@delta10/atlas-sdk 0.1.9 → 0.1.11
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/assets/index-Bl_2ECGV.js +12 -0
- package/dist/assets/index-OirD7Ry3.css +1 -0
- package/dist/index.html +14 -0
- package/package.json +2 -3
- package/dist/Example.vue.d.ts +0 -3
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -9
- package/dist/assets/icons/layers.svg.js +0 -23
- package/dist/assets/icons/map.svg.js +0 -21
- package/dist/assets/icons/minus.svg.js +0 -20
- package/dist/assets/icons/plus.svg.js +0 -20
- package/dist/components/Map.vue.d.ts +0 -96
- package/dist/components/Map.vue.js +0 -7
- package/dist/components/Map.vue2.js +0 -422
- package/dist/components/index.d.ts +0 -1
- package/dist/components/panels/BaseLayers.vue.d.ts +0 -23
- package/dist/components/panels/BaseLayers.vue.js +0 -7
- package/dist/components/panels/BaseLayers.vue2.js +0 -50
- package/dist/components/panels/Layers.vue.d.ts +0 -23
- package/dist/components/panels/Layers.vue.js +0 -7
- package/dist/components/panels/Layers.vue2.js +0 -35
- package/dist/data/demo-data.d.ts +0 -15
- package/dist/index.d.ts +0 -8
- package/dist/index.js +0 -10
- package/dist/main.d.ts +0 -1
- package/dist/style.css +0 -1
- package/dist/utils/projections.d.ts +0 -5
- package/dist/utils/projections.js +0 -8
|
@@ -0,0 +1,12 @@
|
|
|
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 e(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=e(s);fetch(s.href,r)}})();function lu(i){const t=Object.create(null);for(const e of i.split(","))t[e]=1;return e=>e in t}const Ut={},dr=[],$i=()=>{},Ug=()=>!1,Gl=i=>i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&(i.charCodeAt(2)>122||i.charCodeAt(2)<97),hu=i=>i.startsWith("onUpdate:"),ye=Object.assign,cu=(i,t)=>{const e=i.indexOf(t);e>-1&&i.splice(e,1)},g1=Object.prototype.hasOwnProperty,Pt=(i,t)=>g1.call(i,t),ht=Array.isArray,gr=i=>Dl(i)==="[object Map]",Vg=i=>Dl(i)==="[object Set]",dt=i=>typeof i=="function",se=i=>typeof i=="string",Rn=i=>typeof i=="symbol",Xt=i=>i!==null&&typeof i=="object",Xg=i=>(Xt(i)||dt(i))&&dt(i.then)&&dt(i.catch),$g=Object.prototype.toString,Dl=i=>$g.call(i),_1=i=>Dl(i).slice(8,-1),Kg=i=>Dl(i)==="[object Object]",uu=i=>se(i)&&i!=="NaN"&&i[0]!=="-"&&""+parseInt(i,10)===i,go=lu(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Nl=i=>{const t=Object.create(null);return(e=>t[e]||(t[e]=i(e)))},m1=/-\w/g,ns=Nl(i=>i.replace(m1,t=>t.slice(1).toUpperCase())),p1=/\B([A-Z])/g,ks=Nl(i=>i.replace(p1,"-$1").toLowerCase()),Yg=Nl(i=>i.charAt(0).toUpperCase()+i.slice(1)),Eh=Nl(i=>i?`on${Yg(i)}`:""),Zn=(i,t)=>!Object.is(i,t),Sh=(i,...t)=>{for(let e=0;e<i.length;e++)i[e](...t)},qg=(i,t,e,n=!1)=>{Object.defineProperty(i,t,{configurable:!0,enumerable:!1,writable:n,value:e})},y1=i=>{const t=parseFloat(i);return isNaN(t)?i:t},v1=i=>{const t=se(i)?Number(i):NaN;return isNaN(t)?i:t};let Ff;const kl=()=>Ff||(Ff=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function jl(i){if(ht(i)){const t={};for(let e=0;e<i.length;e++){const n=i[e],s=se(n)?M1(n):jl(n);if(s)for(const r in s)t[r]=s[r]}return t}else if(se(i)||Xt(i))return i}const x1=/;(?![^(]*\))/g,E1=/:([^]+)/,S1=/\/\*[^]*?\*\//g;function M1(i){const t={};return i.replace(S1,"").split(x1).forEach(e=>{if(e){const n=e.split(E1);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Po(i){let t="";if(se(i))t=i;else if(ht(i))for(let e=0;e<i.length;e++){const n=Po(i[e]);n&&(t+=n+" ")}else if(Xt(i))for(const e in i)i[e]&&(t+=e+" ");return t.trim()}const w1="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",C1=lu(w1);function Hg(i){return!!i||i===""}const Zg=i=>!!(i&&i.__v_isRef===!0),Bl=i=>se(i)?i:i==null?"":ht(i)||Xt(i)&&(i.toString===$g||!dt(i.toString))?Zg(i)?Bl(i.value):JSON.stringify(i,Jg,2):String(i),Jg=(i,t)=>Zg(t)?Jg(i,t.value):gr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[n,s],r)=>(e[Mh(n,r)+" =>"]=s,e),{})}:Vg(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Mh(e))}:Rn(t)?Mh(t):Xt(t)&&!ht(t)&&!Kg(t)?String(t):t,Mh=(i,t="")=>{var e;return Rn(i)?`Symbol(${(e=i.description)!=null?e:t})`:i};let $e;class T1{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,e;if(this.scopes)for(t=0,e=this.scopes.length;t<e;t++)this.scopes[t].pause();for(t=0,e=this.effects.length;t<e;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,e;if(this.scopes)for(t=0,e=this.scopes.length;t<e;t++)this.scopes[t].resume();for(t=0,e=this.effects.length;t<e;t++)this.effects[t].resume()}}run(t){if(this._active){const e=$e;try{return $e=this,t()}finally{$e=e}}}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 e,n;for(e=0,n=this.effects.length;e<n;e++)this.effects[e].stop();for(this.effects.length=0,e=0,n=this.cleanups.length;e<n;e++)this.cleanups[e]();if(this.cleanups.length=0,this.scopes){for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].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 R1(){return $e}let Wt;const wh=new WeakSet;class Qg{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,wh.has(this)&&(wh.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||e_(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Gf(this),i_(this);const t=Wt,e=Pi;Wt=this,Pi=!0;try{return this.fn()}finally{n_(this),Wt=t,Pi=e,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)gu(t);this.deps=this.depsTail=void 0,Gf(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?wh.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){mc(this)&&this.run()}get dirty(){return mc(this)}}let t_=0,_o,mo;function e_(i,t=!1){if(i.flags|=8,t){i.next=mo,mo=i;return}i.next=_o,_o=i}function fu(){t_++}function du(){if(--t_>0)return;if(mo){let t=mo;for(mo=void 0;t;){const e=t.next;t.next=void 0,t.flags&=-9,t=e}}let i;for(;_o;){let t=_o;for(_o=void 0;t;){const e=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){i||(i=n)}t=e}}if(i)throw i}function i_(i){for(let t=i.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function n_(i){let t,e=i.depsTail,n=e;for(;n;){const s=n.prevDep;n.version===-1?(n===e&&(e=s),gu(n),I1(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=s}i.deps=t,i.depsTail=e}function mc(i){for(let t=i.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(s_(t.dep.computed)||t.dep.version!==t.version))return!0;return!!i._dirty}function s_(i){if(i.flags&4&&!(i.flags&16)||(i.flags&=-17,i.globalVersion===bo)||(i.globalVersion=bo,!i.isSSR&&i.flags&128&&(!i.deps&&!i._dirty||!mc(i))))return;i.flags|=2;const t=i.dep,e=Wt,n=Pi;Wt=i,Pi=!0;try{i_(i);const s=i.fn(i._value);(t.version===0||Zn(s,i._value))&&(i.flags|=128,i._value=s,t.version++)}catch(s){throw t.version++,s}finally{Wt=e,Pi=n,n_(i),i.flags&=-3}}function gu(i,t=!1){const{dep:e,prevSub:n,nextSub:s}=i;if(n&&(n.nextSub=s,i.prevSub=void 0),s&&(s.prevSub=n,i.nextSub=void 0),e.subs===i&&(e.subs=n,!n&&e.computed)){e.computed.flags&=-5;for(let r=e.computed.deps;r;r=r.nextDep)gu(r,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function I1(i){const{prevDep:t,nextDep:e}=i;t&&(t.nextDep=e,i.prevDep=void 0),e&&(e.prevDep=t,i.nextDep=void 0)}let Pi=!0;const r_=[];function Mn(){r_.push(Pi),Pi=!1}function wn(){const i=r_.pop();Pi=i===void 0?!0:i}function Gf(i){const{cleanup:t}=i;if(i.cleanup=void 0,t){const e=Wt;Wt=void 0;try{t()}finally{Wt=e}}}let bo=0;class P1{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class _u{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(!Wt||!Pi||Wt===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==Wt)e=this.activeLink=new P1(Wt,this),Wt.deps?(e.prevDep=Wt.depsTail,Wt.depsTail.nextDep=e,Wt.depsTail=e):Wt.deps=Wt.depsTail=e,o_(e);else if(e.version===-1&&(e.version=this.version,e.nextDep)){const n=e.nextDep;n.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=n),e.prevDep=Wt.depsTail,e.nextDep=void 0,Wt.depsTail.nextDep=e,Wt.depsTail=e,Wt.deps===e&&(Wt.deps=n)}return e}trigger(t){this.version++,bo++,this.notify(t)}notify(t){fu();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{du()}}}function o_(i){if(i.dep.sc++,i.sub.flags&4){const t=i.dep.computed;if(t&&!i.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)o_(n)}const e=i.dep.subs;e!==i&&(i.prevSub=e,e&&(e.nextSub=i)),i.dep.subs=i}}const Ja=new WeakMap,bs=Symbol(""),pc=Symbol(""),Ao=Symbol("");function Le(i,t,e){if(Pi&&Wt){let n=Ja.get(i);n||Ja.set(i,n=new Map);let s=n.get(e);s||(n.set(e,s=new _u),s.map=n,s.key=e),s.track()}}function fn(i,t,e,n,s,r){const o=Ja.get(i);if(!o){bo++;return}const a=l=>{l&&l.trigger()};if(fu(),t==="clear")o.forEach(a);else{const l=ht(i),h=l&&uu(e);if(l&&e==="length"){const c=Number(n);o.forEach((u,f)=>{(f==="length"||f===Ao||!Rn(f)&&f>=c)&&a(u)})}else switch((e!==void 0||o.has(void 0))&&a(o.get(e)),h&&a(o.get(Ao)),t){case"add":l?h&&a(o.get("length")):(a(o.get(bs)),gr(i)&&a(o.get(pc)));break;case"delete":l||(a(o.get(bs)),gr(i)&&a(o.get(pc)));break;case"set":gr(i)&&a(o.get(bs));break}}du()}function b1(i,t){const e=Ja.get(i);return e&&e.get(t)}function Vs(i){const t=wt(i);return t===i?t:(Le(t,"iterate",Ao),vi(i)?t:t.map(Se))}function zl(i){return Le(i=wt(i),"iterate",Ao),i}const A1={__proto__:null,[Symbol.iterator](){return Ch(this,Symbol.iterator,Se)},concat(...i){return Vs(this).concat(...i.map(t=>ht(t)?Vs(t):t))},entries(){return Ch(this,"entries",i=>(i[1]=Se(i[1]),i))},every(i,t){return en(this,"every",i,t,void 0,arguments)},filter(i,t){return en(this,"filter",i,t,e=>e.map(Se),arguments)},find(i,t){return en(this,"find",i,t,Se,arguments)},findIndex(i,t){return en(this,"findIndex",i,t,void 0,arguments)},findLast(i,t){return en(this,"findLast",i,t,Se,arguments)},findLastIndex(i,t){return en(this,"findLastIndex",i,t,void 0,arguments)},forEach(i,t){return en(this,"forEach",i,t,void 0,arguments)},includes(...i){return Th(this,"includes",i)},indexOf(...i){return Th(this,"indexOf",i)},join(i){return Vs(this).join(i)},lastIndexOf(...i){return Th(this,"lastIndexOf",i)},map(i,t){return en(this,"map",i,t,void 0,arguments)},pop(){return qr(this,"pop")},push(...i){return qr(this,"push",i)},reduce(i,...t){return Df(this,"reduce",i,t)},reduceRight(i,...t){return Df(this,"reduceRight",i,t)},shift(){return qr(this,"shift")},some(i,t){return en(this,"some",i,t,void 0,arguments)},splice(...i){return qr(this,"splice",i)},toReversed(){return Vs(this).toReversed()},toSorted(i){return Vs(this).toSorted(i)},toSpliced(...i){return Vs(this).toSpliced(...i)},unshift(...i){return qr(this,"unshift",i)},values(){return Ch(this,"values",Se)}};function Ch(i,t,e){const n=zl(i),s=n[t]();return n!==i&&!vi(i)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.done||(r.value=e(r.value)),r}),s}const L1=Array.prototype;function en(i,t,e,n,s,r){const o=zl(i),a=o!==i&&!vi(i),l=o[t];if(l!==L1[t]){const u=l.apply(i,r);return a?Se(u):u}let h=e;o!==i&&(a?h=function(u,f){return e.call(this,Se(u),f,i)}:e.length>2&&(h=function(u,f){return e.call(this,u,f,i)}));const c=l.call(o,h,n);return a&&s?s(c):c}function Df(i,t,e,n){const s=zl(i);let r=e;return s!==i&&(vi(i)?e.length>3&&(r=function(o,a,l){return e.call(this,o,a,l,i)}):r=function(o,a,l){return e.call(this,o,Se(a),l,i)}),s[t](r,...n)}function Th(i,t,e){const n=wt(i);Le(n,"iterate",Ao);const s=n[t](...e);return(s===-1||s===!1)&&yu(e[0])?(e[0]=wt(e[0]),n[t](...e)):s}function qr(i,t,e=[]){Mn(),fu();const n=wt(i)[t].apply(i,e);return du(),wn(),n}const O1=lu("__proto__,__v_isRef,__isVue"),a_=new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(Rn));function F1(i){Rn(i)||(i=String(i));const t=wt(this);return Le(t,"has",i),t.hasOwnProperty(i)}class l_{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,n){if(e==="__v_skip")return t.__v_skip;const s=this._isReadonly,r=this._isShallow;if(e==="__v_isReactive")return!s;if(e==="__v_isReadonly")return s;if(e==="__v_isShallow")return r;if(e==="__v_raw")return n===(s?r?V1:f_:r?u_:c_).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const o=ht(t);if(!s){let l;if(o&&(l=A1[e]))return l;if(e==="hasOwnProperty")return F1}const a=Reflect.get(t,e,pe(t)?t:n);if((Rn(e)?a_.has(e):O1(e))||(s||Le(t,"get",e),r))return a;if(pe(a)){const l=o&&uu(e)?a:a.value;return s&&Xt(l)?vc(l):l}return Xt(a)?s?vc(a):ta(a):a}}class h_ extends l_{constructor(t=!1){super(!1,t)}set(t,e,n,s){let r=t[e];if(!this._isShallow){const l=ss(r);if(!vi(n)&&!ss(n)&&(r=wt(r),n=wt(n)),!ht(t)&&pe(r)&&!pe(n))return l||(r.value=n),!0}const o=ht(t)&&uu(e)?Number(e)<t.length:Pt(t,e),a=Reflect.set(t,e,n,pe(t)?t:s);return t===wt(s)&&(o?Zn(n,r)&&fn(t,"set",e,n):fn(t,"add",e,n)),a}deleteProperty(t,e){const n=Pt(t,e);t[e];const s=Reflect.deleteProperty(t,e);return s&&n&&fn(t,"delete",e,void 0),s}has(t,e){const n=Reflect.has(t,e);return(!Rn(e)||!a_.has(e))&&Le(t,"has",e),n}ownKeys(t){return Le(t,"iterate",ht(t)?"length":bs),Reflect.ownKeys(t)}}class G1 extends l_{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}}const D1=new h_,N1=new G1,k1=new h_(!0);const yc=i=>i,_a=i=>Reflect.getPrototypeOf(i);function j1(i,t,e){return function(...n){const s=this.__v_raw,r=wt(s),o=gr(r),a=i==="entries"||i===Symbol.iterator&&o,l=i==="keys"&&o,h=s[i](...n),c=e?yc:t?Qa:Se;return!t&&Le(r,"iterate",l?pc:bs),{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 ma(i){return function(...t){return i==="delete"?!1:i==="clear"?void 0:this}}function B1(i,t){const e={get(s){const r=this.__v_raw,o=wt(r),a=wt(s);i||(Zn(s,a)&&Le(o,"get",s),Le(o,"get",a));const{has:l}=_a(o),h=t?yc:i?Qa: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!i&&Le(wt(s),"iterate",bs),s.size},has(s){const r=this.__v_raw,o=wt(r),a=wt(s);return i||(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=wt(a),h=t?yc:i?Qa:Se;return!i&&Le(l,"iterate",bs),a.forEach((c,u)=>s.call(r,h(c),h(u),o))}};return ye(e,i?{add:ma("add"),set:ma("set"),delete:ma("delete"),clear:ma("clear")}:{add(s){!t&&!vi(s)&&!ss(s)&&(s=wt(s));const r=wt(this);return _a(r).has.call(r,s)||(r.add(s),fn(r,"add",s,s)),this},set(s,r){!t&&!vi(r)&&!ss(r)&&(r=wt(r));const o=wt(this),{has:a,get:l}=_a(o);let h=a.call(o,s);h||(s=wt(s),h=a.call(o,s));const c=l.call(o,s);return o.set(s,r),h?Zn(r,c)&&fn(o,"set",s,r):fn(o,"add",s,r),this},delete(s){const r=wt(this),{has:o,get:a}=_a(r);let l=o.call(r,s);l||(s=wt(s),l=o.call(r,s)),a&&a.call(r,s);const h=r.delete(s);return l&&fn(r,"delete",s,void 0),h},clear(){const s=wt(this),r=s.size!==0,o=s.clear();return r&&fn(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{e[s]=j1(s,i,t)}),e}function mu(i,t){const e=B1(i,t);return(n,s,r)=>s==="__v_isReactive"?!i:s==="__v_isReadonly"?i:s==="__v_raw"?n:Reflect.get(Pt(e,s)&&s in n?e:n,s,r)}const z1={get:mu(!1,!1)},W1={get:mu(!1,!0)},U1={get:mu(!0,!1)};const c_=new WeakMap,u_=new WeakMap,f_=new WeakMap,V1=new WeakMap;function X1(i){switch(i){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function $1(i){return i.__v_skip||!Object.isExtensible(i)?0:X1(_1(i))}function ta(i){return ss(i)?i:pu(i,!1,D1,z1,c_)}function K1(i){return pu(i,!1,k1,W1,u_)}function vc(i){return pu(i,!0,N1,U1,f_)}function pu(i,t,e,n,s){if(!Xt(i)||i.__v_raw&&!(t&&i.__v_isReactive))return i;const r=$1(i);if(r===0)return i;const o=s.get(i);if(o)return o;const a=new Proxy(i,r===2?n:e);return s.set(i,a),a}function _r(i){return ss(i)?_r(i.__v_raw):!!(i&&i.__v_isReactive)}function ss(i){return!!(i&&i.__v_isReadonly)}function vi(i){return!!(i&&i.__v_isShallow)}function yu(i){return i?!!i.__v_raw:!1}function wt(i){const t=i&&i.__v_raw;return t?wt(t):i}function Y1(i){return!Pt(i,"__v_skip")&&Object.isExtensible(i)&&qg(i,"__v_skip",!0),i}const Se=i=>Xt(i)?ta(i):i,Qa=i=>Xt(i)?vc(i):i;function pe(i){return i?i.__v_isRef===!0:!1}function Nt(i){return d_(i,!1)}function vu(i){return d_(i,!0)}function d_(i,t){return pe(i)?i:new q1(i,t)}class q1{constructor(t,e){this.dep=new _u,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:wt(t),this._value=e?t:Se(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,n=this.__v_isShallow||vi(t)||ss(t);t=n?t:wt(t),Zn(t,e)&&(this._rawValue=t,this._value=n?t:Se(t),this.dep.trigger())}}function Dt(i){return pe(i)?i.value:i}const H1={get:(i,t,e)=>t==="__v_raw"?i:Dt(Reflect.get(i,t,e)),set:(i,t,e,n)=>{const s=i[t];return pe(s)&&!pe(e)?(s.value=e,!0):Reflect.set(i,t,e,n)}};function g_(i){return _r(i)?i:new Proxy(i,H1)}function Wl(i){const t=ht(i)?new Array(i.length):{};for(const e in i)t[e]=J1(i,e);return t}class Z1{constructor(t,e,n){this._object=t,this._key=e,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 b1(wt(this._object),this._key)}}function J1(i,t,e){const n=i[t];return pe(n)?n:new Z1(i,t,e)}class Q1{constructor(t,e,n){this.fn=t,this.setter=e,this._value=void 0,this.dep=new _u(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=!e,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Wt!==this)return e_(this,!0),!0}get value(){const t=this.dep.track();return s_(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function tp(i,t,e=!1){let n,s;return dt(i)?n=i:(n=i.get,s=i.set),new Q1(n,s,e)}const pa={},tl=new WeakMap;let Es;function ep(i,t=!1,e=Es){if(e){let n=tl.get(e);n||tl.set(e,n=[]),n.push(i)}}function ip(i,t,e=Ut){const{immediate:n,deep:s,once:r,scheduler:o,augmentJob:a,call:l}=e,h=x=>s?x:vi(x)||s===!1||s===0?Un(x,1):Un(x);let c,u,f,d,g=!1,_=!1;if(pe(i)?(u=()=>i.value,g=vi(i)):_r(i)?(u=()=>h(i),g=!0):ht(i)?(_=!0,g=i.some(x=>_r(x)||vi(x)),u=()=>i.map(x=>{if(pe(x))return x.value;if(_r(x))return h(x);if(dt(x))return l?l(x,2):x()})):dt(i)?t?u=l?()=>l(i,2):i:u=()=>{if(f){Mn();try{f()}finally{wn()}}const x=Es;Es=c;try{return l?l(i,3,[d]):i(d)}finally{Es=x}}:u=$i,t&&s){const x=u,S=s===!0?1/0:s;u=()=>Un(x(),S)}const m=R1(),p=()=>{c.stop(),m&&m.active&&cu(m.effects,c)};if(r&&t){const x=t;t=(...S)=>{x(...S),p()}}let y=_?new Array(i.length).fill(pa):pa;const E=x=>{if(!(!(c.flags&1)||!c.dirty&&!x))if(t){const S=c.run();if(s||g||(_?S.some((w,I)=>Zn(w,y[I])):Zn(S,y))){f&&f();const w=Es;Es=c;try{const I=[S,y===pa?void 0:_&&y[0]===pa?[]:y,d];y=S,l?l(t,3,I):t(...I)}finally{Es=w}}}else c.run()};return a&&a(E),c=new Qg(u),c.scheduler=o?()=>o(E,!1):E,d=x=>ep(x,!1,c),f=c.onStop=()=>{const x=tl.get(c);if(x){if(l)l(x,4);else for(const S of x)S();tl.delete(c)}},t?n?E(!0):y=c.run():o?o(E.bind(null,!0),!0):c.run(),p.pause=c.pause.bind(c),p.resume=c.resume.bind(c),p.stop=p,p}function Un(i,t=1/0,e){if(t<=0||!Xt(i)||i.__v_skip||(e=e||new Map,(e.get(i)||0)>=t))return i;if(e.set(i,t),t--,pe(i))Un(i.value,t,e);else if(ht(i))for(let n=0;n<i.length;n++)Un(i[n],t,e);else if(Vg(i)||gr(i))i.forEach(n=>{Un(n,t,e)});else if(Kg(i)){for(const n in i)Un(i[n],t,e);for(const n of Object.getOwnPropertySymbols(i))Object.prototype.propertyIsEnumerable.call(i,n)&&Un(i[n],t,e)}return i}function ea(i,t,e,n){try{return n?i(...n):i()}catch(s){Ul(s,t,e)}}function Oi(i,t,e,n){if(dt(i)){const s=ea(i,t,e,n);return s&&Xg(s)&&s.catch(r=>{Ul(r,t,e)}),s}if(ht(i)){const s=[];for(let r=0;r<i.length;r++)s.push(Oi(i[r],t,e,n));return s}}function Ul(i,t,e,n=!0){const s=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||Ut;if(t){let a=t.parent;const l=t.proxy,h=`https://vuejs.org/error-reference/#runtime-${e}`;for(;a;){const c=a.ec;if(c){for(let u=0;u<c.length;u++)if(c[u](i,l,h)===!1)return}a=a.parent}if(r){Mn(),ea(r,null,10,[i,l,h]),wn();return}}np(i,e,s,n,o)}function np(i,t,e,n=!0,s=!1){if(s)throw i;console.error(i)}const je=[];let Bi=-1;const mr=[];let Bn=null,Qs=0;const __=Promise.resolve();let el=null;function m_(i){const t=el||__;return i?t.then(this?i.bind(this):i):t}function sp(i){let t=Bi+1,e=je.length;for(;t<e;){const n=t+e>>>1,s=je[n],r=Lo(s);r<i||r===i&&s.flags&2?t=n+1:e=n}return t}function xu(i){if(!(i.flags&1)){const t=Lo(i),e=je[je.length-1];!e||!(i.flags&2)&&t>=Lo(e)?je.push(i):je.splice(sp(t),0,i),i.flags|=1,p_()}}function p_(){el||(el=__.then(v_))}function rp(i){ht(i)?mr.push(...i):Bn&&i.id===-1?Bn.splice(Qs+1,0,i):i.flags&1||(mr.push(i),i.flags|=1),p_()}function Nf(i,t,e=Bi+1){for(;e<je.length;e++){const n=je[e];if(n&&n.flags&2){if(i&&n.id!==i.uid)continue;je.splice(e,1),e--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function y_(i){if(mr.length){const t=[...new Set(mr)].sort((e,n)=>Lo(e)-Lo(n));if(mr.length=0,Bn){Bn.push(...t);return}for(Bn=t,Qs=0;Qs<Bn.length;Qs++){const e=Bn[Qs];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}Bn=null,Qs=0}}const Lo=i=>i.id==null?i.flags&2?-1:1/0:i.id;function v_(i){try{for(Bi=0;Bi<je.length;Bi++){const t=je[Bi];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),ea(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Bi<je.length;Bi++){const t=je[Bi];t&&(t.flags&=-2)}Bi=-1,je.length=0,y_(),el=null,(je.length||mr.length)&&v_()}}let Je=null,x_=null;function il(i){const t=Je;return Je=i,x_=i&&i.type.__scopeId||null,t}function ji(i,t=Je,e){if(!t||i._n)return i;const n=(...s)=>{n._d&&ol(-1);const r=il(t);let o;try{o=i(...s)}finally{il(r),n._d&&ol(1)}return o};return n._n=!0,n._c=!0,n._d=!0,n}function _s(i,t,e,n){const s=i.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&&(Mn(),Oi(l,e,8,[i.el,a,i,t]),wn())}}const op=Symbol("_vte"),E_=i=>i.__isTeleport,cn=Symbol("_leaveCb"),ya=Symbol("_enterCb");function ap(){const i={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ei(()=>{i.isMounted=!0}),Eu(()=>{i.isUnmounting=!0}),i}const di=[Function,Array],S_={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},M_=i=>{const t=i.subTree;return t.component?M_(t.component):t},lp={name:"BaseTransition",props:S_,setup(i,{slots:t}){const e=Yl(),n=ap();return()=>{const s=t.default&&T_(t.default(),!0);if(!s||!s.length)return;const r=w_(s),o=wt(i),{mode:a}=o;if(n.isLeaving)return Rh(r);const l=kf(r);if(!l)return Rh(r);let h=xc(l,o,n,e,u=>h=u);l.type!==Oe&&Oo(l,h);let c=e.subTree&&kf(e.subTree);if(c&&c.type!==Oe&&!ws(c,l)&&M_(e).type!==Oe){let u=xc(c,o,n,e);if(Oo(c,u),a==="out-in"&&l.type!==Oe)return n.isLeaving=!0,u.afterLeave=()=>{n.isLeaving=!1,e.job.flags&8||e.update(),delete u.afterLeave,c=void 0},Rh(r);a==="in-out"&&l.type!==Oe?u.delayLeave=(f,d,g)=>{const _=C_(n,c);_[String(c.key)]=c,f[cn]=()=>{d(),f[cn]=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 w_(i){let t=i[0];if(i.length>1){for(const e of i)if(e.type!==Oe){t=e;break}}return t}const hp=lp;function C_(i,t){const{leavingVNodes:e}=i;let n=e.get(t.type);return n||(n=Object.create(null),e.set(t.type,n)),n}function xc(i,t,e,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:E}=t,x=String(i.key),S=C_(e,i),w=(C,N)=>{C&&Oi(C,n,9,N)},I=(C,N)=>{const z=N[1];w(C,N),ht(C)?C.every(b=>b.length<=1)&&z():C.length<=1&&z()},P={mode:o,persisted:a,beforeEnter(C){let N=l;if(!e.isMounted)if(r)N=m||l;else return;C[cn]&&C[cn](!0);const z=S[x];z&&ws(i,z)&&z.el[cn]&&z.el[cn](),w(N,[C])},enter(C){let N=h,z=c,b=u;if(!e.isMounted)if(r)N=p||h,z=y||c,b=E||u;else return;let A=!1;const W=C[ya]=Q=>{A||(A=!0,Q?w(b,[C]):w(z,[C]),P.delayedLeave&&P.delayedLeave(),C[ya]=void 0)};N?I(N,[C,W]):W()},leave(C,N){const z=String(i.key);if(C[ya]&&C[ya](!0),e.isUnmounting)return N();w(f,[C]);let b=!1;const A=C[cn]=W=>{b||(b=!0,N(),W?w(_,[C]):w(g,[C]),C[cn]=void 0,S[z]===i&&delete S[z])};S[z]=i,d?I(d,[C,A]):A()},clone(C){const N=xc(C,t,e,n,s);return s&&s(N),N}};return P}function Rh(i){if(Vl(i))return i=rs(i),i.children=null,i}function kf(i){if(!Vl(i))return E_(i.type)&&i.children?w_(i.children):i;if(i.component)return i.component.subTree;const{shapeFlag:t,children:e}=i;if(e){if(t&16)return e[0];if(t&32&&dt(e.default))return e.default()}}function Oo(i,t){i.shapeFlag&6&&i.component?(i.transition=t,Oo(i.component.subTree,t)):i.shapeFlag&128?(i.ssContent.transition=t.clone(i.ssContent),i.ssFallback.transition=t.clone(i.ssFallback)):i.transition=t}function T_(i,t=!1,e){let n=[],s=0;for(let r=0;r<i.length;r++){let o=i[r];const a=e==null?o.key:String(e)+String(o.key!=null?o.key:r);o.type===ge?(o.patchFlag&128&&s++,n=n.concat(T_(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 le(i,t){return dt(i)?ye({name:i.name},t,{setup:i}):i}function R_(i){i.ids=[i.ids[0]+i.ids[2]+++"-",0,0]}const nl=new WeakMap;function po(i,t,e,n,s=!1){if(ht(i)){i.forEach((g,_)=>po(g,t&&(ht(t)?t[_]:t),e,n,s));return}if(pr(n)&&!s){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&po(i,t,e,n.component.subTree);return}const r=n.shapeFlag&4?Tu(n.component):n.el,o=s?null:r,{i:a,r:l}=i,h=t&&t.r,c=a.refs===Ut?a.refs={}:a.refs,u=a.setupState,f=wt(u),d=u===Ut?Ug:g=>Pt(f,g);if(h!=null&&h!==l){if(jf(t),se(h))c[h]=null,d(h)&&(u[h]=null);else if(pe(h)){h.value=null;const g=t;g.k&&(c[g.k]=null)}}if(dt(l))ea(l,a,12,[o,c]);else{const g=se(l),_=pe(l);if(g||_){const m=()=>{if(i.f){const p=g?d(l)?u[l]:c[l]:l.value;if(s)ht(p)&&cu(p,r);else if(ht(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,i.k&&(c[i.k]=y)}}else g?(c[l]=o,d(l)&&(u[l]=o)):_&&(l.value=o,i.k&&(c[i.k]=o))};if(o){const p=()=>{m(),nl.delete(i)};p.id=-1,nl.set(i,p),ri(p,e)}else jf(i),m()}}}function jf(i){const t=nl.get(i);t&&(t.flags|=8,nl.delete(i))}kl().requestIdleCallback;kl().cancelIdleCallback;const pr=i=>!!i.type.__asyncLoader,Vl=i=>i.type.__isKeepAlive;function cp(i,t){I_(i,"a",t)}function up(i,t){I_(i,"da",t)}function I_(i,t,e=ze){const n=i.__wdc||(i.__wdc=()=>{let s=e;for(;s;){if(s.isDeactivated)return;s=s.parent}return i()});if(Xl(t,n,e),e){let s=e.parent;for(;s&&s.parent;)Vl(s.parent.vnode)&&fp(n,t,e,s),s=s.parent}}function fp(i,t,e,n){const s=Xl(t,i,n,!0);wi(()=>{cu(n[t],s)},e)}function Xl(i,t,e=ze,n=!1){if(e){const s=e[i]||(e[i]=[]),r=t.__weh||(t.__weh=(...o)=>{Mn();const a=ia(e),l=Oi(t,e,i,o);return a(),wn(),l});return n?s.unshift(r):s.push(r),r}}const In=i=>(t,e=ze)=>{(!Do||i==="sp")&&Xl(i,(...n)=>t(...n),e)},dp=In("bm"),ei=In("m"),gp=In("bu"),_p=In("u"),Eu=In("bum"),wi=In("um"),mp=In("sp"),pp=In("rtg"),yp=In("rtc");function vp(i,t=ze){Xl("ec",i,t)}const xp=Symbol.for("v-ndc");function sl(i,t,e,n){let s;const r=e,o=ht(i);if(o||se(i)){const a=o&&_r(i);let l=!1,h=!1;a&&(l=!vi(i),h=ss(i),i=zl(i)),s=new Array(i.length);for(let c=0,u=i.length;c<u;c++)s[c]=t(l?h?Qa(Se(i[c])):Se(i[c]):i[c],c,void 0,r)}else if(typeof i=="number"){s=new Array(i);for(let a=0;a<i;a++)s[a]=t(a+1,a,void 0,r)}else if(Xt(i))if(i[Symbol.iterator])s=Array.from(i,(a,l)=>t(a,l,void 0,r));else{const a=Object.keys(i);s=new Array(a.length);for(let l=0,h=a.length;l<h;l++){const c=a[l];s[l]=t(i[c],c,l,r)}}else s=[];return s}function Hi(i,t,e={},n,s){if(Je.ce||Je.parent&&pr(Je.parent)&&Je.parent.ce){const h=Object.keys(e).length>0;return _t(),Re(ge,null,[kt("slot",e,n)],h?-2:64)}let r=i[t];r&&r._c&&(r._d=!1),_t();const o=r&&P_(r(e)),a=e.key||o&&o.key,l=Re(ge,{key:(a&&!Rn(a)?a:`_${t}`)+(!o&&n?"_fb":"")},o||[],o&&i._===1?64:-2);return l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),r&&r._c&&(r._d=!0),l}function P_(i){return i.some(t=>Go(t)?!(t.type===Oe||t.type===ge&&!P_(t.children)):!0)?i:null}const Ec=i=>i?H_(i)?Tu(i):Ec(i.parent):null,yo=ye(Object.create(null),{$:i=>i,$el:i=>i.vnode.el,$data:i=>i.data,$props:i=>i.props,$attrs:i=>i.attrs,$slots:i=>i.slots,$refs:i=>i.refs,$parent:i=>Ec(i.parent),$root:i=>Ec(i.root),$host:i=>i.ce,$emit:i=>i.emit,$options:i=>L_(i),$forceUpdate:i=>i.f||(i.f=()=>{xu(i.update)}),$nextTick:i=>i.n||(i.n=m_.bind(i.proxy)),$watch:i=>Wp.bind(i)}),Ih=(i,t)=>i!==Ut&&!i.__isScriptSetup&&Pt(i,t),Ep={get({_:i},t){if(t==="__v_skip")return!0;const{ctx:e,setupState:n,data:s,props:r,accessCache:o,type:a,appContext:l}=i;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 e[t];case 3:return r[t]}else{if(Ih(n,t))return o[t]=1,n[t];if(s!==Ut&&Pt(s,t))return o[t]=2,s[t];if((h=i.propsOptions[0])&&Pt(h,t))return o[t]=3,r[t];if(e!==Ut&&Pt(e,t))return o[t]=4,e[t];Mc&&(o[t]=0)}}const c=yo[t];let u,f;if(c)return t==="$attrs"&&Le(i.attrs,"get",""),c(i);if((u=a.__cssModules)&&(u=u[t]))return u;if(e!==Ut&&Pt(e,t))return o[t]=4,e[t];if(f=l.config.globalProperties,Pt(f,t))return f[t]},set({_:i},t,e){const{data:n,setupState:s,ctx:r}=i;return Ih(s,t)?(s[t]=e,!0):n!==Ut&&Pt(n,t)?(n[t]=e,!0):Pt(i.props,t)||t[0]==="$"&&t.slice(1)in i?!1:(r[t]=e,!0)},has({_:{data:i,setupState:t,accessCache:e,ctx:n,appContext:s,propsOptions:r,type:o}},a){let l,h;return!!(e[a]||i!==Ut&&a[0]!=="$"&&Pt(i,a)||Ih(t,a)||(l=r[0])&&Pt(l,a)||Pt(n,a)||Pt(yo,a)||Pt(s.config.globalProperties,a)||(h=o.__cssModules)&&h[a])},defineProperty(i,t,e){return e.get!=null?i._.accessCache[t]=0:Pt(e,"value")&&this.set(i,t,e.value,null),Reflect.defineProperty(i,t,e)}};function Sc(i){return ht(i)?i.reduce((t,e)=>(t[e]=null,t),{}):i}function b_(i,t){const e=Sc(i);for(const n in t){if(n.startsWith("__skip"))continue;let s=e[n];s?ht(s)||dt(s)?s=e[n]={type:s,default:t[n]}:s.default=t[n]:s===null&&(s=e[n]={default:t[n]}),s&&t[`__skip_${n}`]&&(s.skipFactory=!0)}return e}let Mc=!0;function Sp(i){const t=L_(i),e=i.proxy,n=i.ctx;Mc=!1,t.beforeCreate&&Bf(t.beforeCreate,i,"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:E,unmounted:x,render:S,renderTracked:w,renderTriggered:I,errorCaptured:P,serverPrefetch:C,expose:N,inheritAttrs:z,components:b,directives:A,filters:W}=t;if(h&&Mp(h,n,null),o)for(const Y in o){const K=o[Y];dt(K)&&(n[Y]=K.bind(e))}if(s){const Y=s.call(e,e);Xt(Y)&&(i.data=ta(Y))}if(Mc=!0,r)for(const Y in r){const K=r[Y],ot=dt(K)?K.bind(e,e):dt(K.get)?K.get.bind(e,e):$i,ft=!dt(K)&&dt(K.set)?K.set.bind(e):$i,pt=ae({get:ot,set:ft});Object.defineProperty(n,Y,{enumerable:!0,configurable:!0,get:()=>pt.value,set:j=>pt.value=j})}if(a)for(const Y in a)A_(a[Y],n,e,Y);if(l){const Y=dt(l)?l.call(e):l;Reflect.ownKeys(Y).forEach(K=>{Mi(K,Y[K])})}c&&Bf(c,i,"c");function q(Y,K){ht(K)?K.forEach(ot=>Y(ot.bind(e))):K&&Y(K.bind(e))}if(q(dp,u),q(ei,f),q(gp,d),q(_p,g),q(cp,_),q(up,m),q(vp,P),q(yp,w),q(pp,I),q(Eu,y),q(wi,x),q(mp,C),ht(N))if(N.length){const Y=i.exposed||(i.exposed={});N.forEach(K=>{Object.defineProperty(Y,K,{get:()=>e[K],set:ot=>e[K]=ot,enumerable:!0})})}else i.exposed||(i.exposed={});S&&i.render===$i&&(i.render=S),z!=null&&(i.inheritAttrs=z),b&&(i.components=b),A&&(i.directives=A),C&&R_(i)}function Mp(i,t,e=$i){ht(i)&&(i=wc(i));for(const n in i){const s=i[n];let r;Xt(s)?"default"in s?r=Bt(s.from||n,s.default,!0):r=Bt(s.from||n):r=Bt(s),pe(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):t[n]=r}}function Bf(i,t,e){Oi(ht(i)?i.map(n=>n.bind(t.proxy)):i.bind(t.proxy),t,e)}function A_(i,t,e,n){let s=n.includes(".")?V_(e,n):()=>e[n];if(se(i)){const r=t[i];dt(r)&&ne(s,r)}else if(dt(i))ne(s,i.bind(e));else if(Xt(i))if(ht(i))i.forEach(r=>A_(r,t,e,n));else{const r=dt(i.handler)?i.handler.bind(e):t[i.handler];dt(r)&&ne(s,r,i)}}function L_(i){const t=i.type,{mixins:e,extends:n}=t,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=i.appContext,a=r.get(t);let l;return a?l=a:!s.length&&!e&&!n?l=t:(l={},s.length&&s.forEach(h=>rl(l,h,o,!0)),rl(l,t,o)),Xt(t)&&r.set(t,l),l}function rl(i,t,e,n=!1){const{mixins:s,extends:r}=t;r&&rl(i,r,e,!0),s&&s.forEach(o=>rl(i,o,e,!0));for(const o in t)if(!(n&&o==="expose")){const a=wp[o]||e&&e[o];i[o]=a?a(i[o],t[o]):t[o]}return i}const wp={data:zf,props:Wf,emits:Wf,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:Tp,provide:zf,inject:Cp};function zf(i,t){return t?i?function(){return ye(dt(i)?i.call(this,this):i,dt(t)?t.call(this,this):t)}:t:i}function Cp(i,t){return no(wc(i),wc(t))}function wc(i){if(ht(i)){const t={};for(let e=0;e<i.length;e++)t[i[e]]=i[e];return t}return i}function De(i,t){return i?[...new Set([].concat(i,t))]:t}function no(i,t){return i?ye(Object.create(null),i,t):t}function Wf(i,t){return i?ht(i)&&ht(t)?[...new Set([...i,...t])]:ye(Object.create(null),Sc(i),Sc(t??{})):t}function Tp(i,t){if(!i)return t;if(!t)return i;const e=ye(Object.create(null),i);for(const n in t)e[n]=De(i[n],t[n]);return e}function O_(){return{app:null,config:{isNativeTag:Ug,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 Rp=0;function Ip(i,t){return function(n,s=null){dt(n)||(n=ye({},n)),s!=null&&!Xt(s)&&(s=null);const r=O_(),o=new WeakSet,a=[];let l=!1;const h=r.app={_uid:Rp++,_component:n,_props:s,_container:null,_context:r,_instance:null,version:cy,get config(){return r.config},set config(c){},use(c,...u){return o.has(c)||(c&&dt(c.install)?(o.add(c),c.install(h,...u)):dt(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||kt(n,s);return d.appContext=r,f===!0?f="svg":f===!1&&(f=void 0),i(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),i(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(i,t){if(ze){let e=ze.provides;const n=ze.parent&&ze.parent.provides;n===e&&(e=ze.provides=Object.create(n)),e[i]=t}}function Bt(i,t,e=!1){const n=Yl();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&&i in s)return s[i];if(arguments.length>1)return e&&dt(t)?t.call(n&&n.proxy):t}}const F_={},G_=()=>Object.create(F_),D_=i=>Object.getPrototypeOf(i)===F_;function Pp(i,t,e,n=!1){const s={},r=G_();i.propsDefaults=Object.create(null),N_(i,t,s,r);for(const o in i.propsOptions[0])o in s||(s[o]=void 0);e?i.props=n?s:K1(s):i.type.props?i.props=s:i.props=r,i.attrs=r}function bp(i,t,e,n){const{props:s,attrs:r,vnode:{patchFlag:o}}=i,a=wt(s),[l]=i.propsOptions;let h=!1;if((n||o>0)&&!(o&16)){if(o&8){const c=i.vnode.dynamicProps;for(let u=0;u<c.length;u++){let f=c[u];if($l(i.emitsOptions,f))continue;const d=t[f];if(l)if(Pt(r,f))d!==r[f]&&(r[f]=d,h=!0);else{const g=ns(f);s[g]=Cc(l,a,g,d,i,!1)}else d!==r[f]&&(r[f]=d,h=!0)}}}else{N_(i,t,s,r)&&(h=!0);let c;for(const u in a)(!t||!Pt(t,u)&&((c=ks(u))===u||!Pt(t,c)))&&(l?e&&(e[u]!==void 0||e[c]!==void 0)&&(s[u]=Cc(l,a,u,void 0,i,!0)):delete s[u]);if(r!==a)for(const u in r)(!t||!Pt(t,u))&&(delete r[u],h=!0)}h&&fn(i.attrs,"set","")}function N_(i,t,e,n){const[s,r]=i.propsOptions;let o=!1,a;if(t)for(let l in t){if(go(l))continue;const h=t[l];let c;s&&Pt(s,c=ns(l))?!r||!r.includes(c)?e[c]=h:(a||(a={}))[c]=h:$l(i.emitsOptions,l)||(!(l in n)||h!==n[l])&&(n[l]=h,o=!0)}if(r){const l=wt(e),h=a||Ut;for(let c=0;c<r.length;c++){const u=r[c];e[u]=Cc(s,l,u,h[u],i,!Pt(h,u))}}return o}function Cc(i,t,e,n,s,r){const o=i[e];if(o!=null){const a=Pt(o,"default");if(a&&n===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&dt(l)){const{propsDefaults:h}=s;if(e in h)n=h[e];else{const c=ia(s);n=h[e]=l.call(null,t),c()}}else n=l;s.ce&&s.ce._setProp(e,n)}o[0]&&(r&&!a?n=!1:o[1]&&(n===""||n===ks(e))&&(n=!0))}return n}const Ap=new WeakMap;function k_(i,t,e=!1){const n=e?Ap:t.propsCache,s=n.get(i);if(s)return s;const r=i.props,o={},a=[];let l=!1;if(!dt(i)){const c=u=>{l=!0;const[f,d]=k_(u,t,!0);ye(o,f),d&&a.push(...d)};!e&&t.mixins.length&&t.mixins.forEach(c),i.extends&&c(i.extends),i.mixins&&i.mixins.forEach(c)}if(!r&&!l)return Xt(i)&&n.set(i,dr),dr;if(ht(r))for(let c=0;c<r.length;c++){const u=ns(r[c]);Uf(u)&&(o[u]=Ut)}else if(r)for(const c in r){const u=ns(c);if(Uf(u)){const f=r[c],d=o[u]=ht(f)||dt(f)?{type:f}:ye({},f),g=d.type;let _=!1,m=!0;if(ht(g))for(let p=0;p<g.length;++p){const y=g[p],E=dt(y)&&y.name;if(E==="Boolean"){_=!0;break}else E==="String"&&(m=!1)}else _=dt(g)&&g.name==="Boolean";d[0]=_,d[1]=m,(_||Pt(d,"default"))&&a.push(u)}}const h=[o,a];return Xt(i)&&n.set(i,h),h}function Uf(i){return i[0]!=="$"&&!go(i)}const Su=i=>i==="_"||i==="_ctx"||i==="$stable",Mu=i=>ht(i)?i.map(zi):[zi(i)],Lp=(i,t,e)=>{if(t._n)return t;const n=ji((...s)=>Mu(t(...s)),e);return n._c=!1,n},j_=(i,t,e)=>{const n=i._ctx;for(const s in i){if(Su(s))continue;const r=i[s];if(dt(r))t[s]=Lp(s,r,n);else if(r!=null){const o=Mu(r);t[s]=()=>o}}},B_=(i,t)=>{const e=Mu(t);i.slots.default=()=>e},z_=(i,t,e)=>{for(const n in t)(e||!Su(n))&&(i[n]=t[n])},Op=(i,t,e)=>{const n=i.slots=G_();if(i.vnode.shapeFlag&32){const s=t._;s?(z_(n,t,e),e&&qg(n,"_",s,!0)):j_(t,n)}else t&&B_(i,t)},Fp=(i,t,e)=>{const{vnode:n,slots:s}=i;let r=!0,o=Ut;if(n.shapeFlag&32){const a=t._;a?e&&a===1?r=!1:z_(s,t,e):(r=!t.$stable,j_(t,s)),o=t}else t&&(B_(i,t),o={default:1});if(r)for(const a in s)!Su(a)&&o[a]==null&&delete s[a]},ri=Hp;function Gp(i){return Dp(i)}function Dp(i,t){const e=kl();e.__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=$i,insertStaticContent:g}=i,_=(v,M,T,G=null,L=null,O=null,U=void 0,X=null,V=!!M.dynamicChildren)=>{if(v===M)return;v&&!ws(v,M)&&(G=qt(v),j(v,L,O,!0),v=null),M.patchFlag===-2&&(V=!1,M.dynamicChildren=null);const{type:k,ref:et,shapeFlag:$}=M;switch(k){case Kl:m(v,M,T,G);break;case Oe:p(v,M,T,G);break;case bh:v==null&&y(M,T,G,U);break;case ge:b(v,M,T,G,L,O,U,X,V);break;default:$&1?S(v,M,T,G,L,O,U,X,V):$&6?A(v,M,T,G,L,O,U,X,V):($&64||$&128)&&k.process(v,M,T,G,L,O,U,X,V,D)}et!=null&&L?po(et,v&&v.ref,O,M||v,!M):et==null&&v&&v.ref!=null&&po(v.ref,null,O,v,!0)},m=(v,M,T,G)=>{if(v==null)n(M.el=a(M.children),T,G);else{const L=M.el=v.el;M.children!==v.children&&h(L,M.children)}},p=(v,M,T,G)=>{v==null?n(M.el=l(M.children||""),T,G):M.el=v.el},y=(v,M,T,G)=>{[v.el,v.anchor]=g(v.children,M,T,G,v.el,v.anchor)},E=({el:v,anchor:M},T,G)=>{let L;for(;v&&v!==M;)L=f(v),n(v,T,G),v=L;n(M,T,G)},x=({el:v,anchor:M})=>{let T;for(;v&&v!==M;)T=f(v),s(v),v=T;s(M)},S=(v,M,T,G,L,O,U,X,V)=>{if(M.type==="svg"?U="svg":M.type==="math"&&(U="mathml"),v==null)w(M,T,G,L,O,U,X,V);else{const k=v.el&&v.el._isVueCE?v.el:null;try{k&&k._beginPatch(),C(v,M,L,O,U,X,V)}finally{k&&k._endPatch()}}},w=(v,M,T,G,L,O,U,X)=>{let V,k;const{props:et,shapeFlag:$,transition:it,dirs:at}=v;if(V=v.el=o(v.type,O,et&&et.is,et),$&8?c(V,v.children):$&16&&P(v.children,V,null,G,L,Ph(v,O),U,X),at&&_s(v,null,G,"created"),I(V,v,v.scopeId,U,G),et){for(const Ct in et)Ct!=="value"&&!go(Ct)&&r(V,Ct,null,et[Ct],O,G);"value"in et&&r(V,"value",null,et.value,O),(k=et.onVnodeBeforeMount)&&ki(k,G,v)}at&&_s(v,null,G,"beforeMount");const yt=Np(L,it);yt&&it.beforeEnter(V),n(V,M,T),((k=et&&et.onVnodeMounted)||yt||at)&&ri(()=>{k&&ki(k,G,v),yt&&it.enter(V),at&&_s(v,null,G,"mounted")},L)},I=(v,M,T,G,L)=>{if(T&&d(v,T),G)for(let O=0;O<G.length;O++)d(v,G[O]);if(L){let O=L.subTree;if(M===O||$_(O.type)&&(O.ssContent===M||O.ssFallback===M)){const U=L.vnode;I(v,U,U.scopeId,U.slotScopeIds,L.parent)}}},P=(v,M,T,G,L,O,U,X,V=0)=>{for(let k=V;k<v.length;k++){const et=v[k]=X?zn(v[k]):zi(v[k]);_(null,et,M,T,G,L,O,U,X)}},C=(v,M,T,G,L,O,U)=>{const X=M.el=v.el;let{patchFlag:V,dynamicChildren:k,dirs:et}=M;V|=v.patchFlag&16;const $=v.props||Ut,it=M.props||Ut;let at;if(T&&ms(T,!1),(at=it.onVnodeBeforeUpdate)&&ki(at,T,M,v),et&&_s(M,v,T,"beforeUpdate"),T&&ms(T,!0),($.innerHTML&&it.innerHTML==null||$.textContent&&it.textContent==null)&&c(X,""),k?N(v.dynamicChildren,k,X,T,G,Ph(M,L),O):U||K(v,M,X,null,T,G,Ph(M,L),O,!1),V>0){if(V&16)z(X,$,it,T,L);else if(V&2&&$.class!==it.class&&r(X,"class",null,it.class,L),V&4&&r(X,"style",$.style,it.style,L),V&8){const yt=M.dynamicProps;for(let Ct=0;Ct<yt.length;Ct++){const Tt=yt[Ct],ve=$[Tt],xe=it[Tt];(xe!==ve||Tt==="value")&&r(X,Tt,ve,xe,L,T)}}V&1&&v.children!==M.children&&c(X,M.children)}else!U&&k==null&&z(X,$,it,T,L);((at=it.onVnodeUpdated)||et)&&ri(()=>{at&&ki(at,T,M,v),et&&_s(M,v,T,"updated")},G)},N=(v,M,T,G,L,O,U)=>{for(let X=0;X<M.length;X++){const V=v[X],k=M[X],et=V.el&&(V.type===ge||!ws(V,k)||V.shapeFlag&198)?u(V.el):T;_(V,k,et,null,G,L,O,U,!0)}},z=(v,M,T,G,L)=>{if(M!==T){if(M!==Ut)for(const O in M)!go(O)&&!(O in T)&&r(v,O,M[O],null,L,G);for(const O in T){if(go(O))continue;const U=T[O],X=M[O];U!==X&&O!=="value"&&r(v,O,X,U,L,G)}"value"in T&&r(v,"value",M.value,T.value,L)}},b=(v,M,T,G,L,O,U,X,V)=>{const k=M.el=v?v.el:a(""),et=M.anchor=v?v.anchor:a("");let{patchFlag:$,dynamicChildren:it,slotScopeIds:at}=M;at&&(X=X?X.concat(at):at),v==null?(n(k,T,G),n(et,T,G),P(M.children||[],T,et,L,O,U,X,V)):$>0&&$&64&&it&&v.dynamicChildren?(N(v.dynamicChildren,it,T,L,O,U,X),(M.key!=null||L&&M===L.subTree)&&W_(v,M,!0)):K(v,M,T,et,L,O,U,X,V)},A=(v,M,T,G,L,O,U,X,V)=>{M.slotScopeIds=X,v==null?M.shapeFlag&512?L.ctx.activate(M,T,G,U,V):W(M,T,G,L,O,U,V):Q(v,M,V)},W=(v,M,T,G,L,O,U)=>{const X=v.component=ny(v,G,L);if(Vl(v)&&(X.ctx.renderer=D),sy(X,!1,U),X.asyncDep){if(L&&L.registerDep(X,q,U),!v.el){const V=X.subTree=kt(Oe);p(null,V,M,T),v.placeholder=V.el}}else q(X,v,M,T,L,O,U)},Q=(v,M,T)=>{const G=M.component=v.component;if(Yp(v,M,T))if(G.asyncDep&&!G.asyncResolved){Y(G,M,T);return}else G.next=M,G.update();else M.el=v.el,G.vnode=M},q=(v,M,T,G,L,O,U)=>{const X=()=>{if(v.isMounted){let{next:$,bu:it,u:at,parent:yt,vnode:Ct}=v;{const hi=U_(v);if(hi){$&&($.el=Ct.el,Y(v,$,U)),hi.asyncDep.then(()=>{v.isUnmounted||X()});return}}let Tt=$,ve;ms(v,!1),$?($.el=Ct.el,Y(v,$,U)):$=Ct,it&&Sh(it),(ve=$.props&&$.props.onVnodeBeforeUpdate)&&ki(ve,yt,$,Ct),ms(v,!0);const xe=Xf(v),Ue=v.subTree;v.subTree=xe,_(Ue,xe,u(Ue.el),qt(Ue),v,L,O),$.el=xe.el,Tt===null&&qp(v,xe.el),at&&ri(at,L),(ve=$.props&&$.props.onVnodeUpdated)&&ri(()=>ki(ve,yt,$,Ct),L)}else{let $;const{el:it,props:at}=M,{bm:yt,m:Ct,parent:Tt,root:ve,type:xe}=v,Ue=pr(M);ms(v,!1),yt&&Sh(yt),!Ue&&($=at&&at.onVnodeBeforeMount)&&ki($,Tt,M),ms(v,!0);{ve.ce&&ve.ce._def.shadowRoot!==!1&&ve.ce._injectChildStyle(xe);const hi=v.subTree=Xf(v);_(null,hi,T,G,v,L,O),M.el=hi.el}if(Ct&&ri(Ct,L),!Ue&&($=at&&at.onVnodeMounted)){const hi=M;ri(()=>ki($,Tt,hi),L)}(M.shapeFlag&256||Tt&&pr(Tt.vnode)&&Tt.vnode.shapeFlag&256)&&v.a&&ri(v.a,L),v.isMounted=!0,M=T=G=null}};v.scope.on();const V=v.effect=new Qg(X);v.scope.off();const k=v.update=V.run.bind(V),et=v.job=V.runIfDirty.bind(V);et.i=v,et.id=v.uid,V.scheduler=()=>xu(et),ms(v,!0),k()},Y=(v,M,T)=>{M.component=v;const G=v.vnode.props;v.vnode=M,v.next=null,bp(v,M.props,G,T),Fp(v,M.children,T),Mn(),Nf(v),wn()},K=(v,M,T,G,L,O,U,X,V=!1)=>{const k=v&&v.children,et=v?v.shapeFlag:0,$=M.children,{patchFlag:it,shapeFlag:at}=M;if(it>0){if(it&128){ft(k,$,T,G,L,O,U,X,V);return}else if(it&256){ot(k,$,T,G,L,O,U,X,V);return}}at&8?(et&16&&Jt(k,L,O),$!==k&&c(T,$)):et&16?at&16?ft(k,$,T,G,L,O,U,X,V):Jt(k,L,O,!0):(et&8&&c(T,""),at&16&&P($,T,G,L,O,U,X,V))},ot=(v,M,T,G,L,O,U,X,V)=>{v=v||dr,M=M||dr;const k=v.length,et=M.length,$=Math.min(k,et);let it;for(it=0;it<$;it++){const at=M[it]=V?zn(M[it]):zi(M[it]);_(v[it],at,T,null,L,O,U,X,V)}k>et?Jt(v,L,O,!0,!1,$):P(M,T,G,L,O,U,X,V,$)},ft=(v,M,T,G,L,O,U,X,V)=>{let k=0;const et=M.length;let $=v.length-1,it=et-1;for(;k<=$&&k<=it;){const at=v[k],yt=M[k]=V?zn(M[k]):zi(M[k]);if(ws(at,yt))_(at,yt,T,null,L,O,U,X,V);else break;k++}for(;k<=$&&k<=it;){const at=v[$],yt=M[it]=V?zn(M[it]):zi(M[it]);if(ws(at,yt))_(at,yt,T,null,L,O,U,X,V);else break;$--,it--}if(k>$){if(k<=it){const at=it+1,yt=at<et?M[at].el:G;for(;k<=it;)_(null,M[k]=V?zn(M[k]):zi(M[k]),T,yt,L,O,U,X,V),k++}}else if(k>it)for(;k<=$;)j(v[k],L,O,!0),k++;else{const at=k,yt=k,Ct=new Map;for(k=yt;k<=it;k++){const Ce=M[k]=V?zn(M[k]):zi(M[k]);Ce.key!=null&&Ct.set(Ce.key,k)}let Tt,ve=0;const xe=it-yt+1;let Ue=!1,hi=0;const ds=new Array(xe);for(k=0;k<xe;k++)ds[k]=0;for(k=at;k<=$;k++){const Ce=v[k];if(ve>=xe){j(Ce,L,O,!0);continue}let Ve;if(Ce.key!=null)Ve=Ct.get(Ce.key);else for(Tt=yt;Tt<=it;Tt++)if(ds[Tt-yt]===0&&ws(Ce,M[Tt])){Ve=Tt;break}Ve===void 0?j(Ce,L,O,!0):(ds[Ve-yt]=k+1,Ve>=hi?hi=Ve:Ue=!0,_(Ce,M[Ve],T,null,L,O,U,X,V),ve++)}const Vr=Ue?kp(ds):dr;for(Tt=Vr.length-1,k=xe-1;k>=0;k--){const Ce=yt+k,Ve=M[Ce],Xr=M[Ce+1],ga=Ce+1<et?Xr.el||Xr.placeholder:G;ds[k]===0?_(null,Ve,T,ga,L,O,U,X,V):Ue&&(Tt<0||k!==Vr[Tt]?pt(Ve,T,ga,2):Tt--)}}},pt=(v,M,T,G,L=null)=>{const{el:O,type:U,transition:X,children:V,shapeFlag:k}=v;if(k&6){pt(v.component.subTree,M,T,G);return}if(k&128){v.suspense.move(M,T,G);return}if(k&64){U.move(v,M,T,D);return}if(U===ge){n(O,M,T);for(let $=0;$<V.length;$++)pt(V[$],M,T,G);n(v.anchor,M,T);return}if(U===bh){E(v,M,T);return}if(G!==2&&k&1&&X)if(G===0)X.beforeEnter(O),n(O,M,T),ri(()=>X.enter(O),L);else{const{leave:$,delayLeave:it,afterLeave:at}=X,yt=()=>{v.ctx.isUnmounted?s(O):n(O,M,T)},Ct=()=>{O._isLeaving&&O[cn](!0),$(O,()=>{yt(),at&&at()})};it?it(O,yt,Ct):Ct()}else n(O,M,T)},j=(v,M,T,G=!1,L=!1)=>{const{type:O,props:U,ref:X,children:V,dynamicChildren:k,shapeFlag:et,patchFlag:$,dirs:it,cacheIndex:at}=v;if($===-2&&(L=!1),X!=null&&(Mn(),po(X,null,T,v,!0),wn()),at!=null&&(M.renderCache[at]=void 0),et&256){M.ctx.deactivate(v);return}const yt=et&1&&it,Ct=!pr(v);let Tt;if(Ct&&(Tt=U&&U.onVnodeBeforeUnmount)&&ki(Tt,M,v),et&6)zt(v.component,T,G);else{if(et&128){v.suspense.unmount(T,G);return}yt&&_s(v,null,M,"beforeUnmount"),et&64?v.type.remove(v,M,T,D,G):k&&!k.hasOnce&&(O!==ge||$>0&&$&64)?Jt(k,M,T,!1,!0):(O===ge&&$&384||!L&&et&16)&&Jt(V,M,T),G&&Zt(v)}(Ct&&(Tt=U&&U.onVnodeUnmounted)||yt)&&ri(()=>{Tt&&ki(Tt,M,v),yt&&_s(v,null,M,"unmounted")},T)},Zt=v=>{const{type:M,el:T,anchor:G,transition:L}=v;if(M===ge){re(T,G);return}if(M===bh){x(v);return}const O=()=>{s(T),L&&!L.persisted&&L.afterLeave&&L.afterLeave()};if(v.shapeFlag&1&&L&&!L.persisted){const{leave:U,delayLeave:X}=L,V=()=>U(T,O);X?X(v.el,O,V):V()}else O()},re=(v,M)=>{let T;for(;v!==M;)T=f(v),s(v),v=T;s(M)},zt=(v,M,T)=>{const{bum:G,scope:L,job:O,subTree:U,um:X,m:V,a:k}=v;Vf(V),Vf(k),G&&Sh(G),L.stop(),O&&(O.flags|=8,j(U,v,M,T)),X&&ri(X,M),ri(()=>{v.isUnmounted=!0},M)},Jt=(v,M,T,G=!1,L=!1,O=0)=>{for(let U=O;U<v.length;U++)j(v[U],M,T,G,L)},qt=v=>{if(v.shapeFlag&6)return qt(v.component.subTree);if(v.shapeFlag&128)return v.suspense.next();const M=f(v.anchor||v.el),T=M&&M[op];return T?f(T):M};let ue=!1;const R=(v,M,T)=>{v==null?M._vnode&&j(M._vnode,null,null,!0):_(M._vnode||null,v,M,null,null,null,T),M._vnode=v,ue||(ue=!0,Nf(),y_(),ue=!1)},D={p:_,um:j,m:pt,r:Zt,mt:W,mc:P,pc:K,pbc:N,n:qt,o:i};return{render:R,hydrate:void 0,createApp:Ip(R)}}function Ph({type:i,props:t},e){return e==="svg"&&i==="foreignObject"||e==="mathml"&&i==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:e}function ms({effect:i,job:t},e){e?(i.flags|=32,t.flags|=4):(i.flags&=-33,t.flags&=-5)}function Np(i,t){return(!i||i&&!i.pendingBranch)&&t&&!t.persisted}function W_(i,t,e=!1){const n=i.children,s=t.children;if(ht(n)&&ht(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),!e&&a.patchFlag!==-2&&W_(o,a)),a.type===Kl&&a.patchFlag!==-1&&(a.el=o.el),a.type===Oe&&!a.el&&(a.el=o.el)}}function kp(i){const t=i.slice(),e=[0];let n,s,r,o,a;const l=i.length;for(n=0;n<l;n++){const h=i[n];if(h!==0){if(s=e[e.length-1],i[s]<h){t[n]=s,e.push(n);continue}for(r=0,o=e.length-1;r<o;)a=r+o>>1,i[e[a]]<h?r=a+1:o=a;h<i[e[r]]&&(r>0&&(t[n]=e[r-1]),e[r]=n)}}for(r=e.length,o=e[r-1];r-- >0;)e[r]=o,o=t[o];return e}function U_(i){const t=i.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:U_(t)}function Vf(i){if(i)for(let t=0;t<i.length;t++)i[t].flags|=8}const jp=Symbol.for("v-scx"),Bp=()=>Bt(jp);function zp(i,t){return wu(i,null,t)}function ne(i,t,e){return wu(i,t,e)}function wu(i,t,e=Ut){const{immediate:n,deep:s,flush:r,once:o}=e,a=ye({},e),l=t&&n||!t&&r!=="post";let h;if(Do){if(r==="sync"){const d=Bp();h=d.__watcherHandles||(d.__watcherHandles=[])}else if(!l){const d=()=>{};return d.stop=$i,d.resume=$i,d.pause=$i,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=ip(i,t,a);return Do&&(h?h.push(f):l&&f()),f}function Wp(i,t,e){const n=this.proxy,s=se(i)?i.includes(".")?V_(n,i):()=>n[i]:i.bind(n,n);let r;dt(t)?r=t:(r=t.handler,e=t);const o=ia(this),a=wu(s,r.bind(n),e);return o(),a}function V_(i,t){const e=t.split(".");return()=>{let n=i;for(let s=0;s<e.length&&n;s++)n=n[e[s]];return n}}const Up=(i,t)=>t==="modelValue"||t==="model-value"?i.modelModifiers:i[`${t}Modifiers`]||i[`${ns(t)}Modifiers`]||i[`${ks(t)}Modifiers`];function Vp(i,t,...e){if(i.isUnmounted)return;const n=i.vnode.props||Ut;let s=e;const r=t.startsWith("update:"),o=r&&Up(n,t.slice(7));o&&(o.trim&&(s=e.map(c=>se(c)?c.trim():c)),o.number&&(s=e.map(y1)));let a,l=n[a=Eh(t)]||n[a=Eh(ns(t))];!l&&r&&(l=n[a=Eh(ks(t))]),l&&Oi(l,i,6,s);const h=n[a+"Once"];if(h){if(!i.emitted)i.emitted={};else if(i.emitted[a])return;i.emitted[a]=!0,Oi(h,i,6,s)}}const Xp=new WeakMap;function X_(i,t,e=!1){const n=e?Xp:t.emitsCache,s=n.get(i);if(s!==void 0)return s;const r=i.emits;let o={},a=!1;if(!dt(i)){const l=h=>{const c=X_(h,t,!0);c&&(a=!0,ye(o,c))};!e&&t.mixins.length&&t.mixins.forEach(l),i.extends&&l(i.extends),i.mixins&&i.mixins.forEach(l)}return!r&&!a?(Xt(i)&&n.set(i,null),null):(ht(r)?r.forEach(l=>o[l]=null):ye(o,r),Xt(i)&&n.set(i,o),o)}function $l(i,t){return!i||!Gl(t)?!1:(t=t.slice(2).replace(/Once$/,""),Pt(i,t[0].toLowerCase()+t.slice(1))||Pt(i,ks(t))||Pt(i,t))}function Xf(i){const{type:t,vnode:e,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:_}=i,m=il(i);let p,y;try{if(e.shapeFlag&4){const x=s||n,S=x;p=zi(h.call(S,x,c,u,d,f,g)),y=a}else{const x=t;p=zi(x.length>1?x(u,{attrs:a,slots:o,emit:l}):x(u,null)),y=t.props?a:$p(a)}}catch(x){vo.length=0,Ul(x,i,1),p=kt(Oe)}let E=p;if(y&&_!==!1){const x=Object.keys(y),{shapeFlag:S}=E;x.length&&S&7&&(r&&x.some(hu)&&(y=Kp(y,r)),E=rs(E,y,!1,!0))}return e.dirs&&(E=rs(E,null,!1,!0),E.dirs=E.dirs?E.dirs.concat(e.dirs):e.dirs),e.transition&&Oo(E,e.transition),p=E,il(m),p}const $p=i=>{let t;for(const e in i)(e==="class"||e==="style"||Gl(e))&&((t||(t={}))[e]=i[e]);return t},Kp=(i,t)=>{const e={};for(const n in i)(!hu(n)||!(n.slice(9)in t))&&(e[n]=i[n]);return e};function Yp(i,t,e){const{props:n,children:s,component:r}=i,{props:o,children:a,patchFlag:l}=t,h=r.emitsOptions;if(t.dirs||t.transition)return!0;if(e&&l>=0){if(l&1024)return!0;if(l&16)return n?$f(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]&&!$l(h,f))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:n===o?!1:n?o?$f(n,o,h):!0:!!o;return!1}function $f(i,t,e){const n=Object.keys(t);if(n.length!==Object.keys(i).length)return!0;for(let s=0;s<n.length;s++){const r=n[s];if(t[r]!==i[r]&&!$l(e,r))return!0}return!1}function qp({vnode:i,parent:t},e){for(;t;){const n=t.subTree;if(n.suspense&&n.suspense.activeBranch===i&&(n.el=i.el),n===i)(i=t.vnode).el=e,t=t.parent;else break}}const $_=i=>i.__isSuspense;function Hp(i,t){t&&t.pendingBranch?ht(i)?t.effects.push(...i):t.effects.push(i):rp(i)}const ge=Symbol.for("v-fgt"),Kl=Symbol.for("v-txt"),Oe=Symbol.for("v-cmt"),bh=Symbol.for("v-stc"),vo=[];let ai=null;function _t(i=!1){vo.push(ai=i?null:[])}function Zp(){vo.pop(),ai=vo[vo.length-1]||null}let Fo=1;function ol(i,t=!1){Fo+=i,i<0&&ai&&t&&(ai.hasOnce=!0)}function K_(i){return i.dynamicChildren=Fo>0?ai||dr:null,Zp(),Fo>0&&ai&&ai.push(i),i}function Yt(i,t,e,n,s,r){return K_(Gt(i,t,e,n,s,r,!0))}function Re(i,t,e,n,s){return K_(kt(i,t,e,n,s,!0))}function Go(i){return i?i.__v_isVNode===!0:!1}function ws(i,t){return i.type===t.type&&i.key===t.key}const Y_=({key:i})=>i??null,Ua=({ref:i,ref_key:t,ref_for:e})=>(typeof i=="number"&&(i=""+i),i!=null?se(i)||pe(i)||dt(i)?{i:Je,r:i,k:t,f:!!e}:i:null);function Gt(i,t=null,e=null,n=0,s=null,r=i===ge?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:i,props:t,key:t&&Y_(t),ref:t&&Ua(t),scopeId:x_,slotScopeIds:null,children:e,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,e),r&128&&i.normalize(l)):e&&(l.shapeFlag|=se(e)?8:16),Fo>0&&!o&&ai&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&ai.push(l),l}const kt=Jp;function Jp(i,t=null,e=null,n=0,s=null,r=!1){if((!i||i===xp)&&(i=Oe),Go(i)){const a=rs(i,t,!0);return e&&Cu(a,e),Fo>0&&!r&&ai&&(a.shapeFlag&6?ai[ai.indexOf(i)]=a:ai.push(a)),a.patchFlag=-2,a}if(ly(i)&&(i=i.__vccOpts),t){t=Qp(t);let{class:a,style:l}=t;a&&!se(a)&&(t.class=Po(a)),Xt(l)&&(yu(l)&&!ht(l)&&(l=ye({},l)),t.style=jl(l))}const o=se(i)?1:$_(i)?128:E_(i)?64:Xt(i)?4:dt(i)?2:0;return Gt(i,t,e,n,s,o,r,!0)}function Qp(i){return i?yu(i)||D_(i)?ye({},i):i:null}function rs(i,t,e=!1,n=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=i,h=t?q_(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:i.type,props:h,key:h&&Y_(h),ref:t&&t.ref?e&&r?ht(r)?r.concat(Ua(t)):[r,Ua(t)]:Ua(t):r,scopeId:i.scopeId,slotScopeIds:i.slotScopeIds,children:a,target:i.target,targetStart:i.targetStart,targetAnchor:i.targetAnchor,staticCount:i.staticCount,shapeFlag:i.shapeFlag,patchFlag:t&&i.type!==ge?o===-1?16:o|16:o,dynamicProps:i.dynamicProps,dynamicChildren:i.dynamicChildren,appContext:i.appContext,dirs:i.dirs,transition:l,component:i.component,suspense:i.suspense,ssContent:i.ssContent&&rs(i.ssContent),ssFallback:i.ssFallback&&rs(i.ssFallback),placeholder:i.placeholder,el:i.el,anchor:i.anchor,ctx:i.ctx,ce:i.ce};return l&&n&&Oo(c,l.clone(c)),c}function ty(i=" ",t=0){return kt(Kl,null,i,t)}function oe(i="",t=!1){return t?(_t(),Re(Oe,null,i)):kt(Oe,null,i)}function zi(i){return i==null||typeof i=="boolean"?kt(Oe):ht(i)?kt(ge,null,i.slice()):Go(i)?zn(i):kt(Kl,null,String(i))}function zn(i){return i.el===null&&i.patchFlag!==-1||i.memo?i:rs(i)}function Cu(i,t){let e=0;const{shapeFlag:n}=i;if(t==null)t=null;else if(ht(t))e=16;else if(typeof t=="object")if(n&65){const s=t.default;s&&(s._c&&(s._d=!1),Cu(i,s()),s._c&&(s._d=!0));return}else{e=32;const s=t._;!s&&!D_(t)?t._ctx=Je:s===3&&Je&&(Je.slots._===1?t._=1:(t._=2,i.patchFlag|=1024))}else dt(t)?(t={default:t,_ctx:Je},e=32):(t=String(t),n&64?(e=16,t=[ty(t)]):e=8);i.children=t,i.shapeFlag|=e}function q_(...i){const t={};for(let e=0;e<i.length;e++){const n=i[e];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=jl([t.style,n.style]);else if(Gl(s)){const r=t[s],o=n[s];o&&r!==o&&!(ht(r)&&r.includes(o))&&(t[s]=r?[].concat(r,o):o)}else s!==""&&(t[s]=n[s])}return t}function ki(i,t,e,n=null){Oi(i,t,7,[e,n])}const ey=O_();let iy=0;function ny(i,t,e){const n=i.type,s=(t?t.appContext:i.appContext)||ey,r={uid:iy++,vnode:i,type:n,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new T1(!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:k_(n,s),emitsOptions:X_(n,s),emit:null,emitted:null,propsDefaults:Ut,inheritAttrs:n.inheritAttrs,ctx:Ut,data:Ut,props:Ut,attrs:Ut,slots:Ut,refs:Ut,setupState:Ut,setupContext:null,suspense:e,suspenseId:e?e.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=Vp.bind(null,r),i.ce&&i.ce(r),r}let ze=null;const Yl=()=>ze||Je;let al,Tc;{const i=kl(),t=(e,n)=>{let s;return(s=i[e])||(s=i[e]=[]),s.push(n),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};al=t("__VUE_INSTANCE_SETTERS__",e=>ze=e),Tc=t("__VUE_SSR_SETTERS__",e=>Do=e)}const ia=i=>{const t=ze;return al(i),i.scope.on(),()=>{i.scope.off(),al(t)}},Kf=()=>{ze&&ze.scope.off(),al(null)};function H_(i){return i.vnode.shapeFlag&4}let Do=!1;function sy(i,t=!1,e=!1){t&&Tc(t);const{props:n,children:s}=i.vnode,r=H_(i);Pp(i,n,r,t),Op(i,s,e||t);const o=r?ry(i,t):void 0;return t&&Tc(!1),o}function ry(i,t){const e=i.type;i.accessCache=Object.create(null),i.proxy=new Proxy(i.ctx,Ep);const{setup:n}=e;if(n){Mn();const s=i.setupContext=n.length>1?ay(i):null,r=ia(i),o=ea(n,i,0,[i.props,s]),a=Xg(o);if(wn(),r(),(a||i.sp)&&!pr(i)&&R_(i),a){if(o.then(Kf,Kf),t)return o.then(l=>{Yf(i,l)}).catch(l=>{Ul(l,i,0)});i.asyncDep=o}else Yf(i,o)}else Z_(i)}function Yf(i,t,e){dt(t)?i.type.__ssrInlineRender?i.ssrRender=t:i.render=t:Xt(t)&&(i.setupState=g_(t)),Z_(i)}function Z_(i,t,e){const n=i.type;i.render||(i.render=n.render||$i);{const s=ia(i);Mn();try{Sp(i)}finally{wn(),s()}}}const oy={get(i,t){return Le(i,"get",""),i[t]}};function ay(i){const t=e=>{i.exposed=e||{}};return{attrs:new Proxy(i.attrs,oy),slots:i.slots,emit:i.emit,expose:t}}function Tu(i){return i.exposed?i.exposeProxy||(i.exposeProxy=new Proxy(g_(Y1(i.exposed)),{get(t,e){if(e in t)return t[e];if(e in yo)return yo[e](i)},has(t,e){return e in t||e in yo}})):i.proxy}function ly(i){return dt(i)&&"__vccOpts"in i}const ae=(i,t)=>tp(i,t,Do);function hy(i,t,e){try{ol(-1);const n=arguments.length;return n===2?Xt(t)&&!ht(t)?Go(t)?kt(i,null,[t]):kt(i,t):kt(i,null,t):(n>3?e=Array.prototype.slice.call(arguments,2):n===3&&Go(e)&&(e=[e]),kt(i,t,e))}finally{ol(1)}}const cy="3.5.24";let Rc;const qf=typeof window<"u"&&window.trustedTypes;if(qf)try{Rc=qf.createPolicy("vue",{createHTML:i=>i})}catch{}const J_=Rc?i=>Rc.createHTML(i):i=>i,uy="http://www.w3.org/2000/svg",fy="http://www.w3.org/1998/Math/MathML",an=typeof document<"u"?document:null,Hf=an&&an.createElement("template"),dy={insert:(i,t,e)=>{t.insertBefore(i,e||null)},remove:i=>{const t=i.parentNode;t&&t.removeChild(i)},createElement:(i,t,e,n)=>{const s=t==="svg"?an.createElementNS(uy,i):t==="mathml"?an.createElementNS(fy,i):e?an.createElement(i,{is:e}):an.createElement(i);return i==="select"&&n&&n.multiple!=null&&s.setAttribute("multiple",n.multiple),s},createText:i=>an.createTextNode(i),createComment:i=>an.createComment(i),setText:(i,t)=>{i.nodeValue=t},setElementText:(i,t)=>{i.textContent=t},parentNode:i=>i.parentNode,nextSibling:i=>i.nextSibling,querySelector:i=>an.querySelector(i),setScopeId(i,t){i.setAttribute(t,"")},insertStaticContent(i,t,e,n,s,r){const o=e?e.previousSibling:t.lastChild;if(s&&(s===r||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),e),!(s===r||!(s=s.nextSibling)););else{Hf.innerHTML=J_(n==="svg"?`<svg>${i}</svg>`:n==="mathml"?`<math>${i}</math>`:i);const a=Hf.content;if(n==="svg"||n==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,e)}return[o?o.nextSibling:t.firstChild,e?e.previousSibling:t.lastChild]}},On="transition",Hr="animation",No=Symbol("_vtc"),Q_={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},gy=ye({},S_,Q_),_y=i=>(i.displayName="Transition",i.props=gy,i),Zf=_y((i,{slots:t})=>hy(hp,my(i),t)),ps=(i,t=[])=>{ht(i)?i.forEach(e=>e(...t)):i&&i(...t)},Jf=i=>i?ht(i)?i.some(t=>t.length>1):i.length>1:!1;function my(i){const t={};for(const b in i)b in Q_||(t[b]=i[b]);if(i.css===!1)return t;const{name:e="v",type:n,duration:s,enterFromClass:r=`${e}-enter-from`,enterActiveClass:o=`${e}-enter-active`,enterToClass:a=`${e}-enter-to`,appearFromClass:l=r,appearActiveClass:h=o,appearToClass:c=a,leaveFromClass:u=`${e}-leave-from`,leaveActiveClass:f=`${e}-leave-active`,leaveToClass:d=`${e}-leave-to`}=i,g=py(s),_=g&&g[0],m=g&&g[1],{onBeforeEnter:p,onEnter:y,onEnterCancelled:E,onLeave:x,onLeaveCancelled:S,onBeforeAppear:w=p,onAppear:I=y,onAppearCancelled:P=E}=t,C=(b,A,W,Q)=>{b._enterCancelled=Q,ys(b,A?c:a),ys(b,A?h:o),W&&W()},N=(b,A)=>{b._isLeaving=!1,ys(b,u),ys(b,d),ys(b,f),A&&A()},z=b=>(A,W)=>{const Q=b?I:y,q=()=>C(A,b,W);ps(Q,[A,q]),Qf(()=>{ys(A,b?l:r),nn(A,b?c:a),Jf(Q)||td(A,n,_,q)})};return ye(t,{onBeforeEnter(b){ps(p,[b]),nn(b,r),nn(b,o)},onBeforeAppear(b){ps(w,[b]),nn(b,l),nn(b,h)},onEnter:z(!1),onAppear:z(!0),onLeave(b,A){b._isLeaving=!0;const W=()=>N(b,A);nn(b,u),b._enterCancelled?(nn(b,f),nd(b)):(nd(b),nn(b,f)),Qf(()=>{b._isLeaving&&(ys(b,u),nn(b,d),Jf(x)||td(b,n,m,W))}),ps(x,[b,W])},onEnterCancelled(b){C(b,!1,void 0,!0),ps(E,[b])},onAppearCancelled(b){C(b,!0,void 0,!0),ps(P,[b])},onLeaveCancelled(b){N(b),ps(S,[b])}})}function py(i){if(i==null)return null;if(Xt(i))return[Ah(i.enter),Ah(i.leave)];{const t=Ah(i);return[t,t]}}function Ah(i){return v1(i)}function nn(i,t){t.split(/\s+/).forEach(e=>e&&i.classList.add(e)),(i[No]||(i[No]=new Set)).add(t)}function ys(i,t){t.split(/\s+/).forEach(n=>n&&i.classList.remove(n));const e=i[No];e&&(e.delete(t),e.size||(i[No]=void 0))}function Qf(i){requestAnimationFrame(()=>{requestAnimationFrame(i)})}let yy=0;function td(i,t,e,n){const s=i._endId=++yy,r=()=>{s===i._endId&&n()};if(e!=null)return setTimeout(r,e);const{type:o,timeout:a,propCount:l}=vy(i,t);if(!o)return n();const h=o+"end";let c=0;const u=()=>{i.removeEventListener(h,f),r()},f=d=>{d.target===i&&++c>=l&&u()};setTimeout(()=>{c<l&&u()},a+1),i.addEventListener(h,f)}function vy(i,t){const e=window.getComputedStyle(i),n=g=>(e[g]||"").split(", "),s=n(`${On}Delay`),r=n(`${On}Duration`),o=ed(s,r),a=n(`${Hr}Delay`),l=n(`${Hr}Duration`),h=ed(a,l);let c=null,u=0,f=0;t===On?o>0&&(c=On,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?On:Hr:null,f=c?c===On?r.length:l.length:0);const d=c===On&&/\b(?:transform|all)(?:,|$)/.test(n(`${On}Property`).toString());return{type:c,timeout:u,propCount:f,hasTransform:d}}function ed(i,t){for(;i.length<t.length;)i=i.concat(i);return Math.max(...t.map((e,n)=>id(e)+id(i[n])))}function id(i){return i==="auto"?0:Number(i.slice(0,-1).replace(",","."))*1e3}function nd(i){return(i?i.ownerDocument:document).body.offsetHeight}function xy(i,t,e){const n=i[No];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?i.removeAttribute("class"):e?i.setAttribute("class",t):i.className=t}const sd=Symbol("_vod"),Ey=Symbol("_vsh"),Sy=Symbol(""),My=/(?:^|;)\s*display\s*:/;function wy(i,t,e){const n=i.style,s=se(e);let r=!1;if(e&&!s){if(t)if(se(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();e[a]==null&&Va(n,a,"")}else for(const o in t)e[o]==null&&Va(n,o,"");for(const o in e)o==="display"&&(r=!0),Va(n,o,e[o])}else if(s){if(t!==e){const o=n[Sy];o&&(e+=";"+o),n.cssText=e,r=My.test(e)}}else t&&i.removeAttribute("style");sd in i&&(i[sd]=r?n.display:"",i[Ey]&&(n.display="none"))}const rd=/\s*!important$/;function Va(i,t,e){if(ht(e))e.forEach(n=>Va(i,t,n));else if(e==null&&(e=""),t.startsWith("--"))i.setProperty(t,e);else{const n=Cy(i,t);rd.test(e)?i.setProperty(ks(n),e.replace(rd,""),"important"):i[n]=e}}const od=["Webkit","Moz","ms"],Lh={};function Cy(i,t){const e=Lh[t];if(e)return e;let n=ns(t);if(n!=="filter"&&n in i)return Lh[t]=n;n=Yg(n);for(let s=0;s<od.length;s++){const r=od[s]+n;if(r in i)return Lh[t]=r}return t}const ad="http://www.w3.org/1999/xlink";function ld(i,t,e,n,s,r=C1(t)){n&&t.startsWith("xlink:")?e==null?i.removeAttributeNS(ad,t.slice(6,t.length)):i.setAttributeNS(ad,t,e):e==null||r&&!Hg(e)?i.removeAttribute(t):i.setAttribute(t,r?"":Rn(e)?String(e):e)}function hd(i,t,e,n,s){if(t==="innerHTML"||t==="textContent"){e!=null&&(i[t]=t==="innerHTML"?J_(e):e);return}const r=i.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const a=r==="OPTION"?i.getAttribute("value")||"":i.value,l=e==null?i.type==="checkbox"?"on":"":String(e);(a!==l||!("_value"in i))&&(i.value=l),e==null&&i.removeAttribute(t),i._value=e;return}let o=!1;if(e===""||e==null){const a=typeof i[t];a==="boolean"?e=Hg(e):e==null&&a==="string"?(e="",o=!0):a==="number"&&(e=0,o=!0)}try{i[t]=e}catch{}o&&i.removeAttribute(s||t)}function Ty(i,t,e,n){i.addEventListener(t,e,n)}function Ry(i,t,e,n){i.removeEventListener(t,e,n)}const cd=Symbol("_vei");function Iy(i,t,e,n,s=null){const r=i[cd]||(i[cd]={}),o=r[t];if(n&&o)o.value=n;else{const[a,l]=Py(t);if(n){const h=r[t]=Ly(n,s);Ty(i,a,h,l)}else o&&(Ry(i,a,o,l),r[t]=void 0)}}const ud=/(?:Once|Passive|Capture)$/;function Py(i){let t;if(ud.test(i)){t={};let n;for(;n=i.match(ud);)i=i.slice(0,i.length-n[0].length),t[n[0].toLowerCase()]=!0}return[i[2]===":"?i.slice(3):ks(i.slice(2)),t]}let Oh=0;const by=Promise.resolve(),Ay=()=>Oh||(by.then(()=>Oh=0),Oh=Date.now());function Ly(i,t){const e=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=e.attached)return;Oi(Oy(n,e.value),t,5,[n])};return e.value=i,e.attached=Ay(),e}function Oy(i,t){if(ht(t)){const e=i.stopImmediatePropagation;return i.stopImmediatePropagation=()=>{e.call(i),i._stopped=!0},t.map(n=>s=>!s._stopped&&n&&n(s))}else return t}const fd=i=>i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&i.charCodeAt(2)>96&&i.charCodeAt(2)<123,Fy=(i,t,e,n,s,r)=>{const o=s==="svg";t==="class"?xy(i,n,o):t==="style"?wy(i,e,n):Gl(t)?hu(t)||Iy(i,t,e,n,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Gy(i,t,n,o))?(hd(i,t,n),!i.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&ld(i,t,n,o,r,t!=="value")):i._isVueCE&&(/[A-Z]/.test(t)||!se(n))?hd(i,ns(t),n,r,t):(t==="true-value"?i._trueValue=n:t==="false-value"&&(i._falseValue=n),ld(i,t,n,o))};function Gy(i,t,e,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in i&&fd(t)&&dt(e));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&i.tagName==="IFRAME"||t==="form"||t==="list"&&i.tagName==="INPUT"||t==="type"&&i.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=i.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return fd(t)&&se(e)?!1:t in i}const Dy=ye({patchProp:Fy},dy);let dd;function Ny(){return dd||(dd=Gp(Dy))}const ky=((...i)=>{const t=Ny().createApp(...i),{mount:e}=t;return t.mount=n=>{const s=By(n);if(!s)return;const r=t._component;!dt(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=e(s,!1,jy(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},t});function jy(i){if(i instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&i instanceof MathMLElement)return"mathml"}function By(i){return se(i)?document.querySelector(i):i}const Tr={PROPERTYCHANGE:"propertychange"},lt={CHANGE:"change",ERROR:"error",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",TOUCHMOVE:"touchmove",WHEEL:"wheel"};class ql{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function zy(i,t,e){let n,s;e=e||_n;let r=0,o=i.length,a=!1;for(;r<o;)n=r+(o-r>>1),s=+e(i[n],t),s<0?r=n+1:(o=n,a=!s);return a?r:~r}function _n(i,t){return i>t?1:i<t?-1:0}function Wy(i,t){return i<t?1:i>t?-1:0}function Hl(i,t,e){if(i[0]<=t)return 0;const n=i.length;if(t<=i[n-1])return n-1;if(typeof e=="function"){for(let s=1;s<n;++s){const r=i[s];if(r===t)return s;if(r<t)return e(t,i[s-1],r)>0?s-1:s}return n-1}if(e>0){for(let s=1;s<n;++s)if(i[s]<t)return s-1;return n-1}if(e<0){for(let s=1;s<n;++s)if(i[s]<=t)return s;return n-1}for(let s=1;s<n;++s){if(i[s]==t)return s;if(i[s]<t)return i[s-1]-t<t-i[s]?s-1:s}return n-1}function Uy(i,t,e){for(;t<e;){const n=i[t];i[t]=i[e],i[e]=n,++t,--e}}function xi(i,t){const e=Array.isArray(t)?t:[t],n=e.length;for(let s=0;s<n;s++)i[i.length]=e[s]}function Pn(i,t){const e=i.length;if(e!==t.length)return!1;for(let n=0;n<e;n++)if(i[n]!==t[n])return!1;return!0}function Vy(i,t,e){const n=t||_n;return i.every(function(s,r){if(r===0)return!0;const o=n(i[r-1],s);return!(o>0||o===0)})}function Cn(){return!0}function js(){return!1}function ko(){}function t0(i){let t,e,n;return function(){const s=Array.prototype.slice.call(arguments);return(!e||this!==n||!Pn(s,e))&&(n=this,e=s,t=i.apply(this,arguments)),t}}function e0(i){function t(){let e;try{e=i()}catch(n){return Promise.reject(n)}return e instanceof Promise?e:Promise.resolve(e)}return t()}function Bs(i){for(const t in i)delete i[t]}function Rr(i){let t;for(t in i)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 na extends ql{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const n=this.listeners_||(this.listeners_={}),s=n[t]||(n[t]=[]);s.includes(e)||s.push(e)}dispatchEvent(t){const e=typeof t=="string",n=e?t:t.type,s=this.listeners_&&this.listeners_[n];if(!s)return;const r=e?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,ko);delete o[n]}return l}disposeInternal(){this.listeners_&&Bs(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,e){if(!this.listeners_)return;const n=this.listeners_[t];if(!n)return;const s=n.indexOf(e);s!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[s]=ko,++this.pendingRemovals_[t]):(n.splice(s,1),n.length===0&&delete this.listeners_[t]))}}function mt(i,t,e,n,s){if(s){const o=e;e=function(a){return i.removeEventListener(t,e),o.call(n??this,a)}}else n&&n!==i&&(e=e.bind(n));const r={target:i,type:t,listener:e};return i.addEventListener(t,e),r}function ll(i,t,e,n){return mt(i,t,e,n,!0)}function It(i){i&&i.target&&(i.target.removeEventListener(i.type,i.listener),Bs(i))}class sa extends na{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(lt.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const n=t.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=mt(this,t[r],e);return s}return mt(this,t,e)}onceInternal(t,e){let n;if(Array.isArray(t)){const s=t.length;n=new Array(s);for(let r=0;r<s;++r)n[r]=ll(this,t[r],e)}else n=ll(this,t,e);return e.ol_key=n,n}unInternal(t,e){const n=e.ol_key;if(n)i0(n);else if(Array.isArray(t))for(let s=0,r=t.length;s<r;++s)this.removeEventListener(t[s],e);else this.removeEventListener(t,e)}}sa.prototype.on;sa.prototype.once;sa.prototype.un;function i0(i){if(Array.isArray(i))for(let t=0,e=i.length;t<e;++t)It(i[t]);else It(i)}function Mt(){throw new Error("Unimplemented abstract method.")}let Xy=0;function ct(i){return i.ol_uid||(i.ol_uid=String(++Xy))}class gd extends ii{constructor(t,e,n){super(t),this.key=e,this.oldValue=n}}class Di extends sa{constructor(t){super(),this.on,this.once,this.un,ct(this),this.values_=null,t!==void 0&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}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,e){let n;n=`change:${t}`,this.hasListener(n)&&this.dispatchEvent(new gd(n,t,e)),n=Tr.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new gd(n,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,n){const s=this.values_||(this.values_={});if(n)s[t]=e;else{const r=s[t];s[t]=e,r!==e&&this.notify(t,r)}}setProperties(t,e){for(const n in t)this.set(n,t[n],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const n=this.values_[t];delete this.values_[t],Rr(this.values_)&&(this.values_=null),e||this.notify(t,n)}}}function Lt(i,t){if(!i)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 e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new _i(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.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_&&(It(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=mt(t,lt.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?$y(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 $y(i){if(typeof i=="function")return i;let t;return Array.isArray(i)?t=i:(Lt(typeof i.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[i]),function(){return t}}const fe={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function te(i){const t=ti();for(let e=0,n=i.length;e<n;++e)Eo(t,i[e]);return t}function Ky(i,t,e){const n=Math.min.apply(null,i),s=Math.min.apply(null,t),r=Math.max.apply(null,i),o=Math.max.apply(null,t);return Ki(n,s,r,o,e)}function As(i,t,e){return e?(e[0]=i[0]-t,e[1]=i[1]-t,e[2]=i[2]+t,e[3]=i[3]+t,e):[i[0]-t,i[1]-t,i[2]+t,i[3]+t]}function n0(i,t){return t?(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t):i.slice()}function zs(i,t,e){let n,s;return t<i[0]?n=i[0]-t:i[2]<t?n=t-i[2]:n=0,e<i[1]?s=i[1]-e:i[3]<e?s=e-i[3]:s=0,n*n+s*s}function Ir(i,t){return Ru(i,t[0],t[1])}function dn(i,t){return i[0]<=t[0]&&t[2]<=i[2]&&i[1]<=t[1]&&t[3]<=i[3]}function Ru(i,t,e){return i[0]<=t&&t<=i[2]&&i[1]<=e&&e<=i[3]}function Ic(i,t){const e=i[0],n=i[1],s=i[2],r=i[3],o=t[0],a=t[1];let l=fe.UNKNOWN;return o<e?l=l|fe.LEFT:o>s&&(l=l|fe.RIGHT),a<n?l=l|fe.BELOW:a>r&&(l=l|fe.ABOVE),l===fe.UNKNOWN&&(l=fe.INTERSECTING),l}function ti(){return[1/0,1/0,-1/0,-1/0]}function Ki(i,t,e,n,s){return s?(s[0]=i,s[1]=t,s[2]=e,s[3]=n,s):[i,t,e,n]}function Gr(i){return Ki(1/0,1/0,-1/0,-1/0,i)}function xo(i,t){const e=i[0],n=i[1];return Ki(e,n,e,n,t)}function Iu(i,t,e,n,s){const r=Gr(s);return r0(r,i,t,e,n)}function Pr(i,t){return i[0]==t[0]&&i[2]==t[2]&&i[1]==t[1]&&i[3]==t[3]}function s0(i,t){return t[0]<i[0]&&(i[0]=t[0]),t[2]>i[2]&&(i[2]=t[2]),t[1]<i[1]&&(i[1]=t[1]),t[3]>i[3]&&(i[3]=t[3]),i}function Eo(i,t){t[0]<i[0]&&(i[0]=t[0]),t[0]>i[2]&&(i[2]=t[0]),t[1]<i[1]&&(i[1]=t[1]),t[1]>i[3]&&(i[3]=t[1])}function r0(i,t,e,n,s){for(;e<n;e+=s)Yy(i,t[e],t[e+1]);return i}function Yy(i,t,e){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}function Pu(i,t){let e;return e=t(Zl(i)),e||(e=t(Jl(i)),e)||(e=t(Ql(i)),e)||(e=t(hs(i)),e)?e:!1}function Pc(i){let t=0;return Dr(i)||(t=Et(i)*_e(i)),t}function Zl(i){return[i[0],i[1]]}function Jl(i){return[i[2],i[1]]}function Yi(i){return[(i[0]+i[2])/2,(i[1]+i[3])/2]}function qy(i,t){let e;if(t==="bottom-left")e=Zl(i);else if(t==="bottom-right")e=Jl(i);else if(t==="top-left")e=hs(i);else if(t==="top-right")e=Ql(i);else throw new Error("Invalid corner");return e}function hl(i,t,e,n,s){const[r,o,a,l,h,c,u,f]=o0(i,t,e,n);return Ki(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 o0(i,t,e,n){const s=t*n[0]/2,r=t*n[1]/2,o=Math.cos(e),a=Math.sin(e),l=s*o,h=s*a,c=r*o,u=r*a,f=i[0],d=i[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 _e(i){return i[3]-i[1]}function Jn(i,t,e){const n=e||ti();return Fe(i,t)?(i[0]>t[0]?n[0]=i[0]:n[0]=t[0],i[1]>t[1]?n[1]=i[1]:n[1]=t[1],i[2]<t[2]?n[2]=i[2]:n[2]=t[2],i[3]<t[3]?n[3]=i[3]:n[3]=t[3]):Gr(n),n}function hs(i){return[i[0],i[3]]}function Ql(i){return[i[2],i[3]]}function Et(i){return i[2]-i[0]}function Fe(i,t){return i[0]<=t[2]&&i[2]>=t[0]&&i[1]<=t[3]&&i[3]>=t[1]}function Dr(i){return i[2]<i[0]||i[3]<i[1]}function Hy(i,t){return t?(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t):i}function Zy(i,t,e){let n=!1;const s=Ic(i,t),r=Ic(i,e);if(s===fe.INTERSECTING||r===fe.INTERSECTING)n=!0;else{const o=i[0],a=i[1],l=i[2],h=i[3],c=t[0],u=t[1],f=e[0],d=e[1],g=(d-u)/(f-c);let _,m;r&fe.ABOVE&&!(s&fe.ABOVE)&&(_=f-(d-h)/g,n=_>=o&&_<=l),!n&&r&fe.RIGHT&&!(s&fe.RIGHT)&&(m=d-(f-l)*g,n=m>=a&&m<=h),!n&&r&fe.BELOW&&!(s&fe.BELOW)&&(_=f-(d-a)/g,n=_>=o&&_<=l),!n&&r&fe.LEFT&&!(s&fe.LEFT)&&(m=d-(f-o)*g,n=m>=a&&m<=h)}return n}function Jy(i,t,e,n){if(Dr(i))return Gr(e);let s=[];s=[i[0],i[1],i[2],i[1],i[2],i[3],i[0],i[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 Ky(r,o,e)}function a0(i,t){const e=t.getExtent(),n=Yi(i);if(t.canWrapX()&&(n[0]<e[0]||n[0]>=e[2])){const s=Et(e),o=Math.floor((n[0]-e[0])/s)*s;i[0]-=o,i[2]-=o}return i}function l0(i,t,e){if(t.canWrapX()){const n=t.getExtent();if(!isFinite(i[0])||!isFinite(i[2]))return[[n[0],i[1],n[2],i[3]]];a0(i,t);const s=Et(n);if(Et(i)>s&&!e)return[[n[0],i[1],n[2],i[3]]];if(i[0]<n[0])return[[i[0]+s,i[1],n[2],i[3]],[n[0],i[1],i[2],i[3]]];if(i[2]>n[2])return[[i[0],i[1],n[2],i[3]],[n[0],i[1],i[2]-s,i[3]]]}return[i]}function h0(...i){console.warn(...i)}function Vt(i,t,e){return Math.min(Math.max(i,t),e)}function Qy(i,t,e,n,s,r){const o=s-e,a=r-n;if(o!==0||a!==0){const l=((i-e)*o+(t-n)*a)/(o*o+a*a);l>1?(e=s,n=r):l>0&&(e+=o*l,n+=a*l)}return mn(i,t,e,n)}function mn(i,t,e,n){const s=e-i,r=n-t;return s*s+r*r}function tv(i){const t=i.length;for(let n=0;n<t;n++){let s=n,r=Math.abs(i[n][n]);for(let a=n+1;a<t;a++){const l=Math.abs(i[a][n]);l>r&&(r=l,s=a)}if(r===0)return null;const o=i[s];i[s]=i[n],i[n]=o;for(let a=n+1;a<t;a++){const l=-i[a][n]/i[n][n];for(let h=n;h<t+1;h++)n==h?i[a][h]=0:i[a][h]+=l*i[n][h]}}const e=new Array(t);for(let n=t-1;n>=0;n--){e[n]=i[n][t]/i[n][n];for(let s=n-1;s>=0;s--)i[s][t]-=i[s][n]*e[n]}return e}function _d(i){return i*180/Math.PI}function Qn(i){return i*Math.PI/180}function ts(i,t){const e=i%t;return e*t<0?e+t:e}function oi(i,t,e){return i+e*(t-i)}function Nr(i,t){const e=Math.pow(10,t);return Math.round(i*e)/e}function md(i,t){return Math.round(Nr(i,t))}function va(i,t){return Math.floor(Nr(i,t))}function Vn(i,t){return Math.ceil(Nr(i,t))}function bc(i,t,e){if(i>=t&&i<e)return i;const n=e-t;return((i-t)%n+n)%n+t}function c0(i,t){const e=(""+i).split("."),n=(""+t).split(".");for(let s=0;s<Math.max(e.length,n.length);s++){const r=parseInt(e[s]||"0",10),o=parseInt(n[s]||"0",10);if(r>o)return 1;if(o>r)return-1}return 0}function ev(i,t){return i[0]+=+t[0],i[1]+=+t[1],i}function iv(i,t){const e=t.getRadius(),n=t.getCenter(),s=n[0],r=n[1],o=i[0],a=i[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+e*l/c,f=r+e*h/c;return[u,f]}function th(i,t){const e=i[0],n=i[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*(e-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(i,t){let e=!0;for(let n=i.length-1;n>=0;--n)if(i[n]!=t[n]){e=!1;break}return e}function bu(i,t){const e=Math.cos(t),n=Math.sin(t),s=i[0]*e-i[1]*n,r=i[1]*e+i[0]*n;return i[0]=s,i[1]=r,i}function nv(i,t){return i[0]*=t,i[1]*=t,i}function pn(i,t){const e=i[0]-t[0],n=i[1]-t[1];return e*e+n*n}function rr(i,t){return Math.sqrt(pn(i,t))}function sv(i,t){return pn(i,th(i,t))}function u0(i,t){if(t.canWrapX()){const e=Et(t.getExtent()),n=f0(i,t,e);n&&(i[0]-=n*e)}return i}function f0(i,t,e){const n=t.getExtent();let s=0;return t.canWrapX()&&(i[0]<n[0]||i[0]>n[2])&&(e=e||Et(n),s=Math.floor((i[0]-n[0])/e)),s}const Au={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};let Ls=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 ra=6378137,or=Math.PI*ra,rv=[-or,-or,or,or],ov=[-180,-85,180,85],xa=ra*Math.log(Math.tan(Math.PI/2));class Xs extends Ls{constructor(t){super({code:t,units:"m",extent:rv,global:!0,worldExtent:ov,getPointResolution:function(e,n){return e/Math.cosh(n[1]/ra)}})}}const pd=[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 av(i,t,e,n){const s=i.length;e=e>1?e:2,n=n??e,t===void 0&&(e>2?t=i.slice():t=new Array(s));for(let r=0;r<s;r+=n){t[r]=or*i[r]/180;let o=ra*Math.log(Math.tan(Math.PI*(+i[r+1]+90)/360));o>xa?o=xa:o<-xa&&(o=-xa),t[r+1]=o}return t}function lv(i,t,e,n){const s=i.length;e=e>1?e:2,n=n??e,t===void 0&&(e>2?t=i.slice():t=new Array(s));for(let r=0;r<s;r+=n)t[r]=180*i[r]/or,t[r+1]=360*Math.atan(Math.exp(i[r+1]/ra))/Math.PI-90;return t}const hv=6378137,yd=[-180,-90,180,90],cv=Math.PI*hv/180;class vs extends Ls{constructor(t,e){super({code:t,units:"degrees",extent:yd,axisOrientation:e,global:!0,metersPerUnit:cv,worldExtent:yd})}}const vd=[new vs("CRS:84"),new vs("EPSG:4326","neu"),new vs("urn:ogc:def:crs:OGC:1.3:CRS84"),new vs("urn:ogc:def:crs:OGC:2:84"),new vs("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new vs("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new vs("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Ac={};function Xa(i){return Ac[i]||Ac[i.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function uv(i,t){Ac[i]=t}let vr={};function Os(i,t,e){const n=i.getCode(),s=t.getCode();n in vr||(vr[n]={}),vr[n][s]=e}function $a(i,t){return i in vr&&t in vr[i]?vr[i][t]:null}const cl=.9996,Ei=.00669438,eh=Ei*Ei,ih=eh*Ei,Ts=Ei/(1-Ei),xd=Math.sqrt(1-Ei),br=(1-xd)/(1+xd),d0=br*br,Lu=d0*br,Ou=Lu*br,g0=Ou*br,_0=1-Ei/4-3*eh/64-5*ih/256,fv=3*Ei/8+3*eh/32+45*ih/1024,dv=15*eh/256+45*ih/1024,gv=35*ih/3072,_v=3/2*br-27/32*Lu+269/512*g0,mv=21/16*d0-55/32*Ou,pv=151/96*Lu-417/128*g0,yv=1097/512*Ou,ul=6378137;function vv(i,t,e){const n=i-5e5,o=(e.north?t:t-1e7)/cl/(ul*_0),a=o+_v*Math.sin(2*o)+mv*Math.sin(4*o)+pv*Math.sin(6*o)+yv*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=ul/_,p=(1-Ei)/g,y=Ts*c**2,E=y*y,x=n/(m*cl),S=x*x,w=S*x,I=w*x,P=I*x,C=P*x,N=a-u/p*(S/2-I/24*(5+3*f+10*y-4*E-9*Ts))+C/720*(61+90*f+298*y+45*d-252*Ts-3*E);let z=(x-w/6*(1+2*f+y)+P/120*(5-2*y+28*f-3*E+8*Ts+24*d))/c;return z=bc(z+Qn(m0(e.number)),-Math.PI,Math.PI),[_d(z),_d(N)]}const Ed=-80,Sd=84,xv=-180,Ev=180;function Sv(i,t,e){i=bc(i,xv,Ev),t<Ed?t=Ed:t>Sd&&(t=Sd);const n=Qn(t),s=Math.sin(n),r=Math.cos(n),o=s/r,a=o*o,l=a*a,h=Qn(i),c=m0(e.number),u=Qn(c),f=ul/Math.sqrt(1-Ei*s**2),d=Ts*r**2,g=r*bc(h-u,-Math.PI,Math.PI),_=g*g,m=_*g,p=m*g,y=p*g,E=y*g,x=ul*(_0*n-fv*Math.sin(2*n)+dv*Math.sin(4*n)-gv*Math.sin(6*n)),S=cl*f*(g+m/6*(1-a+d)+y/120*(5-18*a+l+72*d-58*Ts))+5e5;let w=cl*(x+f*o*(_/2+p/24*(5-a+9*d+4*d**2)+E/720*(61-58*a+l+600*d-330*Ts)));return e.north||(w+=1e7),[S,w]}function m0(i){return(i-1)*6-180+3}const Mv=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function p0(i){let t=0;for(const s of Mv){const r=i.match(s);if(r){t=parseInt(r[1]);break}}if(!t)return null;let e=0,n=!1;return t>32700&&t<32761?e=t-32700:t>32600&&t<32661&&(n=!0,e=t-32600),e?{number:e,north:n}:null}function Md(i,t){return function(e,n,s,r){const o=e.length;s=s>1?s:2,r=r??s,n||(s>2?n=e.slice():n=new Array(o));for(let a=0;a<o;a+=r){const l=e[a],h=e[a+1],c=i(l,h,t);n[a]=c[0],n[a+1]=c[1]}return n}}function wv(i){return p0(i)?new Ls({code:i,units:"m"}):null}function Cv(i){const t=p0(i.getCode());return t?{forward:Md(Sv,t),inverse:Md(vv,t)}:null}const Tv=63710088e-1;function wd(i,t,e){e=e||Tv;const n=Qn(i[1]),s=Qn(t[1]),r=(s-n)/2,o=Qn(t[0]-i[0])/2,a=Math.sin(r)*Math.sin(r)+Math.sin(o)*Math.sin(o)*Math.cos(n)*Math.cos(s);return 2*e*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}const Rv=[Cv],Iv=[wv];let Lc=!0;function Pv(i){Lc=!1}function Fu(i,t){if(t!==void 0){for(let e=0,n=i.length;e<n;++e)t[e]=i[e];t=t}else t=i.slice();return t}function fl(i){uv(i.getCode(),i),Os(i,i,Fu)}function bv(i){i.forEach(fl)}function Kt(i){if(typeof i!="string")return i;const t=Xa(i);if(t)return t;for(const e of Iv){const n=e(i);if(n)return n}return null}function Cd(i,t,e,n){i=Kt(i);let s;const r=i.getPointResolutionFunc();if(r)s=r(t,e);else{const o=i.getUnits();if(o=="degrees"&&!n||n=="degrees")s=t;else{const a=Du(i,Kt("EPSG:4326"));if(!a&&o!=="degrees")s=t*i.getMetersPerUnit();else{let h=[e[0]-t/2,e[1],e[0]+t/2,e[1],e[0],e[1]-t/2,e[0],e[1]+t/2];h=a(h,h,2);const c=wd(h.slice(0,2),h.slice(2,4)),u=wd(h.slice(4,6),h.slice(6,8));s=(c+u)/2}const l=i.getMetersPerUnit();l!==void 0&&(s/=l)}}return s}function Oc(i){bv(i),i.forEach(function(t){i.forEach(function(e){t!==e&&Os(t,e,Fu)})})}function Av(i,t,e,n){i.forEach(function(s){t.forEach(function(r){Os(s,r,e),Os(r,s,n)})})}function Gu(i,t){return i?typeof i=="string"?Kt(i):i:Kt(t)}function Fc(i){return(function(t,e,n,s){const r=t.length;n=n!==void 0?n:2,s=s??n,e=e!==void 0?e:new Array(r);for(let o=0;o<r;o+=s){const a=i(t.slice(o,o+n)),l=a.length;for(let h=0,c=s;h<c;++h)e[o+h]=h>=l?t[o+h]:a[h]}return e})}function Lv(i,t,e,n){const s=Kt(i),r=Kt(t);Os(s,r,Fc(e)),Os(r,s,Fc(n))}function yn(i,t){if(i===t)return!0;const e=i.getUnits()===t.getUnits();return(i.getCode()===t.getCode()||Du(i,t)===Fu)&&e}function Du(i,t){const e=i.getCode(),n=t.getCode();let s=$a(e,n);if(s)return s;let r=null,o=null;for(const l of Rv)r||(r=l(i)),o||(o=l(t));if(!r&&!o)return null;const a="EPSG:4326";if(o)if(r)s=Fh(r.inverse,o.forward);else{const l=$a(e,a);l&&(s=Fh(l,o.forward))}else{const l=$a(a,n);l&&(s=Fh(r.inverse,l))}return s&&(fl(i),fl(t),Os(i,t,s)),s}function Fh(i,t){return function(e,n,s,r){return n=i(e,n,s,r),t(n,n,s,r)}}function jo(i,t){const e=Kt(i),n=Kt(t);return Du(e,n)}function Nu(i,t,e){const n=jo(t,e);if(!n){const s=Kt(t).getCode(),r=Kt(e).getCode();throw new Error(`No transform available between ${s} and ${r}`)}return n(i,void 0,i.length)}function Ov(i,t,e,n){const s=jo(t,e);return Jy(i,s,void 0)}function os(i,t){return i}function jt(i,t){return Lc&&!Ne(i,[0,0])&&i[0]>=-180&&i[0]<=180&&i[1]>=-90&&i[1]<=90&&(Lc=!1,h0("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),i}function nh(i,t){return i}function gn(i,t){return i}function Td(i,t,e){return function(n){let s,r;if(i.canWrapX()){const o=i.getExtent(),a=Et(o);n=n.slice(0),r=f0(n,i,a),r&&(n[0]=n[0]-r*a),n[0]=Vt(n[0],o[0],o[2]),n[1]=Vt(n[1],o[1],o[3]),s=e(n)}else s=e(n);return r&&t.canWrapX()&&(s[0]+=r*Et(t.getExtent())),s}}function Fv(){Oc(pd),Oc(vd),Av(vd,pd,av,lv)}Fv();new Array(6);function bi(){return[1,0,0,1,0,0]}function Gv(i,t){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i}function de(i,t){const e=t[0],n=t[1];return t[0]=i[0]*e+i[2]*n+i[4],t[1]=i[1]*e+i[3]*n+i[5],t}function Tn(i,t,e,n,s,r,o,a){const l=Math.sin(r),h=Math.cos(r);return i[0]=n*h,i[1]=s*l,i[2]=-n*l,i[3]=s*h,i[4]=o*n*h-a*n*l+t,i[5]=o*s*l+a*s*h+e,i}function y0(i,t){const e=Dv(t);Lt(e!==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 i[0]=o/e,i[1]=-s/e,i[2]=-r/e,i[3]=n/e,i[4]=(r*l-o*a)/e,i[5]=-(n*l-s*a)/e,i}function Dv(i){return i[0]*i[3]-i[1]*i[2]}const Nv=[1e5,1e5,1e5,1e5,2,2];function kv(i){return"matrix("+i.join(", ")+")"}function Gc(i){return i.substring(7,i.length-1).split(",").map(parseFloat)}function jv(i,t){const e=Gc(i),n=Gc(t);for(let s=0;s<6;++s)if(Math.round((e[s]-n[s])*Nv[s])!==0)return!1;return!0}function es(i,t,e,n,s,r,o){r=r||[],o=o||2;let a=0;for(let l=t;l<e;l+=n){const h=i[l],c=i[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++]=i[l+u]}return r&&r.length!=a&&(r.length=a),r}function ku(i,t,e,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<e;f+=n){const d=i[f]-h,g=i[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++]=i[_]}return o&&o.length!=u&&(o.length=u),o}function Bv(i,t,e,n,s,r,o,a){a=a||[];const l=o[0],h=o[1];let c=0;for(let u=t;u<e;u+=n){const f=i[u]-l,d=i[u+1]-h;a[c++]=l+s*f,a[c++]=h+r*d;for(let g=u+2;g<u+n;++g)a[c++]=i[g]}return a&&a.length!=c&&(a.length=c),a}function zv(i,t,e,n,s,r,o){o=o||[];let a=0;for(let l=t;l<e;l+=n){o[a++]=i[l]+s,o[a++]=i[l+1]+r;for(let h=l+2;h<l+n;++h)o[a++]=i[h]}return o&&o.length!=a&&(o.length=a),o}const Rd=bi(),Wv=[NaN,NaN];class ju extends Di{constructor(){super(),this.extent_=ti(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=t0((t,e,n)=>{if(!n)return this.getSimplifiedGeometry(e);const s=this.clone();return s.applyTransform(n),s.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return Mt()}closestPointXY(t,e,n,s){return Mt()}containsXY(t,e){return this.closestPointXY(t,e,Wv,Number.MIN_VALUE)===0}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return Mt()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Gr(e),this.extentRevision_=this.getRevision()}return Hy(this.extent_,t)}rotate(t,e){Mt()}scale(t,e,n){Mt()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return Mt()}getType(){return Mt()}applyTransform(t){Mt()}intersectsExtent(t){return Mt()}translate(t,e){Mt()}transform(t,e){const n=Kt(t),s=n.getUnits()=="tile-pixels"?function(r,o,a){const l=n.getExtent(),h=n.getWorldExtent(),c=_e(h)/_e(l);Tn(Rd,h[0],h[3],c,-c,0,0,0);const u=es(r,0,r.length,a,Rd,o),f=jo(n,e);return f?f(u,u,a):u}:jo(n,e);return this.applyTransform(s),this}}const Uv=le({__name:"OlFeature",props:{properties:{}},setup(i,{expose:t}){const e=i,n=Bt("vectorSource"),s=Bt("vectorLayer",null),o=Bt("heatmapLayer",null)||s,a=Bt("animation",null),l=Nt(new _i({...e.properties}));return ne(()=>e.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({}))}),ne(()=>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),m_(()=>{n?.value?.addFeature(l.value)})}),wi(()=>{n?.value?.removeFeature(l.value)}),Mi("feature",l),Mi("stylable",l),t({feature:l}),(h,c)=>Hi(h.$slots,"default")}});class cs 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 Mt()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=dl(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){Mt()}setLayout(t,e,n){let s;if(t)s=dl(t);else{for(let r=0;r<n;++r){if(e.length===0){this.layout="XY",this.stride=2;return}e=e[0]}s=e.length,t=Vv(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,e){const n=this.getFlatCoordinates();if(n){const s=this.getStride();ku(n,0,n.length,s,t,e,n),this.changed()}}scale(t,e,n){e===void 0&&(e=t),n||(n=Yi(this.getExtent()));const s=this.getFlatCoordinates();if(s){const r=this.getStride();Bv(s,0,s.length,r,t,e,n,s),this.changed()}}translate(t,e){const n=this.getFlatCoordinates();if(n){const s=this.getStride();zv(n,0,n.length,s,t,e,n),this.changed()}}}function Vv(i){let t;return i==2?t="XY":i==3?t="XYZ":i==4&&(t="XYZM"),t}function dl(i){let t;return i=="XY"?t=2:i=="XYZ"||i=="XYM"?t=3:i=="XYZM"&&(t=4),t}function Xv(i,t,e){const n=i.getFlatCoordinates();if(!n)return null;const s=i.getStride();return es(n,0,n.length,s,t,e)}function v0(i,t,e,n){let s=0;const r=i[e-n],o=i[e-n+1];let a=0,l=0;for(;t<e;t+=n){const h=i[t]-r,c=i[t+1]-o;s+=l*h-a*c,a=h,l=c}return s/2}function x0(i,t,e,n){let s=0;for(let r=0,o=e.length;r<o;++r){const a=e[r];s+=v0(i,t,a,n),t=a}return s}function $v(i,t,e,n){let s=0;for(let r=0,o=e.length;r<o;++r){const a=e[r];s+=x0(i,t,a,n),t=a[a.length-1]}return s}function Id(i,t,e,n,s,r,o){const a=i[t],l=i[t+1],h=i[e]-a,c=i[e+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=e;else if(f>0){for(let d=0;d<n;++d)o[d]=oi(i[t+d],i[e+d],f);o.length=n;return}else u=t}for(let f=0;f<n;++f)o[f]=i[u+f];o.length=n}function Bu(i,t,e,n,s){let r=i[t],o=i[t+1];for(t+=n;t<e;t+=n){const a=i[t],l=i[t+1],h=mn(r,o,a,l);h>s&&(s=h),r=a,o=l}return s}function zu(i,t,e,n,s){for(let r=0,o=e.length;r<o;++r){const a=e[r];s=Bu(i,t,a,n,s),t=a}return s}function Kv(i,t,e,n,s){for(let r=0,o=e.length;r<o;++r){const a=e[r];s=zu(i,t,a,n,s),t=a[a.length-1]}return s}function Wu(i,t,e,n,s,r,o,a,l,h,c){if(t==e)return h;let u,f;if(s===0){if(f=mn(o,a,i[t],i[t+1]),f<h){for(u=0;u<n;++u)l[u]=i[t+u];return l.length=n,f}return h}c=c||[NaN,NaN];let d=t+n;for(;d<e;)if(Id(i,d-n,d,n,o,a,c),f=mn(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&&(Id(i,e-n,t,n,o,a,c),f=mn(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(i,t,e,n,s,r,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,f=e.length;u<f;++u){const d=e[u];h=Wu(i,t,d,n,s,r,o,a,l,h,c),t=d}return h}function Yv(i,t,e,n,s,r,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,f=e.length;u<f;++u){const d=e[u];h=Uu(i,t,d,n,s,r,o,a,l,h,c),t=d[d.length-1]}return h}function E0(i,t,e,n){for(let s=0,r=e.length;s<r;++s)i[t++]=e[s];return t}function sh(i,t,e,n){for(let s=0,r=e.length;s<r;++s){const o=e[s];for(let a=0;a<n;++a)i[t++]=o[a]}return t}function Vu(i,t,e,n,s){s=s||[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=sh(i,t,e[o],n);s[r++]=l,t=l}return s.length=r,s}function qv(i,t,e,n,s){s=s||[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=Vu(i,t,e[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(i,t,e,n,s){s=s!==void 0?s:[];let r=0;for(let o=t;o<e;o+=n)s[r++]=i.slice(o,o+n);return s.length=r,s}function Bo(i,t,e,n,s){s=s!==void 0?s:[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];s[r++]=Xn(i,t,l,n,s[r]),t=l}return s.length=r,s}function Dc(i,t,e,n,s){s=s!==void 0?s:[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];s[r++]=l.length===1&&l[0]===t?[]:Bo(i,t,l,n,s[r]),t=l[l.length-1]}return s.length=r,s}function rh(i,t,e,n,s,r,o){const a=(e-t)/n;if(a<3){for(;t<e;t+=n)r[o++]=i[t],r[o++]=i[t+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const h=[t,e-n];let c=0;for(;h.length>0;){const u=h.pop(),f=h.pop();let d=0;const g=i[f],_=i[f+1],m=i[u],p=i[u+1];for(let y=f+n;y<u;y+=n){const E=i[y],x=i[y+1],S=Qy(E,x,g,_,m,p);S>d&&(c=y,d=S)}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++]=i[t+u*n],r[o++]=i[t+u*n+1]);return o}function S0(i,t,e,n,s,r,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=rh(i,t,c,n,s,r,o),a.push(o),t=c}return o}function Ss(i,t){return t*Math.round(i/t)}function Hv(i,t,e,n,s,r,o){if(t==e)return o;let a=Ss(i[t],s),l=Ss(i[t+1],s);t+=n,r[o++]=a,r[o++]=l;let h,c;do if(h=Ss(i[t],s),c=Ss(i[t+1],s),t+=n,t==e)return r[o++]=h,r[o++]=c,o;while(h==a&&c==l);for(;t<e;){const u=Ss(i[t],s),f=Ss(i[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(i,t,e,n,s,r,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=Hv(i,t,c,n,s,r,o),a.push(o),t=c}return o}function Zv(i,t,e,n,s,r,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l],u=[];o=Xu(i,t,c,n,s,r,o,u),a.push(u),t=c[c.length-1]}return o}class zo extends cs{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}clone(){return new zo(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,n,s){return s<zs(this.getExtent(),t,e)?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,e,n,s))}getArea(){return v0(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Xn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=rh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new zo(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=sh(this.flatCoordinates,0,t,this.stride),this.changed()}}let vn=class M0 extends cs{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new M0(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,s){const r=this.flatCoordinates,o=mn(t,e,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,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=E0(this.flatCoordinates,0,t,this.stride),this.changed()}};function Jv(i,t,e,n,s){return!Pu(s,function(o){return!Rs(i,t,e,n,o[0],o[1])})}function Rs(i,t,e,n,s,r){let o=0,a=i[e-n],l=i[e-n+1];for(;t<e;t+=n){const h=i[t],c=i[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(i,t,e,n,s,r){if(e.length===0||!Rs(i,t,e[0],n,s,r))return!1;for(let o=1,a=e.length;o<a;++o)if(Rs(i,e[o-1],e[o],n,s,r))return!1;return!0}function Qv(i,t,e,n,s,r){if(e.length===0)return!1;for(let o=0,a=e.length;o<a;++o){const l=e[o];if($u(i,t,l,n,s,r))return!0;t=l[l.length-1]}return!1}function Ku(i,t,e,n,s,r,o){let a,l,h,c,u,f,d;const g=s[r+1],_=[];for(let y=0,E=e.length;y<E;++y){const x=e[y];for(c=i[x-n],f=i[x-n+1],a=t;a<x;a+=n)u=i[a],d=i[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(_n),c=_[0],a=1,l=_.length;a<l;++a){u=_[a];const y=Math.abs(u-c);y>p&&(h=(c+u)/2,$u(i,t,e,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 w0(i,t,e,n,s){let r=[];for(let o=0,a=e.length;o<a;++o){const l=e[o];r=Ku(i,t,l,n,s,2*o,r),t=l[l.length-1]}return r}function C0(i,t,e,n,s){let r;for(t+=n;t<e;t+=n)if(r=s(i.slice(t-n,t),i.slice(t,t+n)),r)return r;return!1}function Pd(i,t){const[e,n]=i,[s,r]=t,o=((e[0]-s[0])*(s[1]-r[1])-(e[1]-s[1])*(s[0]-r[0]))/((e[0]-n[0])*(s[1]-r[1])-(e[1]-n[1])*(s[0]-r[0])),a=((e[0]-s[0])*(e[1]-n[1])-(e[1]-s[1])*(e[0]-n[0]))/((e[0]-n[0])*(s[1]-r[1])-(e[1]-n[1])*(s[0]-r[0]));if(0<=o&&o<=1&&0<=a&&a<=1)return[e[0]+o*(n[0]-e[0]),e[1]+o*(n[1]-e[1])]}function oh(i,t,e,n,s,r){return r=r??r0(ti(),i,t,e,n),Fe(s,r)?r[0]>=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:C0(i,t,e,n,function(o,a){return Zy(s,o,a)}):!1}function tx(i,t,e,n,s){for(let r=0,o=e.length;r<o;++r){if(oh(i,t,e[r],n,s))return!0;t=e[r]}return!1}function T0(i,t,e,n,s){return!!(oh(i,t,e,n,s)||Rs(i,t,e,n,s[0],s[1])||Rs(i,t,e,n,s[0],s[3])||Rs(i,t,e,n,s[2],s[1])||Rs(i,t,e,n,s[2],s[3]))}function R0(i,t,e,n,s){if(!T0(i,t,e[0],n,s))return!1;if(e.length===1)return!0;for(let r=1,o=e.length;r<o;++r)if(Jv(i,e[r-1],e[r],n,s)&&!oh(i,e[r-1],e[r],n,s))return!1;return!0}function ex(i,t,e,n,s){for(let r=0,o=e.length;r<o;++r){const a=e[r];if(R0(i,t,a,n,s))return!0;t=a[a.length-1]}return!1}function ix(i,t,e,n){for(;t<e-n;){for(let s=0;s<n;++s){const r=i[t+s];i[t+s]=i[e-n+s],i[e-n+s]=r}t+=n,e-=n}}function Yu(i,t,e,n){let s=0,r=i[e-n],o=i[e-n+1];for(;t<e;t+=n){const a=i[t],l=i[t+1];s+=(a-r)*(l+o),r=a,o=l}return s===0?void 0:s>0}function I0(i,t,e,n,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r<o;++r){const a=e[r],l=Yu(i,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 nx(i,t,e,n,s){for(let r=0,o=e.length;r<o;++r){const a=e[r];if(!I0(i,t,a,n,s))return!1;a.length&&(t=a[a.length-1])}return!0}function Nc(i,t,e,n,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r<o;++r){const a=e[r],l=Yu(i,t,a,n);(r===0?s&&l||!s&&!l:s&&!l||!s&&l)&&ix(i,t,a,n),t=a}return t}function bd(i,t,e,n,s){for(let r=0,o=e.length;r<o;++r)t=Nc(i,t,e[r],n,s);return t}function sx(i,t){const e=[];let n=0,s=0,r;for(let o=0,a=t.length;o<a;++o){const l=t[o],h=Yu(i,n,l,2);if(r===void 0&&(r=h),h===r)e.push(t.slice(s,o+1));else{if(e.length===0)continue;e[e.length-1].push(t[s])}s=o+1,n=l}return e}class Fi extends cs{constructor(t,e,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,e!==void 0&&n?(this.setFlatCoordinates(e,t),this.ends_=n):this.setCoordinates(t,e)}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,e,n,s){return s<zs(this.getExtent(),t,e)?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,e,n,s))}containsXY(t,e){return $u(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return x0(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),Nc(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,Bo(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Yi(this.getExtent());this.flatInteriorPoint_=Ku(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new vn(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new zo(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=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 zo(e.slice(r,l),t);s.push(h),r=l}return s}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;I0(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Nc(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=Xu(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,n),new Fi(e,"XY",n)}getType(){return"Polygon"}intersectsExtent(t){return R0(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,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 Ad(i){if(Dr(i))throw new Error("Cannot create polygon from empty extent");const t=i[0],e=i[1],n=i[2],s=i[3],r=[t,e,t,s,n,s,n,e,t,e];return new Fi(r,"XY",[r.length])}function rx(i,t,e){t=t||32;const n=i.getStride(),s=i.getLayout(),r=i.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 ox(h,r,i.getRadius()),h}function ox(i,t,e,n){const s=i.getFlatCoordinates(),r=i.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]+e*Math.cos(c),s[h+1]=t[1]+e*Math.sin(c)}i.changed()}function ax(i){if("styles"in i){const{styles:t,...e}=Wl(ta(i));return{style:t,...e}}else return i}function bn(i){const t=Yl();let e={debug:!1};t&&(e=Bt("ol-options",e));const n=ax(i),s=ta(n);return e?.debug&&console.debug("[Vue3-OpenLayers Debug] PROPS",{in:i,out:s}),s}const P0=["change","error","propertychange"],lx=["change:extent","change:maxResolution","change:maxZoom","change:minResolution","change:minZoom","change:opacity","change:source","change:visible","change:zIndex","postrender","prerender","sourceready"],hx=["tileloadend","tileloaderror","tileloadstart"],cx=["imageloadend","imageloaderror","imageloadstart"],ux=["addfeature","changefeature","clear","featuresloadend","featuresloaderror","featuresloadstart","removefeature"];function kr(i,t){const e=Yl();let n={debug:!1};e&&(n=Bt("ol-options",n));function s(){[...P0,...t].forEach(r=>{let o;pe(i)?o=i.value:o=i,o.on(r,(...a)=>{n?.debug&&console.debug("[Vue3-OpenLayers Debug] EVENT",r,{eventName:r,args:a,source:i}),e?.emit(r,...a)})})}return e&&ei(()=>{s()}),{updateOpenLayersEventHandlers:s}}const ee={ADD:"add",REMOVE:"remove"},Ld={LENGTH:"length"};class Ea extends ii{constructor(t,e,n){super(t),this.element=e,this.index=n}}class Me extends Di{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.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 e=0,n=t.length;e<n;++e)this.push(t[e]);return this}forEach(t){const e=this.array_;for(let n=0,s=e.length;n<s;++n)t(e[n],n,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(Ld.LENGTH)}insertAt(t,e){if(t<0||t>this.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new Ea(ee.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let n=0,s=e.length;n<s;++n)if(e[n]===t)return this.removeAt(n)}removeAt(t){if(t<0||t>=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Ea(ee.REMOVE,e,t)),e}setAt(t,e){const n=this.getLength();if(t>=n){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const s=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Ea(ee.REMOVE,s,t)),this.dispatchEvent(new Ea(ee.ADD,e,t))}updateLength_(){this.set(Ld.LENGTH,this.array_.length)}assertUnique_(t,e){const n=this.array_;for(let s=0,r=n.length;s<r;++s)if(n[s]===t&&s!==e)throw new Error("Duplicate item added to a unique collection")}}class tr extends ii{constructor(t,e,n){super(t),this.map=e,this.frameState=n!==void 0?n:null}}class ln extends tr{constructor(t,e,n,s,r,o){super(t,e,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 xt={SINGLECLICK:"singleclick",CLICK:lt.CLICK,DBLCLICK:lt.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Fs=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",fx=Fs.includes("safari")&&!Fs.includes("chrom");fx&&(Fs.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Fs));const dx=Fs.includes("webkit")&&!Fs.includes("edge"),b0=Fs.includes("macintosh"),gx=typeof devicePixelRatio<"u"?devicePixelRatio:1,mi=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,A0=typeof Image<"u"&&Image.prototype.decode,_x=typeof createImageBitmap=="function",L0=(function(){let i=!1;try{const t=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return i})(),kc={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown"};class mx extends na{constructor(t,e){super(t),this.map_=t,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=e===void 0?1:e,this.down_=null;const n=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=n,this.pointerdownListenerKey_=mt(n,kc.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=mt(n,kc.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(lt.TOUCHMOVE,this.boundHandleTouchMove_,L0?{passive:!1}:!1)}emulateClick_(t){let e=new ln(xt.CLICK,this.map_,t);this.dispatchEvent(e),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new ln(xt.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const n=new ln(xt.SINGLECLICK,this.map_,t);this.dispatchEvent(n)},250)}updateActivePointers_(t){const e=t,n=e.pointerId;if(e.type==xt.POINTERUP||e.type==xt.POINTERCANCEL){delete this.trackedTouches_[n];for(const s in this.trackedTouches_)if(this.trackedTouches_[s].target!==e.target){delete this.trackedTouches_[s];break}}else(e.type==xt.POINTERDOWN||e.type==xt.POINTERMOVE)&&(this.trackedTouches_[n]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new ln(xt.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(It),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 e=new ln(xt.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),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(mt(n,xt.POINTERMOVE,this.handlePointerMove_,this),mt(n,xt.POINTERUP,this.handlePointerUp_,this),mt(this.element_,xt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(mt(this.element_.getRootNode(),xt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new ln(xt.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new ln(xt.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;(!e||e.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_&&(It(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(lt.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(It(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(It),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const hn={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Ie={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},st={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},gl=1/0;class px{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Bs(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,n=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const s=this.keyFunction_(n);return delete this.queuedElements_[s],n}enqueue(t){Lt(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=gl?(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,n=this.priorities_,s=e.length,r=e[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;e[t]=e[c],n[t]=n[c],t=c}e[t]=r,n[t]=o,this.siftDown_(a,t)}siftDown_(t,e){const n=this.elements_,s=this.priorities_,r=n[e],o=s[e];for(;e>t;){const a=this.getParentIndex_(e);if(s[a]>o)n[e]=n[a],s[e]=s[a],e=a;else break}n[e]=r,s[e]=o}reprioritize(){const t=this.priorityFunction_,e=this.elements_,n=this.priorities_;let s=0;const r=e.length;let o,a,l;for(a=0;a<r;++a)o=e[a],l=t(o),l==gl?delete this.queuedElements_[this.keyFunction_(o)]:(n[s]=l,e[s++]=o);e.length=s,n.length=s,this.heapify_()}}class yx extends px{constructor(t,e){super(n=>t.apply(null,n),n=>n[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=e,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(t){const e=super.enqueue(t);return e&&t[0].addEventListener(lt.CHANGE,this.boundHandleTileChange_),e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target,n=e.getState();if(n===st.LOADED||n===st.ERROR||n===st.EMPTY){n!==st.ERROR&&e.removeEventListener(lt.CHANGE,this.boundHandleTileChange_);const s=e.getKey();s in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[s],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let n=0;for(;this.tilesLoading_<t&&n<e&&this.getCount()>0;){const s=this.dequeue()[0],r=s.getKey();s.getState()===st.IDLE&&!(r in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++n,s.load())}}}function vx(i,t,e,n,s){if(!i||!(e in i.wantedTiles)||!i.wantedTiles[e][t.getKey()])return gl;const r=i.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 Od(i,t,e){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=i[0]+l/2+c,d=i[2]-l/2+c,g=i[1]+h/2+u,_=i[3]-h/2+u;f>d&&(f=(d+f)/2,d=f),g>_&&(g=(_+g)/2,_=g);let m=Vt(n[0],f,d),p=Vt(n[1],g,_);if(o&&e&&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 xx(i){return i}function O0(i){return Math.pow(i,3)}function jr(i){return 1-O0(1-i)}function Ex(i){return 3*i*i-2*i*i*i}function Sx(i){return i}function qu(i,t,e,n){const s=Et(t)/e[0],r=_e(t)/e[1];return n?Math.min(i,Math.max(s,r)):Math.min(i,Math.min(s,r))}function Hu(i,t,e){let n=Math.min(i,t);const s=50;return n*=Math.log(1+s*Math.max(0,i/t-1))/s+1,e&&(n=Math.max(n,e),n/=Math.log(1+s*Math.max(0,e/i-1))/s+1),Vt(n,e/2,t*2)}function Mx(i,t,e,n){return t=t!==void 0?t:!0,(function(s,r,o,a){if(s!==void 0){const l=i[0],h=i[i.length-1],c=e?qu(l,e,o,n):l;if(a)return t?Hu(s,c,h):Vt(s,h,c);const u=Math.min(c,s),f=Math.floor(Hl(i,u,r));return i[f]>c&&f<i.length-1?i[f+1]:i[f]}})}function wx(i,t,e,n,s,r){return n=n!==void 0?n:!0,e=e!==void 0?e: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,e):Vt(o,e,c);const u=1e-9,f=Math.ceil(Math.log(t/c)/Math.log(i)-u),d=-a*(.5-u)+.5,g=Math.min(c,o),_=Math.floor(Math.log(t/g)/Math.log(i)+d),m=Math.max(f,_),p=t/Math.pow(i,m);return Vt(p,e,c)}})}function Fd(i,t,e,n,s){return e=e!==void 0?e:!0,(function(r,o,a,l){if(r!==void 0){const h=n?qu(i,n,a,s):i;return!e||!l?Vt(r,t,h):Hu(r,h,t)}})}function Zu(i){if(i!==void 0)return 0}function Gd(i){if(i!==void 0)return i}function Cx(i){const t=2*Math.PI/i;return(function(e,n){if(n)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e})}function Tx(i){const t=Qn(5);return(function(e,n){return n||e===void 0?e:Math.abs(e)<=t?0:e})}const Rx=42,Ju=256,Gh=0;class Wi 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&&Pv(),t.center&&(t.center=jt(t.center,this.projection_)),t.extent&&(t.extent=gn(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const a in Ci)delete e[a];this.setProperties(e,!0);const n=Px(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=Ix(t),r=n.constraint,o=bx(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 e=this.padding_;this.padding_=t;const n=this.getCenterInternal();if(n){const s=t||[0,0,0,0];e=e||[0,0,0,0];const r=this.getResolution(),o=r/2*(s[3]-e[3]+e[1]-s[1]),a=r/2*(s[0]-e[0]+e[2]-s[2]);this.setCenterInternal([n[0]+o,n[1]-a])}}getUpdatedOptions_(t){const e=this.getProperties();return e.resolution!==void 0?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Object.assign({},e,t)}animate(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const e=new Array(arguments.length);for(let n=0;n<e.length;++n){let s=arguments[n];s.center&&(s=Object.assign({},s),s.center=jt(s.center,this.getProjection())),s.anchor&&(s=Object.assign({},s),s.anchor=jt(s.anchor,this.getProjection())),e[n]=s}this.animateInternal.apply(this,e)}animateInternal(t){let e=arguments.length,n;e>1&&typeof arguments[e-1]=="function"&&(n=arguments[e-1],--e);let s=0;for(;s<e&&!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===e){n&&Sa(n,!0);return}let r=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_;const h=[];for(;s<e;++s){const c=arguments[s],u={start:r,complete:!1,anchor:c.anchor,duration:c.duration!==void 0?c.duration:1e3,easing:c.easing||Ex,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}Ax(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 e=0,n=this.animations_.length;e<n;++e){const s=this.animations_[e];if(s[0].callback&&Sa(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 e=!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),e=!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&&Sa(o,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let n;const s=this.getCenterInternal();return s!==void 0&&(n=[s[0]-e[0],s[1]-e[1]],bu(n,t-this.getRotation()),ev(n,e)),n}calculateCenterZoom(t,e){let n;const s=this.getCenterInternal(),r=this.getResolution();if(s!==void 0&&r!==void 0){const o=e[0]-t*(e[0]-s[0])/r,a=e[1]-t*(e[1]-s[1])/r;n=[o,a]}return n}getViewportSize_(t){const e=this.viewportSize_;if(t){const n=e[0],s=e[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 e}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 e=this.calculateExtentInternal(t);return nh(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();Lt(e,"The view center is not defined");const n=this.getResolution();Lt(n!==void 0,"The view resolution is not defined");const s=this.getRotation();return Lt(s!==void 0,"The view rotation is not defined"),hl(e,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,e){return this.getResolutionForExtentInternal(gn(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const n=Et(t)/e[0],s=_e(t)/e[1];return Math.max(n,s)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,s=Math.log(e/n)/Math.log(t);return(function(r){return e/Math.pow(t,r*s)})}getRotation(){return this.get(Ci.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),s=this.minResolution_,r=Math.log(n/s)/e;return(function(o){return Math.log(n/o)/e/r})}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),n=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const o=this.getViewportSizeMinusPadding_();s=Dh(s,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],e,n)}return{center:s.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,n,s;if(this.resolutions_){const r=Hl(this.resolutions_,t,1);e=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 e+Math.log(n/t)/Math.log(s)}getResolutionForZoom(t){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];const e=Vt(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,Vt(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let n;if(Lt(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){Lt(!Dr(t),"Cannot fit empty extent provided as `geometry`");const s=gn(t,this.getProjection());n=Ad(s)}else if(t.getType()==="Circle"){const s=gn(t.getExtent(),this.getProjection());n=Ad(s),n.rotate(this.getRotation(),Yi(s))}else n=t;this.fitInternal(n,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),n=Math.cos(e),s=Math.sin(-e),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,e){e=e||{};let n=e.size;n||(n=this.getViewportSizeMinusPadding_());const s=e.padding!==void 0?e.padding:[0,0,0,0],r=e.nearest!==void 0?e.nearest:!1;let o;e.minResolution!==void 0?o=e.minResolution:e.maxZoom!==void 0?o=this.getResolutionForZoom(e.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=Yi(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=e.callback?e.callback:ko;e.duration!==void 0?this.animateInternal({resolution:l,center:_,duration:e.duration,easing:e.easing},m):(this.targetResolution_=l,this.targetCenter_=_,this.applyTargetState_(!1,!0),Sa(m,!0))}centerOn(t,e,n){this.centerOnInternal(jt(t,this.getProjection()),e,n)}centerOnInternal(t,e,n){this.setCenterInternal(Dh(t,e,n,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,n,s){let r;const o=this.padding_;if(o&&t){const a=this.getViewportSizeMinusPadding_(-n),l=Dh(t,s,[a[0]/2+o[3],a[1]/2+o[0]],e,n);r=[t[0]-l[0],t[1]-l[1]]}return r}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(t){const e=os(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])}adjustCenterInternal(t){const e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])}adjustResolution(t,e){e=e&&jt(e,this.getProjection()),this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){const n=this.getAnimating()||this.getInteracting(),s=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,s,n);e&&(this.targetCenter_=this.calculateCenterZoom(r,e)),this.targetResolution_*=t,this.applyTargetState_()}adjustZoom(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)}adjustRotation(t,e){e&&(e=jt(e,this.getProjection())),this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){const n=this.getAnimating()||this.getInteracting(),s=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(s,e)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t&&jt(t,this.getProjection()))}setCenterInternal(t){this.targetCenter_=t,this.applyTargetState_()}setHint(t,e){return this.hints_[t]+=e,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,e){const n=this.getAnimating()||this.getInteracting()||e,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,e,n){t=t!==void 0?t:200;const s=e||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,e,n){n=n&&jt(n,this.getProjection()),this.endInteractionInternal(t,e,n)}endInteractionInternal(t,e,n){this.getInteracting()&&(this.setHint(be.INTERACTING,-1),this.resolveConstraints(t,e,n))}getConstrainedCenter(t,e){const n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),n)}getConstrainedZoom(t,e){const n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,e))}getConstrainedResolution(t,e){e=e||0;const n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,n)}}function Sa(i,t){setTimeout(function(){i(t)},0)}function Ix(i){if(i.extent!==void 0){const e=i.smoothExtentConstraint!==void 0?i.smoothExtentConstraint:!0;return Od(i.extent,i.constrainOnlyCenter,e)}const t=Gu(i.projection,"EPSG:3857");if(i.multiWorld!==!0&&t.isGlobal()){const e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,Od(e,!1,!1)}return xx}function Px(i){let t,e,n,o=i.minZoom!==void 0?i.minZoom:Gh,a=i.maxZoom!==void 0?i.maxZoom:28;const l=i.zoomFactor!==void 0?i.zoomFactor:2,h=i.multiWorld!==void 0?i.multiWorld:!1,c=i.smoothResolutionConstraint!==void 0?i.smoothResolutionConstraint:!0,u=i.showFullExtent!==void 0?i.showFullExtent:!1,f=Gu(i.projection,"EPSG:3857"),d=f.getExtent();let g=i.constrainOnlyCenter,_=i.extent;if(!h&&!_&&f.isGlobal()&&(g=!1,_=d),i.resolutions!==void 0){const m=i.resolutions;e=m[o],n=m[a]!==void 0?m[a]:m[m.length-1],i.constrainResolution?t=Mx(m,c,!g&&_,u):t=Fd(e,n,c,!g&&_,u)}else{const p=(d?Math.max(Et(d),_e(d)):360*Au.degrees/f.getMetersPerUnit())/Ju/Math.pow(2,Gh),y=p/Math.pow(2,28-Gh);e=i.maxResolution,e!==void 0?o=0:e=p/Math.pow(l,o),n=i.minResolution,n===void 0&&(i.maxZoom!==void 0?i.maxResolution!==void 0?n=e/Math.pow(l,a):n=p/Math.pow(l,a):n=y),a=o+Math.floor(Math.log(e/n)/Math.log(l)),n=e/Math.pow(l,a-o),i.constrainResolution?t=wx(l,e,n,c,!g&&_,u):t=Fd(e,n,c,!g&&_,u)}return{constraint:t,maxResolution:e,minResolution:n,minZoom:o,zoomFactor:l}}function bx(i){if(i.enableRotation!==void 0?i.enableRotation:!0){const e=i.constrainRotation;return e===void 0||e===!0?Tx():e===!1?Gd:typeof e=="number"?Cx(e):Gd}return Zu}function Ax(i){return!(i.sourceCenter&&i.targetCenter&&!Ne(i.sourceCenter,i.targetCenter)||i.sourceResolution!==i.targetResolution||i.sourceRotation!==i.targetRotation)}function Dh(i,t,e,n,s){const r=Math.cos(-s);let o=Math.sin(-s),a=i[0]*r-i[1]*o,l=i[1]*r+i[0]*o;a+=(t[0]/2-e[0])*n,l+=(e[1]-t[1]/2)*n,o=-o;const h=a*r-l*o,c=l*r+a*o;return[h,c]}const Ma="ol-hidden",Lx="ol-selectable",ah="ol-unselectable",Qu="ol-control",Dd="ol-collapsed",Ox=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"),Nd=["style","variant","weight","size","lineHeight","family"],jc={normal:400,bold:700},Bc=function(i){const t=i.match(Ox);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"400",variant:"normal"};for(let n=0,s=Nd.length;n<s;++n){const r=t[n+1];r!==void 0&&(e[Nd[n]]=typeof r=="string"?r.trim():r)}return isNaN(Number(e.weight))&&e.weight in jc&&(e.weight=jc[e.weight]),e.families=e.family.split(/,\s?/).map(n=>n.trim().replace(/^['"]|['"]$/g,"")),e};function ce(i,t,e,n){let s;return e&&e.length?s=e.shift():mi?s=new class extends OffscreenCanvas{style={}}(i??300,t??150):s=document.createElement("canvas"),i&&(s.width=i),t&&(s.height=t),s.getContext("2d",n)}let Nh;function _l(){return Nh||(Nh=ce(1,1)),Nh}function lh(i){const t=i.canvas;t.width=1,t.height=1,i.clearRect(0,0,1,1)}function Fx(i){let t=i.offsetWidth;const e=getComputedStyle(i);return t+=parseInt(e.marginLeft,10)+parseInt(e.marginRight,10),t}function Gx(i){let t=i.offsetHeight;const e=getComputedStyle(i);return t+=parseInt(e.marginTop,10)+parseInt(e.marginBottom,10),t}function kd(i,t){const e=t.parentNode;e&&e.replaceChild(i,t)}function F0(i){for(;i.lastChild;)i.lastChild.remove()}function Dx(i,t){const e=i.childNodes;for(let n=0;;++n){const s=e[n],r=t[n];if(!s&&!r)break;if(s!==r){if(!s){i.appendChild(r);continue}if(!r){i.removeChild(s),--n;continue}i.insertBefore(r,s)}}}function G0(){return new Proxy({childNodes:[],appendChild:function(t){return this.childNodes.push(t),t},remove:function(){},removeChild:function(t){const e=this.childNodes.indexOf(t);if(e===-1)throw new Error("Node to remove was not found");return this.childNodes.splice(e,1),t},insertBefore:function(t,e){const n=this.childNodes.indexOf(e);if(n===-1)throw new Error("Reference node not found");return this.childNodes.splice(n,0,t),t},style:{}},{get(t,e,n){return e==="firstElementChild"?t.childNodes.length>0?t.childNodes[0]:null:Reflect.get(t,e,n)}})}function $n(i){return typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas}class tf extends Di{constructor(t){super();const e=t.element;e&&!t.target&&!e.style.pointerEvents&&(e.style.pointerEvents="auto"),this.element=e||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 e=0,n=this.listenerKeys.length;e<n;++e)It(this.listenerKeys[e]);if(this.listenerKeys.length=0,this.map_=t,t){const e=this.target_??t.getOverlayContainerStopEvent();this.element&&e.appendChild(this.element),this.render!==ko&&this.listenerKeys.push(mt(t,hn.POSTRENDER,this.render,this)),t.render()}}render(t){}setTarget(t){this.target_=typeof t=="string"?document.getElementById(t):t}}class Nx 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 e=t.className!==void 0?t.className:"ol-attribution",n=t.tipLabel!==void 0?t.tipLabel:"Attributions",s=t.expandClassName!==void 0?t.expandClassName:e+"-expand",r=t.collapseLabel!==void 0?t.collapseLabel:"›",o=t.collapseClassName!==void 0?t.collapseClassName:e+"-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(lt.CLICK,this.handleClick_.bind(this),!1);const h=e+" "+ah+" "+Qu+(this.collapsed_&&this.collapsible_?" "+Dd:"")+(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 e=this.getMap().getAllLayers(),n=new Set(e.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=!e.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 e=await Promise.all(this.collectSourceAttributions_(t).map(s=>e0(()=>s))),n=e.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!Pn(e,this.renderedAttributions_)){F0(this.ulElement_);for(let s=0,r=e.length;s<r;++s){const o=document.createElement("li");o.innerHTML=e[s],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}handleClick_(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(Dd),this.collapsed_?kd(this.collapseLabel_,this.label_):kd(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 kx extends tf{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target});const e=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=e+"-reset",o.setAttribute("type","button"),o.title=r,o.appendChild(this.label_),o.addEventListener(lt.CLICK,this.handleClick_.bind(this),!1);const a=e+" "+ah+" "+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(Ma)}handleClick_(t){t.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const e=this.getMap().getView();if(!e)return;const n=e.getRotation();n!==void 0&&(this.duration_>0&&n%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:jr}):e.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const n=e.viewState.rotation;if(n!=this.rotation_){const s="rotate("+n+"rad)";if(this.autoHide_){const r=this.element.classList.contains(Ma);!r&&n===0?this.element.classList.add(Ma):r&&n!==0&&this.element.classList.remove(Ma)}this.label_.style.transform=s}this.rotation_=n}}class jx extends tf{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=t.className!==void 0?t.className:"ol-zoom",n=t.delta!==void 0?t.delta:1,s=t.zoomInClassName!==void 0?t.zoomInClassName:e+"-in",r=t.zoomOutClassName!==void 0?t.zoomOutClassName:e+"-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(lt.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(lt.CLICK,this.handleClick_.bind(this,-n),!1);const f=e+" "+ah+" "+Qu,d=this.element;d.className=f,d.appendChild(c),d.appendChild(u),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,e){e.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 Bx(i){i=i||{};const t=new Me;return(i.zoom!==void 0?i.zoom:!0)&&t.push(new jx(i.zoomOptions)),(i.rotate!==void 0?i.rotate:!0)&&t.push(new kx(i.rotateOptions)),(i.attribution!==void 0?i.attribution:!0)&&t.push(new Nx(i.attributionOptions)),t}class zx{constructor(t,e,n){this.decay_=t,this.minVelocity_=e,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;const t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;let n=e-3;for(;n>0&&this.points_[n+2]>t;)n-=3;const s=this.points_[e+2]-this.points_[n+2];if(s<1e3/60)return!1;const r=this.points_[e]-this.points_[n],o=this.points_[e+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 zc={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(zc.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(zc.ACTIVE,t)}setMap(t){this.map_=t}}function Wx(i,t,e){const n=i.getCenterInternal();if(n){const s=[n[0]+t[0],n[1]+t[1]];i.animateInternal({duration:e!==void 0?e:250,easing:Sx,center:i.getConstrainedCenter(s)})}}function ef(i,t,e,n){const s=i.getZoom();if(s===void 0)return;const r=i.getConstrainedZoom(s+t),o=i.getResolutionForZoom(r);i.getAnimating()&&i.cancelAnimations(),i.animate({resolution:o,anchor:e,duration:n!==void 0?n:250,easing:jr})}class Ux 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 e=!1;if(t.type==xt.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(),e=!0}return!e}}function Wc(i){const t=arguments;return function(e){let n=!0;for(let s=0,r=t.length;s<r&&(n=n&&t[s](e),!!n);++s);return n}}const Vx=function(i){const t=i.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},Xx=function(i){const t=i.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},$x=function(i){const t=i.map.getTargetElement(),e=t.getRootNode(),n=i.map.getOwnerDocument().activeElement;return e instanceof ShadowRoot?e.host.contains(n):t.contains(n)},D0=function(i){const t=i.map.getTargetElement(),e=t.getRootNode();return(e instanceof ShadowRoot?e.host:t).hasAttribute("tabindex")?$x(i):!0},xr=Cn,N0=function(i){const t=i.originalEvent;return"pointerId"in t&&t.button==0&&!(dx&&b0&&t.ctrlKey)},ml=js,k0=function(i){return i.type==xt.SINGLECLICK},nf=function(i){const t=i.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},Kx=function(i){const t=i.originalEvent;return b0?t.metaKey:t.ctrlKey},pl=function(i){const t=i.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},j0=function(i){const t=i.originalEvent,e=t.target.tagName;return e!=="INPUT"&&e!=="SELECT"&&e!=="TEXTAREA"&&!t.target.isContentEditable},kh=function(i){const t=i.originalEvent;return"pointerId"in t&&t.pointerType=="mouse"},B0=function(i){const t=i.originalEvent;return"pointerId"in t&&t.isPrimary&&t.button===0};class us 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 e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==xt.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==xt.POINTERUP){const n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==xt.POINTERDOWN){const n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==xt.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function sf(i){const t=i.length;let e=0,n=0;for(let s=0;s<t;s++)e+=i[s].clientX,n+=i[s].clientY;return{clientX:e/t,clientY:n/t}}class Yx extends us{constructor(t){super({stopDown:js}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const e=t.condition?t.condition:Wc(nf,B0);this.condition_=t.onFocusOnly?Wc(D0,e):e,this.noKinetic_=!1}handleDragEvent(t){const e=t.map;this.panning_||(this.panning_=!0,e.getView().beginInteraction());const n=this.targetPointers,s=e.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();nv(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 e=t.map,n=e.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=e.getPixelFromCoordinateInternal(o),l=e.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 qx extends us{constructor(t){t=t||{},super({stopDown:js}),this.condition_=t.condition?t.condition:Xx,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!kh(t))return;const e=t.map,n=e.getView();if(n.getConstraints().rotation===Zu)return;const s=e.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 kh(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return kh(t)&&N0(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class Hx extends ql{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_,e=this.endPixel_,n="px",s=this.element_.style;s.left=Math.min(t[0],e[0])+n,s.top=Math.min(t[1],e[1])+n,s.width=Math.abs(e[0]-t[0])+n,s.height=Math.abs(e[1]-t[1])+n}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const t=this.startPixel_,e=this.endPixel_,s=[t,[t[0],e[1]],e,[e[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,e,n){super(t),this.coordinate=e,this.mapBrowserEvent=n}}class Zx extends us{constructor(t){super(),this.on,this.once,this.un,t=t??{},this.box_=new Hx(t.className||"ol-dragbox"),this.minArea_=t.minArea??64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition??N0,this.boxEndCondition_=t.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,n){const s=n[0]-e[0],r=n[1]-e[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 e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Zr(e?$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 Jx extends Zx{constructor(t){t=t||{};const e=t.condition?t.condition:pl;super({condition:e,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 xs={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class Qx extends Br{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return nf(e)&&j0(e)},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 e=!1;if(t.type==lt.KEYDOWN){const n=t.originalEvent,s=n.key;if(this.condition_(t)&&(s==xs.DOWN||s==xs.LEFT||s==xs.RIGHT||s==xs.UP)){const o=t.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,h=0;s==xs.DOWN?h=-a:s==xs.LEFT?l=-a:s==xs.RIGHT?l=a:h=a;const c=[l,h];bu(c,o.getRotation()),Wx(o,c,this.duration_),n.preventDefault(),e=!0}}return!e}}class tE extends Br{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(e){return!Kx(e)&&j0(e)},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(t){let e=!1;if(t.type==lt.KEYDOWN||t.type==lt.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(),e=!0}}return!e}}const eE=40,iE=300;class nE 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 e=t.condition?t.condition:xr;this.condition_=t.onFocusOnly?Wc(D0,e):e,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!==lt.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*=eE;break;case WheelEvent.DOM_DELTA_PAGE:r*=iE;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 e=t.getView();e.getAnimating()&&e.cancelAnimations();let n=-Vt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),ef(e,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 sE extends us{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=js),super(e),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 e=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),e=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(e,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 e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}class rE extends us{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=js),super(e),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=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&&(e=this.lastDistance_/a),this.lastDistance_=a;const l=t.map,h=l.getView();e!=1&&(this.lastScaleDelta_=e),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(sf(this.targetPointers))),l.render(),h.adjustResolutionInternal(e,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 e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}function oE(i){i=i||{};const t=new Me,e=new zx(-.005,.05,100);return(i.altShiftDragRotate!==void 0?i.altShiftDragRotate:!0)&&t.push(new qx),(i.doubleClickZoom!==void 0?i.doubleClickZoom:!0)&&t.push(new Ux({delta:i.zoomDelta,duration:i.zoomDuration})),(i.dragPan!==void 0?i.dragPan:!0)&&t.push(new Yx({onFocusOnly:i.onFocusOnly,kinetic:e})),(i.pinchRotate!==void 0?i.pinchRotate:!0)&&t.push(new sE),(i.pinchZoom!==void 0?i.pinchZoom:!0)&&t.push(new rE({duration:i.zoomDuration})),(i.keyboard!==void 0?i.keyboard:!0)&&(t.push(new Qx),t.push(new tE({delta:i.zoomDelta,duration:i.zoomDuration}))),(i.mouseWheelZoom!==void 0?i.mouseWheelZoom:!0)&&t.push(new nE({onFocusOnly:i.onFocusOnly,duration:i.zoomDuration})),(i.shiftDragZoom!==void 0?i.shiftDragZoom:!0)&&t.push(new Jx({duration:i.zoomDuration})),t}const Ft={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 z0 extends Di{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);typeof t.properties=="object"&&(delete e.properties,Object.assign(e,t.properties)),e[Ft.OPACITY]=t.opacity!==void 0?t.opacity:1,Lt(typeof e[Ft.OPACITY]=="number","Layer opacity must be a number"),e[Ft.VISIBLE]=t.visible!==void 0?t.visible:!0,e[Ft.Z_INDEX]=t.zIndex,e[Ft.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[Ft.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[Ft.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[Ft.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=e.className!==void 0?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:t===void 0?!0:t},n=this.getZIndex();return e.opacity=Vt(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=n===void 0&&!e.managed?1/0:n,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return Mt()}getLayerStatesArray(t){return Mt()}getExtent(){return this.get(Ft.EXTENT)}getMaxResolution(){return this.get(Ft.MAX_RESOLUTION)}getMinResolution(){return this.get(Ft.MIN_RESOLUTION)}getMinZoom(){return this.get(Ft.MIN_ZOOM)}getMaxZoom(){return this.get(Ft.MAX_ZOOM)}getOpacity(){return this.get(Ft.OPACITY)}getSourceState(){return Mt()}getVisible(){return this.get(Ft.VISIBLE)}getZIndex(){return this.get(Ft.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(Ft.EXTENT,t)}setMaxResolution(t){this.set(Ft.MAX_RESOLUTION,t)}setMinResolution(t){this.set(Ft.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(Ft.MAX_ZOOM,t)}setMinZoom(t){this.set(Ft.MIN_ZOOM,t)}setOpacity(t){Lt(typeof t=="number","Layer opacity must be a number"),this.set(Ft.OPACITY,t)}setVisible(t){this.set(Ft.VISIBLE,t)}setZIndex(t){this.set(Ft.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const Fn={ADDLAYER:"addlayer",REMOVELAYER:"removelayer"};class Wn extends ii{constructor(t,e){super(t),this.layer=e}}const jh={LAYERS:"layers"};class zr extends z0{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let n=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(jh.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new Me(n.slice(),{unique:!0}):Lt(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(It),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(mt(t,ee.ADD,this.handleLayersAdd_,this),mt(t,ee.REMOVE,this.handleLayersRemove_,this));for(const n in this.listenerKeys_)this.listenerKeys_[n].forEach(It);Bs(this.listenerKeys_);const e=t.getArray();for(let n=0,s=e.length;n<s;n++){const r=e[n];this.registerLayerListeners_(r),this.dispatchEvent(new Wn(Fn.ADDLAYER,r))}this.changed()}registerLayerListeners_(t){const e=[mt(t,Tr.PROPERTYCHANGE,this.handleLayerChange_,this),mt(t,lt.CHANGE,this.handleLayerChange_,this)];t instanceof zr&&e.push(mt(t,Fn.ADDLAYER,this.handleLayerGroupAdd_,this),mt(t,Fn.REMOVELAYER,this.handleLayerGroupRemove_,this)),this.listenerKeys_[ct(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new Wn(Fn.ADDLAYER,t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new Wn(Fn.REMOVELAYER,t.layer))}handleLayersAdd_(t){const e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new Wn(Fn.ADDLAYER,e)),this.changed()}handleLayersRemove_(t){const e=t.element,n=ct(e);this.listenerKeys_[n].forEach(It),delete this.listenerKeys_[n],this.dispatchEvent(new Wn(Fn.REMOVELAYER,e)),this.changed()}getLayers(){return this.get(jh.LAYERS)}setLayers(t){const e=this.getLayers();if(e){const n=e.getArray();for(let s=0,r=n.length;s<r;++s)this.dispatchEvent(new Wn(Fn.REMOVELAYER,n[s]))}this.set(jh.LAYERS,t)}getLayersArray(t){return t=t!==void 0?t:[],this.getLayers().forEach(function(e){e.getLayersArray(t)}),t}getLayerStatesArray(t){const e=t!==void 0?t:[],n=e.length;this.getLayers().forEach(function(o){o.getLayerStatesArray(e)});const s=this.getLayerState();let r=s.zIndex;!t&&s.zIndex===void 0&&(r=0);for(let o=n,a=e.length;o<a;o++){const l=e[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 e}getSourceState(){return"ready"}}const pi={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class hh extends z0{constructor(t){const e=Object.assign({},t);delete e.source,super(e),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(Ft.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(Ft.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_&&(It(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=mt(t,lt.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 e;const n=this.getMapInternal();!t&&n&&(t=n.getView()),t instanceof Wi?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&n&&(e.layerStatesArray=n.getLayerGroup().getLayerStatesArray());let s;if(e.layerStatesArray){if(s=e.layerStatesArray.find(o=>o.layer===this),!s)return!1}else s=this.getLayerState();const r=this.getExtent();return rf(s,e.viewState)&&(!r||Fe(r,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];const e=this.getSource()?.getAttributions();if(!e)return[];const n=t instanceof Wi?t.getViewStateAndExtent():t;let s=e(n);return Array.isArray(s)||(s=[s]),s}render(t,e){const n=this.getRenderer();return n.prepareFrame(t)?(this.rendered=!0,n.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(Ft.MAP,t)}getMapInternal(){return this.get(Ft.MAP)}setMap(t){this.mapPrecomposeKey_&&(It(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(It(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=mt(t,pi.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=mt(this,lt.CHANGE,t.render,t),this.changed())}handlePrecompose_(t){const e=t.frameState.layerStatesArray,n=this.getLayerState(!1);Lt(!e.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."),e.push(n)}setSource(t){this.set(Ft.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(i,t){if(!i.visible)return!1;const e=t.resolution;if(e<i.minResolution||e>=i.maxResolution)return!1;const n=t.zoom;return n>i.minZoom&&n<=i.maxZoom}function W0(i,t,e=0,n=i.length-1,s=aE){for(;n>e;){if(n-e>600){const l=n-e+1,h=t-e+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(e,Math.floor(t-h*u/l+f)),g=Math.min(n,Math.floor(t+(l-h)*u/l+f));W0(i,t,d,g,s)}const r=i[t];let o=e,a=n;for(Jr(i,e,t),s(i[n],r)>0&&Jr(i,e,n);o<a;){for(Jr(i,o,a),o++,a--;s(i[o],r)<0;)o++;for(;s(i[a],r)>0;)a--}s(i[e],r)===0?Jr(i,e,a):(a++,Jr(i,a,n)),a<=t&&(e=a+1),t<=a&&(n=a-1)}}function Jr(i,t,e){const n=i[t];i[t]=i[e],i[e]=n}function aE(i,t){return i<t?-1:i>t?1:0}let U0=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 e=this.data;const n=[];if(!Ca(t,e))return n;const s=this.toBBox,r=[];for(;e;){for(let o=0;o<e.children.length;o++){const a=e.children[o],l=e.leaf?s(a):a;Ca(t,l)&&(e.leaf?n.push(a):zh(t,l)?this._all(a,n):r.push(a))}e=r.pop()}return n}collides(t){let e=this.data;if(!Ca(t,e))return!1;const n=[];for(;e;){for(let s=0;s<e.children.length;s++){const r=e.children[s],o=e.leaf?this.toBBox(r):r;if(Ca(t,o)){if(e.leaf||zh(t,o))return!0;n.push(r)}}e=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 e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=e;else if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const n=this.data;this.data=e,e=n}this._insert(e,this.data.height-e.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,e){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=lE(t,n.children,e);if(c!==-1)return n.children.splice(c,1),r.push(n),this._condense(r),this}!h&&!n.leaf&&zh(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,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,s){const r=n-e+1;let o=this._maxEntries,a;if(r<=o)return a=er(t.slice(e,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));jd(t,e,n,h,this.compareMinX);for(let c=e;c<=n;c+=h){const u=Math.min(c+h-1,n);jd(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,e,n,s){for(;s.push(e),!(e.leaf||s.length-1===n);){let r=1/0,o=1/0,a;for(let l=0;l<e.children.length;l++){const h=e.children[l],c=Bh(h),u=uE(t,h)-c;u<o?(o=u,r=c<r?c:r,a=h):u===o&&c<r&&(r=c,a=h)}e=a||e.children[0]}return e}_insert(t,e,n){const s=n?t:this.toBBox(t),r=[],o=this._chooseSubtree(s,this.data,e,r);for(o.children.push(t),ro(o,s);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)}_split(t,e){const n=t[e],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),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=er([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Ks(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let s,r=1/0,o=1/0;for(let a=e;a<=n-e;a++){const l=so(t,0,a,this.toBBox),h=so(t,a,n,this.toBBox),c=fE(l,h),u=Bh(l)+Bh(h);c<r?(r=c,s=a,o=u<o?u:o):c===r&&u<o&&(o=u,s=a)}return s||n-e}_chooseSplitAxis(t,e,n){const s=t.leaf?this.compareMinX:hE,r=t.leaf?this.compareMinY:cE,o=this._allDistMargin(t,e,n,s),a=this._allDistMargin(t,e,n,r);o<a&&t.children.sort(s)}_allDistMargin(t,e,n,s){t.children.sort(s);const r=this.toBBox,o=so(t,0,e,r),a=so(t,n-e,n,r);let l=wa(o)+wa(a);for(let h=e;h<n-e;h++){const c=t.children[h];ro(o,t.leaf?r(c):c),l+=wa(o)}for(let h=n-e-1;h>=e;h--){const c=t.children[h];ro(a,t.leaf?r(c):c),l+=wa(a)}return l}_adjustParentBBoxes(t,e,n){for(let s=n;s>=0;s--)ro(e[s],t)}_condense(t){for(let e=t.length-1,n;e>=0;e--)t[e].children.length===0?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():Ks(t[e],this.toBBox)}};function lE(i,t,e){if(!e)return t.indexOf(i);for(let n=0;n<t.length;n++)if(e(i,t[n]))return n;return-1}function Ks(i,t){so(i,0,i.children.length,t,i)}function so(i,t,e,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<e;r++){const o=i.children[r];ro(s,i.leaf?n(o):o)}return s}function ro(i,t){return i.minX=Math.min(i.minX,t.minX),i.minY=Math.min(i.minY,t.minY),i.maxX=Math.max(i.maxX,t.maxX),i.maxY=Math.max(i.maxY,t.maxY),i}function hE(i,t){return i.minX-t.minX}function cE(i,t){return i.minY-t.minY}function Bh(i){return(i.maxX-i.minX)*(i.maxY-i.minY)}function wa(i){return i.maxX-i.minX+(i.maxY-i.minY)}function uE(i,t){return(Math.max(t.maxX,i.maxX)-Math.min(t.minX,i.minX))*(Math.max(t.maxY,i.maxY)-Math.min(t.minY,i.minY))}function fE(i,t){const e=Math.max(i.minX,t.minX),n=Math.max(i.minY,t.minY),s=Math.min(i.maxX,t.maxX),r=Math.min(i.maxY,t.maxY);return Math.max(0,s-e)*Math.max(0,r-n)}function zh(i,t){return i.minX<=t.minX&&i.minY<=t.minY&&t.maxX<=i.maxX&&t.maxY<=i.maxY}function Ca(i,t){return t.minX<=i.maxX&&t.minY<=i.maxY&&t.maxX>=i.minX&&t.maxY>=i.minY}function er(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function jd(i,t,e,n,s){const r=[t,e];for(;r.length;){if(e=r.pop(),t=r.pop(),e-t<=n)continue;const o=t+Math.ceil((e-t)/n/2)*n;W0(i,o,t,e,s),r.push(t,o,o,e)}}const of=[NaN,NaN,NaN,0];let Wh;function dE(){return Wh||(Wh=ce(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),Wh}const gE=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,_E=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,mE=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,pE=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function Ta(i,t){return i.endsWith("%")?Number(i.substring(0,i.length-1))/t:Number(i)}function So(i){throw new Error('failed to parse "'+i+'" as color')}function V0(i){if(i.toLowerCase().startsWith("rgb")){const r=i.match(_E)||i.match(gE)||i.match(mE);if(r){const o=r[4],a=100/255;return[Vt(Ta(r[1],a)+.5|0,0,255),Vt(Ta(r[2],a)+.5|0,0,255),Vt(Ta(r[3],a)+.5|0,0,255),o!==void 0?Vt(Ta(o,100),0,1):1]}So(i)}if(i.startsWith("#")){if(pE.test(i)){const r=i.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(i)}const t=dE();t.fillStyle="#abcdef";let e=t.fillStyle;t.fillStyle=i,t.fillStyle===e&&(t.fillStyle="#fedcba",e=t.fillStyle,t.fillStyle=i,t.fillStyle===e&&So(i));const n=t.fillStyle;if(n.startsWith("#")||n.startsWith("rgba"))return V0(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 yE(i){return typeof i=="string"?i:lf(i)}const vE=1024,Qr={};let Uh=0;function xE(i){if(i.length===4)return i;const t=i.slice();return t[3]=1,t}function Vh(i){return i>.0031308?Math.pow(i,1/2.4)*269.025-14.025:i*3294.6}function Xh(i){return i>.2068965?Math.pow(i,3):(i-4/29)*(108/841)}function $h(i){return i>10.314724?Math.pow((i+14.025)/269.025,2.4):i/3294.6}function Kh(i){return i>.0088564?Math.pow(i,1/3):i/(108/841)+4/29}function Bd(i){const t=$h(i[0]),e=$h(i[1]),n=$h(i[2]),s=Kh(t*.222488403+e*.716873169+n*.06060791),r=500*(Kh(t*.452247074+e*.399439023+n*.148375274)-s),o=200*(s-Kh(t*.016863605+e*.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,i[3]]}function EE(i){const t=(i[0]+16)/116,e=i[1],n=i[2]*Math.PI/180,s=Xh(t),r=Xh(t+e/500*Math.cos(n)),o=Xh(t-e/200*Math.sin(n)),a=Vh(r*3.021973625-s*1.617392459-o*.404875592),l=Vh(r*-.943766287+s*1.916279586+o*.027607165),h=Vh(r*.069407491-s*.22898585+o*1.159737864);return[Vt(a+.5|0,0,255),Vt(l+.5|0,0,255),Vt(h+.5|0,0,255),i[3]]}function af(i){if(i==="none")return of;if(Qr.hasOwnProperty(i))return Qr[i];if(Uh>=vE){let e=0;for(const n in Qr)(e++&3)===0&&(delete Qr[n],--Uh)}const t=V0(i);t.length!==4&&So(i);for(const e of t)isNaN(e)&&So(i);return Qr[i]=t,++Uh,t}function Ar(i){return Array.isArray(i)?i:af(i)}function lf(i){let t=i[0];t!=(t|0)&&(t=t+.5|0);let e=i[1];e!=(e|0)&&(e=e+.5|0);let n=i[2];n!=(n|0)&&(n=n+.5|0);const s=i[3]===void 0?1:Math.round(i[3]*1e3)/1e3;return"rgba("+t+","+e+","+n+","+s+")"}function zd(i){return i[0]>0&&i[1]>0}function SE(i,t,e){return e===void 0&&(e=[0,0]),e[0]=i[0]*t+.5|0,e[1]=i[1]*t+.5|0,e}function Qe(i,t){return Array.isArray(i)?i:(t===void 0?t=[i,i]:(t[0]=i,t[1]=i),t)}let Ws=0;const Be=1<<Ws++,vt=1<<Ws++,Ke=1<<Ws++,Ii=1<<Ws++,Gs=1<<Ws++,oo=1<<Ws++,Ra=Math.pow(2,Ws)-1,hf={[Be]:"boolean",[vt]:"number",[Ke]:"string",[Ii]:"color",[Gs]:"number[]",[oo]:"size"},ME=Object.keys(hf).map(Number).sort(_n);function wE(i){return i in hf}function ao(i){const t=[];for(const e of ME)lo(i,e)&&t.push(hf[e]);return t.length===0?"untyped":t.length<3?t.join(" or "):t.slice(0,-1).join(", ")+", or "+t[t.length-1]}function lo(i,t){return(i&t)===t}function Gn(i,t){return i===t}class he{constructor(t,e){if(!wE(t))throw new Error(`literal expressions must have a specific type, got ${ao(t)}`);this.type=t,this.value=e}}class CE{constructor(t,e,...n){this.type=t,this.operator=e,this.args=n}}function X0(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mapState:!1}}function we(i,t,e){switch(typeof i){case"boolean":{if(Gn(t,Ke))return new he(Ke,i?"true":"false");if(!lo(t,Be))throw new Error(`got a boolean, but expected ${ao(t)}`);return new he(Be,i)}case"number":{if(Gn(t,oo))return new he(oo,Qe(i));if(Gn(t,Be))return new he(Be,!!i);if(Gn(t,Ke))return new he(Ke,i.toString());if(!lo(t,vt))throw new Error(`got a number, but expected ${ao(t)}`);return new he(vt,i)}case"string":{if(Gn(t,Ii))return new he(Ii,af(i));if(Gn(t,Be))return new he(Be,!!i);if(!lo(t,Ke))throw new Error(`got a string, but expected ${ao(t)}`);return new he(Ke,i)}}if(!Array.isArray(i))throw new Error("expression must be an array or a primitive value");if(i.length===0)throw new Error("empty expression");if(typeof i[0]=="string")return DE(i,t,e);for(const n of i)if(typeof n!="number")throw new Error("expected an array of numbers");if(Gn(t,oo)){if(i.length!==2)throw new Error(`expected an array of two values for a size, got ${i.length}`);return new he(oo,i)}if(Gn(t,Ii)){if(i.length===3)return new he(Ii,[...i,1]);if(i.length===4)return new he(Ii,i);throw new Error(`expected an array of 3 or 4 values for a color, got ${i.length}`)}if(!lo(t,Gs))throw new Error(`got an array of numbers, but expected ${ao(t)}`);return new he(Gs,i)}const F={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"},TE={[F.Get]:ut(gt(1,1/0),Wd),[F.Var]:ut(gt(1,1),RE),[F.Has]:ut(gt(1,1/0),Wd),[F.Id]:ut(IE,Ys),[F.Concat]:ut(gt(2,1/0),Rt(Ke)),[F.GeometryType]:ut(PE,Ys),[F.LineMetric]:ut(Ys),[F.Resolution]:ut(Yh,Ys),[F.Zoom]:ut(Yh,Ys),[F.Time]:ut(Yh,Ys),[F.Any]:ut(gt(2,1/0),Rt(Be)),[F.All]:ut(gt(2,1/0),Rt(Be)),[F.Not]:ut(gt(1,1),Rt(Be)),[F.Equal]:ut(gt(2,2),Rt(Ra)),[F.NotEqual]:ut(gt(2,2),Rt(Ra)),[F.GreaterThan]:ut(gt(2,2),Rt(vt)),[F.GreaterThanOrEqualTo]:ut(gt(2,2),Rt(vt)),[F.LessThan]:ut(gt(2,2),Rt(vt)),[F.LessThanOrEqualTo]:ut(gt(2,2),Rt(vt)),[F.Multiply]:ut(gt(2,1/0),Ud),[F.Coalesce]:ut(gt(2,1/0),Ud),[F.Divide]:ut(gt(2,2),Rt(vt)),[F.Add]:ut(gt(2,1/0),Rt(vt)),[F.Subtract]:ut(gt(2,2),Rt(vt)),[F.Clamp]:ut(gt(3,3),Rt(vt)),[F.Mod]:ut(gt(2,2),Rt(vt)),[F.Pow]:ut(gt(2,2),Rt(vt)),[F.Abs]:ut(gt(1,1),Rt(vt)),[F.Floor]:ut(gt(1,1),Rt(vt)),[F.Ceil]:ut(gt(1,1),Rt(vt)),[F.Round]:ut(gt(1,1),Rt(vt)),[F.Sin]:ut(gt(1,1),Rt(vt)),[F.Cos]:ut(gt(1,1),Rt(vt)),[F.Atan]:ut(gt(1,2),Rt(vt)),[F.Sqrt]:ut(gt(1,1),Rt(vt)),[F.Match]:ut(gt(4,1/0),Vd,AE),[F.Between]:ut(gt(3,3),Rt(vt)),[F.Interpolate]:ut(gt(6,1/0),Vd,LE),[F.Case]:ut(gt(3,1/0),bE,OE),[F.In]:ut(gt(2,2),FE),[F.Number]:ut(gt(1,1/0),Rt(Ra)),[F.String]:ut(gt(1,1/0),Rt(Ra)),[F.Array]:ut(gt(1,1/0),Rt(vt)),[F.Color]:ut(gt(1,4),Rt(vt)),[F.Band]:ut(gt(1,3),Rt(vt)),[F.Palette]:ut(gt(2,2),GE),[F.ToString]:ut(gt(1,1),Rt(Be|vt|Ke|Ii))};function Wd(i,t,e){const n=i.length-1,s=new Array(n);for(let r=0;r<n;++r){const o=i[r+1];switch(typeof o){case"number":{s[r]=new he(vt,o);break}case"string":{s[r]=new he(Ke,o);break}default:throw new Error(`expected a string key or numeric array index for a get operation, got ${o}`)}r===0&&e.properties.add(String(o))}return s}function RE(i,t,e){const n=i[1];if(typeof n!="string")throw new Error("expected a string argument for var operation");return e.variables.add(n),[new he(Ke,n)]}function IE(i,t,e){e.featureId=!0}function PE(i,t,e){e.geometryType=!0}function Yh(i,t,e){e.mapState=!0}function Ys(i,t,e){const n=i[0];if(i.length!==1)throw new Error(`expected no arguments for ${n} operation`);return[]}function gt(i,t){return function(e,n,s){const r=e[0],o=e.length-1;if(i===t){if(o!==i){const a=i===1?"":"s";throw new Error(`expected ${i} argument${a} for ${r}, got ${o}`)}}else if(o<i||o>t){const a=t===1/0?`${i} or more`:`${i} to ${t}`;throw new Error(`expected ${a} arguments for ${r}, got ${o}`)}}}function Ud(i,t,e){const n=i.length-1,s=new Array(n);for(let r=0;r<n;++r){const o=we(i[r+1],t,e);s[r]=o}return s}function Rt(i){return function(t,e,n){const s=t.length-1,r=new Array(s);for(let o=0;o<s;++o){const a=we(t[o+1],i,n);r[o]=a}return r}}function bE(i,t,e){const n=i[0],s=i.length-1;if(s%2===0)throw new Error(`expected an odd number of arguments for ${n}, got ${s} instead`)}function Vd(i,t,e){const n=i[0],s=i.length-1;if(s%2===1)throw new Error(`expected an even number of arguments for operation ${n}, got ${s} instead`)}function AE(i,t,e){const n=i.length-1,s=Ke|vt|Be,r=we(i[1],s,e),o=we(i[i.length-1],t,e),a=new Array(n-2);for(let l=0;l<n-2;l+=2){try{const h=we(i[l+2],r.type,e);a[l]=h}catch(h){throw new Error(`failed to parse argument ${l+1} of match expression: ${h.message}`)}try{const h=we(i[l+3],o.type,e);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 LE(i,t,e){const n=i[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 he(vt,s);let o;try{o=we(i[2],vt,e)}catch(l){throw new Error(`failed to parse argument 1 in interpolate expression: ${l.message}`)}const a=new Array(i.length-3);for(let l=0;l<a.length;l+=2){try{const h=we(i[l+3],vt,e);a[l]=h}catch(h){throw new Error(`failed to parse argument ${l+2} for interpolate expression: ${h.message}`)}try{const h=we(i[l+4],t,e);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 OE(i,t,e){const n=we(i[i.length-1],t,e),s=new Array(i.length-1);for(let r=0;r<s.length-1;r+=2){try{const o=we(i[r+1],Be,e);s[r]=o}catch(o){throw new Error(`failed to parse argument ${r} of case expression: ${o.message}`)}try{const o=we(i[r+2],n.type,e);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 FE(i,t,e){let n=i[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=vt;const r=new Array(n.length);for(let a=0;a<r.length;a++)try{const l=we(n[a],s,e);r[a]=l}catch(l){throw new Error(`failed to parse haystack item ${a} for "in" expression: ${l.message}`)}return[we(i[1],s,e),...r]}function GE(i,t,e){let n;try{n=we(i[1],vt,e)}catch(o){throw new Error(`failed to parse first argument in palette expression: ${o.message}`)}const s=i[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,e)}catch(l){throw new Error(`failed to parse color at index ${o} in palette expression: ${l.message}`)}if(!(a instanceof he))throw new Error(`the palette color at index ${o} must be a literal value`);r[o]=a}return[n,...r]}function ut(...i){return function(t,e,n){const s=t[0];let r;for(let o=0;o<i.length;o++){const a=i[o](t,e,n);if(o==i.length-1){if(!a)throw new Error("expected last argument validator to return the parsed args");r=a}}return new CE(e,s,...r)}}function DE(i,t,e){const n=i[0],s=TE[n];if(!s)throw new Error(`unknown operator: ${n}`);return s(i,t,e)}function $0(i){if(!i)return"";const t=i.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 $0(i.getGeometries()[0]);default:return""}}function K0(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function An(i,t,e){const n=we(i,t,e);return Gi(n)}function Gi(i,t){if(i instanceof he){if(i.type===Ii&&typeof i.value=="string"){const n=af(i.value);return function(){return n}}return function(){return i.value}}const e=i.operator;switch(e){case F.Number:case F.String:case F.Coalesce:return NE(i);case F.Get:case F.Var:case F.Has:return kE(i);case F.Id:return n=>n.featureId;case F.GeometryType:return n=>n.geometryType;case F.Concat:{const n=i.args.map(s=>Gi(s));return s=>"".concat(...n.map(r=>r(s).toString()))}case F.Resolution:return n=>n.resolution;case F.Any:case F.All:case F.Between:case F.In:case F.Not:return BE(i);case F.Equal:case F.NotEqual:case F.LessThan:case F.LessThanOrEqualTo:case F.GreaterThan:case F.GreaterThanOrEqualTo:return jE(i);case F.Multiply:case F.Divide:case F.Add:case F.Subtract:case F.Clamp:case F.Mod:case F.Pow:case F.Abs:case F.Floor:case F.Ceil:case F.Round:case F.Sin:case F.Cos:case F.Atan:case F.Sqrt:return zE(i);case F.Case:return WE(i);case F.Match:return UE(i);case F.Interpolate:return VE(i);case F.ToString:return XE(i);default:throw new Error(`Unsupported operator ${e}`)}}function NE(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=Gi(i.args[r]);switch(e){case F.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 F.Number:case F.String:return r=>{for(let o=0;o<n;++o){const a=s[o](r);if(typeof a===e)return a}throw new Error(`Expected one of the values to be a ${e}`)};default:throw new Error(`Unsupported assertion operator ${e}`)}}function kE(i,t){const n=i.args[0].value;switch(i.operator){case F.Get:return s=>{const r=i.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 F.Var:return s=>s.variables[n];case F.Has:return s=>{const r=i.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 ${i.operator}`)}}function jE(i,t){const e=i.operator,n=Gi(i.args[0]),s=Gi(i.args[1]);switch(e){case F.Equal:return r=>n(r)===s(r);case F.NotEqual:return r=>n(r)!==s(r);case F.LessThan:return r=>n(r)<s(r);case F.LessThanOrEqualTo:return r=>n(r)<=s(r);case F.GreaterThan:return r=>n(r)>s(r);case F.GreaterThanOrEqualTo:return r=>n(r)>=s(r);default:throw new Error(`Unsupported comparison operator ${e}`)}}function BE(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=Gi(i.args[r]);switch(e){case F.Any:return r=>{for(let o=0;o<n;++o)if(s[o](r))return!0;return!1};case F.All:return r=>{for(let o=0;o<n;++o)if(!s[o](r))return!1;return!0};case F.Between:return r=>{const o=s[0](r),a=s[1](r),l=s[2](r);return o>=a&&o<=l};case F.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 F.Not:return r=>!s[0](r);default:throw new Error(`Unsupported logical operator ${e}`)}}function zE(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=Gi(i.args[r]);switch(e){case F.Multiply:return r=>{let o=1;for(let a=0;a<n;++a)o*=s[a](r);return o};case F.Divide:return r=>s[0](r)/s[1](r);case F.Add:return r=>{let o=0;for(let a=0;a<n;++a)o+=s[a](r);return o};case F.Subtract:return r=>s[0](r)-s[1](r);case F.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 F.Mod:return r=>s[0](r)%s[1](r);case F.Pow:return r=>Math.pow(s[0](r),s[1](r));case F.Abs:return r=>Math.abs(s[0](r));case F.Floor:return r=>Math.floor(s[0](r));case F.Ceil:return r=>Math.ceil(s[0](r));case F.Round:return r=>Math.round(s[0](r));case F.Sin:return r=>Math.sin(s[0](r));case F.Cos:return r=>Math.cos(s[0](r));case F.Atan:return n===2?r=>Math.atan2(s[0](r),s[1](r)):r=>Math.atan(s[0](r));case F.Sqrt:return r=>Math.sqrt(s[0](r));default:throw new Error(`Unsupported numeric operator ${e}`)}}function WE(i,t){const e=i.args.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=Gi(i.args[s]);return s=>{for(let r=0;r<e-1;r+=2)if(n[r](s))return n[r+1](s);return n[e-1](s)}}function UE(i,t){const e=i.args.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=Gi(i.args[s]);return s=>{const r=n[0](s);for(let o=1;o<e-1;o+=2)if(r===n[o](s))return n[o+1](s);return n[e-1](s)}}function VE(i,t){const e=i.args.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=Gi(i.args[s]);return s=>{const r=n[0](s),o=n[1](s);let a,l;for(let h=2;h<e;h+=2){const c=n[h](s);let u=n[h+1](s);const f=Array.isArray(u);if(f&&(u=xE(u)),c>=o)return h===2?u:f?$E(r,o,a,l,c,u):ho(r,o,a,l,c,u);a=c,l=u}return l}}function XE(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=Gi(i.args[r]);switch(e){case F.ToString:return r=>{const o=s[0](r);return i.args[0].type===Ii?lf(o):o.toString()};default:throw new Error(`Unsupported convert operator ${e}`)}}function ho(i,t,e,n,s,r){const o=s-e;if(o===0)return n;const a=t-e,l=i===1?a/o:(Math.pow(i,a)-1)/(Math.pow(i,o)-1);return n+l*(r-n)}function $E(i,t,e,n,s,r){if(s-e===0)return n;const a=Bd(n),l=Bd(r);let h=l[2]-a[2];h>180?h-=360:h<-180&&(h+=360);const c=[ho(i,t,e,a[0],s,l[0]),ho(i,t,e,a[1],s,l[1]),a[2]+ho(i,t,e,0,s,h),ho(i,t,e,n[3],s,r[3])];return EE(c)}const tt={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class Y0 extends na{constructor(t,e,n,s){super(),this.extent=t,this.pixelRatio_=n,this.resolution=e,this.state=typeof s=="function"?tt.IDLE:s,this.image_=null,this.loader=typeof s=="function"?s:null}changed(){this.dispatchEvent(lt.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==tt.IDLE&&this.loader){this.state=tt.LOADING,this.changed();const t=this.getResolution(),e=Array.isArray(t)?t[0]:t;e0(()=>this.loader(this.getExtent(),e,this.getPixelRatio())).then(n=>{"image"in n&&(this.image_=n.image),"extent"in n&&(this.extent=n.extent),"resolution"in n&&(this.resolution=n.resolution),"pixelRatio"in n&&(this.pixelRatio_=n.pixelRatio),(n instanceof HTMLImageElement||_x&&n instanceof ImageBitmap||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement)&&(this.image_=n),this.state=tt.LOADED}).catch(n=>{this.state=tt.ERROR,console.error(n)}).finally(()=>this.changed())}}setImage(t){this.image_=t}setResolution(t){this.resolution=t}}function KE(i,t,e){const n=i;let s=!0,r=!1,o=!1;const a=[ll(n,lt.LOAD,function(){o=!0,r||t()})];return n.src&&A0?(r=!0,n.decode().then(function(){s&&t()}).catch(function(l){s&&(o?t():e())})):a.push(ll(n,lt.ERROR,e)),function(){s=!1,a.forEach(It)}}function YE(i,t){return new Promise((e,n)=>{function s(){o(),e(i)}function r(){o(),n(new Error("Image load error"))}function o(){i.removeEventListener("load",s),i.removeEventListener("error",r)}i.addEventListener("load",s),i.addEventListener("error",r)})}function qE(i,t){return t&&(i.src=t),i.src&&A0?new Promise((e,n)=>i.decode().then(()=>e(i)).catch(s=>i.complete&&i.width?e(i):n(s))):YE(i)}class HE{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 e in this.cache_){const n=this.cache_[e];(t++&3)===0&&!n.hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,n){const s=qh(t,e,n);return s in this.cache_?this.cache_[s]:null}getPattern(t,e,n){const s=qh(t,e,n);return s in this.patternCache_?this.patternCache_[s]:null}set(t,e,n,s,r){const o=qh(t,e,n),a=o in this.cache_;this.cache_[o]=s,r&&(s.getImageState()===tt.IDLE&&s.load(),s.getImageState()===tt.LOADING?s.ready().then(()=>{this.patternCache_[o]=_l().createPattern(s.getImage(1),"repeat")}):this.patternCache_[o]=_l().createPattern(s.getImage(1),"repeat")),a||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function qh(i,t,e){const n=e?Ar(e):"null";return t+":"+i+":"+n}const yi=new HE;let to=null;class q0 extends na{constructor(t,e,n,s,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=n,this.canvas_={},this.color_=r,this.imageState_=s===void 0?tt.IDLE:s,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===tt.LOADED){to||(to=ce(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(lt.CHANGE)}handleImageError_(){this.imageState_=tt.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=tt.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],n=ce(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===tt.IDLE){this.image_||this.initializeImage_(),this.imageState_=tt.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&qE(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_!==tt.LOADED)return;const e=this.image_,n=ce(Math.ceil(e.width*t),Math.ceil(e.height*t)),s=n.canvas;n.scale(t,t),n.drawImage(e,0,0),n.globalCompositeOperation="multiply",n.fillStyle=yE(this.color_),n.fillRect(0,0,s.width/t,s.height/t),n.globalCompositeOperation="destination-in",n.drawImage(e,0,0),this.canvas_[t]=s}ready(){return this.ready_||(this.ready_=new Promise(t=>{if(this.imageState_===tt.LOADED||this.imageState_===tt.ERROR)t();else{const e=()=>{(this.imageState_===tt.LOADED||this.imageState_===tt.ERROR)&&(this.removeEventListener(lt.CHANGE,e),t())};this.addEventListener(lt.CHANGE,e)}})),this.ready_}}function yl(i,t,e,n,s,r){let o=t===void 0?void 0:yi.get(t,e,s);return o||(o=new q0(i,i&&"src"in i?i.src||void 0:t,e,n,s),yi.set(t,e,s,o,r)),r&&o&&!yi.getPattern(t,e,s)&&yi.set(t,e,s,o,r),o}function Vi(i){return i?Array.isArray(i)?lf(i):typeof i=="object"&&"src"in i?ZE(i):i:null}function ZE(i){if(!i.offset||!i.size)return yi.getPattern(i.src,"anonymous",i.color);const t=i.src+":"+i.offset,e=yi.getPattern(t,void 0,i.color);if(e)return e;const n=yi.get(i.src,"anonymous",null);if(n.getImageState()!==tt.LOADED)return null;const s=ce(i.size[0],i.size[1]);return s.drawImage(n.getImage(1),i.offset[0],i.offset[1],i.size[0],i.size[1],0,0,i.size[0],i.size[1]),yl(s.canvas,t,void 0,tt.LOADED,i.color,!0),yi.getPattern(t,void 0,i.color)}const H0="10px sans-serif",Ye="#000",Lr="round",xn=[],En=0,Or="round",Wo=10,Uo="#000",Vo="center",vl="middle",Is=[0,0,0,0],Xo=1,ir=new Di;let eo=null,Xd;const Uc={},JE=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function QE(i,t,e){return`${i} ${t} 16px "${e}"`}const tS=(function(){let t,e;async function n(r){await e.ready;const o=await e.load(r);if(o.length===0)return!1;const a=Bc(r),l=a.families[0].toLowerCase(),h=a.weight;return o.some(c=>{const u=c.family.replace(/^['"]|['"]$/g,"").toLowerCase(),f=jc[c.weight]||c.weight;return u===l&&c.style===a.style&&f==h})}async function s(){await e.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)?(Bs(Uc),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){e||(e=mi?self.fonts:document.fonts);const o=Bc(r);if(!o)return;const a=o.families;let l=!1;for(const h of a){if(JE.has(h))continue;const c=QE(o.style,o.weight,h);ir.get(c)===void 0&&(ir.set(c,0,!0),l=!0)}l&&(clearTimeout(t),t=setTimeout(s,100))}})(),eS=(function(){let i;return function(t){let e=Uc[t];if(e==null){if(mi){const n=Bc(t),s=Z0(t,"Žg");e=(isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight))*(s.actualBoundingBoxAscent+s.actualBoundingBoxDescent)}else i||(i=document.createElement("div"),i.innerHTML="M",i.style.minHeight="0",i.style.maxHeight="none",i.style.height="auto",i.style.padding="0",i.style.border="none",i.style.position="absolute",i.style.display="block",i.style.left="-99999px"),i.style.font=t,document.body.appendChild(i),e=i.offsetHeight,document.body.removeChild(i);Uc[t]=e}return e}})();function Z0(i,t){return eo||(eo=ce(1,1)),i!=Xd&&(eo.font=i,Xd=eo.font),eo.measureText(t)}function J0(i,t){return Z0(i,t).width}function $d(i,t,e){if(t in e)return e[t];const n=t.split(`
|
|
2
|
+
`).reduce((s,r)=>Math.max(s,J0(i,r)),0);return e[t]=n,n}function iS(i,t){const e=[],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]||i.font,d=J0(f,u);e.push(d),o+=d;const g=eS(f);n.push(g),l=Math.max(l,g)}return{width:r,height:a,widths:e,heights:n,lineWidths:s}}function nS(i,t,e,n,s,r,o,a,l,h,c){i.save(),e!==1&&(i.globalAlpha===void 0?i.globalAlpha=u=>u.globalAlpha*=e:i.globalAlpha*=e),t&&i.transform.apply(i,t),n.contextInstructions?(i.translate(l,h),i.scale(c[0],c[1]),sS(n,i)):c[0]<0||c[1]<0?(i.translate(l,h),i.scale(c[0],c[1]),i.drawImage(n,s,r,o,a,0,0,o,a)):i.drawImage(n,s,r,o,a,l,h,o*c[0],a*c[1]),i.restore()}function sS(i,t){const e=i.contextInstructions;for(let n=0,s=e.length;n<s;n+=2)Array.isArray(e[n+1])?t[e[n]].apply(t,e[n+1]):t[e[n]]=e[n+1]}class ch{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 ch({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 Mt()}getImage(t){return Mt()}getHitDetectionImage(){return Mt()}getPixelRatio(t){return 1}getImageState(){return Mt()}getImageSize(){return Mt()}getOrigin(){return Mt()}getSize(){return Mt()}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){Mt()}load(){Mt()}unlistenImageChange(t){Mt()}ready(){return Promise.resolve()}}class uh extends ch{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()?tt.LOADING:tt.LOADED,this.imageState_===tt.LOADING&&this.ready().then(()=>this.imageState_=tt.LOADED),this.render()}clone(){const t=this.getScale(),e=new uh({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),n=this.getScaleArray();return[t[0]/2-e[0]/n[0],t[1]/2+e[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){const e=this.fill_?.getKey(),n=`${t},${this.angle_},${this.radius},${this.radius2_},${this.points_},${e}`+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=ce(o,o);this.draw_(r,a,t),s=a.canvas,yi.set(n,null,null,new q0(s,void 0,null,tt.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,e,n){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let s=this.radius,r=this.radius2_===void 0?s:this.radius2_;if(s<r){const w=s;s=r,r=w}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*e;const d=e/2/f,g=e/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),E=r-y,S=Math.sqrt(p*p+E*E)/p;if(S<=n){const w=S*e/2-r-s;return 2*Math.max(m,w)}return m*2}createRenderOptions(){let t=Lr,e=Or,n=0,s=null,r=0,o,a=0;this.stroke_&&(o=Vi(this.stroke_.getColor()??Uo),a=this.stroke_.getWidth()??Xo,s=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset()??0,e=this.stroke_.getLineJoin()??Or,t=this.stroke_.getLineCap()??Lr,n=this.stroke_.getMiterLimit()??Wo);const l=this.calculateLineJoinSize_(e,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:e,miterLimit:n}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[t,t]}draw_(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let s=this.fill_.getColor();s===null&&(s=Ye),e.fillStyle=Vi(s),e.fill()}t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}createHitDetectionCanvas_(t){let e;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&&(e=ce(t.size,t.size),this.drawHitDetectionCanvas_(t,e))}return e?e.canvas:this.getImage(1)}createPath_(t){let e=this.points_;const n=this.radius;if(e===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&&(e*=2);const r=this.angle_-Math.PI/2,o=2*Math.PI/e;for(let a=0;a<e;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,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=Ye,e.fill(),t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}}class Us extends uh{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(),e=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 e.setOpacity(this.getOpacity()),e}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 e=yl(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then(()=>{this.patternImage_=null}),e.getImageState()===tt.IDLE&&e.load(),e.getImageState()===tt.LOADING&&(this.patternImage_=e)}this.color_=t}getKey(){const t=this.getColor();return t?t instanceof CanvasPattern||t instanceof CanvasGradient?ct(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 Kd(i,t,e,n){return e!==void 0&&n!==void 0?[e/i,n/t]:e!==void 0?e/i:n!==void 0?n/t:1}class fh extends ch{constructor(t){t=t||{};const e=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:e,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;Lt(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||ct(o)),Lt(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),Lt(!((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=tt.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?tt.LOADED:tt.IDLE:l=tt.LOADING:l=tt.LOADED),this.color_=t.color!==void 0?Ar(t.color):null,this.iconImage_=yl(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(Kd(d[0],d[1],t.width,t.height))};this.listenImageChange(f);return}}h!==void 0&&this.setScale(Kd(h,c,t.width,t.height))}}clone(){let t,e,n;return this.initialOptions_?(e=this.initialOptions_.width,n=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new fh({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const 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 e=this.getDisplacement(),n=this.getScaleArray();return[t[0]-e[0]/n[0],t[1]+e[1]/n[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=n[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}setSrc(t){this.iconImage_=yl(null,t,this.crossOrigin_,tt.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()==tt.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()==tt.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(lt.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(lt.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 me{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=Yd,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 me({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(e){return e.get(t)}:t?t!==void 0&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Yd,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function rS(i){let t;if(typeof i=="function")t=i;else{let e;Array.isArray(i)?e=i:(Lt(typeof i.getZIndex=="function","Expected an `Style` or an array of `Style`"),e=[i]),t=function(){return e}}return t}let Hh=null;function Q0(i,t){if(!Hh){const e=new li({color:"rgba(255,255,255,0.4)"}),n=new Si({color:"#3399CC",width:1.25});Hh=[new me({image:new Us({fill:e,stroke:n,radius:5}),fill:e,stroke:n})]}return Hh}function cf(){const i={},t=[255,255,255,1],e=[0,153,255,1],n=3;return i.Polygon=[new me({fill:new li({color:[255,255,255,.5]})})],i.MultiPolygon=i.Polygon,i.LineString=[new me({stroke:new Si({color:t,width:n+2})}),new me({stroke:new Si({color:e,width:n})})],i.MultiLineString=i.LineString,i.Circle=i.Polygon.concat(i.LineString),i.Point=[new me({image:new Us({radius:n*2,fill:new li({color:e}),stroke:new Si({color:t,width:n/2})}),zIndex:1/0})],i.MultiPoint=i.Point,i.GeometryCollection=i.Polygon.concat(i.LineString,i.Point),i}function Yd(i){return i.getGeometry()}const oS="#333";class oa{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:oS}),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 oa({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),keepUpright:this.getKeepUpright(),scale:Array.isArray(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 aS(i){return!0}function lS(i){const t=X0(),e=hS(i,t),n=K0();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=$0(s.getGeometry())),e(n)}}function qd(i){const t=X0(),e=i.length,n=new Array(e);for(let o=0;o<e;++o)n[o]=Vc(i[o],t);const s=K0(),r=new Array(e);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<e;++h){const c=n[h](s);c&&(r[l]=c,l+=1)}return r.length=l,r}}function hS(i,t){const e=i.length,n=new Array(e);for(let s=0;s<e;++s){const r=i[s],o="filter"in r?An(r.filter,Be,t):aS;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]=Vc(r.style[h],t)}else a=[Vc(r.style,t)];n[s]={filter:o,styles:a}}return function(s){const r=[];let o=!1;for(let a=0;a<e;++a){const l=n[a].filter;if(l(s)&&!(i[a].else&&o)){o=!0;for(const h of n[a].styles){const c=h(s);c&&r.push(c)}}}return r}}function Vc(i,t){const e=$o(i,"",t),n=Ko(i,"",t),s=cS(i,t),r=uS(i,t),o=He(i,"z-index",t);if(!e&&!n&&!s&&!r&&!Rr(i))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(i));const a=new me;return function(l){let h=!0;if(e){const c=e(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 $o(i,t,e){let n;if(t+"fill-pattern-src"in i)n=_S(i,t+"fill-",e);else{if(i[t+"fill-color"]==="none")return r=>null;n=uf(i,t+"fill-color",e)}if(!n)return null;const s=new li;return function(r){const o=n(r);return o===of?null:(s.setColor(o),s)}}function Ko(i,t,e){const n=He(i,t+"stroke-width",e),s=uf(i,t+"stroke-color",e);if(!n&&!s)return null;const r=un(i,t+"stroke-line-cap",e),o=un(i,t+"stroke-line-join",e),a=tm(i,t+"stroke-line-dash",e),l=He(i,t+"stroke-line-dash-offset",e),h=He(i,t+"stroke-miter-limit",e),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 cS(i,t){const e="text-",n=un(i,e+"value",t);if(!n)return null;const s=$o(i,e,t),r=$o(i,e+"background-",t),o=Ko(i,e,t),a=Ko(i,e+"background-",t),l=un(i,e+"font",t),h=He(i,e+"max-angle",t),c=He(i,e+"offset-x",t),u=He(i,e+"offset-y",t),f=Er(i,e+"overflow",t),d=un(i,e+"placement",t),g=He(i,e+"repeat",t),_=dh(i,e+"scale",t),m=Er(i,e+"rotate-with-view",t),p=He(i,e+"rotation",t),y=un(i,e+"align",t),E=un(i,e+"justify",t),x=un(i,e+"baseline",t),S=Er(i,e+"keep-upright",t),w=tm(i,e+"padding",t),I=gh(i,e+"declutter-mode"),P=new oa({declutterMode:I});return function(C){if(P.setText(n(C)),s&&P.setFill(s(C)),r&&P.setBackgroundFill(r(C)),o&&P.setStroke(o(C)),a&&P.setBackgroundStroke(a(C)),l&&P.setFont(l(C)),h&&P.setMaxAngle(h(C)),c&&P.setOffsetX(c(C)),u&&P.setOffsetY(u(C)),f&&P.setOverflow(f(C)),d){const N=d(C);if(N!=="point"&&N!=="line")throw new Error("Expected point or line for text-placement");P.setPlacement(N)}if(g&&P.setRepeat(g(C)),_&&P.setScale(_(C)),m&&P.setRotateWithView(m(C)),p&&P.setRotation(p(C)),y){const N=y(C);if(N!=="left"&&N!=="center"&&N!=="right"&&N!=="end"&&N!=="start")throw new Error("Expected left, right, center, start, or end for text-align");P.setTextAlign(N)}if(E){const N=E(C);if(N!=="left"&&N!=="right"&&N!=="center")throw new Error("Expected left, right, or center for text-justify");P.setJustify(N)}if(x){const N=x(C);if(N!=="bottom"&&N!=="top"&&N!=="middle"&&N!=="alphabetic"&&N!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");P.setTextBaseline(N)}return w&&P.setPadding(w(C)),S&&P.setKeepUpright(S(C)),P}}function uS(i,t){return"icon-src"in i?fS(i,t):"shape-points"in i?dS(i,t):"circle-radius"in i?gS(i,t):null}function fS(i,t){const e="icon-",n=e+"src",s=em(i[n],n),r=xl(i,e+"anchor",t),o=dh(i,e+"scale",t),a=He(i,e+"opacity",t),l=xl(i,e+"displacement",t),h=He(i,e+"rotation",t),c=Er(i,e+"rotate-with-view",t),u=Zd(i,e+"anchor-origin"),f=Jd(i,e+"anchor-x-units"),d=Jd(i,e+"anchor-y-units"),g=vS(i,e+"color"),_=pS(i,e+"cross-origin"),m=yS(i,e+"offset"),p=Zd(i,e+"offset-origin"),y=El(i,e+"width"),E=El(i,e+"height"),x=mS(i,e+"size"),S=gh(i,e+"declutter-mode"),w=new fh({src:s,anchorOrigin:u,anchorXUnits:f,anchorYUnits:d,color:g,crossOrigin:_,offset:m,offsetOrigin:p,height:E,width:y,size:x,declutterMode:S});return function(I){return a&&w.setOpacity(a(I)),l&&w.setDisplacement(l(I)),h&&w.setRotation(h(I)),c&&w.setRotateWithView(c(I)),o&&w.setScale(o(I)),r&&w.setAnchor(r(I)),w}}function dS(i,t){const e="shape-",n=e+"points",s=e+"radius",r=Xc(i[n],n),o=Xc(i[s],s),a=$o(i,e,t),l=Ko(i,e,t),h=dh(i,e+"scale",t),c=xl(i,e+"displacement",t),u=He(i,e+"rotation",t),f=Er(i,e+"rotate-with-view",t),d=El(i,e+"radius2"),g=El(i,e+"angle"),_=gh(i,e+"declutter-mode"),m=new uh({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 gS(i,t){const e="circle-",n=$o(i,e,t),s=Ko(i,e,t),r=He(i,e+"radius",t),o=dh(i,e+"scale",t),a=xl(i,e+"displacement",t),l=He(i,e+"rotation",t),h=Er(i,e+"rotate-with-view",t),c=gh(i,e+"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(i,t,e){if(!(t in i))return;const n=An(i[t],vt,e);return function(s){return Xc(n(s),t)}}function un(i,t,e){if(!(t in i))return null;const n=An(i[t],Ke,e);return function(s){return em(n(s),t)}}function _S(i,t,e){const n=un(i,t+"pattern-src",e),s=Hd(i,t+"pattern-offset",e),r=Hd(i,t+"pattern-size",e),o=uf(i,t+"color",e);return function(a){return{src:n(a),offset:s&&s(a),size:r&&r(a),color:o&&o(a)}}}function Er(i,t,e){if(!(t in i))return null;const n=An(i[t],Be,e);return function(s){const r=n(s);if(typeof r!="boolean")throw new Error(`Expected a boolean for ${t}`);return r}}function uf(i,t,e){if(!(t in i))return null;const n=An(i[t],Ii,e);return function(s){return im(n(s),t)}}function tm(i,t,e){if(!(t in i))return null;const n=An(i[t],Gs,e);return function(s){return aa(n(s),t)}}function xl(i,t,e){if(!(t in i))return null;const n=An(i[t],Gs,e);return function(s){const r=aa(n(s),t);if(r.length!==2)throw new Error(`Expected two numbers for ${t}`);return r}}function Hd(i,t,e){if(!(t in i))return null;const n=An(i[t],Gs,e);return function(s){return nm(n(s),t)}}function dh(i,t,e){if(!(t in i))return null;const n=An(i[t],Gs|vt,e);return function(s){return xS(n(s),t)}}function El(i,t){const e=i[t];if(e!==void 0){if(typeof e!="number")throw new Error(`Expected a number for ${t}`);return e}}function mS(i,t){const e=i[t];if(e!==void 0){if(typeof e=="number")return Qe(e);if(!Array.isArray(e))throw new Error(`Expected a number or size array for ${t}`);if(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number")throw new Error(`Expected a number or size array for ${t}`);return e}}function pS(i,t){const e=i[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);return e}}function Zd(i,t){const e=i[t];if(e!==void 0){if(e!=="bottom-left"&&e!=="bottom-right"&&e!=="top-left"&&e!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return e}}function Jd(i,t){const e=i[t];if(e!==void 0){if(e!=="pixels"&&e!=="fraction")throw new Error(`Expected pixels or fraction for ${t}`);return e}}function yS(i,t){const e=i[t];if(e!==void 0)return aa(e,t)}function gh(i,t){const e=i[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);if(e!=="declutter"&&e!=="obstacle"&&e!=="none")throw new Error(`Expected declutter, obstacle, or none for ${t}`);return e}}function vS(i,t){const e=i[t];if(e!==void 0)return im(e,t)}function aa(i,t){if(!Array.isArray(i))throw new Error(`Expected an array for ${t}`);const e=i.length;for(let n=0;n<e;++n)if(typeof i[n]!="number")throw new Error(`Expected an array of numbers for ${t}`);return i}function em(i,t){if(typeof i!="string")throw new Error(`Expected a string for ${t}`);return i}function Xc(i,t){if(typeof i!="number")throw new Error(`Expected a number for ${t}`);return i}function im(i,t){if(typeof i=="string")return i;const e=aa(i,t),n=e.length;if(n<3||n>4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function nm(i,t){const e=aa(i,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}function xS(i,t){return typeof i=="number"?i:nm(i,t)}const Qd={RENDER_ORDER:"renderOrder"};class sm extends hh{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Qd.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const n=this.getDeclutter();n in t.declutter||(t.declutter[n]=new U0(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(Qd.RENDER_ORDER,t)}setStyle(t){this.style_=t===void 0?Q0:t;const e=ES(t);this.styleFunction_=t===null?void 0:rS(e),this.changed()}setDeclutter(t){this.declutter_=t?String(t):void 0,this.changed()}}function ES(i){if(i===void 0)return Q0;if(!i)return null;if(typeof i=="function"||i instanceof me)return i;if(!Array.isArray(i))return qd([i]);if(i.length===0)return[];const t=i.length,e=i[0];if(e instanceof me){const s=new Array(t);for(let r=0;r<t;++r){const o=i[r];if(!(o instanceof me))throw new Error("Expected a list of style instances");s[r]=o}return s}if("style"in e){const s=new Array(t);for(let r=0;r<t;++r){const o=i[r];if(!("style"in o))throw new Error("Expected a list of rules with a style property");s[r]=o}return lS(s)}return qd(i)}class rm extends ii{constructor(t,e,n,s){super(t),this.inversePixelTransform=e,this.frameState=n,this.context=s}}class SS extends ql{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){Mt()}calculateMatrices2D(t){const e=t.viewState,n=t.coordinateToPixelTransform,s=t.pixelToCoordinateTransform;Tn(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),y0(s,n)}forEachFeatureAtCoordinate(t,e,n,s,r,o,a,l){let h;const c=e.viewState;function u(x,S,w,I){return r.call(o,S,x?w:null,I)}const f=c.projection,d=u0(t.slice(),f),g=[[0,0]];if(f.canWrapX()&&s){const x=f.getExtent(),S=Et(x);g.push([-S,0],[S,0])}const _=e.layerStatesArray,m=_.length,p=[],y=[];for(let x=0;x<g.length;x++)for(let S=m-1;S>=0;--S){const w=_[S],I=w.layer;if(I.hasRenderer()&&rf(w,c)&&a.call(l,I)){const P=I.getRenderer(),C=I.getSource();if(P&&C){const N=C.getWrapX()?d:t,z=u.bind(null,w.managed);y[0]=N[0]+g[x][0],y[1]=N[1]+g[x][1],h=P.forEachFeatureAtCoordinate(y,e,n,z,p)}if(h)return h}}if(p.length===0)return;const E=1/p.length;return p.forEach((x,S)=>x.distanceSq+=S*E),p.sort((x,S)=>x.distanceSq-S.distanceSq),p.some(x=>h=x.callback(x.feature,x.layer,x.geometry)),h}hasFeatureAtCoordinate(t,e,n,s,r,o){return this.forEachFeatureAtCoordinate(t,e,n,s,Cn,this,r,o)!==void 0}getMap(){return this.map_}renderFrame(t){Mt()}scheduleExpireIconCache(t){yi.canExpireCache()&&t.postRenderFunctions.push(MS)}}function MS(i,t){yi.expire()}class wS extends SS{constructor(t){super(t),this.fontChangeListenerKey_=mt(ir,Tr.PROPERTYCHANGE,t.redrawText,t),this.element_=mi?G0():document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=ah+" ol-layers";const n=t.getViewport();n&&n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,e){const n=this.getMap();if(n.hasListener(t)){const s=new rm(t,void 0,e);n.dispatchEvent(s)}}disposeInternal(){It(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 e=t.layerStatesArray.sort((h,c)=>h.zIndex-c.zIndex);e.some(h=>h.layer instanceof sm&&h.layer.getDeclutter())&&(t.declutter={});const s=t.viewState;this.children_.length=0;const r=[];let o=null;for(let h=0,c=e.length;h<c;++h){const u=e[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),Dx(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(...Gc(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,e){if(t.declutter){for(let n=e.length-1;n>=0;--n){const s=e[n],r=s.layer;r.getDeclutter()&&r.renderDeclutter(t,s)}e.forEach(n=>n.layer.renderDeferred(t))}}}function om(i){if(i instanceof hh){i.setMapInternal(null);return}i instanceof zr&&i.getLayers().forEach(om)}function am(i,t){if(i instanceof hh){i.setMapInternal(t);return}if(i instanceof zr){const e=i.getLayers().getArray();for(let n=0,s=e.length;n<s;++n)am(e[n],t)}}let CS=class extends Di{constructor(t){super(),t=t||{},this.on,this.once,this.un;const e=TS(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:gx,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_=e.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,mi||(this.resizeObserver_=new ResizeObserver(()=>this.updateSize())),this.controls=e.controls||(mi?new Me:Bx()),this.interactions=e.interactions||(mi?new Me:oE({onFocusOnly:!0})),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new yx(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(e.values);const n=this;t.view&&!(t.view instanceof Wi)&&t.view.then(function(s){n.setView(new Wi(s))}),this.controls.addEventListener(ee.ADD,s=>{s.element.setMap(this)}),this.controls.addEventListener(ee.REMOVE,s=>{s.element.setMap(null)}),this.interactions.addEventListener(ee.ADD,s=>{s.element.setMap(this)}),this.interactions.addEventListener(ee.REMOVE,s=>{s.element.setMap(null)}),this.overlays_.addEventListener(ee.ADD,s=>{this.addOverlayInternal_(s.element)}),this.overlays_.addEventListener(ee.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){am(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();e!==void 0&&(this.overlayIdIndex_[e.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,e,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:Cn,a=n.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(s,this.frameState_,r,a,e,null,o,null)}getFeaturesAtPixel(t,e){const n=[];return this.forEachFeatureAtPixel(t,function(s){n.push(s)},e),n}getAllLayers(){const t=[];function e(n){n.forEach(function(s){s instanceof zr?e(s.getLayers()):t.push(s)})}return e(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const n=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};const s=e.layerFilter!==void 0?e.layerFilter:Cn,r=e.hitTolerance!==void 0?e.hitTolerance:0,o=e.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 e=this.frameState_;return e?de(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return e!==void 0?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Ie.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof Me){e.setLayers(t);return}const n=e.getLayers();n.clear(),n.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,n=t.length;e<n;++e){const s=t[e];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 e=jt(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){const e=this.frameState_;return e?de(e.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,e,n,s){return vx(this.frameState_,t,e,n,s)}handleBrowserEvent(t,e){e=e||t.type;const n=new ln(e,this,t);this.handleMapBrowserEvent(n)}handleMapBrowserEvent(t){if(!this.frameState_)return;const e=t.originalEvent,n=e.type;if(n===kc.POINTERDOWN||n===lt.WHEEL||n===lt.KEYDOWN){const s=this.getOwnerDocument(),r=this.viewport_.getRootNode?this.viewport_.getRootNode():s,o=e.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_,e=this.tileQueue_;if(!e.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}}e.getTilesLoading()<s&&(e.reprioritize(),e.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(hn.LOADEND,this,t)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new tr(hn.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)It(this.targetChangeHandlerKeys_[n]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(lt.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(lt.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(),e=typeof t=="string"?document.getElementById(t):t;if(this.targetElement_=e,!e)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(e)||e.appendChild(this.viewport_),this.renderer_||(this.renderer_=new wS(this)),!$n(e)){this.mapBrowserEventHandler_=new mx(this,this.moveTolerance_);for(const s in xt)this.mapBrowserEventHandler_.addEventListener(xt[s],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(lt.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(lt.WHEEL,this.boundHandleBrowserEvent_,L0?{passive:!1}:!1);let n;if(this.keyboardEventTarget_)n=this.keyboardEventTarget_;else{const s=e.getRootNode();n=s instanceof ShadowRoot?s.host:e}if(this.targetChangeHandlerKeys_=[mt(n,lt.KEYDOWN,this.handleBrowserEvent,this),mt(n,lt.KEYPRESS,this.handleBrowserEvent,this)],e instanceof HTMLElement){const s=e.getRootNode();s instanceof ShadowRoot&&this.resizeObserver_.observe(s.host),this.resizeObserver_?.observe(e)}}this.updateSize()}}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(It(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(It(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const t=this.getView();t&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=mt(t,Tr.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=mt(t,lt.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(It),this.layerGroupPropertyListenerKeys_=null);const t=this.getLayerGroup();t&&(this.handleLayerAdd_(new Wn("addlayer",t)),this.layerGroupPropertyListenerKeys_=[mt(t,Tr.PROPERTYCHANGE,this.render,this),mt(t,lt.CHANGE,this.render,this),mt(t,"addlayer",this.handleLayerAdd_,this),mt(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 e=0,n=t.length;e<n;++e){const s=t[e].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){om(t.layer)}removeOverlay(t){return this.getOverlays().remove(t)}renderFrame_(t){const e=this.getSize(),n=this.getView(),s=this.frameState_;let r=null;if(e!==void 0&&zd(e)&&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:hl(a.center,a.resolution,a.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{},mapId:ct(this),renderTargets:{}},a.nextCenter&&a.nextResolution){const l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;r.nextExtent=hl(a.nextCenter,a.nextResolution,l,e)}}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(hn.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(hn.MOVEEND,this,r)),n0(r.extent,this.previousExtent_))),this.dispatchEvent(new tr(hn.POSTRENDER,this,r)),this.renderComplete_=(this.hasListener(hn.LOADSTART)||this.hasListener(hn.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 e=this.getLayerGroup();e&&this.handleLayerRemove_(new Wn("removelayer",e)),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 Wi){this.set(Ie.VIEW,t);return}this.set(Ie.VIEW,new Wi);const e=this;t.then(function(n){e.setView(new Wi(n))})}updateSize(){const t=this.getTargetElement();let e;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)&&(e=[Math.max(0,s),Math.max(0,r)],!zd(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&h0("No map visible because the map container's width or height are 0."))}const n=this.getSize();e&&(!n||!Pn(e,n))&&(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){const e=this.getView();e&&e.setViewportSize(t)}};function TS(i){let t=null;i.keyboardEventTarget!==void 0&&(t=typeof i.keyboardEventTarget=="string"?document.getElementById(i.keyboardEventTarget):i.keyboardEventTarget);const e={},n=i.layers&&typeof i.layers.getLayers=="function"?i.layers:new zr({layers:i.layers});e[Ie.LAYERGROUP]=n,e[Ie.TARGET]=i.target,e[Ie.VIEW]=i.view instanceof Wi?i.view:new Wi;let s;i.controls!==void 0&&(Array.isArray(i.controls)?s=new Me(i.controls.slice()):(Lt(typeof i.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),s=i.controls));let r;i.interactions!==void 0&&(Array.isArray(i.interactions)?r=new Me(i.interactions.slice()):(Lt(typeof i.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),r=i.interactions));let o;return i.overlays!==void 0?Array.isArray(i.overlays)?o=new Me(i.overlays.slice()):(Lt(typeof i.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=i.overlays):o=new Me,{controls:s,interactions:r,keyboardEventTarget:t,overlays:o,values:e}}function RS(i,t){for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&t[e]!==void 0&&(i[e]=t[e]);return i}const IS=le({__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(i,{expose:t,emit:e}){const n=i,s=e,r=bn({...n,instance:void 0}),o=Nt(void 0);let a=n.instance||new CS({...r});ne(r,()=>{const f=n.instance?RS(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)=>(_t(),Yt("div",{ref_key:"mapRef",ref:o},[Hi(f.$slots,"default")],512))}}),Te={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class PS 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 "+Lx,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(){F0(this.element);const t=this.getElement();t&&this.element.appendChild(t)}handleMapChanged(){this.mapPostrenderListenerKey&&(this.element?.remove(),It(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const t=this.getMap();if(t){this.mapPostrenderListenerKey=mt(t,hn.POSTRENDER,this.render,this),this.updatePixelPosition();const e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.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 e=this.getMap();if(!e||!e.getTargetElement()||!this.get(Te.POSITION))return;const n=this.getRect(e.getTargetElement(),e.getSize()),s=this.getElement(),r=this.getRect(s,[Fx(s),Gx(s)]);t=t||{};const o=t.margin===void 0?20:t.margin;if(!dn(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=e.getView().getCenterInternal(),d=e.getPixelFromCoordinateInternal(f);if(!d)return;const g=[d[0]+u[0],d[1]+u[1]],_=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(g),duration:_.duration,easing:_.easing})}}}getRect(t,e){const n=t.getBoundingClientRect(),s=n.left+window.pageXOffset,r=n.top+window.pageYOffset;return[s,r,s+e[0],r+e[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(),e=this.getPosition();if(!t||!t.isRendered()||!e){this.setVisible(!1);return}const n=t.getPixelFromCoordinate(e),s=t.getSize();this.updateRenderedPosition(n,s)}updateRenderedPosition(t,e){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 bS=le({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(i,{expose:t}){const e=i,n=Bt("map"),s=Nt(),r=bn(e),o=vu(new PS(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)),ne(()=>r,m=>{for(const p in m){const y=p;m[y]!==void 0&&o.value.set(p,m[y])}},{deep:!0}),zp(()=>{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)=>(_t(),Yt("div",{ref_key:"htmlContent",ref:s},[Hi(m.$slots,"default",{position:m.position})],512))}});function AS(i){const t=Object.keys(i.defs),e=t.length;let n,s;for(n=0;n<e;++n){const r=t[n];if(!Xa(r)){const o=i.defs(r);let a=o.units;!a&&o.projName==="longlat"&&(a="degrees"),fl(new Ls({code:r,axisOrientation:o.axis,metersPerUnit:o.to_meter,units:a}))}}for(n=0;n<e;++n){const r=t[n],o=Xa(r);for(s=0;s<e;++s){const a=t[s],l=Xa(a);if(!$a(r,a))if(i.defs[r]===i.defs[a])Oc([o,l]);else{const h=i(r,a);Lv(o,l,Td(o,l,h.forward),Td(l,o,h.inverse))}}}}function LS(i){i("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),i("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),i("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)i("EPSG:"+(32600+t),"+proj=utm +zone="+t+" +datum=WGS84 +units=m"),i("EPSG:"+(32700+t),"+proj=utm +zone="+t+" +south +datum=WGS84 +units=m");i.WGS84=i["EPSG:4326"],i["EPSG:3785"]=i["EPSG:3857"],i.GOOGLE=i["EPSG:3857"],i["EPSG:900913"]=i["EPSG:3857"],i["EPSG:102113"]=i["EPSG:3857"]}var Ds=1,Ns=2,Sr=3,OS=4,$c=5,tg=6378137,FS=6356752314e-3,eg=.0066943799901413165,Mo=484813681109536e-20,B=Math.PI/2,GS=.16666666666666666,DS=.04722222222222222,NS=.022156084656084655,Z=1e-10,Ee=.017453292519943295,Xi=57.29577951308232,bt=Math.PI/4,Yo=Math.PI*2,ie=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 kS={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 ig=/[\s_\-\/\(\)]/g;function as(i,t){if(i[t])return i[t];for(var e=Object.keys(i),n=t.toLowerCase().replace(ig,""),s=-1,r,o;++s<e.length;)if(r=e[s],o=r.toLowerCase().replace(ig,""),o===n)return i[r]}function Kc(i){var t={},e=i.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*Ee},lat_1:function(a){t.lat1=a*Ee},lat_2:function(a){t.lat2=a*Ee},lat_ts:function(a){t.lat_ts=a*Ee},lon_0:function(a){t.long0=a*Ee},lon_1:function(a){t.long1=a*Ee},lon_2:function(a){t.long2=a*Ee},alpha:function(a){t.alpha=parseFloat(a)*Ee},gamma:function(a){t.rectified_grid_angle=parseFloat(a)*Ee},lonc:function(a){t.longc=a*Ee},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(kS,a);l&&(t.to_meter=l.to_meter)},from_greenwich:function(a){t.from_greenwich=a*Ee},pm:function(a){var l=as(ni,a);t.from_greenwich=(l||parseFloat(a))*Ee},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 e)s=e[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 lm{static getId(t){const e=t.find(n=>Array.isArray(n)&&n[0]==="ID");return e&&e.length>=3?{authority:e[1],code:parseInt(e[2],10)}:null}static convertUnit(t,e="unit"){if(!t||t.length<3)return{type:e,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:e,name:n,conversion_factor:s,id:o}}static convertAxis(t){const e=t[1]||"Unknown";let n;const s=e.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:e,direction:n,unit:l,order:o}}static extractAxes(t){return t.filter(e=>Array.isArray(e)&&e[0]==="AXIS").map(e=>this.convertAxis(e)).sort((e,n)=>(e.order||0)-(n.order||0))}static convert(t,e={}){switch(t[0]){case"PROJCRS":e.type="ProjectedCRS",e.name=t[1],e.base_crs=t.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")):null,e.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&&(e.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);e.coordinate_system.unit=f}e.id=this.getId(t);break;case"BASEGEOGCRS":case"GEOGCRS":e.type="GeographicCRS",e.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"?e.datum_ensemble=f:e.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])})}e.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(t)},e.id=this.getId(t);break;case"DATUM":e.type="GeodeticReferenceFrame",e.name=t[1],e.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":e.type="DatumEnsemble",e.name=t[1],e.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&&(e.accuracy=parseFloat(o[1]));const a=t.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID");a&&(e.ellipsoid=this.convert(a)),e.id=this.getId(t);break;case"ELLIPSOID":e.type="Ellipsoid",e.name=t[1],e.semi_major_axis=parseFloat(t[2]),e.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"),e);break;case"CONVERSION":e.type="Conversion",e.name=t[1],e.method=t.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,e.parameters=t.filter(f=>Array.isArray(f)&&f[0]==="PARAMETER").map(f=>this.convert(f));break;case"METHOD":e.type="Method",e.name=t[1],e.id=this.getId(t);break;case"PARAMETER":e.type="Parameter",e.name=t[1],e.value=parseFloat(t[2]),e.unit=this.convertUnit(t.find(f=>Array.isArray(f)&&(f[0]==="LENGTHUNIT"||f[0]==="ANGLEUNIT"||f[0]==="SCALEUNIT"))),e.id=this.getId(t);break;case"BOUNDCRS":e.type="BoundCRS";const l=t.find(f=>Array.isArray(f)&&f[0]==="SOURCECRS");if(l){const f=l.find(d=>Array.isArray(d));e.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));e.target_crs=f?this.convert(f):null}const c=t.find(f=>Array.isArray(f)&&f[0]==="ABRIDGEDTRANSFORMATION");c?e.transformation=this.convert(c):e.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(e.type="Transformation",e.name=t[1],e.method=t.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,e.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}}}),e.parameters.length===7){const f=e.parameters[6];f.name==="Scale difference"&&(f.value=Math.round((f.value-1)*1e12)/1e6)}e.id=this.getId(t);break;case"AXIS":e.coordinate_system||(e.coordinate_system={type:"unspecified",axis:[]}),e.coordinate_system.axis.push(this.convertAxis(t));break;case"LENGTHUNIT":const u=this.convertUnit(t,"LinearUnit");e.coordinate_system&&e.coordinate_system.axis&&e.coordinate_system.axis.forEach(f=>{f.unit||(f.unit=u)}),u.conversion_factor&&u.conversion_factor!==1&&e.semi_major_axis&&(e.semi_major_axis={value:e.semi_major_axis,unit:u});break;default:e.keyword=t[0];break}return e}}class jS extends lm{static convert(t,e={}){return super.convert(t,e),e.coordinate_system&&e.coordinate_system.subtype==="Cartesian"&&delete e.coordinate_system,e.usage&&delete e.usage,e}}class BS extends lm{static convert(t,e={}){super.convert(t,e);const n=t.find(r=>Array.isArray(r)&&r[0]==="CS");n&&(e.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");e.usage={},r&&(e.usage.scope=r[1]),o&&(e.usage.area=o[1]),a&&(e.usage.bbox=a.slice(1))}return e}}function zS(i){return i.find(t=>Array.isArray(t)&&t[0]==="USAGE")?"2019":(i.find(t=>Array.isArray(t)&&t[0]==="CS")||i[0]==="BOUNDCRS"||i[0]==="PROJCRS"||i[0]==="GEOGCRS","2015")}function WS(i){return(zS(i)==="2019"?BS:jS).convert(i)}function US(i){const t=i.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 qo=1,hm=2,cm=3,Sl=4,um=5,ff=-1,VS=/\s/,XS=/[A-Za-z]/,$S=/[A-Za-z84_]/,_h=/[,\]]/,fm=/[\d\.E\-\+]/;function Ln(i){if(typeof i!="string")throw new Error("not a string");this.text=i.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=qo}Ln.prototype.readCharicter=function(){var i=this.text[this.place++];if(this.state!==Sl)for(;VS.test(i);){if(this.place>=this.text.length)return;i=this.text[this.place++]}switch(this.state){case qo:return this.neutral(i);case hm:return this.keyword(i);case Sl:return this.quoted(i);case um:return this.afterquote(i);case cm:return this.number(i);case ff:return}};Ln.prototype.afterquote=function(i){if(i==='"'){this.word+='"',this.state=Sl;return}if(_h.test(i)){this.word=this.word.trim(),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)};Ln.prototype.afterItem=function(i){if(i===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=qo;return}if(i==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=qo,this.currentObject=this.stack.pop(),this.currentObject||(this.state=ff);return}};Ln.prototype.number=function(i){if(fm.test(i)){this.word+=i;return}if(_h.test(i)){this.word=parseFloat(this.word),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)};Ln.prototype.quoted=function(i){if(i==='"'){this.state=um;return}this.word+=i};Ln.prototype.keyword=function(i){if($S.test(i)){this.word+=i;return}if(i==="["){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=qo;return}if(_h.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place)};Ln.prototype.neutral=function(i){if(XS.test(i)){this.word=i,this.state=hm;return}if(i==='"'){this.word="",this.state=Sl;return}if(fm.test(i)){this.word=i,this.state=cm;return}if(_h.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place)};Ln.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 KS(i){var t=new Ln(i);return t.output()}function Zh(i,t,e){Array.isArray(t)&&(e.unshift(t),t=null);var n=t?{}:i,s=e.reduce(function(r,o){return ar(o,r),r},n);t&&(i[t]=s)}function ar(i,t){if(!Array.isArray(i)){t[i]=!0;return}var e=i.shift();if(e==="PARAMETER"&&(e=i.shift()),i.length===1){if(Array.isArray(i[0])){t[e]={},ar(i[0],t[e]);return}t[e]=i[0];return}if(!i.length){t[e]=!0;return}if(e==="TOWGS84"){t[e]=i;return}if(e==="AXIS"){e in t||(t[e]=[]),t[e].push(i);return}Array.isArray(e)||(t[e]={});var n;switch(e){case"UNIT":case"PRIMEM":case"VERT_DATUM":t[e]={name:i[0].toLowerCase(),convert:i[1]},i.length===3&&ar(i[2],t[e]);return;case"SPHEROID":case"ELLIPSOID":t[e]={name:i[0],a:i[1],rf:i[2]},i.length===4&&ar(i[3],t[e]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":i[0]=["name",i[0]],Zh(t,e,i);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":i[0]=["name",i[0]],Zh(t,e,i),t[e].type=e;return;default:for(n=-1;++n<i.length;)if(!Array.isArray(i[n]))return ar(i,t[e]);return Zh(t,e,i)}}var YS=.017453292519943295;function Ti(i){return i*YS}function dm(i){const t=(i.projName||"").toLowerCase().replace(/_/g," ");!i.long0&&i.longc&&(t==="albers conic equal area"||t==="lambert azimuthal equal area")&&(i.long0=i.longc),!i.lat_ts&&i.lat1&&(t==="stereographic south pole"||t==="polar stereographic (variant b)")?(i.lat0=Ti(i.lat1>0?90:-90),i.lat_ts=i.lat1,delete i.lat1):!i.lat_ts&&i.lat0&&(t==="polar stereographic"||t==="polar stereographic (variant a)")&&(i.lat_ts=i.lat0,i.lat0=Ti(i.lat0>0?90:-90),delete i.lat1)}function ng(i){let t={units:null,to_meter:void 0};return typeof i=="string"?(t.units=i.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.units==="meter"&&(t.to_meter=1)):i&&i.name&&(t.units=i.name.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.to_meter=i.conversion_factor),t}function sg(i){return typeof i=="object"?i.value*i.unit.conversion_factor:i}function rg(i,t){i.ellipsoid.radius?(t.a=i.ellipsoid.radius,t.rf=0):(t.a=sg(i.ellipsoid.semi_major_axis),i.ellipsoid.inverse_flattening!==void 0?t.rf=i.ellipsoid.inverse_flattening:i.ellipsoid.semi_major_axis!==void 0&&i.ellipsoid.semi_minor_axis!==void 0&&(t.rf=t.a/(t.a-sg(i.ellipsoid.semi_minor_axis))))}function Ml(i,t={}){return!i||typeof i!="object"?i:i.type==="BoundCRS"?(Ml(i.source_crs,t),i.transformation&&(i.transformation.method&&i.transformation.method.name==="NTv2"?t.nadgrids=i.transformation.parameters[0].value:t.datum_params=i.transformation.parameters.map(e=>e.value)),t):(Object.keys(i).forEach(e=>{const n=i[e];if(n!==null)switch(e){case"name":if(t.srsCode)break;t.name=n,t.srsCode=n;break;case"type":n==="GeographicCRS"?t.projName="longlat":n==="ProjectedCRS"&&i.conversion&&i.conversion.method&&(t.projName=i.conversion.method.name);break;case"datum":case"datum_ensemble":n.ellipsoid&&(t.ellps=n.ellipsoid.name,rg(n,t)),n.prime_meridian&&(t.from_greenwich=n.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":t.ellps=n.name,rg(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}=ng(n.unit);t.units=s,t.to_meter=r}else if(n.axis[0]&&n.axis[0].unit){const{units:s,to_meter:r}=ng(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":Ml(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),dm(t),t)}var qS=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function HS(i,t){var e=t[0],n=t[1];!(e in i)&&n in i&&(i[e]=i[n],t.length===3&&(i[e]=t[2](i[e])))}function gm(i){for(var t=Object.keys(i),e=0,n=t.length;e<n;++e){var s=t[e];qS.indexOf(s)!==-1&&ZS(i[s]),typeof i[s]=="object"&&gm(i[s])}}function ZS(i){if(i.AUTHORITY){var t=Object.keys(i.AUTHORITY)[0];t&&t in i.AUTHORITY&&(i.title=t+":"+i.AUTHORITY[t])}if(i.type==="GEOGCS"?i.projName="longlat":i.type==="LOCAL_CS"?(i.projName="identity",i.local=!0):typeof i.PROJECTION=="object"?i.projName=Object.keys(i.PROJECTION)[0]:i.projName=i.PROJECTION,i.AXIS){for(var e="",n=0,s=i.AXIS.length;n<s;++n){var r=[i.AXIS[n][0].toLowerCase(),i.AXIS[n][1].toLowerCase()];r[0].indexOf("north")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="north"?e+="n":r[0].indexOf("south")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="south"?e+="s":r[0].indexOf("east")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="east"?e+="e":(r[0].indexOf("west")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="west")&&(e+="w")}e.length===2&&(e+="u"),e.length===3&&(i.axis=e)}i.UNIT&&(i.units=i.UNIT.name.toLowerCase(),i.units==="metre"&&(i.units="meter"),i.UNIT.convert&&(i.type==="GEOGCS"?i.DATUM&&i.DATUM.SPHEROID&&(i.to_meter=i.UNIT.convert*i.DATUM.SPHEROID.a):i.to_meter=i.UNIT.convert));var o=i.GEOGCS;i.type==="GEOGCS"&&(o=i),o&&(o.DATUM?i.datumCode=o.DATUM.name.toLowerCase():i.datumCode=o.name.toLowerCase(),i.datumCode.slice(0,2)==="d_"&&(i.datumCode=i.datumCode.slice(2)),i.datumCode==="new_zealand_1949"&&(i.datumCode="nzgd49"),(i.datumCode==="wgs_1984"||i.datumCode==="world_geodetic_system_1984")&&(i.PROJECTION==="Mercator_Auxiliary_Sphere"&&(i.sphere=!0),i.datumCode="wgs84"),i.datumCode==="belge_1972"&&(i.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(i.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),i.ellps.toLowerCase().slice(0,13)==="international"&&(i.ellps="intl"),i.a=o.DATUM.SPHEROID.a,i.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(i.datum_params=o.DATUM.TOWGS84),~i.datumCode.indexOf("osgb_1936")&&(i.datumCode="osgb36"),~i.datumCode.indexOf("osni_1952")&&(i.datumCode="osni52"),(~i.datumCode.indexOf("tm65")||~i.datumCode.indexOf("geodetic_datum_of_1965"))&&(i.datumCode="ire65"),i.datumCode==="ch1903+"&&(i.datumCode="ch1903"),~i.datumCode.indexOf("israel")&&(i.datumCode="isr93")),i.b&&!isFinite(i.b)&&(i.b=i.a),i.rectified_grid_angle&&(i.rectified_grid_angle=Ti(i.rectified_grid_angle));function a(c){var u=i.to_meter||1;return c*u}var l=function(c){return HS(i,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),dm(i)}function Yc(i){if(typeof i=="object")return Ml(i);const t=US(i);var e=KS(i);if(t==="WKT2"){const r=WS(e);return Ml(r)}var n=e[0],s={};return ar(e,s),gm(s),s[n]}function ke(i){var t=this;if(arguments.length===2){var e=arguments[1];typeof e=="string"?e.charAt(0)==="+"?ke[i]=Kc(arguments[1]):ke[i]=Yc(arguments[1]):ke[i]=e}else if(arguments.length===1){if(Array.isArray(i))return i.map(function(n){return Array.isArray(n)?ke.apply(t,n):ke(n)});if(typeof i=="string"){if(i in ke)return ke[i]}else"EPSG"in i?ke["EPSG:"+i.EPSG]=i:"ESRI"in i?ke["ESRI:"+i.ESRI]=i:"IAU2000"in i?ke["IAU2000:"+i.IAU2000]=i:console.log(i);return}}LS(ke);function JS(i){return typeof i=="string"}function QS(i){return i in ke}function tM(i){return i.indexOf("+")!==0&&i.indexOf("[")!==-1||typeof i=="object"&&!("srsCode"in i)}var eM=["3857","900913","3785","102113"];function iM(i){var t=as(i,"authority");if(t){var e=as(t,"epsg");return e&&eM.indexOf(e)>-1}}function nM(i){var t=as(i,"extension");if(t)return as(t,"proj4")}function sM(i){return i[0]==="+"}function rM(i){if(JS(i)){if(QS(i))return ke[i];if(tM(i)){var t=Yc(i);if(iM(t))return ke["EPSG:3857"];var e=nM(t);return e?Kc(e):t}if(sM(i))return Kc(i)}else return"projName"in i?i:Yc(i)}function og(i,t){i=i||{};var e,n;if(!t)return i;for(n in t)e=t[n],e!==void 0&&(i[n]=e);return i}function qi(i,t,e){var n=i*t;return e/Math.sqrt(1-n*n)}function la(i){return i<0?-1:1}function J(i){return Math.abs(i)<=ie?i:i-la(i)*Yo}function Ai(i,t,e){var n=i*e,s=.5*i;return n=Math.pow((1-n)/(1+n),s),Math.tan(.5*(B-t))/n}function Ho(i,t){for(var e=.5*i,n,s,r=B-2*Math.atan(t),o=0;o<=15;o++)if(n=i*Math.sin(r),s=B-2*Math.atan(t*Math.pow((1-n)/(1+n),e))-r,r+=s,Math.abs(s)<=1e-10)return r;return-9999}function oM(){var i=this.b/this.a;this.es=1-i*i,"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=qi(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function aM(i){var t=i.x,e=i.y;if(e*Xi>90&&e*Xi<-90&&t*Xi>180&&t*Xi<-180)return null;var n,s;if(Math.abs(Math.abs(e)-B)<=Z)return null;if(this.sphere)n=this.x0+this.a*this.k0*J(t-this.long0),s=this.y0+this.a*this.k0*Math.log(Math.tan(bt+.5*e));else{var r=Math.sin(e),o=Ai(this.e,e,r);n=this.x0+this.a*this.k0*J(t-this.long0),s=this.y0-this.a*this.k0*Math.log(o)}return i.x=n,i.y=s,i}function lM(i){var t=i.x-this.x0,e=i.y-this.y0,n,s;if(this.sphere)s=B-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var r=Math.exp(-e/(this.a*this.k0));if(s=Ho(this.e,r),s===-9999)return null}return n=J(this.long0+t/(this.a*this.k0)),i.x=n,i.y=s,i}var hM=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const cM={init:oM,forward:aM,inverse:lM,names:hM};function uM(){}function ag(i){return i}var fM=["longlat","identity"];const dM={init:uM,forward:ag,inverse:ag,names:fM};var gM=[cM,dM],Ms={},lr=[];function _m(i,t){var e=lr.length;return i.names?(lr[e]=i,i.names.forEach(function(n){Ms[n.toLowerCase()]=e}),this):(console.log(t),!0)}function mm(i){return i.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function _M(i){if(!i)return!1;var t=i.toLowerCase();if(typeof Ms[t]<"u"&&lr[Ms[t]]||(t=mm(t),t in Ms&&lr[Ms[t]]))return lr[Ms[t]]}function mM(){gM.forEach(_m)}const pM={start:mM,add:_m,get:_M};var pm={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 yM=pm.WGS84;function vM(i,t,e,n){var s=i*i,r=t*t,o=(s-r)/s,a=0;n?(i*=1-o*(GS+o*(DS+o*NS)),s=i*i,o=0):a=Math.sqrt(o);var l=(s-r)/r;return{es:o,e:a,ep2:l}}function xM(i,t,e,n,s){if(!i){var r=as(pm,n);r||(r=yM),i=r.a,t=r.b,e=r.rf}return e&&!t&&(t=(1-1/e)*i),(e===0||Math.abs(i-t)<Z)&&(s=!0,t=i),{a:i,b:t,rf:e,sphere:s}}var Ka={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 EM in Ka){var Jh=Ka[EM];Jh.datumName&&(Ka[Jh.datumName]=Jh)}function SM(i,t,e,n,s,r,o){var a={};return i===void 0||i==="none"?a.datum_type=$c:a.datum_type=OS,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=Ds),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=Ns,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=e,a.b=n,a.es=s,a.ep2=r,a}var df={};function MM(i,t,e){return t instanceof ArrayBuffer?wM(i,t,e):{ready:CM(i,t)}}function wM(i,t,e){var n=!0;e!==void 0&&e.includeErrorFields===!1&&(n=!1);var s=new DataView(t),r=IM(s),o=PM(s,r),a=bM(s,o,r,n),l={header:o,subgrids:a};return df[i]=l,l}async function CM(i,t){for(var e=[],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(lg),c=[r.fileDirectory.ModelPixelScale[0],r.fileDirectory.ModelPixelScale[1]].map(lg),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 E=l[0]-1;E>=0;E--){var m=y*l[0]+E;_.push([-Kn(g[m]),Kn(d[m])])}e.push({del:c,lim:l,ll:[-u,f],cvs:_})}var p={header:{nSubgrids:n},subgrids:e};return df[i]=p,p}function TM(i){if(i===void 0)return null;var t=i.split(",");return t.map(RM)}function RM(i){if(i.length===0)return null;var t=i[0]==="@";return t&&(i=i.slice(1)),i==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:i,mandatory:!t,grid:df[i]||null,isNull:!1}}function lg(i){return i*Math.PI/180}function Kn(i){return i/3600*Math.PI/180}function IM(i){var t=i.getInt32(8,!1);return t===11?!1:(t=i.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function PM(i,t){return{nFields:i.getInt32(8,t),nSubgridFields:i.getInt32(24,t),nSubgrids:i.getInt32(40,t),shiftType:qc(i,56,64).trim(),fromSemiMajorAxis:i.getFloat64(120,t),fromSemiMinorAxis:i.getFloat64(136,t),toSemiMajorAxis:i.getFloat64(152,t),toSemiMinorAxis:i.getFloat64(168,t)}}function qc(i,t,e){return String.fromCharCode.apply(null,new Uint8Array(i.buffer.slice(t,e)))}function bM(i,t,e,n){for(var s=176,r=[],o=0;o<t.nSubgrids;o++){var a=LM(i,s,e),l=OM(i,s,a,e,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:AM(l)});var u=16;n===!1&&(u=8),s+=176+a.gridNodeCount*u}return r}function AM(i){return i.map(function(t){return[Kn(t.longitudeShift),Kn(t.latitudeShift)]})}function LM(i,t,e){return{name:qc(i,t+8,t+16).trim(),parent:qc(i,t+24,t+24+8).trim(),lowerLatitude:i.getFloat64(t+72,e),upperLatitude:i.getFloat64(t+88,e),lowerLongitude:i.getFloat64(t+104,e),upperLongitude:i.getFloat64(t+120,e),latitudeInterval:i.getFloat64(t+136,e),longitudeInterval:i.getFloat64(t+152,e),gridNodeCount:i.getInt32(t+168,e)}}function OM(i,t,e,n,s){var r=t+176,o=16;s===!1&&(o=8);for(var a=[],l=0;l<e.gridNodeCount;l++){var h={latitudeShift:i.getFloat32(r+l*o,n),longitudeShift:i.getFloat32(r+l*o+4,n)};s!==!1&&(h.latitudeAccuracy=i.getFloat32(r+l*o+8,n),h.longitudeAccuracy=i.getFloat32(r+l*o+12,n)),a.push(h)}return a}function Li(i,t){if(!(this instanceof Li))return new Li(i);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 e=rM(i);if(typeof e!="object"){t("Could not parse to valid json: "+i);return}var n=Li.projections.get(e.projName);if(!n){t("Could not get projection name from: "+i);return}if(e.datumCode&&e.datumCode!=="none"){var s=as(Ka,e.datumCode);s&&(e.datum_params=e.datum_params||(s.towgs84?s.towgs84.split(","):null),e.ellps=s.ellipse,e.datumName=s.datumName?s.datumName:e.datumCode)}e.k0=e.k0||1,e.axis=e.axis||"enu",e.ellps=e.ellps||"wgs84",e.lat1=e.lat1||e.lat0;var r=xM(e.a,e.b,e.rf,e.ellps,e.sphere),o=vM(r.a,r.b,r.rf,e.R_A),a=TM(e.nadgrids),l=e.datum||SM(e.datumCode,e.datum_params,r.a,r.b,o.es,o.ep2,a);og(this,e),og(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=pM;Li.projections.start();function FM(i,t){return i.datum_type!==t.datum_type||i.a!==t.a||Math.abs(i.es-t.es)>5e-11?!1:i.datum_type===Ds?i.datum_params[0]===t.datum_params[0]&&i.datum_params[1]===t.datum_params[1]&&i.datum_params[2]===t.datum_params[2]:i.datum_type===Ns?i.datum_params[0]===t.datum_params[0]&&i.datum_params[1]===t.datum_params[1]&&i.datum_params[2]===t.datum_params[2]&&i.datum_params[3]===t.datum_params[3]&&i.datum_params[4]===t.datum_params[4]&&i.datum_params[5]===t.datum_params[5]&&i.datum_params[6]===t.datum_params[6]:!0}function ym(i,t,e){var n=i.x,s=i.y,r=i.z?i.z:0,o,a,l,h;if(s<-B&&s>-1.001*B)s=-B;else if(s>B&&s<1.001*B)s=B;else{if(s<-B)return{x:-1/0,y:-1/0,z:i.z};if(s>B)return{x:1/0,y:1/0,z:i.z}}return n>Math.PI&&(n-=2*Math.PI),a=Math.sin(s),h=Math.cos(s),l=a*a,o=e/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 vm(i,t,e,n){var s=1e-12,r=s*s,o=30,a,l,h,c,u,f,d,g,_,m,p,y,E,x=i.x,S=i.y,w=i.z?i.z:0,I,P,C;if(a=Math.sqrt(x*x+S*S),l=Math.sqrt(x*x+S*S+w*w),a/e<s){if(I=0,l/e<s)return P=B,C=-n,{x:i.x,y:i.y,z:i.z}}else I=Math.atan2(S,x);h=w/l,c=a/l,u=1/Math.sqrt(1-t*(2-t)*c*c),g=c*(1-t)*u,_=h*u,E=0;do E++,d=e/Math.sqrt(1-t*_*_),C=a*g+w*_-d*(1-t*_*_),f=t*d/(d+C),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&&E<o);return P=Math.atan(p/Math.abs(m)),{x:I,y:P,z:C}}function GM(i,t,e){if(t===Ds)return{x:i.x+e[0],y:i.y+e[1],z:i.z+e[2]};if(t===Ns){var n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],l=e[5],h=e[6];return{x:h*(i.x-l*i.y+a*i.z)+n,y:h*(l*i.x+i.y-o*i.z)+s,z:h*(-a*i.x+o*i.y+i.z)+r}}}function DM(i,t,e){if(t===Ds)return{x:i.x-e[0],y:i.y-e[1],z:i.z-e[2]};if(t===Ns){var n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],l=e[5],h=e[6],c=(i.x-n)/h,u=(i.y-s)/h,f=(i.z-r)/h;return{x:c+l*u-a*f,y:-l*c+u+o*f,z:a*c-o*u+f}}}function Ia(i){return i===Ds||i===Ns}function NM(i,t,e){if(FM(i,t)||i.datum_type===$c||t.datum_type===$c)return e;var n=i.a,s=i.es;if(i.datum_type===Sr){var r=hg(i,!1,e);if(r!==0)return;n=tg,s=eg}var o=t.a,a=t.b,l=t.es;if(t.datum_type===Sr&&(o=tg,a=FS,l=eg),s===l&&n===o&&!Ia(i.datum_type)&&!Ia(t.datum_type))return e;if(e=ym(e,s,n),Ia(i.datum_type)&&(e=GM(e,i.datum_type,i.datum_params)),Ia(t.datum_type)&&(e=DM(e,t.datum_type,t.datum_params)),e=vm(e,l,o,a),t.datum_type===Sr){var h=hg(t,!0,e);if(h!==0)return}return e}function hg(i,t,e){if(i.grids===null||i.grids.length===0)return console.log("Grid shift grids not found"),-1;var n={x:-e.x,y:e.y},s={x:Number.NaN,y:Number.NaN},r=[];t:for(var o=0;o<i.grids.length;o++){var a=i.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=kM(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*Xi+" "+n.y*Xi+" tried: '"+r+"'"),-1):(e.x=-s.x,e.y=s.y,0)}function kM(i,t,e){var n={x:Number.NaN,y:Number.NaN};if(isNaN(i.x))return n;var s={x:i.x,y:i.y};s.x-=e.ll[0],s.y-=e.ll[1],s.x=J(s.x-Math.PI)+Math.PI;var r=cg(s,e);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=cg(r,e),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=J(r.x+e.ll[0]),n.y=r.y+e.ll[1]}else isNaN(r.x)||(n.x=i.x+r.x,n.y=i.y+r.y);return n}function cg(i,t){var e={x:i.x/t.del[0],y:i.y/t.del[1]},n={x:Math.floor(e.x),y:Math.floor(e.y)},s={x:e.x-1*n.x,y:e.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 ug(i,t,e){var n=e.x,s=e.y,r=e.z||0,o,a,l,h={};for(l=0;l<3;l++)if(!(t&&l===2&&e.z===void 0))switch(l===0?(o=n,"ew".indexOf(i.axis[l])!==-1?a="x":a="y"):l===1?(o=s,"ns".indexOf(i.axis[l])!==-1?a="y":a="x"):(o=r,a="z"),i.axis[l]){case"e":h[a]=o;break;case"w":h[a]=-o;break;case"n":h[a]=o;break;case"s":h[a]=-o;break;case"u":e[a]!==void 0&&(h.z=o);break;case"d":e[a]!==void 0&&(h.z=-o);break;default:return null}return h}function xm(i){var t={x:i[0],y:i[1]};return i.length>2&&(t.z=i[2]),i.length>3&&(t.m=i[3]),t}function jM(i){fg(i.x),fg(i.y)}function fg(i){if(typeof Number.isFinite=="function"){if(Number.isFinite(i))return;throw new TypeError("coordinates must be finite numbers")}if(typeof i!="number"||i!==i||!isFinite(i))throw new TypeError("coordinates must be finite numbers")}function BM(i,t){return(i.datum.datum_type===Ds||i.datum.datum_type===Ns||i.datum.datum_type===Sr)&&t.datumCode!=="WGS84"||(t.datum.datum_type===Ds||t.datum.datum_type===Ns||t.datum.datum_type===Sr)&&i.datumCode!=="WGS84"}function wl(i,t,e,n){var s;Array.isArray(e)?e=xm(e):e={x:e.x,y:e.y,z:e.z,m:e.m};var r=e.z!==void 0;if(jM(e),i.datum&&t.datum&&BM(i,t)&&(s=new Li("WGS84"),e=wl(i,s,e,n),i=s),n&&i.axis!=="enu"&&(e=ug(i,!1,e)),i.projName==="longlat")e={x:e.x*Ee,y:e.y*Ee,z:e.z||0};else if(i.to_meter&&(e={x:e.x*i.to_meter,y:e.y*i.to_meter,z:e.z||0}),e=i.inverse(e),!e)return;if(i.from_greenwich&&(e.x+=i.from_greenwich),e=NM(i.datum,t.datum,e),!!e)return e=e,t.from_greenwich&&(e={x:e.x-t.from_greenwich,y:e.y,z:e.z||0}),t.projName==="longlat"?e={x:e.x*Xi,y:e.y*Xi,z:e.z||0}:(e=t.forward(e),t.to_meter&&(e={x:e.x/t.to_meter,y:e.y/t.to_meter,z:e.z||0})),n&&t.axis!=="enu"?ug(t,!0,e):(e&&!r&&delete e.z,e)}var dg=Li("WGS84");function Qh(i,t,e,n){var s,r,o;return Array.isArray(e)?(s=wl(i,t,e,n)||{x:NaN,y:NaN},e.length>2?typeof i.name<"u"&&i.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"?typeof s.z=="number"?[s.x,s.y,s.z].concat(e.slice(3)):[s.x,s.y,e[2]].concat(e.slice(3)):[s.x,s.y].concat(e.slice(2)):[s.x,s.y]):(r=wl(i,t,e,n),o=Object.keys(e),o.length===2||o.forEach(function(a){if(typeof i.name<"u"&&i.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]=e[a]}),r)}function Pa(i){return i instanceof Li?i:typeof i=="object"&&"oProj"in i?i.oProj:Li(i)}function zM(i,t,e){var n,s,r=!1,o;return typeof t>"u"?(s=Pa(i),n=dg,r=!0):(typeof t.x<"u"||Array.isArray(t))&&(e=t,s=Pa(i),n=dg,r=!0),n||(n=Pa(i)),s||(s=Pa(t)),e?Qh(n,s,e):(o={forward:function(a,l){return Qh(n,s,a,l)},inverse:function(a,l){return Qh(s,n,a,l)}},r&&(o.oProj=s),o)}var gg=6,Em="AJSAJS",Sm="AFAFAF",hr=65,Xe=73,gi=79,co=86,uo=90;const WM={forward:Mm,inverse:UM,toPoint:wm};function Mm(i,t){return t=t||5,$M(VM({lat:i[1],lon:i[0]}),t)}function UM(i){var t=gf(Tm(i.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function wm(i){var t=gf(Tm(i.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function tc(i){return i*(Math.PI/180)}function _g(i){return 180*(i/Math.PI)}function VM(i){var t=i.lat,e=i.lon,n=6378137,s=.00669438,r=.9996,o,a,l,h,c,u,f,d=tc(t),g=tc(e),_,m;m=Math.floor((e+180)/6)+1,e===180&&(m=60),t>=56&&t<64&&e>=3&&e<12&&(m=32),t>=72&&t<84&&(e>=0&&e<9?m=31:e>=9&&e<21?m=33:e>=21&&e<33?m=35:e>=33&&e<42&&(m=37)),o=(m-1)*6-180+3,_=tc(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:XM(t)}}function gf(i){var t=i.northing,e=i.easting,n=i.zoneLetter,s=i.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,E=e-5e5,x=t;n<"N"&&(x-=1e7),m=(s-1)*6-180+3,l=a/(1-a),_=x/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=E/(c*r);var S=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);S=_g(S);var w=(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);w=m+_g(w);var I;if(i.accuracy){var P=gf({northing:i.northing+i.accuracy,easting:i.easting+i.accuracy,zoneLetter:i.zoneLetter,zoneNumber:i.zoneNumber});I={top:P.lat,right:P.lon,bottom:S,left:w}}else I={lat:S,lon:w};return I}function XM(i){var t="Z";return 84>=i&&i>=72?t="X":72>i&&i>=64?t="W":64>i&&i>=56?t="V":56>i&&i>=48?t="U":48>i&&i>=40?t="T":40>i&&i>=32?t="S":32>i&&i>=24?t="R":24>i&&i>=16?t="Q":16>i&&i>=8?t="P":8>i&&i>=0?t="N":0>i&&i>=-8?t="M":-8>i&&i>=-16?t="L":-16>i&&i>=-24?t="K":-24>i&&i>=-32?t="J":-32>i&&i>=-40?t="H":-40>i&&i>=-48?t="G":-48>i&&i>=-56?t="F":-56>i&&i>=-64?t="E":-64>i&&i>=-72?t="D":-72>i&&i>=-80&&(t="C"),t}function $M(i,t){var e="00000"+i.easting,n="00000"+i.northing;return i.zoneNumber+i.zoneLetter+KM(i.easting,i.northing,i.zoneNumber)+e.substr(e.length-5,t)+n.substr(n.length-5,t)}function KM(i,t,e){var n=Cm(e),s=Math.floor(i/1e5),r=Math.floor(t/1e5)%20;return YM(s,r,n)}function Cm(i){var t=i%gg;return t===0&&(t=gg),t}function YM(i,t,e){var n=e-1,s=Em.charCodeAt(n),r=Sm.charCodeAt(n),o=s+i-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 Tm(i){if(i&&i.length===0)throw"MGRSPoint coverting from nothing";for(var t=i.length,e=null,n="",s,r=0;!/[A-Z]/.test(s=i.charAt(r));){if(r>=2)throw"MGRSPoint bad conversion from: "+i;n+=s,r++}var o=parseInt(n,10);if(r===0||r+3>t)throw"MGRSPoint bad conversion from: "+i;var a=i.charAt(r++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+i;e=i.substring(r,r+=2);for(var l=Cm(o),h=qM(e.charAt(0),l),c=HM(e.charAt(1),l);c<ZM(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`+i;var f=u/2,d=0,g=0,_,m,p,y,E;return f>0&&(_=1e5/Math.pow(10,f),m=i.substring(r,r+f),d=parseFloat(m)*_,p=i.substring(r+f),g=parseFloat(p)*_),y=d+h,E=g+c,{easting:y,northing:E,zoneLetter:a,zoneNumber:o,accuracy:_}}function qM(i,t){for(var e=Em.charCodeAt(t-1),n=1e5,s=!1;e!==i.charCodeAt(0);){if(e++,e===Xe&&e++,e===gi&&e++,e>uo){if(s)throw"Bad character: "+i;e=hr,s=!0}n+=1e5}return n}function HM(i,t){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var e=Sm.charCodeAt(t-1),n=0,s=!1;e!==i.charCodeAt(0);){if(e++,e===Xe&&e++,e===gi&&e++,e>co){if(s)throw"Bad character: "+i;e=hr,s=!0}n+=1e5}return n}function ZM(i){var t;switch(i){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: "+i}function Fr(i,t,e){if(!(this instanceof Fr))return new Fr(i,t,e);if(Array.isArray(i))this.x=i[0],this.y=i[1],this.z=i[2]||0;else if(typeof i=="object")this.x=i.x,this.y=i.y,this.z=i.z||0;else if(typeof i=="string"&&typeof t>"u"){var n=i.split(",");this.x=parseFloat(n[0]),this.y=parseFloat(n[1]),this.z=parseFloat(n[2])||0}else this.x=i,this.y=t,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Fr.fromMGRS=function(i){return new Fr(wm(i))};Fr.prototype.toMGRS=function(i){return Mm([this.x,this.y],i)};var JM=1,QM=.25,mg=.046875,pg=.01953125,yg=.01068115234375,t2=.75,e2=.46875,i2=.013020833333333334,n2=.007120768229166667,s2=.3645833333333333,r2=.005696614583333333,o2=.3076171875;function _f(i){var t=[];t[0]=JM-i*(QM+i*(mg+i*(pg+i*yg))),t[1]=i*(t2-i*(mg+i*(pg+i*yg)));var e=i*i;return t[2]=e*(e2-i*(i2+i*n2)),e*=i,t[3]=e*(s2-i*r2),t[4]=e*i*o2,t}function Wr(i,t,e,n){return e*=t,t*=t,n[0]*i-e*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var a2=20;function mf(i,t,e){for(var n=1/(1-t),s=i,r=a2;r;--r){var o=Math.sin(s),a=1-t*o*o;if(a=(Wr(s,o,Math.cos(s),e)-i)*(a*Math.sqrt(a))*n,s-=a,Math.abs(a)<Z)return s}return s}function l2(){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 h2(i){var t=i.x,e=i.y,n=J(t-this.long0),s,r,o,a=Math.sin(e),l=Math.cos(e);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)>Z?Math.tan(e):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(e,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)<Z)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>Z)return 93;o=0}else o=Math.acos(o);e<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return i.x=r,i.y=o,i}function c2(i){var t,e,n,s,r=(i.x-this.x0)*(1/this.a),o=(i.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,e=mf(t,this.es,this.en),Math.abs(e)<B){var u=Math.sin(e),f=Math.cos(e),d=Math.abs(f)>Z?Math.tan(e):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,E=Math.pow(y,2);t=t*d,n=e-t*E/(1-this.es)*.5*(1-E/12*(5+3*m-9*g*m+g-4*_-E/30*(61+90*m-252*g*m+45*p+46*g-E/56*(1385+3633*m+4095*p+1574*p*m)))),s=J(this.long0+y*(1-E/6*(1+2*m+g-E/20*(5+28*m+24*p+8*g*m+6*g-E/42*(61+662*m+1320*p+720*p*m))))/f)}else n=B*la(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=J(Math.atan2(l,c)+this.long0)}return i.x=s,i.y=n,i}var u2=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const Ya={init:l2,forward:h2,inverse:c2,names:u2};function Rm(i){var t=Math.exp(i);return t=(t-1/t)/2,t}function Ze(i,t){i=Math.abs(i),t=Math.abs(t);var e=Math.max(i,t),n=Math.min(i,t)/(e||1);return e*Math.sqrt(1+Math.pow(n,2))}function f2(i){var t=1+i,e=t-1;return e===0?i:i*Math.log(t)/e}function d2(i){var t=Math.abs(i);return t=f2(t*(1+t/(Ze(1,t)+1))),i<0?-t:t}function pf(i,t){for(var e=2*Math.cos(2*t),n=i.length-1,s=i[n],r=0,o;--n>=0;)o=-r+e*s+i[n],r=s,s=o;return t+o*Math.sin(2*t)}function g2(i,t){for(var e=2*Math.cos(t),n=i.length-1,s=i[n],r=0,o;--n>=0;)o=-r+e*s+i[n],r=s,s=o;return Math.sin(t)*o}function _2(i){var t=Math.exp(i);return t=(t+1/t)/2,t}function Im(i,t,e){for(var n=Math.sin(t),s=Math.cos(t),r=Rm(e),o=_2(e),a=2*s*o,l=-2*n*r,h=i.length-1,c=i[h],u=0,f=0,d=0,g,_;--h>=0;)g=f,_=u,f=c,u=d,c=-g+a*f-l*u+i[h],d=-_+l*f+a*u;return a=n*o,l=s*r,[a*c-l*d,a*d+l*c]}function m2(){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&&(Ya.init.apply(this),this.forward=Ya.forward,this.inverse=Ya.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 i=this.es/(1+Math.sqrt(1-this.es)),t=i/(2-i),e=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),e=e*t,this.cgb[1]=e*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=e*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),e=e*t,this.cgb[2]=e*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=e*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),e=e*t,this.cgb[3]=e*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=e*(1237/630+t*(-12/5+t*(-24832/14175))),e=e*t,this.cgb[4]=e*(4174/315+t*(-144838/6237)),this.cbg[4]=e*(-734/315+t*(109598/31185)),e=e*t,this.cgb[5]=e*(601676/22275),this.cbg[5]=e*(444337/155925),e=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+e*(1/4+e*(1/64+e/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=e*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=e*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),e=e*t,this.utg[2]=e*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=e*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),e=e*t,this.utg[3]=e*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=e*(49561/161280+t*(-179/168+t*(6601661/7257600))),e=e*t,this.utg[4]=e*(-4583/161280+t*(108847/3991680)),this.gtu[4]=e*(34729/80640+t*(-3418889/1995840)),e=e*t,this.utg[5]=e*(-20648693/638668800),this.gtu[5]=e*(212378941/319334400);var n=pf(this.cbg,this.lat0);this.Zb=-this.Qn*(n+g2(this.gtu,2*n))}function p2(i){var t=J(i.x-this.long0),e=i.y;e=pf(this.cbg,e);var n=Math.sin(e),s=Math.cos(e),r=Math.sin(t),o=Math.cos(t);e=Math.atan2(n,o*s),t=Math.atan2(r*s,Ze(n,s*o)),t=d2(Math.tan(t));var a=Im(this.gtu,2*e,2*t);e=e+a[0],t=t+a[1];var l,h;return Math.abs(t)<=2.623395162778?(l=this.a*(this.Qn*t)+this.x0,h=this.a*(this.Qn*e+this.Zb)+this.y0):(l=1/0,h=1/0),i.x=l,i.y=h,i}function y2(i){var t=(i.x-this.x0)*(1/this.a),e=(i.y-this.y0)*(1/this.a);e=(e-this.Zb)/this.Qn,t=t/this.Qn;var n,s;if(Math.abs(t)<=2.623395162778){var r=Im(this.utg,2*e,2*t);e=e+r[0],t=t+r[1],t=Math.atan(Rm(t));var o=Math.sin(e),a=Math.cos(e),l=Math.sin(t),h=Math.cos(t);e=Math.atan2(o*h,Ze(l,h*a)),t=Math.atan2(l,h*a),n=J(t+this.long0),s=pf(this.cgb,e)}else n=1/0,s=1/0;return i.x=n,i.y=s,i}var v2=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const qa={init:m2,forward:p2,inverse:y2,names:v2};function x2(i,t){if(i===void 0){if(i=Math.floor((J(t)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var E2="etmerc";function S2(){var i=x2(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*Ee,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,qa.init.apply(this),this.forward=qa.forward,this.inverse=qa.inverse}var M2=["Universal Transverse Mercator System","utm"];const w2={init:S2,names:M2,dependsOn:E2};function yf(i,t){return Math.pow((1-i)/(1+i),t)}var C2=20;function T2(){var i=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*i*i),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(i/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+bt)/(Math.pow(Math.tan(.5*this.lat0+bt),this.C)*yf(this.e*i,this.ratexp))}function R2(i){var t=i.x,e=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+bt),this.C)*yf(this.e*Math.sin(e),this.ratexp))-B,i.x=this.C*t,i}function I2(i){for(var t=1e-14,e=i.x/this.C,n=i.y,s=Math.pow(Math.tan(.5*n+bt)/this.K,1/this.C),r=C2;r>0&&(n=2*Math.atan(s*yf(this.e*Math.sin(i.y),-.5*this.e))-B,!(Math.abs(n-i.y)<t));--r)i.y=n;return r?(i.x=e,i.y=n,i):null}const vf={init:T2,forward:R2,inverse:I2};function P2(){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 b2(i){var t,e,n,s;return i.x=J(i.x-this.long0),vf.forward.apply(this,[i]),t=Math.sin(i.y),e=Math.cos(i.y),n=Math.cos(i.x),s=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*e*n),i.x=s*e*Math.sin(i.x),i.y=s*(this.cosc0*t-this.sinc0*e*n),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function A2(i){var t,e,n,s,r;if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,r=Ze(i.x,i.y)){var o=2*Math.atan2(r,this.R2);t=Math.sin(o),e=Math.cos(o),s=Math.asin(e*this.sinc0+i.y*t*this.cosc0/r),n=Math.atan2(i.x*t,r*this.cosc0*e-i.y*this.sinc0*t)}else s=this.phic0,n=0;return i.x=n,i.y=s,vf.inverse.apply(this,[i]),i.x=J(i.x+this.long0),i}var L2=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const O2={init:P2,forward:b2,inverse:A2,names:L2};function xf(i,t,e){return t*=e,Math.tan(.5*(B+i))*Math.pow((1-t)/(1+t),.5*e)}function F2(){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)<=Z&&(this.k0=.5*(1+la(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Z&&(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)<=Z&&Math.abs(Math.cos(this.lat_ts))>Z&&(this.k0=.5*this.cons*qi(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=qi(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(xf(this.lat0,this.sinlat0,this.e))-B,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function G2(i){var t=i.x,e=i.y,n=Math.sin(e),s=Math.cos(e),r,o,a,l,h,c,u=J(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=Z&&Math.abs(e+this.lat0)<=Z?(i.x=NaN,i.y=NaN,i):this.sphere?(r=2*this.k0/(1+this.sinlat0*n+this.coslat0*s*Math.cos(u)),i.x=this.a*r*s*Math.sin(u)+this.x0,i.y=this.a*r*(this.coslat0*n-this.sinlat0*s*Math.cos(u))+this.y0,i):(o=2*Math.atan(xf(e,n,this.e))-B,l=Math.cos(o),a=Math.sin(o),Math.abs(this.coslat0)<=Z?(h=Ai(this.e,e*this.con,this.con*n),c=2*this.a*this.k0*h/this.cons,i.x=this.x0+c*Math.sin(t-this.long0),i.y=this.y0-this.con*c*Math.cos(t-this.long0),i):(Math.abs(this.sinlat0)<Z?(r=2*this.a*this.k0/(1+l*Math.cos(u)),i.y=r*a):(r=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*l*Math.cos(u))),i.y=r*(this.cosX0*a-this.sinX0*l*Math.cos(u))+this.y0),i.x=r*l*Math.sin(u)+this.x0,i))}function D2(i){i.x-=this.x0,i.y-=this.y0;var t,e,n,s,r,o=Math.sqrt(i.x*i.x+i.y*i.y);if(this.sphere){var a=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,e=this.lat0,o<=Z?(i.x=t,i.y=e,i):(e=Math.asin(Math.cos(a)*this.sinlat0+i.y*Math.sin(a)*this.coslat0/o),Math.abs(this.coslat0)<Z?this.lat0>0?t=J(this.long0+Math.atan2(i.x,-1*i.y)):t=J(this.long0+Math.atan2(i.x,i.y)):t=J(this.long0+Math.atan2(i.x*Math.sin(a),o*this.coslat0*Math.cos(a)-i.y*this.sinlat0*Math.sin(a))),i.x=t,i.y=e,i)}else if(Math.abs(this.coslat0)<=Z){if(o<=Z)return e=this.lat0,t=this.long0,i.x=t,i.y=e,i;i.x*=this.con,i.y*=this.con,n=o*this.cons/(2*this.a*this.k0),e=this.con*Ho(this.e,n),t=this.con*J(this.con*this.long0+Math.atan2(i.x,-1*i.y))}else s=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=Z?r=this.X0:(r=Math.asin(Math.cos(s)*this.sinX0+i.y*Math.sin(s)*this.cosX0/o),t=J(this.long0+Math.atan2(i.x*Math.sin(s),o*this.cosX0*Math.cos(s)-i.y*this.sinX0*Math.sin(s)))),e=-1*Ho(this.e,Math.tan(.5*(B+r)));return i.x=t,i.y=e,i}var N2=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const k2={init:F2,forward:G2,inverse:D2,names:N2,ssfn_:xf};function j2(){var i=this.lat0;this.lambda0=this.long0;var t=Math.sin(i),e=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*e*Math.sqrt(1-r)/(1-r*Math.pow(t,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(i),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+i/2)),h=Math.log((1+o*t)/(1-o*t));this.K=a-this.alpha*l+this.alpha*o/2*h}function B2(i){var t=Math.log(Math.tan(Math.PI/4-i.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(i.y))/(1-this.e*Math.sin(i.y))),n=-this.alpha*(t+e)+this.K,s=2*(Math.atan(Math.exp(n))-Math.PI/4),r=this.alpha*(i.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 i.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,i.x=this.R*o+this.x0,i}function z2(i){for(var t=i.x-this.x0,e=i.y-this.y0,n=t/this.R,s=2*(Math.atan(Math.exp(e/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 i.x=a,i.y=h,i}var W2=["somerc"];const U2={init:j2,forward:B2,inverse:z2,names:W2};var nr=1e-7;function V2(i){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],e=typeof i.projName=="object"?Object.keys(i.projName)[0]:i.projName;return"no_uoff"in i||"no_off"in i||t.indexOf(e)!==-1||t.indexOf(mm(e))!==-1}function X2(){var i,t,e,n,s,r,o,a,l,h,c=0,u,f=0,d=0,g=0,_=0,m=0,p=0;this.no_off=V2(this),this.no_rot="no_rot"in this;var y=!1;"alpha"in this&&(y=!0);var E=!1;if("rectified_grid_angle"in this&&(E=!0),y&&(p=this.alpha),E&&(c=this.rectified_grid_angle),y||E)f=this.longc;else if(d=this.long1,_=this.lat1,g=this.long2,m=this.lat2,Math.abs(_-m)<=nr||(i=Math.abs(_))<=nr||Math.abs(i-B)<=nr||Math.abs(Math.abs(this.lat0)-B)<=nr||Math.abs(Math.abs(m)-B)<=nr)throw new Error;var x=1-this.es;t=Math.sqrt(x),Math.abs(this.lat0)>Z?(a=Math.sin(this.lat0),e=Math.cos(this.lat0),i=1-this.es*a*a,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/x),this.A=this.B*this.k0*t/i,n=this.B*t/(e*Math.sqrt(i)),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||E?(y?(u=Math.asin(Math.sin(p)/n),E||(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),i=d-g,i<-Math.PI?g-=Yo:i>Math.PI&&(g+=Yo),this.lam0=J(.5*(d+g)-Math.atan(h*Math.tan(.5*this.B*(d-g))/l)/this.B),u=Math.atan(2*Math.sin(this.B*J(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(bt-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(bt+s))}function $2(i){var t={},e,n,s,r,o,a,l,h;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-B)>Z){if(o=this.E/Math.pow(Ai(this.e,i.y,Math.sin(i.y)),this.B),a=1/o,e=.5*(o-a),n=.5*(o+a),r=Math.sin(this.B*i.x),s=(e*this.singam-r*this.cosgam)/n,Math.abs(Math.abs(s)-1)<Z)throw new Error;h=.5*this.ArB*Math.log((1-s)/(1+s)),a=Math.cos(this.B*i.x),Math.abs(a)<nr?l=this.A*i.x:l=this.ArB*Math.atan2(e*this.cosgam+r*this.singam,a)}else h=i.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*i.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 K2(i){var t,e,n,s,r,o,a,l={};if(i.x=(i.x-this.x0)*(1/this.a),i.y=(i.y-this.y0)*(1/this.a),this.no_rot?(e=i.y,t=i.x):(e=i.x*this.cosrot-i.y*this.sinrot,t=i.y*this.cosrot+i.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*e),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)<Z)l.x=0,l.y=a<0?-B:B;else{if(l.y=this.E/Math.sqrt((1+a)/(1-a)),l.y=Ho(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 Y2=["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 q2={init:X2,forward:$2,inverse:K2,names:Y2};function H2(){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)<Z)){var i=this.b/this.a;this.e=Math.sqrt(1-i*i);var t=Math.sin(this.lat1),e=Math.cos(this.lat1),n=qi(this.e,t,e),s=Ai(this.e,this.lat1,t),r=Math.sin(this.lat2),o=Math.cos(this.lat2),a=qi(this.e,r,o),l=Ai(this.e,this.lat2,r),h=Math.abs(Math.abs(this.lat0)-B)<Z?0:Ai(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Z?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 Z2(i){var t=i.x,e=i.y;Math.abs(2*Math.abs(e)-Math.PI)<=Z&&(e=la(e)*(B-2*Z));var n=Math.abs(Math.abs(e)-B),s,r;if(n>Z)s=Ai(this.e,e,Math.sin(e)),r=this.a*this.f0*Math.pow(s,this.ns);else{if(n=e*this.ns,n<=0)return null;r=0}var o=this.ns*J(t-this.long0);return i.x=this.k0*(r*Math.sin(o))+this.x0,i.y=this.k0*(this.rh-r*Math.cos(o))+this.y0,i}function J2(i){var t,e,n,s,r,o=(i.x-this.x0)/this.k0,a=this.rh-(i.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+a*a),e=1):(t=-Math.sqrt(o*o+a*a),e=-1);var l=0;if(t!==0&&(l=Math.atan2(e*o,e*a)),t!==0||this.ns>0){if(e=1/this.ns,n=Math.pow(t/(this.a*this.f0),e),s=Ho(this.e,n),s===-9999)return null}else s=-B;return r=J(l/this.ns+this.long0),i.x=r,i.y=s,i}var Q2=["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 tw={init:H2,forward:Z2,inverse:J2,names:Q2};function ew(){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 iw(i){var t,e,n,s,r,o,a,l=i.x,h=i.y,c=J(l-this.long0);return t=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/t)-this.s45),n=-c*this.alfa,s=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(n)),r=Math.asin(Math.cos(e)*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),i.y=a*Math.cos(o)/1,i.x=a*Math.sin(o)/1,this.czech||(i.y*=-1,i.x*=-1),i}function nw(i){var t,e,n,s,r,o,a,l,h=i.x;i.x=i.y,i.y=h,this.czech||(i.y*=-1,i.x*=-1),o=Math.sqrt(i.x*i.x+i.y*i.y),r=Math.atan2(i.y,i.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)),e=Math.asin(Math.cos(n)*Math.sin(s)/Math.cos(t)),i.x=this.long0-e/this.alfa,a=t,l=0;var c=0;do i.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-i.y)<1e-10&&(l=1),a=i.y,c+=1;while(l===0&&c<15);return c>=15?null:i}var sw=["Krovak","krovak"];const rw={init:ew,forward:iw,inverse:nw,names:sw};function We(i,t,e,n,s){return i*s-t*Math.sin(2*s)+e*Math.sin(4*s)-n*Math.sin(6*s)}function ha(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function ca(i){return .375*i*(1+.25*i*(1+.46875*i))}function ua(i){return .05859375*i*i*(1+.75*i)}function fa(i){return i*i*i*(35/3072)}function Ef(i,t,e){var n=t*e;return i/Math.sqrt(1-n*n)}function fs(i){return Math.abs(i)<B?i:i-la(i)*Math.PI}function Cl(i,t,e,n,s){var r,o;r=i/t;for(var a=0;a<15;a++)if(o=(i-(t*r-e*Math.sin(2*r)+n*Math.sin(4*r)-s*Math.sin(6*r)))/(t-2*e*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 ow(){this.sphere||(this.e0=ha(this.es),this.e1=ca(this.es),this.e2=ua(this.es),this.e3=fa(this.es),this.ml0=this.a*We(this.e0,this.e1,this.e2,this.e3,this.lat0))}function aw(i){var t,e,n=i.x,s=i.y;if(n=J(n-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(s)*Math.sin(n)),e=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)),e=f-this.ml0+a*r/o*c*(.5+(5-l+6*u)*c/24)}return i.x=t+this.x0,i.y=e+this.y0,i}function lw(i){i.x-=this.x0,i.y-=this.y0;var t=i.x/this.a,e=i.y/this.a,n,s;if(this.sphere){var r=e+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+e,a=Cl(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-B)<=Z)return i.x=this.long0,i.y=B,e<0&&(i.y*=-1),i;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 i.x=J(s+this.long0),i.y=fs(n),i}var hw=["Cassini","Cassini_Soldner","cass"];const cw={init:ow,forward:aw,inverse:lw,names:hw};function is(i,t){var e;return i>1e-7?(e=i*t,(1-i*i)*(t/(1-e*e)-.5/i*Math.log((1-e)/(1+e)))):2*t}var Hc=1,Zc=2,Jc=3,Ha=4;function uw(){var i=Math.abs(this.lat0);if(Math.abs(i-B)<Z?this.mode=this.lat0<0?Hc:Zc:Math.abs(i)<Z?this.mode=Jc:this.mode=Ha,this.es>0){var t;switch(this.qp=is(this.e,1),this.mmf=.5/(1-this.es),this.apa=xw(this.es),this.mode){case Zc:this.dd=1;break;case Hc:this.dd=1;break;case Jc:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case Ha: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===Ha&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function fw(i){var t,e,n,s,r,o,a,l,h,c,u=i.x,f=i.y;if(u=J(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(e=this.mode===this.EQUIT?1+c*n:1+this.sinph0*r+this.cosph0*c*n,e<=Z)return null;e=Math.sqrt(2/e),t=e*c*Math.sin(u),e*=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)<Z)return null;e=bt-f*.5,e=2*(this.mode===this.S_POLE?Math.cos(e):Math.sin(e)),t=e*Math.sin(u),e*=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=B+f,o=this.qp-o;break;case this.S_POLE:h=f-B,o=this.qp+o;break}if(Math.abs(h)<Z)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),this.mode===this.OBLIQ?e=this.ymf*h*(this.cosb1*a-this.sinb1*l*n):e=(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,e=n*(this.mode===this.S_POLE?h:-h)):t=e=0;break}}return i.x=this.a*t+this.x0,i.y=this.a*e+this.y0,i}function dw(i){i.x-=this.x0,i.y-=this.y0;var t=i.x/this.a,e=i.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+e*e),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)<=Z?0:Math.asin(e*f/u),t*=f,e=c*u;break;case this.OBLIQ:s=Math.abs(u)<=Z?this.lat0:Math.asin(c*this.sinph0+e*f*this.cosph0/u),t*=f*this.cosph0,e=(c-Math.sin(s)*this.sinph0)*u;break;case this.N_POLE:e=-e,s=B-s;break;case this.S_POLE:s-=B;break}n=e===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,e)}else{if(h=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,e*=this.dd,l=Math.sqrt(t*t+e*e),l<Z)return i.x=this.long0,i.y=this.lat0,i;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+e*o*this.cosb1/l,a=this.qp*h,e=l*this.cosb1*r-e*this.sinb1*o):(h=e*o/l,a=this.qp*h,e=l*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(e=-e),a=t*t+e*e,!a)return i.x=this.long0,i.y=this.lat0,i;h=1-a/this.qp,this.mode===this.S_POLE&&(h=-h)}n=Math.atan2(t,e),s=Ew(Math.asin(h),this.apa)}return i.x=J(this.long0+n),i.y=s,i}var gw=.3333333333333333,_w=.17222222222222222,mw=.10257936507936508,pw=.06388888888888888,yw=.0664021164021164,vw=.016415012942191543;function xw(i){var t,e=[];return e[0]=i*gw,t=i*i,e[0]+=t*_w,e[1]=t*pw,t*=i,e[0]+=t*mw,e[1]+=t*yw,e[2]=t*vw,e}function Ew(i,t){var e=i+i;return i+t[0]*Math.sin(e)+t[1]*Math.sin(e+e)+t[2]*Math.sin(e+e+e)}var Sw=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const Mw={init:uw,forward:fw,inverse:dw,names:Sw,S_POLE:Hc,N_POLE:Zc,EQUIT:Jc,OBLIQ:Ha};function ls(i){return Math.abs(i)>1&&(i=i>1?1:-1),Math.asin(i)}function ww(){Math.abs(this.lat1+this.lat2)<Z||(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=qi(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=qi(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)>Z?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 Cw(i){var t=i.x,e=i.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var n=is(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,r=this.ns0*J(t-this.long0),o=s*Math.sin(r)+this.x0,a=this.rh-s*Math.cos(r)+this.y0;return i.x=o,i.y=a,i}function Tw(i){var t,e,n,s,r,o;return i.x-=this.x0,i.y=this.rh-i.y+this.y0,this.ns0>=0?(t=Math.sqrt(i.x*i.x+i.y*i.y),n=1):(t=-Math.sqrt(i.x*i.x+i.y*i.y),n=-1),s=0,t!==0&&(s=Math.atan2(n*i.x,n*i.y)),n=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-n*n)/(2*this.ns0)):(e=(this.c-n*n)/this.ns0,o=this.phi1z(this.e3,e)),r=J(s/this.ns0+this.long0),i.x=r,i.y=o,i}function Rw(i,t){var e,n,s,r,o,a=ls(.5*t);if(i<Z)return a;for(var l=i*i,h=1;h<=25;h++)if(e=Math.sin(a),n=Math.cos(a),s=i*e,r=1-s*s,o=.5*r*r/n*(t/(1-l)-e/r+.5/i*Math.log((1-s)/(1+s))),a=a+o,Math.abs(o)<=1e-7)return a;return null}var Iw=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const Pw={init:ww,forward:Cw,inverse:Tw,names:Iw,phi1z:Rw};function bw(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function Aw(i){var t,e,n,s,r,o,a,l,h=i.x,c=i.y;return n=J(h-this.long0),t=Math.sin(c),e=Math.cos(c),s=Math.cos(n),o=this.sin_p14*t+this.cos_p14*e*s,r=1,o>0||Math.abs(o)<=Z?(a=this.x0+this.a*r*e*Math.sin(n)/o,l=this.y0+this.a*r*(this.cos_p14*t-this.sin_p14*e*s)/o):(a=this.x0+this.infinity_dist*e*Math.sin(n),l=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*e*s)),i.x=a,i.y=l,i}function Lw(i){var t,e,n,s,r,o;return i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,(t=Math.sqrt(i.x*i.x+i.y*i.y))?(s=Math.atan2(t,this.rc),e=Math.sin(s),n=Math.cos(s),o=ls(n*this.sin_p14+i.y*e*this.cos_p14/t),r=Math.atan2(i.x*e,t*this.cos_p14*n-i.y*this.sin_p14*e),r=J(this.long0+r)):(o=this.phic0,r=0),i.x=r,i.y=o,i}var Ow=["gnom"];const Fw={init:bw,forward:Aw,inverse:Lw,names:Ow};function Gw(i,t){var e=1-(1-i*i)/(2*i)*Math.log((1-i)/(1+i));if(Math.abs(Math.abs(t)-e)<1e-6)return t<0?-1*B:B;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=i*r,s=Math.pow(1-a*a,2)/(2*o)*(t/(1-i*i)-r/(1-a*a)+.5/i*Math.log((1-a)/(1+a))),n+=s,Math.abs(s)<=1e-10)return n;return NaN}function Dw(){this.sphere||(this.k0=qi(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Nw(i){var t=i.x,e=i.y,n,s,r=J(t-this.long0);if(this.sphere)n=this.x0+this.a*r*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var o=is(this.e,Math.sin(e));n=this.x0+this.a*this.k0*r,s=this.y0+this.a*o*.5/this.k0}return i.x=n,i.y=s,i}function kw(i){i.x-=this.x0,i.y-=this.y0;var t,e;return this.sphere?(t=J(this.long0+i.x/this.a/Math.cos(this.lat_ts)),e=Math.asin(i.y/this.a*Math.cos(this.lat_ts))):(e=Gw(this.e,2*i.y*this.k0/this.a),t=J(this.long0+i.x/(this.a*this.k0))),i.x=t,i.y=e,i}var jw=["cea"];const Bw={init:Dw,forward:Nw,inverse:kw,names:jw};function zw(){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 Ww(i){var t=i.x,e=i.y,n=J(t-this.long0),s=fs(e-this.lat0);return i.x=this.x0+this.a*n*this.rc,i.y=this.y0+this.a*s,i}function Uw(i){var t=i.x,e=i.y;return i.x=J(this.long0+(t-this.x0)/(this.a*this.rc)),i.y=fs(this.lat0+(e-this.y0)/this.a),i}var Vw=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const Xw={init:zw,forward:Ww,inverse:Uw,names:Vw};var vg=20;function $w(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ha(this.es),this.e1=ca(this.es),this.e2=ua(this.es),this.e3=fa(this.es),this.ml0=this.a*We(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Kw(i){var t=i.x,e=i.y,n,s,r,o=J(t-this.long0);if(r=o*Math.sin(e),this.sphere)Math.abs(e)<=Z?(n=this.a*o,s=-1*this.a*this.lat0):(n=this.a*Math.sin(r)/Math.tan(e),s=this.a*(fs(e-this.lat0)+(1-Math.cos(r))/Math.tan(e)));else if(Math.abs(e)<=Z)n=this.a*o,s=-1*this.ml0;else{var a=Ef(this.a,this.e,Math.sin(e))/Math.tan(e);n=a*Math.sin(r),s=this.a*We(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+a*(1-Math.cos(r))}return i.x=n+this.x0,i.y=s+this.y0,i}function Yw(i){var t,e,n,s,r,o,a,l,h;if(n=i.x-this.x0,s=i.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=Z)t=J(n/this.a+this.long0),e=0;else{o=this.lat0+s/this.a,a=n*n/this.a/this.a+o*o,l=o;var c;for(r=vg;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)<=Z){e=l;break}t=J(this.long0+Math.asin(n*Math.tan(l)/this.a)/Math.sin(e))}else if(Math.abs(s+this.ml0)<=Z)e=0,t=J(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=vg;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)<=Z){e=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),t=J(this.long0+Math.asin(n*u/this.a)/Math.sin(e))}return i.x=t,i.y=e,i}var qw=["Polyconic","American_Polyconic","poly"];const Hw={init:$w,forward:Kw,inverse:Yw,names:qw};function Zw(){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 Jw(i){var t,e=i.x,n=i.y,s=n-this.lat0,r=e-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 i.x=p*this.a+this.x0,i.y=m*this.a+this.y0,i}function Qw(i){var t,e=i.x,n=i.y,s=e-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,E=o,x=a;for(t=2;t<=6;t++)p=_*f-m*d,y=m*f+_*d,_=p,m=y,E=E+(t-1)*(this.B_re[t]*_-this.B_im[t]*m),x=x+(t-1)*(this.B_im[t]*_+this.B_re[t]*m);_=1,m=0;var S=this.B_re[1],w=this.B_im[1];for(t=2;t<=6;t++)p=_*f-m*d,y=m*f+_*d,_=p,m=y,S=S+t*(this.B_re[t]*_-this.B_im[t]*m),w=w+t*(this.B_im[t]*_+this.B_re[t]*m);var I=S*S+w*w;f=(E*S+x*w)/I,d=(x*S-E*w)/I}var P=f,C=d,N=1,z=0;for(t=1;t<=9;t++)N=N*P,z=z+this.D[t]*N;var b=this.lat0+z*Mo*1e5,A=this.long0+C;return i.x=A,i.y=b,i}var tC=["New_Zealand_Map_Grid","nzmg"];const eC={init:Zw,forward:Jw,inverse:Qw,names:tC};function iC(){}function nC(i){var t=i.x,e=i.y,n=J(t-this.long0),s=this.x0+this.a*n,r=this.y0+this.a*Math.log(Math.tan(Math.PI/4+e/2.5))*1.25;return i.x=s,i.y=r,i}function sC(i){i.x-=this.x0,i.y-=this.y0;var t=J(this.long0+i.x/this.a),e=2.5*(Math.atan(Math.exp(.8*i.y/this.a))-Math.PI/4);return i.x=t,i.y=e,i}var rC=["Miller_Cylindrical","mill"];const oC={init:iC,forward:nC,inverse:sC,names:rC};var aC=20;function lC(){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 hC(i){var t,e,n=i.x,s=i.y;if(n=J(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=aC;o;--o){var a=(this.m*s+Math.sin(s)-r)/(this.m+Math.cos(s));if(s-=a,Math.abs(a)<Z)break}t=this.a*this.C_x*n*(this.m+Math.cos(s)),e=this.a*this.C_y*s}else{var l=Math.sin(s),h=Math.cos(s);e=this.a*Wr(s,l,h,this.en),t=this.a*n*h/Math.sqrt(1-this.es*l*l)}return i.x=t,i.y=e,i}function cC(i){var t,e,n,s;return i.x-=this.x0,n=i.x/this.a,i.y-=this.y0,t=i.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=J(n+this.long0),t=fs(t)):(t=mf(i.y/this.a,this.es,this.en),s=Math.abs(t),s<B?(s=Math.sin(t),e=this.long0+i.x*Math.sqrt(1-this.es*s*s)/(this.a*Math.cos(t)),n=J(e)):s-Z<B&&(n=this.long0)),i.x=n,i.y=t,i}var uC=["Sinusoidal","sinu"];const fC={init:lC,forward:hC,inverse:cC,names:uC};function dC(){}function gC(i){for(var t=i.x,e=i.y,n=J(t-this.long0),s=e,r=Math.PI*Math.sin(e);;){var o=-(s+Math.sin(s)-r)/(1+Math.cos(s));if(s+=o,Math.abs(o)<Z)break}s/=2,Math.PI/2-Math.abs(e)<Z&&(n=0);var a=.900316316158*this.a*n*Math.cos(s)+this.x0,l=1.4142135623731*this.a*Math.sin(s)+this.y0;return i.x=a,i.y=l,i}function _C(i){var t,e;i.x-=this.x0,i.y-=this.y0,e=i.y/(1.4142135623731*this.a),Math.abs(e)>.999999999999&&(e=.999999999999),t=Math.asin(e);var n=J(this.long0+i.x/(.900316316158*this.a*Math.cos(t)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),e=(2*t+Math.sin(2*t))/Math.PI,Math.abs(e)>1&&(e=1);var s=Math.asin(e);return i.x=n,i.y=s,i}var mC=["Mollweide","moll"];const pC={init:dC,forward:gC,inverse:_C,names:mC};function yC(){Math.abs(this.lat1+this.lat2)<Z||(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=ha(this.es),this.e1=ca(this.es),this.e2=ua(this.es),this.e3=fa(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=qi(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)<Z?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=qi(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 vC(i){var t=i.x,e=i.y,n;if(this.sphere)n=this.a*(this.g-e);else{var s=We(this.e0,this.e1,this.e2,this.e3,e);n=this.a*(this.g-s)}var r=this.ns*J(t-this.long0),o=this.x0+n*Math.sin(r),a=this.y0+this.rh-n*Math.cos(r);return i.x=o,i.y=a,i}function xC(i){i.x-=this.x0,i.y=this.rh-i.y+this.y0;var t,e,n,s;this.ns>=0?(e=Math.sqrt(i.x*i.x+i.y*i.y),t=1):(e=-Math.sqrt(i.x*i.x+i.y*i.y),t=-1);var r=0;if(e!==0&&(r=Math.atan2(t*i.x,t*i.y)),this.sphere)return s=J(this.long0+r/this.ns),n=fs(this.g-e/this.a),i.x=s,i.y=n,i;var o=this.g-e/this.a;return n=Cl(o,this.e0,this.e1,this.e2,this.e3),s=J(this.long0+r/this.ns),i.x=s,i.y=n,i}var EC=["Equidistant_Conic","eqdc"];const SC={init:yC,forward:vC,inverse:xC,names:EC};function MC(){this.R=this.a}function wC(i){var t=i.x,e=i.y,n=J(t-this.long0),s,r;Math.abs(e)<=Z&&(s=this.x0+this.R*n,r=this.y0);var o=ls(2*Math.abs(e/Math.PI));(Math.abs(n)<=Z||Math.abs(Math.abs(e)-B)<=Z)&&(s=this.x0,e>=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),e>=0?r=this.y0+_:r=this.y0-_,i.x=s,i.y=r,i}function CC(i){var t,e,n,s,r,o,a,l,h,c,u,f,d;return i.x-=this.x0,i.y-=this.y0,u=Math.PI*this.R,n=i.x/u,s=i.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,i.y>=0?e=(-c*Math.cos(f+Math.PI/3)-a/3/l)*Math.PI:e=-(-c*Math.cos(f+Math.PI/3)-a/3/l)*Math.PI,Math.abs(n)<Z?t=this.long0:t=J(this.long0+Math.PI*(r-1+Math.sqrt(1+2*(n*n-s*s)+r*r))/2/n),i.x=t,i.y=e,i}var TC=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const RC={init:MC,forward:wC,inverse:CC,names:TC};function IC(i,t,e,n,s,r){const o=n-t,a=Math.atan((1-r)*Math.tan(i)),l=Math.atan((1-r)*Math.tan(e)),h=Math.sin(a),c=Math.cos(a),u=Math.sin(l),f=Math.cos(l);let d=o,g,_=100,m,p,y,E,x,S,w,I,P,C,N,z,b,A;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};E=h*u+c*f*p,x=Math.atan2(y,E),S=c*f*m/y,w=1-S*S,I=w!==0?E-2*h*u/w:0,P=r/16*w*(4+r*(4-3*w)),g=d,d=o+(1-P)*r*S*(x+P*y*(I+P*E*(-1+2*I*I)))}while(Math.abs(d-g)>1e-12&&--_>0);return _===0?{azi1:NaN,s12:NaN}:(C=w*(s*s-s*(1-r)*(s*(1-r)))/(s*(1-r)*(s*(1-r))),N=1+C/16384*(4096+C*(-768+C*(320-175*C))),z=C/1024*(256+C*(-128+C*(74-47*C))),b=z*y*(I+z/4*(E*(-1+2*I*I)-z/6*I*(-3+4*y*y)*(-3+4*I*I))),A=s*(1-r)*N*(x-b),{azi1:Math.atan2(f*m,c*u-h*f*p),s12:A})}function PC(i,t,e,n,s,r){const o=Math.atan((1-r)*Math.tan(i)),a=Math.sin(o),l=Math.cos(o),h=Math.sin(e),c=Math.cos(e),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,E=100,x,S,w,I;do x=Math.cos(2*u+p),S=Math.sin(p),w=Math.cos(p),I=m*S*(x+m/4*(w*(-1+2*x*x)-m/6*x*(-3+4*S*S)*(-3+4*x*x))),y=p,p=n/(s*(1-r)*_)+I;while(Math.abs(p-y)>1e-12&&--E>0);if(E===0)return{lat2:NaN,lon2:NaN};const P=a*S-l*w*c,C=Math.atan2(a*w+l*S*c,(1-r)*Math.sqrt(f*f+P*P)),N=Math.atan2(S*h,l*w-a*S*c),z=r/16*d*(4+r*(4-3*d)),b=N-(1-z)*r*f*(p+z*S*(x+z*w*(-1+2*x*x))),A=t+b;return{lat2:C,lon2:A}}function bC(){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 AC(i){var t=i.x,e=i.y,n=Math.sin(i.y),s=Math.cos(i.y),r=J(t-this.long0),o,a,l,h,c,u,f,d,g,_,m;return this.sphere?Math.abs(this.sin_p12-1)<=Z?(i.x=this.x0+this.a*(B-e)*Math.sin(r),i.y=this.y0-this.a*(B-e)*Math.cos(r),i):Math.abs(this.sin_p12+1)<=Z?(i.x=this.x0+this.a*(B+e)*Math.sin(r),i.y=this.y0+this.a*(B+e)*Math.cos(r),i):(g=this.sin_p12*n+this.cos_p12*s*Math.cos(r),f=Math.acos(g),d=f?f/Math.sin(f):1,i.x=this.x0+this.a*d*s*Math.sin(r),i.y=this.y0+this.a*d*(this.cos_p12*n-this.sin_p12*s*Math.cos(r)),i):(o=ha(this.es),a=ca(this.es),l=ua(this.es),h=fa(this.es),Math.abs(this.sin_p12-1)<=Z?(c=this.a*We(o,a,l,h,B),u=this.a*We(o,a,l,h,e),i.x=this.x0+(c-u)*Math.sin(r),i.y=this.y0-(c-u)*Math.cos(r),i):Math.abs(this.sin_p12+1)<=Z?(c=this.a*We(o,a,l,h,B),u=this.a*We(o,a,l,h,e),i.x=this.x0+(c+u)*Math.sin(r),i.y=this.y0+(c+u)*Math.cos(r),i):Math.abs(t)<Z&&Math.abs(e-this.lat0)<Z?(i.x=i.y=0,i):(_=IC(this.lat0,this.long0,e,t,this.a,this.f),m=_.azi1,i.x=_.s12*Math.sin(m),i.y=_.s12*Math.cos(m),i))}function LC(i){i.x-=this.x0,i.y-=this.y0;var t,e,n,s,r,o,a,l,h,c,u,f,d,g,_,m;return this.sphere?(t=Math.sqrt(i.x*i.x+i.y*i.y),t>2*B*this.a?void 0:(e=t/this.a,n=Math.sin(e),s=Math.cos(e),r=this.long0,Math.abs(t)<=Z?o=this.lat0:(o=ls(s*this.sin_p12+i.y*n*this.cos_p12/t),a=Math.abs(this.lat0)-B,Math.abs(a)<=Z?this.lat0>=0?r=J(this.long0+Math.atan2(i.x,-i.y)):r=J(this.long0-Math.atan2(-i.x,i.y)):r=J(this.long0+Math.atan2(i.x*n,t*this.cos_p12*s-i.y*this.sin_p12*n))),i.x=r,i.y=o,i)):(l=ha(this.es),h=ca(this.es),c=ua(this.es),u=fa(this.es),Math.abs(this.sin_p12-1)<=Z?(f=this.a*We(l,h,c,u,B),t=Math.sqrt(i.x*i.x+i.y*i.y),d=f-t,o=Cl(d/this.a,l,h,c,u),r=J(this.long0+Math.atan2(i.x,-1*i.y)),i.x=r,i.y=o,i):Math.abs(this.sin_p12+1)<=Z?(f=this.a*We(l,h,c,u,B),t=Math.sqrt(i.x*i.x+i.y*i.y),d=t-f,o=Cl(d/this.a,l,h,c,u),r=J(this.long0+Math.atan2(i.x,i.y)),i.x=r,i.y=o,i):(g=Math.atan2(i.x,i.y),_=Math.sqrt(i.x*i.x+i.y*i.y),m=PC(this.lat0,this.long0,g,_,this.a,this.f),i.x=m.lon2,i.y=m.lat2,i))}var OC=["Azimuthal_Equidistant","aeqd"];const FC={init:bC,forward:AC,inverse:LC,names:OC};function GC(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function DC(i){var t,e,n,s,r,o,a,l,h=i.x,c=i.y;return n=J(h-this.long0),t=Math.sin(c),e=Math.cos(c),s=Math.cos(n),o=this.sin_p14*t+this.cos_p14*e*s,r=1,(o>0||Math.abs(o)<=Z)&&(a=this.a*r*e*Math.sin(n),l=this.y0+this.a*r*(this.cos_p14*t-this.sin_p14*e*s)),i.x=a,i.y=l,i}function NC(i){var t,e,n,s,r,o,a;return i.x-=this.x0,i.y-=this.y0,t=Math.sqrt(i.x*i.x+i.y*i.y),e=ls(t/this.a),n=Math.sin(e),s=Math.cos(e),o=this.long0,Math.abs(t)<=Z?(a=this.lat0,i.x=o,i.y=a,i):(a=ls(s*this.sin_p14+i.y*n*this.cos_p14/t),r=Math.abs(this.lat0)-B,Math.abs(r)<=Z?(this.lat0>=0?o=J(this.long0+Math.atan2(i.x,-i.y)):o=J(this.long0-Math.atan2(-i.x,i.y)),i.x=o,i.y=a,i):(o=J(this.long0+Math.atan2(i.x*n,t*this.cos_p14*s-i.y*this.sin_p14*n)),i.x=o,i.y=a,i))}var kC=["ortho"];const jC={init:GC,forward:DC,inverse:NC,names:kC};var Ht={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},At={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function BC(){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>=B-bt/2?this.face=Ht.TOP:this.lat0<=-(B-bt/2)?this.face=Ht.BOTTOM:Math.abs(this.long0)<=bt?this.face=Ht.FRONT:Math.abs(this.long0)<=B+bt?this.face=this.long0>0?Ht.RIGHT:Ht.LEFT:this.face=Ht.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 zC(i){var t={x:0,y:0},e,n,s,r,o,a,l={value:0};if(i.x-=this.long0,this.es!==0?e=Math.atan(this.one_minus_f_squared*Math.tan(i.y)):e=i.y,n=i.x,this.face===Ht.TOP)r=B-e,n>=bt&&n<=B+bt?(l.value=At.AREA_0,s=n-B):n>B+bt||n<=-(B+bt)?(l.value=At.AREA_1,s=n>0?n-ie:n+ie):n>-(B+bt)&&n<=-bt?(l.value=At.AREA_2,s=n+B):(l.value=At.AREA_3,s=n);else if(this.face===Ht.BOTTOM)r=B+e,n>=bt&&n<=B+bt?(l.value=At.AREA_0,s=-n+B):n<bt&&n>=-bt?(l.value=At.AREA_1,s=-n):n<-bt&&n>=-(B+bt)?(l.value=At.AREA_2,s=-n-B):(l.value=At.AREA_3,s=n>0?-n+ie:-n-ie);else{var h,c,u,f,d,g,_;this.face===Ht.RIGHT?n=Mr(n,+B):this.face===Ht.BACK?n=Mr(n,+ie):this.face===Ht.LEFT&&(n=Mr(n,-B)),f=Math.sin(e),d=Math.cos(e),g=Math.sin(n),_=Math.cos(n),h=d*_,c=d*g,u=f,this.face===Ht.FRONT?(r=Math.acos(h),s=ba(r,u,c,l)):this.face===Ht.RIGHT?(r=Math.acos(c),s=ba(r,u,-h,l)):this.face===Ht.BACK?(r=Math.acos(-h),s=ba(r,u,-c,l)):this.face===Ht.LEFT?(r=Math.acos(-c),s=ba(r,u,h,l)):(r=s=0,l.value=At.AREA_0)}return a=Math.atan(12/ie*(s+Math.acos(Math.sin(s)*Math.cos(bt))-B)),o=Math.sqrt((1-Math.cos(r))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(s))))),l.value===At.AREA_1?a+=B:l.value===At.AREA_2?a+=ie:l.value===At.AREA_3&&(a+=1.5*ie),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,i.x=t.x,i.y=t.y,i}function WC(i){var t={lam:0,phi:0},e,n,s,r,o,a,l,h,c,u={value:0};if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,n=Math.atan(Math.sqrt(i.x*i.x+i.y*i.y)),e=Math.atan2(i.y,i.x),i.x>=0&&i.x>=Math.abs(i.y)?u.value=At.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(u.value=At.AREA_1,e-=B):i.x<0&&-i.x>=Math.abs(i.y)?(u.value=At.AREA_2,e=e<0?e+ie:e-ie):(u.value=At.AREA_3,e+=B),c=ie/12*Math.tan(e),o=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),a=Math.atan(o),s=Math.cos(e),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===Ht.TOP)h=Math.acos(l),t.phi=B-h,u.value===At.AREA_0?t.lam=a+B:u.value===At.AREA_1?t.lam=a<0?a+ie:a-ie:u.value===At.AREA_2?t.lam=a-B:t.lam=a;else if(this.face===Ht.BOTTOM)h=Math.acos(l),t.phi=h-B,u.value===At.AREA_0?t.lam=-a+B:u.value===At.AREA_1?t.lam=-a:u.value===At.AREA_2?t.lam=-a-B:t.lam=a<0?-a-ie:-a+ie;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===At.AREA_1?(c=d,d=-g,g=c):u.value===At.AREA_2?(d=-d,g=-g):u.value===At.AREA_3&&(c=d,d=g,g=-c),this.face===Ht.RIGHT?(c=f,f=-d,d=c):this.face===Ht.BACK?(f=-f,d=-d):this.face===Ht.LEFT&&(c=f,f=d,d=-c),t.phi=Math.acos(-g)-B,t.lam=Math.atan2(d,f),this.face===Ht.RIGHT?t.lam=Mr(t.lam,-B):this.face===Ht.BACK?t.lam=Mr(t.lam,-ie):this.face===Ht.LEFT&&(t.lam=Mr(t.lam,+B))}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,i.x=t.lam,i.y=t.phi,i}function ba(i,t,e,n){var s;return i<Z?(n.value=At.AREA_0,s=0):(s=Math.atan2(t,e),Math.abs(s)<=bt?n.value=At.AREA_0:s>bt&&s<=B+bt?(n.value=At.AREA_1,s-=B):s>B+bt||s<=-(B+bt)?(n.value=At.AREA_2,s=s>=0?s-ie:s+ie):(n.value=At.AREA_3,s+=B)),s}function Mr(i,t){var e=i+t;return e<-ie?e+=Yo:e>+ie&&(e-=Yo),e}var UC=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const VC={init:BC,forward:zC,inverse:WC,names:UC};var Qc=[[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]],Pm=.8487,bm=1.3523,Am=Xi/5,XC=1/Am,cr=18,Tl=function(i,t){return i[0]+t*(i[1]+t*(i[2]+t*i[3]))},$C=function(i,t){return i[1]+t*(2*i[2]+t*3*i[3])};function KC(i,t,e,n){for(var s=t;n;--n){var r=i(s);if(s-=r,Math.abs(r)<e)break}return s}function YC(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function qC(i){var t=J(i.x-this.long0),e=Math.abs(i.y),n=Math.floor(e*Am);n<0?n=0:n>=cr&&(n=cr-1),e=Xi*(e-XC*n);var s={x:Tl(Qc[n],e)*t,y:Tl(fo[n],e)};return i.y<0&&(s.y=-s.y),s.x=s.x*this.a*Pm+this.x0,s.y=s.y*this.a*bm+this.y0,s}function HC(i){var t={x:(i.x-this.x0)/(this.a*Pm),y:Math.abs(i.y-this.y0)/(this.a*bm)};if(t.y>=1)t.x/=Qc[cr][0],t.y=i.y<0?-B:B;else{var e=Math.floor(t.y*cr);for(e<0?e=0:e>=cr&&(e=cr-1);;)if(fo[e][0]>t.y)--e;else if(fo[e+1][0]<=t.y)++e;else break;var n=fo[e],s=5*(t.y-n[0])/(fo[e+1][0]-n[0]);s=KC(function(r){return(Tl(n,r)-t.y)/$C(n,r)},s,Z,100),t.x/=Tl(Qc[e],s),t.y=(5*e+s)*Ee,i.y<0&&(t.y=-t.y)}return t.x=J(t.x+this.long0),t}var ZC=["Robinson","robin"];const JC={init:YC,forward:qC,inverse:HC,names:ZC};function QC(){this.name="geocent"}function t4(i){var t=ym(i,this.es,this.a);return t}function e4(i){var t=vm(i,this.es,this.a,this.b);return t}var i4=["Geocentric","geocentric","geocent","Geocent"];const n4={init:QC,forward:t4,inverse:e4,names:i4};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 s4(){if(Object.keys(io).forEach((function(e){if(typeof this[e]>"u")this[e]=io[e].def;else{if(io[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);io[e].num&&(this[e]=parseFloat(this[e]))}io[e].degrees&&(this[e]=this[e]*Ee)}).bind(this)),Math.abs(Math.abs(this.lat0)-B)<Z?this.mode=this.lat0<0?Ae.S_POLE:Ae.N_POLE:Math.abs(this.lat0)<Z?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 i=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(i),this.sw=Math.sin(i)}function r4(i){i.x-=this.long0;var t=Math.sin(i.y),e=Math.cos(i.y),n=Math.cos(i.x),s,r;switch(this.mode){case Ae.OBLIQ:r=this.sinph0*t+this.cosph0*e*n;break;case Ae.EQUIT:r=e*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*e*Math.sin(i.x),this.mode){case Ae.OBLIQ:r*=this.cosph0*t-this.sinph0*e*n;break;case Ae.EQUIT:r*=t;break;case Ae.N_POLE:r*=-(e*n);break;case Ae.S_POLE:r*=e*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,i.x=s*this.a,i.y=r*this.a,i}function o4(i){i.x/=this.a,i.y/=this.a;var t={x:i.x,y:i.y},e,n,s;s=1/(this.pn1-i.y*this.sw),e=this.pn1*i.x*s,n=this.pn1*i.y*this.cw*s,i.x=e*this.cg+n*this.sg,i.y=n*this.cg-e*this.sg;var r=Ze(i.x,i.y);if(Math.abs(r)<Z)t.x=0,t.y=i.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+i.y*a*this.cosph0/r),i.y=(o-this.sinph0*Math.sin(t.y))*r,i.x*=a*this.cosph0;break;case Ae.EQUIT:t.y=Math.asin(i.y*a/r),i.y=o*r,i.x*=a;break;case Ae.N_POLE:t.y=Math.asin(o),i.y=-i.y;break;case Ae.S_POLE:t.y=-Math.asin(o);break}t.x=Math.atan2(i.x,i.y)}return i.x=t.x+this.long0,i.y=t.y,i}var a4=["Tilted_Perspective","tpers"];const l4={init:s4,forward:r4,inverse:o4,names:a4};function h4(){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 i=1-this.es,t=1/i;this.radius_p=Math.sqrt(i),this.radius_p2=i,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 c4(i){var t=i.x,e=i.y,n,s,r,o;if(t=t-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var a=this.radius_p/Ze(this.radius_p*Math.cos(e),Math.sin(e));if(s=a*Math.cos(t)*Math.cos(e),r=a*Math.sin(t)*Math.cos(e),o=a*Math.sin(e),(this.radius_g-s)*s-r*r-o*o*this.radius_p_inv2<0)return i.x=Number.NaN,i.y=Number.NaN,i;n=this.radius_g-s,this.flip_axis?(i.x=this.radius_g_1*Math.atan(r/Ze(o,n)),i.y=this.radius_g_1*Math.atan(o/n)):(i.x=this.radius_g_1*Math.atan(r/n),i.y=this.radius_g_1*Math.atan(o/Ze(r,n)))}else this.shape==="sphere"&&(n=Math.cos(e),s=Math.cos(t)*n,r=Math.sin(t)*n,o=Math.sin(e),n=this.radius_g-s,this.flip_axis?(i.x=this.radius_g_1*Math.atan(r/Ze(o,n)),i.y=this.radius_g_1*Math.atan(o/n)):(i.x=this.radius_g_1*Math.atan(r/n),i.y=this.radius_g_1*Math.atan(o/Ze(r,n))));return i.x=i.x*this.a,i.y=i.y*this.a,i}function u4(i){var t=-1,e=0,n=0,s,r,o,a;if(i.x=i.x/this.a,i.y=i.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),e=Math.tan(i.x/this.radius_g_1)*Ze(1,n)):(e=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*Ze(1,e));var l=n/this.radius_p;if(s=e*e+l*l+t*t,r=2*this.radius_g*t,o=r*r-4*s*this.C,o<0)return i.x=Number.NaN,i.y=Number.NaN,i;a=(-r-Math.sqrt(o))/(2*s),t=this.radius_g+a*t,e*=a,n*=a,i.x=Math.atan2(e,t),i.y=Math.atan(n*Math.cos(i.x)/t),i.y=Math.atan(this.radius_p_inv2*Math.tan(i.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),e=Math.tan(i.x/this.radius_g_1)*Math.sqrt(1+n*n)):(e=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*Math.sqrt(1+e*e)),s=e*e+n*n+t*t,r=2*this.radius_g*t,o=r*r-4*s*this.C,o<0)return i.x=Number.NaN,i.y=Number.NaN,i;a=(-r-Math.sqrt(o))/(2*s),t=this.radius_g+a*t,e*=a,n*=a,i.x=Math.atan2(e,t),i.y=Math.atan(n*Math.cos(i.x)/t)}return i.x=i.x+this.long0,i}var f4=["Geostationary Satellite View","Geostationary_Satellite","geos"];const d4={init:h4,forward:c4,inverse:u4,names:f4};var wo=1.340264,Co=-.081106,To=893e-6,Ro=.003796,Rl=Math.sqrt(3)/2;function g4(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function _4(i){var t=J(i.x-this.long0),e=i.y,n=Math.asin(Rl*Math.sin(e)),s=n*n,r=s*s*s;return i.x=t*Math.cos(n)/(Rl*(wo+3*Co*s+r*(7*To+9*Ro*s))),i.y=n*(wo+Co*s+r*(To+Ro*s)),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function m4(i){i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a;var t=1e-9,e=12,n=i.y,s,r,o,a,l,h;for(h=0;h<e&&(s=n*n,r=s*s*s,o=n*(wo+Co*s+r*(To+Ro*s))-i.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,i.x=Rl*i.x*(wo+3*Co*s+r*(7*To+9*Ro*s))/Math.cos(n),i.y=Math.asin(Math.sin(n)/Rl),i.x=J(i.x+this.long0),i}var p4=["eqearth","Equal Earth","Equal_Earth"];const y4={init:g4,forward:_4,inverse:m4,names:p4};var Zo=1e-10;function v4(){var i;if(this.phi1=this.lat1,Math.abs(this.phi1)<Zo)throw new Error;this.es?(this.en=_f(this.es),this.m1=Wr(this.phi1,this.am1=Math.sin(this.phi1),i=Math.cos(this.phi1),this.en),this.am1=i/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=E4,this.forward=x4):(Math.abs(this.phi1)+Zo>=B?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=M4,this.forward=S4)}function x4(i){var t=J(i.x-(this.long0||0)),e=i.y,n,s,r;return n=this.am1+this.m1-Wr(e,s=Math.sin(e),r=Math.cos(e),this.en),s=r*t/(n*Math.sqrt(1-this.es*s*s)),i.x=n*Math.sin(s),i.y=this.am1-n*Math.cos(s),i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function E4(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var t,e,n,s;if(e=Ze(i.x,i.y=this.am1-i.y),s=mf(this.am1+this.m1-e,this.es,this.en),(t=Math.abs(s))<B)t=Math.sin(s),n=e*Math.atan2(i.x,i.y)*Math.sqrt(1-this.es*t*t)/Math.cos(s);else if(Math.abs(t-B)<=Zo)n=0;else throw new Error;return i.x=J(n+(this.long0||0)),i.y=fs(s),i}function S4(i){var t=J(i.x-(this.long0||0)),e=i.y,n,s;return s=this.cphi1+this.phi1-e,Math.abs(s)>Zo?(i.x=s*Math.sin(n=t*Math.cos(e)/s),i.y=this.cphi1-s*Math.cos(n)):i.x=i.y=0,i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function M4(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var t,e,n=Ze(i.x,i.y=this.cphi1-i.y);if(e=this.cphi1+this.phi1-n,Math.abs(e)>B)throw new Error;return Math.abs(Math.abs(e)-B)<=Zo?t=0:t=n*Math.atan2(i.x,i.y)/Math.cos(e),i.x=J(t+(this.long0||0)),i.y=fs(e),i}var w4=["bonne","Bonne (Werner lat_1=90)"];const C4={init:v4,names:w4};function T4(i){i.Proj.projections.add(Ya),i.Proj.projections.add(qa),i.Proj.projections.add(w2),i.Proj.projections.add(O2),i.Proj.projections.add(k2),i.Proj.projections.add(U2),i.Proj.projections.add(q2),i.Proj.projections.add(tw),i.Proj.projections.add(rw),i.Proj.projections.add(cw),i.Proj.projections.add(Mw),i.Proj.projections.add(Pw),i.Proj.projections.add(Fw),i.Proj.projections.add(Bw),i.Proj.projections.add(Xw),i.Proj.projections.add(Hw),i.Proj.projections.add(eC),i.Proj.projections.add(oC),i.Proj.projections.add(fC),i.Proj.projections.add(pC),i.Proj.projections.add(SC),i.Proj.projections.add(RC),i.Proj.projections.add(FC),i.Proj.projections.add(jC),i.Proj.projections.add(VC),i.Proj.projections.add(JC),i.Proj.projections.add(n4),i.Proj.projections.add(l4),i.Proj.projections.add(d4),i.Proj.projections.add(y4),i.Proj.projections.add(C4)}const tu=Object.assign(zM,{defaultDatum:"WGS84",Proj:Li,WGS84:new Li("WGS84"),Point:Fr,toPoint:xm,defs:ke,nadgrid:MM,transform:wl,mgrs:WM,version:"__VERSION__"});T4(tu);const R4=le({__name:"OlProjectionRegister",props:{projectionName:{},projectionDef:{},projectionExtent:{}},setup(i,{expose:t}){const e=i,{projectionName:n,projectionDef:s,projectionExtent:r}=Wl(e);tu.defs(n.value,s.value),AS(tu);const o=new Ls({code:n.value,extent:r.value});return t({projection:o}),(a,l)=>oe("",!0)}});function Lm(i){if(i)return typeof i=="string"||i instanceof Ls?i:new Ls(i)}const I4=le({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(i,{expose:t}){const e=i,n=Bt("map"),s=bn(e),r=()=>({...s,projection:Lm(s.projection)}),o=new Wi(r());return kr(o,["change:center","change:resolution","change:rotation"]),ei(()=>{n?.setView(o)}),ne(s,()=>{const D=r();o.setProperties(D),o.applyOptions_(D)}),t({view:o,adjustCenter:D=>o.adjustCenter(D),adjustResolution:(D,H)=>o.adjustResolution(D,H),adjustRotation:(D,H)=>o.adjustRotation(D,H),adjustZoom:(D,H)=>o.adjustZoom(D,H),animate:(...D)=>o.animate(...D),beginInteraction:()=>o.beginInteraction(),calculateExtent:D=>o.calculateExtent(D),cancelAnimations:()=>o.cancelAnimations(),centerOn:(D,H,v)=>o.centerOn(D,H,v),changed:()=>o.changed(),dispatchEvent:D=>o.dispatchEvent(D),endInteraction:(D,H,v)=>o.endInteraction(D,H,v),fit:(D,H)=>o.fit(D,H),get:D=>o.get(D),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:(D,H)=>o.getResolutionForExtent(D,H),getResolutionForZoom:D=>o.getResolutionForZoom(D),getResolutions:()=>o.getResolutions(),getRevision:()=>o.getRevision(),getRotation:()=>o.getRotation(),getZoom:()=>o.getZoom(),getZoomForResolution:D=>o.getZoomForResolution(D),setCenter:D=>o.setCenter(D),setConstrainResolution:D=>o.setConstrainResolution(D),setMaxZoom:D=>o.setMaxZoom(D),setMinZoom:D=>o.setMinZoom(D),setResolution:D=>o.setResolution(D),setRotation:D=>o.setRotation(D),setZoom:D=>o.setZoom(D)}),(D,H)=>oe("",!0)}}),P4={className:"ol-layer",opacity:1,visible:!0,properties:()=>({}),displayInLayerSwitcher:!0};function Om(i){return{...P4,...i}}class xg{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 ql&&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 e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const n=this.entries_[t];return Lt(n!==void 0,"Tried to get a value for a key that does not exist in the cache"),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_}remove(t){const e=this.entries_[t];return Lt(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.key_;return t}getValues(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){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,e){this.get(t),this.entries_[t].value_=e}set(t,e){Lt(!(t in this.entries_),"Tried to set a value for a key that is used already");const n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_}setSize(t){this.highWaterMark=t}}function Il(i,t,e,n){return n!==void 0?(n[0]=i,n[1]=t,n[2]=e,n):[i,t,e]}function b4(i,t,e){return i+"/"+t+"/"+e}function Za(i,t,e,n,s){return`${ct(i)},${t},${b4(e,n,s)}`}function Fm(i){return A4(i[0],i[1],i[2])}function A4(i,t,e){return(t<<i)+e}function L4(i,t){const e=i[0],n=i[1],s=i[2];if(t.getMinZoom()>e||e>t.getMaxZoom())return!1;const r=t.getFullTileRange(e);return r?r.containsXY(n,s):!0}class Sf{constructor(t,e,n,s){this.minX=t,this.maxX=e,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,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.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(i,t,e,n,s){return s!==void 0?(s.minX=i,s.maxX=t,s.minY=e,s.maxY=n,s):new Sf(i,t,e,n)}const Hs=[0,0,0],Dn=5;class Gm{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,Lt(Vy(this.resolutions_,(s,r)=>r-s),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let s=0,r=this.resolutions_.length-1;s<r;++s)if(!e)e=this.resolutions_[s]/this.resolutions_[s+1];else if(this.resolutions_[s]/this.resolutions_[s+1]!==e){e=void 0;break}}this.zoomFactor_=e,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,Lt(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_=hs(n)),Lt(!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,Lt(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,Lt(!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,e,n){const s=this.getTileRangeForExtentAndZ(t,e);for(let r=s.minX,o=s.maxX;r<=o;++r)for(let a=s.minY,l=s.maxY;a<=l;++a)n([e,r,a])}forEachTileCoordParentTileRange(t,e,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),e(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,e,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,e)}const s=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(s,t[0]+1,e)}return null}getTileRangeForTileCoordAndZ(t,e,n){if(e>this.maxZoom||e<this.minZoom)return null;const s=t[0],r=t[1],o=t[2];if(e===s)return qs(r,o,r,o,n);if(this.zoomFactor_){const l=Math.pow(this.zoomFactor_,e-s),h=Math.floor(r*l),c=Math.floor(o*l);if(e<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,e,n)}getTileRangeForExtentAndZ(t,e,n){this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,Hs);const s=Hs[1],r=Hs[2];this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,Hs);const o=Hs[1],a=Hs[2];return qs(s,o,r,a,n)}getTileCoordCenter(t){const e=this.getOrigin(t[0]),n=this.getResolution(t[0]),s=Qe(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*s[0]*n,e[1]-(t[2]+.5)*s[1]*n]}getTileCoordExtent(t,e){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 Ki(o,a,l,h,e)}getTileCoordForCoordAndResolution(t,e,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,n)}getTileCoordForXYAndResolution_(t,e,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]-e)/n/h[1];return s?(c=Vn(c,Dn)-1,u=Vn(u,Dn)-1):(c=va(c,Dn),u=va(u,Dn)),Il(o,c,u,r)}getTileCoordForXYAndZ_(t,e,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]-e)/a/l[1];return s?(h=Vn(h,Dn)-1,c=Vn(c,Dn)-1):(h=va(h,Dn),c=va(c,Dn)),Il(n,h,c,r)}getTileCoordForCoordAndZ(t,e,n){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!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,e){const n=Hl(this.resolutions_,t,e||0);return Vt(n,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return T0(e,0,e.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){const e=this.resolutions_.length,n=new Array(e);for(let s=this.minZoom;s<e;++s)n[s]=this.getTileRangeForExtentAndZ(t,s);this.fullTileRanges_=n}}class Dm extends Gm{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 O4(i,t,e){const n=[],s=[],r=[],o=[],a=[];e=e!==void 0?e:[];const l="SupportedCRS",h="TileMatrix",c="Identifier",u="ScaleDenominator",f="TopLeftCorner",d="TileWidth",g="TileHeight",_=i[l],m=Kt(_),p=m.getMetersPerUnit(),y=m.getAxisOrientation().startsWith("ne");return i[h].sort(function(E,x){return x[u]-E[u]}),i[h].forEach(function(E){let x;if(e.length>0?x=e.find(function(S){return E[c]==S[h]?!0:E[c].includes(":")?!1:i[c]+":"+E[c]===S[h]}):x=!0,x){s.push(E[c]);const S=E[u]*28e-5/p,w=E[d],I=E[g];y?r.push([E[f][1],E[f][0]]):r.push(E[f]),n.push(S),o.push(w==I?w:[w,I]),a.push([E.MatrixWidth,E.MatrixHeight])}}),new Dm({extent:t,origins:r,resolutions:n,matrixIds:s,tileSizes:o,sizes:a})}function Nm(i){let t=i.getDefaultTileGrid();return t||(t=N4(i),i.setDefaultTileGrid(t)),t}function F4(i,t,e){const n=t[0],s=i.getTileCoordCenter(t),r=km(e);if(!Ir(r,s)){const o=Et(r),a=Math.ceil((r[0]-s[0])/o);return s[0]+=o*a,i.getTileCoordForCoordAndZ(s,n)}return t}function G4(i,t,e,n){n=n!==void 0?n:"top-left";const s=D4(i,t,e);return new Gm({extent:i,origin:qy(i,n),resolutions:s,tileSize:e})}function D4(i,t,e,n){t=t!==void 0?t:Rx,e=Qe(e!==void 0?e:Ju);const s=_e(i),r=Et(i);n=n>0?n:Math.max(r/e[0],s/e[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 N4(i,t,e,n){const s=km(i);return G4(s,t,e,n)}function km(i){i=Kt(i);let t=i.getExtent();if(!t){const e=180*Au.degrees/i.getMetersPerUnit();t=Ki(-e,-e,e,e)}return t}function Pl(i,t){const e=[];Object.keys(t).forEach(function(s){t[s]!==null&&t[s]!==void 0&&e.push(s+"="+encodeURIComponent(t[s]))});const n=e.join("&");return i=i.replace(/[?&]$/,""),i+=i.includes("?")?"&":"?",i+n}const k4=/\{z\}/g,j4=/\{x\}/g,B4=/\{y\}/g,z4=/\{-y\}/g;function W4(i,t,e,n,s){return i.replace(k4,t.toString()).replace(j4,e.toString()).replace(B4,n.toString()).replace(z4,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 jm(i){const t=[];let e=/\{([a-z])-([a-z])\}/.exec(i);if(e){const n=e[1].charCodeAt(0),s=e[2].charCodeAt(0);let r;for(r=n;r<=s;++r)t.push(i.replace(e[0],String.fromCharCode(r)));return t}if(e=/\{(\d+)-(\d+)\}/.exec(i),e){const n=parseInt(e[2],10);for(let s=parseInt(e[1],10);s<=n;s++)t.push(i.replace(e[0],s.toString()));return t}return t.push(i),t}function U4(i,t){return(function(e,n,s){if(!e)return;let r;const o=e[0];if(t){const a=t.getFullTileRange(o);a&&(r=a.getHeight()-1)}return W4(i,o,e[1],e[2],r)})}function V4(i,t){const e=i.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=U4(i[s],t);return eu(n)}function eu(i){return i.length===1?i[0]:(function(t,e,n){if(!t)return;const s=Fm(t),r=ts(s,i.length);return i[r](t,e,n)})}class Mf extends na{constructor(t,e,n){super(),n=n||{},this.tileCoord=t,this.state=e,this.key="",this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(lt.CHANGE)}release(){this.setState(st.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==st.EMPTY){if(this.state!==st.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}}load(){Mt()}getAlpha(t,e){if(!this.transition_)return 1;let n=this.transitionStarts_[t];if(!n)n=e,this.transitionStarts_[t]=n;else if(n===-1)return 1;const s=e-n+1e3/60;return s>=this.transition_?1:O0(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 Bm extends Mf{constructor(t,e,n,s,r,o){super(t,e,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=st.LOADED,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_}handleImageError_(){this.state=st.ERROR,this.unlistenImage_(),this.image_=X4(),this.changed()}handleImageLoad_(){if(mi)this.state=st.LOADED;else{const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=st.LOADED:this.state=st.EMPTY}this.unlistenImage_(),this.changed()}load(){this.state==st.ERROR&&(this.state=st.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==st.IDLE&&(this.state=st.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=KE(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 X4(){const i=ce(1,1);return i.fillStyle="rgba(0,0,0,0)",i.fillRect(0,0,1,1),i.canvas}let ec;const wr=[];function Eg(i,t,e,n,s){i.beginPath(),i.moveTo(0,0),i.lineTo(t,e),i.lineTo(n,s),i.closePath(),i.save(),i.clip(),i.fillRect(0,0,Math.max(t,n)+1,Math.max(e,s)),i.restore()}function ic(i,t){return Math.abs(i[t*4]-210)>2||Math.abs(i[t*4+3]-.75*255)>2}function $4(){if(ec===void 0){const i=ce(6,6,wr);i.globalCompositeOperation="lighter",i.fillStyle="rgba(210, 0, 0, 0.75)",Eg(i,4,5,4,0),Eg(i,4,5,0,5);const t=i.getImageData(0,0,3,3).data;ec=ic(t,0)||ic(t,4)||ic(t,8),lh(i),wr.push(i.canvas)}return ec}function bl(i,t,e,n){const s=Nu(e,t,i);let r=Cd(t,n,e);const o=t.getMetersPerUnit();o!==void 0&&(r*=o);const a=i.getMetersPerUnit();a!==void 0&&(r/=a);const l=i.getExtent();if(!l||Ir(l,s)){const h=Cd(i,r,s)/r;isFinite(h)&&h>0&&(r/=h)}return r}function K4(i,t,e,n){const s=Yi(e);let r=bl(i,t,s,n);return(!isFinite(r)||r<=0)&&Pu(e,function(o){return r=bl(i,t,o,n),isFinite(r)&&r>0}),r}function zm(i,t,e,n,s,r,o,a,l,h,c,u,f,d){const g=ce(Math.round(e*i),Math.round(e*t),wr);if(u||(g.imageSmoothingEnabled=!1),l.length===0)return g.canvas;g.scale(e,e);function _(S){return Math.round(S*e)/e}g.globalCompositeOperation="lighter";const m=ti();l.forEach(function(S,w,I){s0(m,S.extent)});let p;const y=e/n,E=(u?1:1+Math.pow(2,-24))/y;(!f||l.length!==1||h!==0)&&(p=ce(Math.round(Et(m)*y),Math.round(_e(m)*y),wr),u||(p.imageSmoothingEnabled=!1),l.forEach(function(S,w,I){if(S.image.width>0&&S.image.height>0){if(S.clipExtent){p.save();const b=(S.clipExtent[0]-m[0])*y,A=-(S.clipExtent[3]-m[3])*y,W=Et(S.clipExtent)*y,Q=_e(S.clipExtent)*y;p.rect(u?b:Math.round(b),u?A:Math.round(A),u?W:Math.round(b+W)-Math.round(b),u?Q:Math.round(A+Q)-Math.round(A)),p.clip()}const P=(S.extent[0]-m[0])*y,C=-(S.extent[3]-m[3])*y,N=Et(S.extent)*y,z=_e(S.extent)*y;p.drawImage(S.image,h,h,S.image.width-2*h,S.image.height-2*h,u?P:Math.round(P),u?C:Math.round(C),u?N:Math.round(P+N)-Math.round(P),u?z:Math.round(C+z)-Math.round(C)),S.clipExtent&&p.restore()}}));const x=hs(o);return a.getTriangles().forEach(function(S,w,I){const P=S.source,C=S.target;let N=P[0][0],z=P[0][1],b=P[1][0],A=P[1][1],W=P[2][0],Q=P[2][1];const q=_((C[0][0]-x[0])/r),Y=_(-(C[0][1]-x[1])/r),K=_((C[1][0]-x[0])/r),ot=_(-(C[1][1]-x[1])/r),ft=_((C[2][0]-x[0])/r),pt=_(-(C[2][1]-x[1])/r),j=N,Zt=z;N=0,z=0,b-=j,A-=Zt,W-=j,Q-=Zt;const re=[[b,A,0,0,K-q],[W,Q,0,0,ft-q],[0,0,b,A,ot-Y],[0,0,W,Q,pt-Y]],zt=tv(re);if(!zt)return;if(g.save(),g.beginPath(),$4()||!u){g.moveTo(K,ot);const qt=4,ue=q-K,R=Y-ot;for(let D=0;D<qt;D++)g.lineTo(K+_((D+1)*ue/qt),ot+_(D*R/(qt-1))),D!=qt-1&&g.lineTo(K+_((D+1)*ue/qt),ot+_((D+1)*R/(qt-1)));g.lineTo(ft,pt)}else g.moveTo(K,ot),g.lineTo(q,Y),g.lineTo(ft,pt);g.clip(),g.transform(zt[0],zt[2],zt[1],zt[3],q,Y),g.translate(m[0]-j,m[3]-Zt);let Jt;if(p)Jt=p.canvas,g.scale(E,-E);else{const qt=l[0],ue=qt.extent;Jt=qt.image,g.scale(Et(ue)/Jt.width,-_e(ue)/Jt.height)}g.drawImage(Jt,0,0),g.restore()}),p&&(lh(p),wr.push(p.canvas)),c&&(g.save(),g.globalCompositeOperation="source-over",g.strokeStyle="black",g.lineWidth=1,a.getTriangles().forEach(function(S,w,I){const P=S.target,C=(P[0][0]-x[0])/r,N=-(P[0][1]-x[1])/r,z=(P[1][0]-x[0])/r,b=-(P[1][1]-x[1])/r,A=(P[2][0]-x[0])/r,W=-(P[2][1]-x[1])/r;g.beginPath(),g.moveTo(z,b),g.lineTo(C,N),g.lineTo(A,W),g.closePath(),g.stroke()}),g.restore()),g.canvas}const Y4=10,Sg=.25;class Wm{constructor(t,e,n,s,r,o,a){this.sourceProj_=t,this.targetProj_=e;let l={};const h=a?Fc(E=>de(a,Nu(E,this.targetProj_,this.sourceProj_))):jo(this.targetProj_,this.sourceProj_);this.transformInv_=function(E){const x=E[0]+"/"+E[1];return l[x]||(l[x]=h(E)),l[x]},this.maxSourceExtent_=s,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!s&&!!this.sourceProj_.getExtent()&&Et(s)>=Et(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Et(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Et(this.targetProj_.getExtent()):null;const c=hs(n),u=Ql(n),f=Jl(n),d=Zl(n),g=this.transformInv_(c),_=this.transformInv_(u),m=this.transformInv_(f),p=this.transformInv_(d),y=Y4+(o?Math.max(0,Math.ceil(Math.log2(Pc(n)/(o*o*256*256)))):0);if(this.addQuad_(c,u,f,d,g,_,m,p,y),this.wrapsXInSource_){let E=1/0;this.triangles_.forEach(function(x,S,w){E=Math.min(E,x.source[0][0],x.source[1][0],x.source[2][0])}),this.triangles_.forEach(x=>{if(Math.max(x.source[0][0],x.source[1][0],x.source[2][0])-E>this.sourceWorldWidth_/2){const S=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];S[0][0]-E>this.sourceWorldWidth_/2&&(S[0][0]-=this.sourceWorldWidth_),S[1][0]-E>this.sourceWorldWidth_/2&&(S[1][0]-=this.sourceWorldWidth_),S[2][0]-E>this.sourceWorldWidth_/2&&(S[2][0]-=this.sourceWorldWidth_);const w=Math.min(S[0][0],S[1][0],S[2][0]);Math.max(S[0][0],S[1][0],S[2][0])-w<this.sourceWorldWidth_/2&&(x.source=S)}})}l={}}addTriangle_(t,e,n,s,r,o){this.triangles_.push({source:[s,r,o],target:[t,e,n]})}addQuad_(t,e,n,s,r,o,a,l,h){const c=te([r,o,a,l]),u=this.sourceWorldWidth_?Et(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=te([t,e,n,s]);g=Et(m)/this.targetWorldWidth_>Sg||g}!d&&this.sourceProj_.isGlobal()&&u&&(g=u>Sg||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 E=(r[1]+a[1])/2-p[1];g=y*y+E*E>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){const m=[(e[0]+n[0])/2,(e[1]+n[1])/2],p=this.transformInv_(m),y=[(s[0]+t[0])/2,(s[1]+t[1])/2],E=this.transformInv_(y);this.addQuad_(t,e,m,y,r,o,p,E,h-1),this.addQuad_(y,m,n,s,E,p,a,l,h-1)}else{const m=[(t[0]+e[0])/2,(t[1]+e[1])/2],p=this.transformInv_(m),y=[(n[0]+s[0])/2,(n[1]+s[1])/2],E=this.transformInv_(y);this.addQuad_(t,m,y,s,r,p,E,l,h-1),this.addQuad_(m,e,n,y,p,o,a,E,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,e,r,a,o),_&&((_&13)==0&&this.addTriangle_(e,s,t,o,l,r),(_&7)==0&&this.addTriangle_(e,s,n,o,l,a))}calculateSourceExtent(){const t=ti();return this.triangles_.forEach(function(e,n,s){const r=e.source;Eo(t,r[0]),Eo(t,r[1]),Eo(t,r[2])}),t}getTriangles(){return this.triangles_}}const Um=.5;class Vm extends Mf{constructor(t,e,n,s,r,o,a,l,h,c,u,f){super(r,st.IDLE,f),this.renderEdges_=u!==void 0?u:!1,this.pixelRatio_=a,this.gutter_=l,this.canvas_=null,this.sourceTileGrid_=e,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(Pc(m)===0){this.state=st.EMPTY;return}const p=t.getExtent();p&&(_?_=Jn(_,p):_=p);const y=s.getResolution(this.wrappedTileCoord_[0]),E=K4(t,n,m,y);if(!isFinite(E)||E<=0){this.state=st.EMPTY;return}const x=c!==void 0?c:Um;if(this.triangulation_=new Wm(t,n,m,_,E*x,y),this.triangulation_.getTriangles().length===0){this.state=st.EMPTY;return}this.sourceZ_=e.getZForResolution(E);let S=this.triangulation_.calculateSourceExtent();if(_&&(t.canWrapX()?(S[1]=Vt(S[1],_[1],_[3]),S[3]=Vt(S[3],_[1],_[3])):S=Jn(S,_)),!Pc(S))this.state=st.EMPTY;else{let w=0,I=0;t.canWrapX()&&(w=Et(p),I=Math.floor((S[0]-p[0])/w)),l0(S.slice(),t,!0).forEach(C=>{const N=e.getTileRangeForExtentAndZ(C,this.sourceZ_);for(let z=N.minX;z<=N.maxX;z++)for(let b=N.minY;b<=N.maxY;b++){const A=h(this.sourceZ_,z,b,a);if(A){const W=I*w;this.sourceTiles_.push({tile:A,offset:W})}}++I}),this.sourceTiles_.length===0&&(this.state=st.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{const n=e.tile;if(n&&n.getState()==st.LOADED){const s=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);s[0]+=e.offset,s[2]+=e.offset;const r=this.clipExtent_?.slice();r&&(r[0]+=e.offset,r[2]+=e.offset),t.push({extent:s,clipExtent:r,image:n.getImage()})}}),this.sourceTiles_.length=0,t.length===0)this.state=st.ERROR;else{const e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),s=typeof n=="number"?n:n[0],r=typeof n=="number"?n:n[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=zm(s,r,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=st.LOADED}this.changed()}load(){if(this.state==st.IDLE){this.state=st.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:e})=>{const n=e.getState();if(n==st.IDLE||n==st.LOADING){t++;const s=mt(e,lt.CHANGE,r=>{const o=e.getState();(o==st.LOADED||o==st.ERROR||o==st.EMPTY)&&(It(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:e},n,s){e.getState()==st.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(It),this.sourcesListenerKeys_=null}release(){this.canvas_&&(lh(this.canvas_.getContext("2d")),wr.push(this.canvas_),this.canvas_=null),super.release()}}class wf extends Di{constructor(t){super(),this.projection=Kt(t.projection),this.attributions_=Mg(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 e=this;this.viewPromise_=new Promise(function(n,s){e.viewResolver=n,e.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_=Mg(t),this.changed()}setState(t){this.state_=t,this.changed()}}function Mg(i){return i?typeof i=="function"?i:(Array.isArray(i)||(i=[i]),t=>i):null}class Xm 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 e=[256,256];this.tileGrid&&Qe(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),e),this.tmpSize=[0,0],this.key_=t.key||ct(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 e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,n,s,r,o){return Mt()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:Nm(t)}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,n){const s=this.getTileGridForProjection(n),r=this.getTilePixelRatio(e),o=Qe(s.getTileSize(t),this.tmpSize);return r==1?o:SE(o,r,this.tmpSize)}getTileCoordForTileUrlFunction(t,e){const n=e!==void 0?e:this.getProjection(),s=e!==void 0?this.getTileGridForProjection(n):this.tileGrid||this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=F4(s,t,n)),L4(t,s)?t:null}clear(){}refresh(){this.clear(),super.refresh()}}class q4 extends ii{constructor(t,e){super(t),this.tile=e}}const nc={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class Cf extends Xm{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 e=t.target,n=ct(e),s=e.getState();let r;s==st.LOADING?(this.tileLoadingKeys_[n]=!0,r=nc.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],r=s==st.ERROR?nc.TILELOADERROR:s==st.LOADED?nc.TILELOADEND:void 0),r!=null&&this.dispatchEvent(new q4(r,e))}setTileLoadFunction(t){this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,typeof e<"u"?this.setKey(e):this.changed()}setUrl(t){const e=jm(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join(`
|
|
7
|
+
`);this.generateTileUrlFunction_?this.setTileUrlFunction(V4(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,n){}}class $m 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:H4,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:Bm,this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(t){return this.getProjection()&&t&&!yn(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||yn(e,t)))return this.tileGrid;const n=ct(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=Nm(t)),this.tileGridForProjection[n]}createTile_(t,e,n,s,r,o){const a=[t,e,n],l=this.getTileCoordForTileUrlFunction(a,r),h=l?this.tileUrlFunction(l,s,r):void 0,c=new this.tileClass(a,h!==void 0?st.IDLE:st.EMPTY,h!==void 0?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return c.key=o,c.addEventListener(lt.CHANGE,this.handleTileChange.bind(this)),c}getTile(t,e,n,s,r,o){const a=this.getProjection();if(!a||!r||yn(a,r))return this.getTileInternal(t,e,n,s,a||r);const l=[t,e,n],h=this.getKey(),c=this.getTileGridForProjection(a),u=this.getTileGridForProjection(r),f=this.getTileCoordForTileUrlFunction(l,r),d=new Vm(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,e,n,s,r,o){const a=this.getKey(),l=Za(this,a,t,e,n);if(o&&o.containsKey(l))return o.get(l);const h=this.createTile_(t,e,n,s,r,a);return o?.set(l,h),h}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,e){const n=Kt(t);if(n){const s=ct(n);s in this.tileGridForProjection||(this.tileGridForProjection[s]=e)}}}function H4(i,t){if(mi){const e=i.getCrossOrigin();let n="same-origin",s="same-origin";e==="anonymous"||e===""?(n="cors",s="omit"):e==="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=i.getImage();o.width=r.width,o.height=r.height,o.getContext("2d").drawImage(r,0,0),r.close?.(),o.dispatchEvent(new Event("load"))}).catch(()=>{i.getImage().dispatchEvent(new Event("error"))});return}i.getImage().src=t}let Z4=!1;function J4(i,t,e,n,s,r,o){const a=new XMLHttpRequest;a.open("GET",typeof i=="function"?i(e,n,s):i,!0),t.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=Z4,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:e,featureProjection:s}),t.readProjection(c)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function wg(i,t){return function(e,n,s,r,o){J4(i,t,e,n,s,(a,l)=>{this.addFeatures(a),r!==void 0&&r(a)},()=>{this.changed(),o!==void 0&&o()})}}function Q4(i,t){return[[-1/0,-1/0,1/0,1/0]]}function Km(i,t,e,n){const s=[];let r=ti();for(let o=0,a=e.length;o<a;++o){const l=e[o];r=Iu(i,t,l[0],n),s.push((r[0]+r[2])/2,(r[1]+r[3])/2),t=l[l.length-1]}return s}function Al(i,t,e,n,s,r,o){let a,l;const h=(e-t)/n;if(h===1)a=t;else if(h===2)a=t,l=s;else if(h!==0){let c=i[t],u=i[t+1],f=0;const d=[0];for(let m=t+n;m<e;m+=n){const p=i[m],y=i[m+1];f+=Math.sqrt((p-c)*(p-c)+(y-u)*(y-u)),d.push(f),c=p,u=y}const g=s*f,_=zy(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?i[a+c]:oi(i[a+c],i[a+n+c],l);return r}function iu(i,t,e,n,s,r){if(e==t)return null;let o;if(s<i[t+n-1])return r?(o=i.slice(t,t+n),o[n-1]=s,o):null;if(i[e-1]<s)return r?(o=i.slice(e-n,e),o[n-1]=s,o):null;if(s==i[t+n-1])return i.slice(t,t+n);let a=t/n,l=e/n;for(;a<l;){const f=a+l>>1;s<i[(f+1)*n-1]?l=f:a=f+1}const h=i[a*n-1];if(s==h)return i.slice((a-1)*n,(a-1)*n+n);const c=i[(a+1)*n-1],u=(s-h)/(c-h);o=[];for(let f=0;f<n-1;++f)o.push(oi(i[(a-1)*n+f],i[a*n+f],u));return o.push(s),o}function tT(i,t,e,n,s,r,o){if(o)return iu(i,t,e[e.length-1],n,s,r);let a;if(s<i[n-1])return r?(a=i.slice(0,n),a[n-1]=s,a):null;if(i[i.length-1]<s)return r?(a=i.slice(i.length-n),a[n-1]=s,a):null;for(let l=0,h=e.length;l<h;++l){const c=e[l];if(t!=c){if(s<i[t+n-1])return null;if(s<=i[c-1])return iu(i,t,c,n,s,!1);t=c}}return null}class mh extends cs{constructor(t,e,n){super(),n!==void 0&&e===void 0?this.setFlatCoordinates(n,t):(e=e||0,this.setCenterAndRadius(t,e,n))}clone(){const t=new mh(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,s){const r=this.flatCoordinates,o=t-r[0],a=e-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,e){const n=this.flatCoordinates,s=t-n[0],r=e-n[1];return s*s+r*r<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(t){const e=this.flatCoordinates,n=e[this.stride]-e[0];return Ki(e[0]-n,e[1]-n,e[0]+n,e[1]+n,t)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){const t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e}getType(){return"Circle"}intersectsExtent(t){const e=this.getExtent();if(Fe(t,e)){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 e=this.stride,n=this.flatCoordinates[e]-this.flatCoordinates[0],s=t.slice();s[e]=s[0]+n;for(let r=1;r<e;++r)s[e+r]=t[r];this.setFlatCoordinates(this.layout,s),this.changed()}setCenterAndRadius(t,e,n){this.setLayout(n,t,0),this.flatCoordinates||(this.flatCoordinates=[]);const s=this.flatCoordinates;let r=E0(s,0,t,this.stride);s[r++]=s[0]+e;for(let o=1,a=this.stride;o<a;++o)s[r++]=s[o];s.length=r,this.changed()}getCoordinates(){return null}setCoordinates(t,e){}setRadius(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()}rotate(t,e){const n=this.getCenter(),s=this.getStride();this.setCenter(ku(n,0,n.length,s,t,e,n)),this.changed()}}mh.prototype.transform;class Ll extends ju{constructor(t){super(),this.geometries_=t,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(It),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const t=this.geometries_;for(let e=0,n=t.length;e<n;++e)this.changeEventsKeys_.push(mt(t[e],lt.CHANGE,this.changed,this))}clone(){const t=new Ll(sc(this.geometries_));return t.applyProperties(this),t}closestPointXY(t,e,n,s){if(s<zs(this.getExtent(),t,e))return s;const r=this.geometries_;for(let o=0,a=r.length;o<a;++o)s=r[o].closestPointXY(t,e,n,s);return s}containsXY(t,e){const n=this.geometries_;for(let s=0,r=n.length;s<r;++s)if(n[s].containsXY(t,e))return!0;return!1}computeExtent(t){Gr(t);const e=this.geometries_;for(let n=0,s=e.length;n<s;++n)s0(t,e[n].getExtent());return t}getGeometries(){return sc(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[];const e=this.geometries_;for(let n=0,s=e.length;n<s;++n)e[n].getType()===this.getType()?t=t.concat(e[n].getGeometriesArrayRecursive()):t.push(e[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 e=[],n=this.geometries_;let s=!1;for(let r=0,o=n.length;r<o;++r){const a=n[r],l=a.getSimplifiedGeometry(t);e.push(l),l!==a&&(s=!0)}return s?new Ll(e):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return"GeometryCollection"}intersectsExtent(t){const e=this.geometries_;for(let n=0,s=e.length;n<s;++n)if(e[n].intersectsExtent(t))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(t,e){const n=this.geometries_;for(let s=0,r=n.length;s<r;++s)n[s].rotate(t,e);this.changed()}scale(t,e,n){n||(n=Yi(this.getExtent()));const s=this.geometries_;for(let r=0,o=s.length;r<o;++r)s[r].scale(t,e,n);this.changed()}setGeometries(t){this.setGeometriesArray(sc(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){const e=this.geometries_;for(let n=0,s=e.length;n<s;++n)e[n].applyTransform(t);this.changed()}translate(t,e){const n=this.geometries_;for(let s=0,r=n.length;s<r;++s)n[s].translate(t,e);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function sc(i){return i.map(t=>t.clone())}function Tf(i,t,e,n){let s=i[t],r=i[t+1],o=0;for(let a=t+n;a<e;a+=n){const l=i[a],h=i[a+1];o+=Math.sqrt((l-s)*(l-s)+(h-r)*(h-r)),s=l,r=h}return o}class Sn extends cs{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendCoordinate(t){xi(this.flatCoordinates,t),this.changed()}clone(){const t=new Sn(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,s){return s<zs(this.getExtent(),t,e)?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,e,n,s))}forEachSegment(t){return C0(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){return this.layout!="XYM"&&this.layout!="XYZM"?null:(e=e!==void 0?e:!1,iu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return Xn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return Al(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,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 e=[];return e.length=rh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new Sn(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return oh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,this.getExtent())}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=sh(this.flatCoordinates,0,t,this.stride),this.changed()}}class Jo extends cs{constructor(t,e,n){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(e!==void 0&&n)this.setFlatCoordinates(e,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 Jo(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,n,s){return s<zs(this.getExtent(),t,e)?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,e,n,s))}getCoordinateAtM(t,e,n){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(e=e!==void 0?e:!1,n=n!==void 0?n:!1,tT(this.flatCoordinates,0,this.ends_,this.stride,t,e,n))}getCoordinates(){return Bo(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new Sn(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLineStrings(){const t=this.flatCoordinates,e=this.ends_,n=this.layout,s=[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=e[o],h=new Sn(t.slice(r,l),n);s.push(h),r=l}return s}getLength(){const t=this.ends_;let e=0,n=0;for(let s=0,r=t.length;s<r;++s)n+=Tf(this.flatCoordinates,e,t[s],this.stride),e=t[s];return n}getFlatMidpoints(){const t=[],e=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=Al(e,n,l,r,.5);xi(t,h),n=l}return t}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=S0(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,n),new Jo(e,"XY",n)}getType(){return"MultiLineString"}intersectsExtent(t){return tx(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,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 ph extends cs{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){xi(this.flatCoordinates,t.getFlatCoordinates()),this.changed()}clone(){const t=new ph(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,s){if(s<zs(this.getExtent(),t,e))return s;const r=this.flatCoordinates,o=this.stride;for(let a=0,l=r.length;a<l;a+=o){const h=mn(t,e,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 e=this.flatCoordinates.length/this.stride;return t<0||e<=t?null:new vn(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){const t=this.flatCoordinates,e=this.layout,n=this.stride,s=[];for(let r=0,o=t.length;r<o;r+=n){const a=new vn(t.slice(r,r+n),e);s.push(a)}return s}getType(){return"MultiPoint"}intersectsExtent(t){const e=this.flatCoordinates,n=this.stride;for(let s=0,r=e.length;s<r;s+=n){const o=e[s],a=e[s+1];if(Ru(t,o,a))return!0}return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=sh(this.flatCoordinates,0,t,this.stride),this.changed()}}class Qo extends cs{constructor(t,e,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)}e=s.length===0?this.getLayout():s[0].getLayout(),t=r,n=o}e!==void 0&&n?(this.setFlatCoordinates(e,t),this.endss_=n):this.setCoordinates(t,e)}appendPolygon(t){let e;if(!this.flatCoordinates)this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();else{const n=this.flatCoordinates.length;xi(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(let s=0,r=e.length;s<r;++s)e[s]+=n}this.endss_.push(e),this.changed()}clone(){const t=this.endss_.length,e=new Array(t);for(let s=0;s<t;++s)e[s]=this.endss_[s].slice();const n=new Qo(this.flatCoordinates.slice(),this.layout,e);return n.applyProperties(this),n}closestPointXY(t,e,n,s){return s<zs(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Kv(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Yv(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,n,s))}containsXY(t,e){return Qv(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return $v(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),bd(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,Dc(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=Km(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=w0(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new ph(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;nx(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=bd(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=Zv(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,n),new Qo(e,"XY",n)}getPolygon(t){if(t<0||this.endss_.length<=t)return null;let e;if(t===0)e=0;else{const r=this.endss_[t-1];e=r[r.length-1]}const n=this.endss_[t].slice(),s=n[n.length-1];if(e!==0)for(let r=0,o=n.length;r<o;++r)n[r]-=e;return new Fi(this.flatCoordinates.slice(e,s),this.layout,n)}getPolygons(){const t=this.layout,e=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(e.slice(r,h),t,l);s.push(c),r=h}return s}getType(){return"MultiPolygon"}intersectsExtent(t){return ex(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const n=qv(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 Cg=bi();class Ri{constructor(t,e,n,s,r,o){this.styleFunction,this.extent_,this.id_=o,this.type_=t,this.flatCoordinates_=e,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=Yi(this.getExtent());this.flatInteriorPoints_=Ku(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=sx(this.flatCoordinates_,this.ends_),e=Km(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=w0(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=Al(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let e=0;const n=this.ends_;for(let s=0,r=n.length;s<r;++s){const o=n[s],a=Al(t,e,o,2,.5);xi(this.flatMidpoints_,a),e=o}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(t){return this}simplifyTransformed(t,e){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=Kt(t);const e=t.getExtent(),n=t.getWorldExtent();if(e&&n){const s=_e(n)/_e(e);Tn(Cg,n[0],n[3],s,-s,0,0,0),es(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Cg,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=t0((t,e)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const n=this.simplifiedGeometry_.getFlatCoordinates();let s;switch(this.type_){case"LineString":n.length=rh(n,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,n,0),s=[n.length];break;case"MultiLineString":s=[],n.length=S0(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 Ol{constructor(t){this.rbush_=new U0(t),this.items_={}}insert(t,e){const n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(n),this.items_[ct(e)]=n}load(t,e){const n=new Array(e.length);for(let s=0,r=e.length;s<r;s++){const o=t[s],a=e[s],l={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:a};n[s]=l,this.items_[ct(a)]=l}this.rbush_.load(n)}remove(t){const e=ct(t),n=this.items_[e];return delete this.items_[e],this.rbush_.remove(n)!==null}update(t,e){const n=this.items_[ct(e)],s=[n.minX,n.minY,n.maxX,n.maxY];Pr(s,t)||(this.remove(e),this.insert(t,e))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(t){const e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(s){return s.value})}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,e){return this.forEach_(this.getInExtent(t),e)}forEach_(t,e){let n;for(let s=0,r=t.length;s<r;s++)if(n=e(t[s]),n)return n;return n}isEmpty(){return Rr(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const e=this.rbush_.toJSON();return Ki(e.minX,e.minY,e.maxX,e.maxY,t)}concat(t){this.rbush_.load(t.rbush_.all());for(const e in t.items_)this.items_[e]=t.items_[e]}}const Pe={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};class Nn extends ii{constructor(t,e,n){super(t),this.feature=e,this.features=n}}class yh 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_=ko,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&&(Lt(this.format_,"`format` must be set when `url` is set"),this.loader_=wg(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:Q4;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new Ol:null,this.loadedExtentsRtree_=new Ol,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()),!e&&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 e=ct(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const n=t.getGeometry();if(n){const s=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(s,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Nn(Pe.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof Ri||(this.featureChangeKeys_[t]=[mt(e,lt.CHANGE,this.handleFeatureChange_,this),mt(e,Tr.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let n=!0;if(e.getId()!==void 0){const s=String(e.getId());if(!(s in this.idIndex_))this.idIndex_[s]=e;else if(e instanceof Ri){const r=this.idIndex_[s];r instanceof Ri?Array.isArray(r)?r.push(e):this.idIndex_[s]=[r,e]:n=!1}else n=!1}return n&&(Lt(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),n}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],n=[],s=[];for(let r=0,o=t.length;r<o;r++){const a=t[r],l=ct(a);this.addToIndex_(l,a)&&n.push(a)}for(let r=0,o=n.length;r<o;r++){const a=n[r],l=ct(a);this.setupChangeEvents_(l,a);const h=a.getGeometry();if(h){const c=h.getExtent();e.push(c),s.push(a)}else this.nullGeometryFeatures_[l]=a}if(this.featuresRtree_&&this.featuresRtree_.load(e,s),this.hasListener(Pe.ADDFEATURE))for(let r=0,o=n.length;r<o;r++)this.dispatchEvent(new Nn(Pe.ADDFEATURE,n[r]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener(Pe.ADDFEATURE,function(n){e||(e=!0,t.push(n.feature),e=!1)}),this.addEventListener(Pe.REMOVEFEATURE,function(n){e||(e=!0,t.remove(n.feature),e=!1)}),t.addEventListener(ee.ADD,n=>{e||(e=!0,this.addFeature(n.element),e=!1)}),t.addEventListener(ee.REMOVE,n=>{e||(e=!0,this.removeFeature(n.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const n in this.featureChangeKeys_)this.featureChangeKeys_[n].forEach(It);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 e=new Nn(Pe.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(s){const r=s.getGeometry();if(r instanceof Ri||r.intersectsCoordinate(t))return e(s)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(n){const s=n.getGeometry();if(s instanceof Ri||s.intersectsExtent(t)){const r=e(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 e=[];return this.forEachFeatureAtCoordinateDirect(t,function(n){e.push(n)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const s=l0(t,e);return[].concat(...s.map(r=>this.featuresRtree_.getInExtent(r)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){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 e=e||Cn,this.featuresRtree_.forEachInExtent(l,function(h){if(e(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 e=this.idIndex_[t.toString()];return e!==void 0?e:null}getFeatureByUid(t){const e=this.uidIndex_[t];return e!==void 0?e:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(t){const e=t.target,n=ct(e),s=e.getGeometry();if(!s)n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);else{const o=s.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}const r=e.getId();if(r!==void 0){const o=r.toString();this.idIndex_[o]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[o]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new Nn(Pe.CHANGEFEATURE,e))}hasFeature(t){const e=t.getId();return e!==void 0?e in this.idIndex_:ct(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&Rr(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(t,e,n){const s=this.loadedExtentsRtree_,r=this.strategy_(t,e,n);for(let o=0,a=r.length;o<a;++o){const l=r[o];s.forEachInExtent(l,function(c){return dn(c.extent,l)})||(++this.loadingExtentsCount_,this.dispatchEvent(new Nn(Pe.FEATURESLOADSTART)),this.loader_.call(this,l,e,n,c=>{--this.loadingExtentsCount_,this.dispatchEvent(new Nn(Pe.FEATURESLOADEND,void 0,c))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Nn(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 e=this.loadedExtentsRtree_,n=e.forEachInExtent(t,function(s){if(Pr(s.extent,t))return s});n&&e.remove(n)}removeFeatures(t){let e=!1;for(let n=0,s=t.length;n<s;++n)e=this.removeFeatureInternal(t[n])||e;e&&this.changed()}removeFeature(t){if(!t)return;this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=ct(t);if(!(e in this.uidIndex_))return!1;e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.featureChangeKeys_[e]?.forEach(It),delete this.featureChangeKeys_[e];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_[e],this.hasListener(Pe.REMOVEFEATURE)&&this.dispatchEvent(new Nn(Pe.REMOVEFEATURE,t)),!0}removeFromIdIndex_(t){for(const e in this.idIndex_)if(this.idIndex_[e]===t){delete this.idIndex_[e];break}}setLoader(t){this.loader_=t}setUrl(t){Lt(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(wg(t,this.format_))}setOverlaps(t){this.overlaps_=t,this.changed()}}function nu(i){return i instanceof Image||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement||i instanceof ImageBitmap?i:null}const eT=new Error("disposed"),iT=[256,256];class Tg extends Mf{constructor(t){const e=st.IDLE;super(t.tileCoord,e,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null,this.controller_=t.controller||null}getSize(){if(this.size_)return this.size_;const t=nu(this.data_);return t?[t.width,t.height]:iT}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==st.IDLE&&this.state!==st.ERROR)return;this.state=st.LOADING,this.changed();const t=this;this.loader_().then(function(e){t.data_=e,t.state=st.LOADED,t.changed()}).catch(function(e){t.error_=e,t.state=st.ERROR,t.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(eT),this.controller_=null),super.disposeInternal()}}function su(i){return Array.isArray(i)?Math.min(...i):i}class nT extends Y0{constructor(t,e,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=e.getExtent();h&&e.canWrapX()&&(h=h.slice(),h[0]=-1/0,h[2]=1/0);const c=h?Jn(n,h):n,u=Yi(c),f=bl(t,e,u,s),d=Um,g=new Wm(t,e,c,l,f*d,s),_=g.calculateSourceExtent(),m=Dr(_)?null:o(_,f,r),p=m?tt.IDLE:tt.EMPTY,y=m?m.getPixelRatio():1;super(n,s,y,p),this.targetProj_=e,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==tt.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const t=this.sourceImage_.getState();if(t==tt.LOADED){const e=Et(this.targetExtent_)/this.targetResolution_,n=_e(this.targetExtent_)/this.targetResolution_;this.canvas_=zm(e,n,this.sourcePixelRatio_,su(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==tt.IDLE){this.state=tt.LOADING,this.changed();const t=this.sourceImage_.getState();t==tt.LOADED||t==tt.ERROR?this.reproject_():(this.sourceListenerKey_=mt(this.sourceImage_,lt.CHANGE,e=>{const n=this.sourceImage_.getState();(n==tt.LOADED||n==tt.ERROR)&&(this.unlistenSource_(),this.reproject_())}),this.sourceImage_.load())}}unlistenSource_(){It(this.sourceListenerKey_),this.sourceListenerKey_=null}}const ur=4,rc={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"};class sT extends ii{constructor(t,e){super(t),this.image=e}}class rT 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 e=this.getResolutions();if(e){const n=Hl(e,t,0);t=e[n]}return t}getImage(t,e,n,s){const r=this.getProjection();if(!r||!s||yn(r,s))return r&&(s=r),this.getImageInternal(t,e,n,s);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&yn(this.reprojectedImage_.getProjection(),s)&&this.reprojectedImage_.getResolution()==e&&Pr(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new nT(r,s,t,e,n,(o,a,l)=>this.getImageInternal(o,a,l,r),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(t,e,n,s){if(this.loader){const r=oT(t,e,n,1),o=this.findNearestResolution(e);if(this.image&&(this.static_||this.wantedProjection_===s&&(this.wantedExtent_&&dn(this.wantedExtent_,r)||dn(this.image.getExtent(),r))&&(this.wantedResolution_&&su(this.wantedResolution_)===o||su(this.image.getResolution())===o)))return this.image;this.wantedProjection_=s,this.wantedExtent_=r,this.wantedResolution_=o,this.image=new Y0(r,o,n,this.loader),this.image.addEventListener(lt.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(t){const e=t.target;let n;switch(e.getState()){case tt.LOADING:this.loading=!0,n=rc.IMAGELOADSTART;break;case tt.LOADED:this.loading=!1,n=rc.IMAGELOADEND;break;case tt.ERROR:this.loading=!1,n=rc.IMAGELOADERROR;break;default:return}this.hasListener(n)&&this.dispatchEvent(new sT(n,e))}}function oT(i,t,e,n){const s=t/e,r=Yi(i),o=Vn(Et(i)/s,ur),a=Vn(_e(i)/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 hl(r,s,0,[h,u])}const ru="1.3.0";function aT(i,t,e,n,s){s.WIDTH=e[0],s.HEIGHT=e[1];const r=n.getAxisOrientation(),o=c0(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(","),Pl(i,s)}function lT(i,t,e,n,s,r,o){r=Object.assign({REQUEST:"GetMap"},r);const a=t/e,l=[md(Et(i)/a,ur),md(_e(i)/a,ur)];if(e!=1)switch(o){case"geoserver":const c=90*e+.5|0;"FORMAT_OPTIONS"in r?r.FORMAT_OPTIONS+=";dpi:"+c:r.FORMAT_OPTIONS="dpi:"+c;break;case"mapserver":r.MAP_RESOLUTION=90*e;break;case"carmentaserver":case"qgis":r.DPI=90*e;break;default:throw new Error("Unknown `serverType` configured")}return aT(s,i,l,n,r)}function Rg(i,t){return Object.assign({REQUEST:t,SERVICE:"WMS",VERSION:ru,FORMAT:"image/png",STYLES:"",TRANSPARENT:"TRUE"},i)}class Ym{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(_l(),{get:(t,e)=>{if(typeof _l()[e]=="function")return this.push_(e),this.pushMethodArgs_},set:(t,e,n)=>(this.push_(e,n),!0)})}push_(...t){const e=this.instructions_,n=this.zIndex+this.offset_;e[n]||(e[n]=[]),e[n].push(...t)}pushMethodArgs_=(...t)=>(this.push_(t),this);pushFunction(t){this.push_(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let n=0,s=e.length;n<s;++n){const r=e[n];if(typeof r=="function"){r(t);continue}const o=e[++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 hT=5;class cT extends sa{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=new Array,this.maxStaleKeys=hT}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return Mt()}getData(t){return null}prepareFrame(t){return Mt()}renderFrame(t,e){return Mt()}forEachFeatureAtCoordinate(t,e,n,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===tt.LOADED||e.getState()===tt.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=tt.LOADED&&e!=tt.ERROR&&t.addEventListener(lt.CHANGE,this.boundHandleImageChange_),e==tt.IDLE&&(t.load(),e=t.getState()),e==tt.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const Ig=[];let sr=null;function uT(){sr=ce(1,1,void 0,{willReadFrequently:!0})}class qm extends cT{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,e,n){sr||uT(),sr.clearRect(0,0,1,1);let s;try{sr.drawImage(t,e,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,e,n){const s=this.getLayer().getClassName();let r,o;if(t&&t.className===s&&(!n||t&&t.style.backgroundColor&&Pn(Ar(t.style.backgroundColor),Ar(n)))){const a=t.firstElementChild;$n(a)&&(o=a.getContext("2d"))}if(o&&jv(o.canvas.style.transform,e)?(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?G0():document.createElement("div"),r.className=s;let a=r.style;a.position="absolute",a.width="100%",a.height="100%",o=ce();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,e,n){const s=hs(n),r=Ql(n),o=Jl(n),a=Zl(n);de(e.coordinateToPixelTransform,s),de(e.coordinateToPixelTransform,r),de(e.coordinateToPixelTransform,o),de(e.coordinateToPixelTransform,a);const l=this.inversePixelTransform;de(l,s),de(l,r),de(l,o),de(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,e){const n=t.extent,s=t.viewState.resolution,r=t.viewState.rotation,o=t.pixelRatio,a=Math.round(Et(n)/s*o),l=Math.round(_e(n)/s*o);Tn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/o,1/o,r,-a/2,-l/2),y0(this.inversePixelTransform,this.pixelTransform);const h=kv(this.pixelTransform);if(this.useContainer(e,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,e,n){const s=this.getLayer();if(s.hasListener(t)){const r=new rm(t,this.inversePixelTransform,n,e);s.dispatchEvent(r)}}preRender(t,e){this.frameState=e,!e.declutter&&this.dispatchRenderEvent_(pi.PRERENDER,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(pi.POSTRENDER,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new Ym),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,e,n,s,r,o,a){const l=r/2,h=o/2,c=s/e,u=-c,f=-t[0]+a,d=-t[1];return Tn(this.tempTransform,l,h,c,u,-n,f,d)}disposeInternal(){delete this.frameState,super.disposeInternal()}}function oc(i,t,e){if(!(e in i))return i[e]=new Set([t]),!0;const n=i[e],s=n.has(t);return s||n.add(t),!s}function fT(i,t,e){const n=i[e];return n?n.delete(t):!1}function Pg(i,t){const e=i.layerStatesArray[i.layerIndex];e.extent&&(t=Jn(t,gn(e.extent,i.viewState.projection)));const n=e.layer.getRenderSource();if(!n.getWrapX()){const s=n.getTileGridForProjection(i.viewState.projection).getExtent();s&&(t=Jn(t,s))}return t}class dT extends qm{constructor(t,e){super(t),e=e||{},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_=Il(0,0,0);const n=e.cacheSize!==void 0?e.cacheSize:512;this.tileCache_=new xg(n),this.sourceTileCache_=null,this.maxStaleKeys=n*.5}getTileCache(){return this.tileCache_}getSourceTileCache(){return this.sourceTileCache_||(this.sourceTileCache_=new xg(512)),this.sourceTileCache_}getOrCreateTile(t,e,n,s){const r=this.tileCache_,a=this.getLayer().getSource(),l=Za(a,a.getKey(),t,e,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,e,n,s.pixelRatio,c,!u||yn(u,c)?void 0:this.getSourceTileCache()),!h)return null;r.set(l,h)}return h}getTile(t,e,n,s){const r=this.getOrCreateTile(t,e,n,s);return r||null}getData(t){const e=this.frameState;if(!e)return null;const n=this.getLayer(),s=de(e.pixelToCoordinateTransform,t.slice()),r=n.getExtent();if(r&&!Ir(r,s))return null;const o=e.viewState,a=n.getRenderSource(),l=a.getTileGridForProjection(o.projection),h=a.getTilePixelRatio(e.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],e);if(!f||f.getState()!==st.LOADED)continue;const d=l.getOrigin(c),g=Qe(l.getTileSize(c)),_=l.getResolution(c);let m;if(f instanceof Bm||f instanceof Vm)m=f.getImage();else if(f instanceof Tg){if(m=nu(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])),E=Math.round(h*a.getGutterForProjection(o.projection));return this.getImageData(m,p+E,y+E)}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 e=this.getLayer().getSource();if(!e)return!1;const n=e.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==n&&(this.renderedSourceRevision_=n,this.renderedSourceKey_===e.getKey()&&(this.tileCache_.clear(),this.sourceTileCache_?.clear())):this.renderedSourceRevision_=n,!0}enqueueTilesForNextExtent(){return!0}enqueueTiles(t,e,n,s,r){const o=t.viewState,a=this.getLayer(),l=a.getRenderSource(),h=l.getTileGridForProjection(o.projection),c=ct(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?o0(o.center,o.resolution,g,t.size):void 0;for(let m=n;m>=d;--m){const p=h.getTileRangeForExtentAndZ(e,m,this.tempTileRange_),y=h.getResolution(m);for(let E=p.minX;E<=p.maxX;++E)for(let x=p.minY;x<=p.maxY;++x){if(g&&!h.tileCoordIntersectsViewport([m,E,x],_))continue;const S=this.getTile(m,E,x,t);if(!S||!oc(s,S,m))continue;const I=S.getKey();if(u[I]=!0,S.getState()===st.IDLE&&!t.tileQueue.isKeyQueued(I)){const P=Il(m,E,x,this.tempTileCoord_);t.tileQueue.enqueue([S,c,h.getTileCoordCenter(P),y])}}}}findStaleTile_(t,e){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=Za(this.getLayer().getSource(),a[l],s,r,o);if(n.containsKey(h)){const c=n.peek(h);if(c.getState()===st.LOADED)return c.endTransition(ct(this)),oc(e,c,s),!0}}return!1}findAltTiles_(t,e,n,s){const r=t.getTileRangeForTileCoordAndZ(e,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=Za(l,h,n,c,u);let d=!1;if(a.containsKey(f)){const g=a.peek(f);g.getState()===st.LOADED&&(oc(s,g,n),d=!0)}d||(o=!1)}return o}renderFrame(t,e){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,e);const p=this.context.canvas.width,y=this.context.canvas.height,E=n.extent&&gn(n.extent);E&&(_=Jn(_,gn(n.extent)));const x=d*p/2/m,S=d*y/2/m,w=[a[0]-x,a[1]-S,a[0]+x,a[1]+S],I={};this.renderedTiles.length=0;const P=h.getPreload();if(t.nextExtent&&this.enqueueTilesForNextExtent()){const K=u.getZForResolution(s.nextResolution,c.zDirection),ot=Pg(t,t.nextExtent);this.enqueueTiles(t,ot,K,I,P)}const C=Pg(t,_);if(this.enqueueTiles(t,C,f,I,0),P>0&&setTimeout(()=>{this.enqueueTiles(t,C,f-1,I,P-1)},0),!(f in I))return this.container;const N=ct(this),z=t.time;for(const K of I[f]){const ot=K.getState();if(ot===st.EMPTY)continue;const ft=K.tileCoord;if(ot===st.LOADED&&K.getAlpha(N,z)===1){K.endTransition(N);continue}if(ot!==st.ERROR&&(this.renderComplete=!1),this.findStaleTile_(ft,I)){fT(I,K,f),t.animate=!0;continue}if(this.findAltTiles_(u,ft,f+1,I))continue;const Zt=u.getMinZoom();for(let re=f-1;re>=Zt&&!this.findAltTiles_(u,ft,re,I);--re);}const b=d/o*l/m,A=this.getRenderContext(t);Tn(this.tempTransform,p/2,y/2,b,b,0,-p/2,-y/2),n.extent&&this.clipUnrotated(A,t,E),c.getInterpolate()||(A.imageSmoothingEnabled=!1),this.preRender(A,t);const W=Object.keys(I).map(Number);W.sort(_n);let Q;const q=[],Y=[];for(let K=W.length-1;K>=0;--K){const ot=W[K],ft=c.getTilePixelSize(ot,l,r),j=u.getResolution(ot)/d,Zt=ft[0]*j*b,re=ft[1]*j*b,zt=u.getTileCoordForCoordAndZ(hs(w),ot),Jt=u.getTileCoordExtent(zt),qt=de(this.tempTransform,[m*(Jt[0]-w[0])/d,m*(w[3]-Jt[3])/d]),ue=m*c.getGutterForProjection(r);for(const R of I[ot]){if(R.getState()!==st.LOADED)continue;const D=R.tileCoord,H=zt[1]-D[1],v=Math.round(qt[0]-(H-1)*Zt),M=zt[2]-D[2],T=Math.round(qt[1]-(M-1)*re),G=Math.round(qt[0]-H*Zt),L=Math.round(qt[1]-M*re),O=v-G,U=T-L,X=W.length===1;let V=!1;Q=[G,L,G+O,L,G+O,L+U,G,L+U];for(let k=0,et=q.length;k<et;++k)if(!X&&ot<Y[k]){const $=q[k];Fe([G,L,G+O,L+U],[$[0],$[3],$[4],$[7]])&&(V||(A.save(),V=!0),A.beginPath(),A.moveTo(Q[0],Q[1]),A.lineTo(Q[2],Q[3]),A.lineTo(Q[4],Q[5]),A.lineTo(Q[6],Q[7]),A.moveTo($[6],$[7]),A.lineTo($[4],$[5]),A.lineTo($[2],$[3]),A.lineTo($[0],$[1]),A.clip())}q.push(Q),Y.push(ot),this.drawTile(R,t,G,L,O,U,ue,X),V&&A.restore(),this.renderedTiles.unshift(R),this.updateUsedTiles(t.usedTiles,c,R)}}if(this.renderedResolution=d,this.extentChanged=!this.renderedExtent_||!Pr(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.postRender(this.context,t),n.extent&&A.restore(),A.imageSmoothingEnabled=!0,this.renderComplete){const K=(ot,ft)=>{const pt=ct(c),j=ft.wantedTiles[pt],Zt=j?Object.keys(j).length:0;this.updateCacheSize(Zt),this.tileCache_.expireCache(),this.sourceTileCache_?.expireCache()};t.postRenderFunctions.push(K)}return this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,t*2)}drawTile(t,e,n,s,r,o,a,l){let h;if(t instanceof Tg){if(h=nu(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(e),u=ct(this),f=e.layerStatesArray[e.layerIndex],d=f.opacity*(l?t.getAlpha(u,e.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?e.animate=!0:l&&t.endTransition(u)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,n){const s=ct(e);s in t||(t[s]={}),t[s][n.getKey()]=!0}}const Aa={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class gT extends hh{constructor(t){t=t||{};const e=Object.assign({},t),n=t.cacheSize;delete t.cacheSize,delete e.preload,delete e.useInterimTilesOnError,super(e),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(Aa.PRELOAD)}setPreload(t){this.set(Aa.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(Aa.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(Aa.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}class _T extends gT{constructor(t){super(t)}createRenderer(){return new dT(this,{cacheSize:this.getCacheSize()})}}class mT extends $m{constructor(t){t=t||{};const e=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_=e,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,e,n,s){const r=Kt(n),o=this.getProjection()||r;let a=this.getTileGrid();a||(a=this.getTileGridForProjection(o));const l=Nu(t,r,o),h=bl(o,r,t,e),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=As(d,u*g,d));const _={QUERY_LAYERS:this.params_.LAYERS};Object.assign(_,Rg(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,e){if(this.urls[0]===void 0)return;const n={SERVICE:"WMS",VERSION:ru,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(e===void 0||e.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,e),Pl(this.urls[0],n)}getGutter(){return this.gutter_}getParams(){return this.params_}getRequestUrl_(t,e,n,s,r){const o=this.urls;if(!o)return;let a;if(o.length==1)a=o[0];else{const l=ts(Fm(t),o.length);a=o[l]}return lT(e,(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 e=[];for(const n in this.params_)e[t++]=n+"-"+this.params_[n];return e.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||ru;this.v13_=c0(t,"1.3")>=0}tileUrlFunction(t,e,n){let s=this.getTileGrid();if(s||(s=this.getTileGridForProjection(n)),s.getResolutions().length<=t[0])return;e!=1&&(!this.hidpi_||this.serverType_===void 0)&&(e=1);const r=s.getResolution(t[0]);let o=s.getTileCoordExtent(t,this.tmpExtent_);const a=this.gutter_;a!==0&&(o=As(o,r*a,o));const l=Object.assign({},Rg(this.params_,"GetMap"));return this.getRequestUrl_(t,o,e,n,l)}}class pT extends $m{constructor(t){const e=t.requestEncoding!==void 0?t.requestEncoding:"KVP",n=t.tileGrid;let s=t.urls;s===void 0&&t.url!==void 0&&(s=jm(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_=e,this.setKey(this.getKeyForDimensions_()),s&&s.length>0&&(this.tileUrlFunction=eu(s.map(this.createFromWMTSTemplate.bind(this))))}setUrls(t){this.urls=t;const e=t.join(`
|
|
8
|
+
`);this.setTileUrlFunction(eu(t.map(this.createFromWMTSTemplate.bind(this))),e)}getDimensions(){return this.dimensions_}getFormat(){return this.format_}getLayer(){return this.layer_}getMatrixSet(){return this.matrixSet_}getRequestEncoding(){return this.requestEncoding_}getStyle(){return this.style_}getVersion(){return this.version_}getKeyForDimensions_(){const t=this.urls?this.urls.slice(0):[];for(const e in this.dimensions_)t.push(e+"-"+this.dimensions_[e]);return t.join("/")}updateDimensions(t){Object.assign(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())}createFromWMTSTemplate(t){const e=this.requestEncoding_,n={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};e=="KVP"&&Object.assign(n,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=e=="KVP"?Pl(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 e=="KVP"?c=Pl(c,h):c=c.replace(/\{(\w+?)\}/g,function(u,f){return encodeURIComponent(h[f])}),c})}}function yT(i,t){const n=i.Contents.Layer?.find(function(A){return A.Identifier==t.layer});if(!n)return null;const s=i.Contents.TileMatrixSet;let r;n.TileMatrixSetLink.length>1?"projection"in t?r=n.TileMatrixSetLink.findIndex(function(A){const Q=s.find(function(K){return K.Identifier==A.TileMatrixSet}).SupportedCRS,q=Kt(Q),Y=Kt(t.projection);return q&&Y?yn(q,Y):Q==t.projection}):r=n.TileMatrixSetLink.findIndex(function(A){return A.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(A){return"style"in t?A.Title==t.style:A.isDefault}),r<0&&(r=0);const h=n.Style[r].Identifier,c={};"Dimension"in n&&n.Dimension.forEach(function(A,W,Q){const q=A.Identifier;let Y=A.Default;Y===void 0&&(Y=A.Value[0]),c[q]=Y});const f=i.Contents.TileMatrixSet.find(function(A){return A.Identifier==o});let d;const g=f.SupportedCRS;if(g&&(d=Kt(g)),"projection"in t){const A=Kt(t.projection);A&&(!d||yn(A,d))&&(d=A)}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 A=f.TileMatrix.find(W=>W.Identifier===y.TileMatrix||f.Identifier+":"+W.Identifier===y.TileMatrix);A&&(p=A)}const E=n.BoundingBox?.find(A=>Kt(A.crs)&&yn(Kt(A.crs),d)),x=p.ScaleDenominator*28e-5/d.getMetersPerUnit(),S=m?[p.TopLeftCorner[1],p.TopLeftCorner[0]]:p.TopLeftCorner,w=p.TileWidth*x,I=p.TileHeight*x;let P=E?.extent??f.BoundingBox;P&&m&&(P=[P[1],P[0],P[3],P[2]]);let C=[S[0]+w*y.MinTileCol,S[1]-I*(1+y.MaxTileRow),S[0]+w*(1+y.MaxTileCol),S[1]-I*y.MinTileRow];if(P!==void 0&&!dn(P,C)){const A=n.WGS84BoundingBox,W=Kt("EPSG:4326").getExtent();if(C=P,A)_=A[0]===W[0]&&A[2]===W[2];else{const Q=Ov(P,f.SupportedCRS,"EPSG:4326");_=Q[0]-1e-10<=W[0]&&Q[2]+1e-10>=W[2]}}const N=O4(f,C,a),z=[];let b=t.requestEncoding;if(b=b!==void 0?b:"","OperationsMetadata"in i&&"GetTile"in i.OperationsMetadata){const A=i.OperationsMetadata.GetTile.DCP.HTTP.Get;for(let W=0,Q=A.length;W<Q;++W)if(A[W].Constraint){const Y=A[W].Constraint.find(function(K){return K.name=="GetEncoding"}).AllowedValues.Value;if(b===""&&(b=Y[0]),b==="KVP")Y.includes("KVP")&&z.push(A[W].href);else break}else A[W].href&&(b="KVP",z.push(A[W].href))}return z.length===0&&(b="REST",n.ResourceURL.forEach(function(A){A.resourceType==="tile"&&(l=A.format,z.push(A.template))})),{urls:z,layer:t.layer,matrixSet:o,format:l,projection:d,requestEncoding:b,tileGrid:N,style:h,dimensions:c,wrapX:_,crossOrigin:t.crossOrigin}}class Hm{drawCustom(t,e,n,s,r){}drawGeometry(t){}setStyle(t){}drawCircle(t,e,n){}drawFeature(t,e,n){}drawGeometryCollection(t,e,n){}drawLineString(t,e,n){}drawMultiLineString(t,e,n){}drawMultiPoint(t,e,n){}drawMultiPolygon(t,e,n){}drawPoint(t,e,n){}drawPolygon(t,e,n){}drawText(t,e,n){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}const rt={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},La=[rt.FILL],Yn=[rt.STROKE],Ps=[rt.BEGIN_PATH],bg=[rt.CLOSE_PATH];class da extends Hm{constructor(t,e,n,s){super(),this.tolerance=t,this.maxExtent=e,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 e=this.pixelRatio;return e==1?t:t.map(function(n){return n*e})}appendFlatPointCoordinates(t,e){const n=this.getBufferedMaxExtent(),s=this.tmpCoordinate_,r=this.coordinates;let o=r.length;for(let a=0,l=t.length;a<l;a+=e)s[0]=t[a],s[1]=t[a+1],Ir(n,s)&&(r[o++]=s[0],r[o++]=s[1]);return o}appendFlatLineCoordinates(t,e,n,s,r,o){const a=this.coordinates;let l=a.length;const h=this.getBufferedMaxExtent();o&&(e+=s);let c=t[e],u=t[e+1];const f=this.tmpCoordinate_;let d=!0,g,_,m;for(g=e+s;g<n;g+=s)f[0]=t[g],f[1]=t[g+1],m=Ic(h,f),m!==_?(d&&(a[l++]=c,a[l++]=u,d=!1),a[l++]=f[0],a[l++]=f[1]):m===fe.INTERSECTING?(a[l++]=f[0],a[l++]=f[1],d=!1):d=!0,c=f[0],u=f[1],_=m;return(r&&d||g===e+s)&&(a[l++]=c,a[l++]=u),l}drawCustomCoordinates_(t,e,n,s,r){for(let o=0,a=n.length;o<a;++o){const l=n[o],h=this.appendFlatLineCoordinates(t,e,l,s,!1,!1);r.push(h),e=l}return e}drawCustom(t,e,n,s,r){this.beginGeometry(t,e,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([rt.CUSTOM,l,f,t,n,Dc,r]),this.hitDetectionInstructions.push([rt.CUSTOM,l,f,t,s||n,Dc,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([rt.CUSTOM,l,u,t,n,Bo,r]),this.hitDetectionInstructions.push([rt.CUSTOM,l,u,t,s||n,Bo,r]);break;case"LineString":case"Circle":h=t.getFlatCoordinates(),c=this.appendFlatLineCoordinates(h,0,h.length,a,!1,!1),this.instructions.push([rt.CUSTOM,l,c,t,n,Xn,r]),this.hitDetectionInstructions.push([rt.CUSTOM,l,c,t,s||n,Xn,r]);break;case"MultiPoint":h=t.getFlatCoordinates(),c=this.appendFlatPointCoordinates(h,a),c>l&&(this.instructions.push([rt.CUSTOM,l,c,t,n,Xn,r]),this.hitDetectionInstructions.push([rt.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([rt.CUSTOM,l,c,t,n,void 0,r]),this.hitDetectionInstructions.push([rt.CUSTOM,l,c,t,s||n,void 0,r]);break}this.endGeometry(e)}beginGeometry(t,e,n){this.beginGeometryInstruction1_=[rt.BEGIN_GEOMETRY,e,0,t,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[rt.BEGIN_GEOMETRY,e,0,t,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const n=t.length;let s,r,o=-1;for(e=0;e<n;++e)s=t[e],r=s[0],r==rt.END_GEOMETRY?o=e:r==rt.BEGIN_GEOMETRY&&(s[2]=e,Uy(this.hitDetectionInstructions,o,e),o=-1)}fillStyleToState(t,e={}){if(t){const n=t.getColor();e.fillPatternScale=n&&typeof n=="object"&&"src"in n?this.pixelRatio:1,e.fillStyle=Vi(n||Ye)}else e.fillStyle=void 0;return e}strokeStyleToState(t,e={}){if(t){const n=t.getColor();e.strokeStyle=Vi(n||Uo);const s=t.getLineCap();e.lineCap=s!==void 0?s:Lr;const r=t.getLineDash();e.lineDash=r?r.slice():xn;const o=t.getLineDashOffset();e.lineDashOffset=o||En;const a=t.getLineJoin();e.lineJoin=a!==void 0?a:Or;const l=t.getWidth();e.lineWidth=l!==void 0?l:Xo;const h=t.getMiterLimit();e.miterLimit=h!==void 0?h:Wo,e.lineWidth>this.maxLineWidth&&(this.maxLineWidth=e.lineWidth,this.bufferedMaxExtent_=null)}else e.strokeStyle=void 0,e.lineCap=void 0,e.lineDash=null,e.lineDashOffset=void 0,e.lineJoin=void 0,e.lineWidth=void 0,e.miterLimit=void 0;return e}setFillStrokeStyle(t,e){const n=this.state;this.fillStyleToState(t,n),this.strokeStyleToState(e,n)}createFill(t){const e=t.fillStyle,n=[rt.SET_FILL_STYLE,e];return typeof e!="string"&&n.push(t.fillPatternScale),n}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[rt.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,e){const n=t.fillStyle;(typeof n!="string"||t.currentFillStyle!=n)&&(this.instructions.push(e.call(this,t)),t.currentFillStyle=n)}updateStrokeStyle(t,e){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&&!Pn(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=l||t.currentMiterLimit!=h)&&(e.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 e=[rt.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=n0(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;As(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class vT extends da{constructor(t,e,n,s){super(t,e,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,e,n){if(!this.image_||this.maxExtent&&!Ir(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,n);const s=t.getFlatCoordinates(),r=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(s,r);this.instructions.push([rt.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([rt.DRAW_IMAGE,o,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,n){if(!this.image_)return;this.beginGeometry(t,e,n);const 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([rt.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([rt.DRAW_IMAGE,o,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}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,e){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_=e}}class xT extends da{constructor(t,e,n,s){super(t,e,n,s)}drawFlatCoordinates_(t,e,n,s){const r=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,n,s,!1,!1),a=[rt.MOVE_TO_LINE_TO,r,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),n}drawLineString(t,e,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,e,n),this.hitDetectionInstructions.push([rt.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,xn,En],Ps);const a=t.getFlatCoordinates(),l=t.getStride();this.drawFlatCoordinates_(a,0,a.length,l),this.hitDetectionInstructions.push(Yn),this.endGeometry(e)}drawMultiLineString(t,e,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,e,n),this.hitDetectionInstructions.push([rt.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,xn,En],Ps);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(e)}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(Ps)}}class Ag extends da{constructor(t,e,n,s){super(t,e,n,s)}drawFlatCoordinatess_(t,e,n,s){const r=this.state,o=r.fillStyle!==void 0,a=r.strokeStyle!==void 0,l=n.length;this.instructions.push(Ps),this.hitDetectionInstructions.push(Ps);for(let h=0;h<l;++h){const c=n[h],u=this.coordinates.length,f=this.appendFlatLineCoordinates(t,e,c,s,!0,!a),d=[rt.MOVE_TO_LINE_TO,u,f];this.instructions.push(d),this.hitDetectionInstructions.push(d),a&&(this.instructions.push(bg),this.hitDetectionInstructions.push(bg)),e=c}return o&&(this.instructions.push(La),this.hitDetectionInstructions.push(La)),a&&(this.instructions.push(Yn),this.hitDetectionInstructions.push(Yn)),e}drawCircle(t,e,n){const s=this.state,r=s.fillStyle,o=s.strokeStyle;if(r===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),s.fillStyle!==void 0&&this.hitDetectionInstructions.push([rt.SET_FILL_STYLE,Ye]),s.strokeStyle!==void 0&&this.hitDetectionInstructions.push([rt.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,xn,En]);const a=t.getFlatCoordinates(),l=t.getStride(),h=this.coordinates.length;this.appendFlatLineCoordinates(a,0,a.length,l,!1,!1);const c=[rt.CIRCLE,h];this.instructions.push(Ps,c),this.hitDetectionInstructions.push(Ps,c),s.fillStyle!==void 0&&(this.instructions.push(La),this.hitDetectionInstructions.push(La)),s.strokeStyle!==void 0&&(this.instructions.push(Yn),this.hitDetectionInstructions.push(Yn)),this.endGeometry(e)}drawPolygon(t,e,n){const s=this.state,r=s.fillStyle,o=s.strokeStyle;if(r===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),s.fillStyle!==void 0&&this.hitDetectionInstructions.push([rt.SET_FILL_STYLE,Ye]),s.strokeStyle!==void 0&&this.hitDetectionInstructions.push([rt.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,xn,En]);const a=t.getEnds(),l=t.getOrientedFlatCoordinates(),h=t.getStride();this.drawFlatCoordinatess_(l,0,a,h),this.endGeometry(e)}drawMultiPolygon(t,e,n){const s=this.state,r=s.fillStyle,o=s.strokeStyle;if(r===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),s.fillStyle!==void 0&&this.hitDetectionInstructions.push([rt.SET_FILL_STYLE,Ye]),s.strokeStyle!==void 0&&this.hitDetectionInstructions.push([rt.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,xn,En]);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(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(t!==0){const e=this.coordinates;for(let n=0,s=e.length;n<s;++n)e[n]=Ss(e[n],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;this.updateFillStyle(t,this.createFill),this.updateStrokeStyle(t,this.applyStroke)}}function ET(i,t,e,n,s){const r=[];let o=e,a=0,l=t.slice(e,2);for(;a<i&&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>=i){const g=(i-a+d)/d,_=oi(h,u,g),m=oi(c,f,g);l.push(_,m),r.push(l),l=[_,m],a==i&&(o+=s),a=0}else if(a<i)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 ST(i,t,e,n,s){let r=e,o=e,a=0,l=0,h=e,c,u,f,d,g,_,m,p,y,E;for(u=e;u<n;u+=s){const x=t[u],S=t[u+1];g!==void 0&&(y=x-g,E=S-_,d=Math.sqrt(y*y+E*E),m!==void 0&&(l+=f,c=Math.acos((m*y+p*E)/(f*d)),c>i&&(l>a&&(a=l,r=h,o=u),l=0,h=u-s)),f=d,m=y,p=E),g=x,_=S}return l+=d,l>a?[h,u]:[r,o]}const Fl={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class MT extends da{constructor(t,e,n,s){super(t,e,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,e,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,e,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=ET(d*this.resolution,c,_,f[m],u):y=[c.slice(_,f[m])];for(let E=0,x=y.length;E<x;++E){const S=y[E];let w=0,I=S.length;if(g==null){const C=ST(o.maxAngle,S,0,S.length,2);w=C[0],I=C[1]}for(let C=w;C<I;C+=u)a.push(S[C],S[C+1]);const P=a.length;_=f[m],this.drawChars_(l,P),l=P}}this.endGeometry(e)}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 x=t.getFlatInteriorPoints();c=[];for(let S=0,w=x.length;S<w;S+=3)o.overflow||f.push(x[S+2]/this.resolution),c.push(x[S],x[S+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 x=l/2;f=f.filter((S,w)=>{const I=a[(x+w)*2]===c[w*u]&&a[(x+w)*2+1]===c[w*u+1];return I||--x,I})}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,e,n);let m=o.padding;if(m!=Is&&(o.scale[0]<0||o.scale[1]<0)){let x=o.padding[0],S=o.padding[1],w=o.padding[2],I=o.padding[3];o.scale[0]<0&&(S=-S,I=-I),o.scale[1]<0&&(x=-x,w=-w),m=[x,S,w,I]}const p=this.pixelRatio;this.instructions.push([rt.DRAW_IMAGE,l,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,m==Is?Is:m.map(function(x){return x*p}),g,_,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,f]);const y=1/p,E=g?g.slice(0):null;E&&(E[1]=Ye),this.hitDetectionInstructions.push([rt.DRAW_IMAGE,l,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[y,y],NaN,this.declutterMode_,this.declutterImageWithText_,m,E,_,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Ye:this.fillKey_,this.textOffsetX_,this.textOffsetY_,f]),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=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:e.font,textAlign:e.textAlign||Vo,justify:e.justify,textBaseline:e.textBaseline||vl,scale:e.scale});const o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))}drawChars_(t,e){const n=this.textStrokeState_,s=this.textState_,r=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,h=Fl[s.textBaseline],c=this.textOffsetY_*l,u=this.text_,f=n?n.lineWidth*Math.abs(s.scale[0])/2:0;this.instructions.push([rt.DRAW_CHARS,t,e,h,s.overflow,a,s.maxAngle,l,c,r,f*l,u,o,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([rt.DRAW_CHARS,t,e,h,s.overflow,a&&Ye,s.maxAngle,l,c,r,f*l,u,o,1/l,this.declutterMode_,this.textKeepUpright_])}setTextStyle(t,e){let n,s,r;if(!t)this.text_="";else{const o=t.getFill();o?(s=this.textFillState_,s||(s={},this.textFillState_=s),s.fillStyle=Vi(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():xn,r.lineDashOffset=m===void 0?En:m,r.lineJoin=a.getLineJoin()||Or,r.lineWidth=p===void 0?Xo:p,r.miterLimit=y===void 0?Wo:y,r.strokeStyle=Vi(a.getColor()||Uo)}n=this.textState_;const l=t.getFont()||H0;tS(l);const h=t.getScaleArray();n.overflow=t.getOverflow(),n.font=l,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.repeat=t.getRepeat(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||vl,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||Is,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:ct(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:"|"+ct(s.fillStyle):""}this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const wT={Circle:Ag,Default:da,Image:vT,LineString:xT,Polygon:Ag,Text:MT};class CT{constructor(t,e,n,s){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=s,this.resolution_=n,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const n=this.buildersByZIndex_[e];for(const s in n){const r=n[s].finish();t[e][s]=r}}return t}getBuilder(t,e){const n=t!==void 0?t.toString():"0";let s=this.buildersByZIndex_[n];s===void 0&&(s={},this.buildersByZIndex_[n]=s);let r=s[e];if(r===void 0){const o=wT[e];r=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),s[e]=r}return r}}function TT(i,t,e,n,s,r,o,a,l,h,c,u,f=!0){let d=i[t],g=i[t+1],_=0,m=0,p=0,y=0;function E(){_=d,m=g,t+=n,d=i[t],g=i[t+1],y+=p,p=Math.sqrt((d-_)*(d-_)+(g-m)*(g-m))}do E();while(t<e-n&&y+p<r);let x=p===0?0:(r-y)/p;const S=oi(_,d,x),w=oi(m,g,x),I=t-n,P=y,C=r+a*l(h,s,c);for(;t<e-n&&y+p<C;)E();x=p===0?0:(C-y)/p;const N=oi(_,d,x),z=oi(m,g,x);let b=!1;if(f)if(u){const Y=[S,w,N,z];ku(Y,0,4,2,u,Y,Y),b=Y[0]>Y[2]}else b=S>N;const A=Math.PI,W=[],Q=I+n===t;t=I,p=0,y=P,d=i[t],g=i[t+1];let q;if(Q){E(),q=Math.atan2(g-m,d-_),b&&(q+=q>0?-A:A);const Y=(N+S)/2,K=(z+w)/2;return W[0]=[Y,K,(C-r)/2,q,s],W}s=s.replace(/\n/g," ");for(let Y=0,K=s.length;Y<K;){E();let ot=Math.atan2(g-m,d-_);if(b&&(ot+=ot>0?-A:A),q!==void 0){let zt=ot-q;if(zt+=zt>A?-2*A:zt<-A?2*A:0,Math.abs(zt)>o)return null}q=ot;const ft=Y;let pt=0;for(;Y<K;++Y){const zt=b?K-Y-1:Y,Jt=a*l(h,s[zt],c);if(t+n<e&&y+p<r+pt+Jt/2)break;pt+=Jt}if(Y===ft)continue;const j=b?s.substring(K-ft,K-Y):s.substring(ft,Y);x=p===0?0:(r+pt/2-y)/p;const Zt=oi(_,d,x),re=oi(m,g,x);W.push([Zt,re,pt/2,ot,j]),r+=pt}return W}const Zs=ti(),kn=[],sn=[],rn=[],jn=[];function Lg(i){return i[3].declutterBox}const Og=new RegExp("[֑-ࣿיִ-﷿ﹰ-ﻼࠀ--]");function ac(i,t){return t==="start"?t=Og.test(i)?"right":"left":t==="end"&&(t=Og.test(i)?"left":"right"),Fl[t]}function RT(i,t,e){return e>0&&i.push(`
|
|
9
|
+
`,""),i.push(t,""),i}function IT(i,t,e){return e%2===0&&(i+=t),i}class PT{constructor(t,e,n,s,r){this.overlaps=n,this.pixelRatio=e,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 Ym:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,n,s){const r=t+e+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[e],h=this.pixelRatio,c=[l.scale[0]*h,l.scale[1]*h],u=l.justify?Fl[l.justify]:ac(Array.isArray(t)?t[0]:t,l.textAlign||Vo),f=s&&o.lineWidth?o.lineWidth:0,d=Array.isArray(t)?t:String(t).split(`
|
|
10
|
+
`).reduce(RT,[]),{width:g,height:_,widths:m,heights:p,lineWidths:y}=iS(l,d),E=g+f,x=[],S=(E+2)*c[0],w=(_+f)*c[1],I={width:S<0?Math.floor(S):Math.ceil(S),height:w<0?Math.floor(w):Math.ceil(w),contextInstructions:x};(c[0]!=1||c[1]!=1)&&x.push("scale",c),s&&(x.push("strokeStyle",o.strokeStyle),x.push("lineWidth",f),x.push("lineCap",o.lineCap),x.push("lineJoin",o.lineJoin),x.push("miterLimit",o.miterLimit),x.push("setLineDash",[o.lineDash]),x.push("lineDashOffset",o.lineDashOffset)),n&&x.push("fillStyle",a.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");const P=.5-u;let C=u*E+P*f;const N=[],z=[];let b=0,A=0,W=0,Q=0,q;for(let Y=0,K=d.length;Y<K;Y+=2){const ot=d[Y];if(ot===`
|
|
11
|
+
`){A+=b,b=0,C=u*E+P*f,++Q;continue}const ft=d[Y+1]||l.font;ft!==q&&(s&&N.push("font",ft),n&&z.push("font",ft),q=ft),b=Math.max(b,p[W]);const pt=[ot,C+P*m[W]+u*(m[W]-y[Q]),.5*(f+b)+A];C+=m[W],s&&N.push("strokeText",pt),n&&z.push("fillText",pt),++W}return Array.prototype.push.apply(x,N),Array.prototype.push.apply(x,z),this.labels_[r]=I,I}replayTextBackground_(t,e,n,s,r,o,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,s),t.lineTo.apply(t,r),t.lineTo.apply(t,e),o&&(this.alignAndScaleFill_=o[2],t.fillStyle=o[1],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())}calculateImageOrLabelDimensions_(t,e,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 E=r+h>t?t-h:r,x=o+c>e?e-c:o,S=g[3]+E*f[0]+g[1],w=g[0]+x*f[1]+g[2],I=p-g[3],P=y-g[0];(_||u!==0)&&(kn[0]=I,jn[0]=I,kn[1]=P,sn[1]=P,sn[0]=I+S,rn[0]=sn[0],rn[1]=P+w,jn[1]=rn[1]);let C;return u!==0?(C=Tn(bi(),n,s,1,1,u,-n,-s),de(C,kn),de(C,sn),de(C,rn),de(C,jn),Ki(Math.min(kn[0],sn[0],rn[0],jn[0]),Math.min(kn[1],sn[1],rn[1],jn[1]),Math.max(kn[0],sn[0],rn[0],jn[0]),Math.max(kn[1],sn[1],rn[1],jn[1]),Zs)):Ki(Math.min(I,I+S),Math.min(P,P+w),Math.max(I,I+S),Math.max(P,P+w),Zs),d&&(p=Math.round(p),y=Math.round(y)),{drawImageX:p,drawImageY:y,drawImageW:E,drawImageH:x,originX:h,originY:c,declutterBox:{minX:Zs[0],minY:Zs[1],maxX:Zs[2],maxY:Zs[3],value:m},canvasTransform:C,scale:f}}replayImageOrLabel_(t,e,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<=e[0]&&h.maxX+c>=0&&h.minY-c<=e[1]&&h.maxY+c>=0&&(l&&this.replayTextBackground_(t,kn,sn,rn,jn,o,a),nS(t,s.canvasTransform,r,n,s.originX,s.originY,s.drawImageW,s.drawImageH,s.drawImageX,s.drawImageY,s.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const n=de(this.renderedTransform_,[0,0]),s=512*this.pixelRatio;t.save(),t.translate(n[0]%s,n[1]%s),e!==1&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],e[1]&&(t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6]))}drawLabelWithPointPlacement_(t,e,n,s){const r=this.textStates[e],o=this.createLabel(t,e,s,n),a=this.strokeStates[n],l=this.pixelRatio,h=ac(Array.isArray(t)?t[0]:t,r.textAlign||Vo),c=Fl[r.textBaseline||vl],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,e,n,s,r,o,a,l){const h=this.zIndexContext_;let c;this.pixelCoordinates_&&Pn(n,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=es(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),Gv(this.renderedTransform_,n));let u=0;const f=s.length;let d=0,g,_,m,p,y,E,x,S,w,I,P,C,N,z=0,b=0;const A=this.coordinateCache_,W=this.viewRotation_,Q=Math.round(Math.atan2(-n[1],n[0])*1e12)/1e12,q={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:W},Y=this.instructions!=s||this.overlaps?0:200;let K,ot,ft,pt;for(;u<f;){const j=s[u];switch(j[0]){case rt.BEGIN_GEOMETRY:K=j[1],pt=j[3],K.getGeometry()?a!==void 0&&!Fe(a,pt.getExtent())?u=j[2]+1:++u:u=j[2],h&&(h.zIndex=j[4]);break;case rt.BEGIN_PATH:z>Y&&(this.fill_(t),z=0),b>Y&&(t.stroke(),b=0),!z&&!b&&(t.beginPath(),y=NaN,E=NaN),++u;break;case rt.CIRCLE:d=j[1];const re=c[d],zt=c[d+1],Jt=c[d+2],qt=c[d+3],ue=Jt-re,R=qt-zt,D=Math.sqrt(ue*ue+R*R);t.moveTo(re+D,zt),t.arc(re,zt,D,0,2*Math.PI,!0),++u;break;case rt.CLOSE_PATH:t.closePath(),++u;break;case rt.CUSTOM:d=j[1],g=j[2];const H=j[3],v=j[4],M=j[5];q.geometry=H,q.feature=K,u in A||(A[u]=[]);const T=A[u];M?M(c,d,g,2,T):(T[0]=c[d],T[1]=c[d+1],T.length=2),h&&(h.zIndex=j[6]),v(T,q),++u;break;case rt.DRAW_IMAGE:d=j[1],g=j[2],w=j[3],_=j[4],m=j[5];let G=j[6];const L=j[7],O=j[8],U=j[9],X=j[10];let V=j[11];const k=j[12];let et=j[13];p=j[14]||"declutter";const $=j[15];if(!w&&j.length>=20){I=j[19],P=j[20],C=j[21],N=j[22];const ci=this.drawLabelWithPointPlacement_(I,P,C,N);w=ci.label,j[3]=w;const gs=j[23];_=(ci.anchorX-gs)*this.pixelRatio,j[4]=_;const ui=j[24];m=(ci.anchorY-ui)*this.pixelRatio,j[5]=m,G=w.height,j[6]=G,et=w.width,j[13]=et}let it;j.length>25&&(it=j[25]);let at,yt,Ct;j.length>17?(at=j[16],yt=j[17],Ct=j[18]):(at=Is,yt=null,Ct=null),X&&Q?V+=W:!X&&!Q&&(V-=W);let Tt=0;for(;d<g;d+=2){if(it&&it[Tt++]<et/this.pixelRatio)continue;const ci=this.calculateImageOrLabelDimensions_(w.width,w.height,c[d],c[d+1],et,G,_,m,O,U,V,k,r,at,!!yt||!!Ct,K),gs=[t,e,w,ci,L,yt,Ct];if(l){let ui,Ni,fi;if($){const Qt=g-d;if(!$[Qt]){$[Qt]={args:gs,declutterMode:p};continue}const Ge=$[Qt];ui=Ge.args,Ni=Ge.declutterMode,delete $[Qt],fi=Lg(ui)}let Ji,Qi;if(ui&&(Ni!=="declutter"||!l.collides(fi))&&(Ji=!0),(p!=="declutter"||!l.collides(ci.declutterBox))&&(Qi=!0),Ni==="declutter"&&p==="declutter"){const Qt=Ji&&Qi;Ji=Qt,Qi=Qt}Ji&&(Ni!=="none"&&l.insert(fi),this.replayImageOrLabel_.apply(this,ui)),Qi&&(p!=="none"&&l.insert(ci.declutterBox),this.replayImageOrLabel_.apply(this,gs))}else this.replayImageOrLabel_.apply(this,gs)}++u;break;case rt.DRAW_CHARS:const ve=j[1],xe=j[2],Ue=j[3],hi=j[4];N=j[5];const ds=j[6],Vr=j[7],Ce=j[8];C=j[9];const Ve=j[10];I=j[11],Array.isArray(I)&&(I=I.reduce(IT,"")),P=j[12];const Xr=[j[13],j[13]];p=j[14]||"declutter";const ga=j[15],xh=this.textStates[P],$r=xh.font,Kr=[xh.scale[0]*Vr,xh.scale[1]*Vr];let Yr;$r in this.widths_?Yr=this.widths_[$r]:(Yr={},this.widths_[$r]=Yr);const Lf=Tf(c,ve,xe,2),Of=Math.abs(Kr[0])*$d($r,I,Yr);if(hi||Of<=Lf){const ci=this.textStates[P].textAlign,gs=(Lf-Of)*ac(I,ci),ui=TT(c,ve,xe,2,I,gs,ds,Math.abs(Kr[0]),$d,$r,Yr,Q?0:this.viewRotation_,ga);t:if(ui){const Ni=[];let fi,Ji,Qi,Qt,Ge;if(C)for(fi=0,Ji=ui.length;fi<Ji;++fi){Ge=ui[fi],Qi=Ge[4],Qt=this.createLabel(Qi,P,"",C),_=Ge[2]+(Kr[0]<0?-Ve:Ve),m=Ue*Qt.height+(.5-Ue)*2*Ve*Kr[1]/Kr[0]-Ce;const tn=this.calculateImageOrLabelDimensions_(Qt.width,Qt.height,Ge[0],Ge[1],Qt.width,Qt.height,_,m,0,0,Ge[3],Xr,!1,Is,!1,K);if(l&&p==="declutter"&&l.collides(tn.declutterBox))break t;Ni.push([t,e,Qt,tn,1,null,null])}if(N)for(fi=0,Ji=ui.length;fi<Ji;++fi){Ge=ui[fi],Qi=Ge[4],Qt=this.createLabel(Qi,P,N,""),_=Ge[2],m=Ue*Qt.height-Ce;const tn=this.calculateImageOrLabelDimensions_(Qt.width,Qt.height,Ge[0],Ge[1],Qt.width,Qt.height,_,m,0,0,Ge[3],Xr,!1,Is,!1,K);if(l&&p==="declutter"&&l.collides(tn.declutterBox))break t;Ni.push([t,e,Qt,tn,1,null,null])}l&&p!=="none"&&l.load(Ni.map(Lg));for(let tn=0,d1=Ni.length;tn<d1;++tn)this.replayImageOrLabel_.apply(this,Ni[tn])}}++u;break;case rt.END_GEOMETRY:if(o!==void 0){K=j[1];const ci=o(K,pt,p);if(ci)return ci}++u;break;case rt.FILL:Y?z++:this.fill_(t),++u;break;case rt.MOVE_TO_LINE_TO:for(d=j[1],g=j[2],ot=c[d],ft=c[d+1],t.moveTo(ot,ft),y=ot+.5|0,E=ft+.5|0,d+=2;d<g;d+=2)ot=c[d],ft=c[d+1],x=ot+.5|0,S=ft+.5|0,(d==g-2||x!==y||S!==E)&&(t.lineTo(ot,ft),y=x,E=S);++u;break;case rt.SET_FILL_STYLE:this.alignAndScaleFill_=j[2],z&&(this.fill_(t),z=0,b&&(t.stroke(),b=0)),t.fillStyle=j[1],++u;break;case rt.SET_STROKE_STYLE:b&&(t.stroke(),b=0),this.setStrokeStyle_(t,j),++u;break;case rt.STROKE:Y?b++:t.stroke(),++u;break;default:++u;break}}z&&this.fill_(t),b&&t.stroke()}execute(t,e,n,s,r,o){this.viewRotation_=s,this.execute_(t,e,n,this.instructions,r,void 0,void 0,o)}executeHitDetection(t,e,n,s,r){return this.viewRotation_=n,this.execute_(t,[t.canvas.width,t.canvas.height],e,this.hitDetectionInstructions,!0,s,r)}}const Cs=["Polygon","Circle","LineString","Image","Text","Default"],Zm=["Image","Text"],bT=Cs.filter(i=>!Zm.includes(i));class AT{constructor(t,e,n,s,r,o,a){this.maxExtent_=t,this.overlaps_=s,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=bi(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(r,a)}clip(t,e){const n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()}createExecutors_(t,e){for(const n in t){let 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 PT(this.resolution_,this.pixelRatio_,this.overlaps_,a,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const n=this.executorsByZIndex_[e];for(let s=0,r=t.length;s<r;++s)if(t[s]in n)return!0}return!1}forEachFeatureAtCoordinate(t,e,n,s,r,o){s=Math.round(s);const a=s*2+1,l=Tn(this.hitDetectionTransform_,s+.5,s+.5,1/e,-1/e,-n,-t[0],-t[1]),h=!this.hitDetectionContext_;h&&(this.hitDetectionContext_=ce(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),As(u,e*(this.renderBuffer_+s),u));const f=LT(s);let d;function g(S,w,I){const P=c.getImageData(0,0,a,a).data;for(let C=0,N=f.length;C<N;C++)if(P[f[C]]>0){if(!o||I==="none"||d!=="Image"&&d!=="Text"||o.includes(S)){const z=(f[C]-3)/4,b=s-z%a,A=s-(z/a|0),W=r(S,w,b*b+A*A);if(W)return W}c.clearRect(0,0,a,a);break}}const _=Object.keys(this.executorsByZIndex_).map(Number);_.sort(_n);let m,p,y,E,x;for(m=_.length-1;m>=0;--m){const S=_[m].toString();for(y=this.executorsByZIndex_[S],p=Cs.length-1;p>=0;--p)if(d=Cs[p],E=y[d],E!==void 0&&(x=E.executeHitDetection(c,l,n,g,u),x))return x}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const n=e[0],s=e[1],r=e[2],o=e[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,e,n,s,r,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(a?Wy:_n),o=o||Cs;const h=Cs.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(),E=y?y.getContext():t,x=this.maxExtent_&&m!=="Image"&&m!=="Text";if(x&&(E.save(),this.clip(E,n)),!y||m==="Text"||m==="Image"?p.execute(E,e,n,s,r,a):y.pushFunction(S=>p.execute(S,e,n,s,r,a)),x&&E.restore(),y){y.offset();const S=l[c]*h+Cs.indexOf(m);this.deferredZIndexContexts_[S]||(this.deferredZIndexContexts_[S]=[]),this.deferredZIndexContexts_[S].push(y)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(_n);for(let n=0,s=e.length;n<s;++n)t[e[n]].forEach(r=>{r.draw(this.renderedContext_),r.clear()}),t[e[n]].length=0}}const lc={};function LT(i){if(lc[i]!==void 0)return lc[i];const t=i*2+1,e=i*i,n=new Array(e+1);for(let r=0;r<=i;++r)for(let o=0;o<=i;++o){const a=r*r+o*o;if(a>e)break;let l=n[a];l||(l=[],n[a]=l),l.push(((i+r)*t+(i+o))*4+3),r>0&&l.push(((i-r)*t+(i+o))*4+3),o>0&&(l.push(((i+r)*t+(i-o))*4+3),r>0&&l.push(((i-r)*t+(i-o))*4+3))}const s=[];for(let r=0,o=n.length;r<o;++r)n[r]&&s.push(...n[r]);return lc[i]=s,s}class OT extends Hm{constructor(t,e,n,s,r,o,a){super(),this.context_=t,this.pixelRatio_=e,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,e,n,s){if(!this.image_)return;const r=es(t,e,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_;Tn(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,e,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,e,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_);e<n;e+=s){const l=r[e]+this.textOffsetX_,h=r[e+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,e,n,s,r){const o=this.context_,a=es(t,e,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,e,n,s){for(let r=0,o=n.length;r<o;++r)e=this.moveToLineTo_(t,e,n[r],s,!0);return e}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 e=Xv(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],s=e[3]-e[1],r=Math.sqrt(n*n+s*s),o=this.context_;o.beginPath(),o.arc(e[0],e[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,e){const n=e.getGeometryFunction()(t);n&&(this.setStyle(e),this.drawGeometry(n))}drawGeometryCollection(t){const e=t.getGeometriesArray();for(let n=0,s=e.length;n<s;++n)this.drawGeometry(e[n])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),this.text_!==""&&this.drawText_(e,0,e.length,n)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),this.text_!==""&&this.drawText_(e,0,e.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 e=this.context_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),e.stroke()}if(this.text_!==""){const e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}}}drawMultiLineString(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getExtent();if(Fe(this.extent_,e)){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 e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoint();this.drawText_(e,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 e=this.context_,n=t.getOrientedFlatCoordinates();let s=0;const r=t.getEndss(),o=t.getStride();e.beginPath();for(let a=0,l=r.length;a<l;++a){const h=r[a];s=this.drawRings_(n,s,h,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoints();this.drawText_(e,0,e.length,2)}}}setContextFillState_(t){const e=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){const e=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),Pn(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset,e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.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 e=this.context_,n=this.contextTextState_,s=t.textAlign?t.textAlign:Vo;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=s&&(n.textAlign=s,e.textAlign=s),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=s,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:s,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(!t)this.fillState_=null;else{const n=t.getColor();this.fillState_={fillStyle:Vi(n||Ye)}}if(!e)this.strokeState_=null;else{const n=e.getColor(),s=e.getLineCap(),r=e.getLineDash(),o=e.getLineDashOffset(),a=e.getLineJoin(),l=e.getWidth(),h=e.getMiterLimit(),c=r||xn;this.strokeState_={lineCap:s!==void 0?s:Lr,lineDash:this.pixelRatio_===1?c:c.map(u=>u*this.pixelRatio_),lineDashOffset:(o||En)*this.pixelRatio_,lineJoin:a!==void 0?a:Or,lineWidth:(l!==void 0?l:Xo)*this.pixelRatio_,miterLimit:h!==void 0?h:Wo,strokeStyle:Vi(n||Uo)}}}setImageStyle(t){let e;if(!t||!(e=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_=e[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_=e[0]*n}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const d=e.getColor();this.textFillState_={fillStyle:Vi(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(),E=n.getMiterLimit();this.textStrokeState_={lineCap:g!==void 0?g:Lr,lineDash:_||xn,lineDashOffset:m||En,lineJoin:p!==void 0?p:Or,lineWidth:y!==void 0?y:Xo,miterLimit:E!==void 0?E:Wo,strokeStyle:Vi(d||Uo)}}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:H0,textAlign:u!==void 0?u:Vo,textBaseline:f!==void 0?f:vl},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 Ui=.5;function FT(i,t,e,n,s,r,o,a,l){const h=s,c=i[0]*Ui,u=i[1]*Ui,f=ce(c,u);f.imageSmoothingEnabled=!1;const d=f.canvas,g=new OT(f,Ui,s,null,o,a,null),_=e.length,m=Math.floor((256*256*256-1)/_),p={};for(let E=1;E<=_;++E){const x=e[E-1],S=x.getStyleFunction()||n;if(!S)continue;let w=S(x,r);if(!w)continue;Array.isArray(w)||(w=[w]);const P=(E*m).toString(16).padStart(7,"#00000");for(let C=0,N=w.length;C<N;++C){const z=w[C],b=z.getGeometryFunction()(x);if(!b||!Fe(h,b.getExtent()))continue;const A=z.clone(),W=A.getFill();W&&W.setColor(P);const Q=A.getStroke();Q&&(Q.setColor(P),Q.setLineDash(null)),A.setText(void 0);const q=z.getImage();if(q){const ft=q.getImageSize();if(!ft)continue;const pt=ce(ft[0],ft[1],void 0,{alpha:!1}),j=pt.canvas;pt.fillStyle=P,pt.fillRect(0,0,j.width,j.height),A.setImage(new fh({img:j,anchor:q.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:q.getOrigin(),opacity:1,size:q.getSize(),scale:q.getScale(),rotation:q.getRotation(),rotateWithView:q.getRotateWithView()}))}const Y=A.getZIndex()||0;let K=p[Y];K||(K={},p[Y]=K,K.Polygon=[],K.Circle=[],K.LineString=[],K.Point=[]);const ot=b.getType();if(ot==="GeometryCollection"){const ft=b.getGeometriesArrayRecursive();for(let pt=0,j=ft.length;pt<j;++pt){const Zt=ft[pt];K[Zt.getType().replace("Multi","")].push(Zt,A)}}else K[ot.replace("Multi","")].push(b,A)}}const y=Object.keys(p).map(Number).sort(_n);for(let E=0,x=y.length;E<x;++E){const S=p[y[E]];for(const w in S){const I=S[w];for(let P=0,C=I.length;P<C;P+=2){g.setStyle(I[P+1]);for(let N=0,z=t.length;N<z;++N)g.setTransform(t[N]),g.drawGeometry(I[P])}}}return f.getImageData(0,0,d.width,d.height)}function GT(i,t,e){const n=[];if(e){const s=Math.floor(Math.round(i[0])*Ui),r=Math.floor(Math.round(i[1])*Ui),o=(Vt(s,0,e.width-1)+Vt(r,0,e.height-1)*e.width)*4,a=e.data[o],l=e.data[o+1],c=e.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 DT=.5,Jm={Point:VT,LineString:zT,Polygon:$T,MultiPoint:XT,MultiLineString:WT,MultiPolygon:UT,GeometryCollection:BT,Circle:kT};function NT(i,t){return parseInt(ct(i),10)-parseInt(ct(t),10)}function Fg(i,t){const e=Qm(i,t);return e*e}function Qm(i,t){return DT*i/t}function kT(i,t,e,n,s){const r=e.getFill(),o=e.getStroke();if(r||o){const l=i.getBuilder(e.getZIndex(),"Circle");l.setFillStrokeStyle(r,o),l.drawCircle(t,n,s)}const a=e.getText();if(a&&a.getText()){const l=i.getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,n)}}function Gg(i,t,e,n,s,r,o,a){const l=[],h=e.getImage();if(h){let f=!0;const d=h.getImageState();d==tt.LOADED||d==tt.ERROR?f=!1:d==tt.IDLE&&h.load(),f&&l.push(h.ready())}const c=e.getFill();c&&c.loading()&&l.push(c.ready());const u=l.length>0;return u&&Promise.all(l).then(()=>s(null)),jT(i,t,e,n,r,o,a),u}function jT(i,t,e,n,s,r,o){const a=e.getGeometryFunction()(t);if(!a)return;const l=a.simplifyTransformed(n,s);if(e.getRenderer())t1(i,l,e,t,o);else{const c=Jm[l.getType()];c(i,l,e,t,o,r)}}function t1(i,t,e,n,s){if(t.getType()=="GeometryCollection"){const o=t.getGeometries();for(let a=0,l=o.length;a<l;++a)t1(i,o[a],e,n,s);return}i.getBuilder(e.getZIndex(),"Default").drawCustom(t,n,e.getRenderer(),e.getHitDetectionRenderer(),s)}function BT(i,t,e,n,s,r){const o=t.getGeometriesArray();let a,l;for(a=0,l=o.length;a<l;++a){const h=Jm[o[a].getType()];h(i,o[a],e,n,s,r)}}function zT(i,t,e,n,s){const r=e.getStroke();if(r){const a=i.getBuilder(e.getZIndex(),"LineString");a.setFillStrokeStyle(null,r),a.drawLineString(t,n,s)}const o=e.getText();if(o&&o.getText()){const a=i.getBuilder(e.getZIndex(),"Text");a.setTextStyle(o),a.drawText(t,n,s)}}function WT(i,t,e,n,s){const r=e.getStroke();if(r){const a=i.getBuilder(e.getZIndex(),"LineString");a.setFillStrokeStyle(null,r),a.drawMultiLineString(t,n,s)}const o=e.getText();if(o&&o.getText()){const a=i.getBuilder(e.getZIndex(),"Text");a.setTextStyle(o),a.drawText(t,n,s)}}function UT(i,t,e,n,s){const r=e.getFill(),o=e.getStroke();if(o||r){const l=i.getBuilder(e.getZIndex(),"Polygon");l.setFillStrokeStyle(r,o),l.drawMultiPolygon(t,n,s)}const a=e.getText();if(a&&a.getText()){const l=i.getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,n,s)}}function VT(i,t,e,n,s,r){const o=e.getImage(),a=e.getText(),l=a&&a.getText(),h=r&&o&&l?{}:void 0;if(o){if(o.getImageState()!=tt.LOADED)return;const c=i.getBuilder(e.getZIndex(),"Image");c.setImageStyle(o,h),c.drawPoint(t,n,s)}if(l){const c=i.getBuilder(e.getZIndex(),"Text");c.setTextStyle(a,h),c.drawText(t,n,s)}}function XT(i,t,e,n,s,r){const o=e.getImage(),a=o&&o.getOpacity()!==0,l=e.getText(),h=l&&l.getText(),c=r&&a&&h?{}:void 0;if(a){if(o.getImageState()!=tt.LOADED)return;const u=i.getBuilder(e.getZIndex(),"Image");u.setImageStyle(o,c),u.drawMultiPoint(t,n,s)}if(h){const u=i.getBuilder(e.getZIndex(),"Text");u.setTextStyle(l,c),u.drawText(t,n,s)}}function $T(i,t,e,n,s){const r=e.getFill(),o=e.getStroke();if(r||o){const l=i.getBuilder(e.getZIndex(),"Polygon");l.setFillStrokeStyle(r,o),l.drawPolygon(t,n,s)}const a=e.getText();if(a&&a.getText()){const l=i.getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,n,s)}}class KT extends qm{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,e,n){const s=e.extent,r=e.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=e.pixelRatio,g=e.viewHints,_=!(g[be.ANIMATING]||g[be.INTERACTING]),m=this.context,p=Math.round(Et(s)/a*d),y=Math.round(_e(s)/a*d),E=u.getWrapX()&&l.canWrapX(),x=E?Et(c):null,S=E?Math.ceil((s[2]-c[2])/x)+1:1;let w=E?Math.floor((s[0]-c[0])/x):0;do{let I=this.getRenderTransform(o,a,0,d,p,y,w*x);e.declutter&&(I=I.slice(0)),t.execute(m,[m.canvas.width,m.canvas.height],I,h,_,n===void 0?Cs:n?Zm:bT,n?f&&e.declutter[f]:void 0)}while(++w<S)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=ce(this.context.canvas.width,this.context.canvas.height,Ig))}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,lh(this.context),Ig.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,e){const n=t.layerStatesArray[t.layerIndex];this.opacity_=n.opacity;const s=t.viewState;this.prepareContainer(t,e);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=gn(n.extent);a=Fe(l,t.extent),this.clipped_=a&&!dn(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(e=>{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]*Ui,f=n[1]*Ui;c.push(this.getRenderTransform(s,r,o,Ui,u,f,0).slice());const d=h.getSource(),g=a.getExtent();if(d.getWrapX()&&a.canWrapX()&&!dn(g,l)){let _=l[0];const m=Et(g);let p=0,y;for(;_<g[0];)--p,y=m*p,c.push(this.getRenderTransform(s,r,o,Ui,u,f,y).slice()),_+=m;for(p=0,_=l[2];_>g[2];)++p,y=m*p,c.push(this.getRenderTransform(s,r,o,Ui,u,f,y).slice()),_-=m}this.hitDetectionImageData_=FT(n,c,this.renderedFeatures_,h.getStyleFunction(),l,r,o,Fg(r,this.renderedPixelRatio_))}e(GT(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,n,s,r){if(!this.replayGroup_)return;const o=e.viewState.resolution,a=e.viewState.rotation,l=this.getLayer(),h={},c=function(f,d,g){const _=ct(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?e.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 e=this.getLayer(),n=e.getSource();if(!n)return!1;const s=t.viewHints[be.ANIMATING],r=t.viewHints[be.INTERACTING],o=e.getUpdateWhileAnimating(),a=e.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=e.getRevision(),g=e.getRenderBuffer();let _=e.getRenderOrder();_===void 0&&(_=NT);const m=h.center.slice(),p=As(l,g*u),y=p.slice(),E=[p.slice()],x=c.getExtent();if(n.getWrapX()&&c.canWrapX()&&!dn(x,t.extent)){const W=Et(x),Q=Math.max(Et(p)/2,W);p[0]=x[0]-Q,p[2]=x[2]+Q,u0(m,c);const q=a0(E[0],c);q[0]<x[0]&&q[2]<x[2]?E.push([q[0]+W,q[1],q[2]+W,q[3]]):q[0]>x[0]&&q[2]>x[2]&&E.push([q[0]-W,q[1],q[2]-W,q[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==d&&this.renderedRenderOrder_==_&&this.renderedFrameDeclutter_===!!t.declutter&&dn(this.wrappedRenderedExtent_,p))return Pn(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const S=new CT(Qm(u,f),p,u,f);let w;for(let W=0,Q=E.length;W<Q;++W)n.loadFeatures(E[W],u,c);const I=Fg(u,f);let P=!0;const C=(W,Q)=>{let q;const Y=W.getStyleFunction()||e.getStyleFunction();if(Y&&(q=Y(W,u)),q){const K=this.renderFeature(W,I,q,S,w,this.getLayer().getDeclutter(),Q);P=P&&!K}},N=nh(p),z=n.getFeaturesInExtent(N);_&&z.sort(_);for(let W=0,Q=z.length;W<Q;++W)C(z[W],W);this.renderedFeatures_=z,this.ready=P;const b=S.finish(),A=new AT(p,u,f,n.getOverlaps(),b,e.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_=A,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,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=Gg(s,t,n[h],e,this.boundHandleStyleImageChange_,r,o,a)||l;else l=Gg(s,t,n,e,this.boundHandleStyleImageChange_,r,o,a);return l}}class vh extends sm{constructor(t){super(t)}createRenderer(){return new KT(this)}}function e1(i,t,e=[]){const n=bn(t),s=vu(new i(n));kr(s,[...lx,...e]);const r=Bt("map"),o=Bt("layerGroup",null),a=Bt("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),ne(()=>n,h,{deep:!0,immediate:!0}),a?.value&&ne(a,()=>{c(),h()}),{layer:s,map:r}}const Dg=le({__name:"OlTileLayer",props:b_({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:{}},Om({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(i,{expose:t}){const e=i,{layer:n}=e1(_T,Wl(e),["change:useInterimTilesOnError","change:preload"]);return Mi("tileLayer",n),t({tileLayer:n}),(s,r)=>(_t(),Yt("div",null,[Hi(s.$slots,"default")]))}}),YT=le({__name:"OlVectorLayer",props:b_({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:{}},Om()),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(i,{expose:t}){const e=i,{layer:n}=e1(vh,e);return Mi("vectorLayer",n),Mi("stylable",n),t({vectorLayer:n}),(s,r)=>(_t(),Yt("div",null,[Hi(s.$slots,"default")]))}});function Rf(i,t,e,n=[],s){function r(){return bn({...e,...e.projection?{projection:Lm(e.projection)}:{}})}const o=vu(new i(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,[...P0,...l(),...n]),o}function l(){const c=o.value;return c instanceof yh?ux:c instanceof Xm?hx:c instanceof rT?cx:[]}function h(){t?.value?.setSource(null)}return wi(h),ne(o,a),ne(()=>t,a),ne(()=>e,a,{deep:!0}),{source:o,updateSource:a,removeSource:h}}const qT=le({inheritAttrs:!1,__name:"OlSourceTileWMS",props:{attributions:{},attributionsCollapsible:{type:Boolean,default:!0},cacheSize:{},crossOrigin:{},interpolate:{type:Boolean,default:!0},params:{},gutter:{},hidpi:{type:Boolean,default:!0},projection:{default:"EPSG:3857"},reprojectionErrorThreshold:{},tileClass:{},tileGrid:{},serverType:{},tileLoadFunction:{},url:{},urls:{},wrapX:{type:Boolean,default:!0},transition:{},zDirection:{},layers:{},styles:{default:""}},emits:["tileloadend","tileloaderror","tileloadstart","change","error","propertychange"],setup(i,{expose:t}){const e=i,n=Bt("tileLayer"),{source:s}=Rf(mT,n,{...e,params:{...e.params,LAYERS:e.layers,STYLES:e.styles},tileGrid:e.tileGrid});return t({layer:n,source:s}),(r,o)=>oe("",!0)}}),HT=le({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(i,{expose:t}){const e=i,n=Bt("vectorLayer",null),s=Bt("heatmapLayer",null),r=Bt("webglVectorLayer",null),o=s||n||r,{source:a,updateSource:l}=Rf(yh,o,e);return ne(()=>e.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}),ne(()=>e.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)=>(_t(),Yt("div",null,[Hi(h.$slots,"default")]))}}),ZT=le({inheritAttrs:!1,__name:"OlSourceWMTS",props:{attributions:{},attributionsCollapsible:{type:Boolean,default:!0},cacheSize:{},crossOrigin:{},interpolate:{type:Boolean,default:!0},projection:{},reprojectionErrorThreshold:{},requestEncoding:{},layer:{},tileClass:{},tilePixelRatio:{},format:{},version:{},matrixSet:{},dimensions:{},url:{},tileLoadFunction:{},urls:{},wrapX:{type:Boolean},transition:{},zDirection:{},tileGrid:{},styles:{},tileZoomLevel:{default:30},tileMatrixPrefix:{default:""}},emits:["tileloadend","tileloaderror","tileloadstart","change","error","propertychange"],setup(i,{expose:t}){const e=i,n=Bt("tileLayer"),s=ae(()=>Kt(e.projection)?.getExtent()),r=ae(()=>s.value?hs(s.value):void 0),o=ae(()=>s.value?Et(s.value)/256:0),a=ae(()=>{if(e.tileGrid)return e.tileGrid;const h=[e.tileZoomLevel],c=[`${e.tileZoomLevel}`];for(let u=0;u<e.tileZoomLevel;++u)h[u]=o.value/Math.pow(2,u),c[u]=e.tileMatrixPrefix+u;return new Dm({origin:r.value,resolutions:h,matrixIds:c})}),{source:l}=Rf(pT,n,{...e,style:e.styles,tileGrid:a.value});return t({tileLayer:n,source:l}),(h,c)=>oe("",!0)}});function i1(i,t){const e=Bt("feature"),n=bn(t),s=ae(()=>{const r=Object.values(n);return new i(...r)});return ne(n,()=>{e?.value?.setGeometry(s.value),e?.value?.changed()}),ne(()=>e,()=>{e?.value?.setGeometry(s.value)}),ei(()=>{e?.value?.setGeometry(s.value)}),wi(()=>{e?.value?.setGeometry(void 0)}),s}const JT=le({__name:"OlGeomPoint",props:{coordinates:{},layout:{default:"XY"}},setup(i,{expose:t}){const n=i1(vn,i);return t({geometry:n}),(s,r)=>oe("",!0)}}),QT=le({__name:"OlGeomPolygon",props:{coordinates:{},layout:{default:"XY"},ends:{}},setup(i,{expose:t}){const n=i1(Fi,i);return t({geometry:n}),(s,r)=>oe("",!0)}});function qn(i,t){const e=i.length;return t<0?i[t+e]:t>=e?i[t-e]:i[t]}function fr(i,t){const e=i.length;let n=Math.floor(t);const s=t-n;n>=e?n-=e:n<0&&(n+=e);let r=n+1;r>=e&&(r-=e);const o=i[n],a=o[0],l=o[1],h=i[r],c=h[0]-a,u=h[1]-l;return[a+c*s,l+u*s]}const Oa={index:-1,endIndex:NaN,closestTargetDistance:1/0};function n1(i,t,e,n){const s=i[0],r=i[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],E=o1(s,r,p,y);E.squaredDistance<g&&(g=E.squaredDistance,_=m+E.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=e.getPixelFromCoordinate(u),d=e.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 _=Da(u,d,g);Da(u,d,g-f)<_&&(l-=f)}else{const _=Da(u,d,g);Da(u,d,g+f)<_&&(l+=f)}}return Oa.index=a,Oa.endIndex=l,Oa.closestTargetDistance=o,Oa}function s1(i,t){const e=[];for(let n=0;n<t.length;++n){const r=t[n].getGeometry();r1(i,r,e)}return e}function r1(i,t,e){if(t instanceof Sn){Fa(i,t.getCoordinates(),!1,e);return}if(t instanceof Jo){const n=t.getCoordinates();for(let s=0,r=n.length;s<r;++s)Fa(i,n[s],!1,e);return}if(t instanceof Fi){const n=t.getCoordinates();for(let s=0,r=n.length;s<r;++s)Fa(i,n[s],!0,e);return}if(t instanceof Qo){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)Fa(i,o[a],!0,e)}return}if(t instanceof Ll){const n=t.getGeometries();for(let s=0;s<n.length;++s)r1(i,n[s],e);return}}function Fa(i,t,e,n){const s=i[0],r=i[1];for(let o=0,a=t.length-1;o<a;++o){const l=t[o],h=t[o+1],c=o1(s,r,l,h);if(c.squaredDistance===0){const u=o+c.along;n.push({coordinates:t,ring:e,startIndex:u,endIndex:u});return}}}function Ga(i,t){return mn(i[0],i[1],t[0],t[1])}function Da(i,t,e){let n,s;t<e?(n=t,s=e):(n=e,s=t);const r=Math.ceil(n),o=Math.floor(s);if(r>o){const l=fr(i,n),h=fr(i,s);return Ga(l,h)}let a=0;if(n<r){const l=fr(i,n),h=qn(i,r);a+=Ga(l,h)}if(o<s){const l=qn(i,o),h=fr(i,s);a+=Ga(l,h)}for(let l=r;l<o-1;++l){const h=qn(i,l),c=qn(i,l+1);a+=Ga(h,c)}return a}const hc={along:0,squaredDistance:0};function o1(i,t,e,n){const s=e[0],r=e[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=Vt(((i-s)*l+(t-r)*h)/(l*l+h*h),0,1),u+=l*c,f+=h*c),hc.along=c,hc.squaredDistance=Nr(mn(i,t,u,f),10),hc}const Na={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class ka extends ii{constructor(t,e){super(t),this.feature=e}}class tR extends us{constructor(t){const e=t;e.stopDown||(e.stopDown=js),super(e),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_=iR(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:Cn,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 mh([NaN,NaN]),h=jt(r[0]),c=pn(h,jt(r[r.length-1]));return l.setCenterAndRadius(h,Math.sqrt(c),this.geometryLayout_),l};else{let r;s==="Point"?r=vn:s==="LineString"?r=Sn: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 vh({source:new yh({useSpatialIndex:!1,wrapX:t.wrapX?t.wrapX:!1}),style:t.style?t.style:eR(),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:pl,this.traceCondition_,this.setTrace(t.trace||!1),this.traceState_={active:!1},this.traceSource_=t.traceSource||t.source||null,this.addChangeListener(zc.ACTIVE,this.updateState_)}setTrace(t){let e;t?t===!0?e=xr:e=t:e=ml,this.traceCondition_=e}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:pl}getOverlay(){return this.overlay_}getFreehand(){return this.freehand_}handleEvent(t){t.originalEvent.type===lt.CONTEXTMENU&&t.originalEvent.preventDefault(),this.freehand_=this.mode_!=="Point"&&this.freehandCondition_(t);let e=t.type===xt.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&t.type===xt.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=t.pixel,this.shouldHandle_=!this.freehand_,e=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&t.type===xt.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(t.coordinate),n=!1):this.freehand_&&t.type===xt.POINTERDOWN?n=!1:e&&this.getPointerCount()<2?(n=t.type===xt.POINTERMOVE,n&&this.freehand_?(this.handlePointerMove_(t),this.shouldHandle_&&t.originalEvent.preventDefault()):(t.originalEvent.pointerType==="mouse"||t.type===xt.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(t)):t.type===xt.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 ln(xt.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 e=this.getMap(),n=e.getCoordinateFromPixel([t.pixel[0]-this.snapTolerance_,t.pixel[1]+this.snapTolerance_]),s=e.getCoordinateFromPixel([t.pixel[0]+this.snapTolerance_,t.pixel[1]-this.snapTolerance_]),r=te([n,s]),o=this.traceSource_.getFeaturesInExtent(r);if(o.length===0)return;const a=s1(t.coordinate,o);a.length&&(this.traceState_={active:!0,startCoord:t.coordinate.slice(),targets:a,targetIndex:-1})}addOrRemoveTracedCoordinates_(t,e){const n=t.startIndex<=t.endIndex,s=t.startIndex<=e;n===s?n&&e>t.endIndex||!n&&e<t.endIndex?this.addTracedCoordinates_(t,t.endIndex,e):(n&&e<t.endIndex||!n&&e>t.endIndex)&&this.removeTracedCoordinates_(e,t.endIndex):(this.removeTracedCoordinates_(t.startIndex,t.endIndex),this.addTracedCoordinates_(t,t.startIndex,e))}removeTracedCoordinates_(t,e){if(t===e)return;let n=0;if(t<e){const s=Math.ceil(t);let r=Math.floor(e);r===e&&(r-=1),n=r-s+1}else{const s=Math.floor(t);let r=Math.ceil(e);r===e&&(r+=1),n=s-r+1}n>0&&this.removeLastPoints_(n)}addTracedCoordinates_(t,e,n){if(e===n)return;const s=[];if(e<n){const r=Math.ceil(e);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(e);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 e=this.traceState_;if(!e.active)return;if(e.targetIndex===-1){const a=t.map.getPixelFromCoordinate(e.startCoord);if(rr(a,t.pixel)<this.snapTolerance_)return}const n=n1(t.coordinate,e,this.getMap(),this.snapTolerance_);if(e.targetIndex!==n.index){if(e.targetIndex!==-1){const l=e.targets[e.targetIndex];this.removeTracedCoordinates_(l.startIndex,l.endIndex)}const a=e.targets[n.index];this.addTracedCoordinates_(a,a.startIndex,n.endIndex)}else{const a=e.targets[e.targetIndex];this.addOrRemoveTracedCoordinates_(a,n.endIndex)}e.targetIndex=n.index;const s=e.targets[e.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 e=!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)),e=!1}else this.freehand_&&this.abortDrawing()}return this.ignoreNextUpEvent_=!1,!e&&this.stopClick_&&t.preventDefault(),e}handlePointerMove_(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){const e=this.downPx_,n=t.pixel,s=e[0]-n[0],r=e[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,e){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=!e&&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]],e?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 vn(t)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(t){this.sketchLine_||(this.sketchLine_=new _i);const e=t.getLinearRing(0);let n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),n.changed()):(n=new Sn(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(n))}startDrawing_(t){const e=this.getMap().getView().getProjection(),n=dl(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 Sn(this.sketchLineCoords_)));const s=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new _i,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(s),this.updateSketchFeatures_(),this.dispatchEvent(new ka(Na.DRAWSTART,this.sketchFeature_))}modifyDrawing_(t){const e=this.getMap(),n=this.sketchFeature_.getGeometry(),s=e.getView().getProjection(),r=dl(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_(e.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 e=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,e,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_,e,n)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),s?this.finishDrawing():this.sketchFeature_}removeLastPoints_(t){if(!this.sketchFeature_)return;const e=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,e,n),e.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}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_,e,n)}if(o.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const t=this.abortDrawing_();if(!t)return null;let e=this.sketchCoords_;const n=t.getGeometry(),s=this.getMap().getView().getProjection();return this.mode_==="LineString"?(e.pop(),this.geometryFunction_(e,n,s)):this.mode_==="Polygon"&&(e[0].pop(),this.geometryFunction_(e,n,s),e=n.getCoordinates()),this.type_==="MultiPoint"?t.setGeometry(new ph([e])):this.type_==="MultiLineString"?t.setGeometry(new Jo([e])):this.type_==="MultiPolygon"&&t.setGeometry(new Qo([e])),this.dispatchEvent(new ka(Na.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 ka(Na.DRAWABORT,t))}appendCoordinates(t){const e=this.mode_,n=!this.sketchFeature_;n&&this.startDrawing_(t[0]);let s;if(e==="LineString"||e==="Circle")s=this.sketchCoords_;else if(e==="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 vn(s)),this.updateSketchFeatures_(),this.dispatchEvent(new ka(Na.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 e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)}updateState_(){const t=this.getMap(),e=this.getActive();(!t||!e)&&this.abortDrawing(),this.overlay_.setMap(e?t:null)}}function eR(){const i=cf();return function(t,e){return i[t.getGeometry().getType()]}}function iR(i){switch(i){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: "+i)}}const Ng=0,Io=1,kg=[0,0,0,0],Cr=[],cc={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"};function uc(i,t,e){let n;switch(t){case"LineString":n=i;break;case"MultiLineString":case"Polygon":n=i[e[0]];break;case"MultiPolygon":n=i[e[1]][e[0]];break}return n}class fc extends ii{constructor(t,e,n){super(t),this.features=e,this.mapBrowserEvent=n}}class a1 extends us{constructor(t){super(t),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=t.condition?t.condition:B0,this.defaultDeleteCondition_=function(n){return Vx(n)&&k0(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 Ol,this.pixelTolerance_=t.pixelTolerance!==void 0?t.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new vh({source:new yh({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style?t.style:sR(),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 e;if(t.features?e=t.features:t.source&&(this.source_=t.source,e=new Me(this.source_.getFeatures()),this.source_.addEventListener(Pe.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(Pe.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!e)throw new Error("The modify interaction requires features, a source or a layer");t.hitDetection&&(this.hitDetection_=t.hitDetection),this.features_=e,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(ee.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(ee.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 e;t?t===!0?e=xr:e=t:e=ml,this.traceCondition_=e}addFeature_(t){const e=t.getGeometry();if(e){const s=this.SEGMENT_WRITERS_[e.getType()];s&&s(t,e)}const n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastCoordinate_),t.addEventListener(lt.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new Me;const n=this.featuresBeingModified_.getArray();for(let s=0,r=e.length;s<r;++s){const o=e[s].feature;o&&!n.includes(o)&&this.featuresBeingModified_.push(o)}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new fc(cc.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(lt.CHANGE,this.boundHandleFeatureChange_)}removeFeatureSegmentData_(t){const e=this.rBush_,n=[];e.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);e.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 e=t.target;this.removeFeature_(e),this.addFeature_(e)}}handleFeatureRemove_(t){this.removeFeature_(t.element)}writePointGeometry_(t,e){const n=e.getCoordinates(),s={feature:t,geometry:e,segment:[n,n]};this.rBush_.insert(e.getExtent(),s)}writeMultiPointGeometry_(t,e){const n=e.getCoordinates();for(let s=0,r=n.length;s<r;++s){const o=n[s],a={feature:t,geometry:e,depth:[s],index:s,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}}writeLineStringGeometry_(t,e){const n=e.getCoordinates();for(let s=0,r=n.length-1;s<r;++s){const o=n.slice(s,s+2),a={feature:t,geometry:e,index:s,segment:o};this.rBush_.insert(te(o),a)}}writeMultiLineStringGeometry_(t,e){const n=e.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:e,depth:[s],index:a,segment:h};this.rBush_.insert(te(h),c)}}}writePolygonGeometry_(t,e){const n=e.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:e,depth:[s],index:a,segment:h};this.rBush_.insert(te(h),c)}}}writeMultiPolygonGeometry_(t,e){const n=e.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:e,depth:[a,s],index:c,segment:f};this.rBush_.insert(te(f),d)}}}}writeCircleGeometry_(t,e){const n=e.getCenter(),s={feature:t,geometry:e,index:Ng,segment:[n,n]},r={feature:t,geometry:e,index:Io,segment:[n,n]},o=[s,r];s.featureSegments=o,r.featureSegments=o,this.rBush_.insert(xo(n),s);let a=e;this.rBush_.insert(a.getExtent(),r)}writeGeometryCollectionGeometry_(t,e){const n=e.getGeometriesArray();for(let s=0;s<n.length;++s){const r=n[s],o=this.SEGMENT_WRITERS_[r.getType()];o(t,r)}}createOrUpdateVertexFeature_(t,e,n,s){let r=this.vertexFeature_;return r?r.getGeometry().setCoordinates(t):(r=new _i(new vn(t)),this.vertexFeature_=r,this.overlay_.getSource().addFeature(r)),r.set("features",e),r.set("geometries",n),r.set("existing",s),r}handleEvent(t){if(!t.originalEvent)return!0;this.lastPointerEvent_=t;let e;return!t.map.getView().getInteracting()&&t.type==xt.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(t),this.vertexFeature_&&this.deleteCondition_(t)&&(t.type!=xt.SINGLECLICK||!this.ignoreNextSingleClick_?e=this.removePoint():e=!0),t.type==xt.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(t)&&!e}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=te([s]),o=this.rBush_.getInExtent(r),a={};o.sort(nR);for(let l=0,h=o.length;l<h;++l){const c=o[l],u=c.segment;let f=ct(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=Bg(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}ct(u)in this.vertexSegments_&&!a[f][0]&&!a[f][1]&&n.push(c)}return n}deactivateTrace_(){this.traceState_={active:!1}}updateTrace_(t){const e=this.traceState_;if(!e.active)return;if(e.targetIndex===-1){const r=t.map.getPixelFromCoordinate(e.startCoord);if(rr(r,t.pixel)<this.pixelTolerance_)return}const n=n1(t.coordinate,e,t.map,this.pixelTolerance_);if(e.targetIndex===-1&&Math.sqrt(n.closestTargetDistance)/t.map.getView().getResolution()>this.pixelTolerance_)return;if(e.targetIndex!==n.index){if(e.targetIndex!==-1){const o=e.targets[e.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();uc(c,l.getType(),a.depth).splice(a.index+h,1),l.setCoordinates(c),h===0&&(a.index-=1)}const r=e.targets[n.index];this.addTracedCoordinates_(r,r.startIndex,n.endIndex)}else{const r=e.targets[e.targetIndex];this.addOrRemoveTracedCoordinates_(r,n.endIndex)}e.targetIndex=n.index;const s=e.targets[e.targetIndex];s.endIndex=n.endIndex}getTraceCandidates_(t){const e=this.getMap(),n=this.pixelTolerance_,s=e.getCoordinateFromPixel([t.pixel[0]-n,t.pixel[1]+n]),r=e.getCoordinateFromPixel([t.pixel[0]+n,t.pixel[1]-n]),o=te([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 e=this.getTraceCandidates_(t);if(e.length===0)return;const n=s1(t.coordinate,e);n.length&&(this.traceState_={active:!0,startCoord:t.coordinate.slice(),targets:n,targetIndex:-1})}addOrRemoveTracedCoordinates_(t,e){const n=t.startIndex<=t.endIndex,s=t.startIndex<=e;n===s?n&&e>t.endIndex||!n&&e<t.endIndex?this.addTracedCoordinates_(t,t.endIndex,e):(n&&e<t.endIndex||!n&&e>t.endIndex)&&this.removeTracedCoordinates_(e,t.endIndex):(this.removeTracedCoordinates_(t.startIndex,t.endIndex),this.addTracedCoordinates_(t,t.startIndex,e))}removeTracedCoordinates_(t,e){if(t===e)return;let n=0;if(t<e){const s=Math.ceil(t);let r=Math.floor(e);r===e&&(r-=1),n=r-s+1}else{const s=Math.floor(t);let r=Math.ceil(e);r===e&&(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();uc(h,o.getType(),r.depth).splice(l,n),o.setCoordinates(h),a===1&&(r.index-=n)}}addTracedCoordinates_(t,e,n){if(e===n)return;const s=[];if(e<n){const r=Math.ceil(e);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(e);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();uc(c,a.getType(),o.depth).splice(h,0,...s),a.setCoordinates(c),l===1&&(o.index+=s.length)}}updateGeometry_(t,e){const n=e[0],s=n.depth;let r;const o=n.segment,a=n.geometry,l=e[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===Ng)this.changingFeature_=!0,h.setCenter(t),this.changingFeature_=!1;else{this.changingFeature_=!0,this.getMap().getView().getProjection();let c=rr(jt(h.getCenter()),jt(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 e=[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(th(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_(e,l)}this.updateTrace_(t),this.createOrUpdateVertexFeature_(e,n,s,!0)}handleDownEvent(t){if(!this.condition_(t))return!1;const e=t.coordinate,n=this.findInsertVerticesAndUpdateDragSegments_(e);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 e=this.dragSegments_.length-1;e>=0;--e){const n=this.dragSegments_[e][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(te(n.segment),n)}return this.featuresBeingModified_&&(this.toggleTraceState_(t),this.dispatchEvent(new fc(cc.MODIFYEND,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1}handlePointerMove_(t){this.lastCoordinate_=t.coordinate,this.handlePointerAtPixel_(this.lastCoordinate_)}handlePointerAtPixel_(t){const e=this.getMap(),n=e.getPixelFromCoordinate(t);e.getView().getProjection();const s=function(a,l){return jg(t,a)-jg(t,l)};let r,o;if(this.hitDetection_){const a=typeof this.hitDetection_=="object"?l=>l===this.hitDetection_:void 0;e.forEachFeatureAtPixel(n,(l,h,c)=>{c&&c.getType()==="Point"&&(c=new vn(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=gn(xo(t,kg)),l=e.getView().getResolution()*this.pixelTolerance_,h=nh(As(a,l,kg));r=this.rBush_.getInExtent(h)}if(r&&r.length>0){const a=r.sort(s)[0],l=a.segment;let h=Bg(t,a);const c=e.getPixelFromCoordinate(h);let u=rr(n,c);if(o||u<=this.pixelTolerance_){const f={};if(f[ct(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=e.getPixelFromCoordinate(l[0]),g=e.getPixelFromCoordinate(l[1]),_=pn(c,d),m=pn(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[ct(a.geometry)]=!0;for(let y=1,E=r.length;y<E;++y){const x=r[y].segment;if(Ne(l[0],x[0])&&Ne(l[1],x[1])||Ne(l[0],x[1])&&Ne(l[1],x[0])){const S=ct(r[y].geometry);S in p||(p[S]=!0,f[ct(x)]=!0)}else break}}this.vertexSegments_=f;return}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}insertVertex_(t,e){const n=t.segment,s=t.feature,r=t.geometry,o=t.depth,a=t.index;let l;for(;e.length<r.getStride();)e.push(0);switch(r.getType()){case"MultiLineString":l=r.getCoordinates(),l[o[0]].splice(a+1,0,e);break;case"Polygon":l=r.getCoordinates(),l[o[0]].splice(a+1,0,e);break;case"MultiPolygon":l=r.getCoordinates(),l[o[1]][o[0]].splice(a+1,0,e);break;case"LineString":l=r.getCoordinates(),l.splice(a+1,0,e);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],e],feature:s,geometry:r,depth:o,index:a};h.insert(te(c.segment),c),this.dragSegments_.push([c,1]);const u={segment:[e,n[1]],feature:s,geometry:r,depth:o,index:a+1};return h.insert(te(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(te([t])).some(({segment:n})=>Ne(n[0],t)||Ne(n[1],t))}removePoint(t){if(t&&(t=jt(t,this.getMap().getView().getProjection()),this.updatePointer_(t)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=xt.POINTERDRAG){const e=this.lastPointerEvent_;this.willModifyFeatures_(e,this.dragSegments_.map(([s])=>s));const n=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new fc(cc.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null,n}return!1}removeVertex_(){const t=this.dragSegments_,e={};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=ct(d.feature),d.depth&&(g+="-"+d.depth.join("-")),g in e||(e[g]={}),o[1]===0?(e[g].right=d,e[g].index=d.index):o[1]==1&&(e[g].left=d,e[g].index=d.index+1);for(g in e){switch(f=e[g].right,c=e[g].left,h=e[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(te(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(te([t])).some(({segment:n})=>!(Ne(n[0],t)||Ne(n[1],t)))}insertPoint(t){const e=t?jt(t,this.getMap().getView().getProjection()):this.vertexFeature_?.getGeometry().getCoordinates();return e?this.findInsertVerticesAndUpdateDragSegments_(e).reduce((s,r)=>s||this.insertVertex_(r,e),!1):!1}setGeometryCoordinates_(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1}updateSegmentIndices_(t,e,n,s){this.rBush_.forEachInExtent(t.getExtent(),function(r){r.geometry===t&&(n===void 0||r.depth===void 0||Pn(r.depth,n))&&r.index>e&&(r.index+=s)})}}function nR(i,t){return i.index-t.index}function jg(i,t,e){const n=t.geometry;if(n.getType()==="Circle"){let r=n;if(t.index===Io){const o=pn(r.getCenter(),jt(i)),a=Math.sqrt(o)-r.getRadius();return a*a}}const s=jt(i);return Cr[0]=jt(t.segment[0]),Cr[1]=jt(t.segment[1]),sv(s,Cr)}function Bg(i,t,e){const n=t.geometry;if(n.getType()==="Circle"&&t.index===Io)return os(n.getClosestPoint(jt(i)));const s=jt(i);return Cr[0]=jt(t.segment[0]),Cr[1]=jt(t.segment[1]),os(th(s,Cr))}function sR(){const i=cf();return function(t,e){return i.Point}}const rR=le({__name:"OlStyle",props:{zIndex:{},overrideStyleFunction:{}},setup(i,{expose:t}){const e=i,n=Bt("stylable",void 0),s=bn(e),r=ae(()=>new me(s)),o=l=>{const h=n?.value;if(h)if(h instanceof tR||h instanceof a1)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=ae(()=>(l,h)=>s.overrideStyleFunction?s.overrideStyleFunction(l,r.value,h):r.value);return ne(s,()=>o(s.overrideStyleFunction?a.value:r.value)),ei(()=>o(s.overrideStyleFunction?a.value:r.value)),wi(()=>{o(new me)}),Mi("style",r),Mi("styledObj",n),t({style:r}),(l,h)=>(_t(),Yt("div",null,[Hi(l.$slots,"default")]))}}),ja={SELECT:"select"};class Ba extends ii{constructor(t,e,n,s){super(t),this.selected=e,this.deselected=n,this.mapBrowserEvent=s}}const za={};class If 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:k0,this.addCondition_=t.addCondition?t.addCondition:ml,this.removeCondition_=t.removeCondition?t.removeCondition:ml,this.toggleCondition_=t.toggleCondition?t.toggleCondition:pl,this.multi_=t.multi?t.multi:!1,this.filter_=t.filter?t.filter:Cn,this.hitTolerance_=t.hitTolerance?t.hitTolerance:0,this.style_=t.style!==void 0?t.style:oR(),this.features_=t.features||new Me;let e;if(t.layers)if(typeof t.layers=="function")e=t.layers;else{const n=t.layers;e=function(s){return n.includes(s)}}else e=Cn;this.layerFilter_=e,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(t,e){this.featureLayerAssociation_[ct(t)]=e}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(t){return this.featureLayerAssociation_[ct(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(ee.ADD,this.boundAddFeature_),this.features_.addEventListener(ee.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(ee.ADD,this.boundAddFeature_),this.features_.removeEventListener(ee.REMOVE,this.boundRemoveFeature_))}addFeature_(t){const e=t.element;if(this.style_&&this.applySelectedStyle_(e),!this.getLayer(e)){const n=this.findLayerOfFeature_(e);n&&this.addFeatureLayerAssociation_(e,n)}}removeFeature_(t){this.style_&&this.restorePreviousStyle_(t.element)}findLayerOfFeature_(t){return this.getMap().getAllLayers().find(function(n){if(n instanceof vh&&n.getSource()&&n.getSource().hasFeature(t))return n})}getStyle(){return this.style_}applySelectedStyle_(t){const e=ct(t);e in za||(za[e]=t.getStyle()),t.setStyle(this.style_)}restorePreviousStyle_(t){const e=this.getMap().getInteractions().getArray();for(let s=e.length-1;s>=0;--s){const r=e[s];if(r!==this&&r instanceof If&&r.getStyle()&&r.getFeatures().getArray().lastIndexOf(t)!==-1){t.setStyle(r.getStyle());return}}const n=ct(t);t.setStyle(za[n]),delete za[n]}removeFeatureLayerAssociation_(t){delete this.featureLayerAssociation_[ct(t)]}selectFeatureInternal_(t,e,n){if(!(t instanceof _i)||!this.filter_(t,e))return;const s=this.getFeatures();return s.getArray().includes(t)||(this.addFeatureLayerAssociation_(t,e),s.push(t),n?.push(t)),t}selectFeature(t){const e=this.findLayerOfFeature_(t);if(!this.layerFilter_(e))return!1;const n=this.selectFeatureInternal_(t,e);return n&&this.dispatchEvent(new Ba(ja.SELECT,[n],[],void 0)),!!n}removeFeatureInternal_(t,e){const n=this.getFeatures();if(!(!(t instanceof _i)||!n.getArray().includes(t)))return n.remove(t),this.removeFeatureLayerAssociation_(t),e?.push(t),t}deselectFeature(t){const e=this.removeFeatureInternal_(t);return e&&this.dispatchEvent(new Ba(ja.SELECT,[],[e],void 0)),!!e}toggleFeature(t){this.deselectFeature(t)||this.selectFeature(t)}clearSelection(){Bs(this.featureLayerAssociation_);const t=this.getFeatures(),e=t.getArray().slice();t.clear(),e.length!==0&&this.dispatchEvent(new Ba(ja.SELECT,[],e,void 0))}handleEvent(t){if(!this.condition_(t))return!0;const e=this.addCondition_(t),n=this.removeCondition_(t),s=this.toggleCondition_(t),r=!e&&!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)),(e||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 Ba(ja.SELECT,h,l,t)),!0}}function oR(){const i=cf();return xi(i.Polygon,i.LineString),xi(i.GeometryCollection,i.LineString),function(t){return t.getGeometry()?i[t.getGeometry().getType()]:null}}const dc={SNAP:"snap",UNSNAP:"unsnap"};class gc extends ii{constructor(t,e){super(t),this.vertex=e.vertex,this.vertexPixel=e.vertexPixel,this.feature=e.feature,this.segment=e.segment}}const l1={Circle(i,t){const n=rx(i);return l1.Polygon(n)},GeometryCollection(i,t){const e=[],n=i.getGeometriesArray();for(let s=0;s<n.length;++s){const r=this[n[s].getType()];r&&e.push(r(n[s],t))}return e.flat()},LineString(i){const t=[],e=i.getFlatCoordinates(),n=i.getStride();for(let s=0,r=e.length-n;s<r;s+=n)t.push([e.slice(s,s+2),e.slice(s+n,s+n+2)]);return t},MultiLineString(i){const t=[],e=i.getFlatCoordinates(),n=i.getStride(),s=i.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([e.slice(h,h+2),e.slice(h+n,h+n+2)]);r=l}return t},MultiPoint(i){const t=[],e=i.getFlatCoordinates(),n=i.getStride();for(let s=0,r=e.length;s<r;s+=n)t.push([e.slice(s,s+2)]);return t},MultiPolygon(i){const t=[],e=i.getFlatCoordinates(),n=i.getStride(),s=i.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([e.slice(f,f+2),e.slice(f+n,f+n+2)]);r=u}}return t},Point(i){return[[i.getFlatCoordinates().slice(0,2)]]},Polygon(i){const t=[],e=i.getFlatCoordinates(),n=i.getStride(),s=i.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([e.slice(h,h+2),e.slice(h+n,h+n+2)]);r=l}return t}};function zg(i){return i.feature?i.feature:i.element?i.element:null}const _c=[],on=[],Js=[];class aR extends us{constructor(t){t=t||{},super({handleDownEvent:Cn,stopDown:js}),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 Ol,this.snapped_=null,this.segmenters_=Object.assign({},l1,t.segmenters)}addFeature(t,e){e=e!==void 0?e:!0;const n=ct(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];on[l]=te(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=on[l];for(let d=0,g=l-1;d<g;++d){const _=o[d];if(!Fe(u,on[d]))continue;const m=Pd(c,_);if(!m)continue;const p=[m];on[a]=te(p),Js[a++]={feature:t,intersectionFeature:t,segment:p}}const f=this.rBush_.getInExtent(on[l]);for(let d=0,g=f.length;d<g;++d){const _=f[d].segment;if(_.length===1)continue;const m=Pd(c,_);if(!m)continue;const p=[m];on[a]=te(p),Js[a++]={feature:t,intersectionFeature:f[d].feature,segment:p}}}a===1?this.rBush_.insert(on[0],Js[0]):(on.length=a,Js.length=a,this.rBush_.load(on,Js))}}e&&(this.featureChangeListenerKeys_[n]&&It(this.featureChangeListenerKeys_[n]),this.featureChangeListenerKeys_[n]=mt(t,lt.CHANGE,this.handleFeatureChange_,this))}getFeatures_(){let t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t}areSnapDataEqual_(t,e){return t.segment===e.segment&&t.feature===e.feature}handleEvent(t){const e=this.snapTo(t.pixel,t.coordinate,t.map);return e?(t.coordinate=e.vertex.slice(0,2),t.pixel=e.vertexPixel,this.snapped_&&!this.areSnapDataEqual_(this.snapped_,e)&&this.dispatchEvent(new gc(dc.UNSNAP,this.snapped_)),this.snapped_={vertex:t.coordinate,vertexPixel:t.pixel,feature:e.feature,segment:e.segment},this.dispatchEvent(new gc(dc.SNAP,this.snapped_))):this.snapped_&&(this.dispatchEvent(new gc(dc.UNSNAP,this.snapped_)),this.snapped_=null),super.handleEvent(t)}handleFeatureAdd_(t){const e=zg(t);e&&this.addFeature(e)}handleFeatureRemove_(t){const e=zg(t);e&&(this.removeFeature(e),delete this.pendingFeatures_[ct(e)])}handleFeatureChange_(t){const e=t.target;this.handlingDownUpSequence?this.pendingFeatures_[ct(e)]=e:this.updateFeature_(e)}handleUpEvent(t){const e=Object.values(this.pendingFeatures_);if(e.length){for(const n of e)this.updateFeature_(n);Bs(this.pendingFeatures_)}return!1}removeFeature(t,e){const n=e!==void 0?e:!0,s=ct(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&&(It(this.featureChangeListenerKeys_[s]),delete this.featureChangeListenerKeys_[s])}setMap(t){const e=this.getMap(),n=this.featuresListenerKeys_;let s=this.getFeatures_();if(Array.isArray(s)||(s=s.getArray()),e&&(n.forEach(It),n.length=0,this.rBush_.clear(),Object.values(this.featureChangeListenerKeys_).forEach(It),this.featureChangeListenerKeys_={}),super.setMap(t),t){this.features_?n.push(mt(this.features_,ee.ADD,this.handleFeatureAdd_,this),mt(this.features_,ee.REMOVE,this.handleFeatureRemove_,this)):this.source_&&n.push(mt(this.source_,Pe.ADDFEATURE,this.handleFeatureAdd_,this),mt(this.source_,Pe.REMOVEFEATURE,this.handleFeatureRemove_,this));for(const r of s)this.addFeature(r)}}snapTo(t,e,n){n.getView().getProjection();const s=jt(e),r=nh(As(te([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 pn(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=jt(p),E=pn(s,y);E<h&&(this.intersection_&&m.intersectionFeature||this.vertex_&&!m.intersectionFeature)&&(l=p,h=E,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=iv(s,y)}else{const[y,E]=p.segment;E&&(_c[0]=jt(y),_c[1]=jt(E),m=th(s,_c))}if(m){const y=pn(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 lR=le({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(i,{expose:t}){const e=i,n=Bt("map"),s=bn(e),r=ae(()=>new If({style:new me,...s}));return kr(r,["select"]),ne(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)=>Hi(o.$slots,"default")}}),hR=le({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(i,{expose:t}){const e=i,n=Bt("map"),s=Bt("vectorSource",null),{source:r,features:o,condition:a,deleteCondition:l,insertVertexCondition:h,pixelTolerance:c,wrapX:u,hitDetection:f,snapToPointer:d}=Wl(e);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 a1({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"]),ne([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)=>Hi(m.$slots,"default")}}),cR=le({__name:"OlInteractionSnap",props:{features:{},source:{},edge:{type:Boolean,default:!0},vertex:{type:Boolean,default:!0},intersection:{type:Boolean},pixelTolerance:{},segmenters:{}},setup(i,{expose:t}){const e=i,n=Bt("map"),s=Bt("vectorSource"),r=bn(e),o=()=>new aR({...r,source:e.source||s?.value});let a=o();return ne(r,()=>{n?.removeInteraction(a),a=o(),n?.addInteraction(a),n?.changed()}),ei(()=>{n?.addInteraction(a)}),wi(()=>{n?.removeInteraction(a)}),t({snap:a}),(l,h)=>Hi(l.$slots,"default")}}),Wa={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 Pf(i,t){return h1(i,t,[]).join("")}function h1(i,t,e){if(i.nodeType==Node.CDATA_SECTION_NODE||i.nodeType==Node.TEXT_NODE)e.push(i.nodeValue);else{let n;for(n=i.firstChild;n;n=n.nextSibling)h1(n,t,e)}return e}function uR(i){return"documentElement"in i}function fR(i){return new DOMParser().parseFromString(i,"application/xml")}function ou(i,t){return(function(e,n){const s=i.call(this,e,n);s!==void 0&&n[n.length-1].push(s)})}function qe(i,t,e){return(function(n,s){const r=i.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 nt(i,t,e){return(function(n,s){const r=i.call(this,n,s);if(r!==void 0){const o=s[s.length-1],a=n.localName;o[a]=r}})}function Ot(i,t,e){e=e!==void 0?e:{};let n,s;for(n=0,s=i.length;n<s;++n)e[i[n]]=t;return e}function dR(i,t,e,n){let s;for(s=t.firstElementChild;s;s=s.nextElementSibling){const r=i[s.namespaceURI];if(r!==void 0){const o=r[s.localName];o!==void 0&&o.call(n,s,e)}}}function $t(i,t,e,n,s){return n.push(i),dR(t,e,n,s),n.pop()}class c1{read(t){if(!t)return null;if(typeof t=="string"){const e=fR(t);return this.readFromDocument(e)}return uR(t)?this.readFromDocument(t):this.readFromNode(t)}readFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null}readFromNode(t){Mt()}}const gR="http://www.w3.org/1999/xlink";function bf(i){return i.getAttributeNS(gR,"href")}function _R(i){const t=Pf(i,!1);return mR(t)}function mR(i){const t=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(i);if(t)return parseFloat(t[1])}function Hn(i){const t=Pf(i,!1);return pR(t)}function pR(i){const t=/^\s*(\d+)\s*$/.exec(i);if(t)return parseInt(t[1],10)}function St(i){return Pf(i,!1).trim()}const si=[null,"http://www.opengis.net/ows/1.1"],yR=Ot(si,{ServiceIdentification:nt(UR),ServiceProvider:nt(XR),OperationsMetadata:nt(zR)});class vR extends c1{constructor(){super()}readFromNode(t){const e=$t({},yR,t,[]);return e||null}}const xR=Ot(si,{DeliveryPoint:nt(St),City:nt(St),AdministrativeArea:nt(St),PostalCode:nt(St),Country:nt(St),ElectronicMailAddress:nt(St)}),ER=Ot(si,{Value:qe($R)}),SR=Ot(si,{AllowedValues:nt(FR)}),MR=Ot(si,{Phone:nt(WR),Address:nt(OR)}),wR=Ot(si,{HTTP:nt(jR)}),CR=Ot(si,{Get:qe(kR),Post:void 0}),TR=Ot(si,{DCP:nt(NR)}),RR=Ot(si,{Operation:BR}),IR=Ot(si,{Voice:nt(St),Facsimile:nt(St)}),PR=Ot(si,{Constraint:qe(GR)}),bR=Ot(si,{IndividualName:nt(St),PositionName:nt(St),ContactInfo:nt(DR)}),AR=Ot(si,{Abstract:nt(St),AccessConstraints:nt(St),Fees:nt(St),Title:nt(St),ServiceTypeVersion:nt(St),ServiceType:nt(St)}),LR=Ot(si,{ProviderName:nt(St),ProviderSite:nt(bf),ServiceContact:nt(VR)});function OR(i,t){return $t({},xR,i,t)}function FR(i,t){return $t({},ER,i,t)}function GR(i,t){const e=i.getAttribute("name");if(e)return $t({name:e},SR,i,t)}function DR(i,t){return $t({},MR,i,t)}function NR(i,t){return $t({},wR,i,t)}function kR(i,t){const e=bf(i);if(e)return $t({href:e},PR,i,t)}function jR(i,t){return $t({},CR,i,t)}function BR(i,t){const e=i.getAttribute("name"),n=$t({},TR,i,t);if(!n)return;const s=t[t.length-1];s[e]=n}function zR(i,t){return $t({},RR,i,t)}function WR(i,t){return $t({},IR,i,t)}function UR(i,t){return $t({},AR,i,t)}function VR(i,t){return $t({},bR,i,t)}function XR(i,t){return $t({},LR,i,t)}function $R(i,t){return St(i)}const Zi=[null,"http://www.opengis.net/wmts/1.0"],Ur=[null,"http://www.opengis.net/ows/1.1"],KR=Ot(Zi,{Contents:nt(sI)});class YR extends c1{constructor(){super(),this.owsParser_=new vR}readFromNode(t){let e=t.getAttribute("version");e&&(e=e.trim());let n=this.owsParser_.readFromNode(t);return n?(n.version=e,n=$t(n,KR,t,[]),n||null):null}}const qR=Ot(Zi,{Layer:qe(rI),TileMatrixSet:qe(oI)}),HR=Ot(Zi,{Style:qe(aI),Format:qe(St),TileMatrixSetLink:qe(lI),Dimension:qe(hI),ResourceURL:qe(cI)},Ot(Ur,{Title:nt(St),Abstract:nt(St),WGS84BoundingBox:nt(f1),BoundingBox:qe(uI),Identifier:nt(St)})),ZR=Ot(Zi,{LegendURL:qe(fI)},Ot(Ur,{Title:nt(St),Identifier:nt(St)})),JR=Ot(Zi,{TileMatrixSet:nt(St),TileMatrixSetLimits:nt(gI)}),QR=Ot(Zi,{TileMatrixLimits:ou(_I)}),tI=Ot(Zi,{TileMatrix:nt(St),MinTileRow:nt(Hn),MaxTileRow:nt(Hn),MinTileCol:nt(Hn),MaxTileCol:nt(Hn)}),eI=Ot(Zi,{Default:nt(St),Value:qe(St)},Ot(Ur,{Identifier:nt(St)})),u1=Ot(Ur,{LowerCorner:ou(au),UpperCorner:ou(au)}),iI=Ot(Zi,{WellKnownScaleSet:nt(St),TileMatrix:qe(dI)},Ot(Ur,{SupportedCRS:nt(St),Identifier:nt(St),BoundingBox:nt(f1)})),nI=Ot(Zi,{TopLeftCorner:nt(au),ScaleDenominator:nt(_R),TileWidth:nt(Hn),TileHeight:nt(Hn),MatrixWidth:nt(Hn),MatrixHeight:nt(Hn)},Ot(Ur,{Identifier:nt(St)}));function sI(i,t){return $t({},qR,i,t)}function rI(i,t){return $t({},HR,i,t)}function oI(i,t){return $t({},iI,i,t)}function aI(i,t){const e=$t({},ZR,i,t);if(!e)return;const n=i.getAttribute("isDefault")==="true";return e.isDefault=n,e}function lI(i,t){return $t({},JR,i,t)}function hI(i,t){return $t({},eI,i,t)}function cI(i,t){const e=i.getAttribute("format"),n=i.getAttribute("template"),s=i.getAttribute("resourceType"),r={};return e&&(r.format=e),n&&(r.template=n),s&&(r.resourceType=s),r}function f1(i,t){const e=$t([],u1,i,t);if(e.length==2)return te(e)}function uI(i,t){const e=i.getAttribute("crs"),n=$t([],u1,i,t);if(n.length==2)return{extent:te(n),crs:e}}function fI(i,t){const e={};return e.format=i.getAttribute("format"),e.href=bf(i),e}function au(i,t){const e=St(i).split(/\s+/);if(!e||e.length!=2)return;const n=+e[0],s=+e[1];if(!(isNaN(n)||isNaN(s)))return[n,s]}function dI(i,t){return $t({},nI,i,t)}function gI(i,t){return $t([],QR,i,t)}function _I(i,t){return $t({},tI,i,t)}const mI={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor"};function pI(i,t){return _t(),Yt("svg",mI,[...t[0]||(t[0]=[Gt("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),Gt("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 yI={render:pI},vI={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"};function xI(i,t){return _t(),Yt("svg",vI,[...t[0]||(t[0]=[Gt("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),Gt("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 EI={render:xI},SI={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"};function MI(i,t){return _t(),Yt("svg",SI,[...t[0]||(t[0]=[Gt("path",{fill:"#000","fill-rule":"evenodd",d:"M4 10h2V6h4V4H6V0H4v4H0v2h4z"},null,-1)])])}const wI={render:MI},CI={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"2"};function TI(i,t){return _t(),Yt("svg",CI,[...t[0]||(t[0]=[Gt("path",{fill:"#000","fill-rule":"evenodd",d:"M10 2V0H0v2z"},null,-1)])])}const RI={render:TI},II={class:"wrapper"},PI=["id","checked","onClick"],bI=["for"],AI={class:"layer"},LI=["checked"],OI=le({__name:"BaseLayers",props:{baseLayers:{},selectedBaseLayerId:{}},emits:["selectBaseLayer"],setup(i,{emit:t}){const e=i,n=t,s=ae(()=>e.selectedBaseLayerId===null),r=o=>{if(!o){n("selectBaseLayer",null);return}e.selectedBaseLayerId!==o.options.identifier&&n("selectBaseLayer",o.options.identifier)};return(o,a)=>(_t(),Yt("div",II,[Gt("ul",null,[(_t(!0),Yt(ge,null,sl(i.baseLayers,l=>(_t(),Yt("li",{key:l.options.identifier,class:"layer"},[Gt("input",{id:l.options.identifier,type:"radio",name:"baseLayer",checked:e.selectedBaseLayerId===l.options.identifier,onClick:()=>r(l)},null,8,PI),Gt("label",{for:l.options.identifier},Bl(l.options.title),9,bI)]))),128)),Gt("li",AI,[Gt("input",{id:"baseLayer_none",type:"radio",name:"baseLayer",checked:s.value,onClick:a[0]||(a[0]=()=>r(null))},null,8,LI),a[1]||(a[1]=Gt("label",{for:"baseLayer_none"},"Geen",-1))])])]))}}),Af=(i,t)=>{const e=i.__vccOpts||i;for(const[n,s]of t)e[n]=s;return e},FI=Af(OI,[["__scopeId","data-v-7a503b81"]]),GI={class:"wrapper"},DI={key:0},NI={class:"layer-control"},kI=["checked","onChange"],jI={class:"layer-title"},BI=le({__name:"Layers",props:{toggleableLayers:{},visibleToggleableLayers:{}},emits:["toggleLayer"],setup(i,{emit:t}){const e=t,n=s=>{e("toggleLayer",s)};return(s,r)=>(_t(),Yt("div",GI,[i.toggleableLayers.length>0?(_t(),Yt("ul",DI,[(_t(!0),Yt(ge,null,sl(i.toggleableLayers,o=>(_t(),Yt("li",{key:"toggle-"+o.options.identifier,class:"layer"},[Gt("label",NI,[Gt("input",{type:"checkbox",checked:i.visibleToggleableLayers.has(o.options.identifier),onChange:a=>n(o.options.identifier),class:"layer-checkbox"},null,40,kI),Gt("span",jI,Bl(o.options.title),1)])]))),128))])):oe("",!0)]))}}),zI=Af(BI,[["__scopeId","data-v-16f7d1b3"]]),WI={class:"map-container"},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=le({__name:"Map",props:{layers:{default:()=>[]},baseLayers:{default:()=>[]},toggleableLayers:{default:()=>[]},interactions:{},zoom:{default:10},center:{default:()=>[12e4,487e3]}},emits:["featureSelected","featureDeselected","featureModified","mapClicked","modifyCancelled"],setup(i,{expose:t,emit:e}){const n=i,s=e,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),E=Nt(null),x=ae(()=>E.value),S=Nt(new globalThis.Map),w=(R,D,H,v)=>{if(!R)return;if(R instanceof me||typeof R=="function")return R;const M={},T=G=>{if(Array.isArray(G)){const[L,...O]=G;switch(L){case"get":return D?.getProperties()?.[O[0]]??null;case"case":for(let U=0;U<O.length-1;U+=2)if(T(O[U]))return T(O[U+1]);return T(O[O.length-1]);case"==":return T(O[0])===T(O[1]);case"coalesce":for(const U of O){const X=T(U);if(X!=null)return X}return null;default:return G}}return G};if(R["fill-color"]&&(M.fill=new li({color:T(R["fill-color"])})),(R["stroke-color"]||R["stroke-width"])&&(M.stroke=new Si({color:T(R["stroke-color"])||"#3399CC",width:T(R["stroke-width"])||1.25})),R["circle-radius"]||R["circle-fill-color"]||R["circle-stroke-color"]){const G=T(R["circle-radius"])||5,L=T(R["circle-fill-color"]),O=T(R["circle-stroke-color"])||"#3399CC",U=T(R["circle-stroke-width"])||1.25;M.image=new Us({radius:G,fill:L?new li({color:L}):void 0,stroke:new Si({color:O,width:U})})}if(R["text-value"]){const G=T(R["text-value"]);G&&(M.text=new oa({text:String(G),fill:new li({color:"#000"}),stroke:new Si({color:"#fff",width:2})}))}return new me(M)},I=R=>typeof R=="function"?R:R instanceof me?(D,H,v)=>[R]:(D,H,v)=>{const M=w(R,D);return M?[M]:void 0},P=ae(()=>n.layers.map(R=>{if(R.type==="wmts"){const D=S.value.get(R.options.identifier);return{type:"wmts",identifier:R.options.identifier,options:D||null}}else return R.type==="wms"?{type:"wms",identifier:R.options.identifier,wmsUrl:R.options.url,layerName:R.options.layer}:{type:"vector",identifier:R.options.identifier,options:R.options,style:R.options.style,styleFunction:R.options.styleFunction}})),C=ae(()=>{if(!f.value||!n.baseLayers)return null;const R=n.baseLayers.find(D=>D.options.identifier===f.value);return!R||R.type==="wmts"&&!S.value.get(R.options.identifier)?null:R}),N=ae(()=>C.value&&S.value.get(C.value.options.identifier)||null),z=ae(()=>(n.toggleableLayers||[]).filter(R=>d.value.has(R.options.identifier)).map(R=>R.type==="wms"?{type:"wms",identifier:R.options.identifier,wmsUrl:R.options.url,layerName:R.options.layer}:R.type==="wmts"?{type:"wmts",identifier:R.options.identifier,wmtsOptions:S.value.get(R.options.identifier)}:R.type==="vector"?{type:"vector",identifier:R.options.identifier,options:R.options,style:R.options.style,styleFunction:R.options.styleFunction}:{...R,identifier:R.options.identifier})),b=ae(()=>{const R=[];if(C.value){const v=C.value;v.type==="wmts"?R.push({type:"wmts",identifier:v.options.identifier,wmtsOptions:N.value,zIndex:0}):v.type==="wms"?R.push({type:"wms",identifier:v.options.identifier,wmsUrl:v.options.url,layerName:v.options.layer,zIndex:0}):v.type==="vector"&&R.push({type:"vector",identifier:v.options.identifier,options:v.options,style:v.options.style,styleFunction:v.options.styleFunction,zIndex:0})}const D=z.value.map((v,M)=>({...v,zIndex:M+10})),H=P.value.map((v,M)=>({...v,zIndex:D.length+M+20}));return[...R,...D,...H]}),A=()=>{c.value=!c.value},W=()=>{u.value=!u.value},Q=R=>{d.value.has(R)?d.value.delete(R):d.value.add(R)},q=R=>{f.value=R},Y=()=>{if(o.value?.view){const R=o.value.view,D=R.getZoom(),H=R.getMaxZoom();typeof D=="number"&&D<H&&R.animate({zoom:D+1,duration:250})}},K=()=>{if(o.value?.view){const R=o.value.view,D=R.getZoom(),H=R.getMinZoom();typeof D=="number"&&D>H&&R.animate({zoom:D-1,duration:250})}},ot=async(R,D,H)=>{try{const M=await(await fetch(R)).text(),T=new YR().read(M),G=H?[H,"image/jpeg","image/png"]:["image/png","image/jpeg"];let L=null;for(const O of G)try{if(L=yT(T,{layer:D,matrixSet:"EPSG:28992",projection:"EPSG:28992",format:O,crossOrigin:"anonymous",style:"default"}),L)break}catch(U){console.warn(`Format ${O} failed for layer ${D}:`,U)}return L&&(L.style="default"),L}catch(v){return console.error("Failed to fetch WMTS capabilities:",v),null}},ft=R=>{if(!R||R.length===0||!o.value?.view)return;const D=[];for(const H of R)if(H.type==="Point")D.push(H.coordinates);else if(H.type==="Polygon"){const v=H.coordinates;for(const M of v)for(const T of M)D.push(T)}if(D.length>0){const H=te(D);o.value.view.fit(H,{padding:[50,50,50,50]})}};ei(async()=>{if(E.value=new Me([]),!f.value&&n.baseLayers&&n.baseLayers.length>0){const R=n.baseLayers[0];R?.options.identifier&&(f.value=R.options.identifier)}await new Promise(R=>setTimeout(R,100)),r.value?.map&&r.value.map.on("singleclick",R=>{s("mapClicked",{coordinate:R.coordinate,pixel:R.pixel})});for(const R of n.layers.filter(D=>D.type==="wmts"))if(R.options.url){const D=await ot(R.options.url,R.options.identifier,R.options.format);S.value.set(R.options.identifier,D)}if(n.baseLayers){for(const R of n.baseLayers.filter(D=>D.type==="wmts"))if(R.options.url){const D=await ot(R.options.url,R.options.identifier,R.options.format);S.value.set(R.options.identifier,D)}}if(n.toggleableLayers){for(const R of n.toggleableLayers.filter(D=>D.type==="wmts"))if(R.options.url){const D=await ot(R.options.url,R.options.identifier,R.options.format);S.value.set(R.options.identifier,D)}}});const pt=ae(()=>{if(!n.interactions?.selectable?.layers||n.interactions.selectable.layers.length===0)return;const R=n.interactions.selectable.layers;return(D,H)=>{if(!H)return!1;const v=H.get("name");return R.includes(v)}}),j=ae(()=>w(n.interactions?.selectable?.style,void 0)),Zt=R=>{E.value&&(E.value.clear(),R.selected&&R.selected.length>0&&E.value.push(R.selected[0])),s("featureSelected",R)},re=R=>{m.value=R;const D=R.features.getArray()[0];if(D){const H=D.getGeometry();p.value=H.clone();const v=H.getCoordinates();_.value=v,g.value=!0,y.value=H.on("change",()=>{const M=H.getCoordinates();_.value=M})}},zt=R=>{m.value=R},Jt=()=>{if(m.value){const R=m.value.features.getArray();s("featureModified",{features:R}),E.value&&E.value.clear(),a.value?.selectInteraction&&a.value.selectInteraction.getFeatures().clear()}ue()},qt=()=>{if(m.value&&p.value){const R=m.value.features.getArray()[0];R&&R.setGeometry(p.value);const D=m.value.features.getArray();s("modifyCancelled",{features:D})}ue()},ue=()=>{g.value=!1,_.value=null,m.value=null,p.value=null,y.value&&(i0(y.value),y.value=null)};return t({map:r,view:o,fitToFeatures:ft}),(R,D)=>(_t(),Yt("div",WI,[kt(Dt(IS),{ref_key:"mapRef",ref:r,style:{width:"100%",height:"100%"},controls:[]},{default:ji(()=>[kt(Dt(R4),{projectionName:Dt(Wa).name,projectionDef:Dt(Wa).def,extent:Dt(Wa).extent},null,8,["projectionName","projectionDef","extent"]),kt(Dt(I4),{ref_key:"viewRef",ref:o,center:i.center,zoom:i.zoom,projection:Dt(Wa).name},null,8,["center","zoom","projection"]),n.interactions?.selectable?.enabled?(_t(),Re(Dt(lR),{key:0,ref_key:"selectInteractionRef",ref:a,multi:!1,filter:pt.value,style:jl(j.value),onSelect:Zt},null,8,["filter","style"])):oe("",!0),(_t(!0),Yt(ge,null,sl(b.value,H=>(_t(),Yt(ge,{key:H.identifier},[H.type==="wms"?(_t(),Re(Dt(Dg),{key:0,zIndex:H.zIndex},{default:ji(()=>[kt(Dt(qT),{url:H.wmsUrl,layers:H.layerName||"",params:{LAYERS:H.layerName||"",TILED:!0},serverType:"geoserver",crossOrigin:"anonymous"},null,8,["url","layers","params"])]),_:2},1032,["zIndex"])):H.type==="wmts"&&(H.wmtsOptions||H.options)?(_t(),Re(Dt(Dg),{key:1,zIndex:H.zIndex},{default:ji(()=>[kt(Dt(ZT),q_({ref_for:!0},H.wmtsOptions||H.options,{styles:"default"}),null,16)]),_:2},1032,["zIndex"])):H.type==="vector"?(_t(),Re(Dt(YT),{key:2,zIndex:H.zIndex,properties:{name:H.identifier},ref_for:!0,ref:v=>{v&&(l.value[H.identifier]=v)}},{default:ji(()=>[H.styleFunction||H.options?.styleFunction||H.style||H.options?.style?(_t(),Re(Dt(rR),{key:0,overrideStyleFunction:H.styleFunction||H.options?.styleFunction||I(H.style||H.options?.style)},null,8,["overrideStyleFunction"])):oe("",!0),kt(Dt(HT),{ref_for:!0,ref:v=>{v&&(h.value[H.identifier]=v)}},{default:ji(()=>[(_t(!0),Yt(ge,null,sl(H.options?.features,(v,M)=>(_t(),Re(Dt(Uv),{key:`${H.identifier}-${M}`,properties:v.properties||{}},{default:ji(()=>[v.type==="Point"?(_t(),Re(Dt(JT),{key:0,coordinates:v.coordinates},null,8,["coordinates"])):oe("",!0),v.type==="Polygon"?(_t(),Re(Dt(QT),{key:1,coordinates:v.coordinates},null,8,["coordinates"])):oe("",!0)]),_:2},1032,["properties"]))),128)),n.interactions?.modify?.enabled&&n.interactions.modify.layer===H.identifier&&x.value?(_t(),Re(Dt(hR),{key:0,features:x.value,onModifystart:re,onModifyend:zt},null,8,["features"])):oe("",!0),n.interactions?.snap?.enabled&&n.interactions?.modify?.enabled&&n.interactions?.modify?.layer===H.identifier&&h.value[n.interactions.snap.targetLayer]?.source?(_t(),Re(Dt(cR),{key:`snap-${H.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"])):oe("",!0)]),_:2},1536)]),_:2},1032,["zIndex","properties"])):oe("",!0)],64))),128)),g.value&&_.value?(_t(),Re(Dt(bS),{key:1,position:_.value,positioning:"bottom-left",offset:[10,-10],stopEvent:!0},{default:ji(()=>[Gt("div",{class:"modify-overlay"},[Gt("button",{class:"modify-btn modify-btn-ok",onClick:Jt}," Bevestig "),Gt("button",{class:"modify-btn modify-btn-cancel",onClick:qt}," Annuleer ")])]),_:1},8,["position"])):oe("",!0)]),_:1},512),Gt("div",UI,[i.toggleableLayers&&i.toggleableLayers.length>0?(_t(),Yt("div",VI,[Gt("button",{class:Po(["iconbutton",{isActive:u.value}]),"aria-label":"Toon lagen","aria-expanded":u.value,onClick:W},[kt(Dt(EI))],10,XI),kt(Zf,{name:"fade"},{default:ji(()=>[u.value?(_t(),Re(zI,{key:0,toggleableLayers:i.toggleableLayers||[],visibleToggleableLayers:d.value,onToggleLayer:Q},null,8,["toggleableLayers","visibleToggleableLayers"])):oe("",!0)]),_:1})])):oe("",!0)]),Gt("div",$I,[n.baseLayers&&n.baseLayers.length>0?(_t(),Yt("div",KI,[Gt("button",{class:Po(["iconbutton",{isActive:c.value}]),"aria-label":"Toon basislagen","aria-expanded":c.value,onClick:A},[kt(Dt(yI))],10,YI),kt(Zf,{name:"fade"},{default:ji(()=>[c.value?(_t(),Re(FI,{key:0,baseLayers:n.baseLayers,selectedBaseLayerId:f.value,onSelectBaseLayer:q},null,8,["baseLayers","selectedBaseLayerId"])):oe("",!0)]),_:1})])):oe("",!0),Gt("div",qI,[Gt("button",{class:"iconbutton","aria-label":"Zoom in",onClick:Y},[kt(Dt(wI))]),Gt("button",{class:"iconbutton","aria-label":"Zoom out",onClick:K},[kt(Dt(RI))])])])]))}}),ZI=Af(HI,[["__scopeId","data-v-67707055"]]),Wg=[{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=le({__name:"Example",setup(i){const t=Nt([]),e=Nt([]),n=Nt(!1),s=Nt(!1),r=ae(()=>[{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:e.value,styleFunction:(_,m,p)=>{if(p>.2)return[];const y=_.getProperties(),E=y.geplaatst===!0,x=y.id||"";return[new me({image:new Us({radius:20,fill:new li({color:"white"}),stroke:new Si({color:E?"green":"red",width:2})}),text:x?new oa({text:String(x),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=ae(()=>({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"},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=[...Wg],e.value=[...JI],l.value&&l.value.fitToFeatures(Wg)},100)}),(_,m)=>(_t(),Yt("div",QI,[Gt("div",tP,[kt(Dt(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?(_t(),Yt("div",eP,Bl(h.value),1)):oe("",!0)]))}});ky(iP).mount("#app");
|