vue-geojson-view-ts 1.3.6 → 1.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,25 @@
1
- (function(de,G){typeof exports=="object"&&typeof module<"u"?G(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],G):(de=typeof globalThis<"u"?globalThis:de||self,G(de.vueGeojsonViewTs={},de.Vue))})(this,function(de,G){"use strict";var qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ph(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function mh(r){if(r.__esModule)return r;var t=r.default;if(typeof t=="function"){var e=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),e}var yh={exports:{}};function $f(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var $o={exports:{}};const Jf=mh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var vh;function xh(){return vh||(vh=1,function(r,t){(function(e,i){r.exports=i()})(qe,function(){var e=e||function(i,n){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof qe<"u"&&qe.crypto&&(o=qe.crypto),!o&&typeof $f=="function")try{o=Jf}catch{}var a=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},h=Object.create||function(){function w(){}return function(T){var P;return w.prototype=T,P=new w,w.prototype=null,P}}(),c={},d=c.lib={},f=d.Base=function(){return{extend:function(w){var T=h(this);return w&&T.mixIn(w),(!T.hasOwnProperty("init")||this.init===T.init)&&(T.init=function(){T.$super.init.apply(this,arguments)}),T.init.prototype=T,T.$super=this,T},create:function(){var w=this.extend();return w.init.apply(w,arguments),w},init:function(){},mixIn:function(w){for(var T in w)w.hasOwnProperty(T)&&(this[T]=w[T]);w.hasOwnProperty("toString")&&(this.toString=w.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),_=d.WordArray=f.extend({init:function(w,T){w=this.words=w||[],T!=n?this.sigBytes=T:this.sigBytes=w.length*4},toString:function(w){return(w||v).stringify(this)},concat:function(w){var T=this.words,P=w.words,M=this.sigBytes,I=w.sigBytes;if(this.clamp(),M%4)for(var D=0;D<I;D++){var z=P[D>>>2]>>>24-D%4*8&255;T[M+D>>>2]|=z<<24-(M+D)%4*8}else for(var W=0;W<I;W+=4)T[M+W>>>2]=P[W>>>2];return this.sigBytes+=I,this},clamp:function(){var w=this.words,T=this.sigBytes;w[T>>>2]&=4294967295<<32-T%4*8,w.length=i.ceil(T/4)},clone:function(){var w=f.clone.call(this);return w.words=this.words.slice(0),w},random:function(w){for(var T=[],P=0;P<w;P+=4)T.push(a());return new _.init(T,w)}}),m=c.enc={},v=m.Hex={stringify:function(w){for(var T=w.words,P=w.sigBytes,M=[],I=0;I<P;I++){var D=T[I>>>2]>>>24-I%4*8&255;M.push((D>>>4).toString(16)),M.push((D&15).toString(16))}return M.join("")},parse:function(w){for(var T=w.length,P=[],M=0;M<T;M+=2)P[M>>>3]|=parseInt(w.substr(M,2),16)<<24-M%8*4;return new _.init(P,T/2)}},y=m.Latin1={stringify:function(w){for(var T=w.words,P=w.sigBytes,M=[],I=0;I<P;I++){var D=T[I>>>2]>>>24-I%4*8&255;M.push(String.fromCharCode(D))}return M.join("")},parse:function(w){for(var T=w.length,P=[],M=0;M<T;M++)P[M>>>2]|=(w.charCodeAt(M)&255)<<24-M%4*8;return new _.init(P,T)}},E=m.Utf8={stringify:function(w){try{return decodeURIComponent(escape(y.stringify(w)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(w){return y.parse(unescape(encodeURIComponent(w)))}},b=d.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new _.init,this._nDataBytes=0},_append:function(w){typeof w=="string"&&(w=E.parse(w)),this._data.concat(w),this._nDataBytes+=w.sigBytes},_process:function(w){var T,P=this._data,M=P.words,I=P.sigBytes,D=this.blockSize,z=D*4,W=I/z;w?W=i.ceil(W):W=i.max((W|0)-this._minBufferSize,0);var K=W*D,Q=i.min(K*4,I);if(K){for(var q=0;q<K;q+=D)this._doProcessBlock(M,q);T=M.splice(0,K),P.sigBytes-=Q}return new _.init(T,Q)},clone:function(){var w=f.clone.call(this);return w._data=this._data.clone(),w},_minBufferSize:0});d.Hasher=b.extend({cfg:f.extend(),init:function(w){this.cfg=this.cfg.extend(w),this.reset()},reset:function(){b.reset.call(this),this._doReset()},update:function(w){return this._append(w),this._process(),this},finalize:function(w){w&&this._append(w);var T=this._doFinalize();return T},blockSize:16,_createHelper:function(w){return function(T,P){return new w.init(P).finalize(T)}},_createHmacHelper:function(w){return function(T,P){return new S.HMAC.init(w,P).finalize(T)}}});var S=c.algo={};return c}(Math);return e})}($o)),$o.exports}(function(r,t){(function(e,i){r.exports=i(xh())})(qe,function(e){return function(){var i=e,n=i.lib,o=n.WordArray,a=i.enc;a.Base64={stringify:function(c){var d=c.words,f=c.sigBytes,_=this._map;c.clamp();for(var m=[],v=0;v<f;v+=3)for(var y=d[v>>>2]>>>24-v%4*8&255,E=d[v+1>>>2]>>>24-(v+1)%4*8&255,b=d[v+2>>>2]>>>24-(v+2)%4*8&255,S=y<<16|E<<8|b,w=0;w<4&&v+w*.75<f;w++)m.push(_.charAt(S>>>6*(3-w)&63));var T=_.charAt(64);if(T)for(;m.length%4;)m.push(T);return m.join("")},parse:function(c){var d=c.length,f=this._map,_=this._reverseMap;if(!_){_=this._reverseMap=[];for(var m=0;m<f.length;m++)_[f.charCodeAt(m)]=m}var v=f.charAt(64);if(v){var y=c.indexOf(v);y!==-1&&(d=y)}return h(c,d,_)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function h(c,d,f){for(var _=[],m=0,v=0;v<d;v++)if(v%4){var y=f[c.charCodeAt(v-1)]<<v%4*2,E=f[c.charCodeAt(v)]>>>6-v%4*2,b=y|E;_[m>>>2]|=b<<24-m%4*8,m++}return o.create(_,m)}}(),e.enc.Base64})})(yh);var Qf=yh.exports;const Jo=ph(Qf);var Eh={exports:{}};(function(r,t){(function(e,i){r.exports=i(xh())})(qe,function(e){return e.enc.Utf8})})(Eh);var tg=Eh.exports;const wh=ph(tg),eg=(r,t)=>{localStorage.setItem(r,Jo.stringify(wh.parse(t)))},ns=r=>{const t=localStorage.getItem(r);return t?Jo.parse(t).toString(wh):null},Lh=r=>{const t=localStorage.getItem(r);return t?Jo.parse(t):null},rs=r=>{localStorage.removeItem(r)};function ig(){const r=document.createElement("div");return r.className="loading-overlay",r.innerHTML="Recuperando Datos de Google Maps",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",r.style.backgroundColor="rgba(255, 255, 255)",r.style.display="flex",r.style.justifyContent="center",r.style.alignItems="center",r.style.color="#000",r.style.fontSize="24px",r.style.zIndex="999999",document.body.appendChild(r),r}function ng(r){r&&r.remove()}const rg=()=>{const t=window.location.href.split("?")[1],e=new URLSearchParams(t),i=Object.fromEntries(e.entries());if(i.coordinates){const n=ig();setTimeout(function(){eg("coordinates",i.coordinates.replace("#/",""))},4e3),setTimeout(function(){window.close(),ng(n)},5e3)}},sg=async()=>{window.open("https://www.google.com/maps/?hl=es","Iniciar Sesion Ciudadania Digital","width=700,height=700,resizable=no"),rs("coordinates"),rs("closePopup");var r=!1;const t=setInterval(function(){let n=ns("coordinates"),o=Lh("closePopup");(n||o)&&(clearInterval(t),r=!0)},1e3);await(async()=>{for(;!r;)await new Promise(n=>setTimeout(n,100));return!0})();let i=ns("coordinates");if(i){const n=JSON.parse(i);return[parseFloat(n.lat),parseFloat(n.long),parseFloat(n.z)]}},og=async r=>{window.open(`http://maps.google.com/?q=${r}`,"Iniciar Sesion Ciudadania Digital","width=700,height=700,resizable=no"),rs("coordinates"),rs("closePopup");var t=!1;const e=setInterval(function(){let o=ns("coordinates"),a=Lh("closePopup");(o||a)&&(clearInterval(e),t=!0)},1e3);await(async()=>{for(;!t;)await new Promise(o=>setTimeout(o,100));return!0})();let n=ns("coordinates");if(n){const o=JSON.parse(n);return[parseFloat(o.lat),parseFloat(o.long),parseFloat(o.z)]}},ss="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=";var os={exports:{}};/* @preserve
1
+ (function(de,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],V):(de=typeof globalThis<"u"?globalThis:de||self,V(de.vueGeojsonViewTs={},de.Vue))})(this,function(de,V){"use strict";var De=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jo(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function lh(r){if(r.__esModule)return r;var t=r.default;if(typeof t=="function"){var e=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),e}var hh={exports:{}};function Bf(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Wo={exports:{}};const Gf=lh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var ch;function uh(){return ch||(ch=1,function(r,t){(function(e,i){r.exports=i()})(De,function(){var e=e||function(i,n){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof De<"u"&&De.crypto&&(o=De.crypto),!o&&typeof Bf=="function")try{o=Gf}catch{}var a=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},h=Object.create||function(){function y(){}return function(x){var T;return y.prototype=x,T=new y,y.prototype=null,T}}(),c={},d=c.lib={},f=d.Base=function(){return{extend:function(y){var x=h(this);return y&&x.mixIn(y),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var x in y)y.hasOwnProperty(x)&&(this[x]=y[x]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),_=d.WordArray=f.extend({init:function(y,x){y=this.words=y||[],x!=n?this.sigBytes=x:this.sigBytes=y.length*4},toString:function(y){return(y||E).stringify(this)},concat:function(y){var x=this.words,T=y.words,k=this.sigBytes,R=y.sigBytes;if(this.clamp(),k%4)for(var M=0;M<R;M++){var A=T[M>>>2]>>>24-M%4*8&255;x[k+M>>>2]|=A<<24-(k+M)%4*8}else for(var z=0;z<R;z+=4)x[k+z>>>2]=T[z>>>2];return this.sigBytes+=R,this},clamp:function(){var y=this.words,x=this.sigBytes;y[x>>>2]&=4294967295<<32-x%4*8,y.length=i.ceil(x/4)},clone:function(){var y=f.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var x=[],T=0;T<y;T+=4)x.push(a());return new _.init(x,y)}}),m=c.enc={},E=m.Hex={stringify:function(y){for(var x=y.words,T=y.sigBytes,k=[],R=0;R<T;R++){var M=x[R>>>2]>>>24-R%4*8&255;k.push((M>>>4).toString(16)),k.push((M&15).toString(16))}return k.join("")},parse:function(y){for(var x=y.length,T=[],k=0;k<x;k+=2)T[k>>>3]|=parseInt(y.substr(k,2),16)<<24-k%8*4;return new _.init(T,x/2)}},v=m.Latin1={stringify:function(y){for(var x=y.words,T=y.sigBytes,k=[],R=0;R<T;R++){var M=x[R>>>2]>>>24-R%4*8&255;k.push(String.fromCharCode(M))}return k.join("")},parse:function(y){for(var x=y.length,T=[],k=0;k<x;k++)T[k>>>2]|=(y.charCodeAt(k)&255)<<24-k%4*8;return new _.init(T,x)}},b=m.Utf8={stringify:function(y){try{return decodeURIComponent(escape(v.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return v.parse(unescape(encodeURIComponent(y)))}},C=d.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new _.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=b.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var x,T=this._data,k=T.words,R=T.sigBytes,M=this.blockSize,A=M*4,z=R/A;y?z=i.ceil(z):z=i.max((z|0)-this._minBufferSize,0);var U=z*M,Z=i.min(U*4,R);if(U){for(var H=0;H<U;H+=M)this._doProcessBlock(k,H);x=k.splice(0,U),T.sigBytes-=Z}return new _.init(x,Z)},clone:function(){var y=f.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});d.Hasher=C.extend({cfg:f.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset()},reset:function(){C.reset.call(this),this._doReset()},update:function(y){return this._append(y),this._process(),this},finalize:function(y){y&&this._append(y);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(y){return function(x,T){return new y.init(T).finalize(x)}},_createHmacHelper:function(y){return function(x,T){return new S.HMAC.init(y,T).finalize(x)}}});var S=c.algo={};return c}(Math);return e})}(Wo)),Wo.exports}(function(r,t){(function(e,i){r.exports=i(uh())})(De,function(e){return function(){var i=e,n=i.lib,o=n.WordArray,a=i.enc;a.Base64={stringify:function(c){var d=c.words,f=c.sigBytes,_=this._map;c.clamp();for(var m=[],E=0;E<f;E+=3)for(var v=d[E>>>2]>>>24-E%4*8&255,b=d[E+1>>>2]>>>24-(E+1)%4*8&255,C=d[E+2>>>2]>>>24-(E+2)%4*8&255,S=v<<16|b<<8|C,y=0;y<4&&E+y*.75<f;y++)m.push(_.charAt(S>>>6*(3-y)&63));var x=_.charAt(64);if(x)for(;m.length%4;)m.push(x);return m.join("")},parse:function(c){var d=c.length,f=this._map,_=this._reverseMap;if(!_){_=this._reverseMap=[];for(var m=0;m<f.length;m++)_[f.charCodeAt(m)]=m}var E=f.charAt(64);if(E){var v=c.indexOf(E);v!==-1&&(d=v)}return h(c,d,_)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function h(c,d,f){for(var _=[],m=0,E=0;E<d;E++)if(E%4){var v=f[c.charCodeAt(E-1)]<<E%4*2,b=f[c.charCodeAt(E)]>>>6-E%4*2,C=v|b;_[m>>>2]|=C<<24-m%4*8,m++}return o.create(_,m)}}(),e.enc.Base64})})(hh);var Uf=hh.exports;const Ho=jo(Uf);var dh={exports:{}};(function(r,t){(function(e,i){r.exports=i(uh())})(De,function(e){return e.enc.Utf8})})(dh);var Zf=dh.exports;const fh=jo(Zf),jf=(r,t)=>{localStorage.setItem(r,Ho.stringify(fh.parse(t)))},Jr=r=>{const t=localStorage.getItem(r);return t?Ho.parse(t).toString(fh):null},gh=r=>{const t=localStorage.getItem(r);return t?Ho.parse(t):null},Qr=r=>{localStorage.removeItem(r)};function Wf(){const r=document.createElement("div");return r.className="loading-overlay",r.innerHTML="Recuperando Datos de Google Maps",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",r.style.backgroundColor="rgba(255, 255, 255)",r.style.display="flex",r.style.justifyContent="center",r.style.alignItems="center",r.style.color="#000",r.style.fontSize="24px",r.style.zIndex="999999",document.body.appendChild(r),r}function Hf(r){r&&r.remove()}const Vf=()=>{const t=window.location.href.split("?")[1],e=new URLSearchParams(t),i=Object.fromEntries(e.entries());if(i.coordinates){const n=Wf();setTimeout(function(){jf("coordinates",i.coordinates.replace("#/",""))},4e3),setTimeout(function(){window.close(),Hf(n)},5e3)}},Xf=async()=>{window.open("https://www.google.com/maps/?hl=es","Iniciar Sesion Ciudadania Digital","width=700,height=700,resizable=no"),Qr("coordinates"),Qr("closePopup");var r=!1;const t=setInterval(function(){let n=Jr("coordinates"),o=gh("closePopup");(n||o)&&(clearInterval(t),r=!0)},1e3);await(async()=>{for(;!r;)await new Promise(n=>setTimeout(n,100));return!0})();let i=Jr("coordinates");if(i){const n=JSON.parse(i);return[parseFloat(n.lat),parseFloat(n.long),parseFloat(n.z)]}},Yf=async r=>{window.open(`http://maps.google.com/?q=${r}`,"Iniciar Sesion Ciudadania Digital","width=700,height=700,resizable=no"),Qr("coordinates"),Qr("closePopup");var t=!1;const e=setInterval(function(){let o=Jr("coordinates"),a=gh("closePopup");(o||a)&&(clearInterval(e),t=!0)},1e3);await(async()=>{for(;!t;)await new Promise(o=>setTimeout(o,100));return!0})();let n=Jr("coordinates");if(n){const o=JSON.parse(n);return[parseFloat(o.lat),parseFloat(o.long),parseFloat(o.z)]}},ts="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=";var Vo={exports:{}};/* @preserve
2
2
  * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
3
3
  * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
4
- */var bh;function Th(){return bh||(bh=1,function(r,t){(function(e,i){i(t)})(qe,function(e){var i="1.9.4";function n(s){var l,u,g,p;for(u=1,g=arguments.length;u<g;u++){p=arguments[u];for(l in p)s[l]=p[l]}return s}var o=Object.create||function(){function s(){}return function(l){return s.prototype=l,new s}}();function a(s,l){var u=Array.prototype.slice;if(s.bind)return s.bind.apply(s,u.call(arguments,1));var g=u.call(arguments,2);return function(){return s.apply(l,g.length?g.concat(u.call(arguments)):arguments)}}var h=0;function c(s){return"_leaflet_id"in s||(s._leaflet_id=++h),s._leaflet_id}function d(s,l,u){var g,p,x,C;return C=function(){g=!1,p&&(x.apply(u,p),p=!1)},x=function(){g?p=arguments:(s.apply(u,arguments),setTimeout(C,l),g=!0)},x}function f(s,l,u){var g=l[1],p=l[0],x=g-p;return s===g&&u?s:((s-p)%x+x)%x+p}function _(){return!1}function m(s,l){if(l===!1)return s;var u=Math.pow(10,l===void 0?6:l);return Math.round(s*u)/u}function v(s){return s.trim?s.trim():s.replace(/^\s+|\s+$/g,"")}function y(s){return v(s).split(/\s+/)}function E(s,l){Object.prototype.hasOwnProperty.call(s,"options")||(s.options=s.options?o(s.options):{});for(var u in l)s.options[u]=l[u];return s.options}function b(s,l,u){var g=[];for(var p in s)g.push(encodeURIComponent(u?p.toUpperCase():p)+"="+encodeURIComponent(s[p]));return(!l||l.indexOf("?")===-1?"?":"&")+g.join("&")}var S=/\{ *([\w_ -]+) *\}/g;function w(s,l){return s.replace(S,function(u,g){var p=l[g];if(p===void 0)throw new Error("No value provided for variable "+u);return typeof p=="function"&&(p=p(l)),p})}var T=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"};function P(s,l){for(var u=0;u<s.length;u++)if(s[u]===l)return u;return-1}var M="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function I(s){return window["webkit"+s]||window["moz"+s]||window["ms"+s]}var D=0;function z(s){var l=+new Date,u=Math.max(0,16-(l-D));return D=l+u,window.setTimeout(s,u)}var W=window.requestAnimationFrame||I("RequestAnimationFrame")||z,K=window.cancelAnimationFrame||I("CancelAnimationFrame")||I("CancelRequestAnimationFrame")||function(s){window.clearTimeout(s)};function Q(s,l,u){if(u&&W===z)s.call(l);else return W.call(window,a(s,l))}function q(s){s&&K.call(window,s)}var ct={__proto__:null,extend:n,create:o,bind:a,get lastId(){return h},stamp:c,throttle:d,wrapNum:f,falseFn:_,formatNum:m,trim:v,splitWords:y,setOptions:E,getParamString:b,template:w,isArray:T,indexOf:P,emptyImageUrl:M,requestFn:W,cancelFn:K,requestAnimFrame:Q,cancelAnimFrame:q};function Et(){}Et.extend=function(s){var l=function(){E(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},u=l.__super__=this.prototype,g=o(u);g.constructor=l,l.prototype=g;for(var p in this)Object.prototype.hasOwnProperty.call(this,p)&&p!=="prototype"&&p!=="__super__"&&(l[p]=this[p]);return s.statics&&n(l,s.statics),s.includes&&(V(s.includes),n.apply(null,[g].concat(s.includes))),n(g,s),delete g.statics,delete g.includes,g.options&&(g.options=u.options?o(u.options):{},n(g.options,s.options)),g._initHooks=[],g.callInitHooks=function(){if(!this._initHooksCalled){u.callInitHooks&&u.callInitHooks.call(this),this._initHooksCalled=!0;for(var x=0,C=g._initHooks.length;x<C;x++)g._initHooks[x].call(this)}},l},Et.include=function(s){var l=this.prototype.options;return n(this.prototype,s),s.options&&(this.prototype.options=l,this.mergeOptions(s.options)),this},Et.mergeOptions=function(s){return n(this.prototype.options,s),this},Et.addInitHook=function(s){var l=Array.prototype.slice.call(arguments,1),u=typeof s=="function"?s:function(){this[s].apply(this,l)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(u),this};function V(s){if(!(typeof L>"u"||!L||!L.Mixin)){s=T(s)?s:[s];for(var l=0;l<s.length;l++)s[l]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var H={on:function(s,l,u){if(typeof s=="object")for(var g in s)this._on(g,s[g],l);else{s=y(s);for(var p=0,x=s.length;p<x;p++)this._on(s[p],l,u)}return this},off:function(s,l,u){if(!arguments.length)delete this._events;else if(typeof s=="object")for(var g in s)this._off(g,s[g],l);else{s=y(s);for(var p=arguments.length===1,x=0,C=s.length;x<C;x++)p?this._off(s[x]):this._off(s[x],l,u)}return this},_on:function(s,l,u,g){if(typeof l!="function"){console.warn("wrong listener type: "+typeof l);return}if(this._listens(s,l,u)===!1){u===this&&(u=void 0);var p={fn:l,ctx:u};g&&(p.once=!0),this._events=this._events||{},this._events[s]=this._events[s]||[],this._events[s].push(p)}},_off:function(s,l,u){var g,p,x;if(this._events&&(g=this._events[s],!!g)){if(arguments.length===1){if(this._firingCount)for(p=0,x=g.length;p<x;p++)g[p].fn=_;delete this._events[s];return}if(typeof l!="function"){console.warn("wrong listener type: "+typeof l);return}var C=this._listens(s,l,u);if(C!==!1){var k=g[C];this._firingCount&&(k.fn=_,this._events[s]=g=g.slice()),g.splice(C,1)}}},fire:function(s,l,u){if(!this.listens(s,u))return this;var g=n({},l,{type:s,target:this,sourceTarget:l&&l.sourceTarget||this});if(this._events){var p=this._events[s];if(p){this._firingCount=this._firingCount+1||1;for(var x=0,C=p.length;x<C;x++){var k=p[x],R=k.fn;k.once&&this.off(s,R,k.ctx),R.call(k.ctx||this,g)}this._firingCount--}}return u&&this._propagateEvent(g),this},listens:function(s,l,u,g){typeof s!="string"&&console.warn('"string" type argument expected');var p=l;typeof l!="function"&&(g=!!l,p=void 0,u=void 0);var x=this._events&&this._events[s];if(x&&x.length&&this._listens(s,p,u)!==!1)return!0;if(g){for(var C in this._eventParents)if(this._eventParents[C].listens(s,l,u,g))return!0}return!1},_listens:function(s,l,u){if(!this._events)return!1;var g=this._events[s]||[];if(!l)return!!g.length;u===this&&(u=void 0);for(var p=0,x=g.length;p<x;p++)if(g[p].fn===l&&g[p].ctx===u)return p;return!1},once:function(s,l,u){if(typeof s=="object")for(var g in s)this._on(g,s[g],l,!0);else{s=y(s);for(var p=0,x=s.length;p<x;p++)this._on(s[p],l,u,!0)}return this},addEventParent:function(s){return this._eventParents=this._eventParents||{},this._eventParents[c(s)]=s,this},removeEventParent:function(s){return this._eventParents&&delete this._eventParents[c(s)],this},_propagateEvent:function(s){for(var l in this._eventParents)this._eventParents[l].fire(s.type,n({layer:s.target,propagatedFrom:s.target},s),!0)}};H.addEventListener=H.on,H.removeEventListener=H.clearAllEventListeners=H.off,H.addOneTimeEventListener=H.once,H.fireEvent=H.fire,H.hasEventListeners=H.listens;var Z=Et.extend(H);function B(s,l,u){this.x=u?Math.round(s):s,this.y=u?Math.round(l):l}var yt=Math.trunc||function(s){return s>0?Math.floor(s):Math.ceil(s)};B.prototype={clone:function(){return new B(this.x,this.y)},add:function(s){return this.clone()._add(U(s))},_add:function(s){return this.x+=s.x,this.y+=s.y,this},subtract:function(s){return this.clone()._subtract(U(s))},_subtract:function(s){return this.x-=s.x,this.y-=s.y,this},divideBy:function(s){return this.clone()._divideBy(s)},_divideBy:function(s){return this.x/=s,this.y/=s,this},multiplyBy:function(s){return this.clone()._multiplyBy(s)},_multiplyBy:function(s){return this.x*=s,this.y*=s,this},scaleBy:function(s){return new B(this.x*s.x,this.y*s.y)},unscaleBy:function(s){return new B(this.x/s.x,this.y/s.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=yt(this.x),this.y=yt(this.y),this},distanceTo:function(s){s=U(s);var l=s.x-this.x,u=s.y-this.y;return Math.sqrt(l*l+u*u)},equals:function(s){return s=U(s),s.x===this.x&&s.y===this.y},contains:function(s){return s=U(s),Math.abs(s.x)<=Math.abs(this.x)&&Math.abs(s.y)<=Math.abs(this.y)},toString:function(){return"Point("+m(this.x)+", "+m(this.y)+")"}};function U(s,l,u){return s instanceof B?s:T(s)?new B(s[0],s[1]):s==null?s:typeof s=="object"&&"x"in s&&"y"in s?new B(s.x,s.y):new B(s,l,u)}function st(s,l){if(s)for(var u=l?[s,l]:s,g=0,p=u.length;g<p;g++)this.extend(u[g])}st.prototype={extend:function(s){var l,u;if(!s)return this;if(s instanceof B||typeof s[0]=="number"||"x"in s)l=u=U(s);else if(s=F(s),l=s.min,u=s.max,!l||!u)return this;return!this.min&&!this.max?(this.min=l.clone(),this.max=u.clone()):(this.min.x=Math.min(l.x,this.min.x),this.max.x=Math.max(u.x,this.max.x),this.min.y=Math.min(l.y,this.min.y),this.max.y=Math.max(u.y,this.max.y)),this},getCenter:function(s){return U((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,s)},getBottomLeft:function(){return U(this.min.x,this.max.y)},getTopRight:function(){return U(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(s){var l,u;return typeof s[0]=="number"||s instanceof B?s=U(s):s=F(s),s instanceof st?(l=s.min,u=s.max):l=u=s,l.x>=this.min.x&&u.x<=this.max.x&&l.y>=this.min.y&&u.y<=this.max.y},intersects:function(s){s=F(s);var l=this.min,u=this.max,g=s.min,p=s.max,x=p.x>=l.x&&g.x<=u.x,C=p.y>=l.y&&g.y<=u.y;return x&&C},overlaps:function(s){s=F(s);var l=this.min,u=this.max,g=s.min,p=s.max,x=p.x>l.x&&g.x<u.x,C=p.y>l.y&&g.y<u.y;return x&&C},isValid:function(){return!!(this.min&&this.max)},pad:function(s){var l=this.min,u=this.max,g=Math.abs(l.x-u.x)*s,p=Math.abs(l.y-u.y)*s;return F(U(l.x-g,l.y-p),U(u.x+g,u.y+p))},equals:function(s){return s?(s=F(s),this.min.equals(s.getTopLeft())&&this.max.equals(s.getBottomRight())):!1}};function F(s,l){return!s||s instanceof st?s:new st(s,l)}function Lt(s,l){if(s)for(var u=l?[s,l]:s,g=0,p=u.length;g<p;g++)this.extend(u[g])}Lt.prototype={extend:function(s){var l=this._southWest,u=this._northEast,g,p;if(s instanceof Y)g=s,p=s;else if(s instanceof Lt){if(g=s._southWest,p=s._northEast,!g||!p)return this}else return s?this.extend(nt(s)||J(s)):this;return!l&&!u?(this._southWest=new Y(g.lat,g.lng),this._northEast=new Y(p.lat,p.lng)):(l.lat=Math.min(g.lat,l.lat),l.lng=Math.min(g.lng,l.lng),u.lat=Math.max(p.lat,u.lat),u.lng=Math.max(p.lng,u.lng)),this},pad:function(s){var l=this._southWest,u=this._northEast,g=Math.abs(l.lat-u.lat)*s,p=Math.abs(l.lng-u.lng)*s;return new Lt(new Y(l.lat-g,l.lng-p),new Y(u.lat+g,u.lng+p))},getCenter:function(){return new Y((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new Y(this.getNorth(),this.getWest())},getSouthEast:function(){return new Y(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(s){typeof s[0]=="number"||s instanceof Y||"lat"in s?s=nt(s):s=J(s);var l=this._southWest,u=this._northEast,g,p;return s instanceof Lt?(g=s.getSouthWest(),p=s.getNorthEast()):g=p=s,g.lat>=l.lat&&p.lat<=u.lat&&g.lng>=l.lng&&p.lng<=u.lng},intersects:function(s){s=J(s);var l=this._southWest,u=this._northEast,g=s.getSouthWest(),p=s.getNorthEast(),x=p.lat>=l.lat&&g.lat<=u.lat,C=p.lng>=l.lng&&g.lng<=u.lng;return x&&C},overlaps:function(s){s=J(s);var l=this._southWest,u=this._northEast,g=s.getSouthWest(),p=s.getNorthEast(),x=p.lat>l.lat&&g.lat<u.lat,C=p.lng>l.lng&&g.lng<u.lng;return x&&C},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(s,l){return s?(s=J(s),this._southWest.equals(s.getSouthWest(),l)&&this._northEast.equals(s.getNorthEast(),l)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function J(s,l){return s instanceof Lt?s:new Lt(s,l)}function Y(s,l,u){if(isNaN(s)||isNaN(l))throw new Error("Invalid LatLng object: ("+s+", "+l+")");this.lat=+s,this.lng=+l,u!==void 0&&(this.alt=+u)}Y.prototype={equals:function(s,l){if(!s)return!1;s=nt(s);var u=Math.max(Math.abs(this.lat-s.lat),Math.abs(this.lng-s.lng));return u<=(l===void 0?1e-9:l)},toString:function(s){return"LatLng("+m(this.lat,s)+", "+m(this.lng,s)+")"},distanceTo:function(s){return St.distance(this,nt(s))},wrap:function(){return St.wrapLatLng(this)},toBounds:function(s){var l=180*s/40075017,u=l/Math.cos(Math.PI/180*this.lat);return J([this.lat-l,this.lng-u],[this.lat+l,this.lng+u])},clone:function(){return new Y(this.lat,this.lng,this.alt)}};function nt(s,l,u){return s instanceof Y?s:T(s)&&typeof s[0]!="object"?s.length===3?new Y(s[0],s[1],s[2]):s.length===2?new Y(s[0],s[1]):null:s==null?s:typeof s=="object"&&"lat"in s?new Y(s.lat,"lng"in s?s.lng:s.lon,s.alt):l===void 0?null:new Y(s,l,u)}var Ft={latLngToPoint:function(s,l){var u=this.projection.project(s),g=this.scale(l);return this.transformation._transform(u,g)},pointToLatLng:function(s,l){var u=this.scale(l),g=this.transformation.untransform(s,u);return this.projection.unproject(g)},project:function(s){return this.projection.project(s)},unproject:function(s){return this.projection.unproject(s)},scale:function(s){return 256*Math.pow(2,s)},zoom:function(s){return Math.log(s/256)/Math.LN2},getProjectedBounds:function(s){if(this.infinite)return null;var l=this.projection.bounds,u=this.scale(s),g=this.transformation.transform(l.min,u),p=this.transformation.transform(l.max,u);return new st(g,p)},infinite:!1,wrapLatLng:function(s){var l=this.wrapLng?f(s.lng,this.wrapLng,!0):s.lng,u=this.wrapLat?f(s.lat,this.wrapLat,!0):s.lat,g=s.alt;return new Y(u,l,g)},wrapLatLngBounds:function(s){var l=s.getCenter(),u=this.wrapLatLng(l),g=l.lat-u.lat,p=l.lng-u.lng;if(g===0&&p===0)return s;var x=s.getSouthWest(),C=s.getNorthEast(),k=new Y(x.lat-g,x.lng-p),R=new Y(C.lat-g,C.lng-p);return new Lt(k,R)}},St=n({},Ft,{wrapLng:[-180,180],R:6371e3,distance:function(s,l){var u=Math.PI/180,g=s.lat*u,p=l.lat*u,x=Math.sin((l.lat-s.lat)*u/2),C=Math.sin((l.lng-s.lng)*u/2),k=x*x+Math.cos(g)*Math.cos(p)*C*C,R=2*Math.atan2(Math.sqrt(k),Math.sqrt(1-k));return this.R*R}}),ve=6378137,je={R:ve,MAX_LATITUDE:85.0511287798,project:function(s){var l=Math.PI/180,u=this.MAX_LATITUDE,g=Math.max(Math.min(u,s.lat),-u),p=Math.sin(g*l);return new B(this.R*s.lng*l,this.R*Math.log((1+p)/(1-p))/2)},unproject:function(s){var l=180/Math.PI;return new Y((2*Math.atan(Math.exp(s.y/this.R))-Math.PI/2)*l,s.x*l/this.R)},bounds:function(){var s=ve*Math.PI;return new st([-s,-s],[s,s])}()};function Di(s,l,u,g){if(T(s)){this._a=s[0],this._b=s[1],this._c=s[2],this._d=s[3];return}this._a=s,this._b=l,this._c=u,this._d=g}Di.prototype={transform:function(s,l){return this._transform(s.clone(),l)},_transform:function(s,l){return l=l||1,s.x=l*(this._a*s.x+this._b),s.y=l*(this._c*s.y+this._d),s},untransform:function(s,l){return l=l||1,new B((s.x/l-this._b)/this._a,(s.y/l-this._d)/this._c)}};function xe(s,l,u,g){return new Di(s,l,u,g)}var Oi=n({},St,{code:"EPSG:3857",projection:je,transformation:function(){var s=.5/(Math.PI*je.R);return xe(s,.5,-s,.5)}()}),We=n({},Oi,{code:"EPSG:900913"});function Fi(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function Pe(s,l){var u="",g,p,x,C,k,R;for(g=0,x=s.length;g<x;g++){for(k=s[g],p=0,C=k.length;p<C;p++)R=k[p],u+=(p?"L":"M")+R.x+" "+R.y;u+=l?X.svg?"z":"x":""}return u||"M0 0"}var zi=document.documentElement.style,di="ActiveXObject"in window,Xn=di&&!document.addEventListener,fi="msLaunchUri"in navigator&&!("documentMode"in document),hn=zt("webkit"),Xt=zt("android"),ie=zt("android 2")||zt("android 3"),me=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),ke=Xt&&zt("Google")&&me<537&&!("AudioNode"in window),He=!!window.opera,Ve=!fi&&zt("chrome"),Re=zt("gecko")&&!hn&&!He&&!di,Ni=!Ve&&zt("safari"),cn=zt("phantom"),Wt="OTransition"in zi,Ur=navigator.platform.indexOf("Win")===0,Po=di&&"transition"in zi,Zr="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ie,jr="MozPerspective"in zi,ko=!window.L_DISABLE_3D&&(Po||Zr||jr)&&!Wt&&!cn,gi=typeof orientation<"u"||zt("mobile"),Ro=gi&&hn,Wr=gi&&Zr,Bi=!window.PointerEvent&&window.MSPointerEvent,Gi=!!(window.PointerEvent||Bi),Ui="ontouchstart"in window||!!window.TouchEvent,Mo=!window.L_NO_TOUCH&&(Ui||Gi),Io=gi&&He,ne=gi&&Re,Zi=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,he=function(){var s=!1;try{var l=Object.defineProperty({},"passive",{get:function(){s=!0}});window.addEventListener("testPassiveEventSupport",_,l),window.removeEventListener("testPassiveEventSupport",_,l)}catch{}return s}(),Me=function(){return!!document.createElement("canvas").getContext}(),Yt=!!(document.createElementNS&&Fi("svg").createSVGRect),Yn=!!Yt&&function(){var s=document.createElement("div");return s.innerHTML="<svg/>",(s.firstChild&&s.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Kn=!Yt&&function(){try{var s=document.createElement("div");s.innerHTML='<v:shape adj="1"/>';var l=s.firstChild;return l.style.behavior="url(#default#VML)",l&&typeof l.adj=="object"}catch{return!1}}(),te=navigator.platform.indexOf("Mac")===0,ce=navigator.platform.indexOf("Linux")===0;function zt(s){return navigator.userAgent.toLowerCase().indexOf(s)>=0}var X={ie:di,ielt9:Xn,edge:fi,webkit:hn,android:Xt,android23:ie,androidStock:ke,opera:He,chrome:Ve,gecko:Re,safari:Ni,phantom:cn,opera12:Wt,win:Ur,ie3d:Po,webkit3d:Zr,gecko3d:jr,any3d:ko,mobile:gi,mobileWebkit:Ro,mobileWebkit3d:Wr,msPointer:Bi,pointer:Gi,touch:Mo,touchNative:Ui,mobileOpera:Io,mobileGecko:ne,retina:Zi,passiveEvents:he,canvas:Me,svg:Yt,vml:Kn,inlineSvg:Yn,mac:te,linux:ce},ef=X.msPointer?"MSPointerDown":"pointerdown",nf=X.msPointer?"MSPointerMove":"pointermove",rf=X.msPointer?"MSPointerUp":"pointerup",sf=X.msPointer?"MSPointerCancel":"pointercancel",Wl={touchstart:ef,touchmove:nf,touchend:rf,touchcancel:sf},of={touchstart:bw,touchmove:Ao,touchend:Ao,touchcancel:Ao},qn={},af=!1;function vw(s,l,u){return l==="touchstart"&&Lw(),of[l]?(u=of[l].bind(this,u),s.addEventListener(Wl[l],u,!1),u):(console.warn("wrong event specified:",l),_)}function xw(s,l,u){if(!Wl[l]){console.warn("wrong event specified:",l);return}s.removeEventListener(Wl[l],u,!1)}function Ew(s){qn[s.pointerId]=s}function ww(s){qn[s.pointerId]&&(qn[s.pointerId]=s)}function lf(s){delete qn[s.pointerId]}function Lw(){af||(document.addEventListener(ef,Ew,!0),document.addEventListener(nf,ww,!0),document.addEventListener(rf,lf,!0),document.addEventListener(sf,lf,!0),af=!0)}function Ao(s,l){if(l.pointerType!==(l.MSPOINTER_TYPE_MOUSE||"mouse")){l.touches=[];for(var u in qn)l.touches.push(qn[u]);l.changedTouches=[l],s(l)}}function bw(s,l){l.MSPOINTER_TYPE_TOUCH&&l.pointerType===l.MSPOINTER_TYPE_TOUCH&&Kt(l),Ao(s,l)}function Tw(s){var l={},u,g;for(g in s)u=s[g],l[g]=u&&u.bind?u.bind(s):u;return s=l,l.type="dblclick",l.detail=2,l.isTrusted=!1,l._simulated=!0,l}var Cw=200;function Sw(s,l){s.addEventListener("dblclick",l);var u=0,g;function p(x){if(x.detail!==1){g=x.detail;return}if(!(x.pointerType==="mouse"||x.sourceCapabilities&&!x.sourceCapabilities.firesTouchEvents)){var C=ff(x);if(!(C.some(function(R){return R instanceof HTMLLabelElement&&R.attributes.for})&&!C.some(function(R){return R instanceof HTMLInputElement||R instanceof HTMLSelectElement}))){var k=Date.now();k-u<=Cw?(g++,g===2&&l(Tw(x))):g=1,u=k}}}return s.addEventListener("click",p),{dblclick:l,simDblclick:p}}function Pw(s,l){s.removeEventListener("dblclick",l.dblclick),s.removeEventListener("click",l.simDblclick)}var Hl=Fo(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Hr=Fo(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),hf=Hr==="webkitTransition"||Hr==="OTransition"?Hr+"End":"transitionend";function cf(s){return typeof s=="string"?document.getElementById(s):s}function Vr(s,l){var u=s.style[l]||s.currentStyle&&s.currentStyle[l];if((!u||u==="auto")&&document.defaultView){var g=document.defaultView.getComputedStyle(s,null);u=g?g[l]:null}return u==="auto"?null:u}function mt(s,l,u){var g=document.createElement(s);return g.className=l||"",u&&u.appendChild(g),g}function Rt(s){var l=s.parentNode;l&&l.removeChild(s)}function Do(s){for(;s.firstChild;)s.removeChild(s.firstChild)}function $n(s){var l=s.parentNode;l&&l.lastChild!==s&&l.appendChild(s)}function Jn(s){var l=s.parentNode;l&&l.firstChild!==s&&l.insertBefore(s,l.firstChild)}function Vl(s,l){if(s.classList!==void 0)return s.classList.contains(l);var u=Oo(s);return u.length>0&&new RegExp("(^|\\s)"+l+"(\\s|$)").test(u)}function lt(s,l){if(s.classList!==void 0)for(var u=y(l),g=0,p=u.length;g<p;g++)s.classList.add(u[g]);else if(!Vl(s,l)){var x=Oo(s);Xl(s,(x?x+" ":"")+l)}}function At(s,l){s.classList!==void 0?s.classList.remove(l):Xl(s,v((" "+Oo(s)+" ").replace(" "+l+" "," ")))}function Xl(s,l){s.className.baseVal===void 0?s.className=l:s.className.baseVal=l}function Oo(s){return s.correspondingElement&&(s=s.correspondingElement),s.className.baseVal===void 0?s.className:s.className.baseVal}function Ee(s,l){"opacity"in s.style?s.style.opacity=l:"filter"in s.style&&kw(s,l)}function kw(s,l){var u=!1,g="DXImageTransform.Microsoft.Alpha";try{u=s.filters.item(g)}catch{if(l===1)return}l=Math.round(l*100),u?(u.Enabled=l!==100,u.Opacity=l):s.style.filter+=" progid:"+g+"(opacity="+l+")"}function Fo(s){for(var l=document.documentElement.style,u=0;u<s.length;u++)if(s[u]in l)return s[u];return!1}function un(s,l,u){var g=l||new B(0,0);s.style[Hl]=(X.ie3d?"translate("+g.x+"px,"+g.y+"px)":"translate3d("+g.x+"px,"+g.y+"px,0)")+(u?" scale("+u+")":"")}function Nt(s,l){s._leaflet_pos=l,X.any3d?un(s,l):(s.style.left=l.x+"px",s.style.top=l.y+"px")}function dn(s){return s._leaflet_pos||new B(0,0)}var Xr,Yr,Yl;if("onselectstart"in document)Xr=function(){ot(window,"selectstart",Kt)},Yr=function(){Pt(window,"selectstart",Kt)};else{var Kr=Fo(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Xr=function(){if(Kr){var s=document.documentElement.style;Yl=s[Kr],s[Kr]="none"}},Yr=function(){Kr&&(document.documentElement.style[Kr]=Yl,Yl=void 0)}}function Kl(){ot(window,"dragstart",Kt)}function ql(){Pt(window,"dragstart",Kt)}var zo,$l;function Jl(s){for(;s.tabIndex===-1;)s=s.parentNode;s.style&&(No(),zo=s,$l=s.style.outlineStyle,s.style.outlineStyle="none",ot(window,"keydown",No))}function No(){zo&&(zo.style.outlineStyle=$l,zo=void 0,$l=void 0,Pt(window,"keydown",No))}function uf(s){do s=s.parentNode;while((!s.offsetWidth||!s.offsetHeight)&&s!==document.body);return s}function Ql(s){var l=s.getBoundingClientRect();return{x:l.width/s.offsetWidth||1,y:l.height/s.offsetHeight||1,boundingClientRect:l}}var Rw={__proto__:null,TRANSFORM:Hl,TRANSITION:Hr,TRANSITION_END:hf,get:cf,getStyle:Vr,create:mt,remove:Rt,empty:Do,toFront:$n,toBack:Jn,hasClass:Vl,addClass:lt,removeClass:At,setClass:Xl,getClass:Oo,setOpacity:Ee,testProp:Fo,setTransform:un,setPosition:Nt,getPosition:dn,get disableTextSelection(){return Xr},get enableTextSelection(){return Yr},disableImageDrag:Kl,enableImageDrag:ql,preventOutline:Jl,restoreOutline:No,getSizedParentNode:uf,getScale:Ql};function ot(s,l,u,g){if(l&&typeof l=="object")for(var p in l)eh(s,p,l[p],u);else{l=y(l);for(var x=0,C=l.length;x<C;x++)eh(s,l[x],u,g)}return this}var Xe="_leaflet_events";function Pt(s,l,u,g){if(arguments.length===1)df(s),delete s[Xe];else if(l&&typeof l=="object")for(var p in l)ih(s,p,l[p],u);else if(l=y(l),arguments.length===2)df(s,function(k){return P(l,k)!==-1});else for(var x=0,C=l.length;x<C;x++)ih(s,l[x],u,g);return this}function df(s,l){for(var u in s[Xe]){var g=u.split(/\d/)[0];(!l||l(g))&&ih(s,g,null,null,u)}}var th={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function eh(s,l,u,g){var p=l+c(u)+(g?"_"+c(g):"");if(s[Xe]&&s[Xe][p])return this;var x=function(k){return u.call(g||s,k||window.event)},C=x;!X.touchNative&&X.pointer&&l.indexOf("touch")===0?x=vw(s,l,x):X.touch&&l==="dblclick"?x=Sw(s,x):"addEventListener"in s?l==="touchstart"||l==="touchmove"||l==="wheel"||l==="mousewheel"?s.addEventListener(th[l]||l,x,X.passiveEvents?{passive:!1}:!1):l==="mouseenter"||l==="mouseleave"?(x=function(k){k=k||window.event,rh(s,k)&&C(k)},s.addEventListener(th[l],x,!1)):s.addEventListener(l,C,!1):s.attachEvent("on"+l,x),s[Xe]=s[Xe]||{},s[Xe][p]=x}function ih(s,l,u,g,p){p=p||l+c(u)+(g?"_"+c(g):"");var x=s[Xe]&&s[Xe][p];if(!x)return this;!X.touchNative&&X.pointer&&l.indexOf("touch")===0?xw(s,l,x):X.touch&&l==="dblclick"?Pw(s,x):"removeEventListener"in s?s.removeEventListener(th[l]||l,x,!1):s.detachEvent("on"+l,x),s[Xe][p]=null}function fn(s){return s.stopPropagation?s.stopPropagation():s.originalEvent?s.originalEvent._stopped=!0:s.cancelBubble=!0,this}function nh(s){return eh(s,"wheel",fn),this}function qr(s){return ot(s,"mousedown touchstart dblclick contextmenu",fn),s._leaflet_disable_click=!0,this}function Kt(s){return s.preventDefault?s.preventDefault():s.returnValue=!1,this}function gn(s){return Kt(s),fn(s),this}function ff(s){if(s.composedPath)return s.composedPath();for(var l=[],u=s.target;u;)l.push(u),u=u.parentNode;return l}function gf(s,l){if(!l)return new B(s.clientX,s.clientY);var u=Ql(l),g=u.boundingClientRect;return new B((s.clientX-g.left)/u.x-l.clientLeft,(s.clientY-g.top)/u.y-l.clientTop)}var Mw=X.linux&&X.chrome?window.devicePixelRatio:X.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function _f(s){return X.edge?s.wheelDeltaY/2:s.deltaY&&s.deltaMode===0?-s.deltaY/Mw:s.deltaY&&s.deltaMode===1?-s.deltaY*20:s.deltaY&&s.deltaMode===2?-s.deltaY*60:s.deltaX||s.deltaZ?0:s.wheelDelta?(s.wheelDeltaY||s.wheelDelta)/2:s.detail&&Math.abs(s.detail)<32765?-s.detail*20:s.detail?s.detail/-32765*60:0}function rh(s,l){var u=l.relatedTarget;if(!u)return!0;try{for(;u&&u!==s;)u=u.parentNode}catch{return!1}return u!==s}var Iw={__proto__:null,on:ot,off:Pt,stopPropagation:fn,disableScrollPropagation:nh,disableClickPropagation:qr,preventDefault:Kt,stop:gn,getPropagationPath:ff,getMousePosition:gf,getWheelDelta:_f,isExternalTarget:rh,addListener:ot,removeListener:Pt},pf=Z.extend({run:function(s,l,u,g){this.stop(),this._el=s,this._inProgress=!0,this._duration=u||.25,this._easeOutPower=1/Math.max(g||.5,.2),this._startPos=dn(s),this._offset=l.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=Q(this._animate,this),this._step()},_step:function(s){var l=+new Date-this._startTime,u=this._duration*1e3;l<u?this._runFrame(this._easeOut(l/u),s):(this._runFrame(1),this._complete())},_runFrame:function(s,l){var u=this._startPos.add(this._offset.multiplyBy(s));l&&u._round(),Nt(this._el,u),this.fire("step")},_complete:function(){q(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(s){return 1-Math.pow(1-s,this._easeOutPower)}}),_t=Z.extend({options:{crs:Oi,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(s,l){l=E(this,l),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(s),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),l.maxBounds&&this.setMaxBounds(l.maxBounds),l.zoom!==void 0&&(this._zoom=this._limitZoom(l.zoom)),l.center&&l.zoom!==void 0&&this.setView(nt(l.center),l.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Hr&&X.any3d&&!X.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ot(this._proxy,hf,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(s,l,u){if(l=l===void 0?this._zoom:this._limitZoom(l),s=this._limitCenter(nt(s),l,this.options.maxBounds),u=u||{},this._stop(),this._loaded&&!u.reset&&u!==!0){u.animate!==void 0&&(u.zoom=n({animate:u.animate},u.zoom),u.pan=n({animate:u.animate,duration:u.duration},u.pan));var g=this._zoom!==l?this._tryAnimatedZoom&&this._tryAnimatedZoom(s,l,u.zoom):this._tryAnimatedPan(s,u.pan);if(g)return clearTimeout(this._sizeTimer),this}return this._resetView(s,l,u.pan&&u.pan.noMoveStart),this},setZoom:function(s,l){return this._loaded?this.setView(this.getCenter(),s,{zoom:l}):(this._zoom=s,this)},zoomIn:function(s,l){return s=s||(X.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+s,l)},zoomOut:function(s,l){return s=s||(X.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-s,l)},setZoomAround:function(s,l,u){var g=this.getZoomScale(l),p=this.getSize().divideBy(2),x=s instanceof B?s:this.latLngToContainerPoint(s),C=x.subtract(p).multiplyBy(1-1/g),k=this.containerPointToLatLng(p.add(C));return this.setView(k,l,{zoom:u})},_getBoundsCenterZoom:function(s,l){l=l||{},s=s.getBounds?s.getBounds():J(s);var u=U(l.paddingTopLeft||l.padding||[0,0]),g=U(l.paddingBottomRight||l.padding||[0,0]),p=this.getBoundsZoom(s,!1,u.add(g));if(p=typeof l.maxZoom=="number"?Math.min(l.maxZoom,p):p,p===1/0)return{center:s.getCenter(),zoom:p};var x=g.subtract(u).divideBy(2),C=this.project(s.getSouthWest(),p),k=this.project(s.getNorthEast(),p),R=this.unproject(C.add(k).divideBy(2).add(x),p);return{center:R,zoom:p}},fitBounds:function(s,l){if(s=J(s),!s.isValid())throw new Error("Bounds are not valid.");var u=this._getBoundsCenterZoom(s,l);return this.setView(u.center,u.zoom,l)},fitWorld:function(s){return this.fitBounds([[-90,-180],[90,180]],s)},panTo:function(s,l){return this.setView(s,this._zoom,{pan:l})},panBy:function(s,l){if(s=U(s).round(),l=l||{},!s.x&&!s.y)return this.fire("moveend");if(l.animate!==!0&&!this.getSize().contains(s))return this._resetView(this.unproject(this.project(this.getCenter()).add(s)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new pf,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),l.noMoveStart||this.fire("movestart"),l.animate!==!1){lt(this._mapPane,"leaflet-pan-anim");var u=this._getMapPanePos().subtract(s).round();this._panAnim.run(this._mapPane,u,l.duration||.25,l.easeLinearity)}else this._rawPanBy(s),this.fire("move").fire("moveend");return this},flyTo:function(s,l,u){if(u=u||{},u.animate===!1||!X.any3d)return this.setView(s,l,u);this._stop();var g=this.project(this.getCenter()),p=this.project(s),x=this.getSize(),C=this._zoom;s=nt(s),l=l===void 0?C:l;var k=Math.max(x.x,x.y),R=k*this.getZoomScale(C,l),O=p.distanceTo(g)||1,j=1.42,et=j*j;function ut(Bt){var qo=Bt?-1:1,xL=Bt?R:k,EL=R*R-k*k+qo*et*et*O*O,wL=2*xL*et*O,_h=EL/wL,qf=Math.sqrt(_h*_h+1)-_h,LL=qf<1e-9?-18:Math.log(qf);return LL}function re(Bt){return(Math.exp(Bt)-Math.exp(-Bt))/2}function Ht(Bt){return(Math.exp(Bt)+Math.exp(-Bt))/2}function Le(Bt){return re(Bt)/Ht(Bt)}var ue=ut(0);function rr(Bt){return k*(Ht(ue)/Ht(ue+j*Bt))}function pL(Bt){return k*(Ht(ue)*Le(ue+j*Bt)-re(ue))/et}function mL(Bt){return 1-Math.pow(1-Bt,1.5)}var yL=Date.now(),Yf=(ut(1)-ue)/j,vL=u.duration?1e3*u.duration:1e3*Yf*.8;function Kf(){var Bt=(Date.now()-yL)/vL,qo=mL(Bt)*Yf;Bt<=1?(this._flyToFrame=Q(Kf,this),this._move(this.unproject(g.add(p.subtract(g).multiplyBy(pL(qo)/O)),C),this.getScaleZoom(k/rr(qo),C),{flyTo:!0})):this._move(s,l)._moveEnd(!0)}return this._moveStart(!0,u.noMoveStart),Kf.call(this),this},flyToBounds:function(s,l){var u=this._getBoundsCenterZoom(s,l);return this.flyTo(u.center,u.zoom,l)},setMaxBounds:function(s){return s=J(s),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),s.isValid()?(this.options.maxBounds=s,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(s){var l=this.options.minZoom;return this.options.minZoom=s,this._loaded&&l!==s&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(s):this},setMaxZoom:function(s){var l=this.options.maxZoom;return this.options.maxZoom=s,this._loaded&&l!==s&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(s):this},panInsideBounds:function(s,l){this._enforcingBounds=!0;var u=this.getCenter(),g=this._limitCenter(u,this._zoom,J(s));return u.equals(g)||this.panTo(g,l),this._enforcingBounds=!1,this},panInside:function(s,l){l=l||{};var u=U(l.paddingTopLeft||l.padding||[0,0]),g=U(l.paddingBottomRight||l.padding||[0,0]),p=this.project(this.getCenter()),x=this.project(s),C=this.getPixelBounds(),k=F([C.min.add(u),C.max.subtract(g)]),R=k.getSize();if(!k.contains(x)){this._enforcingBounds=!0;var O=x.subtract(k.getCenter()),j=k.extend(x).getSize().subtract(R);p.x+=O.x<0?-j.x:j.x,p.y+=O.y<0?-j.y:j.y,this.panTo(this.unproject(p),l),this._enforcingBounds=!1}return this},invalidateSize:function(s){if(!this._loaded)return this;s=n({animate:!1,pan:!0},s===!0?{animate:!0}:s);var l=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var u=this.getSize(),g=l.divideBy(2).round(),p=u.divideBy(2).round(),x=g.subtract(p);return!x.x&&!x.y?this:(s.animate&&s.pan?this.panBy(x):(s.pan&&this._rawPanBy(x),this.fire("move"),s.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:l,newSize:u}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(s){if(s=this._locateOptions=n({timeout:1e4,watch:!1},s),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var l=a(this._handleGeolocationResponse,this),u=a(this._handleGeolocationError,this);return s.watch?this._locationWatchId=navigator.geolocation.watchPosition(l,u,s):navigator.geolocation.getCurrentPosition(l,u,s),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(s){if(this._container._leaflet_id){var l=s.code,u=s.message||(l===1?"permission denied":l===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:l,message:"Geolocation error: "+u+"."})}},_handleGeolocationResponse:function(s){if(this._container._leaflet_id){var l=s.coords.latitude,u=s.coords.longitude,g=new Y(l,u),p=g.toBounds(s.coords.accuracy*2),x=this._locateOptions;if(x.setView){var C=this.getBoundsZoom(p);this.setView(g,x.maxZoom?Math.min(C,x.maxZoom):C)}var k={latlng:g,bounds:p,timestamp:s.timestamp};for(var R in s.coords)typeof s.coords[R]=="number"&&(k[R]=s.coords[R]);this.fire("locationfound",k)}},addHandler:function(s,l){if(!l)return this;var u=this[s]=new l(this);return this._handlers.push(u),this.options[s]&&u.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Rt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(q(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var s;for(s in this._layers)this._layers[s].remove();for(s in this._panes)Rt(this._panes[s]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(s,l){var u="leaflet-pane"+(s?" leaflet-"+s.replace("Pane","")+"-pane":""),g=mt("div",u,l||this._mapPane);return s&&(this._panes[s]=g),g},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var s=this.getPixelBounds(),l=this.unproject(s.getBottomLeft()),u=this.unproject(s.getTopRight());return new Lt(l,u)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(s,l,u){s=J(s),u=U(u||[0,0]);var g=this.getZoom()||0,p=this.getMinZoom(),x=this.getMaxZoom(),C=s.getNorthWest(),k=s.getSouthEast(),R=this.getSize().subtract(u),O=F(this.project(k,g),this.project(C,g)).getSize(),j=X.any3d?this.options.zoomSnap:1,et=R.x/O.x,ut=R.y/O.y,re=l?Math.max(et,ut):Math.min(et,ut);return g=this.getScaleZoom(re,g),j&&(g=Math.round(g/(j/100))*(j/100),g=l?Math.ceil(g/j)*j:Math.floor(g/j)*j),Math.max(p,Math.min(x,g))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new B(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(s,l){var u=this._getTopLeftPoint(s,l);return new st(u,u.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(s){return this.options.crs.getProjectedBounds(s===void 0?this.getZoom():s)},getPane:function(s){return typeof s=="string"?this._panes[s]:s},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(s,l){var u=this.options.crs;return l=l===void 0?this._zoom:l,u.scale(s)/u.scale(l)},getScaleZoom:function(s,l){var u=this.options.crs;l=l===void 0?this._zoom:l;var g=u.zoom(s*u.scale(l));return isNaN(g)?1/0:g},project:function(s,l){return l=l===void 0?this._zoom:l,this.options.crs.latLngToPoint(nt(s),l)},unproject:function(s,l){return l=l===void 0?this._zoom:l,this.options.crs.pointToLatLng(U(s),l)},layerPointToLatLng:function(s){var l=U(s).add(this.getPixelOrigin());return this.unproject(l)},latLngToLayerPoint:function(s){var l=this.project(nt(s))._round();return l._subtract(this.getPixelOrigin())},wrapLatLng:function(s){return this.options.crs.wrapLatLng(nt(s))},wrapLatLngBounds:function(s){return this.options.crs.wrapLatLngBounds(J(s))},distance:function(s,l){return this.options.crs.distance(nt(s),nt(l))},containerPointToLayerPoint:function(s){return U(s).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(s){return U(s).add(this._getMapPanePos())},containerPointToLatLng:function(s){var l=this.containerPointToLayerPoint(U(s));return this.layerPointToLatLng(l)},latLngToContainerPoint:function(s){return this.layerPointToContainerPoint(this.latLngToLayerPoint(nt(s)))},mouseEventToContainerPoint:function(s){return gf(s,this._container)},mouseEventToLayerPoint:function(s){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(s))},mouseEventToLatLng:function(s){return this.layerPointToLatLng(this.mouseEventToLayerPoint(s))},_initContainer:function(s){var l=this._container=cf(s);if(l){if(l._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");ot(l,"scroll",this._onScroll,this),this._containerId=c(l)},_initLayout:function(){var s=this._container;this._fadeAnimated=this.options.fadeAnimation&&X.any3d,lt(s,"leaflet-container"+(X.touch?" leaflet-touch":"")+(X.retina?" leaflet-retina":"")+(X.ielt9?" leaflet-oldie":"")+(X.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var l=Vr(s,"position");l!=="absolute"&&l!=="relative"&&l!=="fixed"&&l!=="sticky"&&(s.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var s=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Nt(this._mapPane,new B(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(lt(s.markerPane,"leaflet-zoom-hide"),lt(s.shadowPane,"leaflet-zoom-hide"))},_resetView:function(s,l,u){Nt(this._mapPane,new B(0,0));var g=!this._loaded;this._loaded=!0,l=this._limitZoom(l),this.fire("viewprereset");var p=this._zoom!==l;this._moveStart(p,u)._move(s,l)._moveEnd(p),this.fire("viewreset"),g&&this.fire("load")},_moveStart:function(s,l){return s&&this.fire("zoomstart"),l||this.fire("movestart"),this},_move:function(s,l,u,g){l===void 0&&(l=this._zoom);var p=this._zoom!==l;return this._zoom=l,this._lastCenter=s,this._pixelOrigin=this._getNewPixelOrigin(s),g?u&&u.pinch&&this.fire("zoom",u):((p||u&&u.pinch)&&this.fire("zoom",u),this.fire("move",u)),this},_moveEnd:function(s){return s&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return q(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(s){Nt(this._mapPane,this._getMapPanePos().subtract(s))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(s){this._targets={},this._targets[c(this._container)]=this;var l=s?Pt:ot;l(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&l(window,"resize",this._onResize,this),X.any3d&&this.options.transform3DLimit&&(s?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){q(this._resizeRequest),this._resizeRequest=Q(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var s=this._getMapPanePos();Math.max(Math.abs(s.x),Math.abs(s.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(s,l){for(var u=[],g,p=l==="mouseout"||l==="mouseover",x=s.target||s.srcElement,C=!1;x;){if(g=this._targets[c(x)],g&&(l==="click"||l==="preclick")&&this._draggableMoved(g)){C=!0;break}if(g&&g.listens(l,!0)&&(p&&!rh(x,s)||(u.push(g),p))||x===this._container)break;x=x.parentNode}return!u.length&&!C&&!p&&this.listens(l,!0)&&(u=[this]),u},_isClickDisabled:function(s){for(;s&&s!==this._container;){if(s._leaflet_disable_click)return!0;s=s.parentNode}},_handleDOMEvent:function(s){var l=s.target||s.srcElement;if(!(!this._loaded||l._leaflet_disable_events||s.type==="click"&&this._isClickDisabled(l))){var u=s.type;u==="mousedown"&&Jl(l),this._fireDOMEvent(s,u)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(s,l,u){if(s.type==="click"){var g=n({},s);g.type="preclick",this._fireDOMEvent(g,g.type,u)}var p=this._findEventTargets(s,l);if(u){for(var x=[],C=0;C<u.length;C++)u[C].listens(l,!0)&&x.push(u[C]);p=x.concat(p)}if(p.length){l==="contextmenu"&&Kt(s);var k=p[0],R={originalEvent:s};if(s.type!=="keypress"&&s.type!=="keydown"&&s.type!=="keyup"){var O=k.getLatLng&&(!k._radius||k._radius<=10);R.containerPoint=O?this.latLngToContainerPoint(k.getLatLng()):this.mouseEventToContainerPoint(s),R.layerPoint=this.containerPointToLayerPoint(R.containerPoint),R.latlng=O?k.getLatLng():this.layerPointToLatLng(R.layerPoint)}for(C=0;C<p.length;C++)if(p[C].fire(l,R,!0),R.originalEvent._stopped||p[C].options.bubblingMouseEvents===!1&&P(this._mouseEvents,l)!==-1)return}},_draggableMoved:function(s){return s=s.dragging&&s.dragging.enabled()?s:this,s.dragging&&s.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var s=0,l=this._handlers.length;s<l;s++)this._handlers[s].disable()},whenReady:function(s,l){return this._loaded?s.call(l||this,{target:this}):this.on("load",s,l),this},_getMapPanePos:function(){return dn(this._mapPane)||new B(0,0)},_moved:function(){var s=this._getMapPanePos();return s&&!s.equals([0,0])},_getTopLeftPoint:function(s,l){var u=s&&l!==void 0?this._getNewPixelOrigin(s,l):this.getPixelOrigin();return u.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(s,l){var u=this.getSize()._divideBy(2);return this.project(s,l)._subtract(u)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(s,l,u){var g=this._getNewPixelOrigin(u,l);return this.project(s,l)._subtract(g)},_latLngBoundsToNewLayerBounds:function(s,l,u){var g=this._getNewPixelOrigin(u,l);return F([this.project(s.getSouthWest(),l)._subtract(g),this.project(s.getNorthWest(),l)._subtract(g),this.project(s.getSouthEast(),l)._subtract(g),this.project(s.getNorthEast(),l)._subtract(g)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(s){return this.latLngToLayerPoint(s).subtract(this._getCenterLayerPoint())},_limitCenter:function(s,l,u){if(!u)return s;var g=this.project(s,l),p=this.getSize().divideBy(2),x=new st(g.subtract(p),g.add(p)),C=this._getBoundsOffset(x,u,l);return Math.abs(C.x)<=1&&Math.abs(C.y)<=1?s:this.unproject(g.add(C),l)},_limitOffset:function(s,l){if(!l)return s;var u=this.getPixelBounds(),g=new st(u.min.add(s),u.max.add(s));return s.add(this._getBoundsOffset(g,l))},_getBoundsOffset:function(s,l,u){var g=F(this.project(l.getNorthEast(),u),this.project(l.getSouthWest(),u)),p=g.min.subtract(s.min),x=g.max.subtract(s.max),C=this._rebound(p.x,-x.x),k=this._rebound(p.y,-x.y);return new B(C,k)},_rebound:function(s,l){return s+l>0?Math.round(s-l)/2:Math.max(0,Math.ceil(s))-Math.max(0,Math.floor(l))},_limitZoom:function(s){var l=this.getMinZoom(),u=this.getMaxZoom(),g=X.any3d?this.options.zoomSnap:1;return g&&(s=Math.round(s/g)*g),Math.max(l,Math.min(u,s))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){At(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(s,l){var u=this._getCenterOffset(s)._trunc();return(l&&l.animate)!==!0&&!this.getSize().contains(u)?!1:(this.panBy(u,l),!0)},_createAnimProxy:function(){var s=this._proxy=mt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(s),this.on("zoomanim",function(l){var u=Hl,g=this._proxy.style[u];un(this._proxy,this.project(l.center,l.zoom),this.getZoomScale(l.zoom,1)),g===this._proxy.style[u]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Rt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var s=this.getCenter(),l=this.getZoom();un(this._proxy,this.project(s,l),this.getZoomScale(l,1))},_catchTransitionEnd:function(s){this._animatingZoom&&s.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(s,l,u){if(this._animatingZoom)return!0;if(u=u||{},!this._zoomAnimated||u.animate===!1||this._nothingToAnimate()||Math.abs(l-this._zoom)>this.options.zoomAnimationThreshold)return!1;var g=this.getZoomScale(l),p=this._getCenterOffset(s)._divideBy(1-1/g);return u.animate!==!0&&!this.getSize().contains(p)?!1:(Q(function(){this._moveStart(!0,u.noMoveStart||!1)._animateZoom(s,l,!0)},this),!0)},_animateZoom:function(s,l,u,g){this._mapPane&&(u&&(this._animatingZoom=!0,this._animateToCenter=s,this._animateToZoom=l,lt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:s,zoom:l,noUpdate:g}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&At(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Aw(s,l){return new _t(s,l)}var Ie=Et.extend({options:{position:"topright"},initialize:function(s){E(this,s)},getPosition:function(){return this.options.position},setPosition:function(s){var l=this._map;return l&&l.removeControl(this),this.options.position=s,l&&l.addControl(this),this},getContainer:function(){return this._container},addTo:function(s){this.remove(),this._map=s;var l=this._container=this.onAdd(s),u=this.getPosition(),g=s._controlCorners[u];return lt(l,"leaflet-control"),u.indexOf("bottom")!==-1?g.insertBefore(l,g.firstChild):g.appendChild(l),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Rt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(s){this._map&&s&&s.screenX>0&&s.screenY>0&&this._map.getContainer().focus()}}),$r=function(s){return new Ie(s)};_t.include({addControl:function(s){return s.addTo(this),this},removeControl:function(s){return s.remove(),this},_initControlPos:function(){var s=this._controlCorners={},l="leaflet-",u=this._controlContainer=mt("div",l+"control-container",this._container);function g(p,x){var C=l+p+" "+l+x;s[p+x]=mt("div",C,u)}g("top","left"),g("top","right"),g("bottom","left"),g("bottom","right")},_clearControlPos:function(){for(var s in this._controlCorners)Rt(this._controlCorners[s]);Rt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var mf=Ie.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(s,l,u,g){return u<g?-1:g<u?1:0}},initialize:function(s,l,u){E(this,u),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var g in s)this._addLayer(s[g],g);for(g in l)this._addLayer(l[g],g,!0)},onAdd:function(s){this._initLayout(),this._update(),this._map=s,s.on("zoomend",this._checkDisabledLayers,this);for(var l=0;l<this._layers.length;l++)this._layers[l].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(s){return Ie.prototype.addTo.call(this,s),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var s=0;s<this._layers.length;s++)this._layers[s].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(s,l){return this._addLayer(s,l),this._map?this._update():this},addOverlay:function(s,l){return this._addLayer(s,l,!0),this._map?this._update():this},removeLayer:function(s){s.off("add remove",this._onLayerChange,this);var l=this._getLayer(c(s));return l&&this._layers.splice(this._layers.indexOf(l),1),this._map?this._update():this},expand:function(){lt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var s=this._map.getSize().y-(this._container.offsetTop+50);return s<this._section.clientHeight?(lt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=s+"px"):At(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return At(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var s="leaflet-control-layers",l=this._container=mt("div",s),u=this.options.collapsed;l.setAttribute("aria-haspopup",!0),qr(l),nh(l);var g=this._section=mt("section",s+"-list");u&&(this._map.on("click",this.collapse,this),ot(l,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var p=this._layersLink=mt("a",s+"-toggle",l);p.href="#",p.title="Layers",p.setAttribute("role","button"),ot(p,{keydown:function(x){x.keyCode===13&&this._expandSafely()},click:function(x){Kt(x),this._expandSafely()}},this),u||this.expand(),this._baseLayersList=mt("div",s+"-base",g),this._separator=mt("div",s+"-separator",g),this._overlaysList=mt("div",s+"-overlays",g),l.appendChild(g)},_getLayer:function(s){for(var l=0;l<this._layers.length;l++)if(this._layers[l]&&c(this._layers[l].layer)===s)return this._layers[l]},_addLayer:function(s,l,u){this._map&&s.on("add remove",this._onLayerChange,this),this._layers.push({layer:s,name:l,overlay:u}),this.options.sortLayers&&this._layers.sort(a(function(g,p){return this.options.sortFunction(g.layer,p.layer,g.name,p.name)},this)),this.options.autoZIndex&&s.setZIndex&&(this._lastZIndex++,s.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Do(this._baseLayersList),Do(this._overlaysList),this._layerControlInputs=[];var s,l,u,g,p=0;for(u=0;u<this._layers.length;u++)g=this._layers[u],this._addItem(g),l=l||g.overlay,s=s||!g.overlay,p+=g.overlay?0:1;return this.options.hideSingleBase&&(s=s&&p>1,this._baseLayersList.style.display=s?"":"none"),this._separator.style.display=l&&s?"":"none",this},_onLayerChange:function(s){this._handlingClick||this._update();var l=this._getLayer(c(s.target)),u=l.overlay?s.type==="add"?"overlayadd":"overlayremove":s.type==="add"?"baselayerchange":null;u&&this._map.fire(u,l)},_createRadioElement:function(s,l){var u='<input type="radio" class="leaflet-control-layers-selector" name="'+s+'"'+(l?' checked="checked"':"")+"/>",g=document.createElement("div");return g.innerHTML=u,g.firstChild},_addItem:function(s){var l=document.createElement("label"),u=this._map.hasLayer(s.layer),g;s.overlay?(g=document.createElement("input"),g.type="checkbox",g.className="leaflet-control-layers-selector",g.defaultChecked=u):g=this._createRadioElement("leaflet-base-layers_"+c(this),u),this._layerControlInputs.push(g),g.layerId=c(s.layer),ot(g,"click",this._onInputClick,this);var p=document.createElement("span");p.innerHTML=" "+s.name;var x=document.createElement("span");l.appendChild(x),x.appendChild(g),x.appendChild(p);var C=s.overlay?this._overlaysList:this._baseLayersList;return C.appendChild(l),this._checkDisabledLayers(),l},_onInputClick:function(){if(!this._preventClick){var s=this._layerControlInputs,l,u,g=[],p=[];this._handlingClick=!0;for(var x=s.length-1;x>=0;x--)l=s[x],u=this._getLayer(l.layerId).layer,l.checked?g.push(u):l.checked||p.push(u);for(x=0;x<p.length;x++)this._map.hasLayer(p[x])&&this._map.removeLayer(p[x]);for(x=0;x<g.length;x++)this._map.hasLayer(g[x])||this._map.addLayer(g[x]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var s=this._layerControlInputs,l,u,g=this._map.getZoom(),p=s.length-1;p>=0;p--)l=s[p],u=this._getLayer(l.layerId).layer,l.disabled=u.options.minZoom!==void 0&&g<u.options.minZoom||u.options.maxZoom!==void 0&&g>u.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var s=this._section;this._preventClick=!0,ot(s,"click",Kt),this.expand();var l=this;setTimeout(function(){Pt(s,"click",Kt),l._preventClick=!1})}}),Dw=function(s,l,u){return new mf(s,l,u)},sh=Ie.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(s){var l="leaflet-control-zoom",u=mt("div",l+" leaflet-bar"),g=this.options;return this._zoomInButton=this._createButton(g.zoomInText,g.zoomInTitle,l+"-in",u,this._zoomIn),this._zoomOutButton=this._createButton(g.zoomOutText,g.zoomOutTitle,l+"-out",u,this._zoomOut),this._updateDisabled(),s.on("zoomend zoomlevelschange",this._updateDisabled,this),u},onRemove:function(s){s.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(s){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(s.shiftKey?3:1))},_zoomOut:function(s){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(s.shiftKey?3:1))},_createButton:function(s,l,u,g,p){var x=mt("a",u,g);return x.innerHTML=s,x.href="#",x.title=l,x.setAttribute("role","button"),x.setAttribute("aria-label",l),qr(x),ot(x,"click",gn),ot(x,"click",p,this),ot(x,"click",this._refocusOnMap,this),x},_updateDisabled:function(){var s=this._map,l="leaflet-disabled";At(this._zoomInButton,l),At(this._zoomOutButton,l),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||s._zoom===s.getMinZoom())&&(lt(this._zoomOutButton,l),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||s._zoom===s.getMaxZoom())&&(lt(this._zoomInButton,l),this._zoomInButton.setAttribute("aria-disabled","true"))}});_t.mergeOptions({zoomControl:!0}),_t.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new sh,this.addControl(this.zoomControl))});var Ow=function(s){return new sh(s)},yf=Ie.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(s){var l="leaflet-control-scale",u=mt("div",l),g=this.options;return this._addScales(g,l+"-line",u),s.on(g.updateWhenIdle?"moveend":"move",this._update,this),s.whenReady(this._update,this),u},onRemove:function(s){s.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(s,l,u){s.metric&&(this._mScale=mt("div",l,u)),s.imperial&&(this._iScale=mt("div",l,u))},_update:function(){var s=this._map,l=s.getSize().y/2,u=s.distance(s.containerPointToLatLng([0,l]),s.containerPointToLatLng([this.options.maxWidth,l]));this._updateScales(u)},_updateScales:function(s){this.options.metric&&s&&this._updateMetric(s),this.options.imperial&&s&&this._updateImperial(s)},_updateMetric:function(s){var l=this._getRoundNum(s),u=l<1e3?l+" m":l/1e3+" km";this._updateScale(this._mScale,u,l/s)},_updateImperial:function(s){var l=s*3.2808399,u,g,p;l>5280?(u=l/5280,g=this._getRoundNum(u),this._updateScale(this._iScale,g+" mi",g/u)):(p=this._getRoundNum(l),this._updateScale(this._iScale,p+" ft",p/l))},_updateScale:function(s,l,u){s.style.width=Math.round(this.options.maxWidth*u)+"px",s.innerHTML=l},_getRoundNum:function(s){var l=Math.pow(10,(Math.floor(s)+"").length-1),u=s/l;return u=u>=10?10:u>=5?5:u>=3?3:u>=2?2:1,l*u}}),Fw=function(s){return new yf(s)},zw='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',oh=Ie.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(X.inlineSvg?zw+" ":"")+"Leaflet</a>"},initialize:function(s){E(this,s),this._attributions={}},onAdd:function(s){s.attributionControl=this,this._container=mt("div","leaflet-control-attribution"),qr(this._container);for(var l in s._layers)s._layers[l].getAttribution&&this.addAttribution(s._layers[l].getAttribution());return this._update(),s.on("layeradd",this._addAttribution,this),this._container},onRemove:function(s){s.off("layeradd",this._addAttribution,this)},_addAttribution:function(s){s.layer.getAttribution&&(this.addAttribution(s.layer.getAttribution()),s.layer.once("remove",function(){this.removeAttribution(s.layer.getAttribution())},this))},setPrefix:function(s){return this.options.prefix=s,this._update(),this},addAttribution:function(s){return s?(this._attributions[s]||(this._attributions[s]=0),this._attributions[s]++,this._update(),this):this},removeAttribution:function(s){return s?(this._attributions[s]&&(this._attributions[s]--,this._update()),this):this},_update:function(){if(this._map){var s=[];for(var l in this._attributions)this._attributions[l]&&s.push(l);var u=[];this.options.prefix&&u.push(this.options.prefix),s.length&&u.push(s.join(", ")),this._container.innerHTML=u.join(' <span aria-hidden="true">|</span> ')}}});_t.mergeOptions({attributionControl:!0}),_t.addInitHook(function(){this.options.attributionControl&&new oh().addTo(this)});var Nw=function(s){return new oh(s)};Ie.Layers=mf,Ie.Zoom=sh,Ie.Scale=yf,Ie.Attribution=oh,$r.layers=Dw,$r.zoom=Ow,$r.scale=Fw,$r.attribution=Nw;var Ye=Et.extend({initialize:function(s){this._map=s},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Ye.addTo=function(s,l){return s.addHandler(l,this),this};var Bw={Events:H},vf=X.touch?"touchstart mousedown":"mousedown",ji=Z.extend({options:{clickTolerance:3},initialize:function(s,l,u,g){E(this,g),this._element=s,this._dragStartTarget=l||s,this._preventOutline=u},enable:function(){this._enabled||(ot(this._dragStartTarget,vf,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ji._dragging===this&&this.finishDrag(!0),Pt(this._dragStartTarget,vf,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(s){if(this._enabled&&(this._moved=!1,!Vl(this._element,"leaflet-zoom-anim"))){if(s.touches&&s.touches.length!==1){ji._dragging===this&&this.finishDrag();return}if(!(ji._dragging||s.shiftKey||s.which!==1&&s.button!==1&&!s.touches)&&(ji._dragging=this,this._preventOutline&&Jl(this._element),Kl(),Xr(),!this._moving)){this.fire("down");var l=s.touches?s.touches[0]:s,u=uf(this._element);this._startPoint=new B(l.clientX,l.clientY),this._startPos=dn(this._element),this._parentScale=Ql(u);var g=s.type==="mousedown";ot(document,g?"mousemove":"touchmove",this._onMove,this),ot(document,g?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(s){if(this._enabled){if(s.touches&&s.touches.length>1){this._moved=!0;return}var l=s.touches&&s.touches.length===1?s.touches[0]:s,u=new B(l.clientX,l.clientY)._subtract(this._startPoint);!u.x&&!u.y||Math.abs(u.x)+Math.abs(u.y)<this.options.clickTolerance||(u.x/=this._parentScale.x,u.y/=this._parentScale.y,Kt(s),this._moved||(this.fire("dragstart"),this._moved=!0,lt(document.body,"leaflet-dragging"),this._lastTarget=s.target||s.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),lt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(u),this._moving=!0,this._lastEvent=s,this._updatePosition())}},_updatePosition:function(){var s={originalEvent:this._lastEvent};this.fire("predrag",s),Nt(this._element,this._newPos),this.fire("drag",s)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(s){At(document.body,"leaflet-dragging"),this._lastTarget&&(At(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Pt(document,"mousemove touchmove",this._onMove,this),Pt(document,"mouseup touchend touchcancel",this._onUp,this),ql(),Yr();var l=this._moved&&this._moving;this._moving=!1,ji._dragging=!1,l&&this.fire("dragend",{noInertia:s,distance:this._newPos.distanceTo(this._startPos)})}});function xf(s,l,u){var g,p=[1,4,2,8],x,C,k,R,O,j,et,ut;for(x=0,j=s.length;x<j;x++)s[x]._code=_n(s[x],l);for(k=0;k<4;k++){for(et=p[k],g=[],x=0,j=s.length,C=j-1;x<j;C=x++)R=s[x],O=s[C],R._code&et?O._code&et||(ut=Bo(O,R,et,l,u),ut._code=_n(ut,l),g.push(ut)):(O._code&et&&(ut=Bo(O,R,et,l,u),ut._code=_n(ut,l),g.push(ut)),g.push(R));s=g}return s}function Ef(s,l){var u,g,p,x,C,k,R,O,j;if(!s||s.length===0)throw new Error("latlngs not passed");we(s)||(console.warn("latlngs are not flat! Only the first ring will be used"),s=s[0]);var et=nt([0,0]),ut=J(s),re=ut.getNorthWest().distanceTo(ut.getSouthWest())*ut.getNorthEast().distanceTo(ut.getNorthWest());re<1700&&(et=ah(s));var Ht=s.length,Le=[];for(u=0;u<Ht;u++){var ue=nt(s[u]);Le.push(l.project(nt([ue.lat-et.lat,ue.lng-et.lng])))}for(k=R=O=0,u=0,g=Ht-1;u<Ht;g=u++)p=Le[u],x=Le[g],C=p.y*x.x-x.y*p.x,R+=(p.x+x.x)*C,O+=(p.y+x.y)*C,k+=C*3;k===0?j=Le[0]:j=[R/k,O/k];var rr=l.unproject(U(j));return nt([rr.lat+et.lat,rr.lng+et.lng])}function ah(s){for(var l=0,u=0,g=0,p=0;p<s.length;p++){var x=nt(s[p]);l+=x.lat,u+=x.lng,g++}return nt([l/g,u/g])}var Gw={__proto__:null,clipPolygon:xf,polygonCenter:Ef,centroid:ah};function wf(s,l){if(!l||!s.length)return s.slice();var u=l*l;return s=jw(s,u),s=Zw(s,u),s}function Lf(s,l,u){return Math.sqrt(Jr(s,l,u,!0))}function Uw(s,l,u){return Jr(s,l,u)}function Zw(s,l){var u=s.length,g=typeof Uint8Array!=void 0+""?Uint8Array:Array,p=new g(u);p[0]=p[u-1]=1,lh(s,p,l,0,u-1);var x,C=[];for(x=0;x<u;x++)p[x]&&C.push(s[x]);return C}function lh(s,l,u,g,p){var x=0,C,k,R;for(k=g+1;k<=p-1;k++)R=Jr(s[k],s[g],s[p],!0),R>x&&(C=k,x=R);x>u&&(l[C]=1,lh(s,l,u,g,C),lh(s,l,u,C,p))}function jw(s,l){for(var u=[s[0]],g=1,p=0,x=s.length;g<x;g++)Ww(s[g],s[p])>l&&(u.push(s[g]),p=g);return p<x-1&&u.push(s[x-1]),u}var bf;function Tf(s,l,u,g,p){var x=g?bf:_n(s,u),C=_n(l,u),k,R,O;for(bf=C;;){if(!(x|C))return[s,l];if(x&C)return!1;k=x||C,R=Bo(s,l,k,u,p),O=_n(R,u),k===x?(s=R,x=O):(l=R,C=O)}}function Bo(s,l,u,g,p){var x=l.x-s.x,C=l.y-s.y,k=g.min,R=g.max,O,j;return u&8?(O=s.x+x*(R.y-s.y)/C,j=R.y):u&4?(O=s.x+x*(k.y-s.y)/C,j=k.y):u&2?(O=R.x,j=s.y+C*(R.x-s.x)/x):u&1&&(O=k.x,j=s.y+C*(k.x-s.x)/x),new B(O,j,p)}function _n(s,l){var u=0;return s.x<l.min.x?u|=1:s.x>l.max.x&&(u|=2),s.y<l.min.y?u|=4:s.y>l.max.y&&(u|=8),u}function Ww(s,l){var u=l.x-s.x,g=l.y-s.y;return u*u+g*g}function Jr(s,l,u,g){var p=l.x,x=l.y,C=u.x-p,k=u.y-x,R=C*C+k*k,O;return R>0&&(O=((s.x-p)*C+(s.y-x)*k)/R,O>1?(p=u.x,x=u.y):O>0&&(p+=C*O,x+=k*O)),C=s.x-p,k=s.y-x,g?C*C+k*k:new B(p,x)}function we(s){return!T(s[0])||typeof s[0][0]!="object"&&typeof s[0][0]<"u"}function Cf(s){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),we(s)}function Sf(s,l){var u,g,p,x,C,k,R,O;if(!s||s.length===0)throw new Error("latlngs not passed");we(s)||(console.warn("latlngs are not flat! Only the first ring will be used"),s=s[0]);var j=nt([0,0]),et=J(s),ut=et.getNorthWest().distanceTo(et.getSouthWest())*et.getNorthEast().distanceTo(et.getNorthWest());ut<1700&&(j=ah(s));var re=s.length,Ht=[];for(u=0;u<re;u++){var Le=nt(s[u]);Ht.push(l.project(nt([Le.lat-j.lat,Le.lng-j.lng])))}for(u=0,g=0;u<re-1;u++)g+=Ht[u].distanceTo(Ht[u+1])/2;if(g===0)O=Ht[0];else for(u=0,x=0;u<re-1;u++)if(C=Ht[u],k=Ht[u+1],p=C.distanceTo(k),x+=p,x>g){R=(x-g)/p,O=[k.x-R*(k.x-C.x),k.y-R*(k.y-C.y)];break}var ue=l.unproject(U(O));return nt([ue.lat+j.lat,ue.lng+j.lng])}var Hw={__proto__:null,simplify:wf,pointToSegmentDistance:Lf,closestPointOnSegment:Uw,clipSegment:Tf,_getEdgeIntersection:Bo,_getBitCode:_n,_sqClosestPointOnSegment:Jr,isFlat:we,_flat:Cf,polylineCenter:Sf},hh={project:function(s){return new B(s.lng,s.lat)},unproject:function(s){return new Y(s.y,s.x)},bounds:new st([-180,-90],[180,90])},ch={R:6378137,R_MINOR:6356752314245179e-9,bounds:new st([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(s){var l=Math.PI/180,u=this.R,g=s.lat*l,p=this.R_MINOR/u,x=Math.sqrt(1-p*p),C=x*Math.sin(g),k=Math.tan(Math.PI/4-g/2)/Math.pow((1-C)/(1+C),x/2);return g=-u*Math.log(Math.max(k,1e-10)),new B(s.lng*l*u,g)},unproject:function(s){for(var l=180/Math.PI,u=this.R,g=this.R_MINOR/u,p=Math.sqrt(1-g*g),x=Math.exp(-s.y/u),C=Math.PI/2-2*Math.atan(x),k=0,R=.1,O;k<15&&Math.abs(R)>1e-7;k++)O=p*Math.sin(C),O=Math.pow((1-O)/(1+O),p/2),R=Math.PI/2-2*Math.atan(x*O)-C,C+=R;return new Y(C*l,s.x*l/u)}},Vw={__proto__:null,LonLat:hh,Mercator:ch,SphericalMercator:je},Xw=n({},St,{code:"EPSG:3395",projection:ch,transformation:function(){var s=.5/(Math.PI*ch.R);return xe(s,.5,-s,.5)}()}),Pf=n({},St,{code:"EPSG:4326",projection:hh,transformation:xe(1/180,1,-1/180,.5)}),Yw=n({},Ft,{projection:hh,transformation:xe(1,0,-1,0),scale:function(s){return Math.pow(2,s)},zoom:function(s){return Math.log(s)/Math.LN2},distance:function(s,l){var u=l.lng-s.lng,g=l.lat-s.lat;return Math.sqrt(u*u+g*g)},infinite:!0});Ft.Earth=St,Ft.EPSG3395=Xw,Ft.EPSG3857=Oi,Ft.EPSG900913=We,Ft.EPSG4326=Pf,Ft.Simple=Yw;var Ae=Z.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(s){return s.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(s){return s&&s.removeLayer(this),this},getPane:function(s){return this._map.getPane(s?this.options[s]||s:this.options.pane)},addInteractiveTarget:function(s){return this._map._targets[c(s)]=this,this},removeInteractiveTarget:function(s){return delete this._map._targets[c(s)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(s){var l=s.target;if(l.hasLayer(this)){if(this._map=l,this._zoomAnimated=l._zoomAnimated,this.getEvents){var u=this.getEvents();l.on(u,this),this.once("remove",function(){l.off(u,this)},this)}this.onAdd(l),this.fire("add"),l.fire("layeradd",{layer:this})}}});_t.include({addLayer:function(s){if(!s._layerAdd)throw new Error("The provided object is not a Layer.");var l=c(s);return this._layers[l]?this:(this._layers[l]=s,s._mapToAdd=this,s.beforeAdd&&s.beforeAdd(this),this.whenReady(s._layerAdd,s),this)},removeLayer:function(s){var l=c(s);return this._layers[l]?(this._loaded&&s.onRemove(this),delete this._layers[l],this._loaded&&(this.fire("layerremove",{layer:s}),s.fire("remove")),s._map=s._mapToAdd=null,this):this},hasLayer:function(s){return c(s)in this._layers},eachLayer:function(s,l){for(var u in this._layers)s.call(l,this._layers[u]);return this},_addLayers:function(s){s=s?T(s)?s:[s]:[];for(var l=0,u=s.length;l<u;l++)this.addLayer(s[l])},_addZoomLimit:function(s){(!isNaN(s.options.maxZoom)||!isNaN(s.options.minZoom))&&(this._zoomBoundLayers[c(s)]=s,this._updateZoomLevels())},_removeZoomLimit:function(s){var l=c(s);this._zoomBoundLayers[l]&&(delete this._zoomBoundLayers[l],this._updateZoomLevels())},_updateZoomLevels:function(){var s=1/0,l=-1/0,u=this._getZoomSpan();for(var g in this._zoomBoundLayers){var p=this._zoomBoundLayers[g].options;s=p.minZoom===void 0?s:Math.min(s,p.minZoom),l=p.maxZoom===void 0?l:Math.max(l,p.maxZoom)}this._layersMaxZoom=l===-1/0?void 0:l,this._layersMinZoom=s===1/0?void 0:s,u!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Qn=Ae.extend({initialize:function(s,l){E(this,l),this._layers={};var u,g;if(s)for(u=0,g=s.length;u<g;u++)this.addLayer(s[u])},addLayer:function(s){var l=this.getLayerId(s);return this._layers[l]=s,this._map&&this._map.addLayer(s),this},removeLayer:function(s){var l=s in this._layers?s:this.getLayerId(s);return this._map&&this._layers[l]&&this._map.removeLayer(this._layers[l]),delete this._layers[l],this},hasLayer:function(s){var l=typeof s=="number"?s:this.getLayerId(s);return l in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(s){var l=Array.prototype.slice.call(arguments,1),u,g;for(u in this._layers)g=this._layers[u],g[s]&&g[s].apply(g,l);return this},onAdd:function(s){this.eachLayer(s.addLayer,s)},onRemove:function(s){this.eachLayer(s.removeLayer,s)},eachLayer:function(s,l){for(var u in this._layers)s.call(l,this._layers[u]);return this},getLayer:function(s){return this._layers[s]},getLayers:function(){var s=[];return this.eachLayer(s.push,s),s},setZIndex:function(s){return this.invoke("setZIndex",s)},getLayerId:function(s){return c(s)}}),Kw=function(s,l){return new Qn(s,l)},_i=Qn.extend({addLayer:function(s){return this.hasLayer(s)?this:(s.addEventParent(this),Qn.prototype.addLayer.call(this,s),this.fire("layeradd",{layer:s}))},removeLayer:function(s){return this.hasLayer(s)?(s in this._layers&&(s=this._layers[s]),s.removeEventParent(this),Qn.prototype.removeLayer.call(this,s),this.fire("layerremove",{layer:s})):this},setStyle:function(s){return this.invoke("setStyle",s)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var s=new Lt;for(var l in this._layers){var u=this._layers[l];s.extend(u.getBounds?u.getBounds():u.getLatLng())}return s}}),qw=function(s,l){return new _i(s,l)},tr=Et.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(s){E(this,s)},createIcon:function(s){return this._createIcon("icon",s)},createShadow:function(s){return this._createIcon("shadow",s)},_createIcon:function(s,l){var u=this._getIconUrl(s);if(!u){if(s==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var g=this._createImg(u,l&&l.tagName==="IMG"?l:null);return this._setIconStyles(g,s),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),g},_setIconStyles:function(s,l){var u=this.options,g=u[l+"Size"];typeof g=="number"&&(g=[g,g]);var p=U(g),x=U(l==="shadow"&&u.shadowAnchor||u.iconAnchor||p&&p.divideBy(2,!0));s.className="leaflet-marker-"+l+" "+(u.className||""),x&&(s.style.marginLeft=-x.x+"px",s.style.marginTop=-x.y+"px"),p&&(s.style.width=p.x+"px",s.style.height=p.y+"px")},_createImg:function(s,l){return l=l||document.createElement("img"),l.src=s,l},_getIconUrl:function(s){return X.retina&&this.options[s+"RetinaUrl"]||this.options[s+"Url"]}});function $w(s){return new tr(s)}var Qr=tr.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(s){return typeof Qr.imagePath!="string"&&(Qr.imagePath=this._detectIconPath()),(this.options.imagePath||Qr.imagePath)+tr.prototype._getIconUrl.call(this,s)},_stripUrl:function(s){var l=function(u,g,p){var x=g.exec(u);return x&&x[p]};return s=l(s,/^url\((['"])?(.+)\1\)$/,2),s&&l(s,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var s=mt("div","leaflet-default-icon-path",document.body),l=Vr(s,"background-image")||Vr(s,"backgroundImage");if(document.body.removeChild(s),l=this._stripUrl(l),l)return l;var u=document.querySelector('link[href$="leaflet.css"]');return u?u.href.substring(0,u.href.length-11-1):""}}),kf=Ye.extend({initialize:function(s){this._marker=s},addHooks:function(){var s=this._marker._icon;this._draggable||(this._draggable=new ji(s,s,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),lt(s,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&At(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(s){var l=this._marker,u=l._map,g=this._marker.options.autoPanSpeed,p=this._marker.options.autoPanPadding,x=dn(l._icon),C=u.getPixelBounds(),k=u.getPixelOrigin(),R=F(C.min._subtract(k).add(p),C.max._subtract(k).subtract(p));if(!R.contains(x)){var O=U((Math.max(R.max.x,x.x)-R.max.x)/(C.max.x-R.max.x)-(Math.min(R.min.x,x.x)-R.min.x)/(C.min.x-R.min.x),(Math.max(R.max.y,x.y)-R.max.y)/(C.max.y-R.max.y)-(Math.min(R.min.y,x.y)-R.min.y)/(C.min.y-R.min.y)).multiplyBy(g);u.panBy(O,{animate:!1}),this._draggable._newPos._add(O),this._draggable._startPos._add(O),Nt(l._icon,this._draggable._newPos),this._onDrag(s),this._panRequest=Q(this._adjustPan.bind(this,s))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(s){this._marker.options.autoPan&&(q(this._panRequest),this._panRequest=Q(this._adjustPan.bind(this,s)))},_onDrag:function(s){var l=this._marker,u=l._shadow,g=dn(l._icon),p=l._map.layerPointToLatLng(g);u&&Nt(u,g),l._latlng=p,s.latlng=p,s.oldLatLng=this._oldLatLng,l.fire("move",s).fire("drag",s)},_onDragEnd:function(s){q(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",s)}}),Go=Ae.extend({options:{icon:new Qr,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(s,l){E(this,l),this._latlng=nt(s)},onAdd:function(s){this._zoomAnimated=this._zoomAnimated&&s.options.markerZoomAnimation,this._zoomAnimated&&s.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(s){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&s.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(s){var l=this._latlng;return this._latlng=nt(s),this.update(),this.fire("move",{oldLatLng:l,latlng:this._latlng})},setZIndexOffset:function(s){return this.options.zIndexOffset=s,this.update()},getIcon:function(){return this.options.icon},setIcon:function(s){return this.options.icon=s,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var s=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(s)}return this},_initIcon:function(){var s=this.options,l="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),u=s.icon.createIcon(this._icon),g=!1;u!==this._icon&&(this._icon&&this._removeIcon(),g=!0,s.title&&(u.title=s.title),u.tagName==="IMG"&&(u.alt=s.alt||"")),lt(u,l),s.keyboard&&(u.tabIndex="0",u.setAttribute("role","button")),this._icon=u,s.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&ot(u,"focus",this._panOnFocus,this);var p=s.icon.createShadow(this._shadow),x=!1;p!==this._shadow&&(this._removeShadow(),x=!0),p&&(lt(p,l),p.alt=""),this._shadow=p,s.opacity<1&&this._updateOpacity(),g&&this.getPane().appendChild(this._icon),this._initInteraction(),p&&x&&this.getPane(s.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Pt(this._icon,"focus",this._panOnFocus,this),Rt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Rt(this._shadow),this._shadow=null},_setPos:function(s){this._icon&&Nt(this._icon,s),this._shadow&&Nt(this._shadow,s),this._zIndex=s.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(s){this._icon&&(this._icon.style.zIndex=this._zIndex+s)},_animateZoom:function(s){var l=this._map._latLngToNewLayerPoint(this._latlng,s.zoom,s.center).round();this._setPos(l)},_initInteraction:function(){if(this.options.interactive&&(lt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),kf)){var s=this.options.draggable;this.dragging&&(s=this.dragging.enabled(),this.dragging.disable()),this.dragging=new kf(this),s&&this.dragging.enable()}},setOpacity:function(s){return this.options.opacity=s,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var s=this.options.opacity;this._icon&&Ee(this._icon,s),this._shadow&&Ee(this._shadow,s)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var s=this._map;if(s){var l=this.options.icon.options,u=l.iconSize?U(l.iconSize):U(0,0),g=l.iconAnchor?U(l.iconAnchor):U(0,0);s.panInside(this._latlng,{paddingTopLeft:g,paddingBottomRight:u.subtract(g)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Jw(s,l){return new Go(s,l)}var Wi=Ae.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(s){this._renderer=s.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(s){return E(this,s),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&s&&Object.prototype.hasOwnProperty.call(s,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Uo=Wi.extend({options:{fill:!0,radius:10},initialize:function(s,l){E(this,l),this._latlng=nt(s),this._radius=this.options.radius},setLatLng:function(s){var l=this._latlng;return this._latlng=nt(s),this.redraw(),this.fire("move",{oldLatLng:l,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(s){return this.options.radius=this._radius=s,this.redraw()},getRadius:function(){return this._radius},setStyle:function(s){var l=s&&s.radius||this._radius;return Wi.prototype.setStyle.call(this,s),this.setRadius(l),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var s=this._radius,l=this._radiusY||s,u=this._clickTolerance(),g=[s+u,l+u];this._pxBounds=new st(this._point.subtract(g),this._point.add(g))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(s){return s.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function Qw(s,l){return new Uo(s,l)}var uh=Uo.extend({initialize:function(s,l,u){if(typeof l=="number"&&(l=n({},u,{radius:l})),E(this,l),this._latlng=nt(s),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(s){return this._mRadius=s,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var s=[this._radius,this._radiusY||this._radius];return new Lt(this._map.layerPointToLatLng(this._point.subtract(s)),this._map.layerPointToLatLng(this._point.add(s)))},setStyle:Wi.prototype.setStyle,_project:function(){var s=this._latlng.lng,l=this._latlng.lat,u=this._map,g=u.options.crs;if(g.distance===St.distance){var p=Math.PI/180,x=this._mRadius/St.R/p,C=u.project([l+x,s]),k=u.project([l-x,s]),R=C.add(k).divideBy(2),O=u.unproject(R).lat,j=Math.acos((Math.cos(x*p)-Math.sin(l*p)*Math.sin(O*p))/(Math.cos(l*p)*Math.cos(O*p)))/p;(isNaN(j)||j===0)&&(j=x/Math.cos(Math.PI/180*l)),this._point=R.subtract(u.getPixelOrigin()),this._radius=isNaN(j)?0:R.x-u.project([O,s-j]).x,this._radiusY=R.y-C.y}else{var et=g.unproject(g.project(this._latlng).subtract([this._mRadius,0]));this._point=u.latLngToLayerPoint(this._latlng),this._radius=this._point.x-u.latLngToLayerPoint(et).x}this._updateBounds()}});function tL(s,l,u){return new uh(s,l,u)}var pi=Wi.extend({options:{smoothFactor:1,noClip:!1},initialize:function(s,l){E(this,l),this._setLatLngs(s)},getLatLngs:function(){return this._latlngs},setLatLngs:function(s){return this._setLatLngs(s),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(s){for(var l=1/0,u=null,g=Jr,p,x,C=0,k=this._parts.length;C<k;C++)for(var R=this._parts[C],O=1,j=R.length;O<j;O++){p=R[O-1],x=R[O];var et=g(s,p,x,!0);et<l&&(l=et,u=g(s,p,x))}return u&&(u.distance=Math.sqrt(l)),u},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Sf(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(s,l){return l=l||this._defaultShape(),s=nt(s),l.push(s),this._bounds.extend(s),this.redraw()},_setLatLngs:function(s){this._bounds=new Lt,this._latlngs=this._convertLatLngs(s)},_defaultShape:function(){return we(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(s){for(var l=[],u=we(s),g=0,p=s.length;g<p;g++)u?(l[g]=nt(s[g]),this._bounds.extend(l[g])):l[g]=this._convertLatLngs(s[g]);return l},_project:function(){var s=new st;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,s),this._bounds.isValid()&&s.isValid()&&(this._rawPxBounds=s,this._updateBounds())},_updateBounds:function(){var s=this._clickTolerance(),l=new B(s,s);this._rawPxBounds&&(this._pxBounds=new st([this._rawPxBounds.min.subtract(l),this._rawPxBounds.max.add(l)]))},_projectLatlngs:function(s,l,u){var g=s[0]instanceof Y,p=s.length,x,C;if(g){for(C=[],x=0;x<p;x++)C[x]=this._map.latLngToLayerPoint(s[x]),u.extend(C[x]);l.push(C)}else for(x=0;x<p;x++)this._projectLatlngs(s[x],l,u)},_clipPoints:function(){var s=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(s))){if(this.options.noClip){this._parts=this._rings;return}var l=this._parts,u,g,p,x,C,k,R;for(u=0,p=0,x=this._rings.length;u<x;u++)for(R=this._rings[u],g=0,C=R.length;g<C-1;g++)k=Tf(R[g],R[g+1],s,g,!0),k&&(l[p]=l[p]||[],l[p].push(k[0]),(k[1]!==R[g+1]||g===C-2)&&(l[p].push(k[1]),p++))}},_simplifyPoints:function(){for(var s=this._parts,l=this.options.smoothFactor,u=0,g=s.length;u<g;u++)s[u]=wf(s[u],l)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(s,l){var u,g,p,x,C,k,R=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(s))return!1;for(u=0,x=this._parts.length;u<x;u++)for(k=this._parts[u],g=0,C=k.length,p=C-1;g<C;p=g++)if(!(!l&&g===0)&&Lf(s,k[p],k[g])<=R)return!0;return!1}});function eL(s,l){return new pi(s,l)}pi._flat=Cf;var er=pi.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Ef(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(s){var l=pi.prototype._convertLatLngs.call(this,s),u=l.length;return u>=2&&l[0]instanceof Y&&l[0].equals(l[u-1])&&l.pop(),l},_setLatLngs:function(s){pi.prototype._setLatLngs.call(this,s),we(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return we(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var s=this._renderer._bounds,l=this.options.weight,u=new B(l,l);if(s=new st(s.min.subtract(u),s.max.add(u)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(s))){if(this.options.noClip){this._parts=this._rings;return}for(var g=0,p=this._rings.length,x;g<p;g++)x=xf(this._rings[g],s,!0),x.length&&this._parts.push(x)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(s){var l=!1,u,g,p,x,C,k,R,O;if(!this._pxBounds||!this._pxBounds.contains(s))return!1;for(x=0,R=this._parts.length;x<R;x++)for(u=this._parts[x],C=0,O=u.length,k=O-1;C<O;k=C++)g=u[C],p=u[k],g.y>s.y!=p.y>s.y&&s.x<(p.x-g.x)*(s.y-g.y)/(p.y-g.y)+g.x&&(l=!l);return l||pi.prototype._containsPoint.call(this,s,!0)}});function iL(s,l){return new er(s,l)}var mi=_i.extend({initialize:function(s,l){E(this,l),this._layers={},s&&this.addData(s)},addData:function(s){var l=T(s)?s:s.features,u,g,p;if(l){for(u=0,g=l.length;u<g;u++)p=l[u],(p.geometries||p.geometry||p.features||p.coordinates)&&this.addData(p);return this}var x=this.options;if(x.filter&&!x.filter(s))return this;var C=Zo(s,x);return C?(C.feature=Ho(s),C.defaultOptions=C.options,this.resetStyle(C),x.onEachFeature&&x.onEachFeature(s,C),this.addLayer(C)):this},resetStyle:function(s){return s===void 0?this.eachLayer(this.resetStyle,this):(s.options=n({},s.defaultOptions),this._setLayerStyle(s,this.options.style),this)},setStyle:function(s){return this.eachLayer(function(l){this._setLayerStyle(l,s)},this)},_setLayerStyle:function(s,l){s.setStyle&&(typeof l=="function"&&(l=l(s.feature)),s.setStyle(l))}});function Zo(s,l){var u=s.type==="Feature"?s.geometry:s,g=u?u.coordinates:null,p=[],x=l&&l.pointToLayer,C=l&&l.coordsToLatLng||dh,k,R,O,j;if(!g&&!u)return null;switch(u.type){case"Point":return k=C(g),Rf(x,s,k,l);case"MultiPoint":for(O=0,j=g.length;O<j;O++)k=C(g[O]),p.push(Rf(x,s,k,l));return new _i(p);case"LineString":case"MultiLineString":return R=jo(g,u.type==="LineString"?0:1,C),new pi(R,l);case"Polygon":case"MultiPolygon":return R=jo(g,u.type==="Polygon"?1:2,C),new er(R,l);case"GeometryCollection":for(O=0,j=u.geometries.length;O<j;O++){var et=Zo({geometry:u.geometries[O],type:"Feature",properties:s.properties},l);et&&p.push(et)}return new _i(p);case"FeatureCollection":for(O=0,j=u.features.length;O<j;O++){var ut=Zo(u.features[O],l);ut&&p.push(ut)}return new _i(p);default:throw new Error("Invalid GeoJSON object.")}}function Rf(s,l,u,g){return s?s(l,u):new Go(u,g&&g.markersInheritOptions&&g)}function dh(s){return new Y(s[1],s[0],s[2])}function jo(s,l,u){for(var g=[],p=0,x=s.length,C;p<x;p++)C=l?jo(s[p],l-1,u):(u||dh)(s[p]),g.push(C);return g}function fh(s,l){return s=nt(s),s.alt!==void 0?[m(s.lng,l),m(s.lat,l),m(s.alt,l)]:[m(s.lng,l),m(s.lat,l)]}function Wo(s,l,u,g){for(var p=[],x=0,C=s.length;x<C;x++)p.push(l?Wo(s[x],we(s[x])?0:l-1,u,g):fh(s[x],g));return!l&&u&&p.length>0&&p.push(p[0].slice()),p}function ir(s,l){return s.feature?n({},s.feature,{geometry:l}):Ho(l)}function Ho(s){return s.type==="Feature"||s.type==="FeatureCollection"?s:{type:"Feature",properties:{},geometry:s}}var gh={toGeoJSON:function(s){return ir(this,{type:"Point",coordinates:fh(this.getLatLng(),s)})}};Go.include(gh),uh.include(gh),Uo.include(gh),pi.include({toGeoJSON:function(s){var l=!we(this._latlngs),u=Wo(this._latlngs,l?1:0,!1,s);return ir(this,{type:(l?"Multi":"")+"LineString",coordinates:u})}}),er.include({toGeoJSON:function(s){var l=!we(this._latlngs),u=l&&!we(this._latlngs[0]),g=Wo(this._latlngs,u?2:l?1:0,!0,s);return l||(g=[g]),ir(this,{type:(u?"Multi":"")+"Polygon",coordinates:g})}}),Qn.include({toMultiPoint:function(s){var l=[];return this.eachLayer(function(u){l.push(u.toGeoJSON(s).geometry.coordinates)}),ir(this,{type:"MultiPoint",coordinates:l})},toGeoJSON:function(s){var l=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(l==="MultiPoint")return this.toMultiPoint(s);var u=l==="GeometryCollection",g=[];return this.eachLayer(function(p){if(p.toGeoJSON){var x=p.toGeoJSON(s);if(u)g.push(x.geometry);else{var C=Ho(x);C.type==="FeatureCollection"?g.push.apply(g,C.features):g.push(C)}}}),u?ir(this,{geometries:g,type:"GeometryCollection"}):{type:"FeatureCollection",features:g}}});function Mf(s,l){return new mi(s,l)}var nL=Mf,Vo=Ae.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(s,l,u){this._url=s,this._bounds=J(l),E(this,u)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(lt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Rt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(s){return this.options.opacity=s,this._image&&this._updateOpacity(),this},setStyle:function(s){return s.opacity&&this.setOpacity(s.opacity),this},bringToFront:function(){return this._map&&$n(this._image),this},bringToBack:function(){return this._map&&Jn(this._image),this},setUrl:function(s){return this._url=s,this._image&&(this._image.src=s),this},setBounds:function(s){return this._bounds=J(s),this._map&&this._reset(),this},getEvents:function(){var s={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(s.zoomanim=this._animateZoom),s},setZIndex:function(s){return this.options.zIndex=s,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var s=this._url.tagName==="IMG",l=this._image=s?this._url:mt("img");if(lt(l,"leaflet-image-layer"),this._zoomAnimated&&lt(l,"leaflet-zoom-animated"),this.options.className&&lt(l,this.options.className),l.onselectstart=_,l.onmousemove=_,l.onload=a(this.fire,this,"load"),l.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(l.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),s){this._url=l.src;return}l.src=this._url,l.alt=this.options.alt},_animateZoom:function(s){var l=this._map.getZoomScale(s.zoom),u=this._map._latLngBoundsToNewLayerBounds(this._bounds,s.zoom,s.center).min;un(this._image,u,l)},_reset:function(){var s=this._image,l=new st(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),u=l.getSize();Nt(s,l.min),s.style.width=u.x+"px",s.style.height=u.y+"px"},_updateOpacity:function(){Ee(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var s=this.options.errorOverlayUrl;s&&this._url!==s&&(this._url=s,this._image.src=s)},getCenter:function(){return this._bounds.getCenter()}}),rL=function(s,l,u){return new Vo(s,l,u)},If=Vo.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var s=this._url.tagName==="VIDEO",l=this._image=s?this._url:mt("video");if(lt(l,"leaflet-image-layer"),this._zoomAnimated&&lt(l,"leaflet-zoom-animated"),this.options.className&&lt(l,this.options.className),l.onselectstart=_,l.onmousemove=_,l.onloadeddata=a(this.fire,this,"load"),s){for(var u=l.getElementsByTagName("source"),g=[],p=0;p<u.length;p++)g.push(u[p].src);this._url=u.length>0?g:[l.src];return}T(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(l.style,"objectFit")&&(l.style.objectFit="fill"),l.autoplay=!!this.options.autoplay,l.loop=!!this.options.loop,l.muted=!!this.options.muted,l.playsInline=!!this.options.playsInline;for(var x=0;x<this._url.length;x++){var C=mt("source");C.src=this._url[x],l.appendChild(C)}}});function sL(s,l,u){return new If(s,l,u)}var Af=Vo.extend({_initImage:function(){var s=this._image=this._url;lt(s,"leaflet-image-layer"),this._zoomAnimated&&lt(s,"leaflet-zoom-animated"),this.options.className&&lt(s,this.options.className),s.onselectstart=_,s.onmousemove=_}});function oL(s,l,u){return new Af(s,l,u)}var Ke=Ae.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(s,l){s&&(s instanceof Y||T(s))?(this._latlng=nt(s),E(this,l)):(E(this,s),this._source=l),this.options.content&&(this._content=this.options.content)},openOn:function(s){return s=arguments.length?s:this._source._map,s.hasLayer(this)||s.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(s){return this._map?this.close():(arguments.length?this._source=s:s=this._source,this._prepareOpen(),this.openOn(s._map)),this},onAdd:function(s){this._zoomAnimated=s._zoomAnimated,this._container||this._initLayout(),s._fadeAnimated&&Ee(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),s._fadeAnimated&&Ee(this._container,1),this.bringToFront(),this.options.interactive&&(lt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(s){s._fadeAnimated?(Ee(this._container,0),this._removeTimeout=setTimeout(a(Rt,void 0,this._container),200)):Rt(this._container),this.options.interactive&&(At(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(s){return this._latlng=nt(s),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(s){return this._content=s,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var s={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(s.zoomanim=this._animateZoom),s},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&$n(this._container),this},bringToBack:function(){return this._map&&Jn(this._container),this},_prepareOpen:function(s){var l=this._source;if(!l._map)return!1;if(l instanceof _i){l=null;var u=this._source._layers;for(var g in u)if(u[g]._map){l=u[g];break}if(!l)return!1;this._source=l}if(!s)if(l.getCenter)s=l.getCenter();else if(l.getLatLng)s=l.getLatLng();else if(l.getBounds)s=l.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(s),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var s=this._contentNode,l=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof l=="string")s.innerHTML=l;else{for(;s.hasChildNodes();)s.removeChild(s.firstChild);s.appendChild(l)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var s=this._map.latLngToLayerPoint(this._latlng),l=U(this.options.offset),u=this._getAnchor();this._zoomAnimated?Nt(this._container,s.add(u)):l=l.add(s).add(u);var g=this._containerBottom=-l.y,p=this._containerLeft=-Math.round(this._containerWidth/2)+l.x;this._container.style.bottom=g+"px",this._container.style.left=p+"px"}},_getAnchor:function(){return[0,0]}});_t.include({_initOverlay:function(s,l,u,g){var p=l;return p instanceof s||(p=new s(g).setContent(l)),u&&p.setLatLng(u),p}}),Ae.include({_initOverlay:function(s,l,u,g){var p=u;return p instanceof s?(E(p,g),p._source=this):(p=l&&!g?l:new s(g,this),p.setContent(u)),p}});var Xo=Ke.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(s){return s=arguments.length?s:this._source._map,!s.hasLayer(this)&&s._popup&&s._popup.options.autoClose&&s.removeLayer(s._popup),s._popup=this,Ke.prototype.openOn.call(this,s)},onAdd:function(s){Ke.prototype.onAdd.call(this,s),s.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Wi||this._source.on("preclick",fn))},onRemove:function(s){Ke.prototype.onRemove.call(this,s),s.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Wi||this._source.off("preclick",fn))},getEvents:function(){var s=Ke.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(s.preclick=this.close),this.options.keepInView&&(s.moveend=this._adjustPan),s},_initLayout:function(){var s="leaflet-popup",l=this._container=mt("div",s+" "+(this.options.className||"")+" leaflet-zoom-animated"),u=this._wrapper=mt("div",s+"-content-wrapper",l);if(this._contentNode=mt("div",s+"-content",u),qr(l),nh(this._contentNode),ot(l,"contextmenu",fn),this._tipContainer=mt("div",s+"-tip-container",l),this._tip=mt("div",s+"-tip",this._tipContainer),this.options.closeButton){var g=this._closeButton=mt("a",s+"-close-button",l);g.setAttribute("role","button"),g.setAttribute("aria-label","Close popup"),g.href="#close",g.innerHTML='<span aria-hidden="true">&#215;</span>',ot(g,"click",function(p){Kt(p),this.close()},this)}},_updateLayout:function(){var s=this._contentNode,l=s.style;l.width="",l.whiteSpace="nowrap";var u=s.offsetWidth;u=Math.min(u,this.options.maxWidth),u=Math.max(u,this.options.minWidth),l.width=u+1+"px",l.whiteSpace="",l.height="";var g=s.offsetHeight,p=this.options.maxHeight,x="leaflet-popup-scrolled";p&&g>p?(l.height=p+"px",lt(s,x)):At(s,x),this._containerWidth=this._container.offsetWidth},_animateZoom:function(s){var l=this._map._latLngToNewLayerPoint(this._latlng,s.zoom,s.center),u=this._getAnchor();Nt(this._container,l.add(u))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var s=this._map,l=parseInt(Vr(this._container,"marginBottom"),10)||0,u=this._container.offsetHeight+l,g=this._containerWidth,p=new B(this._containerLeft,-u-this._containerBottom);p._add(dn(this._container));var x=s.layerPointToContainerPoint(p),C=U(this.options.autoPanPadding),k=U(this.options.autoPanPaddingTopLeft||C),R=U(this.options.autoPanPaddingBottomRight||C),O=s.getSize(),j=0,et=0;x.x+g+R.x>O.x&&(j=x.x+g-O.x+R.x),x.x-j-k.x<0&&(j=x.x-k.x),x.y+u+R.y>O.y&&(et=x.y+u-O.y+R.y),x.y-et-k.y<0&&(et=x.y-k.y),(j||et)&&(this.options.keepInView&&(this._autopanning=!0),s.fire("autopanstart").panBy([j,et]))}},_getAnchor:function(){return U(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),aL=function(s,l){return new Xo(s,l)};_t.mergeOptions({closePopupOnClick:!0}),_t.include({openPopup:function(s,l,u){return this._initOverlay(Xo,s,l,u).openOn(this),this},closePopup:function(s){return s=arguments.length?s:this._popup,s&&s.close(),this}}),Ae.include({bindPopup:function(s,l){return this._popup=this._initOverlay(Xo,this._popup,s,l),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(s){return this._popup&&(this instanceof _i||(this._popup._source=this),this._popup._prepareOpen(s||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(s){return this._popup&&this._popup.setContent(s),this},getPopup:function(){return this._popup},_openPopup:function(s){if(!(!this._popup||!this._map)){gn(s);var l=s.layer||s.target;if(this._popup._source===l&&!(l instanceof Wi)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(s.latlng);return}this._popup._source=l,this.openPopup(s.latlng)}},_movePopup:function(s){this._popup.setLatLng(s.latlng)},_onKeyPress:function(s){s.originalEvent.keyCode===13&&this._openPopup(s)}});var Yo=Ke.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(s){Ke.prototype.onAdd.call(this,s),this.setOpacity(this.options.opacity),s.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(s){Ke.prototype.onRemove.call(this,s),s.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var s=Ke.prototype.getEvents.call(this);return this.options.permanent||(s.preclick=this.close),s},_initLayout:function(){var s="leaflet-tooltip",l=s+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=mt("div",l),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(s){var l,u,g=this._map,p=this._container,x=g.latLngToContainerPoint(g.getCenter()),C=g.layerPointToContainerPoint(s),k=this.options.direction,R=p.offsetWidth,O=p.offsetHeight,j=U(this.options.offset),et=this._getAnchor();k==="top"?(l=R/2,u=O):k==="bottom"?(l=R/2,u=0):k==="center"?(l=R/2,u=O/2):k==="right"?(l=0,u=O/2):k==="left"?(l=R,u=O/2):C.x<x.x?(k="right",l=0,u=O/2):(k="left",l=R+(j.x+et.x)*2,u=O/2),s=s.subtract(U(l,u,!0)).add(j).add(et),At(p,"leaflet-tooltip-right"),At(p,"leaflet-tooltip-left"),At(p,"leaflet-tooltip-top"),At(p,"leaflet-tooltip-bottom"),lt(p,"leaflet-tooltip-"+k),Nt(p,s)},_updatePosition:function(){var s=this._map.latLngToLayerPoint(this._latlng);this._setPosition(s)},setOpacity:function(s){this.options.opacity=s,this._container&&Ee(this._container,s)},_animateZoom:function(s){var l=this._map._latLngToNewLayerPoint(this._latlng,s.zoom,s.center);this._setPosition(l)},_getAnchor:function(){return U(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),lL=function(s,l){return new Yo(s,l)};_t.include({openTooltip:function(s,l,u){return this._initOverlay(Yo,s,l,u).openOn(this),this},closeTooltip:function(s){return s.close(),this}}),Ae.include({bindTooltip:function(s,l){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Yo,this._tooltip,s,l),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(s){if(!(!s&&this._tooltipHandlersAdded)){var l=s?"off":"on",u={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?u.add=this._openTooltip:(u.mouseover=this._openTooltip,u.mouseout=this.closeTooltip,u.click=this._openTooltip,this._map?this._addFocusListeners():u.add=this._addFocusListeners),this._tooltip.options.sticky&&(u.mousemove=this._moveTooltip),this[l](u),this._tooltipHandlersAdded=!s}},openTooltip:function(s){return this._tooltip&&(this instanceof _i||(this._tooltip._source=this),this._tooltip._prepareOpen(s)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(s){return this._tooltip&&this._tooltip.setContent(s),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(s){var l=typeof s.getElement=="function"&&s.getElement();l&&(ot(l,"focus",function(){this._tooltip._source=s,this.openTooltip()},this),ot(l,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(s){var l=typeof s.getElement=="function"&&s.getElement();l&&l.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(s){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var l=this;this._map.once("moveend",function(){l._openOnceFlag=!1,l._openTooltip(s)});return}this._tooltip._source=s.layer||s.target,this.openTooltip(this._tooltip.options.sticky?s.latlng:void 0)}},_moveTooltip:function(s){var l=s.latlng,u,g;this._tooltip.options.sticky&&s.originalEvent&&(u=this._map.mouseEventToContainerPoint(s.originalEvent),g=this._map.containerPointToLayerPoint(u),l=this._map.layerPointToLatLng(g)),this._tooltip.setLatLng(l)}});var Df=tr.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(s){var l=s&&s.tagName==="DIV"?s:document.createElement("div"),u=this.options;if(u.html instanceof Element?(Do(l),l.appendChild(u.html)):l.innerHTML=u.html!==!1?u.html:"",u.bgPos){var g=U(u.bgPos);l.style.backgroundPosition=-g.x+"px "+-g.y+"px"}return this._setIconStyles(l,"icon"),l},createShadow:function(){return null}});function hL(s){return new Df(s)}tr.Default=Qr;var ts=Ae.extend({options:{tileSize:256,opacity:1,updateWhenIdle:X.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(s){E(this,s)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(s){s._addZoomLimit(this)},onRemove:function(s){this._removeAllTiles(),Rt(this._container),s._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&($n(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Jn(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(s){return this.options.opacity=s,this._updateOpacity(),this},setZIndex:function(s){return this.options.zIndex=s,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var s=this._clampZoom(this._map.getZoom());s!==this._tileZoom&&(this._tileZoom=s,this._updateLevels()),this._update()}return this},getEvents:function(){var s={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=d(this._onMoveEnd,this.options.updateInterval,this)),s.move=this._onMove),this._zoomAnimated&&(s.zoomanim=this._animateZoom),s},createTile:function(){return document.createElement("div")},getTileSize:function(){var s=this.options.tileSize;return s instanceof B?s:new B(s,s)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(s){for(var l=this.getPane().children,u=-s(-1/0,1/0),g=0,p=l.length,x;g<p;g++)x=l[g].style.zIndex,l[g]!==this._container&&x&&(u=s(u,+x));isFinite(u)&&(this.options.zIndex=u+s(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!X.ielt9){Ee(this._container,this.options.opacity);var s=+new Date,l=!1,u=!1;for(var g in this._tiles){var p=this._tiles[g];if(!(!p.current||!p.loaded)){var x=Math.min(1,(s-p.loaded)/200);Ee(p.el,x),x<1?l=!0:(p.active?u=!0:this._onOpaqueTile(p),p.active=!0)}}u&&!this._noPrune&&this._pruneTiles(),l&&(q(this._fadeFrame),this._fadeFrame=Q(this._updateOpacity,this))}},_onOpaqueTile:_,_initContainer:function(){this._container||(this._container=mt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var s=this._tileZoom,l=this.options.maxZoom;if(s!==void 0){for(var u in this._levels)u=Number(u),this._levels[u].el.children.length||u===s?(this._levels[u].el.style.zIndex=l-Math.abs(s-u),this._onUpdateLevel(u)):(Rt(this._levels[u].el),this._removeTilesAtZoom(u),this._onRemoveLevel(u),delete this._levels[u]);var g=this._levels[s],p=this._map;return g||(g=this._levels[s]={},g.el=mt("div","leaflet-tile-container leaflet-zoom-animated",this._container),g.el.style.zIndex=l,g.origin=p.project(p.unproject(p.getPixelOrigin()),s).round(),g.zoom=s,this._setZoomTransform(g,p.getCenter(),p.getZoom()),_(g.el.offsetWidth),this._onCreateLevel(g)),this._level=g,g}},_onUpdateLevel:_,_onRemoveLevel:_,_onCreateLevel:_,_pruneTiles:function(){if(this._map){var s,l,u=this._map.getZoom();if(u>this.options.maxZoom||u<this.options.minZoom){this._removeAllTiles();return}for(s in this._tiles)l=this._tiles[s],l.retain=l.current;for(s in this._tiles)if(l=this._tiles[s],l.current&&!l.active){var g=l.coords;this._retainParent(g.x,g.y,g.z,g.z-5)||this._retainChildren(g.x,g.y,g.z,g.z+2)}for(s in this._tiles)this._tiles[s].retain||this._removeTile(s)}},_removeTilesAtZoom:function(s){for(var l in this._tiles)this._tiles[l].coords.z===s&&this._removeTile(l)},_removeAllTiles:function(){for(var s in this._tiles)this._removeTile(s)},_invalidateAll:function(){for(var s in this._levels)Rt(this._levels[s].el),this._onRemoveLevel(Number(s)),delete this._levels[s];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(s,l,u,g){var p=Math.floor(s/2),x=Math.floor(l/2),C=u-1,k=new B(+p,+x);k.z=+C;var R=this._tileCoordsToKey(k),O=this._tiles[R];return O&&O.active?(O.retain=!0,!0):(O&&O.loaded&&(O.retain=!0),C>g?this._retainParent(p,x,C,g):!1)},_retainChildren:function(s,l,u,g){for(var p=2*s;p<2*s+2;p++)for(var x=2*l;x<2*l+2;x++){var C=new B(p,x);C.z=u+1;var k=this._tileCoordsToKey(C),R=this._tiles[k];if(R&&R.active){R.retain=!0;continue}else R&&R.loaded&&(R.retain=!0);u+1<g&&this._retainChildren(p,x,u+1,g)}},_resetView:function(s){var l=s&&(s.pinch||s.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),l,l)},_animateZoom:function(s){this._setView(s.center,s.zoom,!0,s.noUpdate)},_clampZoom:function(s){var l=this.options;return l.minNativeZoom!==void 0&&s<l.minNativeZoom?l.minNativeZoom:l.maxNativeZoom!==void 0&&l.maxNativeZoom<s?l.maxNativeZoom:s},_setView:function(s,l,u,g){var p=Math.round(l);this.options.maxZoom!==void 0&&p>this.options.maxZoom||this.options.minZoom!==void 0&&p<this.options.minZoom?p=void 0:p=this._clampZoom(p);var x=this.options.updateWhenZooming&&p!==this._tileZoom;(!g||x)&&(this._tileZoom=p,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),p!==void 0&&this._update(s),u||this._pruneTiles(),this._noPrune=!!u),this._setZoomTransforms(s,l)},_setZoomTransforms:function(s,l){for(var u in this._levels)this._setZoomTransform(this._levels[u],s,l)},_setZoomTransform:function(s,l,u){var g=this._map.getZoomScale(u,s.zoom),p=s.origin.multiplyBy(g).subtract(this._map._getNewPixelOrigin(l,u)).round();X.any3d?un(s.el,p,g):Nt(s.el,p)},_resetGrid:function(){var s=this._map,l=s.options.crs,u=this._tileSize=this.getTileSize(),g=this._tileZoom,p=this._map.getPixelWorldBounds(this._tileZoom);p&&(this._globalTileRange=this._pxBoundsToTileRange(p)),this._wrapX=l.wrapLng&&!this.options.noWrap&&[Math.floor(s.project([0,l.wrapLng[0]],g).x/u.x),Math.ceil(s.project([0,l.wrapLng[1]],g).x/u.y)],this._wrapY=l.wrapLat&&!this.options.noWrap&&[Math.floor(s.project([l.wrapLat[0],0],g).y/u.x),Math.ceil(s.project([l.wrapLat[1],0],g).y/u.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(s){var l=this._map,u=l._animatingZoom?Math.max(l._animateToZoom,l.getZoom()):l.getZoom(),g=l.getZoomScale(u,this._tileZoom),p=l.project(s,this._tileZoom).floor(),x=l.getSize().divideBy(g*2);return new st(p.subtract(x),p.add(x))},_update:function(s){var l=this._map;if(l){var u=this._clampZoom(l.getZoom());if(s===void 0&&(s=l.getCenter()),this._tileZoom!==void 0){var g=this._getTiledPixelBounds(s),p=this._pxBoundsToTileRange(g),x=p.getCenter(),C=[],k=this.options.keepBuffer,R=new st(p.getBottomLeft().subtract([k,-k]),p.getTopRight().add([k,-k]));if(!(isFinite(p.min.x)&&isFinite(p.min.y)&&isFinite(p.max.x)&&isFinite(p.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var O in this._tiles){var j=this._tiles[O].coords;(j.z!==this._tileZoom||!R.contains(new B(j.x,j.y)))&&(this._tiles[O].current=!1)}if(Math.abs(u-this._tileZoom)>1){this._setView(s,u);return}for(var et=p.min.y;et<=p.max.y;et++)for(var ut=p.min.x;ut<=p.max.x;ut++){var re=new B(ut,et);if(re.z=this._tileZoom,!!this._isValidTile(re)){var Ht=this._tiles[this._tileCoordsToKey(re)];Ht?Ht.current=!0:C.push(re)}}if(C.sort(function(ue,rr){return ue.distanceTo(x)-rr.distanceTo(x)}),C.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Le=document.createDocumentFragment();for(ut=0;ut<C.length;ut++)this._addTile(C[ut],Le);this._level.el.appendChild(Le)}}}},_isValidTile:function(s){var l=this._map.options.crs;if(!l.infinite){var u=this._globalTileRange;if(!l.wrapLng&&(s.x<u.min.x||s.x>u.max.x)||!l.wrapLat&&(s.y<u.min.y||s.y>u.max.y))return!1}if(!this.options.bounds)return!0;var g=this._tileCoordsToBounds(s);return J(this.options.bounds).overlaps(g)},_keyToBounds:function(s){return this._tileCoordsToBounds(this._keyToTileCoords(s))},_tileCoordsToNwSe:function(s){var l=this._map,u=this.getTileSize(),g=s.scaleBy(u),p=g.add(u),x=l.unproject(g,s.z),C=l.unproject(p,s.z);return[x,C]},_tileCoordsToBounds:function(s){var l=this._tileCoordsToNwSe(s),u=new Lt(l[0],l[1]);return this.options.noWrap||(u=this._map.wrapLatLngBounds(u)),u},_tileCoordsToKey:function(s){return s.x+":"+s.y+":"+s.z},_keyToTileCoords:function(s){var l=s.split(":"),u=new B(+l[0],+l[1]);return u.z=+l[2],u},_removeTile:function(s){var l=this._tiles[s];l&&(Rt(l.el),delete this._tiles[s],this.fire("tileunload",{tile:l.el,coords:this._keyToTileCoords(s)}))},_initTile:function(s){lt(s,"leaflet-tile");var l=this.getTileSize();s.style.width=l.x+"px",s.style.height=l.y+"px",s.onselectstart=_,s.onmousemove=_,X.ielt9&&this.options.opacity<1&&Ee(s,this.options.opacity)},_addTile:function(s,l){var u=this._getTilePos(s),g=this._tileCoordsToKey(s),p=this.createTile(this._wrapCoords(s),a(this._tileReady,this,s));this._initTile(p),this.createTile.length<2&&Q(a(this._tileReady,this,s,null,p)),Nt(p,u),this._tiles[g]={el:p,coords:s,current:!0},l.appendChild(p),this.fire("tileloadstart",{tile:p,coords:s})},_tileReady:function(s,l,u){l&&this.fire("tileerror",{error:l,tile:u,coords:s});var g=this._tileCoordsToKey(s);u=this._tiles[g],u&&(u.loaded=+new Date,this._map._fadeAnimated?(Ee(u.el,0),q(this._fadeFrame),this._fadeFrame=Q(this._updateOpacity,this)):(u.active=!0,this._pruneTiles()),l||(lt(u.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:u.el,coords:s})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),X.ielt9||!this._map._fadeAnimated?Q(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(s){return s.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(s){var l=new B(this._wrapX?f(s.x,this._wrapX):s.x,this._wrapY?f(s.y,this._wrapY):s.y);return l.z=s.z,l},_pxBoundsToTileRange:function(s){var l=this.getTileSize();return new st(s.min.unscaleBy(l).floor(),s.max.unscaleBy(l).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var s in this._tiles)if(!this._tiles[s].loaded)return!1;return!0}});function cL(s){return new ts(s)}var nr=ts.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(s,l){this._url=s,l=E(this,l),l.detectRetina&&X.retina&&l.maxZoom>0?(l.tileSize=Math.floor(l.tileSize/2),l.zoomReverse?(l.zoomOffset--,l.minZoom=Math.min(l.maxZoom,l.minZoom+1)):(l.zoomOffset++,l.maxZoom=Math.max(l.minZoom,l.maxZoom-1)),l.minZoom=Math.max(0,l.minZoom)):l.zoomReverse?l.minZoom=Math.min(l.maxZoom,l.minZoom):l.maxZoom=Math.max(l.minZoom,l.maxZoom),typeof l.subdomains=="string"&&(l.subdomains=l.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(s,l){return this._url===s&&l===void 0&&(l=!0),this._url=s,l||this.redraw(),this},createTile:function(s,l){var u=document.createElement("img");return ot(u,"load",a(this._tileOnLoad,this,l,u)),ot(u,"error",a(this._tileOnError,this,l,u)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(u.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(u.referrerPolicy=this.options.referrerPolicy),u.alt="",u.src=this.getTileUrl(s),u},getTileUrl:function(s){var l={r:X.retina?"@2x":"",s:this._getSubdomain(s),x:s.x,y:s.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var u=this._globalTileRange.max.y-s.y;this.options.tms&&(l.y=u),l["-y"]=u}return w(this._url,n(l,this.options))},_tileOnLoad:function(s,l){X.ielt9?setTimeout(a(s,this,null,l),0):s(null,l)},_tileOnError:function(s,l,u){var g=this.options.errorTileUrl;g&&l.getAttribute("src")!==g&&(l.src=g),s(u,l)},_onTileRemove:function(s){s.tile.onload=null},_getZoomForUrl:function(){var s=this._tileZoom,l=this.options.maxZoom,u=this.options.zoomReverse,g=this.options.zoomOffset;return u&&(s=l-s),s+g},_getSubdomain:function(s){var l=Math.abs(s.x+s.y)%this.options.subdomains.length;return this.options.subdomains[l]},_abortLoading:function(){var s,l;for(s in this._tiles)if(this._tiles[s].coords.z!==this._tileZoom&&(l=this._tiles[s].el,l.onload=_,l.onerror=_,!l.complete)){l.src=M;var u=this._tiles[s].coords;Rt(l),delete this._tiles[s],this.fire("tileabort",{tile:l,coords:u})}},_removeTile:function(s){var l=this._tiles[s];if(l)return l.el.setAttribute("src",M),ts.prototype._removeTile.call(this,s)},_tileReady:function(s,l,u){if(!(!this._map||u&&u.getAttribute("src")===M))return ts.prototype._tileReady.call(this,s,l,u)}});function Of(s,l){return new nr(s,l)}var Ff=nr.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(s,l){this._url=s;var u=n({},this.defaultWmsParams);for(var g in l)g in this.options||(u[g]=l[g]);l=E(this,l);var p=l.detectRetina&&X.retina?2:1,x=this.getTileSize();u.width=x.x*p,u.height=x.y*p,this.wmsParams=u},onAdd:function(s){this._crs=this.options.crs||s.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var l=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[l]=this._crs.code,nr.prototype.onAdd.call(this,s)},getTileUrl:function(s){var l=this._tileCoordsToNwSe(s),u=this._crs,g=F(u.project(l[0]),u.project(l[1])),p=g.min,x=g.max,C=(this._wmsVersion>=1.3&&this._crs===Pf?[p.y,p.x,x.y,x.x]:[p.x,p.y,x.x,x.y]).join(","),k=nr.prototype.getTileUrl.call(this,s);return k+b(this.wmsParams,k,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+C},setParams:function(s,l){return n(this.wmsParams,s),l||this.redraw(),this}});function uL(s,l){return new Ff(s,l)}nr.WMS=Ff,Of.wms=uL;var yi=Ae.extend({options:{padding:.1},initialize:function(s){E(this,s),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),lt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var s={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(s.zoomanim=this._onAnimZoom),s},_onAnimZoom:function(s){this._updateTransform(s.center,s.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(s,l){var u=this._map.getZoomScale(l,this._zoom),g=this._map.getSize().multiplyBy(.5+this.options.padding),p=this._map.project(this._center,l),x=g.multiplyBy(-u).add(p).subtract(this._map._getNewPixelOrigin(s,l));X.any3d?un(this._container,x,u):Nt(this._container,x)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var s in this._layers)this._layers[s]._reset()},_onZoomEnd:function(){for(var s in this._layers)this._layers[s]._project()},_updatePaths:function(){for(var s in this._layers)this._layers[s]._update()},_update:function(){var s=this.options.padding,l=this._map.getSize(),u=this._map.containerPointToLayerPoint(l.multiplyBy(-s)).round();this._bounds=new st(u,u.add(l.multiplyBy(1+s*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),zf=yi.extend({options:{tolerance:0},getEvents:function(){var s=yi.prototype.getEvents.call(this);return s.viewprereset=this._onViewPreReset,s},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){yi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var s=this._container=document.createElement("canvas");ot(s,"mousemove",this._onMouseMove,this),ot(s,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ot(s,"mouseout",this._handleMouseOut,this),s._leaflet_disable_events=!0,this._ctx=s.getContext("2d")},_destroyContainer:function(){q(this._redrawRequest),delete this._ctx,Rt(this._container),Pt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var s;this._redrawBounds=null;for(var l in this._layers)s=this._layers[l],s._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){yi.prototype._update.call(this);var s=this._bounds,l=this._container,u=s.getSize(),g=X.retina?2:1;Nt(l,s.min),l.width=g*u.x,l.height=g*u.y,l.style.width=u.x+"px",l.style.height=u.y+"px",X.retina&&this._ctx.scale(2,2),this._ctx.translate(-s.min.x,-s.min.y),this.fire("update")}},_reset:function(){yi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(s){this._updateDashArray(s),this._layers[c(s)]=s;var l=s._order={layer:s,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=l),this._drawLast=l,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(s){this._requestRedraw(s)},_removePath:function(s){var l=s._order,u=l.next,g=l.prev;u?u.prev=g:this._drawLast=g,g?g.next=u:this._drawFirst=u,delete s._order,delete this._layers[c(s)],this._requestRedraw(s)},_updatePath:function(s){this._extendRedrawBounds(s),s._project(),s._update(),this._requestRedraw(s)},_updateStyle:function(s){this._updateDashArray(s),this._requestRedraw(s)},_updateDashArray:function(s){if(typeof s.options.dashArray=="string"){var l=s.options.dashArray.split(/[, ]+/),u=[],g,p;for(p=0;p<l.length;p++){if(g=Number(l[p]),isNaN(g))return;u.push(g)}s.options._dashArray=u}else s.options._dashArray=s.options.dashArray},_requestRedraw:function(s){this._map&&(this._extendRedrawBounds(s),this._redrawRequest=this._redrawRequest||Q(this._redraw,this))},_extendRedrawBounds:function(s){if(s._pxBounds){var l=(s.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new st,this._redrawBounds.extend(s._pxBounds.min.subtract([l,l])),this._redrawBounds.extend(s._pxBounds.max.add([l,l]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var s=this._redrawBounds;if(s){var l=s.getSize();this._ctx.clearRect(s.min.x,s.min.y,l.x,l.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var s,l=this._redrawBounds;if(this._ctx.save(),l){var u=l.getSize();this._ctx.beginPath(),this._ctx.rect(l.min.x,l.min.y,u.x,u.y),this._ctx.clip()}this._drawing=!0;for(var g=this._drawFirst;g;g=g.next)s=g.layer,(!l||s._pxBounds&&s._pxBounds.intersects(l))&&s._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(s,l){if(this._drawing){var u,g,p,x,C=s._parts,k=C.length,R=this._ctx;if(k){for(R.beginPath(),u=0;u<k;u++){for(g=0,p=C[u].length;g<p;g++)x=C[u][g],R[g?"lineTo":"moveTo"](x.x,x.y);l&&R.closePath()}this._fillStroke(R,s)}}},_updateCircle:function(s){if(!(!this._drawing||s._empty())){var l=s._point,u=this._ctx,g=Math.max(Math.round(s._radius),1),p=(Math.max(Math.round(s._radiusY),1)||g)/g;p!==1&&(u.save(),u.scale(1,p)),u.beginPath(),u.arc(l.x,l.y/p,g,0,Math.PI*2,!1),p!==1&&u.restore(),this._fillStroke(u,s)}},_fillStroke:function(s,l){var u=l.options;u.fill&&(s.globalAlpha=u.fillOpacity,s.fillStyle=u.fillColor||u.color,s.fill(u.fillRule||"evenodd")),u.stroke&&u.weight!==0&&(s.setLineDash&&s.setLineDash(l.options&&l.options._dashArray||[]),s.globalAlpha=u.opacity,s.lineWidth=u.weight,s.strokeStyle=u.color,s.lineCap=u.lineCap,s.lineJoin=u.lineJoin,s.stroke())},_onClick:function(s){for(var l=this._map.mouseEventToLayerPoint(s),u,g,p=this._drawFirst;p;p=p.next)u=p.layer,u.options.interactive&&u._containsPoint(l)&&(!(s.type==="click"||s.type==="preclick")||!this._map._draggableMoved(u))&&(g=u);this._fireEvent(g?[g]:!1,s)},_onMouseMove:function(s){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var l=this._map.mouseEventToLayerPoint(s);this._handleMouseHover(s,l)}},_handleMouseOut:function(s){var l=this._hoveredLayer;l&&(At(this._container,"leaflet-interactive"),this._fireEvent([l],s,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(s,l){if(!this._mouseHoverThrottled){for(var u,g,p=this._drawFirst;p;p=p.next)u=p.layer,u.options.interactive&&u._containsPoint(l)&&(g=u);g!==this._hoveredLayer&&(this._handleMouseOut(s),g&&(lt(this._container,"leaflet-interactive"),this._fireEvent([g],s,"mouseover"),this._hoveredLayer=g)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,s),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(s,l,u){this._map._fireDOMEvent(l,u||l.type,s)},_bringToFront:function(s){var l=s._order;if(l){var u=l.next,g=l.prev;if(u)u.prev=g;else return;g?g.next=u:u&&(this._drawFirst=u),l.prev=this._drawLast,this._drawLast.next=l,l.next=null,this._drawLast=l,this._requestRedraw(s)}},_bringToBack:function(s){var l=s._order;if(l){var u=l.next,g=l.prev;if(g)g.next=u;else return;u?u.prev=g:g&&(this._drawLast=g),l.prev=null,l.next=this._drawFirst,this._drawFirst.prev=l,this._drawFirst=l,this._requestRedraw(s)}}});function Nf(s){return X.canvas?new zf(s):null}var es=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(s){return document.createElement("<lvml:"+s+' class="lvml">')}}catch{}return function(s){return document.createElement("<"+s+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),dL={_initContainer:function(){this._container=mt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(yi.prototype._update.call(this),this.fire("update"))},_initPath:function(s){var l=s._container=es("shape");lt(l,"leaflet-vml-shape "+(this.options.className||"")),l.coordsize="1 1",s._path=es("path"),l.appendChild(s._path),this._updateStyle(s),this._layers[c(s)]=s},_addPath:function(s){var l=s._container;this._container.appendChild(l),s.options.interactive&&s.addInteractiveTarget(l)},_removePath:function(s){var l=s._container;Rt(l),s.removeInteractiveTarget(l),delete this._layers[c(s)]},_updateStyle:function(s){var l=s._stroke,u=s._fill,g=s.options,p=s._container;p.stroked=!!g.stroke,p.filled=!!g.fill,g.stroke?(l||(l=s._stroke=es("stroke")),p.appendChild(l),l.weight=g.weight+"px",l.color=g.color,l.opacity=g.opacity,g.dashArray?l.dashStyle=T(g.dashArray)?g.dashArray.join(" "):g.dashArray.replace(/( *, *)/g," "):l.dashStyle="",l.endcap=g.lineCap.replace("butt","flat"),l.joinstyle=g.lineJoin):l&&(p.removeChild(l),s._stroke=null),g.fill?(u||(u=s._fill=es("fill")),p.appendChild(u),u.color=g.fillColor||g.color,u.opacity=g.fillOpacity):u&&(p.removeChild(u),s._fill=null)},_updateCircle:function(s){var l=s._point.round(),u=Math.round(s._radius),g=Math.round(s._radiusY||u);this._setPath(s,s._empty()?"M0 0":"AL "+l.x+","+l.y+" "+u+","+g+" 0,"+65535*360)},_setPath:function(s,l){s._path.v=l},_bringToFront:function(s){$n(s._container)},_bringToBack:function(s){Jn(s._container)}},Ko=X.vml?es:Fi,is=yi.extend({_initContainer:function(){this._container=Ko("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ko("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Rt(this._container),Pt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){yi.prototype._update.call(this);var s=this._bounds,l=s.getSize(),u=this._container;(!this._svgSize||!this._svgSize.equals(l))&&(this._svgSize=l,u.setAttribute("width",l.x),u.setAttribute("height",l.y)),Nt(u,s.min),u.setAttribute("viewBox",[s.min.x,s.min.y,l.x,l.y].join(" ")),this.fire("update")}},_initPath:function(s){var l=s._path=Ko("path");s.options.className&&lt(l,s.options.className),s.options.interactive&&lt(l,"leaflet-interactive"),this._updateStyle(s),this._layers[c(s)]=s},_addPath:function(s){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(s._path),s.addInteractiveTarget(s._path)},_removePath:function(s){Rt(s._path),s.removeInteractiveTarget(s._path),delete this._layers[c(s)]},_updatePath:function(s){s._project(),s._update()},_updateStyle:function(s){var l=s._path,u=s.options;l&&(u.stroke?(l.setAttribute("stroke",u.color),l.setAttribute("stroke-opacity",u.opacity),l.setAttribute("stroke-width",u.weight),l.setAttribute("stroke-linecap",u.lineCap),l.setAttribute("stroke-linejoin",u.lineJoin),u.dashArray?l.setAttribute("stroke-dasharray",u.dashArray):l.removeAttribute("stroke-dasharray"),u.dashOffset?l.setAttribute("stroke-dashoffset",u.dashOffset):l.removeAttribute("stroke-dashoffset")):l.setAttribute("stroke","none"),u.fill?(l.setAttribute("fill",u.fillColor||u.color),l.setAttribute("fill-opacity",u.fillOpacity),l.setAttribute("fill-rule",u.fillRule||"evenodd")):l.setAttribute("fill","none"))},_updatePoly:function(s,l){this._setPath(s,Pe(s._parts,l))},_updateCircle:function(s){var l=s._point,u=Math.max(Math.round(s._radius),1),g=Math.max(Math.round(s._radiusY),1)||u,p="a"+u+","+g+" 0 1,0 ",x=s._empty()?"M0 0":"M"+(l.x-u)+","+l.y+p+u*2+",0 "+p+-u*2+",0 ";this._setPath(s,x)},_setPath:function(s,l){s._path.setAttribute("d",l)},_bringToFront:function(s){$n(s._path)},_bringToBack:function(s){Jn(s._path)}});X.vml&&is.include(dL);function Bf(s){return X.svg||X.vml?new is(s):null}_t.include({getRenderer:function(s){var l=s.options.renderer||this._getPaneRenderer(s.options.pane)||this.options.renderer||this._renderer;return l||(l=this._renderer=this._createRenderer()),this.hasLayer(l)||this.addLayer(l),l},_getPaneRenderer:function(s){if(s==="overlayPane"||s===void 0)return!1;var l=this._paneRenderers[s];return l===void 0&&(l=this._createRenderer({pane:s}),this._paneRenderers[s]=l),l},_createRenderer:function(s){return this.options.preferCanvas&&Nf(s)||Bf(s)}});var Gf=er.extend({initialize:function(s,l){er.prototype.initialize.call(this,this._boundsToLatLngs(s),l)},setBounds:function(s){return this.setLatLngs(this._boundsToLatLngs(s))},_boundsToLatLngs:function(s){return s=J(s),[s.getSouthWest(),s.getNorthWest(),s.getNorthEast(),s.getSouthEast()]}});function fL(s,l){return new Gf(s,l)}is.create=Ko,is.pointsToPath=Pe,mi.geometryToLayer=Zo,mi.coordsToLatLng=dh,mi.coordsToLatLngs=jo,mi.latLngToCoords=fh,mi.latLngsToCoords=Wo,mi.getFeature=ir,mi.asFeature=Ho,_t.mergeOptions({boxZoom:!0});var Uf=Ye.extend({initialize:function(s){this._map=s,this._container=s._container,this._pane=s._panes.overlayPane,this._resetStateTimeout=0,s.on("unload",this._destroy,this)},addHooks:function(){ot(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Pt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Rt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(s){if(!s.shiftKey||s.which!==1&&s.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Xr(),Kl(),this._startPoint=this._map.mouseEventToContainerPoint(s),ot(document,{contextmenu:gn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(s){this._moved||(this._moved=!0,this._box=mt("div","leaflet-zoom-box",this._container),lt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(s);var l=new st(this._point,this._startPoint),u=l.getSize();Nt(this._box,l.min),this._box.style.width=u.x+"px",this._box.style.height=u.y+"px"},_finish:function(){this._moved&&(Rt(this._box),At(this._container,"leaflet-crosshair")),Yr(),ql(),Pt(document,{contextmenu:gn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(s){if(!(s.which!==1&&s.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var l=new Lt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(l).fire("boxzoomend",{boxZoomBounds:l})}},_onKeyDown:function(s){s.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});_t.addInitHook("addHandler","boxZoom",Uf),_t.mergeOptions({doubleClickZoom:!0});var Zf=Ye.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(s){var l=this._map,u=l.getZoom(),g=l.options.zoomDelta,p=s.originalEvent.shiftKey?u-g:u+g;l.options.doubleClickZoom==="center"?l.setZoom(p):l.setZoomAround(s.containerPoint,p)}});_t.addInitHook("addHandler","doubleClickZoom",Zf),_t.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var jf=Ye.extend({addHooks:function(){if(!this._draggable){var s=this._map;this._draggable=new ji(s._mapPane,s._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),s.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),s.on("zoomend",this._onZoomEnd,this),s.whenReady(this._onZoomEnd,this))}lt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){At(this._map._container,"leaflet-grab"),At(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var s=this._map;if(s._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var l=J(this._map.options.maxBounds);this._offsetLimit=F(this._map.latLngToContainerPoint(l.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(l.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;s.fire("movestart").fire("dragstart"),s.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(s){if(this._map.options.inertia){var l=this._lastTime=+new Date,u=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(u),this._times.push(l),this._prunePositions(l)}this._map.fire("move",s).fire("drag",s)},_prunePositions:function(s){for(;this._positions.length>1&&s-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var s=this._map.getSize().divideBy(2),l=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=l.subtract(s).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(s,l){return s-(s-l)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var s=this._draggable._newPos.subtract(this._draggable._startPos),l=this._offsetLimit;s.x<l.min.x&&(s.x=this._viscousLimit(s.x,l.min.x)),s.y<l.min.y&&(s.y=this._viscousLimit(s.y,l.min.y)),s.x>l.max.x&&(s.x=this._viscousLimit(s.x,l.max.x)),s.y>l.max.y&&(s.y=this._viscousLimit(s.y,l.max.y)),this._draggable._newPos=this._draggable._startPos.add(s)}},_onPreDragWrap:function(){var s=this._worldWidth,l=Math.round(s/2),u=this._initialWorldOffset,g=this._draggable._newPos.x,p=(g-l+u)%s+l-u,x=(g+l+u)%s-l-u,C=Math.abs(p+u)<Math.abs(x+u)?p:x;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=C},_onDragEnd:function(s){var l=this._map,u=l.options,g=!u.inertia||s.noInertia||this._times.length<2;if(l.fire("dragend",s),g)l.fire("moveend");else{this._prunePositions(+new Date);var p=this._lastPos.subtract(this._positions[0]),x=(this._lastTime-this._times[0])/1e3,C=u.easeLinearity,k=p.multiplyBy(C/x),R=k.distanceTo([0,0]),O=Math.min(u.inertiaMaxSpeed,R),j=k.multiplyBy(O/R),et=O/(u.inertiaDeceleration*C),ut=j.multiplyBy(-et/2).round();!ut.x&&!ut.y?l.fire("moveend"):(ut=l._limitOffset(ut,l.options.maxBounds),Q(function(){l.panBy(ut,{duration:et,easeLinearity:C,noMoveStart:!0,animate:!0})}))}}});_t.addInitHook("addHandler","dragging",jf),_t.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Wf=Ye.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(s){this._map=s,this._setPanDelta(s.options.keyboardPanDelta),this._setZoomDelta(s.options.zoomDelta)},addHooks:function(){var s=this._map._container;s.tabIndex<=0&&(s.tabIndex="0"),ot(s,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Pt(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var s=document.body,l=document.documentElement,u=s.scrollTop||l.scrollTop,g=s.scrollLeft||l.scrollLeft;this._map._container.focus(),window.scrollTo(g,u)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(s){var l=this._panKeys={},u=this.keyCodes,g,p;for(g=0,p=u.left.length;g<p;g++)l[u.left[g]]=[-1*s,0];for(g=0,p=u.right.length;g<p;g++)l[u.right[g]]=[s,0];for(g=0,p=u.down.length;g<p;g++)l[u.down[g]]=[0,s];for(g=0,p=u.up.length;g<p;g++)l[u.up[g]]=[0,-1*s]},_setZoomDelta:function(s){var l=this._zoomKeys={},u=this.keyCodes,g,p;for(g=0,p=u.zoomIn.length;g<p;g++)l[u.zoomIn[g]]=s;for(g=0,p=u.zoomOut.length;g<p;g++)l[u.zoomOut[g]]=-s},_addHooks:function(){ot(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Pt(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(s){if(!(s.altKey||s.ctrlKey||s.metaKey)){var l=s.keyCode,u=this._map,g;if(l in this._panKeys){if(!u._panAnim||!u._panAnim._inProgress)if(g=this._panKeys[l],s.shiftKey&&(g=U(g).multiplyBy(3)),u.options.maxBounds&&(g=u._limitOffset(U(g),u.options.maxBounds)),u.options.worldCopyJump){var p=u.wrapLatLng(u.unproject(u.project(u.getCenter()).add(g)));u.panTo(p)}else u.panBy(g)}else if(l in this._zoomKeys)u.setZoom(u.getZoom()+(s.shiftKey?3:1)*this._zoomKeys[l]);else if(l===27&&u._popup&&u._popup.options.closeOnEscapeKey)u.closePopup();else return;gn(s)}}});_t.addInitHook("addHandler","keyboard",Wf),_t.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Hf=Ye.extend({addHooks:function(){ot(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Pt(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(s){var l=_f(s),u=this._map.options.wheelDebounceTime;this._delta+=l,this._lastMousePos=this._map.mouseEventToContainerPoint(s),this._startTime||(this._startTime=+new Date);var g=Math.max(u-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),g),gn(s)},_performZoom:function(){var s=this._map,l=s.getZoom(),u=this._map.options.zoomSnap||0;s._stop();var g=this._delta/(this._map.options.wheelPxPerZoomLevel*4),p=4*Math.log(2/(1+Math.exp(-Math.abs(g))))/Math.LN2,x=u?Math.ceil(p/u)*u:p,C=s._limitZoom(l+(this._delta>0?x:-x))-l;this._delta=0,this._startTime=null,C&&(s.options.scrollWheelZoom==="center"?s.setZoom(l+C):s.setZoomAround(this._lastMousePos,l+C))}});_t.addInitHook("addHandler","scrollWheelZoom",Hf);var gL=600;_t.mergeOptions({tapHold:X.touchNative&&X.safari&&X.mobile,tapTolerance:15});var Vf=Ye.extend({addHooks:function(){ot(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Pt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(s){if(clearTimeout(this._holdTimeout),s.touches.length===1){var l=s.touches[0];this._startPos=this._newPos=new B(l.clientX,l.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(ot(document,"touchend",Kt),ot(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",l))},this),gL),ot(document,"touchend touchcancel contextmenu",this._cancel,this),ot(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function s(){Pt(document,"touchend",Kt),Pt(document,"touchend touchcancel",s)},_cancel:function(){clearTimeout(this._holdTimeout),Pt(document,"touchend touchcancel contextmenu",this._cancel,this),Pt(document,"touchmove",this._onMove,this)},_onMove:function(s){var l=s.touches[0];this._newPos=new B(l.clientX,l.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(s,l){var u=new MouseEvent(s,{bubbles:!0,cancelable:!0,view:window,screenX:l.screenX,screenY:l.screenY,clientX:l.clientX,clientY:l.clientY});u._simulated=!0,l.target.dispatchEvent(u)}});_t.addInitHook("addHandler","tapHold",Vf),_t.mergeOptions({touchZoom:X.touch,bounceAtZoomLimits:!0});var Xf=Ye.extend({addHooks:function(){lt(this._map._container,"leaflet-touch-zoom"),ot(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){At(this._map._container,"leaflet-touch-zoom"),Pt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(s){var l=this._map;if(!(!s.touches||s.touches.length!==2||l._animatingZoom||this._zooming)){var u=l.mouseEventToContainerPoint(s.touches[0]),g=l.mouseEventToContainerPoint(s.touches[1]);this._centerPoint=l.getSize()._divideBy(2),this._startLatLng=l.containerPointToLatLng(this._centerPoint),l.options.touchZoom!=="center"&&(this._pinchStartLatLng=l.containerPointToLatLng(u.add(g)._divideBy(2))),this._startDist=u.distanceTo(g),this._startZoom=l.getZoom(),this._moved=!1,this._zooming=!0,l._stop(),ot(document,"touchmove",this._onTouchMove,this),ot(document,"touchend touchcancel",this._onTouchEnd,this),Kt(s)}},_onTouchMove:function(s){if(!(!s.touches||s.touches.length!==2||!this._zooming)){var l=this._map,u=l.mouseEventToContainerPoint(s.touches[0]),g=l.mouseEventToContainerPoint(s.touches[1]),p=u.distanceTo(g)/this._startDist;if(this._zoom=l.getScaleZoom(p,this._startZoom),!l.options.bounceAtZoomLimits&&(this._zoom<l.getMinZoom()&&p<1||this._zoom>l.getMaxZoom()&&p>1)&&(this._zoom=l._limitZoom(this._zoom)),l.options.touchZoom==="center"){if(this._center=this._startLatLng,p===1)return}else{var x=u._add(g)._divideBy(2)._subtract(this._centerPoint);if(p===1&&x.x===0&&x.y===0)return;this._center=l.unproject(l.project(this._pinchStartLatLng,this._zoom).subtract(x),this._zoom)}this._moved||(l._moveStart(!0,!1),this._moved=!0),q(this._animRequest);var C=a(l._move,l,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Q(C,this,!0),Kt(s)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,q(this._animRequest),Pt(document,"touchmove",this._onTouchMove,this),Pt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});_t.addInitHook("addHandler","touchZoom",Xf),_t.BoxZoom=Uf,_t.DoubleClickZoom=Zf,_t.Drag=jf,_t.Keyboard=Wf,_t.ScrollWheelZoom=Hf,_t.TapHold=Vf,_t.TouchZoom=Xf,e.Bounds=st,e.Browser=X,e.CRS=Ft,e.Canvas=zf,e.Circle=uh,e.CircleMarker=Uo,e.Class=Et,e.Control=Ie,e.DivIcon=Df,e.DivOverlay=Ke,e.DomEvent=Iw,e.DomUtil=Rw,e.Draggable=ji,e.Evented=Z,e.FeatureGroup=_i,e.GeoJSON=mi,e.GridLayer=ts,e.Handler=Ye,e.Icon=tr,e.ImageOverlay=Vo,e.LatLng=Y,e.LatLngBounds=Lt,e.Layer=Ae,e.LayerGroup=Qn,e.LineUtil=Hw,e.Map=_t,e.Marker=Go,e.Mixin=Bw,e.Path=Wi,e.Point=B,e.PolyUtil=Gw,e.Polygon=er,e.Polyline=pi,e.Popup=Xo,e.PosAnimation=pf,e.Projection=Vw,e.Rectangle=Gf,e.Renderer=yi,e.SVG=is,e.SVGOverlay=Af,e.TileLayer=nr,e.Tooltip=Yo,e.Transformation=Di,e.Util=ct,e.VideoOverlay=If,e.bind=a,e.bounds=F,e.canvas=Nf,e.circle=tL,e.circleMarker=Qw,e.control=$r,e.divIcon=hL,e.extend=n,e.featureGroup=qw,e.geoJSON=Mf,e.geoJson=nL,e.gridLayer=cL,e.icon=$w,e.imageOverlay=rL,e.latLng=nt,e.latLngBounds=J,e.layerGroup=Kw,e.map=Aw,e.marker=Jw,e.point=U,e.polygon=iL,e.polyline=eL,e.popup=aL,e.rectangle=fL,e.setOptions=E,e.stamp=c,e.svg=Bf,e.svgOverlay=oL,e.tileLayer=Of,e.tooltip=lL,e.transformation=xe,e.version=i,e.videoOverlay=sL;var _L=window.L;e.noConflict=function(){return window.L=_L,this},window.L=e})}(os,os.exports)),os.exports}var pt=Th();const CL="";function Ch(r,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=r,i}function ag(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Sh(r[0])||!Sh(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return Ch(i,t,e)}function lg(r,t,e){e===void 0&&(e={});for(var i=0,n=r;i<n.length;i++){var o=n[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:r};return Ch(h,t,e)}function Sh(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function hg(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function cg(r){return r.type==="Feature"?r.geometry:r}function ug(r,t,e,i,n){Ph(r,t,e||0,i||r.length-1,n||dg)}function Ph(r,t,e,i,n){for(;i>e;){if(i-e>600){var o=i-e+1,a=t-e+1,h=Math.log(o),c=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*c*(o-c)/o)*(a-o/2<0?-1:1),f=Math.max(e,Math.floor(t-a*c/o+d)),_=Math.min(i,Math.floor(t+(o-a)*c/o+d));Ph(r,t,f,_,n)}var m=r[t],v=e,y=i;for(sr(r,e,t),n(r[i],m)>0&&sr(r,e,i);v<y;){for(sr(r,v,y),v++,y--;n(r[v],m)<0;)v++;for(;n(r[y],m)>0;)y--}n(r[e],m)===0?sr(r,e,y):(y++,sr(r,y,i)),y<=t&&(e=y+1),t<=y&&(i=y-1)}}function sr(r,t,e){var i=r[t];r[t]=r[e],r[e]=i}function dg(r,t){return r<t?-1:r>t?1:0}let kh=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 i=[];if(!ls(t,e))return i;const n=this.toBBox,o=[];for(;e;){for(let a=0;a<e.children.length;a++){const h=e.children[a],c=e.leaf?n(h):h;ls(t,c)&&(e.leaf?i.push(h):ta(t,c)?this._all(h,i):o.push(h))}e=o.pop()}return i}collides(t){let e=this.data;if(!ls(t,e))return!1;const i=[];for(;e;){for(let n=0;n<e.children.length;n++){const o=e.children[n],a=e.leaf?this.toBBox(o):o;if(ls(t,a)){if(e.leaf||ta(t,a))return!0;i.push(o)}}e=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);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 i=this.data;this.data=e,e=i}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=mn([]),this}remove(t,e){if(!t)return this;let i=this.data;const n=this.toBBox(t),o=[],a=[];let h,c,d;for(;i||o.length;){if(i||(i=o.pop(),c=o[o.length-1],h=a.pop(),d=!0),i.leaf){const f=fg(t,i.children,e);if(f!==-1)return i.children.splice(f,1),o.push(i),this._condense(o),this}!d&&!i.leaf&&ta(i,n)?(o.push(i),a.push(h),h=0,c=i,i=i.children[0]):c?(h++,i=c.children[h],d=!1):i=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 i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,n){const o=i-e+1;let a=this._maxEntries,h;if(o<=a)return h=mn(t.slice(e,i+1)),pn(h,this.toBBox),h;n||(n=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,n-1))),h=mn([]),h.leaf=!1,h.height=n;const c=Math.ceil(o/a),d=c*Math.ceil(Math.sqrt(a));Rh(t,e,i,d,this.compareMinX);for(let f=e;f<=i;f+=d){const _=Math.min(f+d-1,i);Rh(t,f,_,c,this.compareMinY);for(let m=f;m<=_;m+=c){const v=Math.min(m+c-1,_);h.children.push(this._build(t,m,v,n-1))}}return pn(h,this.toBBox),h}_chooseSubtree(t,e,i,n){for(;n.push(e),!(e.leaf||n.length-1===i);){let o=1/0,a=1/0,h;for(let c=0;c<e.children.length;c++){const d=e.children[c],f=Qo(d),_=pg(t,d)-f;_<a?(a=_,o=f<o?f:o,h=d):_===a&&f<o&&(o=f,h=d)}e=h||e.children[0]}return e}_insert(t,e,i){const n=i?t:this.toBBox(t),o=[],a=this._chooseSubtree(n,this.data,e,o);for(a.children.push(t),ar(a,n);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(n,o,e)}_split(t,e){const i=t[e],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);const a=this._chooseSplitIndex(i,o,n),h=mn(i.children.splice(a,i.children.length-a));h.height=i.height,h.leaf=i.leaf,pn(i,this.toBBox),pn(h,this.toBBox),e?t[e-1].children.push(h):this._splitRoot(i,h)}_splitRoot(t,e){this.data=mn([t,e]),this.data.height=t.height+1,this.data.leaf=!1,pn(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let n,o=1/0,a=1/0;for(let h=e;h<=i-e;h++){const c=or(t,0,h,this.toBBox),d=or(t,h,i,this.toBBox),f=mg(c,d),_=Qo(c)+Qo(d);f<o?(o=f,n=h,a=_<a?_:a):f===o&&_<a&&(a=_,n=h)}return n||i-e}_chooseSplitAxis(t,e,i){const n=t.leaf?this.compareMinX:gg,o=t.leaf?this.compareMinY:_g,a=this._allDistMargin(t,e,i,n),h=this._allDistMargin(t,e,i,o);a<h&&t.children.sort(n)}_allDistMargin(t,e,i,n){t.children.sort(n);const o=this.toBBox,a=or(t,0,e,o),h=or(t,i-e,i,o);let c=as(a)+as(h);for(let d=e;d<i-e;d++){const f=t.children[d];ar(a,t.leaf?o(f):f),c+=as(a)}for(let d=i-e-1;d>=e;d--){const f=t.children[d];ar(h,t.leaf?o(f):f),c+=as(h)}return c}_adjustParentBBoxes(t,e,i){for(let n=i;n>=0;n--)ar(e[n],t)}_condense(t){for(let e=t.length-1,i;e>=0;e--)t[e].children.length===0?e>0?(i=t[e-1].children,i.splice(i.indexOf(t[e]),1)):this.clear():pn(t[e],this.toBBox)}};function fg(r,t,e){if(!e)return t.indexOf(r);for(let i=0;i<t.length;i++)if(e(r,t[i]))return i;return-1}function pn(r,t){or(r,0,r.children.length,t,r)}function or(r,t,e,i,n){n||(n=mn(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let o=t;o<e;o++){const a=r.children[o];ar(n,r.leaf?i(a):a)}return n}function ar(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function gg(r,t){return r.minX-t.minX}function _g(r,t){return r.minY-t.minY}function Qo(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function as(r){return r.maxX-r.minX+(r.maxY-r.minY)}function pg(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function mg(r,t){const e=Math.max(r.minX,t.minX),i=Math.max(r.minY,t.minY),n=Math.min(r.maxX,t.maxX),o=Math.min(r.maxY,t.maxY);return Math.max(0,n-e)*Math.max(0,o-i)}function ta(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function ls(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function mn(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Rh(r,t,e,i,n){const o=[t,e];for(;o.length;){if(e=o.pop(),t=o.pop(),e-t<=i)continue;const a=t+Math.ceil((e-t)/i/2)*i;ug(r,a,t,e,n),o.push(t,a,a,e)}}function yg(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");var i=hg(r),n=cg(t),o=n.type,a=t.bbox,h=n.coordinates;if(a&&vg(i,a)===!1)return!1;o==="Polygon"&&(h=[h]);for(var c=!1,d=0;d<h.length&&!c;d++)if(Mh(i,h[d][0],e.ignoreBoundary)){for(var f=!1,_=1;_<h[d].length&&!f;)Mh(i,h[d][_],!e.ignoreBoundary)&&(f=!0),_++;f||(c=!0)}return c}function Mh(r,t,e){var i=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var n=0,o=t.length-1;n<t.length;o=n++){var a=t[n][0],h=t[n][1],c=t[o][0],d=t[o][1],f=r[1]*(a-c)+h*(c-r[0])+d*(r[0]-a)===0&&(a-r[0])*(c-r[0])<=0&&(h-r[1])*(d-r[1])<=0;if(f)return!e;var _=h>r[1]!=d>r[1]&&r[0]<(c-a)*(r[1]-h)/(d-h)+a;_&&(i=!i)}return i}function vg(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}var Ih={exports:{}};Ih.exports=hs,Ih.exports.default=hs;function hs(r,t,e){e=e||2;var i=t&&t.length,n=i?t[0]*e:r.length,o=Ah(r,0,n,e,!0),a=[];if(!o||o.next===o.prev)return a;var h,c,d,f,_,m,v;if(i&&(o=bg(r,t,o,e)),r.length>80*e){h=d=r[0],c=f=r[1];for(var y=e;y<n;y+=e)_=r[y],m=r[y+1],_<h&&(h=_),m<c&&(c=m),_>d&&(d=_),m>f&&(f=m);v=Math.max(d-h,f-c),v=v!==0?32767/v:0}return lr(o,a,e,h,c,v,0),a}function Ah(r,t,e,i,n){var o,a;if(n===na(r,t,e,i)>0)for(o=t;o<e;o+=i)a=Fh(o,r[o],r[o+1],a);else for(o=e-i;o>=t;o-=i)a=Fh(o,r[o],r[o+1],a);return a&&cs(a,a.next)&&(cr(a),a=a.next),a}function Hi(r,t){if(!r)return r;t||(t=r);var e=r,i;do if(i=!1,!e.steiner&&(cs(e,e.next)||kt(e.prev,e,e.next)===0)){if(cr(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function lr(r,t,e,i,n,o,a){if(r){!a&&o&&kg(r,i,n,o);for(var h=r,c,d;r.prev!==r.next;){if(c=r.prev,d=r.next,o?Eg(r,i,n,o):xg(r)){t.push(c.i/e|0),t.push(r.i/e|0),t.push(d.i/e|0),cr(r),r=d.next,h=d.next;continue}if(r=d,r===h){a?a===1?(r=wg(Hi(r),t,e),lr(r,t,e,i,n,o,2)):a===2&&Lg(r,t,e,i,n,o):lr(Hi(r),t,e,i,n,o,1);break}}}}function xg(r){var t=r.prev,e=r,i=r.next;if(kt(t,e,i)>=0)return!1;for(var n=t.x,o=e.x,a=i.x,h=t.y,c=e.y,d=i.y,f=n<o?n<a?n:a:o<a?o:a,_=h<c?h<d?h:d:c<d?c:d,m=n>o?n>a?n:a:o>a?o:a,v=h>c?h>d?h:d:c>d?c:d,y=i.next;y!==t;){if(y.x>=f&&y.x<=m&&y.y>=_&&y.y<=v&&yn(n,h,o,c,a,d,y.x,y.y)&&kt(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function Eg(r,t,e,i){var n=r.prev,o=r,a=r.next;if(kt(n,o,a)>=0)return!1;for(var h=n.x,c=o.x,d=a.x,f=n.y,_=o.y,m=a.y,v=h<c?h<d?h:d:c<d?c:d,y=f<_?f<m?f:m:_<m?_:m,E=h>c?h>d?h:d:c>d?c:d,b=f>_?f>m?f:m:_>m?_:m,S=ea(v,y,t,e,i),w=ea(E,b,t,e,i),T=r.prevZ,P=r.nextZ;T&&T.z>=S&&P&&P.z<=w;){if(T.x>=v&&T.x<=E&&T.y>=y&&T.y<=b&&T!==n&&T!==a&&yn(h,f,c,_,d,m,T.x,T.y)&&kt(T.prev,T,T.next)>=0||(T=T.prevZ,P.x>=v&&P.x<=E&&P.y>=y&&P.y<=b&&P!==n&&P!==a&&yn(h,f,c,_,d,m,P.x,P.y)&&kt(P.prev,P,P.next)>=0))return!1;P=P.nextZ}for(;T&&T.z>=S;){if(T.x>=v&&T.x<=E&&T.y>=y&&T.y<=b&&T!==n&&T!==a&&yn(h,f,c,_,d,m,T.x,T.y)&&kt(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;P&&P.z<=w;){if(P.x>=v&&P.x<=E&&P.y>=y&&P.y<=b&&P!==n&&P!==a&&yn(h,f,c,_,d,m,P.x,P.y)&&kt(P.prev,P,P.next)>=0)return!1;P=P.nextZ}return!0}function wg(r,t,e){var i=r;do{var n=i.prev,o=i.next.next;!cs(n,o)&&Dh(n,i,i.next,o)&&hr(n,o)&&hr(o,n)&&(t.push(n.i/e|0),t.push(i.i/e|0),t.push(o.i/e|0),cr(i),cr(i.next),i=r=o),i=i.next}while(i!==r);return Hi(i)}function Lg(r,t,e,i,n,o){var a=r;do{for(var h=a.next.next;h!==a.prev;){if(a.i!==h.i&&Ig(a,h)){var c=Oh(a,h);a=Hi(a,a.next),c=Hi(c,c.next),lr(a,t,e,i,n,o,0),lr(c,t,e,i,n,o,0);return}h=h.next}a=a.next}while(a!==r)}function bg(r,t,e,i){var n=[],o,a,h,c,d;for(o=0,a=t.length;o<a;o++)h=t[o]*i,c=o<a-1?t[o+1]*i:r.length,d=Ah(r,h,c,i,!1),d===d.next&&(d.steiner=!0),n.push(Mg(d));for(n.sort(Tg),o=0;o<n.length;o++)e=Cg(n[o],e);return e}function Tg(r,t){return r.x-t.x}function Cg(r,t){var e=Sg(r,t);if(!e)return t;var i=Oh(e,r);return Hi(i,i.next),Hi(e,e.next)}function Sg(r,t){var e=t,i=r.x,n=r.y,o=-1/0,a;do{if(n<=e.y&&n>=e.next.y&&e.next.y!==e.y){var h=e.x+(n-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=i&&h>o&&(o=h,a=e.x<e.next.x?e:e.next,h===i))return a}e=e.next}while(e!==t);if(!a)return null;var c=a,d=a.x,f=a.y,_=1/0,m;e=a;do i>=e.x&&e.x>=d&&i!==e.x&&yn(n<f?i:o,n,d,f,n<f?o:i,n,e.x,e.y)&&(m=Math.abs(n-e.y)/(i-e.x),hr(e,r)&&(m<_||m===_&&(e.x>a.x||e.x===a.x&&Pg(a,e)))&&(a=e,_=m)),e=e.next;while(e!==c);return a}function Pg(r,t){return kt(r.prev,r,t.prev)<0&&kt(t.next,r,r.next)<0}function kg(r,t,e,i){var n=r;do n.z===0&&(n.z=ea(n.x,n.y,t,e,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==r);n.prevZ.nextZ=null,n.prevZ=null,Rg(n)}function Rg(r){var t,e,i,n,o,a,h,c,d=1;do{for(e=r,r=null,o=null,a=0;e;){for(a++,i=e,h=0,t=0;t<d&&(h++,i=i.nextZ,!!i);t++);for(c=d;h>0||c>0&&i;)h!==0&&(c===0||!i||e.z<=i.z)?(n=e,e=e.nextZ,h--):(n=i,i=i.nextZ,c--),o?o.nextZ=n:r=n,n.prevZ=o,o=n;e=i}o.nextZ=null,d*=2}while(a>1);return r}function ea(r,t,e,i,n){return r=(r-e)*n|0,t=(t-i)*n|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function Mg(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function yn(r,t,e,i,n,o,a,h){return(n-a)*(t-h)>=(r-a)*(o-h)&&(r-a)*(i-h)>=(e-a)*(t-h)&&(e-a)*(o-h)>=(n-a)*(i-h)}function Ig(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!Ag(r,t)&&(hr(r,t)&&hr(t,r)&&Dg(r,t)&&(kt(r.prev,r,t.prev)||kt(r,t.prev,t))||cs(r,t)&&kt(r.prev,r,r.next)>0&&kt(t.prev,t,t.next)>0)}function kt(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function cs(r,t){return r.x===t.x&&r.y===t.y}function Dh(r,t,e,i){var n=ds(kt(r,t,e)),o=ds(kt(r,t,i)),a=ds(kt(e,i,r)),h=ds(kt(e,i,t));return!!(n!==o&&a!==h||n===0&&us(r,e,t)||o===0&&us(r,i,t)||a===0&&us(e,r,i)||h===0&&us(e,t,i))}function us(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function ds(r){return r>0?1:r<0?-1:0}function Ag(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Dh(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function hr(r,t){return kt(r.prev,r,r.next)<0?kt(r,t,r.next)>=0&&kt(r,r.prev,t)>=0:kt(r,t,r.prev)<0||kt(r,r.next,t)<0}function Dg(r,t){var e=r,i=!1,n=(r.x+t.x)/2,o=(r.y+t.y)/2;do e.y>o!=e.next.y>o&&e.next.y!==e.y&&n<(e.next.x-e.x)*(o-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==r);return i}function Oh(r,t){var e=new ia(r.i,r.x,r.y),i=new ia(t.i,t.x,t.y),n=r.next,o=t.prev;return r.next=t,t.prev=r,e.next=n,n.prev=e,i.next=e,e.prev=i,o.next=i,i.prev=o,i}function Fh(r,t,e,i){var n=new ia(r,t,e);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function cr(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function ia(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}hs.deviation=function(r,t,e,i){var n=t&&t.length,o=n?t[0]*e:r.length,a=Math.abs(na(r,0,o,e));if(n)for(var h=0,c=t.length;h<c;h++){var d=t[h]*e,f=h<c-1?t[h+1]*e:r.length;a-=Math.abs(na(r,d,f,e))}var _=0;for(h=0;h<i.length;h+=3){var m=i[h]*e,v=i[h+1]*e,y=i[h+2]*e;_+=Math.abs((r[m]-r[y])*(r[v+1]-r[m+1])-(r[m]-r[v])*(r[y+1]-r[m+1]))}return a===0&&_===0?0:Math.abs((_-a)/a)};function na(r,t,e,i){for(var n=0,o=t,a=e-i;o<e;o+=i)n+=(r[a]-r[o])*(r[o+1]+r[a+1]),a=o;return n}hs.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},i=0,n=0;n<r.length;n++){for(var o=0;o<r[n].length;o++)for(var a=0;a<t;a++)e.vertices.push(r[n][o][a]);n>0&&(i+=r[n-1].length,e.holes.push(i))}return e};const SL="";var Og={exports:{}};const zh=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],$e=(()=>{if(typeof document>"u")return!1;const r=zh[0],t={};for(const e of zh)if((e==null?void 0:e[1])in document){for(const[n,o]of e.entries())t[r[n]]=o;return t}return!1})(),Nh={change:$e.fullscreenchange,error:$e.fullscreenerror};let fe={request(r=document.documentElement,t){return new Promise((e,i)=>{const n=()=>{fe.off("change",n),e()};fe.on("change",n);const o=r[$e.requestFullscreen](t);o instanceof Promise&&o.then(n).catch(i)})},exit(){return new Promise((r,t)=>{if(!fe.isFullscreen){r();return}const e=()=>{fe.off("change",e),r()};fe.on("change",e);const i=document[$e.exitFullscreen]();i instanceof Promise&&i.then(e).catch(t)})},toggle(r,t){return fe.isFullscreen?fe.exit():fe.request(r,t)},onchange(r){fe.on("change",r)},onerror(r){fe.on("error",r)},on(r,t){const e=Nh[r];e&&document.addEventListener(e,t,!1)},off(r,t){const e=Nh[r];e&&document.removeEventListener(e,t,!1)},raw:$e};Object.defineProperties(fe,{isFullscreen:{get:()=>!!document[$e.fullscreenElement]},element:{enumerable:!0,get:()=>document[$e.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>!!document[$e.fullscreenEnabled]}}),$e||(fe={isEnabled:!1});const Fg=mh(Object.freeze(Object.defineProperty({__proto__:null,default:fe},Symbol.toStringTag,{value:"Module"})));/*!
4
+ */(function(r,t){(function(e,i){i(t)})(De,function(e){var i="1.9.4";function n(s){var l,u,g,p;for(u=1,g=arguments.length;u<g;u++){p=arguments[u];for(l in p)s[l]=p[l]}return s}var o=Object.create||function(){function s(){}return function(l){return s.prototype=l,new s}}();function a(s,l){var u=Array.prototype.slice;if(s.bind)return s.bind.apply(s,u.call(arguments,1));var g=u.call(arguments,2);return function(){return s.apply(l,g.length?g.concat(u.call(arguments)):arguments)}}var h=0;function c(s){return"_leaflet_id"in s||(s._leaflet_id=++h),s._leaflet_id}function d(s,l,u){var g,p,w,P;return P=function(){g=!1,p&&(w.apply(u,p),p=!1)},w=function(){g?p=arguments:(s.apply(u,arguments),setTimeout(P,l),g=!0)},w}function f(s,l,u){var g=l[1],p=l[0],w=g-p;return s===g&&u?s:((s-p)%w+w)%w+p}function _(){return!1}function m(s,l){if(l===!1)return s;var u=Math.pow(10,l===void 0?6:l);return Math.round(s*u)/u}function E(s){return s.trim?s.trim():s.replace(/^\s+|\s+$/g,"")}function v(s){return E(s).split(/\s+/)}function b(s,l){Object.prototype.hasOwnProperty.call(s,"options")||(s.options=s.options?o(s.options):{});for(var u in l)s.options[u]=l[u];return s.options}function C(s,l,u){var g=[];for(var p in s)g.push(encodeURIComponent(u?p.toUpperCase():p)+"="+encodeURIComponent(s[p]));return(!l||l.indexOf("?")===-1?"?":"&")+g.join("&")}var S=/\{ *([\w_ -]+) *\}/g;function y(s,l){return s.replace(S,function(u,g){var p=l[g];if(p===void 0)throw new Error("No value provided for variable "+u);return typeof p=="function"&&(p=p(l)),p})}var x=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"};function T(s,l){for(var u=0;u<s.length;u++)if(s[u]===l)return u;return-1}var k="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function R(s){return window["webkit"+s]||window["moz"+s]||window["ms"+s]}var M=0;function A(s){var l=+new Date,u=Math.max(0,16-(l-M));return M=l+u,window.setTimeout(s,u)}var z=window.requestAnimationFrame||R("RequestAnimationFrame")||A,U=window.cancelAnimationFrame||R("CancelAnimationFrame")||R("CancelRequestAnimationFrame")||function(s){window.clearTimeout(s)};function Z(s,l,u){if(u&&z===A)s.call(l);else return z.call(window,a(s,l))}function H(s){s&&U.call(window,s)}var K={__proto__:null,extend:n,create:o,bind:a,get lastId(){return h},stamp:c,throttle:d,wrapNum:f,falseFn:_,formatNum:m,trim:E,splitWords:v,setOptions:b,getParamString:C,template:y,isArray:x,indexOf:T,emptyImageUrl:k,requestFn:z,cancelFn:U,requestAnimFrame:Z,cancelAnimFrame:H};function nt(){}nt.extend=function(s){var l=function(){b(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},u=l.__super__=this.prototype,g=o(u);g.constructor=l,l.prototype=g;for(var p in this)Object.prototype.hasOwnProperty.call(this,p)&&p!=="prototype"&&p!=="__super__"&&(l[p]=this[p]);return s.statics&&n(l,s.statics),s.includes&&(q(s.includes),n.apply(null,[g].concat(s.includes))),n(g,s),delete g.statics,delete g.includes,g.options&&(g.options=u.options?o(u.options):{},n(g.options,s.options)),g._initHooks=[],g.callInitHooks=function(){if(!this._initHooksCalled){u.callInitHooks&&u.callInitHooks.call(this),this._initHooksCalled=!0;for(var w=0,P=g._initHooks.length;w<P;w++)g._initHooks[w].call(this)}},l},nt.include=function(s){var l=this.prototype.options;return n(this.prototype,s),s.options&&(this.prototype.options=l,this.mergeOptions(s.options)),this},nt.mergeOptions=function(s){return n(this.prototype.options,s),this},nt.addInitHook=function(s){var l=Array.prototype.slice.call(arguments,1),u=typeof s=="function"?s:function(){this[s].apply(this,l)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(u),this};function q(s){if(!(typeof L>"u"||!L||!L.Mixin)){s=x(s)?s:[s];for(var l=0;l<s.length;l++)s[l]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var X={on:function(s,l,u){if(typeof s=="object")for(var g in s)this._on(g,s[g],l);else{s=v(s);for(var p=0,w=s.length;p<w;p++)this._on(s[p],l,u)}return this},off:function(s,l,u){if(!arguments.length)delete this._events;else if(typeof s=="object")for(var g in s)this._off(g,s[g],l);else{s=v(s);for(var p=arguments.length===1,w=0,P=s.length;w<P;w++)p?this._off(s[w]):this._off(s[w],l,u)}return this},_on:function(s,l,u,g){if(typeof l!="function"){console.warn("wrong listener type: "+typeof l);return}if(this._listens(s,l,u)===!1){u===this&&(u=void 0);var p={fn:l,ctx:u};g&&(p.once=!0),this._events=this._events||{},this._events[s]=this._events[s]||[],this._events[s].push(p)}},_off:function(s,l,u){var g,p,w;if(this._events&&(g=this._events[s],!!g)){if(arguments.length===1){if(this._firingCount)for(p=0,w=g.length;p<w;p++)g[p].fn=_;delete this._events[s];return}if(typeof l!="function"){console.warn("wrong listener type: "+typeof l);return}var P=this._listens(s,l,u);if(P!==!1){var I=g[P];this._firingCount&&(I.fn=_,this._events[s]=g=g.slice()),g.splice(P,1)}}},fire:function(s,l,u){if(!this.listens(s,u))return this;var g=n({},l,{type:s,target:this,sourceTarget:l&&l.sourceTarget||this});if(this._events){var p=this._events[s];if(p){this._firingCount=this._firingCount+1||1;for(var w=0,P=p.length;w<P;w++){var I=p[w],D=I.fn;I.once&&this.off(s,D,I.ctx),D.call(I.ctx||this,g)}this._firingCount--}}return u&&this._propagateEvent(g),this},listens:function(s,l,u,g){typeof s!="string"&&console.warn('"string" type argument expected');var p=l;typeof l!="function"&&(g=!!l,p=void 0,u=void 0);var w=this._events&&this._events[s];if(w&&w.length&&this._listens(s,p,u)!==!1)return!0;if(g){for(var P in this._eventParents)if(this._eventParents[P].listens(s,l,u,g))return!0}return!1},_listens:function(s,l,u){if(!this._events)return!1;var g=this._events[s]||[];if(!l)return!!g.length;u===this&&(u=void 0);for(var p=0,w=g.length;p<w;p++)if(g[p].fn===l&&g[p].ctx===u)return p;return!1},once:function(s,l,u){if(typeof s=="object")for(var g in s)this._on(g,s[g],l,!0);else{s=v(s);for(var p=0,w=s.length;p<w;p++)this._on(s[p],l,u,!0)}return this},addEventParent:function(s){return this._eventParents=this._eventParents||{},this._eventParents[c(s)]=s,this},removeEventParent:function(s){return this._eventParents&&delete this._eventParents[c(s)],this},_propagateEvent:function(s){for(var l in this._eventParents)this._eventParents[l].fire(s.type,n({layer:s.target,propagatedFrom:s.target},s),!0)}};X.addEventListener=X.on,X.removeEventListener=X.clearAllEventListeners=X.off,X.addOneTimeEventListener=X.once,X.fireEvent=X.fire,X.hasEventListeners=X.listens;var j=nt.extend(X);function B(s,l,u){this.x=u?Math.round(s):s,this.y=u?Math.round(l):l}var yt=Math.trunc||function(s){return s>0?Math.floor(s):Math.ceil(s)};B.prototype={clone:function(){return new B(this.x,this.y)},add:function(s){return this.clone()._add(W(s))},_add:function(s){return this.x+=s.x,this.y+=s.y,this},subtract:function(s){return this.clone()._subtract(W(s))},_subtract:function(s){return this.x-=s.x,this.y-=s.y,this},divideBy:function(s){return this.clone()._divideBy(s)},_divideBy:function(s){return this.x/=s,this.y/=s,this},multiplyBy:function(s){return this.clone()._multiplyBy(s)},_multiplyBy:function(s){return this.x*=s,this.y*=s,this},scaleBy:function(s){return new B(this.x*s.x,this.y*s.y)},unscaleBy:function(s){return new B(this.x/s.x,this.y/s.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=yt(this.x),this.y=yt(this.y),this},distanceTo:function(s){s=W(s);var l=s.x-this.x,u=s.y-this.y;return Math.sqrt(l*l+u*u)},equals:function(s){return s=W(s),s.x===this.x&&s.y===this.y},contains:function(s){return s=W(s),Math.abs(s.x)<=Math.abs(this.x)&&Math.abs(s.y)<=Math.abs(this.y)},toString:function(){return"Point("+m(this.x)+", "+m(this.y)+")"}};function W(s,l,u){return s instanceof B?s:x(s)?new B(s[0],s[1]):s==null?s:typeof s=="object"&&"x"in s&&"y"in s?new B(s.x,s.y):new B(s,l,u)}function rt(s,l){if(s)for(var u=l?[s,l]:s,g=0,p=u.length;g<p;g++)this.extend(u[g])}rt.prototype={extend:function(s){var l,u;if(!s)return this;if(s instanceof B||typeof s[0]=="number"||"x"in s)l=u=W(s);else if(s=F(s),l=s.min,u=s.max,!l||!u)return this;return!this.min&&!this.max?(this.min=l.clone(),this.max=u.clone()):(this.min.x=Math.min(l.x,this.min.x),this.max.x=Math.max(u.x,this.max.x),this.min.y=Math.min(l.y,this.min.y),this.max.y=Math.max(u.y,this.max.y)),this},getCenter:function(s){return W((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,s)},getBottomLeft:function(){return W(this.min.x,this.max.y)},getTopRight:function(){return W(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(s){var l,u;return typeof s[0]=="number"||s instanceof B?s=W(s):s=F(s),s instanceof rt?(l=s.min,u=s.max):l=u=s,l.x>=this.min.x&&u.x<=this.max.x&&l.y>=this.min.y&&u.y<=this.max.y},intersects:function(s){s=F(s);var l=this.min,u=this.max,g=s.min,p=s.max,w=p.x>=l.x&&g.x<=u.x,P=p.y>=l.y&&g.y<=u.y;return w&&P},overlaps:function(s){s=F(s);var l=this.min,u=this.max,g=s.min,p=s.max,w=p.x>l.x&&g.x<u.x,P=p.y>l.y&&g.y<u.y;return w&&P},isValid:function(){return!!(this.min&&this.max)},pad:function(s){var l=this.min,u=this.max,g=Math.abs(l.x-u.x)*s,p=Math.abs(l.y-u.y)*s;return F(W(l.x-g,l.y-p),W(u.x+g,u.y+p))},equals:function(s){return s?(s=F(s),this.min.equals(s.getTopLeft())&&this.max.equals(s.getBottomRight())):!1}};function F(s,l){return!s||s instanceof rt?s:new rt(s,l)}function Lt(s,l){if(s)for(var u=l?[s,l]:s,g=0,p=u.length;g<p;g++)this.extend(u[g])}Lt.prototype={extend:function(s){var l=this._southWest,u=this._northEast,g,p;if(s instanceof J)g=s,p=s;else if(s instanceof Lt){if(g=s._southWest,p=s._northEast,!g||!p)return this}else return s?this.extend(ot(s)||tt(s)):this;return!l&&!u?(this._southWest=new J(g.lat,g.lng),this._northEast=new J(p.lat,p.lng)):(l.lat=Math.min(g.lat,l.lat),l.lng=Math.min(g.lng,l.lng),u.lat=Math.max(p.lat,u.lat),u.lng=Math.max(p.lng,u.lng)),this},pad:function(s){var l=this._southWest,u=this._northEast,g=Math.abs(l.lat-u.lat)*s,p=Math.abs(l.lng-u.lng)*s;return new Lt(new J(l.lat-g,l.lng-p),new J(u.lat+g,u.lng+p))},getCenter:function(){return new J((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new J(this.getNorth(),this.getWest())},getSouthEast:function(){return new J(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(s){typeof s[0]=="number"||s instanceof J||"lat"in s?s=ot(s):s=tt(s);var l=this._southWest,u=this._northEast,g,p;return s instanceof Lt?(g=s.getSouthWest(),p=s.getNorthEast()):g=p=s,g.lat>=l.lat&&p.lat<=u.lat&&g.lng>=l.lng&&p.lng<=u.lng},intersects:function(s){s=tt(s);var l=this._southWest,u=this._northEast,g=s.getSouthWest(),p=s.getNorthEast(),w=p.lat>=l.lat&&g.lat<=u.lat,P=p.lng>=l.lng&&g.lng<=u.lng;return w&&P},overlaps:function(s){s=tt(s);var l=this._southWest,u=this._northEast,g=s.getSouthWest(),p=s.getNorthEast(),w=p.lat>l.lat&&g.lat<u.lat,P=p.lng>l.lng&&g.lng<u.lng;return w&&P},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(s,l){return s?(s=tt(s),this._southWest.equals(s.getSouthWest(),l)&&this._northEast.equals(s.getNorthEast(),l)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function tt(s,l){return s instanceof Lt?s:new Lt(s,l)}function J(s,l,u){if(isNaN(s)||isNaN(l))throw new Error("Invalid LatLng object: ("+s+", "+l+")");this.lat=+s,this.lng=+l,u!==void 0&&(this.alt=+u)}J.prototype={equals:function(s,l){if(!s)return!1;s=ot(s);var u=Math.max(Math.abs(this.lat-s.lat),Math.abs(this.lng-s.lng));return u<=(l===void 0?1e-9:l)},toString:function(s){return"LatLng("+m(this.lat,s)+", "+m(this.lng,s)+")"},distanceTo:function(s){return St.distance(this,ot(s))},wrap:function(){return St.wrapLatLng(this)},toBounds:function(s){var l=180*s/40075017,u=l/Math.cos(Math.PI/180*this.lat);return tt([this.lat-l,this.lng-u],[this.lat+l,this.lng+u])},clone:function(){return new J(this.lat,this.lng,this.alt)}};function ot(s,l,u){return s instanceof J?s:x(s)&&typeof s[0]!="object"?s.length===3?new J(s[0],s[1],s[2]):s.length===2?new J(s[0],s[1]):null:s==null?s:typeof s=="object"&&"lat"in s?new J(s.lat,"lng"in s?s.lng:s.lon,s.alt):l===void 0?null:new J(s,l,u)}var Ft={latLngToPoint:function(s,l){var u=this.projection.project(s),g=this.scale(l);return this.transformation._transform(u,g)},pointToLatLng:function(s,l){var u=this.scale(l),g=this.transformation.untransform(s,u);return this.projection.unproject(g)},project:function(s){return this.projection.project(s)},unproject:function(s){return this.projection.unproject(s)},scale:function(s){return 256*Math.pow(2,s)},zoom:function(s){return Math.log(s/256)/Math.LN2},getProjectedBounds:function(s){if(this.infinite)return null;var l=this.projection.bounds,u=this.scale(s),g=this.transformation.transform(l.min,u),p=this.transformation.transform(l.max,u);return new rt(g,p)},infinite:!1,wrapLatLng:function(s){var l=this.wrapLng?f(s.lng,this.wrapLng,!0):s.lng,u=this.wrapLat?f(s.lat,this.wrapLat,!0):s.lat,g=s.alt;return new J(u,l,g)},wrapLatLngBounds:function(s){var l=s.getCenter(),u=this.wrapLatLng(l),g=l.lat-u.lat,p=l.lng-u.lng;if(g===0&&p===0)return s;var w=s.getSouthWest(),P=s.getNorthEast(),I=new J(w.lat-g,w.lng-p),D=new J(P.lat-g,P.lng-p);return new Lt(I,D)}},St=n({},Ft,{wrapLng:[-180,180],R:6371e3,distance:function(s,l){var u=Math.PI/180,g=s.lat*u,p=l.lat*u,w=Math.sin((l.lat-s.lat)*u/2),P=Math.sin((l.lng-s.lng)*u/2),I=w*w+Math.cos(g)*Math.cos(p)*P*P,D=2*Math.atan2(Math.sqrt(I),Math.sqrt(1-I));return this.R*D}}),ve=6378137,We={R:ve,MAX_LATITUDE:85.0511287798,project:function(s){var l=Math.PI/180,u=this.MAX_LATITUDE,g=Math.max(Math.min(u,s.lat),-u),p=Math.sin(g*l);return new B(this.R*s.lng*l,this.R*Math.log((1+p)/(1-p))/2)},unproject:function(s){var l=180/Math.PI;return new J((2*Math.atan(Math.exp(s.y/this.R))-Math.PI/2)*l,s.x*l/this.R)},bounds:function(){var s=ve*Math.PI;return new rt([-s,-s],[s,s])}()};function Di(s,l,u,g){if(x(s)){this._a=s[0],this._b=s[1],this._c=s[2],this._d=s[3];return}this._a=s,this._b=l,this._c=u,this._d=g}Di.prototype={transform:function(s,l){return this._transform(s.clone(),l)},_transform:function(s,l){return l=l||1,s.x=l*(this._a*s.x+this._b),s.y=l*(this._c*s.y+this._d),s},untransform:function(s,l){return l=l||1,new B((s.x/l-this._b)/this._a,(s.y/l-this._d)/this._c)}};function xe(s,l,u,g){return new Di(s,l,u,g)}var Oi=n({},St,{code:"EPSG:3857",projection:We,transformation:function(){var s=.5/(Math.PI*We.R);return xe(s,.5,-s,.5)}()}),He=n({},Oi,{code:"EPSG:900913"});function Fi(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function Pe(s,l){var u="",g,p,w,P,I,D;for(g=0,w=s.length;g<w;g++){for(I=s[g],p=0,P=I.length;p<P;p++)D=I[p],u+=(p?"L":"M")+D.x+" "+D.y;u+=l?$.svg?"z":"x":""}return u||"M0 0"}var zi=document.documentElement.style,di="ActiveXObject"in window,Hn=di&&!document.addEventListener,fi="msLaunchUri"in navigator&&!("documentMode"in document),hn=zt("webkit"),Xt=zt("android"),ie=zt("android 2")||zt("android 3"),me=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),ke=Xt&&zt("Google")&&me<537&&!("AudioNode"in window),Ve=!!window.opera,Xe=!fi&&zt("chrome"),Re=zt("gecko")&&!hn&&!Ve&&!di,Ni=!Xe&&zt("safari"),cn=zt("phantom"),Wt="OTransition"in zi,Fr=navigator.platform.indexOf("Win")===0,xo=di&&"transition"in zi,zr="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ie,Nr="MozPerspective"in zi,Eo=!window.L_DISABLE_3D&&(xo||zr||Nr)&&!Wt&&!cn,gi=typeof orientation<"u"||zt("mobile"),wo=gi&&hn,Br=gi&&zr,Bi=!window.PointerEvent&&window.MSPointerEvent,Gi=!!(window.PointerEvent||Bi),Ui="ontouchstart"in window||!!window.TouchEvent,Lo=!window.L_NO_TOUCH&&(Ui||Gi),bo=gi&&Ve,ne=gi&&Re,Zi=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,he=function(){var s=!1;try{var l=Object.defineProperty({},"passive",{get:function(){s=!0}});window.addEventListener("testPassiveEventSupport",_,l),window.removeEventListener("testPassiveEventSupport",_,l)}catch{}return s}(),Me=function(){return!!document.createElement("canvas").getContext}(),Yt=!!(document.createElementNS&&Fi("svg").createSVGRect),Vn=!!Yt&&function(){var s=document.createElement("div");return s.innerHTML="<svg/>",(s.firstChild&&s.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Xn=!Yt&&function(){try{var s=document.createElement("div");s.innerHTML='<v:shape adj="1"/>';var l=s.firstChild;return l.style.behavior="url(#default#VML)",l&&typeof l.adj=="object"}catch{return!1}}(),te=navigator.platform.indexOf("Mac")===0,ce=navigator.platform.indexOf("Linux")===0;function zt(s){return navigator.userAgent.toLowerCase().indexOf(s)>=0}var $={ie:di,ielt9:Hn,edge:fi,webkit:hn,android:Xt,android23:ie,androidStock:ke,opera:Ve,chrome:Xe,gecko:Re,safari:Ni,phantom:cn,opera12:Wt,win:Fr,ie3d:xo,webkit3d:zr,gecko3d:Nr,any3d:Eo,mobile:gi,mobileWebkit:wo,mobileWebkit3d:Br,msPointer:Bi,pointer:Gi,touch:Lo,touchNative:Ui,mobileOpera:bo,mobileGecko:ne,retina:Zi,passiveEvents:he,canvas:Me,svg:Yt,vml:Xn,inlineSvg:Vn,mac:te,linux:ce},jd=$.msPointer?"MSPointerDown":"pointerdown",Wd=$.msPointer?"MSPointerMove":"pointermove",Hd=$.msPointer?"MSPointerUp":"pointerup",Vd=$.msPointer?"MSPointerCancel":"pointercancel",Fl={touchstart:jd,touchmove:Wd,touchend:Hd,touchcancel:Vd},Xd={touchstart:ow,touchmove:To,touchend:To,touchcancel:To},Yn={},Yd=!1;function ew(s,l,u){return l==="touchstart"&&sw(),Xd[l]?(u=Xd[l].bind(this,u),s.addEventListener(Fl[l],u,!1),u):(console.warn("wrong event specified:",l),_)}function iw(s,l,u){if(!Fl[l]){console.warn("wrong event specified:",l);return}s.removeEventListener(Fl[l],u,!1)}function nw(s){Yn[s.pointerId]=s}function rw(s){Yn[s.pointerId]&&(Yn[s.pointerId]=s)}function Kd(s){delete Yn[s.pointerId]}function sw(){Yd||(document.addEventListener(jd,nw,!0),document.addEventListener(Wd,rw,!0),document.addEventListener(Hd,Kd,!0),document.addEventListener(Vd,Kd,!0),Yd=!0)}function To(s,l){if(l.pointerType!==(l.MSPOINTER_TYPE_MOUSE||"mouse")){l.touches=[];for(var u in Yn)l.touches.push(Yn[u]);l.changedTouches=[l],s(l)}}function ow(s,l){l.MSPOINTER_TYPE_TOUCH&&l.pointerType===l.MSPOINTER_TYPE_TOUCH&&Kt(l),To(s,l)}function aw(s){var l={},u,g;for(g in s)u=s[g],l[g]=u&&u.bind?u.bind(s):u;return s=l,l.type="dblclick",l.detail=2,l.isTrusted=!1,l._simulated=!0,l}var lw=200;function hw(s,l){s.addEventListener("dblclick",l);var u=0,g;function p(w){if(w.detail!==1){g=w.detail;return}if(!(w.pointerType==="mouse"||w.sourceCapabilities&&!w.sourceCapabilities.firesTouchEvents)){var P=tf(w);if(!(P.some(function(D){return D instanceof HTMLLabelElement&&D.attributes.for})&&!P.some(function(D){return D instanceof HTMLInputElement||D instanceof HTMLSelectElement}))){var I=Date.now();I-u<=lw?(g++,g===2&&l(aw(w))):g=1,u=I}}}return s.addEventListener("click",p),{dblclick:l,simDblclick:p}}function cw(s,l){s.removeEventListener("dblclick",l.dblclick),s.removeEventListener("click",l.simDblclick)}var zl=Po(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Gr=Po(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),qd=Gr==="webkitTransition"||Gr==="OTransition"?Gr+"End":"transitionend";function $d(s){return typeof s=="string"?document.getElementById(s):s}function Ur(s,l){var u=s.style[l]||s.currentStyle&&s.currentStyle[l];if((!u||u==="auto")&&document.defaultView){var g=document.defaultView.getComputedStyle(s,null);u=g?g[l]:null}return u==="auto"?null:u}function vt(s,l,u){var g=document.createElement(s);return g.className=l||"",u&&u.appendChild(g),g}function Rt(s){var l=s.parentNode;l&&l.removeChild(s)}function Co(s){for(;s.firstChild;)s.removeChild(s.firstChild)}function Kn(s){var l=s.parentNode;l&&l.lastChild!==s&&l.appendChild(s)}function qn(s){var l=s.parentNode;l&&l.firstChild!==s&&l.insertBefore(s,l.firstChild)}function Nl(s,l){if(s.classList!==void 0)return s.classList.contains(l);var u=So(s);return u.length>0&&new RegExp("(^|\\s)"+l+"(\\s|$)").test(u)}function ct(s,l){if(s.classList!==void 0)for(var u=v(l),g=0,p=u.length;g<p;g++)s.classList.add(u[g]);else if(!Nl(s,l)){var w=So(s);Bl(s,(w?w+" ":"")+l)}}function At(s,l){s.classList!==void 0?s.classList.remove(l):Bl(s,E((" "+So(s)+" ").replace(" "+l+" "," ")))}function Bl(s,l){s.className.baseVal===void 0?s.className=l:s.className.baseVal=l}function So(s){return s.correspondingElement&&(s=s.correspondingElement),s.className.baseVal===void 0?s.className:s.className.baseVal}function Ee(s,l){"opacity"in s.style?s.style.opacity=l:"filter"in s.style&&uw(s,l)}function uw(s,l){var u=!1,g="DXImageTransform.Microsoft.Alpha";try{u=s.filters.item(g)}catch{if(l===1)return}l=Math.round(l*100),u?(u.Enabled=l!==100,u.Opacity=l):s.style.filter+=" progid:"+g+"(opacity="+l+")"}function Po(s){for(var l=document.documentElement.style,u=0;u<s.length;u++)if(s[u]in l)return s[u];return!1}function un(s,l,u){var g=l||new B(0,0);s.style[zl]=($.ie3d?"translate("+g.x+"px,"+g.y+"px)":"translate3d("+g.x+"px,"+g.y+"px,0)")+(u?" scale("+u+")":"")}function Nt(s,l){s._leaflet_pos=l,$.any3d?un(s,l):(s.style.left=l.x+"px",s.style.top=l.y+"px")}function dn(s){return s._leaflet_pos||new B(0,0)}var Zr,jr,Gl;if("onselectstart"in document)Zr=function(){lt(window,"selectstart",Kt)},jr=function(){Pt(window,"selectstart",Kt)};else{var Wr=Po(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Zr=function(){if(Wr){var s=document.documentElement.style;Gl=s[Wr],s[Wr]="none"}},jr=function(){Wr&&(document.documentElement.style[Wr]=Gl,Gl=void 0)}}function Ul(){lt(window,"dragstart",Kt)}function Zl(){Pt(window,"dragstart",Kt)}var ko,jl;function Wl(s){for(;s.tabIndex===-1;)s=s.parentNode;s.style&&(Ro(),ko=s,jl=s.style.outlineStyle,s.style.outlineStyle="none",lt(window,"keydown",Ro))}function Ro(){ko&&(ko.style.outlineStyle=jl,ko=void 0,jl=void 0,Pt(window,"keydown",Ro))}function Jd(s){do s=s.parentNode;while((!s.offsetWidth||!s.offsetHeight)&&s!==document.body);return s}function Hl(s){var l=s.getBoundingClientRect();return{x:l.width/s.offsetWidth||1,y:l.height/s.offsetHeight||1,boundingClientRect:l}}var dw={__proto__:null,TRANSFORM:zl,TRANSITION:Gr,TRANSITION_END:qd,get:$d,getStyle:Ur,create:vt,remove:Rt,empty:Co,toFront:Kn,toBack:qn,hasClass:Nl,addClass:ct,removeClass:At,setClass:Bl,getClass:So,setOpacity:Ee,testProp:Po,setTransform:un,setPosition:Nt,getPosition:dn,get disableTextSelection(){return Zr},get enableTextSelection(){return jr},disableImageDrag:Ul,enableImageDrag:Zl,preventOutline:Wl,restoreOutline:Ro,getSizedParentNode:Jd,getScale:Hl};function lt(s,l,u,g){if(l&&typeof l=="object")for(var p in l)Xl(s,p,l[p],u);else{l=v(l);for(var w=0,P=l.length;w<P;w++)Xl(s,l[w],u,g)}return this}var Ye="_leaflet_events";function Pt(s,l,u,g){if(arguments.length===1)Qd(s),delete s[Ye];else if(l&&typeof l=="object")for(var p in l)Yl(s,p,l[p],u);else if(l=v(l),arguments.length===2)Qd(s,function(I){return T(l,I)!==-1});else for(var w=0,P=l.length;w<P;w++)Yl(s,l[w],u,g);return this}function Qd(s,l){for(var u in s[Ye]){var g=u.split(/\d/)[0];(!l||l(g))&&Yl(s,g,null,null,u)}}var Vl={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Xl(s,l,u,g){var p=l+c(u)+(g?"_"+c(g):"");if(s[Ye]&&s[Ye][p])return this;var w=function(I){return u.call(g||s,I||window.event)},P=w;!$.touchNative&&$.pointer&&l.indexOf("touch")===0?w=ew(s,l,w):$.touch&&l==="dblclick"?w=hw(s,w):"addEventListener"in s?l==="touchstart"||l==="touchmove"||l==="wheel"||l==="mousewheel"?s.addEventListener(Vl[l]||l,w,$.passiveEvents?{passive:!1}:!1):l==="mouseenter"||l==="mouseleave"?(w=function(I){I=I||window.event,ql(s,I)&&P(I)},s.addEventListener(Vl[l],w,!1)):s.addEventListener(l,P,!1):s.attachEvent("on"+l,w),s[Ye]=s[Ye]||{},s[Ye][p]=w}function Yl(s,l,u,g,p){p=p||l+c(u)+(g?"_"+c(g):"");var w=s[Ye]&&s[Ye][p];if(!w)return this;!$.touchNative&&$.pointer&&l.indexOf("touch")===0?iw(s,l,w):$.touch&&l==="dblclick"?cw(s,w):"removeEventListener"in s?s.removeEventListener(Vl[l]||l,w,!1):s.detachEvent("on"+l,w),s[Ye][p]=null}function fn(s){return s.stopPropagation?s.stopPropagation():s.originalEvent?s.originalEvent._stopped=!0:s.cancelBubble=!0,this}function Kl(s){return Xl(s,"wheel",fn),this}function Hr(s){return lt(s,"mousedown touchstart dblclick contextmenu",fn),s._leaflet_disable_click=!0,this}function Kt(s){return s.preventDefault?s.preventDefault():s.returnValue=!1,this}function gn(s){return Kt(s),fn(s),this}function tf(s){if(s.composedPath)return s.composedPath();for(var l=[],u=s.target;u;)l.push(u),u=u.parentNode;return l}function ef(s,l){if(!l)return new B(s.clientX,s.clientY);var u=Hl(l),g=u.boundingClientRect;return new B((s.clientX-g.left)/u.x-l.clientLeft,(s.clientY-g.top)/u.y-l.clientTop)}var fw=$.linux&&$.chrome?window.devicePixelRatio:$.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function nf(s){return $.edge?s.wheelDeltaY/2:s.deltaY&&s.deltaMode===0?-s.deltaY/fw:s.deltaY&&s.deltaMode===1?-s.deltaY*20:s.deltaY&&s.deltaMode===2?-s.deltaY*60:s.deltaX||s.deltaZ?0:s.wheelDelta?(s.wheelDeltaY||s.wheelDelta)/2:s.detail&&Math.abs(s.detail)<32765?-s.detail*20:s.detail?s.detail/-32765*60:0}function ql(s,l){var u=l.relatedTarget;if(!u)return!0;try{for(;u&&u!==s;)u=u.parentNode}catch{return!1}return u!==s}var gw={__proto__:null,on:lt,off:Pt,stopPropagation:fn,disableScrollPropagation:Kl,disableClickPropagation:Hr,preventDefault:Kt,stop:gn,getPropagationPath:tf,getMousePosition:ef,getWheelDelta:nf,isExternalTarget:ql,addListener:lt,removeListener:Pt},rf=j.extend({run:function(s,l,u,g){this.stop(),this._el=s,this._inProgress=!0,this._duration=u||.25,this._easeOutPower=1/Math.max(g||.5,.2),this._startPos=dn(s),this._offset=l.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=Z(this._animate,this),this._step()},_step:function(s){var l=+new Date-this._startTime,u=this._duration*1e3;l<u?this._runFrame(this._easeOut(l/u),s):(this._runFrame(1),this._complete())},_runFrame:function(s,l){var u=this._startPos.add(this._offset.multiplyBy(s));l&&u._round(),Nt(this._el,u),this.fire("step")},_complete:function(){H(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(s){return 1-Math.pow(1-s,this._easeOutPower)}}),mt=j.extend({options:{crs:Oi,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(s,l){l=b(this,l),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(s),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),l.maxBounds&&this.setMaxBounds(l.maxBounds),l.zoom!==void 0&&(this._zoom=this._limitZoom(l.zoom)),l.center&&l.zoom!==void 0&&this.setView(ot(l.center),l.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Gr&&$.any3d&&!$.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),lt(this._proxy,qd,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(s,l,u){if(l=l===void 0?this._zoom:this._limitZoom(l),s=this._limitCenter(ot(s),l,this.options.maxBounds),u=u||{},this._stop(),this._loaded&&!u.reset&&u!==!0){u.animate!==void 0&&(u.zoom=n({animate:u.animate},u.zoom),u.pan=n({animate:u.animate,duration:u.duration},u.pan));var g=this._zoom!==l?this._tryAnimatedZoom&&this._tryAnimatedZoom(s,l,u.zoom):this._tryAnimatedPan(s,u.pan);if(g)return clearTimeout(this._sizeTimer),this}return this._resetView(s,l,u.pan&&u.pan.noMoveStart),this},setZoom:function(s,l){return this._loaded?this.setView(this.getCenter(),s,{zoom:l}):(this._zoom=s,this)},zoomIn:function(s,l){return s=s||($.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+s,l)},zoomOut:function(s,l){return s=s||($.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-s,l)},setZoomAround:function(s,l,u){var g=this.getZoomScale(l),p=this.getSize().divideBy(2),w=s instanceof B?s:this.latLngToContainerPoint(s),P=w.subtract(p).multiplyBy(1-1/g),I=this.containerPointToLatLng(p.add(P));return this.setView(I,l,{zoom:u})},_getBoundsCenterZoom:function(s,l){l=l||{},s=s.getBounds?s.getBounds():tt(s);var u=W(l.paddingTopLeft||l.padding||[0,0]),g=W(l.paddingBottomRight||l.padding||[0,0]),p=this.getBoundsZoom(s,!1,u.add(g));if(p=typeof l.maxZoom=="number"?Math.min(l.maxZoom,p):p,p===1/0)return{center:s.getCenter(),zoom:p};var w=g.subtract(u).divideBy(2),P=this.project(s.getSouthWest(),p),I=this.project(s.getNorthEast(),p),D=this.unproject(P.add(I).divideBy(2).add(w),p);return{center:D,zoom:p}},fitBounds:function(s,l){if(s=tt(s),!s.isValid())throw new Error("Bounds are not valid.");var u=this._getBoundsCenterZoom(s,l);return this.setView(u.center,u.zoom,l)},fitWorld:function(s){return this.fitBounds([[-90,-180],[90,180]],s)},panTo:function(s,l){return this.setView(s,this._zoom,{pan:l})},panBy:function(s,l){if(s=W(s).round(),l=l||{},!s.x&&!s.y)return this.fire("moveend");if(l.animate!==!0&&!this.getSize().contains(s))return this._resetView(this.unproject(this.project(this.getCenter()).add(s)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new rf,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),l.noMoveStart||this.fire("movestart"),l.animate!==!1){ct(this._mapPane,"leaflet-pan-anim");var u=this._getMapPanePos().subtract(s).round();this._panAnim.run(this._mapPane,u,l.duration||.25,l.easeLinearity)}else this._rawPanBy(s),this.fire("move").fire("moveend");return this},flyTo:function(s,l,u){if(u=u||{},u.animate===!1||!$.any3d)return this.setView(s,l,u);this._stop();var g=this.project(this.getCenter()),p=this.project(s),w=this.getSize(),P=this._zoom;s=ot(s),l=l===void 0?P:l;var I=Math.max(w.x,w.y),D=I*this.getZoomScale(P,l),N=p.distanceTo(g)||1,Y=1.42,it=Y*Y;function dt(Bt){var Zo=Bt?-1:1,iL=Bt?D:I,nL=D*D-I*I+Zo*it*it*N*N,rL=2*iL*it*N,ah=nL/rL,Nf=Math.sqrt(ah*ah+1)-ah,sL=Nf<1e-9?-18:Math.log(Nf);return sL}function re(Bt){return(Math.exp(Bt)-Math.exp(-Bt))/2}function Ht(Bt){return(Math.exp(Bt)+Math.exp(-Bt))/2}function Le(Bt){return re(Bt)/Ht(Bt)}var ue=dt(0);function ir(Bt){return I*(Ht(ue)/Ht(ue+Y*Bt))}function Jw(Bt){return I*(Ht(ue)*Le(ue+Y*Bt)-re(ue))/it}function Qw(Bt){return 1-Math.pow(1-Bt,1.5)}var tL=Date.now(),Ff=(dt(1)-ue)/Y,eL=u.duration?1e3*u.duration:1e3*Ff*.8;function zf(){var Bt=(Date.now()-tL)/eL,Zo=Qw(Bt)*Ff;Bt<=1?(this._flyToFrame=Z(zf,this),this._move(this.unproject(g.add(p.subtract(g).multiplyBy(Jw(Zo)/N)),P),this.getScaleZoom(I/ir(Zo),P),{flyTo:!0})):this._move(s,l)._moveEnd(!0)}return this._moveStart(!0,u.noMoveStart),zf.call(this),this},flyToBounds:function(s,l){var u=this._getBoundsCenterZoom(s,l);return this.flyTo(u.center,u.zoom,l)},setMaxBounds:function(s){return s=tt(s),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),s.isValid()?(this.options.maxBounds=s,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(s){var l=this.options.minZoom;return this.options.minZoom=s,this._loaded&&l!==s&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(s):this},setMaxZoom:function(s){var l=this.options.maxZoom;return this.options.maxZoom=s,this._loaded&&l!==s&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(s):this},panInsideBounds:function(s,l){this._enforcingBounds=!0;var u=this.getCenter(),g=this._limitCenter(u,this._zoom,tt(s));return u.equals(g)||this.panTo(g,l),this._enforcingBounds=!1,this},panInside:function(s,l){l=l||{};var u=W(l.paddingTopLeft||l.padding||[0,0]),g=W(l.paddingBottomRight||l.padding||[0,0]),p=this.project(this.getCenter()),w=this.project(s),P=this.getPixelBounds(),I=F([P.min.add(u),P.max.subtract(g)]),D=I.getSize();if(!I.contains(w)){this._enforcingBounds=!0;var N=w.subtract(I.getCenter()),Y=I.extend(w).getSize().subtract(D);p.x+=N.x<0?-Y.x:Y.x,p.y+=N.y<0?-Y.y:Y.y,this.panTo(this.unproject(p),l),this._enforcingBounds=!1}return this},invalidateSize:function(s){if(!this._loaded)return this;s=n({animate:!1,pan:!0},s===!0?{animate:!0}:s);var l=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var u=this.getSize(),g=l.divideBy(2).round(),p=u.divideBy(2).round(),w=g.subtract(p);return!w.x&&!w.y?this:(s.animate&&s.pan?this.panBy(w):(s.pan&&this._rawPanBy(w),this.fire("move"),s.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:l,newSize:u}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(s){if(s=this._locateOptions=n({timeout:1e4,watch:!1},s),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var l=a(this._handleGeolocationResponse,this),u=a(this._handleGeolocationError,this);return s.watch?this._locationWatchId=navigator.geolocation.watchPosition(l,u,s):navigator.geolocation.getCurrentPosition(l,u,s),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(s){if(this._container._leaflet_id){var l=s.code,u=s.message||(l===1?"permission denied":l===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:l,message:"Geolocation error: "+u+"."})}},_handleGeolocationResponse:function(s){if(this._container._leaflet_id){var l=s.coords.latitude,u=s.coords.longitude,g=new J(l,u),p=g.toBounds(s.coords.accuracy*2),w=this._locateOptions;if(w.setView){var P=this.getBoundsZoom(p);this.setView(g,w.maxZoom?Math.min(P,w.maxZoom):P)}var I={latlng:g,bounds:p,timestamp:s.timestamp};for(var D in s.coords)typeof s.coords[D]=="number"&&(I[D]=s.coords[D]);this.fire("locationfound",I)}},addHandler:function(s,l){if(!l)return this;var u=this[s]=new l(this);return this._handlers.push(u),this.options[s]&&u.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Rt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(H(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var s;for(s in this._layers)this._layers[s].remove();for(s in this._panes)Rt(this._panes[s]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(s,l){var u="leaflet-pane"+(s?" leaflet-"+s.replace("Pane","")+"-pane":""),g=vt("div",u,l||this._mapPane);return s&&(this._panes[s]=g),g},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var s=this.getPixelBounds(),l=this.unproject(s.getBottomLeft()),u=this.unproject(s.getTopRight());return new Lt(l,u)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(s,l,u){s=tt(s),u=W(u||[0,0]);var g=this.getZoom()||0,p=this.getMinZoom(),w=this.getMaxZoom(),P=s.getNorthWest(),I=s.getSouthEast(),D=this.getSize().subtract(u),N=F(this.project(I,g),this.project(P,g)).getSize(),Y=$.any3d?this.options.zoomSnap:1,it=D.x/N.x,dt=D.y/N.y,re=l?Math.max(it,dt):Math.min(it,dt);return g=this.getScaleZoom(re,g),Y&&(g=Math.round(g/(Y/100))*(Y/100),g=l?Math.ceil(g/Y)*Y:Math.floor(g/Y)*Y),Math.max(p,Math.min(w,g))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new B(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(s,l){var u=this._getTopLeftPoint(s,l);return new rt(u,u.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(s){return this.options.crs.getProjectedBounds(s===void 0?this.getZoom():s)},getPane:function(s){return typeof s=="string"?this._panes[s]:s},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(s,l){var u=this.options.crs;return l=l===void 0?this._zoom:l,u.scale(s)/u.scale(l)},getScaleZoom:function(s,l){var u=this.options.crs;l=l===void 0?this._zoom:l;var g=u.zoom(s*u.scale(l));return isNaN(g)?1/0:g},project:function(s,l){return l=l===void 0?this._zoom:l,this.options.crs.latLngToPoint(ot(s),l)},unproject:function(s,l){return l=l===void 0?this._zoom:l,this.options.crs.pointToLatLng(W(s),l)},layerPointToLatLng:function(s){var l=W(s).add(this.getPixelOrigin());return this.unproject(l)},latLngToLayerPoint:function(s){var l=this.project(ot(s))._round();return l._subtract(this.getPixelOrigin())},wrapLatLng:function(s){return this.options.crs.wrapLatLng(ot(s))},wrapLatLngBounds:function(s){return this.options.crs.wrapLatLngBounds(tt(s))},distance:function(s,l){return this.options.crs.distance(ot(s),ot(l))},containerPointToLayerPoint:function(s){return W(s).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(s){return W(s).add(this._getMapPanePos())},containerPointToLatLng:function(s){var l=this.containerPointToLayerPoint(W(s));return this.layerPointToLatLng(l)},latLngToContainerPoint:function(s){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ot(s)))},mouseEventToContainerPoint:function(s){return ef(s,this._container)},mouseEventToLayerPoint:function(s){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(s))},mouseEventToLatLng:function(s){return this.layerPointToLatLng(this.mouseEventToLayerPoint(s))},_initContainer:function(s){var l=this._container=$d(s);if(l){if(l._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");lt(l,"scroll",this._onScroll,this),this._containerId=c(l)},_initLayout:function(){var s=this._container;this._fadeAnimated=this.options.fadeAnimation&&$.any3d,ct(s,"leaflet-container"+($.touch?" leaflet-touch":"")+($.retina?" leaflet-retina":"")+($.ielt9?" leaflet-oldie":"")+($.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var l=Ur(s,"position");l!=="absolute"&&l!=="relative"&&l!=="fixed"&&l!=="sticky"&&(s.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var s=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Nt(this._mapPane,new B(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ct(s.markerPane,"leaflet-zoom-hide"),ct(s.shadowPane,"leaflet-zoom-hide"))},_resetView:function(s,l,u){Nt(this._mapPane,new B(0,0));var g=!this._loaded;this._loaded=!0,l=this._limitZoom(l),this.fire("viewprereset");var p=this._zoom!==l;this._moveStart(p,u)._move(s,l)._moveEnd(p),this.fire("viewreset"),g&&this.fire("load")},_moveStart:function(s,l){return s&&this.fire("zoomstart"),l||this.fire("movestart"),this},_move:function(s,l,u,g){l===void 0&&(l=this._zoom);var p=this._zoom!==l;return this._zoom=l,this._lastCenter=s,this._pixelOrigin=this._getNewPixelOrigin(s),g?u&&u.pinch&&this.fire("zoom",u):((p||u&&u.pinch)&&this.fire("zoom",u),this.fire("move",u)),this},_moveEnd:function(s){return s&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return H(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(s){Nt(this._mapPane,this._getMapPanePos().subtract(s))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(s){this._targets={},this._targets[c(this._container)]=this;var l=s?Pt:lt;l(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&l(window,"resize",this._onResize,this),$.any3d&&this.options.transform3DLimit&&(s?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){H(this._resizeRequest),this._resizeRequest=Z(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var s=this._getMapPanePos();Math.max(Math.abs(s.x),Math.abs(s.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(s,l){for(var u=[],g,p=l==="mouseout"||l==="mouseover",w=s.target||s.srcElement,P=!1;w;){if(g=this._targets[c(w)],g&&(l==="click"||l==="preclick")&&this._draggableMoved(g)){P=!0;break}if(g&&g.listens(l,!0)&&(p&&!ql(w,s)||(u.push(g),p))||w===this._container)break;w=w.parentNode}return!u.length&&!P&&!p&&this.listens(l,!0)&&(u=[this]),u},_isClickDisabled:function(s){for(;s&&s!==this._container;){if(s._leaflet_disable_click)return!0;s=s.parentNode}},_handleDOMEvent:function(s){var l=s.target||s.srcElement;if(!(!this._loaded||l._leaflet_disable_events||s.type==="click"&&this._isClickDisabled(l))){var u=s.type;u==="mousedown"&&Wl(l),this._fireDOMEvent(s,u)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(s,l,u){if(s.type==="click"){var g=n({},s);g.type="preclick",this._fireDOMEvent(g,g.type,u)}var p=this._findEventTargets(s,l);if(u){for(var w=[],P=0;P<u.length;P++)u[P].listens(l,!0)&&w.push(u[P]);p=w.concat(p)}if(p.length){l==="contextmenu"&&Kt(s);var I=p[0],D={originalEvent:s};if(s.type!=="keypress"&&s.type!=="keydown"&&s.type!=="keyup"){var N=I.getLatLng&&(!I._radius||I._radius<=10);D.containerPoint=N?this.latLngToContainerPoint(I.getLatLng()):this.mouseEventToContainerPoint(s),D.layerPoint=this.containerPointToLayerPoint(D.containerPoint),D.latlng=N?I.getLatLng():this.layerPointToLatLng(D.layerPoint)}for(P=0;P<p.length;P++)if(p[P].fire(l,D,!0),D.originalEvent._stopped||p[P].options.bubblingMouseEvents===!1&&T(this._mouseEvents,l)!==-1)return}},_draggableMoved:function(s){return s=s.dragging&&s.dragging.enabled()?s:this,s.dragging&&s.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var s=0,l=this._handlers.length;s<l;s++)this._handlers[s].disable()},whenReady:function(s,l){return this._loaded?s.call(l||this,{target:this}):this.on("load",s,l),this},_getMapPanePos:function(){return dn(this._mapPane)||new B(0,0)},_moved:function(){var s=this._getMapPanePos();return s&&!s.equals([0,0])},_getTopLeftPoint:function(s,l){var u=s&&l!==void 0?this._getNewPixelOrigin(s,l):this.getPixelOrigin();return u.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(s,l){var u=this.getSize()._divideBy(2);return this.project(s,l)._subtract(u)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(s,l,u){var g=this._getNewPixelOrigin(u,l);return this.project(s,l)._subtract(g)},_latLngBoundsToNewLayerBounds:function(s,l,u){var g=this._getNewPixelOrigin(u,l);return F([this.project(s.getSouthWest(),l)._subtract(g),this.project(s.getNorthWest(),l)._subtract(g),this.project(s.getSouthEast(),l)._subtract(g),this.project(s.getNorthEast(),l)._subtract(g)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(s){return this.latLngToLayerPoint(s).subtract(this._getCenterLayerPoint())},_limitCenter:function(s,l,u){if(!u)return s;var g=this.project(s,l),p=this.getSize().divideBy(2),w=new rt(g.subtract(p),g.add(p)),P=this._getBoundsOffset(w,u,l);return Math.abs(P.x)<=1&&Math.abs(P.y)<=1?s:this.unproject(g.add(P),l)},_limitOffset:function(s,l){if(!l)return s;var u=this.getPixelBounds(),g=new rt(u.min.add(s),u.max.add(s));return s.add(this._getBoundsOffset(g,l))},_getBoundsOffset:function(s,l,u){var g=F(this.project(l.getNorthEast(),u),this.project(l.getSouthWest(),u)),p=g.min.subtract(s.min),w=g.max.subtract(s.max),P=this._rebound(p.x,-w.x),I=this._rebound(p.y,-w.y);return new B(P,I)},_rebound:function(s,l){return s+l>0?Math.round(s-l)/2:Math.max(0,Math.ceil(s))-Math.max(0,Math.floor(l))},_limitZoom:function(s){var l=this.getMinZoom(),u=this.getMaxZoom(),g=$.any3d?this.options.zoomSnap:1;return g&&(s=Math.round(s/g)*g),Math.max(l,Math.min(u,s))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){At(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(s,l){var u=this._getCenterOffset(s)._trunc();return(l&&l.animate)!==!0&&!this.getSize().contains(u)?!1:(this.panBy(u,l),!0)},_createAnimProxy:function(){var s=this._proxy=vt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(s),this.on("zoomanim",function(l){var u=zl,g=this._proxy.style[u];un(this._proxy,this.project(l.center,l.zoom),this.getZoomScale(l.zoom,1)),g===this._proxy.style[u]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Rt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var s=this.getCenter(),l=this.getZoom();un(this._proxy,this.project(s,l),this.getZoomScale(l,1))},_catchTransitionEnd:function(s){this._animatingZoom&&s.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(s,l,u){if(this._animatingZoom)return!0;if(u=u||{},!this._zoomAnimated||u.animate===!1||this._nothingToAnimate()||Math.abs(l-this._zoom)>this.options.zoomAnimationThreshold)return!1;var g=this.getZoomScale(l),p=this._getCenterOffset(s)._divideBy(1-1/g);return u.animate!==!0&&!this.getSize().contains(p)?!1:(Z(function(){this._moveStart(!0,u.noMoveStart||!1)._animateZoom(s,l,!0)},this),!0)},_animateZoom:function(s,l,u,g){this._mapPane&&(u&&(this._animatingZoom=!0,this._animateToCenter=s,this._animateToZoom=l,ct(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:s,zoom:l,noUpdate:g}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&At(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function _w(s,l){return new mt(s,l)}var Ie=nt.extend({options:{position:"topright"},initialize:function(s){b(this,s)},getPosition:function(){return this.options.position},setPosition:function(s){var l=this._map;return l&&l.removeControl(this),this.options.position=s,l&&l.addControl(this),this},getContainer:function(){return this._container},addTo:function(s){this.remove(),this._map=s;var l=this._container=this.onAdd(s),u=this.getPosition(),g=s._controlCorners[u];return ct(l,"leaflet-control"),u.indexOf("bottom")!==-1?g.insertBefore(l,g.firstChild):g.appendChild(l),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Rt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(s){this._map&&s&&s.screenX>0&&s.screenY>0&&this._map.getContainer().focus()}}),Vr=function(s){return new Ie(s)};mt.include({addControl:function(s){return s.addTo(this),this},removeControl:function(s){return s.remove(),this},_initControlPos:function(){var s=this._controlCorners={},l="leaflet-",u=this._controlContainer=vt("div",l+"control-container",this._container);function g(p,w){var P=l+p+" "+l+w;s[p+w]=vt("div",P,u)}g("top","left"),g("top","right"),g("bottom","left"),g("bottom","right")},_clearControlPos:function(){for(var s in this._controlCorners)Rt(this._controlCorners[s]);Rt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var sf=Ie.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(s,l,u,g){return u<g?-1:g<u?1:0}},initialize:function(s,l,u){b(this,u),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var g in s)this._addLayer(s[g],g);for(g in l)this._addLayer(l[g],g,!0)},onAdd:function(s){this._initLayout(),this._update(),this._map=s,s.on("zoomend",this._checkDisabledLayers,this);for(var l=0;l<this._layers.length;l++)this._layers[l].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(s){return Ie.prototype.addTo.call(this,s),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var s=0;s<this._layers.length;s++)this._layers[s].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(s,l){return this._addLayer(s,l),this._map?this._update():this},addOverlay:function(s,l){return this._addLayer(s,l,!0),this._map?this._update():this},removeLayer:function(s){s.off("add remove",this._onLayerChange,this);var l=this._getLayer(c(s));return l&&this._layers.splice(this._layers.indexOf(l),1),this._map?this._update():this},expand:function(){ct(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var s=this._map.getSize().y-(this._container.offsetTop+50);return s<this._section.clientHeight?(ct(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=s+"px"):At(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return At(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var s="leaflet-control-layers",l=this._container=vt("div",s),u=this.options.collapsed;l.setAttribute("aria-haspopup",!0),Hr(l),Kl(l);var g=this._section=vt("section",s+"-list");u&&(this._map.on("click",this.collapse,this),lt(l,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var p=this._layersLink=vt("a",s+"-toggle",l);p.href="#",p.title="Layers",p.setAttribute("role","button"),lt(p,{keydown:function(w){w.keyCode===13&&this._expandSafely()},click:function(w){Kt(w),this._expandSafely()}},this),u||this.expand(),this._baseLayersList=vt("div",s+"-base",g),this._separator=vt("div",s+"-separator",g),this._overlaysList=vt("div",s+"-overlays",g),l.appendChild(g)},_getLayer:function(s){for(var l=0;l<this._layers.length;l++)if(this._layers[l]&&c(this._layers[l].layer)===s)return this._layers[l]},_addLayer:function(s,l,u){this._map&&s.on("add remove",this._onLayerChange,this),this._layers.push({layer:s,name:l,overlay:u}),this.options.sortLayers&&this._layers.sort(a(function(g,p){return this.options.sortFunction(g.layer,p.layer,g.name,p.name)},this)),this.options.autoZIndex&&s.setZIndex&&(this._lastZIndex++,s.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Co(this._baseLayersList),Co(this._overlaysList),this._layerControlInputs=[];var s,l,u,g,p=0;for(u=0;u<this._layers.length;u++)g=this._layers[u],this._addItem(g),l=l||g.overlay,s=s||!g.overlay,p+=g.overlay?0:1;return this.options.hideSingleBase&&(s=s&&p>1,this._baseLayersList.style.display=s?"":"none"),this._separator.style.display=l&&s?"":"none",this},_onLayerChange:function(s){this._handlingClick||this._update();var l=this._getLayer(c(s.target)),u=l.overlay?s.type==="add"?"overlayadd":"overlayremove":s.type==="add"?"baselayerchange":null;u&&this._map.fire(u,l)},_createRadioElement:function(s,l){var u='<input type="radio" class="leaflet-control-layers-selector" name="'+s+'"'+(l?' checked="checked"':"")+"/>",g=document.createElement("div");return g.innerHTML=u,g.firstChild},_addItem:function(s){var l=document.createElement("label"),u=this._map.hasLayer(s.layer),g;s.overlay?(g=document.createElement("input"),g.type="checkbox",g.className="leaflet-control-layers-selector",g.defaultChecked=u):g=this._createRadioElement("leaflet-base-layers_"+c(this),u),this._layerControlInputs.push(g),g.layerId=c(s.layer),lt(g,"click",this._onInputClick,this);var p=document.createElement("span");p.innerHTML=" "+s.name;var w=document.createElement("span");l.appendChild(w),w.appendChild(g),w.appendChild(p);var P=s.overlay?this._overlaysList:this._baseLayersList;return P.appendChild(l),this._checkDisabledLayers(),l},_onInputClick:function(){if(!this._preventClick){var s=this._layerControlInputs,l,u,g=[],p=[];this._handlingClick=!0;for(var w=s.length-1;w>=0;w--)l=s[w],u=this._getLayer(l.layerId).layer,l.checked?g.push(u):l.checked||p.push(u);for(w=0;w<p.length;w++)this._map.hasLayer(p[w])&&this._map.removeLayer(p[w]);for(w=0;w<g.length;w++)this._map.hasLayer(g[w])||this._map.addLayer(g[w]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var s=this._layerControlInputs,l,u,g=this._map.getZoom(),p=s.length-1;p>=0;p--)l=s[p],u=this._getLayer(l.layerId).layer,l.disabled=u.options.minZoom!==void 0&&g<u.options.minZoom||u.options.maxZoom!==void 0&&g>u.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var s=this._section;this._preventClick=!0,lt(s,"click",Kt),this.expand();var l=this;setTimeout(function(){Pt(s,"click",Kt),l._preventClick=!1})}}),pw=function(s,l,u){return new sf(s,l,u)},$l=Ie.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(s){var l="leaflet-control-zoom",u=vt("div",l+" leaflet-bar"),g=this.options;return this._zoomInButton=this._createButton(g.zoomInText,g.zoomInTitle,l+"-in",u,this._zoomIn),this._zoomOutButton=this._createButton(g.zoomOutText,g.zoomOutTitle,l+"-out",u,this._zoomOut),this._updateDisabled(),s.on("zoomend zoomlevelschange",this._updateDisabled,this),u},onRemove:function(s){s.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(s){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(s.shiftKey?3:1))},_zoomOut:function(s){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(s.shiftKey?3:1))},_createButton:function(s,l,u,g,p){var w=vt("a",u,g);return w.innerHTML=s,w.href="#",w.title=l,w.setAttribute("role","button"),w.setAttribute("aria-label",l),Hr(w),lt(w,"click",gn),lt(w,"click",p,this),lt(w,"click",this._refocusOnMap,this),w},_updateDisabled:function(){var s=this._map,l="leaflet-disabled";At(this._zoomInButton,l),At(this._zoomOutButton,l),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||s._zoom===s.getMinZoom())&&(ct(this._zoomOutButton,l),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||s._zoom===s.getMaxZoom())&&(ct(this._zoomInButton,l),this._zoomInButton.setAttribute("aria-disabled","true"))}});mt.mergeOptions({zoomControl:!0}),mt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new $l,this.addControl(this.zoomControl))});var mw=function(s){return new $l(s)},of=Ie.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(s){var l="leaflet-control-scale",u=vt("div",l),g=this.options;return this._addScales(g,l+"-line",u),s.on(g.updateWhenIdle?"moveend":"move",this._update,this),s.whenReady(this._update,this),u},onRemove:function(s){s.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(s,l,u){s.metric&&(this._mScale=vt("div",l,u)),s.imperial&&(this._iScale=vt("div",l,u))},_update:function(){var s=this._map,l=s.getSize().y/2,u=s.distance(s.containerPointToLatLng([0,l]),s.containerPointToLatLng([this.options.maxWidth,l]));this._updateScales(u)},_updateScales:function(s){this.options.metric&&s&&this._updateMetric(s),this.options.imperial&&s&&this._updateImperial(s)},_updateMetric:function(s){var l=this._getRoundNum(s),u=l<1e3?l+" m":l/1e3+" km";this._updateScale(this._mScale,u,l/s)},_updateImperial:function(s){var l=s*3.2808399,u,g,p;l>5280?(u=l/5280,g=this._getRoundNum(u),this._updateScale(this._iScale,g+" mi",g/u)):(p=this._getRoundNum(l),this._updateScale(this._iScale,p+" ft",p/l))},_updateScale:function(s,l,u){s.style.width=Math.round(this.options.maxWidth*u)+"px",s.innerHTML=l},_getRoundNum:function(s){var l=Math.pow(10,(Math.floor(s)+"").length-1),u=s/l;return u=u>=10?10:u>=5?5:u>=3?3:u>=2?2:1,l*u}}),yw=function(s){return new of(s)},vw='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Jl=Ie.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+($.inlineSvg?vw+" ":"")+"Leaflet</a>"},initialize:function(s){b(this,s),this._attributions={}},onAdd:function(s){s.attributionControl=this,this._container=vt("div","leaflet-control-attribution"),Hr(this._container);for(var l in s._layers)s._layers[l].getAttribution&&this.addAttribution(s._layers[l].getAttribution());return this._update(),s.on("layeradd",this._addAttribution,this),this._container},onRemove:function(s){s.off("layeradd",this._addAttribution,this)},_addAttribution:function(s){s.layer.getAttribution&&(this.addAttribution(s.layer.getAttribution()),s.layer.once("remove",function(){this.removeAttribution(s.layer.getAttribution())},this))},setPrefix:function(s){return this.options.prefix=s,this._update(),this},addAttribution:function(s){return s?(this._attributions[s]||(this._attributions[s]=0),this._attributions[s]++,this._update(),this):this},removeAttribution:function(s){return s?(this._attributions[s]&&(this._attributions[s]--,this._update()),this):this},_update:function(){if(this._map){var s=[];for(var l in this._attributions)this._attributions[l]&&s.push(l);var u=[];this.options.prefix&&u.push(this.options.prefix),s.length&&u.push(s.join(", ")),this._container.innerHTML=u.join(' <span aria-hidden="true">|</span> ')}}});mt.mergeOptions({attributionControl:!0}),mt.addInitHook(function(){this.options.attributionControl&&new Jl().addTo(this)});var xw=function(s){return new Jl(s)};Ie.Layers=sf,Ie.Zoom=$l,Ie.Scale=of,Ie.Attribution=Jl,Vr.layers=pw,Vr.zoom=mw,Vr.scale=yw,Vr.attribution=xw;var Ke=nt.extend({initialize:function(s){this._map=s},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Ke.addTo=function(s,l){return s.addHandler(l,this),this};var Ew={Events:X},af=$.touch?"touchstart mousedown":"mousedown",ji=j.extend({options:{clickTolerance:3},initialize:function(s,l,u,g){b(this,g),this._element=s,this._dragStartTarget=l||s,this._preventOutline=u},enable:function(){this._enabled||(lt(this._dragStartTarget,af,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ji._dragging===this&&this.finishDrag(!0),Pt(this._dragStartTarget,af,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(s){if(this._enabled&&(this._moved=!1,!Nl(this._element,"leaflet-zoom-anim"))){if(s.touches&&s.touches.length!==1){ji._dragging===this&&this.finishDrag();return}if(!(ji._dragging||s.shiftKey||s.which!==1&&s.button!==1&&!s.touches)&&(ji._dragging=this,this._preventOutline&&Wl(this._element),Ul(),Zr(),!this._moving)){this.fire("down");var l=s.touches?s.touches[0]:s,u=Jd(this._element);this._startPoint=new B(l.clientX,l.clientY),this._startPos=dn(this._element),this._parentScale=Hl(u);var g=s.type==="mousedown";lt(document,g?"mousemove":"touchmove",this._onMove,this),lt(document,g?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(s){if(this._enabled){if(s.touches&&s.touches.length>1){this._moved=!0;return}var l=s.touches&&s.touches.length===1?s.touches[0]:s,u=new B(l.clientX,l.clientY)._subtract(this._startPoint);!u.x&&!u.y||Math.abs(u.x)+Math.abs(u.y)<this.options.clickTolerance||(u.x/=this._parentScale.x,u.y/=this._parentScale.y,Kt(s),this._moved||(this.fire("dragstart"),this._moved=!0,ct(document.body,"leaflet-dragging"),this._lastTarget=s.target||s.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ct(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(u),this._moving=!0,this._lastEvent=s,this._updatePosition())}},_updatePosition:function(){var s={originalEvent:this._lastEvent};this.fire("predrag",s),Nt(this._element,this._newPos),this.fire("drag",s)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(s){At(document.body,"leaflet-dragging"),this._lastTarget&&(At(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Pt(document,"mousemove touchmove",this._onMove,this),Pt(document,"mouseup touchend touchcancel",this._onUp,this),Zl(),jr();var l=this._moved&&this._moving;this._moving=!1,ji._dragging=!1,l&&this.fire("dragend",{noInertia:s,distance:this._newPos.distanceTo(this._startPos)})}});function lf(s,l,u){var g,p=[1,4,2,8],w,P,I,D,N,Y,it,dt;for(w=0,Y=s.length;w<Y;w++)s[w]._code=_n(s[w],l);for(I=0;I<4;I++){for(it=p[I],g=[],w=0,Y=s.length,P=Y-1;w<Y;P=w++)D=s[w],N=s[P],D._code&it?N._code&it||(dt=Mo(N,D,it,l,u),dt._code=_n(dt,l),g.push(dt)):(N._code&it&&(dt=Mo(N,D,it,l,u),dt._code=_n(dt,l),g.push(dt)),g.push(D));s=g}return s}function hf(s,l){var u,g,p,w,P,I,D,N,Y;if(!s||s.length===0)throw new Error("latlngs not passed");we(s)||(console.warn("latlngs are not flat! Only the first ring will be used"),s=s[0]);var it=ot([0,0]),dt=tt(s),re=dt.getNorthWest().distanceTo(dt.getSouthWest())*dt.getNorthEast().distanceTo(dt.getNorthWest());re<1700&&(it=Ql(s));var Ht=s.length,Le=[];for(u=0;u<Ht;u++){var ue=ot(s[u]);Le.push(l.project(ot([ue.lat-it.lat,ue.lng-it.lng])))}for(I=D=N=0,u=0,g=Ht-1;u<Ht;g=u++)p=Le[u],w=Le[g],P=p.y*w.x-w.y*p.x,D+=(p.x+w.x)*P,N+=(p.y+w.y)*P,I+=P*3;I===0?Y=Le[0]:Y=[D/I,N/I];var ir=l.unproject(W(Y));return ot([ir.lat+it.lat,ir.lng+it.lng])}function Ql(s){for(var l=0,u=0,g=0,p=0;p<s.length;p++){var w=ot(s[p]);l+=w.lat,u+=w.lng,g++}return ot([l/g,u/g])}var ww={__proto__:null,clipPolygon:lf,polygonCenter:hf,centroid:Ql};function cf(s,l){if(!l||!s.length)return s.slice();var u=l*l;return s=Tw(s,u),s=bw(s,u),s}function uf(s,l,u){return Math.sqrt(Xr(s,l,u,!0))}function Lw(s,l,u){return Xr(s,l,u)}function bw(s,l){var u=s.length,g=typeof Uint8Array!=void 0+""?Uint8Array:Array,p=new g(u);p[0]=p[u-1]=1,th(s,p,l,0,u-1);var w,P=[];for(w=0;w<u;w++)p[w]&&P.push(s[w]);return P}function th(s,l,u,g,p){var w=0,P,I,D;for(I=g+1;I<=p-1;I++)D=Xr(s[I],s[g],s[p],!0),D>w&&(P=I,w=D);w>u&&(l[P]=1,th(s,l,u,g,P),th(s,l,u,P,p))}function Tw(s,l){for(var u=[s[0]],g=1,p=0,w=s.length;g<w;g++)Cw(s[g],s[p])>l&&(u.push(s[g]),p=g);return p<w-1&&u.push(s[w-1]),u}var df;function ff(s,l,u,g,p){var w=g?df:_n(s,u),P=_n(l,u),I,D,N;for(df=P;;){if(!(w|P))return[s,l];if(w&P)return!1;I=w||P,D=Mo(s,l,I,u,p),N=_n(D,u),I===w?(s=D,w=N):(l=D,P=N)}}function Mo(s,l,u,g,p){var w=l.x-s.x,P=l.y-s.y,I=g.min,D=g.max,N,Y;return u&8?(N=s.x+w*(D.y-s.y)/P,Y=D.y):u&4?(N=s.x+w*(I.y-s.y)/P,Y=I.y):u&2?(N=D.x,Y=s.y+P*(D.x-s.x)/w):u&1&&(N=I.x,Y=s.y+P*(I.x-s.x)/w),new B(N,Y,p)}function _n(s,l){var u=0;return s.x<l.min.x?u|=1:s.x>l.max.x&&(u|=2),s.y<l.min.y?u|=4:s.y>l.max.y&&(u|=8),u}function Cw(s,l){var u=l.x-s.x,g=l.y-s.y;return u*u+g*g}function Xr(s,l,u,g){var p=l.x,w=l.y,P=u.x-p,I=u.y-w,D=P*P+I*I,N;return D>0&&(N=((s.x-p)*P+(s.y-w)*I)/D,N>1?(p=u.x,w=u.y):N>0&&(p+=P*N,w+=I*N)),P=s.x-p,I=s.y-w,g?P*P+I*I:new B(p,w)}function we(s){return!x(s[0])||typeof s[0][0]!="object"&&typeof s[0][0]<"u"}function gf(s){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),we(s)}function _f(s,l){var u,g,p,w,P,I,D,N;if(!s||s.length===0)throw new Error("latlngs not passed");we(s)||(console.warn("latlngs are not flat! Only the first ring will be used"),s=s[0]);var Y=ot([0,0]),it=tt(s),dt=it.getNorthWest().distanceTo(it.getSouthWest())*it.getNorthEast().distanceTo(it.getNorthWest());dt<1700&&(Y=Ql(s));var re=s.length,Ht=[];for(u=0;u<re;u++){var Le=ot(s[u]);Ht.push(l.project(ot([Le.lat-Y.lat,Le.lng-Y.lng])))}for(u=0,g=0;u<re-1;u++)g+=Ht[u].distanceTo(Ht[u+1])/2;if(g===0)N=Ht[0];else for(u=0,w=0;u<re-1;u++)if(P=Ht[u],I=Ht[u+1],p=P.distanceTo(I),w+=p,w>g){D=(w-g)/p,N=[I.x-D*(I.x-P.x),I.y-D*(I.y-P.y)];break}var ue=l.unproject(W(N));return ot([ue.lat+Y.lat,ue.lng+Y.lng])}var Sw={__proto__:null,simplify:cf,pointToSegmentDistance:uf,closestPointOnSegment:Lw,clipSegment:ff,_getEdgeIntersection:Mo,_getBitCode:_n,_sqClosestPointOnSegment:Xr,isFlat:we,_flat:gf,polylineCenter:_f},eh={project:function(s){return new B(s.lng,s.lat)},unproject:function(s){return new J(s.y,s.x)},bounds:new rt([-180,-90],[180,90])},ih={R:6378137,R_MINOR:6356752314245179e-9,bounds:new rt([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(s){var l=Math.PI/180,u=this.R,g=s.lat*l,p=this.R_MINOR/u,w=Math.sqrt(1-p*p),P=w*Math.sin(g),I=Math.tan(Math.PI/4-g/2)/Math.pow((1-P)/(1+P),w/2);return g=-u*Math.log(Math.max(I,1e-10)),new B(s.lng*l*u,g)},unproject:function(s){for(var l=180/Math.PI,u=this.R,g=this.R_MINOR/u,p=Math.sqrt(1-g*g),w=Math.exp(-s.y/u),P=Math.PI/2-2*Math.atan(w),I=0,D=.1,N;I<15&&Math.abs(D)>1e-7;I++)N=p*Math.sin(P),N=Math.pow((1-N)/(1+N),p/2),D=Math.PI/2-2*Math.atan(w*N)-P,P+=D;return new J(P*l,s.x*l/u)}},Pw={__proto__:null,LonLat:eh,Mercator:ih,SphericalMercator:We},kw=n({},St,{code:"EPSG:3395",projection:ih,transformation:function(){var s=.5/(Math.PI*ih.R);return xe(s,.5,-s,.5)}()}),pf=n({},St,{code:"EPSG:4326",projection:eh,transformation:xe(1/180,1,-1/180,.5)}),Rw=n({},Ft,{projection:eh,transformation:xe(1,0,-1,0),scale:function(s){return Math.pow(2,s)},zoom:function(s){return Math.log(s)/Math.LN2},distance:function(s,l){var u=l.lng-s.lng,g=l.lat-s.lat;return Math.sqrt(u*u+g*g)},infinite:!0});Ft.Earth=St,Ft.EPSG3395=kw,Ft.EPSG3857=Oi,Ft.EPSG900913=He,Ft.EPSG4326=pf,Ft.Simple=Rw;var Ae=j.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(s){return s.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(s){return s&&s.removeLayer(this),this},getPane:function(s){return this._map.getPane(s?this.options[s]||s:this.options.pane)},addInteractiveTarget:function(s){return this._map._targets[c(s)]=this,this},removeInteractiveTarget:function(s){return delete this._map._targets[c(s)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(s){var l=s.target;if(l.hasLayer(this)){if(this._map=l,this._zoomAnimated=l._zoomAnimated,this.getEvents){var u=this.getEvents();l.on(u,this),this.once("remove",function(){l.off(u,this)},this)}this.onAdd(l),this.fire("add"),l.fire("layeradd",{layer:this})}}});mt.include({addLayer:function(s){if(!s._layerAdd)throw new Error("The provided object is not a Layer.");var l=c(s);return this._layers[l]?this:(this._layers[l]=s,s._mapToAdd=this,s.beforeAdd&&s.beforeAdd(this),this.whenReady(s._layerAdd,s),this)},removeLayer:function(s){var l=c(s);return this._layers[l]?(this._loaded&&s.onRemove(this),delete this._layers[l],this._loaded&&(this.fire("layerremove",{layer:s}),s.fire("remove")),s._map=s._mapToAdd=null,this):this},hasLayer:function(s){return c(s)in this._layers},eachLayer:function(s,l){for(var u in this._layers)s.call(l,this._layers[u]);return this},_addLayers:function(s){s=s?x(s)?s:[s]:[];for(var l=0,u=s.length;l<u;l++)this.addLayer(s[l])},_addZoomLimit:function(s){(!isNaN(s.options.maxZoom)||!isNaN(s.options.minZoom))&&(this._zoomBoundLayers[c(s)]=s,this._updateZoomLevels())},_removeZoomLimit:function(s){var l=c(s);this._zoomBoundLayers[l]&&(delete this._zoomBoundLayers[l],this._updateZoomLevels())},_updateZoomLevels:function(){var s=1/0,l=-1/0,u=this._getZoomSpan();for(var g in this._zoomBoundLayers){var p=this._zoomBoundLayers[g].options;s=p.minZoom===void 0?s:Math.min(s,p.minZoom),l=p.maxZoom===void 0?l:Math.max(l,p.maxZoom)}this._layersMaxZoom=l===-1/0?void 0:l,this._layersMinZoom=s===1/0?void 0:s,u!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var $n=Ae.extend({initialize:function(s,l){b(this,l),this._layers={};var u,g;if(s)for(u=0,g=s.length;u<g;u++)this.addLayer(s[u])},addLayer:function(s){var l=this.getLayerId(s);return this._layers[l]=s,this._map&&this._map.addLayer(s),this},removeLayer:function(s){var l=s in this._layers?s:this.getLayerId(s);return this._map&&this._layers[l]&&this._map.removeLayer(this._layers[l]),delete this._layers[l],this},hasLayer:function(s){var l=typeof s=="number"?s:this.getLayerId(s);return l in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(s){var l=Array.prototype.slice.call(arguments,1),u,g;for(u in this._layers)g=this._layers[u],g[s]&&g[s].apply(g,l);return this},onAdd:function(s){this.eachLayer(s.addLayer,s)},onRemove:function(s){this.eachLayer(s.removeLayer,s)},eachLayer:function(s,l){for(var u in this._layers)s.call(l,this._layers[u]);return this},getLayer:function(s){return this._layers[s]},getLayers:function(){var s=[];return this.eachLayer(s.push,s),s},setZIndex:function(s){return this.invoke("setZIndex",s)},getLayerId:function(s){return c(s)}}),Mw=function(s,l){return new $n(s,l)},_i=$n.extend({addLayer:function(s){return this.hasLayer(s)?this:(s.addEventParent(this),$n.prototype.addLayer.call(this,s),this.fire("layeradd",{layer:s}))},removeLayer:function(s){return this.hasLayer(s)?(s in this._layers&&(s=this._layers[s]),s.removeEventParent(this),$n.prototype.removeLayer.call(this,s),this.fire("layerremove",{layer:s})):this},setStyle:function(s){return this.invoke("setStyle",s)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var s=new Lt;for(var l in this._layers){var u=this._layers[l];s.extend(u.getBounds?u.getBounds():u.getLatLng())}return s}}),Iw=function(s,l){return new _i(s,l)},Jn=nt.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(s){b(this,s)},createIcon:function(s){return this._createIcon("icon",s)},createShadow:function(s){return this._createIcon("shadow",s)},_createIcon:function(s,l){var u=this._getIconUrl(s);if(!u){if(s==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var g=this._createImg(u,l&&l.tagName==="IMG"?l:null);return this._setIconStyles(g,s),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),g},_setIconStyles:function(s,l){var u=this.options,g=u[l+"Size"];typeof g=="number"&&(g=[g,g]);var p=W(g),w=W(l==="shadow"&&u.shadowAnchor||u.iconAnchor||p&&p.divideBy(2,!0));s.className="leaflet-marker-"+l+" "+(u.className||""),w&&(s.style.marginLeft=-w.x+"px",s.style.marginTop=-w.y+"px"),p&&(s.style.width=p.x+"px",s.style.height=p.y+"px")},_createImg:function(s,l){return l=l||document.createElement("img"),l.src=s,l},_getIconUrl:function(s){return $.retina&&this.options[s+"RetinaUrl"]||this.options[s+"Url"]}});function Aw(s){return new Jn(s)}var Yr=Jn.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(s){return typeof Yr.imagePath!="string"&&(Yr.imagePath=this._detectIconPath()),(this.options.imagePath||Yr.imagePath)+Jn.prototype._getIconUrl.call(this,s)},_stripUrl:function(s){var l=function(u,g,p){var w=g.exec(u);return w&&w[p]};return s=l(s,/^url\((['"])?(.+)\1\)$/,2),s&&l(s,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var s=vt("div","leaflet-default-icon-path",document.body),l=Ur(s,"background-image")||Ur(s,"backgroundImage");if(document.body.removeChild(s),l=this._stripUrl(l),l)return l;var u=document.querySelector('link[href$="leaflet.css"]');return u?u.href.substring(0,u.href.length-11-1):""}}),mf=Ke.extend({initialize:function(s){this._marker=s},addHooks:function(){var s=this._marker._icon;this._draggable||(this._draggable=new ji(s,s,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ct(s,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&At(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(s){var l=this._marker,u=l._map,g=this._marker.options.autoPanSpeed,p=this._marker.options.autoPanPadding,w=dn(l._icon),P=u.getPixelBounds(),I=u.getPixelOrigin(),D=F(P.min._subtract(I).add(p),P.max._subtract(I).subtract(p));if(!D.contains(w)){var N=W((Math.max(D.max.x,w.x)-D.max.x)/(P.max.x-D.max.x)-(Math.min(D.min.x,w.x)-D.min.x)/(P.min.x-D.min.x),(Math.max(D.max.y,w.y)-D.max.y)/(P.max.y-D.max.y)-(Math.min(D.min.y,w.y)-D.min.y)/(P.min.y-D.min.y)).multiplyBy(g);u.panBy(N,{animate:!1}),this._draggable._newPos._add(N),this._draggable._startPos._add(N),Nt(l._icon,this._draggable._newPos),this._onDrag(s),this._panRequest=Z(this._adjustPan.bind(this,s))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(s){this._marker.options.autoPan&&(H(this._panRequest),this._panRequest=Z(this._adjustPan.bind(this,s)))},_onDrag:function(s){var l=this._marker,u=l._shadow,g=dn(l._icon),p=l._map.layerPointToLatLng(g);u&&Nt(u,g),l._latlng=p,s.latlng=p,s.oldLatLng=this._oldLatLng,l.fire("move",s).fire("drag",s)},_onDragEnd:function(s){H(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",s)}}),Io=Ae.extend({options:{icon:new Yr,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(s,l){b(this,l),this._latlng=ot(s)},onAdd:function(s){this._zoomAnimated=this._zoomAnimated&&s.options.markerZoomAnimation,this._zoomAnimated&&s.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(s){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&s.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(s){var l=this._latlng;return this._latlng=ot(s),this.update(),this.fire("move",{oldLatLng:l,latlng:this._latlng})},setZIndexOffset:function(s){return this.options.zIndexOffset=s,this.update()},getIcon:function(){return this.options.icon},setIcon:function(s){return this.options.icon=s,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var s=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(s)}return this},_initIcon:function(){var s=this.options,l="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),u=s.icon.createIcon(this._icon),g=!1;u!==this._icon&&(this._icon&&this._removeIcon(),g=!0,s.title&&(u.title=s.title),u.tagName==="IMG"&&(u.alt=s.alt||"")),ct(u,l),s.keyboard&&(u.tabIndex="0",u.setAttribute("role","button")),this._icon=u,s.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&lt(u,"focus",this._panOnFocus,this);var p=s.icon.createShadow(this._shadow),w=!1;p!==this._shadow&&(this._removeShadow(),w=!0),p&&(ct(p,l),p.alt=""),this._shadow=p,s.opacity<1&&this._updateOpacity(),g&&this.getPane().appendChild(this._icon),this._initInteraction(),p&&w&&this.getPane(s.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Pt(this._icon,"focus",this._panOnFocus,this),Rt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Rt(this._shadow),this._shadow=null},_setPos:function(s){this._icon&&Nt(this._icon,s),this._shadow&&Nt(this._shadow,s),this._zIndex=s.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(s){this._icon&&(this._icon.style.zIndex=this._zIndex+s)},_animateZoom:function(s){var l=this._map._latLngToNewLayerPoint(this._latlng,s.zoom,s.center).round();this._setPos(l)},_initInteraction:function(){if(this.options.interactive&&(ct(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),mf)){var s=this.options.draggable;this.dragging&&(s=this.dragging.enabled(),this.dragging.disable()),this.dragging=new mf(this),s&&this.dragging.enable()}},setOpacity:function(s){return this.options.opacity=s,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var s=this.options.opacity;this._icon&&Ee(this._icon,s),this._shadow&&Ee(this._shadow,s)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var s=this._map;if(s){var l=this.options.icon.options,u=l.iconSize?W(l.iconSize):W(0,0),g=l.iconAnchor?W(l.iconAnchor):W(0,0);s.panInside(this._latlng,{paddingTopLeft:g,paddingBottomRight:u.subtract(g)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Dw(s,l){return new Io(s,l)}var Wi=Ae.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(s){this._renderer=s.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(s){return b(this,s),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&s&&Object.prototype.hasOwnProperty.call(s,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Ao=Wi.extend({options:{fill:!0,radius:10},initialize:function(s,l){b(this,l),this._latlng=ot(s),this._radius=this.options.radius},setLatLng:function(s){var l=this._latlng;return this._latlng=ot(s),this.redraw(),this.fire("move",{oldLatLng:l,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(s){return this.options.radius=this._radius=s,this.redraw()},getRadius:function(){return this._radius},setStyle:function(s){var l=s&&s.radius||this._radius;return Wi.prototype.setStyle.call(this,s),this.setRadius(l),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var s=this._radius,l=this._radiusY||s,u=this._clickTolerance(),g=[s+u,l+u];this._pxBounds=new rt(this._point.subtract(g),this._point.add(g))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(s){return s.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function Ow(s,l){return new Ao(s,l)}var nh=Ao.extend({initialize:function(s,l,u){if(typeof l=="number"&&(l=n({},u,{radius:l})),b(this,l),this._latlng=ot(s),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(s){return this._mRadius=s,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var s=[this._radius,this._radiusY||this._radius];return new Lt(this._map.layerPointToLatLng(this._point.subtract(s)),this._map.layerPointToLatLng(this._point.add(s)))},setStyle:Wi.prototype.setStyle,_project:function(){var s=this._latlng.lng,l=this._latlng.lat,u=this._map,g=u.options.crs;if(g.distance===St.distance){var p=Math.PI/180,w=this._mRadius/St.R/p,P=u.project([l+w,s]),I=u.project([l-w,s]),D=P.add(I).divideBy(2),N=u.unproject(D).lat,Y=Math.acos((Math.cos(w*p)-Math.sin(l*p)*Math.sin(N*p))/(Math.cos(l*p)*Math.cos(N*p)))/p;(isNaN(Y)||Y===0)&&(Y=w/Math.cos(Math.PI/180*l)),this._point=D.subtract(u.getPixelOrigin()),this._radius=isNaN(Y)?0:D.x-u.project([N,s-Y]).x,this._radiusY=D.y-P.y}else{var it=g.unproject(g.project(this._latlng).subtract([this._mRadius,0]));this._point=u.latLngToLayerPoint(this._latlng),this._radius=this._point.x-u.latLngToLayerPoint(it).x}this._updateBounds()}});function Fw(s,l,u){return new nh(s,l,u)}var pi=Wi.extend({options:{smoothFactor:1,noClip:!1},initialize:function(s,l){b(this,l),this._setLatLngs(s)},getLatLngs:function(){return this._latlngs},setLatLngs:function(s){return this._setLatLngs(s),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(s){for(var l=1/0,u=null,g=Xr,p,w,P=0,I=this._parts.length;P<I;P++)for(var D=this._parts[P],N=1,Y=D.length;N<Y;N++){p=D[N-1],w=D[N];var it=g(s,p,w,!0);it<l&&(l=it,u=g(s,p,w))}return u&&(u.distance=Math.sqrt(l)),u},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return _f(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(s,l){return l=l||this._defaultShape(),s=ot(s),l.push(s),this._bounds.extend(s),this.redraw()},_setLatLngs:function(s){this._bounds=new Lt,this._latlngs=this._convertLatLngs(s)},_defaultShape:function(){return we(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(s){for(var l=[],u=we(s),g=0,p=s.length;g<p;g++)u?(l[g]=ot(s[g]),this._bounds.extend(l[g])):l[g]=this._convertLatLngs(s[g]);return l},_project:function(){var s=new rt;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,s),this._bounds.isValid()&&s.isValid()&&(this._rawPxBounds=s,this._updateBounds())},_updateBounds:function(){var s=this._clickTolerance(),l=new B(s,s);this._rawPxBounds&&(this._pxBounds=new rt([this._rawPxBounds.min.subtract(l),this._rawPxBounds.max.add(l)]))},_projectLatlngs:function(s,l,u){var g=s[0]instanceof J,p=s.length,w,P;if(g){for(P=[],w=0;w<p;w++)P[w]=this._map.latLngToLayerPoint(s[w]),u.extend(P[w]);l.push(P)}else for(w=0;w<p;w++)this._projectLatlngs(s[w],l,u)},_clipPoints:function(){var s=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(s))){if(this.options.noClip){this._parts=this._rings;return}var l=this._parts,u,g,p,w,P,I,D;for(u=0,p=0,w=this._rings.length;u<w;u++)for(D=this._rings[u],g=0,P=D.length;g<P-1;g++)I=ff(D[g],D[g+1],s,g,!0),I&&(l[p]=l[p]||[],l[p].push(I[0]),(I[1]!==D[g+1]||g===P-2)&&(l[p].push(I[1]),p++))}},_simplifyPoints:function(){for(var s=this._parts,l=this.options.smoothFactor,u=0,g=s.length;u<g;u++)s[u]=cf(s[u],l)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(s,l){var u,g,p,w,P,I,D=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(s))return!1;for(u=0,w=this._parts.length;u<w;u++)for(I=this._parts[u],g=0,P=I.length,p=P-1;g<P;p=g++)if(!(!l&&g===0)&&uf(s,I[p],I[g])<=D)return!0;return!1}});function zw(s,l){return new pi(s,l)}pi._flat=gf;var Qn=pi.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return hf(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(s){var l=pi.prototype._convertLatLngs.call(this,s),u=l.length;return u>=2&&l[0]instanceof J&&l[0].equals(l[u-1])&&l.pop(),l},_setLatLngs:function(s){pi.prototype._setLatLngs.call(this,s),we(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return we(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var s=this._renderer._bounds,l=this.options.weight,u=new B(l,l);if(s=new rt(s.min.subtract(u),s.max.add(u)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(s))){if(this.options.noClip){this._parts=this._rings;return}for(var g=0,p=this._rings.length,w;g<p;g++)w=lf(this._rings[g],s,!0),w.length&&this._parts.push(w)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(s){var l=!1,u,g,p,w,P,I,D,N;if(!this._pxBounds||!this._pxBounds.contains(s))return!1;for(w=0,D=this._parts.length;w<D;w++)for(u=this._parts[w],P=0,N=u.length,I=N-1;P<N;I=P++)g=u[P],p=u[I],g.y>s.y!=p.y>s.y&&s.x<(p.x-g.x)*(s.y-g.y)/(p.y-g.y)+g.x&&(l=!l);return l||pi.prototype._containsPoint.call(this,s,!0)}});function Nw(s,l){return new Qn(s,l)}var mi=_i.extend({initialize:function(s,l){b(this,l),this._layers={},s&&this.addData(s)},addData:function(s){var l=x(s)?s:s.features,u,g,p;if(l){for(u=0,g=l.length;u<g;u++)p=l[u],(p.geometries||p.geometry||p.features||p.coordinates)&&this.addData(p);return this}var w=this.options;if(w.filter&&!w.filter(s))return this;var P=Do(s,w);return P?(P.feature=zo(s),P.defaultOptions=P.options,this.resetStyle(P),w.onEachFeature&&w.onEachFeature(s,P),this.addLayer(P)):this},resetStyle:function(s){return s===void 0?this.eachLayer(this.resetStyle,this):(s.options=n({},s.defaultOptions),this._setLayerStyle(s,this.options.style),this)},setStyle:function(s){return this.eachLayer(function(l){this._setLayerStyle(l,s)},this)},_setLayerStyle:function(s,l){s.setStyle&&(typeof l=="function"&&(l=l(s.feature)),s.setStyle(l))}});function Do(s,l){var u=s.type==="Feature"?s.geometry:s,g=u?u.coordinates:null,p=[],w=l&&l.pointToLayer,P=l&&l.coordsToLatLng||rh,I,D,N,Y;if(!g&&!u)return null;switch(u.type){case"Point":return I=P(g),yf(w,s,I,l);case"MultiPoint":for(N=0,Y=g.length;N<Y;N++)I=P(g[N]),p.push(yf(w,s,I,l));return new _i(p);case"LineString":case"MultiLineString":return D=Oo(g,u.type==="LineString"?0:1,P),new pi(D,l);case"Polygon":case"MultiPolygon":return D=Oo(g,u.type==="Polygon"?1:2,P),new Qn(D,l);case"GeometryCollection":for(N=0,Y=u.geometries.length;N<Y;N++){var it=Do({geometry:u.geometries[N],type:"Feature",properties:s.properties},l);it&&p.push(it)}return new _i(p);case"FeatureCollection":for(N=0,Y=u.features.length;N<Y;N++){var dt=Do(u.features[N],l);dt&&p.push(dt)}return new _i(p);default:throw new Error("Invalid GeoJSON object.")}}function yf(s,l,u,g){return s?s(l,u):new Io(u,g&&g.markersInheritOptions&&g)}function rh(s){return new J(s[1],s[0],s[2])}function Oo(s,l,u){for(var g=[],p=0,w=s.length,P;p<w;p++)P=l?Oo(s[p],l-1,u):(u||rh)(s[p]),g.push(P);return g}function sh(s,l){return s=ot(s),s.alt!==void 0?[m(s.lng,l),m(s.lat,l),m(s.alt,l)]:[m(s.lng,l),m(s.lat,l)]}function Fo(s,l,u,g){for(var p=[],w=0,P=s.length;w<P;w++)p.push(l?Fo(s[w],we(s[w])?0:l-1,u,g):sh(s[w],g));return!l&&u&&p.length>0&&p.push(p[0].slice()),p}function tr(s,l){return s.feature?n({},s.feature,{geometry:l}):zo(l)}function zo(s){return s.type==="Feature"||s.type==="FeatureCollection"?s:{type:"Feature",properties:{},geometry:s}}var oh={toGeoJSON:function(s){return tr(this,{type:"Point",coordinates:sh(this.getLatLng(),s)})}};Io.include(oh),nh.include(oh),Ao.include(oh),pi.include({toGeoJSON:function(s){var l=!we(this._latlngs),u=Fo(this._latlngs,l?1:0,!1,s);return tr(this,{type:(l?"Multi":"")+"LineString",coordinates:u})}}),Qn.include({toGeoJSON:function(s){var l=!we(this._latlngs),u=l&&!we(this._latlngs[0]),g=Fo(this._latlngs,u?2:l?1:0,!0,s);return l||(g=[g]),tr(this,{type:(u?"Multi":"")+"Polygon",coordinates:g})}}),$n.include({toMultiPoint:function(s){var l=[];return this.eachLayer(function(u){l.push(u.toGeoJSON(s).geometry.coordinates)}),tr(this,{type:"MultiPoint",coordinates:l})},toGeoJSON:function(s){var l=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(l==="MultiPoint")return this.toMultiPoint(s);var u=l==="GeometryCollection",g=[];return this.eachLayer(function(p){if(p.toGeoJSON){var w=p.toGeoJSON(s);if(u)g.push(w.geometry);else{var P=zo(w);P.type==="FeatureCollection"?g.push.apply(g,P.features):g.push(P)}}}),u?tr(this,{geometries:g,type:"GeometryCollection"}):{type:"FeatureCollection",features:g}}});function vf(s,l){return new mi(s,l)}var Bw=vf,No=Ae.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(s,l,u){this._url=s,this._bounds=tt(l),b(this,u)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ct(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Rt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(s){return this.options.opacity=s,this._image&&this._updateOpacity(),this},setStyle:function(s){return s.opacity&&this.setOpacity(s.opacity),this},bringToFront:function(){return this._map&&Kn(this._image),this},bringToBack:function(){return this._map&&qn(this._image),this},setUrl:function(s){return this._url=s,this._image&&(this._image.src=s),this},setBounds:function(s){return this._bounds=tt(s),this._map&&this._reset(),this},getEvents:function(){var s={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(s.zoomanim=this._animateZoom),s},setZIndex:function(s){return this.options.zIndex=s,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var s=this._url.tagName==="IMG",l=this._image=s?this._url:vt("img");if(ct(l,"leaflet-image-layer"),this._zoomAnimated&&ct(l,"leaflet-zoom-animated"),this.options.className&&ct(l,this.options.className),l.onselectstart=_,l.onmousemove=_,l.onload=a(this.fire,this,"load"),l.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(l.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),s){this._url=l.src;return}l.src=this._url,l.alt=this.options.alt},_animateZoom:function(s){var l=this._map.getZoomScale(s.zoom),u=this._map._latLngBoundsToNewLayerBounds(this._bounds,s.zoom,s.center).min;un(this._image,u,l)},_reset:function(){var s=this._image,l=new rt(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),u=l.getSize();Nt(s,l.min),s.style.width=u.x+"px",s.style.height=u.y+"px"},_updateOpacity:function(){Ee(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var s=this.options.errorOverlayUrl;s&&this._url!==s&&(this._url=s,this._image.src=s)},getCenter:function(){return this._bounds.getCenter()}}),Gw=function(s,l,u){return new No(s,l,u)},xf=No.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var s=this._url.tagName==="VIDEO",l=this._image=s?this._url:vt("video");if(ct(l,"leaflet-image-layer"),this._zoomAnimated&&ct(l,"leaflet-zoom-animated"),this.options.className&&ct(l,this.options.className),l.onselectstart=_,l.onmousemove=_,l.onloadeddata=a(this.fire,this,"load"),s){for(var u=l.getElementsByTagName("source"),g=[],p=0;p<u.length;p++)g.push(u[p].src);this._url=u.length>0?g:[l.src];return}x(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(l.style,"objectFit")&&(l.style.objectFit="fill"),l.autoplay=!!this.options.autoplay,l.loop=!!this.options.loop,l.muted=!!this.options.muted,l.playsInline=!!this.options.playsInline;for(var w=0;w<this._url.length;w++){var P=vt("source");P.src=this._url[w],l.appendChild(P)}}});function Uw(s,l,u){return new xf(s,l,u)}var Ef=No.extend({_initImage:function(){var s=this._image=this._url;ct(s,"leaflet-image-layer"),this._zoomAnimated&&ct(s,"leaflet-zoom-animated"),this.options.className&&ct(s,this.options.className),s.onselectstart=_,s.onmousemove=_}});function Zw(s,l,u){return new Ef(s,l,u)}var qe=Ae.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(s,l){s&&(s instanceof J||x(s))?(this._latlng=ot(s),b(this,l)):(b(this,s),this._source=l),this.options.content&&(this._content=this.options.content)},openOn:function(s){return s=arguments.length?s:this._source._map,s.hasLayer(this)||s.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(s){return this._map?this.close():(arguments.length?this._source=s:s=this._source,this._prepareOpen(),this.openOn(s._map)),this},onAdd:function(s){this._zoomAnimated=s._zoomAnimated,this._container||this._initLayout(),s._fadeAnimated&&Ee(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),s._fadeAnimated&&Ee(this._container,1),this.bringToFront(),this.options.interactive&&(ct(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(s){s._fadeAnimated?(Ee(this._container,0),this._removeTimeout=setTimeout(a(Rt,void 0,this._container),200)):Rt(this._container),this.options.interactive&&(At(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(s){return this._latlng=ot(s),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(s){return this._content=s,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var s={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(s.zoomanim=this._animateZoom),s},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Kn(this._container),this},bringToBack:function(){return this._map&&qn(this._container),this},_prepareOpen:function(s){var l=this._source;if(!l._map)return!1;if(l instanceof _i){l=null;var u=this._source._layers;for(var g in u)if(u[g]._map){l=u[g];break}if(!l)return!1;this._source=l}if(!s)if(l.getCenter)s=l.getCenter();else if(l.getLatLng)s=l.getLatLng();else if(l.getBounds)s=l.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(s),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var s=this._contentNode,l=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof l=="string")s.innerHTML=l;else{for(;s.hasChildNodes();)s.removeChild(s.firstChild);s.appendChild(l)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var s=this._map.latLngToLayerPoint(this._latlng),l=W(this.options.offset),u=this._getAnchor();this._zoomAnimated?Nt(this._container,s.add(u)):l=l.add(s).add(u);var g=this._containerBottom=-l.y,p=this._containerLeft=-Math.round(this._containerWidth/2)+l.x;this._container.style.bottom=g+"px",this._container.style.left=p+"px"}},_getAnchor:function(){return[0,0]}});mt.include({_initOverlay:function(s,l,u,g){var p=l;return p instanceof s||(p=new s(g).setContent(l)),u&&p.setLatLng(u),p}}),Ae.include({_initOverlay:function(s,l,u,g){var p=u;return p instanceof s?(b(p,g),p._source=this):(p=l&&!g?l:new s(g,this),p.setContent(u)),p}});var Bo=qe.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(s){return s=arguments.length?s:this._source._map,!s.hasLayer(this)&&s._popup&&s._popup.options.autoClose&&s.removeLayer(s._popup),s._popup=this,qe.prototype.openOn.call(this,s)},onAdd:function(s){qe.prototype.onAdd.call(this,s),s.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Wi||this._source.on("preclick",fn))},onRemove:function(s){qe.prototype.onRemove.call(this,s),s.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Wi||this._source.off("preclick",fn))},getEvents:function(){var s=qe.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(s.preclick=this.close),this.options.keepInView&&(s.moveend=this._adjustPan),s},_initLayout:function(){var s="leaflet-popup",l=this._container=vt("div",s+" "+(this.options.className||"")+" leaflet-zoom-animated"),u=this._wrapper=vt("div",s+"-content-wrapper",l);if(this._contentNode=vt("div",s+"-content",u),Hr(l),Kl(this._contentNode),lt(l,"contextmenu",fn),this._tipContainer=vt("div",s+"-tip-container",l),this._tip=vt("div",s+"-tip",this._tipContainer),this.options.closeButton){var g=this._closeButton=vt("a",s+"-close-button",l);g.setAttribute("role","button"),g.setAttribute("aria-label","Close popup"),g.href="#close",g.innerHTML='<span aria-hidden="true">&#215;</span>',lt(g,"click",function(p){Kt(p),this.close()},this)}},_updateLayout:function(){var s=this._contentNode,l=s.style;l.width="",l.whiteSpace="nowrap";var u=s.offsetWidth;u=Math.min(u,this.options.maxWidth),u=Math.max(u,this.options.minWidth),l.width=u+1+"px",l.whiteSpace="",l.height="";var g=s.offsetHeight,p=this.options.maxHeight,w="leaflet-popup-scrolled";p&&g>p?(l.height=p+"px",ct(s,w)):At(s,w),this._containerWidth=this._container.offsetWidth},_animateZoom:function(s){var l=this._map._latLngToNewLayerPoint(this._latlng,s.zoom,s.center),u=this._getAnchor();Nt(this._container,l.add(u))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var s=this._map,l=parseInt(Ur(this._container,"marginBottom"),10)||0,u=this._container.offsetHeight+l,g=this._containerWidth,p=new B(this._containerLeft,-u-this._containerBottom);p._add(dn(this._container));var w=s.layerPointToContainerPoint(p),P=W(this.options.autoPanPadding),I=W(this.options.autoPanPaddingTopLeft||P),D=W(this.options.autoPanPaddingBottomRight||P),N=s.getSize(),Y=0,it=0;w.x+g+D.x>N.x&&(Y=w.x+g-N.x+D.x),w.x-Y-I.x<0&&(Y=w.x-I.x),w.y+u+D.y>N.y&&(it=w.y+u-N.y+D.y),w.y-it-I.y<0&&(it=w.y-I.y),(Y||it)&&(this.options.keepInView&&(this._autopanning=!0),s.fire("autopanstart").panBy([Y,it]))}},_getAnchor:function(){return W(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),jw=function(s,l){return new Bo(s,l)};mt.mergeOptions({closePopupOnClick:!0}),mt.include({openPopup:function(s,l,u){return this._initOverlay(Bo,s,l,u).openOn(this),this},closePopup:function(s){return s=arguments.length?s:this._popup,s&&s.close(),this}}),Ae.include({bindPopup:function(s,l){return this._popup=this._initOverlay(Bo,this._popup,s,l),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(s){return this._popup&&(this instanceof _i||(this._popup._source=this),this._popup._prepareOpen(s||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(s){return this._popup&&this._popup.setContent(s),this},getPopup:function(){return this._popup},_openPopup:function(s){if(!(!this._popup||!this._map)){gn(s);var l=s.layer||s.target;if(this._popup._source===l&&!(l instanceof Wi)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(s.latlng);return}this._popup._source=l,this.openPopup(s.latlng)}},_movePopup:function(s){this._popup.setLatLng(s.latlng)},_onKeyPress:function(s){s.originalEvent.keyCode===13&&this._openPopup(s)}});var Go=qe.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(s){qe.prototype.onAdd.call(this,s),this.setOpacity(this.options.opacity),s.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(s){qe.prototype.onRemove.call(this,s),s.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var s=qe.prototype.getEvents.call(this);return this.options.permanent||(s.preclick=this.close),s},_initLayout:function(){var s="leaflet-tooltip",l=s+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=vt("div",l),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(s){var l,u,g=this._map,p=this._container,w=g.latLngToContainerPoint(g.getCenter()),P=g.layerPointToContainerPoint(s),I=this.options.direction,D=p.offsetWidth,N=p.offsetHeight,Y=W(this.options.offset),it=this._getAnchor();I==="top"?(l=D/2,u=N):I==="bottom"?(l=D/2,u=0):I==="center"?(l=D/2,u=N/2):I==="right"?(l=0,u=N/2):I==="left"?(l=D,u=N/2):P.x<w.x?(I="right",l=0,u=N/2):(I="left",l=D+(Y.x+it.x)*2,u=N/2),s=s.subtract(W(l,u,!0)).add(Y).add(it),At(p,"leaflet-tooltip-right"),At(p,"leaflet-tooltip-left"),At(p,"leaflet-tooltip-top"),At(p,"leaflet-tooltip-bottom"),ct(p,"leaflet-tooltip-"+I),Nt(p,s)},_updatePosition:function(){var s=this._map.latLngToLayerPoint(this._latlng);this._setPosition(s)},setOpacity:function(s){this.options.opacity=s,this._container&&Ee(this._container,s)},_animateZoom:function(s){var l=this._map._latLngToNewLayerPoint(this._latlng,s.zoom,s.center);this._setPosition(l)},_getAnchor:function(){return W(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Ww=function(s,l){return new Go(s,l)};mt.include({openTooltip:function(s,l,u){return this._initOverlay(Go,s,l,u).openOn(this),this},closeTooltip:function(s){return s.close(),this}}),Ae.include({bindTooltip:function(s,l){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Go,this._tooltip,s,l),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(s){if(!(!s&&this._tooltipHandlersAdded)){var l=s?"off":"on",u={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?u.add=this._openTooltip:(u.mouseover=this._openTooltip,u.mouseout=this.closeTooltip,u.click=this._openTooltip,this._map?this._addFocusListeners():u.add=this._addFocusListeners),this._tooltip.options.sticky&&(u.mousemove=this._moveTooltip),this[l](u),this._tooltipHandlersAdded=!s}},openTooltip:function(s){return this._tooltip&&(this instanceof _i||(this._tooltip._source=this),this._tooltip._prepareOpen(s)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(s){return this._tooltip&&this._tooltip.setContent(s),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(s){var l=typeof s.getElement=="function"&&s.getElement();l&&(lt(l,"focus",function(){this._tooltip._source=s,this.openTooltip()},this),lt(l,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(s){var l=typeof s.getElement=="function"&&s.getElement();l&&l.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(s){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var l=this;this._map.once("moveend",function(){l._openOnceFlag=!1,l._openTooltip(s)});return}this._tooltip._source=s.layer||s.target,this.openTooltip(this._tooltip.options.sticky?s.latlng:void 0)}},_moveTooltip:function(s){var l=s.latlng,u,g;this._tooltip.options.sticky&&s.originalEvent&&(u=this._map.mouseEventToContainerPoint(s.originalEvent),g=this._map.containerPointToLayerPoint(u),l=this._map.layerPointToLatLng(g)),this._tooltip.setLatLng(l)}});var wf=Jn.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(s){var l=s&&s.tagName==="DIV"?s:document.createElement("div"),u=this.options;if(u.html instanceof Element?(Co(l),l.appendChild(u.html)):l.innerHTML=u.html!==!1?u.html:"",u.bgPos){var g=W(u.bgPos);l.style.backgroundPosition=-g.x+"px "+-g.y+"px"}return this._setIconStyles(l,"icon"),l},createShadow:function(){return null}});function Hw(s){return new wf(s)}Jn.Default=Yr;var Kr=Ae.extend({options:{tileSize:256,opacity:1,updateWhenIdle:$.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(s){b(this,s)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(s){s._addZoomLimit(this)},onRemove:function(s){this._removeAllTiles(),Rt(this._container),s._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Kn(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(qn(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(s){return this.options.opacity=s,this._updateOpacity(),this},setZIndex:function(s){return this.options.zIndex=s,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var s=this._clampZoom(this._map.getZoom());s!==this._tileZoom&&(this._tileZoom=s,this._updateLevels()),this._update()}return this},getEvents:function(){var s={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=d(this._onMoveEnd,this.options.updateInterval,this)),s.move=this._onMove),this._zoomAnimated&&(s.zoomanim=this._animateZoom),s},createTile:function(){return document.createElement("div")},getTileSize:function(){var s=this.options.tileSize;return s instanceof B?s:new B(s,s)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(s){for(var l=this.getPane().children,u=-s(-1/0,1/0),g=0,p=l.length,w;g<p;g++)w=l[g].style.zIndex,l[g]!==this._container&&w&&(u=s(u,+w));isFinite(u)&&(this.options.zIndex=u+s(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!$.ielt9){Ee(this._container,this.options.opacity);var s=+new Date,l=!1,u=!1;for(var g in this._tiles){var p=this._tiles[g];if(!(!p.current||!p.loaded)){var w=Math.min(1,(s-p.loaded)/200);Ee(p.el,w),w<1?l=!0:(p.active?u=!0:this._onOpaqueTile(p),p.active=!0)}}u&&!this._noPrune&&this._pruneTiles(),l&&(H(this._fadeFrame),this._fadeFrame=Z(this._updateOpacity,this))}},_onOpaqueTile:_,_initContainer:function(){this._container||(this._container=vt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var s=this._tileZoom,l=this.options.maxZoom;if(s!==void 0){for(var u in this._levels)u=Number(u),this._levels[u].el.children.length||u===s?(this._levels[u].el.style.zIndex=l-Math.abs(s-u),this._onUpdateLevel(u)):(Rt(this._levels[u].el),this._removeTilesAtZoom(u),this._onRemoveLevel(u),delete this._levels[u]);var g=this._levels[s],p=this._map;return g||(g=this._levels[s]={},g.el=vt("div","leaflet-tile-container leaflet-zoom-animated",this._container),g.el.style.zIndex=l,g.origin=p.project(p.unproject(p.getPixelOrigin()),s).round(),g.zoom=s,this._setZoomTransform(g,p.getCenter(),p.getZoom()),_(g.el.offsetWidth),this._onCreateLevel(g)),this._level=g,g}},_onUpdateLevel:_,_onRemoveLevel:_,_onCreateLevel:_,_pruneTiles:function(){if(this._map){var s,l,u=this._map.getZoom();if(u>this.options.maxZoom||u<this.options.minZoom){this._removeAllTiles();return}for(s in this._tiles)l=this._tiles[s],l.retain=l.current;for(s in this._tiles)if(l=this._tiles[s],l.current&&!l.active){var g=l.coords;this._retainParent(g.x,g.y,g.z,g.z-5)||this._retainChildren(g.x,g.y,g.z,g.z+2)}for(s in this._tiles)this._tiles[s].retain||this._removeTile(s)}},_removeTilesAtZoom:function(s){for(var l in this._tiles)this._tiles[l].coords.z===s&&this._removeTile(l)},_removeAllTiles:function(){for(var s in this._tiles)this._removeTile(s)},_invalidateAll:function(){for(var s in this._levels)Rt(this._levels[s].el),this._onRemoveLevel(Number(s)),delete this._levels[s];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(s,l,u,g){var p=Math.floor(s/2),w=Math.floor(l/2),P=u-1,I=new B(+p,+w);I.z=+P;var D=this._tileCoordsToKey(I),N=this._tiles[D];return N&&N.active?(N.retain=!0,!0):(N&&N.loaded&&(N.retain=!0),P>g?this._retainParent(p,w,P,g):!1)},_retainChildren:function(s,l,u,g){for(var p=2*s;p<2*s+2;p++)for(var w=2*l;w<2*l+2;w++){var P=new B(p,w);P.z=u+1;var I=this._tileCoordsToKey(P),D=this._tiles[I];if(D&&D.active){D.retain=!0;continue}else D&&D.loaded&&(D.retain=!0);u+1<g&&this._retainChildren(p,w,u+1,g)}},_resetView:function(s){var l=s&&(s.pinch||s.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),l,l)},_animateZoom:function(s){this._setView(s.center,s.zoom,!0,s.noUpdate)},_clampZoom:function(s){var l=this.options;return l.minNativeZoom!==void 0&&s<l.minNativeZoom?l.minNativeZoom:l.maxNativeZoom!==void 0&&l.maxNativeZoom<s?l.maxNativeZoom:s},_setView:function(s,l,u,g){var p=Math.round(l);this.options.maxZoom!==void 0&&p>this.options.maxZoom||this.options.minZoom!==void 0&&p<this.options.minZoom?p=void 0:p=this._clampZoom(p);var w=this.options.updateWhenZooming&&p!==this._tileZoom;(!g||w)&&(this._tileZoom=p,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),p!==void 0&&this._update(s),u||this._pruneTiles(),this._noPrune=!!u),this._setZoomTransforms(s,l)},_setZoomTransforms:function(s,l){for(var u in this._levels)this._setZoomTransform(this._levels[u],s,l)},_setZoomTransform:function(s,l,u){var g=this._map.getZoomScale(u,s.zoom),p=s.origin.multiplyBy(g).subtract(this._map._getNewPixelOrigin(l,u)).round();$.any3d?un(s.el,p,g):Nt(s.el,p)},_resetGrid:function(){var s=this._map,l=s.options.crs,u=this._tileSize=this.getTileSize(),g=this._tileZoom,p=this._map.getPixelWorldBounds(this._tileZoom);p&&(this._globalTileRange=this._pxBoundsToTileRange(p)),this._wrapX=l.wrapLng&&!this.options.noWrap&&[Math.floor(s.project([0,l.wrapLng[0]],g).x/u.x),Math.ceil(s.project([0,l.wrapLng[1]],g).x/u.y)],this._wrapY=l.wrapLat&&!this.options.noWrap&&[Math.floor(s.project([l.wrapLat[0],0],g).y/u.x),Math.ceil(s.project([l.wrapLat[1],0],g).y/u.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(s){var l=this._map,u=l._animatingZoom?Math.max(l._animateToZoom,l.getZoom()):l.getZoom(),g=l.getZoomScale(u,this._tileZoom),p=l.project(s,this._tileZoom).floor(),w=l.getSize().divideBy(g*2);return new rt(p.subtract(w),p.add(w))},_update:function(s){var l=this._map;if(l){var u=this._clampZoom(l.getZoom());if(s===void 0&&(s=l.getCenter()),this._tileZoom!==void 0){var g=this._getTiledPixelBounds(s),p=this._pxBoundsToTileRange(g),w=p.getCenter(),P=[],I=this.options.keepBuffer,D=new rt(p.getBottomLeft().subtract([I,-I]),p.getTopRight().add([I,-I]));if(!(isFinite(p.min.x)&&isFinite(p.min.y)&&isFinite(p.max.x)&&isFinite(p.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var N in this._tiles){var Y=this._tiles[N].coords;(Y.z!==this._tileZoom||!D.contains(new B(Y.x,Y.y)))&&(this._tiles[N].current=!1)}if(Math.abs(u-this._tileZoom)>1){this._setView(s,u);return}for(var it=p.min.y;it<=p.max.y;it++)for(var dt=p.min.x;dt<=p.max.x;dt++){var re=new B(dt,it);if(re.z=this._tileZoom,!!this._isValidTile(re)){var Ht=this._tiles[this._tileCoordsToKey(re)];Ht?Ht.current=!0:P.push(re)}}if(P.sort(function(ue,ir){return ue.distanceTo(w)-ir.distanceTo(w)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Le=document.createDocumentFragment();for(dt=0;dt<P.length;dt++)this._addTile(P[dt],Le);this._level.el.appendChild(Le)}}}},_isValidTile:function(s){var l=this._map.options.crs;if(!l.infinite){var u=this._globalTileRange;if(!l.wrapLng&&(s.x<u.min.x||s.x>u.max.x)||!l.wrapLat&&(s.y<u.min.y||s.y>u.max.y))return!1}if(!this.options.bounds)return!0;var g=this._tileCoordsToBounds(s);return tt(this.options.bounds).overlaps(g)},_keyToBounds:function(s){return this._tileCoordsToBounds(this._keyToTileCoords(s))},_tileCoordsToNwSe:function(s){var l=this._map,u=this.getTileSize(),g=s.scaleBy(u),p=g.add(u),w=l.unproject(g,s.z),P=l.unproject(p,s.z);return[w,P]},_tileCoordsToBounds:function(s){var l=this._tileCoordsToNwSe(s),u=new Lt(l[0],l[1]);return this.options.noWrap||(u=this._map.wrapLatLngBounds(u)),u},_tileCoordsToKey:function(s){return s.x+":"+s.y+":"+s.z},_keyToTileCoords:function(s){var l=s.split(":"),u=new B(+l[0],+l[1]);return u.z=+l[2],u},_removeTile:function(s){var l=this._tiles[s];l&&(Rt(l.el),delete this._tiles[s],this.fire("tileunload",{tile:l.el,coords:this._keyToTileCoords(s)}))},_initTile:function(s){ct(s,"leaflet-tile");var l=this.getTileSize();s.style.width=l.x+"px",s.style.height=l.y+"px",s.onselectstart=_,s.onmousemove=_,$.ielt9&&this.options.opacity<1&&Ee(s,this.options.opacity)},_addTile:function(s,l){var u=this._getTilePos(s),g=this._tileCoordsToKey(s),p=this.createTile(this._wrapCoords(s),a(this._tileReady,this,s));this._initTile(p),this.createTile.length<2&&Z(a(this._tileReady,this,s,null,p)),Nt(p,u),this._tiles[g]={el:p,coords:s,current:!0},l.appendChild(p),this.fire("tileloadstart",{tile:p,coords:s})},_tileReady:function(s,l,u){l&&this.fire("tileerror",{error:l,tile:u,coords:s});var g=this._tileCoordsToKey(s);u=this._tiles[g],u&&(u.loaded=+new Date,this._map._fadeAnimated?(Ee(u.el,0),H(this._fadeFrame),this._fadeFrame=Z(this._updateOpacity,this)):(u.active=!0,this._pruneTiles()),l||(ct(u.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:u.el,coords:s})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),$.ielt9||!this._map._fadeAnimated?Z(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(s){return s.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(s){var l=new B(this._wrapX?f(s.x,this._wrapX):s.x,this._wrapY?f(s.y,this._wrapY):s.y);return l.z=s.z,l},_pxBoundsToTileRange:function(s){var l=this.getTileSize();return new rt(s.min.unscaleBy(l).floor(),s.max.unscaleBy(l).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var s in this._tiles)if(!this._tiles[s].loaded)return!1;return!0}});function Vw(s){return new Kr(s)}var er=Kr.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(s,l){this._url=s,l=b(this,l),l.detectRetina&&$.retina&&l.maxZoom>0?(l.tileSize=Math.floor(l.tileSize/2),l.zoomReverse?(l.zoomOffset--,l.minZoom=Math.min(l.maxZoom,l.minZoom+1)):(l.zoomOffset++,l.maxZoom=Math.max(l.minZoom,l.maxZoom-1)),l.minZoom=Math.max(0,l.minZoom)):l.zoomReverse?l.minZoom=Math.min(l.maxZoom,l.minZoom):l.maxZoom=Math.max(l.minZoom,l.maxZoom),typeof l.subdomains=="string"&&(l.subdomains=l.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(s,l){return this._url===s&&l===void 0&&(l=!0),this._url=s,l||this.redraw(),this},createTile:function(s,l){var u=document.createElement("img");return lt(u,"load",a(this._tileOnLoad,this,l,u)),lt(u,"error",a(this._tileOnError,this,l,u)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(u.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(u.referrerPolicy=this.options.referrerPolicy),u.alt="",u.src=this.getTileUrl(s),u},getTileUrl:function(s){var l={r:$.retina?"@2x":"",s:this._getSubdomain(s),x:s.x,y:s.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var u=this._globalTileRange.max.y-s.y;this.options.tms&&(l.y=u),l["-y"]=u}return y(this._url,n(l,this.options))},_tileOnLoad:function(s,l){$.ielt9?setTimeout(a(s,this,null,l),0):s(null,l)},_tileOnError:function(s,l,u){var g=this.options.errorTileUrl;g&&l.getAttribute("src")!==g&&(l.src=g),s(u,l)},_onTileRemove:function(s){s.tile.onload=null},_getZoomForUrl:function(){var s=this._tileZoom,l=this.options.maxZoom,u=this.options.zoomReverse,g=this.options.zoomOffset;return u&&(s=l-s),s+g},_getSubdomain:function(s){var l=Math.abs(s.x+s.y)%this.options.subdomains.length;return this.options.subdomains[l]},_abortLoading:function(){var s,l;for(s in this._tiles)if(this._tiles[s].coords.z!==this._tileZoom&&(l=this._tiles[s].el,l.onload=_,l.onerror=_,!l.complete)){l.src=k;var u=this._tiles[s].coords;Rt(l),delete this._tiles[s],this.fire("tileabort",{tile:l,coords:u})}},_removeTile:function(s){var l=this._tiles[s];if(l)return l.el.setAttribute("src",k),Kr.prototype._removeTile.call(this,s)},_tileReady:function(s,l,u){if(!(!this._map||u&&u.getAttribute("src")===k))return Kr.prototype._tileReady.call(this,s,l,u)}});function Lf(s,l){return new er(s,l)}var bf=er.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(s,l){this._url=s;var u=n({},this.defaultWmsParams);for(var g in l)g in this.options||(u[g]=l[g]);l=b(this,l);var p=l.detectRetina&&$.retina?2:1,w=this.getTileSize();u.width=w.x*p,u.height=w.y*p,this.wmsParams=u},onAdd:function(s){this._crs=this.options.crs||s.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var l=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[l]=this._crs.code,er.prototype.onAdd.call(this,s)},getTileUrl:function(s){var l=this._tileCoordsToNwSe(s),u=this._crs,g=F(u.project(l[0]),u.project(l[1])),p=g.min,w=g.max,P=(this._wmsVersion>=1.3&&this._crs===pf?[p.y,p.x,w.y,w.x]:[p.x,p.y,w.x,w.y]).join(","),I=er.prototype.getTileUrl.call(this,s);return I+C(this.wmsParams,I,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+P},setParams:function(s,l){return n(this.wmsParams,s),l||this.redraw(),this}});function Xw(s,l){return new bf(s,l)}er.WMS=bf,Lf.wms=Xw;var yi=Ae.extend({options:{padding:.1},initialize:function(s){b(this,s),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),ct(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var s={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(s.zoomanim=this._onAnimZoom),s},_onAnimZoom:function(s){this._updateTransform(s.center,s.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(s,l){var u=this._map.getZoomScale(l,this._zoom),g=this._map.getSize().multiplyBy(.5+this.options.padding),p=this._map.project(this._center,l),w=g.multiplyBy(-u).add(p).subtract(this._map._getNewPixelOrigin(s,l));$.any3d?un(this._container,w,u):Nt(this._container,w)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var s in this._layers)this._layers[s]._reset()},_onZoomEnd:function(){for(var s in this._layers)this._layers[s]._project()},_updatePaths:function(){for(var s in this._layers)this._layers[s]._update()},_update:function(){var s=this.options.padding,l=this._map.getSize(),u=this._map.containerPointToLayerPoint(l.multiplyBy(-s)).round();this._bounds=new rt(u,u.add(l.multiplyBy(1+s*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Tf=yi.extend({options:{tolerance:0},getEvents:function(){var s=yi.prototype.getEvents.call(this);return s.viewprereset=this._onViewPreReset,s},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){yi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var s=this._container=document.createElement("canvas");lt(s,"mousemove",this._onMouseMove,this),lt(s,"click dblclick mousedown mouseup contextmenu",this._onClick,this),lt(s,"mouseout",this._handleMouseOut,this),s._leaflet_disable_events=!0,this._ctx=s.getContext("2d")},_destroyContainer:function(){H(this._redrawRequest),delete this._ctx,Rt(this._container),Pt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var s;this._redrawBounds=null;for(var l in this._layers)s=this._layers[l],s._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){yi.prototype._update.call(this);var s=this._bounds,l=this._container,u=s.getSize(),g=$.retina?2:1;Nt(l,s.min),l.width=g*u.x,l.height=g*u.y,l.style.width=u.x+"px",l.style.height=u.y+"px",$.retina&&this._ctx.scale(2,2),this._ctx.translate(-s.min.x,-s.min.y),this.fire("update")}},_reset:function(){yi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(s){this._updateDashArray(s),this._layers[c(s)]=s;var l=s._order={layer:s,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=l),this._drawLast=l,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(s){this._requestRedraw(s)},_removePath:function(s){var l=s._order,u=l.next,g=l.prev;u?u.prev=g:this._drawLast=g,g?g.next=u:this._drawFirst=u,delete s._order,delete this._layers[c(s)],this._requestRedraw(s)},_updatePath:function(s){this._extendRedrawBounds(s),s._project(),s._update(),this._requestRedraw(s)},_updateStyle:function(s){this._updateDashArray(s),this._requestRedraw(s)},_updateDashArray:function(s){if(typeof s.options.dashArray=="string"){var l=s.options.dashArray.split(/[, ]+/),u=[],g,p;for(p=0;p<l.length;p++){if(g=Number(l[p]),isNaN(g))return;u.push(g)}s.options._dashArray=u}else s.options._dashArray=s.options.dashArray},_requestRedraw:function(s){this._map&&(this._extendRedrawBounds(s),this._redrawRequest=this._redrawRequest||Z(this._redraw,this))},_extendRedrawBounds:function(s){if(s._pxBounds){var l=(s.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new rt,this._redrawBounds.extend(s._pxBounds.min.subtract([l,l])),this._redrawBounds.extend(s._pxBounds.max.add([l,l]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var s=this._redrawBounds;if(s){var l=s.getSize();this._ctx.clearRect(s.min.x,s.min.y,l.x,l.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var s,l=this._redrawBounds;if(this._ctx.save(),l){var u=l.getSize();this._ctx.beginPath(),this._ctx.rect(l.min.x,l.min.y,u.x,u.y),this._ctx.clip()}this._drawing=!0;for(var g=this._drawFirst;g;g=g.next)s=g.layer,(!l||s._pxBounds&&s._pxBounds.intersects(l))&&s._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(s,l){if(this._drawing){var u,g,p,w,P=s._parts,I=P.length,D=this._ctx;if(I){for(D.beginPath(),u=0;u<I;u++){for(g=0,p=P[u].length;g<p;g++)w=P[u][g],D[g?"lineTo":"moveTo"](w.x,w.y);l&&D.closePath()}this._fillStroke(D,s)}}},_updateCircle:function(s){if(!(!this._drawing||s._empty())){var l=s._point,u=this._ctx,g=Math.max(Math.round(s._radius),1),p=(Math.max(Math.round(s._radiusY),1)||g)/g;p!==1&&(u.save(),u.scale(1,p)),u.beginPath(),u.arc(l.x,l.y/p,g,0,Math.PI*2,!1),p!==1&&u.restore(),this._fillStroke(u,s)}},_fillStroke:function(s,l){var u=l.options;u.fill&&(s.globalAlpha=u.fillOpacity,s.fillStyle=u.fillColor||u.color,s.fill(u.fillRule||"evenodd")),u.stroke&&u.weight!==0&&(s.setLineDash&&s.setLineDash(l.options&&l.options._dashArray||[]),s.globalAlpha=u.opacity,s.lineWidth=u.weight,s.strokeStyle=u.color,s.lineCap=u.lineCap,s.lineJoin=u.lineJoin,s.stroke())},_onClick:function(s){for(var l=this._map.mouseEventToLayerPoint(s),u,g,p=this._drawFirst;p;p=p.next)u=p.layer,u.options.interactive&&u._containsPoint(l)&&(!(s.type==="click"||s.type==="preclick")||!this._map._draggableMoved(u))&&(g=u);this._fireEvent(g?[g]:!1,s)},_onMouseMove:function(s){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var l=this._map.mouseEventToLayerPoint(s);this._handleMouseHover(s,l)}},_handleMouseOut:function(s){var l=this._hoveredLayer;l&&(At(this._container,"leaflet-interactive"),this._fireEvent([l],s,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(s,l){if(!this._mouseHoverThrottled){for(var u,g,p=this._drawFirst;p;p=p.next)u=p.layer,u.options.interactive&&u._containsPoint(l)&&(g=u);g!==this._hoveredLayer&&(this._handleMouseOut(s),g&&(ct(this._container,"leaflet-interactive"),this._fireEvent([g],s,"mouseover"),this._hoveredLayer=g)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,s),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(s,l,u){this._map._fireDOMEvent(l,u||l.type,s)},_bringToFront:function(s){var l=s._order;if(l){var u=l.next,g=l.prev;if(u)u.prev=g;else return;g?g.next=u:u&&(this._drawFirst=u),l.prev=this._drawLast,this._drawLast.next=l,l.next=null,this._drawLast=l,this._requestRedraw(s)}},_bringToBack:function(s){var l=s._order;if(l){var u=l.next,g=l.prev;if(g)g.next=u;else return;u?u.prev=g:g&&(this._drawLast=g),l.prev=null,l.next=this._drawFirst,this._drawFirst.prev=l,this._drawFirst=l,this._requestRedraw(s)}}});function Cf(s){return $.canvas?new Tf(s):null}var qr=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(s){return document.createElement("<lvml:"+s+' class="lvml">')}}catch{}return function(s){return document.createElement("<"+s+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Yw={_initContainer:function(){this._container=vt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(yi.prototype._update.call(this),this.fire("update"))},_initPath:function(s){var l=s._container=qr("shape");ct(l,"leaflet-vml-shape "+(this.options.className||"")),l.coordsize="1 1",s._path=qr("path"),l.appendChild(s._path),this._updateStyle(s),this._layers[c(s)]=s},_addPath:function(s){var l=s._container;this._container.appendChild(l),s.options.interactive&&s.addInteractiveTarget(l)},_removePath:function(s){var l=s._container;Rt(l),s.removeInteractiveTarget(l),delete this._layers[c(s)]},_updateStyle:function(s){var l=s._stroke,u=s._fill,g=s.options,p=s._container;p.stroked=!!g.stroke,p.filled=!!g.fill,g.stroke?(l||(l=s._stroke=qr("stroke")),p.appendChild(l),l.weight=g.weight+"px",l.color=g.color,l.opacity=g.opacity,g.dashArray?l.dashStyle=x(g.dashArray)?g.dashArray.join(" "):g.dashArray.replace(/( *, *)/g," "):l.dashStyle="",l.endcap=g.lineCap.replace("butt","flat"),l.joinstyle=g.lineJoin):l&&(p.removeChild(l),s._stroke=null),g.fill?(u||(u=s._fill=qr("fill")),p.appendChild(u),u.color=g.fillColor||g.color,u.opacity=g.fillOpacity):u&&(p.removeChild(u),s._fill=null)},_updateCircle:function(s){var l=s._point.round(),u=Math.round(s._radius),g=Math.round(s._radiusY||u);this._setPath(s,s._empty()?"M0 0":"AL "+l.x+","+l.y+" "+u+","+g+" 0,"+65535*360)},_setPath:function(s,l){s._path.v=l},_bringToFront:function(s){Kn(s._container)},_bringToBack:function(s){qn(s._container)}},Uo=$.vml?qr:Fi,$r=yi.extend({_initContainer:function(){this._container=Uo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Uo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Rt(this._container),Pt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){yi.prototype._update.call(this);var s=this._bounds,l=s.getSize(),u=this._container;(!this._svgSize||!this._svgSize.equals(l))&&(this._svgSize=l,u.setAttribute("width",l.x),u.setAttribute("height",l.y)),Nt(u,s.min),u.setAttribute("viewBox",[s.min.x,s.min.y,l.x,l.y].join(" ")),this.fire("update")}},_initPath:function(s){var l=s._path=Uo("path");s.options.className&&ct(l,s.options.className),s.options.interactive&&ct(l,"leaflet-interactive"),this._updateStyle(s),this._layers[c(s)]=s},_addPath:function(s){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(s._path),s.addInteractiveTarget(s._path)},_removePath:function(s){Rt(s._path),s.removeInteractiveTarget(s._path),delete this._layers[c(s)]},_updatePath:function(s){s._project(),s._update()},_updateStyle:function(s){var l=s._path,u=s.options;l&&(u.stroke?(l.setAttribute("stroke",u.color),l.setAttribute("stroke-opacity",u.opacity),l.setAttribute("stroke-width",u.weight),l.setAttribute("stroke-linecap",u.lineCap),l.setAttribute("stroke-linejoin",u.lineJoin),u.dashArray?l.setAttribute("stroke-dasharray",u.dashArray):l.removeAttribute("stroke-dasharray"),u.dashOffset?l.setAttribute("stroke-dashoffset",u.dashOffset):l.removeAttribute("stroke-dashoffset")):l.setAttribute("stroke","none"),u.fill?(l.setAttribute("fill",u.fillColor||u.color),l.setAttribute("fill-opacity",u.fillOpacity),l.setAttribute("fill-rule",u.fillRule||"evenodd")):l.setAttribute("fill","none"))},_updatePoly:function(s,l){this._setPath(s,Pe(s._parts,l))},_updateCircle:function(s){var l=s._point,u=Math.max(Math.round(s._radius),1),g=Math.max(Math.round(s._radiusY),1)||u,p="a"+u+","+g+" 0 1,0 ",w=s._empty()?"M0 0":"M"+(l.x-u)+","+l.y+p+u*2+",0 "+p+-u*2+",0 ";this._setPath(s,w)},_setPath:function(s,l){s._path.setAttribute("d",l)},_bringToFront:function(s){Kn(s._path)},_bringToBack:function(s){qn(s._path)}});$.vml&&$r.include(Yw);function Sf(s){return $.svg||$.vml?new $r(s):null}mt.include({getRenderer:function(s){var l=s.options.renderer||this._getPaneRenderer(s.options.pane)||this.options.renderer||this._renderer;return l||(l=this._renderer=this._createRenderer()),this.hasLayer(l)||this.addLayer(l),l},_getPaneRenderer:function(s){if(s==="overlayPane"||s===void 0)return!1;var l=this._paneRenderers[s];return l===void 0&&(l=this._createRenderer({pane:s}),this._paneRenderers[s]=l),l},_createRenderer:function(s){return this.options.preferCanvas&&Cf(s)||Sf(s)}});var Pf=Qn.extend({initialize:function(s,l){Qn.prototype.initialize.call(this,this._boundsToLatLngs(s),l)},setBounds:function(s){return this.setLatLngs(this._boundsToLatLngs(s))},_boundsToLatLngs:function(s){return s=tt(s),[s.getSouthWest(),s.getNorthWest(),s.getNorthEast(),s.getSouthEast()]}});function Kw(s,l){return new Pf(s,l)}$r.create=Uo,$r.pointsToPath=Pe,mi.geometryToLayer=Do,mi.coordsToLatLng=rh,mi.coordsToLatLngs=Oo,mi.latLngToCoords=sh,mi.latLngsToCoords=Fo,mi.getFeature=tr,mi.asFeature=zo,mt.mergeOptions({boxZoom:!0});var kf=Ke.extend({initialize:function(s){this._map=s,this._container=s._container,this._pane=s._panes.overlayPane,this._resetStateTimeout=0,s.on("unload",this._destroy,this)},addHooks:function(){lt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Pt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Rt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(s){if(!s.shiftKey||s.which!==1&&s.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Zr(),Ul(),this._startPoint=this._map.mouseEventToContainerPoint(s),lt(document,{contextmenu:gn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(s){this._moved||(this._moved=!0,this._box=vt("div","leaflet-zoom-box",this._container),ct(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(s);var l=new rt(this._point,this._startPoint),u=l.getSize();Nt(this._box,l.min),this._box.style.width=u.x+"px",this._box.style.height=u.y+"px"},_finish:function(){this._moved&&(Rt(this._box),At(this._container,"leaflet-crosshair")),jr(),Zl(),Pt(document,{contextmenu:gn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(s){if(!(s.which!==1&&s.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var l=new Lt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(l).fire("boxzoomend",{boxZoomBounds:l})}},_onKeyDown:function(s){s.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});mt.addInitHook("addHandler","boxZoom",kf),mt.mergeOptions({doubleClickZoom:!0});var Rf=Ke.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(s){var l=this._map,u=l.getZoom(),g=l.options.zoomDelta,p=s.originalEvent.shiftKey?u-g:u+g;l.options.doubleClickZoom==="center"?l.setZoom(p):l.setZoomAround(s.containerPoint,p)}});mt.addInitHook("addHandler","doubleClickZoom",Rf),mt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Mf=Ke.extend({addHooks:function(){if(!this._draggable){var s=this._map;this._draggable=new ji(s._mapPane,s._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),s.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),s.on("zoomend",this._onZoomEnd,this),s.whenReady(this._onZoomEnd,this))}ct(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){At(this._map._container,"leaflet-grab"),At(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var s=this._map;if(s._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var l=tt(this._map.options.maxBounds);this._offsetLimit=F(this._map.latLngToContainerPoint(l.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(l.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;s.fire("movestart").fire("dragstart"),s.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(s){if(this._map.options.inertia){var l=this._lastTime=+new Date,u=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(u),this._times.push(l),this._prunePositions(l)}this._map.fire("move",s).fire("drag",s)},_prunePositions:function(s){for(;this._positions.length>1&&s-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var s=this._map.getSize().divideBy(2),l=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=l.subtract(s).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(s,l){return s-(s-l)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var s=this._draggable._newPos.subtract(this._draggable._startPos),l=this._offsetLimit;s.x<l.min.x&&(s.x=this._viscousLimit(s.x,l.min.x)),s.y<l.min.y&&(s.y=this._viscousLimit(s.y,l.min.y)),s.x>l.max.x&&(s.x=this._viscousLimit(s.x,l.max.x)),s.y>l.max.y&&(s.y=this._viscousLimit(s.y,l.max.y)),this._draggable._newPos=this._draggable._startPos.add(s)}},_onPreDragWrap:function(){var s=this._worldWidth,l=Math.round(s/2),u=this._initialWorldOffset,g=this._draggable._newPos.x,p=(g-l+u)%s+l-u,w=(g+l+u)%s-l-u,P=Math.abs(p+u)<Math.abs(w+u)?p:w;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=P},_onDragEnd:function(s){var l=this._map,u=l.options,g=!u.inertia||s.noInertia||this._times.length<2;if(l.fire("dragend",s),g)l.fire("moveend");else{this._prunePositions(+new Date);var p=this._lastPos.subtract(this._positions[0]),w=(this._lastTime-this._times[0])/1e3,P=u.easeLinearity,I=p.multiplyBy(P/w),D=I.distanceTo([0,0]),N=Math.min(u.inertiaMaxSpeed,D),Y=I.multiplyBy(N/D),it=N/(u.inertiaDeceleration*P),dt=Y.multiplyBy(-it/2).round();!dt.x&&!dt.y?l.fire("moveend"):(dt=l._limitOffset(dt,l.options.maxBounds),Z(function(){l.panBy(dt,{duration:it,easeLinearity:P,noMoveStart:!0,animate:!0})}))}}});mt.addInitHook("addHandler","dragging",Mf),mt.mergeOptions({keyboard:!0,keyboardPanDelta:80});var If=Ke.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(s){this._map=s,this._setPanDelta(s.options.keyboardPanDelta),this._setZoomDelta(s.options.zoomDelta)},addHooks:function(){var s=this._map._container;s.tabIndex<=0&&(s.tabIndex="0"),lt(s,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Pt(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var s=document.body,l=document.documentElement,u=s.scrollTop||l.scrollTop,g=s.scrollLeft||l.scrollLeft;this._map._container.focus(),window.scrollTo(g,u)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(s){var l=this._panKeys={},u=this.keyCodes,g,p;for(g=0,p=u.left.length;g<p;g++)l[u.left[g]]=[-1*s,0];for(g=0,p=u.right.length;g<p;g++)l[u.right[g]]=[s,0];for(g=0,p=u.down.length;g<p;g++)l[u.down[g]]=[0,s];for(g=0,p=u.up.length;g<p;g++)l[u.up[g]]=[0,-1*s]},_setZoomDelta:function(s){var l=this._zoomKeys={},u=this.keyCodes,g,p;for(g=0,p=u.zoomIn.length;g<p;g++)l[u.zoomIn[g]]=s;for(g=0,p=u.zoomOut.length;g<p;g++)l[u.zoomOut[g]]=-s},_addHooks:function(){lt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Pt(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(s){if(!(s.altKey||s.ctrlKey||s.metaKey)){var l=s.keyCode,u=this._map,g;if(l in this._panKeys){if(!u._panAnim||!u._panAnim._inProgress)if(g=this._panKeys[l],s.shiftKey&&(g=W(g).multiplyBy(3)),u.options.maxBounds&&(g=u._limitOffset(W(g),u.options.maxBounds)),u.options.worldCopyJump){var p=u.wrapLatLng(u.unproject(u.project(u.getCenter()).add(g)));u.panTo(p)}else u.panBy(g)}else if(l in this._zoomKeys)u.setZoom(u.getZoom()+(s.shiftKey?3:1)*this._zoomKeys[l]);else if(l===27&&u._popup&&u._popup.options.closeOnEscapeKey)u.closePopup();else return;gn(s)}}});mt.addInitHook("addHandler","keyboard",If),mt.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Af=Ke.extend({addHooks:function(){lt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Pt(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(s){var l=nf(s),u=this._map.options.wheelDebounceTime;this._delta+=l,this._lastMousePos=this._map.mouseEventToContainerPoint(s),this._startTime||(this._startTime=+new Date);var g=Math.max(u-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),g),gn(s)},_performZoom:function(){var s=this._map,l=s.getZoom(),u=this._map.options.zoomSnap||0;s._stop();var g=this._delta/(this._map.options.wheelPxPerZoomLevel*4),p=4*Math.log(2/(1+Math.exp(-Math.abs(g))))/Math.LN2,w=u?Math.ceil(p/u)*u:p,P=s._limitZoom(l+(this._delta>0?w:-w))-l;this._delta=0,this._startTime=null,P&&(s.options.scrollWheelZoom==="center"?s.setZoom(l+P):s.setZoomAround(this._lastMousePos,l+P))}});mt.addInitHook("addHandler","scrollWheelZoom",Af);var qw=600;mt.mergeOptions({tapHold:$.touchNative&&$.safari&&$.mobile,tapTolerance:15});var Df=Ke.extend({addHooks:function(){lt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Pt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(s){if(clearTimeout(this._holdTimeout),s.touches.length===1){var l=s.touches[0];this._startPos=this._newPos=new B(l.clientX,l.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(lt(document,"touchend",Kt),lt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",l))},this),qw),lt(document,"touchend touchcancel contextmenu",this._cancel,this),lt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function s(){Pt(document,"touchend",Kt),Pt(document,"touchend touchcancel",s)},_cancel:function(){clearTimeout(this._holdTimeout),Pt(document,"touchend touchcancel contextmenu",this._cancel,this),Pt(document,"touchmove",this._onMove,this)},_onMove:function(s){var l=s.touches[0];this._newPos=new B(l.clientX,l.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(s,l){var u=new MouseEvent(s,{bubbles:!0,cancelable:!0,view:window,screenX:l.screenX,screenY:l.screenY,clientX:l.clientX,clientY:l.clientY});u._simulated=!0,l.target.dispatchEvent(u)}});mt.addInitHook("addHandler","tapHold",Df),mt.mergeOptions({touchZoom:$.touch,bounceAtZoomLimits:!0});var Of=Ke.extend({addHooks:function(){ct(this._map._container,"leaflet-touch-zoom"),lt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){At(this._map._container,"leaflet-touch-zoom"),Pt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(s){var l=this._map;if(!(!s.touches||s.touches.length!==2||l._animatingZoom||this._zooming)){var u=l.mouseEventToContainerPoint(s.touches[0]),g=l.mouseEventToContainerPoint(s.touches[1]);this._centerPoint=l.getSize()._divideBy(2),this._startLatLng=l.containerPointToLatLng(this._centerPoint),l.options.touchZoom!=="center"&&(this._pinchStartLatLng=l.containerPointToLatLng(u.add(g)._divideBy(2))),this._startDist=u.distanceTo(g),this._startZoom=l.getZoom(),this._moved=!1,this._zooming=!0,l._stop(),lt(document,"touchmove",this._onTouchMove,this),lt(document,"touchend touchcancel",this._onTouchEnd,this),Kt(s)}},_onTouchMove:function(s){if(!(!s.touches||s.touches.length!==2||!this._zooming)){var l=this._map,u=l.mouseEventToContainerPoint(s.touches[0]),g=l.mouseEventToContainerPoint(s.touches[1]),p=u.distanceTo(g)/this._startDist;if(this._zoom=l.getScaleZoom(p,this._startZoom),!l.options.bounceAtZoomLimits&&(this._zoom<l.getMinZoom()&&p<1||this._zoom>l.getMaxZoom()&&p>1)&&(this._zoom=l._limitZoom(this._zoom)),l.options.touchZoom==="center"){if(this._center=this._startLatLng,p===1)return}else{var w=u._add(g)._divideBy(2)._subtract(this._centerPoint);if(p===1&&w.x===0&&w.y===0)return;this._center=l.unproject(l.project(this._pinchStartLatLng,this._zoom).subtract(w),this._zoom)}this._moved||(l._moveStart(!0,!1),this._moved=!0),H(this._animRequest);var P=a(l._move,l,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Z(P,this,!0),Kt(s)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,H(this._animRequest),Pt(document,"touchmove",this._onTouchMove,this),Pt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});mt.addInitHook("addHandler","touchZoom",Of),mt.BoxZoom=kf,mt.DoubleClickZoom=Rf,mt.Drag=Mf,mt.Keyboard=If,mt.ScrollWheelZoom=Af,mt.TapHold=Df,mt.TouchZoom=Of,e.Bounds=rt,e.Browser=$,e.CRS=Ft,e.Canvas=Tf,e.Circle=nh,e.CircleMarker=Ao,e.Class=nt,e.Control=Ie,e.DivIcon=wf,e.DivOverlay=qe,e.DomEvent=gw,e.DomUtil=dw,e.Draggable=ji,e.Evented=j,e.FeatureGroup=_i,e.GeoJSON=mi,e.GridLayer=Kr,e.Handler=Ke,e.Icon=Jn,e.ImageOverlay=No,e.LatLng=J,e.LatLngBounds=Lt,e.Layer=Ae,e.LayerGroup=$n,e.LineUtil=Sw,e.Map=mt,e.Marker=Io,e.Mixin=Ew,e.Path=Wi,e.Point=B,e.PolyUtil=ww,e.Polygon=Qn,e.Polyline=pi,e.Popup=Bo,e.PosAnimation=rf,e.Projection=Pw,e.Rectangle=Pf,e.Renderer=yi,e.SVG=$r,e.SVGOverlay=Ef,e.TileLayer=er,e.Tooltip=Go,e.Transformation=Di,e.Util=K,e.VideoOverlay=xf,e.bind=a,e.bounds=F,e.canvas=Cf,e.circle=Fw,e.circleMarker=Ow,e.control=Vr,e.divIcon=Hw,e.extend=n,e.featureGroup=Iw,e.geoJSON=vf,e.geoJson=Bw,e.gridLayer=Vw,e.icon=Aw,e.imageOverlay=Gw,e.latLng=ot,e.latLngBounds=tt,e.layerGroup=Mw,e.map=_w,e.marker=Dw,e.point=W,e.polygon=Nw,e.polyline=zw,e.popup=jw,e.rectangle=Kw,e.setOptions=b,e.stamp=c,e.svg=Sf,e.svgOverlay=Zw,e.tileLayer=Lf,e.tooltip=Ww,e.transformation=xe,e.version=i,e.videoOverlay=Uw;var $w=window.L;e.noConflict=function(){return window.L=$w,this},window.L=e})})(Vo,Vo.exports);var _t=Vo.exports;const lL="";function _h(r,t,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=r,i}function Kf(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ph(r[0])||!ph(r[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:r};return _h(i,t,e)}function qf(r,t,e){e===void 0&&(e={});for(var i=0,n=r;i<n.length;i++){var o=n[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:r};return _h(h,t,e)}function ph(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function $f(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Jf(r){return r.type==="Feature"?r.geometry:r}var mh={exports:{}};(function(r,t){(function(e,i){r.exports=i()})(De,function(){function e(y,x,T,k,R){(function M(A,z,U,Z,H){for(;Z>U;){if(Z-U>600){var K=Z-U+1,nt=z-U+1,q=Math.log(K),X=.5*Math.exp(2*q/3),j=.5*Math.sqrt(q*X*(K-X)/K)*(nt-K/2<0?-1:1),B=Math.max(U,Math.floor(z-nt*X/K+j)),yt=Math.min(Z,Math.floor(z+(K-nt)*X/K+j));M(A,z,B,yt,H)}var W=A[z],rt=U,F=Z;for(i(A,U,z),H(A[Z],W)>0&&i(A,U,Z);rt<F;){for(i(A,rt,F),rt++,F--;H(A[rt],W)<0;)rt++;for(;H(A[F],W)>0;)F--}H(A[U],W)===0?i(A,U,F):i(A,++F,Z),F<=z&&(U=F+1),z<=F&&(Z=F-1)}})(y,x,T||0,k||y.length-1,R||n)}function i(y,x,T){var k=y[x];y[x]=y[T],y[T]=k}function n(y,x){return y<x?-1:y>x?1:0}var o=function(y){y===void 0&&(y=9),this._maxEntries=Math.max(4,y),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(y,x,T){if(!T)return x.indexOf(y);for(var k=0;k<x.length;k++)if(T(y,x[k]))return k;return-1}function h(y,x){c(y,0,y.children.length,x,y)}function c(y,x,T,k,R){R||(R=C(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var M=x;M<T;M++){var A=y.children[M];d(R,y.leaf?k(A):A)}return R}function d(y,x){return y.minX=Math.min(y.minX,x.minX),y.minY=Math.min(y.minY,x.minY),y.maxX=Math.max(y.maxX,x.maxX),y.maxY=Math.max(y.maxY,x.maxY),y}function f(y,x){return y.minX-x.minX}function _(y,x){return y.minY-x.minY}function m(y){return(y.maxX-y.minX)*(y.maxY-y.minY)}function E(y){return y.maxX-y.minX+(y.maxY-y.minY)}function v(y,x){return y.minX<=x.minX&&y.minY<=x.minY&&x.maxX<=y.maxX&&x.maxY<=y.maxY}function b(y,x){return x.minX<=y.maxX&&x.minY<=y.maxY&&x.maxX>=y.minX&&x.maxY>=y.minY}function C(y){return{children:y,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function S(y,x,T,k,R){for(var M=[x,T];M.length;)if(!((T=M.pop())-(x=M.pop())<=k)){var A=x+Math.ceil((T-x)/k/2)*k;e(y,A,x,T,R),M.push(x,A,A,T)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(y){var x=this.data,T=[];if(!b(y,x))return T;for(var k=this.toBBox,R=[];x;){for(var M=0;M<x.children.length;M++){var A=x.children[M],z=x.leaf?k(A):A;b(y,z)&&(x.leaf?T.push(A):v(y,z)?this._all(A,T):R.push(A))}x=R.pop()}return T},o.prototype.collides=function(y){var x=this.data;if(!b(y,x))return!1;for(var T=[];x;){for(var k=0;k<x.children.length;k++){var R=x.children[k],M=x.leaf?this.toBBox(R):R;if(b(y,M)){if(x.leaf||v(y,M))return!0;T.push(R)}}x=T.pop()}return!1},o.prototype.load=function(y){if(!y||!y.length)return this;if(y.length<this._minEntries){for(var x=0;x<y.length;x++)this.insert(y[x]);return this}var T=this._build(y.slice(),0,y.length-1,0);if(this.data.children.length)if(this.data.height===T.height)this._splitRoot(this.data,T);else{if(this.data.height<T.height){var k=this.data;this.data=T,T=k}this._insert(T,this.data.height-T.height-1,!0)}else this.data=T;return this},o.prototype.insert=function(y){return y&&this._insert(y,this.data.height-1),this},o.prototype.clear=function(){return this.data=C([]),this},o.prototype.remove=function(y,x){if(!y)return this;for(var T,k,R,M=this.data,A=this.toBBox(y),z=[],U=[];M||z.length;){if(M||(M=z.pop(),k=z[z.length-1],T=U.pop(),R=!0),M.leaf){var Z=a(y,M.children,x);if(Z!==-1)return M.children.splice(Z,1),z.push(M),this._condense(z),this}R||M.leaf||!v(M,A)?k?(T++,M=k.children[T],R=!1):M=null:(z.push(M),U.push(T),T=0,k=M,M=M.children[0])}return this},o.prototype.toBBox=function(y){return y},o.prototype.compareMinX=function(y,x){return y.minX-x.minX},o.prototype.compareMinY=function(y,x){return y.minY-x.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(y){return this.data=y,this},o.prototype._all=function(y,x){for(var T=[];y;)y.leaf?x.push.apply(x,y.children):T.push.apply(T,y.children),y=T.pop();return x},o.prototype._build=function(y,x,T,k){var R,M=T-x+1,A=this._maxEntries;if(M<=A)return h(R=C(y.slice(x,T+1)),this.toBBox),R;k||(k=Math.ceil(Math.log(M)/Math.log(A)),A=Math.ceil(M/Math.pow(A,k-1))),(R=C([])).leaf=!1,R.height=k;var z=Math.ceil(M/A),U=z*Math.ceil(Math.sqrt(A));S(y,x,T,U,this.compareMinX);for(var Z=x;Z<=T;Z+=U){var H=Math.min(Z+U-1,T);S(y,Z,H,z,this.compareMinY);for(var K=Z;K<=H;K+=z){var nt=Math.min(K+z-1,H);R.children.push(this._build(y,K,nt,k-1))}}return h(R,this.toBBox),R},o.prototype._chooseSubtree=function(y,x,T,k){for(;k.push(x),!x.leaf&&k.length-1!==T;){for(var R=1/0,M=1/0,A=void 0,z=0;z<x.children.length;z++){var U=x.children[z],Z=m(U),H=(K=y,nt=U,(Math.max(nt.maxX,K.maxX)-Math.min(nt.minX,K.minX))*(Math.max(nt.maxY,K.maxY)-Math.min(nt.minY,K.minY))-Z);H<M?(M=H,R=Z<R?Z:R,A=U):H===M&&Z<R&&(R=Z,A=U)}x=A||x.children[0]}var K,nt;return x},o.prototype._insert=function(y,x,T){var k=T?y:this.toBBox(y),R=[],M=this._chooseSubtree(k,this.data,x,R);for(M.children.push(y),d(M,k);x>=0&&R[x].children.length>this._maxEntries;)this._split(R,x),x--;this._adjustParentBBoxes(k,R,x)},o.prototype._split=function(y,x){var T=y[x],k=T.children.length,R=this._minEntries;this._chooseSplitAxis(T,R,k);var M=this._chooseSplitIndex(T,R,k),A=C(T.children.splice(M,T.children.length-M));A.height=T.height,A.leaf=T.leaf,h(T,this.toBBox),h(A,this.toBBox),x?y[x-1].children.push(A):this._splitRoot(T,A)},o.prototype._splitRoot=function(y,x){this.data=C([y,x]),this.data.height=y.height+1,this.data.leaf=!1,h(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(y,x,T){for(var k,R,M,A,z,U,Z,H=1/0,K=1/0,nt=x;nt<=T-x;nt++){var q=c(y,0,nt,this.toBBox),X=c(y,nt,T,this.toBBox),j=(R=q,M=X,A=void 0,z=void 0,U=void 0,Z=void 0,A=Math.max(R.minX,M.minX),z=Math.max(R.minY,M.minY),U=Math.min(R.maxX,M.maxX),Z=Math.min(R.maxY,M.maxY),Math.max(0,U-A)*Math.max(0,Z-z)),B=m(q)+m(X);j<H?(H=j,k=nt,K=B<K?B:K):j===H&&B<K&&(K=B,k=nt)}return k||T-x},o.prototype._chooseSplitAxis=function(y,x,T){var k=y.leaf?this.compareMinX:f,R=y.leaf?this.compareMinY:_;this._allDistMargin(y,x,T,k)<this._allDistMargin(y,x,T,R)&&y.children.sort(k)},o.prototype._allDistMargin=function(y,x,T,k){y.children.sort(k);for(var R=this.toBBox,M=c(y,0,x,R),A=c(y,T-x,T,R),z=E(M)+E(A),U=x;U<T-x;U++){var Z=y.children[U];d(M,y.leaf?R(Z):Z),z+=E(M)}for(var H=T-x-1;H>=x;H--){var K=y.children[H];d(A,y.leaf?R(K):K),z+=E(A)}return z},o.prototype._adjustParentBBoxes=function(y,x,T){for(var k=T;k>=0;k--)d(x[k],y)},o.prototype._condense=function(y){for(var x=y.length-1,T=void 0;x>=0;x--)y[x].children.length===0?x>0?(T=y[x-1].children).splice(T.indexOf(y[x]),1):this.clear():h(y[x],this.toBBox)},o})})(mh);var Qf=mh.exports;const yh=jo(Qf);function tg(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");var i=$f(r),n=Jf(t),o=n.type,a=t.bbox,h=n.coordinates;if(a&&eg(i,a)===!1)return!1;o==="Polygon"&&(h=[h]);for(var c=!1,d=0;d<h.length&&!c;d++)if(vh(i,h[d][0],e.ignoreBoundary)){for(var f=!1,_=1;_<h[d].length&&!f;)vh(i,h[d][_],!e.ignoreBoundary)&&(f=!0),_++;f||(c=!0)}return c}function vh(r,t,e){var i=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var n=0,o=t.length-1;n<t.length;o=n++){var a=t[n][0],h=t[n][1],c=t[o][0],d=t[o][1],f=r[1]*(a-c)+h*(c-r[0])+d*(r[0]-a)===0&&(a-r[0])*(c-r[0])<=0&&(h-r[1])*(d-r[1])<=0;if(f)return!e;var _=h>r[1]!=d>r[1]&&r[0]<(c-a)*(r[1]-h)/(d-h)+a;_&&(i=!i)}return i}function eg(r,t){return t[0]<=r[0]&&t[1]<=r[1]&&t[2]>=r[0]&&t[3]>=r[1]}var xh={exports:{}};xh.exports=es,xh.exports.default=es;function es(r,t,e){e=e||2;var i=t&&t.length,n=i?t[0]*e:r.length,o=Eh(r,0,n,e,!0),a=[];if(!o||o.next===o.prev)return a;var h,c,d,f,_,m,E;if(i&&(o=og(r,t,o,e)),r.length>80*e){h=d=r[0],c=f=r[1];for(var v=e;v<n;v+=e)_=r[v],m=r[v+1],_<h&&(h=_),m<c&&(c=m),_>d&&(d=_),m>f&&(f=m);E=Math.max(d-h,f-c),E=E!==0?32767/E:0}return nr(o,a,e,h,c,E,0),a}function Eh(r,t,e,i,n){var o,a;if(n===Ko(r,t,e,i)>0)for(o=t;o<e;o+=i)a=bh(o,r[o],r[o+1],a);else for(o=e-i;o>=t;o-=i)a=bh(o,r[o],r[o+1],a);return a&&is(a,a.next)&&(sr(a),a=a.next),a}function Hi(r,t){if(!r)return r;t||(t=r);var e=r,i;do if(i=!1,!e.steiner&&(is(e,e.next)||kt(e.prev,e,e.next)===0)){if(sr(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function nr(r,t,e,i,n,o,a){if(r){!a&&o&&ug(r,i,n,o);for(var h=r,c,d;r.prev!==r.next;){if(c=r.prev,d=r.next,o?ng(r,i,n,o):ig(r)){t.push(c.i/e|0),t.push(r.i/e|0),t.push(d.i/e|0),sr(r),r=d.next,h=d.next;continue}if(r=d,r===h){a?a===1?(r=rg(Hi(r),t,e),nr(r,t,e,i,n,o,2)):a===2&&sg(r,t,e,i,n,o):nr(Hi(r),t,e,i,n,o,1);break}}}}function ig(r){var t=r.prev,e=r,i=r.next;if(kt(t,e,i)>=0)return!1;for(var n=t.x,o=e.x,a=i.x,h=t.y,c=e.y,d=i.y,f=n<o?n<a?n:a:o<a?o:a,_=h<c?h<d?h:d:c<d?c:d,m=n>o?n>a?n:a:o>a?o:a,E=h>c?h>d?h:d:c>d?c:d,v=i.next;v!==t;){if(v.x>=f&&v.x<=m&&v.y>=_&&v.y<=E&&pn(n,h,o,c,a,d,v.x,v.y)&&kt(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function ng(r,t,e,i){var n=r.prev,o=r,a=r.next;if(kt(n,o,a)>=0)return!1;for(var h=n.x,c=o.x,d=a.x,f=n.y,_=o.y,m=a.y,E=h<c?h<d?h:d:c<d?c:d,v=f<_?f<m?f:m:_<m?_:m,b=h>c?h>d?h:d:c>d?c:d,C=f>_?f>m?f:m:_>m?_:m,S=Xo(E,v,t,e,i),y=Xo(b,C,t,e,i),x=r.prevZ,T=r.nextZ;x&&x.z>=S&&T&&T.z<=y;){if(x.x>=E&&x.x<=b&&x.y>=v&&x.y<=C&&x!==n&&x!==a&&pn(h,f,c,_,d,m,x.x,x.y)&&kt(x.prev,x,x.next)>=0||(x=x.prevZ,T.x>=E&&T.x<=b&&T.y>=v&&T.y<=C&&T!==n&&T!==a&&pn(h,f,c,_,d,m,T.x,T.y)&&kt(T.prev,T,T.next)>=0))return!1;T=T.nextZ}for(;x&&x.z>=S;){if(x.x>=E&&x.x<=b&&x.y>=v&&x.y<=C&&x!==n&&x!==a&&pn(h,f,c,_,d,m,x.x,x.y)&&kt(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;T&&T.z<=y;){if(T.x>=E&&T.x<=b&&T.y>=v&&T.y<=C&&T!==n&&T!==a&&pn(h,f,c,_,d,m,T.x,T.y)&&kt(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function rg(r,t,e){var i=r;do{var n=i.prev,o=i.next.next;!is(n,o)&&wh(n,i,i.next,o)&&rr(n,o)&&rr(o,n)&&(t.push(n.i/e|0),t.push(i.i/e|0),t.push(o.i/e|0),sr(i),sr(i.next),i=r=o),i=i.next}while(i!==r);return Hi(i)}function sg(r,t,e,i,n,o){var a=r;do{for(var h=a.next.next;h!==a.prev;){if(a.i!==h.i&&gg(a,h)){var c=Lh(a,h);a=Hi(a,a.next),c=Hi(c,c.next),nr(a,t,e,i,n,o,0),nr(c,t,e,i,n,o,0);return}h=h.next}a=a.next}while(a!==r)}function og(r,t,e,i){var n=[],o,a,h,c,d;for(o=0,a=t.length;o<a;o++)h=t[o]*i,c=o<a-1?t[o+1]*i:r.length,d=Eh(r,h,c,i,!1),d===d.next&&(d.steiner=!0),n.push(fg(d));for(n.sort(ag),o=0;o<n.length;o++)e=lg(n[o],e);return e}function ag(r,t){return r.x-t.x}function lg(r,t){var e=hg(r,t);if(!e)return t;var i=Lh(e,r);return Hi(i,i.next),Hi(e,e.next)}function hg(r,t){var e=t,i=r.x,n=r.y,o=-1/0,a;do{if(n<=e.y&&n>=e.next.y&&e.next.y!==e.y){var h=e.x+(n-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=i&&h>o&&(o=h,a=e.x<e.next.x?e:e.next,h===i))return a}e=e.next}while(e!==t);if(!a)return null;var c=a,d=a.x,f=a.y,_=1/0,m;e=a;do i>=e.x&&e.x>=d&&i!==e.x&&pn(n<f?i:o,n,d,f,n<f?o:i,n,e.x,e.y)&&(m=Math.abs(n-e.y)/(i-e.x),rr(e,r)&&(m<_||m===_&&(e.x>a.x||e.x===a.x&&cg(a,e)))&&(a=e,_=m)),e=e.next;while(e!==c);return a}function cg(r,t){return kt(r.prev,r,t.prev)<0&&kt(t.next,r,r.next)<0}function ug(r,t,e,i){var n=r;do n.z===0&&(n.z=Xo(n.x,n.y,t,e,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==r);n.prevZ.nextZ=null,n.prevZ=null,dg(n)}function dg(r){var t,e,i,n,o,a,h,c,d=1;do{for(e=r,r=null,o=null,a=0;e;){for(a++,i=e,h=0,t=0;t<d&&(h++,i=i.nextZ,!!i);t++);for(c=d;h>0||c>0&&i;)h!==0&&(c===0||!i||e.z<=i.z)?(n=e,e=e.nextZ,h--):(n=i,i=i.nextZ,c--),o?o.nextZ=n:r=n,n.prevZ=o,o=n;e=i}o.nextZ=null,d*=2}while(a>1);return r}function Xo(r,t,e,i,n){return r=(r-e)*n|0,t=(t-i)*n|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function fg(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function pn(r,t,e,i,n,o,a,h){return(n-a)*(t-h)>=(r-a)*(o-h)&&(r-a)*(i-h)>=(e-a)*(t-h)&&(e-a)*(o-h)>=(n-a)*(i-h)}function gg(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!_g(r,t)&&(rr(r,t)&&rr(t,r)&&pg(r,t)&&(kt(r.prev,r,t.prev)||kt(r,t.prev,t))||is(r,t)&&kt(r.prev,r,r.next)>0&&kt(t.prev,t,t.next)>0)}function kt(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function is(r,t){return r.x===t.x&&r.y===t.y}function wh(r,t,e,i){var n=rs(kt(r,t,e)),o=rs(kt(r,t,i)),a=rs(kt(e,i,r)),h=rs(kt(e,i,t));return!!(n!==o&&a!==h||n===0&&ns(r,e,t)||o===0&&ns(r,i,t)||a===0&&ns(e,r,i)||h===0&&ns(e,t,i))}function ns(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function rs(r){return r>0?1:r<0?-1:0}function _g(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&wh(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function rr(r,t){return kt(r.prev,r,r.next)<0?kt(r,t,r.next)>=0&&kt(r,r.prev,t)>=0:kt(r,t,r.prev)<0||kt(r,r.next,t)<0}function pg(r,t){var e=r,i=!1,n=(r.x+t.x)/2,o=(r.y+t.y)/2;do e.y>o!=e.next.y>o&&e.next.y!==e.y&&n<(e.next.x-e.x)*(o-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==r);return i}function Lh(r,t){var e=new Yo(r.i,r.x,r.y),i=new Yo(t.i,t.x,t.y),n=r.next,o=t.prev;return r.next=t,t.prev=r,e.next=n,n.prev=e,i.next=e,e.prev=i,o.next=i,i.prev=o,i}function bh(r,t,e,i){var n=new Yo(r,t,e);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function sr(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Yo(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}es.deviation=function(r,t,e,i){var n=t&&t.length,o=n?t[0]*e:r.length,a=Math.abs(Ko(r,0,o,e));if(n)for(var h=0,c=t.length;h<c;h++){var d=t[h]*e,f=h<c-1?t[h+1]*e:r.length;a-=Math.abs(Ko(r,d,f,e))}var _=0;for(h=0;h<i.length;h+=3){var m=i[h]*e,E=i[h+1]*e,v=i[h+2]*e;_+=Math.abs((r[m]-r[v])*(r[E+1]-r[m+1])-(r[m]-r[E])*(r[v+1]-r[m+1]))}return a===0&&_===0?0:Math.abs((_-a)/a)};function Ko(r,t,e,i){for(var n=0,o=t,a=e-i;o<e;o+=i)n+=(r[a]-r[o])*(r[o+1]+r[a+1]),a=o;return n}es.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},i=0,n=0;n<r.length;n++){for(var o=0;o<r[n].length;o++)for(var a=0;a<t;a++)e.vertices.push(r[n][o][a]);n>0&&(i+=r[n-1].length,e.holes.push(i))}return e};const hL="";var mg={exports:{}};const Th=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],$e=(()=>{if(typeof document>"u")return!1;const r=Th[0],t={};for(const e of Th)if((e==null?void 0:e[1])in document){for(const[n,o]of e.entries())t[r[n]]=o;return t}return!1})(),Ch={change:$e.fullscreenchange,error:$e.fullscreenerror};let fe={request(r=document.documentElement,t){return new Promise((e,i)=>{const n=()=>{fe.off("change",n),e()};fe.on("change",n);const o=r[$e.requestFullscreen](t);o instanceof Promise&&o.then(n).catch(i)})},exit(){return new Promise((r,t)=>{if(!fe.isFullscreen){r();return}const e=()=>{fe.off("change",e),r()};fe.on("change",e);const i=document[$e.exitFullscreen]();i instanceof Promise&&i.then(e).catch(t)})},toggle(r,t){return fe.isFullscreen?fe.exit():fe.request(r,t)},onchange(r){fe.on("change",r)},onerror(r){fe.on("error",r)},on(r,t){const e=Ch[r];e&&document.addEventListener(e,t,!1)},off(r,t){const e=Ch[r];e&&document.removeEventListener(e,t,!1)},raw:$e};Object.defineProperties(fe,{isFullscreen:{get:()=>!!document[$e.fullscreenElement]},element:{enumerable:!0,get:()=>document[$e.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>!!document[$e.fullscreenEnabled]}}),$e||(fe={isEnabled:!1});const yg=lh(Object.freeze(Object.defineProperty({__proto__:null,default:fe},Symbol.toStringTag,{value:"Module"})));/*!
5
5
  * Based on package 'screenfull'
6
6
  * v5.2.0 - 2021-11-03
7
7
  * (c) Sindre Sorhus; MIT License
8
8
  * Added definition for using screenfull as an amd module
9
9
  * Must be placed before the definition of leaflet.fullscreen
10
10
  * as it is required by that
11
- */(function(r){(function(t,e){r.exports?r.exports.screenfull=e():t.screenfull=e()})(typeof self<"u"?self:qe,function(){var t=typeof window<"u"&&typeof window.document<"u"?window.document:{},e=function(){for(var o,a=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],h=0,c=a.length,d={};h<c;h++)if(o=a[h],o&&o[1]in t){for(h=0;h<o.length;h++)d[a[0][h]]=o[h];return d}return!1}(),i={change:e.fullscreenchange,error:e.fullscreenerror},n={request:function(o,a){return new Promise((function(h,c){var d=(function(){this.off("change",d),h()}).bind(this);this.on("change",d),o=o||t.documentElement;var f=o[e.requestFullscreen](a);f instanceof Promise&&f.then(d).catch(c)}).bind(this))},exit:function(){return new Promise((function(o,a){if(!this.isFullscreen){o();return}var h=(function(){this.off("change",h),o()}).bind(this);this.on("change",h);var c=t[e.exitFullscreen]();c instanceof Promise&&c.then(h).catch(a)}).bind(this))},toggle:function(o,a){return this.isFullscreen?this.exit():this.request(o,a)},onchange:function(o){this.on("change",o)},onerror:function(o){this.on("error",o)},on:function(o,a){var h=i[o];h&&t.addEventListener(h,a,!1)},off:function(o,a){var h=i[o];h&&t.removeEventListener(h,a,!1)},raw:e};return e?(Object.defineProperties(n,{isFullscreen:{get:function(){return!!t[e.fullscreenElement]}},element:{enumerable:!0,get:function(){return t[e.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return!!t[e.fullscreenEnabled]}}}),n):{isEnabled:!1}});/*!
11
+ */(function(r){(function(t,e){r.exports?r.exports.screenfull=e():t.screenfull=e()})(typeof self<"u"?self:De,function(){var t=typeof window<"u"&&typeof window.document<"u"?window.document:{},e=function(){for(var o,a=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],h=0,c=a.length,d={};h<c;h++)if(o=a[h],o&&o[1]in t){for(h=0;h<o.length;h++)d[a[0][h]]=o[h];return d}return!1}(),i={change:e.fullscreenchange,error:e.fullscreenerror},n={request:function(o,a){return new Promise((function(h,c){var d=(function(){this.off("change",d),h()}).bind(this);this.on("change",d),o=o||t.documentElement;var f=o[e.requestFullscreen](a);f instanceof Promise&&f.then(d).catch(c)}).bind(this))},exit:function(){return new Promise((function(o,a){if(!this.isFullscreen){o();return}var h=(function(){this.off("change",h),o()}).bind(this);this.on("change",h);var c=t[e.exitFullscreen]();c instanceof Promise&&c.then(h).catch(a)}).bind(this))},toggle:function(o,a){return this.isFullscreen?this.exit():this.request(o,a)},onchange:function(o){this.on("change",o)},onerror:function(o){this.on("error",o)},on:function(o,a){var h=i[o];h&&t.addEventListener(h,a,!1)},off:function(o,a){var h=i[o];h&&t.removeEventListener(h,a,!1)},raw:e};return e?(Object.defineProperties(n,{isFullscreen:{get:function(){return!!t[e.fullscreenElement]}},element:{enumerable:!0,get:function(){return t[e.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return!!t[e.fullscreenEnabled]}}}),n):{isEnabled:!1}});/*!
12
12
  * leaflet.fullscreen
13
- */(function(t,e){r.exports?r.exports=e(Th(),Fg):e(t.L,t.screenfull)})(typeof self<"u"?self:qe,function(t,e){return t.Control.FullScreen=t.Control.extend({options:{position:"topleft",title:"Full Screen",titleCancel:"Exit Full Screen",forceSeparateButton:!1,forcePseudoFullscreen:!1,fullscreenElement:!1},_screenfull:e,onAdd:function(i){var n="leaflet-control-zoom-fullscreen",o,a="";return i.zoomControl&&!this.options.forceSeparateButton?o=i.zoomControl._container:o=t.DomUtil.create("div","leaflet-bar"),this.options.content?a=this.options.content:n+=" fullscreen-icon",this._createButton(this.options.title,n,a,o,this.toggleFullScreen,this),this._map.fullscreenControl=this,this._map.on("enterFullscreen exitFullscreen",this._toggleState,this),o},onRemove:function(){t.DomEvent.off(this.link,"click",t.DomEvent.stop).off(this.link,"click",this.toggleFullScreen,this),this._screenfull.isEnabled&&(t.DomEvent.off(this._container,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).off(this._container,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,this),t.DomEvent.off(document,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).off(document,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,this))},_createButton:function(i,n,o,a,h,c){return this.link=t.DomUtil.create("a",n,a),this.link.href="#",this.link.title=i,this.link.innerHTML=o,this.link.setAttribute("role","button"),this.link.setAttribute("aria-label",i),L.DomEvent.disableClickPropagation(a),t.DomEvent.on(this.link,"click",t.DomEvent.stop).on(this.link,"click",h,c),this._screenfull.isEnabled&&(t.DomEvent.on(a,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).on(a,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,c),t.DomEvent.on(document,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).on(document,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,c)),this.link},toggleFullScreen:function(){var i=this._map;i._exitFired=!1,i._isFullscreen?(this._screenfull.isEnabled&&!this.options.forcePseudoFullscreen?this._screenfull.exit():(t.DomUtil.removeClass(this.options.fullscreenElement?this.options.fullscreenElement:i._container,"leaflet-pseudo-fullscreen"),i.invalidateSize()),i.fire("exitFullscreen"),i._exitFired=!0,i._isFullscreen=!1):(this._screenfull.isEnabled&&!this.options.forcePseudoFullscreen?this._screenfull.request(this.options.fullscreenElement?this.options.fullscreenElement:i._container):(t.DomUtil.addClass(this.options.fullscreenElement?this.options.fullscreenElement:i._container,"leaflet-pseudo-fullscreen"),i.invalidateSize()),i.fire("enterFullscreen"),i._isFullscreen=!0)},_toggleState:function(){this.link.title=this._map._isFullscreen?this.options.title:this.options.titleCancel,this._map._isFullscreen?L.DomUtil.removeClass(this.link,"leaflet-fullscreen-on"):L.DomUtil.addClass(this.link,"leaflet-fullscreen-on")},_handleFullscreenChange:function(){var i=this._map;i.invalidateSize(),!this._screenfull.isFullscreen&&!i._exitFired&&(i.fire("exitFullscreen"),i._exitFired=!0,i._isFullscreen=!1)}}),t.Map.include({toggleFullscreen:function(){this.fullscreenControl.toggleFullScreen()}}),t.Map.addInitHook(function(){this.options.fullscreenControl&&this.addControl(t.control.fullscreen(this.options.fullscreenControlOptions))}),t.control.fullscreen=function(i){return new t.Control.FullScreen(i)},{leaflet:t,screenfull:e}})})(Og);const zg=G.defineComponent({name:"CoordinatesVerifyPolygon",props:{dataPolygon:Object,iconMarker:Object,coordinatesMap:Array,checkPointInPolygon:Function},data(){return{markerIconDefault:{iconUrl:ss,iconSize:[25,41],iconAnchor:[12,41]}}},mounted(){this.verificarPuntoEnPoligono()},methods:{verificarPuntoEnPoligono(){var f;const r=this.iconMarker?this.iconMarker:this.markerIconDefault,t=(f=this.dataPolygon)==null?void 0:f.geometry.coordinates[0].map(_=>[_[1],_[0]]),e=JSON.parse(JSON.stringify(t)),i=[this.coordinatesMap?this.coordinatesMap[0]:0,this.coordinatesMap?this.coordinatesMap[1]:0],n=pt.map("maps",{fullscreenControl:!0}).setView([this.coordinatesMap?this.coordinatesMap[0]:0,this.coordinatesMap?this.coordinatesMap[1]:0],this.coordinatesMap?this.coordinatesMap[2]:0);pt.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(n),pt.polygon(e).addTo(n);const o=[this.coordinatesMap?this.coordinatesMap[0]:0,this.coordinatesMap?this.coordinatesMap[1]:0],a=pt.icon(r);pt.marker(o,{icon:a}).addTo(n);const h=ag(i),c=lg([t]),d=yg(h,c);this.checkPointInPolygon&&this.checkPointInPolygon(d)}}}),RL="",ra=(r,t)=>{const e=r.__vccOpts||r;for(const[i,n]of t)e[i]=n;return e},Ng={ref:"maps",id:"maps"};function Bg(r,t,e,i,n,o){return G.openBlock(),G.createElementBlock("div",Ng,null,512)}const Gg=ra(zg,[["render",Bg]]);(function(r,t,e){function i(n,o){for(;(n=n.parentElement)&&!n.classList.contains(o););return n}L.drawVersion="1.0.4",L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes",text:"Save"},cancel:{title:"Cancel editing, discards all changes",text:"Cancel"},clearAll:{title:"Clear all layers",text:"Clear All"}},buttons:{edit:"Edit layers",editDisabled:"No layers to edit",remove:"Delete layers",removeDisabled:"No layers to delete"}},handlers:{edit:{tooltip:{text:"Drag handles or markers to edit features.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove."}}}}},L.Draw.Event={},L.Draw.Event.CREATED="draw:created",L.Draw.Event.EDITED="draw:edited",L.Draw.Event.DELETED="draw:deleted",L.Draw.Event.DRAWSTART="draw:drawstart",L.Draw.Event.DRAWSTOP="draw:drawstop",L.Draw.Event.DRAWVERTEX="draw:drawvertex",L.Draw.Event.EDITSTART="draw:editstart",L.Draw.Event.EDITMOVE="draw:editmove",L.Draw.Event.EDITRESIZE="draw:editresize",L.Draw.Event.EDITVERTEX="draw:editvertex",L.Draw.Event.EDITSTOP="draw:editstop",L.Draw.Event.DELETESTART="draw:deletestart",L.Draw.Event.DELETESTOP="draw:deletestop",L.Draw.Event.TOOLBAROPENED="draw:toolbaropened",L.Draw.Event.TOOLBARCLOSED="draw:toolbarclosed",L.Draw.Event.MARKERCONTEXT="draw:markercontext",L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({initialize:function(n,o){this._map=n,this._container=n._container,this._overlayPane=n._panes.overlayPane,this._popupPane=n._panes.popupPane,o&&o.shapeOptions&&(o.shapeOptions=L.Util.extend({},this.options.shapeOptions,o.shapeOptions)),L.setOptions(this,o);var a=L.version.split(".");parseInt(a[0],10)===1&&parseInt(a[1],10)>=2?L.Draw.Feature.include(L.Evented.prototype):L.Draw.Feature.include(L.Mixin.Events)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(L.DomUtil.disableTextSelection(),n.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,"keyup",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,"keyup",this._cancelDrawing,this))},setOptions:function(n){L.setOptions(this,n)},_fireCreatedEvent:function(n){this._map.fire(L.Draw.Event.CREATED,{layer:n,layerType:this.type})},_cancelDrawing:function(n){n.keyCode===27&&(this._map.fire("draw:canceled",{layerType:this.type}),this.disable())}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:"polyline"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},initialize:function(n,o){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,o&&o.drawError&&(o.drawError=L.Util.extend({},this.options.drawError,o.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,n,o)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("mouseout",this._onMouseOut,this).on("mousemove",this._onMouseMove,this).on("mousedown",this._onMouseDown,this).on("mouseup",this._onMouseUp,this).addTo(this._map),this._map.on("mouseup",this._onMouseUp,this).on("mousemove",this._onMouseMove,this).on("zoomlevelschange",this._onZoomEnd,this).on("touchstart",this._onTouch,this).on("zoomend",this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._clearHideErrorTimeout(),this._cleanUpShape(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,this._map.removeLayer(this._poly),delete this._poly,this._mouseMarker.off("mousedown",this._onMouseDown,this).off("mouseout",this._onMouseOut,this).off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._clearGuides(),this._map.off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this).off("zoomlevelschange",this._onZoomEnd,this).off("zoomend",this._onZoomEnd,this).off("touchstart",this._onTouch,this).off("click",this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var n=this._markers.pop(),o=this._poly,a=o.getLatLngs(),h=a.splice(-1,1)[0];this._poly.setLatLngs(a),this._markerGroup.removeLayer(n),o.getLatLngs().length<2&&this._map.removeLayer(o),this._vertexChanged(h,!1)}},addVertex:function(n){if(this._markers.length>=2&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(n))return void this._showErrorTooltip();this._errorShown&&this._hideErrorTooltip(),this._markers.push(this._createMarker(n)),this._poly.addLatLng(n),this._poly.getLatLngs().length===2&&this._map.addLayer(this._poly),this._vertexChanged(n,!0)},completeShape:function(){this._markers.length<=1||!this._shapeIsValid()||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_finishShape:function(){var n=this._poly._defaultShape?this._poly._defaultShape():this._poly.getLatLngs(),o=this._poly.newLatLngIntersects(n[n.length-1]);if(!this.options.allowIntersection&&o||!this._shapeIsValid())return void this._showErrorTooltip();this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_shapeIsValid:function(){return!0},_onZoomEnd:function(){this._markers!==null&&this._updateGuide()},_onMouseMove:function(n){var o=this._map.mouseEventToLayerPoint(n.originalEvent),a=this._map.layerPointToLatLng(o);this._currentLatLng=a,this._updateTooltip(a),this._updateGuide(o),this._mouseMarker.setLatLng(a),L.DomEvent.preventDefault(n.originalEvent)},_vertexChanged:function(n,o){this._map.fire(L.Draw.Event.DRAWVERTEX,{layers:this._markerGroup}),this._updateFinishHandler(),this._updateRunningMeasure(n,o),this._clearGuides(),this._updateTooltip()},_onMouseDown:function(n){if(!this._clickHandled&&!this._touchHandled&&!this._disableMarkers){this._onMouseMove(n),this._clickHandled=!0,this._disableNewMarkers();var o=n.originalEvent,a=o.clientX,h=o.clientY;this._startPoint.call(this,a,h)}},_startPoint:function(n,o){this._mouseDownOrigin=L.point(n,o)},_onMouseUp:function(n){var o=n.originalEvent,a=o.clientX,h=o.clientY;this._endPoint.call(this,a,h,n),this._clickHandled=null},_endPoint:function(n,o,a){if(this._mouseDownOrigin){var h=L.point(n,o).distanceTo(this._mouseDownOrigin),c=this._calculateFinishDistance(a.latlng);this.options.maxPoints>1&&this.options.maxPoints==this._markers.length+1?(this.addVertex(a.latlng),this._finishShape()):c<10&&L.Browser.touch?this._finishShape():Math.abs(h)<9*(r.devicePixelRatio||1)&&this.addVertex(a.latlng),this._enableNewMarkers()}this._mouseDownOrigin=null},_onTouch:function(n){var o,a,h=n.originalEvent;!h.touches||!h.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(o=h.touches[0].clientX,a=h.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,o,a),this._endPoint.call(this,o,a,n),this._touchHandled=null),this._clickHandled=null},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_calculateFinishDistance:function(n){var o;if(this._markers.length>0){var a;if(this.type===L.Draw.Polyline.TYPE)a=this._markers[this._markers.length-1];else{if(this.type!==L.Draw.Polygon.TYPE)return 1/0;a=this._markers[0]}var h=this._map.latLngToContainerPoint(a.getLatLng()),c=new L.Marker(n,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),d=this._map.latLngToContainerPoint(c.getLatLng());o=h.distanceTo(d)}else o=1/0;return o},_updateFinishHandler:function(){var n=this._markers.length;n>1&&this._markers[n-1].on("click",this._finishShape,this),n>2&&this._markers[n-2].off("click",this._finishShape,this)},_createMarker:function(n){var o=new L.Marker(n,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(o),o},_updateGuide:function(n){var o=this._markers?this._markers.length:0;o>0&&(n=n||this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[o-1].getLatLng()),n))},_updateTooltip:function(n){var o=this._getTooltipText();n&&this._tooltip.updatePosition(n),this._errorShown||this._tooltip.updateContent(o)},_drawGuide:function(n,o){var a,h,c,d=Math.floor(Math.sqrt(Math.pow(o.x-n.x,2)+Math.pow(o.y-n.y,2))),f=this.options.guidelineDistance,_=this.options.maxGuideLineLength,m=d>_?d-_:f;for(this._guidesContainer||(this._guidesContainer=L.DomUtil.create("div","leaflet-draw-guides",this._overlayPane));m<d;m+=this.options.guidelineDistance)a=m/d,h={x:Math.floor(n.x*(1-a)+a*o.x),y:Math.floor(n.y*(1-a)+a*o.y)},c=L.DomUtil.create("div","leaflet-draw-guide-dash",this._guidesContainer),c.style.backgroundColor=this._errorShown?this.options.drawError.color:this.options.shapeOptions.color,L.DomUtil.setPosition(c,h)},_updateGuideColor:function(n){if(this._guidesContainer)for(var o=0,a=this._guidesContainer.childNodes.length;o<a;o++)this._guidesContainer.childNodes[o].style.backgroundColor=n},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var n,o,a=this.options.showLength;return this._markers.length===0?n={text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(o=a?this._getMeasurementString():"",n=this._markers.length===1?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:o}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:o}),n},_updateRunningMeasure:function(n,o){var a,h,c=this._markers.length;this._markers.length===1?this._measurementRunningTotal=0:(a=c-(o?2:1),h=L.GeometryUtil.isVersion07x()?n.distanceTo(this._markers[a].getLatLng())*(this.options.factor||1):this._map.distance(n,this._markers[a].getLatLng())*(this.options.factor||1),this._measurementRunningTotal+=h*(o?1:-1))},_getMeasurementString:function(){var n,o=this._currentLatLng,a=this._markers[this._markers.length-1].getLatLng();return n=L.GeometryUtil.isVersion07x()?a&&o&&o.distanceTo?this._measurementRunningTotal+o.distanceTo(a)*(this.options.factor||1):this._measurementRunningTotal||0:a&&o?this._measurementRunningTotal+this._map.distance(o,a)*(this.options.factor||1):this._measurementRunningTotal||0,L.GeometryUtil.readableDistance(n,this.options.metric,this.options.feet,this.options.nautic,this.options.precision)},_showErrorTooltip:function(){this._errorShown=!0,this._tooltip.showAsError().updateContent({text:this.options.drawError.message}),this._updateGuideColor(this.options.drawError.color),this._poly.setStyle({color:this.options.drawError.color}),this._clearHideErrorTimeout(),this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1,this._clearHideErrorTimeout(),this._tooltip.removeError().updateContent(this._getTooltipText()),this._updateGuideColor(this.options.shapeOptions.color),this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&(clearTimeout(this._hideErrorTimeout),this._hideErrorTimeout=null)},_disableNewMarkers:function(){this._disableMarkers=!0},_enableNewMarkers:function(){setTimeout((function(){this._disableMarkers=!1}).bind(this),50)},_cleanUpShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off("click",this._finishShape,this)},_fireCreatedEvent:function(){var n=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)}}),L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:"polygon"},Poly:L.Polygon,options:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},initialize:function(n,o){L.Draw.Polyline.prototype.initialize.call(this,n,o),this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var n=this._markers.length;n===1&&this._markers[0].on("click",this._finishShape,this),n>2&&(this._markers[n-1].on("dblclick",this._finishShape,this),n>3&&this._markers[n-2].off("dblclick",this._finishShape,this))},_getTooltipText:function(){var n,o;return this._markers.length===0?n=L.drawLocal.draw.handlers.polygon.tooltip.start:this._markers.length<3?(n=L.drawLocal.draw.handlers.polygon.tooltip.cont,o=this._getMeasurementString()):(n=L.drawLocal.draw.handlers.polygon.tooltip.end,o=this._getMeasurementString()),{text:n,subtext:o}},_getMeasurementString:function(){var n=this._area,o="";return n||this.options.showLength?(this.options.showLength&&(o=L.Draw.Polyline.prototype._getMeasurementString.call(this)),n&&(o+="<br>"+L.GeometryUtil.readableArea(n,this.options.metric,this.options.precision)),o):null},_shapeIsValid:function(){return this._markers.length>=3},_vertexChanged:function(n,o){var a;!this.options.allowIntersection&&this.options.showArea&&(a=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(a)),L.Draw.Polyline.prototype._vertexChanged.call(this,n,o)},_cleanUpShape:function(){var n=this._markers.length;n>0&&(this._markers[0].off("click",this._finishShape,this),n>2&&this._markers[n-1].off("dblclick",this._finishShape,this))}}),L.SimpleShape={},L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(n,o){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end,L.Draw.Feature.prototype.initialize.call(this,n,o)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor="crosshair",this._tooltip.updateContent({text:this._initialLabelText}),this._map.on("mousedown",this._onMouseDown,this).on("mousemove",this._onMouseMove,this).on("touchstart",this._onMouseDown,this).on("touchmove",this._onMouseMove,this),t.addEventListener("touchstart",L.DomEvent.preventDefault,{passive:!1}))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor="",this._map.off("mousedown",this._onMouseDown,this).off("mousemove",this._onMouseMove,this).off("touchstart",this._onMouseDown,this).off("touchmove",this._onMouseMove,this),L.DomEvent.off(t,"mouseup",this._onMouseUp,this),L.DomEvent.off(t,"touchend",this._onMouseUp,this),t.removeEventListener("touchstart",L.DomEvent.preventDefault),this._shape&&(this._map.removeLayer(this._shape),delete this._shape)),this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(n){this._isDrawing=!0,this._startLatLng=n.latlng,L.DomEvent.on(t,"mouseup",this._onMouseUp,this).on(t,"touchend",this._onMouseUp,this).preventDefault(n.originalEvent)},_onMouseMove:function(n){var o=n.latlng;this._tooltip.updatePosition(o),this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(o))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()}}),L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:"rectangle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showArea:!0,metric:!0},initialize:function(n,o){this.type=L.Draw.Rectangle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,n,o)},disable:function(){this._enabled&&(this._isCurrentlyTwoClickDrawing=!1,L.Draw.SimpleShape.prototype.disable.call(this))},_onMouseUp:function(n){if(!this._shape&&!this._isCurrentlyTwoClickDrawing)return void(this._isCurrentlyTwoClickDrawing=!0);this._isCurrentlyTwoClickDrawing&&!i(n.target,"leaflet-pane")||L.Draw.SimpleShape.prototype._onMouseUp.call(this)},_drawShape:function(n){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,n)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,n),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var n=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,n)},_getTooltipText:function(){var n,o,a,h=L.Draw.SimpleShape.prototype._getTooltipText.call(this),c=this._shape,d=this.options.showArea;return c&&(n=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),o=L.GeometryUtil.geodesicArea(n),a=d?L.GeometryUtil.readableArea(o,this.options.metric):""),{text:h.text,subtext:a}}}),L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:"marker"},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(n,o){this.type=L.Draw.Marker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.marker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,n,o)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._tooltip.updateContent({text:this._initialLabelText}),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("click",this._onClick,this).addTo(this._map),this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._map.off("click",this._onClick,this).off("click",this._onTouch,this),this._marker&&(this._marker.off("click",this._onClick,this),this._map.removeLayer(this._marker),delete this._marker),this._mouseMarker.off("click",this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off("mousemove",this._onMouseMove,this))},_onMouseMove:function(n){var o=n.latlng;this._tooltip.updatePosition(o),this._mouseMarker.setLatLng(o),this._marker?(o=this._mouseMarker.getLatLng(),this._marker.setLatLng(o)):(this._marker=this._createMarker(o),this._marker.on("click",this._onClick,this),this._map.on("click",this._onClick,this).addLayer(this._marker))},_createMarker:function(n){return new L.Marker(n,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset})},_onClick:function(){this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_onTouch:function(n){this._onMouseMove(n),this._onClick()},_fireCreatedEvent:function(){var n=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)}}),L.Draw.CircleMarker=L.Draw.Marker.extend({statics:{TYPE:"circlemarker"},options:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0,zIndexOffset:2e3},initialize:function(n,o){this.type=L.Draw.CircleMarker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circlemarker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,n,o)},_fireCreatedEvent:function(){var n=new L.CircleMarker(this._marker.getLatLng(),this.options);L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)},_createMarker:function(n){return new L.CircleMarker(n,this.options)}}),L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:"circle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},initialize:function(n,o){this.type=L.Draw.Circle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,n,o)},_drawShape:function(n){if(L.GeometryUtil.isVersion07x())var o=this._startLatLng.distanceTo(n);else var o=this._map.distance(this._startLatLng,n);this._shape?this._shape.setRadius(o):(this._shape=new L.Circle(this._startLatLng,o,this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var n=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,n)},_onMouseMove:function(n){var o,a=n.latlng,h=this.options.showRadius,c=this.options.metric;if(this._tooltip.updatePosition(a),this._isDrawing){this._drawShape(a),o=this._shape.getRadius().toFixed(1);var d="";h&&(d=L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(o,c,this.options.feet,this.options.nautic)),this._tooltip.updateContent({text:this._endLabelText,subtext:d})}}}),L.Edit=L.Edit||{},L.Edit.Marker=L.Handler.extend({initialize:function(n,o){this._marker=n,L.setOptions(this,o)},addHooks:function(){var n=this._marker;n.dragging.enable(),n.on("dragend",this._onDragEnd,n),this._toggleMarkerHighlight()},removeHooks:function(){var n=this._marker;n.dragging.disable(),n.off("dragend",this._onDragEnd,n),this._toggleMarkerHighlight()},_onDragEnd:function(n){var o=n.target;o.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:o})},_toggleMarkerHighlight:function(){var n=this._marker._icon;n&&(n.style.display="none",L.DomUtil.hasClass(n,"leaflet-edit-marker-selected")?(L.DomUtil.removeClass(n,"leaflet-edit-marker-selected"),this._offsetMarker(n,-4)):(L.DomUtil.addClass(n,"leaflet-edit-marker-selected"),this._offsetMarker(n,4)),n.style.display="")},_offsetMarker:function(n,o){var a=parseInt(n.style.marginTop,10)-o,h=parseInt(n.style.marginLeft,10)-o;n.style.marginTop=a+"px",n.style.marginLeft=h+"px"}}),L.Marker.addInitHook(function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.Poly=L.Handler.extend({initialize:function(n){this.latlngs=[n._latlngs],n._holes&&(this.latlngs=this.latlngs.concat(n._holes)),this._poly=n,this._poly.on("revert-edited",this._updateLatLngs,this)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._poly._latlngs)?this._poly._latlngs:this._poly._latlngs[0]:this._poly._latlngs},_eachVertexHandler:function(n){for(var o=0;o<this._verticesHandlers.length;o++)n(this._verticesHandlers[o])},addHooks:function(){this._initHandlers(),this._eachVertexHandler(function(n){n.addHooks()})},removeHooks:function(){this._eachVertexHandler(function(n){n.removeHooks()})},updateMarkers:function(){this._eachVertexHandler(function(n){n.updateMarkers()})},_initHandlers:function(){this._verticesHandlers=[];for(var n=0;n<this.latlngs.length;n++)this._verticesHandlers.push(new L.Edit.PolyVerticesEdit(this._poly,this.latlngs[n],this._poly.options.poly))},_updateLatLngs:function(n){this.latlngs=[n.layer._latlngs],n.layer._holes&&(this.latlngs=this.latlngs.concat(n.layer._holes))}}),L.Edit.PolyVerticesEdit=L.Handler.extend({options:{icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),drawError:{color:"#b00b00",timeout:1e3}},initialize:function(n,o,a){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this._poly=n,a&&a.drawError&&(a.drawError=L.Util.extend({},this.options.drawError,a.drawError)),this._latlngs=o,L.setOptions(this,a)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]:this._latlngs},addHooks:function(){var n=this._poly,o=n._path;n instanceof L.Polygon||(n.options.fill=!1,n.options.editing&&(n.options.editing.fill=!1)),o&&n.options.editing&&n.options.editing.className&&(n.options.original.className&&n.options.original.className.split(" ").forEach(function(a){L.DomUtil.removeClass(o,a)}),n.options.editing.className.split(" ").forEach(function(a){L.DomUtil.addClass(o,a)})),n.setStyle(n.options.editing),this._poly._map&&(this._map=this._poly._map,this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var n=this._poly,o=n._path;o&&n.options.editing&&n.options.editing.className&&(n.options.editing.className.split(" ").forEach(function(a){L.DomUtil.removeClass(o,a)}),n.options.original.className&&n.options.original.className.split(" ").forEach(function(a){L.DomUtil.addClass(o,a)})),n.setStyle(n.options.original),n._map&&(n._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._markers=[];var n,o,a,h,c=this._defaultShape();for(n=0,a=c.length;n<a;n++)h=this._createMarker(c[n],n),h.on("click",this._onMarkerClick,this),h.on("contextmenu",this._onContextMenu,this),this._markers.push(h);var d,f;for(n=0,o=a-1;n<a;o=n++)(n!==0||L.Polygon&&this._poly instanceof L.Polygon)&&(d=this._markers[o],f=this._markers[n],this._createMiddleMarker(d,f),this._updatePrevNext(d,f))},_createMarker:function(n,o){var a=new L.Marker.Touch(n,{draggable:!0,icon:this.options.icon});return a._origLatLng=n,a._index=o,a.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._fireEdit,this).on("touchmove",this._onTouchMove,this).on("touchend",this._fireEdit,this).on("MSPointerMove",this._onTouchMove,this).on("MSPointerUp",this._fireEdit,this),this._markerGroup.addLayer(a),a},_onMarkerDragStart:function(){this._poly.fire("editstart")},_spliceLatLngs:function(){var n=this._defaultShape(),o=[].splice.apply(n,arguments);return this._poly._convertLatLngs(n,!0),this._poly.redraw(),o},_removeMarker:function(n){var o=n._index;this._markerGroup.removeLayer(n),this._markers.splice(o,1),this._spliceLatLngs(o,1),this._updateIndexes(o,-1),n.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._fireEdit,this).off("touchmove",this._onMarkerDrag,this).off("touchend",this._fireEdit,this).off("click",this._onMarkerClick,this).off("MSPointerMove",this._onTouchMove,this).off("MSPointerUp",this._fireEdit,this)},_fireEdit:function(){this._poly.edited=!0,this._poly.fire("edit"),this._poly._map.fire(L.Draw.Event.EDITVERTEX,{layers:this._markerGroup,poly:this._poly})},_onMarkerDrag:function(n){var o=n.target,a=this._poly,h=L.LatLngUtil.cloneLatLng(o._origLatLng);if(L.extend(o._origLatLng,o._latlng),a.options.poly){var c=a._map._editTooltip;if(!a.options.poly.allowIntersection&&a.intersects()){L.extend(o._origLatLng,h),o.setLatLng(h);var d=a.options.color;a.setStyle({color:this.options.drawError.color}),c&&c.updateContent({text:L.drawLocal.draw.handlers.polyline.error}),setTimeout(function(){a.setStyle({color:d}),c&&c.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext})},1e3)}}o._middleLeft&&o._middleLeft.setLatLng(this._getMiddleLatLng(o._prev,o)),o._middleRight&&o._middleRight.setLatLng(this._getMiddleLatLng(o,o._next)),this._poly._bounds._southWest=L.latLng(1/0,1/0),this._poly._bounds._northEast=L.latLng(-1/0,-1/0);var f=this._poly.getLatLngs();this._poly._convertLatLngs(f,!0),this._poly.redraw(),this._poly.fire("editdrag")},_onMarkerClick:function(n){var o=L.Polygon&&this._poly instanceof L.Polygon?4:3,a=n.target;this._defaultShape().length<o||(this._removeMarker(a),this._updatePrevNext(a._prev,a._next),a._middleLeft&&this._markerGroup.removeLayer(a._middleLeft),a._middleRight&&this._markerGroup.removeLayer(a._middleRight),a._prev&&a._next?this._createMiddleMarker(a._prev,a._next):a._prev?a._next||(a._prev._middleRight=null):a._next._middleLeft=null,this._fireEdit())},_onContextMenu:function(n){var o=n.target;this._poly,this._poly._map.fire(L.Draw.Event.MARKERCONTEXT,{marker:o,layers:this._markerGroup,poly:this._poly}),L.DomEvent.stopPropagation},_onTouchMove:function(n){var o=this._map.mouseEventToLayerPoint(n.originalEvent.touches[0]),a=this._map.layerPointToLatLng(o),h=n.target;L.extend(h._origLatLng,a),h._middleLeft&&h._middleLeft.setLatLng(this._getMiddleLatLng(h._prev,h)),h._middleRight&&h._middleRight.setLatLng(this._getMiddleLatLng(h,h._next)),this._poly.redraw(),this.updateMarkers()},_updateIndexes:function(n,o){this._markerGroup.eachLayer(function(a){a._index>n&&(a._index+=o)})},_createMiddleMarker:function(n,o){var a,h,c,d=this._getMiddleLatLng(n,o),f=this._createMarker(d);f.setOpacity(.6),n._middleRight=o._middleLeft=f,h=function(){f.off("touchmove",h,this);var _=o._index;f._index=_,f.off("click",a,this).on("click",this._onMarkerClick,this),d.lat=f.getLatLng().lat,d.lng=f.getLatLng().lng,this._spliceLatLngs(_,0,d),this._markers.splice(_,0,f),f.setOpacity(1),this._updateIndexes(_,1),o._index++,this._updatePrevNext(n,f),this._updatePrevNext(f,o),this._poly.fire("editstart")},c=function(){f.off("dragstart",h,this),f.off("dragend",c,this),f.off("touchmove",h,this),this._createMiddleMarker(n,f),this._createMiddleMarker(f,o)},a=function(){h.call(this),c.call(this),this._fireEdit()},f.on("click",a,this).on("dragstart",h,this).on("dragend",c,this).on("touchmove",h,this),this._markerGroup.addLayer(f)},_updatePrevNext:function(n,o){n&&(n._next=o),o&&(o._prev=n)},_getMiddleLatLng:function(n,o){var a=this._poly._map,h=a.project(n.getLatLng()),c=a.project(o.getLatLng());return a.unproject(h._add(c)._divideBy(2))}}),L.Polyline.addInitHook(function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))}),L.Edit=L.Edit||{},L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move"}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize"}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon"}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon"})},initialize:function(n,o){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon),this._shape=n,L.Util.setOptions(this,o)},addHooks:function(){var n=this._shape;this._shape._map&&(this._map=this._shape._map,n.setStyle(n.options.editing),n._map&&(this._map=n._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var n=this._shape;if(n.setStyle(n.options.original),n._map){this._unbindMarker(this._moveMarker);for(var o=0,a=this._resizeMarkers.length;o<a;o++)this._unbindMarker(this._resizeMarkers[o]);this._resizeMarkers=null,this._map.removeLayer(this._markerGroup),delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._createMoveMarker(),this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(n,o){var a=new L.Marker.Touch(n,{draggable:!0,icon:o,zIndexOffset:10});return this._bindMarker(a),this._markerGroup.addLayer(a),a},_bindMarker:function(n){n.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._onMarkerDragEnd,this).on("touchstart",this._onTouchStart,this).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onTouchEnd,this).on("MSPointerUp",this._onTouchEnd,this)},_unbindMarker:function(n){n.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._onMarkerDragEnd,this).off("touchstart",this._onTouchStart,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onTouchEnd,this).off("MSPointerUp",this._onTouchEnd,this)},_onMarkerDragStart:function(n){n.target.setOpacity(0),this._shape.fire("editstart")},_fireEdit:function(){this._shape.edited=!0,this._shape.fire("edit")},_onMarkerDrag:function(n){var o=n.target,a=o.getLatLng();o===this._moveMarker?this._move(a):this._resize(a),this._shape.redraw(),this._shape.fire("editdrag")},_onMarkerDragEnd:function(n){n.target.setOpacity(1),this._fireEdit()},_onTouchStart:function(n){if(L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,n),typeof this._getCorners=="function"){var o=this._getCorners(),a=n.target,h=a._cornerIndex;a.setOpacity(0),this._oppositeCorner=o[(h+2)%4],this._toggleCornerMarkers(0,h)}this._shape.fire("editstart")},_onTouchMove:function(n){var o=this._map.mouseEventToLayerPoint(n.originalEvent.touches[0]),a=this._map.layerPointToLatLng(o);return n.target===this._moveMarker?this._move(a):this._resize(a),this._shape.redraw(),!1},_onTouchEnd:function(n){n.target.setOpacity(1),this.updateMarkers(),this._fireEdit()},_move:function(){},_resize:function(){}}),L.Edit=L.Edit||{},L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var n=this._shape.getBounds(),o=n.getCenter();this._moveMarker=this._createMarker(o,this.options.moveIcon)},_createResizeMarker:function(){var n=this._getCorners();this._resizeMarkers=[];for(var o=0,a=n.length;o<a;o++)this._resizeMarkers.push(this._createMarker(n[o],this.options.resizeIcon)),this._resizeMarkers[o]._cornerIndex=o},_onMarkerDragStart:function(n){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,n);var o=this._getCorners(),a=n.target,h=a._cornerIndex;this._oppositeCorner=o[(h+2)%4],this._toggleCornerMarkers(0,h)},_onMarkerDragEnd:function(n){var o,a,h=n.target;h===this._moveMarker&&(o=this._shape.getBounds(),a=o.getCenter(),h.setLatLng(a)),this._toggleCornerMarkers(1),this._repositionCornerMarkers(),L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,n)},_move:function(n){for(var o,a=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),h=this._shape.getBounds(),c=h.getCenter(),d=[],f=0,_=a.length;f<_;f++)o=[a[f].lat-c.lat,a[f].lng-c.lng],d.push([n.lat+o[0],n.lng+o[1]]);this._shape.setLatLngs(d),this._repositionCornerMarkers(),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})},_resize:function(n){var o;this._shape.setBounds(L.latLngBounds(n,this._oppositeCorner)),o=this._shape.getBounds(),this._moveMarker.setLatLng(o.getCenter()),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})},_getCorners:function(){var n=this._shape.getBounds();return[n.getNorthWest(),n.getNorthEast(),n.getSouthEast(),n.getSouthWest()]},_toggleCornerMarkers:function(n){for(var o=0,a=this._resizeMarkers.length;o<a;o++)this._resizeMarkers[o].setOpacity(n)},_repositionCornerMarkers:function(){for(var n=this._getCorners(),o=0,a=this._resizeMarkers.length;o<a;o++)this._resizeMarkers[o].setLatLng(n[o])}}),L.Rectangle.addInitHook(function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.CircleMarker=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var n=this._shape.getLatLng();this._moveMarker=this._createMarker(n,this.options.moveIcon)},_createResizeMarker:function(){this._resizeMarkers=[]},_move:function(n){if(this._resizeMarkers.length){var o=this._getResizeMarkerPoint(n);this._resizeMarkers[0].setLatLng(o)}this._shape.setLatLng(n),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})}}),L.CircleMarker.addInitHook(function(){L.Edit.CircleMarker&&(this.editing=new L.Edit.CircleMarker(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),L.Edit=L.Edit||{},L.Edit.Circle=L.Edit.CircleMarker.extend({_createResizeMarker:function(){var n=this._shape.getLatLng(),o=this._getResizeMarkerPoint(n);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(o,this.options.resizeIcon))},_getResizeMarkerPoint:function(n){var o=this._shape._radius*Math.cos(Math.PI/4),a=this._map.project(n);return this._map.unproject([a.x+o,a.y-o])},_resize:function(n){var o=this._moveMarker.getLatLng();L.GeometryUtil.isVersion07x()?radius=o.distanceTo(n):radius=this._map.distance(o,n),this._shape.setRadius(radius),this._map.editTooltip&&this._map._editTooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.subtext+"<br />"+L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(radius,!0,this.options.feet,this.options.nautic)}),this._shape.setRadius(radius),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})}}),L.Circle.addInitHook(function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable())}),L.Map.mergeOptions({touchExtend:!0}),L.Map.TouchExtend=L.Handler.extend({initialize:function(n){this._map=n,this._container=n._container,this._pane=n._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.on(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.on(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.on(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.on(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.on(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.on(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.on(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.on(this._container,"touchleave",this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.off(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.off(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.off(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.off(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.off(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.off(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.off(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.off(this._container,"touchleave",this._onTouchLeave,this))},_touchEvent:function(n,o){var a={};if(n.touches!==void 0){if(!n.touches.length)return;a=n.touches[0]}else if(n.pointerType!=="touch"||(a=n,!this._filterClick(n)))return;var h=this._map.mouseEventToContainerPoint(a),c=this._map.mouseEventToLayerPoint(a),d=this._map.layerPointToLatLng(c);this._map.fire(o,{latlng:d,layerPoint:c,containerPoint:h,pageX:a.pageX,pageY:a.pageY,originalEvent:n})},_filterClick:function(n){var o=n.timeStamp||n.originalEvent.timeStamp,a=L.DomEvent._lastClick&&o-L.DomEvent._lastClick;return a&&a>100&&a<500||n.target._simulatedClick&&!n._simulated?(L.DomEvent.stop(n),!1):(L.DomEvent._lastClick=o,!0)},_onTouchStart:function(n){this._map._loaded&&this._touchEvent(n,"touchstart")},_onTouchEnd:function(n){this._map._loaded&&this._touchEvent(n,"touchend")},_onTouchCancel:function(n){if(this._map._loaded){var o="touchcancel";this._detectIE()&&(o="pointercancel"),this._touchEvent(n,o)}},_onTouchLeave:function(n){this._map._loaded&&this._touchEvent(n,"touchleave")},_onTouchMove:function(n){this._map._loaded&&this._touchEvent(n,"touchmove")},_detectIE:function(){var n=r.navigator.userAgent,o=n.indexOf("MSIE ");if(o>0)return parseInt(n.substring(o+5,n.indexOf(".",o)),10);if(n.indexOf("Trident/")>0){var a=n.indexOf("rv:");return parseInt(n.substring(a+3,n.indexOf(".",a)),10)}var h=n.indexOf("Edge/");return h>0&&parseInt(n.substring(h+5,n.indexOf(".",h)),10)}}),L.Map.addInitHook("addHandler","touchExtend",L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){return this.addInteractiveTarget?L.Marker.prototype._initInteraction.apply(this):this._initInteractionLegacy()},_initInteractionLegacy:function(){if(this.options.clickable){var n=this._icon,o=["dblclick","mousedown","mouseover","mouseout","contextmenu","touchstart","touchend","touchmove"];this._detectIE?o.concat(["MSPointerDown","MSPointerUp","MSPointerMove","MSPointerCancel"]):o.concat(["touchcancel"]),L.DomUtil.addClass(n,"leaflet-clickable"),L.DomEvent.on(n,"click",this._onMouseClick,this),L.DomEvent.on(n,"keypress",this._onKeyPress,this);for(var a=0;a<o.length;a++)L.DomEvent.on(n,o[a],this._fireMouseEvent,this);L.Handler.MarkerDrag&&(this.dragging=new L.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_detectIE:function(){var n=r.navigator.userAgent,o=n.indexOf("MSIE ");if(o>0)return parseInt(n.substring(o+5,n.indexOf(".",o)),10);if(n.indexOf("Trident/")>0){var a=n.indexOf("rv:");return parseInt(n.substring(a+3,n.indexOf(".",a)),10)}var h=n.indexOf("Edge/");return h>0&&parseInt(n.substring(h+5,n.indexOf(".",h)),10)}}),L.LatLngUtil={cloneLatLngs:function(n){for(var o=[],a=0,h=n.length;a<h;a++)Array.isArray(n[a])?o.push(L.LatLngUtil.cloneLatLngs(n[a])):o.push(this.cloneLatLng(n[a]));return o},cloneLatLng:function(n){return L.latLng(n.lat,n.lng)}},function(){var n={km:2,ha:2,m:0,mi:2,ac:2,yd:0,ft:0,nm:2};L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(o){var a,h,c=o.length,d=0,f=Math.PI/180;if(c>2){for(var _=0;_<c;_++)a=o[_],h=o[(_+1)%c],d+=(h.lng-a.lng)*f*(2+Math.sin(a.lat*f)+Math.sin(h.lat*f));d=6378137*d*6378137/2}return Math.abs(d)},formattedNumber:function(o,a){var h=parseFloat(o).toFixed(a),c=L.drawLocal.format&&L.drawLocal.format.numeric,d=c&&c.delimiters,f=d&&d.thousands,_=d&&d.decimal;if(f||_){var m=h.split(".");h=f?m[0].replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f):m[0],_=_||".",m.length>1&&(h=h+_+m[1])}return h},readableArea:function(o,a,f){var c,d,f=L.Util.extend({},n,f);return a?(d=["ha","m"],type=typeof a,type==="string"?d=[a]:type!=="boolean"&&(d=a),c=o>=1e6&&d.indexOf("km")!==-1?L.GeometryUtil.formattedNumber(1e-6*o,f.km)+" km²":o>=1e4&&d.indexOf("ha")!==-1?L.GeometryUtil.formattedNumber(1e-4*o,f.ha)+" ha":L.GeometryUtil.formattedNumber(o,f.m)+" m²"):(o/=.836127,c=o>=3097600?L.GeometryUtil.formattedNumber(o/3097600,f.mi)+" mi²":o>=4840?L.GeometryUtil.formattedNumber(o/4840,f.ac)+" acres":L.GeometryUtil.formattedNumber(o,f.yd)+" yd²"),c},readableDistance:function(o,a,h,c,_){var f,_=L.Util.extend({},n,_);switch(a?typeof a=="string"?a:"metric":h?"feet":c?"nauticalMile":"yards"){case"metric":f=o>1e3?L.GeometryUtil.formattedNumber(o/1e3,_.km)+" km":L.GeometryUtil.formattedNumber(o,_.m)+" m";break;case"feet":o*=3.28083,f=L.GeometryUtil.formattedNumber(o,_.ft)+" ft";break;case"nauticalMile":o*=.53996,f=L.GeometryUtil.formattedNumber(o/1e3,_.nm)+" nm";break;case"yards":default:o*=1.09361,f=o>1760?L.GeometryUtil.formattedNumber(o/1760,_.mi)+" miles":L.GeometryUtil.formattedNumber(o,_.yd)+" yd"}return f},isVersion07x:function(){var o=L.version.split(".");return parseInt(o[0],10)===0&&parseInt(o[1],10)===7}})}(),L.Util.extend(L.LineUtil,{segmentsIntersect:function(n,o,a,h){return this._checkCounterclockwise(n,a,h)!==this._checkCounterclockwise(o,a,h)&&this._checkCounterclockwise(n,o,a)!==this._checkCounterclockwise(n,o,h)},_checkCounterclockwise:function(n,o,a){return(a.y-n.y)*(o.x-n.x)>(o.y-n.y)*(a.x-n.x)}}),L.Polyline.include({intersects:function(){var n,o,a,h=this._getProjectedPoints(),c=h?h.length:0;if(this._tooFewPointsForIntersection())return!1;for(n=c-1;n>=3;n--)if(o=h[n-1],a=h[n],this._lineSegmentsIntersectsRange(o,a,n-2))return!0;return!1},newLatLngIntersects:function(n,o){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(n),o)},newPointIntersects:function(n,o){var a=this._getProjectedPoints(),h=a?a.length:0,c=a?a[h-1]:null,d=h-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(c,n,d,o?1:0)},_tooFewPointsForIntersection:function(n){var o=this._getProjectedPoints(),a=o?o.length:0;return a+=n||0,!o||a<=3},_lineSegmentsIntersectsRange:function(n,o,a,h){var c,d,f=this._getProjectedPoints();h=h||0;for(var _=a;_>h;_--)if(c=f[_-1],d=f[_],L.LineUtil.segmentsIntersect(n,o,c,d))return!0;return!1},_getProjectedPoints:function(){if(!this._defaultShape)return this._originalPoints;for(var n=[],o=this._defaultShape(),a=0;a<o.length;a++)n.push(this._map.latLngToLayerPoint(o[a]));return n}}),L.Polygon.include({intersects:function(){var n,o,a,h,c=this._getProjectedPoints();return!this._tooFewPointsForIntersection()&&(!!L.Polyline.prototype.intersects.call(this)||(n=c.length,o=c[0],a=c[n-1],h=n-2,this._lineSegmentsIntersectsRange(a,o,h,1)))}}),L.Control.Draw=L.Control.extend({options:{position:"topleft",draw:{},edit:!1},initialize:function(n){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");L.Control.prototype.initialize.call(this,n);var o;this._toolbars={},L.DrawToolbar&&this.options.draw&&(o=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=o,this._toolbars[L.DrawToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(o=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=o,this._toolbars[L.EditToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.toolbar=this},onAdd:function(n){var o,a=L.DomUtil.create("div","leaflet-draw"),h=!1;for(var c in this._toolbars)this._toolbars.hasOwnProperty(c)&&(o=this._toolbars[c].addToolbar(n))&&(h||(L.DomUtil.hasClass(o,"leaflet-draw-toolbar-top")||L.DomUtil.addClass(o.childNodes[0],"leaflet-draw-toolbar-top"),h=!0),a.appendChild(o));return a},onRemove:function(){for(var n in this._toolbars)this._toolbars.hasOwnProperty(n)&&this._toolbars[n].removeToolbar()},setDrawingOptions:function(n){for(var o in this._toolbars)this._toolbars[o]instanceof L.DrawToolbar&&this._toolbars[o].setOptions(n)},_toolbarEnabled:function(n){var o=n.target;for(var a in this._toolbars)this._toolbars[a]!==o&&this._toolbars[a].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))}),L.Toolbar=L.Class.extend({initialize:function(n){L.setOptions(this,n),this._modes={},this._actionButtons=[],this._activeMode=null;var o=L.version.split(".");parseInt(o[0],10)===1&&parseInt(o[1],10)>=2?L.Toolbar.include(L.Evented.prototype):L.Toolbar.include(L.Mixin.Events)},enabled:function(){return this._activeMode!==null},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(n){var o,a=L.DomUtil.create("div","leaflet-draw-section"),h=0,c=this._toolbarClass||"",d=this.getModeHandlers(n);for(this._toolbarContainer=L.DomUtil.create("div","leaflet-draw-toolbar leaflet-bar"),this._map=n,o=0;o<d.length;o++)d[o].enabled&&this._initModeHandler(d[o].handler,this._toolbarContainer,h++,c,d[o].title);if(h)return this._lastButtonIndex=--h,this._actionsContainer=L.DomUtil.create("ul","leaflet-draw-actions"),a.appendChild(this._toolbarContainer),a.appendChild(this._actionsContainer),a},removeToolbar:function(){for(var n in this._modes)this._modes.hasOwnProperty(n)&&(this._disposeButton(this._modes[n].button,this._modes[n].handler.enable,this._modes[n].handler),this._modes[n].handler.disable(),this._modes[n].handler.off("enabled",this._handlerActivated,this).off("disabled",this._handlerDeactivated,this));this._modes={};for(var o=0,a=this._actionButtons.length;o<a;o++)this._disposeButton(this._actionButtons[o].button,this._actionButtons[o].callback,this);this._actionButtons=[],this._actionsContainer=null},_initModeHandler:function(n,o,a,h,c){var d=n.type;this._modes[d]={},this._modes[d].handler=n,this._modes[d].button=this._createButton({type:d,title:c,className:h+"-"+d,container:o,callback:this._modes[d].handler.enable,context:this._modes[d].handler}),this._modes[d].buttonIndex=a,this._modes[d].handler.on("enabled",this._handlerActivated,this).on("disabled",this._handlerDeactivated,this)},_detectIOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!r.MSStream},_createButton:function(n){var o=L.DomUtil.create("a",n.className||"",n.container),a=L.DomUtil.create("span","sr-only",n.container);o.href="#",o.appendChild(a),n.title&&(o.title=n.title,a.innerHTML=n.title),n.text&&(o.innerHTML=n.text,a.innerHTML=n.text);var h=this._detectIOS()?"touchstart":"click";return L.DomEvent.on(o,"click",L.DomEvent.stopPropagation).on(o,"mousedown",L.DomEvent.stopPropagation).on(o,"dblclick",L.DomEvent.stopPropagation).on(o,"touchstart",L.DomEvent.stopPropagation).on(o,"click",L.DomEvent.preventDefault).on(o,h,n.callback,n.context),o},_disposeButton:function(n,o){var a=this._detectIOS()?"touchstart":"click";L.DomEvent.off(n,"click",L.DomEvent.stopPropagation).off(n,"mousedown",L.DomEvent.stopPropagation).off(n,"dblclick",L.DomEvent.stopPropagation).off(n,"touchstart",L.DomEvent.stopPropagation).off(n,"click",L.DomEvent.preventDefault).off(n,a,o)},_handlerActivated:function(n){this.disable(),this._activeMode=this._modes[n.handler],L.DomUtil.addClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._showActionsToolbar(),this.fire("enable")},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._activeMode=null,this.fire("disable")},_createActions:function(n){var o,a,h,c,d=this._actionsContainer,f=this.getActions(n),_=f.length;for(a=0,h=this._actionButtons.length;a<h;a++)this._disposeButton(this._actionButtons[a].button,this._actionButtons[a].callback);for(this._actionButtons=[];d.firstChild;)d.removeChild(d.firstChild);for(var m=0;m<_;m++)"enabled"in f[m]&&!f[m].enabled||(o=L.DomUtil.create("li","",d),c=this._createButton({title:f[m].title,text:f[m].text,container:o,callback:f[m].callback,context:f[m].context}),this._actionButtons.push({button:c,callback:f[m].callback}))},_showActionsToolbar:function(){var n=this._activeMode.buttonIndex,o=this._lastButtonIndex,a=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=a+"px",n===0&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-top")),n===o&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-bottom")),this._actionsContainer.style.display="block",this._map.fire(L.Draw.Event.TOOLBAROPENED)},_hideActionsToolbar:function(){this._actionsContainer.style.display="none",L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-top"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-bottom"),this._map.fire(L.Draw.Event.TOOLBARCLOSED)}}),L.Draw=L.Draw||{},L.Draw.Tooltip=L.Class.extend({initialize:function(n){this._map=n,this._popupPane=n._panes.popupPane,this._visible=!1,this._container=n.options.drawControlTooltips?L.DomUtil.create("div","leaflet-draw-tooltip",this._popupPane):null,this._singleLineLabel=!1,this._map.on("mouseout",this._onMouseOut,this)},dispose:function(){this._map.off("mouseout",this._onMouseOut,this),this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(n){return this._container?(n.subtext=n.subtext||"",n.subtext.length!==0||this._singleLineLabel?n.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!0),this._container.innerHTML=(n.subtext.length>0?'<span class="leaflet-draw-tooltip-subtext">'+n.subtext+"</span><br />":"")+"<span>"+n.text+"</span>",n.text||n.subtext?(this._visible=!0,this._container.style.visibility="inherit"):(this._visible=!1,this._container.style.visibility="hidden"),this):this},updatePosition:function(n){var o=this._map.latLngToLayerPoint(n),a=this._container;return this._container&&(this._visible&&(a.style.visibility="inherit"),L.DomUtil.setPosition(a,o)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,"leaflet-error-draw-tooltip"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,"leaflet-error-draw-tooltip"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility="hidden")}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:"draw"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{},circlemarker:{}},initialize:function(n){for(var o in this.options)this.options.hasOwnProperty(o)&&n[o]&&(n[o]=L.extend({},this.options[o],n[o]));this._toolbarClass="leaflet-draw-draw",L.Toolbar.prototype.initialize.call(this,n)},getModeHandlers:function(n){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(n,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(n,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(n,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(n,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(n,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker},{enabled:this.options.circlemarker,handler:new L.Draw.CircleMarker(n,this.options.circlemarker),title:L.drawLocal.draw.toolbar.buttons.circlemarker}]},getActions:function(n){return[{enabled:n.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:n.completeShape,context:n},{enabled:n.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:n.deleteLastVertex,context:n},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(n){L.setOptions(this,n);for(var o in this._modes)this._modes.hasOwnProperty(o)&&n.hasOwnProperty(o)&&this._modes[o].handler.setOptions(n[o])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:"edit"},options:{edit:{selectedPathOptions:{dashArray:"10, 10",fill:!0,fillColor:"#fe57a1",fillOpacity:.1,maintainColor:!1}},remove:{},poly:null,featureGroup:null},initialize:function(n){n.edit&&(n.edit.selectedPathOptions===void 0&&(n.edit.selectedPathOptions=this.options.edit.selectedPathOptions),n.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,n.edit.selectedPathOptions)),n.remove&&(n.remove=L.extend({},this.options.remove,n.remove)),n.poly&&(n.poly=L.extend({},this.options.poly,n.poly)),this._toolbarClass="leaflet-draw-edit",L.Toolbar.prototype.initialize.call(this,n),this._selectedFeatureCount=0},getModeHandlers:function(n){var o=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(n,{featureGroup:o,selectedPathOptions:this.options.edit.selectedPathOptions,poly:this.options.poly}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(n,{featureGroup:o}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(n){var o=[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}];return n.removeAllLayers&&o.push({title:L.drawLocal.edit.toolbar.actions.clearAll.title,text:L.drawLocal.edit.toolbar.actions.clearAll.text,callback:this._clearAllLayers,context:this}),o},addToolbar:function(n){var o=L.Toolbar.prototype.addToolbar.call(this,n);return this._checkDisabled(),this.options.featureGroup.on("layeradd layerremove",this._checkDisabled,this),o},removeToolbar:function(){this.options.featureGroup.off("layeradd layerremove",this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode&&this._activeMode.handler.disable()},_clearAllLayers:function(){this._activeMode.handler.removeAllLayers(),this._activeMode&&this._activeMode.handler.disable()},_checkDisabled:function(){var n,o=this.options.featureGroup,a=o.getLayers().length!==0;this.options.edit&&(n=this._modes[L.EditToolbar.Edit.TYPE].button,a?L.DomUtil.removeClass(n,"leaflet-disabled"):L.DomUtil.addClass(n,"leaflet-disabled"),n.setAttribute("title",a?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(n=this._modes[L.EditToolbar.Delete.TYPE].button,a?L.DomUtil.removeClass(n,"leaflet-disabled"):L.DomUtil.addClass(n,"leaflet-disabled"),n.setAttribute("title",a?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:"edit"},initialize:function(n,o){if(L.Handler.prototype.initialize.call(this,n),L.setOptions(this,o),this._featureGroup=o.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE;var a=L.version.split(".");parseInt(a[0],10)===1&&parseInt(a[1],10)>=2?L.EditToolbar.Edit.include(L.Evented.prototype):L.EditToolbar.Edit.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.EDITSTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on("layeradd",this._enableLayerEdit,this).on("layerremove",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off("layeradd",this._enableLayerEdit,this).off("layerremove",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.EDITSTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(n.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),n._editTooltip=this._tooltip,this._updateTooltip(),this._map.on("mousemove",this._onMouseMove,this).on("touchmove",this._onMouseMove,this).on("MSPointerMove",this._onMouseMove,this).on(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this).off("touchmove",this._onMouseMove,this).off("MSPointerMove",this._onMouseMove,this).off(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},revertLayers:function(){this._featureGroup.eachLayer(function(n){this._revertLayer(n)},this)},save:function(){var n=new L.LayerGroup;this._featureGroup.eachLayer(function(o){o.edited&&(n.addLayer(o),o.edited=!1)}),this._map.fire(L.Draw.Event.EDITED,{layers:n})},_backupLayer:function(n){var o=L.Util.stamp(n);this._uneditedLayerProps[o]||(n instanceof L.Polyline||n instanceof L.Polygon||n instanceof L.Rectangle?this._uneditedLayerProps[o]={latlngs:L.LatLngUtil.cloneLatLngs(n.getLatLngs())}:n instanceof L.Circle?this._uneditedLayerProps[o]={latlng:L.LatLngUtil.cloneLatLng(n.getLatLng()),radius:n.getRadius()}:(n instanceof L.Marker||n instanceof L.CircleMarker)&&(this._uneditedLayerProps[o]={latlng:L.LatLngUtil.cloneLatLng(n.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(n){var o=L.Util.stamp(n);n.edited=!1,this._uneditedLayerProps.hasOwnProperty(o)&&(n instanceof L.Polyline||n instanceof L.Polygon||n instanceof L.Rectangle?n.setLatLngs(this._uneditedLayerProps[o].latlngs):n instanceof L.Circle?(n.setLatLng(this._uneditedLayerProps[o].latlng),n.setRadius(this._uneditedLayerProps[o].radius)):(n instanceof L.Marker||n instanceof L.CircleMarker)&&n.setLatLng(this._uneditedLayerProps[o].latlng),n.fire("revert-edited",{layer:n}))},_enableLayerEdit:function(n){var o,a,h=n.layer||n.target||n;this._backupLayer(h),this.options.poly&&(a=L.Util.extend({},this.options.poly),h.options.poly=a),this.options.selectedPathOptions&&(o=L.Util.extend({},this.options.selectedPathOptions),o.maintainColor&&(o.color=h.options.color,o.fillColor=h.options.fillColor),h.options.original=L.extend({},h.options),h.options.editing=o),h instanceof L.Marker?(h.editing&&h.editing.enable(),h.dragging.enable(),h.on("dragend",this._onMarkerDragEnd).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onMarkerDragEnd,this).on("MSPointerUp",this._onMarkerDragEnd,this)):h.editing.enable()},_disableLayerEdit:function(n){var o=n.layer||n.target||n;o.edited=!1,o.editing&&o.editing.disable(),delete o.options.editing,delete o.options.original,this._selectedPathOptions&&(o instanceof L.Marker?this._toggleMarkerHighlight(o):(o.setStyle(o.options.previousOptions),delete o.options.previousOptions)),o instanceof L.Marker?(o.dragging.disable(),o.off("dragend",this._onMarkerDragEnd,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onMarkerDragEnd,this).off("MSPointerUp",this._onMarkerDragEnd,this)):o.editing.disable()},_onMouseMove:function(n){this._tooltip.updatePosition(n.latlng)},_onMarkerDragEnd:function(n){var o=n.target;o.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:o})},_onTouchMove:function(n){var o=n.originalEvent.changedTouches[0],a=this._map.mouseEventToLayerPoint(o),h=this._map.layerPointToLatLng(a);n.target.setLatLng(h)},_hasAvailableLayers:function(){return this._featureGroup.getLayers().length!==0}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:"remove"},initialize:function(n,o){if(L.Handler.prototype.initialize.call(this,n),L.Util.setOptions(this,o),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this.type=L.EditToolbar.Delete.TYPE;var a=L.version.split(".");parseInt(a[0],10)===1&&parseInt(a[1],10)>=2?L.EditToolbar.Delete.include(L.Evented.prototype):L.EditToolbar.Delete.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on("layeradd",this._enableLayerDelete,this).on("layerremove",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off("layeradd",this._enableLayerDelete,this).off("layerremove",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(n.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(n){this._deletableLayers.addLayer(n),n.fire("revert-deleted",{layer:n})},this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer(function(n){this._removeLayer({layer:n})},this),this.save()},_enableLayerDelete:function(n){(n.layer||n.target||n).on("click",this._removeLayer,this)},_disableLayerDelete:function(n){var o=n.layer||n.target||n;o.off("click",this._removeLayer,this),this._deletedLayers.removeLayer(o)},_removeLayer:function(n){var o=n.layer||n.target||n;this._deletableLayers.removeLayer(o),this._deletedLayers.addLayer(o),o.fire("deleted")},_onMouseMove:function(n){this._tooltip.updatePosition(n.latlng)},_hasAvailableLayers:function(){return this._deletableLayers.getLayers().length!==0}})})(window,document);const ML="";var Ug={draw:{toolbar:{actions:{title:"መሳል ተው",text:"ተው"},finish:{title:"መሳል ጨርስ",text:"ጨርስ"},undo:{title:"መጨረሻ የተሳለውን ነጥብ አጥፋ",text:"መጨረሻ የተሳለውን ነጥብ አጥፋ"},buttons:{polyline:"ፖሊላየን ሳል",polygon:"ፖሊጎን ሳል",rectangle:"አራት መአዘን ሳል",circle:"ክብ ሳል",marker:"ምልክት ሳል",circlemarker:"ክብ ምልክት ሳል"}},handlers:{circle:{tooltip:{start:"ክብ ለመሳል ተጭንው ይጎትቱ"},radius:"ራዲየስ"},circlemarker:{tooltip:{start:"ክብ ምልክት ለመሳል ካርታውን ይጫኑ ይጎትቱ"}},marker:{tooltip:{start:"ምልክት ለመሳል ካርታውን ይጫኑ ይጎትቱ"}},polygon:{tooltip:{start:"ቅርጽን ለመሳል ካርታውን ተጭነው ይጎትቱ",cont:"ቅርጽን መሳሎን ለመቀጠል ይጫኑ",end:"ቅርጽን ስሎ ለመጨረስ የመጀመሪያውን ነጥብ ይጫኑ"}},polyline:{error:"<strong>ስህተት:</strong> መስመሮች እርስ በእርስ መተላለፍ አይችሉም!",tooltip:{start:"መስመር ለመሳል ካርታውን ተጭነው ይጎትቱ",cont:"መስመር መሳሎን ለመቀጠል ይጫኑ",end:"መስመር ስሎ ለመጨረስ የመጨረሻውን ነጥብ ይጫኑ"}},rectangle:{tooltip:{start:"ዐራት መአዝን ለመሳል ካርታውን ይጫኑ ይጎትቱ"}},simpleshape:{tooltip:{end:"ስለው ለመጨረስ አይጤን ይልቀቁ"}}}},edit:{toolbar:{actions:{save:{title:"ለውጦቹን አኑር",text:"አኑር"},cancel:{title:"ማስተካከሉን ተው፣ ሁሉንም ለውጦች ሰርዝ",text:"ተው"},clearAll:{title:"ሁሉንም የካርታ ገጾች አጥፋ",text:"ሁሉንም አጥፋ"}},buttons:{edit:"የካርታ ገጽ አስተካክል",editDisabled:"የሚስተካከል የካርታ ገጽ የለም",remove:"የካርታ ገጽ ሰርዝ.",removeDisabled:"የሚሰረዝ የካርታ ገጽ የለም"}},handlers:{edit:{tooltip:{text:"ለማስተካከል ምልክቱን ወይም መያዣውን ይጎትቱ",subtext:"ለውጥጡን ለመተው ተው የሚለውን ይጫኑ"}},remove:{tooltip:{text:"ማጥፋት የፈለጉትን ይጫኑ"}}}}},Zg={draw:{toolbar:{actions:{title:"Zrušit kreslení",text:"Zrušit"},finish:{title:"Dokončit kreslení",text:"Dokončit"},undo:{title:"Smazat poslední nakreslený bod",text:"Smazat poslední bod"},buttons:{polyline:"Nakreslit mnohoúhelník",polygon:"Nakreslit polygon",rectangle:"Nakreslit obdélník",circle:"Nakreslit kruh",marker:"Nakreslit značku",circlemarker:"Nakreslit kruhovou značku"}},handlers:{circle:{tooltip:{start:"Kliknout a táhnout pro nakreslení kruhu."},radius:"Poloměr"},circlemarker:{tooltip:{start:"Kliknout do mapy pro umístění kruhové značky."}},marker:{tooltip:{start:"Kliknout do mapy pro umístění značky."}},polygon:{tooltip:{start:"Kliknout pro začátek kreslení tvaru.",cont:"Kliknout pro pokračování v kreslení tvaru.",end:"Kliknout na pvní bod k uzavření tvaru."}},polyline:{error:"<strong>Chyba:</strong> hrany tvaru se nemohou protínat!",tooltip:{start:"Kliknout pro začátek kreslení úsečky.",cont:"Kliknout pro pokračování v kreslení úsečky.",end:"Kliknout na koncový bod k ukončení kreslení úsečky."}},rectangle:{tooltip:{start:"Kliknout a táhnout k nakreslení obdélníku."}},simpleshape:{tooltip:{end:"Pustit myš k dokončení kreslení."}}}},edit:{toolbar:{actions:{save:{title:"Uložit změny.",text:"Uložit"},cancel:{title:"Zrušit úpravu, zruší všechny změny.",text:"Zrušit"},clearAll:{title:"Vymazat všechny vrstvy.",text:"Vymazat vše"}},buttons:{edit:"Upravit vrstvy.",editDisabled:"Žádné vrstvy k úpravě.",remove:"Vymazat vrstvy.",removeDisabled:"Žádná vrstva k vymazání."}},handlers:{edit:{tooltip:{text:"Táhnout za úchopy pro editaci tvaru.",subtext:"Kliknutím na zrušit vrátite změny."}},remove:{tooltip:{text:"Kliknout na tvar pro smazání"}}}}},jg={draw:{toolbar:{actions:{title:"Zeichnung abbrechen",text:"Abbrechen"},finish:{title:"Zeichnung fertigstellen",text:"Fertigstellen"},undo:{title:"Lösche den zuletzt gezeichneten Punkt",text:"Letzter Punkt löschen"},buttons:{polyline:"Zeichne eine Linie",polygon:"Zeichne ein Polygon",rectangle:"Zeichne ein Rechteck",circle:"Zeichne einen Kreis",marker:"Zeichne einen Marker",circlemarker:"Zeichne einen Kreis-Marker"}},handlers:{circle:{tooltip:{start:"Klicken und ziehen um einen Kreis zu zeichnen."},radius:"Radius"},circlemarker:{tooltip:{start:"Karte anklicken um einen Kreis-Marker zu platzieren."}},marker:{tooltip:{start:"Karte anklicken um einen Marker zu platzieren."}},polygon:{tooltip:{start:"Klicken um mit dem Zeichnen einer Form zu beginnen.",cont:"Klicken um mit dem Zeichnen dieser Form fortzufahren.",end:"Erster Punkt anklicken um diese Form abzuschliessen."}},polyline:{error:"<strong>Fehler:</strong> Form-Ecken dürfen sich nicht überschneiden!",tooltip:{start:"Klicken um mit dem Zeichnen einer Linie zu beginnen.",cont:"Klicken um mit dem Zeichnen dieser Linie fortzufahren.",end:"Erster Punkt anklicken um diese Linie abzuschliessen."}},rectangle:{tooltip:{start:"Klicken und ziehen um ein Rechteck zu zeichnen."}},simpleshape:{tooltip:{end:"Maustaste loslassen um die Zeichnung fertigzustellen."}}}},edit:{toolbar:{actions:{save:{title:"Speichere Änderungen.",text:"Speichern"},cancel:{title:"Bearbeitung abbrechen, alle Änderungen verwerfen.",text:"Abbrechen"},clearAll:{title:"Alle Layer bereinigen.",text:"Alles bereinigen"}},buttons:{edit:"Layer bearbeiten.",editDisabled:"Keine Layer zum bearbeiten.",remove:"Layer löschen.",removeDisabled:"Keine Layer zum löschen."}},handlers:{edit:{tooltip:{text:"Ziehe den Griff oder den Marker um die Eigenschaft zu bearbeiten.",subtext:"Klicke abbrechen um Änderungen rückgängig zu machen."}},remove:{tooltip:{text:"Klicke auf eine Eigenschaft um diese zu entfernen."}}}}},Bh={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes.",text:"Save"},cancel:{title:"Cancel editing, discards all changes.",text:"Cancel"},clearAll:{title:"Clear all layers.",text:"Clear All"}},buttons:{edit:"Edit layers.",editDisabled:"No layers to edit.",remove:"Delete layers.",removeDisabled:"No layers to delete."}},handlers:{edit:{tooltip:{text:"Drag handles, or marker to edit feature.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove"}}}}},Wg={draw:{toolbar:{actions:{title:"Cancelar dibujo",text:"Cancelar"},finish:{title:"Terminar dibujo",text:"Terminar"},undo:{title:"Eliminar último punto dibujado",text:"Eliminar último punto"},buttons:{polyline:"Dibujar una polilínea",polygon:"Dibujar un polígono",rectangle:"Dibujar un rectángulo",circle:"Dibujar un círculo",marker:"Dibujar un marcador",circlemarker:"Dibujar un marcador circular"}},handlers:{circle:{tooltip:{start:"Haz click y arrastra para dibujar un círculo"},radius:"Radio"},circlemarker:{tooltip:{start:"Haz click en el mapa para situar el marcador circular"}},marker:{tooltip:{start:"Haz click en el mapa para situar el marcador"}},polygon:{tooltip:{start:"Haz click para empezar a dibujar la forma",cont:"Haz click para continuar dibujando la forma",end:"Haz click en el primer punto para cerrar la forma"}},polyline:{error:"<strong>Error:</strong> las líneas no deben cruzarse",tooltip:{start:"Haz click para empezar a dibujar la línea",cont:"Haz click para continuar dibujando la línea",end:"Haz click en el último punto para terminar la línea"}},rectangle:{tooltip:{start:"Haz click y arrastra para dibujar un rectángulo"}},simpleshape:{tooltip:{end:"Suelta el ratón para terminar de dibujar"}}}},edit:{toolbar:{actions:{save:{title:"Guardar los cambios",text:"Guardar"},cancel:{title:"Cancelar la edición, descarta todos los cambios",text:"Cancelar"},clearAll:{title:"Limpiar todas las capas",text:"Limpiar todo"}},buttons:{edit:"Editar capas",editDisabled:"No hay capas que editar",remove:"Eliminar capas",removeDisabled:"No hay capas que eliminar"}},handlers:{edit:{tooltip:{text:"Arrastra el marcador para editar la forma",subtext:"Haz click en cancelar para deshacer los cambios"}},remove:{tooltip:{text:"Haz click en una forma para eliminarla"}}}}},Hg={draw:{toolbar:{actions:{title:"Peru piirustus",text:"Peru"},finish:{title:"Hyväksy piirustus",text:"Hyväksy"},undo:{title:"Poista viimeinen piirretty piste",text:"Poista viimeinen piste"},buttons:{polyline:"Piirrä murtoviiva",polygon:"Piirrä monikulmio",rectangle:"Piirrä suorakulmio",circle:"Piirrä ympyrä",marker:"Piirrä merkki",circlemarker:"Piirrä piirimerkki"}},handlers:{circle:{tooltip:{start:"Piirrä ympyrä pitämällä hiiri painettuna ja vetämällä."},radius:"Säde"},circlemarker:{tooltip:{start:"Aseta ympyrämerkki painamalla karttaa."}},marker:{tooltip:{start:"Aseta markkeri painamalla karttaa."}},polygon:{tooltip:{start:"Paina aloittaaksesi muodon piirtämisen.",cont:"Paina jatkaaksesi muodon piirtämistä.",end:"Sulje muoto painamalla ensimmäistä pistettä."}},polyline:{error:"<strong>Virhe:</strong> muodon reunaa ei voi ylittää!",tooltip:{start:"Paina aloittaaksesi viivan piirtämisen.",cont:"Paina jatkaaksesi viivan piirtämistä.",end:"Paina viimeistä pistettä päättäksesi viiva."}},rectangle:{tooltip:{start:"Piirrä suorakulmio pitämällä hiiri painettuna ja vetämällä."}},simpleshape:{tooltip:{end:"Vapauta hiiri päättääksesi piirtämisen."}}}},edit:{toolbar:{actions:{save:{title:"Hyväksy muutokset.",text:"Hyväksy"},cancel:{title:"Peru muokkaus, hylkää kaikki muutokset.",text:"Peru"},clearAll:{title:"Poista kaikki tasot.",text:"Poista kaikki"}},buttons:{edit:"Muokkaa tasoja.",editDisabled:"Ei muokattavia tasoja.",remove:"Poista tasot.",removeDisabled:"Ei poistettavia tasoja."}},handlers:{edit:{tooltip:{text:"Vedä pistettä tai markkeria muokataksesi piirrettyjä ominaisuuksia.",subtext:"Kumoa muutokset painamalla peruuta."}},remove:{tooltip:{text:"Paina piirrettyä ominaisuutta poistaaksesi"}}}}},Vg={draw:{toolbar:{actions:{title:"Annuler le dessin",text:"Annuler"},finish:{title:"Terminer le dessin",text:"Terminer"},undo:{title:"Supprimer le dernier point tiré",text:"Supprimer le dernier point"},buttons:{polyline:"Dessinez une polyligne",polygon:"Dessinez un polygone",rectangle:"Dessinez un rectangle",circle:"Dessiner un cercle",marker:"Dessinez un marqueur",circlemarker:"Dessinez un marqueur circulaire"}},handlers:{circle:{tooltip:{start:"Cliquez et faites glisser pour dessiner le cercle."},radius:"Rayon"},circlemarker:{tooltip:{start:"Cliquez sur la carte pour placer le marqueur circulaire."}},marker:{tooltip:{start:"Cliquez sur la carte pour placer le marqueur."}},polygon:{tooltip:{start:"Cliquez pour commencer à dessiner.",cont:"Cliquez pour continuer à dessiner.",end:"Cliquez sur le premier point pour fermer cette forme."}},polyline:{error:"<strong>Erreur:</strong> les polyligne ne peuvent pas traverser!",tooltip:{start:"Cliquez pour commencer à dessiner.",cont:"Cliquez pour continuer à dessiner.",end:"Cliquez sur le dernier point pour fermer cette forme."}},rectangle:{tooltip:{start:"Cliquez et faites glisser pour dessiner le rectangle."}},simpleshape:{tooltip:{end:"Relâchez la souris pour terminer le dessin."}}}},edit:{toolbar:{actions:{save:{title:"Sauvegarder les modifications.",text:"Sauvegarder"},cancel:{title:"Annuler l'édition, rejette toutes les modifications.",text:"Annuler"},clearAll:{title:"Effacez toutes les collections.",text:"Tout effacer"}},buttons:{edit:"Modifier les collections.",editDisabled:"Pas de collections à éditer.",remove:"Supprimez les collections.",removeDisabled:"Pas de collections à supprimer."}},handlers:{edit:{tooltip:{text:"Sélectionnez les poignées ou le marqueur pour modifier l'entité.",subtext:"Cliquez sur annuler pour rétablir les modifications."}},remove:{tooltip:{text:"Cliquez sur une entité pour supprimer"}}}}},Xg={draw:{toolbar:{actions:{title:"Rajzolás elvetése",text:"Mégse"},finish:{title:"Rajzolás befejezése",text:"Befejezés"},undo:{title:"Legutóbbi pont törlése",text:"Legutóbbi pont törlése"},buttons:{polyline:"Útvonal rajzolása",polygon:"Sokszög rajzolása",rectangle:"Négyszög rajzolása",circle:"Kör rajzolása",marker:"Jelölő rajzolása",circlemarker:"Kör-jelölő rajzolása"}},handlers:{circle:{tooltip:{start:"Kattintson és tartsa nyomva a rajzoláshoz."},radius:"Sugár"},circlemarker:{tooltip:{start:"Kör-jelölő elhelyezéséhez kattintson a térképre."}},marker:{tooltip:{start:"Jelölő elhelyezéséhez kattintson a térképre."}},polygon:{tooltip:{start:"Alakzat rajzolásához kattintson a térképre.",cont:"Alakzat folytatásához kattintson a térképre.",end:"Alakzat befejezéséhez kattintson a kezdőpontra."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Útvonal rajzolásához kattintson a térképre.",cont:"Útvonal folytatásához kattintson a térképre.",end:"Útvonal befejezéséhez kattintson a végpontra."}},rectangle:{tooltip:{start:"Kattintson és tartsa nyomva négyszög rajzolásához."}},simpleshape:{tooltip:{end:"Ha elégedett az alakzattal, engedje fel az egér gombját."}}}},edit:{toolbar:{actions:{save:{title:"Változtatások elmentése.",text:"Mentés"},cancel:{title:"Változtatások elvetése.",text:"Mégse"},clearAll:{title:"Összes réteg törlése.",text:"Összes törlése"}},buttons:{edit:"Rétegek szerkesztése.",editDisabled:"Nem állnak rendelkezésre szerkeszthető rétegek.",remove:"Rétegek törlése.",removeDisabled:"Nem állnak rendelkezésre törölhető rétegek."}},handlers:{edit:{tooltip:{text:"Módosításhoz használja a jelölők, alakzatok kezelőit.",subtext:"Változások elvetéséhez kattintson a 'Mégse' gombra."}},remove:{tooltip:{text:"Kattintson a jelölőkre, alakzatokra az eltávolításukhoz."}}}}},Yg={draw:{toolbar:{actions:{title:"Annulla disegno",text:"Annulla"},finish:{title:"Completa disegno",text:"Completa"},undo:{title:"Elimina l'ultimo punto disegnato",text:"Elimina l'ultimo punto"},buttons:{polyline:"Disegna una polilinea",polygon:"Disegna un poligono",rectangle:"Disegna un rettangolo",circle:"Disegna un cerchio",marker:"Disegna un marcatore",circlemarker:"Disegna un marker circolare"}},handlers:{circle:{tooltip:{start:"Clicca e trascina per disegnare un cerchio."},radius:"Raggio"},circlemarker:{tooltip:{start:"Clicca la mappa per posizionare un marcatore circolare."}},marker:{tooltip:{start:"Clicca la mappa per posizionare un marcatore."}},polygon:{tooltip:{start:"Clicca per iniziare a disegnare una figura.",cont:"Clicca per continuare a disegnare una figura.",end:"Clicca il primo punto per chiudere questa figura."}},polyline:{error:"<strong>Errore:</strong> i margini della figura non si possono incrociare!",tooltip:{start:"Clicca per iniziare a disegnare una linea.",cont:"Clicca per continuare a disegnare una linea",end:"Clicca l'ultimo punto per finire questa linea"}},rectangle:{tooltip:{start:"Clicca e trascina per disegnare un rettangolo."}},simpleshape:{tooltip:{end:"Rilascia il mouse per finire il disegno."}}}},edit:{toolbar:{actions:{save:{title:"Salva modifiche.",text:"Salva"},cancel:{title:"Annulla tutte le modifiche.",text:"Annulla"},clearAll:{title:"Pulisci tutti i livelli.",text:"Pulisci tutto"}},buttons:{edit:"Modifica i livelli.",editDisabled:"Nessun livello disponibile per la modifica.",remove:"Elimina livelli.",removeDisabled:"Nessun livello disponibile per l'eliminazione."}},handlers:{edit:{tooltip:{text:"Trascina le maniglie, o i marcatori per modificare l'elemento.",subtext:"Clicca annulla per annullare le modifiche."}},remove:{tooltip:{text:"Clicca un elemento per rimuoverlo"}}}}},Kg={draw:{toolbar:{actions:{title:"ხატვის გაუქმება",text:"გაუქმება"},finish:{title:"ხატვის დასრულება",text:"დასრულება"},undo:{title:"ბოლო დახატული წერტილის წაშლა",text:"ბოლო წერტილის წაშლა"},buttons:{polyline:"პოლილაინის დახაზვა",polygon:"პოლიგონის დახაზვა",rectangle:"მართკუთხედის დახაზვა",circle:"წრის დახაზვა",marker:"ადგილმდებარეობის დატანა",circlemarker:"ადგილმდებარეობის დატანა(წრის სახით)"}},handlers:{circle:{tooltip:{start:"დააწკაპუნეთ და გადაიტანეთ იმისათვის, რომ წრე დახაზოთ."},radius:"რადიუსი"},circlemarker:{tooltip:{start:"დააწკაპუნეთ რუკაზე ადგილმდებარეობის შესაქმნელად."}},marker:{tooltip:{start:"დააწკაპუნეთ რუკაზე ადგილმდებარეობის შესაქმნელად."}},polygon:{tooltip:{start:"დააწკაპუნეთ, კონტურის ხაზვის დაწყებისთვის.",cont:"დააწკაპუნეთ, კონტრუსი ხაზვის დასრულებისთვის.",end:"დააწკაპუნეთ პირველ წერტილზე, რათა დაასრულოთ კონტურის ხაზვა."}},polyline:{error:"<strong>შეცდომა:</strong> ხაზი ვერ გადაკვეთავს თავის თავს",tooltip:{start:"დააწკაპუნეთ, ხაზის ხაზვის დაწყებისთვის.",cont:"დააწკაპუნეთ, ხაზის ხაზვის დასრულებისთვის.",end:"დააწკაპუნეთ ბოლო წერტილზე, რათა დაასრულოთ ხაზის ხაზვა."}},rectangle:{tooltip:{start:"დააწკაპუნეთ და გადაიტანეთ იმისათვის, რომ მართკუთხედი დახაზოთ."}},simpleshape:{tooltip:{end:"გაათავისუფლეთ თაგვის ღილაკი ხაზვის დასასრულებლად."}}}},edit:{toolbar:{actions:{save:{title:"ცვლილებების შენახვა.",text:"შენახვა"},cancel:{title:"რედაქტირების გაუქმება, დააბრუნე ყველა ცვლილება.",text:"გაუქმება"},clearAll:{title:"ყველა რედაქტირებული ფენის გასუფთავება.",text:"გასუფთავება"}},buttons:{edit:"რედაქტირება.",editDisabled:"ფენები არ არის რედაქტირებისთვის.",remove:"წაშლა.",removeDisabled:"ფენები არ არის წაშლისთვის."}},handlers:{edit:{tooltip:{text:"გადაიტანეთ წვერები ან წერტილები ობიექტის რედაქტირებისთვის.",subtext:'დააჭირეთ "გაუქმება", საწყის მდგომარეობაში დასაბრუნებლად.'}},remove:{tooltip:{text:"დააწკაპუნეთ ობიექტზე წაშლისთვის"}}}}},qg={draw:{toolbar:{actions:{title:"Tekening annuleren",text:"Annuleren"},finish:{title:"Tekening voltooien",text:"Voltooien"},undo:{title:"Laatst getekende punt verwijderen",text:"Verwijder laatst getekende punt"},buttons:{polyline:"Teken een polygonale lijn",polygon:"Teken een polygoon",rectangle:"Teken een rechthoek",circle:"Teken een cirkel",marker:"Plaats een marker",circlemarker:"Teken een cirkelmarkering"}},handlers:{circle:{tooltip:{start:"Klik en sleep om de cirkel te tekenen."},radius:"Radius"},circlemarker:{tooltip:{start:"Klik op de kaart om de cirkelmarkering te plaatsen."}},marker:{tooltip:{start:"Klik op de kaart om de markering te plaatsen."}},polygon:{tooltip:{start:"Klik om te beginnen met het tekenen van de polygoon.",cont:"Klik om door te gaan met het tekenen van de vorm.",end:"Klik op het eerste punt om dit polygoon te sluiten."}},polyline:{error:"<strong>Fout:</strong> vormranden kunnen niet kruisen!",tooltip:{start:"Klik om te beginnen met het tekenen van een lijn.",cont:"Klik om door te gaan met het tekenen van de lijn.",end:"Klik laatst getekende punt om deze lijn te voltooien."}},rectangle:{tooltip:{start:"Klik en sleep om een rechthoek te tekenen."}},simpleshape:{tooltip:{end:"Laat de muis los om de tekening te voltooien."}}}},edit:{toolbar:{actions:{save:{title:"Wijzigingen opslaan.",text:"Opslaan"},cancel:{title:"Annuleer bewerken en verwijder alle wijzigingen.",text:"Annuleren"},clearAll:{title:"Verwijder alle lagen.",text:"Verwijderd alles"}},buttons:{edit:"Lagen bewerken.",editDisabled:"Geen lagen om te bewerken.",remove:"Verwijder lagen.",removeDisabled:"Geen lagen om te verwijderen."}},handlers:{edit:{tooltip:{text:"Sleep hoeken om te schalen of middenpunt om te verplaatsen.",subtext:"Klik op annuleren om wijzigingen ongedaan te maken."}},remove:{tooltip:{text:"Klik op een vorm om die te verwijderen"}}}}},$g={draw:{toolbar:{actions:{title:"Avbryt markering",text:"Avbryt"},finish:{title:"Ferdiggjør markering",text:"Ferdiggjør"},undo:{title:"Ta bort siste punkt",text:"Slett siste punkt"},buttons:{polyline:"Tegn flere linjer",polygon:"Tegn en mangekant",rectangle:"Tegn et rektangel",circle:"Tegn en sirkel",marker:"Sett et markeringspunkt",circlemarker:"Tegn et sirkelpunkt"}},handlers:{circle:{tooltip:{start:"Klikk og dra for å tegne en sirkel."},radius:"Radius"},circlemarker:{tooltip:{start:"Klikk på kartet for å plassere et sirkelpunkt."}},marker:{tooltip:{start:"Klikk på kartet for å markere et punkt."}},polygon:{tooltip:{start:"Klikk for å tegne et område.",cont:"Klikk for å fortsette tegningen.",end:"Klikk på det første punktet for å lukke området."}},polyline:{error:"<strong>Error:</strong> kantene kan ikke krysses!",tooltip:{start:"Klikk for å tegne en linje.",cont:"Klikk for å fortsette å tegne linjen.",end:"Kikk siste punkt for å ferdiggjøre linjen."}},rectangle:{tooltip:{start:"Klikk og dra for å tegne et rektangel."}},simpleshape:{tooltip:{end:"Slipp museknappen for å gjøre tegningen ferdig."}}}},edit:{toolbar:{actions:{save:{title:"Lagre endringer.",text:"Lagre"},cancel:{title:"Avbryt redigering og forkast endringer.",text:"Avbryt"},clearAll:{title:"Nullstill alle figurer.",text:"Nullstill alt."}},buttons:{edit:"Rediger figur.",editDisabled:"Ingen figur å redigere.",remove:"Slett figur.",removeDisabled:"Ingen figur å slette."}},handlers:{edit:{tooltip:{text:"Dra markør for å redigere.",subtext:"Klikk avbryt for å angre endringer."}},remove:{tooltip:{text:"Klikk for å ta bort"}}}}},Jg={draw:{toolbar:{actions:{title:"Anuluj wyznaczanie",text:"Anuluj"},finish:{title:"Zakończ wyznaczanie",text:"Zakończ"},undo:{title:"Usuń ostatnio wyznaczony punkt",text:"Usuń ostatni punkt"},buttons:{polyline:"Wyznacz wzór",polygon:"Wyznacz wielokąt",rectangle:"Wyznacz prostokąt",circle:"Wyznacz koło",marker:"Umieść znacznik",circlemarker:"Umieść okrągły znacznik"}},handlers:{circle:{tooltip:{start:"Kliknij i przeciągnij, aby wyznaczyć koło."},radius:"Promień"},circlemarker:{tooltip:{start:"Kliknij na mapę, aby umieścić okrągły znacznik."}},marker:{tooltip:{start:"Kliknij na mapę, aby umieścić znacznik."}},polygon:{tooltip:{start:"Kliknij, aby rozpocząć wyznaczanie kształtu.",cont:"Kliknij, aby kontynuować wyznaczanie kształtu.",end:"Kliknij pierwszy punkt, aby zakończyć ten kształt."}},polyline:{error:"<strong>Błąd:</strong> odcinki nie mogą się przecinać!",tooltip:{start:"Kliknij, aby rozpocząć wyznaczanie lini.",cont:"Kliknij, aby kontynuować wyznaczanie lini.",end:"Kliknij ostatni punkt, aby ukończyć linię."}},rectangle:{tooltip:{start:"Kliknij i przeciągnij, aby wyznaczyć prostokąt."}},simpleshape:{tooltip:{end:"Zwolnij przycisk myszy, aby ukończyć wyznaczanie."}}}},edit:{toolbar:{actions:{save:{title:"Zapisz zmiany.",text:"Zapisz"},cancel:{title:"Anuluj edytowanie i odrzuć zmiany.",text:"Anuluj"},clearAll:{title:"Wyczyść wszystkie warstwy.",text:"Wyczyść wszystko"}},buttons:{edit:"Edytuj warstwy.",editDisabled:"Brak warstw do edycji.",remove:"Usuń warstwy.",removeDisabled:"Brak warstw do usunięcia."}},handlers:{edit:{tooltip:{text:"Przeciągnij uchwyt lub znacznik, aby edytować.",subtext:"Kliknij anuluj, aby odrzucić zmiany."}},remove:{tooltip:{text:"Kliknij obiekt, aby go usunąć."}}}}},Qg={draw:{toolbar:{actions:{title:"Cancelar desenho",text:"Cancelar"},finish:{title:"Terminar desenho",text:"Terminar"},undo:{title:"Eliminar último ponto desenhado",text:"Eliminar último ponto"},buttons:{polyline:"Desenhar uma polilinha",polygon:"Desenhar um polígono",rectangle:"Desenhar um retângulo",circle:"Desenhar um círculo",marker:"Desenhar un marcador",circlemarker:"Desenhar um marcador circular"}},handlers:{circle:{tooltip:{start:"Clique e arrastrar para desenhar o círculo."},radius:"Raio"},circlemarker:{tooltip:{start:"Clique no mapa para colocar o marcador circular."}},marker:{tooltip:{start:"Clique no mapa para colocar o marcador."}},polygon:{tooltip:{start:"Clique para começar a desenhar a figura.",cont:"Clique para continuar desenhando a figura.",end:"Clique no primeiro ponto para fechar esta figura."}},polyline:{error:"<strong>Erro:</strong> as bordas de uma forma não podem atravessar!",tooltip:{start:"Clique para começar a desenhar a linha.",cont:"Clique para continuar desenhando a linha.",end:"Clique no último ponto para terminar a linha."}},rectangle:{tooltip:{start:"Clique e arrastrar para desenhar o retângulo."}},simpleshape:{tooltip:{end:"Solte o mouse para terminar o desenho."}}}},edit:{toolbar:{actions:{save:{title:"Guardar alterações.",text:"Guardar"},cancel:{title:"Cancelar edição, descarta todas as alterações.",text:"Cancelar"},clearAll:{title:"Limpar todas as camadas.",text:"Limpar tudo"}},buttons:{edit:"Editar camadas.",editDisabled:"Nenhuma camada que editar.",remove:"Eliminar camadas.",removeDisabled:"Nenhuma camada que eliminar."}},handlers:{edit:{tooltip:{text:"Arraste os manipuladores ou marcadores para editar a figura.",subtext:"Clique em cancelar para desfazer as alterações."}},remove:{tooltip:{text:"Clique em uma figura para removê-la"}}}}},t_={draw:{toolbar:{actions:{title:"Отменить рисование",text:"Отмена"},finish:{title:"Завершить рисование",text:"Завершить"},undo:{title:"Удалить последнюю нарисованную точку",text:"Удалить последнюю точку"},buttons:{polyline:"Нарисовать полилинию",polygon:"Нарисовать полигон",rectangle:"Нарисовать прямоугольник",circle:"Нарисовать круг",marker:"Нарисовать точку",circlemarker:"Нарисовать точку(в виде круга)"}},handlers:{circle:{tooltip:{start:"Кликните и перетащите для того, чтобы нарисовать круг."},radius:"Радиус"},circlemarker:{tooltip:{start:"Кликните на карту для установки точки."}},marker:{tooltip:{start:"Кликните на карту для установки точки."}},polygon:{tooltip:{start:"Кликните, чтобы начать рисовать контур.",cont:"Кликните, чтобы завершить рисовать контур.",end:"Кликните на первую точку, чтобы завершить рисование контура."}},polyline:{error:"<strong>Ошибка:</strong> линия не может самопересекаться!",tooltip:{start:"Кликните, чтобы начать рисовать линию.",cont:"Кликните, чтобы завершить рисование линии.",end:"Кликните на последнюю точку, чтобы завершить рисование линии."}},rectangle:{tooltip:{start:"Кликните и перетащите, чтобы нарисовать прямоугольник."}},simpleshape:{tooltip:{end:"Отпустите кнопку мыши для завершения рисования."}}}},edit:{toolbar:{actions:{save:{title:"Сохранить изменения.",text:"Сохранить"},cancel:{title:"Отменить редактирование, откатить все изменения.",text:"Отмена"},clearAll:{title:"Очистить все редактируемые слои.",text:"Очистить всё"}},buttons:{edit:"Редактировать.",editDisabled:"Нет слоёв для редактирования.",remove:"Удалить.",removeDisabled:"Нет слоёв для удаления."}},handlers:{edit:{tooltip:{text:"Перетащите вершины или точки для редактирования фигуры.",subtext:'Нажмите "Отмена", чтобы откатить изменения.'}},remove:{tooltip:{text:"Кликните на фигуру для удаления"}}}}},e_={draw:{toolbar:{actions:{title:"Zrušiť kreslenie",text:"Zrušiť"},finish:{title:"Dokončiť kreslenie",text:"Dokončiť"},undo:{title:"Zmazať posledný nakreslený bod",text:"Zmazať posledný bod"},buttons:{polyline:"Nakresliť čiaru",polygon:"Nakresliť polygón",rectangle:"Nakresliť obdĺžnik",circle:"Nakresliť kruh",marker:"Nakresliť bod",circlemarker:"Nakresliť kruhový bod"}},handlers:{circle:{tooltip:{start:"Kliknite a potiahnite, aby ste nakreslili kruh."},radius:"Polomer"},circlemarker:{tooltip:{start:"Kliknite na mapu aby ste umiestnili kruhový bod."}},marker:{tooltip:{start:"Kliknite na mapu aby ste umiestnili bod."}},polygon:{tooltip:{start:"Kliknite, aby ste začali kresliť útvar.",cont:"Kliknite, aby ste nakreslili ďalší bod útvaru.",end:"Kliknite na prvý bod, aby ste uzavreli útvar."}},polyline:{error:"<strong>Chyba:</strong> čiary sa nesmú pretínať!",tooltip:{start:"Kliknite, aby ste začali kresliť čiaru.",cont:"Kliknite, aby ste nakreslili ďalší bod čiary.",end:"Kliknite posledný bod, aby ste dokončili čiaru."}},rectangle:{tooltip:{start:"Kliknite a potiahnite, aby ste nakreslili štvorec."}},simpleshape:{tooltip:{end:"Uvoľnením tlačidla myši ukončíte kreslenie."}}}},edit:{toolbar:{actions:{save:{title:"Uložiť zmeny.",text:"Uložiť"},cancel:{title:"Ukončiť úpravu, zrušiť všetky zmeny.",text:"Zrušiť"},clearAll:{title:"Zmazať všetky vrstvy.",text:"Zmazať všetko"}},buttons:{edit:"Upraviť vrstvy.",editDisabled:"Žiadne vrstvy pre úpravu",remove:"Zmazať vrstvy.",removeDisabled:"Žiadne vrstvy pre zmazanie."}},handlers:{edit:{tooltip:{text:"Potiahnutím vyznačených štvorčekov, alebo bodov upravíte útvar.",subtext:"Kliknite zrušiť, pre zrušenie zmien."}},remove:{tooltip:{text:"Kliknite na útvar pre jeho zmazanie."}}}}},i_={draw:{toolbar:{actions:{title:"Скасувати креслення",text:"Скасувати"},finish:{title:"Завершити креслення",text:"Завершити"},undo:{title:"Видалити останню нанесену точку",text:"Видалити останню точку"},buttons:{polyline:"Накреслити криву",polygon:"Накреслити многокутник",rectangle:"Накреслити прямокутник",circle:"Накреслити коло",marker:"Розмістити маркер",circlemarker:"Розмістити маркер-коло"}},handlers:{circle:{tooltip:{start:"Натисніть і перетягуйте вказівник, щоб накреслити коло."},radius:"Радіус"},circlemarker:{tooltip:{start:"Натисніть на мапу, щоб розмістити маркер-коло."}},marker:{tooltip:{start:"Натисніть на мапу, щоб розмістити маркер."}},polygon:{tooltip:{start:"Натисніть, щоб накреслити фігуру.",cont:"Натисніть, щоб продовжити креслення фігури.",end:"Натисніть на першу точку, щоб замкнути цю фігуру."}},polyline:{error:"<strong>Помилка:</strong> сторони фігури не мають перетинатись!",tooltip:{start:"Натисніть, щоб накреслити лінію.",cont:"Натисніть, щоб продовжити креслення лінії.",end:"Натисніть на останню точку, щоб завершити лінію."}},rectangle:{tooltip:{start:"Натисніть і перетягуйте вказівник, щоб накреслити прямокутник."}},simpleshape:{tooltip:{end:"Відпустіть мишку, щоб завершити рисування."}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни.",text:"Зберегти"},cancel:{title:"Припинити редагування, скасувати всі зміни.",text:"Скасувати"},clearAll:{title:"Очистити всі шари.",text:"Очистити все"}},buttons:{edit:"Редагувати шари.",editDisabled:"Немає шарів для редагування.",remove:"Видалити шари.",removeDisabled:"Немає шарів для видалення."}},handlers:{edit:{tooltip:{text:"Перетягуйте важелі або маркер для редагування фігури.",subtext:"Натисніть «Скасувати» для скасування змін."}},remove:{tooltip:{text:"Натисніть на фігуру для видалення"}}}}},n_={draw:{toolbar:{actions:{title:"الغاء الرسم",text:"الغاء"},finish:{title:"انهاء الرسم",text:"انهاء"},undo:{title:"مسح اخر رسمة",text:"مسح اخر نقطة"},buttons:{polyline:"رسم خط",polygon:"رسم منطقة",rectangle:"رسم مستطيل",circle:"رسم دائرة",marker:"رسم علامة",circlemarker:"رسم علامة دائرة"}},handlers:{circle:{tooltip:{start:"اضغط واسحب لرسم دائرة"},radius:"القطر"},circlemarker:{tooltip:{start:"اضغط على الخريطة لرسم دائرة"}},marker:{tooltip:{start:"اضغط على الخريطة لرسم نقطة"}},polygon:{tooltip:{start:"اضغط لبدء رسم منطقة",cont:"اضغط لاستمرار رسم منطقة",end:"اضغط على اول نقطة لاكمال المنطقة"}},polyline:{error:"<strong>خطأ:</strong> لا يمكن تقاطع الخطوط",tooltip:{start:"اضغط لبدئ رسم الخط",cont:"اضغط لاستكمال رسم الخط",end:"اضغط على اخر نقطة للانهاء"}},rectangle:{tooltip:{start:"اضغط واسحب لرسم مستطيل"}},simpleshape:{tooltip:{end:"اترك الماوس للانهاء"}}}},edit:{toolbar:{actions:{save:{title:"حفظ التغييرات",text:"حفظ"},cancel:{title:"الغاء كل التعديلات",text:"الغاء"},clearAll:{title:"مسح كل الطبقات",text:"مسح الكل"}},buttons:{edit:"تعديل الطبقات",editDisabled:"لاتوجد طبقات للتعديل",remove:"مسح الطبقات",removeDisabled:"لا يوجد طبقات للمسح"}},handlers:{edit:{tooltip:{text:"اسحب للتعديل",subtext:"اضغط الغاء لمسح التعديلات"}},remove:{tooltip:{text:"اضغط على رسمة للمسح"}}}}},r_={draw:{toolbar:{actions:{title:"取消绘制",text:"取消"},finish:{title:"结束绘制",text:"结束"},undo:{title:"删除最后一个绘制点",text:"删除最后一个点"},buttons:{polyline:"绘制折线",polygon:"绘制多边形",rectangle:"绘制矩形",circle:"绘制圆形",marker:"绘制标志物",circlemarker:"绘制圆形标志物"}},handlers:{circle:{tooltip:{start:"单击并拖拽绘制圆形"},radius:"半径"},circlemarker:{tooltip:{start:"单击地图放置圆形标志物"}},marker:{tooltip:{start:"单击地图放置标志物"}},polygon:{tooltip:{start:"单击地图绘制图形",cont:"继续单击绘制图形",end:"单击起始点结束绘制"}},polyline:{error:"<strong>错误:</strong> 图形边缘不能交叉!",tooltip:{start:"单击地图绘制折线",cont:"继续单击绘制下一段折线",end:"单击最后一个点结束绘制"}},rectangle:{tooltip:{start:"单击并拖拽绘制矩形"}},simpleshape:{tooltip:{end:"松开鼠标结束绘制"}}}},edit:{toolbar:{actions:{save:{title:"保存变更",text:"保存"},cancel:{title:"取消编辑,放弃所有变更",text:"取消"},clearAll:{title:"清除所有图形",text:"清除所有"}},buttons:{edit:"编辑图形",editDisabled:"无图形可编辑",remove:"删除图形",removeDisabled:"无图形可删除"}},handlers:{edit:{tooltip:{text:"拖拽线段或标志点以编辑图形",subtext:"点击<strong>取消</strong>按钮撤销变更"}},remove:{tooltip:{text:"单击图形以移除"}}}}},s_={draw:{toolbar:{actions:{title:"Çizimi iptal et",text:"İptal"},finish:{title:"Çizimi Bitir",text:"Bitir"},undo:{title:"Çizilen son noktayı sil",text:"Son noktayı sil"},buttons:{polyline:"Çoklu çizgi çiz",polygon:"Çokgen çiz",rectangle:"Dikdörtgen çiz",circle:"Yuvarlak çiz",marker:"İşaretçi çiz",circlemarker:"Yuvarlak işaretçi çiz"}},handlers:{circle:{tooltip:{start:"Yuvarlak çizmek için tıklayın ve sürükleyin."},radius:"Çap"},circlemarker:{tooltip:{start:"Yuvarlak işaretçi yerleştirmek için haritaya tıklayın."}},marker:{tooltip:{start:"İşaretçi yerleştirmek için haritaya tıklayın."}},polygon:{tooltip:{start:"Şekil çizmeye başlamak için tıklayın.",cont:"Şekil çizmeye devam etmek için tıklayın.",end:"Bu şekli tamamlamak için ilk noktayı tıklayın."}},polyline:{error:"<strong>Hata:</strong> şekil kenarları kesişemez!",tooltip:{start:"Hat çizmeye başlamak için tıklayın.",cont:"Hat çizmeye devam etmek için tıklayın.",end:"Bu hattı tamamlamak için ilk noktayı tıklayın."}},rectangle:{tooltip:{start:"Dikdörtgen çizmek için tıklayın ve sürükleyin."}},simpleshape:{tooltip:{end:"Çizimi bitirmek için fareyi bırakın."}}}},edit:{toolbar:{actions:{save:{title:"Değişiklikleri kaydet.",text:"Kaydet"},cancel:{title:"Düzenlemeyi iptal et, tüm değişiklikleri çıkar.",text:"İptal"},clearAll:{title:"Tüm katmanları temizle.",text:"Hepsini temizle"}},buttons:{edit:"Katmanları düzenle.",editDisabled:"Düzenlenecek katman bulunamadı.",remove:"Katmanları sil.",removeDisabled:"Silinecek katman bulunamadı."}},handlers:{edit:{tooltip:{text:"Çizimi düzenlemek için köşeleri veya işaretçiyi sürükleyin.",subtext:"Değişiklikleri geri almak için iptale tıklayın."}},remove:{tooltip:{text:"Çizimi silmek için tıklayın"}}}}},o_={draw:{toolbar:{actions:{title:"Anulați desenul",text:"Anulare"},finish:{title:"Terminați desenul",text:"Termina"},undo:{title:"Șterge ultimul punct desenat",text:"Șterge ultimul punct"},buttons:{polyline:"Desenați o polilinie",polygon:"Desenați un poligon",rectangle:"Desenați un dreptunghi",circle:"Desenează un cerc",marker:"Desenați un marker",circlemarker:"Desenați un marcator de cerc"}},handlers:{circle:{tooltip:{start:"Dați clic și trageți pentru a desena cerc."},radius:"Rază"},circlemarker:{tooltip:{start:"Dați clic pe hartă pentru a plasa marcatorul cercului."}},marker:{tooltip:{start:"Dați clic pe hartă pentru a plasa marcatorul."}},polygon:{tooltip:{start:"Dați clic pentru a începe desenarea parcelei",cont:"Dați clic pentru a continua desenarea parcelei",end:"Dați clic pe primul punct pentru a închide această parcelei."}},polyline:{error:"<strong>Eroare:</strong> marginile formei nu se pot traversa!",tooltip:{start:"Daţi clic pentru a începe să desenezi o linie.",cont:"Daţi clic pentru a continua să desenezi linia.",end:"Dați clic pe ultimul punct pentru a ajunge la linia de sosire."}},rectangle:{tooltip:{start:"Dați clic și trageți pentru a desena dreptunghi."}},simpleshape:{tooltip:{end:"Eliberați mouse-ul pentru a termina desenul."}}}},edit:{toolbar:{actions:{save:{title:"Salvează modificările.",text:"Salvați"},cancel:{title:"Anulează editarea, anulează toate modificările.",text:"Anulare"},clearAll:{title:"Ștergeți toate straturile.",text:"Curata tot"}},buttons:{edit:"Editați straturi.",editDisabled:"Fără straturi de editat.",remove:"Ștergeți straturile.",removeDisabled:"Nu există straturi de șters."}},handlers:{edit:{tooltip:{text:"Trageți mânerele sau marcatorul pentru a edita caracteristica.",subtext:"Dați clic pe Anulare pentru a anula modificările."}},remove:{tooltip:{text:"Dați clic pe o caracteristică pentru a o elimina"}}}}},a_=function(r){var t=Bh;switch(r.toLocaleLowerCase()){case"de":case"de-at":case"de-be":case"de-ch":case"de-de":case"de-li":case"de-lu":case"de-de.utf-8":case"german":t=jg;break;case"en":case"en-us":case"en-ca":case"en-gb":case"en-us.utf-8":case"english":t=Bh;break;case"ar":case"ar-ae":case"ar-eg":case"arabic":t=n_;break;case"fi":case"fi-fi":case"fi-fi.utf-8":case"finnish":t=Hg;break;case"fr":case"fr-us":case"fr-ca":case"fr-us.utf-8":case"french":t=Vg;break;case"es":case"es-us":case"es-ca":case"es-us.utf-8":case"spanish":t=Wg;break;case"sk":case"sk-sk":case"sk-sk.utf-8":case"slovak":t=e_;break;case"pl":case"pl-pl":case"pl-pl.utf-8":case"polish":t=Jg;break;case"pt":case"pt-pt":case"pt-pt.utf-8":case"portuguese":t=Qg;break;case"uk":case"uk-ua":case"uk-ua.utf-8":case"ukrainian":t=i_;break;case"cs":case"cs-cz":case"cs-cz.utf-8":case"czech":t=Zg;break;case"ru":case"ru-ru":case"ru-ru.utf-8":case"russian":t=t_;break;case"ka":case"ka-ka":case"ka-ka.utf-8":case"georgian":t=Kg;break;case"no":case"no-no":case"no-no.utf-8":case"norwegian":t=$g;break;case"am":case"am-et":case"am-et.utf-8":case"amharic":t=Ug;break;case"nl":case"nl-nl":case"nl-nl.utf-8":case"nl-be":case"nl-be.utf-8":case"dutch":case"belgian":case"flemish":t=qg;break;case"it":case"it-it":case"it-ch":case"it-it.utf-8":case"it-ch.utf-8":case"italiano":case"italian":t=Yg;break;case"hu":case"hu-HU":case"hu-hu":case"hu-HU.utf-8":case"hu-hu.utf-8":case"magyar":case"hungarian":t=Xg;break;case"zh":case"zh-cn":case"zh-cn.utf-8":case"chinese":t=r_;break;case"tr":case"tr-tr":case"tr-tr.utf-8":case"turkish":t=s_;break;case"ro":case"ro-ro":case"ro-RO":case"ro-ro.utf-8":case"romanian":t=o_;break;default:throw new Error("[language] not found")}try{L&&L.drawLocal&&(L.drawLocal=t)}catch{}return t};function Gh(r,t){return function(){return r.apply(t,arguments)}}const{toString:l_}=Object.prototype,{getPrototypeOf:sa}=Object,fs=(r=>t=>{const e=l_.call(t);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),De=r=>(r=r.toLowerCase(),t=>fs(t)===r),gs=r=>t=>typeof t===r,{isArray:vn}=Array,ur=gs("undefined");function h_(r){return r!==null&&!ur(r)&&r.constructor!==null&&!ur(r.constructor)&&ye(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const Uh=De("ArrayBuffer");function c_(r){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(r):t=r&&r.buffer&&Uh(r.buffer),t}const u_=gs("string"),ye=gs("function"),Zh=gs("number"),_s=r=>r!==null&&typeof r=="object",d_=r=>r===!0||r===!1,ps=r=>{if(fs(r)!=="object")return!1;const t=sa(r);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},f_=De("Date"),g_=De("File"),__=De("Blob"),p_=De("FileList"),m_=r=>_s(r)&&ye(r.pipe),y_=r=>{let t;return r&&(typeof FormData=="function"&&r instanceof FormData||ye(r.append)&&((t=fs(r))==="formdata"||t==="object"&&ye(r.toString)&&r.toString()==="[object FormData]"))},v_=De("URLSearchParams"),x_=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function dr(r,t,{allOwnKeys:e=!1}={}){if(r===null||typeof r>"u")return;let i,n;if(typeof r!="object"&&(r=[r]),vn(r))for(i=0,n=r.length;i<n;i++)t.call(null,r[i],i,r);else{const o=e?Object.getOwnPropertyNames(r):Object.keys(r),a=o.length;let h;for(i=0;i<a;i++)h=o[i],t.call(null,r[h],h,r)}}function jh(r,t){t=t.toLowerCase();const e=Object.keys(r);let i=e.length,n;for(;i-- >0;)if(n=e[i],t===n.toLowerCase())return n;return null}const Wh=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Hh=r=>!ur(r)&&r!==Wh;function oa(){const{caseless:r}=Hh(this)&&this||{},t={},e=(i,n)=>{const o=r&&jh(t,n)||n;ps(t[o])&&ps(i)?t[o]=oa(t[o],i):ps(i)?t[o]=oa({},i):vn(i)?t[o]=i.slice():t[o]=i};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&dr(arguments[i],e);return t}const E_=(r,t,e,{allOwnKeys:i}={})=>(dr(t,(n,o)=>{e&&ye(n)?r[o]=Gh(n,e):r[o]=n},{allOwnKeys:i}),r),w_=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),L_=(r,t,e,i)=>{r.prototype=Object.create(t.prototype,i),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:t.prototype}),e&&Object.assign(r.prototype,e)},b_=(r,t,e,i)=>{let n,o,a;const h={};if(t=t||{},r==null)return t;do{for(n=Object.getOwnPropertyNames(r),o=n.length;o-- >0;)a=n[o],(!i||i(a,r,t))&&!h[a]&&(t[a]=r[a],h[a]=!0);r=e!==!1&&sa(r)}while(r&&(!e||e(r,t))&&r!==Object.prototype);return t},T_=(r,t,e)=>{r=String(r),(e===void 0||e>r.length)&&(e=r.length),e-=t.length;const i=r.indexOf(t,e);return i!==-1&&i===e},C_=r=>{if(!r)return null;if(vn(r))return r;let t=r.length;if(!Zh(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=r[t];return e},S_=(r=>t=>r&&t instanceof r)(typeof Uint8Array<"u"&&sa(Uint8Array)),P_=(r,t)=>{const i=(r&&r[Symbol.iterator]).call(r);let n;for(;(n=i.next())&&!n.done;){const o=n.value;t.call(r,o[0],o[1])}},k_=(r,t)=>{let e;const i=[];for(;(e=r.exec(t))!==null;)i.push(e);return i},R_=De("HTMLFormElement"),M_=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,i,n){return i.toUpperCase()+n}),Vh=(({hasOwnProperty:r})=>(t,e)=>r.call(t,e))(Object.prototype),I_=De("RegExp"),Xh=(r,t)=>{const e=Object.getOwnPropertyDescriptors(r),i={};dr(e,(n,o)=>{let a;(a=t(n,o,r))!==!1&&(i[o]=a||n)}),Object.defineProperties(r,i)},A_=r=>{Xh(r,(t,e)=>{if(ye(r)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const i=r[e];if(ye(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},D_=(r,t)=>{const e={},i=n=>{n.forEach(o=>{e[o]=!0})};return vn(r)?i(r):i(String(r).split(t)),e},O_=()=>{},F_=(r,t)=>(r=+r,Number.isFinite(r)?r:t),aa="abcdefghijklmnopqrstuvwxyz",Yh="0123456789",Kh={DIGIT:Yh,ALPHA:aa,ALPHA_DIGIT:aa+aa.toUpperCase()+Yh},z_=(r=16,t=Kh.ALPHA_DIGIT)=>{let e="";const{length:i}=t;for(;r--;)e+=t[Math.random()*i|0];return e};function N_(r){return!!(r&&ye(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}const B_=r=>{const t=new Array(10),e=(i,n)=>{if(_s(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[n]=i;const o=vn(i)?[]:{};return dr(i,(a,h)=>{const c=e(a,n+1);!ur(c)&&(o[h]=c)}),t[n]=void 0,o}}return i};return e(r,0)},G_=De("AsyncFunction"),A={isArray:vn,isArrayBuffer:Uh,isBuffer:h_,isFormData:y_,isArrayBufferView:c_,isString:u_,isNumber:Zh,isBoolean:d_,isObject:_s,isPlainObject:ps,isUndefined:ur,isDate:f_,isFile:g_,isBlob:__,isRegExp:I_,isFunction:ye,isStream:m_,isURLSearchParams:v_,isTypedArray:S_,isFileList:p_,forEach:dr,merge:oa,extend:E_,trim:x_,stripBOM:w_,inherits:L_,toFlatObject:b_,kindOf:fs,kindOfTest:De,endsWith:T_,toArray:C_,forEachEntry:P_,matchAll:k_,isHTMLForm:R_,hasOwnProperty:Vh,hasOwnProp:Vh,reduceDescriptors:Xh,freezeMethods:A_,toObjectSet:D_,toCamelCase:M_,noop:O_,toFiniteNumber:F_,findKey:jh,global:Wh,isContextDefined:Hh,ALPHABET:Kh,generateString:z_,isSpecCompliantForm:N_,toJSONObject:B_,isAsyncFn:G_,isThenable:r=>r&&(_s(r)||ye(r))&&ye(r.then)&&ye(r.catch)};function gt(r,t,e,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),i&&(this.request=i),n&&(this.response=n)}A.inherits(gt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:A.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const qh=gt.prototype,$h={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{$h[r]={value:r}}),Object.defineProperties(gt,$h),Object.defineProperty(qh,"isAxiosError",{value:!0}),gt.from=(r,t,e,i,n,o)=>{const a=Object.create(qh);return A.toFlatObject(r,a,function(c){return c!==Error.prototype},h=>h!=="isAxiosError"),gt.call(a,r.message,t,e,i,n),a.cause=r,a.name=r.name,o&&Object.assign(a,o),a};const U_=null;function la(r){return A.isPlainObject(r)||A.isArray(r)}function Jh(r){return A.endsWith(r,"[]")?r.slice(0,-2):r}function Qh(r,t,e){return r?r.concat(t).map(function(n,o){return n=Jh(n),!e&&o?"["+n+"]":n}).join(e?".":""):t}function Z_(r){return A.isArray(r)&&!r.some(la)}const j_=A.toFlatObject(A,{},null,function(t){return/^is[A-Z]/.test(t)});function ms(r,t,e){if(!A.isObject(r))throw new TypeError("target must be an object");t=t||new FormData,e=A.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,b){return!A.isUndefined(b[E])});const i=e.metaTokens,n=e.visitor||f,o=e.dots,a=e.indexes,c=(e.Blob||typeof Blob<"u"&&Blob)&&A.isSpecCompliantForm(t);if(!A.isFunction(n))throw new TypeError("visitor must be a function");function d(y){if(y===null)return"";if(A.isDate(y))return y.toISOString();if(!c&&A.isBlob(y))throw new gt("Blob is not supported. Use a Buffer instead.");return A.isArrayBuffer(y)||A.isTypedArray(y)?c&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function f(y,E,b){let S=y;if(y&&!b&&typeof y=="object"){if(A.endsWith(E,"{}"))E=i?E:E.slice(0,-2),y=JSON.stringify(y);else if(A.isArray(y)&&Z_(y)||(A.isFileList(y)||A.endsWith(E,"[]"))&&(S=A.toArray(y)))return E=Jh(E),S.forEach(function(T,P){!(A.isUndefined(T)||T===null)&&t.append(a===!0?Qh([E],P,o):a===null?E:E+"[]",d(T))}),!1}return la(y)?!0:(t.append(Qh(b,E,o),d(y)),!1)}const _=[],m=Object.assign(j_,{defaultVisitor:f,convertValue:d,isVisitable:la});function v(y,E){if(!A.isUndefined(y)){if(_.indexOf(y)!==-1)throw Error("Circular reference detected in "+E.join("."));_.push(y),A.forEach(y,function(S,w){(!(A.isUndefined(S)||S===null)&&n.call(t,S,A.isString(w)?w.trim():w,E,m))===!0&&v(S,E?E.concat(w):[w])}),_.pop()}}if(!A.isObject(r))throw new TypeError("data must be an object");return v(r),t}function tc(r){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function ha(r,t){this._pairs=[],r&&ms(r,this,t)}const ec=ha.prototype;ec.append=function(t,e){this._pairs.push([t,e])},ec.toString=function(t){const e=t?function(i){return t.call(this,i,tc)}:tc;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function W_(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ic(r,t,e){if(!t)return r;const i=e&&e.encode||W_,n=e&&e.serialize;let o;if(n?o=n(t,e):o=A.isURLSearchParams(t)?t.toString():new ha(t,e).toString(i),o){const a=r.indexOf("#");a!==-1&&(r=r.slice(0,a)),r+=(r.indexOf("?")===-1?"?":"&")+o}return r}class H_{constructor(){this.handlers=[]}use(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){A.forEach(this.handlers,function(i){i!==null&&t(i)})}}const nc=H_,rc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},V_=typeof URLSearchParams<"u"?URLSearchParams:ha,X_=typeof FormData<"u"?FormData:null,Y_=typeof Blob<"u"?Blob:null,K_=(()=>{let r;return typeof navigator<"u"&&((r=navigator.product)==="ReactNative"||r==="NativeScript"||r==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),q_=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Oe={isBrowser:!0,classes:{URLSearchParams:V_,FormData:X_,Blob:Y_},isStandardBrowserEnv:K_,isStandardBrowserWebWorkerEnv:q_,protocols:["http","https","file","blob","url","data"]};function $_(r,t){return ms(r,new Oe.classes.URLSearchParams,Object.assign({visitor:function(e,i,n,o){return Oe.isNode&&A.isBuffer(e)?(this.append(i,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function J_(r){return A.matchAll(/\w+|\[(\w*)]/g,r).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Q_(r){const t={},e=Object.keys(r);let i;const n=e.length;let o;for(i=0;i<n;i++)o=e[i],t[o]=r[o];return t}function sc(r){function t(e,i,n,o){let a=e[o++];const h=Number.isFinite(+a),c=o>=e.length;return a=!a&&A.isArray(n)?n.length:a,c?(A.hasOwnProp(n,a)?n[a]=[n[a],i]:n[a]=i,!h):((!n[a]||!A.isObject(n[a]))&&(n[a]=[]),t(e,i,n[a],o)&&A.isArray(n[a])&&(n[a]=Q_(n[a])),!h)}if(A.isFormData(r)&&A.isFunction(r.entries)){const e={};return A.forEachEntry(r,(i,n)=>{t(J_(i),n,e,0)}),e}return null}function tp(r,t,e){if(A.isString(r))try{return(t||JSON.parse)(r),A.trim(r)}catch(i){if(i.name!=="SyntaxError")throw i}return(e||JSON.stringify)(r)}const ca={transitional:rc,adapter:["xhr","http"],transformRequest:[function(t,e){const i=e.getContentType()||"",n=i.indexOf("application/json")>-1,o=A.isObject(t);if(o&&A.isHTMLForm(t)&&(t=new FormData(t)),A.isFormData(t))return n&&n?JSON.stringify(sc(t)):t;if(A.isArrayBuffer(t)||A.isBuffer(t)||A.isStream(t)||A.isFile(t)||A.isBlob(t))return t;if(A.isArrayBufferView(t))return t.buffer;if(A.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let h;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return $_(t,this.formSerializer).toString();if((h=A.isFileList(t))||i.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return ms(h?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),tp(t)):t}],transformResponse:[function(t){const e=this.transitional||ca.transitional,i=e&&e.forcedJSONParsing,n=this.responseType==="json";if(t&&A.isString(t)&&(i&&!this.responseType||n)){const a=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(h){if(a)throw h.name==="SyntaxError"?gt.from(h,gt.ERR_BAD_RESPONSE,this,null,this.response):h}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Oe.classes.FormData,Blob:Oe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};A.forEach(["delete","get","head","post","put","patch"],r=>{ca.headers[r]={}});const ua=ca,ep=A.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ip=r=>{const t={};let e,i,n;return r&&r.split(`
14
- `).forEach(function(a){n=a.indexOf(":"),e=a.substring(0,n).trim().toLowerCase(),i=a.substring(n+1).trim(),!(!e||t[e]&&ep[e])&&(e==="set-cookie"?t[e]?t[e].push(i):t[e]=[i]:t[e]=t[e]?t[e]+", "+i:i)}),t},oc=Symbol("internals");function fr(r){return r&&String(r).trim().toLowerCase()}function ys(r){return r===!1||r==null?r:A.isArray(r)?r.map(ys):String(r)}function np(r){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=e.exec(r);)t[i[1]]=i[2];return t}const rp=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function da(r,t,e,i,n){if(A.isFunction(i))return i.call(this,t,e);if(n&&(t=e),!!A.isString(t)){if(A.isString(i))return t.indexOf(i)!==-1;if(A.isRegExp(i))return i.test(t)}}function sp(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,i)=>e.toUpperCase()+i)}function op(r,t){const e=A.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(r,i+e,{value:function(n,o,a){return this[i].call(this,t,n,o,a)},configurable:!0})})}class vs{constructor(t){t&&this.set(t)}set(t,e,i){const n=this;function o(h,c,d){const f=fr(c);if(!f)throw new Error("header name must be a non-empty string");const _=A.findKey(n,f);(!_||n[_]===void 0||d===!0||d===void 0&&n[_]!==!1)&&(n[_||c]=ys(h))}const a=(h,c)=>A.forEach(h,(d,f)=>o(d,f,c));return A.isPlainObject(t)||t instanceof this.constructor?a(t,e):A.isString(t)&&(t=t.trim())&&!rp(t)?a(ip(t),e):t!=null&&o(e,t,i),this}get(t,e){if(t=fr(t),t){const i=A.findKey(this,t);if(i){const n=this[i];if(!e)return n;if(e===!0)return np(n);if(A.isFunction(e))return e.call(this,n,i);if(A.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=fr(t),t){const i=A.findKey(this,t);return!!(i&&this[i]!==void 0&&(!e||da(this,this[i],i,e)))}return!1}delete(t,e){const i=this;let n=!1;function o(a){if(a=fr(a),a){const h=A.findKey(i,a);h&&(!e||da(i,i[h],h,e))&&(delete i[h],n=!0)}}return A.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let i=e.length,n=!1;for(;i--;){const o=e[i];(!t||da(this,this[o],o,t,!0))&&(delete this[o],n=!0)}return n}normalize(t){const e=this,i={};return A.forEach(this,(n,o)=>{const a=A.findKey(i,o);if(a){e[a]=ys(n),delete e[o];return}const h=t?sp(o):String(o).trim();h!==o&&delete e[o],e[h]=ys(n),i[h]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return A.forEach(this,(i,n)=>{i!=null&&i!==!1&&(e[n]=t&&A.isArray(i)?i.join(", "):i)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
15
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const i=new this(t);return e.forEach(n=>i.set(n)),i}static accessor(t){const i=(this[oc]=this[oc]={accessors:{}}).accessors,n=this.prototype;function o(a){const h=fr(a);i[h]||(op(n,a),i[h]=!0)}return A.isArray(t)?t.forEach(o):o(t),this}}vs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),A.reduceDescriptors(vs.prototype,({value:r},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>r,set(i){this[e]=i}}}),A.freezeMethods(vs);const Je=vs;function fa(r,t){const e=this||ua,i=t||e,n=Je.from(i.headers);let o=i.data;return A.forEach(r,function(h){o=h.call(e,o,n.normalize(),t?t.status:void 0)}),n.normalize(),o}function ac(r){return!!(r&&r.__CANCEL__)}function gr(r,t,e){gt.call(this,r??"canceled",gt.ERR_CANCELED,t,e),this.name="CanceledError"}A.inherits(gr,gt,{__CANCEL__:!0});function ap(r,t,e){const i=e.config.validateStatus;!e.status||!i||i(e.status)?r(e):t(new gt("Request failed with status code "+e.status,[gt.ERR_BAD_REQUEST,gt.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}const lp=Oe.isStandardBrowserEnv?function(){return{write:function(e,i,n,o,a,h){const c=[];c.push(e+"="+encodeURIComponent(i)),A.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),A.isString(o)&&c.push("path="+o),A.isString(a)&&c.push("domain="+a),h===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(e){const i=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function hp(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function cp(r,t){return t?r.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):r}function lc(r,t){return r&&!hp(t)?cp(r,t):t}const up=Oe.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let i;function n(o){let a=o;return t&&(e.setAttribute("href",a),a=e.href),e.setAttribute("href",a),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return i=n(window.location.href),function(a){const h=A.isString(a)?n(a):a;return h.protocol===i.protocol&&h.host===i.host}}():function(){return function(){return!0}}();function dp(r){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return t&&t[1]||""}function fp(r,t){r=r||10;const e=new Array(r),i=new Array(r);let n=0,o=0,a;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),f=i[o];a||(a=d),e[n]=c,i[n]=d;let _=o,m=0;for(;_!==n;)m+=e[_++],_=_%r;if(n=(n+1)%r,n===o&&(o=(o+1)%r),d-a<t)return;const v=f&&d-f;return v?Math.round(m*1e3/v):void 0}}function hc(r,t){let e=0;const i=fp(50,250);return n=>{const o=n.loaded,a=n.lengthComputable?n.total:void 0,h=o-e,c=i(h),d=o<=a;e=o;const f={loaded:o,total:a,progress:a?o/a:void 0,bytes:h,rate:c||void 0,estimated:c&&a&&d?(a-o)/c:void 0,event:n};f[t?"download":"upload"]=!0,r(f)}}const ga={http:U_,xhr:typeof XMLHttpRequest<"u"&&function(r){return new Promise(function(e,i){let n=r.data;const o=Je.from(r.headers).normalize(),a=r.responseType;let h;function c(){r.cancelToken&&r.cancelToken.unsubscribe(h),r.signal&&r.signal.removeEventListener("abort",h)}let d;A.isFormData(n)&&(Oe.isStandardBrowserEnv||Oe.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.getContentType(/^\s*multipart\/form-data/)?A.isString(d=o.getContentType())&&o.setContentType(d.replace(/^\s*(multipart\/form-data);+/,"$1")):o.setContentType("multipart/form-data"));let f=new XMLHttpRequest;if(r.auth){const y=r.auth.username||"",E=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";o.set("Authorization","Basic "+btoa(y+":"+E))}const _=lc(r.baseURL,r.url);f.open(r.method.toUpperCase(),ic(_,r.params,r.paramsSerializer),!0),f.timeout=r.timeout;function m(){if(!f)return;const y=Je.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),b={data:!a||a==="text"||a==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:y,config:r,request:f};ap(function(w){e(w),c()},function(w){i(w),c()},b),f=null}if("onloadend"in f?f.onloadend=m:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(m)},f.onabort=function(){f&&(i(new gt("Request aborted",gt.ECONNABORTED,r,f)),f=null)},f.onerror=function(){i(new gt("Network Error",gt.ERR_NETWORK,r,f)),f=null},f.ontimeout=function(){let E=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const b=r.transitional||rc;r.timeoutErrorMessage&&(E=r.timeoutErrorMessage),i(new gt(E,b.clarifyTimeoutError?gt.ETIMEDOUT:gt.ECONNABORTED,r,f)),f=null},Oe.isStandardBrowserEnv){const y=(r.withCredentials||up(_))&&r.xsrfCookieName&&lp.read(r.xsrfCookieName);y&&o.set(r.xsrfHeaderName,y)}n===void 0&&o.setContentType(null),"setRequestHeader"in f&&A.forEach(o.toJSON(),function(E,b){f.setRequestHeader(b,E)}),A.isUndefined(r.withCredentials)||(f.withCredentials=!!r.withCredentials),a&&a!=="json"&&(f.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&f.addEventListener("progress",hc(r.onDownloadProgress,!0)),typeof r.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",hc(r.onUploadProgress)),(r.cancelToken||r.signal)&&(h=y=>{f&&(i(!y||y.type?new gr(null,r,f):y),f.abort(),f=null)},r.cancelToken&&r.cancelToken.subscribe(h),r.signal&&(r.signal.aborted?h():r.signal.addEventListener("abort",h)));const v=dp(_);if(v&&Oe.protocols.indexOf(v)===-1){i(new gt("Unsupported protocol "+v+":",gt.ERR_BAD_REQUEST,r));return}f.send(n||null)})}};A.forEach(ga,(r,t)=>{if(r){try{Object.defineProperty(r,"name",{value:t})}catch{}Object.defineProperty(r,"adapterName",{value:t})}});const cc=r=>`- ${r}`,gp=r=>A.isFunction(r)||r===null||r===!1,uc={getAdapter:r=>{r=A.isArray(r)?r:[r];const{length:t}=r;let e,i;const n={};for(let o=0;o<t;o++){e=r[o];let a;if(i=e,!gp(e)&&(i=ga[(a=String(e)).toLowerCase()],i===void 0))throw new gt(`Unknown adapter '${a}'`);if(i)break;n[a||"#"+o]=i}if(!i){const o=Object.entries(n).map(([h,c])=>`adapter ${h} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since :
16
- `+o.map(cc).join(`
17
- `):" "+cc(o[0]):"as no adapter specified";throw new gt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return i},adapters:ga};function _a(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new gr(null,r)}function dc(r){return _a(r),r.headers=Je.from(r.headers),r.data=fa.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),uc.getAdapter(r.adapter||ua.adapter)(r).then(function(i){return _a(r),i.data=fa.call(r,r.transformResponse,i),i.headers=Je.from(i.headers),i},function(i){return ac(i)||(_a(r),i&&i.response&&(i.response.data=fa.call(r,r.transformResponse,i.response),i.response.headers=Je.from(i.response.headers))),Promise.reject(i)})}const fc=r=>r instanceof Je?r.toJSON():r;function xn(r,t){t=t||{};const e={};function i(d,f,_){return A.isPlainObject(d)&&A.isPlainObject(f)?A.merge.call({caseless:_},d,f):A.isPlainObject(f)?A.merge({},f):A.isArray(f)?f.slice():f}function n(d,f,_){if(A.isUndefined(f)){if(!A.isUndefined(d))return i(void 0,d,_)}else return i(d,f,_)}function o(d,f){if(!A.isUndefined(f))return i(void 0,f)}function a(d,f){if(A.isUndefined(f)){if(!A.isUndefined(d))return i(void 0,d)}else return i(void 0,f)}function h(d,f,_){if(_ in t)return i(d,f);if(_ in r)return i(void 0,d)}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:h,headers:(d,f)=>n(fc(d),fc(f),!0)};return A.forEach(Object.keys(Object.assign({},r,t)),function(f){const _=c[f]||n,m=_(r[f],t[f],f);A.isUndefined(m)&&_!==h||(e[f]=m)}),e}const gc="1.5.1",pa={};["object","boolean","number","function","string","symbol"].forEach((r,t)=>{pa[r]=function(i){return typeof i===r||"a"+(t<1?"n ":" ")+r}});const _c={};pa.transitional=function(t,e,i){function n(o,a){return"[Axios v"+gc+"] Transitional option '"+o+"'"+a+(i?". "+i:"")}return(o,a,h)=>{if(t===!1)throw new gt(n(a," has been removed"+(e?" in "+e:"")),gt.ERR_DEPRECATED);return e&&!_c[a]&&(_c[a]=!0,console.warn(n(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(o,a,h):!0}};function _p(r,t,e){if(typeof r!="object")throw new gt("options must be an object",gt.ERR_BAD_OPTION_VALUE);const i=Object.keys(r);let n=i.length;for(;n-- >0;){const o=i[n],a=t[o];if(a){const h=r[o],c=h===void 0||a(h,o,r);if(c!==!0)throw new gt("option "+o+" must be "+c,gt.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new gt("Unknown option "+o,gt.ERR_BAD_OPTION)}}const ma={assertOptions:_p,validators:pa},vi=ma.validators;class xs{constructor(t){this.defaults=t,this.interceptors={request:new nc,response:new nc}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=xn(this.defaults,e);const{transitional:i,paramsSerializer:n,headers:o}=e;i!==void 0&&ma.assertOptions(i,{silentJSONParsing:vi.transitional(vi.boolean),forcedJSONParsing:vi.transitional(vi.boolean),clarifyTimeoutError:vi.transitional(vi.boolean)},!1),n!=null&&(A.isFunction(n)?e.paramsSerializer={serialize:n}:ma.assertOptions(n,{encode:vi.function,serialize:vi.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=o&&A.merge(o.common,o[e.method]);o&&A.forEach(["delete","get","head","post","put","patch","common"],y=>{delete o[y]}),e.headers=Je.concat(a,o);const h=[];let c=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(e)===!1||(c=c&&E.synchronous,h.unshift(E.fulfilled,E.rejected))});const d=[];this.interceptors.response.forEach(function(E){d.push(E.fulfilled,E.rejected)});let f,_=0,m;if(!c){const y=[dc.bind(this),void 0];for(y.unshift.apply(y,h),y.push.apply(y,d),m=y.length,f=Promise.resolve(e);_<m;)f=f.then(y[_++],y[_++]);return f}m=h.length;let v=e;for(_=0;_<m;){const y=h[_++],E=h[_++];try{v=y(v)}catch(b){E.call(this,b);break}}try{f=dc.call(this,v)}catch(y){return Promise.reject(y)}for(_=0,m=d.length;_<m;)f=f.then(d[_++],d[_++]);return f}getUri(t){t=xn(this.defaults,t);const e=lc(t.baseURL,t.url);return ic(e,t.params,t.paramsSerializer)}}A.forEach(["delete","get","head","options"],function(t){xs.prototype[t]=function(e,i){return this.request(xn(i||{},{method:t,url:e,data:(i||{}).data}))}}),A.forEach(["post","put","patch"],function(t){function e(i){return function(o,a,h){return this.request(xn(h||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}xs.prototype[t]=e(),xs.prototype[t+"Form"]=e(!0)});const Es=xs;class ya{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(o){e=o});const i=this;this.promise.then(n=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](n);i._listeners=null}),this.promise.then=n=>{let o;const a=new Promise(h=>{i.subscribe(h),o=h}).then(n);return a.cancel=function(){i.unsubscribe(o)},a},t(function(o,a,h){i.reason||(i.reason=new gr(o,a,h),e(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}static source(){let t;return{token:new ya(function(n){t=n}),cancel:t}}}const pp=ya;function mp(r){return function(e){return r.apply(null,e)}}function yp(r){return A.isObject(r)&&r.isAxiosError===!0}const va={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(va).forEach(([r,t])=>{va[t]=r});const vp=va;function pc(r){const t=new Es(r),e=Gh(Es.prototype.request,t);return A.extend(e,Es.prototype,t,{allOwnKeys:!0}),A.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return pc(xn(r,n))},e}const Dt=pc(ua);Dt.Axios=Es,Dt.CanceledError=gr,Dt.CancelToken=pp,Dt.isCancel=ac,Dt.VERSION=gc,Dt.toFormData=ms,Dt.AxiosError=gt,Dt.Cancel=Dt.CanceledError,Dt.all=function(t){return Promise.all(t)},Dt.spread=mp,Dt.isAxiosError=yp,Dt.mergeConfig=xn,Dt.AxiosHeaders=Je,Dt.formToJSON=r=>sc(A.isHTMLForm(r)?new FormData(r):r),Dt.getAdapter=uc.getAdapter,Dt.HttpStatusCode=vp,Dt.default=Dt;const mc=Dt;pt.Edit.Circle=pt.Edit.CircleMarker.extend({_createResizeMarker:function(){var r=this._shape.getLatLng(),t=this._getResizeMarkerPoint(r);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(t,this.options.resizeIcon))},_getResizeMarkerPoint:function(r){var t=this._shape._radius*Math.cos(Math.PI/4),e=this._map.project(r);return this._map.unproject([e.x+t,e.y-t])},_resize:function(r){var t=this._moveMarker.getLatLng(),e;pt.GeometryUtil.isVersion07x()?e=t.distanceTo(r):e=this._map.distance(t,r),this._shape.setRadius(e),this._map.fire(pt.Draw.Event.EDITRESIZE,{layer:this._shape})}});const xp=G.defineComponent({name:"MapView",props:{loadPolygon:Boolean,reverseCoordinatesPolygon:Boolean,dataPolygon:Object,configurationMap:Object,coordinatesMap:Array,getGeoJSON:Function,getCoodMarker:Function},data(){return{idMap:"",mapRender:null,markerRender:null,renderCoordinates:this.coordinatesMap,renderGeojson:this.dataPolygon,markerIcon:{iconUrl:ss,iconSize:[25,41],iconAnchor:[12,41]},layersFeatureGroup:null,featuresData:null}},mounted(){this.makeid(10),this.renderMap()},methods:{getLayersFeaturesInGeoJson(){const r=pt.geoJSON().addTo(this.mapRender);return this.featuresData.eachLayer(e=>{r.addLayer(e)}),[r.toGeoJSON()]},triggerSaveEdit(){var t,e,i;(i=(e=(t=(document.getElementsByClassName("leaflet-draw-actions leaflet-draw-actions-top")||document.getElementsByClassName("leaflet-draw-actions leaflet-draw-actions-top leaflet-draw-actions-bottom"))[0])==null?void 0:t.querySelector("li"))==null?void 0:e.querySelector("a"))==null||i.click()},makeid(r){let t="";const e="abcdefghijklmnopqrstuvwxyz",i=e.length;let n=0;for(;n<r;)t+=e.charAt(Math.floor(Math.random()*i)),n+=1;this.idMap=t},renderMap(){a_("es"),setTimeout(()=>{this.loadPolygon?this.viewMap():this.createMap()},500)},createMap(){var a,h,c,d,f,_,m,v;const r=this.configurationMap?this.configurationMap.iconMarker?this.configurationMap.iconMarker:this.markerIcon:this.markerIcon;window.type=!0;const t=pt.map(this.idMap,{fullscreenControl:!0}).setView([this.renderCoordinates?this.renderCoordinates[0]:0,this.renderCoordinates?this.renderCoordinates[1]:0],this.renderCoordinates?this.renderCoordinates[2]:0);if(this.mapRender=t,pt.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(t),t.setZoom((a=this.configurationMap)==null?void 0:a.maxZoom),this.configurationMap.renderMarker){const y=pt.marker([this.renderCoordinates?this.renderCoordinates[0]:0,this.renderCoordinates?this.renderCoordinates[1]:0],{icon:pt.icon(r),draggable:this.configurationMap.dragMarker}).addTo(t);this.markerRender=y,this.getCoodMarker&&y.on("dragend",E=>{const b=E.target.getLatLng(),S=b.lat,w=b.lng;this.getCoodMarker&&this.getCoodMarker(S,w)})}const e=pt.featureGroup();this.featuresData=e;const i=e.addTo(t);let n={featureGroup:i,edit:!1,remove:(h=this.configurationMap)==null?void 0:h.editFigures.remove};(c=this.configurationMap)!=null&&c.editFigures.edit&&(n={featureGroup:i,...(d=this.configurationMap)==null?void 0:d.editFigures.edit,remove:(f=this.configurationMap)==null?void 0:f.editFigures.remove});const o=new pt.Control.Draw({position:"topleft",draw:{polygon:(_=this.configurationMap)==null?void 0:_.createFigures.polygon,circle:!1,rectangle:(m=this.configurationMap)!=null&&m.createFigures.rectangle?{shapeOptions:{color:"blue"}}:!1,marker:(v=this.configurationMap)!=null&&v.createFigures.marker?{icon:pt.icon(r)}:!1,polyline:!1,circlemarker:!1},edit:n});t.addControl(o),t.on("draw:created",y=>{const E=y.layer;i.addLayer(E);const b=E.toGeoJSON();this.getGeoJSON&&this.getGeoJSON([b])}),t.on("draw:edited",y=>{y.layers.eachLayer(b=>{const S=b.toGeoJSON();this.getGeoJSON&&this.getGeoJSON([S])})})},viewMap(){var h,c,d,f,_,m,v,y;const r=this.configurationMap?this.configurationMap.iconMarker?this.configurationMap.iconMarker:this.markerIcon:this.markerIcon;window.type=!0;const t=pt.map(this.idMap,{fullscreenControl:!0}).setView([this.renderCoordinates?this.renderCoordinates[0]:0,this.renderCoordinates?this.renderCoordinates[1]:0],this.renderCoordinates?this.renderCoordinates[2]:0);this.mapRender=t,pt.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(t),t.setZoom((h=this.configurationMap)==null?void 0:h.maxZoom);const e=pt.featureGroup();this.featuresData=e;const i=e.addTo(t);let n={featureGroup:i,edit:!1,remove:(c=this.configurationMap)==null?void 0:c.editFigures.remove};(d=this.configurationMap)!=null&&d.editFigures.edit&&(n={featureGroup:i,...(f=this.configurationMap)==null?void 0:f.editFigures.edit,remove:(_=this.configurationMap)==null?void 0:_.editFigures.remove});const o=this.renderGeojson;if(o&&o.length){o.forEach(b=>{b.type==="FeatureCollection"?b.features.forEach(S=>{(S.geometry.type==="Polygon"||S.geometry.type==="MultiPolygon")&&pt.geoJson(S,{onEachFeature:function(w,T){i.addLayer(T)}})}):b.type==="Feature"&&(b.geometry.type==="Polygon"||b.geometry.type==="MultiPolygon")&&pt.geoJson(b,{onEachFeature:function(S,w){i.addLayer(w)}})});const E=i.getBounds();t.fitBounds(E)}const a=new pt.Control.Draw({position:"topleft",draw:{polygon:(m=this.configurationMap)==null?void 0:m.createFigures.polygon,circle:!1,rectangle:(v=this.configurationMap)!=null&&v.createFigures.rectangle?{shapeOptions:{color:"blue"}}:!1,marker:(y=this.configurationMap)!=null&&y.createFigures.marker?{icon:pt.icon(r)}:!1,polyline:!1,circlemarker:!1},edit:n});t.addControl(a),t.on("draw:created",E=>{const b=E.layer;i.addLayer(b);const S=b.toGeoJSON();this.getGeoJSON&&this.getGeoJSON(S)}),t.on("draw:edited",E=>{E.layers.eachLayer(S=>{const w=S.toGeoJSON();this.getGeoJSON&&this.getGeoJSON(w)})})},async searchAddress(r){const t=await mc.get(location.protocol+"//nominatim.openstreetmap.org/search?",{params:{q:r,limit:1,format:"json"}});if(t.data.length===1){const e=parseFloat(t.data[0].lat),n={lng:parseFloat(t.data[0].lon),lat:e};return this.setCoordinates({...n,moveMarker:!0}),t.data[0]}return t.data},setCoordinates({lat:r,lng:t}){if(this.mapRender){const e=pt.latLng(r,t);this.mapRender.panTo(e,{animate:!0,duration:.5})}}},watch:{coordinatesMap(r){if(this.renderCoordinates=r,this.mapRender&&this.markerRender){const t=pt.latLng([r[0],r[1]]);this.mapRender.setView([r[0],r[1]],r[2]),this.markerRender.setLatLng(t)}},dataPolygon(r){this.renderGeojson=r}}}),Ep=["id"];function wp(r,t,e,i,n,o){var a;return G.openBlock(),G.createElementBlock("div",{class:"map-container",style:G.normalizeStyle(`height:${(a=r.configurationMap)==null?void 0:a.height}`)},[G.createElementVNode("div",{id:r.idMap,style:{height:"100%"}},null,8,Ep)],4)}const Lp=ra(xp,[["render",wp]]),bp=["id"],Tp=G.defineComponent({__name:"MapSearchAddress",props:{configurationMap:{default:()=>({height:"250px",maxZoom:20,iconMarker:{iconUrl:ss,iconSize:[25,41],iconAnchor:[12,41],class:"",type:"image"},dragMarker:!0})},coordinatesMap:{default:()=>({lat:-19.0429,lng:-65.2554,zoom:12})}},emits:["updated:coordsMarker"],setup(r,{expose:t,emit:e}){const i=r,n=G.ref(),o=G.ref(i.coordinatesMap),a=G.ref(),h=G.ref();G.onMounted(async()=>{await c(10),await d()});const c=async y=>{let E="";const b="abcdefghijklmnopqrstuvwxyz",S=b.length;let w=0;for(;w<y;)E+=b.charAt(Math.floor(Math.random()*S)),w+=1;n.value=E},d=async()=>{await f()},f=async()=>{var b,S;const y=(b=i.configurationMap)==null?void 0:b.iconMarker,E=pt.map(n.value,{fullscreenControl:!0}).setView([o.value.lat,o.value.lng],o.value.zoom);if(E.invalidateSize(),a.value=E,pt.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:(S=i.configurationMap)==null?void 0:S.maxZoom,attribution:'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(E),y.type==="image"){const w=pt.marker([o.value.lat,o.value.lng],{icon:pt.icon({iconUrl:y.iconUrl,iconAnchor:y.iconAnchor,iconSize:y.iconSize,className:y.class}),draggable:i.configurationMap.dragMarker}).addTo(E);h.value=w,w.on("dragend",T=>{const P=T.target.getLatLng(),M=P.lat,I=P.lng;m({lat:M,lng:I})})}else if(y.type==="svg"){const w=pt.marker([o.value.lat,o.value.lng],{icon:pt.divIcon({html:y.iconUrl,iconAnchor:y.iconAnchor,iconSize:y.iconSize,className:y.class}),draggable:i.configurationMap.dragMarker}).addTo(E);h.value=w,w.on("dragend",T=>{const P=T.target.getLatLng(),M=P.lat,I=P.lng;m({lat:M,lng:I})})}},_=async y=>{const E=await mc.get(location.protocol+"//nominatim.openstreetmap.org/search?",{params:{q:y,limit:1,format:"json"}});if(E.data.length===1){const b=parseFloat(E.data[0].lat),w={lng:parseFloat(E.data[0].lon),lat:b};return m({...w,moveMarker:!0}),E.data[0]}return E.data},m=({lat:y,lng:E,moveMarker:b=!1})=>{var S;e("updated:coordsMarker",{lat:y,lng:E}),b&&((S=h.value)==null||S.setLatLng({lat:y,lng:E})),v({lat:y,lng:E})},v=({lat:y,lng:E})=>{const b=pt.latLng(y,E);a.value.panTo(b,{animate:!0,duration:.5})};return t({searchAddress:_}),(y,E)=>{var b;return G.openBlock(),G.createElementBlock("div",{class:"map-container",style:G.normalizeStyle(`height:${(b=y.configurationMap)==null?void 0:b.height}`)},[G.createElementVNode("div",{id:n.value,style:{height:"100%"}},null,8,bp)],4)}}}),OL="";class Cp{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const Qe=Cp,En={PROPERTYCHANGE:"propertychange"};class Sp{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}const ws=Sp;function Pp(r,t,e){let i,n;e=e||xi;let o=0,a=r.length,h=!1;for(;o<a;)i=o+(a-o>>1),n=+e(r[i],t),n<0?o=i+1:(a=i,h=!n);return h?o:~o}function xi(r,t){return r>t?1:r<t?-1:0}function xa(r,t,e){if(r[0]<=t)return 0;const i=r.length;if(t<=r[i-1])return i-1;if(typeof e=="function"){for(let n=1;n<i;++n){const o=r[n];if(o===t)return n;if(o<t)return e(t,r[n-1],o)>0?n-1:n}return i-1}if(e>0){for(let n=1;n<i;++n)if(r[n]<t)return n-1;return i-1}if(e<0){for(let n=1;n<i;++n)if(r[n]<=t)return n;return i-1}for(let n=1;n<i;++n){if(r[n]==t)return n;if(r[n]<t)return r[n-1]-t<t-r[n]?n-1:n}return i-1}function kp(r,t,e){for(;t<e;){const i=r[t];r[t]=r[e],r[e]=i,++t,--e}}function ti(r,t){const e=Array.isArray(t)?t:[t],i=e.length;for(let n=0;n<i;n++)r[r.length]=e[n]}function ei(r,t){const e=r.length;if(e!==t.length)return!1;for(let i=0;i<e;i++)if(r[i]!==t[i])return!1;return!0}function Rp(r,t,e){const i=t||xi;return r.every(function(n,o){if(o===0)return!0;const a=i(r[o-1],n);return!(a>0||e&&a===0)})}function _r(){return!0}function Ls(){return!1}function wn(){}function Mp(r){let t=!1,e,i,n;return function(){const o=Array.prototype.slice.call(arguments);return(!t||this!==n||!ei(o,i))&&(t=!0,n=this,i=o,e=r.apply(this,arguments)),e}}function Ln(r){for(const t in r)delete r[t]}function bn(r){let t;for(t in r)return!1;return!t}class Ip extends ws{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);n.includes(e)||n.push(e)}dispatchEvent(t){const e=typeof t=="string",i=e?t:t.type,n=this.listeners_&&this.listeners_[i];if(!n)return;const o=e?new Qe(t):t;o.target||(o.target=this.eventTarget_||this);const a=this.dispatching_||(this.dispatching_={}),h=this.pendingRemovals_||(this.pendingRemovals_={});i in a||(a[i]=0,h[i]=0),++a[i];let c;for(let d=0,f=n.length;d<f;++d)if("handleEvent"in n[d]?c=n[d].handleEvent(o):c=n[d].call(this,o),c===!1||o.propagationStopped){c=!1;break}if(--a[i]===0){let d=h[i];for(delete h[i];d--;)this.removeEventListener(i,wn);delete a[i]}return c}disposeInternal(){this.listeners_&&Ln(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){const i=this.listeners_&&this.listeners_[t];if(i){const n=i.indexOf(e);n!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=wn,++this.pendingRemovals_[t]):(i.splice(n,1),i.length===0&&delete this.listeners_[t]))}}}const bs=Ip,rt={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function ht(r,t,e,i,n){if(i&&i!==r&&(e=e.bind(i)),n){const a=e;e=function(){r.removeEventListener(t,e),a.apply(this,arguments)}}const o={target:r,type:t,listener:e};return r.addEventListener(t,e),o}function Ts(r,t,e,i){return ht(r,t,e,i,!0)}function wt(r){r&&r.target&&(r.target.removeEventListener(r.type,r.listener),Ln(r))}class Cs extends bs{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(rt.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,n=new Array(i);for(let o=0;o<i;++o)n[o]=ht(this,t[o],e);return n}return ht(this,t,e)}onceInternal(t,e){let i;if(Array.isArray(t)){const n=t.length;i=new Array(n);for(let o=0;o<n;++o)i[o]=Ts(this,t[o],e)}else i=Ts(this,t,e);return e.ol_key=i,i}unInternal(t,e){const i=e.ol_key;if(i)Ap(i);else if(Array.isArray(t))for(let n=0,o=t.length;n<o;++n)this.removeEventListener(t[n],e);else this.removeEventListener(t,e)}}Cs.prototype.on,Cs.prototype.once,Cs.prototype.un;function Ap(r){if(Array.isArray(r))for(let t=0,e=r.length;t<e;++t)wt(r[t]);else wt(r)}const yc=Cs;function it(){throw new Error("Unimplemented abstract method.")}let Dp=0;function at(r){return r.ol_uid||(r.ol_uid=String(++Dp))}class vc extends Qe{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}class Op extends yc{constructor(t){super(),this.on,this.once,this.un,at(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 i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new vc(i,t,e)),i=En.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new vc(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){const n=this.values_||(this.values_={});if(i)n[t]=e;else{const o=n[t];n[t]=e,o!==e&&this.notify(t,o)}}setProperties(t,e){for(const i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const i=this.values_[t];delete this.values_[t],bn(this.values_)&&(this.values_=null),e||this.notify(t,i)}}}const be=Op,Ut={ANIMATING:0,INTERACTING:1},Te={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},Fp=42,Ea=256,pr={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class zp{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_||pr[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 xc=zp,mr=6378137,Tn=Math.PI*mr,Np=[-Tn,-Tn,Tn,Tn],Bp=[-180,-85,180,85],Ss=mr*Math.log(Math.tan(Math.PI/2));class Cn extends xc{constructor(t){super({code:t,units:"m",extent:Np,global:!0,worldExtent:Bp,getPointResolution:function(e,i){return e/Math.cosh(i[1]/mr)}})}}const Ec=[new Cn("EPSG:3857"),new Cn("EPSG:102100"),new Cn("EPSG:102113"),new Cn("EPSG:900913"),new Cn("http://www.opengis.net/def/crs/EPSG/0/3857"),new Cn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Gp(r,t,e){const i=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(i));for(let n=0;n<i;n+=e){t[n]=Tn*r[n]/180;let o=mr*Math.log(Math.tan(Math.PI*(+r[n+1]+90)/360));o>Ss?o=Ss:o<-Ss&&(o=-Ss),t[n+1]=o}return t}function Up(r,t,e){const i=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(i));for(let n=0;n<i;n+=e)t[n]=180*r[n]/Tn,t[n+1]=360*Math.atan(Math.exp(r[n+1]/mr))/Math.PI-90;return t}const Zp=6378137,wc=[-180,-90,180,90],jp=Math.PI*Zp/180;class Vi extends xc{constructor(t,e){super({code:t,units:"degrees",extent:wc,axisOrientation:e,global:!0,metersPerUnit:jp,worldExtent:wc})}}const Lc=[new Vi("CRS:84"),new Vi("EPSG:4326","neu"),new Vi("urn:ogc:def:crs:OGC:1.3:CRS84"),new Vi("urn:ogc:def:crs:OGC:2:84"),new Vi("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Vi("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Vi("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let wa={};function Wp(r){return wa[r]||wa[r.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Hp(r,t){wa[r]=t}let Sn={};function Ps(r,t,e){const i=r.getCode(),n=t.getCode();i in Sn||(Sn[i]={}),Sn[i][n]=e}function Vp(r,t){let e;return r in Sn&&t in Sn[r]&&(e=Sn[r][t]),e}const Zt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function bc(r){const t=ge();for(let e=0,i=r.length;e<i;++e)vr(t,r[e]);return t}function ks(r,t,e){return e?(e[0]=r[0]-t,e[1]=r[1]-t,e[2]=r[2]+t,e[3]=r[3]+t,e):[r[0]-t,r[1]-t,r[2]+t,r[3]+t]}function Tc(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r.slice()}function Xi(r,t,e){let i,n;return t<r[0]?i=r[0]-t:r[2]<t?i=t-r[2]:i=0,e<r[1]?n=r[1]-e:r[3]<e?n=e-r[3]:n=0,i*i+n*n}function Rs(r,t){return La(r,t[0],t[1])}function Yi(r,t){return r[0]<=t[0]&&t[2]<=r[2]&&r[1]<=t[1]&&t[3]<=r[3]}function La(r,t,e){return r[0]<=t&&t<=r[2]&&r[1]<=e&&e<=r[3]}function ba(r,t){const e=r[0],i=r[1],n=r[2],o=r[3],a=t[0],h=t[1];let c=Zt.UNKNOWN;return a<e?c=c|Zt.LEFT:a>n&&(c=c|Zt.RIGHT),h<i?c=c|Zt.BELOW:h>o&&(c=c|Zt.ABOVE),c===Zt.UNKNOWN&&(c=Zt.INTERSECTING),c}function ge(){return[1/0,1/0,-1/0,-1/0]}function Ei(r,t,e,i,n){return n?(n[0]=r,n[1]=t,n[2]=e,n[3]=i,n):[r,t,e,i]}function yr(r){return Ei(1/0,1/0,-1/0,-1/0,r)}function Xp(r,t){const e=r[0],i=r[1];return Ei(e,i,e,i,t)}function Cc(r,t,e,i,n){const o=yr(n);return Pc(o,r,t,e,i)}function Pn(r,t){return r[0]==t[0]&&r[2]==t[2]&&r[1]==t[1]&&r[3]==t[3]}function Sc(r,t){return t[0]<r[0]&&(r[0]=t[0]),t[2]>r[2]&&(r[2]=t[2]),t[1]<r[1]&&(r[1]=t[1]),t[3]>r[3]&&(r[3]=t[3]),r}function vr(r,t){t[0]<r[0]&&(r[0]=t[0]),t[0]>r[2]&&(r[2]=t[0]),t[1]<r[1]&&(r[1]=t[1]),t[1]>r[3]&&(r[3]=t[1])}function Pc(r,t,e,i,n){for(;e<i;e+=n)Yp(r,t[e],t[e+1]);return r}function Yp(r,t,e){r[0]=Math.min(r[0],t),r[1]=Math.min(r[1],e),r[2]=Math.max(r[2],t),r[3]=Math.max(r[3],e)}function kc(r,t){let e;return e=t(Ms(r)),e||(e=t(Is(r)),e)||(e=t(As(r)),e)||(e=t(qi(r)),e)?e:!1}function Ta(r){let t=0;return Ds(r)||(t=Tt(r)*Fe(r)),t}function Ms(r){return[r[0],r[1]]}function Is(r){return[r[2],r[1]]}function Ki(r){return[(r[0]+r[2])/2,(r[1]+r[3])/2]}function Kp(r,t){let e;if(t==="bottom-left")e=Ms(r);else if(t==="bottom-right")e=Is(r);else if(t==="top-left")e=qi(r);else if(t==="top-right")e=As(r);else throw new Error("Invalid corner");return e}function Ca(r,t,e,i,n){const[o,a,h,c,d,f,_,m]=Sa(r,t,e,i);return Ei(Math.min(o,h,d,_),Math.min(a,c,f,m),Math.max(o,h,d,_),Math.max(a,c,f,m),n)}function Sa(r,t,e,i){const n=t*i[0]/2,o=t*i[1]/2,a=Math.cos(e),h=Math.sin(e),c=n*a,d=n*h,f=o*a,_=o*h,m=r[0],v=r[1];return[m-c+_,v-d-f,m-c-_,v-d+f,m+c-_,v+d+f,m+c+_,v+d-f,m-c+_,v-d-f]}function Fe(r){return r[3]-r[1]}function xr(r,t,e){const i=e||ge();return se(r,t)?(r[0]>t[0]?i[0]=r[0]:i[0]=t[0],r[1]>t[1]?i[1]=r[1]:i[1]=t[1],r[2]<t[2]?i[2]=r[2]:i[2]=t[2],r[3]<t[3]?i[3]=r[3]:i[3]=t[3]):yr(i),i}function qi(r){return[r[0],r[3]]}function As(r){return[r[2],r[3]]}function Tt(r){return r[2]-r[0]}function se(r,t){return r[0]<=t[2]&&r[2]>=t[0]&&r[1]<=t[3]&&r[3]>=t[1]}function Ds(r){return r[2]<r[0]||r[3]<r[1]}function qp(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r}function $p(r,t,e){let i=!1;const n=ba(r,t),o=ba(r,e);if(n===Zt.INTERSECTING||o===Zt.INTERSECTING)i=!0;else{const a=r[0],h=r[1],c=r[2],d=r[3],f=t[0],_=t[1],m=e[0],v=e[1],y=(v-_)/(m-f);let E,b;o&Zt.ABOVE&&!(n&Zt.ABOVE)&&(E=m-(v-d)/y,i=E>=a&&E<=c),!i&&o&Zt.RIGHT&&!(n&Zt.RIGHT)&&(b=v-(m-c)*y,i=b>=h&&b<=d),!i&&o&Zt.BELOW&&!(n&Zt.BELOW)&&(E=m-(v-h)/y,i=E>=a&&E<=c),!i&&o&Zt.LEFT&&!(n&Zt.LEFT)&&(b=v-(m-a)*y,i=b>=h&&b<=d)}return i}function Rc(r,t){const e=t.getExtent(),i=Ki(r);if(t.canWrapX()&&(i[0]<e[0]||i[0]>=e[2])){const n=Tt(e),a=Math.floor((i[0]-e[0])/n)*n;r[0]-=a,r[2]-=a}return r}function Jp(r,t){if(t.canWrapX()){const e=t.getExtent();if(!isFinite(r[0])||!isFinite(r[2]))return[[e[0],r[1],e[2],r[3]]];Rc(r,t);const i=Tt(e);if(Tt(r)>i)return[[e[0],r[1],e[2],r[3]]];if(r[0]<e[0])return[[r[0]+i,r[1],e[2],r[3]],[e[0],r[1],r[2],r[3]]];if(r[2]>e[2])return[[r[0],r[1],e[2],r[3]],[e[0],r[1],r[2]-i,r[3]]]}return[r]}function It(r,t,e){return Math.min(Math.max(r,t),e)}function Qp(r,t,e,i,n,o){const a=n-e,h=o-i;if(a!==0||h!==0){const c=((r-e)*a+(t-i)*h)/(a*a+h*h);c>1?(e=n,i=o):c>0&&(e+=a*c,i+=h*c)}return $i(r,t,e,i)}function $i(r,t,e,i){const n=e-r,o=i-t;return n*n+o*o}function tm(r){const t=r.length;for(let i=0;i<t;i++){let n=i,o=Math.abs(r[i][i]);for(let h=i+1;h<t;h++){const c=Math.abs(r[h][i]);c>o&&(o=c,n=h)}if(o===0)return null;const a=r[n];r[n]=r[i],r[i]=a;for(let h=i+1;h<t;h++){const c=-r[h][i]/r[i][i];for(let d=i;d<t+1;d++)i==d?r[h][d]=0:r[h][d]+=c*r[i][d]}}const e=new Array(t);for(let i=t-1;i>=0;i--){e[i]=r[i][t]/r[i][i];for(let n=i-1;n>=0;n--)r[n][t]-=r[n][i]*e[i]}return e}function Os(r){return r*Math.PI/180}function kn(r,t){const e=r%t;return e*t<0?e+t:e}function _e(r,t,e){return r+e*(t-r)}function Pa(r,t){const e=Math.pow(10,t);return Math.round(r*e)/e}function Fs(r,t){return Math.floor(Pa(r,t))}function zs(r,t){return Math.ceil(Pa(r,t))}function em(r,t){return r[0]+=+t[0],r[1]+=+t[1],r}function Ns(r,t){let e=!0;for(let i=r.length-1;i>=0;--i)if(r[i]!=t[i]){e=!1;break}return e}function ka(r,t){const e=Math.cos(t),i=Math.sin(t),n=r[0]*e-r[1]*i,o=r[1]*e+r[0]*i;return r[0]=n,r[1]=o,r}function im(r,t){return r[0]*=t,r[1]*=t,r}function Mc(r,t){if(t.canWrapX()){const e=Tt(t.getExtent()),i=nm(r,t,e);i&&(r[0]-=i*e)}return r}function nm(r,t,e){const i=t.getExtent();let n=0;return t.canWrapX()&&(r[0]<i[0]||r[0]>i[2])&&(e=e||Tt(i),n=Math.floor((r[0]-i[0])/e)),n}const rm=63710088e-1;function Ic(r,t,e){e=e||rm;const i=Os(r[1]),n=Os(t[1]),o=(n-i)/2,a=Os(t[0]-r[0])/2,h=Math.sin(o)*Math.sin(o)+Math.sin(a)*Math.sin(a)*Math.cos(i)*Math.cos(n);return 2*e*Math.atan2(Math.sqrt(h),Math.sqrt(1-h))}const Ac={info:1,warn:2,error:3,none:4};let sm=Ac.info;function Dc(...r){sm>Ac.warn||console.warn(...r)}let Ra=!0;function Oc(r){Ra=!(r===void 0?!0:r)}function Ma(r,t){if(t!==void 0){for(let e=0,i=r.length;e<i;++e)t[e]=r[e];t=t}else t=r.slice();return t}function Fc(r,t){if(t!==void 0&&r!==t){for(let e=0,i=r.length;e<i;++e)t[e]=r[e];r=t}return r}function om(r){Hp(r.getCode(),r),Ps(r,r,Ma)}function am(r){r.forEach(om)}function Gt(r){return typeof r=="string"?Wp(r):r||null}function zc(r,t,e,i){r=Gt(r);let n;const o=r.getPointResolutionFunc();if(o){if(n=o(t,e),i&&i!==r.getUnits()){const a=r.getMetersPerUnit();a&&(n=n*a/pr[i])}}else{const a=r.getUnits();if(a=="degrees"&&!i||i=="degrees")n=t;else{const h=Aa(r,Gt("EPSG:4326"));if(h===Fc&&a!=="degrees")n=t*r.getMetersPerUnit();else{let d=[e[0]-t/2,e[1],e[0]+t/2,e[1],e[0],e[1]-t/2,e[0],e[1]+t/2];d=h(d,d,2);const f=Ic(d.slice(0,2),d.slice(2,4)),_=Ic(d.slice(4,6),d.slice(6,8));n=(f+_)/2}const c=i?pr[i]:r.getMetersPerUnit();c!==void 0&&(n/=c)}}return n}function Nc(r){am(r),r.forEach(function(t){r.forEach(function(e){t!==e&&Ps(t,e,Ma)})})}function lm(r,t,e,i){r.forEach(function(n){t.forEach(function(o){Ps(n,o,e),Ps(o,n,i)})})}function Ia(r,t){return r?typeof r=="string"?Gt(r):r:Gt(t)}function Bc(r,t){return Oc(),Gc(r,"EPSG:4326",t!==void 0?t:"EPSG:3857")}function Ji(r,t){if(r===t)return!0;const e=r.getUnits()===t.getUnits();return(r.getCode()===t.getCode()||Aa(r,t)===Ma)&&e}function Aa(r,t){const e=r.getCode(),i=t.getCode();let n=Vp(e,i);return n||(n=Fc),n}function Bs(r,t){const e=Gt(r),i=Gt(t);return Aa(e,i)}function Gc(r,t,e){return Bs(t,e)(r,void 0,r.length)}function Da(r,t){return r}function ii(r,t){return Ra&&!Ns(r,[0,0])&&r[0]>=-180&&r[0]<=180&&r[1]>=-90&&r[1]<=90&&(Ra=!1,Dc("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),r}function Uc(r,t){return r}function Qi(r,t){return r}function hm(){Nc(Ec),Nc(Lc),lm(Lc,Ec,Gp,Up)}hm();function ft(r,t){if(!r)throw new Error(t)}function Zc(r,t,e){return function(i,n,o,a,h){if(!i)return;if(!n&&!t)return i;const c=t?0:o[0]*n,d=t?0:o[1]*n,f=h?h[0]:0,_=h?h[1]:0;let m=r[0]+c/2+f,v=r[2]-c/2+f,y=r[1]+d/2+_,E=r[3]-d/2+_;m>v&&(m=(v+m)/2,v=m),y>E&&(y=(E+y)/2,E=y);let b=It(i[0],m,v),S=It(i[1],y,E);if(a&&e&&n){const w=30*n;b+=-w*Math.log(1+Math.max(0,m-i[0])/w)+w*Math.log(1+Math.max(0,i[0]-v)/w),S+=-w*Math.log(1+Math.max(0,y-i[1])/w)+w*Math.log(1+Math.max(0,i[1]-E)/w)}return[b,S]}}function cm(r){return r}function Oa(r,t,e,i){const n=Tt(t)/e[0],o=Fe(t)/e[1];return i?Math.min(r,Math.max(n,o)):Math.min(r,Math.min(n,o))}function Fa(r,t,e){let i=Math.min(r,t);const n=50;return i*=Math.log(1+n*Math.max(0,r/t-1))/n+1,e&&(i=Math.max(i,e),i/=Math.log(1+n*Math.max(0,e/r-1))/n+1),It(i,e/2,t*2)}function um(r,t,e,i){return t=t!==void 0?t:!0,function(n,o,a,h){if(n!==void 0){const c=r[0],d=r[r.length-1],f=e?Oa(c,e,a,i):c;if(h)return t?Fa(n,f,d):It(n,d,f);const _=Math.min(f,n),m=Math.floor(xa(r,_,o));return r[m]>f&&m<r.length-1?r[m+1]:r[m]}}}function dm(r,t,e,i,n,o){return i=i!==void 0?i:!0,e=e!==void 0?e:0,function(a,h,c,d){if(a!==void 0){const f=n?Oa(t,n,c,o):t;if(d)return i?Fa(a,f,e):It(a,e,f);const _=1e-9,m=Math.ceil(Math.log(t/f)/Math.log(r)-_),v=-h*(.5-_)+.5,y=Math.min(f,a),E=Math.floor(Math.log(t/y)/Math.log(r)+v),b=Math.max(m,E),S=t/Math.pow(r,b);return It(S,e,f)}}}function jc(r,t,e,i,n){return e=e!==void 0?e:!0,function(o,a,h,c){if(o!==void 0){const d=i?Oa(r,i,h,n):r;return!e||!c?It(o,t,d):Fa(o,d,t)}}}function za(r){if(r!==void 0)return 0}function Wc(r){if(r!==void 0)return r}function fm(r){const t=2*Math.PI/r;return function(e,i){if(i)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e}}function gm(r){return r=r||Os(5),function(t,e){if(e)return t;if(t!==void 0)return Math.abs(t)<=r?0:t}}function Hc(r){return Math.pow(r,3)}function Rn(r){return 1-Hc(1-r)}function _m(r){return 3*r*r-2*r*r*r}function pm(r){return r}const wi=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",mm=wi.includes("firefox"),ym=wi.includes("safari")&&!wi.includes("chrom")&&(wi.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(wi)),vm=wi.includes("webkit")&&!wi.includes("edge"),Vc=wi.includes("macintosh"),Xc=typeof devicePixelRatio<"u"?devicePixelRatio:1,Na=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Yc=typeof Image<"u"&&Image.prototype.decode,Kc=function(){let r=!1;try{const t=Object.defineProperty({},"passive",{get:function(){r=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return r}(),xm=new Array(6);function Vt(){return[1,0,0,1,0,0]}function qc(r,t){const e=r[0],i=r[1],n=r[2],o=r[3],a=r[4],h=r[5],c=t[0],d=t[1],f=t[2],_=t[3],m=t[4],v=t[5];return r[0]=e*c+n*d,r[1]=i*c+o*d,r[2]=e*f+n*_,r[3]=i*f+o*_,r[4]=e*m+n*v+a,r[5]=i*m+o*v+h,r}function $c(r,t,e,i,n,o,a){return r[0]=t,r[1]=e,r[2]=i,r[3]=n,r[4]=o,r[5]=a,r}function Em(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function Ot(r,t){const e=t[0],i=t[1];return t[0]=r[0]*e+r[2]*i+r[4],t[1]=r[1]*e+r[3]*i+r[5],t}function wm(r,t,e){return $c(r,t,0,0,e,0,0)}function Lm(r,t,e){return qc(r,$c(xm,1,0,0,1,t,e))}function ze(r,t,e,i,n,o,a,h){const c=Math.sin(o),d=Math.cos(o);return r[0]=i*d,r[1]=n*c,r[2]=-i*c,r[3]=n*d,r[4]=a*i*d-h*i*c+t,r[5]=a*n*c+h*n*d+e,r}function Gs(r,t){const e=bm(t);ft(e!==0,"Transformation matrix cannot be inverted");const i=t[0],n=t[1],o=t[2],a=t[3],h=t[4],c=t[5];return r[0]=a/e,r[1]=-n/e,r[2]=-o/e,r[3]=i/e,r[4]=(o*c-a*h)/e,r[5]=-(i*c-n*h)/e,r}function bm(r){return r[0]*r[3]-r[1]*r[2]}let Jc;function Qc(r){const t="matrix("+r.join(", ")+")";if(Na)return t;const e=Jc||(Jc=document.createElement("div"));return e.style.transform=t,e.style.transform}function tn(r,t,e,i,n,o){o=o||[];let a=0;for(let h=t;h<e;h+=i){const c=r[h],d=r[h+1];o[a++]=n[0]*c+n[2]*d+n[4],o[a++]=n[1]*c+n[3]*d+n[5]}return o&&o.length!=a&&(o.length=a),o}function tu(r,t,e,i,n,o,a){a=a||[];const h=Math.cos(n),c=Math.sin(n),d=o[0],f=o[1];let _=0;for(let m=t;m<e;m+=i){const v=r[m]-d,y=r[m+1]-f;a[_++]=d+v*h-y*c,a[_++]=f+v*c+y*h;for(let E=m+2;E<m+i;++E)a[_++]=r[E]}return a&&a.length!=_&&(a.length=_),a}function Tm(r,t,e,i,n,o,a,h){h=h||[];const c=a[0],d=a[1];let f=0;for(let _=t;_<e;_+=i){const m=r[_]-c,v=r[_+1]-d;h[f++]=c+n*m,h[f++]=d+o*v;for(let y=_+2;y<_+i;++y)h[f++]=r[y]}return h&&h.length!=f&&(h.length=f),h}function Cm(r,t,e,i,n,o,a){a=a||[];let h=0;for(let c=t;c<e;c+=i){a[h++]=r[c]+n,a[h++]=r[c+1]+o;for(let d=c+2;d<c+i;++d)a[h++]=r[d]}return a&&a.length!=h&&(a.length=h),a}const eu=Vt();class Sm extends be{constructor(){super(),this.extent_=ge(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=Mp(function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);const n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return it()}closestPointXY(t,e,i,n){return it()}containsXY(t,e){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}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 it()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&yr(e),this.extentRevision_=this.getRevision()}return qp(this.extent_,t)}rotate(t,e){it()}scale(t,e,i){it()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return it()}getType(){return it()}applyTransform(t){it()}intersectsExtent(t){return it()}translate(t,e){it()}transform(t,e){const i=Gt(t),n=i.getUnits()=="tile-pixels"?function(o,a,h){const c=i.getExtent(),d=i.getWorldExtent(),f=Fe(d)/Fe(c);return ze(eu,d[0],d[3],f,-f,0,0,0),tn(o,0,o.length,h,eu,a),Bs(i,e)(o,a,h)}:Bs(i,e);return this.applyTransform(n),this}}const iu=Sm;class Pm extends iu{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates=null}computeExtent(t){return Cc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return it()}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=nu(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){it()}setLayout(t,e,i){let n;if(t)n=nu(t);else{for(let o=0;o<i;++o){if(e.length===0){this.layout="XY",this.stride=2;return}e=e[0]}n=e.length,t=km(n)}this.layout=t,this.stride=n}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())}rotate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();tu(i,0,i.length,n,t,e,i),this.changed()}}scale(t,e,i){e===void 0&&(e=t),i||(i=Ki(this.getExtent()));const n=this.getFlatCoordinates();if(n){const o=this.getStride();Tm(n,0,n.length,o,t,e,i,n),this.changed()}}translate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();Cm(i,0,i.length,n,t,e,i),this.changed()}}}function km(r){let t;return r==2?t="XY":r==3?t="XYZ":r==4&&(t="XYZM"),t}function nu(r){let t;return r=="XY"?t=2:r=="XYZ"||r=="XYM"?t=3:r=="XYZM"&&(t=4),t}function Rm(r,t,e){const i=r.getFlatCoordinates();if(!i)return null;const n=r.getStride();return tn(i,0,i.length,n,t,e)}const en=Pm;function ru(r,t,e,i,n,o,a){const h=r[t],c=r[t+1],d=r[e]-h,f=r[e+1]-c;let _;if(d===0&&f===0)_=t;else{const m=((n-h)*d+(o-c)*f)/(d*d+f*f);if(m>1)_=e;else if(m>0){for(let v=0;v<i;++v)a[v]=_e(r[t+v],r[e+v],m);a.length=i;return}else _=t}for(let m=0;m<i;++m)a[m]=r[_+m];a.length=i}function Ba(r,t,e,i,n){let o=r[t],a=r[t+1];for(t+=i;t<e;t+=i){const h=r[t],c=r[t+1],d=$i(o,a,h,c);d>n&&(n=d),o=h,a=c}return n}function Ga(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o){const h=e[o];n=Ba(r,t,h,i,n),t=h}return n}function Mm(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o){const h=e[o];n=Ga(r,t,h,i,n),t=h[h.length-1]}return n}function Ua(r,t,e,i,n,o,a,h,c,d,f){if(t==e)return d;let _,m;if(n===0){if(m=$i(a,h,r[t],r[t+1]),m<d){for(_=0;_<i;++_)c[_]=r[t+_];return c.length=i,m}return d}f=f||[NaN,NaN];let v=t+i;for(;v<e;)if(ru(r,v-i,v,i,a,h,f),m=$i(a,h,f[0],f[1]),m<d){for(d=m,_=0;_<i;++_)c[_]=f[_];c.length=i,v+=i}else v+=i*Math.max((Math.sqrt(m)-Math.sqrt(d))/n|0,1);if(o&&(ru(r,e-i,t,i,a,h,f),m=$i(a,h,f[0],f[1]),m<d)){for(d=m,_=0;_<i;++_)c[_]=f[_];c.length=i}return d}function Za(r,t,e,i,n,o,a,h,c,d,f){f=f||[NaN,NaN];for(let _=0,m=e.length;_<m;++_){const v=e[_];d=Ua(r,t,v,i,n,o,a,h,c,d,f),t=v}return d}function Im(r,t,e,i,n,o,a,h,c,d,f){f=f||[NaN,NaN];for(let _=0,m=e.length;_<m;++_){const v=e[_];d=Za(r,t,v,i,n,o,a,h,c,d,f),t=v[v.length-1]}return d}function Am(r,t,e,i){for(let n=0,o=e.length;n<o;++n)r[t++]=e[n];return t}function Us(r,t,e,i){for(let n=0,o=e.length;n<o;++n){const a=e[n];for(let h=0;h<i;++h)r[t++]=a[h]}return t}function ja(r,t,e,i,n){n=n||[];let o=0;for(let a=0,h=e.length;a<h;++a){const c=Us(r,t,e[a],i);n[o++]=c,t=c}return n.length=o,n}function Dm(r,t,e,i,n){n=n||[];let o=0;for(let a=0,h=e.length;a<h;++a){const c=ja(r,t,e[a],i,n[o]);c.length===0&&(c[0]=t),n[o++]=c,t=c[c.length-1]}return n.length=o,n}function Wa(r,t,e,i,n,o,a){const h=(e-t)/i;if(h<3){for(;t<e;t+=i)o[a++]=r[t],o[a++]=r[t+1];return a}const c=new Array(h);c[0]=1,c[h-1]=1;const d=[t,e-i];let f=0;for(;d.length>0;){const _=d.pop(),m=d.pop();let v=0;const y=r[m],E=r[m+1],b=r[_],S=r[_+1];for(let w=m+i;w<_;w+=i){const T=r[w],P=r[w+1],M=Qp(T,P,y,E,b,S);M>v&&(f=w,v=M)}v>n&&(c[(f-t)/i]=1,m+i<f&&d.push(m,f),f+i<_&&d.push(f,_))}for(let _=0;_<h;++_)c[_]&&(o[a++]=r[t+_*i],o[a++]=r[t+_*i+1]);return a}function Om(r,t,e,i,n,o,a,h){for(let c=0,d=e.length;c<d;++c){const f=e[c];a=Wa(r,t,f,i,n,o,a),h.push(a),t=f}return a}function nn(r,t){return t*Math.round(r/t)}function Fm(r,t,e,i,n,o,a){if(t==e)return a;let h=nn(r[t],n),c=nn(r[t+1],n);t+=i,o[a++]=h,o[a++]=c;let d,f;do if(d=nn(r[t],n),f=nn(r[t+1],n),t+=i,t==e)return o[a++]=d,o[a++]=f,a;while(d==h&&f==c);for(;t<e;){const _=nn(r[t],n),m=nn(r[t+1],n);if(t+=i,_==d&&m==f)continue;const v=d-h,y=f-c,E=_-h,b=m-c;if(v*b==y*E&&(v<0&&E<v||v==E||v>0&&E>v)&&(y<0&&b<y||y==b||y>0&&b>y)){d=_,f=m;continue}o[a++]=d,o[a++]=f,h=d,c=f,d=_,f=m}return o[a++]=d,o[a++]=f,a}function su(r,t,e,i,n,o,a,h){for(let c=0,d=e.length;c<d;++c){const f=e[c];a=Fm(r,t,f,i,n,o,a),h.push(a),t=f}return a}function zm(r,t,e,i,n,o,a,h){for(let c=0,d=e.length;c<d;++c){const f=e[c],_=[];a=su(r,t,f,i,n,o,a,_),h.push(_),t=f[f.length-1]}return a}function Li(r,t,e,i,n){n=n!==void 0?n:[];let o=0;for(let a=t;a<e;a+=i)n[o++]=r.slice(a,a+i);return n.length=o,n}function Er(r,t,e,i,n){n=n!==void 0?n:[];let o=0;for(let a=0,h=e.length;a<h;++a){const c=e[a];n[o++]=Li(r,t,c,i,n[o]),t=c}return n.length=o,n}function Ha(r,t,e,i,n){n=n!==void 0?n:[];let o=0;for(let a=0,h=e.length;a<h;++a){const c=e[a];n[o++]=c.length===1&&c[0]===t?[]:Er(r,t,c,i,n[o]),t=c[c.length-1]}return n.length=o,n}function ou(r,t,e,i){let n=0,o=r[e-i],a=r[e-i+1];for(;t<e;t+=i){const h=r[t],c=r[t+1];n+=a*h-o*c,o=h,a=c}return n/2}function au(r,t,e,i){let n=0;for(let o=0,a=e.length;o<a;++o){const h=e[o];n+=ou(r,t,h,i),t=h}return n}function Nm(r,t,e,i){let n=0;for(let o=0,a=e.length;o<a;++o){const h=e[o];n+=au(r,t,h,i),t=h[h.length-1]}return n}class Zs extends en{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 Zs(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,n){return n<Xi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ba(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))}getArea(){return ou(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Li(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=Wa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new Zs(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Us(this.flatCoordinates,0,t,this.stride),this.changed()}}const lu=Zs;class Va extends en{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new Va(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){const o=this.flatCoordinates,a=$i(t,e,o[0],o[1]);if(a<n){const h=this.stride;for(let c=0;c<h;++c)i[c]=o[c];return i.length=h,a}return n}getCoordinates(){return this.flatCoordinates?this.flatCoordinates.slice():[]}computeExtent(t){return Xp(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return La(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Am(this.flatCoordinates,0,t,this.stride),this.changed()}}const js=Va;function Bm(r,t,e,i,n){return!kc(n,function(a){return!rn(r,t,e,i,a[0],a[1])})}function rn(r,t,e,i,n,o){let a=0,h=r[e-i],c=r[e-i+1];for(;t<e;t+=i){const d=r[t],f=r[t+1];c<=o?f>o&&(d-h)*(o-c)-(n-h)*(f-c)>0&&a++:f<=o&&(d-h)*(o-c)-(n-h)*(f-c)<0&&a--,h=d,c=f}return a!==0}function Xa(r,t,e,i,n,o){if(e.length===0||!rn(r,t,e[0],i,n,o))return!1;for(let a=1,h=e.length;a<h;++a)if(rn(r,e[a-1],e[a],i,n,o))return!1;return!0}function Gm(r,t,e,i,n,o){if(e.length===0)return!1;for(let a=0,h=e.length;a<h;++a){const c=e[a];if(Xa(r,t,c,i,n,o))return!0;t=c[c.length-1]}return!1}function hu(r,t,e,i,n,o,a){let h,c,d,f,_,m,v;const y=n[o+1],E=[];for(let w=0,T=e.length;w<T;++w){const P=e[w];for(f=r[P-i],m=r[P-i+1],h=t;h<P;h+=i)_=r[h],v=r[h+1],(y<=m&&v<=y||m<=y&&y<=v)&&(d=(y-m)/(v-m)*(_-f)+f,E.push(d)),f=_,m=v}let b=NaN,S=-1/0;for(E.sort(xi),f=E[0],h=1,c=E.length;h<c;++h){_=E[h];const w=Math.abs(_-f);w>S&&(d=(f+_)/2,Xa(r,t,e,i,d,y)&&(b=d,S=w)),f=_}return isNaN(b)&&(b=n[o]),a?(a.push(b,y,S),a):[b,y,S]}function Um(r,t,e,i,n){let o=[];for(let a=0,h=e.length;a<h;++a){const c=e[a];o=hu(r,t,c,i,n,2*a,o),t=c[c.length-1]}return o}function cu(r,t,e,i,n){let o;for(t+=i;t<e;t+=i)if(o=n(r.slice(t-i,t),r.slice(t,t+i)),o)return o;return!1}function Ws(r,t,e,i,n){const o=Pc(ge(),r,t,e,i);return se(n,o)?Yi(n,o)||o[0]>=n[0]&&o[2]<=n[2]||o[1]>=n[1]&&o[3]<=n[3]?!0:cu(r,t,e,i,function(a,h){return $p(n,a,h)}):!1}function Zm(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o){if(Ws(r,t,e[o],i,n))return!0;t=e[o]}return!1}function uu(r,t,e,i,n){return!!(Ws(r,t,e,i,n)||rn(r,t,e,i,n[0],n[1])||rn(r,t,e,i,n[0],n[3])||rn(r,t,e,i,n[2],n[1])||rn(r,t,e,i,n[2],n[3]))}function du(r,t,e,i,n){if(!uu(r,t,e[0],i,n))return!1;if(e.length===1)return!0;for(let o=1,a=e.length;o<a;++o)if(Bm(r,e[o-1],e[o],i,n)&&!Ws(r,e[o-1],e[o],i,n))return!1;return!0}function jm(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o){const h=e[o];if(du(r,t,h,i,n))return!0;t=h[h.length-1]}return!1}function Wm(r,t,e,i){for(;t<e-i;){for(let n=0;n<i;++n){const o=r[t+n];r[t+n]=r[e-i+n],r[e-i+n]=o}t+=i,e-=i}}function fu(r,t,e,i){let n=0,o=r[e-i],a=r[e-i+1];for(;t<e;t+=i){const h=r[t],c=r[t+1];n+=(h-o)*(c+a),o=h,a=c}return n===0?void 0:n>0}function gu(r,t,e,i,n){n=n!==void 0?n:!1;for(let o=0,a=e.length;o<a;++o){const h=e[o],c=fu(r,t,h,i);if(o===0){if(n&&c||!n&&!c)return!1}else if(n&&!c||!n&&c)return!1;t=h}return!0}function Hm(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o){const h=e[o];if(!gu(r,t,h,i,n))return!1;h.length&&(t=h[h.length-1])}return!0}function Ya(r,t,e,i,n){n=n!==void 0?n:!1;for(let o=0,a=e.length;o<a;++o){const h=e[o],c=fu(r,t,h,i);(o===0?n&&c||!n&&!c:n&&!c||!n&&c)&&Wm(r,t,h,i),t=h}return t}function _u(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o)t=Ya(r,t,e[o],i,n);return t}class wr extends en{constructor(t,e,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,e!==void 0&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?ti(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new wr(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Xi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ga(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Za(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return Xa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return au(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),Ya(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,Er(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Ki(this.getExtent());this.flatInteriorPoint_=hu(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new js(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new lu(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[];let o=0;for(let a=0,h=i.length;a<h;++a){const c=i[a],d=new lu(e.slice(o,c),t);n.push(d),o=c}return n}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;gu(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ya(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=su(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i),new wr(e,"XY",i)}getType(){return"Polygon"}intersectsExtent(t){return du(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=ja(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}const Hs=wr;function pu(r){if(Ds(r))throw new Error("Cannot create polygon from empty extent");const t=r[0],e=r[1],i=r[2],n=r[3],o=[t,e,t,n,i,n,i,e,t,e];return new wr(o,"XY",[o.length])}const Ka=0;class Vm extends be{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=Ia(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&&Oc(),t.center&&(t.center=ii(t.center,this.projection_)),t.extent&&(t.extent=Qi(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const h in Te)delete e[h];this.setProperties(e,!0);const i=Ym(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=i.minZoom;const n=Xm(t),o=i.constraint,a=Km(t);this.constraints_={center:n,resolution:o,rotation:a},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 i=this.getCenterInternal();if(i){const n=t||[0,0,0,0];e=e||[0,0,0,0];const o=this.getResolution(),a=o/2*(n[3]-e[3]+e[1]-n[1]),h=o/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([i[0]+a,i[1]-h])}}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 i=0;i<e.length;++i){let n=arguments[i];n.center&&(n=Object.assign({},n),n.center=ii(n.center,this.getProjection())),n.anchor&&(n=Object.assign({},n),n.anchor=ii(n.anchor,this.getProjection())),e[i]=n}this.animateInternal.apply(this,e)}animateInternal(t){let e=arguments.length,i;e>1&&typeof arguments[e-1]=="function"&&(i=arguments[e-1],--e);let n=0;for(;n<e&&!this.isDef();++n){const f=arguments[n];f.center&&this.setCenterInternal(f.center),f.zoom!==void 0?this.setZoom(f.zoom):f.resolution&&this.setResolution(f.resolution),f.rotation!==void 0&&this.setRotation(f.rotation)}if(n===e){i&&Vs(i,!0);return}let o=Date.now(),a=this.targetCenter_.slice(),h=this.targetResolution_,c=this.targetRotation_;const d=[];for(;n<e;++n){const f=arguments[n],_={start:o,complete:!1,anchor:f.anchor,duration:f.duration!==void 0?f.duration:1e3,easing:f.easing||_m,callback:i};if(f.center&&(_.sourceCenter=a,_.targetCenter=f.center.slice(),a=_.targetCenter),f.zoom!==void 0?(_.sourceResolution=h,_.targetResolution=this.getResolutionForZoom(f.zoom),h=_.targetResolution):f.resolution&&(_.sourceResolution=h,_.targetResolution=f.resolution,h=_.targetResolution),f.rotation!==void 0){_.sourceRotation=c;const m=kn(f.rotation-c+Math.PI,2*Math.PI)-Math.PI;_.targetRotation=c+m,c=_.targetRotation}qm(_)?_.complete=!0:o+=_.duration,d.push(_)}this.animations_.push(d),this.setHint(Ut.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[Ut.ANIMATING]>0}getInteracting(){return this.hints_[Ut.INTERACTING]>0}cancelAnimations(){this.setHint(Ut.ANIMATING,-this.hints_[Ut.ANIMATING]);let t;for(let e=0,i=this.animations_.length;e<i;++e){const n=this.animations_[e];if(n[0].callback&&Vs(n[0].callback,!1),!t)for(let o=0,a=n.length;o<a;++o){const h=n[o];if(!h.complete){t=h.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 i=this.animations_.length-1;i>=0;--i){const n=this.animations_[i];let o=!0;for(let a=0,h=n.length;a<h;++a){const c=n[a];if(c.complete)continue;const d=t-c.start;let f=c.duration>0?d/c.duration:1;f>=1?(c.complete=!0,f=1):o=!1;const _=c.easing(f);if(c.sourceCenter){const m=c.sourceCenter[0],v=c.sourceCenter[1],y=c.targetCenter[0],E=c.targetCenter[1];this.nextCenter_=c.targetCenter;const b=m+_*(y-m),S=v+_*(E-v);this.targetCenter_=[b,S]}if(c.sourceResolution&&c.targetResolution){const m=_===1?c.targetResolution:c.sourceResolution+_*(c.targetResolution-c.sourceResolution);if(c.anchor){const v=this.getViewportSize_(this.getRotation()),y=this.constraints_.resolution(m,0,v,!0);this.targetCenter_=this.calculateCenterZoom(y,c.anchor)}this.nextResolution_=c.targetResolution,this.targetResolution_=m,this.applyTargetState_(!0)}if(c.sourceRotation!==void 0&&c.targetRotation!==void 0){const m=_===1?kn(c.targetRotation+Math.PI,2*Math.PI)-Math.PI:c.sourceRotation+_*(c.targetRotation-c.sourceRotation);if(c.anchor){const v=this.constraints_.rotation(m,!0);this.targetCenter_=this.calculateCenterRotate(v,c.anchor)}this.nextRotation_=c.targetRotation,this.targetRotation_=m}if(this.applyTargetState_(!0),e=!0,!c.complete)break}if(o){this.animations_[i]=null,this.setHint(Ut.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const a=n[0].callback;a&&Vs(a,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i;const n=this.getCenterInternal();return n!==void 0&&(i=[n[0]-e[0],n[1]-e[1]],ka(i,t-this.getRotation()),em(i,e)),i}calculateCenterZoom(t,e){let i;const n=this.getCenterInternal(),o=this.getResolution();if(n!==void 0&&o!==void 0){const a=e[0]-t*(e[0]-n[0])/o,h=e[1]-t*(e[1]-n[1])/o;i=[a,h]}return i}getViewportSize_(t){const e=this.viewportSize_;if(t){const i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*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&&Da(t,this.getProjection())}getCenterInternal(){return this.get(Te.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 Uc(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();ft(e,"The view center is not defined");const i=this.getResolution();ft(i!==void 0,"The view resolution is not defined");const n=this.getRotation();return ft(n!==void 0,"The view rotation is not defined"),Ca(e,i,n,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(Te.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(Qi(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const i=Tt(t)/e[0],n=Fe(t)/e[1];return Math.max(i,n)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(e/i)/Math.log(t);return function(o){return e/Math.pow(t,o*n)}}getRotation(){return this.get(Te.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,o=Math.log(i/n)/e;return function(a){return Math.log(i/a)/e/o}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),i=this.getRotation();let n=this.getCenterInternal();const o=this.padding_;if(o){const a=this.getViewportSizeMinusPadding_();n=qa(n,this.getViewportSize_(),[a[0]/2+o[3],a[1]/2+o[0]],e,i)}return{center:n.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,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,i,n;if(this.resolutions_){const o=xa(this.resolutions_,t,1);e=o,i=this.resolutions_[o],o==this.resolutions_.length-1?n=2:n=i/this.resolutions_[o+1]}else i=this.maxResolution_,n=this.zoomFactor_;return e+Math.log(i/t)/Math.log(n)}getResolutionForZoom(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;const e=It(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,It(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if(ft(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){ft(!Ds(t),"Cannot fit empty extent provided as `geometry`");const n=Qi(t,this.getProjection());i=pu(n)}else if(t.getType()==="Circle"){const n=Qi(t.getExtent(),this.getProjection());i=pu(n),i.rotate(this.getRotation(),Ki(n))}else i=t;this.fitInternal(i,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),i=Math.cos(e),n=Math.sin(-e),o=t.getFlatCoordinates(),a=t.getStride();let h=1/0,c=1/0,d=-1/0,f=-1/0;for(let _=0,m=o.length;_<m;_+=a){const v=o[_]*i-o[_+1]*n,y=o[_]*n+o[_+1]*i;h=Math.min(h,v),c=Math.min(c,y),d=Math.max(d,v),f=Math.max(f,y)}return[h,c,d,f]}fitInternal(t,e){e=e||{};let i=e.size;i||(i=this.getViewportSizeMinusPadding_());const n=e.padding!==void 0?e.padding:[0,0,0,0],o=e.nearest!==void 0?e.nearest:!1;let a;e.minResolution!==void 0?a=e.minResolution:e.maxZoom!==void 0?a=this.getResolutionForZoom(e.maxZoom):a=0;const h=this.rotatedExtentForGeometry(t);let c=this.getResolutionForExtentInternal(h,[i[0]-n[1]-n[3],i[1]-n[0]-n[2]]);c=isNaN(c)?a:Math.max(c,a),c=this.getConstrainedResolution(c,o?0:1);const d=this.getRotation(),f=Math.sin(d),_=Math.cos(d),m=Ki(h);m[0]+=(n[1]-n[3])/2*c,m[1]+=(n[0]-n[2])/2*c;const v=m[0]*_-m[1]*f,y=m[1]*_+m[0]*f,E=this.getConstrainedCenter([v,y],c),b=e.callback?e.callback:wn;e.duration!==void 0?this.animateInternal({resolution:c,center:E,duration:e.duration,easing:e.easing},b):(this.targetResolution_=c,this.targetCenter_=E,this.applyTargetState_(!1,!0),Vs(b,!0))}centerOn(t,e,i){this.centerOnInternal(ii(t,this.getProjection()),e,i)}centerOnInternal(t,e,i){this.setCenterInternal(qa(t,e,i,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,i,n){let o;const a=this.padding_;if(a&&t){const h=this.getViewportSizeMinusPadding_(-i),c=qa(t,n,[h[0]/2+a[3],h[1]/2+a[0]],e,i);o=[t[0]-c[0],t[1]-c[1]]}return o}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(t){const e=Da(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&&ii(e,this.getProjection()),this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){const i=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),o=this.constraints_.resolution(this.targetResolution_*t,0,n,i);e&&(this.targetCenter_=this.calculateCenterZoom(o,e)),this.targetResolution_*=t,this.applyTargetState_()}adjustZoom(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)}adjustRotation(t,e){e&&(e=ii(e,this.getProjection())),this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){const i=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t&&ii(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 i=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,i),o=this.getViewportSize_(n),a=this.constraints_.resolution(this.targetResolution_,0,o,i),h=this.constraints_.center(this.targetCenter_,a,o,i,this.calculateCenterShift(this.targetCenter_,a,n,o));this.get(Te.ROTATION)!==n&&this.set(Te.ROTATION,n),this.get(Te.RESOLUTION)!==a&&(this.set(Te.RESOLUTION,a),this.set("zoom",this.getZoom(),!0)),(!h||!this.get(Te.CENTER)||!Ns(this.get(Te.CENTER),h))&&this.set(Te.CENTER,h),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(t,e,i){t=t!==void 0?t:200;const n=e||0,o=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(o),h=this.constraints_.resolution(this.targetResolution_,n,a),c=this.constraints_.center(this.targetCenter_,h,a,!1,this.calculateCenterShift(this.targetCenter_,h,o,a));if(t===0&&!this.cancelAnchor_){this.targetResolution_=h,this.targetRotation_=o,this.targetCenter_=c,this.applyTargetState_();return}i=i||(t===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==h||this.getRotation()!==o||!this.getCenterInternal()||!Ns(this.getCenterInternal(),c))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:c,resolution:h,duration:t,easing:Rn,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(Ut.INTERACTING,1)}endInteraction(t,e,i){i=i&&ii(i,this.getProjection()),this.endInteractionInternal(t,e,i)}endInteractionInternal(t,e,i){this.getInteracting()&&(this.setHint(Ut.INTERACTING,-1),this.resolveConstraints(t,e,i))}getConstrainedCenter(t,e){const i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)}getConstrainedZoom(t,e){const i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))}getConstrainedResolution(t,e){e=e||0;const i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,i)}}function Vs(r,t){setTimeout(function(){r(t)},0)}function Xm(r){if(r.extent!==void 0){const e=r.smoothExtentConstraint!==void 0?r.smoothExtentConstraint:!0;return Zc(r.extent,r.constrainOnlyCenter,e)}const t=Ia(r.projection,"EPSG:3857");if(r.multiWorld!==!0&&t.isGlobal()){const e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,Zc(e,!1,!1)}return cm}function Ym(r){let t,e,i,a=r.minZoom!==void 0?r.minZoom:Ka,h=r.maxZoom!==void 0?r.maxZoom:28;const c=r.zoomFactor!==void 0?r.zoomFactor:2,d=r.multiWorld!==void 0?r.multiWorld:!1,f=r.smoothResolutionConstraint!==void 0?r.smoothResolutionConstraint:!0,_=r.showFullExtent!==void 0?r.showFullExtent:!1,m=Ia(r.projection,"EPSG:3857"),v=m.getExtent();let y=r.constrainOnlyCenter,E=r.extent;if(!d&&!E&&m.isGlobal()&&(y=!1,E=v),r.resolutions!==void 0){const b=r.resolutions;e=b[a],i=b[h]!==void 0?b[h]:b[b.length-1],r.constrainResolution?t=um(b,f,!y&&E,_):t=jc(e,i,f,!y&&E,_)}else{const S=(v?Math.max(Tt(v),Fe(v)):360*pr.degrees/m.getMetersPerUnit())/Ea/Math.pow(2,Ka),w=S/Math.pow(2,28-Ka);e=r.maxResolution,e!==void 0?a=0:e=S/Math.pow(c,a),i=r.minResolution,i===void 0&&(r.maxZoom!==void 0?r.maxResolution!==void 0?i=e/Math.pow(c,h):i=S/Math.pow(c,h):i=w),h=a+Math.floor(Math.log(e/i)/Math.log(c)),i=e/Math.pow(c,h-a),r.constrainResolution?t=dm(c,e,i,f,!y&&E,_):t=jc(e,i,f,!y&&E,_)}return{constraint:t,maxResolution:e,minResolution:i,minZoom:a,zoomFactor:c}}function Km(r){if(r.enableRotation!==void 0?r.enableRotation:!0){const e=r.constrainRotation;return e===void 0||e===!0?gm():e===!1?Wc:typeof e=="number"?fm(e):Wc}return za}function qm(r){return!(r.sourceCenter&&r.targetCenter&&!Ns(r.sourceCenter,r.targetCenter)||r.sourceResolution!==r.targetResolution||r.sourceRotation!==r.targetRotation)}function qa(r,t,e,i,n){const o=Math.cos(-n);let a=Math.sin(-n),h=r[0]*o-r[1]*a,c=r[1]*o+r[0]*a;h+=(t[0]/2-e[0])*i,c+=(e[1]-t[1]/2)*i,a=-a;const d=h*o-c*a,f=c*o+h*a;return[d,f]}const Ne=Vm,oe={ADD:"add",REMOVE:"remove"},mu={LENGTH:"length"};class Xs extends Qe{constructor(t,e,i){super(t),this.element=e,this.index=i}}class $m extends be{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let i=0,n=this.array_.length;i<n;++i)this.assertUnique_(this.array_[i],i);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,i=t.length;e<i;++e)this.push(t[e]);return this}forEach(t){const e=this.array_;for(let i=0,n=e.length;i<n;++i)t(e[i],i,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(mu.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 Xs(oe.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let i=0,n=e.length;i<n;++i)if(e[i]===t)return this.removeAt(i)}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 Xs(oe.REMOVE,e,t)),e}setAt(t,e){const i=this.getLength();if(t>=i){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Xs(oe.REMOVE,n,t)),this.dispatchEvent(new Xs(oe.ADD,e,t))}updateLength_(){this.set(mu.LENGTH,this.array_.length)}assertUnique_(t,e){for(let i=0,n=this.array_.length;i<n;++i)if(this.array_[i]===t&&i!==e)throw new Error("Duplicate item added to a unique collection")}}const Be=$m,Jm=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Qm=/^([a-z]*)$|^hsla?\(.*\)$/i;function yu(r){return typeof r=="string"?r:xu(r)}function ty(r){const t=document.createElement("div");if(t.style.color=r,t.style.color!==""){document.body.appendChild(t);const e=getComputedStyle(t).color;return document.body.removeChild(t),e}return""}const ey=function(){const t={};let e=0;return function(i){let n;if(t.hasOwnProperty(i))n=t[i];else{if(e>=1024){let o=0;for(const a in t)o++&3||(delete t[a],--e)}n=iy(i),t[i]=n,++e}return n}}();function Lr(r){return Array.isArray(r)?r:ey(r)}function iy(r){let t,e,i,n,o;if(Qm.exec(r)&&(r=ty(r)),Jm.exec(r)){const a=r.length-1;let h;a<=4?h=1:h=2;const c=a===4||a===8;t=parseInt(r.substr(1+0*h,h),16),e=parseInt(r.substr(1+1*h,h),16),i=parseInt(r.substr(1+2*h,h),16),c?n=parseInt(r.substr(1+3*h,h),16):n=255,h==1&&(t=(t<<4)+t,e=(e<<4)+e,i=(i<<4)+i,c&&(n=(n<<4)+n)),o=[t,e,i,n/255]}else if(r.startsWith("rgba("))o=r.slice(5,-1).split(",").map(Number),vu(o);else if(r.startsWith("rgb("))o=r.slice(4,-1).split(",").map(Number),o.push(1),vu(o);else throw new Error("Invalid color");return o}function vu(r){return r[0]=It(r[0]+.5|0,0,255),r[1]=It(r[1]+.5|0,0,255),r[2]=It(r[2]+.5|0,0,255),r[3]=It(r[3],0,1),r}function xu(r){let t=r[0];t!=(t|0)&&(t=t+.5|0);let e=r[1];e!=(e|0)&&(e=e+.5|0);let i=r[2];i!=(i|0)&&(i=i+.5|0);const n=r[3]===void 0?1:Math.round(r[3]*100)/100;return"rgba("+t+","+e+","+i+","+n+")"}class ny{constructor(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const i=this.cache_[e];!(t++&3)&&!i.hasListener()&&(delete this.cache_[e],--this.cacheSize_)}}}get(t,e,i){const n=Eu(t,e,i);return n in this.cache_?this.cache_[n]:null}set(t,e,i,n){const o=Eu(t,e,i);this.cache_[o]=n,++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function Eu(r,t,e){const i=e?yu(e):"null";return t+":"+r+":"+i}const Ys=new ny,vt={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 ry extends be{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[vt.OPACITY]=t.opacity!==void 0?t.opacity:1,ft(typeof e[vt.OPACITY]=="number","Layer opacity must be a number"),e[vt.VISIBLE]=t.visible!==void 0?t.visible:!0,e[vt.Z_INDEX]=t.zIndex,e[vt.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[vt.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[vt.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[vt.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},i=this.getZIndex();return e.opacity=It(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=i===void 0&&!e.managed?1/0:i,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 it()}getLayerStatesArray(t){return it()}getExtent(){return this.get(vt.EXTENT)}getMaxResolution(){return this.get(vt.MAX_RESOLUTION)}getMinResolution(){return this.get(vt.MIN_RESOLUTION)}getMinZoom(){return this.get(vt.MIN_ZOOM)}getMaxZoom(){return this.get(vt.MAX_ZOOM)}getOpacity(){return this.get(vt.OPACITY)}getSourceState(){return it()}getVisible(){return this.get(vt.VISIBLE)}getZIndex(){return this.get(vt.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(vt.EXTENT,t)}setMaxResolution(t){this.set(vt.MAX_RESOLUTION,t)}setMinResolution(t){this.set(vt.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(vt.MAX_ZOOM,t)}setMinZoom(t){this.set(vt.MIN_ZOOM,t)}setOpacity(t){ft(typeof t=="number","Layer opacity must be a number"),this.set(vt.OPACITY,t)}setVisible(t){this.set(vt.VISIBLE,t)}setZIndex(t){this.set(vt.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const wu=ry,qt={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class sy extends wu{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(vt.SOURCE,this.handleSourcePropertyChange_);const i=t.source?t.source:null;this.setSource(i)}getLayersArray(t){return t=t||[],t.push(this),t}getLayerStatesArray(t){return t=t||[],t.push(this.getLayerState()),t}getSource(){return this.get(vt.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_&&(wt(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=ht(t,rt.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 i=this.getMapInternal();!t&&i&&(t=i.getView()),t instanceof Ne?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let n;e.layerStatesArray?n=e.layerStatesArray.find(a=>a.layer===this):n=this.getLayerState();const o=this.getExtent();return $a(n,e.viewState)&&(!o||se(o,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];let e;const i=this.getSource();if(i&&(e=i.getAttributions()),!e)return[];const n=t instanceof Ne?t.getViewStateAndExtent():t;let o=e(n);return Array.isArray(o)||(o=[o]),o}render(t,e){const i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}setMapInternal(t){t||this.unrender(),this.set(vt.MAP,t)}getMapInternal(){return this.get(vt.MAP)}setMap(t){this.mapPrecomposeKey_&&(wt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(wt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=ht(t,qt.PRECOMPOSE,function(e){const n=e.frameState.layerStatesArray,o=this.getLayerState(!1);ft(!n.some(function(a){return a.layer===o.layer}),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),n.push(o)},this),this.mapRenderKey_=ht(this,rt.CHANGE,t.render,t),this.changed())}setSource(t){this.set(vt.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function $a(r,t){if(!r.visible)return!1;const e=t.resolution;if(e<r.minResolution||e>=r.maxResolution)return!1;const i=t.zoom;return i>r.minZoom&&i<=r.maxZoom}const Ks=sy;class oy extends ws{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){it()}calculateMatrices2D(t){const e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;ze(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Gs(n,i)}forEachFeatureAtCoordinate(t,e,i,n,o,a,h,c){let d;const f=e.viewState;function _(P,M,I,D){return o.call(a,M,P?I:null,D)}const m=f.projection,v=Mc(t.slice(),m),y=[[0,0]];if(m.canWrapX()&&n){const P=m.getExtent(),M=Tt(P);y.push([-M,0],[M,0])}const E=e.layerStatesArray,b=E.length,S=[],w=[];for(let P=0;P<y.length;P++)for(let M=b-1;M>=0;--M){const I=E[M],D=I.layer;if(D.hasRenderer()&&$a(I,f)&&h.call(c,D)){const z=D.getRenderer(),W=D.getSource();if(z&&W){const K=W.getWrapX()?v:t,Q=_.bind(null,I.managed);w[0]=K[0]+y[P][0],w[1]=K[1]+y[P][1],d=z.forEachFeatureAtCoordinate(w,e,i,Q,S)}if(d)return d}}if(S.length===0)return;const T=1/S.length;return S.forEach((P,M)=>P.distanceSq+=M*T),S.sort((P,M)=>P.distanceSq-M.distanceSq),S.some(P=>d=P.callback(P.feature,P.layer,P.geometry)),d}hasFeatureAtCoordinate(t,e,i,n,o,a){return this.forEachFeatureAtCoordinate(t,e,i,n,_r,this,o,a)!==void 0}getMap(){return this.map_}renderFrame(t){it()}flushDeclutterItems(t){}scheduleExpireIconCache(t){Ys.canExpireCache()&&t.postRenderFunctions.push(ay)}}function ay(r,t){Ys.expire()}const ly=oy;class hy extends Qe{constructor(t,e,i,n){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=n}}const br=hy,qs="ol-hidden",cy="ol-selectable",Tr="ol-unselectable",Lu="ol-unsupported",$s="ol-control",bu="ol-collapsed",uy=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-z]+?)\\s*$`].join(""),"i"),Tu=["style","variant","weight","size","lineHeight","family"],Cu=function(r){const t=r.match(uy);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,n=Tu.length;i<n;++i){const o=t[i+1];o!==void 0&&(e[Tu[i]]=o)}return e.families=e.family.split(/,\s?/),e};function $t(r,t,e,i){let n;return e&&e.length?n=e.shift():Na?n=new OffscreenCanvas(r||300,t||300):n=document.createElement("canvas"),r&&(n.width=r),t&&(n.height=t),n.getContext("2d",i)}function Js(r){const t=r.canvas;t.width=1,t.height=1,r.clearRect(0,0,1,1)}function dy(r){let t=r.offsetWidth;const e=getComputedStyle(r);return t+=parseInt(e.marginLeft,10)+parseInt(e.marginRight,10),t}function fy(r){let t=r.offsetHeight;const e=getComputedStyle(r);return t+=parseInt(e.marginTop,10)+parseInt(e.marginBottom,10),t}function Qs(r,t){const e=t.parentNode;e&&e.replaceChild(r,t)}function to(r){return r&&r.parentNode?r.parentNode.removeChild(r):null}function Su(r){for(;r.lastChild;)r.removeChild(r.lastChild)}function gy(r,t){const e=r.childNodes;for(let i=0;;++i){const n=e[i],o=t[i];if(!n&&!o)break;if(n!==o){if(!n){r.appendChild(o);continue}if(!o){r.removeChild(n),--i;continue}r.insertBefore(o,n)}}}const Pu="10px sans-serif",ae="#000",Mn="round",ni=[],ri=0,In="round",Cr=10,Sr="#000",Pr="center",eo="middle",sn=[0,0,0,0],kr=1,si=new be;let An=null,Ja;const Qa={},_y=function(){const t="32px ",e=["monospace","serif"],i=e.length,n="wmytzilWMYTZIL@#/&?$%10";let o,a;function h(d,f,_){let m=!0;for(let v=0;v<i;++v){const y=e[v];if(a=io(d+" "+f+" "+t+y,n),_!=y){const E=io(d+" "+f+" "+t+_+","+y,n);m=m&&E!=a}}return!!m}function c(){let d=!0;const f=si.getKeys();for(let _=0,m=f.length;_<m;++_){const v=f[_];si.get(v)<100&&(h.apply(this,v.split(`
18
- `))?(Ln(Qa),An=null,Ja=void 0,si.set(v,100)):(si.set(v,si.get(v)+1,!0),d=!1))}d&&(clearInterval(o),o=void 0)}return function(d){const f=Cu(d);if(!f)return;const _=f.families;for(let m=0,v=_.length;m<v;++m){const y=_[m],E=f.style+`
13
+ */(function(t,e){r.exports?r.exports=e(_t,yg):e(t.L,t.screenfull)})(typeof self<"u"?self:De,function(t,e){return t.Control.FullScreen=t.Control.extend({options:{position:"topleft",title:"Full Screen",titleCancel:"Exit Full Screen",forceSeparateButton:!1,forcePseudoFullscreen:!1,fullscreenElement:!1},_screenfull:e,onAdd:function(i){var n="leaflet-control-zoom-fullscreen",o,a="";return i.zoomControl&&!this.options.forceSeparateButton?o=i.zoomControl._container:o=t.DomUtil.create("div","leaflet-bar"),this.options.content?a=this.options.content:n+=" fullscreen-icon",this._createButton(this.options.title,n,a,o,this.toggleFullScreen,this),this._map.fullscreenControl=this,this._map.on("enterFullscreen exitFullscreen",this._toggleState,this),o},onRemove:function(){t.DomEvent.off(this.link,"click",t.DomEvent.stop).off(this.link,"click",this.toggleFullScreen,this),this._screenfull.isEnabled&&(t.DomEvent.off(this._container,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).off(this._container,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,this),t.DomEvent.off(document,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).off(document,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,this))},_createButton:function(i,n,o,a,h,c){return this.link=t.DomUtil.create("a",n,a),this.link.href="#",this.link.title=i,this.link.innerHTML=o,this.link.setAttribute("role","button"),this.link.setAttribute("aria-label",i),L.DomEvent.disableClickPropagation(a),t.DomEvent.on(this.link,"click",t.DomEvent.stop).on(this.link,"click",h,c),this._screenfull.isEnabled&&(t.DomEvent.on(a,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).on(a,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,c),t.DomEvent.on(document,this._screenfull.raw.fullscreenchange,t.DomEvent.stop).on(document,this._screenfull.raw.fullscreenchange,this._handleFullscreenChange,c)),this.link},toggleFullScreen:function(){var i=this._map;i._exitFired=!1,i._isFullscreen?(this._screenfull.isEnabled&&!this.options.forcePseudoFullscreen?this._screenfull.exit():(t.DomUtil.removeClass(this.options.fullscreenElement?this.options.fullscreenElement:i._container,"leaflet-pseudo-fullscreen"),i.invalidateSize()),i.fire("exitFullscreen"),i._exitFired=!0,i._isFullscreen=!1):(this._screenfull.isEnabled&&!this.options.forcePseudoFullscreen?this._screenfull.request(this.options.fullscreenElement?this.options.fullscreenElement:i._container):(t.DomUtil.addClass(this.options.fullscreenElement?this.options.fullscreenElement:i._container,"leaflet-pseudo-fullscreen"),i.invalidateSize()),i.fire("enterFullscreen"),i._isFullscreen=!0)},_toggleState:function(){this.link.title=this._map._isFullscreen?this.options.title:this.options.titleCancel,this._map._isFullscreen?L.DomUtil.removeClass(this.link,"leaflet-fullscreen-on"):L.DomUtil.addClass(this.link,"leaflet-fullscreen-on")},_handleFullscreenChange:function(){var i=this._map;i.invalidateSize(),!this._screenfull.isFullscreen&&!i._exitFired&&(i.fire("exitFullscreen"),i._exitFired=!0,i._isFullscreen=!1)}}),t.Map.include({toggleFullscreen:function(){this.fullscreenControl.toggleFullScreen()}}),t.Map.addInitHook(function(){this.options.fullscreenControl&&this.addControl(t.control.fullscreen(this.options.fullscreenControlOptions))}),t.control.fullscreen=function(i){return new t.Control.FullScreen(i)},{leaflet:t,screenfull:e}})})(mg);const vg=V.defineComponent({name:"CoordinatesVerifyPolygon",props:{dataPolygon:Object,iconMarker:Object,coordinatesMap:Array,checkPointInPolygon:Function},data(){return{markerIconDefault:{iconUrl:ts,iconSize:[25,41],iconAnchor:[12,41]}}},mounted(){this.verificarPuntoEnPoligono()},methods:{verificarPuntoEnPoligono(){var f;const r=this.iconMarker?this.iconMarker:this.markerIconDefault,t=(f=this.dataPolygon)==null?void 0:f.geometry.coordinates[0].map(_=>[_[1],_[0]]),e=JSON.parse(JSON.stringify(t)),i=[this.coordinatesMap?this.coordinatesMap[0]:0,this.coordinatesMap?this.coordinatesMap[1]:0],n=_t.map("maps",{fullscreenControl:!0}).setView([this.coordinatesMap?this.coordinatesMap[0]:0,this.coordinatesMap?this.coordinatesMap[1]:0],this.coordinatesMap?this.coordinatesMap[2]:0);_t.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(n),_t.polygon(e).addTo(n);const o=[this.coordinatesMap?this.coordinatesMap[0]:0,this.coordinatesMap?this.coordinatesMap[1]:0],a=_t.icon(r);_t.marker(o,{icon:a}).addTo(n);const h=Kf(i),c=qf([t]),d=tg(h,c);this.checkPointInPolygon&&this.checkPointInPolygon(d)}}}),dL="",qo=(r,t)=>{const e=r.__vccOpts||r;for(const[i,n]of t)e[i]=n;return e},xg={ref:"maps",id:"maps"};function Eg(r,t,e,i,n,o){return V.openBlock(),V.createElementBlock("div",xg,null,512)}const wg=qo(vg,[["render",Eg]]);(function(r,t,e){function i(n,o){for(;(n=n.parentElement)&&!n.classList.contains(o););return n}L.drawVersion="1.0.4",L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes",text:"Save"},cancel:{title:"Cancel editing, discards all changes",text:"Cancel"},clearAll:{title:"Clear all layers",text:"Clear All"}},buttons:{edit:"Edit layers",editDisabled:"No layers to edit",remove:"Delete layers",removeDisabled:"No layers to delete"}},handlers:{edit:{tooltip:{text:"Drag handles or markers to edit features.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove."}}}}},L.Draw.Event={},L.Draw.Event.CREATED="draw:created",L.Draw.Event.EDITED="draw:edited",L.Draw.Event.DELETED="draw:deleted",L.Draw.Event.DRAWSTART="draw:drawstart",L.Draw.Event.DRAWSTOP="draw:drawstop",L.Draw.Event.DRAWVERTEX="draw:drawvertex",L.Draw.Event.EDITSTART="draw:editstart",L.Draw.Event.EDITMOVE="draw:editmove",L.Draw.Event.EDITRESIZE="draw:editresize",L.Draw.Event.EDITVERTEX="draw:editvertex",L.Draw.Event.EDITSTOP="draw:editstop",L.Draw.Event.DELETESTART="draw:deletestart",L.Draw.Event.DELETESTOP="draw:deletestop",L.Draw.Event.TOOLBAROPENED="draw:toolbaropened",L.Draw.Event.TOOLBARCLOSED="draw:toolbarclosed",L.Draw.Event.MARKERCONTEXT="draw:markercontext",L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({initialize:function(n,o){this._map=n,this._container=n._container,this._overlayPane=n._panes.overlayPane,this._popupPane=n._panes.popupPane,o&&o.shapeOptions&&(o.shapeOptions=L.Util.extend({},this.options.shapeOptions,o.shapeOptions)),L.setOptions(this,o);var a=L.version.split(".");parseInt(a[0],10)===1&&parseInt(a[1],10)>=2?L.Draw.Feature.include(L.Evented.prototype):L.Draw.Feature.include(L.Mixin.Events)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(L.DomUtil.disableTextSelection(),n.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,"keyup",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,"keyup",this._cancelDrawing,this))},setOptions:function(n){L.setOptions(this,n)},_fireCreatedEvent:function(n){this._map.fire(L.Draw.Event.CREATED,{layer:n,layerType:this.type})},_cancelDrawing:function(n){n.keyCode===27&&(this._map.fire("draw:canceled",{layerType:this.type}),this.disable())}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:"polyline"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},initialize:function(n,o){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,o&&o.drawError&&(o.drawError=L.Util.extend({},this.options.drawError,o.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,n,o)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("mouseout",this._onMouseOut,this).on("mousemove",this._onMouseMove,this).on("mousedown",this._onMouseDown,this).on("mouseup",this._onMouseUp,this).addTo(this._map),this._map.on("mouseup",this._onMouseUp,this).on("mousemove",this._onMouseMove,this).on("zoomlevelschange",this._onZoomEnd,this).on("touchstart",this._onTouch,this).on("zoomend",this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._clearHideErrorTimeout(),this._cleanUpShape(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,this._map.removeLayer(this._poly),delete this._poly,this._mouseMarker.off("mousedown",this._onMouseDown,this).off("mouseout",this._onMouseOut,this).off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._clearGuides(),this._map.off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this).off("zoomlevelschange",this._onZoomEnd,this).off("zoomend",this._onZoomEnd,this).off("touchstart",this._onTouch,this).off("click",this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var n=this._markers.pop(),o=this._poly,a=o.getLatLngs(),h=a.splice(-1,1)[0];this._poly.setLatLngs(a),this._markerGroup.removeLayer(n),o.getLatLngs().length<2&&this._map.removeLayer(o),this._vertexChanged(h,!1)}},addVertex:function(n){if(this._markers.length>=2&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(n))return void this._showErrorTooltip();this._errorShown&&this._hideErrorTooltip(),this._markers.push(this._createMarker(n)),this._poly.addLatLng(n),this._poly.getLatLngs().length===2&&this._map.addLayer(this._poly),this._vertexChanged(n,!0)},completeShape:function(){this._markers.length<=1||!this._shapeIsValid()||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_finishShape:function(){var n=this._poly._defaultShape?this._poly._defaultShape():this._poly.getLatLngs(),o=this._poly.newLatLngIntersects(n[n.length-1]);if(!this.options.allowIntersection&&o||!this._shapeIsValid())return void this._showErrorTooltip();this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_shapeIsValid:function(){return!0},_onZoomEnd:function(){this._markers!==null&&this._updateGuide()},_onMouseMove:function(n){var o=this._map.mouseEventToLayerPoint(n.originalEvent),a=this._map.layerPointToLatLng(o);this._currentLatLng=a,this._updateTooltip(a),this._updateGuide(o),this._mouseMarker.setLatLng(a),L.DomEvent.preventDefault(n.originalEvent)},_vertexChanged:function(n,o){this._map.fire(L.Draw.Event.DRAWVERTEX,{layers:this._markerGroup}),this._updateFinishHandler(),this._updateRunningMeasure(n,o),this._clearGuides(),this._updateTooltip()},_onMouseDown:function(n){if(!this._clickHandled&&!this._touchHandled&&!this._disableMarkers){this._onMouseMove(n),this._clickHandled=!0,this._disableNewMarkers();var o=n.originalEvent,a=o.clientX,h=o.clientY;this._startPoint.call(this,a,h)}},_startPoint:function(n,o){this._mouseDownOrigin=L.point(n,o)},_onMouseUp:function(n){var o=n.originalEvent,a=o.clientX,h=o.clientY;this._endPoint.call(this,a,h,n),this._clickHandled=null},_endPoint:function(n,o,a){if(this._mouseDownOrigin){var h=L.point(n,o).distanceTo(this._mouseDownOrigin),c=this._calculateFinishDistance(a.latlng);this.options.maxPoints>1&&this.options.maxPoints==this._markers.length+1?(this.addVertex(a.latlng),this._finishShape()):c<10&&L.Browser.touch?this._finishShape():Math.abs(h)<9*(r.devicePixelRatio||1)&&this.addVertex(a.latlng),this._enableNewMarkers()}this._mouseDownOrigin=null},_onTouch:function(n){var o,a,h=n.originalEvent;!h.touches||!h.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(o=h.touches[0].clientX,a=h.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,o,a),this._endPoint.call(this,o,a,n),this._touchHandled=null),this._clickHandled=null},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_calculateFinishDistance:function(n){var o;if(this._markers.length>0){var a;if(this.type===L.Draw.Polyline.TYPE)a=this._markers[this._markers.length-1];else{if(this.type!==L.Draw.Polygon.TYPE)return 1/0;a=this._markers[0]}var h=this._map.latLngToContainerPoint(a.getLatLng()),c=new L.Marker(n,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),d=this._map.latLngToContainerPoint(c.getLatLng());o=h.distanceTo(d)}else o=1/0;return o},_updateFinishHandler:function(){var n=this._markers.length;n>1&&this._markers[n-1].on("click",this._finishShape,this),n>2&&this._markers[n-2].off("click",this._finishShape,this)},_createMarker:function(n){var o=new L.Marker(n,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(o),o},_updateGuide:function(n){var o=this._markers?this._markers.length:0;o>0&&(n=n||this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[o-1].getLatLng()),n))},_updateTooltip:function(n){var o=this._getTooltipText();n&&this._tooltip.updatePosition(n),this._errorShown||this._tooltip.updateContent(o)},_drawGuide:function(n,o){var a,h,c,d=Math.floor(Math.sqrt(Math.pow(o.x-n.x,2)+Math.pow(o.y-n.y,2))),f=this.options.guidelineDistance,_=this.options.maxGuideLineLength,m=d>_?d-_:f;for(this._guidesContainer||(this._guidesContainer=L.DomUtil.create("div","leaflet-draw-guides",this._overlayPane));m<d;m+=this.options.guidelineDistance)a=m/d,h={x:Math.floor(n.x*(1-a)+a*o.x),y:Math.floor(n.y*(1-a)+a*o.y)},c=L.DomUtil.create("div","leaflet-draw-guide-dash",this._guidesContainer),c.style.backgroundColor=this._errorShown?this.options.drawError.color:this.options.shapeOptions.color,L.DomUtil.setPosition(c,h)},_updateGuideColor:function(n){if(this._guidesContainer)for(var o=0,a=this._guidesContainer.childNodes.length;o<a;o++)this._guidesContainer.childNodes[o].style.backgroundColor=n},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var n,o,a=this.options.showLength;return this._markers.length===0?n={text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(o=a?this._getMeasurementString():"",n=this._markers.length===1?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:o}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:o}),n},_updateRunningMeasure:function(n,o){var a,h,c=this._markers.length;this._markers.length===1?this._measurementRunningTotal=0:(a=c-(o?2:1),h=L.GeometryUtil.isVersion07x()?n.distanceTo(this._markers[a].getLatLng())*(this.options.factor||1):this._map.distance(n,this._markers[a].getLatLng())*(this.options.factor||1),this._measurementRunningTotal+=h*(o?1:-1))},_getMeasurementString:function(){var n,o=this._currentLatLng,a=this._markers[this._markers.length-1].getLatLng();return n=L.GeometryUtil.isVersion07x()?a&&o&&o.distanceTo?this._measurementRunningTotal+o.distanceTo(a)*(this.options.factor||1):this._measurementRunningTotal||0:a&&o?this._measurementRunningTotal+this._map.distance(o,a)*(this.options.factor||1):this._measurementRunningTotal||0,L.GeometryUtil.readableDistance(n,this.options.metric,this.options.feet,this.options.nautic,this.options.precision)},_showErrorTooltip:function(){this._errorShown=!0,this._tooltip.showAsError().updateContent({text:this.options.drawError.message}),this._updateGuideColor(this.options.drawError.color),this._poly.setStyle({color:this.options.drawError.color}),this._clearHideErrorTimeout(),this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1,this._clearHideErrorTimeout(),this._tooltip.removeError().updateContent(this._getTooltipText()),this._updateGuideColor(this.options.shapeOptions.color),this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&(clearTimeout(this._hideErrorTimeout),this._hideErrorTimeout=null)},_disableNewMarkers:function(){this._disableMarkers=!0},_enableNewMarkers:function(){setTimeout((function(){this._disableMarkers=!1}).bind(this),50)},_cleanUpShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off("click",this._finishShape,this)},_fireCreatedEvent:function(){var n=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)}}),L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:"polygon"},Poly:L.Polygon,options:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},initialize:function(n,o){L.Draw.Polyline.prototype.initialize.call(this,n,o),this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var n=this._markers.length;n===1&&this._markers[0].on("click",this._finishShape,this),n>2&&(this._markers[n-1].on("dblclick",this._finishShape,this),n>3&&this._markers[n-2].off("dblclick",this._finishShape,this))},_getTooltipText:function(){var n,o;return this._markers.length===0?n=L.drawLocal.draw.handlers.polygon.tooltip.start:this._markers.length<3?(n=L.drawLocal.draw.handlers.polygon.tooltip.cont,o=this._getMeasurementString()):(n=L.drawLocal.draw.handlers.polygon.tooltip.end,o=this._getMeasurementString()),{text:n,subtext:o}},_getMeasurementString:function(){var n=this._area,o="";return n||this.options.showLength?(this.options.showLength&&(o=L.Draw.Polyline.prototype._getMeasurementString.call(this)),n&&(o+="<br>"+L.GeometryUtil.readableArea(n,this.options.metric,this.options.precision)),o):null},_shapeIsValid:function(){return this._markers.length>=3},_vertexChanged:function(n,o){var a;!this.options.allowIntersection&&this.options.showArea&&(a=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(a)),L.Draw.Polyline.prototype._vertexChanged.call(this,n,o)},_cleanUpShape:function(){var n=this._markers.length;n>0&&(this._markers[0].off("click",this._finishShape,this),n>2&&this._markers[n-1].off("dblclick",this._finishShape,this))}}),L.SimpleShape={},L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(n,o){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end,L.Draw.Feature.prototype.initialize.call(this,n,o)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor="crosshair",this._tooltip.updateContent({text:this._initialLabelText}),this._map.on("mousedown",this._onMouseDown,this).on("mousemove",this._onMouseMove,this).on("touchstart",this._onMouseDown,this).on("touchmove",this._onMouseMove,this),t.addEventListener("touchstart",L.DomEvent.preventDefault,{passive:!1}))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor="",this._map.off("mousedown",this._onMouseDown,this).off("mousemove",this._onMouseMove,this).off("touchstart",this._onMouseDown,this).off("touchmove",this._onMouseMove,this),L.DomEvent.off(t,"mouseup",this._onMouseUp,this),L.DomEvent.off(t,"touchend",this._onMouseUp,this),t.removeEventListener("touchstart",L.DomEvent.preventDefault),this._shape&&(this._map.removeLayer(this._shape),delete this._shape)),this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(n){this._isDrawing=!0,this._startLatLng=n.latlng,L.DomEvent.on(t,"mouseup",this._onMouseUp,this).on(t,"touchend",this._onMouseUp,this).preventDefault(n.originalEvent)},_onMouseMove:function(n){var o=n.latlng;this._tooltip.updatePosition(o),this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(o))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()}}),L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:"rectangle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showArea:!0,metric:!0},initialize:function(n,o){this.type=L.Draw.Rectangle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,n,o)},disable:function(){this._enabled&&(this._isCurrentlyTwoClickDrawing=!1,L.Draw.SimpleShape.prototype.disable.call(this))},_onMouseUp:function(n){if(!this._shape&&!this._isCurrentlyTwoClickDrawing)return void(this._isCurrentlyTwoClickDrawing=!0);this._isCurrentlyTwoClickDrawing&&!i(n.target,"leaflet-pane")||L.Draw.SimpleShape.prototype._onMouseUp.call(this)},_drawShape:function(n){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,n)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,n),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var n=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,n)},_getTooltipText:function(){var n,o,a,h=L.Draw.SimpleShape.prototype._getTooltipText.call(this),c=this._shape,d=this.options.showArea;return c&&(n=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),o=L.GeometryUtil.geodesicArea(n),a=d?L.GeometryUtil.readableArea(o,this.options.metric):""),{text:h.text,subtext:a}}}),L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:"marker"},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(n,o){this.type=L.Draw.Marker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.marker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,n,o)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._tooltip.updateContent({text:this._initialLabelText}),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("click",this._onClick,this).addTo(this._map),this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._map.off("click",this._onClick,this).off("click",this._onTouch,this),this._marker&&(this._marker.off("click",this._onClick,this),this._map.removeLayer(this._marker),delete this._marker),this._mouseMarker.off("click",this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off("mousemove",this._onMouseMove,this))},_onMouseMove:function(n){var o=n.latlng;this._tooltip.updatePosition(o),this._mouseMarker.setLatLng(o),this._marker?(o=this._mouseMarker.getLatLng(),this._marker.setLatLng(o)):(this._marker=this._createMarker(o),this._marker.on("click",this._onClick,this),this._map.on("click",this._onClick,this).addLayer(this._marker))},_createMarker:function(n){return new L.Marker(n,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset})},_onClick:function(){this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_onTouch:function(n){this._onMouseMove(n),this._onClick()},_fireCreatedEvent:function(){var n=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)}}),L.Draw.CircleMarker=L.Draw.Marker.extend({statics:{TYPE:"circlemarker"},options:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0,zIndexOffset:2e3},initialize:function(n,o){this.type=L.Draw.CircleMarker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circlemarker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,n,o)},_fireCreatedEvent:function(){var n=new L.CircleMarker(this._marker.getLatLng(),this.options);L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)},_createMarker:function(n){return new L.CircleMarker(n,this.options)}}),L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:"circle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},initialize:function(n,o){this.type=L.Draw.Circle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,n,o)},_drawShape:function(n){if(L.GeometryUtil.isVersion07x())var o=this._startLatLng.distanceTo(n);else var o=this._map.distance(this._startLatLng,n);this._shape?this._shape.setRadius(o):(this._shape=new L.Circle(this._startLatLng,o,this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var n=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,n)},_onMouseMove:function(n){var o,a=n.latlng,h=this.options.showRadius,c=this.options.metric;if(this._tooltip.updatePosition(a),this._isDrawing){this._drawShape(a),o=this._shape.getRadius().toFixed(1);var d="";h&&(d=L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(o,c,this.options.feet,this.options.nautic)),this._tooltip.updateContent({text:this._endLabelText,subtext:d})}}}),L.Edit=L.Edit||{},L.Edit.Marker=L.Handler.extend({initialize:function(n,o){this._marker=n,L.setOptions(this,o)},addHooks:function(){var n=this._marker;n.dragging.enable(),n.on("dragend",this._onDragEnd,n),this._toggleMarkerHighlight()},removeHooks:function(){var n=this._marker;n.dragging.disable(),n.off("dragend",this._onDragEnd,n),this._toggleMarkerHighlight()},_onDragEnd:function(n){var o=n.target;o.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:o})},_toggleMarkerHighlight:function(){var n=this._marker._icon;n&&(n.style.display="none",L.DomUtil.hasClass(n,"leaflet-edit-marker-selected")?(L.DomUtil.removeClass(n,"leaflet-edit-marker-selected"),this._offsetMarker(n,-4)):(L.DomUtil.addClass(n,"leaflet-edit-marker-selected"),this._offsetMarker(n,4)),n.style.display="")},_offsetMarker:function(n,o){var a=parseInt(n.style.marginTop,10)-o,h=parseInt(n.style.marginLeft,10)-o;n.style.marginTop=a+"px",n.style.marginLeft=h+"px"}}),L.Marker.addInitHook(function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.Poly=L.Handler.extend({initialize:function(n){this.latlngs=[n._latlngs],n._holes&&(this.latlngs=this.latlngs.concat(n._holes)),this._poly=n,this._poly.on("revert-edited",this._updateLatLngs,this)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._poly._latlngs)?this._poly._latlngs:this._poly._latlngs[0]:this._poly._latlngs},_eachVertexHandler:function(n){for(var o=0;o<this._verticesHandlers.length;o++)n(this._verticesHandlers[o])},addHooks:function(){this._initHandlers(),this._eachVertexHandler(function(n){n.addHooks()})},removeHooks:function(){this._eachVertexHandler(function(n){n.removeHooks()})},updateMarkers:function(){this._eachVertexHandler(function(n){n.updateMarkers()})},_initHandlers:function(){this._verticesHandlers=[];for(var n=0;n<this.latlngs.length;n++)this._verticesHandlers.push(new L.Edit.PolyVerticesEdit(this._poly,this.latlngs[n],this._poly.options.poly))},_updateLatLngs:function(n){this.latlngs=[n.layer._latlngs],n.layer._holes&&(this.latlngs=this.latlngs.concat(n.layer._holes))}}),L.Edit.PolyVerticesEdit=L.Handler.extend({options:{icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),drawError:{color:"#b00b00",timeout:1e3}},initialize:function(n,o,a){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this._poly=n,a&&a.drawError&&(a.drawError=L.Util.extend({},this.options.drawError,a.drawError)),this._latlngs=o,L.setOptions(this,a)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]:this._latlngs},addHooks:function(){var n=this._poly,o=n._path;n instanceof L.Polygon||(n.options.fill=!1,n.options.editing&&(n.options.editing.fill=!1)),o&&n.options.editing&&n.options.editing.className&&(n.options.original.className&&n.options.original.className.split(" ").forEach(function(a){L.DomUtil.removeClass(o,a)}),n.options.editing.className.split(" ").forEach(function(a){L.DomUtil.addClass(o,a)})),n.setStyle(n.options.editing),this._poly._map&&(this._map=this._poly._map,this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var n=this._poly,o=n._path;o&&n.options.editing&&n.options.editing.className&&(n.options.editing.className.split(" ").forEach(function(a){L.DomUtil.removeClass(o,a)}),n.options.original.className&&n.options.original.className.split(" ").forEach(function(a){L.DomUtil.addClass(o,a)})),n.setStyle(n.options.original),n._map&&(n._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._markers=[];var n,o,a,h,c=this._defaultShape();for(n=0,a=c.length;n<a;n++)h=this._createMarker(c[n],n),h.on("click",this._onMarkerClick,this),h.on("contextmenu",this._onContextMenu,this),this._markers.push(h);var d,f;for(n=0,o=a-1;n<a;o=n++)(n!==0||L.Polygon&&this._poly instanceof L.Polygon)&&(d=this._markers[o],f=this._markers[n],this._createMiddleMarker(d,f),this._updatePrevNext(d,f))},_createMarker:function(n,o){var a=new L.Marker.Touch(n,{draggable:!0,icon:this.options.icon});return a._origLatLng=n,a._index=o,a.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._fireEdit,this).on("touchmove",this._onTouchMove,this).on("touchend",this._fireEdit,this).on("MSPointerMove",this._onTouchMove,this).on("MSPointerUp",this._fireEdit,this),this._markerGroup.addLayer(a),a},_onMarkerDragStart:function(){this._poly.fire("editstart")},_spliceLatLngs:function(){var n=this._defaultShape(),o=[].splice.apply(n,arguments);return this._poly._convertLatLngs(n,!0),this._poly.redraw(),o},_removeMarker:function(n){var o=n._index;this._markerGroup.removeLayer(n),this._markers.splice(o,1),this._spliceLatLngs(o,1),this._updateIndexes(o,-1),n.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._fireEdit,this).off("touchmove",this._onMarkerDrag,this).off("touchend",this._fireEdit,this).off("click",this._onMarkerClick,this).off("MSPointerMove",this._onTouchMove,this).off("MSPointerUp",this._fireEdit,this)},_fireEdit:function(){this._poly.edited=!0,this._poly.fire("edit"),this._poly._map.fire(L.Draw.Event.EDITVERTEX,{layers:this._markerGroup,poly:this._poly})},_onMarkerDrag:function(n){var o=n.target,a=this._poly,h=L.LatLngUtil.cloneLatLng(o._origLatLng);if(L.extend(o._origLatLng,o._latlng),a.options.poly){var c=a._map._editTooltip;if(!a.options.poly.allowIntersection&&a.intersects()){L.extend(o._origLatLng,h),o.setLatLng(h);var d=a.options.color;a.setStyle({color:this.options.drawError.color}),c&&c.updateContent({text:L.drawLocal.draw.handlers.polyline.error}),setTimeout(function(){a.setStyle({color:d}),c&&c.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext})},1e3)}}o._middleLeft&&o._middleLeft.setLatLng(this._getMiddleLatLng(o._prev,o)),o._middleRight&&o._middleRight.setLatLng(this._getMiddleLatLng(o,o._next)),this._poly._bounds._southWest=L.latLng(1/0,1/0),this._poly._bounds._northEast=L.latLng(-1/0,-1/0);var f=this._poly.getLatLngs();this._poly._convertLatLngs(f,!0),this._poly.redraw(),this._poly.fire("editdrag")},_onMarkerClick:function(n){var o=L.Polygon&&this._poly instanceof L.Polygon?4:3,a=n.target;this._defaultShape().length<o||(this._removeMarker(a),this._updatePrevNext(a._prev,a._next),a._middleLeft&&this._markerGroup.removeLayer(a._middleLeft),a._middleRight&&this._markerGroup.removeLayer(a._middleRight),a._prev&&a._next?this._createMiddleMarker(a._prev,a._next):a._prev?a._next||(a._prev._middleRight=null):a._next._middleLeft=null,this._fireEdit())},_onContextMenu:function(n){var o=n.target;this._poly,this._poly._map.fire(L.Draw.Event.MARKERCONTEXT,{marker:o,layers:this._markerGroup,poly:this._poly}),L.DomEvent.stopPropagation},_onTouchMove:function(n){var o=this._map.mouseEventToLayerPoint(n.originalEvent.touches[0]),a=this._map.layerPointToLatLng(o),h=n.target;L.extend(h._origLatLng,a),h._middleLeft&&h._middleLeft.setLatLng(this._getMiddleLatLng(h._prev,h)),h._middleRight&&h._middleRight.setLatLng(this._getMiddleLatLng(h,h._next)),this._poly.redraw(),this.updateMarkers()},_updateIndexes:function(n,o){this._markerGroup.eachLayer(function(a){a._index>n&&(a._index+=o)})},_createMiddleMarker:function(n,o){var a,h,c,d=this._getMiddleLatLng(n,o),f=this._createMarker(d);f.setOpacity(.6),n._middleRight=o._middleLeft=f,h=function(){f.off("touchmove",h,this);var _=o._index;f._index=_,f.off("click",a,this).on("click",this._onMarkerClick,this),d.lat=f.getLatLng().lat,d.lng=f.getLatLng().lng,this._spliceLatLngs(_,0,d),this._markers.splice(_,0,f),f.setOpacity(1),this._updateIndexes(_,1),o._index++,this._updatePrevNext(n,f),this._updatePrevNext(f,o),this._poly.fire("editstart")},c=function(){f.off("dragstart",h,this),f.off("dragend",c,this),f.off("touchmove",h,this),this._createMiddleMarker(n,f),this._createMiddleMarker(f,o)},a=function(){h.call(this),c.call(this),this._fireEdit()},f.on("click",a,this).on("dragstart",h,this).on("dragend",c,this).on("touchmove",h,this),this._markerGroup.addLayer(f)},_updatePrevNext:function(n,o){n&&(n._next=o),o&&(o._prev=n)},_getMiddleLatLng:function(n,o){var a=this._poly._map,h=a.project(n.getLatLng()),c=a.project(o.getLatLng());return a.unproject(h._add(c)._divideBy(2))}}),L.Polyline.addInitHook(function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))}),L.Edit=L.Edit||{},L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move"}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize"}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon"}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon"})},initialize:function(n,o){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon),this._shape=n,L.Util.setOptions(this,o)},addHooks:function(){var n=this._shape;this._shape._map&&(this._map=this._shape._map,n.setStyle(n.options.editing),n._map&&(this._map=n._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var n=this._shape;if(n.setStyle(n.options.original),n._map){this._unbindMarker(this._moveMarker);for(var o=0,a=this._resizeMarkers.length;o<a;o++)this._unbindMarker(this._resizeMarkers[o]);this._resizeMarkers=null,this._map.removeLayer(this._markerGroup),delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._createMoveMarker(),this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(n,o){var a=new L.Marker.Touch(n,{draggable:!0,icon:o,zIndexOffset:10});return this._bindMarker(a),this._markerGroup.addLayer(a),a},_bindMarker:function(n){n.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._onMarkerDragEnd,this).on("touchstart",this._onTouchStart,this).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onTouchEnd,this).on("MSPointerUp",this._onTouchEnd,this)},_unbindMarker:function(n){n.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._onMarkerDragEnd,this).off("touchstart",this._onTouchStart,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onTouchEnd,this).off("MSPointerUp",this._onTouchEnd,this)},_onMarkerDragStart:function(n){n.target.setOpacity(0),this._shape.fire("editstart")},_fireEdit:function(){this._shape.edited=!0,this._shape.fire("edit")},_onMarkerDrag:function(n){var o=n.target,a=o.getLatLng();o===this._moveMarker?this._move(a):this._resize(a),this._shape.redraw(),this._shape.fire("editdrag")},_onMarkerDragEnd:function(n){n.target.setOpacity(1),this._fireEdit()},_onTouchStart:function(n){if(L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,n),typeof this._getCorners=="function"){var o=this._getCorners(),a=n.target,h=a._cornerIndex;a.setOpacity(0),this._oppositeCorner=o[(h+2)%4],this._toggleCornerMarkers(0,h)}this._shape.fire("editstart")},_onTouchMove:function(n){var o=this._map.mouseEventToLayerPoint(n.originalEvent.touches[0]),a=this._map.layerPointToLatLng(o);return n.target===this._moveMarker?this._move(a):this._resize(a),this._shape.redraw(),!1},_onTouchEnd:function(n){n.target.setOpacity(1),this.updateMarkers(),this._fireEdit()},_move:function(){},_resize:function(){}}),L.Edit=L.Edit||{},L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var n=this._shape.getBounds(),o=n.getCenter();this._moveMarker=this._createMarker(o,this.options.moveIcon)},_createResizeMarker:function(){var n=this._getCorners();this._resizeMarkers=[];for(var o=0,a=n.length;o<a;o++)this._resizeMarkers.push(this._createMarker(n[o],this.options.resizeIcon)),this._resizeMarkers[o]._cornerIndex=o},_onMarkerDragStart:function(n){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,n);var o=this._getCorners(),a=n.target,h=a._cornerIndex;this._oppositeCorner=o[(h+2)%4],this._toggleCornerMarkers(0,h)},_onMarkerDragEnd:function(n){var o,a,h=n.target;h===this._moveMarker&&(o=this._shape.getBounds(),a=o.getCenter(),h.setLatLng(a)),this._toggleCornerMarkers(1),this._repositionCornerMarkers(),L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,n)},_move:function(n){for(var o,a=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),h=this._shape.getBounds(),c=h.getCenter(),d=[],f=0,_=a.length;f<_;f++)o=[a[f].lat-c.lat,a[f].lng-c.lng],d.push([n.lat+o[0],n.lng+o[1]]);this._shape.setLatLngs(d),this._repositionCornerMarkers(),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})},_resize:function(n){var o;this._shape.setBounds(L.latLngBounds(n,this._oppositeCorner)),o=this._shape.getBounds(),this._moveMarker.setLatLng(o.getCenter()),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})},_getCorners:function(){var n=this._shape.getBounds();return[n.getNorthWest(),n.getNorthEast(),n.getSouthEast(),n.getSouthWest()]},_toggleCornerMarkers:function(n){for(var o=0,a=this._resizeMarkers.length;o<a;o++)this._resizeMarkers[o].setOpacity(n)},_repositionCornerMarkers:function(){for(var n=this._getCorners(),o=0,a=this._resizeMarkers.length;o<a;o++)this._resizeMarkers[o].setLatLng(n[o])}}),L.Rectangle.addInitHook(function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.CircleMarker=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var n=this._shape.getLatLng();this._moveMarker=this._createMarker(n,this.options.moveIcon)},_createResizeMarker:function(){this._resizeMarkers=[]},_move:function(n){if(this._resizeMarkers.length){var o=this._getResizeMarkerPoint(n);this._resizeMarkers[0].setLatLng(o)}this._shape.setLatLng(n),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})}}),L.CircleMarker.addInitHook(function(){L.Edit.CircleMarker&&(this.editing=new L.Edit.CircleMarker(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),L.Edit=L.Edit||{},L.Edit.Circle=L.Edit.CircleMarker.extend({_createResizeMarker:function(){var n=this._shape.getLatLng(),o=this._getResizeMarkerPoint(n);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(o,this.options.resizeIcon))},_getResizeMarkerPoint:function(n){var o=this._shape._radius*Math.cos(Math.PI/4),a=this._map.project(n);return this._map.unproject([a.x+o,a.y-o])},_resize:function(n){var o=this._moveMarker.getLatLng();L.GeometryUtil.isVersion07x()?radius=o.distanceTo(n):radius=this._map.distance(o,n),this._shape.setRadius(radius),this._map.editTooltip&&this._map._editTooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.subtext+"<br />"+L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(radius,!0,this.options.feet,this.options.nautic)}),this._shape.setRadius(radius),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})}}),L.Circle.addInitHook(function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable())}),L.Map.mergeOptions({touchExtend:!0}),L.Map.TouchExtend=L.Handler.extend({initialize:function(n){this._map=n,this._container=n._container,this._pane=n._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.on(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.on(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.on(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.on(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.on(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.on(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.on(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.on(this._container,"touchleave",this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.off(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.off(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.off(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.off(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.off(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.off(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.off(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.off(this._container,"touchleave",this._onTouchLeave,this))},_touchEvent:function(n,o){var a={};if(n.touches!==void 0){if(!n.touches.length)return;a=n.touches[0]}else if(n.pointerType!=="touch"||(a=n,!this._filterClick(n)))return;var h=this._map.mouseEventToContainerPoint(a),c=this._map.mouseEventToLayerPoint(a),d=this._map.layerPointToLatLng(c);this._map.fire(o,{latlng:d,layerPoint:c,containerPoint:h,pageX:a.pageX,pageY:a.pageY,originalEvent:n})},_filterClick:function(n){var o=n.timeStamp||n.originalEvent.timeStamp,a=L.DomEvent._lastClick&&o-L.DomEvent._lastClick;return a&&a>100&&a<500||n.target._simulatedClick&&!n._simulated?(L.DomEvent.stop(n),!1):(L.DomEvent._lastClick=o,!0)},_onTouchStart:function(n){this._map._loaded&&this._touchEvent(n,"touchstart")},_onTouchEnd:function(n){this._map._loaded&&this._touchEvent(n,"touchend")},_onTouchCancel:function(n){if(this._map._loaded){var o="touchcancel";this._detectIE()&&(o="pointercancel"),this._touchEvent(n,o)}},_onTouchLeave:function(n){this._map._loaded&&this._touchEvent(n,"touchleave")},_onTouchMove:function(n){this._map._loaded&&this._touchEvent(n,"touchmove")},_detectIE:function(){var n=r.navigator.userAgent,o=n.indexOf("MSIE ");if(o>0)return parseInt(n.substring(o+5,n.indexOf(".",o)),10);if(n.indexOf("Trident/")>0){var a=n.indexOf("rv:");return parseInt(n.substring(a+3,n.indexOf(".",a)),10)}var h=n.indexOf("Edge/");return h>0&&parseInt(n.substring(h+5,n.indexOf(".",h)),10)}}),L.Map.addInitHook("addHandler","touchExtend",L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){return this.addInteractiveTarget?L.Marker.prototype._initInteraction.apply(this):this._initInteractionLegacy()},_initInteractionLegacy:function(){if(this.options.clickable){var n=this._icon,o=["dblclick","mousedown","mouseover","mouseout","contextmenu","touchstart","touchend","touchmove"];this._detectIE?o.concat(["MSPointerDown","MSPointerUp","MSPointerMove","MSPointerCancel"]):o.concat(["touchcancel"]),L.DomUtil.addClass(n,"leaflet-clickable"),L.DomEvent.on(n,"click",this._onMouseClick,this),L.DomEvent.on(n,"keypress",this._onKeyPress,this);for(var a=0;a<o.length;a++)L.DomEvent.on(n,o[a],this._fireMouseEvent,this);L.Handler.MarkerDrag&&(this.dragging=new L.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_detectIE:function(){var n=r.navigator.userAgent,o=n.indexOf("MSIE ");if(o>0)return parseInt(n.substring(o+5,n.indexOf(".",o)),10);if(n.indexOf("Trident/")>0){var a=n.indexOf("rv:");return parseInt(n.substring(a+3,n.indexOf(".",a)),10)}var h=n.indexOf("Edge/");return h>0&&parseInt(n.substring(h+5,n.indexOf(".",h)),10)}}),L.LatLngUtil={cloneLatLngs:function(n){for(var o=[],a=0,h=n.length;a<h;a++)Array.isArray(n[a])?o.push(L.LatLngUtil.cloneLatLngs(n[a])):o.push(this.cloneLatLng(n[a]));return o},cloneLatLng:function(n){return L.latLng(n.lat,n.lng)}},function(){var n={km:2,ha:2,m:0,mi:2,ac:2,yd:0,ft:0,nm:2};L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(o){var a,h,c=o.length,d=0,f=Math.PI/180;if(c>2){for(var _=0;_<c;_++)a=o[_],h=o[(_+1)%c],d+=(h.lng-a.lng)*f*(2+Math.sin(a.lat*f)+Math.sin(h.lat*f));d=6378137*d*6378137/2}return Math.abs(d)},formattedNumber:function(o,a){var h=parseFloat(o).toFixed(a),c=L.drawLocal.format&&L.drawLocal.format.numeric,d=c&&c.delimiters,f=d&&d.thousands,_=d&&d.decimal;if(f||_){var m=h.split(".");h=f?m[0].replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f):m[0],_=_||".",m.length>1&&(h=h+_+m[1])}return h},readableArea:function(o,a,f){var c,d,f=L.Util.extend({},n,f);return a?(d=["ha","m"],type=typeof a,type==="string"?d=[a]:type!=="boolean"&&(d=a),c=o>=1e6&&d.indexOf("km")!==-1?L.GeometryUtil.formattedNumber(1e-6*o,f.km)+" km²":o>=1e4&&d.indexOf("ha")!==-1?L.GeometryUtil.formattedNumber(1e-4*o,f.ha)+" ha":L.GeometryUtil.formattedNumber(o,f.m)+" m²"):(o/=.836127,c=o>=3097600?L.GeometryUtil.formattedNumber(o/3097600,f.mi)+" mi²":o>=4840?L.GeometryUtil.formattedNumber(o/4840,f.ac)+" acres":L.GeometryUtil.formattedNumber(o,f.yd)+" yd²"),c},readableDistance:function(o,a,h,c,_){var f,_=L.Util.extend({},n,_);switch(a?typeof a=="string"?a:"metric":h?"feet":c?"nauticalMile":"yards"){case"metric":f=o>1e3?L.GeometryUtil.formattedNumber(o/1e3,_.km)+" km":L.GeometryUtil.formattedNumber(o,_.m)+" m";break;case"feet":o*=3.28083,f=L.GeometryUtil.formattedNumber(o,_.ft)+" ft";break;case"nauticalMile":o*=.53996,f=L.GeometryUtil.formattedNumber(o/1e3,_.nm)+" nm";break;case"yards":default:o*=1.09361,f=o>1760?L.GeometryUtil.formattedNumber(o/1760,_.mi)+" miles":L.GeometryUtil.formattedNumber(o,_.yd)+" yd"}return f},isVersion07x:function(){var o=L.version.split(".");return parseInt(o[0],10)===0&&parseInt(o[1],10)===7}})}(),L.Util.extend(L.LineUtil,{segmentsIntersect:function(n,o,a,h){return this._checkCounterclockwise(n,a,h)!==this._checkCounterclockwise(o,a,h)&&this._checkCounterclockwise(n,o,a)!==this._checkCounterclockwise(n,o,h)},_checkCounterclockwise:function(n,o,a){return(a.y-n.y)*(o.x-n.x)>(o.y-n.y)*(a.x-n.x)}}),L.Polyline.include({intersects:function(){var n,o,a,h=this._getProjectedPoints(),c=h?h.length:0;if(this._tooFewPointsForIntersection())return!1;for(n=c-1;n>=3;n--)if(o=h[n-1],a=h[n],this._lineSegmentsIntersectsRange(o,a,n-2))return!0;return!1},newLatLngIntersects:function(n,o){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(n),o)},newPointIntersects:function(n,o){var a=this._getProjectedPoints(),h=a?a.length:0,c=a?a[h-1]:null,d=h-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(c,n,d,o?1:0)},_tooFewPointsForIntersection:function(n){var o=this._getProjectedPoints(),a=o?o.length:0;return a+=n||0,!o||a<=3},_lineSegmentsIntersectsRange:function(n,o,a,h){var c,d,f=this._getProjectedPoints();h=h||0;for(var _=a;_>h;_--)if(c=f[_-1],d=f[_],L.LineUtil.segmentsIntersect(n,o,c,d))return!0;return!1},_getProjectedPoints:function(){if(!this._defaultShape)return this._originalPoints;for(var n=[],o=this._defaultShape(),a=0;a<o.length;a++)n.push(this._map.latLngToLayerPoint(o[a]));return n}}),L.Polygon.include({intersects:function(){var n,o,a,h,c=this._getProjectedPoints();return!this._tooFewPointsForIntersection()&&(!!L.Polyline.prototype.intersects.call(this)||(n=c.length,o=c[0],a=c[n-1],h=n-2,this._lineSegmentsIntersectsRange(a,o,h,1)))}}),L.Control.Draw=L.Control.extend({options:{position:"topleft",draw:{},edit:!1},initialize:function(n){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");L.Control.prototype.initialize.call(this,n);var o;this._toolbars={},L.DrawToolbar&&this.options.draw&&(o=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=o,this._toolbars[L.DrawToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(o=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=o,this._toolbars[L.EditToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.toolbar=this},onAdd:function(n){var o,a=L.DomUtil.create("div","leaflet-draw"),h=!1;for(var c in this._toolbars)this._toolbars.hasOwnProperty(c)&&(o=this._toolbars[c].addToolbar(n))&&(h||(L.DomUtil.hasClass(o,"leaflet-draw-toolbar-top")||L.DomUtil.addClass(o.childNodes[0],"leaflet-draw-toolbar-top"),h=!0),a.appendChild(o));return a},onRemove:function(){for(var n in this._toolbars)this._toolbars.hasOwnProperty(n)&&this._toolbars[n].removeToolbar()},setDrawingOptions:function(n){for(var o in this._toolbars)this._toolbars[o]instanceof L.DrawToolbar&&this._toolbars[o].setOptions(n)},_toolbarEnabled:function(n){var o=n.target;for(var a in this._toolbars)this._toolbars[a]!==o&&this._toolbars[a].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))}),L.Toolbar=L.Class.extend({initialize:function(n){L.setOptions(this,n),this._modes={},this._actionButtons=[],this._activeMode=null;var o=L.version.split(".");parseInt(o[0],10)===1&&parseInt(o[1],10)>=2?L.Toolbar.include(L.Evented.prototype):L.Toolbar.include(L.Mixin.Events)},enabled:function(){return this._activeMode!==null},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(n){var o,a=L.DomUtil.create("div","leaflet-draw-section"),h=0,c=this._toolbarClass||"",d=this.getModeHandlers(n);for(this._toolbarContainer=L.DomUtil.create("div","leaflet-draw-toolbar leaflet-bar"),this._map=n,o=0;o<d.length;o++)d[o].enabled&&this._initModeHandler(d[o].handler,this._toolbarContainer,h++,c,d[o].title);if(h)return this._lastButtonIndex=--h,this._actionsContainer=L.DomUtil.create("ul","leaflet-draw-actions"),a.appendChild(this._toolbarContainer),a.appendChild(this._actionsContainer),a},removeToolbar:function(){for(var n in this._modes)this._modes.hasOwnProperty(n)&&(this._disposeButton(this._modes[n].button,this._modes[n].handler.enable,this._modes[n].handler),this._modes[n].handler.disable(),this._modes[n].handler.off("enabled",this._handlerActivated,this).off("disabled",this._handlerDeactivated,this));this._modes={};for(var o=0,a=this._actionButtons.length;o<a;o++)this._disposeButton(this._actionButtons[o].button,this._actionButtons[o].callback,this);this._actionButtons=[],this._actionsContainer=null},_initModeHandler:function(n,o,a,h,c){var d=n.type;this._modes[d]={},this._modes[d].handler=n,this._modes[d].button=this._createButton({type:d,title:c,className:h+"-"+d,container:o,callback:this._modes[d].handler.enable,context:this._modes[d].handler}),this._modes[d].buttonIndex=a,this._modes[d].handler.on("enabled",this._handlerActivated,this).on("disabled",this._handlerDeactivated,this)},_detectIOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!r.MSStream},_createButton:function(n){var o=L.DomUtil.create("a",n.className||"",n.container),a=L.DomUtil.create("span","sr-only",n.container);o.href="#",o.appendChild(a),n.title&&(o.title=n.title,a.innerHTML=n.title),n.text&&(o.innerHTML=n.text,a.innerHTML=n.text);var h=this._detectIOS()?"touchstart":"click";return L.DomEvent.on(o,"click",L.DomEvent.stopPropagation).on(o,"mousedown",L.DomEvent.stopPropagation).on(o,"dblclick",L.DomEvent.stopPropagation).on(o,"touchstart",L.DomEvent.stopPropagation).on(o,"click",L.DomEvent.preventDefault).on(o,h,n.callback,n.context),o},_disposeButton:function(n,o){var a=this._detectIOS()?"touchstart":"click";L.DomEvent.off(n,"click",L.DomEvent.stopPropagation).off(n,"mousedown",L.DomEvent.stopPropagation).off(n,"dblclick",L.DomEvent.stopPropagation).off(n,"touchstart",L.DomEvent.stopPropagation).off(n,"click",L.DomEvent.preventDefault).off(n,a,o)},_handlerActivated:function(n){this.disable(),this._activeMode=this._modes[n.handler],L.DomUtil.addClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._showActionsToolbar(),this.fire("enable")},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._activeMode=null,this.fire("disable")},_createActions:function(n){var o,a,h,c,d=this._actionsContainer,f=this.getActions(n),_=f.length;for(a=0,h=this._actionButtons.length;a<h;a++)this._disposeButton(this._actionButtons[a].button,this._actionButtons[a].callback);for(this._actionButtons=[];d.firstChild;)d.removeChild(d.firstChild);for(var m=0;m<_;m++)"enabled"in f[m]&&!f[m].enabled||(o=L.DomUtil.create("li","",d),c=this._createButton({title:f[m].title,text:f[m].text,container:o,callback:f[m].callback,context:f[m].context}),this._actionButtons.push({button:c,callback:f[m].callback}))},_showActionsToolbar:function(){var n=this._activeMode.buttonIndex,o=this._lastButtonIndex,a=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=a+"px",n===0&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-top")),n===o&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-bottom")),this._actionsContainer.style.display="block",this._map.fire(L.Draw.Event.TOOLBAROPENED)},_hideActionsToolbar:function(){this._actionsContainer.style.display="none",L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-top"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-bottom"),this._map.fire(L.Draw.Event.TOOLBARCLOSED)}}),L.Draw=L.Draw||{},L.Draw.Tooltip=L.Class.extend({initialize:function(n){this._map=n,this._popupPane=n._panes.popupPane,this._visible=!1,this._container=n.options.drawControlTooltips?L.DomUtil.create("div","leaflet-draw-tooltip",this._popupPane):null,this._singleLineLabel=!1,this._map.on("mouseout",this._onMouseOut,this)},dispose:function(){this._map.off("mouseout",this._onMouseOut,this),this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(n){return this._container?(n.subtext=n.subtext||"",n.subtext.length!==0||this._singleLineLabel?n.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!0),this._container.innerHTML=(n.subtext.length>0?'<span class="leaflet-draw-tooltip-subtext">'+n.subtext+"</span><br />":"")+"<span>"+n.text+"</span>",n.text||n.subtext?(this._visible=!0,this._container.style.visibility="inherit"):(this._visible=!1,this._container.style.visibility="hidden"),this):this},updatePosition:function(n){var o=this._map.latLngToLayerPoint(n),a=this._container;return this._container&&(this._visible&&(a.style.visibility="inherit"),L.DomUtil.setPosition(a,o)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,"leaflet-error-draw-tooltip"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,"leaflet-error-draw-tooltip"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility="hidden")}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:"draw"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{},circlemarker:{}},initialize:function(n){for(var o in this.options)this.options.hasOwnProperty(o)&&n[o]&&(n[o]=L.extend({},this.options[o],n[o]));this._toolbarClass="leaflet-draw-draw",L.Toolbar.prototype.initialize.call(this,n)},getModeHandlers:function(n){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(n,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(n,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(n,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(n,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(n,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker},{enabled:this.options.circlemarker,handler:new L.Draw.CircleMarker(n,this.options.circlemarker),title:L.drawLocal.draw.toolbar.buttons.circlemarker}]},getActions:function(n){return[{enabled:n.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:n.completeShape,context:n},{enabled:n.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:n.deleteLastVertex,context:n},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(n){L.setOptions(this,n);for(var o in this._modes)this._modes.hasOwnProperty(o)&&n.hasOwnProperty(o)&&this._modes[o].handler.setOptions(n[o])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:"edit"},options:{edit:{selectedPathOptions:{dashArray:"10, 10",fill:!0,fillColor:"#fe57a1",fillOpacity:.1,maintainColor:!1}},remove:{},poly:null,featureGroup:null},initialize:function(n){n.edit&&(n.edit.selectedPathOptions===void 0&&(n.edit.selectedPathOptions=this.options.edit.selectedPathOptions),n.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,n.edit.selectedPathOptions)),n.remove&&(n.remove=L.extend({},this.options.remove,n.remove)),n.poly&&(n.poly=L.extend({},this.options.poly,n.poly)),this._toolbarClass="leaflet-draw-edit",L.Toolbar.prototype.initialize.call(this,n),this._selectedFeatureCount=0},getModeHandlers:function(n){var o=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(n,{featureGroup:o,selectedPathOptions:this.options.edit.selectedPathOptions,poly:this.options.poly}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(n,{featureGroup:o}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(n){var o=[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}];return n.removeAllLayers&&o.push({title:L.drawLocal.edit.toolbar.actions.clearAll.title,text:L.drawLocal.edit.toolbar.actions.clearAll.text,callback:this._clearAllLayers,context:this}),o},addToolbar:function(n){var o=L.Toolbar.prototype.addToolbar.call(this,n);return this._checkDisabled(),this.options.featureGroup.on("layeradd layerremove",this._checkDisabled,this),o},removeToolbar:function(){this.options.featureGroup.off("layeradd layerremove",this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode&&this._activeMode.handler.disable()},_clearAllLayers:function(){this._activeMode.handler.removeAllLayers(),this._activeMode&&this._activeMode.handler.disable()},_checkDisabled:function(){var n,o=this.options.featureGroup,a=o.getLayers().length!==0;this.options.edit&&(n=this._modes[L.EditToolbar.Edit.TYPE].button,a?L.DomUtil.removeClass(n,"leaflet-disabled"):L.DomUtil.addClass(n,"leaflet-disabled"),n.setAttribute("title",a?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(n=this._modes[L.EditToolbar.Delete.TYPE].button,a?L.DomUtil.removeClass(n,"leaflet-disabled"):L.DomUtil.addClass(n,"leaflet-disabled"),n.setAttribute("title",a?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:"edit"},initialize:function(n,o){if(L.Handler.prototype.initialize.call(this,n),L.setOptions(this,o),this._featureGroup=o.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE;var a=L.version.split(".");parseInt(a[0],10)===1&&parseInt(a[1],10)>=2?L.EditToolbar.Edit.include(L.Evented.prototype):L.EditToolbar.Edit.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.EDITSTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on("layeradd",this._enableLayerEdit,this).on("layerremove",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off("layeradd",this._enableLayerEdit,this).off("layerremove",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.EDITSTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(n.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),n._editTooltip=this._tooltip,this._updateTooltip(),this._map.on("mousemove",this._onMouseMove,this).on("touchmove",this._onMouseMove,this).on("MSPointerMove",this._onMouseMove,this).on(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this).off("touchmove",this._onMouseMove,this).off("MSPointerMove",this._onMouseMove,this).off(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},revertLayers:function(){this._featureGroup.eachLayer(function(n){this._revertLayer(n)},this)},save:function(){var n=new L.LayerGroup;this._featureGroup.eachLayer(function(o){o.edited&&(n.addLayer(o),o.edited=!1)}),this._map.fire(L.Draw.Event.EDITED,{layers:n})},_backupLayer:function(n){var o=L.Util.stamp(n);this._uneditedLayerProps[o]||(n instanceof L.Polyline||n instanceof L.Polygon||n instanceof L.Rectangle?this._uneditedLayerProps[o]={latlngs:L.LatLngUtil.cloneLatLngs(n.getLatLngs())}:n instanceof L.Circle?this._uneditedLayerProps[o]={latlng:L.LatLngUtil.cloneLatLng(n.getLatLng()),radius:n.getRadius()}:(n instanceof L.Marker||n instanceof L.CircleMarker)&&(this._uneditedLayerProps[o]={latlng:L.LatLngUtil.cloneLatLng(n.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(n){var o=L.Util.stamp(n);n.edited=!1,this._uneditedLayerProps.hasOwnProperty(o)&&(n instanceof L.Polyline||n instanceof L.Polygon||n instanceof L.Rectangle?n.setLatLngs(this._uneditedLayerProps[o].latlngs):n instanceof L.Circle?(n.setLatLng(this._uneditedLayerProps[o].latlng),n.setRadius(this._uneditedLayerProps[o].radius)):(n instanceof L.Marker||n instanceof L.CircleMarker)&&n.setLatLng(this._uneditedLayerProps[o].latlng),n.fire("revert-edited",{layer:n}))},_enableLayerEdit:function(n){var o,a,h=n.layer||n.target||n;this._backupLayer(h),this.options.poly&&(a=L.Util.extend({},this.options.poly),h.options.poly=a),this.options.selectedPathOptions&&(o=L.Util.extend({},this.options.selectedPathOptions),o.maintainColor&&(o.color=h.options.color,o.fillColor=h.options.fillColor),h.options.original=L.extend({},h.options),h.options.editing=o),h instanceof L.Marker?(h.editing&&h.editing.enable(),h.dragging.enable(),h.on("dragend",this._onMarkerDragEnd).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onMarkerDragEnd,this).on("MSPointerUp",this._onMarkerDragEnd,this)):h.editing.enable()},_disableLayerEdit:function(n){var o=n.layer||n.target||n;o.edited=!1,o.editing&&o.editing.disable(),delete o.options.editing,delete o.options.original,this._selectedPathOptions&&(o instanceof L.Marker?this._toggleMarkerHighlight(o):(o.setStyle(o.options.previousOptions),delete o.options.previousOptions)),o instanceof L.Marker?(o.dragging.disable(),o.off("dragend",this._onMarkerDragEnd,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onMarkerDragEnd,this).off("MSPointerUp",this._onMarkerDragEnd,this)):o.editing.disable()},_onMouseMove:function(n){this._tooltip.updatePosition(n.latlng)},_onMarkerDragEnd:function(n){var o=n.target;o.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:o})},_onTouchMove:function(n){var o=n.originalEvent.changedTouches[0],a=this._map.mouseEventToLayerPoint(o),h=this._map.layerPointToLatLng(a);n.target.setLatLng(h)},_hasAvailableLayers:function(){return this._featureGroup.getLayers().length!==0}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:"remove"},initialize:function(n,o){if(L.Handler.prototype.initialize.call(this,n),L.Util.setOptions(this,o),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this.type=L.EditToolbar.Delete.TYPE;var a=L.version.split(".");parseInt(a[0],10)===1&&parseInt(a[1],10)>=2?L.EditToolbar.Delete.include(L.Evented.prototype):L.EditToolbar.Delete.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on("layeradd",this._enableLayerDelete,this).on("layerremove",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off("layeradd",this._enableLayerDelete,this).off("layerremove",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(n.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(n){this._deletableLayers.addLayer(n),n.fire("revert-deleted",{layer:n})},this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer(function(n){this._removeLayer({layer:n})},this),this.save()},_enableLayerDelete:function(n){(n.layer||n.target||n).on("click",this._removeLayer,this)},_disableLayerDelete:function(n){var o=n.layer||n.target||n;o.off("click",this._removeLayer,this),this._deletedLayers.removeLayer(o)},_removeLayer:function(n){var o=n.layer||n.target||n;this._deletableLayers.removeLayer(o),this._deletedLayers.addLayer(o),o.fire("deleted")},_onMouseMove:function(n){this._tooltip.updatePosition(n.latlng)},_hasAvailableLayers:function(){return this._deletableLayers.getLayers().length!==0}})})(window,document);const fL="";var Lg={draw:{toolbar:{actions:{title:"መሳል ተው",text:"ተው"},finish:{title:"መሳል ጨርስ",text:"ጨርስ"},undo:{title:"መጨረሻ የተሳለውን ነጥብ አጥፋ",text:"መጨረሻ የተሳለውን ነጥብ አጥፋ"},buttons:{polyline:"ፖሊላየን ሳል",polygon:"ፖሊጎን ሳል",rectangle:"አራት መአዘን ሳል",circle:"ክብ ሳል",marker:"ምልክት ሳል",circlemarker:"ክብ ምልክት ሳል"}},handlers:{circle:{tooltip:{start:"ክብ ለመሳል ተጭንው ይጎትቱ"},radius:"ራዲየስ"},circlemarker:{tooltip:{start:"ክብ ምልክት ለመሳል ካርታውን ይጫኑ ይጎትቱ"}},marker:{tooltip:{start:"ምልክት ለመሳል ካርታውን ይጫኑ ይጎትቱ"}},polygon:{tooltip:{start:"ቅርጽን ለመሳል ካርታውን ተጭነው ይጎትቱ",cont:"ቅርጽን መሳሎን ለመቀጠል ይጫኑ",end:"ቅርጽን ስሎ ለመጨረስ የመጀመሪያውን ነጥብ ይጫኑ"}},polyline:{error:"<strong>ስህተት:</strong> መስመሮች እርስ በእርስ መተላለፍ አይችሉም!",tooltip:{start:"መስመር ለመሳል ካርታውን ተጭነው ይጎትቱ",cont:"መስመር መሳሎን ለመቀጠል ይጫኑ",end:"መስመር ስሎ ለመጨረስ የመጨረሻውን ነጥብ ይጫኑ"}},rectangle:{tooltip:{start:"ዐራት መአዝን ለመሳል ካርታውን ይጫኑ ይጎትቱ"}},simpleshape:{tooltip:{end:"ስለው ለመጨረስ አይጤን ይልቀቁ"}}}},edit:{toolbar:{actions:{save:{title:"ለውጦቹን አኑር",text:"አኑር"},cancel:{title:"ማስተካከሉን ተው፣ ሁሉንም ለውጦች ሰርዝ",text:"ተው"},clearAll:{title:"ሁሉንም የካርታ ገጾች አጥፋ",text:"ሁሉንም አጥፋ"}},buttons:{edit:"የካርታ ገጽ አስተካክል",editDisabled:"የሚስተካከል የካርታ ገጽ የለም",remove:"የካርታ ገጽ ሰርዝ.",removeDisabled:"የሚሰረዝ የካርታ ገጽ የለም"}},handlers:{edit:{tooltip:{text:"ለማስተካከል ምልክቱን ወይም መያዣውን ይጎትቱ",subtext:"ለውጥጡን ለመተው ተው የሚለውን ይጫኑ"}},remove:{tooltip:{text:"ማጥፋት የፈለጉትን ይጫኑ"}}}}},bg={draw:{toolbar:{actions:{title:"Zrušit kreslení",text:"Zrušit"},finish:{title:"Dokončit kreslení",text:"Dokončit"},undo:{title:"Smazat poslední nakreslený bod",text:"Smazat poslední bod"},buttons:{polyline:"Nakreslit mnohoúhelník",polygon:"Nakreslit polygon",rectangle:"Nakreslit obdélník",circle:"Nakreslit kruh",marker:"Nakreslit značku",circlemarker:"Nakreslit kruhovou značku"}},handlers:{circle:{tooltip:{start:"Kliknout a táhnout pro nakreslení kruhu."},radius:"Poloměr"},circlemarker:{tooltip:{start:"Kliknout do mapy pro umístění kruhové značky."}},marker:{tooltip:{start:"Kliknout do mapy pro umístění značky."}},polygon:{tooltip:{start:"Kliknout pro začátek kreslení tvaru.",cont:"Kliknout pro pokračování v kreslení tvaru.",end:"Kliknout na pvní bod k uzavření tvaru."}},polyline:{error:"<strong>Chyba:</strong> hrany tvaru se nemohou protínat!",tooltip:{start:"Kliknout pro začátek kreslení úsečky.",cont:"Kliknout pro pokračování v kreslení úsečky.",end:"Kliknout na koncový bod k ukončení kreslení úsečky."}},rectangle:{tooltip:{start:"Kliknout a táhnout k nakreslení obdélníku."}},simpleshape:{tooltip:{end:"Pustit myš k dokončení kreslení."}}}},edit:{toolbar:{actions:{save:{title:"Uložit změny.",text:"Uložit"},cancel:{title:"Zrušit úpravu, zruší všechny změny.",text:"Zrušit"},clearAll:{title:"Vymazat všechny vrstvy.",text:"Vymazat vše"}},buttons:{edit:"Upravit vrstvy.",editDisabled:"Žádné vrstvy k úpravě.",remove:"Vymazat vrstvy.",removeDisabled:"Žádná vrstva k vymazání."}},handlers:{edit:{tooltip:{text:"Táhnout za úchopy pro editaci tvaru.",subtext:"Kliknutím na zrušit vrátite změny."}},remove:{tooltip:{text:"Kliknout na tvar pro smazání"}}}}},Tg={draw:{toolbar:{actions:{title:"Zeichnung abbrechen",text:"Abbrechen"},finish:{title:"Zeichnung fertigstellen",text:"Fertigstellen"},undo:{title:"Lösche den zuletzt gezeichneten Punkt",text:"Letzter Punkt löschen"},buttons:{polyline:"Zeichne eine Linie",polygon:"Zeichne ein Polygon",rectangle:"Zeichne ein Rechteck",circle:"Zeichne einen Kreis",marker:"Zeichne einen Marker",circlemarker:"Zeichne einen Kreis-Marker"}},handlers:{circle:{tooltip:{start:"Klicken und ziehen um einen Kreis zu zeichnen."},radius:"Radius"},circlemarker:{tooltip:{start:"Karte anklicken um einen Kreis-Marker zu platzieren."}},marker:{tooltip:{start:"Karte anklicken um einen Marker zu platzieren."}},polygon:{tooltip:{start:"Klicken um mit dem Zeichnen einer Form zu beginnen.",cont:"Klicken um mit dem Zeichnen dieser Form fortzufahren.",end:"Erster Punkt anklicken um diese Form abzuschliessen."}},polyline:{error:"<strong>Fehler:</strong> Form-Ecken dürfen sich nicht überschneiden!",tooltip:{start:"Klicken um mit dem Zeichnen einer Linie zu beginnen.",cont:"Klicken um mit dem Zeichnen dieser Linie fortzufahren.",end:"Erster Punkt anklicken um diese Linie abzuschliessen."}},rectangle:{tooltip:{start:"Klicken und ziehen um ein Rechteck zu zeichnen."}},simpleshape:{tooltip:{end:"Maustaste loslassen um die Zeichnung fertigzustellen."}}}},edit:{toolbar:{actions:{save:{title:"Speichere Änderungen.",text:"Speichern"},cancel:{title:"Bearbeitung abbrechen, alle Änderungen verwerfen.",text:"Abbrechen"},clearAll:{title:"Alle Layer bereinigen.",text:"Alles bereinigen"}},buttons:{edit:"Layer bearbeiten.",editDisabled:"Keine Layer zum bearbeiten.",remove:"Layer löschen.",removeDisabled:"Keine Layer zum löschen."}},handlers:{edit:{tooltip:{text:"Ziehe den Griff oder den Marker um die Eigenschaft zu bearbeiten.",subtext:"Klicke abbrechen um Änderungen rückgängig zu machen."}},remove:{tooltip:{text:"Klicke auf eine Eigenschaft um diese zu entfernen."}}}}},Sh={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes.",text:"Save"},cancel:{title:"Cancel editing, discards all changes.",text:"Cancel"},clearAll:{title:"Clear all layers.",text:"Clear All"}},buttons:{edit:"Edit layers.",editDisabled:"No layers to edit.",remove:"Delete layers.",removeDisabled:"No layers to delete."}},handlers:{edit:{tooltip:{text:"Drag handles, or marker to edit feature.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove"}}}}},Cg={draw:{toolbar:{actions:{title:"Cancelar dibujo",text:"Cancelar"},finish:{title:"Terminar dibujo",text:"Terminar"},undo:{title:"Eliminar último punto dibujado",text:"Eliminar último punto"},buttons:{polyline:"Dibujar una polilínea",polygon:"Dibujar un polígono",rectangle:"Dibujar un rectángulo",circle:"Dibujar un círculo",marker:"Dibujar un marcador",circlemarker:"Dibujar un marcador circular"}},handlers:{circle:{tooltip:{start:"Haz click y arrastra para dibujar un círculo"},radius:"Radio"},circlemarker:{tooltip:{start:"Haz click en el mapa para situar el marcador circular"}},marker:{tooltip:{start:"Haz click en el mapa para situar el marcador"}},polygon:{tooltip:{start:"Haz click para empezar a dibujar la forma",cont:"Haz click para continuar dibujando la forma",end:"Haz click en el primer punto para cerrar la forma"}},polyline:{error:"<strong>Error:</strong> las líneas no deben cruzarse",tooltip:{start:"Haz click para empezar a dibujar la línea",cont:"Haz click para continuar dibujando la línea",end:"Haz click en el último punto para terminar la línea"}},rectangle:{tooltip:{start:"Haz click y arrastra para dibujar un rectángulo"}},simpleshape:{tooltip:{end:"Suelta el ratón para terminar de dibujar"}}}},edit:{toolbar:{actions:{save:{title:"Guardar los cambios",text:"Guardar"},cancel:{title:"Cancelar la edición, descarta todos los cambios",text:"Cancelar"},clearAll:{title:"Limpiar todas las capas",text:"Limpiar todo"}},buttons:{edit:"Editar capas",editDisabled:"No hay capas que editar",remove:"Eliminar capas",removeDisabled:"No hay capas que eliminar"}},handlers:{edit:{tooltip:{text:"Arrastra el marcador para editar la forma",subtext:"Haz click en cancelar para deshacer los cambios"}},remove:{tooltip:{text:"Haz click en una forma para eliminarla"}}}}},Sg={draw:{toolbar:{actions:{title:"Peru piirustus",text:"Peru"},finish:{title:"Hyväksy piirustus",text:"Hyväksy"},undo:{title:"Poista viimeinen piirretty piste",text:"Poista viimeinen piste"},buttons:{polyline:"Piirrä murtoviiva",polygon:"Piirrä monikulmio",rectangle:"Piirrä suorakulmio",circle:"Piirrä ympyrä",marker:"Piirrä merkki",circlemarker:"Piirrä piirimerkki"}},handlers:{circle:{tooltip:{start:"Piirrä ympyrä pitämällä hiiri painettuna ja vetämällä."},radius:"Säde"},circlemarker:{tooltip:{start:"Aseta ympyrämerkki painamalla karttaa."}},marker:{tooltip:{start:"Aseta markkeri painamalla karttaa."}},polygon:{tooltip:{start:"Paina aloittaaksesi muodon piirtämisen.",cont:"Paina jatkaaksesi muodon piirtämistä.",end:"Sulje muoto painamalla ensimmäistä pistettä."}},polyline:{error:"<strong>Virhe:</strong> muodon reunaa ei voi ylittää!",tooltip:{start:"Paina aloittaaksesi viivan piirtämisen.",cont:"Paina jatkaaksesi viivan piirtämistä.",end:"Paina viimeistä pistettä päättäksesi viiva."}},rectangle:{tooltip:{start:"Piirrä suorakulmio pitämällä hiiri painettuna ja vetämällä."}},simpleshape:{tooltip:{end:"Vapauta hiiri päättääksesi piirtämisen."}}}},edit:{toolbar:{actions:{save:{title:"Hyväksy muutokset.",text:"Hyväksy"},cancel:{title:"Peru muokkaus, hylkää kaikki muutokset.",text:"Peru"},clearAll:{title:"Poista kaikki tasot.",text:"Poista kaikki"}},buttons:{edit:"Muokkaa tasoja.",editDisabled:"Ei muokattavia tasoja.",remove:"Poista tasot.",removeDisabled:"Ei poistettavia tasoja."}},handlers:{edit:{tooltip:{text:"Vedä pistettä tai markkeria muokataksesi piirrettyjä ominaisuuksia.",subtext:"Kumoa muutokset painamalla peruuta."}},remove:{tooltip:{text:"Paina piirrettyä ominaisuutta poistaaksesi"}}}}},Pg={draw:{toolbar:{actions:{title:"Annuler le dessin",text:"Annuler"},finish:{title:"Terminer le dessin",text:"Terminer"},undo:{title:"Supprimer le dernier point tiré",text:"Supprimer le dernier point"},buttons:{polyline:"Dessinez une polyligne",polygon:"Dessinez un polygone",rectangle:"Dessinez un rectangle",circle:"Dessiner un cercle",marker:"Dessinez un marqueur",circlemarker:"Dessinez un marqueur circulaire"}},handlers:{circle:{tooltip:{start:"Cliquez et faites glisser pour dessiner le cercle."},radius:"Rayon"},circlemarker:{tooltip:{start:"Cliquez sur la carte pour placer le marqueur circulaire."}},marker:{tooltip:{start:"Cliquez sur la carte pour placer le marqueur."}},polygon:{tooltip:{start:"Cliquez pour commencer à dessiner.",cont:"Cliquez pour continuer à dessiner.",end:"Cliquez sur le premier point pour fermer cette forme."}},polyline:{error:"<strong>Erreur:</strong> les polyligne ne peuvent pas traverser!",tooltip:{start:"Cliquez pour commencer à dessiner.",cont:"Cliquez pour continuer à dessiner.",end:"Cliquez sur le dernier point pour fermer cette forme."}},rectangle:{tooltip:{start:"Cliquez et faites glisser pour dessiner le rectangle."}},simpleshape:{tooltip:{end:"Relâchez la souris pour terminer le dessin."}}}},edit:{toolbar:{actions:{save:{title:"Sauvegarder les modifications.",text:"Sauvegarder"},cancel:{title:"Annuler l'édition, rejette toutes les modifications.",text:"Annuler"},clearAll:{title:"Effacez toutes les collections.",text:"Tout effacer"}},buttons:{edit:"Modifier les collections.",editDisabled:"Pas de collections à éditer.",remove:"Supprimez les collections.",removeDisabled:"Pas de collections à supprimer."}},handlers:{edit:{tooltip:{text:"Sélectionnez les poignées ou le marqueur pour modifier l'entité.",subtext:"Cliquez sur annuler pour rétablir les modifications."}},remove:{tooltip:{text:"Cliquez sur une entité pour supprimer"}}}}},kg={draw:{toolbar:{actions:{title:"Rajzolás elvetése",text:"Mégse"},finish:{title:"Rajzolás befejezése",text:"Befejezés"},undo:{title:"Legutóbbi pont törlése",text:"Legutóbbi pont törlése"},buttons:{polyline:"Útvonal rajzolása",polygon:"Sokszög rajzolása",rectangle:"Négyszög rajzolása",circle:"Kör rajzolása",marker:"Jelölő rajzolása",circlemarker:"Kör-jelölő rajzolása"}},handlers:{circle:{tooltip:{start:"Kattintson és tartsa nyomva a rajzoláshoz."},radius:"Sugár"},circlemarker:{tooltip:{start:"Kör-jelölő elhelyezéséhez kattintson a térképre."}},marker:{tooltip:{start:"Jelölő elhelyezéséhez kattintson a térképre."}},polygon:{tooltip:{start:"Alakzat rajzolásához kattintson a térképre.",cont:"Alakzat folytatásához kattintson a térképre.",end:"Alakzat befejezéséhez kattintson a kezdőpontra."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Útvonal rajzolásához kattintson a térképre.",cont:"Útvonal folytatásához kattintson a térképre.",end:"Útvonal befejezéséhez kattintson a végpontra."}},rectangle:{tooltip:{start:"Kattintson és tartsa nyomva négyszög rajzolásához."}},simpleshape:{tooltip:{end:"Ha elégedett az alakzattal, engedje fel az egér gombját."}}}},edit:{toolbar:{actions:{save:{title:"Változtatások elmentése.",text:"Mentés"},cancel:{title:"Változtatások elvetése.",text:"Mégse"},clearAll:{title:"Összes réteg törlése.",text:"Összes törlése"}},buttons:{edit:"Rétegek szerkesztése.",editDisabled:"Nem állnak rendelkezésre szerkeszthető rétegek.",remove:"Rétegek törlése.",removeDisabled:"Nem állnak rendelkezésre törölhető rétegek."}},handlers:{edit:{tooltip:{text:"Módosításhoz használja a jelölők, alakzatok kezelőit.",subtext:"Változások elvetéséhez kattintson a 'Mégse' gombra."}},remove:{tooltip:{text:"Kattintson a jelölőkre, alakzatokra az eltávolításukhoz."}}}}},Rg={draw:{toolbar:{actions:{title:"Annulla disegno",text:"Annulla"},finish:{title:"Completa disegno",text:"Completa"},undo:{title:"Elimina l'ultimo punto disegnato",text:"Elimina l'ultimo punto"},buttons:{polyline:"Disegna una polilinea",polygon:"Disegna un poligono",rectangle:"Disegna un rettangolo",circle:"Disegna un cerchio",marker:"Disegna un marcatore",circlemarker:"Disegna un marker circolare"}},handlers:{circle:{tooltip:{start:"Clicca e trascina per disegnare un cerchio."},radius:"Raggio"},circlemarker:{tooltip:{start:"Clicca la mappa per posizionare un marcatore circolare."}},marker:{tooltip:{start:"Clicca la mappa per posizionare un marcatore."}},polygon:{tooltip:{start:"Clicca per iniziare a disegnare una figura.",cont:"Clicca per continuare a disegnare una figura.",end:"Clicca il primo punto per chiudere questa figura."}},polyline:{error:"<strong>Errore:</strong> i margini della figura non si possono incrociare!",tooltip:{start:"Clicca per iniziare a disegnare una linea.",cont:"Clicca per continuare a disegnare una linea",end:"Clicca l'ultimo punto per finire questa linea"}},rectangle:{tooltip:{start:"Clicca e trascina per disegnare un rettangolo."}},simpleshape:{tooltip:{end:"Rilascia il mouse per finire il disegno."}}}},edit:{toolbar:{actions:{save:{title:"Salva modifiche.",text:"Salva"},cancel:{title:"Annulla tutte le modifiche.",text:"Annulla"},clearAll:{title:"Pulisci tutti i livelli.",text:"Pulisci tutto"}},buttons:{edit:"Modifica i livelli.",editDisabled:"Nessun livello disponibile per la modifica.",remove:"Elimina livelli.",removeDisabled:"Nessun livello disponibile per l'eliminazione."}},handlers:{edit:{tooltip:{text:"Trascina le maniglie, o i marcatori per modificare l'elemento.",subtext:"Clicca annulla per annullare le modifiche."}},remove:{tooltip:{text:"Clicca un elemento per rimuoverlo"}}}}},Mg={draw:{toolbar:{actions:{title:"ხატვის გაუქმება",text:"გაუქმება"},finish:{title:"ხატვის დასრულება",text:"დასრულება"},undo:{title:"ბოლო დახატული წერტილის წაშლა",text:"ბოლო წერტილის წაშლა"},buttons:{polyline:"პოლილაინის დახაზვა",polygon:"პოლიგონის დახაზვა",rectangle:"მართკუთხედის დახაზვა",circle:"წრის დახაზვა",marker:"ადგილმდებარეობის დატანა",circlemarker:"ადგილმდებარეობის დატანა(წრის სახით)"}},handlers:{circle:{tooltip:{start:"დააწკაპუნეთ და გადაიტანეთ იმისათვის, რომ წრე დახაზოთ."},radius:"რადიუსი"},circlemarker:{tooltip:{start:"დააწკაპუნეთ რუკაზე ადგილმდებარეობის შესაქმნელად."}},marker:{tooltip:{start:"დააწკაპუნეთ რუკაზე ადგილმდებარეობის შესაქმნელად."}},polygon:{tooltip:{start:"დააწკაპუნეთ, კონტურის ხაზვის დაწყებისთვის.",cont:"დააწკაპუნეთ, კონტრუსი ხაზვის დასრულებისთვის.",end:"დააწკაპუნეთ პირველ წერტილზე, რათა დაასრულოთ კონტურის ხაზვა."}},polyline:{error:"<strong>შეცდომა:</strong> ხაზი ვერ გადაკვეთავს თავის თავს",tooltip:{start:"დააწკაპუნეთ, ხაზის ხაზვის დაწყებისთვის.",cont:"დააწკაპუნეთ, ხაზის ხაზვის დასრულებისთვის.",end:"დააწკაპუნეთ ბოლო წერტილზე, რათა დაასრულოთ ხაზის ხაზვა."}},rectangle:{tooltip:{start:"დააწკაპუნეთ და გადაიტანეთ იმისათვის, რომ მართკუთხედი დახაზოთ."}},simpleshape:{tooltip:{end:"გაათავისუფლეთ თაგვის ღილაკი ხაზვის დასასრულებლად."}}}},edit:{toolbar:{actions:{save:{title:"ცვლილებების შენახვა.",text:"შენახვა"},cancel:{title:"რედაქტირების გაუქმება, დააბრუნე ყველა ცვლილება.",text:"გაუქმება"},clearAll:{title:"ყველა რედაქტირებული ფენის გასუფთავება.",text:"გასუფთავება"}},buttons:{edit:"რედაქტირება.",editDisabled:"ფენები არ არის რედაქტირებისთვის.",remove:"წაშლა.",removeDisabled:"ფენები არ არის წაშლისთვის."}},handlers:{edit:{tooltip:{text:"გადაიტანეთ წვერები ან წერტილები ობიექტის რედაქტირებისთვის.",subtext:'დააჭირეთ "გაუქმება", საწყის მდგომარეობაში დასაბრუნებლად.'}},remove:{tooltip:{text:"დააწკაპუნეთ ობიექტზე წაშლისთვის"}}}}},Ig={draw:{toolbar:{actions:{title:"Tekening annuleren",text:"Annuleren"},finish:{title:"Tekening voltooien",text:"Voltooien"},undo:{title:"Laatst getekende punt verwijderen",text:"Verwijder laatst getekende punt"},buttons:{polyline:"Teken een polygonale lijn",polygon:"Teken een polygoon",rectangle:"Teken een rechthoek",circle:"Teken een cirkel",marker:"Plaats een marker",circlemarker:"Teken een cirkelmarkering"}},handlers:{circle:{tooltip:{start:"Klik en sleep om de cirkel te tekenen."},radius:"Radius"},circlemarker:{tooltip:{start:"Klik op de kaart om de cirkelmarkering te plaatsen."}},marker:{tooltip:{start:"Klik op de kaart om de markering te plaatsen."}},polygon:{tooltip:{start:"Klik om te beginnen met het tekenen van de polygoon.",cont:"Klik om door te gaan met het tekenen van de vorm.",end:"Klik op het eerste punt om dit polygoon te sluiten."}},polyline:{error:"<strong>Fout:</strong> vormranden kunnen niet kruisen!",tooltip:{start:"Klik om te beginnen met het tekenen van een lijn.",cont:"Klik om door te gaan met het tekenen van de lijn.",end:"Klik laatst getekende punt om deze lijn te voltooien."}},rectangle:{tooltip:{start:"Klik en sleep om een rechthoek te tekenen."}},simpleshape:{tooltip:{end:"Laat de muis los om de tekening te voltooien."}}}},edit:{toolbar:{actions:{save:{title:"Wijzigingen opslaan.",text:"Opslaan"},cancel:{title:"Annuleer bewerken en verwijder alle wijzigingen.",text:"Annuleren"},clearAll:{title:"Verwijder alle lagen.",text:"Verwijderd alles"}},buttons:{edit:"Lagen bewerken.",editDisabled:"Geen lagen om te bewerken.",remove:"Verwijder lagen.",removeDisabled:"Geen lagen om te verwijderen."}},handlers:{edit:{tooltip:{text:"Sleep hoeken om te schalen of middenpunt om te verplaatsen.",subtext:"Klik op annuleren om wijzigingen ongedaan te maken."}},remove:{tooltip:{text:"Klik op een vorm om die te verwijderen"}}}}},Ag={draw:{toolbar:{actions:{title:"Avbryt markering",text:"Avbryt"},finish:{title:"Ferdiggjør markering",text:"Ferdiggjør"},undo:{title:"Ta bort siste punkt",text:"Slett siste punkt"},buttons:{polyline:"Tegn flere linjer",polygon:"Tegn en mangekant",rectangle:"Tegn et rektangel",circle:"Tegn en sirkel",marker:"Sett et markeringspunkt",circlemarker:"Tegn et sirkelpunkt"}},handlers:{circle:{tooltip:{start:"Klikk og dra for å tegne en sirkel."},radius:"Radius"},circlemarker:{tooltip:{start:"Klikk på kartet for å plassere et sirkelpunkt."}},marker:{tooltip:{start:"Klikk på kartet for å markere et punkt."}},polygon:{tooltip:{start:"Klikk for å tegne et område.",cont:"Klikk for å fortsette tegningen.",end:"Klikk på det første punktet for å lukke området."}},polyline:{error:"<strong>Error:</strong> kantene kan ikke krysses!",tooltip:{start:"Klikk for å tegne en linje.",cont:"Klikk for å fortsette å tegne linjen.",end:"Kikk siste punkt for å ferdiggjøre linjen."}},rectangle:{tooltip:{start:"Klikk og dra for å tegne et rektangel."}},simpleshape:{tooltip:{end:"Slipp museknappen for å gjøre tegningen ferdig."}}}},edit:{toolbar:{actions:{save:{title:"Lagre endringer.",text:"Lagre"},cancel:{title:"Avbryt redigering og forkast endringer.",text:"Avbryt"},clearAll:{title:"Nullstill alle figurer.",text:"Nullstill alt."}},buttons:{edit:"Rediger figur.",editDisabled:"Ingen figur å redigere.",remove:"Slett figur.",removeDisabled:"Ingen figur å slette."}},handlers:{edit:{tooltip:{text:"Dra markør for å redigere.",subtext:"Klikk avbryt for å angre endringer."}},remove:{tooltip:{text:"Klikk for å ta bort"}}}}},Dg={draw:{toolbar:{actions:{title:"Anuluj wyznaczanie",text:"Anuluj"},finish:{title:"Zakończ wyznaczanie",text:"Zakończ"},undo:{title:"Usuń ostatnio wyznaczony punkt",text:"Usuń ostatni punkt"},buttons:{polyline:"Wyznacz wzór",polygon:"Wyznacz wielokąt",rectangle:"Wyznacz prostokąt",circle:"Wyznacz koło",marker:"Umieść znacznik",circlemarker:"Umieść okrągły znacznik"}},handlers:{circle:{tooltip:{start:"Kliknij i przeciągnij, aby wyznaczyć koło."},radius:"Promień"},circlemarker:{tooltip:{start:"Kliknij na mapę, aby umieścić okrągły znacznik."}},marker:{tooltip:{start:"Kliknij na mapę, aby umieścić znacznik."}},polygon:{tooltip:{start:"Kliknij, aby rozpocząć wyznaczanie kształtu.",cont:"Kliknij, aby kontynuować wyznaczanie kształtu.",end:"Kliknij pierwszy punkt, aby zakończyć ten kształt."}},polyline:{error:"<strong>Błąd:</strong> odcinki nie mogą się przecinać!",tooltip:{start:"Kliknij, aby rozpocząć wyznaczanie lini.",cont:"Kliknij, aby kontynuować wyznaczanie lini.",end:"Kliknij ostatni punkt, aby ukończyć linię."}},rectangle:{tooltip:{start:"Kliknij i przeciągnij, aby wyznaczyć prostokąt."}},simpleshape:{tooltip:{end:"Zwolnij przycisk myszy, aby ukończyć wyznaczanie."}}}},edit:{toolbar:{actions:{save:{title:"Zapisz zmiany.",text:"Zapisz"},cancel:{title:"Anuluj edytowanie i odrzuć zmiany.",text:"Anuluj"},clearAll:{title:"Wyczyść wszystkie warstwy.",text:"Wyczyść wszystko"}},buttons:{edit:"Edytuj warstwy.",editDisabled:"Brak warstw do edycji.",remove:"Usuń warstwy.",removeDisabled:"Brak warstw do usunięcia."}},handlers:{edit:{tooltip:{text:"Przeciągnij uchwyt lub znacznik, aby edytować.",subtext:"Kliknij anuluj, aby odrzucić zmiany."}},remove:{tooltip:{text:"Kliknij obiekt, aby go usunąć."}}}}},Og={draw:{toolbar:{actions:{title:"Cancelar desenho",text:"Cancelar"},finish:{title:"Terminar desenho",text:"Terminar"},undo:{title:"Eliminar último ponto desenhado",text:"Eliminar último ponto"},buttons:{polyline:"Desenhar uma polilinha",polygon:"Desenhar um polígono",rectangle:"Desenhar um retângulo",circle:"Desenhar um círculo",marker:"Desenhar un marcador",circlemarker:"Desenhar um marcador circular"}},handlers:{circle:{tooltip:{start:"Clique e arrastrar para desenhar o círculo."},radius:"Raio"},circlemarker:{tooltip:{start:"Clique no mapa para colocar o marcador circular."}},marker:{tooltip:{start:"Clique no mapa para colocar o marcador."}},polygon:{tooltip:{start:"Clique para começar a desenhar a figura.",cont:"Clique para continuar desenhando a figura.",end:"Clique no primeiro ponto para fechar esta figura."}},polyline:{error:"<strong>Erro:</strong> as bordas de uma forma não podem atravessar!",tooltip:{start:"Clique para começar a desenhar a linha.",cont:"Clique para continuar desenhando a linha.",end:"Clique no último ponto para terminar a linha."}},rectangle:{tooltip:{start:"Clique e arrastrar para desenhar o retângulo."}},simpleshape:{tooltip:{end:"Solte o mouse para terminar o desenho."}}}},edit:{toolbar:{actions:{save:{title:"Guardar alterações.",text:"Guardar"},cancel:{title:"Cancelar edição, descarta todas as alterações.",text:"Cancelar"},clearAll:{title:"Limpar todas as camadas.",text:"Limpar tudo"}},buttons:{edit:"Editar camadas.",editDisabled:"Nenhuma camada que editar.",remove:"Eliminar camadas.",removeDisabled:"Nenhuma camada que eliminar."}},handlers:{edit:{tooltip:{text:"Arraste os manipuladores ou marcadores para editar a figura.",subtext:"Clique em cancelar para desfazer as alterações."}},remove:{tooltip:{text:"Clique em uma figura para removê-la"}}}}},Fg={draw:{toolbar:{actions:{title:"Отменить рисование",text:"Отмена"},finish:{title:"Завершить рисование",text:"Завершить"},undo:{title:"Удалить последнюю нарисованную точку",text:"Удалить последнюю точку"},buttons:{polyline:"Нарисовать полилинию",polygon:"Нарисовать полигон",rectangle:"Нарисовать прямоугольник",circle:"Нарисовать круг",marker:"Нарисовать точку",circlemarker:"Нарисовать точку(в виде круга)"}},handlers:{circle:{tooltip:{start:"Кликните и перетащите для того, чтобы нарисовать круг."},radius:"Радиус"},circlemarker:{tooltip:{start:"Кликните на карту для установки точки."}},marker:{tooltip:{start:"Кликните на карту для установки точки."}},polygon:{tooltip:{start:"Кликните, чтобы начать рисовать контур.",cont:"Кликните, чтобы завершить рисовать контур.",end:"Кликните на первую точку, чтобы завершить рисование контура."}},polyline:{error:"<strong>Ошибка:</strong> линия не может самопересекаться!",tooltip:{start:"Кликните, чтобы начать рисовать линию.",cont:"Кликните, чтобы завершить рисование линии.",end:"Кликните на последнюю точку, чтобы завершить рисование линии."}},rectangle:{tooltip:{start:"Кликните и перетащите, чтобы нарисовать прямоугольник."}},simpleshape:{tooltip:{end:"Отпустите кнопку мыши для завершения рисования."}}}},edit:{toolbar:{actions:{save:{title:"Сохранить изменения.",text:"Сохранить"},cancel:{title:"Отменить редактирование, откатить все изменения.",text:"Отмена"},clearAll:{title:"Очистить все редактируемые слои.",text:"Очистить всё"}},buttons:{edit:"Редактировать.",editDisabled:"Нет слоёв для редактирования.",remove:"Удалить.",removeDisabled:"Нет слоёв для удаления."}},handlers:{edit:{tooltip:{text:"Перетащите вершины или точки для редактирования фигуры.",subtext:'Нажмите "Отмена", чтобы откатить изменения.'}},remove:{tooltip:{text:"Кликните на фигуру для удаления"}}}}},zg={draw:{toolbar:{actions:{title:"Zrušiť kreslenie",text:"Zrušiť"},finish:{title:"Dokončiť kreslenie",text:"Dokončiť"},undo:{title:"Zmazať posledný nakreslený bod",text:"Zmazať posledný bod"},buttons:{polyline:"Nakresliť čiaru",polygon:"Nakresliť polygón",rectangle:"Nakresliť obdĺžnik",circle:"Nakresliť kruh",marker:"Nakresliť bod",circlemarker:"Nakresliť kruhový bod"}},handlers:{circle:{tooltip:{start:"Kliknite a potiahnite, aby ste nakreslili kruh."},radius:"Polomer"},circlemarker:{tooltip:{start:"Kliknite na mapu aby ste umiestnili kruhový bod."}},marker:{tooltip:{start:"Kliknite na mapu aby ste umiestnili bod."}},polygon:{tooltip:{start:"Kliknite, aby ste začali kresliť útvar.",cont:"Kliknite, aby ste nakreslili ďalší bod útvaru.",end:"Kliknite na prvý bod, aby ste uzavreli útvar."}},polyline:{error:"<strong>Chyba:</strong> čiary sa nesmú pretínať!",tooltip:{start:"Kliknite, aby ste začali kresliť čiaru.",cont:"Kliknite, aby ste nakreslili ďalší bod čiary.",end:"Kliknite posledný bod, aby ste dokončili čiaru."}},rectangle:{tooltip:{start:"Kliknite a potiahnite, aby ste nakreslili štvorec."}},simpleshape:{tooltip:{end:"Uvoľnením tlačidla myši ukončíte kreslenie."}}}},edit:{toolbar:{actions:{save:{title:"Uložiť zmeny.",text:"Uložiť"},cancel:{title:"Ukončiť úpravu, zrušiť všetky zmeny.",text:"Zrušiť"},clearAll:{title:"Zmazať všetky vrstvy.",text:"Zmazať všetko"}},buttons:{edit:"Upraviť vrstvy.",editDisabled:"Žiadne vrstvy pre úpravu",remove:"Zmazať vrstvy.",removeDisabled:"Žiadne vrstvy pre zmazanie."}},handlers:{edit:{tooltip:{text:"Potiahnutím vyznačených štvorčekov, alebo bodov upravíte útvar.",subtext:"Kliknite zrušiť, pre zrušenie zmien."}},remove:{tooltip:{text:"Kliknite na útvar pre jeho zmazanie."}}}}},Ng={draw:{toolbar:{actions:{title:"Скасувати креслення",text:"Скасувати"},finish:{title:"Завершити креслення",text:"Завершити"},undo:{title:"Видалити останню нанесену точку",text:"Видалити останню точку"},buttons:{polyline:"Накреслити криву",polygon:"Накреслити многокутник",rectangle:"Накреслити прямокутник",circle:"Накреслити коло",marker:"Розмістити маркер",circlemarker:"Розмістити маркер-коло"}},handlers:{circle:{tooltip:{start:"Натисніть і перетягуйте вказівник, щоб накреслити коло."},radius:"Радіус"},circlemarker:{tooltip:{start:"Натисніть на мапу, щоб розмістити маркер-коло."}},marker:{tooltip:{start:"Натисніть на мапу, щоб розмістити маркер."}},polygon:{tooltip:{start:"Натисніть, щоб накреслити фігуру.",cont:"Натисніть, щоб продовжити креслення фігури.",end:"Натисніть на першу точку, щоб замкнути цю фігуру."}},polyline:{error:"<strong>Помилка:</strong> сторони фігури не мають перетинатись!",tooltip:{start:"Натисніть, щоб накреслити лінію.",cont:"Натисніть, щоб продовжити креслення лінії.",end:"Натисніть на останню точку, щоб завершити лінію."}},rectangle:{tooltip:{start:"Натисніть і перетягуйте вказівник, щоб накреслити прямокутник."}},simpleshape:{tooltip:{end:"Відпустіть мишку, щоб завершити рисування."}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни.",text:"Зберегти"},cancel:{title:"Припинити редагування, скасувати всі зміни.",text:"Скасувати"},clearAll:{title:"Очистити всі шари.",text:"Очистити все"}},buttons:{edit:"Редагувати шари.",editDisabled:"Немає шарів для редагування.",remove:"Видалити шари.",removeDisabled:"Немає шарів для видалення."}},handlers:{edit:{tooltip:{text:"Перетягуйте важелі або маркер для редагування фігури.",subtext:"Натисніть «Скасувати» для скасування змін."}},remove:{tooltip:{text:"Натисніть на фігуру для видалення"}}}}},Bg={draw:{toolbar:{actions:{title:"الغاء الرسم",text:"الغاء"},finish:{title:"انهاء الرسم",text:"انهاء"},undo:{title:"مسح اخر رسمة",text:"مسح اخر نقطة"},buttons:{polyline:"رسم خط",polygon:"رسم منطقة",rectangle:"رسم مستطيل",circle:"رسم دائرة",marker:"رسم علامة",circlemarker:"رسم علامة دائرة"}},handlers:{circle:{tooltip:{start:"اضغط واسحب لرسم دائرة"},radius:"القطر"},circlemarker:{tooltip:{start:"اضغط على الخريطة لرسم دائرة"}},marker:{tooltip:{start:"اضغط على الخريطة لرسم نقطة"}},polygon:{tooltip:{start:"اضغط لبدء رسم منطقة",cont:"اضغط لاستمرار رسم منطقة",end:"اضغط على اول نقطة لاكمال المنطقة"}},polyline:{error:"<strong>خطأ:</strong> لا يمكن تقاطع الخطوط",tooltip:{start:"اضغط لبدئ رسم الخط",cont:"اضغط لاستكمال رسم الخط",end:"اضغط على اخر نقطة للانهاء"}},rectangle:{tooltip:{start:"اضغط واسحب لرسم مستطيل"}},simpleshape:{tooltip:{end:"اترك الماوس للانهاء"}}}},edit:{toolbar:{actions:{save:{title:"حفظ التغييرات",text:"حفظ"},cancel:{title:"الغاء كل التعديلات",text:"الغاء"},clearAll:{title:"مسح كل الطبقات",text:"مسح الكل"}},buttons:{edit:"تعديل الطبقات",editDisabled:"لاتوجد طبقات للتعديل",remove:"مسح الطبقات",removeDisabled:"لا يوجد طبقات للمسح"}},handlers:{edit:{tooltip:{text:"اسحب للتعديل",subtext:"اضغط الغاء لمسح التعديلات"}},remove:{tooltip:{text:"اضغط على رسمة للمسح"}}}}},Gg={draw:{toolbar:{actions:{title:"取消绘制",text:"取消"},finish:{title:"结束绘制",text:"结束"},undo:{title:"删除最后一个绘制点",text:"删除最后一个点"},buttons:{polyline:"绘制折线",polygon:"绘制多边形",rectangle:"绘制矩形",circle:"绘制圆形",marker:"绘制标志物",circlemarker:"绘制圆形标志物"}},handlers:{circle:{tooltip:{start:"单击并拖拽绘制圆形"},radius:"半径"},circlemarker:{tooltip:{start:"单击地图放置圆形标志物"}},marker:{tooltip:{start:"单击地图放置标志物"}},polygon:{tooltip:{start:"单击地图绘制图形",cont:"继续单击绘制图形",end:"单击起始点结束绘制"}},polyline:{error:"<strong>错误:</strong> 图形边缘不能交叉!",tooltip:{start:"单击地图绘制折线",cont:"继续单击绘制下一段折线",end:"单击最后一个点结束绘制"}},rectangle:{tooltip:{start:"单击并拖拽绘制矩形"}},simpleshape:{tooltip:{end:"松开鼠标结束绘制"}}}},edit:{toolbar:{actions:{save:{title:"保存变更",text:"保存"},cancel:{title:"取消编辑,放弃所有变更",text:"取消"},clearAll:{title:"清除所有图形",text:"清除所有"}},buttons:{edit:"编辑图形",editDisabled:"无图形可编辑",remove:"删除图形",removeDisabled:"无图形可删除"}},handlers:{edit:{tooltip:{text:"拖拽线段或标志点以编辑图形",subtext:"点击<strong>取消</strong>按钮撤销变更"}},remove:{tooltip:{text:"单击图形以移除"}}}}},Ug={draw:{toolbar:{actions:{title:"Çizimi iptal et",text:"İptal"},finish:{title:"Çizimi Bitir",text:"Bitir"},undo:{title:"Çizilen son noktayı sil",text:"Son noktayı sil"},buttons:{polyline:"Çoklu çizgi çiz",polygon:"Çokgen çiz",rectangle:"Dikdörtgen çiz",circle:"Yuvarlak çiz",marker:"İşaretçi çiz",circlemarker:"Yuvarlak işaretçi çiz"}},handlers:{circle:{tooltip:{start:"Yuvarlak çizmek için tıklayın ve sürükleyin."},radius:"Çap"},circlemarker:{tooltip:{start:"Yuvarlak işaretçi yerleştirmek için haritaya tıklayın."}},marker:{tooltip:{start:"İşaretçi yerleştirmek için haritaya tıklayın."}},polygon:{tooltip:{start:"Şekil çizmeye başlamak için tıklayın.",cont:"Şekil çizmeye devam etmek için tıklayın.",end:"Bu şekli tamamlamak için ilk noktayı tıklayın."}},polyline:{error:"<strong>Hata:</strong> şekil kenarları kesişemez!",tooltip:{start:"Hat çizmeye başlamak için tıklayın.",cont:"Hat çizmeye devam etmek için tıklayın.",end:"Bu hattı tamamlamak için ilk noktayı tıklayın."}},rectangle:{tooltip:{start:"Dikdörtgen çizmek için tıklayın ve sürükleyin."}},simpleshape:{tooltip:{end:"Çizimi bitirmek için fareyi bırakın."}}}},edit:{toolbar:{actions:{save:{title:"Değişiklikleri kaydet.",text:"Kaydet"},cancel:{title:"Düzenlemeyi iptal et, tüm değişiklikleri çıkar.",text:"İptal"},clearAll:{title:"Tüm katmanları temizle.",text:"Hepsini temizle"}},buttons:{edit:"Katmanları düzenle.",editDisabled:"Düzenlenecek katman bulunamadı.",remove:"Katmanları sil.",removeDisabled:"Silinecek katman bulunamadı."}},handlers:{edit:{tooltip:{text:"Çizimi düzenlemek için köşeleri veya işaretçiyi sürükleyin.",subtext:"Değişiklikleri geri almak için iptale tıklayın."}},remove:{tooltip:{text:"Çizimi silmek için tıklayın"}}}}},Zg={draw:{toolbar:{actions:{title:"Anulați desenul",text:"Anulare"},finish:{title:"Terminați desenul",text:"Termina"},undo:{title:"Șterge ultimul punct desenat",text:"Șterge ultimul punct"},buttons:{polyline:"Desenați o polilinie",polygon:"Desenați un poligon",rectangle:"Desenați un dreptunghi",circle:"Desenează un cerc",marker:"Desenați un marker",circlemarker:"Desenați un marcator de cerc"}},handlers:{circle:{tooltip:{start:"Dați clic și trageți pentru a desena cerc."},radius:"Rază"},circlemarker:{tooltip:{start:"Dați clic pe hartă pentru a plasa marcatorul cercului."}},marker:{tooltip:{start:"Dați clic pe hartă pentru a plasa marcatorul."}},polygon:{tooltip:{start:"Dați clic pentru a începe desenarea parcelei",cont:"Dați clic pentru a continua desenarea parcelei",end:"Dați clic pe primul punct pentru a închide această parcelei."}},polyline:{error:"<strong>Eroare:</strong> marginile formei nu se pot traversa!",tooltip:{start:"Daţi clic pentru a începe să desenezi o linie.",cont:"Daţi clic pentru a continua să desenezi linia.",end:"Dați clic pe ultimul punct pentru a ajunge la linia de sosire."}},rectangle:{tooltip:{start:"Dați clic și trageți pentru a desena dreptunghi."}},simpleshape:{tooltip:{end:"Eliberați mouse-ul pentru a termina desenul."}}}},edit:{toolbar:{actions:{save:{title:"Salvează modificările.",text:"Salvați"},cancel:{title:"Anulează editarea, anulează toate modificările.",text:"Anulare"},clearAll:{title:"Ștergeți toate straturile.",text:"Curata tot"}},buttons:{edit:"Editați straturi.",editDisabled:"Fără straturi de editat.",remove:"Ștergeți straturile.",removeDisabled:"Nu există straturi de șters."}},handlers:{edit:{tooltip:{text:"Trageți mânerele sau marcatorul pentru a edita caracteristica.",subtext:"Dați clic pe Anulare pentru a anula modificările."}},remove:{tooltip:{text:"Dați clic pe o caracteristică pentru a o elimina"}}}}},jg=function(r){var t=Sh;switch(r.toLocaleLowerCase()){case"de":case"de-at":case"de-be":case"de-ch":case"de-de":case"de-li":case"de-lu":case"de-de.utf-8":case"german":t=Tg;break;case"en":case"en-us":case"en-ca":case"en-gb":case"en-us.utf-8":case"english":t=Sh;break;case"ar":case"ar-ae":case"ar-eg":case"arabic":t=Bg;break;case"fi":case"fi-fi":case"fi-fi.utf-8":case"finnish":t=Sg;break;case"fr":case"fr-us":case"fr-ca":case"fr-us.utf-8":case"french":t=Pg;break;case"es":case"es-us":case"es-ca":case"es-us.utf-8":case"spanish":t=Cg;break;case"sk":case"sk-sk":case"sk-sk.utf-8":case"slovak":t=zg;break;case"pl":case"pl-pl":case"pl-pl.utf-8":case"polish":t=Dg;break;case"pt":case"pt-pt":case"pt-pt.utf-8":case"portuguese":t=Og;break;case"uk":case"uk-ua":case"uk-ua.utf-8":case"ukrainian":t=Ng;break;case"cs":case"cs-cz":case"cs-cz.utf-8":case"czech":t=bg;break;case"ru":case"ru-ru":case"ru-ru.utf-8":case"russian":t=Fg;break;case"ka":case"ka-ka":case"ka-ka.utf-8":case"georgian":t=Mg;break;case"no":case"no-no":case"no-no.utf-8":case"norwegian":t=Ag;break;case"am":case"am-et":case"am-et.utf-8":case"amharic":t=Lg;break;case"nl":case"nl-nl":case"nl-nl.utf-8":case"nl-be":case"nl-be.utf-8":case"dutch":case"belgian":case"flemish":t=Ig;break;case"it":case"it-it":case"it-ch":case"it-it.utf-8":case"it-ch.utf-8":case"italiano":case"italian":t=Rg;break;case"hu":case"hu-HU":case"hu-hu":case"hu-HU.utf-8":case"hu-hu.utf-8":case"magyar":case"hungarian":t=kg;break;case"zh":case"zh-cn":case"zh-cn.utf-8":case"chinese":t=Gg;break;case"tr":case"tr-tr":case"tr-tr.utf-8":case"turkish":t=Ug;break;case"ro":case"ro-ro":case"ro-RO":case"ro-ro.utf-8":case"romanian":t=Zg;break;default:throw new Error("[language] not found")}try{L&&L.drawLocal&&(L.drawLocal=t)}catch{}return t};function Ph(r,t){return function(){return r.apply(t,arguments)}}const{toString:Wg}=Object.prototype,{getPrototypeOf:$o}=Object,ss=(r=>t=>{const e=Wg.call(t);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Oe=r=>(r=r.toLowerCase(),t=>ss(t)===r),os=r=>t=>typeof t===r,{isArray:mn}=Array,or=os("undefined");function Hg(r){return r!==null&&!or(r)&&r.constructor!==null&&!or(r.constructor)&&ye(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const kh=Oe("ArrayBuffer");function Vg(r){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(r):t=r&&r.buffer&&kh(r.buffer),t}const Xg=os("string"),ye=os("function"),Rh=os("number"),as=r=>r!==null&&typeof r=="object",Yg=r=>r===!0||r===!1,ls=r=>{if(ss(r)!=="object")return!1;const t=$o(r);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},Kg=Oe("Date"),qg=Oe("File"),$g=Oe("Blob"),Jg=Oe("FileList"),Qg=r=>as(r)&&ye(r.pipe),t_=r=>{let t;return r&&(typeof FormData=="function"&&r instanceof FormData||ye(r.append)&&((t=ss(r))==="formdata"||t==="object"&&ye(r.toString)&&r.toString()==="[object FormData]"))},e_=Oe("URLSearchParams"),i_=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ar(r,t,{allOwnKeys:e=!1}={}){if(r===null||typeof r>"u")return;let i,n;if(typeof r!="object"&&(r=[r]),mn(r))for(i=0,n=r.length;i<n;i++)t.call(null,r[i],i,r);else{const o=e?Object.getOwnPropertyNames(r):Object.keys(r),a=o.length;let h;for(i=0;i<a;i++)h=o[i],t.call(null,r[h],h,r)}}function Mh(r,t){t=t.toLowerCase();const e=Object.keys(r);let i=e.length,n;for(;i-- >0;)if(n=e[i],t===n.toLowerCase())return n;return null}const Ih=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Ah=r=>!or(r)&&r!==Ih;function Jo(){const{caseless:r}=Ah(this)&&this||{},t={},e=(i,n)=>{const o=r&&Mh(t,n)||n;ls(t[o])&&ls(i)?t[o]=Jo(t[o],i):ls(i)?t[o]=Jo({},i):mn(i)?t[o]=i.slice():t[o]=i};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&ar(arguments[i],e);return t}const n_=(r,t,e,{allOwnKeys:i}={})=>(ar(t,(n,o)=>{e&&ye(n)?r[o]=Ph(n,e):r[o]=n},{allOwnKeys:i}),r),r_=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),s_=(r,t,e,i)=>{r.prototype=Object.create(t.prototype,i),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:t.prototype}),e&&Object.assign(r.prototype,e)},o_=(r,t,e,i)=>{let n,o,a;const h={};if(t=t||{},r==null)return t;do{for(n=Object.getOwnPropertyNames(r),o=n.length;o-- >0;)a=n[o],(!i||i(a,r,t))&&!h[a]&&(t[a]=r[a],h[a]=!0);r=e!==!1&&$o(r)}while(r&&(!e||e(r,t))&&r!==Object.prototype);return t},a_=(r,t,e)=>{r=String(r),(e===void 0||e>r.length)&&(e=r.length),e-=t.length;const i=r.indexOf(t,e);return i!==-1&&i===e},l_=r=>{if(!r)return null;if(mn(r))return r;let t=r.length;if(!Rh(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=r[t];return e},h_=(r=>t=>r&&t instanceof r)(typeof Uint8Array<"u"&&$o(Uint8Array)),c_=(r,t)=>{const i=(r&&r[Symbol.iterator]).call(r);let n;for(;(n=i.next())&&!n.done;){const o=n.value;t.call(r,o[0],o[1])}},u_=(r,t)=>{let e;const i=[];for(;(e=r.exec(t))!==null;)i.push(e);return i},d_=Oe("HTMLFormElement"),f_=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,i,n){return i.toUpperCase()+n}),Dh=(({hasOwnProperty:r})=>(t,e)=>r.call(t,e))(Object.prototype),g_=Oe("RegExp"),Oh=(r,t)=>{const e=Object.getOwnPropertyDescriptors(r),i={};ar(e,(n,o)=>{let a;(a=t(n,o,r))!==!1&&(i[o]=a||n)}),Object.defineProperties(r,i)},__=r=>{Oh(r,(t,e)=>{if(ye(r)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const i=r[e];if(ye(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},p_=(r,t)=>{const e={},i=n=>{n.forEach(o=>{e[o]=!0})};return mn(r)?i(r):i(String(r).split(t)),e},m_=()=>{},y_=(r,t)=>(r=+r,Number.isFinite(r)?r:t),Qo="abcdefghijklmnopqrstuvwxyz",Fh="0123456789",zh={DIGIT:Fh,ALPHA:Qo,ALPHA_DIGIT:Qo+Qo.toUpperCase()+Fh},v_=(r=16,t=zh.ALPHA_DIGIT)=>{let e="";const{length:i}=t;for(;r--;)e+=t[Math.random()*i|0];return e};function x_(r){return!!(r&&ye(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}const E_=r=>{const t=new Array(10),e=(i,n)=>{if(as(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[n]=i;const o=mn(i)?[]:{};return ar(i,(a,h)=>{const c=e(a,n+1);!or(c)&&(o[h]=c)}),t[n]=void 0,o}}return i};return e(r,0)},w_=Oe("AsyncFunction"),O={isArray:mn,isArrayBuffer:kh,isBuffer:Hg,isFormData:t_,isArrayBufferView:Vg,isString:Xg,isNumber:Rh,isBoolean:Yg,isObject:as,isPlainObject:ls,isUndefined:or,isDate:Kg,isFile:qg,isBlob:$g,isRegExp:g_,isFunction:ye,isStream:Qg,isURLSearchParams:e_,isTypedArray:h_,isFileList:Jg,forEach:ar,merge:Jo,extend:n_,trim:i_,stripBOM:r_,inherits:s_,toFlatObject:o_,kindOf:ss,kindOfTest:Oe,endsWith:a_,toArray:l_,forEachEntry:c_,matchAll:u_,isHTMLForm:d_,hasOwnProperty:Dh,hasOwnProp:Dh,reduceDescriptors:Oh,freezeMethods:__,toObjectSet:p_,toCamelCase:f_,noop:m_,toFiniteNumber:y_,findKey:Mh,global:Ih,isContextDefined:Ah,ALPHABET:zh,generateString:v_,isSpecCompliantForm:x_,toJSONObject:E_,isAsyncFn:w_,isThenable:r=>r&&(as(r)||ye(r))&&ye(r.then)&&ye(r.catch)};function pt(r,t,e,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),i&&(this.request=i),n&&(this.response=n)}O.inherits(pt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:O.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Nh=pt.prototype,Bh={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{Bh[r]={value:r}}),Object.defineProperties(pt,Bh),Object.defineProperty(Nh,"isAxiosError",{value:!0}),pt.from=(r,t,e,i,n,o)=>{const a=Object.create(Nh);return O.toFlatObject(r,a,function(c){return c!==Error.prototype},h=>h!=="isAxiosError"),pt.call(a,r.message,t,e,i,n),a.cause=r,a.name=r.name,o&&Object.assign(a,o),a};const L_=null;function ta(r){return O.isPlainObject(r)||O.isArray(r)}function Gh(r){return O.endsWith(r,"[]")?r.slice(0,-2):r}function Uh(r,t,e){return r?r.concat(t).map(function(n,o){return n=Gh(n),!e&&o?"["+n+"]":n}).join(e?".":""):t}function b_(r){return O.isArray(r)&&!r.some(ta)}const T_=O.toFlatObject(O,{},null,function(t){return/^is[A-Z]/.test(t)});function hs(r,t,e){if(!O.isObject(r))throw new TypeError("target must be an object");t=t||new FormData,e=O.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,C){return!O.isUndefined(C[b])});const i=e.metaTokens,n=e.visitor||f,o=e.dots,a=e.indexes,c=(e.Blob||typeof Blob<"u"&&Blob)&&O.isSpecCompliantForm(t);if(!O.isFunction(n))throw new TypeError("visitor must be a function");function d(v){if(v===null)return"";if(O.isDate(v))return v.toISOString();if(!c&&O.isBlob(v))throw new pt("Blob is not supported. Use a Buffer instead.");return O.isArrayBuffer(v)||O.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function f(v,b,C){let S=v;if(v&&!C&&typeof v=="object"){if(O.endsWith(b,"{}"))b=i?b:b.slice(0,-2),v=JSON.stringify(v);else if(O.isArray(v)&&b_(v)||(O.isFileList(v)||O.endsWith(b,"[]"))&&(S=O.toArray(v)))return b=Gh(b),S.forEach(function(x,T){!(O.isUndefined(x)||x===null)&&t.append(a===!0?Uh([b],T,o):a===null?b:b+"[]",d(x))}),!1}return ta(v)?!0:(t.append(Uh(C,b,o),d(v)),!1)}const _=[],m=Object.assign(T_,{defaultVisitor:f,convertValue:d,isVisitable:ta});function E(v,b){if(!O.isUndefined(v)){if(_.indexOf(v)!==-1)throw Error("Circular reference detected in "+b.join("."));_.push(v),O.forEach(v,function(S,y){(!(O.isUndefined(S)||S===null)&&n.call(t,S,O.isString(y)?y.trim():y,b,m))===!0&&E(S,b?b.concat(y):[y])}),_.pop()}}if(!O.isObject(r))throw new TypeError("data must be an object");return E(r),t}function Zh(r){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function ea(r,t){this._pairs=[],r&&hs(r,this,t)}const jh=ea.prototype;jh.append=function(t,e){this._pairs.push([t,e])},jh.toString=function(t){const e=t?function(i){return t.call(this,i,Zh)}:Zh;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function C_(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Wh(r,t,e){if(!t)return r;const i=e&&e.encode||C_,n=e&&e.serialize;let o;if(n?o=n(t,e):o=O.isURLSearchParams(t)?t.toString():new ea(t,e).toString(i),o){const a=r.indexOf("#");a!==-1&&(r=r.slice(0,a)),r+=(r.indexOf("?")===-1?"?":"&")+o}return r}class S_{constructor(){this.handlers=[]}use(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){O.forEach(this.handlers,function(i){i!==null&&t(i)})}}const Hh=S_,Vh={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},P_=typeof URLSearchParams<"u"?URLSearchParams:ea,k_=typeof FormData<"u"?FormData:null,R_=typeof Blob<"u"?Blob:null,M_=(()=>{let r;return typeof navigator<"u"&&((r=navigator.product)==="ReactNative"||r==="NativeScript"||r==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),I_=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Fe={isBrowser:!0,classes:{URLSearchParams:P_,FormData:k_,Blob:R_},isStandardBrowserEnv:M_,isStandardBrowserWebWorkerEnv:I_,protocols:["http","https","file","blob","url","data"]};function A_(r,t){return hs(r,new Fe.classes.URLSearchParams,Object.assign({visitor:function(e,i,n,o){return Fe.isNode&&O.isBuffer(e)?(this.append(i,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function D_(r){return O.matchAll(/\w+|\[(\w*)]/g,r).map(t=>t[0]==="[]"?"":t[1]||t[0])}function O_(r){const t={},e=Object.keys(r);let i;const n=e.length;let o;for(i=0;i<n;i++)o=e[i],t[o]=r[o];return t}function Xh(r){function t(e,i,n,o){let a=e[o++];const h=Number.isFinite(+a),c=o>=e.length;return a=!a&&O.isArray(n)?n.length:a,c?(O.hasOwnProp(n,a)?n[a]=[n[a],i]:n[a]=i,!h):((!n[a]||!O.isObject(n[a]))&&(n[a]=[]),t(e,i,n[a],o)&&O.isArray(n[a])&&(n[a]=O_(n[a])),!h)}if(O.isFormData(r)&&O.isFunction(r.entries)){const e={};return O.forEachEntry(r,(i,n)=>{t(D_(i),n,e,0)}),e}return null}function F_(r,t,e){if(O.isString(r))try{return(t||JSON.parse)(r),O.trim(r)}catch(i){if(i.name!=="SyntaxError")throw i}return(e||JSON.stringify)(r)}const ia={transitional:Vh,adapter:["xhr","http"],transformRequest:[function(t,e){const i=e.getContentType()||"",n=i.indexOf("application/json")>-1,o=O.isObject(t);if(o&&O.isHTMLForm(t)&&(t=new FormData(t)),O.isFormData(t))return n&&n?JSON.stringify(Xh(t)):t;if(O.isArrayBuffer(t)||O.isBuffer(t)||O.isStream(t)||O.isFile(t)||O.isBlob(t))return t;if(O.isArrayBufferView(t))return t.buffer;if(O.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let h;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return A_(t,this.formSerializer).toString();if((h=O.isFileList(t))||i.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return hs(h?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),F_(t)):t}],transformResponse:[function(t){const e=this.transitional||ia.transitional,i=e&&e.forcedJSONParsing,n=this.responseType==="json";if(t&&O.isString(t)&&(i&&!this.responseType||n)){const a=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(h){if(a)throw h.name==="SyntaxError"?pt.from(h,pt.ERR_BAD_RESPONSE,this,null,this.response):h}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Fe.classes.FormData,Blob:Fe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};O.forEach(["delete","get","head","post","put","patch"],r=>{ia.headers[r]={}});const na=ia,z_=O.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),N_=r=>{const t={};let e,i,n;return r&&r.split(`
14
+ `).forEach(function(a){n=a.indexOf(":"),e=a.substring(0,n).trim().toLowerCase(),i=a.substring(n+1).trim(),!(!e||t[e]&&z_[e])&&(e==="set-cookie"?t[e]?t[e].push(i):t[e]=[i]:t[e]=t[e]?t[e]+", "+i:i)}),t},Yh=Symbol("internals");function lr(r){return r&&String(r).trim().toLowerCase()}function cs(r){return r===!1||r==null?r:O.isArray(r)?r.map(cs):String(r)}function B_(r){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=e.exec(r);)t[i[1]]=i[2];return t}const G_=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function ra(r,t,e,i,n){if(O.isFunction(i))return i.call(this,t,e);if(n&&(t=e),!!O.isString(t)){if(O.isString(i))return t.indexOf(i)!==-1;if(O.isRegExp(i))return i.test(t)}}function U_(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,i)=>e.toUpperCase()+i)}function Z_(r,t){const e=O.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(r,i+e,{value:function(n,o,a){return this[i].call(this,t,n,o,a)},configurable:!0})})}class us{constructor(t){t&&this.set(t)}set(t,e,i){const n=this;function o(h,c,d){const f=lr(c);if(!f)throw new Error("header name must be a non-empty string");const _=O.findKey(n,f);(!_||n[_]===void 0||d===!0||d===void 0&&n[_]!==!1)&&(n[_||c]=cs(h))}const a=(h,c)=>O.forEach(h,(d,f)=>o(d,f,c));return O.isPlainObject(t)||t instanceof this.constructor?a(t,e):O.isString(t)&&(t=t.trim())&&!G_(t)?a(N_(t),e):t!=null&&o(e,t,i),this}get(t,e){if(t=lr(t),t){const i=O.findKey(this,t);if(i){const n=this[i];if(!e)return n;if(e===!0)return B_(n);if(O.isFunction(e))return e.call(this,n,i);if(O.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=lr(t),t){const i=O.findKey(this,t);return!!(i&&this[i]!==void 0&&(!e||ra(this,this[i],i,e)))}return!1}delete(t,e){const i=this;let n=!1;function o(a){if(a=lr(a),a){const h=O.findKey(i,a);h&&(!e||ra(i,i[h],h,e))&&(delete i[h],n=!0)}}return O.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let i=e.length,n=!1;for(;i--;){const o=e[i];(!t||ra(this,this[o],o,t,!0))&&(delete this[o],n=!0)}return n}normalize(t){const e=this,i={};return O.forEach(this,(n,o)=>{const a=O.findKey(i,o);if(a){e[a]=cs(n),delete e[o];return}const h=t?U_(o):String(o).trim();h!==o&&delete e[o],e[h]=cs(n),i[h]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return O.forEach(this,(i,n)=>{i!=null&&i!==!1&&(e[n]=t&&O.isArray(i)?i.join(", "):i)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
15
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const i=new this(t);return e.forEach(n=>i.set(n)),i}static accessor(t){const i=(this[Yh]=this[Yh]={accessors:{}}).accessors,n=this.prototype;function o(a){const h=lr(a);i[h]||(Z_(n,a),i[h]=!0)}return O.isArray(t)?t.forEach(o):o(t),this}}us.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),O.reduceDescriptors(us.prototype,({value:r},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>r,set(i){this[e]=i}}}),O.freezeMethods(us);const Je=us;function sa(r,t){const e=this||na,i=t||e,n=Je.from(i.headers);let o=i.data;return O.forEach(r,function(h){o=h.call(e,o,n.normalize(),t?t.status:void 0)}),n.normalize(),o}function Kh(r){return!!(r&&r.__CANCEL__)}function hr(r,t,e){pt.call(this,r??"canceled",pt.ERR_CANCELED,t,e),this.name="CanceledError"}O.inherits(hr,pt,{__CANCEL__:!0});function j_(r,t,e){const i=e.config.validateStatus;!e.status||!i||i(e.status)?r(e):t(new pt("Request failed with status code "+e.status,[pt.ERR_BAD_REQUEST,pt.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}const W_=Fe.isStandardBrowserEnv?function(){return{write:function(e,i,n,o,a,h){const c=[];c.push(e+"="+encodeURIComponent(i)),O.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),O.isString(o)&&c.push("path="+o),O.isString(a)&&c.push("domain="+a),h===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(e){const i=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function H_(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function V_(r,t){return t?r.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):r}function qh(r,t){return r&&!H_(t)?V_(r,t):t}const X_=Fe.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let i;function n(o){let a=o;return t&&(e.setAttribute("href",a),a=e.href),e.setAttribute("href",a),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return i=n(window.location.href),function(a){const h=O.isString(a)?n(a):a;return h.protocol===i.protocol&&h.host===i.host}}():function(){return function(){return!0}}();function Y_(r){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return t&&t[1]||""}function K_(r,t){r=r||10;const e=new Array(r),i=new Array(r);let n=0,o=0,a;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),f=i[o];a||(a=d),e[n]=c,i[n]=d;let _=o,m=0;for(;_!==n;)m+=e[_++],_=_%r;if(n=(n+1)%r,n===o&&(o=(o+1)%r),d-a<t)return;const E=f&&d-f;return E?Math.round(m*1e3/E):void 0}}function $h(r,t){let e=0;const i=K_(50,250);return n=>{const o=n.loaded,a=n.lengthComputable?n.total:void 0,h=o-e,c=i(h),d=o<=a;e=o;const f={loaded:o,total:a,progress:a?o/a:void 0,bytes:h,rate:c||void 0,estimated:c&&a&&d?(a-o)/c:void 0,event:n};f[t?"download":"upload"]=!0,r(f)}}const oa={http:L_,xhr:typeof XMLHttpRequest<"u"&&function(r){return new Promise(function(e,i){let n=r.data;const o=Je.from(r.headers).normalize(),a=r.responseType;let h;function c(){r.cancelToken&&r.cancelToken.unsubscribe(h),r.signal&&r.signal.removeEventListener("abort",h)}let d;O.isFormData(n)&&(Fe.isStandardBrowserEnv||Fe.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.getContentType(/^\s*multipart\/form-data/)?O.isString(d=o.getContentType())&&o.setContentType(d.replace(/^\s*(multipart\/form-data);+/,"$1")):o.setContentType("multipart/form-data"));let f=new XMLHttpRequest;if(r.auth){const v=r.auth.username||"",b=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";o.set("Authorization","Basic "+btoa(v+":"+b))}const _=qh(r.baseURL,r.url);f.open(r.method.toUpperCase(),Wh(_,r.params,r.paramsSerializer),!0),f.timeout=r.timeout;function m(){if(!f)return;const v=Je.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),C={data:!a||a==="text"||a==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:v,config:r,request:f};j_(function(y){e(y),c()},function(y){i(y),c()},C),f=null}if("onloadend"in f?f.onloadend=m:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(m)},f.onabort=function(){f&&(i(new pt("Request aborted",pt.ECONNABORTED,r,f)),f=null)},f.onerror=function(){i(new pt("Network Error",pt.ERR_NETWORK,r,f)),f=null},f.ontimeout=function(){let b=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const C=r.transitional||Vh;r.timeoutErrorMessage&&(b=r.timeoutErrorMessage),i(new pt(b,C.clarifyTimeoutError?pt.ETIMEDOUT:pt.ECONNABORTED,r,f)),f=null},Fe.isStandardBrowserEnv){const v=(r.withCredentials||X_(_))&&r.xsrfCookieName&&W_.read(r.xsrfCookieName);v&&o.set(r.xsrfHeaderName,v)}n===void 0&&o.setContentType(null),"setRequestHeader"in f&&O.forEach(o.toJSON(),function(b,C){f.setRequestHeader(C,b)}),O.isUndefined(r.withCredentials)||(f.withCredentials=!!r.withCredentials),a&&a!=="json"&&(f.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&f.addEventListener("progress",$h(r.onDownloadProgress,!0)),typeof r.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",$h(r.onUploadProgress)),(r.cancelToken||r.signal)&&(h=v=>{f&&(i(!v||v.type?new hr(null,r,f):v),f.abort(),f=null)},r.cancelToken&&r.cancelToken.subscribe(h),r.signal&&(r.signal.aborted?h():r.signal.addEventListener("abort",h)));const E=Y_(_);if(E&&Fe.protocols.indexOf(E)===-1){i(new pt("Unsupported protocol "+E+":",pt.ERR_BAD_REQUEST,r));return}f.send(n||null)})}};O.forEach(oa,(r,t)=>{if(r){try{Object.defineProperty(r,"name",{value:t})}catch{}Object.defineProperty(r,"adapterName",{value:t})}});const Jh=r=>`- ${r}`,q_=r=>O.isFunction(r)||r===null||r===!1,Qh={getAdapter:r=>{r=O.isArray(r)?r:[r];const{length:t}=r;let e,i;const n={};for(let o=0;o<t;o++){e=r[o];let a;if(i=e,!q_(e)&&(i=oa[(a=String(e)).toLowerCase()],i===void 0))throw new pt(`Unknown adapter '${a}'`);if(i)break;n[a||"#"+o]=i}if(!i){const o=Object.entries(n).map(([h,c])=>`adapter ${h} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since :
16
+ `+o.map(Jh).join(`
17
+ `):" "+Jh(o[0]):"as no adapter specified";throw new pt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return i},adapters:oa};function aa(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new hr(null,r)}function tc(r){return aa(r),r.headers=Je.from(r.headers),r.data=sa.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),Qh.getAdapter(r.adapter||na.adapter)(r).then(function(i){return aa(r),i.data=sa.call(r,r.transformResponse,i),i.headers=Je.from(i.headers),i},function(i){return Kh(i)||(aa(r),i&&i.response&&(i.response.data=sa.call(r,r.transformResponse,i.response),i.response.headers=Je.from(i.response.headers))),Promise.reject(i)})}const ec=r=>r instanceof Je?r.toJSON():r;function yn(r,t){t=t||{};const e={};function i(d,f,_){return O.isPlainObject(d)&&O.isPlainObject(f)?O.merge.call({caseless:_},d,f):O.isPlainObject(f)?O.merge({},f):O.isArray(f)?f.slice():f}function n(d,f,_){if(O.isUndefined(f)){if(!O.isUndefined(d))return i(void 0,d,_)}else return i(d,f,_)}function o(d,f){if(!O.isUndefined(f))return i(void 0,f)}function a(d,f){if(O.isUndefined(f)){if(!O.isUndefined(d))return i(void 0,d)}else return i(void 0,f)}function h(d,f,_){if(_ in t)return i(d,f);if(_ in r)return i(void 0,d)}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:h,headers:(d,f)=>n(ec(d),ec(f),!0)};return O.forEach(Object.keys(Object.assign({},r,t)),function(f){const _=c[f]||n,m=_(r[f],t[f],f);O.isUndefined(m)&&_!==h||(e[f]=m)}),e}const ic="1.5.1",la={};["object","boolean","number","function","string","symbol"].forEach((r,t)=>{la[r]=function(i){return typeof i===r||"a"+(t<1?"n ":" ")+r}});const nc={};la.transitional=function(t,e,i){function n(o,a){return"[Axios v"+ic+"] Transitional option '"+o+"'"+a+(i?". "+i:"")}return(o,a,h)=>{if(t===!1)throw new pt(n(a," has been removed"+(e?" in "+e:"")),pt.ERR_DEPRECATED);return e&&!nc[a]&&(nc[a]=!0,console.warn(n(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(o,a,h):!0}};function $_(r,t,e){if(typeof r!="object")throw new pt("options must be an object",pt.ERR_BAD_OPTION_VALUE);const i=Object.keys(r);let n=i.length;for(;n-- >0;){const o=i[n],a=t[o];if(a){const h=r[o],c=h===void 0||a(h,o,r);if(c!==!0)throw new pt("option "+o+" must be "+c,pt.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new pt("Unknown option "+o,pt.ERR_BAD_OPTION)}}const ha={assertOptions:$_,validators:la},vi=ha.validators;class ds{constructor(t){this.defaults=t,this.interceptors={request:new Hh,response:new Hh}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=yn(this.defaults,e);const{transitional:i,paramsSerializer:n,headers:o}=e;i!==void 0&&ha.assertOptions(i,{silentJSONParsing:vi.transitional(vi.boolean),forcedJSONParsing:vi.transitional(vi.boolean),clarifyTimeoutError:vi.transitional(vi.boolean)},!1),n!=null&&(O.isFunction(n)?e.paramsSerializer={serialize:n}:ha.assertOptions(n,{encode:vi.function,serialize:vi.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=o&&O.merge(o.common,o[e.method]);o&&O.forEach(["delete","get","head","post","put","patch","common"],v=>{delete o[v]}),e.headers=Je.concat(a,o);const h=[];let c=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(e)===!1||(c=c&&b.synchronous,h.unshift(b.fulfilled,b.rejected))});const d=[];this.interceptors.response.forEach(function(b){d.push(b.fulfilled,b.rejected)});let f,_=0,m;if(!c){const v=[tc.bind(this),void 0];for(v.unshift.apply(v,h),v.push.apply(v,d),m=v.length,f=Promise.resolve(e);_<m;)f=f.then(v[_++],v[_++]);return f}m=h.length;let E=e;for(_=0;_<m;){const v=h[_++],b=h[_++];try{E=v(E)}catch(C){b.call(this,C);break}}try{f=tc.call(this,E)}catch(v){return Promise.reject(v)}for(_=0,m=d.length;_<m;)f=f.then(d[_++],d[_++]);return f}getUri(t){t=yn(this.defaults,t);const e=qh(t.baseURL,t.url);return Wh(e,t.params,t.paramsSerializer)}}O.forEach(["delete","get","head","options"],function(t){ds.prototype[t]=function(e,i){return this.request(yn(i||{},{method:t,url:e,data:(i||{}).data}))}}),O.forEach(["post","put","patch"],function(t){function e(i){return function(o,a,h){return this.request(yn(h||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}ds.prototype[t]=e(),ds.prototype[t+"Form"]=e(!0)});const fs=ds;class ca{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(o){e=o});const i=this;this.promise.then(n=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](n);i._listeners=null}),this.promise.then=n=>{let o;const a=new Promise(h=>{i.subscribe(h),o=h}).then(n);return a.cancel=function(){i.unsubscribe(o)},a},t(function(o,a,h){i.reason||(i.reason=new hr(o,a,h),e(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}static source(){let t;return{token:new ca(function(n){t=n}),cancel:t}}}const J_=ca;function Q_(r){return function(e){return r.apply(null,e)}}function tp(r){return O.isObject(r)&&r.isAxiosError===!0}const ua={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ua).forEach(([r,t])=>{ua[t]=r});const ep=ua;function rc(r){const t=new fs(r),e=Ph(fs.prototype.request,t);return O.extend(e,fs.prototype,t,{allOwnKeys:!0}),O.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return rc(yn(r,n))},e}const Dt=rc(na);Dt.Axios=fs,Dt.CanceledError=hr,Dt.CancelToken=J_,Dt.isCancel=Kh,Dt.VERSION=ic,Dt.toFormData=hs,Dt.AxiosError=pt,Dt.Cancel=Dt.CanceledError,Dt.all=function(t){return Promise.all(t)},Dt.spread=Q_,Dt.isAxiosError=tp,Dt.mergeConfig=yn,Dt.AxiosHeaders=Je,Dt.formToJSON=r=>Xh(O.isHTMLForm(r)?new FormData(r):r),Dt.getAdapter=Qh.getAdapter,Dt.HttpStatusCode=ep,Dt.default=Dt;const sc=Dt;_t.Edit.Circle=_t.Edit.CircleMarker.extend({_createResizeMarker:function(){var r=this._shape.getLatLng(),t=this._getResizeMarkerPoint(r);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(t,this.options.resizeIcon))},_getResizeMarkerPoint:function(r){var t=this._shape._radius*Math.cos(Math.PI/4),e=this._map.project(r);return this._map.unproject([e.x+t,e.y-t])},_resize:function(r){var t=this._moveMarker.getLatLng(),e;_t.GeometryUtil.isVersion07x()?e=t.distanceTo(r):e=this._map.distance(t,r),this._shape.setRadius(e),this._map.fire(_t.Draw.Event.EDITRESIZE,{layer:this._shape})}});const ip=V.defineComponent({name:"MapView",props:{loadPolygon:Boolean,reverseCoordinatesPolygon:Boolean,dataPolygon:Object,configurationMap:Object,coordinatesMap:Array,getGeoJSON:Function,getCoodMarker:Function},data(){return{idMap:"",mapRender:null,markerRender:null,renderCoordinates:this.coordinatesMap,renderGeojson:this.dataPolygon,markerIcon:{iconUrl:ts,iconSize:[25,41],iconAnchor:[12,41]},layersFeatureGroup:null,featuresData:null}},mounted(){this.makeid(10),this.renderMap()},methods:{getLayersFeaturesInGeoJson(){const r=_t.geoJSON().addTo(this.mapRender);return this.featuresData.eachLayer(e=>{r.addLayer(e)}),[r.toGeoJSON()]},triggerSaveEdit(){var t,e,i;(i=(e=(t=(document.getElementsByClassName("leaflet-draw-actions leaflet-draw-actions-top")||document.getElementsByClassName("leaflet-draw-actions leaflet-draw-actions-top leaflet-draw-actions-bottom"))[0])==null?void 0:t.querySelector("li"))==null?void 0:e.querySelector("a"))==null||i.click()},makeid(r){let t="";const e="abcdefghijklmnopqrstuvwxyz",i=e.length;let n=0;for(;n<r;)t+=e.charAt(Math.floor(Math.random()*i)),n+=1;this.idMap=t},renderMap(){jg("es"),setTimeout(()=>{this.loadPolygon?this.viewMap():this.createMap()},500)},createMap(){var a,h,c,d,f,_,m,E;const r=this.configurationMap?this.configurationMap.iconMarker?this.configurationMap.iconMarker:this.markerIcon:this.markerIcon;window.type=!0;const t=_t.map(this.idMap,{fullscreenControl:!0}).setView([this.renderCoordinates?this.renderCoordinates[0]:0,this.renderCoordinates?this.renderCoordinates[1]:0],this.renderCoordinates?this.renderCoordinates[2]:0);if(this.mapRender=t,_t.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(t),t.setZoom((a=this.configurationMap)==null?void 0:a.maxZoom),this.configurationMap.renderMarker){const v=_t.marker([this.renderCoordinates?this.renderCoordinates[0]:0,this.renderCoordinates?this.renderCoordinates[1]:0],{icon:_t.icon(r),draggable:this.configurationMap.dragMarker}).addTo(t);this.markerRender=v,this.getCoodMarker&&v.on("dragend",b=>{const C=b.target.getLatLng(),S=C.lat,y=C.lng;this.getCoodMarker&&this.getCoodMarker(S,y)})}const e=_t.featureGroup();this.featuresData=e;const i=e.addTo(t);let n={featureGroup:i,edit:!1,remove:(h=this.configurationMap)==null?void 0:h.editFigures.remove};(c=this.configurationMap)!=null&&c.editFigures.edit&&(n={featureGroup:i,...(d=this.configurationMap)==null?void 0:d.editFigures.edit,remove:(f=this.configurationMap)==null?void 0:f.editFigures.remove});const o=new _t.Control.Draw({position:"topleft",draw:{polygon:(_=this.configurationMap)==null?void 0:_.createFigures.polygon,circle:!1,rectangle:(m=this.configurationMap)!=null&&m.createFigures.rectangle?{shapeOptions:{color:"blue"}}:!1,marker:(E=this.configurationMap)!=null&&E.createFigures.marker?{icon:_t.icon(r)}:!1,polyline:!1,circlemarker:!1},edit:n});t.addControl(o),t.on("draw:created",v=>{const b=v.layer;i.addLayer(b);const C=b.toGeoJSON();this.getGeoJSON&&this.getGeoJSON([C])}),t.on("draw:edited",v=>{v.layers.eachLayer(C=>{const S=C.toGeoJSON();this.getGeoJSON&&this.getGeoJSON([S])})})},viewMap(){var h,c,d,f,_,m,E,v;const r=this.configurationMap?this.configurationMap.iconMarker?this.configurationMap.iconMarker:this.markerIcon:this.markerIcon;window.type=!0;const t=_t.map(this.idMap,{fullscreenControl:!0}).setView([this.renderCoordinates?this.renderCoordinates[0]:0,this.renderCoordinates?this.renderCoordinates[1]:0],this.renderCoordinates?this.renderCoordinates[2]:0);this.mapRender=t,_t.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(t),t.setZoom((h=this.configurationMap)==null?void 0:h.maxZoom);const e=_t.featureGroup();this.featuresData=e;const i=e.addTo(t);let n={featureGroup:i,edit:!1,remove:(c=this.configurationMap)==null?void 0:c.editFigures.remove};(d=this.configurationMap)!=null&&d.editFigures.edit&&(n={featureGroup:i,...(f=this.configurationMap)==null?void 0:f.editFigures.edit,remove:(_=this.configurationMap)==null?void 0:_.editFigures.remove});const o=this.renderGeojson;if(o&&o.length){o.forEach(C=>{C.type==="FeatureCollection"?C.features.forEach(S=>{(S.geometry.type==="Polygon"||S.geometry.type==="MultiPolygon")&&_t.geoJson(S,{onEachFeature:function(y,x){i.addLayer(x)}})}):C.type==="Feature"&&(C.geometry.type==="Polygon"||C.geometry.type==="MultiPolygon")&&_t.geoJson(C,{onEachFeature:function(S,y){i.addLayer(y)}})});const b=i.getBounds();t.fitBounds(b)}const a=new _t.Control.Draw({position:"topleft",draw:{polygon:(m=this.configurationMap)==null?void 0:m.createFigures.polygon,circle:!1,rectangle:(E=this.configurationMap)!=null&&E.createFigures.rectangle?{shapeOptions:{color:"blue"}}:!1,marker:(v=this.configurationMap)!=null&&v.createFigures.marker?{icon:_t.icon(r)}:!1,polyline:!1,circlemarker:!1},edit:n});t.addControl(a),t.on("draw:created",b=>{const C=b.layer;i.addLayer(C);const S=C.toGeoJSON();this.getGeoJSON&&this.getGeoJSON(S)}),t.on("draw:edited",b=>{b.layers.eachLayer(S=>{const y=S.toGeoJSON();this.getGeoJSON&&this.getGeoJSON(y)})})},async searchAddress(r){const t=await sc.get(location.protocol+"//nominatim.openstreetmap.org/search?",{params:{q:r,limit:1,format:"json"}});if(t.data.length===1){const e=parseFloat(t.data[0].lat),n={lng:parseFloat(t.data[0].lon),lat:e};return this.setCoordinates({...n,moveMarker:!0}),t.data[0]}return t.data},setCoordinates({lat:r,lng:t}){if(this.mapRender){const e=_t.latLng(r,t);this.mapRender.panTo(e,{animate:!0,duration:.5})}}},watch:{coordinatesMap(r){if(this.renderCoordinates=r,this.mapRender&&this.markerRender){const t=_t.latLng([r[0],r[1]]);this.mapRender.setView([r[0],r[1]],r[2]),this.markerRender.setLatLng(t)}},dataPolygon(r){this.renderGeojson=r}}}),np=["id"];function rp(r,t,e,i,n,o){var a;return V.openBlock(),V.createElementBlock("div",{class:"map-container",style:V.normalizeStyle(`height:${(a=r.configurationMap)==null?void 0:a.height}`)},[V.createElementVNode("div",{id:r.idMap,style:{height:"100%"}},null,8,np)],4)}const sp=qo(ip,[["render",rp]]),op=["id"],ap=V.defineComponent({__name:"MapSearchAddress",props:{configurationMap:{default:()=>({height:"250px",maxZoom:20,iconMarker:{iconUrl:ts,iconSize:[25,41],iconAnchor:[12,41],class:"",type:"image"},dragMarker:!0})},coordinatesMap:{default:()=>({lat:-19.0429,lng:-65.2554,zoom:12})}},emits:["updated:coordsMarker"],setup(r,{expose:t,emit:e}){const i=r,n=V.ref(),o=V.ref(i.coordinatesMap),a=V.ref(),h=V.ref();V.onMounted(async()=>{await c(10),await d()});const c=async v=>{let b="";const C="abcdefghijklmnopqrstuvwxyz",S=C.length;let y=0;for(;y<v;)b+=C.charAt(Math.floor(Math.random()*S)),y+=1;n.value=b},d=async()=>{await f()},f=async()=>{var C,S;const v=(C=i.configurationMap)==null?void 0:C.iconMarker,b=_t.map(n.value,{fullscreenControl:!0}).setView([o.value.lat,o.value.lng],o.value.zoom);if(b.invalidateSize(),a.value=b,_t.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:(S=i.configurationMap)==null?void 0:S.maxZoom,attribution:'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(b),v.type==="image"){const y=_t.marker([o.value.lat,o.value.lng],{icon:_t.icon({iconUrl:v.iconUrl,iconAnchor:v.iconAnchor,iconSize:v.iconSize,className:v.class}),draggable:i.configurationMap.dragMarker}).addTo(b);h.value=y,y.on("dragend",x=>{const T=x.target.getLatLng(),k=T.lat,R=T.lng;m({lat:k,lng:R})})}else if(v.type==="svg"){const y=_t.marker([o.value.lat,o.value.lng],{icon:_t.divIcon({html:v.iconUrl,iconAnchor:v.iconAnchor,iconSize:v.iconSize,className:v.class}),draggable:i.configurationMap.dragMarker}).addTo(b);h.value=y,y.on("dragend",x=>{const T=x.target.getLatLng(),k=T.lat,R=T.lng;m({lat:k,lng:R})})}},_=async v=>{const b=await sc.get(location.protocol+"//nominatim.openstreetmap.org/search?",{params:{q:v,limit:1,format:"json"}});if(b.data.length===1){const C=parseFloat(b.data[0].lat),y={lng:parseFloat(b.data[0].lon),lat:C};return m({...y,moveMarker:!0}),b.data[0]}return b.data},m=({lat:v,lng:b,moveMarker:C=!1})=>{var S;e("updated:coordsMarker",{lat:v,lng:b}),C&&((S=h.value)==null||S.setLatLng({lat:v,lng:b})),E({lat:v,lng:b})},E=({lat:v,lng:b})=>{const C=_t.latLng(v,b);a.value.panTo(C,{animate:!0,duration:.5})};return t({searchAddress:_}),(v,b)=>{var C;return V.openBlock(),V.createElementBlock("div",{class:"map-container",style:V.normalizeStyle(`height:${(C=v.configurationMap)==null?void 0:C.height}`)},[V.createElementVNode("div",{id:n.value,style:{height:"100%"}},null,8,op)],4)}}}),mL="";class lp{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const Qe=lp,vn={PROPERTYCHANGE:"propertychange"};class hp{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}const gs=hp;function cp(r,t,e){let i,n;e=e||xi;let o=0,a=r.length,h=!1;for(;o<a;)i=o+(a-o>>1),n=+e(r[i],t),n<0?o=i+1:(a=i,h=!n);return h?o:~o}function xi(r,t){return r>t?1:r<t?-1:0}function da(r,t,e){if(r[0]<=t)return 0;const i=r.length;if(t<=r[i-1])return i-1;if(typeof e=="function"){for(let n=1;n<i;++n){const o=r[n];if(o===t)return n;if(o<t)return e(t,r[n-1],o)>0?n-1:n}return i-1}if(e>0){for(let n=1;n<i;++n)if(r[n]<t)return n-1;return i-1}if(e<0){for(let n=1;n<i;++n)if(r[n]<=t)return n;return i-1}for(let n=1;n<i;++n){if(r[n]==t)return n;if(r[n]<t)return r[n-1]-t<t-r[n]?n-1:n}return i-1}function up(r,t,e){for(;t<e;){const i=r[t];r[t]=r[e],r[e]=i,++t,--e}}function ti(r,t){const e=Array.isArray(t)?t:[t],i=e.length;for(let n=0;n<i;n++)r[r.length]=e[n]}function ei(r,t){const e=r.length;if(e!==t.length)return!1;for(let i=0;i<e;i++)if(r[i]!==t[i])return!1;return!0}function dp(r,t,e){const i=t||xi;return r.every(function(n,o){if(o===0)return!0;const a=i(r[o-1],n);return!(a>0||e&&a===0)})}function cr(){return!0}function _s(){return!1}function xn(){}function fp(r){let t=!1,e,i,n;return function(){const o=Array.prototype.slice.call(arguments);return(!t||this!==n||!ei(o,i))&&(t=!0,n=this,i=o,e=r.apply(this,arguments)),e}}function En(r){for(const t in r)delete r[t]}function wn(r){let t;for(t in r)return!1;return!t}class gp extends gs{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);n.includes(e)||n.push(e)}dispatchEvent(t){const e=typeof t=="string",i=e?t:t.type,n=this.listeners_&&this.listeners_[i];if(!n)return;const o=e?new Qe(t):t;o.target||(o.target=this.eventTarget_||this);const a=this.dispatching_||(this.dispatching_={}),h=this.pendingRemovals_||(this.pendingRemovals_={});i in a||(a[i]=0,h[i]=0),++a[i];let c;for(let d=0,f=n.length;d<f;++d)if("handleEvent"in n[d]?c=n[d].handleEvent(o):c=n[d].call(this,o),c===!1||o.propagationStopped){c=!1;break}if(--a[i]===0){let d=h[i];for(delete h[i];d--;)this.removeEventListener(i,xn);delete a[i]}return c}disposeInternal(){this.listeners_&&En(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){const i=this.listeners_&&this.listeners_[t];if(i){const n=i.indexOf(e);n!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=xn,++this.pendingRemovals_[t]):(i.splice(n,1),i.length===0&&delete this.listeners_[t]))}}}const ps=gp,at={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function ut(r,t,e,i,n){if(i&&i!==r&&(e=e.bind(i)),n){const a=e;e=function(){r.removeEventListener(t,e),a.apply(this,arguments)}}const o={target:r,type:t,listener:e};return r.addEventListener(t,e),o}function ms(r,t,e,i){return ut(r,t,e,i,!0)}function wt(r){r&&r.target&&(r.target.removeEventListener(r.type,r.listener),En(r))}class ys extends ps{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(at.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,n=new Array(i);for(let o=0;o<i;++o)n[o]=ut(this,t[o],e);return n}return ut(this,t,e)}onceInternal(t,e){let i;if(Array.isArray(t)){const n=t.length;i=new Array(n);for(let o=0;o<n;++o)i[o]=ms(this,t[o],e)}else i=ms(this,t,e);return e.ol_key=i,i}unInternal(t,e){const i=e.ol_key;if(i)_p(i);else if(Array.isArray(t))for(let n=0,o=t.length;n<o;++n)this.removeEventListener(t[n],e);else this.removeEventListener(t,e)}}ys.prototype.on,ys.prototype.once,ys.prototype.un;function _p(r){if(Array.isArray(r))for(let t=0,e=r.length;t<e;++t)wt(r[t]);else wt(r)}const oc=ys;function st(){throw new Error("Unimplemented abstract method.")}let pp=0;function ht(r){return r.ol_uid||(r.ol_uid=String(++pp))}class ac extends Qe{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}class mp extends oc{constructor(t){super(),this.on,this.once,this.un,ht(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 i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new ac(i,t,e)),i=vn.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new ac(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){const n=this.values_||(this.values_={});if(i)n[t]=e;else{const o=n[t];n[t]=e,o!==e&&this.notify(t,o)}}setProperties(t,e){for(const i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const i=this.values_[t];delete this.values_[t],wn(this.values_)&&(this.values_=null),e||this.notify(t,i)}}}const be=mp,Ut={ANIMATING:0,INTERACTING:1},Te={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},yp=42,fa=256,ur={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class vp{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_||ur[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 lc=vp,dr=6378137,Ln=Math.PI*dr,xp=[-Ln,-Ln,Ln,Ln],Ep=[-180,-85,180,85],vs=dr*Math.log(Math.tan(Math.PI/2));class bn extends lc{constructor(t){super({code:t,units:"m",extent:xp,global:!0,worldExtent:Ep,getPointResolution:function(e,i){return e/Math.cosh(i[1]/dr)}})}}const hc=[new bn("EPSG:3857"),new bn("EPSG:102100"),new bn("EPSG:102113"),new bn("EPSG:900913"),new bn("http://www.opengis.net/def/crs/EPSG/0/3857"),new bn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function wp(r,t,e){const i=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(i));for(let n=0;n<i;n+=e){t[n]=Ln*r[n]/180;let o=dr*Math.log(Math.tan(Math.PI*(+r[n+1]+90)/360));o>vs?o=vs:o<-vs&&(o=-vs),t[n+1]=o}return t}function Lp(r,t,e){const i=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(i));for(let n=0;n<i;n+=e)t[n]=180*r[n]/Ln,t[n+1]=360*Math.atan(Math.exp(r[n+1]/dr))/Math.PI-90;return t}const bp=6378137,cc=[-180,-90,180,90],Tp=Math.PI*bp/180;class Vi extends lc{constructor(t,e){super({code:t,units:"degrees",extent:cc,axisOrientation:e,global:!0,metersPerUnit:Tp,worldExtent:cc})}}const uc=[new Vi("CRS:84"),new Vi("EPSG:4326","neu"),new Vi("urn:ogc:def:crs:OGC:1.3:CRS84"),new Vi("urn:ogc:def:crs:OGC:2:84"),new Vi("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Vi("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Vi("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let ga={};function Cp(r){return ga[r]||ga[r.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Sp(r,t){ga[r]=t}let Tn={};function xs(r,t,e){const i=r.getCode(),n=t.getCode();i in Tn||(Tn[i]={}),Tn[i][n]=e}function Pp(r,t){let e;return r in Tn&&t in Tn[r]&&(e=Tn[r][t]),e}const Zt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function dc(r){const t=ge();for(let e=0,i=r.length;e<i;++e)gr(t,r[e]);return t}function Es(r,t,e){return e?(e[0]=r[0]-t,e[1]=r[1]-t,e[2]=r[2]+t,e[3]=r[3]+t,e):[r[0]-t,r[1]-t,r[2]+t,r[3]+t]}function fc(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r.slice()}function Xi(r,t,e){let i,n;return t<r[0]?i=r[0]-t:r[2]<t?i=t-r[2]:i=0,e<r[1]?n=r[1]-e:r[3]<e?n=e-r[3]:n=0,i*i+n*n}function ws(r,t){return _a(r,t[0],t[1])}function Yi(r,t){return r[0]<=t[0]&&t[2]<=r[2]&&r[1]<=t[1]&&t[3]<=r[3]}function _a(r,t,e){return r[0]<=t&&t<=r[2]&&r[1]<=e&&e<=r[3]}function pa(r,t){const e=r[0],i=r[1],n=r[2],o=r[3],a=t[0],h=t[1];let c=Zt.UNKNOWN;return a<e?c=c|Zt.LEFT:a>n&&(c=c|Zt.RIGHT),h<i?c=c|Zt.BELOW:h>o&&(c=c|Zt.ABOVE),c===Zt.UNKNOWN&&(c=Zt.INTERSECTING),c}function ge(){return[1/0,1/0,-1/0,-1/0]}function Ei(r,t,e,i,n){return n?(n[0]=r,n[1]=t,n[2]=e,n[3]=i,n):[r,t,e,i]}function fr(r){return Ei(1/0,1/0,-1/0,-1/0,r)}function kp(r,t){const e=r[0],i=r[1];return Ei(e,i,e,i,t)}function gc(r,t,e,i,n){const o=fr(n);return pc(o,r,t,e,i)}function Cn(r,t){return r[0]==t[0]&&r[2]==t[2]&&r[1]==t[1]&&r[3]==t[3]}function _c(r,t){return t[0]<r[0]&&(r[0]=t[0]),t[2]>r[2]&&(r[2]=t[2]),t[1]<r[1]&&(r[1]=t[1]),t[3]>r[3]&&(r[3]=t[3]),r}function gr(r,t){t[0]<r[0]&&(r[0]=t[0]),t[0]>r[2]&&(r[2]=t[0]),t[1]<r[1]&&(r[1]=t[1]),t[1]>r[3]&&(r[3]=t[1])}function pc(r,t,e,i,n){for(;e<i;e+=n)Rp(r,t[e],t[e+1]);return r}function Rp(r,t,e){r[0]=Math.min(r[0],t),r[1]=Math.min(r[1],e),r[2]=Math.max(r[2],t),r[3]=Math.max(r[3],e)}function mc(r,t){let e;return e=t(Ls(r)),e||(e=t(bs(r)),e)||(e=t(Ts(r)),e)||(e=t(qi(r)),e)?e:!1}function ma(r){let t=0;return Cs(r)||(t=Tt(r)*ze(r)),t}function Ls(r){return[r[0],r[1]]}function bs(r){return[r[2],r[1]]}function Ki(r){return[(r[0]+r[2])/2,(r[1]+r[3])/2]}function Mp(r,t){let e;if(t==="bottom-left")e=Ls(r);else if(t==="bottom-right")e=bs(r);else if(t==="top-left")e=qi(r);else if(t==="top-right")e=Ts(r);else throw new Error("Invalid corner");return e}function ya(r,t,e,i,n){const[o,a,h,c,d,f,_,m]=va(r,t,e,i);return Ei(Math.min(o,h,d,_),Math.min(a,c,f,m),Math.max(o,h,d,_),Math.max(a,c,f,m),n)}function va(r,t,e,i){const n=t*i[0]/2,o=t*i[1]/2,a=Math.cos(e),h=Math.sin(e),c=n*a,d=n*h,f=o*a,_=o*h,m=r[0],E=r[1];return[m-c+_,E-d-f,m-c-_,E-d+f,m+c-_,E+d+f,m+c+_,E+d-f,m-c+_,E-d-f]}function ze(r){return r[3]-r[1]}function _r(r,t,e){const i=e||ge();return se(r,t)?(r[0]>t[0]?i[0]=r[0]:i[0]=t[0],r[1]>t[1]?i[1]=r[1]:i[1]=t[1],r[2]<t[2]?i[2]=r[2]:i[2]=t[2],r[3]<t[3]?i[3]=r[3]:i[3]=t[3]):fr(i),i}function qi(r){return[r[0],r[3]]}function Ts(r){return[r[2],r[3]]}function Tt(r){return r[2]-r[0]}function se(r,t){return r[0]<=t[2]&&r[2]>=t[0]&&r[1]<=t[3]&&r[3]>=t[1]}function Cs(r){return r[2]<r[0]||r[3]<r[1]}function Ip(r,t){return t?(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t):r}function Ap(r,t,e){let i=!1;const n=pa(r,t),o=pa(r,e);if(n===Zt.INTERSECTING||o===Zt.INTERSECTING)i=!0;else{const a=r[0],h=r[1],c=r[2],d=r[3],f=t[0],_=t[1],m=e[0],E=e[1],v=(E-_)/(m-f);let b,C;o&Zt.ABOVE&&!(n&Zt.ABOVE)&&(b=m-(E-d)/v,i=b>=a&&b<=c),!i&&o&Zt.RIGHT&&!(n&Zt.RIGHT)&&(C=E-(m-c)*v,i=C>=h&&C<=d),!i&&o&Zt.BELOW&&!(n&Zt.BELOW)&&(b=m-(E-h)/v,i=b>=a&&b<=c),!i&&o&Zt.LEFT&&!(n&Zt.LEFT)&&(C=E-(m-a)*v,i=C>=h&&C<=d)}return i}function yc(r,t){const e=t.getExtent(),i=Ki(r);if(t.canWrapX()&&(i[0]<e[0]||i[0]>=e[2])){const n=Tt(e),a=Math.floor((i[0]-e[0])/n)*n;r[0]-=a,r[2]-=a}return r}function Dp(r,t){if(t.canWrapX()){const e=t.getExtent();if(!isFinite(r[0])||!isFinite(r[2]))return[[e[0],r[1],e[2],r[3]]];yc(r,t);const i=Tt(e);if(Tt(r)>i)return[[e[0],r[1],e[2],r[3]]];if(r[0]<e[0])return[[r[0]+i,r[1],e[2],r[3]],[e[0],r[1],r[2],r[3]]];if(r[2]>e[2])return[[r[0],r[1],e[2],r[3]],[e[0],r[1],r[2]-i,r[3]]]}return[r]}function It(r,t,e){return Math.min(Math.max(r,t),e)}function Op(r,t,e,i,n,o){const a=n-e,h=o-i;if(a!==0||h!==0){const c=((r-e)*a+(t-i)*h)/(a*a+h*h);c>1?(e=n,i=o):c>0&&(e+=a*c,i+=h*c)}return $i(r,t,e,i)}function $i(r,t,e,i){const n=e-r,o=i-t;return n*n+o*o}function Fp(r){const t=r.length;for(let i=0;i<t;i++){let n=i,o=Math.abs(r[i][i]);for(let h=i+1;h<t;h++){const c=Math.abs(r[h][i]);c>o&&(o=c,n=h)}if(o===0)return null;const a=r[n];r[n]=r[i],r[i]=a;for(let h=i+1;h<t;h++){const c=-r[h][i]/r[i][i];for(let d=i;d<t+1;d++)i==d?r[h][d]=0:r[h][d]+=c*r[i][d]}}const e=new Array(t);for(let i=t-1;i>=0;i--){e[i]=r[i][t]/r[i][i];for(let n=i-1;n>=0;n--)r[n][t]-=r[n][i]*e[i]}return e}function Ss(r){return r*Math.PI/180}function Sn(r,t){const e=r%t;return e*t<0?e+t:e}function _e(r,t,e){return r+e*(t-r)}function xa(r,t){const e=Math.pow(10,t);return Math.round(r*e)/e}function Ps(r,t){return Math.floor(xa(r,t))}function ks(r,t){return Math.ceil(xa(r,t))}function zp(r,t){return r[0]+=+t[0],r[1]+=+t[1],r}function Rs(r,t){let e=!0;for(let i=r.length-1;i>=0;--i)if(r[i]!=t[i]){e=!1;break}return e}function Ea(r,t){const e=Math.cos(t),i=Math.sin(t),n=r[0]*e-r[1]*i,o=r[1]*e+r[0]*i;return r[0]=n,r[1]=o,r}function Np(r,t){return r[0]*=t,r[1]*=t,r}function vc(r,t){if(t.canWrapX()){const e=Tt(t.getExtent()),i=Bp(r,t,e);i&&(r[0]-=i*e)}return r}function Bp(r,t,e){const i=t.getExtent();let n=0;return t.canWrapX()&&(r[0]<i[0]||r[0]>i[2])&&(e=e||Tt(i),n=Math.floor((r[0]-i[0])/e)),n}const Gp=63710088e-1;function xc(r,t,e){e=e||Gp;const i=Ss(r[1]),n=Ss(t[1]),o=(n-i)/2,a=Ss(t[0]-r[0])/2,h=Math.sin(o)*Math.sin(o)+Math.sin(a)*Math.sin(a)*Math.cos(i)*Math.cos(n);return 2*e*Math.atan2(Math.sqrt(h),Math.sqrt(1-h))}const Ec={info:1,warn:2,error:3,none:4};let Up=Ec.info;function wc(...r){Up>Ec.warn||console.warn(...r)}let wa=!0;function Lc(r){wa=!(r===void 0?!0:r)}function La(r,t){if(t!==void 0){for(let e=0,i=r.length;e<i;++e)t[e]=r[e];t=t}else t=r.slice();return t}function bc(r,t){if(t!==void 0&&r!==t){for(let e=0,i=r.length;e<i;++e)t[e]=r[e];r=t}return r}function Zp(r){Sp(r.getCode(),r),xs(r,r,La)}function jp(r){r.forEach(Zp)}function Gt(r){return typeof r=="string"?Cp(r):r||null}function Tc(r,t,e,i){r=Gt(r);let n;const o=r.getPointResolutionFunc();if(o){if(n=o(t,e),i&&i!==r.getUnits()){const a=r.getMetersPerUnit();a&&(n=n*a/ur[i])}}else{const a=r.getUnits();if(a=="degrees"&&!i||i=="degrees")n=t;else{const h=Ta(r,Gt("EPSG:4326"));if(h===bc&&a!=="degrees")n=t*r.getMetersPerUnit();else{let d=[e[0]-t/2,e[1],e[0]+t/2,e[1],e[0],e[1]-t/2,e[0],e[1]+t/2];d=h(d,d,2);const f=xc(d.slice(0,2),d.slice(2,4)),_=xc(d.slice(4,6),d.slice(6,8));n=(f+_)/2}const c=i?ur[i]:r.getMetersPerUnit();c!==void 0&&(n/=c)}}return n}function Cc(r){jp(r),r.forEach(function(t){r.forEach(function(e){t!==e&&xs(t,e,La)})})}function Wp(r,t,e,i){r.forEach(function(n){t.forEach(function(o){xs(n,o,e),xs(o,n,i)})})}function ba(r,t){return r?typeof r=="string"?Gt(r):r:Gt(t)}function Sc(r,t){return Lc(),Pc(r,"EPSG:4326",t!==void 0?t:"EPSG:3857")}function Ji(r,t){if(r===t)return!0;const e=r.getUnits()===t.getUnits();return(r.getCode()===t.getCode()||Ta(r,t)===La)&&e}function Ta(r,t){const e=r.getCode(),i=t.getCode();let n=Pp(e,i);return n||(n=bc),n}function Ms(r,t){const e=Gt(r),i=Gt(t);return Ta(e,i)}function Pc(r,t,e){return Ms(t,e)(r,void 0,r.length)}function Ca(r,t){return r}function ii(r,t){return wa&&!Rs(r,[0,0])&&r[0]>=-180&&r[0]<=180&&r[1]>=-90&&r[1]<=90&&(wa=!1,wc("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),r}function kc(r,t){return r}function Qi(r,t){return r}function Hp(){Cc(hc),Cc(uc),Wp(uc,hc,wp,Lp)}Hp();function gt(r,t){if(!r)throw new Error(t)}function Rc(r,t,e){return function(i,n,o,a,h){if(!i)return;if(!n&&!t)return i;const c=t?0:o[0]*n,d=t?0:o[1]*n,f=h?h[0]:0,_=h?h[1]:0;let m=r[0]+c/2+f,E=r[2]-c/2+f,v=r[1]+d/2+_,b=r[3]-d/2+_;m>E&&(m=(E+m)/2,E=m),v>b&&(v=(b+v)/2,b=v);let C=It(i[0],m,E),S=It(i[1],v,b);if(a&&e&&n){const y=30*n;C+=-y*Math.log(1+Math.max(0,m-i[0])/y)+y*Math.log(1+Math.max(0,i[0]-E)/y),S+=-y*Math.log(1+Math.max(0,v-i[1])/y)+y*Math.log(1+Math.max(0,i[1]-b)/y)}return[C,S]}}function Vp(r){return r}function Sa(r,t,e,i){const n=Tt(t)/e[0],o=ze(t)/e[1];return i?Math.min(r,Math.max(n,o)):Math.min(r,Math.min(n,o))}function Pa(r,t,e){let i=Math.min(r,t);const n=50;return i*=Math.log(1+n*Math.max(0,r/t-1))/n+1,e&&(i=Math.max(i,e),i/=Math.log(1+n*Math.max(0,e/r-1))/n+1),It(i,e/2,t*2)}function Xp(r,t,e,i){return t=t!==void 0?t:!0,function(n,o,a,h){if(n!==void 0){const c=r[0],d=r[r.length-1],f=e?Sa(c,e,a,i):c;if(h)return t?Pa(n,f,d):It(n,d,f);const _=Math.min(f,n),m=Math.floor(da(r,_,o));return r[m]>f&&m<r.length-1?r[m+1]:r[m]}}}function Yp(r,t,e,i,n,o){return i=i!==void 0?i:!0,e=e!==void 0?e:0,function(a,h,c,d){if(a!==void 0){const f=n?Sa(t,n,c,o):t;if(d)return i?Pa(a,f,e):It(a,e,f);const _=1e-9,m=Math.ceil(Math.log(t/f)/Math.log(r)-_),E=-h*(.5-_)+.5,v=Math.min(f,a),b=Math.floor(Math.log(t/v)/Math.log(r)+E),C=Math.max(m,b),S=t/Math.pow(r,C);return It(S,e,f)}}}function Mc(r,t,e,i,n){return e=e!==void 0?e:!0,function(o,a,h,c){if(o!==void 0){const d=i?Sa(r,i,h,n):r;return!e||!c?It(o,t,d):Pa(o,d,t)}}}function ka(r){if(r!==void 0)return 0}function Ic(r){if(r!==void 0)return r}function Kp(r){const t=2*Math.PI/r;return function(e,i){if(i)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e}}function qp(r){return r=r||Ss(5),function(t,e){if(e)return t;if(t!==void 0)return Math.abs(t)<=r?0:t}}function Ac(r){return Math.pow(r,3)}function Pn(r){return 1-Ac(1-r)}function $p(r){return 3*r*r-2*r*r*r}function Jp(r){return r}const wi=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",Qp=wi.includes("firefox"),tm=wi.includes("safari")&&!wi.includes("chrom")&&(wi.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(wi)),em=wi.includes("webkit")&&!wi.includes("edge"),Dc=wi.includes("macintosh"),Oc=typeof devicePixelRatio<"u"?devicePixelRatio:1,Ra=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Fc=typeof Image<"u"&&Image.prototype.decode,zc=function(){let r=!1;try{const t=Object.defineProperty({},"passive",{get:function(){r=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return r}(),im=new Array(6);function Vt(){return[1,0,0,1,0,0]}function Nc(r,t){const e=r[0],i=r[1],n=r[2],o=r[3],a=r[4],h=r[5],c=t[0],d=t[1],f=t[2],_=t[3],m=t[4],E=t[5];return r[0]=e*c+n*d,r[1]=i*c+o*d,r[2]=e*f+n*_,r[3]=i*f+o*_,r[4]=e*m+n*E+a,r[5]=i*m+o*E+h,r}function Bc(r,t,e,i,n,o,a){return r[0]=t,r[1]=e,r[2]=i,r[3]=n,r[4]=o,r[5]=a,r}function nm(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function Ot(r,t){const e=t[0],i=t[1];return t[0]=r[0]*e+r[2]*i+r[4],t[1]=r[1]*e+r[3]*i+r[5],t}function rm(r,t,e){return Bc(r,t,0,0,e,0,0)}function sm(r,t,e){return Nc(r,Bc(im,1,0,0,1,t,e))}function Ne(r,t,e,i,n,o,a,h){const c=Math.sin(o),d=Math.cos(o);return r[0]=i*d,r[1]=n*c,r[2]=-i*c,r[3]=n*d,r[4]=a*i*d-h*i*c+t,r[5]=a*n*c+h*n*d+e,r}function Is(r,t){const e=om(t);gt(e!==0,"Transformation matrix cannot be inverted");const i=t[0],n=t[1],o=t[2],a=t[3],h=t[4],c=t[5];return r[0]=a/e,r[1]=-n/e,r[2]=-o/e,r[3]=i/e,r[4]=(o*c-a*h)/e,r[5]=-(i*c-n*h)/e,r}function om(r){return r[0]*r[3]-r[1]*r[2]}let Gc;function Uc(r){const t="matrix("+r.join(", ")+")";if(Ra)return t;const e=Gc||(Gc=document.createElement("div"));return e.style.transform=t,e.style.transform}function tn(r,t,e,i,n,o){o=o||[];let a=0;for(let h=t;h<e;h+=i){const c=r[h],d=r[h+1];o[a++]=n[0]*c+n[2]*d+n[4],o[a++]=n[1]*c+n[3]*d+n[5]}return o&&o.length!=a&&(o.length=a),o}function Zc(r,t,e,i,n,o,a){a=a||[];const h=Math.cos(n),c=Math.sin(n),d=o[0],f=o[1];let _=0;for(let m=t;m<e;m+=i){const E=r[m]-d,v=r[m+1]-f;a[_++]=d+E*h-v*c,a[_++]=f+E*c+v*h;for(let b=m+2;b<m+i;++b)a[_++]=r[b]}return a&&a.length!=_&&(a.length=_),a}function am(r,t,e,i,n,o,a,h){h=h||[];const c=a[0],d=a[1];let f=0;for(let _=t;_<e;_+=i){const m=r[_]-c,E=r[_+1]-d;h[f++]=c+n*m,h[f++]=d+o*E;for(let v=_+2;v<_+i;++v)h[f++]=r[v]}return h&&h.length!=f&&(h.length=f),h}function lm(r,t,e,i,n,o,a){a=a||[];let h=0;for(let c=t;c<e;c+=i){a[h++]=r[c]+n,a[h++]=r[c+1]+o;for(let d=c+2;d<c+i;++d)a[h++]=r[d]}return a&&a.length!=h&&(a.length=h),a}const jc=Vt();class hm extends be{constructor(){super(),this.extent_=ge(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=fp(function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);const n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return st()}closestPointXY(t,e,i,n){return st()}containsXY(t,e){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}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 st()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&fr(e),this.extentRevision_=this.getRevision()}return Ip(this.extent_,t)}rotate(t,e){st()}scale(t,e,i){st()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return st()}getType(){return st()}applyTransform(t){st()}intersectsExtent(t){return st()}translate(t,e){st()}transform(t,e){const i=Gt(t),n=i.getUnits()=="tile-pixels"?function(o,a,h){const c=i.getExtent(),d=i.getWorldExtent(),f=ze(d)/ze(c);return Ne(jc,d[0],d[3],f,-f,0,0,0),tn(o,0,o.length,h,jc,a),Ms(i,e)(o,a,h)}:Ms(i,e);return this.applyTransform(n),this}}const Wc=hm;class cm extends Wc{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates=null}computeExtent(t){return gc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return st()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const 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=Hc(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){st()}setLayout(t,e,i){let n;if(t)n=Hc(t);else{for(let o=0;o<i;++o){if(e.length===0){this.layout="XY",this.stride=2;return}e=e[0]}n=e.length,t=um(n)}this.layout=t,this.stride=n}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())}rotate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();Zc(i,0,i.length,n,t,e,i),this.changed()}}scale(t,e,i){e===void 0&&(e=t),i||(i=Ki(this.getExtent()));const n=this.getFlatCoordinates();if(n){const o=this.getStride();am(n,0,n.length,o,t,e,i,n),this.changed()}}translate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();lm(i,0,i.length,n,t,e,i),this.changed()}}}function um(r){let t;return r==2?t="XY":r==3?t="XYZ":r==4&&(t="XYZM"),t}function Hc(r){let t;return r=="XY"?t=2:r=="XYZ"||r=="XYM"?t=3:r=="XYZM"&&(t=4),t}function dm(r,t,e){const i=r.getFlatCoordinates();if(!i)return null;const n=r.getStride();return tn(i,0,i.length,n,t,e)}const en=cm;function Vc(r,t,e,i,n,o,a){const h=r[t],c=r[t+1],d=r[e]-h,f=r[e+1]-c;let _;if(d===0&&f===0)_=t;else{const m=((n-h)*d+(o-c)*f)/(d*d+f*f);if(m>1)_=e;else if(m>0){for(let E=0;E<i;++E)a[E]=_e(r[t+E],r[e+E],m);a.length=i;return}else _=t}for(let m=0;m<i;++m)a[m]=r[_+m];a.length=i}function Ma(r,t,e,i,n){let o=r[t],a=r[t+1];for(t+=i;t<e;t+=i){const h=r[t],c=r[t+1],d=$i(o,a,h,c);d>n&&(n=d),o=h,a=c}return n}function Ia(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o){const h=e[o];n=Ma(r,t,h,i,n),t=h}return n}function fm(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o){const h=e[o];n=Ia(r,t,h,i,n),t=h[h.length-1]}return n}function Aa(r,t,e,i,n,o,a,h,c,d,f){if(t==e)return d;let _,m;if(n===0){if(m=$i(a,h,r[t],r[t+1]),m<d){for(_=0;_<i;++_)c[_]=r[t+_];return c.length=i,m}return d}f=f||[NaN,NaN];let E=t+i;for(;E<e;)if(Vc(r,E-i,E,i,a,h,f),m=$i(a,h,f[0],f[1]),m<d){for(d=m,_=0;_<i;++_)c[_]=f[_];c.length=i,E+=i}else E+=i*Math.max((Math.sqrt(m)-Math.sqrt(d))/n|0,1);if(o&&(Vc(r,e-i,t,i,a,h,f),m=$i(a,h,f[0],f[1]),m<d)){for(d=m,_=0;_<i;++_)c[_]=f[_];c.length=i}return d}function Da(r,t,e,i,n,o,a,h,c,d,f){f=f||[NaN,NaN];for(let _=0,m=e.length;_<m;++_){const E=e[_];d=Aa(r,t,E,i,n,o,a,h,c,d,f),t=E}return d}function gm(r,t,e,i,n,o,a,h,c,d,f){f=f||[NaN,NaN];for(let _=0,m=e.length;_<m;++_){const E=e[_];d=Da(r,t,E,i,n,o,a,h,c,d,f),t=E[E.length-1]}return d}function _m(r,t,e,i){for(let n=0,o=e.length;n<o;++n)r[t++]=e[n];return t}function As(r,t,e,i){for(let n=0,o=e.length;n<o;++n){const a=e[n];for(let h=0;h<i;++h)r[t++]=a[h]}return t}function Oa(r,t,e,i,n){n=n||[];let o=0;for(let a=0,h=e.length;a<h;++a){const c=As(r,t,e[a],i);n[o++]=c,t=c}return n.length=o,n}function pm(r,t,e,i,n){n=n||[];let o=0;for(let a=0,h=e.length;a<h;++a){const c=Oa(r,t,e[a],i,n[o]);c.length===0&&(c[0]=t),n[o++]=c,t=c[c.length-1]}return n.length=o,n}function Fa(r,t,e,i,n,o,a){const h=(e-t)/i;if(h<3){for(;t<e;t+=i)o[a++]=r[t],o[a++]=r[t+1];return a}const c=new Array(h);c[0]=1,c[h-1]=1;const d=[t,e-i];let f=0;for(;d.length>0;){const _=d.pop(),m=d.pop();let E=0;const v=r[m],b=r[m+1],C=r[_],S=r[_+1];for(let y=m+i;y<_;y+=i){const x=r[y],T=r[y+1],k=Op(x,T,v,b,C,S);k>E&&(f=y,E=k)}E>n&&(c[(f-t)/i]=1,m+i<f&&d.push(m,f),f+i<_&&d.push(f,_))}for(let _=0;_<h;++_)c[_]&&(o[a++]=r[t+_*i],o[a++]=r[t+_*i+1]);return a}function mm(r,t,e,i,n,o,a,h){for(let c=0,d=e.length;c<d;++c){const f=e[c];a=Fa(r,t,f,i,n,o,a),h.push(a),t=f}return a}function nn(r,t){return t*Math.round(r/t)}function ym(r,t,e,i,n,o,a){if(t==e)return a;let h=nn(r[t],n),c=nn(r[t+1],n);t+=i,o[a++]=h,o[a++]=c;let d,f;do if(d=nn(r[t],n),f=nn(r[t+1],n),t+=i,t==e)return o[a++]=d,o[a++]=f,a;while(d==h&&f==c);for(;t<e;){const _=nn(r[t],n),m=nn(r[t+1],n);if(t+=i,_==d&&m==f)continue;const E=d-h,v=f-c,b=_-h,C=m-c;if(E*C==v*b&&(E<0&&b<E||E==b||E>0&&b>E)&&(v<0&&C<v||v==C||v>0&&C>v)){d=_,f=m;continue}o[a++]=d,o[a++]=f,h=d,c=f,d=_,f=m}return o[a++]=d,o[a++]=f,a}function Xc(r,t,e,i,n,o,a,h){for(let c=0,d=e.length;c<d;++c){const f=e[c];a=ym(r,t,f,i,n,o,a),h.push(a),t=f}return a}function vm(r,t,e,i,n,o,a,h){for(let c=0,d=e.length;c<d;++c){const f=e[c],_=[];a=Xc(r,t,f,i,n,o,a,_),h.push(_),t=f[f.length-1]}return a}function Li(r,t,e,i,n){n=n!==void 0?n:[];let o=0;for(let a=t;a<e;a+=i)n[o++]=r.slice(a,a+i);return n.length=o,n}function pr(r,t,e,i,n){n=n!==void 0?n:[];let o=0;for(let a=0,h=e.length;a<h;++a){const c=e[a];n[o++]=Li(r,t,c,i,n[o]),t=c}return n.length=o,n}function za(r,t,e,i,n){n=n!==void 0?n:[];let o=0;for(let a=0,h=e.length;a<h;++a){const c=e[a];n[o++]=c.length===1&&c[0]===t?[]:pr(r,t,c,i,n[o]),t=c[c.length-1]}return n.length=o,n}function Yc(r,t,e,i){let n=0,o=r[e-i],a=r[e-i+1];for(;t<e;t+=i){const h=r[t],c=r[t+1];n+=a*h-o*c,o=h,a=c}return n/2}function Kc(r,t,e,i){let n=0;for(let o=0,a=e.length;o<a;++o){const h=e[o];n+=Yc(r,t,h,i),t=h}return n}function xm(r,t,e,i){let n=0;for(let o=0,a=e.length;o<a;++o){const h=e[o];n+=Kc(r,t,h,i),t=h[h.length-1]}return n}class Ds extends en{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 Ds(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,n){return n<Xi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ma(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Aa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))}getArea(){return Yc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Li(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=Fa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new Ds(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=As(this.flatCoordinates,0,t,this.stride),this.changed()}}const qc=Ds;class Na extends en{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new Na(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){const o=this.flatCoordinates,a=$i(t,e,o[0],o[1]);if(a<n){const h=this.stride;for(let c=0;c<h;++c)i[c]=o[c];return i.length=h,a}return n}getCoordinates(){return this.flatCoordinates?this.flatCoordinates.slice():[]}computeExtent(t){return kp(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return _a(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=_m(this.flatCoordinates,0,t,this.stride),this.changed()}}const Os=Na;function Em(r,t,e,i,n){return!mc(n,function(a){return!rn(r,t,e,i,a[0],a[1])})}function rn(r,t,e,i,n,o){let a=0,h=r[e-i],c=r[e-i+1];for(;t<e;t+=i){const d=r[t],f=r[t+1];c<=o?f>o&&(d-h)*(o-c)-(n-h)*(f-c)>0&&a++:f<=o&&(d-h)*(o-c)-(n-h)*(f-c)<0&&a--,h=d,c=f}return a!==0}function Ba(r,t,e,i,n,o){if(e.length===0||!rn(r,t,e[0],i,n,o))return!1;for(let a=1,h=e.length;a<h;++a)if(rn(r,e[a-1],e[a],i,n,o))return!1;return!0}function wm(r,t,e,i,n,o){if(e.length===0)return!1;for(let a=0,h=e.length;a<h;++a){const c=e[a];if(Ba(r,t,c,i,n,o))return!0;t=c[c.length-1]}return!1}function $c(r,t,e,i,n,o,a){let h,c,d,f,_,m,E;const v=n[o+1],b=[];for(let y=0,x=e.length;y<x;++y){const T=e[y];for(f=r[T-i],m=r[T-i+1],h=t;h<T;h+=i)_=r[h],E=r[h+1],(v<=m&&E<=v||m<=v&&v<=E)&&(d=(v-m)/(E-m)*(_-f)+f,b.push(d)),f=_,m=E}let C=NaN,S=-1/0;for(b.sort(xi),f=b[0],h=1,c=b.length;h<c;++h){_=b[h];const y=Math.abs(_-f);y>S&&(d=(f+_)/2,Ba(r,t,e,i,d,v)&&(C=d,S=y)),f=_}return isNaN(C)&&(C=n[o]),a?(a.push(C,v,S),a):[C,v,S]}function Lm(r,t,e,i,n){let o=[];for(let a=0,h=e.length;a<h;++a){const c=e[a];o=$c(r,t,c,i,n,2*a,o),t=c[c.length-1]}return o}function Jc(r,t,e,i,n){let o;for(t+=i;t<e;t+=i)if(o=n(r.slice(t-i,t),r.slice(t,t+i)),o)return o;return!1}function Fs(r,t,e,i,n){const o=pc(ge(),r,t,e,i);return se(n,o)?Yi(n,o)||o[0]>=n[0]&&o[2]<=n[2]||o[1]>=n[1]&&o[3]<=n[3]?!0:Jc(r,t,e,i,function(a,h){return Ap(n,a,h)}):!1}function bm(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o){if(Fs(r,t,e[o],i,n))return!0;t=e[o]}return!1}function Qc(r,t,e,i,n){return!!(Fs(r,t,e,i,n)||rn(r,t,e,i,n[0],n[1])||rn(r,t,e,i,n[0],n[3])||rn(r,t,e,i,n[2],n[1])||rn(r,t,e,i,n[2],n[3]))}function tu(r,t,e,i,n){if(!Qc(r,t,e[0],i,n))return!1;if(e.length===1)return!0;for(let o=1,a=e.length;o<a;++o)if(Em(r,e[o-1],e[o],i,n)&&!Fs(r,e[o-1],e[o],i,n))return!1;return!0}function Tm(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o){const h=e[o];if(tu(r,t,h,i,n))return!0;t=h[h.length-1]}return!1}function Cm(r,t,e,i){for(;t<e-i;){for(let n=0;n<i;++n){const o=r[t+n];r[t+n]=r[e-i+n],r[e-i+n]=o}t+=i,e-=i}}function eu(r,t,e,i){let n=0,o=r[e-i],a=r[e-i+1];for(;t<e;t+=i){const h=r[t],c=r[t+1];n+=(h-o)*(c+a),o=h,a=c}return n===0?void 0:n>0}function iu(r,t,e,i,n){n=n!==void 0?n:!1;for(let o=0,a=e.length;o<a;++o){const h=e[o],c=eu(r,t,h,i);if(o===0){if(n&&c||!n&&!c)return!1}else if(n&&!c||!n&&c)return!1;t=h}return!0}function Sm(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o){const h=e[o];if(!iu(r,t,h,i,n))return!1;h.length&&(t=h[h.length-1])}return!0}function Ga(r,t,e,i,n){n=n!==void 0?n:!1;for(let o=0,a=e.length;o<a;++o){const h=e[o],c=eu(r,t,h,i);(o===0?n&&c||!n&&!c:n&&!c||!n&&c)&&Cm(r,t,h,i),t=h}return t}function nu(r,t,e,i,n){for(let o=0,a=e.length;o<a;++o)t=Ga(r,t,e[o],i,n);return t}class mr extends en{constructor(t,e,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,e!==void 0&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?ti(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new mr(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Xi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ia(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Da(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return Ba(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return Kc(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),Ga(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,pr(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Ki(this.getExtent());this.flatInteriorPoint_=$c(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Os(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new qc(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[];let o=0;for(let a=0,h=i.length;a<h;++a){const c=i[a],d=new qc(e.slice(o,c),t);n.push(d),o=c}return n}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;iu(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ga(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=Xc(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i),new mr(e,"XY",i)}getType(){return"Polygon"}intersectsExtent(t){return tu(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Oa(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}const zs=mr;function ru(r){if(Cs(r))throw new Error("Cannot create polygon from empty extent");const t=r[0],e=r[1],i=r[2],n=r[3],o=[t,e,t,n,i,n,i,e,t,e];return new mr(o,"XY",[o.length])}const Ua=0;class Pm extends be{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=ba(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&&Lc(),t.center&&(t.center=ii(t.center,this.projection_)),t.extent&&(t.extent=Qi(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const h in Te)delete e[h];this.setProperties(e,!0);const i=Rm(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=i.minZoom;const n=km(t),o=i.constraint,a=Mm(t);this.constraints_={center:n,resolution:o,rotation:a},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 i=this.getCenterInternal();if(i){const n=t||[0,0,0,0];e=e||[0,0,0,0];const o=this.getResolution(),a=o/2*(n[3]-e[3]+e[1]-n[1]),h=o/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([i[0]+a,i[1]-h])}}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 i=0;i<e.length;++i){let n=arguments[i];n.center&&(n=Object.assign({},n),n.center=ii(n.center,this.getProjection())),n.anchor&&(n=Object.assign({},n),n.anchor=ii(n.anchor,this.getProjection())),e[i]=n}this.animateInternal.apply(this,e)}animateInternal(t){let e=arguments.length,i;e>1&&typeof arguments[e-1]=="function"&&(i=arguments[e-1],--e);let n=0;for(;n<e&&!this.isDef();++n){const f=arguments[n];f.center&&this.setCenterInternal(f.center),f.zoom!==void 0?this.setZoom(f.zoom):f.resolution&&this.setResolution(f.resolution),f.rotation!==void 0&&this.setRotation(f.rotation)}if(n===e){i&&Ns(i,!0);return}let o=Date.now(),a=this.targetCenter_.slice(),h=this.targetResolution_,c=this.targetRotation_;const d=[];for(;n<e;++n){const f=arguments[n],_={start:o,complete:!1,anchor:f.anchor,duration:f.duration!==void 0?f.duration:1e3,easing:f.easing||$p,callback:i};if(f.center&&(_.sourceCenter=a,_.targetCenter=f.center.slice(),a=_.targetCenter),f.zoom!==void 0?(_.sourceResolution=h,_.targetResolution=this.getResolutionForZoom(f.zoom),h=_.targetResolution):f.resolution&&(_.sourceResolution=h,_.targetResolution=f.resolution,h=_.targetResolution),f.rotation!==void 0){_.sourceRotation=c;const m=Sn(f.rotation-c+Math.PI,2*Math.PI)-Math.PI;_.targetRotation=c+m,c=_.targetRotation}Im(_)?_.complete=!0:o+=_.duration,d.push(_)}this.animations_.push(d),this.setHint(Ut.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[Ut.ANIMATING]>0}getInteracting(){return this.hints_[Ut.INTERACTING]>0}cancelAnimations(){this.setHint(Ut.ANIMATING,-this.hints_[Ut.ANIMATING]);let t;for(let e=0,i=this.animations_.length;e<i;++e){const n=this.animations_[e];if(n[0].callback&&Ns(n[0].callback,!1),!t)for(let o=0,a=n.length;o<a;++o){const h=n[o];if(!h.complete){t=h.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 i=this.animations_.length-1;i>=0;--i){const n=this.animations_[i];let o=!0;for(let a=0,h=n.length;a<h;++a){const c=n[a];if(c.complete)continue;const d=t-c.start;let f=c.duration>0?d/c.duration:1;f>=1?(c.complete=!0,f=1):o=!1;const _=c.easing(f);if(c.sourceCenter){const m=c.sourceCenter[0],E=c.sourceCenter[1],v=c.targetCenter[0],b=c.targetCenter[1];this.nextCenter_=c.targetCenter;const C=m+_*(v-m),S=E+_*(b-E);this.targetCenter_=[C,S]}if(c.sourceResolution&&c.targetResolution){const m=_===1?c.targetResolution:c.sourceResolution+_*(c.targetResolution-c.sourceResolution);if(c.anchor){const E=this.getViewportSize_(this.getRotation()),v=this.constraints_.resolution(m,0,E,!0);this.targetCenter_=this.calculateCenterZoom(v,c.anchor)}this.nextResolution_=c.targetResolution,this.targetResolution_=m,this.applyTargetState_(!0)}if(c.sourceRotation!==void 0&&c.targetRotation!==void 0){const m=_===1?Sn(c.targetRotation+Math.PI,2*Math.PI)-Math.PI:c.sourceRotation+_*(c.targetRotation-c.sourceRotation);if(c.anchor){const E=this.constraints_.rotation(m,!0);this.targetCenter_=this.calculateCenterRotate(E,c.anchor)}this.nextRotation_=c.targetRotation,this.targetRotation_=m}if(this.applyTargetState_(!0),e=!0,!c.complete)break}if(o){this.animations_[i]=null,this.setHint(Ut.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const a=n[0].callback;a&&Ns(a,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i;const n=this.getCenterInternal();return n!==void 0&&(i=[n[0]-e[0],n[1]-e[1]],Ea(i,t-this.getRotation()),zp(i,e)),i}calculateCenterZoom(t,e){let i;const n=this.getCenterInternal(),o=this.getResolution();if(n!==void 0&&o!==void 0){const a=e[0]-t*(e[0]-n[0])/o,h=e[1]-t*(e[1]-n[1])/o;i=[a,h]}return i}getViewportSize_(t){const e=this.viewportSize_;if(t){const i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*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&&Ca(t,this.getProjection())}getCenterInternal(){return this.get(Te.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 kc(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();gt(e,"The view center is not defined");const i=this.getResolution();gt(i!==void 0,"The view resolution is not defined");const n=this.getRotation();return gt(n!==void 0,"The view rotation is not defined"),ya(e,i,n,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(Te.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(Qi(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const i=Tt(t)/e[0],n=ze(t)/e[1];return Math.max(i,n)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(e/i)/Math.log(t);return function(o){return e/Math.pow(t,o*n)}}getRotation(){return this.get(Te.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,o=Math.log(i/n)/e;return function(a){return Math.log(i/a)/e/o}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),i=this.getRotation();let n=this.getCenterInternal();const o=this.padding_;if(o){const a=this.getViewportSizeMinusPadding_();n=Za(n,this.getViewportSize_(),[a[0]/2+o[3],a[1]/2+o[0]],e,i)}return{center:n.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,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,i,n;if(this.resolutions_){const o=da(this.resolutions_,t,1);e=o,i=this.resolutions_[o],o==this.resolutions_.length-1?n=2:n=i/this.resolutions_[o+1]}else i=this.maxResolution_,n=this.zoomFactor_;return e+Math.log(i/t)/Math.log(n)}getResolutionForZoom(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;const e=It(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,It(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if(gt(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){gt(!Cs(t),"Cannot fit empty extent provided as `geometry`");const n=Qi(t,this.getProjection());i=ru(n)}else if(t.getType()==="Circle"){const n=Qi(t.getExtent(),this.getProjection());i=ru(n),i.rotate(this.getRotation(),Ki(n))}else i=t;this.fitInternal(i,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),i=Math.cos(e),n=Math.sin(-e),o=t.getFlatCoordinates(),a=t.getStride();let h=1/0,c=1/0,d=-1/0,f=-1/0;for(let _=0,m=o.length;_<m;_+=a){const E=o[_]*i-o[_+1]*n,v=o[_]*n+o[_+1]*i;h=Math.min(h,E),c=Math.min(c,v),d=Math.max(d,E),f=Math.max(f,v)}return[h,c,d,f]}fitInternal(t,e){e=e||{};let i=e.size;i||(i=this.getViewportSizeMinusPadding_());const n=e.padding!==void 0?e.padding:[0,0,0,0],o=e.nearest!==void 0?e.nearest:!1;let a;e.minResolution!==void 0?a=e.minResolution:e.maxZoom!==void 0?a=this.getResolutionForZoom(e.maxZoom):a=0;const h=this.rotatedExtentForGeometry(t);let c=this.getResolutionForExtentInternal(h,[i[0]-n[1]-n[3],i[1]-n[0]-n[2]]);c=isNaN(c)?a:Math.max(c,a),c=this.getConstrainedResolution(c,o?0:1);const d=this.getRotation(),f=Math.sin(d),_=Math.cos(d),m=Ki(h);m[0]+=(n[1]-n[3])/2*c,m[1]+=(n[0]-n[2])/2*c;const E=m[0]*_-m[1]*f,v=m[1]*_+m[0]*f,b=this.getConstrainedCenter([E,v],c),C=e.callback?e.callback:xn;e.duration!==void 0?this.animateInternal({resolution:c,center:b,duration:e.duration,easing:e.easing},C):(this.targetResolution_=c,this.targetCenter_=b,this.applyTargetState_(!1,!0),Ns(C,!0))}centerOn(t,e,i){this.centerOnInternal(ii(t,this.getProjection()),e,i)}centerOnInternal(t,e,i){this.setCenterInternal(Za(t,e,i,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,i,n){let o;const a=this.padding_;if(a&&t){const h=this.getViewportSizeMinusPadding_(-i),c=Za(t,n,[h[0]/2+a[3],h[1]/2+a[0]],e,i);o=[t[0]-c[0],t[1]-c[1]]}return o}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(t){const e=Ca(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&&ii(e,this.getProjection()),this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){const i=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),o=this.constraints_.resolution(this.targetResolution_*t,0,n,i);e&&(this.targetCenter_=this.calculateCenterZoom(o,e)),this.targetResolution_*=t,this.applyTargetState_()}adjustZoom(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)}adjustRotation(t,e){e&&(e=ii(e,this.getProjection())),this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){const i=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t&&ii(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 i=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,i),o=this.getViewportSize_(n),a=this.constraints_.resolution(this.targetResolution_,0,o,i),h=this.constraints_.center(this.targetCenter_,a,o,i,this.calculateCenterShift(this.targetCenter_,a,n,o));this.get(Te.ROTATION)!==n&&this.set(Te.ROTATION,n),this.get(Te.RESOLUTION)!==a&&(this.set(Te.RESOLUTION,a),this.set("zoom",this.getZoom(),!0)),(!h||!this.get(Te.CENTER)||!Rs(this.get(Te.CENTER),h))&&this.set(Te.CENTER,h),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(t,e,i){t=t!==void 0?t:200;const n=e||0,o=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(o),h=this.constraints_.resolution(this.targetResolution_,n,a),c=this.constraints_.center(this.targetCenter_,h,a,!1,this.calculateCenterShift(this.targetCenter_,h,o,a));if(t===0&&!this.cancelAnchor_){this.targetResolution_=h,this.targetRotation_=o,this.targetCenter_=c,this.applyTargetState_();return}i=i||(t===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==h||this.getRotation()!==o||!this.getCenterInternal()||!Rs(this.getCenterInternal(),c))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:c,resolution:h,duration:t,easing:Pn,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(Ut.INTERACTING,1)}endInteraction(t,e,i){i=i&&ii(i,this.getProjection()),this.endInteractionInternal(t,e,i)}endInteractionInternal(t,e,i){this.getInteracting()&&(this.setHint(Ut.INTERACTING,-1),this.resolveConstraints(t,e,i))}getConstrainedCenter(t,e){const i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)}getConstrainedZoom(t,e){const i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))}getConstrainedResolution(t,e){e=e||0;const i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,i)}}function Ns(r,t){setTimeout(function(){r(t)},0)}function km(r){if(r.extent!==void 0){const e=r.smoothExtentConstraint!==void 0?r.smoothExtentConstraint:!0;return Rc(r.extent,r.constrainOnlyCenter,e)}const t=ba(r.projection,"EPSG:3857");if(r.multiWorld!==!0&&t.isGlobal()){const e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,Rc(e,!1,!1)}return Vp}function Rm(r){let t,e,i,a=r.minZoom!==void 0?r.minZoom:Ua,h=r.maxZoom!==void 0?r.maxZoom:28;const c=r.zoomFactor!==void 0?r.zoomFactor:2,d=r.multiWorld!==void 0?r.multiWorld:!1,f=r.smoothResolutionConstraint!==void 0?r.smoothResolutionConstraint:!0,_=r.showFullExtent!==void 0?r.showFullExtent:!1,m=ba(r.projection,"EPSG:3857"),E=m.getExtent();let v=r.constrainOnlyCenter,b=r.extent;if(!d&&!b&&m.isGlobal()&&(v=!1,b=E),r.resolutions!==void 0){const C=r.resolutions;e=C[a],i=C[h]!==void 0?C[h]:C[C.length-1],r.constrainResolution?t=Xp(C,f,!v&&b,_):t=Mc(e,i,f,!v&&b,_)}else{const S=(E?Math.max(Tt(E),ze(E)):360*ur.degrees/m.getMetersPerUnit())/fa/Math.pow(2,Ua),y=S/Math.pow(2,28-Ua);e=r.maxResolution,e!==void 0?a=0:e=S/Math.pow(c,a),i=r.minResolution,i===void 0&&(r.maxZoom!==void 0?r.maxResolution!==void 0?i=e/Math.pow(c,h):i=S/Math.pow(c,h):i=y),h=a+Math.floor(Math.log(e/i)/Math.log(c)),i=e/Math.pow(c,h-a),r.constrainResolution?t=Yp(c,e,i,f,!v&&b,_):t=Mc(e,i,f,!v&&b,_)}return{constraint:t,maxResolution:e,minResolution:i,minZoom:a,zoomFactor:c}}function Mm(r){if(r.enableRotation!==void 0?r.enableRotation:!0){const e=r.constrainRotation;return e===void 0||e===!0?qp():e===!1?Ic:typeof e=="number"?Kp(e):Ic}return ka}function Im(r){return!(r.sourceCenter&&r.targetCenter&&!Rs(r.sourceCenter,r.targetCenter)||r.sourceResolution!==r.targetResolution||r.sourceRotation!==r.targetRotation)}function Za(r,t,e,i,n){const o=Math.cos(-n);let a=Math.sin(-n),h=r[0]*o-r[1]*a,c=r[1]*o+r[0]*a;h+=(t[0]/2-e[0])*i,c+=(e[1]-t[1]/2)*i,a=-a;const d=h*o-c*a,f=c*o+h*a;return[d,f]}const Be=Pm,oe={ADD:"add",REMOVE:"remove"},su={LENGTH:"length"};class Bs extends Qe{constructor(t,e,i){super(t),this.element=e,this.index=i}}class Am extends be{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let i=0,n=this.array_.length;i<n;++i)this.assertUnique_(this.array_[i],i);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,i=t.length;e<i;++e)this.push(t[e]);return this}forEach(t){const e=this.array_;for(let i=0,n=e.length;i<n;++i)t(e[i],i,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(su.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 Bs(oe.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let i=0,n=e.length;i<n;++i)if(e[i]===t)return this.removeAt(i)}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 Bs(oe.REMOVE,e,t)),e}setAt(t,e){const i=this.getLength();if(t>=i){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Bs(oe.REMOVE,n,t)),this.dispatchEvent(new Bs(oe.ADD,e,t))}updateLength_(){this.set(su.LENGTH,this.array_.length)}assertUnique_(t,e){for(let i=0,n=this.array_.length;i<n;++i)if(this.array_[i]===t&&i!==e)throw new Error("Duplicate item added to a unique collection")}}const Ge=Am,Dm=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Om=/^([a-z]*)$|^hsla?\(.*\)$/i;function ou(r){return typeof r=="string"?r:lu(r)}function Fm(r){const t=document.createElement("div");if(t.style.color=r,t.style.color!==""){document.body.appendChild(t);const e=getComputedStyle(t).color;return document.body.removeChild(t),e}return""}const zm=function(){const t={};let e=0;return function(i){let n;if(t.hasOwnProperty(i))n=t[i];else{if(e>=1024){let o=0;for(const a in t)o++&3||(delete t[a],--e)}n=Nm(i),t[i]=n,++e}return n}}();function yr(r){return Array.isArray(r)?r:zm(r)}function Nm(r){let t,e,i,n,o;if(Om.exec(r)&&(r=Fm(r)),Dm.exec(r)){const a=r.length-1;let h;a<=4?h=1:h=2;const c=a===4||a===8;t=parseInt(r.substr(1+0*h,h),16),e=parseInt(r.substr(1+1*h,h),16),i=parseInt(r.substr(1+2*h,h),16),c?n=parseInt(r.substr(1+3*h,h),16):n=255,h==1&&(t=(t<<4)+t,e=(e<<4)+e,i=(i<<4)+i,c&&(n=(n<<4)+n)),o=[t,e,i,n/255]}else if(r.startsWith("rgba("))o=r.slice(5,-1).split(",").map(Number),au(o);else if(r.startsWith("rgb("))o=r.slice(4,-1).split(",").map(Number),o.push(1),au(o);else throw new Error("Invalid color");return o}function au(r){return r[0]=It(r[0]+.5|0,0,255),r[1]=It(r[1]+.5|0,0,255),r[2]=It(r[2]+.5|0,0,255),r[3]=It(r[3],0,1),r}function lu(r){let t=r[0];t!=(t|0)&&(t=t+.5|0);let e=r[1];e!=(e|0)&&(e=e+.5|0);let i=r[2];i!=(i|0)&&(i=i+.5|0);const n=r[3]===void 0?1:Math.round(r[3]*100)/100;return"rgba("+t+","+e+","+i+","+n+")"}class Bm{constructor(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const i=this.cache_[e];!(t++&3)&&!i.hasListener()&&(delete this.cache_[e],--this.cacheSize_)}}}get(t,e,i){const n=hu(t,e,i);return n in this.cache_?this.cache_[n]:null}set(t,e,i,n){const o=hu(t,e,i);this.cache_[o]=n,++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function hu(r,t,e){const i=e?ou(e):"null";return t+":"+r+":"+i}const Gs=new Bm,xt={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 Gm extends be{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[xt.OPACITY]=t.opacity!==void 0?t.opacity:1,gt(typeof e[xt.OPACITY]=="number","Layer opacity must be a number"),e[xt.VISIBLE]=t.visible!==void 0?t.visible:!0,e[xt.Z_INDEX]=t.zIndex,e[xt.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[xt.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[xt.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[xt.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},i=this.getZIndex();return e.opacity=It(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=i===void 0&&!e.managed?1/0:i,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 st()}getLayerStatesArray(t){return st()}getExtent(){return this.get(xt.EXTENT)}getMaxResolution(){return this.get(xt.MAX_RESOLUTION)}getMinResolution(){return this.get(xt.MIN_RESOLUTION)}getMinZoom(){return this.get(xt.MIN_ZOOM)}getMaxZoom(){return this.get(xt.MAX_ZOOM)}getOpacity(){return this.get(xt.OPACITY)}getSourceState(){return st()}getVisible(){return this.get(xt.VISIBLE)}getZIndex(){return this.get(xt.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(xt.EXTENT,t)}setMaxResolution(t){this.set(xt.MAX_RESOLUTION,t)}setMinResolution(t){this.set(xt.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(xt.MAX_ZOOM,t)}setMinZoom(t){this.set(xt.MIN_ZOOM,t)}setOpacity(t){gt(typeof t=="number","Layer opacity must be a number"),this.set(xt.OPACITY,t)}setVisible(t){this.set(xt.VISIBLE,t)}setZIndex(t){this.set(xt.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const cu=Gm,qt={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class Um extends cu{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(xt.SOURCE,this.handleSourcePropertyChange_);const i=t.source?t.source:null;this.setSource(i)}getLayersArray(t){return t=t||[],t.push(this),t}getLayerStatesArray(t){return t=t||[],t.push(this.getLayerState()),t}getSource(){return this.get(xt.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_&&(wt(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=ut(t,at.CHANGE,this.handleSourceChange_,this),t.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e;const i=this.getMapInternal();!t&&i&&(t=i.getView()),t instanceof Be?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let n;e.layerStatesArray?n=e.layerStatesArray.find(a=>a.layer===this):n=this.getLayerState();const o=this.getExtent();return ja(n,e.viewState)&&(!o||se(o,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];let e;const i=this.getSource();if(i&&(e=i.getAttributions()),!e)return[];const n=t instanceof Be?t.getViewStateAndExtent():t;let o=e(n);return Array.isArray(o)||(o=[o]),o}render(t,e){const i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}setMapInternal(t){t||this.unrender(),this.set(xt.MAP,t)}getMapInternal(){return this.get(xt.MAP)}setMap(t){this.mapPrecomposeKey_&&(wt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(wt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=ut(t,qt.PRECOMPOSE,function(e){const n=e.frameState.layerStatesArray,o=this.getLayerState(!1);gt(!n.some(function(a){return a.layer===o.layer}),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),n.push(o)},this),this.mapRenderKey_=ut(this,at.CHANGE,t.render,t),this.changed())}setSource(t){this.set(xt.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function ja(r,t){if(!r.visible)return!1;const e=t.resolution;if(e<r.minResolution||e>=r.maxResolution)return!1;const i=t.zoom;return i>r.minZoom&&i<=r.maxZoom}const Us=Um;class Zm extends gs{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){st()}calculateMatrices2D(t){const e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;Ne(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Is(n,i)}forEachFeatureAtCoordinate(t,e,i,n,o,a,h,c){let d;const f=e.viewState;function _(T,k,R,M){return o.call(a,k,T?R:null,M)}const m=f.projection,E=vc(t.slice(),m),v=[[0,0]];if(m.canWrapX()&&n){const T=m.getExtent(),k=Tt(T);v.push([-k,0],[k,0])}const b=e.layerStatesArray,C=b.length,S=[],y=[];for(let T=0;T<v.length;T++)for(let k=C-1;k>=0;--k){const R=b[k],M=R.layer;if(M.hasRenderer()&&ja(R,f)&&h.call(c,M)){const A=M.getRenderer(),z=M.getSource();if(A&&z){const U=z.getWrapX()?E:t,Z=_.bind(null,R.managed);y[0]=U[0]+v[T][0],y[1]=U[1]+v[T][1],d=A.forEachFeatureAtCoordinate(y,e,i,Z,S)}if(d)return d}}if(S.length===0)return;const x=1/S.length;return S.forEach((T,k)=>T.distanceSq+=k*x),S.sort((T,k)=>T.distanceSq-k.distanceSq),S.some(T=>d=T.callback(T.feature,T.layer,T.geometry)),d}hasFeatureAtCoordinate(t,e,i,n,o,a){return this.forEachFeatureAtCoordinate(t,e,i,n,cr,this,o,a)!==void 0}getMap(){return this.map_}renderFrame(t){st()}flushDeclutterItems(t){}scheduleExpireIconCache(t){Gs.canExpireCache()&&t.postRenderFunctions.push(jm)}}function jm(r,t){Gs.expire()}const Wm=Zm;class Hm extends Qe{constructor(t,e,i,n){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=n}}const vr=Hm,Zs="ol-hidden",Vm="ol-selectable",xr="ol-unselectable",uu="ol-unsupported",js="ol-control",du="ol-collapsed",Xm=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-z]+?)\\s*$`].join(""),"i"),fu=["style","variant","weight","size","lineHeight","family"],gu=function(r){const t=r.match(Xm);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,n=fu.length;i<n;++i){const o=t[i+1];o!==void 0&&(e[fu[i]]=o)}return e.families=e.family.split(/,\s?/),e};function $t(r,t,e,i){let n;return e&&e.length?n=e.shift():Ra?n=new OffscreenCanvas(r||300,t||300):n=document.createElement("canvas"),r&&(n.width=r),t&&(n.height=t),n.getContext("2d",i)}function Ws(r){const t=r.canvas;t.width=1,t.height=1,r.clearRect(0,0,1,1)}function Ym(r){let t=r.offsetWidth;const e=getComputedStyle(r);return t+=parseInt(e.marginLeft,10)+parseInt(e.marginRight,10),t}function Km(r){let t=r.offsetHeight;const e=getComputedStyle(r);return t+=parseInt(e.marginTop,10)+parseInt(e.marginBottom,10),t}function Hs(r,t){const e=t.parentNode;e&&e.replaceChild(r,t)}function Vs(r){return r&&r.parentNode?r.parentNode.removeChild(r):null}function _u(r){for(;r.lastChild;)r.removeChild(r.lastChild)}function qm(r,t){const e=r.childNodes;for(let i=0;;++i){const n=e[i],o=t[i];if(!n&&!o)break;if(n!==o){if(!n){r.appendChild(o);continue}if(!o){r.removeChild(n),--i;continue}r.insertBefore(o,n)}}}const pu="10px sans-serif",ae="#000",kn="round",ni=[],ri=0,Rn="round",Er=10,wr="#000",Lr="center",Xs="middle",sn=[0,0,0,0],br=1,si=new be;let Mn=null,Wa;const Ha={},$m=function(){const t="32px ",e=["monospace","serif"],i=e.length,n="wmytzilWMYTZIL@#/&?$%10";let o,a;function h(d,f,_){let m=!0;for(let E=0;E<i;++E){const v=e[E];if(a=Ys(d+" "+f+" "+t+v,n),_!=v){const b=Ys(d+" "+f+" "+t+_+","+v,n);m=m&&b!=a}}return!!m}function c(){let d=!0;const f=si.getKeys();for(let _=0,m=f.length;_<m;++_){const E=f[_];si.get(E)<100&&(h.apply(this,E.split(`
18
+ `))?(En(Ha),Mn=null,Wa=void 0,si.set(E,100)):(si.set(E,si.get(E)+1,!0),d=!1))}d&&(clearInterval(o),o=void 0)}return function(d){const f=gu(d);if(!f)return;const _=f.families;for(let m=0,E=_.length;m<E;++m){const v=_[m],b=f.style+`
19
19
  `+f.weight+`
20
- `+y;si.get(E)===void 0&&(si.set(E,100,!0),h(f.style,f.weight,y)||(si.set(E,0,!0),o===void 0&&(o=setInterval(c,32))))}}}(),py=function(){let r;return function(t){let e=Qa[t];if(e==null){if(Na){const i=Cu(t),n=ku(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else r||(r=document.createElement("div"),r.innerHTML="M",r.style.minHeight="0",r.style.maxHeight="none",r.style.height="auto",r.style.padding="0",r.style.border="none",r.style.position="absolute",r.style.display="block",r.style.left="-99999px"),r.style.font=t,document.body.appendChild(r),e=r.offsetHeight,document.body.removeChild(r);Qa[t]=e}return e}}();function ku(r,t){return An||(An=$t(1,1)),r!=Ja&&(An.font=r,Ja=An.font),An.measureText(t)}function io(r,t){return ku(r,t).width}function Ru(r,t,e){if(t in e)return e[t];const i=t.split(`
21
- `).reduce((n,o)=>Math.max(n,io(r,o)),0);return e[t]=i,i}function my(r,t){const e=[],i=[],n=[];let o=0,a=0,h=0,c=0;for(let d=0,f=t.length;d<=f;d+=2){const _=t[d];if(_===`
22
- `||d===f){o=Math.max(o,a),n.push(a),a=0,h+=c;continue}const m=t[d+1]||r.font,v=io(m,_);e.push(v),a+=v;const y=py(m);i.push(y),c=Math.max(c,y)}return{width:o,height:h,widths:e,heights:i,lineWidths:n}}function yy(r,t,e,i,n,o,a,h,c,d,f){r.save(),e!==1&&(r.globalAlpha*=e),t&&r.transform.apply(r,t),i.contextInstructions?(r.translate(c,d),r.scale(f[0],f[1]),vy(i,r)):f[0]<0||f[1]<0?(r.translate(c,d),r.scale(f[0],f[1]),r.drawImage(i,n,o,a,h,0,0,a,h)):r.drawImage(i,n,o,a,h,c,d,a*f[0],h*f[1]),r.restore()}function vy(r,t){const e=r.contextInstructions;for(let i=0,n=e.length;i<n;i+=2)Array.isArray(e[i+1])?t[e[i]].apply(t,e[i+1]):t[e[i]]=e[i+1]}class xy extends ly{constructor(t){super(t),this.fontChangeListenerKey_=ht(si,En.PROPERTYCHANGE,t.redrawText.bind(t)),this.element_=document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=Tr+" ol-layers";const i=t.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0,this.declutterLayers_=[]}dispatchRenderEvent(t,e){const i=this.getMap();if(i.hasListener(t)){const n=new br(t,void 0,e);i.dispatchEvent(n)}}disposeInternal(){wt(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),super.disposeInternal()}renderFrame(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(qt.PRECOMPOSE,t);const e=t.layerStatesArray.sort(function(a,h){return a.zIndex-h.zIndex}),i=t.viewState;this.children_.length=0;const n=this.declutterLayers_;n.length=0;let o=null;for(let a=0,h=e.length;a<h;++a){const c=e[a];t.layerIndex=a;const d=c.layer,f=d.getSourceState();if(!$a(c,i)||f!="ready"&&f!="undefined"){d.unrender();continue}const _=d.render(t,o);_&&(_!==o&&(this.children_.push(_),o=_),"getDeclutter"in d&&n.push(d))}this.flushDeclutterItems(t),gy(this.element_,this.children_),this.dispatchRenderEvent(qt.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}flushDeclutterItems(t){const e=this.declutterLayers_;for(let i=e.length-1;i>=0;--i)e[i].renderDeclutter(t);e.length=0}}const Ey=xy;class bi extends Qe{constructor(t,e){super(t),this.layer=e}}const tl={LAYERS:"layers"};class el extends wu{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let i=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(tl.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new Be(i.slice(),{unique:!0}):ft(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new Be(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(wt),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(ht(t,oe.ADD,this.handleLayersAdd_,this),ht(t,oe.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(wt);Ln(this.listenerKeys_);const e=t.getArray();for(let i=0,n=e.length;i<n;i++){const o=e[i];this.registerLayerListeners_(o),this.dispatchEvent(new bi("addlayer",o))}this.changed()}registerLayerListeners_(t){const e=[ht(t,En.PROPERTYCHANGE,this.handleLayerChange_,this),ht(t,rt.CHANGE,this.handleLayerChange_,this)];t instanceof el&&e.push(ht(t,"addlayer",this.handleLayerGroupAdd_,this),ht(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[at(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new bi("addlayer",t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new bi("removelayer",t.layer))}handleLayersAdd_(t){const e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new bi("addlayer",e)),this.changed()}handleLayersRemove_(t){const e=t.element,i=at(e);this.listenerKeys_[i].forEach(wt),delete this.listenerKeys_[i],this.dispatchEvent(new bi("removelayer",e)),this.changed()}getLayers(){return this.get(tl.LAYERS)}setLayers(t){const e=this.getLayers();if(e){const i=e.getArray();for(let n=0,o=i.length;n<o;++n)this.dispatchEvent(new bi("removelayer",i[n]))}this.set(tl.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:[],i=e.length;this.getLayers().forEach(function(a){a.getLayerStatesArray(e)});const n=this.getLayerState();let o=n.zIndex;!t&&n.zIndex===void 0&&(o=0);for(let a=i,h=e.length;a<h;a++){const c=e[a];c.opacity*=n.opacity,c.visible=c.visible&&n.visible,c.maxResolution=Math.min(c.maxResolution,n.maxResolution),c.minResolution=Math.max(c.minResolution,n.minResolution),c.minZoom=Math.max(c.minZoom,n.minZoom),c.maxZoom=Math.min(c.maxZoom,n.maxZoom),n.extent!==void 0&&(c.extent!==void 0?c.extent=xr(c.extent,n.extent):c.extent=n.extent),c.zIndex===void 0&&(c.zIndex=o)}return e}getSourceState(){return"ready"}}const no=el;class wy extends Qe{constructor(t,e,i){super(t),this.map=e,this.frameState=i!==void 0?i:null}}const Dn=wy;class Ly extends Dn{constructor(t,e,i,n,o,a){super(t,e,o),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=n!==void 0?n:!1,this.activePointers=a}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 Ti=Ly,Mt={SINGLECLICK:"singleclick",CLICK:rt.CLICK,DBLCLICK:rt.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},il={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};class by extends bs{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 i=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=ht(i,il.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=ht(i,il.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(rt.TOUCHMOVE,this.boundHandleTouchMove_,Kc?{passive:!1}:!1)}emulateClick_(t){let e=new Ti(Mt.CLICK,this.map_,t);this.dispatchEvent(e),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Ti(Mt.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const i=new Ti(Mt.SINGLECLICK,this.map_,t);this.dispatchEvent(i)},250)}updateActivePointers_(t){const e=t,i=e.pointerId;if(e.type==Mt.POINTERUP||e.type==Mt.POINTERCANCEL){delete this.trackedTouches_[i];for(const n in this.trackedTouches_)if(this.trackedTouches_[n].target!==e.target){delete this.trackedTouches_[n];break}}else(e.type==Mt.POINTERDOWN||e.type==Mt.POINTERMOVE)&&(this.trackedTouches_[i]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new Ti(Mt.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(wt),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 Ti(Mt.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 i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(ht(i,Mt.POINTERMOVE,this.handlePointerMove_,this),ht(i,Mt.POINTERUP,this.handlePointerUp_,this),ht(this.element_,Mt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(ht(this.element_.getRootNode(),Mt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new Ti(Mt.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 Ti(Mt.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_&&(wt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(rt.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(wt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(wt),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const Ty=by,oi={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},jt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},ro=1/0;class Cy{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Ln(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,i=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const n=this.keyFunction_(i);return delete this.queuedElements_[n],i}enqueue(t){ft(!(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!=ro?(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_,i=this.priorities_,n=e.length,o=e[t],a=i[t],h=t;for(;t<n>>1;){const c=this.getLeftChildIndex_(t),d=this.getRightChildIndex_(t),f=d<n&&i[d]<i[c]?d:c;e[t]=e[f],i[t]=i[f],t=f}e[t]=o,i[t]=a,this.siftDown_(h,t)}siftDown_(t,e){const i=this.elements_,n=this.priorities_,o=i[e],a=n[e];for(;e>t;){const h=this.getParentIndex_(e);if(n[h]>a)i[e]=i[h],n[e]=n[h],e=h;else break}i[e]=o,n[e]=a}reprioritize(){const t=this.priorityFunction_,e=this.elements_,i=this.priorities_;let n=0;const o=e.length;let a,h,c;for(h=0;h<o;++h)a=e[h],c=t(a),c==ro?delete this.queuedElements_[this.keyFunction_(a)]:(i[n]=c,e[n++]=a);e.length=n,i.length=n,this.heapify_()}}const Sy=Cy,$={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class Py extends Sy{constructor(t,e){super(function(i){return t.apply(null,i)},function(i){return i[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(rt.CHANGE,this.boundHandleTileChange_),e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target,i=e.getState();if(i===$.LOADED||i===$.ERROR||i===$.EMPTY){i!==$.ERROR&&e.removeEventListener(rt.CHANGE,this.boundHandleTileChange_);const n=e.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let i=0,n,o,a;for(;this.tilesLoading_<t&&i<e&&this.getCount()>0;)o=this.dequeue()[0],a=o.getKey(),n=o.getState(),n===$.IDLE&&!(a in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[a]=!0,++this.tilesLoading_,++i,o.load())}}const ky=Py;function Ry(r,t,e,i,n){if(!r||!(e in r.wantedTiles)||!r.wantedTiles[e][t.getKey()])return ro;const o=r.viewState.center,a=i[0]-o[0],h=i[1]-o[1];return 65536*Math.log(n)+Math.sqrt(a*a+h*h)/n}class My extends be{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(){to(this.element),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&to(this.element);for(let e=0,i=this.listenerKeys.length;e<i;++e)wt(this.listenerKeys[e]);this.listenerKeys.length=0,this.map_=t,t&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==wn&&this.listenerKeys.push(ht(t,oi.POSTRENDER,this.render,this)),t.render())}render(t){}setTarget(t){this.target_=typeof t=="string"?document.getElementById(t):t}}const so=My;class Iy extends so{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);const e=t.className!==void 0?t.className:"ol-attribution",i=t.tipLabel!==void 0?t.tipLabel:"Attributions",n=t.expandClassName!==void 0?t.expandClassName:e+"-expand",o=t.collapseLabel!==void 0?t.collapseLabel:"›",a=t.collapseClassName!==void 0?t.collapseClassName:e+"-collapse";typeof o=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=o,this.collapseLabel_.className=a):this.collapseLabel_=o;const h=t.label!==void 0?t.label:"i";typeof h=="string"?(this.label_=document.createElement("span"),this.label_.textContent=h,this.label_.className=n):this.label_=h;const c=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(c),this.toggleButton_.addEventListener(rt.CLICK,this.handleClick_.bind(this),!1);const d=e+" "+Tr+" "+$s+(this.collapsed_&&this.collapsible_?" "+bu:"")+(this.collapsible_?"":" ol-uncollapsible"),f=this.element;f.className=d,f.appendChild(this.toggleButton_),f.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){const e=Array.from(new Set(this.getMap().getAllLayers().flatMap(n=>n.getAttributions(t)))),i=!this.getMap().getAllLayers().some(n=>n.getSource()&&n.getSource().getAttributionsCollapsible()===!1);return this.overrideCollapsible_||this.setCollapsible(i),e}updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!ei(e,this.renderedAttributions_)){Su(this.ulElement_);for(let n=0,o=e.length;n<o;++n){const a=document.createElement("li");a.innerHTML=e[n],this.ulElement_.appendChild(a)}this.renderedAttributions_=e}}handleClick_(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(bu),this.collapsed_?Qs(this.collapseLabel_,this.label_):Qs(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)}}const Mu=Iy;class Ay extends so{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",i=t.label!==void 0?t.label:"⇧",n=t.compassClassName!==void 0?t.compassClassName:"ol-compass";this.label_=null,typeof i=="string"?(this.label_=document.createElement("span"),this.label_.className=n,this.label_.textContent=i):(this.label_=i,this.label_.classList.add(n));const o=t.tipLabel?t.tipLabel:"Reset rotation",a=document.createElement("button");a.className=e+"-reset",a.setAttribute("type","button"),a.title=o,a.appendChild(this.label_),a.addEventListener(rt.CLICK,this.handleClick_.bind(this),!1);const h=e+" "+Tr+" "+$s,c=this.element;c.className=h,c.appendChild(a),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(qs)}handleClick_(t){t.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const e=this.getMap().getView();if(!e)return;const i=e.getRotation();i!==void 0&&(this.duration_>0&&i%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:Rn}):e.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const i=e.viewState.rotation;if(i!=this.rotation_){const n="rotate("+i+"rad)";if(this.autoHide_){const o=this.element.classList.contains(qs);!o&&i===0?this.element.classList.add(qs):o&&i!==0&&this.element.classList.remove(qs)}this.label_.style.transform=n}this.rotation_=i}}const Dy=Ay;class Oy extends so{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=t.className!==void 0?t.className:"ol-zoom",i=t.delta!==void 0?t.delta:1,n=t.zoomInClassName!==void 0?t.zoomInClassName:e+"-in",o=t.zoomOutClassName!==void 0?t.zoomOutClassName:e+"-out",a=t.zoomInLabel!==void 0?t.zoomInLabel:"+",h=t.zoomOutLabel!==void 0?t.zoomOutLabel:"–",c=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",d=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",f=document.createElement("button");f.className=n,f.setAttribute("type","button"),f.title=c,f.appendChild(typeof a=="string"?document.createTextNode(a):a),f.addEventListener(rt.CLICK,this.handleClick_.bind(this,i),!1);const _=document.createElement("button");_.className=o,_.setAttribute("type","button"),_.title=d,_.appendChild(typeof h=="string"?document.createTextNode(h):h),_.addEventListener(rt.CLICK,this.handleClick_.bind(this,-i),!1);const m=e+" "+Tr+" "+$s,v=this.element;v.className=m,v.appendChild(f),v.appendChild(_),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const i=this.getMap().getView();if(!i)return;const n=i.getZoom();if(n!==void 0){const o=i.getConstrainedZoom(n+t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:o,duration:this.duration_,easing:Rn})):i.setZoom(o)}}}const Fy=Oy;function Iu(r){r=r||{};const t=new Be;return(r.zoom!==void 0?r.zoom:!0)&&t.push(new Fy(r.zoomOptions)),(r.rotate!==void 0?r.rotate:!0)&&t.push(new Dy(r.rotateOptions)),(r.attribution!==void 0?r.attribution:!0)&&t.push(new Mu(r.attributionOptions)),t}const Au={ACTIVE:"active"};class zy extends be{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(Au.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(Au.ACTIVE,t)}setMap(t){this.map_=t}}function Ny(r,t,e){const i=r.getCenterInternal();if(i){const n=[i[0]+t[0],i[1]+t[1]];r.animateInternal({duration:e!==void 0?e:250,easing:pm,center:r.getConstrainedCenter(n)})}}function nl(r,t,e,i){const n=r.getZoom();if(n===void 0)return;const o=r.getConstrainedZoom(n+t),a=r.getResolutionForZoom(o);r.getAnimating()&&r.cancelAnimations(),r.animate({resolution:a,anchor:e,duration:i!==void 0?i:250,easing:Rn})}const Rr=zy;class By extends Rr{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==Mt.DBLCLICK){const i=t.originalEvent,n=t.map,o=t.coordinate,a=i.shiftKey?-this.delta_:this.delta_,h=n.getView();nl(h,a,o,this.duration_),i.preventDefault(),e=!0}return!e}}const Gy=By;class Uy extends Rr{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==Mt.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Mt.POINTERUP){const i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==Mt.POINTERDOWN){const i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==Mt.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 rl(r){const t=r.length;let e=0,i=0;for(let n=0;n<t;n++)e+=r[n].clientX,i+=r[n].clientY;return{clientX:e/t,clientY:i/t}}const Mr=Uy;function sl(r){const t=arguments;return function(e){let i=!0;for(let n=0,o=t.length;n<o&&(i=i&&t[n](e),!!i);++n);return i}}const Zy=function(r){const t=r.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},jy=function(r){const t=r.map.getTargetElement(),e=r.map.getOwnerDocument().activeElement;return t.contains(e)},Du=function(r){return r.map.getTargetElement().hasAttribute("tabindex")?jy(r):!0},Wy=_r,Ou=function(r){const t=r.originalEvent;return t.button==0&&!(vm&&Vc&&t.ctrlKey)},Fu=function(r){const t=r.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},Hy=function(r){const t=r.originalEvent;return Vc?t.metaKey:t.ctrlKey},Vy=function(r){const t=r.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},zu=function(r){const t=r.originalEvent,e=t.target.tagName;return e!=="INPUT"&&e!=="SELECT"&&e!=="TEXTAREA"&&!t.target.isContentEditable},ol=function(r){const t=r.originalEvent;return ft(t!==void 0,"mapBrowserEvent must originate from a pointer event"),t.pointerType=="mouse"},Xy=function(r){const t=r.originalEvent;return ft(t!==void 0,"mapBrowserEvent must originate from a pointer event"),t.isPrimary&&t.button===0};class Yy extends Mr{constructor(t){super({stopDown:Ls}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const e=t.condition?t.condition:sl(Fu,Xy);this.condition_=t.onFocusOnly?sl(Du,e):e,this.noKinetic_=!1}handleDragEvent(t){const e=t.map;this.panning_||(this.panning_=!0,e.getView().beginInteraction());const i=this.targetPointers,n=e.getEventPixel(rl(i));if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){const o=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],h=t.map.getView();im(o,h.getResolution()),ka(o,h.getRotation()),h.adjustCenterInternal(o)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=i.length,t.originalEvent.preventDefault()}handleUpEvent(t){const e=t.map,i=e.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const n=this.kinetic_.getDistance(),o=this.kinetic_.getAngle(),a=i.getCenterInternal(),h=e.getPixelFromCoordinateInternal(a),c=e.getCoordinateFromPixelInternal([h[0]-n*Math.cos(o),h[1]-n*Math.sin(o)]);i.animateInternal({center:i.getConstrainedCenter(c),duration:500,easing:Rn})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){const i=t.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}const Ky=Yy;class qy extends Mr{constructor(t){t=t||{},super({stopDown:Ls}),this.condition_=t.condition?t.condition:Zy,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!ol(t))return;const e=t.map,i=e.getView();if(i.getConstraints().rotation===za)return;const n=e.getSize(),o=t.pixel,a=Math.atan2(n[1]/2-o[1],o[0]-n[0]/2);if(this.lastAngle_!==void 0){const h=a-this.lastAngle_;i.adjustRotationInternal(-h)}this.lastAngle_=a}handleUpEvent(t){return ol(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return ol(t)&&Ou(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}const $y=qy;class Jy extends ws{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_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i}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(){const t=this.startPixel_,e=this.endPixel_,n=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new Hs([n])}getGeometry(){return this.geometry_}}const Qy=Jy,oo={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class al extends Qe{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}}class tv extends Mr{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.box_=new Qy(t.className||"ol-dragbox"),this.minArea_=t.minArea!==void 0?t.minArea:64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition?t.condition:Ou,this.boxEndCondition_=t.boxEndCondition?t.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,i){const n=i[0]-e[0],o=i[1]-e[1];return n*n+o*o>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new al(oo.BOXDRAG,t.coordinate,t))}handleUpEvent(t){this.box_.setMap(null);const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new al(e?oo.BOXEND:oo.BOXCANCEL,t.coordinate,t)),!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 al(oo.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}}const ev=tv;class iv extends ev{constructor(t){t=t||{};const e=t.condition?t.condition:Vy;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 i=this.getMap().getView();let n=this.getGeometry();if(this.out_){const o=i.rotatedExtentForGeometry(n),a=i.getResolutionForExtentInternal(o),h=i.getResolution()/a;n=n.clone(),n.scale(h*h)}i.fitInternal(n,{duration:this.duration_,easing:Rn})}}const nv=iv,on={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class rv extends Rr{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return Fu(e)&&zu(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==rt.KEYDOWN){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&(n==on.DOWN||n==on.LEFT||n==on.RIGHT||n==on.UP)){const a=t.map.getView(),h=a.getResolution()*this.pixelDelta_;let c=0,d=0;n==on.DOWN?d=-h:n==on.LEFT?c=-h:n==on.RIGHT?c=h:d=h;const f=[c,d];ka(f,a.getRotation()),Ny(a,f,this.duration_),i.preventDefault(),e=!0}}return!e}}const sv=rv;class ov extends Rr{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(e){return!Hy(e)&&zu(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==rt.KEYDOWN||t.type==rt.KEYPRESS){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&(n==="+"||n==="-")){const o=t.map,a=n==="+"?this.delta_:-this.delta_,h=o.getView();nl(h,a,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}}const av=ov;class lv{constructor(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,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 i=e-3;for(;i>0&&this.points_[i+2]>t;)i-=3;const n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;const o=this.points_[e]-this.points_[i],a=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(a,o),this.initialVelocity_=Math.sqrt(o*o+a*a)/n,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const hv=lv;class cv extends Rr{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:Wy;this.condition_=t.onFocusOnly?sl(Du,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_)}handleEvent(t){if(!this.condition_(t)||t.type!==rt.WHEEL)return!0;const i=t.map,n=t.originalEvent;n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);let o;if(t.type==rt.WHEEL&&(o=n.deltaY,mm&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(o/=Xc),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(o*=40)),o===0)return!1;this.lastDelta_=o;const a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(o)<4?"trackpad":"wheel");const h=i.getView();if(this.mode_==="trackpad"&&!(h.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(h.getAnimating()&&h.cancelAnimations(),h.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),h.adjustZoom(-o/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=a,!1;this.totalDelta_+=o;const c=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),c),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let i=-It(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),nl(e,i,this.lastAnchor_,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)}}const uv=cv;class dv extends Mr{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=Ls),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 i=this.targetPointers[0],n=this.targetPointers[1],o=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(this.lastAngle_!==void 0){const c=o-this.lastAngle_;this.rotationDelta_+=c,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=c}this.lastAngle_=o;const a=t.map,h=a.getView();h.getConstraints().rotation!==za&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(rl(this.targetPointers))),this.rotating_&&(a.render(),h.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}}const fv=dv;class gv extends Mr{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=Ls),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 i=this.targetPointers[0],n=this.targetPointers[1],o=i.clientX-n.clientX,a=i.clientY-n.clientY,h=Math.sqrt(o*o+a*a);this.lastDistance_!==void 0&&(e=this.lastDistance_/h),this.lastDistance_=h;const c=t.map,d=c.getView();e!=1&&(this.lastScaleDelta_=e),this.anchor_=c.getCoordinateFromPixelInternal(c.getEventPixel(rl(this.targetPointers))),c.render(),d.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const i=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,n),!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}}const _v=gv;function pv(r){r=r||{};const t=new Be,e=new hv(-.005,.05,100);return(r.altShiftDragRotate!==void 0?r.altShiftDragRotate:!0)&&t.push(new $y),(r.doubleClickZoom!==void 0?r.doubleClickZoom:!0)&&t.push(new Gy({delta:r.zoomDelta,duration:r.zoomDuration})),(r.dragPan!==void 0?r.dragPan:!0)&&t.push(new Ky({onFocusOnly:r.onFocusOnly,kinetic:e})),(r.pinchRotate!==void 0?r.pinchRotate:!0)&&t.push(new fv),(r.pinchZoom!==void 0?r.pinchZoom:!0)&&t.push(new _v({duration:r.zoomDuration})),(r.keyboard!==void 0?r.keyboard:!0)&&(t.push(new sv),t.push(new av({delta:r.zoomDelta,duration:r.zoomDuration}))),(r.mouseWheelZoom!==void 0?r.mouseWheelZoom:!0)&&t.push(new uv({onFocusOnly:r.onFocusOnly,duration:r.zoomDuration})),(r.shiftDragZoom!==void 0?r.shiftDragZoom:!0)&&t.push(new nv({duration:r.zoomDuration})),t}function Nu(r){return r[0]>0&&r[1]>0}function mv(r,t,e){return e===void 0&&(e=[0,0]),e[0]=r[0]*t+.5|0,e[1]=r[1]*t+.5|0,e}function pe(r,t){return Array.isArray(r)?r:(t===void 0?t=[r,r]:(t[0]=r,t[1]=r),t)}function Bu(r){if(r instanceof Ks){r.setMapInternal(null);return}r instanceof no&&r.getLayers().forEach(Bu)}function Gu(r,t){if(r instanceof Ks){r.setMapInternal(t);return}if(r instanceof no){const e=r.getLayers().getArray();for(let i=0,n=e.length;i<n;++i)Gu(e[i],t)}}class yv extends be{constructor(t){super(),t=t||{},this.on,this.once,this.un;const e=vv(t);this.renderComplete_,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:Xc,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=Vt(),this.pixelToCoordinateTransform_=Vt(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,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,this.resizeObserver_=new ResizeObserver(()=>this.updateSize()),this.controls=e.controls||Iu(),this.interactions=e.interactions||pv({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new ky(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(jt.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(jt.VIEW,this.handleViewChanged_),this.addChangeListener(jt.SIZE,this.handleSizeChanged_),this.addChangeListener(jt.TARGET,this.handleTargetChanged_),this.setProperties(e.values);const i=this;t.view&&!(t.view instanceof Ne)&&t.view.then(function(n){i.setView(new Ne(n))}),this.controls.addEventListener(oe.ADD,n=>{n.element.setMap(this)}),this.controls.addEventListener(oe.REMOVE,n=>{n.element.setMap(null)}),this.interactions.addEventListener(oe.ADD,n=>{n.element.setMap(this)}),this.interactions.addEventListener(oe.REMOVE,n=>{n.element.setMap(null)}),this.overlays_.addEventListener(oe.ADD,n=>{this.addOverlayInternal_(n.element)}),this.overlays_.addEventListener(oe.REMOVE,n=>{const o=n.element.getId();o!==void 0&&delete this.overlayIdIndex_[o.toString()],n.element.setMap(null)}),this.controls.forEach(n=>{n.setMap(this)}),this.interactions.forEach(n=>{n.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){Gu(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,i){if(!this.frameState_||!this.renderer_)return;const n=this.getCoordinateFromPixelInternal(t);i=i!==void 0?i:{};const o=i.hitTolerance!==void 0?i.hitTolerance:0,a=i.layerFilter!==void 0?i.layerFilter:_r,h=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,o,h,e,null,a,null)}getFeaturesAtPixel(t,e){const i=[];return this.forEachFeatureAtPixel(t,function(n){i.push(n)},e),i}getAllLayers(){const t=[];function e(i){i.forEach(function(n){n instanceof no?e(n.getLayers()):t.push(n)})}return e(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};const n=e.layerFilter!==void 0?e.layerFilter:_r,o=e.hitTolerance!==void 0?e.hitTolerance:0,a=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,o,a,n,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const i=this.viewport_.getBoundingClientRect(),n=this.getSize(),o=i.width/n[0],a=i.height/n[1],h="changedTouches"in t?t.changedTouches[0]:t;return[(h.clientX-i.left)/o,(h.clientY-i.top)/a]}getTarget(){return this.get(jt.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return Da(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?Ot(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(jt.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof Be){e.setLayers(t);return}const i=e.getLayers();i.clear(),i.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e<i;++e){const n=t[e];if(!n.visible)continue;const o=n.layer.getRenderer();if(o&&!o.ready)return!0;const a=n.layer.getSource();if(a&&a.loading)return!0}return!1}getPixelFromCoordinate(t){const e=ii(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){const e=this.frameState_;return e?Ot(e.coordinateToPixelTransform,t.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(jt.SIZE)}getView(){return this.get(jt.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,i,n){return Ry(this.frameState_,t,e,i,n)}handleBrowserEvent(t,e){e=e||t.type;const i=new Ti(e,this,t);this.handleMapBrowserEvent(i)}handleMapBrowserEvent(t){if(!this.frameState_)return;const e=t.originalEvent,i=e.type;if(i===il.POINTERDOWN||i===rt.WHEEL||i===rt.KEYDOWN){const n=this.getOwnerDocument(),o=this.viewport_.getRootNode?this.viewport_.getRootNode():n,a=e.target;if(this.overlayContainerStopEvent_.contains(a)||!(o===n?n.documentElement:o).contains(a))return}if(t.frameState=this.frameState_,this.dispatchEvent(t)!==!1){const n=this.getInteractions().getArray().slice();for(let o=n.length-1;o>=0;o--){const a=n[o];if(a.getMap()!==this||!a.getActive()||!this.getTargetElement())continue;if(!a.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let n=this.maxTilesLoading_,o=n;if(t){const a=t.viewHints;if(a[Ut.ANIMATING]||a[Ut.INTERACTING]){const h=Date.now()-t.time>8;n=h?0:8,o=h?0:2}}e.getTilesLoading()<n&&(e.reprioritize(),e.loadMoreTiles(n,o))}t&&this.renderer_&&!t.animate&&(this.renderComplete_===!0?(this.hasListener(qt.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(qt.RENDERCOMPLETE,t),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new Dn(oi.LOADEND,this,t)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new Dn(oi.LOADSTART,this,t))));const i=this.postRenderFunctions_;for(let n=0,o=i.length;n<o;++n)i[n](this,t);i.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let i=0,n=this.targetChangeHandlerKeys_.length;i<n;++i)wt(this.targetChangeHandlerKeys_[i]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(rt.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(rt.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,to(this.viewport_)}if(this.targetElement_){this.resizeObserver_.unobserve(this.targetElement_);const i=this.targetElement_.getRootNode();i instanceof ShadowRoot&&this.resizeObserver_.unobserve(i.host),this.setSize(void 0)}const 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{e.appendChild(this.viewport_),this.renderer_||(this.renderer_=new Ey(this)),this.mapBrowserEventHandler_=new Ty(this,this.moveTolerance_);for(const o in Mt)this.mapBrowserEventHandler_.addEventListener(Mt[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(rt.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(rt.WHEEL,this.boundHandleBrowserEvent_,Kc?{passive:!1}:!1);const i=this.keyboardEventTarget_?this.keyboardEventTarget_:e;this.targetChangeHandlerKeys_=[ht(i,rt.KEYDOWN,this.handleBrowserEvent,this),ht(i,rt.KEYPRESS,this.handleBrowserEvent,this)];const n=e.getRootNode();n instanceof ShadowRoot&&this.resizeObserver_.observe(n.host),this.resizeObserver_.observe(e)}this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(wt(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(wt(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=ht(t,En.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=ht(t,rt.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(wt),this.layerGroupPropertyListenerKeys_=null);const t=this.getLayerGroup();t&&(this.handleLayerAdd_(new bi("addlayer",t)),this.layerGroupPropertyListenerKeys_=[ht(t,En.PROPERTYCHANGE,this.render,this),ht(t,rt.CHANGE,this.render,this),ht(t,"addlayer",this.handleLayerAdd_,this),ht(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(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e<i;++e){const n=t[e].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}flushDeclutterItems(){const t=this.frameState_;t&&this.renderer_.flushDeclutterItems(t)}removeControl(t){return this.getControls().remove(t)}removeInteraction(t){return this.getInteractions().remove(t)}removeLayer(t){return this.getLayerGroup().getLayers().remove(t)}handleLayerRemove_(t){Bu(t.layer)}removeOverlay(t){return this.getOverlays().remove(t)}renderFrame_(t){const e=this.getSize(),i=this.getView(),n=this.frameState_;let o=null;if(e!==void 0&&Nu(e)&&i&&i.isDef()){const a=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),h=i.getState();if(o={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:Ca(h.center,h.resolution,h.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:h,viewHints:a,wantedTiles:{},mapId:at(this),renderTargets:{}},h.nextCenter&&h.nextResolution){const c=isNaN(h.nextRotation)?h.rotation:h.nextRotation;o.nextExtent=Ca(h.nextCenter,h.nextResolution,c,e)}}this.frameState_=o,this.renderer_.renderFrame(o),o&&(o.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions),n&&(!this.previousExtent_||!Ds(this.previousExtent_)&&!Pn(o.extent,this.previousExtent_))&&(this.dispatchEvent(new Dn(oi.MOVESTART,this,n)),this.previousExtent_=yr(this.previousExtent_)),this.previousExtent_&&!o.viewHints[Ut.ANIMATING]&&!o.viewHints[Ut.INTERACTING]&&!Pn(o.extent,this.previousExtent_)&&(this.dispatchEvent(new Dn(oi.MOVEEND,this,o)),Tc(o.extent,this.previousExtent_))),this.dispatchEvent(new Dn(oi.POSTRENDER,this,o)),this.renderComplete_=this.hasListener(oi.LOADSTART)||this.hasListener(oi.LOADEND)||this.hasListener(qt.RENDERCOMPLETE)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new bi("removelayer",e)),this.set(jt.LAYERGROUP,t)}setSize(t){this.set(jt.SIZE,t)}setTarget(t){this.set(jt.TARGET,t)}setView(t){if(!t||t instanceof Ne){this.set(jt.VIEW,t);return}this.set(jt.VIEW,new Ne);const e=this;t.then(function(i){e.setView(new Ne(i))})}updateSize(){const t=this.getTargetElement();let e;if(t){const n=getComputedStyle(t),o=t.offsetWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderRightWidth),a=t.offsetHeight-parseFloat(n.borderTopWidth)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderBottomWidth);!isNaN(o)&&!isNaN(a)&&(e=[o,a],!Nu(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&Dc("No map visible because the map container's width or height are 0."))}const i=this.getSize();e&&(!i||!ei(e,i))&&(this.setSize(e),this.updateViewportSize_())}updateViewportSize_(){const t=this.getView();if(t){let e;const i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}}}function vv(r){let t=null;r.keyboardEventTarget!==void 0&&(t=typeof r.keyboardEventTarget=="string"?document.getElementById(r.keyboardEventTarget):r.keyboardEventTarget);const e={},i=r.layers&&typeof r.layers.getLayers=="function"?r.layers:new no({layers:r.layers});e[jt.LAYERGROUP]=i,e[jt.TARGET]=r.target,e[jt.VIEW]=r.view instanceof Ne?r.view:new Ne;let n;r.controls!==void 0&&(Array.isArray(r.controls)?n=new Be(r.controls.slice()):(ft(typeof r.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),n=r.controls));let o;r.interactions!==void 0&&(Array.isArray(r.interactions)?o=new Be(r.interactions.slice()):(ft(typeof r.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),o=r.interactions));let a;return r.overlays!==void 0?Array.isArray(r.overlays)?a=new Be(r.overlays.slice()):(ft(typeof r.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),a=r.overlays):a=new Be,{controls:n,interactions:o,keyboardEventTarget:t,overlays:a,values:e}}const xv=yv,Ct={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class ll{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=pe(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new ll({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 it()}getImage(t){return it()}getHitDetectionImage(){return it()}getPixelRatio(t){return 1}getImageState(){return it()}getImageSize(){return it()}getOrigin(){return it()}getSize(){return it()}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_=pe(t)}listenImageChange(t){it()}load(){it()}unlistenImageChange(t){it()}}const Uu=ll;function Ge(r){return Array.isArray(r)?xu(r):r}class hl extends Uu{constructor(t){const e=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:1,rotateWithView:e,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.canvas_=void 0,this.hitDetectionCanvas_=null,this.fill_=t.fill!==void 0?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=t.radius!==void 0?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=t.angle!==void 0?t.angle:0,this.stroke_=t.stroke!==void 0?t.stroke:null,this.size_=null,this.renderOptions_=null,this.render()}clone(){const t=this.getScale(),e=new hl({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_;if(!t)return null;const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(t){let e=this.canvas_[t];if(!e){const i=this.renderOptions_,n=$t(i.size*t,i.size*t);this.draw_(i,n,t),e=n.canvas,this.canvas_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return Ct.LOADED}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,i){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let n=this.radius_,o=this.radius2_===void 0?n:this.radius2_;if(n<o){const I=n;n=o,o=I}const a=this.radius2_===void 0?this.points_:this.points_*2,h=2*Math.PI/a,c=o*Math.sin(h),d=Math.sqrt(o*o-c*c),f=n-d,_=Math.sqrt(c*c+f*f),m=_/c;if(t==="miter"&&m<=i)return m*e;const v=e/2/m,y=e/2*(f/_),b=Math.sqrt((n+v)*(n+v)+y*y)-n;if(this.radius2_===void 0||t==="bevel")return b*2;const S=n*Math.sin(h),w=Math.sqrt(n*n-S*S),T=o-w,M=Math.sqrt(S*S+T*T)/S;if(M<=i){const I=M*e/2-o-n;return 2*Math.max(b,I)}return b*2}createRenderOptions(){let t=Mn,e=In,i=0,n=null,o=0,a,h=0;this.stroke_&&(a=this.stroke_.getColor(),a===null&&(a=Sr),a=Ge(a),h=this.stroke_.getWidth(),h===void 0&&(h=kr),n=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),e=this.stroke_.getLineJoin(),e===void 0&&(e=In),t=this.stroke_.getLineCap(),t===void 0&&(t=Mn),i=this.stroke_.getMiterLimit(),i===void 0&&(i=Cr));const c=this.calculateLineJoinSize_(e,h,i),d=Math.max(this.radius_,this.radius2_||0),f=Math.ceil(2*d+c);return{strokeStyle:a,strokeWidth:h,size:f,lineCap:t,lineDash:n,lineDashOffset:o,lineJoin:e,miterLimit:i}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]}draw_(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let n=this.fill_.getColor();n===null&&(n=ae),e.fillStyle=Ge(n),e.fill()}this.stroke_&&(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){if(this.fill_){let e=this.fill_.getColor(),i=0;if(typeof e=="string"&&(e=Lr(e)),e===null?i=1:Array.isArray(e)&&(i=e.length===4?e[3]:1),i===0){const n=$t(t.size,t.size);this.hitDetectionCanvas_=n.canvas,this.drawHitDetectionCanvas_(t,n)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))}createPath_(t){let e=this.points_;const i=this.radius_;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{const n=this.radius2_===void 0?i:this.radius2_;this.radius2_!==void 0&&(e*=2);const o=this.angle_-Math.PI/2,a=2*Math.PI/e;for(let h=0;h<e;h++){const c=o+h*a,d=h%2===0?i:n;t.lineTo(d*Math.cos(c),d*Math.sin(c))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=ae,e.fill(),this.stroke_&&(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())}}const Zu=hl;class cl extends Zu{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 cl({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()}}const ju=cl;class ul{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null}clone(){const t=this.getColor();return new ul({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){this.color_=t}}const ao=ul;class dl{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 dl({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}}const lo=dl;class ho{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=Wu,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 ho({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),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_=Wu,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function Ev(r){let t;if(typeof r=="function")t=r;else{let e;Array.isArray(r)?e=r:(ft(typeof r.getZIndex=="function","Expected an `Style` or an array of `Style`"),e=[r]),t=function(){return e}}return t}let fl=null;function wv(r,t){if(!fl){const e=new ao({color:"rgba(255,255,255,0.4)"}),i=new lo({color:"#3399CC",width:1.25});fl=[new ho({image:new ju({fill:e,stroke:i,radius:5}),fill:e,stroke:i})]}return fl}function Wu(r){return r.getGeometry()}const On=ho;function Lv(r,t,e){const i=r;let n=!0,o=!1,a=!1;const h=[Ts(i,rt.LOAD,function(){a=!0,o||t()})];return i.src&&Yc?(o=!0,i.decode().then(function(){n&&t()}).catch(function(c){n&&(a?t():e())})):h.push(Ts(i,rt.ERROR,e)),function(){n=!1,h.forEach(wt)}}function bv(r,t){return new Promise((e,i)=>{function n(){a(),e(r)}function o(){a(),i(new Error("Image load error"))}function a(){r.removeEventListener("load",n),r.removeEventListener("error",o)}r.addEventListener("load",n),r.addEventListener("error",o),t&&(r.src=t)})}function Tv(r,t){return t&&(r.src=t),Yc?new Promise((e,i)=>r.decode().then(()=>e(r),i)):bv(r)}let Ir=null;class Cv extends bs{constructor(t,e,i,n,o){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=o,this.imageState_=n===void 0?Ct.IDLE:n,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===Ct.LOADED){Ir||(Ir=$t(1,1,void 0,{willReadFrequently:!0})),Ir.drawImage(this.image_,0,0);try{Ir.getImageData(0,0,1,1),this.tainted_=!1}catch{Ir=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(rt.CHANGE)}handleImageError_(){this.imageState_=Ct.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=Ct.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],i=$t(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===Ct.IDLE){this.image_||this.initializeImage_(),this.imageState_=Ct.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&Tv(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_!==Ct.LOADED)return;const e=this.image_,i=document.createElement("canvas");i.width=Math.ceil(e.width*t),i.height=Math.ceil(e.height*t);const n=i.getContext("2d");n.scale(t,t),n.drawImage(e,0,0),n.globalCompositeOperation="multiply",n.fillStyle=yu(this.color_),n.fillRect(0,0,i.width/t,i.height/t),n.globalCompositeOperation="destination-in",n.drawImage(e,0,0),this.canvas_[t]=i}}function Sv(r,t,e,i,n){let o=t===void 0?void 0:Ys.get(t,e,n);return o||(o=new Cv(r,r instanceof HTMLImageElement?r.src||void 0:t,e,i,n),Ys.set(t,e,n,o)),o}function Hu(r,t,e,i){return e!==void 0&&i!==void 0?[e/r,i/t]:e!==void 0?e/r:i!==void 0?i/t:1}class gl extends Uu{constructor(t){t=t||{};const e=t.opacity!==void 0?t.opacity:1,i=t.rotation!==void 0?t.rotation:0,n=t.scale!==void 0?t.scale:1,o=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:i,scale:n,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:o,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 a=t.img!==void 0?t.img:null;let h=t.src;ft(!(h!==void 0&&a),"`image` and `src` cannot be provided at the same time"),(h===void 0||h.length===0)&&a&&(h=a.src||at(a)),ft(h!==void 0&&h.length>0,"A defined and non-empty `src` or `image` must be provided"),ft(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let c;if(t.src!==void 0?c=Ct.IDLE:a!==void 0&&(a instanceof HTMLImageElement?a.complete?c=a.src?Ct.LOADED:Ct.IDLE:c=Ct.LOADING:c=Ct.LOADED),this.color_=t.color!==void 0?Lr(t.color):null,this.iconImage_=Sv(a,h,this.crossOrigin_,c,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,t.width!==void 0||t.height!==void 0){let d,f;if(t.size)[d,f]=t.size;else{const _=this.getImage(1);if(_.width&&_.height)d=_.width,f=_.height;else if(_ instanceof HTMLImageElement){this.initialOptions_=t;const m=()=>{if(this.unlistenImageChange(m),!this.initialOptions_)return;const v=this.iconImage_.getSize();this.setScale(Hu(v[0],v[1],t.width,t.height))};this.listenImageChange(m);return}}d!==void 0&&this.setScale(Hu(d,f,t.width,t.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new gl({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:i,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 n=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!n)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=n[0]),this.anchorYUnits_=="fraction"&&(t[1]*=n[1])}if(this.anchorOrigin_!="top-left"){if(!n)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+n[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+n[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[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(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=i[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}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()==Ct.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()==Ct.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(rt.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(rt.CHANGE,t)}}const _l=gl,Pv="#333";class pl{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=pe(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 ao({color:Pv}),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}clone(){const t=this.getScale();return new pl({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})}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_}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_}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}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=pe(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}}const Vu=pl;let Fn=0;const Jt=1<<Fn++,dt=1<<Fn++,zn=1<<Fn++,ml=1<<Fn++,Ar=1<<Fn++,Ce=Math.pow(2,Fn)-1,Xu={[Jt]:"boolean",[dt]:"number",[zn]:"string",[ml]:"color",[Ar]:"number[]"},kv=Object.keys(Xu).map(Number).sort(xi);function co(r){const t=[];for(const e of kv)Rv(r,e)&&t.push(Xu[e]);return t.length===0?"untyped":t.length<3?t.join(" or "):t.slice(0,-1).join(", ")+", or "+t[t.length-1]}function Rv(r,t){return(r&t)===t}function Yu(r,t){return!!(r&t)}class Ci{constructor(t,e){this.type=t,this.value=e}}class Mv{constructor(t,e,...i){this.type=t,this.operator=e,this.args=i}}function Ku(){return{variables:new Set,properties:new Set}}function uo(r,t){switch(typeof r){case"boolean":return new Ci(Jt,r);case"number":return new Ci(dt,r);case"string":return new Ci(zn,r)}if(!Array.isArray(r))throw new Error("Expression must be an array or a primitive value");if(r.length===0)throw new Error("Empty expression");if(typeof r[0]=="string")return Fv(r,t);for(const i of r)if(typeof i!="number")throw new Error("Expected an array of numbers");let e=Ar;return(r.length===3||r.length===4)&&(e|=ml),new Ci(e,r)}const N={Number:"number",String:"string",Get:"get",Var:"var",Any:"any",All:"all",Not:"!",Resolution:"resolution",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"},Iv={[N.Number]:xt(bt(1,1/0,Ce),dt),[N.String]:xt(bt(1,1/0,Ce),zn),[N.Get]:xt(Av,Ce),[N.Var]:xt(Dv,Ce),[N.Resolution]:xt(Ov,dt),[N.Any]:xt(bt(2,1/0,Jt),Jt),[N.All]:xt(bt(2,1/0,Jt),Jt),[N.Not]:xt(bt(1,1,Jt),Jt),[N.Equal]:xt(bt(2,2,Ce),Jt),[N.NotEqual]:xt(bt(2,2,Ce),Jt),[N.GreaterThan]:xt(bt(2,2,Ce),Jt),[N.GreaterThanOrEqualTo]:xt(bt(2,2,Ce),Jt),[N.LessThan]:xt(bt(2,2,Ce),Jt),[N.LessThanOrEqualTo]:xt(bt(2,2,Ce),Jt),[N.Multiply]:xt(bt(2,1/0,dt),dt),[N.Divide]:xt(bt(2,2,dt),dt),[N.Add]:xt(bt(2,1/0,dt),dt),[N.Subtract]:xt(bt(2,2,dt),dt),[N.Clamp]:xt(bt(3,3,dt),dt),[N.Mod]:xt(bt(2,2,dt),dt),[N.Pow]:xt(bt(2,2,dt),dt),[N.Abs]:xt(bt(1,1,dt),dt),[N.Floor]:xt(bt(1,1,dt),dt),[N.Ceil]:xt(bt(1,1,dt),dt),[N.Round]:xt(bt(1,1,dt),dt),[N.Sin]:xt(bt(1,1,dt),dt),[N.Cos]:xt(bt(1,1,dt),dt),[N.Atan]:xt(bt(1,2,dt),dt),[N.Sqrt]:xt(bt(1,1,dt),dt),[N.Match]:xt(bt(4,1/0,zn|dt),Ce)};function Av(r,t){if(r.length!==2)throw new Error("Expected 1 argument for get operation");const e=uo(r[1],t);if(!(e instanceof Ci))throw new Error("Expected a literal argument for get operation");if(typeof e.value!="string")throw new Error("Expected a string argument for get operation");return t.properties.add(e.value),[e]}function Dv(r,t){if(r.length!==2)throw new Error("Expected 1 argument for var operation");const e=uo(r[1],t);if(!(e instanceof Ci))throw new Error("Expected a literal argument for var operation");if(typeof e.value!="string")throw new Error("Expected a string argument for get operation");return t.variables.add(e.value),[e]}function Ov(r,t){const e=r[0];if(r.length!==1)throw new Error(`Expected no arguments for ${e} operation`);return[]}function bt(r,t,e){return function(i,n){const o=i[0],a=i.length-1;if(r===t){if(a!==r){const c=r===1?"":"s";throw new Error(`Expected ${r} argument${c} for operation ${o}, got ${a}`)}}else if(a<r||a>t)throw new Error(`Expected ${r} to ${t} arguments for operation ${o}, got ${a}`);const h=new Array(a);for(let c=0;c<a;++c){const d=uo(i[c+1],n);if(!Yu(e,d.type)){const f=co(e),_=co(d.type);throw new Error(`Unexpected type for argument ${c} of ${o} operation : got ${f} but expected ${_}`)}h[c]=d}return h}}function xt(r,t){return function(e,i){const n=e[0],o=r(e,i);return new Mv(t,n,...o)}}function Fv(r,t){const e=r[0],i=Iv[e];if(!i)throw new Error(`Unknown operator: ${e}`);return i(r,t)}function qu(){return{variables:{},properties:{},resolution:NaN}}function Si(r,t,e){const i=uo(r,e);if(!Yu(t,i.type)){const n=co(t),o=co(i.type);throw new Error(`Expected expression to be of type ${n}, got ${o}`)}return an(i)}function an(r,t){if(r instanceof Ci)return function(){return r.value};const e=r.operator;switch(e){case N.Number:case N.String:return zv(r);case N.Get:case N.Var:return Nv(r);case N.Resolution:return i=>i.resolution;case N.Any:case N.All:case N.Not:return Gv(r);case N.Equal:case N.NotEqual:case N.LessThan:case N.LessThanOrEqualTo:case N.GreaterThan:case N.GreaterThanOrEqualTo:return Bv(r);case N.Multiply:case N.Divide:case N.Add:case N.Subtract:case N.Clamp:case N.Mod:case N.Pow:case N.Abs:case N.Floor:case N.Ceil:case N.Round:case N.Sin:case N.Cos:case N.Atan:case N.Sqrt:return Uv(r);case N.Match:return Zv(r);default:throw new Error(`Unsupported operator ${e}`)}}function zv(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let o=0;o<i;++o)n[o]=an(r.args[o]);switch(e){case N.Number:case N.String:return o=>{for(let a=0;a<i;++a){const h=n[a](o);if(typeof h===e)return h}throw new Error(`Expected one of the values to be a ${e}`)};default:throw new Error(`Unsupported assertion operator ${e}`)}}function Nv(r,t){const e=r.args[0];if(!(e instanceof Ci))throw new Error("Expected literal name");const i=e.value;if(typeof i!="string")throw new Error("Expected string name");switch(r.operator){case N.Get:return n=>n.properties[i];case N.Var:return n=>n.variables[i];default:throw new Error(`Unsupported accessor operator ${r.operator}`)}}function Bv(r,t){const e=r.operator,i=an(r.args[0]),n=an(r.args[1]);switch(e){case N.Equal:return o=>i(o)===n(o);case N.NotEqual:return o=>i(o)!==n(o);case N.LessThan:return o=>i(o)<n(o);case N.LessThanOrEqualTo:return o=>i(o)<=n(o);case N.GreaterThan:return o=>i(o)>n(o);case N.GreaterThanOrEqualTo:return o=>i(o)>=n(o);default:throw new Error(`Unsupported comparison operator ${e}`)}}function Gv(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let o=0;o<i;++o)n[o]=an(r.args[o]);switch(e){case N.Any:return o=>{for(let a=0;a<i;++a)if(n[a](o))return!0;return!1};case N.All:return o=>{for(let a=0;a<i;++a)if(!n[a](o))return!1;return!0};case N.Not:return o=>!n[0](o);default:throw new Error(`Unsupported logical operator ${e}`)}}function Uv(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let o=0;o<i;++o)n[o]=an(r.args[o]);switch(e){case N.Multiply:return o=>{let a=1;for(let h=0;h<i;++h)a*=n[h](o);return a};case N.Divide:return o=>n[0](o)/n[1](o);case N.Add:return o=>{let a=0;for(let h=0;h<i;++h)a+=n[h](o);return a};case N.Subtract:return o=>n[0](o)-n[1](o);case N.Clamp:return o=>{const a=n[0](o),h=n[1](o);if(a<h)return h;const c=n[2](o);return a>c?c:a};case N.Mod:return o=>n[0](o)%n[1](o);case N.Pow:return o=>Math.pow(n[0](o),n[1](o));case N.Abs:return o=>Math.abs(n[0](o));case N.Floor:return o=>Math.floor(n[0](o));case N.Ceil:return o=>Math.ceil(n[0](o));case N.Round:return o=>Math.round(n[0](o));case N.Sin:return o=>Math.sin(n[0](o));case N.Cos:return o=>Math.cos(n[0](o));case N.Atan:return i===2?o=>Math.atan2(n[0](o),n[1](o)):o=>Math.atan(n[0](o));case N.Sqrt:return o=>Math.sqrt(n[0](o));default:throw new Error(`Unsupported numeric operator ${e}`)}}function Zv(r,t){const e=r.args.length,i=new Array(e);for(let n=0;n<e;++n)i[n]=an(r.args[n]);return n=>{const o=i[0](n);for(let a=1;a<e;a+=2)if(o===i[a](n))return i[a+1](n);return i[e-1](n)}}function jv(r){return!0}function Wv(r){const t=Ku(),e=Hv(r,t),i=qu();return function(n,o){return i.properties=n.getPropertiesInternal(),i.resolution=o,e(i)}}function $u(r){const t=Ku(),e=r.length,i=new Array(e);for(let a=0;a<e;++a)i[a]=yl(r[a],t);const n=qu(),o=new Array(e);return function(a,h){n.properties=a.getPropertiesInternal(),n.resolution=h;for(let c=0;c<e;++c)o[c]=i[c](n);return o}}function Hv(r,t){const e=r.length,i=new Array(e);for(let n=0;n<e;++n){const o=r[n],a="filter"in o?Si(o.filter,Jt,t):jv;let h;if(Array.isArray(o.style)){const c=o.style.length;h=new Array(c);for(let d=0;d<c;++d)h[d]=yl(o.style[d],t)}else h=[yl(o.style,t)];i[n]={filter:a,styles:h}}return function(n){const o=[];let a=!1;for(let h=0;h<e;++h){const c=i[h].filter;if(c(n)&&!(r[h].else&&a)){a=!0;for(const d of i[h].styles){const f=d(n);f&&o.push(f)}}}return o}}function yl(r,t){const e=Dr(r,"",t),i=Or(r,"",t),n=Vv(r,t),o=Xv(r,t),a=le(r,"z-index",t),h=new On;return function(c){let d=!0;if(e){const f=e(c);f&&(d=!1),h.setFill(f)}if(i){const f=i(c);f&&(d=!1),h.setStroke(f)}if(n){const f=n(c);f&&(d=!1),h.setText(f)}if(o){const f=o(c);f&&(d=!1),h.setImage(f)}return a&&h.setZIndex(a(c)),d?null:h}}function Dr(r,t,e){const i=Ju(r,t+"fill-color",e);if(!i)return null;const n=new ao;return function(o){const a=i(o);return a==="none"?null:(n.setColor(a),n)}}function Or(r,t,e){const i=le(r,t+"stroke-width",e),n=Ju(r,t+"stroke-color",e);if(!i&&!n)return null;const o=Pi(r,t+"stroke-line-cap",e),a=Pi(r,t+"stroke-line-join",e),h=Qu(r,t+"stroke-line-dash",e),c=le(r,t+"stroke-line-dash-offset",e),d=le(r,t+"stroke-miter-limit",e),f=new lo;return function(_){if(n){const m=n(_);if(m==="none")return null;f.setColor(m)}if(i&&f.setWidth(i(_)),o){const m=o(_);if(m!=="butt"&&m!=="round"&&m!=="square")throw new Error("Expected butt, round, or square line cap");f.setLineCap(m)}if(a){const m=a(_);if(m!=="bevel"&&m!=="round"&&m!=="miter")throw new Error("Expected bevel, round, or miter line join");f.setLineJoin(m)}return h&&f.setLineDash(h(_)),c&&f.setLineDashOffset(c(_)),d&&f.setMiterLimit(d(_)),f}}function Vv(r,t){const e="text-",i=Pi(r,e+"value",t);if(!i)return null;const n=Dr(r,e,t),o=Dr(r,e+"background-",t),a=Or(r,e,t),h=Or(r,e+"background-",t),c=Pi(r,e+"font",t),d=le(r,e+"max-angle",t),f=le(r,e+"offset-x",t),_=le(r,e+"offset-y",t),m=Fr(r,e+"overflow",t),v=Pi(r,e+"placement",t),y=le(r,e+"repeat",t),E=go(r,e+"scale",t),b=Fr(r,e+"rotate-with-view",t),S=le(r,e+"rotation",t),w=Pi(r,e+"align",t),T=Pi(r,e+"justify",t),P=Pi(r,e+"baseline",t),M=Qu(r,e+"padding",t),I=new Vu({});return function(D){if(I.setText(i(D)),n&&I.setFill(n(D)),o&&I.setBackgroundFill(o(D)),a&&I.setStroke(a(D)),h&&I.setBackgroundStroke(h(D)),c&&I.setFont(c(D)),d&&I.setMaxAngle(d(D)),f&&I.setOffsetX(f(D)),_&&I.setOffsetY(_(D)),m&&I.setOverflow(m(D)),v){const z=v(D);if(z!=="point"&&z!=="line")throw new Error("Expected point or line for text-placement");I.setPlacement(z)}if(y&&I.setRepeat(y(D)),E&&I.setScale(E(D)),b&&I.setRotateWithView(b(D)),S&&I.setRotation(S(D)),w){const z=w(D);if(z!=="left"&&z!=="center"&&z!=="right"&&z!=="end"&&z!=="start")throw new Error("Expected left, right, center, start, or end for text-align");I.setTextAlign(z)}if(T){const z=T(D);if(z!=="left"&&z!=="right"&&z!=="center")throw new Error("Expected left, right, or center for text-justify");I.setJustify(z)}if(P){const z=P(D);if(z!=="bottom"&&z!=="top"&&z!=="middle"&&z!=="alphabetic"&&z!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");I.setTextBaseline(z)}return M&&I.setPadding(M(D)),I}}function Xv(r,t){return"icon-src"in r?Yv(r,t):"shape-points"in r?Kv(r,t):"circle-radius"in r?qv(r,t):null}function Yv(r,t){const e="icon-",i=e+"src",n=id(r[i],i),o=fo(r,e+"anchor",t),a=go(r,e+"scale",t),h=le(r,e+"opacity",t),c=fo(r,e+"displacement",t),d=le(r,e+"rotation",t),f=Fr(r,e+"rotate-with-view",t),_=td(r,e+"anchor-origin"),m=ed(r,e+"anchor-x-units"),v=ed(r,e+"anchor-y-units"),y=tx(r,e+"color"),E=Jv(r,e+"cross-origin"),b=Qv(r,e+"offset"),S=td(r,e+"offset-origin"),w=Nn(r,e+"width"),T=Nn(r,e+"height"),P=$v(r,e+"size"),M=vl(r,e+"declutter"),I=new _l({src:n,anchorOrigin:_,anchorXUnits:m,anchorYUnits:v,color:y,crossOrigin:E,offset:b,offsetOrigin:S,height:T,width:w,size:P,declutterMode:M});return function(D){return h&&I.setOpacity(h(D)),c&&I.setDisplacement(c(D)),d&&I.setRotation(d(D)),f&&I.setRotateWithView(f(D)),a&&I.setScale(a(D)),o&&I.setAnchor(o(D)),I}}function Kv(r,t){const e="shape-",i=e+"points",n=nd(r[i],i),o=Dr(r,e,t),a=Or(r,e,t),h=go(r,e+"scale",t),c=fo(r,e+"displacement",t),d=le(r,e+"rotation",t),f=Fr(r,e+"rotate-with-view",t),_=Nn(r,e+"radius"),m=Nn(r,e+"radius1"),v=Nn(r,e+"radius2"),y=Nn(r,e+"angle"),E=vl(r,e+"declutter-mode"),b=new Zu({points:n,radius:_,radius1:m,radius2:v,angle:y,declutterMode:E});return function(S){return o&&b.setFill(o(S)),a&&b.setStroke(a(S)),c&&b.setDisplacement(c(S)),d&&b.setRotation(d(S)),f&&b.setRotateWithView(f(S)),h&&b.setScale(h(S)),b}}function qv(r,t){const e="circle-",i=Dr(r,e,t),n=Or(r,e,t),o=le(r,e+"radius",t),a=go(r,e+"scale",t),h=fo(r,e+"displacement",t),c=le(r,e+"rotation",t),d=Fr(r,e+"rotate-with-view",t),f=vl(r,e+"declutter-mode"),_=new ju({radius:5,declutterMode:f});return function(m){return o&&_.setRadius(o(m)),i&&_.setFill(i(m)),n&&_.setStroke(n(m)),h&&_.setDisplacement(h(m)),c&&_.setRotation(c(m)),d&&_.setRotateWithView(d(m)),a&&_.setScale(a(m)),_}}function le(r,t,e){if(!(t in r))return;const i=Si(r[t],dt,e);return function(n){return nd(i(n),t)}}function Pi(r,t,e){if(!(t in r))return null;const i=Si(r[t],zn,e);return function(n){return id(i(n),t)}}function Fr(r,t,e){if(!(t in r))return null;const i=Si(r[t],Jt,e);return function(n){const o=i(n);if(typeof o!="boolean")throw new Error(`Expected a boolean for ${t}`);return o}}function Ju(r,t,e){if(!(t in r))return null;const i=Si(r[t],ml|zn,e);return function(n){return rd(i(n),t)}}function Qu(r,t,e){if(!(t in r))return null;const i=Si(r[t],Ar,e);return function(n){return zr(i(n),t)}}function fo(r,t,e){if(!(t in r))return null;const i=Si(r[t],Ar,e);return function(n){const o=zr(i(n),t);if(o.length!==2)throw new Error(`Expected two numbers for ${t}`);return o}}function go(r,t,e){if(!(t in r))return null;const i=Si(r[t],Ar|dt,e);return function(n){return ex(i(n),t)}}function Nn(r,t){const e=r[t];if(e!==void 0){if(typeof e!="number")throw new Error(`Expected a number for ${t}`);return e}}function $v(r,t){const e=r[t];if(e!==void 0){if(typeof e=="number")return pe(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 Jv(r,t){const e=r[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);return e}}function td(r,t){const e=r[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 ed(r,t){const e=r[t];if(e!==void 0){if(e!=="pixels"&&e!=="fraction")throw new Error(`Expected pixels or fraction for ${t}`);return e}}function Qv(r,t){const e=r[t];if(e!==void 0)return zr(e,t)}function vl(r,t){const e=r[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 tx(r,t){const e=r[t];if(e!==void 0)return rd(e,t)}function zr(r,t){if(!Array.isArray(r))throw new Error(`Expected an array for ${t}`);const e=r.length;for(let i=0;i<e;++i)if(typeof r[i]!="number")throw new Error(`Expected an array of numbers for ${t}`);return r}function id(r,t){if(typeof r!="string")throw new Error(`Expected a string for ${t}`);return r}function nd(r,t){if(typeof r!="number")throw new Error(`Expected a number for ${t}`);return r}function rd(r,t){if(typeof r=="string")return r;const e=zr(r,t),i=e.length;if(i<3||i>4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function ex(r,t){if(typeof r=="number")return r;const e=zr(r,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}const sd={RENDER_ORDER:"renderOrder"};class ix extends Ks{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!==void 0?t.declutter:!1,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(sd.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t){t.declutterTree||(t.declutterTree=new kh(9)),this.getRenderer().renderDeclutter(t)}setRenderOrder(t){this.set(sd.RENDER_ORDER,t)}setStyle(t){this.style_=nx(t),this.styleFunction_=t===null?void 0:Ev(this.style_),this.changed()}}function nx(r){if(r===void 0)return wv;if(!r)return null;if(typeof r=="function"||r instanceof On)return r;if(!Array.isArray(r))return $u([r]);if(r.length===0)return[];const t=r.length,e=r[0];if(e instanceof On){const n=new Array(t);for(let o=0;o<t;++o){const a=r[o];if(!(a instanceof On))throw new Error("Expected a list of style instances");n[o]=a}return n}if("style"in e){const n=new Array(t);for(let o=0;o<t;++o){const a=r[o];if(!("style"in a))throw new Error("Expected a list of rules with a style property");n[o]=a}return Wv(n)}return $u(r)}const xl=ix,ee={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"},El=34962,wl=34963,rx=35040,sx=35044,Ll=35048,ox=5121,ax=5123,lx=5125,od=5126,ad=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function hx(r,t){t=Object.assign({preserveDrawingBuffer:!0,antialias:!ym},t);const e=ad.length;for(let i=0;i<e;++i)try{const n=r.getContext(ad[i],t);if(n)return n}catch{}return null}const cx={STATIC_DRAW:sx,STREAM_DRAW:rx,DYNAMIC_DRAW:Ll};class ux{constructor(t,e){this.array=null,this.type=t,ft(t===El||t===wl,"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`"),this.usage=e!==void 0?e:cx.STATIC_DRAW}ofSize(t){return this.array=new(bl(this.type))(t),this}fromArray(t){return this.array=bl(this.type).from(t),this}fromArrayBuffer(t){return this.array=new(bl(this.type))(t),this}getType(){return this.type}getArray(){return this.array}getUsage(){return this.usage}getSize(){return this.array?this.array.length:0}}function bl(r){switch(r){case El:return Float32Array;case wl:return Uint32Array;default:return Float32Array}}const ld=ux;class dx extends yc{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.declutterExecutorGroup=null}getFeatures(t){return it()}getData(t){return null}prepareFrame(t){return it()}renderFrame(t,e){return it()}loadedTileCallback(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i}createLoadedTileFinder(t,e,i){return(n,o)=>{const a=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,o,a)}}forEachFeatureAtCoordinate(t,e,i,n,o){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===Ct.LOADED||e.getState()===Ct.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=Ct.LOADED&&e!=Ct.ERROR&&t.addEventListener(rt.CHANGE,this.boundHandleImageChange_),e==Ct.IDLE&&(t.load(),e=t.getState()),e==Ct.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}disposeInternal(){delete this.layer_,super.disposeInternal()}}const hd=dx,_o={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"},fx=`
20
+ `+v;si.get(b)===void 0&&(si.set(b,100,!0),h(f.style,f.weight,v)||(si.set(b,0,!0),o===void 0&&(o=setInterval(c,32))))}}}(),Jm=function(){let r;return function(t){let e=Ha[t];if(e==null){if(Ra){const i=gu(t),n=mu(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else r||(r=document.createElement("div"),r.innerHTML="M",r.style.minHeight="0",r.style.maxHeight="none",r.style.height="auto",r.style.padding="0",r.style.border="none",r.style.position="absolute",r.style.display="block",r.style.left="-99999px"),r.style.font=t,document.body.appendChild(r),e=r.offsetHeight,document.body.removeChild(r);Ha[t]=e}return e}}();function mu(r,t){return Mn||(Mn=$t(1,1)),r!=Wa&&(Mn.font=r,Wa=Mn.font),Mn.measureText(t)}function Ys(r,t){return mu(r,t).width}function yu(r,t,e){if(t in e)return e[t];const i=t.split(`
21
+ `).reduce((n,o)=>Math.max(n,Ys(r,o)),0);return e[t]=i,i}function Qm(r,t){const e=[],i=[],n=[];let o=0,a=0,h=0,c=0;for(let d=0,f=t.length;d<=f;d+=2){const _=t[d];if(_===`
22
+ `||d===f){o=Math.max(o,a),n.push(a),a=0,h+=c;continue}const m=t[d+1]||r.font,E=Ys(m,_);e.push(E),a+=E;const v=Jm(m);i.push(v),c=Math.max(c,v)}return{width:o,height:h,widths:e,heights:i,lineWidths:n}}function ty(r,t,e,i,n,o,a,h,c,d,f){r.save(),e!==1&&(r.globalAlpha*=e),t&&r.transform.apply(r,t),i.contextInstructions?(r.translate(c,d),r.scale(f[0],f[1]),ey(i,r)):f[0]<0||f[1]<0?(r.translate(c,d),r.scale(f[0],f[1]),r.drawImage(i,n,o,a,h,0,0,a,h)):r.drawImage(i,n,o,a,h,c,d,a*f[0],h*f[1]),r.restore()}function ey(r,t){const e=r.contextInstructions;for(let i=0,n=e.length;i<n;i+=2)Array.isArray(e[i+1])?t[e[i]].apply(t,e[i+1]):t[e[i]]=e[i+1]}class iy extends Wm{constructor(t){super(t),this.fontChangeListenerKey_=ut(si,vn.PROPERTYCHANGE,t.redrawText.bind(t)),this.element_=document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=xr+" ol-layers";const i=t.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0,this.declutterLayers_=[]}dispatchRenderEvent(t,e){const i=this.getMap();if(i.hasListener(t)){const n=new vr(t,void 0,e);i.dispatchEvent(n)}}disposeInternal(){wt(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),super.disposeInternal()}renderFrame(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(qt.PRECOMPOSE,t);const e=t.layerStatesArray.sort(function(a,h){return a.zIndex-h.zIndex}),i=t.viewState;this.children_.length=0;const n=this.declutterLayers_;n.length=0;let o=null;for(let a=0,h=e.length;a<h;++a){const c=e[a];t.layerIndex=a;const d=c.layer,f=d.getSourceState();if(!ja(c,i)||f!="ready"&&f!="undefined"){d.unrender();continue}const _=d.render(t,o);_&&(_!==o&&(this.children_.push(_),o=_),"getDeclutter"in d&&n.push(d))}this.flushDeclutterItems(t),qm(this.element_,this.children_),this.dispatchRenderEvent(qt.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}flushDeclutterItems(t){const e=this.declutterLayers_;for(let i=e.length-1;i>=0;--i)e[i].renderDeclutter(t);e.length=0}}const ny=iy;class bi extends Qe{constructor(t,e){super(t),this.layer=e}}const Va={LAYERS:"layers"};class Xa extends cu{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let i=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Va.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new Ge(i.slice(),{unique:!0}):gt(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new Ge(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(wt),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(ut(t,oe.ADD,this.handleLayersAdd_,this),ut(t,oe.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(wt);En(this.listenerKeys_);const e=t.getArray();for(let i=0,n=e.length;i<n;i++){const o=e[i];this.registerLayerListeners_(o),this.dispatchEvent(new bi("addlayer",o))}this.changed()}registerLayerListeners_(t){const e=[ut(t,vn.PROPERTYCHANGE,this.handleLayerChange_,this),ut(t,at.CHANGE,this.handleLayerChange_,this)];t instanceof Xa&&e.push(ut(t,"addlayer",this.handleLayerGroupAdd_,this),ut(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[ht(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new bi("addlayer",t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new bi("removelayer",t.layer))}handleLayersAdd_(t){const e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new bi("addlayer",e)),this.changed()}handleLayersRemove_(t){const e=t.element,i=ht(e);this.listenerKeys_[i].forEach(wt),delete this.listenerKeys_[i],this.dispatchEvent(new bi("removelayer",e)),this.changed()}getLayers(){return this.get(Va.LAYERS)}setLayers(t){const e=this.getLayers();if(e){const i=e.getArray();for(let n=0,o=i.length;n<o;++n)this.dispatchEvent(new bi("removelayer",i[n]))}this.set(Va.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:[],i=e.length;this.getLayers().forEach(function(a){a.getLayerStatesArray(e)});const n=this.getLayerState();let o=n.zIndex;!t&&n.zIndex===void 0&&(o=0);for(let a=i,h=e.length;a<h;a++){const c=e[a];c.opacity*=n.opacity,c.visible=c.visible&&n.visible,c.maxResolution=Math.min(c.maxResolution,n.maxResolution),c.minResolution=Math.max(c.minResolution,n.minResolution),c.minZoom=Math.max(c.minZoom,n.minZoom),c.maxZoom=Math.min(c.maxZoom,n.maxZoom),n.extent!==void 0&&(c.extent!==void 0?c.extent=_r(c.extent,n.extent):c.extent=n.extent),c.zIndex===void 0&&(c.zIndex=o)}return e}getSourceState(){return"ready"}}const Ks=Xa;class ry extends Qe{constructor(t,e,i){super(t),this.map=e,this.frameState=i!==void 0?i:null}}const In=ry;class sy extends In{constructor(t,e,i,n,o,a){super(t,e,o),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=n!==void 0?n:!1,this.activePointers=a}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 Ti=sy,Mt={SINGLECLICK:"singleclick",CLICK:at.CLICK,DBLCLICK:at.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Ya={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};class oy extends ps{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 i=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=ut(i,Ya.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=ut(i,Ya.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(at.TOUCHMOVE,this.boundHandleTouchMove_,zc?{passive:!1}:!1)}emulateClick_(t){let e=new Ti(Mt.CLICK,this.map_,t);this.dispatchEvent(e),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Ti(Mt.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const i=new Ti(Mt.SINGLECLICK,this.map_,t);this.dispatchEvent(i)},250)}updateActivePointers_(t){const e=t,i=e.pointerId;if(e.type==Mt.POINTERUP||e.type==Mt.POINTERCANCEL){delete this.trackedTouches_[i];for(const n in this.trackedTouches_)if(this.trackedTouches_[n].target!==e.target){delete this.trackedTouches_[n];break}}else(e.type==Mt.POINTERDOWN||e.type==Mt.POINTERMOVE)&&(this.trackedTouches_[i]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new Ti(Mt.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(wt),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 Ti(Mt.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 i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(ut(i,Mt.POINTERMOVE,this.handlePointerMove_,this),ut(i,Mt.POINTERUP,this.handlePointerUp_,this),ut(this.element_,Mt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(ut(this.element_.getRootNode(),Mt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new Ti(Mt.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 Ti(Mt.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_&&(wt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(at.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(wt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(wt),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const ay=oy,oi={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},jt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},qs=1/0;class ly{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,En(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,i=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const n=this.keyFunction_(i);return delete this.queuedElements_[n],i}enqueue(t){gt(!(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!=qs?(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_,i=this.priorities_,n=e.length,o=e[t],a=i[t],h=t;for(;t<n>>1;){const c=this.getLeftChildIndex_(t),d=this.getRightChildIndex_(t),f=d<n&&i[d]<i[c]?d:c;e[t]=e[f],i[t]=i[f],t=f}e[t]=o,i[t]=a,this.siftDown_(h,t)}siftDown_(t,e){const i=this.elements_,n=this.priorities_,o=i[e],a=n[e];for(;e>t;){const h=this.getParentIndex_(e);if(n[h]>a)i[e]=i[h],n[e]=n[h],e=h;else break}i[e]=o,n[e]=a}reprioritize(){const t=this.priorityFunction_,e=this.elements_,i=this.priorities_;let n=0;const o=e.length;let a,h,c;for(h=0;h<o;++h)a=e[h],c=t(a),c==qs?delete this.queuedElements_[this.keyFunction_(a)]:(i[n]=c,e[n++]=a);e.length=n,i.length=n,this.heapify_()}}const hy=ly,Q={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class cy extends hy{constructor(t,e){super(function(i){return t.apply(null,i)},function(i){return i[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(at.CHANGE,this.boundHandleTileChange_),e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target,i=e.getState();if(i===Q.LOADED||i===Q.ERROR||i===Q.EMPTY){i!==Q.ERROR&&e.removeEventListener(at.CHANGE,this.boundHandleTileChange_);const n=e.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let i=0,n,o,a;for(;this.tilesLoading_<t&&i<e&&this.getCount()>0;)o=this.dequeue()[0],a=o.getKey(),n=o.getState(),n===Q.IDLE&&!(a in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[a]=!0,++this.tilesLoading_,++i,o.load())}}const uy=cy;function dy(r,t,e,i,n){if(!r||!(e in r.wantedTiles)||!r.wantedTiles[e][t.getKey()])return qs;const o=r.viewState.center,a=i[0]-o[0],h=i[1]-o[1];return 65536*Math.log(n)+Math.sqrt(a*a+h*h)/n}class fy extends be{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(){Vs(this.element),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&Vs(this.element);for(let e=0,i=this.listenerKeys.length;e<i;++e)wt(this.listenerKeys[e]);this.listenerKeys.length=0,this.map_=t,t&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==xn&&this.listenerKeys.push(ut(t,oi.POSTRENDER,this.render,this)),t.render())}render(t){}setTarget(t){this.target_=typeof t=="string"?document.getElementById(t):t}}const $s=fy;class gy extends $s{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);const e=t.className!==void 0?t.className:"ol-attribution",i=t.tipLabel!==void 0?t.tipLabel:"Attributions",n=t.expandClassName!==void 0?t.expandClassName:e+"-expand",o=t.collapseLabel!==void 0?t.collapseLabel:"›",a=t.collapseClassName!==void 0?t.collapseClassName:e+"-collapse";typeof o=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=o,this.collapseLabel_.className=a):this.collapseLabel_=o;const h=t.label!==void 0?t.label:"i";typeof h=="string"?(this.label_=document.createElement("span"),this.label_.textContent=h,this.label_.className=n):this.label_=h;const c=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(c),this.toggleButton_.addEventListener(at.CLICK,this.handleClick_.bind(this),!1);const d=e+" "+xr+" "+js+(this.collapsed_&&this.collapsible_?" "+du:"")+(this.collapsible_?"":" ol-uncollapsible"),f=this.element;f.className=d,f.appendChild(this.toggleButton_),f.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){const e=Array.from(new Set(this.getMap().getAllLayers().flatMap(n=>n.getAttributions(t)))),i=!this.getMap().getAllLayers().some(n=>n.getSource()&&n.getSource().getAttributionsCollapsible()===!1);return this.overrideCollapsible_||this.setCollapsible(i),e}updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!ei(e,this.renderedAttributions_)){_u(this.ulElement_);for(let n=0,o=e.length;n<o;++n){const a=document.createElement("li");a.innerHTML=e[n],this.ulElement_.appendChild(a)}this.renderedAttributions_=e}}handleClick_(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(du),this.collapsed_?Hs(this.collapseLabel_,this.label_):Hs(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)}}const vu=gy;class _y extends $s{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",i=t.label!==void 0?t.label:"⇧",n=t.compassClassName!==void 0?t.compassClassName:"ol-compass";this.label_=null,typeof i=="string"?(this.label_=document.createElement("span"),this.label_.className=n,this.label_.textContent=i):(this.label_=i,this.label_.classList.add(n));const o=t.tipLabel?t.tipLabel:"Reset rotation",a=document.createElement("button");a.className=e+"-reset",a.setAttribute("type","button"),a.title=o,a.appendChild(this.label_),a.addEventListener(at.CLICK,this.handleClick_.bind(this),!1);const h=e+" "+xr+" "+js,c=this.element;c.className=h,c.appendChild(a),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(Zs)}handleClick_(t){t.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const e=this.getMap().getView();if(!e)return;const i=e.getRotation();i!==void 0&&(this.duration_>0&&i%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:Pn}):e.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const i=e.viewState.rotation;if(i!=this.rotation_){const n="rotate("+i+"rad)";if(this.autoHide_){const o=this.element.classList.contains(Zs);!o&&i===0?this.element.classList.add(Zs):o&&i!==0&&this.element.classList.remove(Zs)}this.label_.style.transform=n}this.rotation_=i}}const py=_y;class my extends $s{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=t.className!==void 0?t.className:"ol-zoom",i=t.delta!==void 0?t.delta:1,n=t.zoomInClassName!==void 0?t.zoomInClassName:e+"-in",o=t.zoomOutClassName!==void 0?t.zoomOutClassName:e+"-out",a=t.zoomInLabel!==void 0?t.zoomInLabel:"+",h=t.zoomOutLabel!==void 0?t.zoomOutLabel:"–",c=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",d=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",f=document.createElement("button");f.className=n,f.setAttribute("type","button"),f.title=c,f.appendChild(typeof a=="string"?document.createTextNode(a):a),f.addEventListener(at.CLICK,this.handleClick_.bind(this,i),!1);const _=document.createElement("button");_.className=o,_.setAttribute("type","button"),_.title=d,_.appendChild(typeof h=="string"?document.createTextNode(h):h),_.addEventListener(at.CLICK,this.handleClick_.bind(this,-i),!1);const m=e+" "+xr+" "+js,E=this.element;E.className=m,E.appendChild(f),E.appendChild(_),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const i=this.getMap().getView();if(!i)return;const n=i.getZoom();if(n!==void 0){const o=i.getConstrainedZoom(n+t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:o,duration:this.duration_,easing:Pn})):i.setZoom(o)}}}const yy=my;function xu(r){r=r||{};const t=new Ge;return(r.zoom!==void 0?r.zoom:!0)&&t.push(new yy(r.zoomOptions)),(r.rotate!==void 0?r.rotate:!0)&&t.push(new py(r.rotateOptions)),(r.attribution!==void 0?r.attribution:!0)&&t.push(new vu(r.attributionOptions)),t}const Eu={ACTIVE:"active"};class vy extends be{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(Eu.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(Eu.ACTIVE,t)}setMap(t){this.map_=t}}function xy(r,t,e){const i=r.getCenterInternal();if(i){const n=[i[0]+t[0],i[1]+t[1]];r.animateInternal({duration:e!==void 0?e:250,easing:Jp,center:r.getConstrainedCenter(n)})}}function Ka(r,t,e,i){const n=r.getZoom();if(n===void 0)return;const o=r.getConstrainedZoom(n+t),a=r.getResolutionForZoom(o);r.getAnimating()&&r.cancelAnimations(),r.animate({resolution:a,anchor:e,duration:i!==void 0?i:250,easing:Pn})}const Tr=vy;class Ey extends Tr{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==Mt.DBLCLICK){const i=t.originalEvent,n=t.map,o=t.coordinate,a=i.shiftKey?-this.delta_:this.delta_,h=n.getView();Ka(h,a,o,this.duration_),i.preventDefault(),e=!0}return!e}}const wy=Ey;class Ly extends Tr{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==Mt.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Mt.POINTERUP){const i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==Mt.POINTERDOWN){const i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==Mt.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 qa(r){const t=r.length;let e=0,i=0;for(let n=0;n<t;n++)e+=r[n].clientX,i+=r[n].clientY;return{clientX:e/t,clientY:i/t}}const Cr=Ly;function $a(r){const t=arguments;return function(e){let i=!0;for(let n=0,o=t.length;n<o&&(i=i&&t[n](e),!!i);++n);return i}}const by=function(r){const t=r.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},Ty=function(r){const t=r.map.getTargetElement(),e=r.map.getOwnerDocument().activeElement;return t.contains(e)},wu=function(r){return r.map.getTargetElement().hasAttribute("tabindex")?Ty(r):!0},Cy=cr,Lu=function(r){const t=r.originalEvent;return t.button==0&&!(em&&Dc&&t.ctrlKey)},bu=function(r){const t=r.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},Sy=function(r){const t=r.originalEvent;return Dc?t.metaKey:t.ctrlKey},Py=function(r){const t=r.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},Tu=function(r){const t=r.originalEvent,e=t.target.tagName;return e!=="INPUT"&&e!=="SELECT"&&e!=="TEXTAREA"&&!t.target.isContentEditable},Ja=function(r){const t=r.originalEvent;return gt(t!==void 0,"mapBrowserEvent must originate from a pointer event"),t.pointerType=="mouse"},ky=function(r){const t=r.originalEvent;return gt(t!==void 0,"mapBrowserEvent must originate from a pointer event"),t.isPrimary&&t.button===0};class Ry extends Cr{constructor(t){super({stopDown:_s}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const e=t.condition?t.condition:$a(bu,ky);this.condition_=t.onFocusOnly?$a(wu,e):e,this.noKinetic_=!1}handleDragEvent(t){const e=t.map;this.panning_||(this.panning_=!0,e.getView().beginInteraction());const i=this.targetPointers,n=e.getEventPixel(qa(i));if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){const o=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],h=t.map.getView();Np(o,h.getResolution()),Ea(o,h.getRotation()),h.adjustCenterInternal(o)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=i.length,t.originalEvent.preventDefault()}handleUpEvent(t){const e=t.map,i=e.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const n=this.kinetic_.getDistance(),o=this.kinetic_.getAngle(),a=i.getCenterInternal(),h=e.getPixelFromCoordinateInternal(a),c=e.getCoordinateFromPixelInternal([h[0]-n*Math.cos(o),h[1]-n*Math.sin(o)]);i.animateInternal({center:i.getConstrainedCenter(c),duration:500,easing:Pn})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){const i=t.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}const My=Ry;class Iy extends Cr{constructor(t){t=t||{},super({stopDown:_s}),this.condition_=t.condition?t.condition:by,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!Ja(t))return;const e=t.map,i=e.getView();if(i.getConstraints().rotation===ka)return;const n=e.getSize(),o=t.pixel,a=Math.atan2(n[1]/2-o[1],o[0]-n[0]/2);if(this.lastAngle_!==void 0){const h=a-this.lastAngle_;i.adjustRotationInternal(-h)}this.lastAngle_=a}handleUpEvent(t){return Ja(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return Ja(t)&&Lu(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}const Ay=Iy;class Dy extends gs{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_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i}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(){const t=this.startPixel_,e=this.endPixel_,n=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new zs([n])}getGeometry(){return this.geometry_}}const Oy=Dy,Js={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class Qa extends Qe{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}}class Fy extends Cr{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.box_=new Oy(t.className||"ol-dragbox"),this.minArea_=t.minArea!==void 0?t.minArea:64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition?t.condition:Lu,this.boxEndCondition_=t.boxEndCondition?t.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,i){const n=i[0]-e[0],o=i[1]-e[1];return n*n+o*o>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Qa(Js.BOXDRAG,t.coordinate,t))}handleUpEvent(t){this.box_.setMap(null);const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Qa(e?Js.BOXEND:Js.BOXCANCEL,t.coordinate,t)),!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 Qa(Js.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}}const zy=Fy;class Ny extends zy{constructor(t){t=t||{};const e=t.condition?t.condition:Py;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 i=this.getMap().getView();let n=this.getGeometry();if(this.out_){const o=i.rotatedExtentForGeometry(n),a=i.getResolutionForExtentInternal(o),h=i.getResolution()/a;n=n.clone(),n.scale(h*h)}i.fitInternal(n,{duration:this.duration_,easing:Pn})}}const By=Ny,on={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class Gy extends Tr{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return bu(e)&&Tu(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==at.KEYDOWN){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&(n==on.DOWN||n==on.LEFT||n==on.RIGHT||n==on.UP)){const a=t.map.getView(),h=a.getResolution()*this.pixelDelta_;let c=0,d=0;n==on.DOWN?d=-h:n==on.LEFT?c=-h:n==on.RIGHT?c=h:d=h;const f=[c,d];Ea(f,a.getRotation()),xy(a,f,this.duration_),i.preventDefault(),e=!0}}return!e}}const Uy=Gy;class Zy extends Tr{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(e){return!Sy(e)&&Tu(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==at.KEYDOWN||t.type==at.KEYPRESS){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&(n==="+"||n==="-")){const o=t.map,a=n==="+"?this.delta_:-this.delta_,h=o.getView();Ka(h,a,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}}const jy=Zy;class Wy{constructor(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,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 i=e-3;for(;i>0&&this.points_[i+2]>t;)i-=3;const n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;const o=this.points_[e]-this.points_[i],a=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(a,o),this.initialVelocity_=Math.sqrt(o*o+a*a)/n,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const Hy=Wy;class Vy extends Tr{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:Cy;this.condition_=t.onFocusOnly?$a(wu,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_)}handleEvent(t){if(!this.condition_(t)||t.type!==at.WHEEL)return!0;const i=t.map,n=t.originalEvent;n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);let o;if(t.type==at.WHEEL&&(o=n.deltaY,Qp&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(o/=Oc),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(o*=40)),o===0)return!1;this.lastDelta_=o;const a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(o)<4?"trackpad":"wheel");const h=i.getView();if(this.mode_==="trackpad"&&!(h.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(h.getAnimating()&&h.cancelAnimations(),h.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),h.adjustZoom(-o/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=a,!1;this.totalDelta_+=o;const c=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),c),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let i=-It(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Ka(e,i,this.lastAnchor_,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)}}const Xy=Vy;class Yy extends Cr{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=_s),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 i=this.targetPointers[0],n=this.targetPointers[1],o=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(this.lastAngle_!==void 0){const c=o-this.lastAngle_;this.rotationDelta_+=c,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=c}this.lastAngle_=o;const a=t.map,h=a.getView();h.getConstraints().rotation!==ka&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(qa(this.targetPointers))),this.rotating_&&(a.render(),h.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}}const Ky=Yy;class qy extends Cr{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=_s),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 i=this.targetPointers[0],n=this.targetPointers[1],o=i.clientX-n.clientX,a=i.clientY-n.clientY,h=Math.sqrt(o*o+a*a);this.lastDistance_!==void 0&&(e=this.lastDistance_/h),this.lastDistance_=h;const c=t.map,d=c.getView();e!=1&&(this.lastScaleDelta_=e),this.anchor_=c.getCoordinateFromPixelInternal(c.getEventPixel(qa(this.targetPointers))),c.render(),d.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const i=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,n),!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}}const $y=qy;function Jy(r){r=r||{};const t=new Ge,e=new Hy(-.005,.05,100);return(r.altShiftDragRotate!==void 0?r.altShiftDragRotate:!0)&&t.push(new Ay),(r.doubleClickZoom!==void 0?r.doubleClickZoom:!0)&&t.push(new wy({delta:r.zoomDelta,duration:r.zoomDuration})),(r.dragPan!==void 0?r.dragPan:!0)&&t.push(new My({onFocusOnly:r.onFocusOnly,kinetic:e})),(r.pinchRotate!==void 0?r.pinchRotate:!0)&&t.push(new Ky),(r.pinchZoom!==void 0?r.pinchZoom:!0)&&t.push(new $y({duration:r.zoomDuration})),(r.keyboard!==void 0?r.keyboard:!0)&&(t.push(new Uy),t.push(new jy({delta:r.zoomDelta,duration:r.zoomDuration}))),(r.mouseWheelZoom!==void 0?r.mouseWheelZoom:!0)&&t.push(new Xy({onFocusOnly:r.onFocusOnly,duration:r.zoomDuration})),(r.shiftDragZoom!==void 0?r.shiftDragZoom:!0)&&t.push(new By({duration:r.zoomDuration})),t}function Cu(r){return r[0]>0&&r[1]>0}function Qy(r,t,e){return e===void 0&&(e=[0,0]),e[0]=r[0]*t+.5|0,e[1]=r[1]*t+.5|0,e}function pe(r,t){return Array.isArray(r)?r:(t===void 0?t=[r,r]:(t[0]=r,t[1]=r),t)}function Su(r){if(r instanceof Us){r.setMapInternal(null);return}r instanceof Ks&&r.getLayers().forEach(Su)}function Pu(r,t){if(r instanceof Us){r.setMapInternal(t);return}if(r instanceof Ks){const e=r.getLayers().getArray();for(let i=0,n=e.length;i<n;++i)Pu(e[i],t)}}class tv extends be{constructor(t){super(),t=t||{},this.on,this.once,this.un;const e=ev(t);this.renderComplete_,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:Oc,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=Vt(),this.pixelToCoordinateTransform_=Vt(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,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,this.resizeObserver_=new ResizeObserver(()=>this.updateSize()),this.controls=e.controls||xu(),this.interactions=e.interactions||Jy({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new uy(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(jt.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(jt.VIEW,this.handleViewChanged_),this.addChangeListener(jt.SIZE,this.handleSizeChanged_),this.addChangeListener(jt.TARGET,this.handleTargetChanged_),this.setProperties(e.values);const i=this;t.view&&!(t.view instanceof Be)&&t.view.then(function(n){i.setView(new Be(n))}),this.controls.addEventListener(oe.ADD,n=>{n.element.setMap(this)}),this.controls.addEventListener(oe.REMOVE,n=>{n.element.setMap(null)}),this.interactions.addEventListener(oe.ADD,n=>{n.element.setMap(this)}),this.interactions.addEventListener(oe.REMOVE,n=>{n.element.setMap(null)}),this.overlays_.addEventListener(oe.ADD,n=>{this.addOverlayInternal_(n.element)}),this.overlays_.addEventListener(oe.REMOVE,n=>{const o=n.element.getId();o!==void 0&&delete this.overlayIdIndex_[o.toString()],n.element.setMap(null)}),this.controls.forEach(n=>{n.setMap(this)}),this.interactions.forEach(n=>{n.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){Pu(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,i){if(!this.frameState_||!this.renderer_)return;const n=this.getCoordinateFromPixelInternal(t);i=i!==void 0?i:{};const o=i.hitTolerance!==void 0?i.hitTolerance:0,a=i.layerFilter!==void 0?i.layerFilter:cr,h=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,o,h,e,null,a,null)}getFeaturesAtPixel(t,e){const i=[];return this.forEachFeatureAtPixel(t,function(n){i.push(n)},e),i}getAllLayers(){const t=[];function e(i){i.forEach(function(n){n instanceof Ks?e(n.getLayers()):t.push(n)})}return e(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};const n=e.layerFilter!==void 0?e.layerFilter:cr,o=e.hitTolerance!==void 0?e.hitTolerance:0,a=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,o,a,n,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const i=this.viewport_.getBoundingClientRect(),n=this.getSize(),o=i.width/n[0],a=i.height/n[1],h="changedTouches"in t?t.changedTouches[0]:t;return[(h.clientX-i.left)/o,(h.clientY-i.top)/a]}getTarget(){return this.get(jt.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return Ca(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?Ot(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(jt.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof Ge){e.setLayers(t);return}const i=e.getLayers();i.clear(),i.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e<i;++e){const n=t[e];if(!n.visible)continue;const o=n.layer.getRenderer();if(o&&!o.ready)return!0;const a=n.layer.getSource();if(a&&a.loading)return!0}return!1}getPixelFromCoordinate(t){const e=ii(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){const e=this.frameState_;return e?Ot(e.coordinateToPixelTransform,t.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(jt.SIZE)}getView(){return this.get(jt.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,i,n){return dy(this.frameState_,t,e,i,n)}handleBrowserEvent(t,e){e=e||t.type;const i=new Ti(e,this,t);this.handleMapBrowserEvent(i)}handleMapBrowserEvent(t){if(!this.frameState_)return;const e=t.originalEvent,i=e.type;if(i===Ya.POINTERDOWN||i===at.WHEEL||i===at.KEYDOWN){const n=this.getOwnerDocument(),o=this.viewport_.getRootNode?this.viewport_.getRootNode():n,a=e.target;if(this.overlayContainerStopEvent_.contains(a)||!(o===n?n.documentElement:o).contains(a))return}if(t.frameState=this.frameState_,this.dispatchEvent(t)!==!1){const n=this.getInteractions().getArray().slice();for(let o=n.length-1;o>=0;o--){const a=n[o];if(a.getMap()!==this||!a.getActive()||!this.getTargetElement())continue;if(!a.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let n=this.maxTilesLoading_,o=n;if(t){const a=t.viewHints;if(a[Ut.ANIMATING]||a[Ut.INTERACTING]){const h=Date.now()-t.time>8;n=h?0:8,o=h?0:2}}e.getTilesLoading()<n&&(e.reprioritize(),e.loadMoreTiles(n,o))}t&&this.renderer_&&!t.animate&&(this.renderComplete_===!0?(this.hasListener(qt.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(qt.RENDERCOMPLETE,t),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new In(oi.LOADEND,this,t)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new In(oi.LOADSTART,this,t))));const i=this.postRenderFunctions_;for(let n=0,o=i.length;n<o;++n)i[n](this,t);i.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let i=0,n=this.targetChangeHandlerKeys_.length;i<n;++i)wt(this.targetChangeHandlerKeys_[i]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(at.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(at.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,Vs(this.viewport_)}if(this.targetElement_){this.resizeObserver_.unobserve(this.targetElement_);const i=this.targetElement_.getRootNode();i instanceof ShadowRoot&&this.resizeObserver_.unobserve(i.host),this.setSize(void 0)}const 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{e.appendChild(this.viewport_),this.renderer_||(this.renderer_=new ny(this)),this.mapBrowserEventHandler_=new ay(this,this.moveTolerance_);for(const o in Mt)this.mapBrowserEventHandler_.addEventListener(Mt[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(at.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(at.WHEEL,this.boundHandleBrowserEvent_,zc?{passive:!1}:!1);const i=this.keyboardEventTarget_?this.keyboardEventTarget_:e;this.targetChangeHandlerKeys_=[ut(i,at.KEYDOWN,this.handleBrowserEvent,this),ut(i,at.KEYPRESS,this.handleBrowserEvent,this)];const n=e.getRootNode();n instanceof ShadowRoot&&this.resizeObserver_.observe(n.host),this.resizeObserver_.observe(e)}this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(wt(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(wt(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=ut(t,vn.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=ut(t,at.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(wt),this.layerGroupPropertyListenerKeys_=null);const t=this.getLayerGroup();t&&(this.handleLayerAdd_(new bi("addlayer",t)),this.layerGroupPropertyListenerKeys_=[ut(t,vn.PROPERTYCHANGE,this.render,this),ut(t,at.CHANGE,this.render,this),ut(t,"addlayer",this.handleLayerAdd_,this),ut(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(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e<i;++e){const n=t[e].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}flushDeclutterItems(){const t=this.frameState_;t&&this.renderer_.flushDeclutterItems(t)}removeControl(t){return this.getControls().remove(t)}removeInteraction(t){return this.getInteractions().remove(t)}removeLayer(t){return this.getLayerGroup().getLayers().remove(t)}handleLayerRemove_(t){Su(t.layer)}removeOverlay(t){return this.getOverlays().remove(t)}renderFrame_(t){const e=this.getSize(),i=this.getView(),n=this.frameState_;let o=null;if(e!==void 0&&Cu(e)&&i&&i.isDef()){const a=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),h=i.getState();if(o={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:ya(h.center,h.resolution,h.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:h,viewHints:a,wantedTiles:{},mapId:ht(this),renderTargets:{}},h.nextCenter&&h.nextResolution){const c=isNaN(h.nextRotation)?h.rotation:h.nextRotation;o.nextExtent=ya(h.nextCenter,h.nextResolution,c,e)}}this.frameState_=o,this.renderer_.renderFrame(o),o&&(o.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions),n&&(!this.previousExtent_||!Cs(this.previousExtent_)&&!Cn(o.extent,this.previousExtent_))&&(this.dispatchEvent(new In(oi.MOVESTART,this,n)),this.previousExtent_=fr(this.previousExtent_)),this.previousExtent_&&!o.viewHints[Ut.ANIMATING]&&!o.viewHints[Ut.INTERACTING]&&!Cn(o.extent,this.previousExtent_)&&(this.dispatchEvent(new In(oi.MOVEEND,this,o)),fc(o.extent,this.previousExtent_))),this.dispatchEvent(new In(oi.POSTRENDER,this,o)),this.renderComplete_=this.hasListener(oi.LOADSTART)||this.hasListener(oi.LOADEND)||this.hasListener(qt.RENDERCOMPLETE)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new bi("removelayer",e)),this.set(jt.LAYERGROUP,t)}setSize(t){this.set(jt.SIZE,t)}setTarget(t){this.set(jt.TARGET,t)}setView(t){if(!t||t instanceof Be){this.set(jt.VIEW,t);return}this.set(jt.VIEW,new Be);const e=this;t.then(function(i){e.setView(new Be(i))})}updateSize(){const t=this.getTargetElement();let e;if(t){const n=getComputedStyle(t),o=t.offsetWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderRightWidth),a=t.offsetHeight-parseFloat(n.borderTopWidth)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderBottomWidth);!isNaN(o)&&!isNaN(a)&&(e=[o,a],!Cu(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&wc("No map visible because the map container's width or height are 0."))}const i=this.getSize();e&&(!i||!ei(e,i))&&(this.setSize(e),this.updateViewportSize_())}updateViewportSize_(){const t=this.getView();if(t){let e;const i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}}}function ev(r){let t=null;r.keyboardEventTarget!==void 0&&(t=typeof r.keyboardEventTarget=="string"?document.getElementById(r.keyboardEventTarget):r.keyboardEventTarget);const e={},i=r.layers&&typeof r.layers.getLayers=="function"?r.layers:new Ks({layers:r.layers});e[jt.LAYERGROUP]=i,e[jt.TARGET]=r.target,e[jt.VIEW]=r.view instanceof Be?r.view:new Be;let n;r.controls!==void 0&&(Array.isArray(r.controls)?n=new Ge(r.controls.slice()):(gt(typeof r.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),n=r.controls));let o;r.interactions!==void 0&&(Array.isArray(r.interactions)?o=new Ge(r.interactions.slice()):(gt(typeof r.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),o=r.interactions));let a;return r.overlays!==void 0?Array.isArray(r.overlays)?a=new Ge(r.overlays.slice()):(gt(typeof r.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),a=r.overlays):a=new Ge,{controls:n,interactions:o,keyboardEventTarget:t,overlays:a,values:e}}const iv=tv,Ct={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class tl{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=pe(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new tl({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return st()}getImage(t){return st()}getHitDetectionImage(){return st()}getPixelRatio(t){return 1}getImageState(){return st()}getImageSize(){return st()}getOrigin(){return st()}getSize(){return st()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=pe(t)}listenImageChange(t){st()}load(){st()}unlistenImageChange(t){st()}}const ku=tl;function Ue(r){return Array.isArray(r)?lu(r):r}class el extends ku{constructor(t){const e=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:1,rotateWithView:e,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.canvas_=void 0,this.hitDetectionCanvas_=null,this.fill_=t.fill!==void 0?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=t.radius!==void 0?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=t.angle!==void 0?t.angle:0,this.stroke_=t.stroke!==void 0?t.stroke:null,this.size_=null,this.renderOptions_=null,this.render()}clone(){const t=this.getScale(),e=new el({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_;if(!t)return null;const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(t){let e=this.canvas_[t];if(!e){const i=this.renderOptions_,n=$t(i.size*t,i.size*t);this.draw_(i,n,t),e=n.canvas,this.canvas_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return Ct.LOADED}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,i){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let n=this.radius_,o=this.radius2_===void 0?n:this.radius2_;if(n<o){const R=n;n=o,o=R}const a=this.radius2_===void 0?this.points_:this.points_*2,h=2*Math.PI/a,c=o*Math.sin(h),d=Math.sqrt(o*o-c*c),f=n-d,_=Math.sqrt(c*c+f*f),m=_/c;if(t==="miter"&&m<=i)return m*e;const E=e/2/m,v=e/2*(f/_),C=Math.sqrt((n+E)*(n+E)+v*v)-n;if(this.radius2_===void 0||t==="bevel")return C*2;const S=n*Math.sin(h),y=Math.sqrt(n*n-S*S),x=o-y,k=Math.sqrt(S*S+x*x)/S;if(k<=i){const R=k*e/2-o-n;return 2*Math.max(C,R)}return C*2}createRenderOptions(){let t=kn,e=Rn,i=0,n=null,o=0,a,h=0;this.stroke_&&(a=this.stroke_.getColor(),a===null&&(a=wr),a=Ue(a),h=this.stroke_.getWidth(),h===void 0&&(h=br),n=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),e=this.stroke_.getLineJoin(),e===void 0&&(e=Rn),t=this.stroke_.getLineCap(),t===void 0&&(t=kn),i=this.stroke_.getMiterLimit(),i===void 0&&(i=Er));const c=this.calculateLineJoinSize_(e,h,i),d=Math.max(this.radius_,this.radius2_||0),f=Math.ceil(2*d+c);return{strokeStyle:a,strokeWidth:h,size:f,lineCap:t,lineDash:n,lineDashOffset:o,lineJoin:e,miterLimit:i}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]}draw_(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let n=this.fill_.getColor();n===null&&(n=ae),e.fillStyle=Ue(n),e.fill()}this.stroke_&&(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){if(this.fill_){let e=this.fill_.getColor(),i=0;if(typeof e=="string"&&(e=yr(e)),e===null?i=1:Array.isArray(e)&&(i=e.length===4?e[3]:1),i===0){const n=$t(t.size,t.size);this.hitDetectionCanvas_=n.canvas,this.drawHitDetectionCanvas_(t,n)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))}createPath_(t){let e=this.points_;const i=this.radius_;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{const n=this.radius2_===void 0?i:this.radius2_;this.radius2_!==void 0&&(e*=2);const o=this.angle_-Math.PI/2,a=2*Math.PI/e;for(let h=0;h<e;h++){const c=o+h*a,d=h%2===0?i:n;t.lineTo(d*Math.cos(c),d*Math.sin(c))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=ae,e.fill(),this.stroke_&&(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())}}const Ru=el;class il extends Ru{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 il({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()}}const Mu=il;class nl{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null}clone(){const t=this.getColor();return new nl({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){this.color_=t}}const Qs=nl;class rl{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 rl({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}}const to=rl;class eo{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=Iu,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 eo({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),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_=Iu,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function nv(r){let t;if(typeof r=="function")t=r;else{let e;Array.isArray(r)?e=r:(gt(typeof r.getZIndex=="function","Expected an `Style` or an array of `Style`"),e=[r]),t=function(){return e}}return t}let sl=null;function rv(r,t){if(!sl){const e=new Qs({color:"rgba(255,255,255,0.4)"}),i=new to({color:"#3399CC",width:1.25});sl=[new eo({image:new Mu({fill:e,stroke:i,radius:5}),fill:e,stroke:i})]}return sl}function Iu(r){return r.getGeometry()}const An=eo;function sv(r,t,e){const i=r;let n=!0,o=!1,a=!1;const h=[ms(i,at.LOAD,function(){a=!0,o||t()})];return i.src&&Fc?(o=!0,i.decode().then(function(){n&&t()}).catch(function(c){n&&(a?t():e())})):h.push(ms(i,at.ERROR,e)),function(){n=!1,h.forEach(wt)}}function ov(r,t){return new Promise((e,i)=>{function n(){a(),e(r)}function o(){a(),i(new Error("Image load error"))}function a(){r.removeEventListener("load",n),r.removeEventListener("error",o)}r.addEventListener("load",n),r.addEventListener("error",o),t&&(r.src=t)})}function av(r,t){return t&&(r.src=t),Fc?new Promise((e,i)=>r.decode().then(()=>e(r),i)):ov(r)}let Sr=null;class lv extends ps{constructor(t,e,i,n,o){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=o,this.imageState_=n===void 0?Ct.IDLE:n,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===Ct.LOADED){Sr||(Sr=$t(1,1,void 0,{willReadFrequently:!0})),Sr.drawImage(this.image_,0,0);try{Sr.getImageData(0,0,1,1),this.tainted_=!1}catch{Sr=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(at.CHANGE)}handleImageError_(){this.imageState_=Ct.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=Ct.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],i=$t(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===Ct.IDLE){this.image_||this.initializeImage_(),this.imageState_=Ct.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&av(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_!==Ct.LOADED)return;const e=this.image_,i=document.createElement("canvas");i.width=Math.ceil(e.width*t),i.height=Math.ceil(e.height*t);const n=i.getContext("2d");n.scale(t,t),n.drawImage(e,0,0),n.globalCompositeOperation="multiply",n.fillStyle=ou(this.color_),n.fillRect(0,0,i.width/t,i.height/t),n.globalCompositeOperation="destination-in",n.drawImage(e,0,0),this.canvas_[t]=i}}function hv(r,t,e,i,n){let o=t===void 0?void 0:Gs.get(t,e,n);return o||(o=new lv(r,r instanceof HTMLImageElement?r.src||void 0:t,e,i,n),Gs.set(t,e,n,o)),o}function Au(r,t,e,i){return e!==void 0&&i!==void 0?[e/r,i/t]:e!==void 0?e/r:i!==void 0?i/t:1}class ol extends ku{constructor(t){t=t||{};const e=t.opacity!==void 0?t.opacity:1,i=t.rotation!==void 0?t.rotation:0,n=t.scale!==void 0?t.scale:1,o=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:i,scale:n,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:o,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 a=t.img!==void 0?t.img:null;let h=t.src;gt(!(h!==void 0&&a),"`image` and `src` cannot be provided at the same time"),(h===void 0||h.length===0)&&a&&(h=a.src||ht(a)),gt(h!==void 0&&h.length>0,"A defined and non-empty `src` or `image` must be provided"),gt(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let c;if(t.src!==void 0?c=Ct.IDLE:a!==void 0&&(a instanceof HTMLImageElement?a.complete?c=a.src?Ct.LOADED:Ct.IDLE:c=Ct.LOADING:c=Ct.LOADED),this.color_=t.color!==void 0?yr(t.color):null,this.iconImage_=hv(a,h,this.crossOrigin_,c,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,t.width!==void 0||t.height!==void 0){let d,f;if(t.size)[d,f]=t.size;else{const _=this.getImage(1);if(_.width&&_.height)d=_.width,f=_.height;else if(_ instanceof HTMLImageElement){this.initialOptions_=t;const m=()=>{if(this.unlistenImageChange(m),!this.initialOptions_)return;const E=this.iconImage_.getSize();this.setScale(Au(E[0],E[1],t.width,t.height))};this.listenImageChange(m);return}}d!==void 0&&this.setScale(Au(d,f,t.width,t.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new ol({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:i,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 n=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!n)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=n[0]),this.anchorYUnits_=="fraction"&&(t[1]*=n[1])}if(this.anchorOrigin_!="top-left"){if(!n)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+n[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+n[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[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(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=i[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}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()==Ct.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()==Ct.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(at.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(at.CHANGE,t)}}const al=ol,cv="#333";class ll{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=pe(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 Qs({color:cv}),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}clone(){const t=this.getScale();return new ll({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})}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_}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_}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}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=pe(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}}const Du=ll;let Dn=0;const Jt=1<<Dn++,ft=1<<Dn++,On=1<<Dn++,hl=1<<Dn++,Pr=1<<Dn++,Ce=Math.pow(2,Dn)-1,Ou={[Jt]:"boolean",[ft]:"number",[On]:"string",[hl]:"color",[Pr]:"number[]"},uv=Object.keys(Ou).map(Number).sort(xi);function io(r){const t=[];for(const e of uv)dv(r,e)&&t.push(Ou[e]);return t.length===0?"untyped":t.length<3?t.join(" or "):t.slice(0,-1).join(", ")+", or "+t[t.length-1]}function dv(r,t){return(r&t)===t}function Fu(r,t){return!!(r&t)}class Ci{constructor(t,e){this.type=t,this.value=e}}class fv{constructor(t,e,...i){this.type=t,this.operator=e,this.args=i}}function zu(){return{variables:new Set,properties:new Set}}function no(r,t){switch(typeof r){case"boolean":return new Ci(Jt,r);case"number":return new Ci(ft,r);case"string":return new Ci(On,r)}if(!Array.isArray(r))throw new Error("Expression must be an array or a primitive value");if(r.length===0)throw new Error("Empty expression");if(typeof r[0]=="string")return yv(r,t);for(const i of r)if(typeof i!="number")throw new Error("Expected an array of numbers");let e=Pr;return(r.length===3||r.length===4)&&(e|=hl),new Ci(e,r)}const G={Number:"number",String:"string",Get:"get",Var:"var",Any:"any",All:"all",Not:"!",Resolution:"resolution",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"},gv={[G.Number]:Et(bt(1,1/0,Ce),ft),[G.String]:Et(bt(1,1/0,Ce),On),[G.Get]:Et(_v,Ce),[G.Var]:Et(pv,Ce),[G.Resolution]:Et(mv,ft),[G.Any]:Et(bt(2,1/0,Jt),Jt),[G.All]:Et(bt(2,1/0,Jt),Jt),[G.Not]:Et(bt(1,1,Jt),Jt),[G.Equal]:Et(bt(2,2,Ce),Jt),[G.NotEqual]:Et(bt(2,2,Ce),Jt),[G.GreaterThan]:Et(bt(2,2,Ce),Jt),[G.GreaterThanOrEqualTo]:Et(bt(2,2,Ce),Jt),[G.LessThan]:Et(bt(2,2,Ce),Jt),[G.LessThanOrEqualTo]:Et(bt(2,2,Ce),Jt),[G.Multiply]:Et(bt(2,1/0,ft),ft),[G.Divide]:Et(bt(2,2,ft),ft),[G.Add]:Et(bt(2,1/0,ft),ft),[G.Subtract]:Et(bt(2,2,ft),ft),[G.Clamp]:Et(bt(3,3,ft),ft),[G.Mod]:Et(bt(2,2,ft),ft),[G.Pow]:Et(bt(2,2,ft),ft),[G.Abs]:Et(bt(1,1,ft),ft),[G.Floor]:Et(bt(1,1,ft),ft),[G.Ceil]:Et(bt(1,1,ft),ft),[G.Round]:Et(bt(1,1,ft),ft),[G.Sin]:Et(bt(1,1,ft),ft),[G.Cos]:Et(bt(1,1,ft),ft),[G.Atan]:Et(bt(1,2,ft),ft),[G.Sqrt]:Et(bt(1,1,ft),ft),[G.Match]:Et(bt(4,1/0,On|ft),Ce)};function _v(r,t){if(r.length!==2)throw new Error("Expected 1 argument for get operation");const e=no(r[1],t);if(!(e instanceof Ci))throw new Error("Expected a literal argument for get operation");if(typeof e.value!="string")throw new Error("Expected a string argument for get operation");return t.properties.add(e.value),[e]}function pv(r,t){if(r.length!==2)throw new Error("Expected 1 argument for var operation");const e=no(r[1],t);if(!(e instanceof Ci))throw new Error("Expected a literal argument for var operation");if(typeof e.value!="string")throw new Error("Expected a string argument for get operation");return t.variables.add(e.value),[e]}function mv(r,t){const e=r[0];if(r.length!==1)throw new Error(`Expected no arguments for ${e} operation`);return[]}function bt(r,t,e){return function(i,n){const o=i[0],a=i.length-1;if(r===t){if(a!==r){const c=r===1?"":"s";throw new Error(`Expected ${r} argument${c} for operation ${o}, got ${a}`)}}else if(a<r||a>t)throw new Error(`Expected ${r} to ${t} arguments for operation ${o}, got ${a}`);const h=new Array(a);for(let c=0;c<a;++c){const d=no(i[c+1],n);if(!Fu(e,d.type)){const f=io(e),_=io(d.type);throw new Error(`Unexpected type for argument ${c} of ${o} operation : got ${f} but expected ${_}`)}h[c]=d}return h}}function Et(r,t){return function(e,i){const n=e[0],o=r(e,i);return new fv(t,n,...o)}}function yv(r,t){const e=r[0],i=gv[e];if(!i)throw new Error(`Unknown operator: ${e}`);return i(r,t)}function Nu(){return{variables:{},properties:{},resolution:NaN}}function Si(r,t,e){const i=no(r,e);if(!Fu(t,i.type)){const n=io(t),o=io(i.type);throw new Error(`Expected expression to be of type ${n}, got ${o}`)}return an(i)}function an(r,t){if(r instanceof Ci)return function(){return r.value};const e=r.operator;switch(e){case G.Number:case G.String:return vv(r);case G.Get:case G.Var:return xv(r);case G.Resolution:return i=>i.resolution;case G.Any:case G.All:case G.Not:return wv(r);case G.Equal:case G.NotEqual:case G.LessThan:case G.LessThanOrEqualTo:case G.GreaterThan:case G.GreaterThanOrEqualTo:return Ev(r);case G.Multiply:case G.Divide:case G.Add:case G.Subtract:case G.Clamp:case G.Mod:case G.Pow:case G.Abs:case G.Floor:case G.Ceil:case G.Round:case G.Sin:case G.Cos:case G.Atan:case G.Sqrt:return Lv(r);case G.Match:return bv(r);default:throw new Error(`Unsupported operator ${e}`)}}function vv(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let o=0;o<i;++o)n[o]=an(r.args[o]);switch(e){case G.Number:case G.String:return o=>{for(let a=0;a<i;++a){const h=n[a](o);if(typeof h===e)return h}throw new Error(`Expected one of the values to be a ${e}`)};default:throw new Error(`Unsupported assertion operator ${e}`)}}function xv(r,t){const e=r.args[0];if(!(e instanceof Ci))throw new Error("Expected literal name");const i=e.value;if(typeof i!="string")throw new Error("Expected string name");switch(r.operator){case G.Get:return n=>n.properties[i];case G.Var:return n=>n.variables[i];default:throw new Error(`Unsupported accessor operator ${r.operator}`)}}function Ev(r,t){const e=r.operator,i=an(r.args[0]),n=an(r.args[1]);switch(e){case G.Equal:return o=>i(o)===n(o);case G.NotEqual:return o=>i(o)!==n(o);case G.LessThan:return o=>i(o)<n(o);case G.LessThanOrEqualTo:return o=>i(o)<=n(o);case G.GreaterThan:return o=>i(o)>n(o);case G.GreaterThanOrEqualTo:return o=>i(o)>=n(o);default:throw new Error(`Unsupported comparison operator ${e}`)}}function wv(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let o=0;o<i;++o)n[o]=an(r.args[o]);switch(e){case G.Any:return o=>{for(let a=0;a<i;++a)if(n[a](o))return!0;return!1};case G.All:return o=>{for(let a=0;a<i;++a)if(!n[a](o))return!1;return!0};case G.Not:return o=>!n[0](o);default:throw new Error(`Unsupported logical operator ${e}`)}}function Lv(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let o=0;o<i;++o)n[o]=an(r.args[o]);switch(e){case G.Multiply:return o=>{let a=1;for(let h=0;h<i;++h)a*=n[h](o);return a};case G.Divide:return o=>n[0](o)/n[1](o);case G.Add:return o=>{let a=0;for(let h=0;h<i;++h)a+=n[h](o);return a};case G.Subtract:return o=>n[0](o)-n[1](o);case G.Clamp:return o=>{const a=n[0](o),h=n[1](o);if(a<h)return h;const c=n[2](o);return a>c?c:a};case G.Mod:return o=>n[0](o)%n[1](o);case G.Pow:return o=>Math.pow(n[0](o),n[1](o));case G.Abs:return o=>Math.abs(n[0](o));case G.Floor:return o=>Math.floor(n[0](o));case G.Ceil:return o=>Math.ceil(n[0](o));case G.Round:return o=>Math.round(n[0](o));case G.Sin:return o=>Math.sin(n[0](o));case G.Cos:return o=>Math.cos(n[0](o));case G.Atan:return i===2?o=>Math.atan2(n[0](o),n[1](o)):o=>Math.atan(n[0](o));case G.Sqrt:return o=>Math.sqrt(n[0](o));default:throw new Error(`Unsupported numeric operator ${e}`)}}function bv(r,t){const e=r.args.length,i=new Array(e);for(let n=0;n<e;++n)i[n]=an(r.args[n]);return n=>{const o=i[0](n);for(let a=1;a<e;a+=2)if(o===i[a](n))return i[a+1](n);return i[e-1](n)}}function Tv(r){return!0}function Cv(r){const t=zu(),e=Sv(r,t),i=Nu();return function(n,o){return i.properties=n.getPropertiesInternal(),i.resolution=o,e(i)}}function Bu(r){const t=zu(),e=r.length,i=new Array(e);for(let a=0;a<e;++a)i[a]=cl(r[a],t);const n=Nu(),o=new Array(e);return function(a,h){n.properties=a.getPropertiesInternal(),n.resolution=h;for(let c=0;c<e;++c)o[c]=i[c](n);return o}}function Sv(r,t){const e=r.length,i=new Array(e);for(let n=0;n<e;++n){const o=r[n],a="filter"in o?Si(o.filter,Jt,t):Tv;let h;if(Array.isArray(o.style)){const c=o.style.length;h=new Array(c);for(let d=0;d<c;++d)h[d]=cl(o.style[d],t)}else h=[cl(o.style,t)];i[n]={filter:a,styles:h}}return function(n){const o=[];let a=!1;for(let h=0;h<e;++h){const c=i[h].filter;if(c(n)&&!(r[h].else&&a)){a=!0;for(const d of i[h].styles){const f=d(n);f&&o.push(f)}}}return o}}function cl(r,t){const e=kr(r,"",t),i=Rr(r,"",t),n=Pv(r,t),o=kv(r,t),a=le(r,"z-index",t),h=new An;return function(c){let d=!0;if(e){const f=e(c);f&&(d=!1),h.setFill(f)}if(i){const f=i(c);f&&(d=!1),h.setStroke(f)}if(n){const f=n(c);f&&(d=!1),h.setText(f)}if(o){const f=o(c);f&&(d=!1),h.setImage(f)}return a&&h.setZIndex(a(c)),d?null:h}}function kr(r,t,e){const i=Gu(r,t+"fill-color",e);if(!i)return null;const n=new Qs;return function(o){const a=i(o);return a==="none"?null:(n.setColor(a),n)}}function Rr(r,t,e){const i=le(r,t+"stroke-width",e),n=Gu(r,t+"stroke-color",e);if(!i&&!n)return null;const o=Pi(r,t+"stroke-line-cap",e),a=Pi(r,t+"stroke-line-join",e),h=Uu(r,t+"stroke-line-dash",e),c=le(r,t+"stroke-line-dash-offset",e),d=le(r,t+"stroke-miter-limit",e),f=new to;return function(_){if(n){const m=n(_);if(m==="none")return null;f.setColor(m)}if(i&&f.setWidth(i(_)),o){const m=o(_);if(m!=="butt"&&m!=="round"&&m!=="square")throw new Error("Expected butt, round, or square line cap");f.setLineCap(m)}if(a){const m=a(_);if(m!=="bevel"&&m!=="round"&&m!=="miter")throw new Error("Expected bevel, round, or miter line join");f.setLineJoin(m)}return h&&f.setLineDash(h(_)),c&&f.setLineDashOffset(c(_)),d&&f.setMiterLimit(d(_)),f}}function Pv(r,t){const e="text-",i=Pi(r,e+"value",t);if(!i)return null;const n=kr(r,e,t),o=kr(r,e+"background-",t),a=Rr(r,e,t),h=Rr(r,e+"background-",t),c=Pi(r,e+"font",t),d=le(r,e+"max-angle",t),f=le(r,e+"offset-x",t),_=le(r,e+"offset-y",t),m=Mr(r,e+"overflow",t),E=Pi(r,e+"placement",t),v=le(r,e+"repeat",t),b=so(r,e+"scale",t),C=Mr(r,e+"rotate-with-view",t),S=le(r,e+"rotation",t),y=Pi(r,e+"align",t),x=Pi(r,e+"justify",t),T=Pi(r,e+"baseline",t),k=Uu(r,e+"padding",t),R=new Du({});return function(M){if(R.setText(i(M)),n&&R.setFill(n(M)),o&&R.setBackgroundFill(o(M)),a&&R.setStroke(a(M)),h&&R.setBackgroundStroke(h(M)),c&&R.setFont(c(M)),d&&R.setMaxAngle(d(M)),f&&R.setOffsetX(f(M)),_&&R.setOffsetY(_(M)),m&&R.setOverflow(m(M)),E){const A=E(M);if(A!=="point"&&A!=="line")throw new Error("Expected point or line for text-placement");R.setPlacement(A)}if(v&&R.setRepeat(v(M)),b&&R.setScale(b(M)),C&&R.setRotateWithView(C(M)),S&&R.setRotation(S(M)),y){const A=y(M);if(A!=="left"&&A!=="center"&&A!=="right"&&A!=="end"&&A!=="start")throw new Error("Expected left, right, center, start, or end for text-align");R.setTextAlign(A)}if(x){const A=x(M);if(A!=="left"&&A!=="right"&&A!=="center")throw new Error("Expected left, right, or center for text-justify");R.setJustify(A)}if(T){const A=T(M);if(A!=="bottom"&&A!=="top"&&A!=="middle"&&A!=="alphabetic"&&A!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");R.setTextBaseline(A)}return k&&R.setPadding(k(M)),R}}function kv(r,t){return"icon-src"in r?Rv(r,t):"shape-points"in r?Mv(r,t):"circle-radius"in r?Iv(r,t):null}function Rv(r,t){const e="icon-",i=e+"src",n=Wu(r[i],i),o=ro(r,e+"anchor",t),a=so(r,e+"scale",t),h=le(r,e+"opacity",t),c=ro(r,e+"displacement",t),d=le(r,e+"rotation",t),f=Mr(r,e+"rotate-with-view",t),_=Zu(r,e+"anchor-origin"),m=ju(r,e+"anchor-x-units"),E=ju(r,e+"anchor-y-units"),v=Fv(r,e+"color"),b=Dv(r,e+"cross-origin"),C=Ov(r,e+"offset"),S=Zu(r,e+"offset-origin"),y=Fn(r,e+"width"),x=Fn(r,e+"height"),T=Av(r,e+"size"),k=ul(r,e+"declutter"),R=new al({src:n,anchorOrigin:_,anchorXUnits:m,anchorYUnits:E,color:v,crossOrigin:b,offset:C,offsetOrigin:S,height:x,width:y,size:T,declutterMode:k});return function(M){return h&&R.setOpacity(h(M)),c&&R.setDisplacement(c(M)),d&&R.setRotation(d(M)),f&&R.setRotateWithView(f(M)),a&&R.setScale(a(M)),o&&R.setAnchor(o(M)),R}}function Mv(r,t){const e="shape-",i=e+"points",n=Hu(r[i],i),o=kr(r,e,t),a=Rr(r,e,t),h=so(r,e+"scale",t),c=ro(r,e+"displacement",t),d=le(r,e+"rotation",t),f=Mr(r,e+"rotate-with-view",t),_=Fn(r,e+"radius"),m=Fn(r,e+"radius1"),E=Fn(r,e+"radius2"),v=Fn(r,e+"angle"),b=ul(r,e+"declutter-mode"),C=new Ru({points:n,radius:_,radius1:m,radius2:E,angle:v,declutterMode:b});return function(S){return o&&C.setFill(o(S)),a&&C.setStroke(a(S)),c&&C.setDisplacement(c(S)),d&&C.setRotation(d(S)),f&&C.setRotateWithView(f(S)),h&&C.setScale(h(S)),C}}function Iv(r,t){const e="circle-",i=kr(r,e,t),n=Rr(r,e,t),o=le(r,e+"radius",t),a=so(r,e+"scale",t),h=ro(r,e+"displacement",t),c=le(r,e+"rotation",t),d=Mr(r,e+"rotate-with-view",t),f=ul(r,e+"declutter-mode"),_=new Mu({radius:5,declutterMode:f});return function(m){return o&&_.setRadius(o(m)),i&&_.setFill(i(m)),n&&_.setStroke(n(m)),h&&_.setDisplacement(h(m)),c&&_.setRotation(c(m)),d&&_.setRotateWithView(d(m)),a&&_.setScale(a(m)),_}}function le(r,t,e){if(!(t in r))return;const i=Si(r[t],ft,e);return function(n){return Hu(i(n),t)}}function Pi(r,t,e){if(!(t in r))return null;const i=Si(r[t],On,e);return function(n){return Wu(i(n),t)}}function Mr(r,t,e){if(!(t in r))return null;const i=Si(r[t],Jt,e);return function(n){const o=i(n);if(typeof o!="boolean")throw new Error(`Expected a boolean for ${t}`);return o}}function Gu(r,t,e){if(!(t in r))return null;const i=Si(r[t],hl|On,e);return function(n){return Vu(i(n),t)}}function Uu(r,t,e){if(!(t in r))return null;const i=Si(r[t],Pr,e);return function(n){return Ir(i(n),t)}}function ro(r,t,e){if(!(t in r))return null;const i=Si(r[t],Pr,e);return function(n){const o=Ir(i(n),t);if(o.length!==2)throw new Error(`Expected two numbers for ${t}`);return o}}function so(r,t,e){if(!(t in r))return null;const i=Si(r[t],Pr|ft,e);return function(n){return zv(i(n),t)}}function Fn(r,t){const e=r[t];if(e!==void 0){if(typeof e!="number")throw new Error(`Expected a number for ${t}`);return e}}function Av(r,t){const e=r[t];if(e!==void 0){if(typeof e=="number")return pe(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 Dv(r,t){const e=r[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);return e}}function Zu(r,t){const e=r[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 ju(r,t){const e=r[t];if(e!==void 0){if(e!=="pixels"&&e!=="fraction")throw new Error(`Expected pixels or fraction for ${t}`);return e}}function Ov(r,t){const e=r[t];if(e!==void 0)return Ir(e,t)}function ul(r,t){const e=r[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 Fv(r,t){const e=r[t];if(e!==void 0)return Vu(e,t)}function Ir(r,t){if(!Array.isArray(r))throw new Error(`Expected an array for ${t}`);const e=r.length;for(let i=0;i<e;++i)if(typeof r[i]!="number")throw new Error(`Expected an array of numbers for ${t}`);return r}function Wu(r,t){if(typeof r!="string")throw new Error(`Expected a string for ${t}`);return r}function Hu(r,t){if(typeof r!="number")throw new Error(`Expected a number for ${t}`);return r}function Vu(r,t){if(typeof r=="string")return r;const e=Ir(r,t),i=e.length;if(i<3||i>4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function zv(r,t){if(typeof r=="number")return r;const e=Ir(r,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}const Xu={RENDER_ORDER:"renderOrder"};class Nv extends Us{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!==void 0?t.declutter:!1,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(Xu.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t){t.declutterTree||(t.declutterTree=new yh(9)),this.getRenderer().renderDeclutter(t)}setRenderOrder(t){this.set(Xu.RENDER_ORDER,t)}setStyle(t){this.style_=Bv(t),this.styleFunction_=t===null?void 0:nv(this.style_),this.changed()}}function Bv(r){if(r===void 0)return rv;if(!r)return null;if(typeof r=="function"||r instanceof An)return r;if(!Array.isArray(r))return Bu([r]);if(r.length===0)return[];const t=r.length,e=r[0];if(e instanceof An){const n=new Array(t);for(let o=0;o<t;++o){const a=r[o];if(!(a instanceof An))throw new Error("Expected a list of style instances");n[o]=a}return n}if("style"in e){const n=new Array(t);for(let o=0;o<t;++o){const a=r[o];if(!("style"in a))throw new Error("Expected a list of rules with a style property");n[o]=a}return Cv(n)}return Bu(r)}const dl=Nv,ee={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"},fl=34962,gl=34963,Gv=35040,Uv=35044,_l=35048,Zv=5121,jv=5123,Wv=5125,Yu=5126,Ku=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function Hv(r,t){t=Object.assign({preserveDrawingBuffer:!0,antialias:!tm},t);const e=Ku.length;for(let i=0;i<e;++i)try{const n=r.getContext(Ku[i],t);if(n)return n}catch{}return null}const Vv={STATIC_DRAW:Uv,STREAM_DRAW:Gv,DYNAMIC_DRAW:_l};class Xv{constructor(t,e){this.array=null,this.type=t,gt(t===fl||t===gl,"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`"),this.usage=e!==void 0?e:Vv.STATIC_DRAW}ofSize(t){return this.array=new(pl(this.type))(t),this}fromArray(t){return this.array=pl(this.type).from(t),this}fromArrayBuffer(t){return this.array=new(pl(this.type))(t),this}getType(){return this.type}getArray(){return this.array}getUsage(){return this.usage}getSize(){return this.array?this.array.length:0}}function pl(r){switch(r){case fl:return Float32Array;case gl:return Uint32Array;default:return Float32Array}}const qu=Xv;class Yv extends oc{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.declutterExecutorGroup=null}getFeatures(t){return st()}getData(t){return null}prepareFrame(t){return st()}renderFrame(t,e){return st()}loadedTileCallback(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i}createLoadedTileFinder(t,e,i){return(n,o)=>{const a=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,o,a)}}forEachFeatureAtCoordinate(t,e,i,n,o){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===Ct.LOADED||e.getState()===Ct.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=Ct.LOADED&&e!=Ct.ERROR&&t.addEventListener(at.CHANGE,this.boundHandleImageChange_),e==Ct.IDLE&&(t.load(),e=t.getState()),e==Ct.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}disposeInternal(){delete this.layer_,super.disposeInternal()}}const $u=Yv,oo={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"},Kv=`
23
23
  precision mediump float;
24
24
 
25
25
  attribute vec2 a_position;
@@ -33,7 +33,7 @@
33
33
  v_screenCoord = v_texCoord * u_screenSize;
34
34
  gl_Position = vec4(a_position, 0.0, 1.0);
35
35
  }
36
- `,gx=`
36
+ `,qv=`
37
37
  precision mediump float;
38
38
 
39
39
  uniform sampler2D u_image;
@@ -44,7 +44,7 @@
44
44
  void main() {
45
45
  gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;
46
46
  }
47
- `;class _x{constructor(t){this.gl_=t.webGlContext;const e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer(),this.depthBuffer_=e.createRenderbuffer();const i=e.createShader(e.VERTEX_SHADER);e.shaderSource(i,t.vertexShader||fx),e.compileShader(i);const n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,t.fragmentShader||gx),e.compileShader(n),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,i),e.attachShader(this.renderTargetProgram_,n),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer();const o=[-1,-1,1,-1,-1,1,1,-1,1,1,-1,1];e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array(o),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(a=>{this.uniforms_.push({value:t.uniforms[a],location:e.getUniformLocation(this.renderTargetProgram_,a)})})}getGL(){return this.gl_}init(t){const e=this.getGL(),i=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.bindRenderbuffer(e.RENDERBUFFER,this.getDepthBuffer()),e.viewport(0,0,i[0],i[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==i[0]||this.renderTargetTextureSize_[1]!==i[1]){this.renderTargetTextureSize_=i;const n=0,o=e.RGBA,a=0,h=e.RGBA,c=e.UNSIGNED_BYTE,d=null;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,n,o,i[0],i[1],a,h,c,d),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,i[0],i[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthBuffer_)}}apply(t,e,i,n){const o=this.getGL(),a=t.size;if(o.bindFramebuffer(o.FRAMEBUFFER,e?e.getFrameBuffer():null),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,this.renderTargetTexture_),!e){const c=at(o.canvas);if(!t.renderTargets[c]){const d=o.getContextAttributes();d&&d.preserveDrawingBuffer&&(o.clearColor(0,0,0,0),o.clearDepth(1),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT)),t.renderTargets[c]=!0}}o.disable(o.DEPTH_TEST),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),o.viewport(0,0,o.drawingBufferWidth,o.drawingBufferHeight),o.bindBuffer(o.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),o.useProgram(this.renderTargetProgram_),o.enableVertexAttribArray(this.renderTargetAttribLocation_),o.vertexAttribPointer(this.renderTargetAttribLocation_,2,o.FLOAT,!1,0,0),o.uniform2f(this.renderTargetUniformLocation_,a[0],a[1]),o.uniform1i(this.renderTargetTextureLocation_,0);const h=t.layerStatesArray[t.layerIndex].opacity;o.uniform1f(this.renderTargetOpacityLocation_,h),this.applyUniforms(t),i&&i(o,t),o.drawArrays(o.TRIANGLES,0,6),n&&n(o,t)}getFrameBuffer(){return this.frameBuffer_}getDepthBuffer(){return this.depthBuffer_}applyUniforms(t){const e=this.getGL();let i,n=1;this.uniforms_.forEach(function(o){if(i=typeof o.value=="function"?o.value(t):o.value,i instanceof HTMLCanvasElement||i instanceof ImageData)o.texture||(o.texture=e.createTexture()),e.activeTexture(e[`TEXTURE${n}`]),e.bindTexture(e.TEXTURE_2D,o.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),i instanceof ImageData?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,i.width,i.height,0,e.UNSIGNED_BYTE,new Uint8Array(i.data)):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i),e.uniform1i(o.location,n++);else if(Array.isArray(i))switch(i.length){case 2:e.uniform2f(o.location,i[0],i[1]);return;case 3:e.uniform3f(o.location,i[0],i[1],i[2]);return;case 4:e.uniform4f(o.location,i[0],i[1],i[2],i[3]);return;default:return}else typeof i=="number"&&e.uniform1f(o.location,i)})}}const cd=_x;function px(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function mx(r,t){return r[0]=t[0],r[1]=t[1],r[4]=t[2],r[5]=t[3],r[12]=t[4],r[13]=t[5],r}const ai={PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution",ROTATION:"u_rotation",VIEWPORT_SIZE_PX:"u_viewportSizePx",PIXEL_RATIO:"u_pixelRatio",HIT_DETECTION:"u_hitDetection"},li={UNSIGNED_BYTE:ox,UNSIGNED_SHORT:ax,UNSIGNED_INT:lx,FLOAT:od},po={};function ud(r){return"shared/"+r}let dd=0;function yx(){const r="unique/"+dd;return dd+=1,r}function vx(r){let t=po[r];if(!t){const e=document.createElement("canvas");e.width=1,e.height=1,e.style.position="absolute",e.style.left="0",t={users:0,context:hx(e)},po[r]=t}return t.users+=1,t.context}function xx(r){const t=po[r];if(!t||(t.users-=1,t.users>0))return;const e=t.context,i=e.getExtension("WEBGL_lose_context");i&&i.loseContext();const n=e.canvas;n.width=1,n.height=1,delete po[r]}class Ex extends ws{constructor(t){super(),t=t||{},this.boundHandleWebGLContextLost_=this.handleWebGLContextLost.bind(this),this.boundHandleWebGLContextRestored_=this.handleWebGLContextRestored.bind(this),this.canvasCacheKey_=t.canvasCacheKey?ud(t.canvasCacheKey):yx(),this.gl_=vx(this.canvasCacheKey_),this.bufferCache_={},this.extensionCache_={},this.currentProgram_=null,this.needsToBeRecreated_=!1;const e=this.gl_.canvas;e.addEventListener(_o.LOST,this.boundHandleWebGLContextLost_),e.addEventListener(_o.RESTORED,this.boundHandleWebGLContextRestored_),this.offsetRotateMatrix_=Vt(),this.offsetScaleMatrix_=Vt(),this.tmpMat4_=px(),this.uniformLocationsByProgram_={},this.attribLocationsByProgram_={},this.uniforms_=[],t.uniforms&&this.setUniforms(t.uniforms),this.postProcessPasses_=t.postProcesses?t.postProcesses.map(i=>new cd({webGlContext:this.gl_,scaleRatio:i.scaleRatio,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,uniforms:i.uniforms})):[new cd({webGlContext:this.gl_})],this.shaderCompileErrors_=null,this.startTime_=Date.now()}setUniforms(t){this.uniforms_=[],this.addUniforms(t)}addUniforms(t){for(const e in t)this.uniforms_.push({name:e,value:t[e]})}canvasCacheKeyMatches(t){return this.canvasCacheKey_===ud(t)}getExtension(t){if(t in this.extensionCache_)return this.extensionCache_[t];const e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e}bindBuffer(t){const e=this.gl_,i=at(t);let n=this.bufferCache_[i];if(!n){const o=e.createBuffer();n={buffer:t,webGlBuffer:o},this.bufferCache_[i]=n}e.bindBuffer(t.getType(),n.webGlBuffer)}flushBufferData(t){const e=this.gl_;this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())}deleteBuffer(t){const e=this.gl_,i=at(t),n=this.bufferCache_[i];n&&!e.isContextLost()&&e.deleteBuffer(n.webGlBuffer),delete this.bufferCache_[i]}disposeInternal(){const t=this.gl_.canvas;t.removeEventListener(_o.LOST,this.boundHandleWebGLContextLost_),t.removeEventListener(_o.RESTORED,this.boundHandleWebGLContextRestored_),xx(this.canvasCacheKey_),delete this.gl_}prepareDraw(t,e,i){const n=this.gl_,o=this.getCanvas(),a=t.size,h=t.pixelRatio;(o.width!==a[0]*h||o.height!==a[1]*h)&&(o.width=a[0]*h,o.height=a[1]*h,o.style.width=a[0]+"px",o.style.height=a[1]+"px");for(let c=this.postProcessPasses_.length-1;c>=0;c--)this.postProcessPasses_[c].init(t);n.bindTexture(n.TEXTURE_2D,null),n.clearColor(0,0,0,0),n.depthRange(0,1),n.clearDepth(1),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,e?n.ZERO:n.ONE_MINUS_SRC_ALPHA),i?(n.enable(n.DEPTH_TEST),n.depthFunc(n.LEQUAL)):n.disable(n.DEPTH_TEST)}bindTexture(t,e,i){const n=this.gl_;n.activeTexture(n.TEXTURE0+e),n.bindTexture(n.TEXTURE_2D,t),n.uniform1i(this.getUniformLocation(i),e)}prepareDrawToRenderTarget(t,e,i,n){const o=this.gl_,a=e.getSize();o.bindFramebuffer(o.FRAMEBUFFER,e.getFramebuffer()),o.bindRenderbuffer(o.RENDERBUFFER,e.getDepthbuffer()),o.viewport(0,0,a[0],a[1]),o.bindTexture(o.TEXTURE_2D,e.getTexture()),o.clearColor(0,0,0,0),o.depthRange(0,1),o.clearDepth(1),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.enable(o.BLEND),o.blendFunc(o.ONE,i?o.ZERO:o.ONE_MINUS_SRC_ALPHA),n?(o.enable(o.DEPTH_TEST),o.depthFunc(o.LEQUAL)):o.disable(o.DEPTH_TEST)}drawElements(t,e){const i=this.gl_;this.getExtension("OES_element_index_uint");const n=i.UNSIGNED_INT,o=4,a=e-t,h=t*o;i.drawElements(i.TRIANGLES,a,n,h)}finalizeDraw(t,e,i){for(let n=0,o=this.postProcessPasses_.length;n<o;n++)n===o-1?this.postProcessPasses_[n].apply(t,null,e,i):this.postProcessPasses_[n].apply(t,this.postProcessPasses_[n+1])}getCanvas(){return this.gl_.canvas}getGL(){return this.gl_}applyFrameState(t){const e=t.size,i=t.viewState.rotation,n=t.pixelRatio;this.setUniformFloatValue(ai.TIME,(Date.now()-this.startTime_)*.001),this.setUniformFloatValue(ai.ZOOM,t.viewState.zoom),this.setUniformFloatValue(ai.RESOLUTION,t.viewState.resolution),this.setUniformFloatValue(ai.PIXEL_RATIO,n),this.setUniformFloatVec2(ai.VIEWPORT_SIZE_PX,[e[0],e[1]]),this.setUniformFloatValue(ai.ROTATION,i)}applyHitDetectionUniform(t){const e=this.getUniformLocation(ai.HIT_DETECTION);this.getGL().uniform1i(e,t?1:0),t&&this.setUniformFloatValue(ai.PIXEL_RATIO,.5)}applyUniforms(t){const e=this.gl_;let i,n=0;this.uniforms_.forEach(o=>{if(i=typeof o.value=="function"?o.value(t):o.value,i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof ImageData)o.texture||(o.prevValue=void 0,o.texture=e.createTexture()),this.bindTexture(o.texture,n,o.name),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),(!(i instanceof HTMLImageElement)||i.complete)&&o.prevValue!==i&&(o.prevValue=i,e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i)),n++;else if(Array.isArray(i)&&i.length===6)this.setUniformMatrixValue(o.name,mx(this.tmpMat4_,i));else if(Array.isArray(i)&&i.length<=4)switch(i.length){case 2:e.uniform2f(this.getUniformLocation(o.name),i[0],i[1]);return;case 3:e.uniform3f(this.getUniformLocation(o.name),i[0],i[1],i[2]);return;case 4:e.uniform4f(this.getUniformLocation(o.name),i[0],i[1],i[2],i[3]);return;default:return}else typeof i=="number"&&e.uniform1f(this.getUniformLocation(o.name),i)})}useProgram(t,e){this.gl_.useProgram(t),this.currentProgram_=t,this.applyFrameState(e),this.applyUniforms(e)}compileShader(t,e){const i=this.gl_,n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}getProgram(t,e){const i=this.gl_,n=this.compileShader(t,i.FRAGMENT_SHADER),o=this.compileShader(e,i.VERTEX_SHADER),a=i.createProgram();if(i.attachShader(a,n),i.attachShader(a,o),i.linkProgram(a),!i.getShaderParameter(n,i.COMPILE_STATUS)){const h=`Fragment shader compilation failed: ${i.getShaderInfoLog(n)}`;throw new Error(h)}if(i.deleteShader(n),!i.getShaderParameter(o,i.COMPILE_STATUS)){const h=`Vertex shader compilation failed: ${i.getShaderInfoLog(o)}`;throw new Error(h)}if(i.deleteShader(o),!i.getProgramParameter(a,i.LINK_STATUS)){const h=`GL program linking failed: ${i.getProgramInfoLog(a)}`;throw new Error(h)}return a}getUniformLocation(t){const e=at(this.currentProgram_);return this.uniformLocationsByProgram_[e]===void 0&&(this.uniformLocationsByProgram_[e]={}),this.uniformLocationsByProgram_[e][t]===void 0&&(this.uniformLocationsByProgram_[e][t]=this.gl_.getUniformLocation(this.currentProgram_,t)),this.uniformLocationsByProgram_[e][t]}getAttributeLocation(t){const e=at(this.currentProgram_);return this.attribLocationsByProgram_[e]===void 0&&(this.attribLocationsByProgram_[e]={}),this.attribLocationsByProgram_[e][t]===void 0&&(this.attribLocationsByProgram_[e][t]=this.gl_.getAttribLocation(this.currentProgram_,t)),this.attribLocationsByProgram_[e][t]}makeProjectionTransform(t,e){const i=t.size,n=t.viewState.rotation,o=t.viewState.resolution,a=t.viewState.center;return ze(e,0,0,2/(o*i[0]),2/(o*i[1]),-n,-a[0],-a[1]),e}setUniformFloatValue(t,e){this.gl_.uniform1f(this.getUniformLocation(t),e)}setUniformFloatVec2(t,e){this.gl_.uniform2fv(this.getUniformLocation(t),e)}setUniformFloatVec4(t,e){this.gl_.uniform4fv(this.getUniformLocation(t),e)}setUniformMatrixValue(t,e){this.gl_.uniformMatrix4fv(this.getUniformLocation(t),!1,e)}enableAttributeArray_(t,e,i,n,o){const a=this.getAttributeLocation(t);a<0||(this.gl_.enableVertexAttribArray(a),this.gl_.vertexAttribPointer(a,e,i,!1,n,o))}enableAttributes(t){const e=wx(t);let i=0;for(let n=0;n<t.length;n++){const o=t[n];this.enableAttributeArray_(o.name,o.size,o.type||od,e,i),i+=o.size*fd(o.type)}}handleWebGLContextLost(t){Ln(this.bufferCache_),this.currentProgram_=null,t.preventDefault()}handleWebGLContextRestored(){this.needsToBeRecreated_=!0}needsToBeRecreated(){return this.needsToBeRecreated_}createTexture(t,e,i){const n=this.gl_;i=i||n.createTexture();const o=0,a=n.RGBA,h=0,c=n.RGBA,d=n.UNSIGNED_BYTE;return n.bindTexture(n.TEXTURE_2D,i),e?n.texImage2D(n.TEXTURE_2D,o,a,c,d,e):n.texImage2D(n.TEXTURE_2D,o,a,t[0],t[1],h,c,d,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),i}}function wx(r){let t=0;for(let e=0;e<r.length;e++){const i=r[e];t+=i.size*fd(i.type)}return t}function fd(r){switch(r){case li.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case li.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case li.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case li.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}class Tl extends hd{constructor(t,e){super(t),e=e||{},this.inversePixelTransform_=Vt(),this.pixelContext_=null,this.postProcesses_=e.postProcesses,this.uniforms_=e.uniforms,this.helper,t.addChangeListener(vt.MAP,this.removeHelper.bind(this)),this.dispatchPreComposeEvent=this.dispatchPreComposeEvent.bind(this),this.dispatchPostComposeEvent=this.dispatchPostComposeEvent.bind(this)}dispatchPreComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(qt.PRECOMPOSE)){const n=new br(qt.PRECOMPOSE,void 0,e,t);i.dispatchEvent(n)}}dispatchPostComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(qt.POSTCOMPOSE)){const n=new br(qt.POSTCOMPOSE,void 0,e,t);i.dispatchEvent(n)}}reset(t){this.uniforms_=t.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)}removeHelper(){this.helper&&(this.helper.dispose(),delete this.helper)}prepareFrame(t){if(this.getLayer().getRenderSource()){let e=!0,i=-1,n;for(let a=0,h=t.layerStatesArray.length;a<h;a++){const c=t.layerStatesArray[a].layer,d=c.getRenderer();if(!(d instanceof Tl)){e=!0;continue}const f=c.getClassName();if((e||f!==n)&&(i+=1,e=!1),n=f,d===this)break}const o="map/"+t.mapId+"/group/"+i;(!this.helper||!this.helper.canvasCacheKeyMatches(o)||this.helper.needsToBeRecreated())&&(this.removeHelper(),this.helper=new Ex({postProcesses:this.postProcesses_,uniforms:this.uniforms_,canvasCacheKey:o}),n&&(this.helper.getCanvas().className=n),this.afterHelperCreated())}return this.prepareFrameInternal(t)}afterHelperCreated(){}prepareFrameInternal(t){return!0}disposeInternal(){this.removeHelper(),super.disposeInternal()}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){ze(this.inversePixelTransform_,0,0,i.pixelRatio,-i.pixelRatio,0,0,-i.size[1]);const o=new br(t,this.inversePixelTransform_,i,e);n.dispatchEvent(o)}}preRender(t,e){this.dispatchRenderEvent_(qt.PRERENDER,t,e)}postRender(t,e){this.dispatchRenderEvent_(qt.POSTRENDER,t,e)}}const Lx=Tl,Ue=new Uint8Array(4);class bx{constructor(t,e){this.helper_=t;const i=t.getGL();this.texture_=i.createTexture(),this.framebuffer_=i.createFramebuffer(),this.depthbuffer_=i.createRenderbuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}setSize(t){ei(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())}getSize(){return this.size_}clearCachedData(){this.dataCacheDirty_=!0}readAll(){if(this.dataCacheDirty_){const t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_}readPixel(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return Ue[0]=0,Ue[1]=0,Ue[2]=0,Ue[3]=0,Ue;this.readAll();const i=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return Ue[0]=this.data_[i*4],Ue[1]=this.data_[i*4+1],Ue[2]=this.data_[i*4+2],Ue[3]=this.data_[i*4+3],Ue}getTexture(){return this.texture_}getFramebuffer(){return this.framebuffer_}getDepthbuffer(){return this.depthbuffer_}updateSize_(){const t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),e.bindRenderbuffer(e.RENDERBUFFER,this.depthbuffer_),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t[0],t[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthbuffer_),this.data_=new Uint8Array(t[0]*t[1]*4)}}const Tx=bx,gd={GENERATE_POLYGON_BUFFERS:"GENERATE_POLYGON_BUFFERS",GENERATE_POINT_BUFFERS:"GENERATE_POINT_BUFFERS",GENERATE_LINE_STRING_BUFFERS:"GENERATE_LINE_STRING_BUFFERS"};function Cx(r,t){t=t||[];const e=256,i=e-1;return t[0]=Math.floor(r/e/e/e)/i,t[1]=Math.floor(r/e/e)%e/i,t[2]=Math.floor(r/e)%e/i,t[3]=r%e/i,t}function Sx(r){let t=0;const e=256,i=e-1;return t+=Math.round(r[0]*e*e*e*i),t+=Math.round(r[1]*e*e*i),t+=Math.round(r[2]*e*i),t+=Math.round(r[3]*i),t}function Px(){const r='const e="GENERATE_POLYGON_BUFFERS",t="GENERATE_POINT_BUFFERS",n="GENERATE_LINE_STRING_BUFFERS";function r(e,t){const n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function x(e,t){const n=(r=t)[0]*r[3]-r[1]*r[2];var r;!function(e,t){if(!e)throw new Error(t)}(0!==n,"Transformation matrix cannot be inverted");const x=t[0],i=t[1],u=t[2],o=t[3],f=t[4],s=t[5];return e[0]=o/n,e[1]=-i/n,e[2]=-u/n,e[3]=x/n,e[4]=(u*s-o*f)/n,e[5]=-(x*s-i*f)/n,e}function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}new Array(6);var u={exports:{}};function o(e,t,n){n=n||2;var r,x,i,u,o,s,l,v=t&&t.length,c=v?t[0]*n:e.length,h=f(e,0,c,n,!0),g=[];if(!h||h.next===h.prev)return g;if(v&&(h=function(e,t,n,r){var x,i,u,o=[];for(x=0,i=t.length;x<i;x++)(u=f(e,t[x]*r,x<i-1?t[x+1]*r:e.length,r,!1))===u.next&&(u.steiner=!0),o.push(d(u));for(o.sort(p),x=0;x<o.length;x++)n=y(o[x],n);return n}(e,t,h,n)),e.length>80*n){r=i=e[0],x=u=e[1];for(var b=n;b<c;b+=n)(o=e[b])<r&&(r=o),(s=e[b+1])<x&&(x=s),o>i&&(i=o),s>u&&(u=s);l=0!==(l=Math.max(i-r,u-x))?32767/l:0}return a(h,g,n,r,x,l,0),g}function f(e,t,n,r,x){var i,u;if(x===O(e,t,n,r)>0)for(i=t;i<n;i+=r)u=P(i,e[i],e[i+1],u);else for(i=n-r;i>=t;i-=r)u=P(i,e[i],e[i+1],u);return u&&m(u,u.next)&&(B(u),u=u.next),u}function s(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!m(r,r.next)&&0!==M(r.prev,r,r.next))r=r.next;else{if(B(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function a(e,t,n,r,x,i,u){if(e){!u&&i&&function(e,t,n,r){var x=e;do{0===x.z&&(x.z=b(x.x,x.y,t,n,r)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next}while(x!==e);x.prevZ.nextZ=null,x.prevZ=null,function(e){var t,n,r,x,i,u,o,f,s=1;do{for(n=e,e=null,i=null,u=0;n;){for(u++,r=n,o=0,t=0;t<s&&(o++,r=r.nextZ);t++);for(f=s;o>0||f>0&&r;)0!==o&&(0===f||!r||n.z<=r.z)?(x=n,n=n.nextZ,o--):(x=r,r=r.nextZ,f--),i?i.nextZ=x:e=x,x.prevZ=i,i=x;n=r}i.nextZ=null,s*=2}while(u>1)}(x)}(e,r,x,i);for(var o,f,p=e;e.prev!==e.next;)if(o=e.prev,f=e.next,i?v(e,r,x,i):l(e))t.push(o.i/n|0),t.push(e.i/n|0),t.push(f.i/n|0),B(e),e=f.next,p=f.next;else if((e=f)===p){u?1===u?a(e=c(s(e),t,n),t,n,r,x,i,2):2===u&&h(e,t,n,r,x,i):a(s(e),t,n,r,x,i,1);break}}}function l(e){var t=e.prev,n=e,r=e.next;if(M(t,n,r)>=0)return!1;for(var x=t.x,i=n.x,u=r.x,o=t.y,f=n.y,s=r.y,a=x<i?x<u?x:u:i<u?i:u,l=o<f?o<s?o:s:f<s?f:s,v=x>i?x>u?x:u:i>u?i:u,c=o>f?o>s?o:s:f>s?f:s,h=r.next;h!==t;){if(h.x>=a&&h.x<=v&&h.y>=l&&h.y<=c&&Z(x,o,i,f,u,s,h.x,h.y)&&M(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function v(e,t,n,r){var x=e.prev,i=e,u=e.next;if(M(x,i,u)>=0)return!1;for(var o=x.x,f=i.x,s=u.x,a=x.y,l=i.y,v=u.y,c=o<f?o<s?o:s:f<s?f:s,h=a<l?a<v?a:v:l<v?l:v,p=o>f?o>s?o:s:f>s?f:s,y=a>l?a>v?a:v:l>v?l:v,g=b(c,h,t,n,r),d=b(p,y,t,n,r),w=e.prevZ,m=e.nextZ;w&&w.z>=g&&m&&m.z<=d;){if(w.x>=c&&w.x<=p&&w.y>=h&&w.y<=y&&w!==x&&w!==u&&Z(o,a,f,l,s,v,w.x,w.y)&&M(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,m.x>=c&&m.x<=p&&m.y>=h&&m.y<=y&&m!==x&&m!==u&&Z(o,a,f,l,s,v,m.x,m.y)&&M(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;w&&w.z>=g;){if(w.x>=c&&w.x<=p&&w.y>=h&&w.y<=y&&w!==x&&w!==u&&Z(o,a,f,l,s,v,w.x,w.y)&&M(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;m&&m.z<=d;){if(m.x>=c&&m.x<=p&&m.y>=h&&m.y<=y&&m!==x&&m!==u&&Z(o,a,f,l,s,v,m.x,m.y)&&M(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function c(e,t,n){var r=e;do{var x=r.prev,i=r.next.next;!m(x,i)&&A(x,r,r.next,i)&&F(x,i)&&F(i,x)&&(t.push(x.i/n|0),t.push(r.i/n|0),t.push(i.i/n|0),B(r),B(r.next),r=e=i),r=r.next}while(r!==e);return s(r)}function h(e,t,n,r,x,i){var u=e;do{for(var o=u.next.next;o!==u.prev;){if(u.i!==o.i&&w(u,o)){var f=I(u,o);return u=s(u,u.next),f=s(f,f.next),a(u,t,n,r,x,i,0),void a(f,t,n,r,x,i,0)}o=o.next}u=u.next}while(u!==e)}function p(e,t){return e.x-t.x}function y(e,t){var n=function(e,t){var n,r=t,x=e.x,i=e.y,u=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var o=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=x&&o>u&&(u=o,n=r.x<r.next.x?r:r.next,o===x))return n}r=r.next}while(r!==t);if(!n)return null;var f,s=n,a=n.x,l=n.y,v=1/0;r=n;do{x>=r.x&&r.x>=a&&x!==r.x&&Z(i<l?x:u,i,a,l,i<l?u:x,i,r.x,r.y)&&(f=Math.abs(i-r.y)/(x-r.x),F(r,e)&&(f<v||f===v&&(r.x>n.x||r.x===n.x&&g(n,r)))&&(n=r,v=f)),r=r.next}while(r!==s);return n}(e,t);if(!n)return t;var r=I(n,e);return s(r,r.next),s(n,n.next)}function g(e,t){return M(e.prev,e,t.prev)<0&&M(t.next,e,e.next)<0}function b(e,t,n,r,x){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*x|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*x|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function d(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Z(e,t,n,r,x,i,u,o){return(x-u)*(t-o)>=(e-u)*(i-o)&&(e-u)*(r-o)>=(n-u)*(t-o)&&(n-u)*(i-o)>=(x-u)*(r-o)}function w(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&A(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(F(e,t)&&F(t,e)&&function(e,t){var n=e,r=!1,x=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&x<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(M(e.prev,e,t.prev)||M(e,t.prev,t))||m(e,t)&&M(e.prev,e,e.next)>0&&M(t.prev,t,t.next)>0)}function M(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function m(e,t){return e.x===t.x&&e.y===t.y}function A(e,t,n,r){var x=z(M(e,t,n)),i=z(M(e,t,r)),u=z(M(n,r,e)),o=z(M(n,r,t));return x!==i&&u!==o||(!(0!==x||!E(e,n,t))||(!(0!==i||!E(e,r,t))||(!(0!==u||!E(n,e,r))||!(0!==o||!E(n,t,r)))))}function E(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function z(e){return e>0?1:e<0?-1:0}function F(e,t){return M(e.prev,e,e.next)<0?M(e,t,e.next)>=0&&M(e,e.prev,t)>=0:M(e,t,e.prev)<0||M(e,e.next,t)<0}function I(e,t){var n=new _(e.i,e.x,e.y),r=new _(t.i,t.x,t.y),x=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=x,x.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function P(e,t,n,r){var x=new _(e,t,n);return r?(x.next=r.next,x.prev=r,r.next.prev=x,r.next=x):(x.prev=x,x.next=x),x}function B(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function _(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(e,t,n,r){for(var x=0,i=t,u=n-r;i<n;i+=r)x+=(e[u]-e[i])*(e[i+1]+e[u+1]),u=i;return x}u.exports=o,u.exports.default=o,o.deviation=function(e,t,n,r){var x=t&&t.length,i=x?t[0]*n:e.length,u=Math.abs(O(e,0,i,n));if(x)for(var o=0,f=t.length;o<f;o++){var s=t[o]*n,a=o<f-1?t[o+1]*n:e.length;u-=Math.abs(O(e,s,a,n))}var l=0;for(o=0;o<r.length;o+=3){var v=r[o]*n,c=r[o+1]*n,h=r[o+2]*n;l+=Math.abs((e[v]-e[h])*(e[c+1]-e[v+1])-(e[v]-e[c])*(e[h+1]-e[v+1]))}return 0===u&&0===l?0:Math.abs((l-u)/u)},o.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,x=0;x<e.length;x++){for(var i=0;i<e[x].length;i++)for(var u=0;u<t;u++)n.vertices.push(e[x][i][u]);x>0&&(r+=e[x-1].length,n.holes.push(r))}return n};var N=i(u.exports);const R=[],S={vertexPosition:0,indexPosition:0};function T(e,t,n,r,x){e[t+0]=n,e[t+1]=r,e[t+2]=x}function U(e,t,n,r,x,i){const u=3+x,o=e[t+0],f=e[t+1],s=R;s.length=x;for(let n=0;n<s.length;n++)s[n]=e[t+2+n];let a=i?i.vertexPosition:0,l=i?i.indexPosition:0;const v=a/u;return T(n,a,o,f,0),s.length&&n.set(s,a+3),a+=u,T(n,a,o,f,1),s.length&&n.set(s,a+3),a+=u,T(n,a,o,f,2),s.length&&n.set(s,a+3),a+=u,T(n,a,o,f,3),s.length&&n.set(s,a+3),a+=u,r[l++]=v,r[l++]=v+1,r[l++]=v+3,r[l++]=v+1,r[l++]=v+2,r[l++]=v+3,S.vertexPosition=a,S.indexPosition=l,S}function k(e,t,n,x,i,u,o,f,s,a){const l=8+f.length,v=u.length/l,c=[e[t+0],e[t+1]],h=[e[n],e[n+1]],p=r(s,[...c]),y=r(s,[...h]);function g(e,t,n){const r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),x=[(t[0]-e[0])/r,(t[1]-e[1])/r],i=[-x[1],x[0]],u=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),o=[(n[0]-e[0])/u,(n[1]-e[1])/u],f=0===r||0===u?0:Math.acos((s=o[0]*x[0]+o[1]*x[1],a=-1,l=1,Math.min(Math.max(s,a),l)));var s,a,l;return o[0]*i[0]+o[1]*i[1]>0?f:2*Math.PI-f}let b=-1,d=-1;const Z=null!==i;if(null!==x){b=g(p,y,r(s,[...[e[x],e[x+1]]]))}if(Z){d=g(y,p,r(s,[...[e[i],e[i+1]]]))}return u.push(c[0],c[1],h[0],h[1],b,d,a,0),u.push(...f),u.push(c[0],c[1],h[0],h[1],b,d,a,1),u.push(...f),u.push(c[0],c[1],h[0],h[1],b,d,a,2),u.push(...f),u.push(c[0],c[1],h[0],h[1],b,d,a,3),u.push(...f),o.push(v,v+1,v+2,v+1,v+3,v+2),a+Math.sqrt((y[0]-p[0])*(y[0]-p[0])+(y[1]-p[1])*(y[1]-p[1]))}function G(e,t,n,r,x){const i=2+x;let u=t;const o=e.slice(u,u+x);u+=x;const f=e[u++];let s=0;const a=new Array(f-1);for(let t=0;t<f;t++)s+=e[u++],t<f-1&&(a[t]=s);const l=e.slice(u,u+2*s),v=N(l,a,2);for(let e=0;e<v.length;e++)r.push(v[e]+n.length/i);for(let e=0;e<l.length;e+=2)n.push(l[e],l[e+1],...o);return u+2*s}const j=self;j.onmessage=r=>{const i=r.data;switch(i.type){case t:{const e=3,t=2,n=i.customAttributesSize,r=t+n,x=new Float32Array(i.renderInstructions),u=x.length/r,o=4*u*(n+e),f=new Uint32Array(6*u),s=new Float32Array(o);let a;for(let e=0;e<x.length;e+=r)a=U(x,e,s,f,n,a);const l=Object.assign({vertexBuffer:s.buffer,indexBuffer:f.buffer,renderInstructions:x.buffer},i);j.postMessage(l,[s.buffer,f.buffer,x.buffer]);break}case n:{const e=[],t=[],n=i.customAttributesSize,r=2,u=new Float32Array(i.renderInstructions);let o=0;const f=[1,0,0,1,0,0];let s,a;for(x(f,i.renderInstructionsTransform);o<u.length;){a=Array.from(u.slice(o,o+n)),o+=n,s=u[o++];const x=o,i=o+(s-1)*r,l=u[x]===u[i]&&u[x+1]===u[i+1];let v=0;for(let n=0;n<s-1;n++){let c=null;n>0?c=o+(n-1)*r:l&&(c=i-r);let h=null;n<s-2?h=o+(n+2)*r:l&&(h=x+r),v=k(u,o+n*r,o+(n+1)*r,c,h,e,t,a,f,v)}o+=s*r}const l=Uint32Array.from(t),v=Float32Array.from(e),c=Object.assign({vertexBuffer:v.buffer,indexBuffer:l.buffer,renderInstructions:u.buffer},i);j.postMessage(c,[v.buffer,l.buffer,u.buffer]);break}case e:{const e=[],t=[],n=i.customAttributesSize,r=new Float32Array(i.renderInstructions);let x=0;for(;x<r.length;)x=G(r,x,e,t,n);const u=Uint32Array.from(t),o=Float32Array.from(e),f=Object.assign({vertexBuffer:o.buffer,indexBuffer:u.buffer,renderInstructions:r.buffer},i);j.postMessage(f,[o.buffer,u.buffer,r.buffer]);break}}};';return new Worker(typeof Blob>"u"?"data:application/javascript;base64,"+Buffer.from(r,"binary").toString("base64"):URL.createObjectURL(new Blob([r],{type:"application/javascript"})))}class kx extends Lx{constructor(t,e){const i=e.uniforms||{},n=Vt();i[ai.PROJECTION_MATRIX]=n,super(t,{uniforms:i,postProcesses:e.postProcesses}),this.sourceRevision_=-1,this.verticesBuffer_=new ld(El,Ll),this.indicesBuffer_=new ld(wl,Ll),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.program_,this.hitDetectionEnabled_=e.hitDetectionEnabled??!0;const o=e.attributes?e.attributes.map(function(h){return{name:"a_"+h.name,size:1,type:li.FLOAT}}):[];this.attributes=[{name:"a_position",size:2,type:li.FLOAT},{name:"a_index",size:1,type:li.FLOAT}],this.hitDetectionEnabled_&&(this.attributes.push({name:"a_hitColor",size:4,type:li.FLOAT}),this.attributes.push({name:"a_featureUid",size:1,type:li.FLOAT})),this.attributes.push(...o),this.customAttributes=e.attributes?e.attributes:[],this.previousExtent_=ge(),this.currentTransform_=n,this.renderTransform_=Vt(),this.invertRenderTransform_=Vt(),this.renderInstructions_=new Float32Array(0),this.hitRenderTarget_,this.lastSentId=0,this.worker_=Px(),this.worker_.addEventListener("message",h=>{const c=h.data;if(c.type===gd.GENERATE_POINT_BUFFERS){const d=c.projectionTransform;this.verticesBuffer_.fromArrayBuffer(c.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_),this.indicesBuffer_.fromArrayBuffer(c.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=d,Gs(this.invertRenderTransform_,this.renderTransform_),this.renderInstructions_=new Float32Array(h.data.renderInstructions),c.id===this.lastSentId&&(this.ready=!0),this.getLayer().changed()}}),this.featureCache_={},this.featureCount_=0;const a=this.getLayer().getSource();this.sourceListenKeys_=[ht(a,ee.ADDFEATURE,this.handleSourceFeatureAdded_,this),ht(a,ee.CHANGEFEATURE,this.handleSourceFeatureChanged_,this),ht(a,ee.REMOVEFEATURE,this.handleSourceFeatureDelete_,this),ht(a,ee.CLEAR,this.handleSourceFeatureClear_,this)],a.forEachFeature(h=>{this.featureCache_[at(h)]={feature:h,properties:h.getProperties(),geometry:h.getGeometry()},this.featureCount_++})}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitRenderTarget_=new Tx(this.helper))}handleSourceFeatureAdded_(t){const e=t.feature;this.featureCache_[at(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++}handleSourceFeatureChanged_(t){const e=t.feature;this.featureCache_[at(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}}handleSourceFeatureDelete_(t){const e=t.feature;delete this.featureCache_[at(e)],this.featureCount_--}handleSourceFeatureClear_(){this.featureCache_={},this.featureCount_=0}renderFrame(t){const e=this.helper.getGL();this.preRender(e,t);const[i,n,o]=this.getWorldParameters_(t);this.renderWorlds(t,!1,i,n,o),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);const a=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderWorlds(t,!0,i,n,o),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),a}getWorldParameters_(t){const e=t.viewState.projection,o=this.getLayer().getSource().getWrapX()&&e.canWrapX(),a=e.getExtent(),h=t.extent,c=o?Tt(a):null,d=o?Math.ceil((h[2]-a[2])/c)+1:1;return[o?Math.floor((h[0]-a[0])/c):0,d,c]}prepareFrameInternal(t){const e=this.getLayer(),i=e.getSource(),n=t.viewState,o=!t.viewHints[Ut.ANIMATING]&&!t.viewHints[Ut.INTERACTING],a=!Pn(this.previousExtent_,t.extent),h=this.sourceRevision_<i.getRevision();if(h&&(this.sourceRevision_=i.getRevision()),o&&(a||h)){const c=n.projection,d=n.resolution,f=e instanceof xl?e.getRenderBuffer():0,_=ks(t.extent,f*d);i.loadFeatures(_,d,c),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.useProgram(this.program_,t),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0}rebuildBuffers_(t){const e=Vt();this.helper.makeProjectionTransform(t,e);const n=(this.hitDetectionEnabled_?7:2)+this.customAttributes.length,o=n*this.featureCount_;(!this.renderInstructions_||this.renderInstructions_.length!==o)&&(this.renderInstructions_=new Float32Array(o));let a,h;const c=[],d=[];let f=-1;for(const m in this.featureCache_)if(a=this.featureCache_[m],h=a.geometry,!(!h||h.getType()!=="Point")){if(c[0]=h.getFlatCoordinates()[0],c[1]=h.getFlatCoordinates()[1],Ot(e,c),this.renderInstructions_[++f]=c[0],this.renderInstructions_[++f]=c[1],this.hitDetectionEnabled_){const v=Cx(f+5,d);this.renderInstructions_[++f]=v[0],this.renderInstructions_[++f]=v[1],this.renderInstructions_[++f]=v[2],this.renderInstructions_[++f]=v[3],this.renderInstructions_[++f]=Number(m)}for(let v=0;v<this.customAttributes.length;v++){const y=this.customAttributes[v].callback(a.feature,a.properties);this.renderInstructions_[++f]=y}}const _={id:++this.lastSentId,type:gd.GENERATE_POINT_BUFFERS,renderInstructions:this.renderInstructions_.buffer,customAttributesSize:n-2};_.projectionTransform=e,this.ready=!1,this.worker_.postMessage(_,[this.renderInstructions_.buffer]),this.renderInstructions_=null}forEachFeatureAtCoordinate(t,e,i,n,o){if(ft(this.hitDetectionEnabled_,"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has not been enabled. This is done by providing adequate shaders using the `hitVertexShader` and `hitFragmentShader` properties of `WebGLPointsLayerRenderer`"),!this.renderInstructions_||!this.hitDetectionEnabled_)return;const a=Ot(e.coordinateToPixelTransform,t.slice()),h=this.hitRenderTarget_.readPixel(a[0]/2,a[1]/2),c=[h[0]/255,h[1]/255,h[2]/255,h[3]/255],d=Sx(c),f=this.renderInstructions_[d],_=Math.floor(f).toString(),v=this.getLayer().getSource().getFeatureByUid(_);if(v)return n(v,this.getLayer(),null)}renderWorlds(t,e,i,n,o){let a=i;this.helper.useProgram(this.program_,t),e&&(this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0)),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes);do{this.helper.makeProjectionTransform(t,this.currentTransform_),Lm(this.currentTransform_,a*o,0),qc(this.currentTransform_,this.invertRenderTransform_),this.helper.applyUniforms(t),this.helper.applyHitDetectionUniform(e);const h=this.indicesBuffer_.getSize();this.helper.drawElements(0,h)}while(++a<n)}disposeInternal(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach(function(t){wt(t)}),this.sourceListenKeys_=null,super.disposeInternal()}}const Rx=kx,Mx=.5;class Ix extends bs{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.interimTile=null,this.key="",this.transition_=i.transition===void 0?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(rt.CHANGE)}release(){this.state===$.ERROR&&this.setState($.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getInterimTile(){if(!this.interimTile)return this;let t=this.interimTile;do{if(t.getState()==$.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this}refreshInterimChain(){if(!this.interimTile)return;let t=this.interimTile,e=this;do{if(t.getState()==$.LOADED){t.interimTile=null;break}else t.getState()==$.LOADING?e=t:t.getState()==$.IDLE?e.interimTile=t.interimTile:e=t;t=e.interimTile}while(t)}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==$.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){it()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(!i)i=e,this.transitionStarts_[t]=i;else if(i===-1)return 1;const n=e-i+1e3/60;return n>=this.transition_?1:Hc(n/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}}const _d=Ix,Ax=10,pd=.25;class Dx{constructor(t,e,i,n,o,a){this.sourceProj_=t,this.targetProj_=e;let h={};const c=Bs(this.targetProj_,this.sourceProj_);this.transformInv_=function(w){const T=w[0]+"/"+w[1];return h[T]||(h[T]=c(w)),h[T]},this.maxSourceExtent_=n,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&Tt(n)>=Tt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Tt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Tt(this.targetProj_.getExtent()):null;const d=qi(i),f=As(i),_=Is(i),m=Ms(i),v=this.transformInv_(d),y=this.transformInv_(f),E=this.transformInv_(_),b=this.transformInv_(m),S=Ax+(a?Math.max(0,Math.ceil(Math.log2(Ta(i)/(a*a*256*256)))):0);if(this.addQuad_(d,f,_,m,v,y,E,b,S),this.wrapsXInSource_){let w=1/0;this.triangles_.forEach(function(T,P,M){w=Math.min(w,T.source[0][0],T.source[1][0],T.source[2][0])}),this.triangles_.forEach(T=>{if(Math.max(T.source[0][0],T.source[1][0],T.source[2][0])-w>this.sourceWorldWidth_/2){const P=[[T.source[0][0],T.source[0][1]],[T.source[1][0],T.source[1][1]],[T.source[2][0],T.source[2][1]]];P[0][0]-w>this.sourceWorldWidth_/2&&(P[0][0]-=this.sourceWorldWidth_),P[1][0]-w>this.sourceWorldWidth_/2&&(P[1][0]-=this.sourceWorldWidth_),P[2][0]-w>this.sourceWorldWidth_/2&&(P[2][0]-=this.sourceWorldWidth_);const M=Math.min(P[0][0],P[1][0],P[2][0]);Math.max(P[0][0],P[1][0],P[2][0])-M<this.sourceWorldWidth_/2&&(T.source=P)}})}h={}}addTriangle_(t,e,i,n,o,a){this.triangles_.push({source:[n,o,a],target:[t,e,i]})}addQuad_(t,e,i,n,o,a,h,c,d){const f=bc([o,a,h,c]),_=this.sourceWorldWidth_?Tt(f)/this.sourceWorldWidth_:null,m=this.sourceWorldWidth_,v=this.sourceProj_.canWrapX()&&_>.5&&_<1;let y=!1;if(d>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const b=bc([t,e,i,n]);y=Tt(b)/this.targetWorldWidth_>pd||y}!v&&this.sourceProj_.isGlobal()&&_&&(y=_>pd||y)}if(!y&&this.maxSourceExtent_&&isFinite(f[0])&&isFinite(f[1])&&isFinite(f[2])&&isFinite(f[3])&&!se(f,this.maxSourceExtent_))return;let E=0;if(!y&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(h[0])||!isFinite(h[1])||!isFinite(c[0])||!isFinite(c[1]))){if(d>0)y=!0;else if(E=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(h[0])||!isFinite(h[1])?2:0)+(!isFinite(c[0])||!isFinite(c[1])?1:0),E!=1&&E!=2&&E!=4&&E!=8)return}if(d>0){if(!y){const b=[(t[0]+i[0])/2,(t[1]+i[1])/2],S=this.transformInv_(b);let w;v?w=(kn(o[0],m)+kn(h[0],m))/2-kn(S[0],m):w=(o[0]+h[0])/2-S[0];const T=(o[1]+h[1])/2-S[1];y=w*w+T*T>this.errorThresholdSquared_}if(y){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){const b=[(e[0]+i[0])/2,(e[1]+i[1])/2],S=this.transformInv_(b),w=[(n[0]+t[0])/2,(n[1]+t[1])/2],T=this.transformInv_(w);this.addQuad_(t,e,b,w,o,a,S,T,d-1),this.addQuad_(w,b,i,n,T,S,h,c,d-1)}else{const b=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(b),w=[(i[0]+n[0])/2,(i[1]+n[1])/2],T=this.transformInv_(w);this.addQuad_(t,b,w,n,o,S,T,c,d-1),this.addQuad_(b,e,i,w,S,a,h,T,d-1)}return}}if(v){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}E&11||this.addTriangle_(t,i,n,o,h,c),E&14||this.addTriangle_(t,i,e,o,h,a),E&&(E&13||this.addTriangle_(e,n,t,a,c,o),E&7||this.addTriangle_(e,n,i,a,c,h))}calculateSourceExtent(){const t=ge();return this.triangles_.forEach(function(e,i,n){const o=e.source;vr(t,o[0]),vr(t,o[1]),vr(t,o[2])}),t}getTriangles(){return this.triangles_}}const Ox=Dx;let Cl;const Bn=[];function md(r,t,e,i,n){r.beginPath(),r.moveTo(0,0),r.lineTo(t,e),r.lineTo(i,n),r.closePath(),r.save(),r.clip(),r.fillRect(0,0,Math.max(t,i)+1,Math.max(e,n)),r.restore()}function Sl(r,t){return Math.abs(r[t*4]-210)>2||Math.abs(r[t*4+3]-.75*255)>2}function Fx(){if(Cl===void 0){const r=$t(6,6,Bn);r.globalCompositeOperation="lighter",r.fillStyle="rgba(210, 0, 0, 0.75)",md(r,4,5,4,0),md(r,4,5,0,5);const t=r.getImageData(0,0,3,3).data;Cl=Sl(t,0)||Sl(t,4)||Sl(t,8),Js(r),Bn.push(r.canvas)}return Cl}function yd(r,t,e,i){const n=Gc(e,t,r);let o=zc(t,i,e);const a=t.getMetersPerUnit();a!==void 0&&(o*=a);const h=r.getMetersPerUnit();h!==void 0&&(o/=h);const c=r.getExtent();if(!c||Rs(c,n)){const d=zc(r,o,n)/o;isFinite(d)&&d>0&&(o/=d)}return o}function zx(r,t,e,i){const n=Ki(e);let o=yd(r,t,n,i);return(!isFinite(o)||o<=0)&&kc(e,function(a){return o=yd(r,t,a,i),isFinite(o)&&o>0}),o}function Nx(r,t,e,i,n,o,a,h,c,d,f,_){const m=$t(Math.round(e*r),Math.round(e*t),Bn);if(_||(m.imageSmoothingEnabled=!1),c.length===0)return m.canvas;m.scale(e,e);function v(P){return Math.round(P*e)/e}m.globalCompositeOperation="lighter";const y=ge();c.forEach(function(P,M,I){Sc(y,P.extent)});const E=Tt(y),b=Fe(y),S=$t(Math.round(e*E/i),Math.round(e*b/i),Bn);_||(S.imageSmoothingEnabled=!1);const w=e/i;c.forEach(function(P,M,I){const D=P.extent[0]-y[0],z=-(P.extent[3]-y[3]),W=Tt(P.extent),K=Fe(P.extent);P.image.width>0&&P.image.height>0&&S.drawImage(P.image,d,d,P.image.width-2*d,P.image.height-2*d,D*w,z*w,W*w,K*w)});const T=qi(a);return h.getTriangles().forEach(function(P,M,I){const D=P.source,z=P.target;let W=D[0][0],K=D[0][1],Q=D[1][0],q=D[1][1],ct=D[2][0],Et=D[2][1];const V=v((z[0][0]-T[0])/o),H=v(-(z[0][1]-T[1])/o),Z=v((z[1][0]-T[0])/o),B=v(-(z[1][1]-T[1])/o),yt=v((z[2][0]-T[0])/o),U=v(-(z[2][1]-T[1])/o),st=W,F=K;W=0,K=0,Q-=st,q-=F,ct-=st,Et-=F;const Lt=[[Q,q,0,0,Z-V],[ct,Et,0,0,yt-V],[0,0,Q,q,B-H],[0,0,ct,Et,U-H]],J=tm(Lt);if(J){if(m.save(),m.beginPath(),Fx()||!_){m.moveTo(Z,B);const Y=4,nt=V-Z,Ft=H-B;for(let St=0;St<Y;St++)m.lineTo(Z+v((St+1)*nt/Y),B+v(St*Ft/(Y-1))),St!=Y-1&&m.lineTo(Z+v((St+1)*nt/Y),B+v((St+1)*Ft/(Y-1)));m.lineTo(yt,U)}else m.moveTo(Z,B),m.lineTo(V,H),m.lineTo(yt,U);m.clip(),m.transform(J[0],J[2],J[1],J[3],V,H),m.translate(y[0]-st,y[3]-F),m.scale(i/e,-i/e),m.drawImage(S.canvas,0,0),m.restore()}}),Js(S),Bn.push(S.canvas),f&&(m.save(),m.globalCompositeOperation="source-over",m.strokeStyle="black",m.lineWidth=1,h.getTriangles().forEach(function(P,M,I){const D=P.target,z=(D[0][0]-T[0])/o,W=-(D[0][1]-T[1])/o,K=(D[1][0]-T[0])/o,Q=-(D[1][1]-T[1])/o,q=(D[2][0]-T[0])/o,ct=-(D[2][1]-T[1])/o;m.beginPath(),m.moveTo(K,Q),m.lineTo(z,W),m.lineTo(q,ct),m.closePath(),m.stroke()}),m.restore()),m.canvas}class Bx extends _d{constructor(t,e,i,n,o,a,h,c,d,f,_,m){super(o,$.IDLE,{interpolate:!!m}),this.renderEdges_=_!==void 0?_:!1,this.pixelRatio_=h,this.gutter_=c,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=n,this.wrappedTileCoord_=a||o,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const v=n.getTileCoordExtent(this.wrappedTileCoord_),y=this.targetTileGrid_.getExtent();let E=this.sourceTileGrid_.getExtent();const b=y?xr(v,y):v;if(Ta(b)===0){this.state=$.EMPTY;return}const S=t.getExtent();S&&(E?E=xr(E,S):E=S);const w=n.getResolution(this.wrappedTileCoord_[0]),T=zx(t,i,b,w);if(!isFinite(T)||T<=0){this.state=$.EMPTY;return}const P=f!==void 0?f:Mx;if(this.triangulation_=new Ox(t,i,b,E,T*P,w),this.triangulation_.getTriangles().length===0){this.state=$.EMPTY;return}this.sourceZ_=e.getZForResolution(T);let M=this.triangulation_.calculateSourceExtent();if(E&&(t.canWrapX()?(M[1]=It(M[1],E[1],E[3]),M[3]=It(M[3],E[1],E[3])):M=xr(M,E)),!Ta(M))this.state=$.EMPTY;else{const I=e.getTileRangeForExtentAndZ(M,this.sourceZ_);for(let D=I.minX;D<=I.maxX;D++)for(let z=I.minY;z<=I.maxY;z++){const W=d(this.sourceZ_,D,z,h);W&&this.sourceTiles_.push(W)}this.sourceTiles_.length===0&&(this.state=$.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{e&&e.getState()==$.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}),this.sourceTiles_.length=0,t.length===0)this.state=$.ERROR;else{const e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n=typeof i=="number"?i:i[0],o=typeof i=="number"?i:i[1],a=this.targetTileGrid_.getResolution(e),h=this.sourceTileGrid_.getResolution(this.sourceZ_),c=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Nx(n,o,this.pixelRatio_,h,this.sourceTileGrid_.getExtent(),a,c,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=$.LOADED}this.changed()}load(){if(this.state==$.IDLE){this.state=$.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(e=>{const i=e.getState();if(i==$.IDLE||i==$.LOADING){t++;const n=ht(e,rt.CHANGE,function(o){const a=e.getState();(a==$.LOADED||a==$.ERROR||a==$.EMPTY)&&(wt(n),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(n)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(e,i,n){e.getState()==$.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(wt),this.sourcesListenerKeys_=null}release(){this.canvas_&&(Js(this.canvas_.getContext("2d")),Bn.push(this.canvas_),this.canvas_=null),super.release()}}const Pl=Bx;class Gx extends _d{constructor(t,e,i,n,o,a){super(t,e,a),this.crossOrigin_=n,this.src_=i,this.key=i,this.image_=new Image,n!==null&&(this.image_.crossOrigin=n),this.unlisten_=null,this.tileLoadFunction_=o}getImage(){return this.image_}setImage(t){this.image_=t,this.state=$.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=$.ERROR,this.unlistenImage_(),this.image_=Ux(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=$.LOADED:this.state=$.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==$.ERROR&&(this.state=$.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==$.IDLE&&(this.state=$.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Lv(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function Ux(){const r=$t(1,1);return r.fillStyle="rgba(0,0,0,0)",r.fillRect(0,0,1,1),r.canvas}const vd=Gx;class Zx{constructor(t){this.highWaterMark=t!==void 0?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}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 i=this.entries_[t];return ft(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(t){const e=this.entries_[t];return ft(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,i;for(i=this.newest_;i;i=i.older)t[e++]=i.key_;return t}getValues(){const t=new Array(this.count_);let e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){if(this.containsKey(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){ft(!(t in this.entries_),"Tried to set a value for a key that is used already");const i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_}setSize(t){this.highWaterMark=t}}const jx=Zx;class xd{constructor(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}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 Gn(r,t,e,i,n){return n!==void 0?(n.minX=r,n.maxX=t,n.minY=e,n.maxY=i,n):new xd(r,t,e,i)}const Ed=xd;function wd(r,t,e,i){return i!==void 0?(i[0]=r,i[1]=t,i[2]=e,i):[r,t,e]}function mo(r,t,e){return r+"/"+t+"/"+e}function Ld(r){return mo(r[0],r[1],r[2])}function Wx(r){return r.split("/").map(Number)}function Hx(r){return(r[1]<<r[0])+r[2]}function Vx(r,t){const e=r[0],i=r[1],n=r[2];if(t.getMinZoom()>e||e>t.getMaxZoom())return!1;const o=t.getFullTileRange(e);return o?o.containsXY(i,n):!0}function Nr(r){const t=r.toString();return t.includes(".")?t:t+".0"}function Xx(r){if(r.length<2||r.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return`vec${r.length}(${r.map(Nr).join(", ")})`}function kl(r){const t=Lr(r),e=t.length>3?t[3]:1;return Xx([t[0]/255*e,t[1]/255*e,t[2]/255*e,e])}const Rl={};let Yx=0;function Kx(r){return r in Rl||(Rl[r]=Yx++),Rl[r]}function Un(r){return Nr(Kx(r))}function qx(){return{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"#3399CC","stroke-width":1.25,"circle-radius":5,"circle-fill-color":"rgba(255,255,255,0.4)","circle-stroke-width":1.25,"circle-stroke-color":"#3399CC"}}const Zn=`#ifdef GL_FRAGMENT_PRECISION_HIGH
47
+ `;class $v{constructor(t){this.gl_=t.webGlContext;const e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer(),this.depthBuffer_=e.createRenderbuffer();const i=e.createShader(e.VERTEX_SHADER);e.shaderSource(i,t.vertexShader||Kv),e.compileShader(i);const n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,t.fragmentShader||qv),e.compileShader(n),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,i),e.attachShader(this.renderTargetProgram_,n),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer();const o=[-1,-1,1,-1,-1,1,1,-1,1,1,-1,1];e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array(o),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(a=>{this.uniforms_.push({value:t.uniforms[a],location:e.getUniformLocation(this.renderTargetProgram_,a)})})}getGL(){return this.gl_}init(t){const e=this.getGL(),i=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.bindRenderbuffer(e.RENDERBUFFER,this.getDepthBuffer()),e.viewport(0,0,i[0],i[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==i[0]||this.renderTargetTextureSize_[1]!==i[1]){this.renderTargetTextureSize_=i;const n=0,o=e.RGBA,a=0,h=e.RGBA,c=e.UNSIGNED_BYTE,d=null;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,n,o,i[0],i[1],a,h,c,d),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,i[0],i[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthBuffer_)}}apply(t,e,i,n){const o=this.getGL(),a=t.size;if(o.bindFramebuffer(o.FRAMEBUFFER,e?e.getFrameBuffer():null),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,this.renderTargetTexture_),!e){const c=ht(o.canvas);if(!t.renderTargets[c]){const d=o.getContextAttributes();d&&d.preserveDrawingBuffer&&(o.clearColor(0,0,0,0),o.clearDepth(1),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT)),t.renderTargets[c]=!0}}o.disable(o.DEPTH_TEST),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),o.viewport(0,0,o.drawingBufferWidth,o.drawingBufferHeight),o.bindBuffer(o.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),o.useProgram(this.renderTargetProgram_),o.enableVertexAttribArray(this.renderTargetAttribLocation_),o.vertexAttribPointer(this.renderTargetAttribLocation_,2,o.FLOAT,!1,0,0),o.uniform2f(this.renderTargetUniformLocation_,a[0],a[1]),o.uniform1i(this.renderTargetTextureLocation_,0);const h=t.layerStatesArray[t.layerIndex].opacity;o.uniform1f(this.renderTargetOpacityLocation_,h),this.applyUniforms(t),i&&i(o,t),o.drawArrays(o.TRIANGLES,0,6),n&&n(o,t)}getFrameBuffer(){return this.frameBuffer_}getDepthBuffer(){return this.depthBuffer_}applyUniforms(t){const e=this.getGL();let i,n=1;this.uniforms_.forEach(function(o){if(i=typeof o.value=="function"?o.value(t):o.value,i instanceof HTMLCanvasElement||i instanceof ImageData)o.texture||(o.texture=e.createTexture()),e.activeTexture(e[`TEXTURE${n}`]),e.bindTexture(e.TEXTURE_2D,o.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),i instanceof ImageData?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,i.width,i.height,0,e.UNSIGNED_BYTE,new Uint8Array(i.data)):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i),e.uniform1i(o.location,n++);else if(Array.isArray(i))switch(i.length){case 2:e.uniform2f(o.location,i[0],i[1]);return;case 3:e.uniform3f(o.location,i[0],i[1],i[2]);return;case 4:e.uniform4f(o.location,i[0],i[1],i[2],i[3]);return;default:return}else typeof i=="number"&&e.uniform1f(o.location,i)})}}const Ju=$v;function Jv(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Qv(r,t){return r[0]=t[0],r[1]=t[1],r[4]=t[2],r[5]=t[3],r[12]=t[4],r[13]=t[5],r}const ai={PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution",ROTATION:"u_rotation",VIEWPORT_SIZE_PX:"u_viewportSizePx",PIXEL_RATIO:"u_pixelRatio",HIT_DETECTION:"u_hitDetection"},li={UNSIGNED_BYTE:Zv,UNSIGNED_SHORT:jv,UNSIGNED_INT:Wv,FLOAT:Yu},ao={};function Qu(r){return"shared/"+r}let td=0;function tx(){const r="unique/"+td;return td+=1,r}function ex(r){let t=ao[r];if(!t){const e=document.createElement("canvas");e.width=1,e.height=1,e.style.position="absolute",e.style.left="0",t={users:0,context:Hv(e)},ao[r]=t}return t.users+=1,t.context}function ix(r){const t=ao[r];if(!t||(t.users-=1,t.users>0))return;const e=t.context,i=e.getExtension("WEBGL_lose_context");i&&i.loseContext();const n=e.canvas;n.width=1,n.height=1,delete ao[r]}class nx extends gs{constructor(t){super(),t=t||{},this.boundHandleWebGLContextLost_=this.handleWebGLContextLost.bind(this),this.boundHandleWebGLContextRestored_=this.handleWebGLContextRestored.bind(this),this.canvasCacheKey_=t.canvasCacheKey?Qu(t.canvasCacheKey):tx(),this.gl_=ex(this.canvasCacheKey_),this.bufferCache_={},this.extensionCache_={},this.currentProgram_=null,this.needsToBeRecreated_=!1;const e=this.gl_.canvas;e.addEventListener(oo.LOST,this.boundHandleWebGLContextLost_),e.addEventListener(oo.RESTORED,this.boundHandleWebGLContextRestored_),this.offsetRotateMatrix_=Vt(),this.offsetScaleMatrix_=Vt(),this.tmpMat4_=Jv(),this.uniformLocationsByProgram_={},this.attribLocationsByProgram_={},this.uniforms_=[],t.uniforms&&this.setUniforms(t.uniforms),this.postProcessPasses_=t.postProcesses?t.postProcesses.map(i=>new Ju({webGlContext:this.gl_,scaleRatio:i.scaleRatio,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,uniforms:i.uniforms})):[new Ju({webGlContext:this.gl_})],this.shaderCompileErrors_=null,this.startTime_=Date.now()}setUniforms(t){this.uniforms_=[],this.addUniforms(t)}addUniforms(t){for(const e in t)this.uniforms_.push({name:e,value:t[e]})}canvasCacheKeyMatches(t){return this.canvasCacheKey_===Qu(t)}getExtension(t){if(t in this.extensionCache_)return this.extensionCache_[t];const e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e}bindBuffer(t){const e=this.gl_,i=ht(t);let n=this.bufferCache_[i];if(!n){const o=e.createBuffer();n={buffer:t,webGlBuffer:o},this.bufferCache_[i]=n}e.bindBuffer(t.getType(),n.webGlBuffer)}flushBufferData(t){const e=this.gl_;this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())}deleteBuffer(t){const e=this.gl_,i=ht(t),n=this.bufferCache_[i];n&&!e.isContextLost()&&e.deleteBuffer(n.webGlBuffer),delete this.bufferCache_[i]}disposeInternal(){const t=this.gl_.canvas;t.removeEventListener(oo.LOST,this.boundHandleWebGLContextLost_),t.removeEventListener(oo.RESTORED,this.boundHandleWebGLContextRestored_),ix(this.canvasCacheKey_),delete this.gl_}prepareDraw(t,e,i){const n=this.gl_,o=this.getCanvas(),a=t.size,h=t.pixelRatio;(o.width!==a[0]*h||o.height!==a[1]*h)&&(o.width=a[0]*h,o.height=a[1]*h,o.style.width=a[0]+"px",o.style.height=a[1]+"px");for(let c=this.postProcessPasses_.length-1;c>=0;c--)this.postProcessPasses_[c].init(t);n.bindTexture(n.TEXTURE_2D,null),n.clearColor(0,0,0,0),n.depthRange(0,1),n.clearDepth(1),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,e?n.ZERO:n.ONE_MINUS_SRC_ALPHA),i?(n.enable(n.DEPTH_TEST),n.depthFunc(n.LEQUAL)):n.disable(n.DEPTH_TEST)}bindTexture(t,e,i){const n=this.gl_;n.activeTexture(n.TEXTURE0+e),n.bindTexture(n.TEXTURE_2D,t),n.uniform1i(this.getUniformLocation(i),e)}prepareDrawToRenderTarget(t,e,i,n){const o=this.gl_,a=e.getSize();o.bindFramebuffer(o.FRAMEBUFFER,e.getFramebuffer()),o.bindRenderbuffer(o.RENDERBUFFER,e.getDepthbuffer()),o.viewport(0,0,a[0],a[1]),o.bindTexture(o.TEXTURE_2D,e.getTexture()),o.clearColor(0,0,0,0),o.depthRange(0,1),o.clearDepth(1),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.enable(o.BLEND),o.blendFunc(o.ONE,i?o.ZERO:o.ONE_MINUS_SRC_ALPHA),n?(o.enable(o.DEPTH_TEST),o.depthFunc(o.LEQUAL)):o.disable(o.DEPTH_TEST)}drawElements(t,e){const i=this.gl_;this.getExtension("OES_element_index_uint");const n=i.UNSIGNED_INT,o=4,a=e-t,h=t*o;i.drawElements(i.TRIANGLES,a,n,h)}finalizeDraw(t,e,i){for(let n=0,o=this.postProcessPasses_.length;n<o;n++)n===o-1?this.postProcessPasses_[n].apply(t,null,e,i):this.postProcessPasses_[n].apply(t,this.postProcessPasses_[n+1])}getCanvas(){return this.gl_.canvas}getGL(){return this.gl_}applyFrameState(t){const e=t.size,i=t.viewState.rotation,n=t.pixelRatio;this.setUniformFloatValue(ai.TIME,(Date.now()-this.startTime_)*.001),this.setUniformFloatValue(ai.ZOOM,t.viewState.zoom),this.setUniformFloatValue(ai.RESOLUTION,t.viewState.resolution),this.setUniformFloatValue(ai.PIXEL_RATIO,n),this.setUniformFloatVec2(ai.VIEWPORT_SIZE_PX,[e[0],e[1]]),this.setUniformFloatValue(ai.ROTATION,i)}applyHitDetectionUniform(t){const e=this.getUniformLocation(ai.HIT_DETECTION);this.getGL().uniform1i(e,t?1:0),t&&this.setUniformFloatValue(ai.PIXEL_RATIO,.5)}applyUniforms(t){const e=this.gl_;let i,n=0;this.uniforms_.forEach(o=>{if(i=typeof o.value=="function"?o.value(t):o.value,i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof ImageData)o.texture||(o.prevValue=void 0,o.texture=e.createTexture()),this.bindTexture(o.texture,n,o.name),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),(!(i instanceof HTMLImageElement)||i.complete)&&o.prevValue!==i&&(o.prevValue=i,e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i)),n++;else if(Array.isArray(i)&&i.length===6)this.setUniformMatrixValue(o.name,Qv(this.tmpMat4_,i));else if(Array.isArray(i)&&i.length<=4)switch(i.length){case 2:e.uniform2f(this.getUniformLocation(o.name),i[0],i[1]);return;case 3:e.uniform3f(this.getUniformLocation(o.name),i[0],i[1],i[2]);return;case 4:e.uniform4f(this.getUniformLocation(o.name),i[0],i[1],i[2],i[3]);return;default:return}else typeof i=="number"&&e.uniform1f(this.getUniformLocation(o.name),i)})}useProgram(t,e){this.gl_.useProgram(t),this.currentProgram_=t,this.applyFrameState(e),this.applyUniforms(e)}compileShader(t,e){const i=this.gl_,n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}getProgram(t,e){const i=this.gl_,n=this.compileShader(t,i.FRAGMENT_SHADER),o=this.compileShader(e,i.VERTEX_SHADER),a=i.createProgram();if(i.attachShader(a,n),i.attachShader(a,o),i.linkProgram(a),!i.getShaderParameter(n,i.COMPILE_STATUS)){const h=`Fragment shader compilation failed: ${i.getShaderInfoLog(n)}`;throw new Error(h)}if(i.deleteShader(n),!i.getShaderParameter(o,i.COMPILE_STATUS)){const h=`Vertex shader compilation failed: ${i.getShaderInfoLog(o)}`;throw new Error(h)}if(i.deleteShader(o),!i.getProgramParameter(a,i.LINK_STATUS)){const h=`GL program linking failed: ${i.getProgramInfoLog(a)}`;throw new Error(h)}return a}getUniformLocation(t){const e=ht(this.currentProgram_);return this.uniformLocationsByProgram_[e]===void 0&&(this.uniformLocationsByProgram_[e]={}),this.uniformLocationsByProgram_[e][t]===void 0&&(this.uniformLocationsByProgram_[e][t]=this.gl_.getUniformLocation(this.currentProgram_,t)),this.uniformLocationsByProgram_[e][t]}getAttributeLocation(t){const e=ht(this.currentProgram_);return this.attribLocationsByProgram_[e]===void 0&&(this.attribLocationsByProgram_[e]={}),this.attribLocationsByProgram_[e][t]===void 0&&(this.attribLocationsByProgram_[e][t]=this.gl_.getAttribLocation(this.currentProgram_,t)),this.attribLocationsByProgram_[e][t]}makeProjectionTransform(t,e){const i=t.size,n=t.viewState.rotation,o=t.viewState.resolution,a=t.viewState.center;return Ne(e,0,0,2/(o*i[0]),2/(o*i[1]),-n,-a[0],-a[1]),e}setUniformFloatValue(t,e){this.gl_.uniform1f(this.getUniformLocation(t),e)}setUniformFloatVec2(t,e){this.gl_.uniform2fv(this.getUniformLocation(t),e)}setUniformFloatVec4(t,e){this.gl_.uniform4fv(this.getUniformLocation(t),e)}setUniformMatrixValue(t,e){this.gl_.uniformMatrix4fv(this.getUniformLocation(t),!1,e)}enableAttributeArray_(t,e,i,n,o){const a=this.getAttributeLocation(t);a<0||(this.gl_.enableVertexAttribArray(a),this.gl_.vertexAttribPointer(a,e,i,!1,n,o))}enableAttributes(t){const e=rx(t);let i=0;for(let n=0;n<t.length;n++){const o=t[n];this.enableAttributeArray_(o.name,o.size,o.type||Yu,e,i),i+=o.size*ed(o.type)}}handleWebGLContextLost(t){En(this.bufferCache_),this.currentProgram_=null,t.preventDefault()}handleWebGLContextRestored(){this.needsToBeRecreated_=!0}needsToBeRecreated(){return this.needsToBeRecreated_}createTexture(t,e,i){const n=this.gl_;i=i||n.createTexture();const o=0,a=n.RGBA,h=0,c=n.RGBA,d=n.UNSIGNED_BYTE;return n.bindTexture(n.TEXTURE_2D,i),e?n.texImage2D(n.TEXTURE_2D,o,a,c,d,e):n.texImage2D(n.TEXTURE_2D,o,a,t[0],t[1],h,c,d,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),i}}function rx(r){let t=0;for(let e=0;e<r.length;e++){const i=r[e];t+=i.size*ed(i.type)}return t}function ed(r){switch(r){case li.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case li.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case li.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case li.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}class ml extends $u{constructor(t,e){super(t),e=e||{},this.inversePixelTransform_=Vt(),this.pixelContext_=null,this.postProcesses_=e.postProcesses,this.uniforms_=e.uniforms,this.helper,t.addChangeListener(xt.MAP,this.removeHelper.bind(this)),this.dispatchPreComposeEvent=this.dispatchPreComposeEvent.bind(this),this.dispatchPostComposeEvent=this.dispatchPostComposeEvent.bind(this)}dispatchPreComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(qt.PRECOMPOSE)){const n=new vr(qt.PRECOMPOSE,void 0,e,t);i.dispatchEvent(n)}}dispatchPostComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(qt.POSTCOMPOSE)){const n=new vr(qt.POSTCOMPOSE,void 0,e,t);i.dispatchEvent(n)}}reset(t){this.uniforms_=t.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)}removeHelper(){this.helper&&(this.helper.dispose(),delete this.helper)}prepareFrame(t){if(this.getLayer().getRenderSource()){let e=!0,i=-1,n;for(let a=0,h=t.layerStatesArray.length;a<h;a++){const c=t.layerStatesArray[a].layer,d=c.getRenderer();if(!(d instanceof ml)){e=!0;continue}const f=c.getClassName();if((e||f!==n)&&(i+=1,e=!1),n=f,d===this)break}const o="map/"+t.mapId+"/group/"+i;(!this.helper||!this.helper.canvasCacheKeyMatches(o)||this.helper.needsToBeRecreated())&&(this.removeHelper(),this.helper=new nx({postProcesses:this.postProcesses_,uniforms:this.uniforms_,canvasCacheKey:o}),n&&(this.helper.getCanvas().className=n),this.afterHelperCreated())}return this.prepareFrameInternal(t)}afterHelperCreated(){}prepareFrameInternal(t){return!0}disposeInternal(){this.removeHelper(),super.disposeInternal()}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){Ne(this.inversePixelTransform_,0,0,i.pixelRatio,-i.pixelRatio,0,0,-i.size[1]);const o=new vr(t,this.inversePixelTransform_,i,e);n.dispatchEvent(o)}}preRender(t,e){this.dispatchRenderEvent_(qt.PRERENDER,t,e)}postRender(t,e){this.dispatchRenderEvent_(qt.POSTRENDER,t,e)}}const sx=ml,Ze=new Uint8Array(4);class ox{constructor(t,e){this.helper_=t;const i=t.getGL();this.texture_=i.createTexture(),this.framebuffer_=i.createFramebuffer(),this.depthbuffer_=i.createRenderbuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}setSize(t){ei(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())}getSize(){return this.size_}clearCachedData(){this.dataCacheDirty_=!0}readAll(){if(this.dataCacheDirty_){const t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_}readPixel(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return Ze[0]=0,Ze[1]=0,Ze[2]=0,Ze[3]=0,Ze;this.readAll();const i=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return Ze[0]=this.data_[i*4],Ze[1]=this.data_[i*4+1],Ze[2]=this.data_[i*4+2],Ze[3]=this.data_[i*4+3],Ze}getTexture(){return this.texture_}getFramebuffer(){return this.framebuffer_}getDepthbuffer(){return this.depthbuffer_}updateSize_(){const t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),e.bindRenderbuffer(e.RENDERBUFFER,this.depthbuffer_),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t[0],t[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthbuffer_),this.data_=new Uint8Array(t[0]*t[1]*4)}}const ax=ox,id={GENERATE_POLYGON_BUFFERS:"GENERATE_POLYGON_BUFFERS",GENERATE_POINT_BUFFERS:"GENERATE_POINT_BUFFERS",GENERATE_LINE_STRING_BUFFERS:"GENERATE_LINE_STRING_BUFFERS"};function lx(r,t){t=t||[];const e=256,i=e-1;return t[0]=Math.floor(r/e/e/e)/i,t[1]=Math.floor(r/e/e)%e/i,t[2]=Math.floor(r/e)%e/i,t[3]=r%e/i,t}function hx(r){let t=0;const e=256,i=e-1;return t+=Math.round(r[0]*e*e*e*i),t+=Math.round(r[1]*e*e*i),t+=Math.round(r[2]*e*i),t+=Math.round(r[3]*i),t}function cx(){const r='const e="GENERATE_POLYGON_BUFFERS",t="GENERATE_POINT_BUFFERS",n="GENERATE_LINE_STRING_BUFFERS";function r(e,t){const n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function x(e,t){const n=(r=t)[0]*r[3]-r[1]*r[2];var r;!function(e,t){if(!e)throw new Error(t)}(0!==n,"Transformation matrix cannot be inverted");const x=t[0],i=t[1],u=t[2],o=t[3],f=t[4],s=t[5];return e[0]=o/n,e[1]=-i/n,e[2]=-u/n,e[3]=x/n,e[4]=(u*s-o*f)/n,e[5]=-(x*s-i*f)/n,e}function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}new Array(6);var u={exports:{}};function o(e,t,n){n=n||2;var r,x,i,u,o,s,l,v=t&&t.length,c=v?t[0]*n:e.length,h=f(e,0,c,n,!0),g=[];if(!h||h.next===h.prev)return g;if(v&&(h=function(e,t,n,r){var x,i,u,o=[];for(x=0,i=t.length;x<i;x++)(u=f(e,t[x]*r,x<i-1?t[x+1]*r:e.length,r,!1))===u.next&&(u.steiner=!0),o.push(d(u));for(o.sort(p),x=0;x<o.length;x++)n=y(o[x],n);return n}(e,t,h,n)),e.length>80*n){r=i=e[0],x=u=e[1];for(var b=n;b<c;b+=n)(o=e[b])<r&&(r=o),(s=e[b+1])<x&&(x=s),o>i&&(i=o),s>u&&(u=s);l=0!==(l=Math.max(i-r,u-x))?32767/l:0}return a(h,g,n,r,x,l,0),g}function f(e,t,n,r,x){var i,u;if(x===O(e,t,n,r)>0)for(i=t;i<n;i+=r)u=P(i,e[i],e[i+1],u);else for(i=n-r;i>=t;i-=r)u=P(i,e[i],e[i+1],u);return u&&m(u,u.next)&&(B(u),u=u.next),u}function s(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!m(r,r.next)&&0!==M(r.prev,r,r.next))r=r.next;else{if(B(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function a(e,t,n,r,x,i,u){if(e){!u&&i&&function(e,t,n,r){var x=e;do{0===x.z&&(x.z=b(x.x,x.y,t,n,r)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next}while(x!==e);x.prevZ.nextZ=null,x.prevZ=null,function(e){var t,n,r,x,i,u,o,f,s=1;do{for(n=e,e=null,i=null,u=0;n;){for(u++,r=n,o=0,t=0;t<s&&(o++,r=r.nextZ);t++);for(f=s;o>0||f>0&&r;)0!==o&&(0===f||!r||n.z<=r.z)?(x=n,n=n.nextZ,o--):(x=r,r=r.nextZ,f--),i?i.nextZ=x:e=x,x.prevZ=i,i=x;n=r}i.nextZ=null,s*=2}while(u>1)}(x)}(e,r,x,i);for(var o,f,p=e;e.prev!==e.next;)if(o=e.prev,f=e.next,i?v(e,r,x,i):l(e))t.push(o.i/n|0),t.push(e.i/n|0),t.push(f.i/n|0),B(e),e=f.next,p=f.next;else if((e=f)===p){u?1===u?a(e=c(s(e),t,n),t,n,r,x,i,2):2===u&&h(e,t,n,r,x,i):a(s(e),t,n,r,x,i,1);break}}}function l(e){var t=e.prev,n=e,r=e.next;if(M(t,n,r)>=0)return!1;for(var x=t.x,i=n.x,u=r.x,o=t.y,f=n.y,s=r.y,a=x<i?x<u?x:u:i<u?i:u,l=o<f?o<s?o:s:f<s?f:s,v=x>i?x>u?x:u:i>u?i:u,c=o>f?o>s?o:s:f>s?f:s,h=r.next;h!==t;){if(h.x>=a&&h.x<=v&&h.y>=l&&h.y<=c&&Z(x,o,i,f,u,s,h.x,h.y)&&M(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function v(e,t,n,r){var x=e.prev,i=e,u=e.next;if(M(x,i,u)>=0)return!1;for(var o=x.x,f=i.x,s=u.x,a=x.y,l=i.y,v=u.y,c=o<f?o<s?o:s:f<s?f:s,h=a<l?a<v?a:v:l<v?l:v,p=o>f?o>s?o:s:f>s?f:s,y=a>l?a>v?a:v:l>v?l:v,g=b(c,h,t,n,r),d=b(p,y,t,n,r),w=e.prevZ,m=e.nextZ;w&&w.z>=g&&m&&m.z<=d;){if(w.x>=c&&w.x<=p&&w.y>=h&&w.y<=y&&w!==x&&w!==u&&Z(o,a,f,l,s,v,w.x,w.y)&&M(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,m.x>=c&&m.x<=p&&m.y>=h&&m.y<=y&&m!==x&&m!==u&&Z(o,a,f,l,s,v,m.x,m.y)&&M(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;w&&w.z>=g;){if(w.x>=c&&w.x<=p&&w.y>=h&&w.y<=y&&w!==x&&w!==u&&Z(o,a,f,l,s,v,w.x,w.y)&&M(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;m&&m.z<=d;){if(m.x>=c&&m.x<=p&&m.y>=h&&m.y<=y&&m!==x&&m!==u&&Z(o,a,f,l,s,v,m.x,m.y)&&M(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function c(e,t,n){var r=e;do{var x=r.prev,i=r.next.next;!m(x,i)&&A(x,r,r.next,i)&&F(x,i)&&F(i,x)&&(t.push(x.i/n|0),t.push(r.i/n|0),t.push(i.i/n|0),B(r),B(r.next),r=e=i),r=r.next}while(r!==e);return s(r)}function h(e,t,n,r,x,i){var u=e;do{for(var o=u.next.next;o!==u.prev;){if(u.i!==o.i&&w(u,o)){var f=I(u,o);return u=s(u,u.next),f=s(f,f.next),a(u,t,n,r,x,i,0),void a(f,t,n,r,x,i,0)}o=o.next}u=u.next}while(u!==e)}function p(e,t){return e.x-t.x}function y(e,t){var n=function(e,t){var n,r=t,x=e.x,i=e.y,u=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var o=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=x&&o>u&&(u=o,n=r.x<r.next.x?r:r.next,o===x))return n}r=r.next}while(r!==t);if(!n)return null;var f,s=n,a=n.x,l=n.y,v=1/0;r=n;do{x>=r.x&&r.x>=a&&x!==r.x&&Z(i<l?x:u,i,a,l,i<l?u:x,i,r.x,r.y)&&(f=Math.abs(i-r.y)/(x-r.x),F(r,e)&&(f<v||f===v&&(r.x>n.x||r.x===n.x&&g(n,r)))&&(n=r,v=f)),r=r.next}while(r!==s);return n}(e,t);if(!n)return t;var r=I(n,e);return s(r,r.next),s(n,n.next)}function g(e,t){return M(e.prev,e,t.prev)<0&&M(t.next,e,e.next)<0}function b(e,t,n,r,x){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*x|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*x|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function d(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Z(e,t,n,r,x,i,u,o){return(x-u)*(t-o)>=(e-u)*(i-o)&&(e-u)*(r-o)>=(n-u)*(t-o)&&(n-u)*(i-o)>=(x-u)*(r-o)}function w(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&A(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(F(e,t)&&F(t,e)&&function(e,t){var n=e,r=!1,x=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&x<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(M(e.prev,e,t.prev)||M(e,t.prev,t))||m(e,t)&&M(e.prev,e,e.next)>0&&M(t.prev,t,t.next)>0)}function M(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function m(e,t){return e.x===t.x&&e.y===t.y}function A(e,t,n,r){var x=z(M(e,t,n)),i=z(M(e,t,r)),u=z(M(n,r,e)),o=z(M(n,r,t));return x!==i&&u!==o||(!(0!==x||!E(e,n,t))||(!(0!==i||!E(e,r,t))||(!(0!==u||!E(n,e,r))||!(0!==o||!E(n,t,r)))))}function E(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function z(e){return e>0?1:e<0?-1:0}function F(e,t){return M(e.prev,e,e.next)<0?M(e,t,e.next)>=0&&M(e,e.prev,t)>=0:M(e,t,e.prev)<0||M(e,e.next,t)<0}function I(e,t){var n=new _(e.i,e.x,e.y),r=new _(t.i,t.x,t.y),x=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=x,x.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function P(e,t,n,r){var x=new _(e,t,n);return r?(x.next=r.next,x.prev=r,r.next.prev=x,r.next=x):(x.prev=x,x.next=x),x}function B(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function _(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(e,t,n,r){for(var x=0,i=t,u=n-r;i<n;i+=r)x+=(e[u]-e[i])*(e[i+1]+e[u+1]),u=i;return x}u.exports=o,u.exports.default=o,o.deviation=function(e,t,n,r){var x=t&&t.length,i=x?t[0]*n:e.length,u=Math.abs(O(e,0,i,n));if(x)for(var o=0,f=t.length;o<f;o++){var s=t[o]*n,a=o<f-1?t[o+1]*n:e.length;u-=Math.abs(O(e,s,a,n))}var l=0;for(o=0;o<r.length;o+=3){var v=r[o]*n,c=r[o+1]*n,h=r[o+2]*n;l+=Math.abs((e[v]-e[h])*(e[c+1]-e[v+1])-(e[v]-e[c])*(e[h+1]-e[v+1]))}return 0===u&&0===l?0:Math.abs((l-u)/u)},o.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,x=0;x<e.length;x++){for(var i=0;i<e[x].length;i++)for(var u=0;u<t;u++)n.vertices.push(e[x][i][u]);x>0&&(r+=e[x-1].length,n.holes.push(r))}return n};var N=i(u.exports);const R=[],S={vertexPosition:0,indexPosition:0};function T(e,t,n,r,x){e[t+0]=n,e[t+1]=r,e[t+2]=x}function U(e,t,n,r,x,i){const u=3+x,o=e[t+0],f=e[t+1],s=R;s.length=x;for(let n=0;n<s.length;n++)s[n]=e[t+2+n];let a=i?i.vertexPosition:0,l=i?i.indexPosition:0;const v=a/u;return T(n,a,o,f,0),s.length&&n.set(s,a+3),a+=u,T(n,a,o,f,1),s.length&&n.set(s,a+3),a+=u,T(n,a,o,f,2),s.length&&n.set(s,a+3),a+=u,T(n,a,o,f,3),s.length&&n.set(s,a+3),a+=u,r[l++]=v,r[l++]=v+1,r[l++]=v+3,r[l++]=v+1,r[l++]=v+2,r[l++]=v+3,S.vertexPosition=a,S.indexPosition=l,S}function k(e,t,n,x,i,u,o,f,s,a){const l=8+f.length,v=u.length/l,c=[e[t+0],e[t+1]],h=[e[n],e[n+1]],p=r(s,[...c]),y=r(s,[...h]);function g(e,t,n){const r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),x=[(t[0]-e[0])/r,(t[1]-e[1])/r],i=[-x[1],x[0]],u=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),o=[(n[0]-e[0])/u,(n[1]-e[1])/u],f=0===r||0===u?0:Math.acos((s=o[0]*x[0]+o[1]*x[1],a=-1,l=1,Math.min(Math.max(s,a),l)));var s,a,l;return o[0]*i[0]+o[1]*i[1]>0?f:2*Math.PI-f}let b=-1,d=-1;const Z=null!==i;if(null!==x){b=g(p,y,r(s,[...[e[x],e[x+1]]]))}if(Z){d=g(y,p,r(s,[...[e[i],e[i+1]]]))}return u.push(c[0],c[1],h[0],h[1],b,d,a,0),u.push(...f),u.push(c[0],c[1],h[0],h[1],b,d,a,1),u.push(...f),u.push(c[0],c[1],h[0],h[1],b,d,a,2),u.push(...f),u.push(c[0],c[1],h[0],h[1],b,d,a,3),u.push(...f),o.push(v,v+1,v+2,v+1,v+3,v+2),a+Math.sqrt((y[0]-p[0])*(y[0]-p[0])+(y[1]-p[1])*(y[1]-p[1]))}function G(e,t,n,r,x){const i=2+x;let u=t;const o=e.slice(u,u+x);u+=x;const f=e[u++];let s=0;const a=new Array(f-1);for(let t=0;t<f;t++)s+=e[u++],t<f-1&&(a[t]=s);const l=e.slice(u,u+2*s),v=N(l,a,2);for(let e=0;e<v.length;e++)r.push(v[e]+n.length/i);for(let e=0;e<l.length;e+=2)n.push(l[e],l[e+1],...o);return u+2*s}const j=self;j.onmessage=r=>{const i=r.data;switch(i.type){case t:{const e=3,t=2,n=i.customAttributesSize,r=t+n,x=new Float32Array(i.renderInstructions),u=x.length/r,o=4*u*(n+e),f=new Uint32Array(6*u),s=new Float32Array(o);let a;for(let e=0;e<x.length;e+=r)a=U(x,e,s,f,n,a);const l=Object.assign({vertexBuffer:s.buffer,indexBuffer:f.buffer,renderInstructions:x.buffer},i);j.postMessage(l,[s.buffer,f.buffer,x.buffer]);break}case n:{const e=[],t=[],n=i.customAttributesSize,r=2,u=new Float32Array(i.renderInstructions);let o=0;const f=[1,0,0,1,0,0];let s,a;for(x(f,i.renderInstructionsTransform);o<u.length;){a=Array.from(u.slice(o,o+n)),o+=n,s=u[o++];const x=o,i=o+(s-1)*r,l=u[x]===u[i]&&u[x+1]===u[i+1];let v=0;for(let n=0;n<s-1;n++){let c=null;n>0?c=o+(n-1)*r:l&&(c=i-r);let h=null;n<s-2?h=o+(n+2)*r:l&&(h=x+r),v=k(u,o+n*r,o+(n+1)*r,c,h,e,t,a,f,v)}o+=s*r}const l=Uint32Array.from(t),v=Float32Array.from(e),c=Object.assign({vertexBuffer:v.buffer,indexBuffer:l.buffer,renderInstructions:u.buffer},i);j.postMessage(c,[v.buffer,l.buffer,u.buffer]);break}case e:{const e=[],t=[],n=i.customAttributesSize,r=new Float32Array(i.renderInstructions);let x=0;for(;x<r.length;)x=G(r,x,e,t,n);const u=Uint32Array.from(t),o=Float32Array.from(e),f=Object.assign({vertexBuffer:o.buffer,indexBuffer:u.buffer,renderInstructions:r.buffer},i);j.postMessage(f,[o.buffer,u.buffer,r.buffer]);break}}};';return new Worker(typeof Blob>"u"?"data:application/javascript;base64,"+Buffer.from(r,"binary").toString("base64"):URL.createObjectURL(new Blob([r],{type:"application/javascript"})))}class ux extends sx{constructor(t,e){const i=e.uniforms||{},n=Vt();i[ai.PROJECTION_MATRIX]=n,super(t,{uniforms:i,postProcesses:e.postProcesses}),this.sourceRevision_=-1,this.verticesBuffer_=new qu(fl,_l),this.indicesBuffer_=new qu(gl,_l),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.program_,this.hitDetectionEnabled_=e.hitDetectionEnabled??!0;const o=e.attributes?e.attributes.map(function(h){return{name:"a_"+h.name,size:1,type:li.FLOAT}}):[];this.attributes=[{name:"a_position",size:2,type:li.FLOAT},{name:"a_index",size:1,type:li.FLOAT}],this.hitDetectionEnabled_&&(this.attributes.push({name:"a_hitColor",size:4,type:li.FLOAT}),this.attributes.push({name:"a_featureUid",size:1,type:li.FLOAT})),this.attributes.push(...o),this.customAttributes=e.attributes?e.attributes:[],this.previousExtent_=ge(),this.currentTransform_=n,this.renderTransform_=Vt(),this.invertRenderTransform_=Vt(),this.renderInstructions_=new Float32Array(0),this.hitRenderTarget_,this.lastSentId=0,this.worker_=cx(),this.worker_.addEventListener("message",h=>{const c=h.data;if(c.type===id.GENERATE_POINT_BUFFERS){const d=c.projectionTransform;this.verticesBuffer_.fromArrayBuffer(c.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_),this.indicesBuffer_.fromArrayBuffer(c.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=d,Is(this.invertRenderTransform_,this.renderTransform_),this.renderInstructions_=new Float32Array(h.data.renderInstructions),c.id===this.lastSentId&&(this.ready=!0),this.getLayer().changed()}}),this.featureCache_={},this.featureCount_=0;const a=this.getLayer().getSource();this.sourceListenKeys_=[ut(a,ee.ADDFEATURE,this.handleSourceFeatureAdded_,this),ut(a,ee.CHANGEFEATURE,this.handleSourceFeatureChanged_,this),ut(a,ee.REMOVEFEATURE,this.handleSourceFeatureDelete_,this),ut(a,ee.CLEAR,this.handleSourceFeatureClear_,this)],a.forEachFeature(h=>{this.featureCache_[ht(h)]={feature:h,properties:h.getProperties(),geometry:h.getGeometry()},this.featureCount_++})}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitRenderTarget_=new ax(this.helper))}handleSourceFeatureAdded_(t){const e=t.feature;this.featureCache_[ht(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++}handleSourceFeatureChanged_(t){const e=t.feature;this.featureCache_[ht(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}}handleSourceFeatureDelete_(t){const e=t.feature;delete this.featureCache_[ht(e)],this.featureCount_--}handleSourceFeatureClear_(){this.featureCache_={},this.featureCount_=0}renderFrame(t){const e=this.helper.getGL();this.preRender(e,t);const[i,n,o]=this.getWorldParameters_(t);this.renderWorlds(t,!1,i,n,o),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);const a=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderWorlds(t,!0,i,n,o),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),a}getWorldParameters_(t){const e=t.viewState.projection,o=this.getLayer().getSource().getWrapX()&&e.canWrapX(),a=e.getExtent(),h=t.extent,c=o?Tt(a):null,d=o?Math.ceil((h[2]-a[2])/c)+1:1;return[o?Math.floor((h[0]-a[0])/c):0,d,c]}prepareFrameInternal(t){const e=this.getLayer(),i=e.getSource(),n=t.viewState,o=!t.viewHints[Ut.ANIMATING]&&!t.viewHints[Ut.INTERACTING],a=!Cn(this.previousExtent_,t.extent),h=this.sourceRevision_<i.getRevision();if(h&&(this.sourceRevision_=i.getRevision()),o&&(a||h)){const c=n.projection,d=n.resolution,f=e instanceof dl?e.getRenderBuffer():0,_=Es(t.extent,f*d);i.loadFeatures(_,d,c),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.useProgram(this.program_,t),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0}rebuildBuffers_(t){const e=Vt();this.helper.makeProjectionTransform(t,e);const n=(this.hitDetectionEnabled_?7:2)+this.customAttributes.length,o=n*this.featureCount_;(!this.renderInstructions_||this.renderInstructions_.length!==o)&&(this.renderInstructions_=new Float32Array(o));let a,h;const c=[],d=[];let f=-1;for(const m in this.featureCache_)if(a=this.featureCache_[m],h=a.geometry,!(!h||h.getType()!=="Point")){if(c[0]=h.getFlatCoordinates()[0],c[1]=h.getFlatCoordinates()[1],Ot(e,c),this.renderInstructions_[++f]=c[0],this.renderInstructions_[++f]=c[1],this.hitDetectionEnabled_){const E=lx(f+5,d);this.renderInstructions_[++f]=E[0],this.renderInstructions_[++f]=E[1],this.renderInstructions_[++f]=E[2],this.renderInstructions_[++f]=E[3],this.renderInstructions_[++f]=Number(m)}for(let E=0;E<this.customAttributes.length;E++){const v=this.customAttributes[E].callback(a.feature,a.properties);this.renderInstructions_[++f]=v}}const _={id:++this.lastSentId,type:id.GENERATE_POINT_BUFFERS,renderInstructions:this.renderInstructions_.buffer,customAttributesSize:n-2};_.projectionTransform=e,this.ready=!1,this.worker_.postMessage(_,[this.renderInstructions_.buffer]),this.renderInstructions_=null}forEachFeatureAtCoordinate(t,e,i,n,o){if(gt(this.hitDetectionEnabled_,"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has not been enabled. This is done by providing adequate shaders using the `hitVertexShader` and `hitFragmentShader` properties of `WebGLPointsLayerRenderer`"),!this.renderInstructions_||!this.hitDetectionEnabled_)return;const a=Ot(e.coordinateToPixelTransform,t.slice()),h=this.hitRenderTarget_.readPixel(a[0]/2,a[1]/2),c=[h[0]/255,h[1]/255,h[2]/255,h[3]/255],d=hx(c),f=this.renderInstructions_[d],_=Math.floor(f).toString(),E=this.getLayer().getSource().getFeatureByUid(_);if(E)return n(E,this.getLayer(),null)}renderWorlds(t,e,i,n,o){let a=i;this.helper.useProgram(this.program_,t),e&&(this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0)),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes);do{this.helper.makeProjectionTransform(t,this.currentTransform_),sm(this.currentTransform_,a*o,0),Nc(this.currentTransform_,this.invertRenderTransform_),this.helper.applyUniforms(t),this.helper.applyHitDetectionUniform(e);const h=this.indicesBuffer_.getSize();this.helper.drawElements(0,h)}while(++a<n)}disposeInternal(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach(function(t){wt(t)}),this.sourceListenKeys_=null,super.disposeInternal()}}const dx=ux,fx=.5;class gx extends ps{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.interimTile=null,this.key="",this.transition_=i.transition===void 0?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(at.CHANGE)}release(){this.state===Q.ERROR&&this.setState(Q.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getInterimTile(){if(!this.interimTile)return this;let t=this.interimTile;do{if(t.getState()==Q.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this}refreshInterimChain(){if(!this.interimTile)return;let t=this.interimTile,e=this;do{if(t.getState()==Q.LOADED){t.interimTile=null;break}else t.getState()==Q.LOADING?e=t:t.getState()==Q.IDLE?e.interimTile=t.interimTile:e=t;t=e.interimTile}while(t)}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==Q.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){st()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(!i)i=e,this.transitionStarts_[t]=i;else if(i===-1)return 1;const n=e-i+1e3/60;return n>=this.transition_?1:Ac(n/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}}const nd=gx,_x=10,rd=.25;class px{constructor(t,e,i,n,o,a){this.sourceProj_=t,this.targetProj_=e;let h={};const c=Ms(this.targetProj_,this.sourceProj_);this.transformInv_=function(y){const x=y[0]+"/"+y[1];return h[x]||(h[x]=c(y)),h[x]},this.maxSourceExtent_=n,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&Tt(n)>=Tt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Tt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Tt(this.targetProj_.getExtent()):null;const d=qi(i),f=Ts(i),_=bs(i),m=Ls(i),E=this.transformInv_(d),v=this.transformInv_(f),b=this.transformInv_(_),C=this.transformInv_(m),S=_x+(a?Math.max(0,Math.ceil(Math.log2(ma(i)/(a*a*256*256)))):0);if(this.addQuad_(d,f,_,m,E,v,b,C,S),this.wrapsXInSource_){let y=1/0;this.triangles_.forEach(function(x,T,k){y=Math.min(y,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])-y>this.sourceWorldWidth_/2){const T=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];T[0][0]-y>this.sourceWorldWidth_/2&&(T[0][0]-=this.sourceWorldWidth_),T[1][0]-y>this.sourceWorldWidth_/2&&(T[1][0]-=this.sourceWorldWidth_),T[2][0]-y>this.sourceWorldWidth_/2&&(T[2][0]-=this.sourceWorldWidth_);const k=Math.min(T[0][0],T[1][0],T[2][0]);Math.max(T[0][0],T[1][0],T[2][0])-k<this.sourceWorldWidth_/2&&(x.source=T)}})}h={}}addTriangle_(t,e,i,n,o,a){this.triangles_.push({source:[n,o,a],target:[t,e,i]})}addQuad_(t,e,i,n,o,a,h,c,d){const f=dc([o,a,h,c]),_=this.sourceWorldWidth_?Tt(f)/this.sourceWorldWidth_:null,m=this.sourceWorldWidth_,E=this.sourceProj_.canWrapX()&&_>.5&&_<1;let v=!1;if(d>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const C=dc([t,e,i,n]);v=Tt(C)/this.targetWorldWidth_>rd||v}!E&&this.sourceProj_.isGlobal()&&_&&(v=_>rd||v)}if(!v&&this.maxSourceExtent_&&isFinite(f[0])&&isFinite(f[1])&&isFinite(f[2])&&isFinite(f[3])&&!se(f,this.maxSourceExtent_))return;let b=0;if(!v&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(h[0])||!isFinite(h[1])||!isFinite(c[0])||!isFinite(c[1]))){if(d>0)v=!0;else if(b=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(h[0])||!isFinite(h[1])?2:0)+(!isFinite(c[0])||!isFinite(c[1])?1:0),b!=1&&b!=2&&b!=4&&b!=8)return}if(d>0){if(!v){const C=[(t[0]+i[0])/2,(t[1]+i[1])/2],S=this.transformInv_(C);let y;E?y=(Sn(o[0],m)+Sn(h[0],m))/2-Sn(S[0],m):y=(o[0]+h[0])/2-S[0];const x=(o[1]+h[1])/2-S[1];v=y*y+x*x>this.errorThresholdSquared_}if(v){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){const C=[(e[0]+i[0])/2,(e[1]+i[1])/2],S=this.transformInv_(C),y=[(n[0]+t[0])/2,(n[1]+t[1])/2],x=this.transformInv_(y);this.addQuad_(t,e,C,y,o,a,S,x,d-1),this.addQuad_(y,C,i,n,x,S,h,c,d-1)}else{const C=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(C),y=[(i[0]+n[0])/2,(i[1]+n[1])/2],x=this.transformInv_(y);this.addQuad_(t,C,y,n,o,S,x,c,d-1),this.addQuad_(C,e,i,y,S,a,h,x,d-1)}return}}if(E){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}b&11||this.addTriangle_(t,i,n,o,h,c),b&14||this.addTriangle_(t,i,e,o,h,a),b&&(b&13||this.addTriangle_(e,n,t,a,c,o),b&7||this.addTriangle_(e,n,i,a,c,h))}calculateSourceExtent(){const t=ge();return this.triangles_.forEach(function(e,i,n){const o=e.source;gr(t,o[0]),gr(t,o[1]),gr(t,o[2])}),t}getTriangles(){return this.triangles_}}const mx=px;let yl;const zn=[];function sd(r,t,e,i,n){r.beginPath(),r.moveTo(0,0),r.lineTo(t,e),r.lineTo(i,n),r.closePath(),r.save(),r.clip(),r.fillRect(0,0,Math.max(t,i)+1,Math.max(e,n)),r.restore()}function vl(r,t){return Math.abs(r[t*4]-210)>2||Math.abs(r[t*4+3]-.75*255)>2}function yx(){if(yl===void 0){const r=$t(6,6,zn);r.globalCompositeOperation="lighter",r.fillStyle="rgba(210, 0, 0, 0.75)",sd(r,4,5,4,0),sd(r,4,5,0,5);const t=r.getImageData(0,0,3,3).data;yl=vl(t,0)||vl(t,4)||vl(t,8),Ws(r),zn.push(r.canvas)}return yl}function od(r,t,e,i){const n=Pc(e,t,r);let o=Tc(t,i,e);const a=t.getMetersPerUnit();a!==void 0&&(o*=a);const h=r.getMetersPerUnit();h!==void 0&&(o/=h);const c=r.getExtent();if(!c||ws(c,n)){const d=Tc(r,o,n)/o;isFinite(d)&&d>0&&(o/=d)}return o}function vx(r,t,e,i){const n=Ki(e);let o=od(r,t,n,i);return(!isFinite(o)||o<=0)&&mc(e,function(a){return o=od(r,t,a,i),isFinite(o)&&o>0}),o}function xx(r,t,e,i,n,o,a,h,c,d,f,_){const m=$t(Math.round(e*r),Math.round(e*t),zn);if(_||(m.imageSmoothingEnabled=!1),c.length===0)return m.canvas;m.scale(e,e);function E(T){return Math.round(T*e)/e}m.globalCompositeOperation="lighter";const v=ge();c.forEach(function(T,k,R){_c(v,T.extent)});const b=Tt(v),C=ze(v),S=$t(Math.round(e*b/i),Math.round(e*C/i),zn);_||(S.imageSmoothingEnabled=!1);const y=e/i;c.forEach(function(T,k,R){const M=T.extent[0]-v[0],A=-(T.extent[3]-v[3]),z=Tt(T.extent),U=ze(T.extent);T.image.width>0&&T.image.height>0&&S.drawImage(T.image,d,d,T.image.width-2*d,T.image.height-2*d,M*y,A*y,z*y,U*y)});const x=qi(a);return h.getTriangles().forEach(function(T,k,R){const M=T.source,A=T.target;let z=M[0][0],U=M[0][1],Z=M[1][0],H=M[1][1],K=M[2][0],nt=M[2][1];const q=E((A[0][0]-x[0])/o),X=E(-(A[0][1]-x[1])/o),j=E((A[1][0]-x[0])/o),B=E(-(A[1][1]-x[1])/o),yt=E((A[2][0]-x[0])/o),W=E(-(A[2][1]-x[1])/o),rt=z,F=U;z=0,U=0,Z-=rt,H-=F,K-=rt,nt-=F;const Lt=[[Z,H,0,0,j-q],[K,nt,0,0,yt-q],[0,0,Z,H,B-X],[0,0,K,nt,W-X]],tt=Fp(Lt);if(tt){if(m.save(),m.beginPath(),yx()||!_){m.moveTo(j,B);const J=4,ot=q-j,Ft=X-B;for(let St=0;St<J;St++)m.lineTo(j+E((St+1)*ot/J),B+E(St*Ft/(J-1))),St!=J-1&&m.lineTo(j+E((St+1)*ot/J),B+E((St+1)*Ft/(J-1)));m.lineTo(yt,W)}else m.moveTo(j,B),m.lineTo(q,X),m.lineTo(yt,W);m.clip(),m.transform(tt[0],tt[2],tt[1],tt[3],q,X),m.translate(v[0]-rt,v[3]-F),m.scale(i/e,-i/e),m.drawImage(S.canvas,0,0),m.restore()}}),Ws(S),zn.push(S.canvas),f&&(m.save(),m.globalCompositeOperation="source-over",m.strokeStyle="black",m.lineWidth=1,h.getTriangles().forEach(function(T,k,R){const M=T.target,A=(M[0][0]-x[0])/o,z=-(M[0][1]-x[1])/o,U=(M[1][0]-x[0])/o,Z=-(M[1][1]-x[1])/o,H=(M[2][0]-x[0])/o,K=-(M[2][1]-x[1])/o;m.beginPath(),m.moveTo(U,Z),m.lineTo(A,z),m.lineTo(H,K),m.closePath(),m.stroke()}),m.restore()),m.canvas}class Ex extends nd{constructor(t,e,i,n,o,a,h,c,d,f,_,m){super(o,Q.IDLE,{interpolate:!!m}),this.renderEdges_=_!==void 0?_:!1,this.pixelRatio_=h,this.gutter_=c,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=n,this.wrappedTileCoord_=a||o,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const E=n.getTileCoordExtent(this.wrappedTileCoord_),v=this.targetTileGrid_.getExtent();let b=this.sourceTileGrid_.getExtent();const C=v?_r(E,v):E;if(ma(C)===0){this.state=Q.EMPTY;return}const S=t.getExtent();S&&(b?b=_r(b,S):b=S);const y=n.getResolution(this.wrappedTileCoord_[0]),x=vx(t,i,C,y);if(!isFinite(x)||x<=0){this.state=Q.EMPTY;return}const T=f!==void 0?f:fx;if(this.triangulation_=new mx(t,i,C,b,x*T,y),this.triangulation_.getTriangles().length===0){this.state=Q.EMPTY;return}this.sourceZ_=e.getZForResolution(x);let k=this.triangulation_.calculateSourceExtent();if(b&&(t.canWrapX()?(k[1]=It(k[1],b[1],b[3]),k[3]=It(k[3],b[1],b[3])):k=_r(k,b)),!ma(k))this.state=Q.EMPTY;else{const R=e.getTileRangeForExtentAndZ(k,this.sourceZ_);for(let M=R.minX;M<=R.maxX;M++)for(let A=R.minY;A<=R.maxY;A++){const z=d(this.sourceZ_,M,A,h);z&&this.sourceTiles_.push(z)}this.sourceTiles_.length===0&&(this.state=Q.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{e&&e.getState()==Q.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}),this.sourceTiles_.length=0,t.length===0)this.state=Q.ERROR;else{const e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n=typeof i=="number"?i:i[0],o=typeof i=="number"?i:i[1],a=this.targetTileGrid_.getResolution(e),h=this.sourceTileGrid_.getResolution(this.sourceZ_),c=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=xx(n,o,this.pixelRatio_,h,this.sourceTileGrid_.getExtent(),a,c,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=Q.LOADED}this.changed()}load(){if(this.state==Q.IDLE){this.state=Q.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(e=>{const i=e.getState();if(i==Q.IDLE||i==Q.LOADING){t++;const n=ut(e,at.CHANGE,function(o){const a=e.getState();(a==Q.LOADED||a==Q.ERROR||a==Q.EMPTY)&&(wt(n),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(n)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(e,i,n){e.getState()==Q.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(wt),this.sourcesListenerKeys_=null}release(){this.canvas_&&(Ws(this.canvas_.getContext("2d")),zn.push(this.canvas_),this.canvas_=null),super.release()}}const xl=Ex;class wx extends nd{constructor(t,e,i,n,o,a){super(t,e,a),this.crossOrigin_=n,this.src_=i,this.key=i,this.image_=new Image,n!==null&&(this.image_.crossOrigin=n),this.unlisten_=null,this.tileLoadFunction_=o}getImage(){return this.image_}setImage(t){this.image_=t,this.state=Q.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=Q.ERROR,this.unlistenImage_(),this.image_=Lx(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=Q.LOADED:this.state=Q.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==Q.ERROR&&(this.state=Q.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Q.IDLE&&(this.state=Q.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=sv(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function Lx(){const r=$t(1,1);return r.fillStyle="rgba(0,0,0,0)",r.fillRect(0,0,1,1),r.canvas}const ad=wx;class bx{constructor(t){this.highWaterMark=t!==void 0?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}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 i=this.entries_[t];return gt(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(t){const e=this.entries_[t];return gt(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,i;for(i=this.newest_;i;i=i.older)t[e++]=i.key_;return t}getValues(){const t=new Array(this.count_);let e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){if(this.containsKey(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){gt(!(t in this.entries_),"Tried to set a value for a key that is used already");const i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_}setSize(t){this.highWaterMark=t}}const Tx=bx;class ld{constructor(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}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 Nn(r,t,e,i,n){return n!==void 0?(n.minX=r,n.maxX=t,n.minY=e,n.maxY=i,n):new ld(r,t,e,i)}const hd=ld;function cd(r,t,e,i){return i!==void 0?(i[0]=r,i[1]=t,i[2]=e,i):[r,t,e]}function lo(r,t,e){return r+"/"+t+"/"+e}function ud(r){return lo(r[0],r[1],r[2])}function Cx(r){return r.split("/").map(Number)}function Sx(r){return(r[1]<<r[0])+r[2]}function Px(r,t){const e=r[0],i=r[1],n=r[2];if(t.getMinZoom()>e||e>t.getMaxZoom())return!1;const o=t.getFullTileRange(e);return o?o.containsXY(i,n):!0}function Ar(r){const t=r.toString();return t.includes(".")?t:t+".0"}function kx(r){if(r.length<2||r.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return`vec${r.length}(${r.map(Ar).join(", ")})`}function El(r){const t=yr(r),e=t.length>3?t[3]:1;return kx([t[0]/255*e,t[1]/255*e,t[2]/255*e,e])}const wl={};let Rx=0;function Mx(r){return r in wl||(wl[r]=Rx++),wl[r]}function Bn(r){return Ar(Mx(r))}function Ix(){return{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"#3399CC","stroke-width":1.25,"circle-radius":5,"circle-fill-color":"rgba(255,255,255,0.4)","circle-stroke-width":1.25,"circle-stroke-color":"#3399CC"}}const Gn=`#ifdef GL_FRAGMENT_PRECISION_HIGH
48
48
  precision highp float;
49
49
  #else
50
50
  precision mediump float;
@@ -63,7 +63,7 @@ uniform mediump int u_hitDetection;
63
63
 
64
64
  const float PI = 3.141592653589793238;
65
65
  const float TWO_PI = 2.0 * PI;
66
- `,jn=qx();class $x{constructor(){this.uniforms_=[],this.attributes_=[],this.varyings_=[],this.hasSymbol_=!1,this.symbolSizeExpression_=`vec2(${Nr(jn["circle-radius"])} + ${Nr(jn["circle-stroke-width"]*.5)})`,this.symbolRotationExpression_="0.0",this.symbolOffsetExpression_="vec2(0.0)",this.symbolColorExpression_=kl(jn["circle-fill-color"]),this.texCoordExpression_="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression_="false",this.symbolRotateWithView_=!1,this.hasStroke_=!1,this.strokeWidthExpression_=Nr(jn["stroke-width"]),this.strokeColorExpression_=kl(jn["stroke-color"]),this.strokeOffsetExpression_="0.",this.strokeCapExpression_=Un("round"),this.strokeJoinExpression_=Un("round"),this.strokeMiterLimitExpression_="10.",this.strokeDistanceFieldExpression_="-1000.",this.hasFill_=!1,this.fillColorExpression_=kl(jn["fill-color"]),this.vertexShaderFunctions_=[],this.fragmentShaderFunctions_=[]}addUniform(t){return this.uniforms_.push(t),this}addAttribute(t){return this.attributes_.push(t),this}addVarying(t,e,i){return this.varyings_.push({name:t,type:e,expression:i}),this}setSymbolSizeExpression(t){return this.hasSymbol_=!0,this.symbolSizeExpression_=t,this}getSymbolSizeExpression(){return this.symbolSizeExpression_}setSymbolRotationExpression(t){return this.symbolRotationExpression_=t,this}setSymbolOffsetExpression(t){return this.symbolOffsetExpression_=t,this}getSymbolOffsetExpression(){return this.symbolOffsetExpression_}setSymbolColorExpression(t){return this.hasSymbol_=!0,this.symbolColorExpression_=t,this}getSymbolColorExpression(){return this.symbolColorExpression_}setTextureCoordinateExpression(t){return this.texCoordExpression_=t,this}setFragmentDiscardExpression(t){return this.discardExpression_=t,this}setSymbolRotateWithView(t){return this.symbolRotateWithView_=t,this}setStrokeWidthExpression(t){return this.hasStroke_=!0,this.strokeWidthExpression_=t,this}setStrokeColorExpression(t){return this.hasStroke_=!0,this.strokeColorExpression_=t,this}setStrokeOffsetExpression(t){return this.strokeOffsetExpression_=t,this}setStrokeCapExpression(t){return this.strokeCapExpression_=t,this}setStrokeJoinExpression(t){return this.strokeJoinExpression_=t,this}setStrokeMiterLimitExpression(t){return this.strokeMiterLimitExpression_=t,this}setStrokeDistanceFieldExpression(t){return this.strokeDistanceFieldExpression_=t,this}setFillColorExpression(t){return this.hasFill_=!0,this.fillColorExpression_=t,this}addVertexShaderFunction(t){this.vertexShaderFunctions_.includes(t)||this.vertexShaderFunctions_.push(t)}addFragmentShaderFunction(t){this.fragmentShaderFunctions_.includes(t)||this.fragmentShaderFunctions_.push(t)}getSymbolVertexShader(){return this.hasSymbol_?`${Zn}
66
+ `,Un=Ix();class Ax{constructor(){this.uniforms_=[],this.attributes_=[],this.varyings_=[],this.hasSymbol_=!1,this.symbolSizeExpression_=`vec2(${Ar(Un["circle-radius"])} + ${Ar(Un["circle-stroke-width"]*.5)})`,this.symbolRotationExpression_="0.0",this.symbolOffsetExpression_="vec2(0.0)",this.symbolColorExpression_=El(Un["circle-fill-color"]),this.texCoordExpression_="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression_="false",this.symbolRotateWithView_=!1,this.hasStroke_=!1,this.strokeWidthExpression_=Ar(Un["stroke-width"]),this.strokeColorExpression_=El(Un["stroke-color"]),this.strokeOffsetExpression_="0.",this.strokeCapExpression_=Bn("round"),this.strokeJoinExpression_=Bn("round"),this.strokeMiterLimitExpression_="10.",this.strokeDistanceFieldExpression_="-1000.",this.hasFill_=!1,this.fillColorExpression_=El(Un["fill-color"]),this.vertexShaderFunctions_=[],this.fragmentShaderFunctions_=[]}addUniform(t){return this.uniforms_.push(t),this}addAttribute(t){return this.attributes_.push(t),this}addVarying(t,e,i){return this.varyings_.push({name:t,type:e,expression:i}),this}setSymbolSizeExpression(t){return this.hasSymbol_=!0,this.symbolSizeExpression_=t,this}getSymbolSizeExpression(){return this.symbolSizeExpression_}setSymbolRotationExpression(t){return this.symbolRotationExpression_=t,this}setSymbolOffsetExpression(t){return this.symbolOffsetExpression_=t,this}getSymbolOffsetExpression(){return this.symbolOffsetExpression_}setSymbolColorExpression(t){return this.hasSymbol_=!0,this.symbolColorExpression_=t,this}getSymbolColorExpression(){return this.symbolColorExpression_}setTextureCoordinateExpression(t){return this.texCoordExpression_=t,this}setFragmentDiscardExpression(t){return this.discardExpression_=t,this}setSymbolRotateWithView(t){return this.symbolRotateWithView_=t,this}setStrokeWidthExpression(t){return this.hasStroke_=!0,this.strokeWidthExpression_=t,this}setStrokeColorExpression(t){return this.hasStroke_=!0,this.strokeColorExpression_=t,this}setStrokeOffsetExpression(t){return this.strokeOffsetExpression_=t,this}setStrokeCapExpression(t){return this.strokeCapExpression_=t,this}setStrokeJoinExpression(t){return this.strokeJoinExpression_=t,this}setStrokeMiterLimitExpression(t){return this.strokeMiterLimitExpression_=t,this}setStrokeDistanceFieldExpression(t){return this.strokeDistanceFieldExpression_=t,this}setFillColorExpression(t){return this.hasFill_=!0,this.fillColorExpression_=t,this}addVertexShaderFunction(t){this.vertexShaderFunctions_.includes(t)||this.vertexShaderFunctions_.push(t)}addFragmentShaderFunction(t){this.fragmentShaderFunctions_.includes(t)||this.fragmentShaderFunctions_.push(t)}getSymbolVertexShader(){return this.hasSymbol_?`${Gn}
67
67
  ${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
68
68
  `)}
69
69
  attribute vec2 a_position;
@@ -124,7 +124,7 @@ void main(void) {
124
124
  v_centerPx = screenToPx(center.xy) + centerOffsetPx;
125
125
  ${this.varyings_.map(function(t){return" "+t.name+" = "+t.expression+";"}).join(`
126
126
  `)}
127
- }`:null}getSymbolFragmentShader(){return this.hasSymbol_?`${Zn}
127
+ }`:null}getSymbolFragmentShader(){return this.hasSymbol_?`${Gn}
128
128
  ${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
129
129
  `)}
130
130
  varying vec2 v_texCoord;
@@ -148,7 +148,7 @@ void main(void) {
148
148
  if (gl_FragColor.a < 0.05) { discard; };
149
149
  gl_FragColor = v_hitColor;
150
150
  }
151
- }`:null}getStrokeVertexShader(){return this.hasStroke_?`${Zn}
151
+ }`:null}getStrokeVertexShader(){return this.hasStroke_?`${Gn}
152
152
  ${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
153
153
  `)}
154
154
  attribute vec2 a_position;
@@ -242,7 +242,7 @@ void main(void) {
242
242
  v_distanceOffsetPx = a_distance / u_resolution;
243
243
  ${this.varyings_.map(function(t){return" "+t.name+" = "+t.expression+";"}).join(`
244
244
  `)}
245
- }`:null}getStrokeFragmentShader(){return this.hasStroke_?`${Zn}
245
+ }`:null}getStrokeFragmentShader(){return this.hasStroke_?`${Gn}
246
246
  ${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
247
247
  `)}
248
248
  varying vec2 v_segmentStart;
@@ -316,18 +316,18 @@ float miterJoinDistanceField(vec2 point, vec2 start, vec2 end, float width, floa
316
316
  }
317
317
 
318
318
  float capDistanceField(vec2 point, vec2 start, vec2 end, float width, float capType) {
319
- if (capType == ${Un("butt")}) {
319
+ if (capType == ${Bn("butt")}) {
320
320
  return buttCapDistanceField(point, start, end);
321
- } else if (capType == ${Un("square")}) {
321
+ } else if (capType == ${Bn("square")}) {
322
322
  return squareCapDistanceField(point, start, end, width);
323
323
  }
324
324
  return roundCapDistanceField(point, start, end, width);
325
325
  }
326
326
 
327
327
  float joinDistanceField(vec2 point, vec2 start, vec2 end, float width, float joinAngle, float joinType) {
328
- if (joinType == ${Un("bevel")}) {
328
+ if (joinType == ${Bn("bevel")}) {
329
329
  return bevelJoinField(point, start, end, width, joinAngle);
330
- } else if (joinType == ${Un("miter")}) {
330
+ } else if (joinType == ${Bn("miter")}) {
331
331
  return miterJoinDistanceField(point, start, end, width, joinAngle);
332
332
  }
333
333
  return roundJoinDistanceField(point, start, end, width);
@@ -378,7 +378,7 @@ void main(void) {
378
378
  if (gl_FragColor.a < 0.1) { discard; };
379
379
  gl_FragColor = v_hitColor;
380
380
  }
381
- }`:null}getFillVertexShader(){return this.hasFill_?`${Zn}
381
+ }`:null}getFillVertexShader(){return this.hasFill_?`${Gn}
382
382
  ${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
383
383
  `)}
384
384
  attribute vec2 a_position;
@@ -394,7 +394,7 @@ void main(void) {
394
394
  gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);
395
395
  ${this.varyings_.map(function(t){return" "+t.name+" = "+t.expression+";"}).join(`
396
396
  `)}
397
- }`:null}getFillFragmentShader(){return this.hasFill_?`${Zn}
397
+ }`:null}getFillFragmentShader(){return this.hasFill_?`${Gn}
398
398
  ${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(`
399
399
  `)}
400
400
  varying vec4 v_hitColor;
@@ -427,7 +427,7 @@ void main(void) {
427
427
  if (gl_FragColor.a < 0.1) { discard; };
428
428
  gl_FragColor = v_hitColor;
429
429
  }
430
- }`:null}}const Se={BLUR:"blur",GRADIENT:"gradient",RADIUS:"radius"},Jx=["#00f","#0ff","#0f0","#ff0","#f00"];class Qx extends xl{constructor(t){t=t||{};const e=Object.assign({},t);delete e.gradient,delete e.radius,delete e.blur,delete e.weight,super(e),this.gradient_=null,this.addChangeListener(Se.GRADIENT,this.handleGradientChanged_),this.setGradient(t.gradient?t.gradient:Jx),this.setBlur(t.blur!==void 0?t.blur:15),this.setRadius(t.radius!==void 0?t.radius:8);const i=t.weight?t.weight:"weight";typeof i=="string"?this.weightFunction_=function(n){return n.get(i)}:this.weightFunction_=i,this.setRenderOrder(null)}getBlur(){return this.get(Se.BLUR)}getGradient(){return this.get(Se.GRADIENT)}getRadius(){return this.get(Se.RADIUS)}handleGradientChanged_(){this.gradient_=t0(this.getGradient())}setBlur(t){this.set(Se.BLUR,t)}setGradient(t){this.set(Se.GRADIENT,t)}setRadius(t){this.set(Se.RADIUS,t)}createRenderer(){const t=new $x().addAttribute("float a_weight").addVarying("v_weight","float","a_weight").addUniform("float u_size").addUniform("float u_blurSlope").setSymbolSizeExpression("vec2(u_size)").setSymbolColorExpression("vec4(smoothstep(0., 1., (1. - length(coordsPx * 2. / v_quadSizePx)) * u_blurSlope) * v_weight)");return new Rx(this,{className:this.getClassName(),attributes:[{name:"weight",callback:e=>{const i=this.weightFunction_(e);return i!==void 0?It(i,0,1):1}}],uniforms:{u_size:()=>(this.get(Se.RADIUS)+this.get(Se.BLUR))*2,u_blurSlope:()=>this.get(Se.RADIUS)/Math.max(1,this.get(Se.BLUR))},hitDetectionEnabled:!0,vertexShader:t.getSymbolVertexShader(),fragmentShader:t.getSymbolFragmentShader(),postProcesses:[{fragmentShader:`
430
+ }`:null}}const Se={BLUR:"blur",GRADIENT:"gradient",RADIUS:"radius"},Dx=["#00f","#0ff","#0f0","#ff0","#f00"];class Ox extends dl{constructor(t){t=t||{};const e=Object.assign({},t);delete e.gradient,delete e.radius,delete e.blur,delete e.weight,super(e),this.gradient_=null,this.addChangeListener(Se.GRADIENT,this.handleGradientChanged_),this.setGradient(t.gradient?t.gradient:Dx),this.setBlur(t.blur!==void 0?t.blur:15),this.setRadius(t.radius!==void 0?t.radius:8);const i=t.weight?t.weight:"weight";typeof i=="string"?this.weightFunction_=function(n){return n.get(i)}:this.weightFunction_=i,this.setRenderOrder(null)}getBlur(){return this.get(Se.BLUR)}getGradient(){return this.get(Se.GRADIENT)}getRadius(){return this.get(Se.RADIUS)}handleGradientChanged_(){this.gradient_=Fx(this.getGradient())}setBlur(t){this.set(Se.BLUR,t)}setGradient(t){this.set(Se.GRADIENT,t)}setRadius(t){this.set(Se.RADIUS,t)}createRenderer(){const t=new Ax().addAttribute("float a_weight").addVarying("v_weight","float","a_weight").addUniform("float u_size").addUniform("float u_blurSlope").setSymbolSizeExpression("vec2(u_size)").setSymbolColorExpression("vec4(smoothstep(0., 1., (1. - length(coordsPx * 2. / v_quadSizePx)) * u_blurSlope) * v_weight)");return new dx(this,{className:this.getClassName(),attributes:[{name:"weight",callback:e=>{const i=this.weightFunction_(e);return i!==void 0?It(i,0,1):1}}],uniforms:{u_size:()=>(this.get(Se.RADIUS)+this.get(Se.BLUR))*2,u_blurSlope:()=>this.get(Se.RADIUS)/Math.max(1,this.get(Se.BLUR))},hitDetectionEnabled:!0,vertexShader:t.getSymbolVertexShader(),fragmentShader:t.getSymbolFragmentShader(),postProcesses:[{fragmentShader:`
431
431
  precision mediump float;
432
432
 
433
433
  uniform sampler2D u_image;
@@ -441,8 +441,8 @@ void main(void) {
441
441
  gl_FragColor.a = color.a * u_opacity;
442
442
  gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;
443
443
  gl_FragColor.rgb *= gl_FragColor.a;
444
- }`,uniforms:{u_gradientTexture:()=>this.gradient_,u_opacity:()=>this.getOpacity()}}]})}renderDeclutter(){}}function t0(r){const i=$t(1,256),n=i.createLinearGradient(0,0,1,256),o=1/(r.length-1);for(let a=0,h=r.length;a<h;++a)n.addColorStop(a*o,r[a]);return i.fillStyle=n,i.fillRect(0,0,1,256),i.canvas}const e0=Qx;class i0 extends jx{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()}pruneExceptNewestZ(){if(this.getCount()===0)return;const t=this.peekFirstKey(),i=Wx(t)[0];this.forEach(n=>{n.tileCoord[0]!==i&&(this.remove(Ld(n.tileCoord)),n.release())})}}const bd=i0,Ml={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class n0 extends be{constructor(t){super(),this.projection=Gt(t.projection),this.attributions_=Td(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible!==void 0?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(i,n){e.viewResolver=i,e.viewRejector=n})}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_=Td(t),this.changed()}setState(t){this.state_=t,this.changed()}}function Td(r){return r?Array.isArray(r)?function(t){return r}:typeof r=="function"?r:function(t){return[r]}:null}const Cd=n0,Wn=[0,0,0],ki=5;class r0{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,ft(Rp(this.resolutions_,function(n,o){return o-n},!0),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let n=0,o=this.resolutions_.length-1;n<o;++n)if(!e)e=this.resolutions_[n]/this.resolutions_[n+1];else if(this.resolutions_[n]/this.resolutions_[n+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,ft(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const i=t.extent;i!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=qi(i)),ft(!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,ft(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:Ea,ft(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=i!==void 0?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],t.sizes!==void 0?this.fullTileRanges_=t.sizes.map(function(n,o){const a=new Ed(Math.min(0,n[0]),Math.max(n[0]-1,-1),Math.min(0,n[1]),Math.max(n[1]-1,-1));if(i){const h=this.getTileRangeForExtentAndZ(i,o);a.minX=Math.max(h.minX,a.minX),a.maxX=Math.min(h.maxX,a.maxX),a.minY=Math.max(h.minY,a.minY),a.maxY=Math.min(h.maxY,a.maxY)}return a},this):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){const n=this.getTileRangeForExtentAndZ(t,e);for(let o=n.minX,a=n.maxX;o<=a;++o)for(let h=n.minY,c=n.maxY;h<=c;++h)i([e,o,h])}forEachTileCoordParentTileRange(t,e,i,n){let o,a,h,c=null,d=t[0]-1;for(this.zoomFactor_===2?(a=t[1],h=t[2]):c=this.getTileCoordExtent(t,n);d>=this.minZoom;){if(this.zoomFactor_===2?(a=Math.floor(a/2),h=Math.floor(h/2),o=Gn(a,a,h,h,i)):o=this.getTileRangeForExtentAndZ(c,d,i),e(d,o))return!0;--d}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,i){if(t[0]<this.maxZoom){if(this.zoomFactor_===2){const o=t[1]*2,a=t[2]*2;return Gn(o,o+1,a,a+1,e)}const n=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(n,t[0]+1,e)}return null}getTileRangeForTileCoordAndZ(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;const n=t[0],o=t[1],a=t[2];if(e===n)return Gn(o,a,o,a,i);if(this.zoomFactor_){const c=Math.pow(this.zoomFactor_,e-n),d=Math.floor(o*c),f=Math.floor(a*c);if(e<n)return Gn(d,d,f,f,i);const _=Math.floor(c*(o+1))-1,m=Math.floor(c*(a+1))-1;return Gn(d,_,f,m,i)}const h=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(h,e,i)}getTileRangeForExtentAndZ(t,e,i){this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,Wn);const n=Wn[1],o=Wn[2];this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,Wn);const a=Wn[1],h=Wn[2];return Gn(n,a,o,h,i)}getTileCoordCenter(t){const e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=pe(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*i,e[1]-(t[2]+.5)*n[1]*i]}getTileCoordExtent(t,e){const i=this.getOrigin(t[0]),n=this.getResolution(t[0]),o=pe(this.getTileSize(t[0]),this.tmpSize_),a=i[0]+t[1]*o[0]*n,h=i[1]-(t[2]+1)*o[1]*n,c=a+o[0]*n,d=h+o[1]*n;return Ei(a,h,c,d,e)}getTileCoordForCoordAndResolution(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)}getTileCoordForXYAndResolution_(t,e,i,n,o){const a=this.getZForResolution(i),h=i/this.getResolution(a),c=this.getOrigin(a),d=pe(this.getTileSize(a),this.tmpSize_);let f=h*(t-c[0])/i/d[0],_=h*(c[1]-e)/i/d[1];return n?(f=zs(f,ki)-1,_=zs(_,ki)-1):(f=Fs(f,ki),_=Fs(_,ki)),wd(a,f,_,o)}getTileCoordForXYAndZ_(t,e,i,n,o){const a=this.getOrigin(i),h=this.getResolution(i),c=pe(this.getTileSize(i),this.tmpSize_);let d=(t-a[0])/h/c[0],f=(a[1]-e)/h/c[1];return n?(d=zs(d,ki)-1,f=zs(f,ki)-1):(d=Fs(d,ki),f=Fs(f,ki)),wd(i,d,f,o)}getTileCoordForCoordAndZ(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)}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 i=xa(this.resolutions_,t,e||0);return It(i,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return uu(e,0,e.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){const e=this.resolutions_.length,i=new Array(e);for(let n=this.minZoom;n<e;++n)i[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=i}}const Sd=r0;function Pd(r){let t=r.getDefaultTileGrid();return t||(t=l0(r),r.setDefaultTileGrid(t)),t}function s0(r,t,e){const i=t[0],n=r.getTileCoordCenter(t),o=Il(e);if(!Rs(o,n)){const a=Tt(o),h=Math.ceil((o[0]-n[0])/a);return n[0]+=a*h,r.getTileCoordForCoordAndZ(n,i)}return t}function o0(r,t,e,i){i=i!==void 0?i:"top-left";const n=kd(r,t,e);return new Sd({extent:r,origin:Kp(r,i),resolutions:n,tileSize:e})}function a0(r){const t=r||{},e=t.extent||Gt("EPSG:3857").getExtent(),i={extent:e,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:kd(e,t.maxZoom,t.tileSize,t.maxResolution)};return new Sd(i)}function kd(r,t,e,i){t=t!==void 0?t:Fp,e=pe(e!==void 0?e:Ea);const n=Fe(r),o=Tt(r);i=i>0?i:Math.max(o/e[0],n/e[1]);const a=t+1,h=new Array(a);for(let c=0;c<a;++c)h[c]=i/Math.pow(2,c);return h}function l0(r,t,e,i){const n=Il(r);return o0(n,t,e,i)}function Il(r){r=Gt(r);let t=r.getExtent();if(!t){const e=180*pr.degrees/r.getMetersPerUnit();t=Ei(-e,-e,e,e)}return t}class h0 extends Cd{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.opaque_=t.opaque!==void 0?t.opaque:!1,this.tilePixelRatio_=t.tilePixelRatio!==void 0?t.tilePixelRatio:1,this.tileGrid=t.tileGrid!==void 0?t.tileGrid:null;const e=[256,256];this.tileGrid&&pe(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),e),this.tileCache=new bd(t.cacheSize||0),this.tmpSize=[0,0],this.key_=t.key||"",this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}canExpireCache(){return this.tileCache.canExpireCache()}expireCache(t,e){const i=this.getTileCacheForProjection(t);i&&i.expireCache(e)}forEachLoadedTile(t,e,i,n){const o=this.getTileCacheForProjection(t);if(!o)return!1;let a=!0,h,c,d;for(let f=i.minX;f<=i.maxX;++f)for(let _=i.minY;_<=i.maxY;++_)c=mo(e,f,_),d=!1,o.containsKey(c)&&(h=o.get(c),d=h.getState()===$.LOADED,d&&(d=n(h)!==!1)),d||(a=!1);return a}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getOpaque(t){return this.opaque_}getResolutions(t){const e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,i,n,o){return it()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:Pd(t)}getTileCacheForProjection(t){const e=this.getProjection();return ft(e===null||Ji(e,t),"A VectorTile source can only be rendered if it has a projection compatible with the view projection."),this.tileCache}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,i){const n=this.getTileGridForProjection(i),o=this.getTilePixelRatio(e),a=pe(n.getTileSize(t),this.tmpSize);return o==1?a:mv(a,o,this.tmpSize)}getTileCoordForTileUrlFunction(t,e){e=e!==void 0?e:this.getProjection();const i=this.getTileGridForProjection(e);return this.getWrapX()&&e.isGlobal()&&(t=s0(i,t,e)),Vx(t,i)?t:null}clear(){this.tileCache.clear()}refresh(){this.clear(),super.refresh()}updateCacheSize(t,e){const i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)}useTile(t,e,i,n){}}class c0 extends Qe{constructor(t,e){super(t),this.tile=e}}const u0=h0;function d0(r,t){const e=/\{z\}/g,i=/\{x\}/g,n=/\{y\}/g,o=/\{-y\}/g;return function(a,h,c){if(a)return r.replace(e,a[0].toString()).replace(i,a[1].toString()).replace(n,a[2].toString()).replace(o,function(){const d=a[0],f=t.getFullTileRange(d);return ft(f,"The {-y} placeholder requires a tile grid with extent"),(f.getHeight()-a[2]-1).toString()})}}function f0(r,t){const e=r.length,i=new Array(e);for(let n=0;n<e;++n)i[n]=d0(r[n],t);return g0(i)}function g0(r){return r.length===1?r[0]:function(t,e,i){if(!t)return;const n=Hx(t),o=kn(n,r.length);return r[o](t,e,i)}}function _0(r){const t=[];let e=/\{([a-z])-([a-z])\}/.exec(r);if(e){const i=e[1].charCodeAt(0),n=e[2].charCodeAt(0);let o;for(o=i;o<=n;++o)t.push(r.replace(e[0],String.fromCharCode(o)));return t}if(e=/\{(\d+)-(\d+)\}/.exec(r),e){const i=parseInt(e[2],10);for(let n=parseInt(e[1],10);n<=i;n++)t.push(r.replace(e[0],n.toString()));return t}return t.push(r),t}class Al extends u0{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,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===Al.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,i=at(e),n=e.getState();let o;n==$.LOADING?(this.tileLoadingKeys_[i]=!0,o=Ml.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],o=n==$.ERROR?Ml.TILELOADERROR:n==$.LOADED?Ml.TILELOADEND:void 0),o!=null&&this.dispatchEvent(new c0(o,e))}setTileLoadFunction(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),typeof e<"u"?this.setKey(e):this.changed()}setUrl(t){const e=_0(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join(`
445
- `);this.generateTileUrlFunction_?this.setTileUrlFunction(f0(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,i){}useTile(t,e,i){const n=mo(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)}}const p0=Al;class m0 extends p0{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:y0,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:vd,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}canExpireCache(){if(this.tileCache.canExpireCache())return!0;for(const t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1}expireCache(t,e){const i=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==i?e:{});for(const n in this.tileCacheForProjection){const o=this.tileCacheForProjection[n];o.expireCache(o==i?e:{})}}getGutterForProjection(t){return this.getProjection()&&t&&!Ji(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getOpaque(t){return this.getProjection()&&t&&!Ji(this.getProjection(),t)?!1:super.getOpaque(t)}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||Ji(e,t)))return this.tileGrid;const i=at(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Pd(t)),this.tileGridForProjection[i]}getTileCacheForProjection(t){const e=this.getProjection();if(!e||Ji(e,t))return this.tileCache;const i=at(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new bd(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]}createTile_(t,e,i,n,o,a){const h=[t,e,i],c=this.getTileCoordForTileUrlFunction(h,o),d=c?this.tileUrlFunction(c,n,o):void 0,f=new this.tileClass(h,d!==void 0?$.IDLE:$.EMPTY,d!==void 0?d:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return f.key=a,f.addEventListener(rt.CHANGE,this.handleTileChange.bind(this)),f}getTile(t,e,i,n,o){const a=this.getProjection();if(!a||!o||Ji(a,o))return this.getTileInternal(t,e,i,n,a||o);const h=this.getTileCacheForProjection(o),c=[t,e,i];let d;const f=Ld(c);h.containsKey(f)&&(d=h.get(f));const _=this.getKey();if(d&&d.key==_)return d;const m=this.getTileGridForProjection(a),v=this.getTileGridForProjection(o),y=this.getTileCoordForTileUrlFunction(c,o),E=new Pl(a,m,o,v,c,y,this.getTilePixelRatio(n),this.getGutter(),(b,S,w,T)=>this.getTileInternal(b,S,w,T,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return E.key=_,d?(E.interimTile=d,E.refreshInterimChain(),h.replace(f,E)):h.set(f,E),E}getTileInternal(t,e,i,n,o){let a=null;const h=mo(t,e,i),c=this.getKey();if(!this.tileCache.containsKey(h))a=this.createTile_(t,e,i,n,o,c),this.tileCache.set(h,a);else if(a=this.tileCache.get(h),a.key!=c){const d=a;a=this.createTile_(t,e,i,n,o,c),d.getState()==$.IDLE?a.interimTile=d.interimTile:a.interimTile=d,a.refreshInterimChain(),this.tileCache.replace(h,a)}return a}setRenderReprojectionEdges(t){if(this.renderReprojectionEdges_!=t){this.renderReprojectionEdges_=t;for(const e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}}setTileGridForProjection(t,e){const i=Gt(t);if(i){const n=at(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}}clear(){super.clear();for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear()}}function y0(r,t){r.getImage().src=t}const v0=m0;class x0 extends v0{constructor(t){t=t||{};const e=t.projection!==void 0?t.projection:"EPSG:3857",i=t.tileGrid!==void 0?t.tileGrid:a0({extent:Il(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,opaque:t.opaque,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}}const E0=x0,w0='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class L0 extends E0{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[w0];const i=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",n=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:i,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,opaque:t.opaque!==void 0?t.opaque:!0,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:n,wrapX:t.wrapX,zDirection:t.zDirection})}}const b0=L0,yo={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class T0 extends Ks{constructor(t){t=t||{};const e=Object.assign({},t);delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getPreload(){return this.get(yo.PRELOAD)}setPreload(t){this.set(yo.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(yo.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(yo.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}const C0=T0,Rd=[];let Hn=null;function S0(){Hn=$t(1,1,void 0,{willReadFrequently:!0})}class P0 extends hd{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=Vt(),this.pixelTransform=Vt(),this.inversePixelTransform=Vt(),this.context=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(t,e,i){Hn||S0(),Hn.clearRect(0,0,1,1);let n;try{Hn.drawImage(t,e,i,1,1,0,0,1,1),n=Hn.getImageData(0,0,1,1).data}catch{return Hn=null,null}return n}getBackground(t){let i=this.getLayer().getBackground();return typeof i=="function"&&(i=i(t.viewState.resolution)),i||void 0}useContainer(t,e,i){const n=this.getLayer().getClassName();let o,a;if(t&&t.className===n&&(!i||t&&t.style.backgroundColor&&ei(Lr(t.style.backgroundColor),Lr(i)))){const h=t.firstElementChild;h instanceof HTMLCanvasElement&&(a=h.getContext("2d"))}if(a&&a.canvas.style.transform===e?(this.container=t,this.context=a,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){o=document.createElement("div"),o.className=n;let h=o.style;h.position="absolute",h.width="100%",h.height="100%",a=$t();const c=a.canvas;o.appendChild(c),h=c.style,h.position="absolute",h.left="0",h.transformOrigin="top left",this.container=o,this.context=a}!this.containerReused&&i&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=i)}clipUnrotated(t,e,i){const n=qi(i),o=As(i),a=Is(i),h=Ms(i);Ot(e.coordinateToPixelTransform,n),Ot(e.coordinateToPixelTransform,o),Ot(e.coordinateToPixelTransform,a),Ot(e.coordinateToPixelTransform,h);const c=this.inversePixelTransform;Ot(c,n),Ot(c,o),Ot(c,a),Ot(c,h),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.lineTo(Math.round(h[0]),Math.round(h[1])),t.clip()}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){const o=new br(t,this.inversePixelTransform,i,e);n.dispatchEvent(o)}}preRender(t,e){this.frameState=e,this.dispatchRenderEvent_(qt.PRERENDER,t,e)}postRender(t,e){this.dispatchRenderEvent_(qt.POSTRENDER,t,e)}getRenderTransform(t,e,i,n,o,a,h){const c=o/2,d=a/2,f=n/e,_=-f,m=-t[0]+h,v=-t[1];return ze(this.tempTransform,c,d,f,_,-i,m,v)}disposeInternal(){delete this.frameState,super.disposeInternal()}}const Md=P0;class k0 extends Md{constructor(t){super(t),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=ge(),this.tmpTileRange_=new Ed(0,0,0,0)}isDrawableTile(t){const e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==$.LOADED||i==$.EMPTY||i==$.ERROR&&!n}getTile(t,e,i,n){const o=n.pixelRatio,a=n.viewState.projection,h=this.getLayer();let d=h.getSource().getTile(t,e,i,o,a);return d.getState()==$.ERROR&&h.getUseInterimTilesOnError()&&h.getPreload()>0&&(this.newTiles_=!0),this.isDrawableTile(d)||(d=d.getInterimTile()),d}getData(t){const e=this.frameState;if(!e)return null;const i=this.getLayer(),n=Ot(e.pixelToCoordinateTransform,t.slice()),o=i.getExtent();if(o&&!Rs(o,n))return null;const a=e.pixelRatio,h=e.viewState.projection,c=e.viewState,d=i.getRenderSource(),f=d.getTileGridForProjection(c.projection),_=d.getTilePixelRatio(e.pixelRatio);for(let m=f.getZForResolution(c.resolution);m>=f.getMinZoom();--m){const v=f.getTileCoordForCoordAndZ(n,m),y=d.getTile(m,v[1],v[2],a,h);if(!(y instanceof vd||y instanceof Pl)||y instanceof Pl&&y.getState()===$.EMPTY)return null;if(y.getState()!==$.LOADED)continue;const E=f.getOrigin(m),b=pe(f.getTileSize(m)),S=f.getResolution(m),w=Math.floor(_*((n[0]-E[0])/S-v[1]*b[0])),T=Math.floor(_*((E[1]-n[1])/S-v[2]*b[1])),P=Math.round(_*d.getGutterForProjection(c.projection));return this.getImageData(y.getImage(),w+P,T+P)}return null}loadedTileCallback(t,e,i){return this.isDrawableTile(i)?super.loadedTileCallback(t,e,i):!1}prepareFrame(t){return!!this.getLayer().getSource()}renderFrame(t,e){const i=t.layerStatesArray[t.layerIndex],n=t.viewState,o=n.projection,a=n.resolution,h=n.center,c=n.rotation,d=t.pixelRatio,f=this.getLayer(),_=f.getSource(),m=_.getRevision(),v=_.getTileGridForProjection(o),y=v.getZForResolution(a,_.zDirection),E=v.getResolution(y);let b=t.extent;const S=t.viewState.resolution,w=_.getTilePixelRatio(d),T=Math.round(Tt(b)/S*d),P=Math.round(Fe(b)/S*d),M=i.extent&&Qi(i.extent);M&&(b=xr(b,Qi(i.extent)));const I=E*T/2/w,D=E*P/2/w,z=[h[0]-I,h[1]-D,h[0]+I,h[1]+D],W=v.getTileRangeForExtentAndZ(b,y),K={};K[y]={};const Q=this.createLoadedTileFinder(_,o,K),q=this.tmpExtent,ct=this.tmpTileRange_;this.newTiles_=!1;const Et=c?Sa(n.center,S,c,t.size):void 0;for(let Lt=W.minX;Lt<=W.maxX;++Lt)for(let J=W.minY;J<=W.maxY;++J){if(c&&!v.tileCoordIntersectsViewport([y,Lt,J],Et))continue;const Y=this.getTile(y,Lt,J,t);if(this.isDrawableTile(Y)){const St=at(this);if(Y.getState()==$.LOADED){K[y][Y.tileCoord.toString()]=Y;let ve=Y.inTransition(St);ve&&i.opacity!==1&&(Y.endTransition(St),ve=!1),!this.newTiles_&&(ve||!this.renderedTiles.includes(Y))&&(this.newTiles_=!0)}if(Y.getAlpha(St,t.time)===1)continue}const nt=v.getTileCoordChildTileRange(Y.tileCoord,ct,q);let Ft=!1;nt&&(Ft=Q(y+1,nt)),Ft||v.forEachTileCoordParentTileRange(Y.tileCoord,Q,ct,q)}const V=E/a*d/w;ze(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/d,1/d,c,-T/2,-P/2);const H=Qc(this.pixelTransform);this.useContainer(e,H,this.getBackground(t));const Z=this.context,B=Z.canvas;Gs(this.inversePixelTransform,this.pixelTransform),ze(this.tempTransform,T/2,P/2,V,V,0,-T/2,-P/2),B.width!=T||B.height!=P?(B.width=T,B.height=P):this.containerReused||Z.clearRect(0,0,T,P),M&&this.clipUnrotated(Z,t,M),_.getInterpolate()||(Z.imageSmoothingEnabled=!1),this.preRender(Z,t),this.renderedTiles.length=0;let yt=Object.keys(K).map(Number);yt.sort(xi);let U,st,F;i.opacity===1&&(!this.containerReused||_.getOpaque(t.viewState.projection))?yt=yt.reverse():(U=[],st=[]);for(let Lt=yt.length-1;Lt>=0;--Lt){const J=yt[Lt],Y=_.getTilePixelSize(J,d,o),Ft=v.getResolution(J)/E,St=Y[0]*Ft*V,ve=Y[1]*Ft*V,je=v.getTileCoordForCoordAndZ(qi(z),J),Di=v.getTileCoordExtent(je),xe=Ot(this.tempTransform,[w*(Di[0]-z[0])/E,w*(z[3]-Di[3])/E]),Oi=w*_.getGutterForProjection(o),We=K[J];for(const Fi in We){const Pe=We[Fi],zi=Pe.tileCoord,di=je[1]-zi[1],Xn=Math.round(xe[0]-(di-1)*St),fi=je[2]-zi[2],hn=Math.round(xe[1]-(fi-1)*ve),Xt=Math.round(xe[0]-di*St),ie=Math.round(xe[1]-fi*ve),me=Xn-Xt,ke=hn-ie,He=y===J,Ve=He&&Pe.getAlpha(at(this),t.time)!==1;let Re=!1;if(!Ve)if(U){F=[Xt,ie,Xt+me,ie,Xt+me,ie+ke,Xt,ie+ke];for(let Ni=0,cn=U.length;Ni<cn;++Ni)if(y!==J&&J<st[Ni]){const Wt=U[Ni];se([Xt,ie,Xt+me,ie+ke],[Wt[0],Wt[3],Wt[4],Wt[7]])&&(Re||(Z.save(),Re=!0),Z.beginPath(),Z.moveTo(F[0],F[1]),Z.lineTo(F[2],F[3]),Z.lineTo(F[4],F[5]),Z.lineTo(F[6],F[7]),Z.moveTo(Wt[6],Wt[7]),Z.lineTo(Wt[4],Wt[5]),Z.lineTo(Wt[2],Wt[3]),Z.lineTo(Wt[0],Wt[1]),Z.clip())}U.push(F),st.push(J)}else Z.clearRect(Xt,ie,me,ke);this.drawTileImage(Pe,t,Xt,ie,me,ke,Oi,He),U&&!Ve?(Re&&Z.restore(),this.renderedTiles.unshift(Pe)):this.renderedTiles.push(Pe),this.updateUsedTiles(t.usedTiles,_,Pe)}}return this.renderedRevision=m,this.renderedResolution=E,this.extentChanged=!this.renderedExtent_||!Pn(this.renderedExtent_,z),this.renderedExtent_=z,this.renderedPixelRatio=d,this.renderedProjection=o,this.manageTilePyramid(t,_,v,d,o,b,y,f.getPreload()),this.scheduleExpireCache(t,_),this.postRender(Z,t),i.extent&&Z.restore(),Z.imageSmoothingEnabled=!0,H!==B.style.transform&&(B.style.transform=H),this.container}drawTileImage(t,e,i,n,o,a,h,c){const d=this.getTileImage(t);if(!d)return;const f=at(this),_=e.layerStatesArray[e.layerIndex],m=_.opacity*(c?t.getAlpha(f,e.time):1),v=m!==this.context.globalAlpha;v&&(this.context.save(),this.context.globalAlpha=m),this.context.drawImage(d,h,h,d.width-2*h,d.height-2*h,i,n,o,a),v&&this.context.restore(),m!==_.opacity?e.animate=!0:c&&t.endTransition(f)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}scheduleExpireCache(t,e){if(e.canExpireCache()){const i=(function(n,o,a){const h=at(n);h in a.usedTiles&&n.expireCache(a.viewState.projection,a.usedTiles[h])}).bind(null,e);t.postRenderFunctions.push(i)}}updateUsedTiles(t,e,i){const n=at(e);n in t||(t[n]={}),t[n][i.getKey()]=!0}manageTilePyramid(t,e,i,n,o,a,h,c,d){const f=at(e);f in t.wantedTiles||(t.wantedTiles[f]={});const _=t.wantedTiles[f],m=t.tileQueue,v=i.getMinZoom(),y=t.viewState.rotation,E=y?Sa(t.viewState.center,t.viewState.resolution,y,t.size):void 0;let b=0,S,w,T,P,M,I;for(I=v;I<=h;++I)for(w=i.getTileRangeForExtentAndZ(a,I,w),T=i.getResolution(I),P=w.minX;P<=w.maxX;++P)for(M=w.minY;M<=w.maxY;++M)y&&!i.tileCoordIntersectsViewport([I,P,M],E)||(h-I<=c?(++b,S=e.getTile(I,P,M,n,o),S.getState()==$.IDLE&&(_[S.getKey()]=!0,m.isKeyQueued(S.getKey())||m.enqueue([S,f,i.getTileCoordCenter(S.tileCoord),T])),d!==void 0&&d(S)):e.useTile(I,P,M,o));e.updateCacheSize(b,o)}}const R0=k0;class M0 extends C0{constructor(t){super(t)}createRenderer(){return new R0(this)}}const I0=M0;class A0{constructor(t){this.rbush_=new kh(t),this.items_={}}insert(t,e){const i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[at(e)]=i}load(t,e){const i=new Array(e.length);for(let n=0,o=e.length;n<o;n++){const a=t[n],h=e[n],c={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:h};i[n]=c,this.items_[at(h)]=c}this.rbush_.load(i)}remove(t){const e=at(t),i=this.items_[e];return delete this.items_[e],this.rbush_.remove(i)!==null}update(t,e){const i=this.items_[at(e)],n=[i.minX,i.minY,i.maxX,i.maxY];Pn(n,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(n){return n.value})}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,e){return this.forEach_(this.getInExtent(t),e)}forEach_(t,e){let i;for(let n=0,o=t.length;n<o;n++)if(i=e(t[n]),i)return i;return i}isEmpty(){return bn(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const e=this.rbush_.toJSON();return Ei(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 Id=A0;function D0(r,t){return[[-1/0,-1/0,1/0,1/0]]}let O0=!1;function F0(r,t,e,i,n,o,a){const h=new XMLHttpRequest;h.open("GET",typeof r=="function"?r(e,i,n):r,!0),t.getType()=="arraybuffer"&&(h.responseType="arraybuffer"),h.withCredentials=O0,h.onload=function(c){if(!h.status||h.status>=200&&h.status<300){const d=t.getType();let f;d=="json"||d=="text"?f=h.responseText:d=="xml"?(f=h.responseXML,f||(f=new DOMParser().parseFromString(h.responseText,"application/xml"))):d=="arraybuffer"&&(f=h.response),f?o(t.readFeatures(f,{extent:e,featureProjection:n}),t.readProjection(f)):a()}else a()},h.onerror=a,h.send()}function Ad(r,t){return function(e,i,n,o,a){const h=this;F0(r,t,e,i,n,function(c,d){h.addFeatures(c),o!==void 0&&o(c)},a||wn)}}class Ri extends Qe{constructor(t,e,i){super(t),this.feature=e,this.features=i}}class z0 extends Cd{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_=wn,this.format_=t.format,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&&(ft(this.format_,"`format` must be set when `url` is set"),this.loader_=Ad(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:D0;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new Id:null,this.loadedExtentsRtree_=new Id,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,n;Array.isArray(t.features)?n=t.features:t.features&&(i=t.features,n=i.getArray()),!e&&i===void 0&&(i=new Be(n)),n!==void 0&&this.addFeaturesInternal(n),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=at(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const i=t.getGeometry();if(i){const n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Ri(ee.ADDFEATURE,t))}setupChangeEvents_(t,e){this.featureChangeKeys_[t]=[ht(e,rt.CHANGE,this.handleFeatureChange_,this),ht(e,En.PROPERTYCHANGE,this.handleFeatureChange_,this)]}addToIndex_(t,e){let i=!0;const n=e.getId();return n!==void 0&&(n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e),i&&(ft(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),i}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],i=[],n=[];for(let o=0,a=t.length;o<a;o++){const h=t[o],c=at(h);this.addToIndex_(c,h)&&i.push(h)}for(let o=0,a=i.length;o<a;o++){const h=i[o],c=at(h);this.setupChangeEvents_(c,h);const d=h.getGeometry();if(d){const f=d.getExtent();e.push(f),n.push(h)}else this.nullGeometryFeatures_[c]=h}if(this.featuresRtree_&&this.featuresRtree_.load(e,n),this.hasListener(ee.ADDFEATURE))for(let o=0,a=i.length;o<a;o++)this.dispatchEvent(new Ri(ee.ADDFEATURE,i[o]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener(ee.ADDFEATURE,function(i){e||(e=!0,t.push(i.feature),e=!1)}),this.addEventListener(ee.REMOVEFEATURE,function(i){e||(e=!0,t.remove(i.feature),e=!1)}),t.addEventListener(oe.ADD,i=>{e||(e=!0,this.addFeature(i.element),e=!1)}),t.addEventListener(oe.REMOVE,i=>{e||(e=!0,this.removeFeature(i.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(wt);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const i=n=>{this.removeFeatureInternal(n)};this.featuresRtree_.forEach(i);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 Ri(ee.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 i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,function(n){if(n.getGeometry().intersectsCoordinate(t))return e(n)})}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(i){if(i.getGeometry().intersectsExtent(t)){const o=e(i);if(o)return o}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),bn(this.nullGeometryFeatures_)||ti(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(i){e.push(i)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const n=Jp(t,e);return[].concat(...n.map(o=>this.featuresRtree_.getInExtent(o)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const i=t[0],n=t[1];let o=null;const a=[NaN,NaN];let h=1/0;const c=[-1/0,-1/0,1/0,1/0];return e=e||_r,this.featuresRtree_.forEachInExtent(c,function(d){if(e(d)){const f=d.getGeometry(),_=h;if(h=f.closestPointXY(i,n,a,h),h<_){o=d;const m=Math.sqrt(h);c[0]=i-m,c[1]=n-m,c[2]=i+m,c[3]=n+m}}}),o}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,i=at(e),n=e.getGeometry();if(!n)i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);else{const a=n.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(a,e)):this.featuresRtree_&&this.featuresRtree_.update(a,e)}const o=e.getId();if(o!==void 0){const a=o.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Ri(ee.CHANGEFEATURE,e))}hasFeature(t){const e=t.getId();return e!==void 0?e in this.idIndex_:at(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&bn(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(t,e,i){const n=this.loadedExtentsRtree_,o=this.strategy_(t,e,i);for(let a=0,h=o.length;a<h;++a){const c=o[a];n.forEachInExtent(c,function(f){return Yi(f.extent,c)})||(++this.loadingExtentsCount_,this.dispatchEvent(new Ri(ee.FEATURESLOADSTART)),this.loader_.call(this,c,e,i,f=>{--this.loadingExtentsCount_,this.dispatchEvent(new Ri(ee.FEATURESLOADEND,void 0,f))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Ri(ee.FEATURESLOADERROR))}),n.insert(c,{extent:c.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_;let i;e.forEachInExtent(t,function(n){if(Pn(n.extent,t))return i=n,!0}),i&&e.remove(i)}removeFeature(t){if(!t)return;const e=at(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=at(t),i=this.featureChangeKeys_[e];if(!i)return;i.forEach(wt),delete this.featureChangeKeys_[e];const n=t.getId();return n!==void 0&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Ri(ee.REMOVEFEATURE,t)),t}removeFromIdIndex_(t){let e=!1;for(const i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e}setLoader(t){this.loader_=t}setUrl(t){ft(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(Ad(t,this.format_))}}const vo=z0;class Dl extends be{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 Dl(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const i=this.getStyle();return i&&t.setStyle(i),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_&&(wt(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=ht(t,rt.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?N0(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 N0(r){if(typeof r=="function")return r;let t;return Array.isArray(r)?t=r:(ft(typeof r.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[r]),function(){return t}}const B0=Dl;class xo extends iu{constructor(t){super(),this.geometries_=t||null,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(wt),this.changeEventsKeys_.length=0}listenGeometriesChange_(){if(this.geometries_)for(let t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(ht(this.geometries_[t],rt.CHANGE,this.changed,this))}clone(){const t=new xo(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<Xi(this.getExtent(),t,e))return n;const o=this.geometries_;for(let a=0,h=o.length;a<h;++a)n=o[a].closestPointXY(t,e,i,n);return n}containsXY(t,e){const i=this.geometries_;for(let n=0,o=i.length;n<o;++n)if(i[n].containsXY(t,e))return!0;return!1}computeExtent(t){yr(t);const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)Sc(t,e[i].getExtent());return t}getGeometries(){return Dd(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[];const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);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=[],i=this.geometries_;let n=!1;for(let o=0,a=i.length;o<a;++o){const h=i[o],c=h.getSimplifiedGeometry(t);e.push(c),c!==h&&(n=!0)}if(n){const o=new xo(null);return o.setGeometriesArray(e),o}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this}getType(){return"GeometryCollection"}intersectsExtent(t){const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)if(e[i].intersectsExtent(t))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(t,e){const i=this.geometries_;for(let n=0,o=i.length;n<o;++n)i[n].rotate(t,e);this.changed()}scale(t,e,i){i||(i=Ki(this.getExtent()));const n=this.geometries_;for(let o=0,a=n.length;o<a;++o)n[o].scale(t,e,i);this.changed()}setGeometries(t){this.setGeometriesArray(Dd(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)e[i].applyTransform(t);this.changed()}translate(t,e){const i=this.geometries_;for(let n=0,o=i.length;n<o;++n)i[n].translate(t,e);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function Dd(r){const t=[];for(let e=0,i=r.length;e<i;++e)t.push(r[e].clone());return t}const G0=xo;class U0{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let i=e.dataProjection?Gt(e.dataProjection):this.readProjection(t);e.extent&&i&&i.getUnits()==="tile-pixels"&&(i=Gt(i),i.setWorldExtent(e.extent)),e={dataProjection:i,featureProjection:e.featureProjection}}return this.adaptOptions(e)}adaptOptions(t){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)}getType(){return it()}readFeature(t,e){return it()}readFeatures(t,e){return it()}readGeometry(t,e){return it()}readProjection(t){return it()}writeFeature(t,e){return it()}writeFeatures(t,e){return it()}writeGeometry(t,e){return it()}}function Od(r,t,e){const i=e?Gt(e.featureProjection):null,n=e?Gt(e.dataProjection):null;let o;if(i&&n&&!Ji(i,n)?o=(t?r.clone():r).transform(t?i:n,t?n:i):o=r,t&&e&&e.decimals!==void 0){const a=Math.pow(10,e.decimals),h=function(c){for(let d=0,f=c.length;d<f;++d)c[d]=Math.round(c[d]*a)/a;return c};o===r&&(o=r.clone()),o.applyTransform(h)}return o}class Z0 extends U0{constructor(){super()}getType(){return"json"}readFeature(t,e){return this.readFeatureFromObject(Eo(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(Eo(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return it()}readFeaturesFromObject(t,e){return it()}readGeometry(t,e){return this.readGeometryFromObject(Eo(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return it()}readProjection(t){return this.readProjectionFromObject(Eo(t))}readProjectionFromObject(t){return it()}writeFeature(t,e){return JSON.stringify(this.writeFeatureObject(t,e))}writeFeatureObject(t,e){return it()}writeFeatures(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))}writeFeaturesObject(t,e){return it()}writeGeometry(t,e){return JSON.stringify(this.writeGeometryObject(t,e))}writeGeometryObject(t,e){return it()}}function Eo(r){if(typeof r=="string"){const t=JSON.parse(r);return t||null}return r!==null?r:null}const j0=Z0;function Fd(r,t,e,i,n,o,a){let h,c;const d=(e-t)/i;if(d===1)h=t;else if(d===2)h=t,c=n;else if(d!==0){let f=r[t],_=r[t+1],m=0;const v=[0];for(let b=t+i;b<e;b+=i){const S=r[b],w=r[b+1];m+=Math.sqrt((S-f)*(S-f)+(w-_)*(w-_)),v.push(m),f=S,_=w}const y=n*m,E=Pp(v,y);E<0?(c=(y-v[-E-2])/(v[-E-1]-v[-E-2]),h=t+(-E-2)*i):h=t+E*i}a=a>1?a:2,o=o||new Array(a);for(let f=0;f<a;++f)o[f]=h===void 0?NaN:c===void 0?r[h+f]:_e(r[h+f],r[h+i+f],c);return o}function Ol(r,t,e,i,n,o){if(e==t)return null;let a;if(n<r[t+i-1])return o?(a=r.slice(t,t+i),a[i-1]=n,a):null;if(r[e-1]<n)return o?(a=r.slice(e-i,e),a[i-1]=n,a):null;if(n==r[t+i-1])return r.slice(t,t+i);let h=t/i,c=e/i;for(;h<c;){const m=h+c>>1;n<r[(m+1)*i-1]?c=m:h=m+1}const d=r[h*i-1];if(n==d)return r.slice((h-1)*i,(h-1)*i+i);const f=r[(h+1)*i-1],_=(n-d)/(f-d);a=[];for(let m=0;m<i-1;++m)a.push(_e(r[(h-1)*i+m],r[h*i+m],_));return a.push(n),a}function W0(r,t,e,i,n,o,a){if(a)return Ol(r,t,e[e.length-1],i,n,o);let h;if(n<r[i-1])return o?(h=r.slice(0,i),h[i-1]=n,h):null;if(r[r.length-1]<n)return o?(h=r.slice(r.length-i),h[i-1]=n,h):null;for(let c=0,d=e.length;c<d;++c){const f=e[c];if(t!=f){if(n<r[t+i-1])return null;if(n<=r[f-1])return Ol(r,t,f,i,n,!1);t=f}}return null}function zd(r,t,e,i){let n=r[t],o=r[t+1],a=0;for(let h=t+i;h<e;h+=i){const c=r[h],d=r[h+1];a+=Math.sqrt((c-n)*(c-n)+(d-o)*(d-o)),n=c,o=d}return a}class wo extends en{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){this.flatCoordinates?ti(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()}clone(){const t=new wo(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Xi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ba(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,n))}forEachSegment(t){return cu(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,Ol(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return Li(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return Fd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return zd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const e=[];return e.length=Wa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new wo(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return Ws(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Us(this.flatCoordinates,0,t,this.stride),this.changed()}}const Fl=wo;class Lo extends en{constructor(t,e,i){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(e!==void 0&&i)this.setFlatCoordinates(e,t),this.ends_=i;else{let n=this.getLayout();const o=t,a=[],h=[];for(let c=0,d=o.length;c<d;++c){const f=o[c];c===0&&(n=f.getLayout()),ti(a,f.getFlatCoordinates()),h.push(a.length)}this.setFlatCoordinates(n,a),this.ends_=h}}appendLineString(t){this.flatCoordinates?ti(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new Lo(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Xi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ga(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Za(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,n))}getCoordinateAtM(t,e,i){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(e=e!==void 0?e:!1,i=i!==void 0?i:!1,W0(this.flatCoordinates,0,this.ends_,this.stride,t,e,i))}getCoordinates(){return Er(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new Fl(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLineStrings(){const t=this.flatCoordinates,e=this.ends_,i=this.layout,n=[];let o=0;for(let a=0,h=e.length;a<h;++a){const c=e[a],d=new Fl(t.slice(o,c),i);n.push(d),o=c}return n}getFlatMidpoints(){const t=[],e=this.flatCoordinates;let i=0;const n=this.ends_,o=this.stride;for(let a=0,h=n.length;a<h;++a){const c=n[a],d=Fd(e,i,c,o,.5);ti(t,d),i=c}return t}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=Om(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,i),new Lo(e,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(t){return Zm(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=ja(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}const H0=Lo;class zl extends en{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){this.flatCoordinates?ti(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()}clone(){const t=new zl(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<Xi(this.getExtent(),t,e))return n;const o=this.flatCoordinates,a=this.stride;for(let h=0,c=o.length;h<c;h+=a){const d=$i(t,e,o[h],o[h+1]);if(d<n){n=d;for(let f=0;f<a;++f)i[f]=o[h+f];i.length=a}}return n}getCoordinates(){return Li(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new js(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){const t=this.flatCoordinates,e=this.layout,i=this.stride,n=[];for(let o=0,a=t.length;o<a;o+=i){const h=new js(t.slice(o,o+i),e);n.push(h)}return n}getType(){return"MultiPoint"}intersectsExtent(t){const e=this.flatCoordinates,i=this.stride;for(let n=0,o=e.length;n<o;n+=i){const a=e[n],h=e[n+1];if(La(t,a,h))return!0}return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Us(this.flatCoordinates,0,t,this.stride),this.changed()}}const Nd=zl;function V0(r,t,e,i){const n=[];let o=ge();for(let a=0,h=e.length;a<h;++a){const c=e[a];o=Cc(r,t,c[0],i),n.push((o[0]+o[2])/2,(o[1]+o[3])/2),t=c[c.length-1]}return n}class bo extends en{constructor(t,e,i){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(t[0])){let n=this.getLayout();const o=t,a=[],h=[];for(let c=0,d=o.length;c<d;++c){const f=o[c];c===0&&(n=f.getLayout());const _=a.length,m=f.getEnds();for(let v=0,y=m.length;v<y;++v)m[v]+=_;ti(a,f.getFlatCoordinates()),h.push(m)}e=n,t=a,i=h}e!==void 0&&i?(this.setFlatCoordinates(e,t),this.endss_=i):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 i=this.flatCoordinates.length;ti(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(let n=0,o=e.length;n<o;++n)e[n]+=i}this.endss_.push(e),this.changed()}clone(){const t=this.endss_.length,e=new Array(t);for(let n=0;n<t;++n)e[n]=this.endss_[n].slice();const i=new bo(this.flatCoordinates.slice(),this.layout,e);return i.applyProperties(this),i}closestPointXY(t,e,i,n){return n<Xi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Mm(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Im(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return Gm(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return Nm(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),_u(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,Ha(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=V0(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Um(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Nd(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;Hm(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=_u(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=zm(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,i),new bo(e,"XY",i)}getPolygon(t){if(t<0||this.endss_.length<=t)return null;let e;if(t===0)e=0;else{const o=this.endss_[t-1];e=o[o.length-1]}const i=this.endss_[t].slice(),n=i[i.length-1];if(e!==0)for(let o=0,a=i.length;o<a;++o)i[o]-=e;return new Hs(this.flatCoordinates.slice(e,n),this.layout,i)}getPolygons(){const t=this.layout,e=this.flatCoordinates,i=this.endss_,n=[];let o=0;for(let a=0,h=i.length;a<h;++a){const c=i[a].slice(),d=c[c.length-1];if(o!==0)for(let _=0,m=c.length;_<m;++_)c[_]-=o;const f=new Hs(e.slice(o,d),t,c);n.push(f),o=d}return n}getType(){return"MultiPolygon"}intersectsExtent(t){return jm(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=Dm(this.flatCoordinates,0,t,this.stride,this.endss_);if(i.length===0)this.flatCoordinates.length=0;else{const n=i[i.length-1];this.flatCoordinates.length=n.length===0?0:n[n.length-1]}this.changed()}}const X0=bo;class Y0 extends j0{constructor(t){t=t||{},super(),this.dataProjection=Gt(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=Gt(t.featureProjection)),this.geometryName_=t.geometryName,this.extractGeometryName_=t.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(t,e){let i=null;t.type==="Feature"?i=t:i={type:"Feature",geometry:t,properties:null};const n=Nl(i.geometry,e),o=new B0;return this.geometryName_?o.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&o.setGeometryName(i.geometry_name),o.setGeometry(n),"id"in i&&o.setId(i.id),i.properties&&o.setProperties(i.properties,!0),o}readFeaturesFromObject(t,e){const i=t;let n=null;if(i.type==="FeatureCollection"){const o=t;n=[];const a=o.features;for(let h=0,c=a.length;h<c;++h)n.push(this.readFeatureFromObject(a[h],e))}else n=[this.readFeatureFromObject(t,e)];return n}readGeometryFromObject(t,e){return Nl(t,e)}readProjectionFromObject(t){const e=t.crs;let i;if(e)if(e.type=="name")i=Gt(e.properties.name);else if(e.type==="EPSG")i=Gt("EPSG:"+e.properties.code);else throw new Error("Unknown SRS type");else i=this.dataProjection;return i}writeFeatureObject(t,e){e=this.adaptOptions(e);const i={type:"Feature",geometry:null,properties:null},n=t.getId();if(n!==void 0&&(i.id=n),!t.hasProperties())return i;const o=t.getProperties(),a=t.getGeometry();return a&&(i.geometry=Bl(a,e),delete o[t.getGeometryName()]),bn(o)||(i.properties=o),i}writeFeaturesObject(t,e){e=this.adaptOptions(e);const i=[];for(let n=0,o=t.length;n<o;++n)i.push(this.writeFeatureObject(t[n],e));return{type:"FeatureCollection",features:i}}writeGeometryObject(t,e){return Bl(t,this.adaptOptions(e))}}function Nl(r,t){if(!r)return null;let e;switch(r.type){case"Point":{e=q0(r);break}case"LineString":{e=$0(r);break}case"Polygon":{e=eE(r);break}case"MultiPoint":{e=Q0(r);break}case"MultiLineString":{e=J0(r);break}case"MultiPolygon":{e=tE(r);break}case"GeometryCollection":{e=K0(r);break}default:throw new Error("Unsupported GeoJSON type: "+r.type)}return Od(e,!1,t)}function K0(r,t){const e=r.geometries.map(function(i){return Nl(i,t)});return new G0(e)}function q0(r){return new js(r.coordinates)}function $0(r){return new Fl(r.coordinates)}function J0(r){return new H0(r.coordinates)}function Q0(r){return new Nd(r.coordinates)}function tE(r){return new X0(r.coordinates)}function eE(r){return new Hs(r.coordinates)}function Bl(r,t){r=Od(r,!0,t);const e=r.getType();let i;switch(e){case"Point":{i=aE(r);break}case"LineString":{i=nE(r);break}case"Polygon":{i=lE(r,t);break}case"MultiPoint":{i=sE(r);break}case"MultiLineString":{i=rE(r);break}case"MultiPolygon":{i=oE(r,t);break}case"GeometryCollection":{i=iE(r,t);break}case"Circle":{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+e)}return i}function iE(r,t){return t=Object.assign({},t),delete t.featureProjection,{type:"GeometryCollection",geometries:r.getGeometriesArray().map(function(i){return Bl(i,t)})}}function nE(r,t){return{type:"LineString",coordinates:r.getCoordinates()}}function rE(r,t){return{type:"MultiLineString",coordinates:r.getCoordinates()}}function sE(r,t){return{type:"MultiPoint",coordinates:r.getCoordinates()}}function oE(r,t){let e;return t&&(e=t.rightHanded),{type:"MultiPolygon",coordinates:r.getCoordinates(e)}}function aE(r,t){return{type:"Point",coordinates:r.getCoordinates()}}function lE(r,t){let e;return t&&(e=t.rightHanded),{type:"Polygon",coordinates:r.getCoordinates(e)}}const To=Y0,Br={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},Co=[Br.FILL],Mi=[Br.STROKE],ln=[Br.BEGIN_PATH],Bd=[Br.CLOSE_PATH],tt=Br;class hE{drawCustom(t,e,i,n){}drawGeometry(t){}setStyle(t){}drawCircle(t,e){}drawFeature(t,e){}drawGeometryCollection(t,e){}drawLineString(t,e){}drawMultiLineString(t,e){}drawMultiPoint(t,e){}drawMultiPolygon(t,e){}drawPoint(t,e){}drawPolygon(t,e){}drawText(t,e){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}const Gd=hE;class cE extends Gd{constructor(t,e,i,n){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=n,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const e=this.pixelRatio;return e==1?t:t.map(function(i){return i*e})}appendFlatPointCoordinates(t,e){const i=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,o=this.coordinates;let a=o.length;for(let h=0,c=t.length;h<c;h+=e)n[0]=t[h],n[1]=t[h+1],Rs(i,n)&&(o[a++]=n[0],o[a++]=n[1]);return a}appendFlatLineCoordinates(t,e,i,n,o,a){const h=this.coordinates;let c=h.length;const d=this.getBufferedMaxExtent();a&&(e+=n);let f=t[e],_=t[e+1];const m=this.tmpCoordinate_;let v=!0,y,E,b;for(y=e+n;y<i;y+=n)m[0]=t[y],m[1]=t[y+1],b=ba(d,m),b!==E?(v&&(h[c++]=f,h[c++]=_,v=!1),h[c++]=m[0],h[c++]=m[1]):b===Zt.INTERSECTING?(h[c++]=m[0],h[c++]=m[1],v=!1):v=!0,f=m[0],_=m[1],E=b;return(o&&v||y===e+n)&&(h[c++]=f,h[c++]=_),c}drawCustomCoordinates_(t,e,i,n,o){for(let a=0,h=i.length;a<h;++a){const c=i[a],d=this.appendFlatLineCoordinates(t,e,c,n,!1,!1);o.push(d),e=c}return e}drawCustom(t,e,i,n){this.beginGeometry(t,e);const o=t.getType(),a=t.getStride(),h=this.coordinates.length;let c,d,f,_,m;switch(o){case"MultiPolygon":c=t.getOrientedFlatCoordinates(),_=[];const v=t.getEndss();m=0;for(let y=0,E=v.length;y<E;++y){const b=[];m=this.drawCustomCoordinates_(c,m,v[y],a,b),_.push(b)}this.instructions.push([tt.CUSTOM,h,_,t,i,Ha]),this.hitDetectionInstructions.push([tt.CUSTOM,h,_,t,n||i,Ha]);break;case"Polygon":case"MultiLineString":f=[],c=o=="Polygon"?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),m=this.drawCustomCoordinates_(c,0,t.getEnds(),a,f),this.instructions.push([tt.CUSTOM,h,f,t,i,Er]),this.hitDetectionInstructions.push([tt.CUSTOM,h,f,t,n||i,Er]);break;case"LineString":case"Circle":c=t.getFlatCoordinates(),d=this.appendFlatLineCoordinates(c,0,c.length,a,!1,!1),this.instructions.push([tt.CUSTOM,h,d,t,i,Li]),this.hitDetectionInstructions.push([tt.CUSTOM,h,d,t,n||i,Li]);break;case"MultiPoint":c=t.getFlatCoordinates(),d=this.appendFlatPointCoordinates(c,a),d>h&&(this.instructions.push([tt.CUSTOM,h,d,t,i,Li]),this.hitDetectionInstructions.push([tt.CUSTOM,h,d,t,n||i,Li]));break;case"Point":c=t.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),d=this.coordinates.length,this.instructions.push([tt.CUSTOM,h,d,t,i]),this.hitDetectionInstructions.push([tt.CUSTOM,h,d,t,n||i]);break}this.endGeometry(e)}beginGeometry(t,e){this.beginGeometryInstruction1_=[tt.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[tt.BEGIN_GEOMETRY,e,0,t],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 i=t.length;let n,o,a=-1;for(e=0;e<i;++e)n=t[e],o=n[0],o==tt.END_GEOMETRY?a=e:o==tt.BEGIN_GEOMETRY&&(n[2]=e,kp(this.hitDetectionInstructions,a,e),a=-1)}setFillStrokeStyle(t,e){const i=this.state;if(t){const n=t.getColor();i.fillStyle=Ge(n||ae)}else i.fillStyle=void 0;if(e){const n=e.getColor();i.strokeStyle=Ge(n||Sr);const o=e.getLineCap();i.lineCap=o!==void 0?o:Mn;const a=e.getLineDash();i.lineDash=a?a.slice():ni;const h=e.getLineDashOffset();i.lineDashOffset=h||ri;const c=e.getLineJoin();i.lineJoin=c!==void 0?c:In;const d=e.getWidth();i.lineWidth=d!==void 0?d:kr;const f=e.getMiterLimit();i.miterLimit=f!==void 0?f:Cr,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(t){const e=t.fillStyle,i=[tt.SET_FILL_STYLE,e];return typeof e!="string"&&i.push(!0),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[tt.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const i=t.fillStyle;(typeof i!="string"||t.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){const i=t.strokeStyle,n=t.lineCap,o=t.lineDash,a=t.lineDashOffset,h=t.lineJoin,c=t.lineWidth,d=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||o!=t.currentLineDash&&!ei(t.currentLineDash,o)||t.currentLineDashOffset!=a||t.currentLineJoin!=h||t.currentLineWidth!=c||t.currentMiterLimit!=d)&&(i!==void 0&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=o,t.currentLineDashOffset=a,t.currentLineJoin=h,t.currentLineWidth=c,t.currentMiterLimit=d)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[tt.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Tc(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;ks(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}const Gr=cE;class uE extends Gr{constructor(t,e,i,n){super(t,e,i,n),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){if(!this.image_)return;this.beginGeometry(t,e);const i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(i,n);this.instructions.push([tt.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([tt.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){if(!this.image_)return;this.beginGeometry(t,e);const i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(i,n);this.instructions.push([tt.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([tt.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 i=t.getAnchor(),n=t.getSize(),o=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=o[0],this.originY_=o[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const dE=uE;class fE extends Gr{constructor(t,e,i,n){super(t,e,i,n)}drawFlatCoordinates_(t,e,i,n){const o=this.coordinates.length,a=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),h=[tt.MOVE_TO_LINE_TO,o,a];return this.instructions.push(h),this.hitDetectionInstructions.push(h),i}drawLineString(t,e){const i=this.state,n=i.strokeStyle,o=i.lineWidth;if(n===void 0||o===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([tt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ni,ri],ln);const a=t.getFlatCoordinates(),h=t.getStride();this.drawFlatCoordinates_(a,0,a.length,h),this.hitDetectionInstructions.push(Mi),this.endGeometry(e)}drawMultiLineString(t,e){const i=this.state,n=i.strokeStyle,o=i.lineWidth;if(n===void 0||o===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([tt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ni,ri],ln);const a=t.getEnds(),h=t.getFlatCoordinates(),c=t.getStride();let d=0;for(let f=0,_=a.length;f<_;++f)d=this.drawFlatCoordinates_(h,d,a[f],c);this.hitDetectionInstructions.push(Mi),this.endGeometry(e)}finish(){const t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(Mi),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(Mi),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(ln)}}const gE=fE;class _E extends Gr{constructor(t,e,i,n){super(t,e,i,n)}drawFlatCoordinatess_(t,e,i,n){const o=this.state,a=o.fillStyle!==void 0,h=o.strokeStyle!==void 0,c=i.length;this.instructions.push(ln),this.hitDetectionInstructions.push(ln);for(let d=0;d<c;++d){const f=i[d],_=this.coordinates.length,m=this.appendFlatLineCoordinates(t,e,f,n,!0,!h),v=[tt.MOVE_TO_LINE_TO,_,m];this.instructions.push(v),this.hitDetectionInstructions.push(v),h&&(this.instructions.push(Bd),this.hitDetectionInstructions.push(Bd)),e=f}return a&&(this.instructions.push(Co),this.hitDetectionInstructions.push(Co)),h&&(this.instructions.push(Mi),this.hitDetectionInstructions.push(Mi)),e}drawCircle(t,e){const i=this.state,n=i.fillStyle,o=i.strokeStyle;if(n===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([tt.SET_FILL_STYLE,ae]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([tt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ni,ri]);const a=t.getFlatCoordinates(),h=t.getStride(),c=this.coordinates.length;this.appendFlatLineCoordinates(a,0,a.length,h,!1,!1);const d=[tt.CIRCLE,c];this.instructions.push(ln,d),this.hitDetectionInstructions.push(ln,d),i.fillStyle!==void 0&&(this.instructions.push(Co),this.hitDetectionInstructions.push(Co)),i.strokeStyle!==void 0&&(this.instructions.push(Mi),this.hitDetectionInstructions.push(Mi)),this.endGeometry(e)}drawPolygon(t,e){const i=this.state,n=i.fillStyle,o=i.strokeStyle;if(n===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([tt.SET_FILL_STYLE,ae]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([tt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ni,ri]);const a=t.getEnds(),h=t.getOrientedFlatCoordinates(),c=t.getStride();this.drawFlatCoordinatess_(h,0,a,c),this.endGeometry(e)}drawMultiPolygon(t,e){const i=this.state,n=i.fillStyle,o=i.strokeStyle;if(n===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([tt.SET_FILL_STYLE,ae]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([tt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ni,ri]);const a=t.getEndss(),h=t.getOrientedFlatCoordinates(),c=t.getStride();let d=0;for(let f=0,_=a.length;f<_;++f)d=this.drawFlatCoordinatess_(h,d,a[f],c);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(t!==0){const e=this.coordinates;for(let i=0,n=e.length;i<n;++i)e[i]=nn(e[i],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;t.fillStyle!==void 0&&this.updateFillStyle(t,this.createFill),t.strokeStyle!==void 0&&this.updateStrokeStyle(t,this.applyStroke)}}const Ud=_E;function pE(r,t,e,i,n){const o=[];let a=e,h=0,c=t.slice(e,2);for(;h<r&&a+n<i;){const[d,f]=c.slice(-2),_=t[a+n],m=t[a+n+1],v=Math.sqrt((_-d)*(_-d)+(m-f)*(m-f));if(h+=v,h>=r){const y=(r-h+v)/v,E=_e(d,_,y),b=_e(f,m,y);c.push(E,b),o.push(c),c=[E,b],h==r&&(a+=n),h=0}else if(h<r)c.push(t[a+n],t[a+n+1]),a+=n;else{const y=v-h,E=_e(d,_,y/v),b=_e(f,m,y/v);c.push(E,b),o.push(c),c=[E,b],h=0,a+=n}}return h>0&&o.push(c),o}function mE(r,t,e,i,n){let o=e,a=e,h=0,c=0,d=e,f,_,m,v,y,E,b,S,w,T;for(_=e;_<i;_+=n){const P=t[_],M=t[_+1];y!==void 0&&(w=P-y,T=M-E,v=Math.sqrt(w*w+T*T),b!==void 0&&(c+=m,f=Math.acos((b*w+S*T)/(m*v)),f>r&&(c>h&&(h=c,o=d,a=_),c=0,d=_-n)),m=v,b=w,S=T),y=P,E=M}return c+=v,c>h?[d,_]:[o,a]}const So={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class yE extends Gr{constructor(t,e,i,n){super(t,e,i,n),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[ae]={fillStyle:ae},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",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){const i=this.textFillState_,n=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!i&&!n)return;const a=this.coordinates;let h=a.length;const c=t.getType();let d=null,f=t.getStride();if(o.placement==="line"&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!se(this.getBufferedMaxExtent(),t.getExtent()))return;let _;if(d=t.getFlatCoordinates(),c=="LineString")_=[d.length];else if(c=="MultiLineString")_=t.getEnds();else if(c=="Polygon")_=t.getEnds().slice(0,1);else if(c=="MultiPolygon"){const E=t.getEndss();_=[];for(let b=0,S=E.length;b<S;++b)_.push(E[b][0])}this.beginGeometry(t,e);const m=o.repeat,v=m?void 0:o.textAlign;let y=0;for(let E=0,b=_.length;E<b;++E){let S;m?S=pE(m*this.resolution,d,y,_[E],f):S=[d.slice(y,_[E])];for(let w=0,T=S.length;w<T;++w){const P=S[w];let M=0,I=P.length;if(v==null){const z=mE(o.maxAngle,P,0,P.length,2);M=z[0],I=z[1]}for(let z=M;z<I;z+=f)a.push(P[z],P[z+1]);const D=a.length;y=_[E],this.drawChars_(h,D),h=D}}this.endGeometry(e)}else{let _=o.overflow?null:[];switch(c){case"Point":case"MultiPoint":d=t.getFlatCoordinates();break;case"LineString":d=t.getFlatMidpoint();break;case"Circle":d=t.getCenter();break;case"MultiLineString":d=t.getFlatMidpoints(),f=2;break;case"Polygon":d=t.getFlatInteriorPoint(),o.overflow||_.push(d[2]/this.resolution),f=3;break;case"MultiPolygon":const S=t.getFlatInteriorPoints();d=[];for(let w=0,T=S.length;w<T;w+=3)o.overflow||_.push(S[w+2]/this.resolution),d.push(S[w],S[w+1]);if(d.length===0)return;f=2;break}const m=this.appendFlatPointCoordinates(d,f);if(m===h)return;if(_&&(m-h)/2!==d.length/f){let S=h/2;_=_.filter((w,T)=>{const P=a[(S+T)*2]===d[T*f]&&a[(S+T)*2+1]===d[T*f+1];return P||--S,P})}this.saveTextStates_(),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&this.updateFillStyle(this.state,this.createFill),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);let v=o.padding;if(v!=sn&&(o.scale[0]<0||o.scale[1]<0)){let S=o.padding[0],w=o.padding[1],T=o.padding[2],P=o.padding[3];o.scale[0]<0&&(w=-w,P=-P),o.scale[1]<0&&(S=-S,T=-T),v=[S,w,T,P]}const y=this.pixelRatio;this.instructions.push([tt.DRAW_IMAGE,h,m,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,v==sn?sn:v.map(function(S){return S*y}),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,_]);const E=1/y,b=this.state.fillStyle;o.backgroundFill&&(this.state.fillStyle=ae,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([tt.DRAW_IMAGE,h,m,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[E,E],NaN,void 0,this.declutterImageWithText_,v,!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?ae:this.fillKey_,this.textOffsetX_,this.textOffsetY_,_]),o.backgroundFill&&(this.state.fillStyle=b,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,n=this.strokeKey_;t&&(n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const o=this.textKey_;o in this.textStates||(this.textStates[o]={font:e.font,textAlign:e.textAlign||Pr,justify:e.justify,textBaseline:e.textBaseline||eo,scale:e.scale});const a=this.fillKey_;i&&(a in this.fillStates||(this.fillStates[a]={fillStyle:i.fillStyle}))}drawChars_(t,e){const i=this.textStrokeState_,n=this.textState_,o=this.strokeKey_,a=this.textKey_,h=this.fillKey_;this.saveTextStates_();const c=this.pixelRatio,d=So[n.textBaseline],f=this.textOffsetY_*c,_=this.text_,m=i?i.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([tt.DRAW_CHARS,t,e,d,n.overflow,h,n.maxAngle,c,f,o,m*c,_,a,1]),this.hitDetectionInstructions.push([tt.DRAW_CHARS,t,e,d,n.overflow,h&&ae,n.maxAngle,c,f,o,m*c,_,a,1/c])}setTextStyle(t,e){let i,n,o;if(!t)this.text_="";else{const a=t.getFill();a?(n=this.textFillState_,n||(n={},this.textFillState_=n),n.fillStyle=Ge(a.getColor()||ae)):(n=null,this.textFillState_=n);const h=t.getStroke();if(!h)o=null,this.textStrokeState_=o;else{o=this.textStrokeState_,o||(o={},this.textStrokeState_=o);const y=h.getLineDash(),E=h.getLineDashOffset(),b=h.getWidth(),S=h.getMiterLimit();o.lineCap=h.getLineCap()||Mn,o.lineDash=y?y.slice():ni,o.lineDashOffset=E===void 0?ri:E,o.lineJoin=h.getLineJoin()||In,o.lineWidth=b===void 0?kr:b,o.miterLimit=S===void 0?Cr:S,o.strokeStyle=Ge(h.getColor()||Sr)}i=this.textState_;const c=t.getFont()||Pu;_y(c);const d=t.getScaleArray();i.overflow=t.getOverflow(),i.font=c,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.repeat=t.getRepeat(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||eo,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||sn,i.scale=d===void 0?[1,1]:d;const f=t.getOffsetX(),_=t.getOffsetY(),m=t.getRotateWithView(),v=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=f===void 0?0:f,this.textOffsetY_=_===void 0?0:_,this.textRotateWithView_=m===void 0?!1:m,this.textRotation_=v===void 0?0:v,this.strokeKey_=o?(typeof o.strokeStyle=="string"?o.strokeStyle:at(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=n?typeof n.fillStyle=="string"?n.fillStyle:"|"+at(n.fillStyle):""}this.declutterImageWithText_=e}}const vE={Circle:Ud,Default:Gr,Image:dE,LineString:gE,Polygon:Ud,Text:yE};class xE{constructor(t,e,i,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=i,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const i=this.buildersByZIndex_[e];for(const n in i){const o=i[n].finish();t[e][n]=o}}return t}getBuilder(t,e){const i=t!==void 0?t.toString():"0";let n=this.buildersByZIndex_[i];n===void 0&&(n={},this.buildersByZIndex_[i]=n);let o=n[e];if(o===void 0){const a=vE[e];o=new a(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=o}return o}}const Zd=xE;function EE(r,t,e,i,n,o,a,h,c,d,f,_){let m=r[t],v=r[t+1],y=0,E=0,b=0,S=0;function w(){y=m,E=v,t+=i,m=r[t],v=r[t+1],S+=b,b=Math.sqrt((m-y)*(m-y)+(v-E)*(v-E))}do w();while(t<e-i&&S+b<o);let T=b===0?0:(o-S)/b;const P=_e(y,m,T),M=_e(E,v,T),I=t-i,D=S,z=o+h*c(d,n,f);for(;t<e-i&&S+b<z;)w();T=b===0?0:(z-S)/b;const W=_e(y,m,T),K=_e(E,v,T);let Q;if(_){const H=[P,M,W,K];tu(H,0,4,2,_,H,H),Q=H[0]>H[2]}else Q=P>W;const q=Math.PI,ct=[],Et=I+i===t;t=I,b=0,S=D,m=r[t],v=r[t+1];let V;if(Et){w(),V=Math.atan2(v-E,m-y),Q&&(V+=V>0?-q:q);const H=(W+P)/2,Z=(K+M)/2;return ct[0]=[H,Z,(z-o)/2,V,n],ct}n=n.replace(/\n/g," ");for(let H=0,Z=n.length;H<Z;){w();let B=Math.atan2(v-E,m-y);if(Q&&(B+=B>0?-q:q),V!==void 0){let J=B-V;if(J+=J>q?-2*q:J<-q?2*q:0,Math.abs(J)>a)return null}V=B;const yt=H;let U=0;for(;H<Z;++H){const J=Q?Z-H-1:H,Y=h*c(d,n[J],f);if(t+i<e&&S+b<o+U+Y/2)break;U+=Y}if(H===yt)continue;const st=Q?n.substring(Z-yt,Z-H):n.substring(yt,H);T=b===0?0:(o+U/2-S)/b;const F=_e(y,m,T),Lt=_e(E,v,T);ct.push([F,Lt,U/2,B,st]),o+=U}return ct}const Vn=ge(),Ii=[],hi=[],ci=[],Ai=[];function jd(r){return r[3].declutterBox}const Wd=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function Gl(r,t){return t==="start"?t=Wd.test(r)?"right":"left":t==="end"&&(t=Wd.test(r)?"left":"right"),So[t]}function wE(r,t,e){return e>0&&r.push(`
446
- `,""),r.push(t,""),r}class LE{constructor(t,e,i,n){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=Vt(),this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}createLabel(t,e,i,n){const o=t+e+i+n;if(this.labels_[o])return this.labels_[o];const a=n?this.strokeStates[n]:null,h=i?this.fillStates[i]:null,c=this.textStates[e],d=this.pixelRatio,f=[c.scale[0]*d,c.scale[1]*d],_=Array.isArray(t),m=c.justify?So[c.justify]:Gl(Array.isArray(t)?t[0]:t,c.textAlign||Pr),v=n&&a.lineWidth?a.lineWidth:0,y=_?t:t.split(`
447
- `).reduce(wE,[]),{width:E,height:b,widths:S,heights:w,lineWidths:T}=my(c,y),P=E+v,M=[],I=(P+2)*f[0],D=(b+v)*f[1],z={width:I<0?Math.floor(I):Math.ceil(I),height:D<0?Math.floor(D):Math.ceil(D),contextInstructions:M};(f[0]!=1||f[1]!=1)&&M.push("scale",f),n&&(M.push("strokeStyle",a.strokeStyle),M.push("lineWidth",v),M.push("lineCap",a.lineCap),M.push("lineJoin",a.lineJoin),M.push("miterLimit",a.miterLimit),M.push("setLineDash",[a.lineDash]),M.push("lineDashOffset",a.lineDashOffset)),i&&M.push("fillStyle",h.fillStyle),M.push("textBaseline","middle"),M.push("textAlign","center");const W=.5-m;let K=m*P+W*v;const Q=[],q=[];let ct=0,Et=0,V=0,H=0,Z;for(let B=0,yt=y.length;B<yt;B+=2){const U=y[B];if(U===`
448
- `){Et+=ct,ct=0,K=m*P+W*v,++H;continue}const st=y[B+1]||c.font;st!==Z&&(n&&Q.push("font",st),i&&q.push("font",st),Z=st),ct=Math.max(ct,w[V]);const F=[U,K+W*S[V]+m*(S[V]-T[H]),.5*(v+ct)+Et];K+=S[V],n&&Q.push("strokeText",F),i&&q.push("fillText",F),++V}return Array.prototype.push.apply(M,Q),Array.prototype.push.apply(M,q),this.labels_[o]=z,z}replayTextBackground_(t,e,i,n,o,a,h){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,o),t.lineTo.apply(t,e),a&&(this.alignFill_=a[2],this.fill_(t)),h&&(this.setStrokeStyle_(t,h),t.stroke())}calculateImageOrLabelDimensions_(t,e,i,n,o,a,h,c,d,f,_,m,v,y,E,b){h*=m[0],c*=m[1];let S=i-h,w=n-c;const T=o+d>t?t-d:o,P=a+f>e?e-f:a,M=y[3]+T*m[0]+y[1],I=y[0]+P*m[1]+y[2],D=S-y[3],z=w-y[0];(E||_!==0)&&(Ii[0]=D,Ai[0]=D,Ii[1]=z,hi[1]=z,hi[0]=D+M,ci[0]=hi[0],ci[1]=z+I,Ai[1]=ci[1]);let W;return _!==0?(W=ze(Vt(),i,n,1,1,_,-i,-n),Ot(W,Ii),Ot(W,hi),Ot(W,ci),Ot(W,Ai),Ei(Math.min(Ii[0],hi[0],ci[0],Ai[0]),Math.min(Ii[1],hi[1],ci[1],Ai[1]),Math.max(Ii[0],hi[0],ci[0],Ai[0]),Math.max(Ii[1],hi[1],ci[1],Ai[1]),Vn)):Ei(Math.min(D,D+M),Math.min(z,z+I),Math.max(D,D+M),Math.max(z,z+I),Vn),v&&(S=Math.round(S),w=Math.round(w)),{drawImageX:S,drawImageY:w,drawImageW:T,drawImageH:P,originX:d,originY:f,declutterBox:{minX:Vn[0],minY:Vn[1],maxX:Vn[2],maxY:Vn[3],value:b},canvasTransform:W,scale:m}}replayImageOrLabel_(t,e,i,n,o,a,h){const c=!!(a||h),d=n.declutterBox,f=t.canvas,_=h?h[2]*n.scale[0]/2:0;return d.minX-_<=f.width/e&&d.maxX+_>=0&&d.minY-_<=f.height/e&&d.maxY+_>=0&&(c&&this.replayTextBackground_(t,Ii,hi,ci,Ai,a,h),yy(t,n.canvasTransform,o,i,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0}fill_(t){if(this.alignFill_){const e=Ot(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=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,i,n){const o=this.textStates[e],a=this.createLabel(t,e,n,i),h=this.strokeStates[i],c=this.pixelRatio,d=Gl(Array.isArray(t)?t[0]:t,o.textAlign||Pr),f=So[o.textBaseline||eo],_=h&&h.lineWidth?h.lineWidth:0,m=a.width/c-2*o.scale[0],v=d*m+2*(.5-d)*_,y=f*a.height/c+2*(.5-f)*_;return{label:a,anchorX:v,anchorY:y}}execute_(t,e,i,n,o,a,h,c){let d;this.pixelCoordinates_&&ei(i,this.renderedTransform_)?d=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),d=tn(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Em(this.renderedTransform_,i));let f=0;const _=n.length;let m=0,v,y,E,b,S,w,T,P,M,I,D,z,W=0,K=0,Q=null,q=null;const ct=this.coordinateCache_,Et=this.viewRotation_,V=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,H={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:Et},Z=this.instructions!=n||this.overlaps?0:200;let B,yt,U,st;for(;f<_;){const F=n[f];switch(F[0]){case tt.BEGIN_GEOMETRY:B=F[1],st=F[3],B.getGeometry()?h!==void 0&&!se(h,st.getExtent())?f=F[2]+1:++f:f=F[2];break;case tt.BEGIN_PATH:W>Z&&(this.fill_(t),W=0),K>Z&&(t.stroke(),K=0),!W&&!K&&(t.beginPath(),b=NaN,S=NaN),++f;break;case tt.CIRCLE:m=F[1];const J=d[m],Y=d[m+1],nt=d[m+2],Ft=d[m+3],St=nt-J,ve=Ft-Y,je=Math.sqrt(St*St+ve*ve);t.moveTo(J+je,Y),t.arc(J,Y,je,0,2*Math.PI,!0),++f;break;case tt.CLOSE_PATH:t.closePath(),++f;break;case tt.CUSTOM:m=F[1],v=F[2];const Di=F[3],xe=F[4],Oi=F.length==6?F[5]:void 0;H.geometry=Di,H.feature=B,f in ct||(ct[f]=[]);const We=ct[f];Oi?Oi(d,m,v,2,We):(We[0]=d[m],We[1]=d[m+1],We.length=2),xe(We,H),++f;break;case tt.DRAW_IMAGE:m=F[1],v=F[2],P=F[3],y=F[4],E=F[5];let Fi=F[6];const Pe=F[7],zi=F[8],di=F[9],Xn=F[10];let fi=F[11];const hn=F[12];let Xt=F[13];const ie=F[14],me=F[15];if(!P&&F.length>=20){M=F[19],I=F[20],D=F[21],z=F[22];const ne=this.drawLabelWithPointPlacement_(M,I,D,z);P=ne.label,F[3]=P;const Zi=F[23];y=(ne.anchorX-Zi)*this.pixelRatio,F[4]=y;const he=F[24];E=(ne.anchorY-he)*this.pixelRatio,F[5]=E,Fi=P.height,F[6]=Fi,Xt=P.width,F[13]=Xt}let ke;F.length>25&&(ke=F[25]);let He,Ve,Re;F.length>17?(He=F[16],Ve=F[17],Re=F[18]):(He=sn,Ve=!1,Re=!1),Xn&&V?fi+=Et:!Xn&&!V&&(fi-=Et);let Ni=0;for(;m<v;m+=2){if(ke&&ke[Ni++]<Xt/this.pixelRatio)continue;const ne=this.calculateImageOrLabelDimensions_(P.width,P.height,d[m],d[m+1],Xt,Fi,y,E,zi,di,fi,hn,o,He,Ve||Re,B),Zi=[t,e,P,ne,Pe,Ve?Q:null,Re?q:null];if(c){if(ie==="none")continue;if(ie==="obstacle"){c.insert(ne.declutterBox);continue}else{let he,Me;if(me){const Yt=v-m;if(!me[Yt]){me[Yt]=Zi;continue}if(he=me[Yt],delete me[Yt],Me=jd(he),c.collides(Me))continue}if(c.collides(ne.declutterBox))continue;he&&(c.insert(Me),this.replayImageOrLabel_.apply(this,he)),c.insert(ne.declutterBox)}}this.replayImageOrLabel_.apply(this,Zi)}++f;break;case tt.DRAW_CHARS:const cn=F[1],Wt=F[2],Ur=F[3],Po=F[4];z=F[5];const Zr=F[6],jr=F[7],ko=F[8];D=F[9];const gi=F[10];M=F[11],I=F[12];const Ro=[F[13],F[13]],Wr=this.textStates[I],Bi=Wr.font,Gi=[Wr.scale[0]*jr,Wr.scale[1]*jr];let Ui;Bi in this.widths_?Ui=this.widths_[Bi]:(Ui={},this.widths_[Bi]=Ui);const Mo=zd(d,cn,Wt,2),Io=Math.abs(Gi[0])*Ru(Bi,M,Ui);if(Po||Io<=Mo){const ne=this.textStates[I].textAlign,Zi=(Mo-Io)*Gl(M,ne),he=EE(d,cn,Wt,2,M,Zi,Zr,Math.abs(Gi[0]),Ru,Bi,Ui,V?0:this.viewRotation_);t:if(he){const Me=[];let Yt,Yn,Kn,te,ce;if(D)for(Yt=0,Yn=he.length;Yt<Yn;++Yt){ce=he[Yt],Kn=ce[4],te=this.createLabel(Kn,I,"",D),y=ce[2]+(Gi[0]<0?-gi:gi),E=Ur*te.height+(.5-Ur)*2*gi*Gi[1]/Gi[0]-ko;const zt=this.calculateImageOrLabelDimensions_(te.width,te.height,ce[0],ce[1],te.width,te.height,y,E,0,0,ce[3],Ro,!1,sn,!1,B);if(c&&c.collides(zt.declutterBox))break t;Me.push([t,e,te,zt,1,null,null])}if(z)for(Yt=0,Yn=he.length;Yt<Yn;++Yt){ce=he[Yt],Kn=ce[4],te=this.createLabel(Kn,I,z,""),y=ce[2],E=Ur*te.height-ko;const zt=this.calculateImageOrLabelDimensions_(te.width,te.height,ce[0],ce[1],te.width,te.height,y,E,0,0,ce[3],Ro,!1,sn,!1,B);if(c&&c.collides(zt.declutterBox))break t;Me.push([t,e,te,zt,1,null,null])}c&&c.load(Me.map(jd));for(let zt=0,X=Me.length;zt<X;++zt)this.replayImageOrLabel_.apply(this,Me[zt])}}++f;break;case tt.END_GEOMETRY:if(a!==void 0){B=F[1];const ne=a(B,st);if(ne)return ne}++f;break;case tt.FILL:Z?W++:this.fill_(t),++f;break;case tt.MOVE_TO_LINE_TO:for(m=F[1],v=F[2],yt=d[m],U=d[m+1],w=yt+.5|0,T=U+.5|0,(w!==b||T!==S)&&(t.moveTo(yt,U),b=w,S=T),m+=2;m<v;m+=2)yt=d[m],U=d[m+1],w=yt+.5|0,T=U+.5|0,(m==v-2||w!==b||T!==S)&&(t.lineTo(yt,U),b=w,S=T);++f;break;case tt.SET_FILL_STYLE:Q=F,this.alignFill_=F[2],W&&(this.fill_(t),W=0,K&&(t.stroke(),K=0)),t.fillStyle=F[1],++f;break;case tt.SET_STROKE_STYLE:q=F,K&&(t.stroke(),K=0),this.setStrokeStyle_(t,F),++f;break;case tt.STROKE:Z?K++:t.stroke(),++f;break;default:++f;break}}W&&this.fill_(t),K&&t.stroke()}execute(t,e,i,n,o,a){this.viewRotation_=n,this.execute_(t,e,i,this.instructions,o,void 0,void 0,a)}executeHitDetection(t,e,i,n,o){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,n,o)}}const bE=LE,Ul=["Polygon","Circle","LineString","Image","Text","Default"];class TE{constructor(t,e,i,n,o,a){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Vt(),this.createExecutors_(o)}clip(t,e){const i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t){for(const e in t){let i=this.executorsByZIndex_[e];i===void 0&&(i={},this.executorsByZIndex_[e]=i);const n=t[e];for(const o in n){const a=n[o];i[o]=new bE(this.resolution_,this.pixelRatio_,this.overlaps_,a)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const i=this.executorsByZIndex_[e];for(let n=0,o=t.length;n<o;++n)if(t[n]in i)return!0}return!1}forEachFeatureAtCoordinate(t,e,i,n,o,a){n=Math.round(n);const h=n*2+1,c=ze(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-i,-t[0],-t[1]),d=!this.hitDetectionContext_;d&&(this.hitDetectionContext_=$t(h,h,void 0,{willReadFrequently:!0}));const f=this.hitDetectionContext_;f.canvas.width!==h||f.canvas.height!==h?(f.canvas.width=h,f.canvas.height=h):d||f.clearRect(0,0,h,h);let _;this.renderBuffer_!==void 0&&(_=ge(),vr(_,t),ks(_,e*(this.renderBuffer_+n),_));const m=CE(n);let v;function y(M,I){const D=f.getImageData(0,0,h,h).data;for(let z=0,W=m.length;z<W;z++)if(D[m[z]]>0){if(!a||v!=="Image"&&v!=="Text"||a.includes(M)){const K=(m[z]-3)/4,Q=n-K%h,q=n-(K/h|0),ct=o(M,I,Q*Q+q*q);if(ct)return ct}f.clearRect(0,0,h,h);break}}const E=Object.keys(this.executorsByZIndex_).map(Number);E.sort(xi);let b,S,w,T,P;for(b=E.length-1;b>=0;--b){const M=E[b].toString();for(w=this.executorsByZIndex_[M],S=Ul.length-1;S>=0;--S)if(v=Ul[S],T=w[v],T!==void 0&&(P=T.executeHitDetection(f,c,i,y,_),P))return P}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const i=e[0],n=e[1],o=e[2],a=e[3],h=[i,n,i,a,o,a,o,n];return tn(h,0,8,2,t,h),h}isEmpty(){return bn(this.executorsByZIndex_)}execute(t,e,i,n,o,a,h){const c=Object.keys(this.executorsByZIndex_).map(Number);c.sort(xi),this.maxExtent_&&(t.save(),this.clip(t,i)),a=a||Ul;let d,f,_,m,v,y;for(h&&c.reverse(),d=0,f=c.length;d<f;++d){const E=c[d].toString();for(v=this.executorsByZIndex_[E],_=0,m=a.length;_<m;++_){const b=a[_];y=v[b],y!==void 0&&y.execute(t,e,i,n,o,h)}}this.maxExtent_&&t.restore()}}const Zl={};function CE(r){if(Zl[r]!==void 0)return Zl[r];const t=r*2+1,e=r*r,i=new Array(e+1);for(let o=0;o<=r;++o)for(let a=0;a<=r;++a){const h=o*o+a*a;if(h>e)break;let c=i[h];c||(c=[],i[h]=c),c.push(((r+o)*t+(r+a))*4+3),o>0&&c.push(((r-o)*t+(r+a))*4+3),a>0&&(c.push(((r+o)*t+(r-a))*4+3),o>0&&c.push(((r-o)*t+(r-a))*4+3))}const n=[];for(let o=0,a=i.length;o<a;++o)i[o]&&n.push(...i[o]);return Zl[r]=n,n}const Hd=TE;class SE extends Gd{constructor(t,e,i,n,o,a,h){super(),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=n,this.transformRotation_=n?Pa(Math.atan2(n[1],n[0]),10):0,this.viewRotation_=o,this.squaredTolerance_=a,this.userTransform_=h,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_=Vt()}drawImages_(t,e,i,n){if(!this.image_)return;const o=tn(t,e,i,n,this.transform_,this.pixelCoordinates_),a=this.context_,h=this.tmpLocalTransform_,c=a.globalAlpha;this.imageOpacity_!=1&&(a.globalAlpha=c*this.imageOpacity_);let d=this.imageRotation_;this.transformRotation_===0&&(d-=this.viewRotation_),this.imageRotateWithView_&&(d+=this.viewRotation_);for(let f=0,_=o.length;f<_;f+=2){const m=o[f]-this.imageAnchorX_,v=o[f+1]-this.imageAnchorY_;if(d!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const y=m+this.imageAnchorX_,E=v+this.imageAnchorY_;ze(h,y,E,1,1,d,-y,-E),a.save(),a.transform.apply(a,h),a.translate(y,E),a.scale(this.imageScale_[0],this.imageScale_[1]),a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),a.restore()}else a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,m,v,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(a.globalAlpha=c)}drawText_(t,e,i,n){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const o=tn(t,e,i,n,this.transform_,this.pixelCoordinates_),a=this.context_;let h=this.textRotation_;for(this.transformRotation_===0&&(h-=this.viewRotation_),this.textRotateWithView_&&(h+=this.viewRotation_);e<i;e+=n){const c=o[e]+this.textOffsetX_,d=o[e+1]+this.textOffsetY_;h!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(a.save(),a.translate(c-this.textOffsetX_,d-this.textOffsetY_),a.rotate(h),a.translate(this.textOffsetX_,this.textOffsetY_),a.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&a.strokeText(this.text_,0,0),this.textFillState_&&a.fillText(this.text_,0,0),a.restore()):(this.textStrokeState_&&a.strokeText(this.text_,c,d),this.textFillState_&&a.fillText(this.text_,c,d))}}moveToLineTo_(t,e,i,n,o){const a=this.context_,h=tn(t,e,i,n,this.transform_,this.pixelCoordinates_);a.moveTo(h[0],h[1]);let c=h.length;o&&(c-=2);for(let d=2;d<c;d+=2)a.lineTo(h[d],h[d+1]);return o&&a.closePath(),i}drawRings_(t,e,i,n){for(let o=0,a=i.length;o<a;++o)e=this.moveToLineTo_(t,e,i[o],n,!0);return e}drawCircle(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!se(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=Rm(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],n=e[3]-e[1],o=Math.sqrt(i*i+n*n),a=this.context_;a.beginPath(),a.arc(e[0],e[1],o,0,2*Math.PI),this.fillState_&&a.fill(),this.strokeState_&&a.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 i=e.getGeometryFunction()(t);i&&(this.setStyle(e),this.drawGeometry(i))}drawGeometryCollection(t){const e=t.getGeometriesArray();for(let i=0,n=e.length;i<n;++i)this.drawGeometry(e[i])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),this.text_!==""&&this.drawText_(e,0,e.length,i)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),this.text_!==""&&this.drawText_(e,0,e.length,i)}drawLineString(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!se(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.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(se(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const i=this.context_,n=t.getFlatCoordinates();let o=0;const a=t.getEnds(),h=t.getStride();i.beginPath();for(let c=0,d=a.length;c<d;++c)o=this.moveToLineTo_(n,o,a[c],h,!1);i.stroke()}if(this.text_!==""){const i=t.getFlatMidpoints();this.drawText_(i,0,i.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!se(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_)),!!se(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_,i=t.getOrientedFlatCoordinates();let n=0;const o=t.getEndss(),a=t.getStride();e.beginPath();for(let h=0,c=o.length;h<c;++h){const d=o[h];n=this.drawRings_(i,n,d,a)}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_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){const e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),ei(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.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_,i=this.contextTextState_,n=t.textAlign?t.textAlign:Pr;i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=n&&(i.textAlign=n,e.textAlign=n),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(!t)this.fillState_=null;else{const i=t.getColor();this.fillState_={fillStyle:Ge(i||ae)}}if(!e)this.strokeState_=null;else{const i=e.getColor(),n=e.getLineCap(),o=e.getLineDash(),a=e.getLineDashOffset(),h=e.getLineJoin(),c=e.getWidth(),d=e.getMiterLimit(),f=o||ni;this.strokeState_={lineCap:n!==void 0?n:Mn,lineDash:this.pixelRatio_===1?f:f.map(_=>_*this.pixelRatio_),lineDashOffset:(a||ri)*this.pixelRatio_,lineJoin:h!==void 0?h:In,lineWidth:(c!==void 0?c:kr)*this.pixelRatio_,miterLimit:d!==void 0?d:Cr,strokeStyle:Ge(i||Sr)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const i=t.getPixelRatio(this.pixelRatio_),n=t.getAnchor(),o=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*i,this.imageAnchorY_=n[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=o[0],this.imageOriginY_=o[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const a=t.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/i,a[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const v=e.getColor();this.textFillState_={fillStyle:Ge(v||ae)}}const i=t.getStroke();if(!i)this.textStrokeState_=null;else{const v=i.getColor(),y=i.getLineCap(),E=i.getLineDash(),b=i.getLineDashOffset(),S=i.getLineJoin(),w=i.getWidth(),T=i.getMiterLimit();this.textStrokeState_={lineCap:y!==void 0?y:Mn,lineDash:E||ni,lineDashOffset:b||ri,lineJoin:S!==void 0?S:In,lineWidth:w!==void 0?w:kr,miterLimit:T!==void 0?T:Cr,strokeStyle:Ge(v||Sr)}}const n=t.getFont(),o=t.getOffsetX(),a=t.getOffsetY(),h=t.getRotateWithView(),c=t.getRotation(),d=t.getScaleArray(),f=t.getText(),_=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:n!==void 0?n:Pu,textAlign:_!==void 0?_:Pr,textBaseline:m!==void 0?m:eo},this.text_=f!==void 0?Array.isArray(f)?f.reduce((v,y,E)=>v+=E%2?" ":y,""):f:"",this.textOffsetX_=o!==void 0?this.pixelRatio_*o:0,this.textOffsetY_=a!==void 0?this.pixelRatio_*a:0,this.textRotateWithView_=h!==void 0?h:!1,this.textRotation_=c!==void 0?c:0,this.textScale_=[this.pixelRatio_*d[0],this.pixelRatio_*d[1]]}}}const PE=SE,Ze=.5;function kE(r,t,e,i,n,o,a){const h=r[0]*Ze,c=r[1]*Ze,d=$t(h,c);d.imageSmoothingEnabled=!1;const f=d.canvas,_=new PE(d,Ze,n,null,a),m=e.length,v=Math.floor((256*256*256-1)/m),y={};for(let b=1;b<=m;++b){const S=e[b-1],w=S.getStyleFunction()||i;if(!w)continue;let T=w(S,o);if(!T)continue;Array.isArray(T)||(T=[T]);const M=(b*v).toString(16).padStart(7,"#00000");for(let I=0,D=T.length;I<D;++I){const z=T[I],W=z.getGeometryFunction()(S);if(!W||!se(n,W.getExtent()))continue;const K=z.clone(),Q=K.getFill();Q&&Q.setColor(M);const q=K.getStroke();q&&(q.setColor(M),q.setLineDash(null)),K.setText(void 0);const ct=z.getImage();if(ct){const Z=ct.getImageSize();if(!Z)continue;const B=$t(Z[0],Z[1],void 0,{alpha:!1}),yt=B.canvas;B.fillStyle=M,B.fillRect(0,0,yt.width,yt.height),K.setImage(new _l({img:yt,anchor:ct.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:ct.getOrigin(),opacity:1,size:ct.getSize(),scale:ct.getScale(),rotation:ct.getRotation(),rotateWithView:ct.getRotateWithView()}))}const Et=K.getZIndex()||0;let V=y[Et];V||(V={},y[Et]=V,V.Polygon=[],V.Circle=[],V.LineString=[],V.Point=[]);const H=W.getType();if(H==="GeometryCollection"){const Z=W.getGeometriesArrayRecursive();for(let B=0,yt=Z.length;B<yt;++B){const U=Z[B];V[U.getType().replace("Multi","")].push(U,K)}}else V[H.replace("Multi","")].push(W,K)}}const E=Object.keys(y).map(Number).sort(xi);for(let b=0,S=E.length;b<S;++b){const w=y[E[b]];for(const T in w){const P=w[T];for(let M=0,I=P.length;M<I;M+=2){_.setStyle(P[M+1]);for(let D=0,z=t.length;D<z;++D)_.setTransform(t[D]),_.drawGeometry(P[M])}}}return d.getImageData(0,0,f.width,f.height)}function RE(r,t,e){const i=[];if(e){const n=Math.floor(Math.round(r[0])*Ze),o=Math.floor(Math.round(r[1])*Ze),a=(It(n,0,e.width-1)+It(o,0,e.height-1)*e.width)*4,h=e.data[a],c=e.data[a+1],f=e.data[a+2]+256*(c+256*h),_=Math.floor((256*256*256-1)/t.length);f&&f%_===0&&i.push(t[f/_-1])}return i}const ME=.5,Vd={Point:GE,LineString:zE,Polygon:ZE,MultiPoint:UE,MultiLineString:NE,MultiPolygon:BE,GeometryCollection:FE,Circle:DE};function IE(r,t){return parseInt(at(r),10)-parseInt(at(t),10)}function AE(r,t){const e=jl(r,t);return e*e}function jl(r,t){return ME*r/t}function DE(r,t,e,i,n){const o=e.getFill(),a=e.getStroke();if(o||a){const c=r.getBuilder(e.getZIndex(),"Circle");c.setFillStrokeStyle(o,a),c.drawCircle(t,i)}const h=e.getText();if(h&&h.getText()){const c=(n||r).getBuilder(e.getZIndex(),"Text");c.setTextStyle(h),c.drawText(t,i)}}function Xd(r,t,e,i,n,o,a){let h=!1;const c=e.getImage();if(c){const d=c.getImageState();d==Ct.LOADED||d==Ct.ERROR?c.unlistenImageChange(n):(d==Ct.IDLE&&c.load(),c.listenImageChange(n),h=!0)}return OE(r,t,e,i,o,a),h}function OE(r,t,e,i,n,o){const a=e.getGeometryFunction()(t);if(!a)return;const h=a.simplifyTransformed(i,n);if(e.getRenderer())Yd(r,h,e,t);else{const d=Vd[h.getType()];d(r,h,e,t,o)}}function Yd(r,t,e,i){if(t.getType()=="GeometryCollection"){const o=t.getGeometries();for(let a=0,h=o.length;a<h;++a)Yd(r,o[a],e,i);return}r.getBuilder(e.getZIndex(),"Default").drawCustom(t,i,e.getRenderer(),e.getHitDetectionRenderer())}function FE(r,t,e,i,n){const o=t.getGeometriesArray();let a,h;for(a=0,h=o.length;a<h;++a){const c=Vd[o[a].getType()];c(r,o[a],e,i,n)}}function zE(r,t,e,i,n){const o=e.getStroke();if(o){const h=r.getBuilder(e.getZIndex(),"LineString");h.setFillStrokeStyle(null,o),h.drawLineString(t,i)}const a=e.getText();if(a&&a.getText()){const h=(n||r).getBuilder(e.getZIndex(),"Text");h.setTextStyle(a),h.drawText(t,i)}}function NE(r,t,e,i,n){const o=e.getStroke();if(o){const h=r.getBuilder(e.getZIndex(),"LineString");h.setFillStrokeStyle(null,o),h.drawMultiLineString(t,i)}const a=e.getText();if(a&&a.getText()){const h=(n||r).getBuilder(e.getZIndex(),"Text");h.setTextStyle(a),h.drawText(t,i)}}function BE(r,t,e,i,n){const o=e.getFill(),a=e.getStroke();if(a||o){const c=r.getBuilder(e.getZIndex(),"Polygon");c.setFillStrokeStyle(o,a),c.drawMultiPolygon(t,i)}const h=e.getText();if(h&&h.getText()){const c=(n||r).getBuilder(e.getZIndex(),"Text");c.setTextStyle(h),c.drawText(t,i)}}function GE(r,t,e,i,n){const o=e.getImage(),a=e.getText();let h;if(o){if(o.getImageState()!=Ct.LOADED)return;let c=r;if(n){const f=o.getDeclutterMode();if(f!=="none")if(c=n,f==="obstacle"){const _=r.getBuilder(e.getZIndex(),"Image");_.setImageStyle(o,h),_.drawPoint(t,i)}else a&&a.getText()&&(h={})}const d=c.getBuilder(e.getZIndex(),"Image");d.setImageStyle(o,h),d.drawPoint(t,i)}if(a&&a.getText()){let c=r;n&&(c=n);const d=c.getBuilder(e.getZIndex(),"Text");d.setTextStyle(a,h),d.drawText(t,i)}}function UE(r,t,e,i,n){const o=e.getImage(),a=e.getText();let h;if(o){if(o.getImageState()!=Ct.LOADED)return;let c=r;if(n){const f=o.getDeclutterMode();if(f!=="none")if(c=n,f==="obstacle"){const _=r.getBuilder(e.getZIndex(),"Image");_.setImageStyle(o,h),_.drawMultiPoint(t,i)}else a&&a.getText()&&(h={})}const d=c.getBuilder(e.getZIndex(),"Image");d.setImageStyle(o,h),d.drawMultiPoint(t,i)}if(a&&a.getText()){let c=r;n&&(c=n);const d=c.getBuilder(e.getZIndex(),"Text");d.setTextStyle(a,h),d.drawText(t,i)}}function ZE(r,t,e,i,n){const o=e.getFill(),a=e.getStroke();if(o||a){const c=r.getBuilder(e.getZIndex(),"Polygon");c.setFillStrokeStyle(o,a),c.drawPolygon(t,i)}const h=e.getText();if(h&&h.getText()){const c=(n||r).getBuilder(e.getZIndex(),"Text");c.setTextStyle(h),c.drawText(t,i)}}class jE extends Md{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=ge(),this.wrappedRenderedExtent_=ge(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.declutterExecutorGroup=null,this.clipping=!0,this.compositionContext_=null,this.opacity_=1}renderWorlds(t,e,i){const n=e.extent,o=e.viewState,a=o.center,h=o.resolution,c=o.projection,d=o.rotation,f=c.getExtent(),_=this.getLayer().getSource(),m=e.pixelRatio,v=e.viewHints,y=!(v[Ut.ANIMATING]||v[Ut.INTERACTING]),E=this.compositionContext_,b=Math.round(e.size[0]*m),S=Math.round(e.size[1]*m),w=_.getWrapX()&&c.canWrapX(),T=w?Tt(f):null,P=w?Math.ceil((n[2]-f[2])/T)+1:1;let M=w?Math.floor((n[0]-f[0])/T):0;do{const I=this.getRenderTransform(a,h,d,m,b,S,M*T);t.execute(E,1,I,d,y,void 0,i)}while(++M<P)}setupCompositionContext_(){if(this.opacity_!==1){const t=$t(this.context.canvas.width,this.context.canvas.height,Rd);this.compositionContext_=t}else this.compositionContext_=this.context}releaseCompositionContext_(){if(this.opacity_!==1){const t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,Js(this.compositionContext_),Rd.push(this.compositionContext_.canvas),this.compositionContext_=null}}renderDeclutter(t){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.releaseCompositionContext_())}renderFrame(t,e){const i=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];wm(this.pixelTransform,1/i,1/i),Gs(this.inversePixelTransform,this.pixelTransform);const o=Qc(this.pixelTransform);this.useContainer(e,o,this.getBackground(t));const a=this.context,h=a.canvas,c=this.replayGroup_,d=this.declutterExecutorGroup;let f=c&&!c.isEmpty()||d&&!d.isEmpty();if(!f&&!(this.getLayer().hasListener(qt.PRERENDER)||this.getLayer().hasListener(qt.POSTRENDER)))return null;const _=Math.round(t.size[0]*i),m=Math.round(t.size[1]*i);h.width!=_||h.height!=m?(h.width=_,h.height=m,h.style.transform!==o&&(h.style.transform=o)):this.containerReused||a.clearRect(0,0,_,m),this.preRender(a,t);const v=t.viewState;v.projection,this.opacity_=n.opacity,this.setupCompositionContext_();let y=!1;if(f&&n.extent&&this.clipping){const E=Qi(n.extent);f=se(E,t.extent),y=f&&!Yi(E,t.extent),y&&this.clipUnrotated(this.compositionContext_,t,E)}return f&&this.renderWorlds(c,t),y&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(a,t),this.renderedRotation_!==v.rotation&&(this.renderedRotation_=v.rotation,this.hitDetectionImageData_=null),this.container}getFeatures(t){return new Promise(e=>{if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=[this.context.canvas.width,this.context.canvas.height];Ot(this.pixelTransform,i);const n=this.renderedCenter_,o=this.renderedResolution_,a=this.renderedRotation_,h=this.renderedProjection_,c=this.wrappedRenderedExtent_,d=this.getLayer(),f=[],_=i[0]*Ze,m=i[1]*Ze;f.push(this.getRenderTransform(n,o,a,Ze,_,m,0).slice());const v=d.getSource(),y=h.getExtent();if(v.getWrapX()&&h.canWrapX()&&!Yi(y,c)){let E=c[0];const b=Tt(y);let S=0,w;for(;E<y[0];)--S,w=b*S,f.push(this.getRenderTransform(n,o,a,Ze,_,m,w).slice()),E+=b;for(S=0,E=c[2];E>y[2];)++S,w=b*S,f.push(this.getRenderTransform(n,o,a,Ze,_,m,w).slice()),E-=b}this.hitDetectionImageData_=kE(i,f,this.renderedFeatures_,d.getStyleFunction(),c,o,a)}e(RE(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,i,n,o){if(!this.replayGroup_)return;const a=e.viewState.resolution,h=e.viewState.rotation,c=this.getLayer(),d={},f=function(v,y,E){const b=at(v),S=d[b];if(S){if(S!==!0&&E<S.distanceSq){if(E===0)return d[b]=!0,o.splice(o.lastIndexOf(S),1),n(v,c,y);S.geometry=y,S.distanceSq=E}}else{if(E===0)return d[b]=!0,n(v,c,y);o.push(d[b]={feature:v,layer:c,geometry:y,distanceSq:E,callback:n})}};let _;const m=[this.replayGroup_];return this.declutterExecutorGroup&&m.push(this.declutterExecutorGroup),m.some(v=>_=v.forEachFeatureAtCoordinate(t,a,h,i,f,v===this.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map(y=>y.value):null)),_}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),i=e.getSource();if(!i)return!1;const n=t.viewHints[Ut.ANIMATING],o=t.viewHints[Ut.INTERACTING],a=e.getUpdateWhileAnimating(),h=e.getUpdateWhileInteracting();if(this.ready&&!a&&n||!h&&o)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const c=t.extent,d=t.viewState,f=d.projection,_=d.resolution,m=t.pixelRatio,v=e.getRevision(),y=e.getRenderBuffer();let E=e.getRenderOrder();E===void 0&&(E=IE);const b=d.center.slice(),S=ks(c,y*_),w=S.slice(),T=[S.slice()],P=f.getExtent();if(i.getWrapX()&&f.canWrapX()&&!Yi(P,t.extent)){const V=Tt(P),H=Math.max(Tt(S)/2,V);S[0]=P[0]-H,S[2]=P[2]+H,Mc(b,f);const Z=Rc(T[0],f);Z[0]<P[0]&&Z[2]<P[2]?T.push([Z[0]+V,Z[1],Z[2]+V,Z[3]]):Z[0]>P[0]&&Z[2]>P[2]&&T.push([Z[0]-V,Z[1],Z[2]-V,Z[3]])}if(this.ready&&this.renderedResolution_==_&&this.renderedRevision_==v&&this.renderedRenderOrder_==E&&Yi(this.wrappedRenderedExtent_,S))return ei(this.renderedExtent_,w)||(this.hitDetectionImageData_=null,this.renderedExtent_=w),this.renderedCenter_=b,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const M=new Zd(jl(_,m),S,_,m);let I;this.getLayer().getDeclutter()&&(I=new Zd(jl(_,m),S,_,m));let D;for(let V=0,H=T.length;V<H;++V)i.loadFeatures(T[V],_,f);const z=AE(_,m);let W=!0;const K=V=>{let H;const Z=V.getStyleFunction()||e.getStyleFunction();if(Z&&(H=Z(V,_)),H){const B=this.renderFeature(V,z,H,M,D,I);W=W&&!B}},Q=Uc(S),q=i.getFeaturesInExtent(Q);E&&q.sort(E);for(let V=0,H=q.length;V<H;++V)K(q[V]);this.renderedFeatures_=q,this.ready=W;const ct=M.finish(),Et=new Hd(S,_,m,i.getOverlaps(),ct,e.getRenderBuffer());return I&&(this.declutterExecutorGroup=new Hd(S,_,m,i.getOverlaps(),I.finish(),e.getRenderBuffer())),this.renderedResolution_=_,this.renderedRevision_=v,this.renderedRenderOrder_=E,this.renderedExtent_=w,this.wrappedRenderedExtent_=S,this.renderedCenter_=b,this.renderedProjection_=f,this.replayGroup_=Et,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,i,n,o,a){if(!i)return!1;let h=!1;if(Array.isArray(i))for(let c=0,d=i.length;c<d;++c)h=Xd(n,t,i[c],e,this.boundHandleStyleImageChange_,o,a)||h;else h=Xd(n,t,i,e,this.boundHandleStyleImageChange_,o,a);return h}}const WE=jE;class HE extends xl{constructor(t){super(t)}createRenderer(){return new WE(this)}}const Kd=HE,Qt={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class VE extends be{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 "+cy,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(Qt.ELEMENT,this.handleElementChanged),this.addChangeListener(Qt.MAP,this.handleMapChanged),this.addChangeListener(Qt.OFFSET,this.handleOffsetChanged),this.addChangeListener(Qt.POSITION,this.handlePositionChanged),this.addChangeListener(Qt.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(Qt.ELEMENT)}getId(){return this.id}getMap(){return this.get(Qt.MAP)||null}getOffset(){return this.get(Qt.OFFSET)}getPosition(){return this.get(Qt.POSITION)}getPositioning(){return this.get(Qt.POSITIONING)}handleElementChanged(){Su(this.element);const t=this.getElement();t&&this.element.appendChild(t)}handleMapChanged(){this.mapPostrenderListenerKey&&(to(this.element),wt(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const t=this.getMap();if(t){this.mapPostrenderListenerKey=ht(t,oi.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(Qt.ELEMENT,t)}setMap(t){this.set(Qt.MAP,t)}setOffset(t){this.set(Qt.OFFSET,t)}setPosition(t){this.set(Qt.POSITION,t)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(t){const e=this.getMap();if(!e||!e.getTargetElement()||!this.get(Qt.POSITION))return;const i=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),o=this.getRect(n,[dy(n),fy(n)]);t=t||{};const a=t.margin===void 0?20:t.margin;if(!Yi(i,o)){const h=o[0]-i[0],c=i[2]-o[2],d=o[1]-i[1],f=i[3]-o[3],_=[0,0];if(h<0?_[0]=h-a:c<0&&(_[0]=Math.abs(c)+a),d<0?_[1]=d-a:f<0&&(_[1]=Math.abs(f)+a),_[0]!==0||_[1]!==0){const m=e.getView().getCenterInternal(),v=e.getPixelFromCoordinateInternal(m);if(!v)return;const y=[v[0]+_[0],v[1]+_[1]],E=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(y),duration:E.duration,easing:E.easing})}}}getRect(t,e){const i=t.getBoundingClientRect(),n=i.left+window.pageXOffset,o=i.top+window.pageYOffset;return[n,o,n+e[0],o+e[1]]}setPositioning(t){this.set(Qt.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 i=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(i,n)}updateRenderedPosition(t,e){const i=this.element.style,n=this.getOffset(),o=this.getPositioning();this.setVisible(!0);const a=Math.round(t[0]+n[0])+"px",h=Math.round(t[1]+n[1])+"px";let c="0%",d="0%";o=="bottom-right"||o=="center-right"||o=="top-right"?c="-100%":(o=="bottom-center"||o=="center-center"||o=="top-center")&&(c="-50%"),o=="bottom-left"||o=="bottom-center"||o=="bottom-right"?d="-100%":(o=="center-left"||o=="center-center"||o=="center-right")&&(d="-50%");const f=`translate(${c}, ${d}) translate(${a}, ${h})`;this.rendered.transform_!=f&&(this.rendered.transform_=f,i.transform=f)}getOptions(){return this.options}}const XE=VE,qd=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],$d={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"};class YE extends so{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target}),this.on,this.once,this.un,this.keys_=t.keys!==void 0?t.keys:!1,this.source_=t.source,this.isInFullscreen_=!1,this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this),this.cssClassName_=t.className!==void 0?t.className:"ol-full-screen",this.documentListeners_=[],this.activeClassName_=t.activeClassName!==void 0?t.activeClassName.split(" "):[this.cssClassName_+"-true"],this.inactiveClassName_=t.inactiveClassName!==void 0?t.inactiveClassName.split(" "):[this.cssClassName_+"-false"];const e=t.label!==void 0?t.label:"⤢";this.labelNode_=typeof e=="string"?document.createTextNode(e):e;const i=t.labelActive!==void 0?t.labelActive:"×";this.labelActiveNode_=typeof i=="string"?document.createTextNode(i):i;const n=t.tipLabel?t.tipLabel:"Toggle full-screen";this.button_=document.createElement("button"),this.button_.title=n,this.button_.setAttribute("type","button"),this.button_.appendChild(this.labelNode_),this.button_.addEventListener(rt.CLICK,this.handleClick_.bind(this),!1),this.setClassName_(this.button_,this.isInFullscreen_),this.element.className=`${this.cssClassName_} ${Tr} ${$s}`,this.element.appendChild(this.button_)}handleClick_(t){t.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){const t=this.getMap();if(!t)return;const e=t.getOwnerDocument();if(Jd(e))if(Qd(e))qE(e);else{let i;this.source_?i=typeof this.source_=="string"?e.getElementById(this.source_):this.source_:i=t.getTargetElement(),this.keys_?KE(i):tf(i)}}handleFullScreenChange_(){const t=this.getMap();if(!t)return;const e=this.isInFullscreen_;this.isInFullscreen_=Qd(t.getOwnerDocument()),e!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(Qs(this.labelActiveNode_,this.labelNode_),this.dispatchEvent($d.ENTERFULLSCREEN)):(Qs(this.labelNode_,this.labelActiveNode_),this.dispatchEvent($d.LEAVEFULLSCREEN)),t.updateSize())}setClassName_(t,e){e?(t.classList.remove(...this.inactiveClassName_),t.classList.add(...this.activeClassName_)):(t.classList.remove(...this.activeClassName_),t.classList.add(...this.inactiveClassName_))}setMap(t){const e=this.getMap();e&&e.removeChangeListener(jt.TARGET,this.boundHandleMapTargetChange_),super.setMap(t),this.handleMapTargetChange_(),t&&t.addChangeListener(jt.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){const t=this.documentListeners_;for(let i=0,n=t.length;i<n;++i)wt(t[i]);t.length=0;const e=this.getMap();if(e){const i=e.getOwnerDocument();Jd(i)?this.element.classList.remove(Lu):this.element.classList.add(Lu);for(let n=0,o=qd.length;n<o;++n)t.push(ht(i,qd[n],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}}function Jd(r){const t=r.body;return!!(t.webkitRequestFullscreen||t.requestFullscreen&&r.fullscreenEnabled)}function Qd(r){return!!(r.webkitIsFullScreen||r.fullscreenElement)}function tf(r){r.requestFullscreen?r.requestFullscreen():r.webkitRequestFullscreen&&r.webkitRequestFullscreen()}function KE(r){r.webkitRequestFullscreen?r.webkitRequestFullscreen():tf(r)}function qE(r){r.exitFullscreen?r.exitFullscreen():r.webkitExitFullscreen&&r.webkitExitFullscreen()}const $E=YE,JE=G.defineComponent({name:"MapHeat",props:{coords:Object,loadMapa:Object,typeMap:String,abrirCerrarLoader:Function,onClickMarket:Function,configurationMap:{default:()=>({strokeColor:"#f47521",copyright:"&copy; 2021 Desarrollado por UTIC - Ministerio Público",height:"250px",maxZoom:20,iconMarker:{image:ss,color:"#f47521",iconUrl:"/image/gmap01.png",iconSize:[25,41],iconAnchor:[12,41],class:"",type:"image"},dragMarker:!0})}},data:()=>({radius:10,blur:20,zoom:5,type:"0",olMap:null,heatLayer:null,pointLayer:null,countryLayer:null,overlay:null,showSetting:!1,cantidad:0}),watch:{radius(r){this.setRadius(r)},blur(r){this.setBlur(r)},coords(r){this.cantidad=r.features.length,this.updateSource(r),this.updatePointSource(r)},loadMapa(r){this.changeCountryLayer(r)},typeMap(r){this.changeTypeMap(r)},type(r){this.changeTypeMap(r)}},methods:{changeTypeMap(r){r==="0"?(this.heatLayer.setVisible(!0),this.pointLayer.setVisible(!1),this.olMap.removeEventListener("click",this.onClickListener)):(this.heatLayer.setVisible(!1),this.pointLayer.setVisible(!0),this.initClick())},initMap(){const r=`<span class='map-copyright-text' >${this.configurationMap.copyright}</span>`,t=new On({stroke:new lo({color:this.configurationMap.strokeColor,width:3}),text:new Vu({font:"12px Roboto",fill:new ao({color:"#000"}),stroke:new lo({color:"#fff",width:1})})});this.countryLayer=new Kd({source:new vo({url:`${this.loadMapa.data}`,format:new To}),style:function(i){return t.getText().setText(i.get("name")),t}}),this.heatLayer=new e0({source:new vo({features:[]}),visible:!1,radius:10,blur:25});try{this.pointLayer=this.configurationMap?new Kd({source:new vo({features:[]}),visible:!1,style:i=>{var a,h,c,d,f;return new On({image:new _l({opacity:1,src:(h=(a=this.configurationMap)==null?void 0:a.iconMarker)==null?void 0:h.iconUrl,color:(c=this.configurationMap.iconMarker)==null?void 0:c.color,width:(d=this.configurationMap)==null?void 0:d.iconMarker.iconSize[0],height:(f=this.configurationMap)==null?void 0:f.iconMarker.iconSize[1]}),zIndex:1})}}):void 0}catch(i){console.log(i)}this.olMap=new xv({controls:Iu({attribution:!1}).extend([new $E({tipLabel:"Pantalla completa"})]).extend([new Mu({collapsible:!1})]),layers:[new I0({source:new b0({attributions:r})}),this.countryLayer,this.heatLayer,this.pointLayer],target:this.$refs["map-root"],view:new Ne({center:[0,0],zoom:this.zoom})});const e=Bc([this.loadMapa.lng,this.loadMapa.lat]);this.olMap.getView().adjustCenter(e),this.fitMap()},initClick(){const r=document.getElementById("popup"),t=document.getElementById("popup-closer");this.overlay=new XE({element:r,autoPan:!0}),this.olMap.addOverlay(this.overlay),t.onclick=()=>this.closeOverlay(),this.olMap.addEventListener("click",this.onClickListener)},closeOverlay(){const r=document.getElementById("popup-closer");return this.overlay.setPosition(void 0),r.blur(),!1},async onClickListener(r){const t=document.getElementById("popup-content"),e=document.getElementById("popup-closer");if(this.olMap.hasFeatureAtPixel(r.pixel)===!0){const i=this.olMap.getFeaturesAtPixel(r.pixel)[0];if(i.getGeometry().getType()==="Point"){const o=this.olMap.getFeaturesAtPixel(r.pixel)[0].getProperties(),a=r.coordinate;this.abrirCerrarLoader&&this.abrirCerrarLoader(!0);try{this.abrirCerrarLoader&&this.abrirCerrarLoader(!1);let h="";this.onClickMarket&&(h=await this.onClickMarket(o)),t.innerHTML=h;const c=this.olMap.getView(),d=i.getGeometry().getExtent(),f=c.getCenter(),_=c.getZoom();c.fit(d,{padding:[325,75,0,75],maxZoom:_});const m=c.getCenter();c.setCenter(f),c.animate({center:m})}catch{this.abrirCerrarLoader&&this.abrirCerrarLoader(!1)}this.overlay.setPosition(a)}}else this.overlay.setPosition(void 0),e.blur()},updateSource(r){if(r&&r.features.length===0){this.heatLayer.getSource().clear();return}if(r){const t=this.heatLayer.getSource(),e=new To({featureProjection:"EPSG:3857"}).readFeatures(r);t.clear(),t.addFeatures(e)}},updatePointSource(r){if(r&&r.features.length===0){this.pointLayer.getSource().clear();return}if(r){const t=this.pointLayer.getSource(),e=new To({featureProjection:"EPSG:3857"}).readFeatures(r);t.clear(),t.addFeatures(e)}},async changeCountryLayer(r){if(this.countryLayer){const e=new vo({url:`${r.data}`,format:new To});await this.countryLayer.setSource(e)}},fitMap(){this.countryLayer.addEventListener("change",this.countryFunction)},countryFunction(r){const t=this.olMap.getView();if(r.target.getSource().getFeatures()[0]){const i=r.target.getSource().getExtent(),n=t.getZoom(),o=t.getCenter();t.fit(i,{padding:[75,75,75,75],maxZoom:6});const a=t.getZoom(),h=t.getCenter();t.setCenter(o),t.setZoom(n),t.animate({center:h}),t.animate({zoom:a})}},setRadius(r){this.heatLayer.setRadius(parseInt(r,10))},setBlur(r){this.heatLayer.setBlur(parseInt(r,10))},irACiudad(){if(this.loadMapa&&this.loadMapa.country!=="Bolivia"){const r=this.olMap.getView(),t=r.getZoom(),e=r.getCenter();r.setCenter(Bc([this.loadMapa.lng,this.loadMapa.lat]));const i=13,n=r.getCenter();r.setCenter(e),r.setZoom(t),r.animate({center:n}),r.animate({zoom:i})}},toggleSettings(){this.showSetting=!this.showSetting}},mounted(){this.countryLayer=this.loadMapa,this.initMap()},beforeDestroy(){this.countryLayer.removeEventListener("change",this.countryFunction),this.olMap.removeEventListener("click",this.onClickListener)}}),zL="",NL="",ui=r=>(G.pushScopeId("data-v-8f838484"),r=r(),G.popScopeId(),r),QE={ref:"map-root",style:{width:"100%",height:"100%",position:"relative"}},tw={class:"btn-zoom-container ol-control"},ew=[ui(()=>G.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[G.createElementVNode("path",{d:"M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224v114.8l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288h114.8l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z"})],-1))],iw={class:"type-map-container ol-control"},nw=[ui(()=>G.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},[G.createElementVNode("path",{d:"M215.7 499.2C267 435 384 279.4 384 192 384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2 12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"})],-1))],rw=[ui(()=>G.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},[G.createElementVNode("path",{d:"m153.6 29.9 16-21.3c4-5.4 10.4-8.6 17.1-8.6C198.4 0 208 9.6 208 21.3v22.2c0 13.1 5.4 25.7 14.9 34.7l84.7 80.8c48.8 46.6 76.4 111.2 76.4 178.7C384 434 306 512 209.7 512H192C86 512 0 426 0 320v-3.8c0-48.8 19.4-95.6 53.9-130.1l3.5-3.5c4.2-4.2 10-6.6 16-6.6 12.5 0 22.6 10.1 22.6 22.6V288c0 35.3 28.7 64 64 64s64-28.7 64-64v-3.9c0-18-7.2-35.3-19.9-48l-38.6-38.6c-24-24-37.5-56.7-37.5-90.7 0-27.7 9-54.8 25.6-76.9z"})],-1))],sw={class:"btn-settings ol-control"},ow=[ui(()=>G.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[G.createElementVNode("path",{d:"M495.9 166.6c3.2 8.7.5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4l-55.6 17.8c-8.8 2.8-18.6.3-24.5-6.8-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4c-1.1-8.4-1.7-16.9-1.7-25.5s.6-17.1 1.7-25.4l-43.3-39.4c-6.9-6.2-9.6-15.9-6.4-24.6 4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2 5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8 8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"})],-1))],aw={class:"control-container"},lw={class:"map-flex"},hw=ui(()=>G.createElementVNode("label",null,"Tamaño del radio",-1)),cw={class:"map-flex"},uw=ui(()=>G.createElementVNode("label",null,"Difuminado",-1)),dw={class:"cant-casos ol-attribution ol-unselectable ol-control ol-uncollapsible"},fw={class:"text-cantidad"},gw=ui(()=>G.createElementVNode("span",{class:"ol-bold"},"Casos: ",-1)),_w={id:"popup",class:"ol-popup"},pw=[ui(()=>G.createElementVNode("a",{id:"popup-closer",class:"ol-popup-closer"},null,-1)),ui(()=>G.createElementVNode("div",{id:"popup-content"},null,-1))];function mw(r,t,e,i,n,o){var a;return G.openBlock(),G.createElementBlock("div",{class:"map-container",style:G.normalizeStyle(`height:${(a=r.configurationMap)==null?void 0:a.height}`)},[G.createElementVNode("div",QE,[G.withDirectives(G.createElementVNode("div",tw,[G.createElementVNode("button",{title:"Ir a la ciudad",class:"jl2-button-map",onClick:t[0]||(t[0]=(...h)=>r.irACiudad&&r.irACiudad(...h))},ew)],512),[[G.vShow,r.loadMapa.country!=="Bolivia"]]),G.createElementVNode("div",iw,[G.createElementVNode("button",{title:"Mapa con Marcador",class:G.normalizeClass(["jl2-button-map",{"jl2-button-map-select":r.type=="1"}]),onClick:t[1]||(t[1]=()=>r.type="1")},nw,2),G.createElementVNode("button",{title:"Mapa de Calor",class:G.normalizeClass(["jl2-button-map",{"jl2-button-map-select":r.type=="0"}]),onClick:t[2]||(t[2]=()=>r.type="0")},rw,2)]),G.withDirectives(G.createElementVNode("div",sw,[G.createElementVNode("button",{title:"Ver Opciones",class:"jl2-button-map",onClick:t[3]||(t[3]=(...h)=>r.toggleSettings&&r.toggleSettings(...h))},ow)],512),[[G.vShow,!r.showSetting&&r.type==="0"]]),G.withDirectives(G.createElementVNode("div",aw,[G.createElementVNode("a",{onClick:t[4]||(t[4]=(...h)=>r.toggleSettings&&r.toggleSettings(...h)),class:"ol-popup-closer"}),G.createElementVNode("div",lw,[hw,G.withDirectives(G.createElementVNode("input",{id:"radius",type:"range",min:"1",max:"50",step:"1","onUpdate:modelValue":t[5]||(t[5]=h=>r.radius=h)},null,512),[[G.vModelText,r.radius]])]),G.createElementVNode("div",cw,[uw,G.withDirectives(G.createElementVNode("input",{id:"blur",type:"range",min:"1",max:"50",step:"1","onUpdate:modelValue":t[6]||(t[6]=h=>r.blur=h)},null,512),[[G.vModelText,r.blur]])])],512),[[G.vShow,r.type==="0"&&r.showSetting]]),G.createElementVNode("div",dw,[G.createElementVNode("p",fw,[gw,G.createTextVNode(G.toDisplayString(r.cantidad),1)])])],512),G.withDirectives(G.createElementVNode("div",_w,pw,512),[[G.vShow,r.type==="1"]])],4)}const yw=ra(JE,[["render",mw],["__scopeId","data-v-8f838484"]]);de.CoordinatesVerifyPolygon=Gg,de.MapHeatComponent=yw,de.MapSearchAddress=Tp,de.MapView=Lp,de.listenServiceGoogleMaps=rg,de.searchAutomaticGoogleMaps=og,de.searchManualGoogleMaps=sg,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});
444
+ }`,uniforms:{u_gradientTexture:()=>this.gradient_,u_opacity:()=>this.getOpacity()}}]})}renderDeclutter(){}}function Fx(r){const i=$t(1,256),n=i.createLinearGradient(0,0,1,256),o=1/(r.length-1);for(let a=0,h=r.length;a<h;++a)n.addColorStop(a*o,r[a]);return i.fillStyle=n,i.fillRect(0,0,1,256),i.canvas}const zx=Ox;class Nx extends Tx{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()}pruneExceptNewestZ(){if(this.getCount()===0)return;const t=this.peekFirstKey(),i=Cx(t)[0];this.forEach(n=>{n.tileCoord[0]!==i&&(this.remove(ud(n.tileCoord)),n.release())})}}const dd=Nx,Ll={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class Bx extends be{constructor(t){super(),this.projection=Gt(t.projection),this.attributions_=fd(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible!==void 0?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(i,n){e.viewResolver=i,e.viewRejector=n})}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_=fd(t),this.changed()}setState(t){this.state_=t,this.changed()}}function fd(r){return r?Array.isArray(r)?function(t){return r}:typeof r=="function"?r:function(t){return[r]}:null}const gd=Bx,Zn=[0,0,0],ki=5;class Gx{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,gt(dp(this.resolutions_,function(n,o){return o-n},!0),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let n=0,o=this.resolutions_.length-1;n<o;++n)if(!e)e=this.resolutions_[n]/this.resolutions_[n+1];else if(this.resolutions_[n]/this.resolutions_[n+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,gt(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const i=t.extent;i!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=qi(i)),gt(!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,gt(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:fa,gt(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=i!==void 0?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],t.sizes!==void 0?this.fullTileRanges_=t.sizes.map(function(n,o){const a=new hd(Math.min(0,n[0]),Math.max(n[0]-1,-1),Math.min(0,n[1]),Math.max(n[1]-1,-1));if(i){const h=this.getTileRangeForExtentAndZ(i,o);a.minX=Math.max(h.minX,a.minX),a.maxX=Math.min(h.maxX,a.maxX),a.minY=Math.max(h.minY,a.minY),a.maxY=Math.min(h.maxY,a.maxY)}return a},this):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){const n=this.getTileRangeForExtentAndZ(t,e);for(let o=n.minX,a=n.maxX;o<=a;++o)for(let h=n.minY,c=n.maxY;h<=c;++h)i([e,o,h])}forEachTileCoordParentTileRange(t,e,i,n){let o,a,h,c=null,d=t[0]-1;for(this.zoomFactor_===2?(a=t[1],h=t[2]):c=this.getTileCoordExtent(t,n);d>=this.minZoom;){if(this.zoomFactor_===2?(a=Math.floor(a/2),h=Math.floor(h/2),o=Nn(a,a,h,h,i)):o=this.getTileRangeForExtentAndZ(c,d,i),e(d,o))return!0;--d}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,i){if(t[0]<this.maxZoom){if(this.zoomFactor_===2){const o=t[1]*2,a=t[2]*2;return Nn(o,o+1,a,a+1,e)}const n=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(n,t[0]+1,e)}return null}getTileRangeForTileCoordAndZ(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;const n=t[0],o=t[1],a=t[2];if(e===n)return Nn(o,a,o,a,i);if(this.zoomFactor_){const c=Math.pow(this.zoomFactor_,e-n),d=Math.floor(o*c),f=Math.floor(a*c);if(e<n)return Nn(d,d,f,f,i);const _=Math.floor(c*(o+1))-1,m=Math.floor(c*(a+1))-1;return Nn(d,_,f,m,i)}const h=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(h,e,i)}getTileRangeForExtentAndZ(t,e,i){this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,Zn);const n=Zn[1],o=Zn[2];this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,Zn);const a=Zn[1],h=Zn[2];return Nn(n,a,o,h,i)}getTileCoordCenter(t){const e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=pe(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*i,e[1]-(t[2]+.5)*n[1]*i]}getTileCoordExtent(t,e){const i=this.getOrigin(t[0]),n=this.getResolution(t[0]),o=pe(this.getTileSize(t[0]),this.tmpSize_),a=i[0]+t[1]*o[0]*n,h=i[1]-(t[2]+1)*o[1]*n,c=a+o[0]*n,d=h+o[1]*n;return Ei(a,h,c,d,e)}getTileCoordForCoordAndResolution(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)}getTileCoordForXYAndResolution_(t,e,i,n,o){const a=this.getZForResolution(i),h=i/this.getResolution(a),c=this.getOrigin(a),d=pe(this.getTileSize(a),this.tmpSize_);let f=h*(t-c[0])/i/d[0],_=h*(c[1]-e)/i/d[1];return n?(f=ks(f,ki)-1,_=ks(_,ki)-1):(f=Ps(f,ki),_=Ps(_,ki)),cd(a,f,_,o)}getTileCoordForXYAndZ_(t,e,i,n,o){const a=this.getOrigin(i),h=this.getResolution(i),c=pe(this.getTileSize(i),this.tmpSize_);let d=(t-a[0])/h/c[0],f=(a[1]-e)/h/c[1];return n?(d=ks(d,ki)-1,f=ks(f,ki)-1):(d=Ps(d,ki),f=Ps(f,ki)),cd(i,d,f,o)}getTileCoordForCoordAndZ(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)}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 i=da(this.resolutions_,t,e||0);return It(i,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return Qc(e,0,e.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){const e=this.resolutions_.length,i=new Array(e);for(let n=this.minZoom;n<e;++n)i[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=i}}const _d=Gx;function pd(r){let t=r.getDefaultTileGrid();return t||(t=Wx(r),r.setDefaultTileGrid(t)),t}function Ux(r,t,e){const i=t[0],n=r.getTileCoordCenter(t),o=bl(e);if(!ws(o,n)){const a=Tt(o),h=Math.ceil((o[0]-n[0])/a);return n[0]+=a*h,r.getTileCoordForCoordAndZ(n,i)}return t}function Zx(r,t,e,i){i=i!==void 0?i:"top-left";const n=md(r,t,e);return new _d({extent:r,origin:Mp(r,i),resolutions:n,tileSize:e})}function jx(r){const t=r||{},e=t.extent||Gt("EPSG:3857").getExtent(),i={extent:e,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:md(e,t.maxZoom,t.tileSize,t.maxResolution)};return new _d(i)}function md(r,t,e,i){t=t!==void 0?t:yp,e=pe(e!==void 0?e:fa);const n=ze(r),o=Tt(r);i=i>0?i:Math.max(o/e[0],n/e[1]);const a=t+1,h=new Array(a);for(let c=0;c<a;++c)h[c]=i/Math.pow(2,c);return h}function Wx(r,t,e,i){const n=bl(r);return Zx(n,t,e,i)}function bl(r){r=Gt(r);let t=r.getExtent();if(!t){const e=180*ur.degrees/r.getMetersPerUnit();t=Ei(-e,-e,e,e)}return t}class Hx extends gd{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.opaque_=t.opaque!==void 0?t.opaque:!1,this.tilePixelRatio_=t.tilePixelRatio!==void 0?t.tilePixelRatio:1,this.tileGrid=t.tileGrid!==void 0?t.tileGrid:null;const e=[256,256];this.tileGrid&&pe(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),e),this.tileCache=new dd(t.cacheSize||0),this.tmpSize=[0,0],this.key_=t.key||"",this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}canExpireCache(){return this.tileCache.canExpireCache()}expireCache(t,e){const i=this.getTileCacheForProjection(t);i&&i.expireCache(e)}forEachLoadedTile(t,e,i,n){const o=this.getTileCacheForProjection(t);if(!o)return!1;let a=!0,h,c,d;for(let f=i.minX;f<=i.maxX;++f)for(let _=i.minY;_<=i.maxY;++_)c=lo(e,f,_),d=!1,o.containsKey(c)&&(h=o.get(c),d=h.getState()===Q.LOADED,d&&(d=n(h)!==!1)),d||(a=!1);return a}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getOpaque(t){return this.opaque_}getResolutions(t){const e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,i,n,o){return st()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:pd(t)}getTileCacheForProjection(t){const e=this.getProjection();return gt(e===null||Ji(e,t),"A VectorTile source can only be rendered if it has a projection compatible with the view projection."),this.tileCache}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,i){const n=this.getTileGridForProjection(i),o=this.getTilePixelRatio(e),a=pe(n.getTileSize(t),this.tmpSize);return o==1?a:Qy(a,o,this.tmpSize)}getTileCoordForTileUrlFunction(t,e){e=e!==void 0?e:this.getProjection();const i=this.getTileGridForProjection(e);return this.getWrapX()&&e.isGlobal()&&(t=Ux(i,t,e)),Px(t,i)?t:null}clear(){this.tileCache.clear()}refresh(){this.clear(),super.refresh()}updateCacheSize(t,e){const i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)}useTile(t,e,i,n){}}class Vx extends Qe{constructor(t,e){super(t),this.tile=e}}const Xx=Hx;function Yx(r,t){const e=/\{z\}/g,i=/\{x\}/g,n=/\{y\}/g,o=/\{-y\}/g;return function(a,h,c){if(a)return r.replace(e,a[0].toString()).replace(i,a[1].toString()).replace(n,a[2].toString()).replace(o,function(){const d=a[0],f=t.getFullTileRange(d);return gt(f,"The {-y} placeholder requires a tile grid with extent"),(f.getHeight()-a[2]-1).toString()})}}function Kx(r,t){const e=r.length,i=new Array(e);for(let n=0;n<e;++n)i[n]=Yx(r[n],t);return qx(i)}function qx(r){return r.length===1?r[0]:function(t,e,i){if(!t)return;const n=Sx(t),o=Sn(n,r.length);return r[o](t,e,i)}}function $x(r){const t=[];let e=/\{([a-z])-([a-z])\}/.exec(r);if(e){const i=e[1].charCodeAt(0),n=e[2].charCodeAt(0);let o;for(o=i;o<=n;++o)t.push(r.replace(e[0],String.fromCharCode(o)));return t}if(e=/\{(\d+)-(\d+)\}/.exec(r),e){const i=parseInt(e[2],10);for(let n=parseInt(e[1],10);n<=i;n++)t.push(r.replace(e[0],n.toString()));return t}return t.push(r),t}class Tl extends Xx{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,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===Tl.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,i=ht(e),n=e.getState();let o;n==Q.LOADING?(this.tileLoadingKeys_[i]=!0,o=Ll.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],o=n==Q.ERROR?Ll.TILELOADERROR:n==Q.LOADED?Ll.TILELOADEND:void 0),o!=null&&this.dispatchEvent(new Vx(o,e))}setTileLoadFunction(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),typeof e<"u"?this.setKey(e):this.changed()}setUrl(t){const e=$x(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join(`
445
+ `);this.generateTileUrlFunction_?this.setTileUrlFunction(Kx(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,i){}useTile(t,e,i){const n=lo(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)}}const Jx=Tl;class Qx extends Jx{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:t0,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:ad,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}canExpireCache(){if(this.tileCache.canExpireCache())return!0;for(const t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1}expireCache(t,e){const i=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==i?e:{});for(const n in this.tileCacheForProjection){const o=this.tileCacheForProjection[n];o.expireCache(o==i?e:{})}}getGutterForProjection(t){return this.getProjection()&&t&&!Ji(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getOpaque(t){return this.getProjection()&&t&&!Ji(this.getProjection(),t)?!1:super.getOpaque(t)}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||Ji(e,t)))return this.tileGrid;const i=ht(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=pd(t)),this.tileGridForProjection[i]}getTileCacheForProjection(t){const e=this.getProjection();if(!e||Ji(e,t))return this.tileCache;const i=ht(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new dd(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]}createTile_(t,e,i,n,o,a){const h=[t,e,i],c=this.getTileCoordForTileUrlFunction(h,o),d=c?this.tileUrlFunction(c,n,o):void 0,f=new this.tileClass(h,d!==void 0?Q.IDLE:Q.EMPTY,d!==void 0?d:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return f.key=a,f.addEventListener(at.CHANGE,this.handleTileChange.bind(this)),f}getTile(t,e,i,n,o){const a=this.getProjection();if(!a||!o||Ji(a,o))return this.getTileInternal(t,e,i,n,a||o);const h=this.getTileCacheForProjection(o),c=[t,e,i];let d;const f=ud(c);h.containsKey(f)&&(d=h.get(f));const _=this.getKey();if(d&&d.key==_)return d;const m=this.getTileGridForProjection(a),E=this.getTileGridForProjection(o),v=this.getTileCoordForTileUrlFunction(c,o),b=new xl(a,m,o,E,c,v,this.getTilePixelRatio(n),this.getGutter(),(C,S,y,x)=>this.getTileInternal(C,S,y,x,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return b.key=_,d?(b.interimTile=d,b.refreshInterimChain(),h.replace(f,b)):h.set(f,b),b}getTileInternal(t,e,i,n,o){let a=null;const h=lo(t,e,i),c=this.getKey();if(!this.tileCache.containsKey(h))a=this.createTile_(t,e,i,n,o,c),this.tileCache.set(h,a);else if(a=this.tileCache.get(h),a.key!=c){const d=a;a=this.createTile_(t,e,i,n,o,c),d.getState()==Q.IDLE?a.interimTile=d.interimTile:a.interimTile=d,a.refreshInterimChain(),this.tileCache.replace(h,a)}return a}setRenderReprojectionEdges(t){if(this.renderReprojectionEdges_!=t){this.renderReprojectionEdges_=t;for(const e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}}setTileGridForProjection(t,e){const i=Gt(t);if(i){const n=ht(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}}clear(){super.clear();for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear()}}function t0(r,t){r.getImage().src=t}const e0=Qx;class i0 extends e0{constructor(t){t=t||{};const e=t.projection!==void 0?t.projection:"EPSG:3857",i=t.tileGrid!==void 0?t.tileGrid:jx({extent:bl(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,opaque:t.opaque,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}}const n0=i0,r0='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class s0 extends n0{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[r0];const i=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",n=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:i,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,opaque:t.opaque!==void 0?t.opaque:!0,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:n,wrapX:t.wrapX,zDirection:t.zDirection})}}const o0=s0,ho={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class a0 extends Us{constructor(t){t=t||{};const e=Object.assign({},t);delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getPreload(){return this.get(ho.PRELOAD)}setPreload(t){this.set(ho.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(ho.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(ho.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}const l0=a0,yd=[];let jn=null;function h0(){jn=$t(1,1,void 0,{willReadFrequently:!0})}class c0 extends $u{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=Vt(),this.pixelTransform=Vt(),this.inversePixelTransform=Vt(),this.context=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(t,e,i){jn||h0(),jn.clearRect(0,0,1,1);let n;try{jn.drawImage(t,e,i,1,1,0,0,1,1),n=jn.getImageData(0,0,1,1).data}catch{return jn=null,null}return n}getBackground(t){let i=this.getLayer().getBackground();return typeof i=="function"&&(i=i(t.viewState.resolution)),i||void 0}useContainer(t,e,i){const n=this.getLayer().getClassName();let o,a;if(t&&t.className===n&&(!i||t&&t.style.backgroundColor&&ei(yr(t.style.backgroundColor),yr(i)))){const h=t.firstElementChild;h instanceof HTMLCanvasElement&&(a=h.getContext("2d"))}if(a&&a.canvas.style.transform===e?(this.container=t,this.context=a,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){o=document.createElement("div"),o.className=n;let h=o.style;h.position="absolute",h.width="100%",h.height="100%",a=$t();const c=a.canvas;o.appendChild(c),h=c.style,h.position="absolute",h.left="0",h.transformOrigin="top left",this.container=o,this.context=a}!this.containerReused&&i&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=i)}clipUnrotated(t,e,i){const n=qi(i),o=Ts(i),a=bs(i),h=Ls(i);Ot(e.coordinateToPixelTransform,n),Ot(e.coordinateToPixelTransform,o),Ot(e.coordinateToPixelTransform,a),Ot(e.coordinateToPixelTransform,h);const c=this.inversePixelTransform;Ot(c,n),Ot(c,o),Ot(c,a),Ot(c,h),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.lineTo(Math.round(h[0]),Math.round(h[1])),t.clip()}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){const o=new vr(t,this.inversePixelTransform,i,e);n.dispatchEvent(o)}}preRender(t,e){this.frameState=e,this.dispatchRenderEvent_(qt.PRERENDER,t,e)}postRender(t,e){this.dispatchRenderEvent_(qt.POSTRENDER,t,e)}getRenderTransform(t,e,i,n,o,a,h){const c=o/2,d=a/2,f=n/e,_=-f,m=-t[0]+h,E=-t[1];return Ne(this.tempTransform,c,d,f,_,-i,m,E)}disposeInternal(){delete this.frameState,super.disposeInternal()}}const vd=c0;class u0 extends vd{constructor(t){super(t),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=ge(),this.tmpTileRange_=new hd(0,0,0,0)}isDrawableTile(t){const e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==Q.LOADED||i==Q.EMPTY||i==Q.ERROR&&!n}getTile(t,e,i,n){const o=n.pixelRatio,a=n.viewState.projection,h=this.getLayer();let d=h.getSource().getTile(t,e,i,o,a);return d.getState()==Q.ERROR&&h.getUseInterimTilesOnError()&&h.getPreload()>0&&(this.newTiles_=!0),this.isDrawableTile(d)||(d=d.getInterimTile()),d}getData(t){const e=this.frameState;if(!e)return null;const i=this.getLayer(),n=Ot(e.pixelToCoordinateTransform,t.slice()),o=i.getExtent();if(o&&!ws(o,n))return null;const a=e.pixelRatio,h=e.viewState.projection,c=e.viewState,d=i.getRenderSource(),f=d.getTileGridForProjection(c.projection),_=d.getTilePixelRatio(e.pixelRatio);for(let m=f.getZForResolution(c.resolution);m>=f.getMinZoom();--m){const E=f.getTileCoordForCoordAndZ(n,m),v=d.getTile(m,E[1],E[2],a,h);if(!(v instanceof ad||v instanceof xl)||v instanceof xl&&v.getState()===Q.EMPTY)return null;if(v.getState()!==Q.LOADED)continue;const b=f.getOrigin(m),C=pe(f.getTileSize(m)),S=f.getResolution(m),y=Math.floor(_*((n[0]-b[0])/S-E[1]*C[0])),x=Math.floor(_*((b[1]-n[1])/S-E[2]*C[1])),T=Math.round(_*d.getGutterForProjection(c.projection));return this.getImageData(v.getImage(),y+T,x+T)}return null}loadedTileCallback(t,e,i){return this.isDrawableTile(i)?super.loadedTileCallback(t,e,i):!1}prepareFrame(t){return!!this.getLayer().getSource()}renderFrame(t,e){const i=t.layerStatesArray[t.layerIndex],n=t.viewState,o=n.projection,a=n.resolution,h=n.center,c=n.rotation,d=t.pixelRatio,f=this.getLayer(),_=f.getSource(),m=_.getRevision(),E=_.getTileGridForProjection(o),v=E.getZForResolution(a,_.zDirection),b=E.getResolution(v);let C=t.extent;const S=t.viewState.resolution,y=_.getTilePixelRatio(d),x=Math.round(Tt(C)/S*d),T=Math.round(ze(C)/S*d),k=i.extent&&Qi(i.extent);k&&(C=_r(C,Qi(i.extent)));const R=b*x/2/y,M=b*T/2/y,A=[h[0]-R,h[1]-M,h[0]+R,h[1]+M],z=E.getTileRangeForExtentAndZ(C,v),U={};U[v]={};const Z=this.createLoadedTileFinder(_,o,U),H=this.tmpExtent,K=this.tmpTileRange_;this.newTiles_=!1;const nt=c?va(n.center,S,c,t.size):void 0;for(let Lt=z.minX;Lt<=z.maxX;++Lt)for(let tt=z.minY;tt<=z.maxY;++tt){if(c&&!E.tileCoordIntersectsViewport([v,Lt,tt],nt))continue;const J=this.getTile(v,Lt,tt,t);if(this.isDrawableTile(J)){const St=ht(this);if(J.getState()==Q.LOADED){U[v][J.tileCoord.toString()]=J;let ve=J.inTransition(St);ve&&i.opacity!==1&&(J.endTransition(St),ve=!1),!this.newTiles_&&(ve||!this.renderedTiles.includes(J))&&(this.newTiles_=!0)}if(J.getAlpha(St,t.time)===1)continue}const ot=E.getTileCoordChildTileRange(J.tileCoord,K,H);let Ft=!1;ot&&(Ft=Z(v+1,ot)),Ft||E.forEachTileCoordParentTileRange(J.tileCoord,Z,K,H)}const q=b/a*d/y;Ne(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/d,1/d,c,-x/2,-T/2);const X=Uc(this.pixelTransform);this.useContainer(e,X,this.getBackground(t));const j=this.context,B=j.canvas;Is(this.inversePixelTransform,this.pixelTransform),Ne(this.tempTransform,x/2,T/2,q,q,0,-x/2,-T/2),B.width!=x||B.height!=T?(B.width=x,B.height=T):this.containerReused||j.clearRect(0,0,x,T),k&&this.clipUnrotated(j,t,k),_.getInterpolate()||(j.imageSmoothingEnabled=!1),this.preRender(j,t),this.renderedTiles.length=0;let yt=Object.keys(U).map(Number);yt.sort(xi);let W,rt,F;i.opacity===1&&(!this.containerReused||_.getOpaque(t.viewState.projection))?yt=yt.reverse():(W=[],rt=[]);for(let Lt=yt.length-1;Lt>=0;--Lt){const tt=yt[Lt],J=_.getTilePixelSize(tt,d,o),Ft=E.getResolution(tt)/b,St=J[0]*Ft*q,ve=J[1]*Ft*q,We=E.getTileCoordForCoordAndZ(qi(A),tt),Di=E.getTileCoordExtent(We),xe=Ot(this.tempTransform,[y*(Di[0]-A[0])/b,y*(A[3]-Di[3])/b]),Oi=y*_.getGutterForProjection(o),He=U[tt];for(const Fi in He){const Pe=He[Fi],zi=Pe.tileCoord,di=We[1]-zi[1],Hn=Math.round(xe[0]-(di-1)*St),fi=We[2]-zi[2],hn=Math.round(xe[1]-(fi-1)*ve),Xt=Math.round(xe[0]-di*St),ie=Math.round(xe[1]-fi*ve),me=Hn-Xt,ke=hn-ie,Ve=v===tt,Xe=Ve&&Pe.getAlpha(ht(this),t.time)!==1;let Re=!1;if(!Xe)if(W){F=[Xt,ie,Xt+me,ie,Xt+me,ie+ke,Xt,ie+ke];for(let Ni=0,cn=W.length;Ni<cn;++Ni)if(v!==tt&&tt<rt[Ni]){const Wt=W[Ni];se([Xt,ie,Xt+me,ie+ke],[Wt[0],Wt[3],Wt[4],Wt[7]])&&(Re||(j.save(),Re=!0),j.beginPath(),j.moveTo(F[0],F[1]),j.lineTo(F[2],F[3]),j.lineTo(F[4],F[5]),j.lineTo(F[6],F[7]),j.moveTo(Wt[6],Wt[7]),j.lineTo(Wt[4],Wt[5]),j.lineTo(Wt[2],Wt[3]),j.lineTo(Wt[0],Wt[1]),j.clip())}W.push(F),rt.push(tt)}else j.clearRect(Xt,ie,me,ke);this.drawTileImage(Pe,t,Xt,ie,me,ke,Oi,Ve),W&&!Xe?(Re&&j.restore(),this.renderedTiles.unshift(Pe)):this.renderedTiles.push(Pe),this.updateUsedTiles(t.usedTiles,_,Pe)}}return this.renderedRevision=m,this.renderedResolution=b,this.extentChanged=!this.renderedExtent_||!Cn(this.renderedExtent_,A),this.renderedExtent_=A,this.renderedPixelRatio=d,this.renderedProjection=o,this.manageTilePyramid(t,_,E,d,o,C,v,f.getPreload()),this.scheduleExpireCache(t,_),this.postRender(j,t),i.extent&&j.restore(),j.imageSmoothingEnabled=!0,X!==B.style.transform&&(B.style.transform=X),this.container}drawTileImage(t,e,i,n,o,a,h,c){const d=this.getTileImage(t);if(!d)return;const f=ht(this),_=e.layerStatesArray[e.layerIndex],m=_.opacity*(c?t.getAlpha(f,e.time):1),E=m!==this.context.globalAlpha;E&&(this.context.save(),this.context.globalAlpha=m),this.context.drawImage(d,h,h,d.width-2*h,d.height-2*h,i,n,o,a),E&&this.context.restore(),m!==_.opacity?e.animate=!0:c&&t.endTransition(f)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}scheduleExpireCache(t,e){if(e.canExpireCache()){const i=(function(n,o,a){const h=ht(n);h in a.usedTiles&&n.expireCache(a.viewState.projection,a.usedTiles[h])}).bind(null,e);t.postRenderFunctions.push(i)}}updateUsedTiles(t,e,i){const n=ht(e);n in t||(t[n]={}),t[n][i.getKey()]=!0}manageTilePyramid(t,e,i,n,o,a,h,c,d){const f=ht(e);f in t.wantedTiles||(t.wantedTiles[f]={});const _=t.wantedTiles[f],m=t.tileQueue,E=i.getMinZoom(),v=t.viewState.rotation,b=v?va(t.viewState.center,t.viewState.resolution,v,t.size):void 0;let C=0,S,y,x,T,k,R;for(R=E;R<=h;++R)for(y=i.getTileRangeForExtentAndZ(a,R,y),x=i.getResolution(R),T=y.minX;T<=y.maxX;++T)for(k=y.minY;k<=y.maxY;++k)v&&!i.tileCoordIntersectsViewport([R,T,k],b)||(h-R<=c?(++C,S=e.getTile(R,T,k,n,o),S.getState()==Q.IDLE&&(_[S.getKey()]=!0,m.isKeyQueued(S.getKey())||m.enqueue([S,f,i.getTileCoordCenter(S.tileCoord),x])),d!==void 0&&d(S)):e.useTile(R,T,k,o));e.updateCacheSize(C,o)}}const d0=u0;class f0 extends l0{constructor(t){super(t)}createRenderer(){return new d0(this)}}const g0=f0;class _0{constructor(t){this.rbush_=new yh(t),this.items_={}}insert(t,e){const i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[ht(e)]=i}load(t,e){const i=new Array(e.length);for(let n=0,o=e.length;n<o;n++){const a=t[n],h=e[n],c={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:h};i[n]=c,this.items_[ht(h)]=c}this.rbush_.load(i)}remove(t){const e=ht(t),i=this.items_[e];return delete this.items_[e],this.rbush_.remove(i)!==null}update(t,e){const i=this.items_[ht(e)],n=[i.minX,i.minY,i.maxX,i.maxY];Cn(n,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(n){return n.value})}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,e){return this.forEach_(this.getInExtent(t),e)}forEach_(t,e){let i;for(let n=0,o=t.length;n<o;n++)if(i=e(t[n]),i)return i;return i}isEmpty(){return wn(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const e=this.rbush_.toJSON();return Ei(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 xd=_0;function p0(r,t){return[[-1/0,-1/0,1/0,1/0]]}let m0=!1;function y0(r,t,e,i,n,o,a){const h=new XMLHttpRequest;h.open("GET",typeof r=="function"?r(e,i,n):r,!0),t.getType()=="arraybuffer"&&(h.responseType="arraybuffer"),h.withCredentials=m0,h.onload=function(c){if(!h.status||h.status>=200&&h.status<300){const d=t.getType();let f;d=="json"||d=="text"?f=h.responseText:d=="xml"?(f=h.responseXML,f||(f=new DOMParser().parseFromString(h.responseText,"application/xml"))):d=="arraybuffer"&&(f=h.response),f?o(t.readFeatures(f,{extent:e,featureProjection:n}),t.readProjection(f)):a()}else a()},h.onerror=a,h.send()}function Ed(r,t){return function(e,i,n,o,a){const h=this;y0(r,t,e,i,n,function(c,d){h.addFeatures(c),o!==void 0&&o(c)},a||xn)}}class Ri extends Qe{constructor(t,e,i){super(t),this.feature=e,this.features=i}}class v0 extends gd{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_=xn,this.format_=t.format,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&&(gt(this.format_,"`format` must be set when `url` is set"),this.loader_=Ed(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:p0;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new xd:null,this.loadedExtentsRtree_=new xd,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,n;Array.isArray(t.features)?n=t.features:t.features&&(i=t.features,n=i.getArray()),!e&&i===void 0&&(i=new Ge(n)),n!==void 0&&this.addFeaturesInternal(n),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=ht(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const i=t.getGeometry();if(i){const n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Ri(ee.ADDFEATURE,t))}setupChangeEvents_(t,e){this.featureChangeKeys_[t]=[ut(e,at.CHANGE,this.handleFeatureChange_,this),ut(e,vn.PROPERTYCHANGE,this.handleFeatureChange_,this)]}addToIndex_(t,e){let i=!0;const n=e.getId();return n!==void 0&&(n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e),i&&(gt(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),i}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],i=[],n=[];for(let o=0,a=t.length;o<a;o++){const h=t[o],c=ht(h);this.addToIndex_(c,h)&&i.push(h)}for(let o=0,a=i.length;o<a;o++){const h=i[o],c=ht(h);this.setupChangeEvents_(c,h);const d=h.getGeometry();if(d){const f=d.getExtent();e.push(f),n.push(h)}else this.nullGeometryFeatures_[c]=h}if(this.featuresRtree_&&this.featuresRtree_.load(e,n),this.hasListener(ee.ADDFEATURE))for(let o=0,a=i.length;o<a;o++)this.dispatchEvent(new Ri(ee.ADDFEATURE,i[o]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener(ee.ADDFEATURE,function(i){e||(e=!0,t.push(i.feature),e=!1)}),this.addEventListener(ee.REMOVEFEATURE,function(i){e||(e=!0,t.remove(i.feature),e=!1)}),t.addEventListener(oe.ADD,i=>{e||(e=!0,this.addFeature(i.element),e=!1)}),t.addEventListener(oe.REMOVE,i=>{e||(e=!0,this.removeFeature(i.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(wt);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const i=n=>{this.removeFeatureInternal(n)};this.featuresRtree_.forEach(i);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 Ri(ee.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 i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,function(n){if(n.getGeometry().intersectsCoordinate(t))return e(n)})}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(i){if(i.getGeometry().intersectsExtent(t)){const o=e(i);if(o)return o}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),wn(this.nullGeometryFeatures_)||ti(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(i){e.push(i)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const n=Dp(t,e);return[].concat(...n.map(o=>this.featuresRtree_.getInExtent(o)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const i=t[0],n=t[1];let o=null;const a=[NaN,NaN];let h=1/0;const c=[-1/0,-1/0,1/0,1/0];return e=e||cr,this.featuresRtree_.forEachInExtent(c,function(d){if(e(d)){const f=d.getGeometry(),_=h;if(h=f.closestPointXY(i,n,a,h),h<_){o=d;const m=Math.sqrt(h);c[0]=i-m,c[1]=n-m,c[2]=i+m,c[3]=n+m}}}),o}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,i=ht(e),n=e.getGeometry();if(!n)i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);else{const a=n.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(a,e)):this.featuresRtree_&&this.featuresRtree_.update(a,e)}const o=e.getId();if(o!==void 0){const a=o.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Ri(ee.CHANGEFEATURE,e))}hasFeature(t){const e=t.getId();return e!==void 0?e in this.idIndex_:ht(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&wn(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(t,e,i){const n=this.loadedExtentsRtree_,o=this.strategy_(t,e,i);for(let a=0,h=o.length;a<h;++a){const c=o[a];n.forEachInExtent(c,function(f){return Yi(f.extent,c)})||(++this.loadingExtentsCount_,this.dispatchEvent(new Ri(ee.FEATURESLOADSTART)),this.loader_.call(this,c,e,i,f=>{--this.loadingExtentsCount_,this.dispatchEvent(new Ri(ee.FEATURESLOADEND,void 0,f))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Ri(ee.FEATURESLOADERROR))}),n.insert(c,{extent:c.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_;let i;e.forEachInExtent(t,function(n){if(Cn(n.extent,t))return i=n,!0}),i&&e.remove(i)}removeFeature(t){if(!t)return;const e=ht(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=ht(t),i=this.featureChangeKeys_[e];if(!i)return;i.forEach(wt),delete this.featureChangeKeys_[e];const n=t.getId();return n!==void 0&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Ri(ee.REMOVEFEATURE,t)),t}removeFromIdIndex_(t){let e=!1;for(const i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e}setLoader(t){this.loader_=t}setUrl(t){gt(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(Ed(t,this.format_))}}const co=v0;class Cl extends be{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 Cl(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const i=this.getStyle();return i&&t.setStyle(i),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_&&(wt(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=ut(t,at.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?x0(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 x0(r){if(typeof r=="function")return r;let t;return Array.isArray(r)?t=r:(gt(typeof r.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[r]),function(){return t}}const E0=Cl;class uo extends Wc{constructor(t){super(),this.geometries_=t||null,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(wt),this.changeEventsKeys_.length=0}listenGeometriesChange_(){if(this.geometries_)for(let t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(ut(this.geometries_[t],at.CHANGE,this.changed,this))}clone(){const t=new uo(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<Xi(this.getExtent(),t,e))return n;const o=this.geometries_;for(let a=0,h=o.length;a<h;++a)n=o[a].closestPointXY(t,e,i,n);return n}containsXY(t,e){const i=this.geometries_;for(let n=0,o=i.length;n<o;++n)if(i[n].containsXY(t,e))return!0;return!1}computeExtent(t){fr(t);const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)_c(t,e[i].getExtent());return t}getGeometries(){return wd(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[];const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);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=[],i=this.geometries_;let n=!1;for(let o=0,a=i.length;o<a;++o){const h=i[o],c=h.getSimplifiedGeometry(t);e.push(c),c!==h&&(n=!0)}if(n){const o=new uo(null);return o.setGeometriesArray(e),o}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this}getType(){return"GeometryCollection"}intersectsExtent(t){const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)if(e[i].intersectsExtent(t))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(t,e){const i=this.geometries_;for(let n=0,o=i.length;n<o;++n)i[n].rotate(t,e);this.changed()}scale(t,e,i){i||(i=Ki(this.getExtent()));const n=this.geometries_;for(let o=0,a=n.length;o<a;++o)n[o].scale(t,e,i);this.changed()}setGeometries(t){this.setGeometriesArray(wd(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)e[i].applyTransform(t);this.changed()}translate(t,e){const i=this.geometries_;for(let n=0,o=i.length;n<o;++n)i[n].translate(t,e);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function wd(r){const t=[];for(let e=0,i=r.length;e<i;++e)t.push(r[e].clone());return t}const w0=uo;class L0{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let i=e.dataProjection?Gt(e.dataProjection):this.readProjection(t);e.extent&&i&&i.getUnits()==="tile-pixels"&&(i=Gt(i),i.setWorldExtent(e.extent)),e={dataProjection:i,featureProjection:e.featureProjection}}return this.adaptOptions(e)}adaptOptions(t){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)}getType(){return st()}readFeature(t,e){return st()}readFeatures(t,e){return st()}readGeometry(t,e){return st()}readProjection(t){return st()}writeFeature(t,e){return st()}writeFeatures(t,e){return st()}writeGeometry(t,e){return st()}}function Ld(r,t,e){const i=e?Gt(e.featureProjection):null,n=e?Gt(e.dataProjection):null;let o;if(i&&n&&!Ji(i,n)?o=(t?r.clone():r).transform(t?i:n,t?n:i):o=r,t&&e&&e.decimals!==void 0){const a=Math.pow(10,e.decimals),h=function(c){for(let d=0,f=c.length;d<f;++d)c[d]=Math.round(c[d]*a)/a;return c};o===r&&(o=r.clone()),o.applyTransform(h)}return o}class b0 extends L0{constructor(){super()}getType(){return"json"}readFeature(t,e){return this.readFeatureFromObject(fo(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(fo(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return st()}readFeaturesFromObject(t,e){return st()}readGeometry(t,e){return this.readGeometryFromObject(fo(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return st()}readProjection(t){return this.readProjectionFromObject(fo(t))}readProjectionFromObject(t){return st()}writeFeature(t,e){return JSON.stringify(this.writeFeatureObject(t,e))}writeFeatureObject(t,e){return st()}writeFeatures(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))}writeFeaturesObject(t,e){return st()}writeGeometry(t,e){return JSON.stringify(this.writeGeometryObject(t,e))}writeGeometryObject(t,e){return st()}}function fo(r){if(typeof r=="string"){const t=JSON.parse(r);return t||null}return r!==null?r:null}const T0=b0;function bd(r,t,e,i,n,o,a){let h,c;const d=(e-t)/i;if(d===1)h=t;else if(d===2)h=t,c=n;else if(d!==0){let f=r[t],_=r[t+1],m=0;const E=[0];for(let C=t+i;C<e;C+=i){const S=r[C],y=r[C+1];m+=Math.sqrt((S-f)*(S-f)+(y-_)*(y-_)),E.push(m),f=S,_=y}const v=n*m,b=cp(E,v);b<0?(c=(v-E[-b-2])/(E[-b-1]-E[-b-2]),h=t+(-b-2)*i):h=t+b*i}a=a>1?a:2,o=o||new Array(a);for(let f=0;f<a;++f)o[f]=h===void 0?NaN:c===void 0?r[h+f]:_e(r[h+f],r[h+i+f],c);return o}function Sl(r,t,e,i,n,o){if(e==t)return null;let a;if(n<r[t+i-1])return o?(a=r.slice(t,t+i),a[i-1]=n,a):null;if(r[e-1]<n)return o?(a=r.slice(e-i,e),a[i-1]=n,a):null;if(n==r[t+i-1])return r.slice(t,t+i);let h=t/i,c=e/i;for(;h<c;){const m=h+c>>1;n<r[(m+1)*i-1]?c=m:h=m+1}const d=r[h*i-1];if(n==d)return r.slice((h-1)*i,(h-1)*i+i);const f=r[(h+1)*i-1],_=(n-d)/(f-d);a=[];for(let m=0;m<i-1;++m)a.push(_e(r[(h-1)*i+m],r[h*i+m],_));return a.push(n),a}function C0(r,t,e,i,n,o,a){if(a)return Sl(r,t,e[e.length-1],i,n,o);let h;if(n<r[i-1])return o?(h=r.slice(0,i),h[i-1]=n,h):null;if(r[r.length-1]<n)return o?(h=r.slice(r.length-i),h[i-1]=n,h):null;for(let c=0,d=e.length;c<d;++c){const f=e[c];if(t!=f){if(n<r[t+i-1])return null;if(n<=r[f-1])return Sl(r,t,f,i,n,!1);t=f}}return null}function Td(r,t,e,i){let n=r[t],o=r[t+1],a=0;for(let h=t+i;h<e;h+=i){const c=r[h],d=r[h+1];a+=Math.sqrt((c-n)*(c-n)+(d-o)*(d-o)),n=c,o=d}return a}class go extends en{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){this.flatCoordinates?ti(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()}clone(){const t=new go(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Xi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ma(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Aa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,n))}forEachSegment(t){return Jc(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,Sl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return Li(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return bd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return Td(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const e=[];return e.length=Fa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new go(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return Fs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=As(this.flatCoordinates,0,t,this.stride),this.changed()}}const Pl=go;class _o extends en{constructor(t,e,i){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(e!==void 0&&i)this.setFlatCoordinates(e,t),this.ends_=i;else{let n=this.getLayout();const o=t,a=[],h=[];for(let c=0,d=o.length;c<d;++c){const f=o[c];c===0&&(n=f.getLayout()),ti(a,f.getFlatCoordinates()),h.push(a.length)}this.setFlatCoordinates(n,a),this.ends_=h}}appendLineString(t){this.flatCoordinates?ti(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new _o(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Xi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ia(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Da(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,n))}getCoordinateAtM(t,e,i){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(e=e!==void 0?e:!1,i=i!==void 0?i:!1,C0(this.flatCoordinates,0,this.ends_,this.stride,t,e,i))}getCoordinates(){return pr(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new Pl(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLineStrings(){const t=this.flatCoordinates,e=this.ends_,i=this.layout,n=[];let o=0;for(let a=0,h=e.length;a<h;++a){const c=e[a],d=new Pl(t.slice(o,c),i);n.push(d),o=c}return n}getFlatMidpoints(){const t=[],e=this.flatCoordinates;let i=0;const n=this.ends_,o=this.stride;for(let a=0,h=n.length;a<h;++a){const c=n[a],d=bd(e,i,c,o,.5);ti(t,d),i=c}return t}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=mm(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,i),new _o(e,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(t){return bm(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Oa(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}const S0=_o;class kl extends en{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){this.flatCoordinates?ti(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()}clone(){const t=new kl(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<Xi(this.getExtent(),t,e))return n;const o=this.flatCoordinates,a=this.stride;for(let h=0,c=o.length;h<c;h+=a){const d=$i(t,e,o[h],o[h+1]);if(d<n){n=d;for(let f=0;f<a;++f)i[f]=o[h+f];i.length=a}}return n}getCoordinates(){return Li(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new Os(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){const t=this.flatCoordinates,e=this.layout,i=this.stride,n=[];for(let o=0,a=t.length;o<a;o+=i){const h=new Os(t.slice(o,o+i),e);n.push(h)}return n}getType(){return"MultiPoint"}intersectsExtent(t){const e=this.flatCoordinates,i=this.stride;for(let n=0,o=e.length;n<o;n+=i){const a=e[n],h=e[n+1];if(_a(t,a,h))return!0}return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=As(this.flatCoordinates,0,t,this.stride),this.changed()}}const Cd=kl;function P0(r,t,e,i){const n=[];let o=ge();for(let a=0,h=e.length;a<h;++a){const c=e[a];o=gc(r,t,c[0],i),n.push((o[0]+o[2])/2,(o[1]+o[3])/2),t=c[c.length-1]}return n}class po extends en{constructor(t,e,i){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(t[0])){let n=this.getLayout();const o=t,a=[],h=[];for(let c=0,d=o.length;c<d;++c){const f=o[c];c===0&&(n=f.getLayout());const _=a.length,m=f.getEnds();for(let E=0,v=m.length;E<v;++E)m[E]+=_;ti(a,f.getFlatCoordinates()),h.push(m)}e=n,t=a,i=h}e!==void 0&&i?(this.setFlatCoordinates(e,t),this.endss_=i):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 i=this.flatCoordinates.length;ti(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(let n=0,o=e.length;n<o;++n)e[n]+=i}this.endss_.push(e),this.changed()}clone(){const t=this.endss_.length,e=new Array(t);for(let n=0;n<t;++n)e[n]=this.endss_[n].slice();const i=new po(this.flatCoordinates.slice(),this.layout,e);return i.applyProperties(this),i}closestPointXY(t,e,i,n){return n<Xi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(fm(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),gm(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return wm(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return xm(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),nu(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,za(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=P0(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Lm(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Cd(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;Sm(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=nu(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=vm(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,i),new po(e,"XY",i)}getPolygon(t){if(t<0||this.endss_.length<=t)return null;let e;if(t===0)e=0;else{const o=this.endss_[t-1];e=o[o.length-1]}const i=this.endss_[t].slice(),n=i[i.length-1];if(e!==0)for(let o=0,a=i.length;o<a;++o)i[o]-=e;return new zs(this.flatCoordinates.slice(e,n),this.layout,i)}getPolygons(){const t=this.layout,e=this.flatCoordinates,i=this.endss_,n=[];let o=0;for(let a=0,h=i.length;a<h;++a){const c=i[a].slice(),d=c[c.length-1];if(o!==0)for(let _=0,m=c.length;_<m;++_)c[_]-=o;const f=new zs(e.slice(o,d),t,c);n.push(f),o=d}return n}getType(){return"MultiPolygon"}intersectsExtent(t){return Tm(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=pm(this.flatCoordinates,0,t,this.stride,this.endss_);if(i.length===0)this.flatCoordinates.length=0;else{const n=i[i.length-1];this.flatCoordinates.length=n.length===0?0:n[n.length-1]}this.changed()}}const k0=po;class R0 extends T0{constructor(t){t=t||{},super(),this.dataProjection=Gt(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=Gt(t.featureProjection)),this.geometryName_=t.geometryName,this.extractGeometryName_=t.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(t,e){let i=null;t.type==="Feature"?i=t:i={type:"Feature",geometry:t,properties:null};const n=Rl(i.geometry,e),o=new E0;return this.geometryName_?o.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&o.setGeometryName(i.geometry_name),o.setGeometry(n),"id"in i&&o.setId(i.id),i.properties&&o.setProperties(i.properties,!0),o}readFeaturesFromObject(t,e){const i=t;let n=null;if(i.type==="FeatureCollection"){const o=t;n=[];const a=o.features;for(let h=0,c=a.length;h<c;++h)n.push(this.readFeatureFromObject(a[h],e))}else n=[this.readFeatureFromObject(t,e)];return n}readGeometryFromObject(t,e){return Rl(t,e)}readProjectionFromObject(t){const e=t.crs;let i;if(e)if(e.type=="name")i=Gt(e.properties.name);else if(e.type==="EPSG")i=Gt("EPSG:"+e.properties.code);else throw new Error("Unknown SRS type");else i=this.dataProjection;return i}writeFeatureObject(t,e){e=this.adaptOptions(e);const i={type:"Feature",geometry:null,properties:null},n=t.getId();if(n!==void 0&&(i.id=n),!t.hasProperties())return i;const o=t.getProperties(),a=t.getGeometry();return a&&(i.geometry=Ml(a,e),delete o[t.getGeometryName()]),wn(o)||(i.properties=o),i}writeFeaturesObject(t,e){e=this.adaptOptions(e);const i=[];for(let n=0,o=t.length;n<o;++n)i.push(this.writeFeatureObject(t[n],e));return{type:"FeatureCollection",features:i}}writeGeometryObject(t,e){return Ml(t,this.adaptOptions(e))}}function Rl(r,t){if(!r)return null;let e;switch(r.type){case"Point":{e=I0(r);break}case"LineString":{e=A0(r);break}case"Polygon":{e=z0(r);break}case"MultiPoint":{e=O0(r);break}case"MultiLineString":{e=D0(r);break}case"MultiPolygon":{e=F0(r);break}case"GeometryCollection":{e=M0(r);break}default:throw new Error("Unsupported GeoJSON type: "+r.type)}return Ld(e,!1,t)}function M0(r,t){const e=r.geometries.map(function(i){return Rl(i,t)});return new w0(e)}function I0(r){return new Os(r.coordinates)}function A0(r){return new Pl(r.coordinates)}function D0(r){return new S0(r.coordinates)}function O0(r){return new Cd(r.coordinates)}function F0(r){return new k0(r.coordinates)}function z0(r){return new zs(r.coordinates)}function Ml(r,t){r=Ld(r,!0,t);const e=r.getType();let i;switch(e){case"Point":{i=j0(r);break}case"LineString":{i=B0(r);break}case"Polygon":{i=W0(r,t);break}case"MultiPoint":{i=U0(r);break}case"MultiLineString":{i=G0(r);break}case"MultiPolygon":{i=Z0(r,t);break}case"GeometryCollection":{i=N0(r,t);break}case"Circle":{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+e)}return i}function N0(r,t){return t=Object.assign({},t),delete t.featureProjection,{type:"GeometryCollection",geometries:r.getGeometriesArray().map(function(i){return Ml(i,t)})}}function B0(r,t){return{type:"LineString",coordinates:r.getCoordinates()}}function G0(r,t){return{type:"MultiLineString",coordinates:r.getCoordinates()}}function U0(r,t){return{type:"MultiPoint",coordinates:r.getCoordinates()}}function Z0(r,t){let e;return t&&(e=t.rightHanded),{type:"MultiPolygon",coordinates:r.getCoordinates(e)}}function j0(r,t){return{type:"Point",coordinates:r.getCoordinates()}}function W0(r,t){let e;return t&&(e=t.rightHanded),{type:"Polygon",coordinates:r.getCoordinates(e)}}const mo=R0,Dr={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},yo=[Dr.FILL],Mi=[Dr.STROKE],ln=[Dr.BEGIN_PATH],Sd=[Dr.CLOSE_PATH],et=Dr;class H0{drawCustom(t,e,i,n){}drawGeometry(t){}setStyle(t){}drawCircle(t,e){}drawFeature(t,e){}drawGeometryCollection(t,e){}drawLineString(t,e){}drawMultiLineString(t,e){}drawMultiPoint(t,e){}drawMultiPolygon(t,e){}drawPoint(t,e){}drawPolygon(t,e){}drawText(t,e){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}const Pd=H0;class V0 extends Pd{constructor(t,e,i,n){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=n,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const e=this.pixelRatio;return e==1?t:t.map(function(i){return i*e})}appendFlatPointCoordinates(t,e){const i=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,o=this.coordinates;let a=o.length;for(let h=0,c=t.length;h<c;h+=e)n[0]=t[h],n[1]=t[h+1],ws(i,n)&&(o[a++]=n[0],o[a++]=n[1]);return a}appendFlatLineCoordinates(t,e,i,n,o,a){const h=this.coordinates;let c=h.length;const d=this.getBufferedMaxExtent();a&&(e+=n);let f=t[e],_=t[e+1];const m=this.tmpCoordinate_;let E=!0,v,b,C;for(v=e+n;v<i;v+=n)m[0]=t[v],m[1]=t[v+1],C=pa(d,m),C!==b?(E&&(h[c++]=f,h[c++]=_,E=!1),h[c++]=m[0],h[c++]=m[1]):C===Zt.INTERSECTING?(h[c++]=m[0],h[c++]=m[1],E=!1):E=!0,f=m[0],_=m[1],b=C;return(o&&E||v===e+n)&&(h[c++]=f,h[c++]=_),c}drawCustomCoordinates_(t,e,i,n,o){for(let a=0,h=i.length;a<h;++a){const c=i[a],d=this.appendFlatLineCoordinates(t,e,c,n,!1,!1);o.push(d),e=c}return e}drawCustom(t,e,i,n){this.beginGeometry(t,e);const o=t.getType(),a=t.getStride(),h=this.coordinates.length;let c,d,f,_,m;switch(o){case"MultiPolygon":c=t.getOrientedFlatCoordinates(),_=[];const E=t.getEndss();m=0;for(let v=0,b=E.length;v<b;++v){const C=[];m=this.drawCustomCoordinates_(c,m,E[v],a,C),_.push(C)}this.instructions.push([et.CUSTOM,h,_,t,i,za]),this.hitDetectionInstructions.push([et.CUSTOM,h,_,t,n||i,za]);break;case"Polygon":case"MultiLineString":f=[],c=o=="Polygon"?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),m=this.drawCustomCoordinates_(c,0,t.getEnds(),a,f),this.instructions.push([et.CUSTOM,h,f,t,i,pr]),this.hitDetectionInstructions.push([et.CUSTOM,h,f,t,n||i,pr]);break;case"LineString":case"Circle":c=t.getFlatCoordinates(),d=this.appendFlatLineCoordinates(c,0,c.length,a,!1,!1),this.instructions.push([et.CUSTOM,h,d,t,i,Li]),this.hitDetectionInstructions.push([et.CUSTOM,h,d,t,n||i,Li]);break;case"MultiPoint":c=t.getFlatCoordinates(),d=this.appendFlatPointCoordinates(c,a),d>h&&(this.instructions.push([et.CUSTOM,h,d,t,i,Li]),this.hitDetectionInstructions.push([et.CUSTOM,h,d,t,n||i,Li]));break;case"Point":c=t.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),d=this.coordinates.length,this.instructions.push([et.CUSTOM,h,d,t,i]),this.hitDetectionInstructions.push([et.CUSTOM,h,d,t,n||i]);break}this.endGeometry(e)}beginGeometry(t,e){this.beginGeometryInstruction1_=[et.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[et.BEGIN_GEOMETRY,e,0,t],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 i=t.length;let n,o,a=-1;for(e=0;e<i;++e)n=t[e],o=n[0],o==et.END_GEOMETRY?a=e:o==et.BEGIN_GEOMETRY&&(n[2]=e,up(this.hitDetectionInstructions,a,e),a=-1)}setFillStrokeStyle(t,e){const i=this.state;if(t){const n=t.getColor();i.fillStyle=Ue(n||ae)}else i.fillStyle=void 0;if(e){const n=e.getColor();i.strokeStyle=Ue(n||wr);const o=e.getLineCap();i.lineCap=o!==void 0?o:kn;const a=e.getLineDash();i.lineDash=a?a.slice():ni;const h=e.getLineDashOffset();i.lineDashOffset=h||ri;const c=e.getLineJoin();i.lineJoin=c!==void 0?c:Rn;const d=e.getWidth();i.lineWidth=d!==void 0?d:br;const f=e.getMiterLimit();i.miterLimit=f!==void 0?f:Er,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(t){const e=t.fillStyle,i=[et.SET_FILL_STYLE,e];return typeof e!="string"&&i.push(!0),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[et.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const i=t.fillStyle;(typeof i!="string"||t.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){const i=t.strokeStyle,n=t.lineCap,o=t.lineDash,a=t.lineDashOffset,h=t.lineJoin,c=t.lineWidth,d=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||o!=t.currentLineDash&&!ei(t.currentLineDash,o)||t.currentLineDashOffset!=a||t.currentLineJoin!=h||t.currentLineWidth!=c||t.currentMiterLimit!=d)&&(i!==void 0&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=o,t.currentLineDashOffset=a,t.currentLineJoin=h,t.currentLineWidth=c,t.currentMiterLimit=d)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[et.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=fc(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;Es(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}const Or=V0;class X0 extends Or{constructor(t,e,i,n){super(t,e,i,n),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){if(!this.image_)return;this.beginGeometry(t,e);const i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(i,n);this.instructions.push([et.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([et.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){if(!this.image_)return;this.beginGeometry(t,e);const i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(i,n);this.instructions.push([et.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([et.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 i=t.getAnchor(),n=t.getSize(),o=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=o[0],this.originY_=o[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const Y0=X0;class K0 extends Or{constructor(t,e,i,n){super(t,e,i,n)}drawFlatCoordinates_(t,e,i,n){const o=this.coordinates.length,a=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),h=[et.MOVE_TO_LINE_TO,o,a];return this.instructions.push(h),this.hitDetectionInstructions.push(h),i}drawLineString(t,e){const i=this.state,n=i.strokeStyle,o=i.lineWidth;if(n===void 0||o===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([et.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ni,ri],ln);const a=t.getFlatCoordinates(),h=t.getStride();this.drawFlatCoordinates_(a,0,a.length,h),this.hitDetectionInstructions.push(Mi),this.endGeometry(e)}drawMultiLineString(t,e){const i=this.state,n=i.strokeStyle,o=i.lineWidth;if(n===void 0||o===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([et.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ni,ri],ln);const a=t.getEnds(),h=t.getFlatCoordinates(),c=t.getStride();let d=0;for(let f=0,_=a.length;f<_;++f)d=this.drawFlatCoordinates_(h,d,a[f],c);this.hitDetectionInstructions.push(Mi),this.endGeometry(e)}finish(){const t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(Mi),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(Mi),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(ln)}}const q0=K0;class $0 extends Or{constructor(t,e,i,n){super(t,e,i,n)}drawFlatCoordinatess_(t,e,i,n){const o=this.state,a=o.fillStyle!==void 0,h=o.strokeStyle!==void 0,c=i.length;this.instructions.push(ln),this.hitDetectionInstructions.push(ln);for(let d=0;d<c;++d){const f=i[d],_=this.coordinates.length,m=this.appendFlatLineCoordinates(t,e,f,n,!0,!h),E=[et.MOVE_TO_LINE_TO,_,m];this.instructions.push(E),this.hitDetectionInstructions.push(E),h&&(this.instructions.push(Sd),this.hitDetectionInstructions.push(Sd)),e=f}return a&&(this.instructions.push(yo),this.hitDetectionInstructions.push(yo)),h&&(this.instructions.push(Mi),this.hitDetectionInstructions.push(Mi)),e}drawCircle(t,e){const i=this.state,n=i.fillStyle,o=i.strokeStyle;if(n===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([et.SET_FILL_STYLE,ae]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([et.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ni,ri]);const a=t.getFlatCoordinates(),h=t.getStride(),c=this.coordinates.length;this.appendFlatLineCoordinates(a,0,a.length,h,!1,!1);const d=[et.CIRCLE,c];this.instructions.push(ln,d),this.hitDetectionInstructions.push(ln,d),i.fillStyle!==void 0&&(this.instructions.push(yo),this.hitDetectionInstructions.push(yo)),i.strokeStyle!==void 0&&(this.instructions.push(Mi),this.hitDetectionInstructions.push(Mi)),this.endGeometry(e)}drawPolygon(t,e){const i=this.state,n=i.fillStyle,o=i.strokeStyle;if(n===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([et.SET_FILL_STYLE,ae]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([et.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ni,ri]);const a=t.getEnds(),h=t.getOrientedFlatCoordinates(),c=t.getStride();this.drawFlatCoordinatess_(h,0,a,c),this.endGeometry(e)}drawMultiPolygon(t,e){const i=this.state,n=i.fillStyle,o=i.strokeStyle;if(n===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([et.SET_FILL_STYLE,ae]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([et.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ni,ri]);const a=t.getEndss(),h=t.getOrientedFlatCoordinates(),c=t.getStride();let d=0;for(let f=0,_=a.length;f<_;++f)d=this.drawFlatCoordinatess_(h,d,a[f],c);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(t!==0){const e=this.coordinates;for(let i=0,n=e.length;i<n;++i)e[i]=nn(e[i],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;t.fillStyle!==void 0&&this.updateFillStyle(t,this.createFill),t.strokeStyle!==void 0&&this.updateStrokeStyle(t,this.applyStroke)}}const kd=$0;function J0(r,t,e,i,n){const o=[];let a=e,h=0,c=t.slice(e,2);for(;h<r&&a+n<i;){const[d,f]=c.slice(-2),_=t[a+n],m=t[a+n+1],E=Math.sqrt((_-d)*(_-d)+(m-f)*(m-f));if(h+=E,h>=r){const v=(r-h+E)/E,b=_e(d,_,v),C=_e(f,m,v);c.push(b,C),o.push(c),c=[b,C],h==r&&(a+=n),h=0}else if(h<r)c.push(t[a+n],t[a+n+1]),a+=n;else{const v=E-h,b=_e(d,_,v/E),C=_e(f,m,v/E);c.push(b,C),o.push(c),c=[b,C],h=0,a+=n}}return h>0&&o.push(c),o}function Q0(r,t,e,i,n){let o=e,a=e,h=0,c=0,d=e,f,_,m,E,v,b,C,S,y,x;for(_=e;_<i;_+=n){const T=t[_],k=t[_+1];v!==void 0&&(y=T-v,x=k-b,E=Math.sqrt(y*y+x*x),C!==void 0&&(c+=m,f=Math.acos((C*y+S*x)/(m*E)),f>r&&(c>h&&(h=c,o=d,a=_),c=0,d=_-n)),m=E,C=y,S=x),v=T,b=k}return c+=E,c>h?[d,_]:[o,a]}const vo={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class tE extends Or{constructor(t,e,i,n){super(t,e,i,n),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[ae]={fillStyle:ae},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",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){const i=this.textFillState_,n=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!i&&!n)return;const a=this.coordinates;let h=a.length;const c=t.getType();let d=null,f=t.getStride();if(o.placement==="line"&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!se(this.getBufferedMaxExtent(),t.getExtent()))return;let _;if(d=t.getFlatCoordinates(),c=="LineString")_=[d.length];else if(c=="MultiLineString")_=t.getEnds();else if(c=="Polygon")_=t.getEnds().slice(0,1);else if(c=="MultiPolygon"){const b=t.getEndss();_=[];for(let C=0,S=b.length;C<S;++C)_.push(b[C][0])}this.beginGeometry(t,e);const m=o.repeat,E=m?void 0:o.textAlign;let v=0;for(let b=0,C=_.length;b<C;++b){let S;m?S=J0(m*this.resolution,d,v,_[b],f):S=[d.slice(v,_[b])];for(let y=0,x=S.length;y<x;++y){const T=S[y];let k=0,R=T.length;if(E==null){const A=Q0(o.maxAngle,T,0,T.length,2);k=A[0],R=A[1]}for(let A=k;A<R;A+=f)a.push(T[A],T[A+1]);const M=a.length;v=_[b],this.drawChars_(h,M),h=M}}this.endGeometry(e)}else{let _=o.overflow?null:[];switch(c){case"Point":case"MultiPoint":d=t.getFlatCoordinates();break;case"LineString":d=t.getFlatMidpoint();break;case"Circle":d=t.getCenter();break;case"MultiLineString":d=t.getFlatMidpoints(),f=2;break;case"Polygon":d=t.getFlatInteriorPoint(),o.overflow||_.push(d[2]/this.resolution),f=3;break;case"MultiPolygon":const S=t.getFlatInteriorPoints();d=[];for(let y=0,x=S.length;y<x;y+=3)o.overflow||_.push(S[y+2]/this.resolution),d.push(S[y],S[y+1]);if(d.length===0)return;f=2;break}const m=this.appendFlatPointCoordinates(d,f);if(m===h)return;if(_&&(m-h)/2!==d.length/f){let S=h/2;_=_.filter((y,x)=>{const T=a[(S+x)*2]===d[x*f]&&a[(S+x)*2+1]===d[x*f+1];return T||--S,T})}this.saveTextStates_(),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&this.updateFillStyle(this.state,this.createFill),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);let E=o.padding;if(E!=sn&&(o.scale[0]<0||o.scale[1]<0)){let S=o.padding[0],y=o.padding[1],x=o.padding[2],T=o.padding[3];o.scale[0]<0&&(y=-y,T=-T),o.scale[1]<0&&(S=-S,x=-x),E=[S,y,x,T]}const v=this.pixelRatio;this.instructions.push([et.DRAW_IMAGE,h,m,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,E==sn?sn:E.map(function(S){return S*v}),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,_]);const b=1/v,C=this.state.fillStyle;o.backgroundFill&&(this.state.fillStyle=ae,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([et.DRAW_IMAGE,h,m,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[b,b],NaN,void 0,this.declutterImageWithText_,E,!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?ae:this.fillKey_,this.textOffsetX_,this.textOffsetY_,_]),o.backgroundFill&&(this.state.fillStyle=C,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,n=this.strokeKey_;t&&(n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const o=this.textKey_;o in this.textStates||(this.textStates[o]={font:e.font,textAlign:e.textAlign||Lr,justify:e.justify,textBaseline:e.textBaseline||Xs,scale:e.scale});const a=this.fillKey_;i&&(a in this.fillStates||(this.fillStates[a]={fillStyle:i.fillStyle}))}drawChars_(t,e){const i=this.textStrokeState_,n=this.textState_,o=this.strokeKey_,a=this.textKey_,h=this.fillKey_;this.saveTextStates_();const c=this.pixelRatio,d=vo[n.textBaseline],f=this.textOffsetY_*c,_=this.text_,m=i?i.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([et.DRAW_CHARS,t,e,d,n.overflow,h,n.maxAngle,c,f,o,m*c,_,a,1]),this.hitDetectionInstructions.push([et.DRAW_CHARS,t,e,d,n.overflow,h&&ae,n.maxAngle,c,f,o,m*c,_,a,1/c])}setTextStyle(t,e){let i,n,o;if(!t)this.text_="";else{const a=t.getFill();a?(n=this.textFillState_,n||(n={},this.textFillState_=n),n.fillStyle=Ue(a.getColor()||ae)):(n=null,this.textFillState_=n);const h=t.getStroke();if(!h)o=null,this.textStrokeState_=o;else{o=this.textStrokeState_,o||(o={},this.textStrokeState_=o);const v=h.getLineDash(),b=h.getLineDashOffset(),C=h.getWidth(),S=h.getMiterLimit();o.lineCap=h.getLineCap()||kn,o.lineDash=v?v.slice():ni,o.lineDashOffset=b===void 0?ri:b,o.lineJoin=h.getLineJoin()||Rn,o.lineWidth=C===void 0?br:C,o.miterLimit=S===void 0?Er:S,o.strokeStyle=Ue(h.getColor()||wr)}i=this.textState_;const c=t.getFont()||pu;$m(c);const d=t.getScaleArray();i.overflow=t.getOverflow(),i.font=c,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.repeat=t.getRepeat(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||Xs,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||sn,i.scale=d===void 0?[1,1]:d;const f=t.getOffsetX(),_=t.getOffsetY(),m=t.getRotateWithView(),E=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=f===void 0?0:f,this.textOffsetY_=_===void 0?0:_,this.textRotateWithView_=m===void 0?!1:m,this.textRotation_=E===void 0?0:E,this.strokeKey_=o?(typeof o.strokeStyle=="string"?o.strokeStyle:ht(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=n?typeof n.fillStyle=="string"?n.fillStyle:"|"+ht(n.fillStyle):""}this.declutterImageWithText_=e}}const eE={Circle:kd,Default:Or,Image:Y0,LineString:q0,Polygon:kd,Text:tE};class iE{constructor(t,e,i,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=i,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const i=this.buildersByZIndex_[e];for(const n in i){const o=i[n].finish();t[e][n]=o}}return t}getBuilder(t,e){const i=t!==void 0?t.toString():"0";let n=this.buildersByZIndex_[i];n===void 0&&(n={},this.buildersByZIndex_[i]=n);let o=n[e];if(o===void 0){const a=eE[e];o=new a(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=o}return o}}const Rd=iE;function nE(r,t,e,i,n,o,a,h,c,d,f,_){let m=r[t],E=r[t+1],v=0,b=0,C=0,S=0;function y(){v=m,b=E,t+=i,m=r[t],E=r[t+1],S+=C,C=Math.sqrt((m-v)*(m-v)+(E-b)*(E-b))}do y();while(t<e-i&&S+C<o);let x=C===0?0:(o-S)/C;const T=_e(v,m,x),k=_e(b,E,x),R=t-i,M=S,A=o+h*c(d,n,f);for(;t<e-i&&S+C<A;)y();x=C===0?0:(A-S)/C;const z=_e(v,m,x),U=_e(b,E,x);let Z;if(_){const X=[T,k,z,U];Zc(X,0,4,2,_,X,X),Z=X[0]>X[2]}else Z=T>z;const H=Math.PI,K=[],nt=R+i===t;t=R,C=0,S=M,m=r[t],E=r[t+1];let q;if(nt){y(),q=Math.atan2(E-b,m-v),Z&&(q+=q>0?-H:H);const X=(z+T)/2,j=(U+k)/2;return K[0]=[X,j,(A-o)/2,q,n],K}n=n.replace(/\n/g," ");for(let X=0,j=n.length;X<j;){y();let B=Math.atan2(E-b,m-v);if(Z&&(B+=B>0?-H:H),q!==void 0){let tt=B-q;if(tt+=tt>H?-2*H:tt<-H?2*H:0,Math.abs(tt)>a)return null}q=B;const yt=X;let W=0;for(;X<j;++X){const tt=Z?j-X-1:X,J=h*c(d,n[tt],f);if(t+i<e&&S+C<o+W+J/2)break;W+=J}if(X===yt)continue;const rt=Z?n.substring(j-yt,j-X):n.substring(yt,X);x=C===0?0:(o+W/2-S)/C;const F=_e(v,m,x),Lt=_e(b,E,x);K.push([F,Lt,W/2,B,rt]),o+=W}return K}const Wn=ge(),Ii=[],hi=[],ci=[],Ai=[];function Md(r){return r[3].declutterBox}const Id=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function Il(r,t){return t==="start"?t=Id.test(r)?"right":"left":t==="end"&&(t=Id.test(r)?"left":"right"),vo[t]}function rE(r,t,e){return e>0&&r.push(`
446
+ `,""),r.push(t,""),r}class sE{constructor(t,e,i,n){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=Vt(),this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}createLabel(t,e,i,n){const o=t+e+i+n;if(this.labels_[o])return this.labels_[o];const a=n?this.strokeStates[n]:null,h=i?this.fillStates[i]:null,c=this.textStates[e],d=this.pixelRatio,f=[c.scale[0]*d,c.scale[1]*d],_=Array.isArray(t),m=c.justify?vo[c.justify]:Il(Array.isArray(t)?t[0]:t,c.textAlign||Lr),E=n&&a.lineWidth?a.lineWidth:0,v=_?t:t.split(`
447
+ `).reduce(rE,[]),{width:b,height:C,widths:S,heights:y,lineWidths:x}=Qm(c,v),T=b+E,k=[],R=(T+2)*f[0],M=(C+E)*f[1],A={width:R<0?Math.floor(R):Math.ceil(R),height:M<0?Math.floor(M):Math.ceil(M),contextInstructions:k};(f[0]!=1||f[1]!=1)&&k.push("scale",f),n&&(k.push("strokeStyle",a.strokeStyle),k.push("lineWidth",E),k.push("lineCap",a.lineCap),k.push("lineJoin",a.lineJoin),k.push("miterLimit",a.miterLimit),k.push("setLineDash",[a.lineDash]),k.push("lineDashOffset",a.lineDashOffset)),i&&k.push("fillStyle",h.fillStyle),k.push("textBaseline","middle"),k.push("textAlign","center");const z=.5-m;let U=m*T+z*E;const Z=[],H=[];let K=0,nt=0,q=0,X=0,j;for(let B=0,yt=v.length;B<yt;B+=2){const W=v[B];if(W===`
448
+ `){nt+=K,K=0,U=m*T+z*E,++X;continue}const rt=v[B+1]||c.font;rt!==j&&(n&&Z.push("font",rt),i&&H.push("font",rt),j=rt),K=Math.max(K,y[q]);const F=[W,U+z*S[q]+m*(S[q]-x[X]),.5*(E+K)+nt];U+=S[q],n&&Z.push("strokeText",F),i&&H.push("fillText",F),++q}return Array.prototype.push.apply(k,Z),Array.prototype.push.apply(k,H),this.labels_[o]=A,A}replayTextBackground_(t,e,i,n,o,a,h){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,o),t.lineTo.apply(t,e),a&&(this.alignFill_=a[2],this.fill_(t)),h&&(this.setStrokeStyle_(t,h),t.stroke())}calculateImageOrLabelDimensions_(t,e,i,n,o,a,h,c,d,f,_,m,E,v,b,C){h*=m[0],c*=m[1];let S=i-h,y=n-c;const x=o+d>t?t-d:o,T=a+f>e?e-f:a,k=v[3]+x*m[0]+v[1],R=v[0]+T*m[1]+v[2],M=S-v[3],A=y-v[0];(b||_!==0)&&(Ii[0]=M,Ai[0]=M,Ii[1]=A,hi[1]=A,hi[0]=M+k,ci[0]=hi[0],ci[1]=A+R,Ai[1]=ci[1]);let z;return _!==0?(z=Ne(Vt(),i,n,1,1,_,-i,-n),Ot(z,Ii),Ot(z,hi),Ot(z,ci),Ot(z,Ai),Ei(Math.min(Ii[0],hi[0],ci[0],Ai[0]),Math.min(Ii[1],hi[1],ci[1],Ai[1]),Math.max(Ii[0],hi[0],ci[0],Ai[0]),Math.max(Ii[1],hi[1],ci[1],Ai[1]),Wn)):Ei(Math.min(M,M+k),Math.min(A,A+R),Math.max(M,M+k),Math.max(A,A+R),Wn),E&&(S=Math.round(S),y=Math.round(y)),{drawImageX:S,drawImageY:y,drawImageW:x,drawImageH:T,originX:d,originY:f,declutterBox:{minX:Wn[0],minY:Wn[1],maxX:Wn[2],maxY:Wn[3],value:C},canvasTransform:z,scale:m}}replayImageOrLabel_(t,e,i,n,o,a,h){const c=!!(a||h),d=n.declutterBox,f=t.canvas,_=h?h[2]*n.scale[0]/2:0;return d.minX-_<=f.width/e&&d.maxX+_>=0&&d.minY-_<=f.height/e&&d.maxY+_>=0&&(c&&this.replayTextBackground_(t,Ii,hi,ci,Ai,a,h),ty(t,n.canvasTransform,o,i,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0}fill_(t){if(this.alignFill_){const e=Ot(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=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,i,n){const o=this.textStates[e],a=this.createLabel(t,e,n,i),h=this.strokeStates[i],c=this.pixelRatio,d=Il(Array.isArray(t)?t[0]:t,o.textAlign||Lr),f=vo[o.textBaseline||Xs],_=h&&h.lineWidth?h.lineWidth:0,m=a.width/c-2*o.scale[0],E=d*m+2*(.5-d)*_,v=f*a.height/c+2*(.5-f)*_;return{label:a,anchorX:E,anchorY:v}}execute_(t,e,i,n,o,a,h,c){let d;this.pixelCoordinates_&&ei(i,this.renderedTransform_)?d=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),d=tn(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),nm(this.renderedTransform_,i));let f=0;const _=n.length;let m=0,E,v,b,C,S,y,x,T,k,R,M,A,z=0,U=0,Z=null,H=null;const K=this.coordinateCache_,nt=this.viewRotation_,q=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,X={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:nt},j=this.instructions!=n||this.overlaps?0:200;let B,yt,W,rt;for(;f<_;){const F=n[f];switch(F[0]){case et.BEGIN_GEOMETRY:B=F[1],rt=F[3],B.getGeometry()?h!==void 0&&!se(h,rt.getExtent())?f=F[2]+1:++f:f=F[2];break;case et.BEGIN_PATH:z>j&&(this.fill_(t),z=0),U>j&&(t.stroke(),U=0),!z&&!U&&(t.beginPath(),C=NaN,S=NaN),++f;break;case et.CIRCLE:m=F[1];const tt=d[m],J=d[m+1],ot=d[m+2],Ft=d[m+3],St=ot-tt,ve=Ft-J,We=Math.sqrt(St*St+ve*ve);t.moveTo(tt+We,J),t.arc(tt,J,We,0,2*Math.PI,!0),++f;break;case et.CLOSE_PATH:t.closePath(),++f;break;case et.CUSTOM:m=F[1],E=F[2];const Di=F[3],xe=F[4],Oi=F.length==6?F[5]:void 0;X.geometry=Di,X.feature=B,f in K||(K[f]=[]);const He=K[f];Oi?Oi(d,m,E,2,He):(He[0]=d[m],He[1]=d[m+1],He.length=2),xe(He,X),++f;break;case et.DRAW_IMAGE:m=F[1],E=F[2],T=F[3],v=F[4],b=F[5];let Fi=F[6];const Pe=F[7],zi=F[8],di=F[9],Hn=F[10];let fi=F[11];const hn=F[12];let Xt=F[13];const ie=F[14],me=F[15];if(!T&&F.length>=20){k=F[19],R=F[20],M=F[21],A=F[22];const ne=this.drawLabelWithPointPlacement_(k,R,M,A);T=ne.label,F[3]=T;const Zi=F[23];v=(ne.anchorX-Zi)*this.pixelRatio,F[4]=v;const he=F[24];b=(ne.anchorY-he)*this.pixelRatio,F[5]=b,Fi=T.height,F[6]=Fi,Xt=T.width,F[13]=Xt}let ke;F.length>25&&(ke=F[25]);let Ve,Xe,Re;F.length>17?(Ve=F[16],Xe=F[17],Re=F[18]):(Ve=sn,Xe=!1,Re=!1),Hn&&q?fi+=nt:!Hn&&!q&&(fi-=nt);let Ni=0;for(;m<E;m+=2){if(ke&&ke[Ni++]<Xt/this.pixelRatio)continue;const ne=this.calculateImageOrLabelDimensions_(T.width,T.height,d[m],d[m+1],Xt,Fi,v,b,zi,di,fi,hn,o,Ve,Xe||Re,B),Zi=[t,e,T,ne,Pe,Xe?Z:null,Re?H:null];if(c){if(ie==="none")continue;if(ie==="obstacle"){c.insert(ne.declutterBox);continue}else{let he,Me;if(me){const Yt=E-m;if(!me[Yt]){me[Yt]=Zi;continue}if(he=me[Yt],delete me[Yt],Me=Md(he),c.collides(Me))continue}if(c.collides(ne.declutterBox))continue;he&&(c.insert(Me),this.replayImageOrLabel_.apply(this,he)),c.insert(ne.declutterBox)}}this.replayImageOrLabel_.apply(this,Zi)}++f;break;case et.DRAW_CHARS:const cn=F[1],Wt=F[2],Fr=F[3],xo=F[4];A=F[5];const zr=F[6],Nr=F[7],Eo=F[8];M=F[9];const gi=F[10];k=F[11],R=F[12];const wo=[F[13],F[13]],Br=this.textStates[R],Bi=Br.font,Gi=[Br.scale[0]*Nr,Br.scale[1]*Nr];let Ui;Bi in this.widths_?Ui=this.widths_[Bi]:(Ui={},this.widths_[Bi]=Ui);const Lo=Td(d,cn,Wt,2),bo=Math.abs(Gi[0])*yu(Bi,k,Ui);if(xo||bo<=Lo){const ne=this.textStates[R].textAlign,Zi=(Lo-bo)*Il(k,ne),he=nE(d,cn,Wt,2,k,Zi,zr,Math.abs(Gi[0]),yu,Bi,Ui,q?0:this.viewRotation_);t:if(he){const Me=[];let Yt,Vn,Xn,te,ce;if(M)for(Yt=0,Vn=he.length;Yt<Vn;++Yt){ce=he[Yt],Xn=ce[4],te=this.createLabel(Xn,R,"",M),v=ce[2]+(Gi[0]<0?-gi:gi),b=Fr*te.height+(.5-Fr)*2*gi*Gi[1]/Gi[0]-Eo;const zt=this.calculateImageOrLabelDimensions_(te.width,te.height,ce[0],ce[1],te.width,te.height,v,b,0,0,ce[3],wo,!1,sn,!1,B);if(c&&c.collides(zt.declutterBox))break t;Me.push([t,e,te,zt,1,null,null])}if(A)for(Yt=0,Vn=he.length;Yt<Vn;++Yt){ce=he[Yt],Xn=ce[4],te=this.createLabel(Xn,R,A,""),v=ce[2],b=Fr*te.height-Eo;const zt=this.calculateImageOrLabelDimensions_(te.width,te.height,ce[0],ce[1],te.width,te.height,v,b,0,0,ce[3],wo,!1,sn,!1,B);if(c&&c.collides(zt.declutterBox))break t;Me.push([t,e,te,zt,1,null,null])}c&&c.load(Me.map(Md));for(let zt=0,$=Me.length;zt<$;++zt)this.replayImageOrLabel_.apply(this,Me[zt])}}++f;break;case et.END_GEOMETRY:if(a!==void 0){B=F[1];const ne=a(B,rt);if(ne)return ne}++f;break;case et.FILL:j?z++:this.fill_(t),++f;break;case et.MOVE_TO_LINE_TO:for(m=F[1],E=F[2],yt=d[m],W=d[m+1],y=yt+.5|0,x=W+.5|0,(y!==C||x!==S)&&(t.moveTo(yt,W),C=y,S=x),m+=2;m<E;m+=2)yt=d[m],W=d[m+1],y=yt+.5|0,x=W+.5|0,(m==E-2||y!==C||x!==S)&&(t.lineTo(yt,W),C=y,S=x);++f;break;case et.SET_FILL_STYLE:Z=F,this.alignFill_=F[2],z&&(this.fill_(t),z=0,U&&(t.stroke(),U=0)),t.fillStyle=F[1],++f;break;case et.SET_STROKE_STYLE:H=F,U&&(t.stroke(),U=0),this.setStrokeStyle_(t,F),++f;break;case et.STROKE:j?U++:t.stroke(),++f;break;default:++f;break}}z&&this.fill_(t),U&&t.stroke()}execute(t,e,i,n,o,a){this.viewRotation_=n,this.execute_(t,e,i,this.instructions,o,void 0,void 0,a)}executeHitDetection(t,e,i,n,o){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,n,o)}}const oE=sE,Al=["Polygon","Circle","LineString","Image","Text","Default"];class aE{constructor(t,e,i,n,o,a){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Vt(),this.createExecutors_(o)}clip(t,e){const i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t){for(const e in t){let i=this.executorsByZIndex_[e];i===void 0&&(i={},this.executorsByZIndex_[e]=i);const n=t[e];for(const o in n){const a=n[o];i[o]=new oE(this.resolution_,this.pixelRatio_,this.overlaps_,a)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const i=this.executorsByZIndex_[e];for(let n=0,o=t.length;n<o;++n)if(t[n]in i)return!0}return!1}forEachFeatureAtCoordinate(t,e,i,n,o,a){n=Math.round(n);const h=n*2+1,c=Ne(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-i,-t[0],-t[1]),d=!this.hitDetectionContext_;d&&(this.hitDetectionContext_=$t(h,h,void 0,{willReadFrequently:!0}));const f=this.hitDetectionContext_;f.canvas.width!==h||f.canvas.height!==h?(f.canvas.width=h,f.canvas.height=h):d||f.clearRect(0,0,h,h);let _;this.renderBuffer_!==void 0&&(_=ge(),gr(_,t),Es(_,e*(this.renderBuffer_+n),_));const m=lE(n);let E;function v(k,R){const M=f.getImageData(0,0,h,h).data;for(let A=0,z=m.length;A<z;A++)if(M[m[A]]>0){if(!a||E!=="Image"&&E!=="Text"||a.includes(k)){const U=(m[A]-3)/4,Z=n-U%h,H=n-(U/h|0),K=o(k,R,Z*Z+H*H);if(K)return K}f.clearRect(0,0,h,h);break}}const b=Object.keys(this.executorsByZIndex_).map(Number);b.sort(xi);let C,S,y,x,T;for(C=b.length-1;C>=0;--C){const k=b[C].toString();for(y=this.executorsByZIndex_[k],S=Al.length-1;S>=0;--S)if(E=Al[S],x=y[E],x!==void 0&&(T=x.executeHitDetection(f,c,i,v,_),T))return T}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const i=e[0],n=e[1],o=e[2],a=e[3],h=[i,n,i,a,o,a,o,n];return tn(h,0,8,2,t,h),h}isEmpty(){return wn(this.executorsByZIndex_)}execute(t,e,i,n,o,a,h){const c=Object.keys(this.executorsByZIndex_).map(Number);c.sort(xi),this.maxExtent_&&(t.save(),this.clip(t,i)),a=a||Al;let d,f,_,m,E,v;for(h&&c.reverse(),d=0,f=c.length;d<f;++d){const b=c[d].toString();for(E=this.executorsByZIndex_[b],_=0,m=a.length;_<m;++_){const C=a[_];v=E[C],v!==void 0&&v.execute(t,e,i,n,o,h)}}this.maxExtent_&&t.restore()}}const Dl={};function lE(r){if(Dl[r]!==void 0)return Dl[r];const t=r*2+1,e=r*r,i=new Array(e+1);for(let o=0;o<=r;++o)for(let a=0;a<=r;++a){const h=o*o+a*a;if(h>e)break;let c=i[h];c||(c=[],i[h]=c),c.push(((r+o)*t+(r+a))*4+3),o>0&&c.push(((r-o)*t+(r+a))*4+3),a>0&&(c.push(((r+o)*t+(r-a))*4+3),o>0&&c.push(((r-o)*t+(r-a))*4+3))}const n=[];for(let o=0,a=i.length;o<a;++o)i[o]&&n.push(...i[o]);return Dl[r]=n,n}const Ad=aE;class hE extends Pd{constructor(t,e,i,n,o,a,h){super(),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=n,this.transformRotation_=n?xa(Math.atan2(n[1],n[0]),10):0,this.viewRotation_=o,this.squaredTolerance_=a,this.userTransform_=h,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_=Vt()}drawImages_(t,e,i,n){if(!this.image_)return;const o=tn(t,e,i,n,this.transform_,this.pixelCoordinates_),a=this.context_,h=this.tmpLocalTransform_,c=a.globalAlpha;this.imageOpacity_!=1&&(a.globalAlpha=c*this.imageOpacity_);let d=this.imageRotation_;this.transformRotation_===0&&(d-=this.viewRotation_),this.imageRotateWithView_&&(d+=this.viewRotation_);for(let f=0,_=o.length;f<_;f+=2){const m=o[f]-this.imageAnchorX_,E=o[f+1]-this.imageAnchorY_;if(d!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const v=m+this.imageAnchorX_,b=E+this.imageAnchorY_;Ne(h,v,b,1,1,d,-v,-b),a.save(),a.transform.apply(a,h),a.translate(v,b),a.scale(this.imageScale_[0],this.imageScale_[1]),a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),a.restore()}else a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,m,E,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(a.globalAlpha=c)}drawText_(t,e,i,n){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const o=tn(t,e,i,n,this.transform_,this.pixelCoordinates_),a=this.context_;let h=this.textRotation_;for(this.transformRotation_===0&&(h-=this.viewRotation_),this.textRotateWithView_&&(h+=this.viewRotation_);e<i;e+=n){const c=o[e]+this.textOffsetX_,d=o[e+1]+this.textOffsetY_;h!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(a.save(),a.translate(c-this.textOffsetX_,d-this.textOffsetY_),a.rotate(h),a.translate(this.textOffsetX_,this.textOffsetY_),a.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&a.strokeText(this.text_,0,0),this.textFillState_&&a.fillText(this.text_,0,0),a.restore()):(this.textStrokeState_&&a.strokeText(this.text_,c,d),this.textFillState_&&a.fillText(this.text_,c,d))}}moveToLineTo_(t,e,i,n,o){const a=this.context_,h=tn(t,e,i,n,this.transform_,this.pixelCoordinates_);a.moveTo(h[0],h[1]);let c=h.length;o&&(c-=2);for(let d=2;d<c;d+=2)a.lineTo(h[d],h[d+1]);return o&&a.closePath(),i}drawRings_(t,e,i,n){for(let o=0,a=i.length;o<a;++o)e=this.moveToLineTo_(t,e,i[o],n,!0);return e}drawCircle(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!se(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=dm(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],n=e[3]-e[1],o=Math.sqrt(i*i+n*n),a=this.context_;a.beginPath(),a.arc(e[0],e[1],o,0,2*Math.PI),this.fillState_&&a.fill(),this.strokeState_&&a.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 i=e.getGeometryFunction()(t);i&&(this.setStyle(e),this.drawGeometry(i))}drawGeometryCollection(t){const e=t.getGeometriesArray();for(let i=0,n=e.length;i<n;++i)this.drawGeometry(e[i])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),this.text_!==""&&this.drawText_(e,0,e.length,i)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),this.text_!==""&&this.drawText_(e,0,e.length,i)}drawLineString(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!se(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.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(se(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const i=this.context_,n=t.getFlatCoordinates();let o=0;const a=t.getEnds(),h=t.getStride();i.beginPath();for(let c=0,d=a.length;c<d;++c)o=this.moveToLineTo_(n,o,a[c],h,!1);i.stroke()}if(this.text_!==""){const i=t.getFlatMidpoints();this.drawText_(i,0,i.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!se(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_)),!!se(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_,i=t.getOrientedFlatCoordinates();let n=0;const o=t.getEndss(),a=t.getStride();e.beginPath();for(let h=0,c=o.length;h<c;++h){const d=o[h];n=this.drawRings_(i,n,d,a)}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_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){const e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),ei(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.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_,i=this.contextTextState_,n=t.textAlign?t.textAlign:Lr;i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=n&&(i.textAlign=n,e.textAlign=n),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(!t)this.fillState_=null;else{const i=t.getColor();this.fillState_={fillStyle:Ue(i||ae)}}if(!e)this.strokeState_=null;else{const i=e.getColor(),n=e.getLineCap(),o=e.getLineDash(),a=e.getLineDashOffset(),h=e.getLineJoin(),c=e.getWidth(),d=e.getMiterLimit(),f=o||ni;this.strokeState_={lineCap:n!==void 0?n:kn,lineDash:this.pixelRatio_===1?f:f.map(_=>_*this.pixelRatio_),lineDashOffset:(a||ri)*this.pixelRatio_,lineJoin:h!==void 0?h:Rn,lineWidth:(c!==void 0?c:br)*this.pixelRatio_,miterLimit:d!==void 0?d:Er,strokeStyle:Ue(i||wr)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const i=t.getPixelRatio(this.pixelRatio_),n=t.getAnchor(),o=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*i,this.imageAnchorY_=n[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=o[0],this.imageOriginY_=o[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const a=t.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/i,a[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const E=e.getColor();this.textFillState_={fillStyle:Ue(E||ae)}}const i=t.getStroke();if(!i)this.textStrokeState_=null;else{const E=i.getColor(),v=i.getLineCap(),b=i.getLineDash(),C=i.getLineDashOffset(),S=i.getLineJoin(),y=i.getWidth(),x=i.getMiterLimit();this.textStrokeState_={lineCap:v!==void 0?v:kn,lineDash:b||ni,lineDashOffset:C||ri,lineJoin:S!==void 0?S:Rn,lineWidth:y!==void 0?y:br,miterLimit:x!==void 0?x:Er,strokeStyle:Ue(E||wr)}}const n=t.getFont(),o=t.getOffsetX(),a=t.getOffsetY(),h=t.getRotateWithView(),c=t.getRotation(),d=t.getScaleArray(),f=t.getText(),_=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:n!==void 0?n:pu,textAlign:_!==void 0?_:Lr,textBaseline:m!==void 0?m:Xs},this.text_=f!==void 0?Array.isArray(f)?f.reduce((E,v,b)=>E+=b%2?" ":v,""):f:"",this.textOffsetX_=o!==void 0?this.pixelRatio_*o:0,this.textOffsetY_=a!==void 0?this.pixelRatio_*a:0,this.textRotateWithView_=h!==void 0?h:!1,this.textRotation_=c!==void 0?c:0,this.textScale_=[this.pixelRatio_*d[0],this.pixelRatio_*d[1]]}}}const cE=hE,je=.5;function uE(r,t,e,i,n,o,a){const h=r[0]*je,c=r[1]*je,d=$t(h,c);d.imageSmoothingEnabled=!1;const f=d.canvas,_=new cE(d,je,n,null,a),m=e.length,E=Math.floor((256*256*256-1)/m),v={};for(let C=1;C<=m;++C){const S=e[C-1],y=S.getStyleFunction()||i;if(!y)continue;let x=y(S,o);if(!x)continue;Array.isArray(x)||(x=[x]);const k=(C*E).toString(16).padStart(7,"#00000");for(let R=0,M=x.length;R<M;++R){const A=x[R],z=A.getGeometryFunction()(S);if(!z||!se(n,z.getExtent()))continue;const U=A.clone(),Z=U.getFill();Z&&Z.setColor(k);const H=U.getStroke();H&&(H.setColor(k),H.setLineDash(null)),U.setText(void 0);const K=A.getImage();if(K){const j=K.getImageSize();if(!j)continue;const B=$t(j[0],j[1],void 0,{alpha:!1}),yt=B.canvas;B.fillStyle=k,B.fillRect(0,0,yt.width,yt.height),U.setImage(new al({img:yt,anchor:K.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:K.getOrigin(),opacity:1,size:K.getSize(),scale:K.getScale(),rotation:K.getRotation(),rotateWithView:K.getRotateWithView()}))}const nt=U.getZIndex()||0;let q=v[nt];q||(q={},v[nt]=q,q.Polygon=[],q.Circle=[],q.LineString=[],q.Point=[]);const X=z.getType();if(X==="GeometryCollection"){const j=z.getGeometriesArrayRecursive();for(let B=0,yt=j.length;B<yt;++B){const W=j[B];q[W.getType().replace("Multi","")].push(W,U)}}else q[X.replace("Multi","")].push(z,U)}}const b=Object.keys(v).map(Number).sort(xi);for(let C=0,S=b.length;C<S;++C){const y=v[b[C]];for(const x in y){const T=y[x];for(let k=0,R=T.length;k<R;k+=2){_.setStyle(T[k+1]);for(let M=0,A=t.length;M<A;++M)_.setTransform(t[M]),_.drawGeometry(T[k])}}}return d.getImageData(0,0,f.width,f.height)}function dE(r,t,e){const i=[];if(e){const n=Math.floor(Math.round(r[0])*je),o=Math.floor(Math.round(r[1])*je),a=(It(n,0,e.width-1)+It(o,0,e.height-1)*e.width)*4,h=e.data[a],c=e.data[a+1],f=e.data[a+2]+256*(c+256*h),_=Math.floor((256*256*256-1)/t.length);f&&f%_===0&&i.push(t[f/_-1])}return i}const fE=.5,Dd={Point:wE,LineString:vE,Polygon:bE,MultiPoint:LE,MultiLineString:xE,MultiPolygon:EE,GeometryCollection:yE,Circle:pE};function gE(r,t){return parseInt(ht(r),10)-parseInt(ht(t),10)}function _E(r,t){const e=Ol(r,t);return e*e}function Ol(r,t){return fE*r/t}function pE(r,t,e,i,n){const o=e.getFill(),a=e.getStroke();if(o||a){const c=r.getBuilder(e.getZIndex(),"Circle");c.setFillStrokeStyle(o,a),c.drawCircle(t,i)}const h=e.getText();if(h&&h.getText()){const c=(n||r).getBuilder(e.getZIndex(),"Text");c.setTextStyle(h),c.drawText(t,i)}}function Od(r,t,e,i,n,o,a){let h=!1;const c=e.getImage();if(c){const d=c.getImageState();d==Ct.LOADED||d==Ct.ERROR?c.unlistenImageChange(n):(d==Ct.IDLE&&c.load(),c.listenImageChange(n),h=!0)}return mE(r,t,e,i,o,a),h}function mE(r,t,e,i,n,o){const a=e.getGeometryFunction()(t);if(!a)return;const h=a.simplifyTransformed(i,n);if(e.getRenderer())Fd(r,h,e,t);else{const d=Dd[h.getType()];d(r,h,e,t,o)}}function Fd(r,t,e,i){if(t.getType()=="GeometryCollection"){const o=t.getGeometries();for(let a=0,h=o.length;a<h;++a)Fd(r,o[a],e,i);return}r.getBuilder(e.getZIndex(),"Default").drawCustom(t,i,e.getRenderer(),e.getHitDetectionRenderer())}function yE(r,t,e,i,n){const o=t.getGeometriesArray();let a,h;for(a=0,h=o.length;a<h;++a){const c=Dd[o[a].getType()];c(r,o[a],e,i,n)}}function vE(r,t,e,i,n){const o=e.getStroke();if(o){const h=r.getBuilder(e.getZIndex(),"LineString");h.setFillStrokeStyle(null,o),h.drawLineString(t,i)}const a=e.getText();if(a&&a.getText()){const h=(n||r).getBuilder(e.getZIndex(),"Text");h.setTextStyle(a),h.drawText(t,i)}}function xE(r,t,e,i,n){const o=e.getStroke();if(o){const h=r.getBuilder(e.getZIndex(),"LineString");h.setFillStrokeStyle(null,o),h.drawMultiLineString(t,i)}const a=e.getText();if(a&&a.getText()){const h=(n||r).getBuilder(e.getZIndex(),"Text");h.setTextStyle(a),h.drawText(t,i)}}function EE(r,t,e,i,n){const o=e.getFill(),a=e.getStroke();if(a||o){const c=r.getBuilder(e.getZIndex(),"Polygon");c.setFillStrokeStyle(o,a),c.drawMultiPolygon(t,i)}const h=e.getText();if(h&&h.getText()){const c=(n||r).getBuilder(e.getZIndex(),"Text");c.setTextStyle(h),c.drawText(t,i)}}function wE(r,t,e,i,n){const o=e.getImage(),a=e.getText();let h;if(o){if(o.getImageState()!=Ct.LOADED)return;let c=r;if(n){const f=o.getDeclutterMode();if(f!=="none")if(c=n,f==="obstacle"){const _=r.getBuilder(e.getZIndex(),"Image");_.setImageStyle(o,h),_.drawPoint(t,i)}else a&&a.getText()&&(h={})}const d=c.getBuilder(e.getZIndex(),"Image");d.setImageStyle(o,h),d.drawPoint(t,i)}if(a&&a.getText()){let c=r;n&&(c=n);const d=c.getBuilder(e.getZIndex(),"Text");d.setTextStyle(a,h),d.drawText(t,i)}}function LE(r,t,e,i,n){const o=e.getImage(),a=e.getText();let h;if(o){if(o.getImageState()!=Ct.LOADED)return;let c=r;if(n){const f=o.getDeclutterMode();if(f!=="none")if(c=n,f==="obstacle"){const _=r.getBuilder(e.getZIndex(),"Image");_.setImageStyle(o,h),_.drawMultiPoint(t,i)}else a&&a.getText()&&(h={})}const d=c.getBuilder(e.getZIndex(),"Image");d.setImageStyle(o,h),d.drawMultiPoint(t,i)}if(a&&a.getText()){let c=r;n&&(c=n);const d=c.getBuilder(e.getZIndex(),"Text");d.setTextStyle(a,h),d.drawText(t,i)}}function bE(r,t,e,i,n){const o=e.getFill(),a=e.getStroke();if(o||a){const c=r.getBuilder(e.getZIndex(),"Polygon");c.setFillStrokeStyle(o,a),c.drawPolygon(t,i)}const h=e.getText();if(h&&h.getText()){const c=(n||r).getBuilder(e.getZIndex(),"Text");c.setTextStyle(h),c.drawText(t,i)}}class TE extends vd{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=ge(),this.wrappedRenderedExtent_=ge(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.declutterExecutorGroup=null,this.clipping=!0,this.compositionContext_=null,this.opacity_=1}renderWorlds(t,e,i){const n=e.extent,o=e.viewState,a=o.center,h=o.resolution,c=o.projection,d=o.rotation,f=c.getExtent(),_=this.getLayer().getSource(),m=e.pixelRatio,E=e.viewHints,v=!(E[Ut.ANIMATING]||E[Ut.INTERACTING]),b=this.compositionContext_,C=Math.round(e.size[0]*m),S=Math.round(e.size[1]*m),y=_.getWrapX()&&c.canWrapX(),x=y?Tt(f):null,T=y?Math.ceil((n[2]-f[2])/x)+1:1;let k=y?Math.floor((n[0]-f[0])/x):0;do{const R=this.getRenderTransform(a,h,d,m,C,S,k*x);t.execute(b,1,R,d,v,void 0,i)}while(++k<T)}setupCompositionContext_(){if(this.opacity_!==1){const t=$t(this.context.canvas.width,this.context.canvas.height,yd);this.compositionContext_=t}else this.compositionContext_=this.context}releaseCompositionContext_(){if(this.opacity_!==1){const t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,Ws(this.compositionContext_),yd.push(this.compositionContext_.canvas),this.compositionContext_=null}}renderDeclutter(t){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.releaseCompositionContext_())}renderFrame(t,e){const i=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];rm(this.pixelTransform,1/i,1/i),Is(this.inversePixelTransform,this.pixelTransform);const o=Uc(this.pixelTransform);this.useContainer(e,o,this.getBackground(t));const a=this.context,h=a.canvas,c=this.replayGroup_,d=this.declutterExecutorGroup;let f=c&&!c.isEmpty()||d&&!d.isEmpty();if(!f&&!(this.getLayer().hasListener(qt.PRERENDER)||this.getLayer().hasListener(qt.POSTRENDER)))return null;const _=Math.round(t.size[0]*i),m=Math.round(t.size[1]*i);h.width!=_||h.height!=m?(h.width=_,h.height=m,h.style.transform!==o&&(h.style.transform=o)):this.containerReused||a.clearRect(0,0,_,m),this.preRender(a,t);const E=t.viewState;E.projection,this.opacity_=n.opacity,this.setupCompositionContext_();let v=!1;if(f&&n.extent&&this.clipping){const b=Qi(n.extent);f=se(b,t.extent),v=f&&!Yi(b,t.extent),v&&this.clipUnrotated(this.compositionContext_,t,b)}return f&&this.renderWorlds(c,t),v&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(a,t),this.renderedRotation_!==E.rotation&&(this.renderedRotation_=E.rotation,this.hitDetectionImageData_=null),this.container}getFeatures(t){return new Promise(e=>{if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=[this.context.canvas.width,this.context.canvas.height];Ot(this.pixelTransform,i);const n=this.renderedCenter_,o=this.renderedResolution_,a=this.renderedRotation_,h=this.renderedProjection_,c=this.wrappedRenderedExtent_,d=this.getLayer(),f=[],_=i[0]*je,m=i[1]*je;f.push(this.getRenderTransform(n,o,a,je,_,m,0).slice());const E=d.getSource(),v=h.getExtent();if(E.getWrapX()&&h.canWrapX()&&!Yi(v,c)){let b=c[0];const C=Tt(v);let S=0,y;for(;b<v[0];)--S,y=C*S,f.push(this.getRenderTransform(n,o,a,je,_,m,y).slice()),b+=C;for(S=0,b=c[2];b>v[2];)++S,y=C*S,f.push(this.getRenderTransform(n,o,a,je,_,m,y).slice()),b-=C}this.hitDetectionImageData_=uE(i,f,this.renderedFeatures_,d.getStyleFunction(),c,o,a)}e(dE(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,i,n,o){if(!this.replayGroup_)return;const a=e.viewState.resolution,h=e.viewState.rotation,c=this.getLayer(),d={},f=function(E,v,b){const C=ht(E),S=d[C];if(S){if(S!==!0&&b<S.distanceSq){if(b===0)return d[C]=!0,o.splice(o.lastIndexOf(S),1),n(E,c,v);S.geometry=v,S.distanceSq=b}}else{if(b===0)return d[C]=!0,n(E,c,v);o.push(d[C]={feature:E,layer:c,geometry:v,distanceSq:b,callback:n})}};let _;const m=[this.replayGroup_];return this.declutterExecutorGroup&&m.push(this.declutterExecutorGroup),m.some(E=>_=E.forEachFeatureAtCoordinate(t,a,h,i,f,E===this.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map(v=>v.value):null)),_}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),i=e.getSource();if(!i)return!1;const n=t.viewHints[Ut.ANIMATING],o=t.viewHints[Ut.INTERACTING],a=e.getUpdateWhileAnimating(),h=e.getUpdateWhileInteracting();if(this.ready&&!a&&n||!h&&o)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const c=t.extent,d=t.viewState,f=d.projection,_=d.resolution,m=t.pixelRatio,E=e.getRevision(),v=e.getRenderBuffer();let b=e.getRenderOrder();b===void 0&&(b=gE);const C=d.center.slice(),S=Es(c,v*_),y=S.slice(),x=[S.slice()],T=f.getExtent();if(i.getWrapX()&&f.canWrapX()&&!Yi(T,t.extent)){const q=Tt(T),X=Math.max(Tt(S)/2,q);S[0]=T[0]-X,S[2]=T[2]+X,vc(C,f);const j=yc(x[0],f);j[0]<T[0]&&j[2]<T[2]?x.push([j[0]+q,j[1],j[2]+q,j[3]]):j[0]>T[0]&&j[2]>T[2]&&x.push([j[0]-q,j[1],j[2]-q,j[3]])}if(this.ready&&this.renderedResolution_==_&&this.renderedRevision_==E&&this.renderedRenderOrder_==b&&Yi(this.wrappedRenderedExtent_,S))return ei(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=C,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const k=new Rd(Ol(_,m),S,_,m);let R;this.getLayer().getDeclutter()&&(R=new Rd(Ol(_,m),S,_,m));let M;for(let q=0,X=x.length;q<X;++q)i.loadFeatures(x[q],_,f);const A=_E(_,m);let z=!0;const U=q=>{let X;const j=q.getStyleFunction()||e.getStyleFunction();if(j&&(X=j(q,_)),X){const B=this.renderFeature(q,A,X,k,M,R);z=z&&!B}},Z=kc(S),H=i.getFeaturesInExtent(Z);b&&H.sort(b);for(let q=0,X=H.length;q<X;++q)U(H[q]);this.renderedFeatures_=H,this.ready=z;const K=k.finish(),nt=new Ad(S,_,m,i.getOverlaps(),K,e.getRenderBuffer());return R&&(this.declutterExecutorGroup=new Ad(S,_,m,i.getOverlaps(),R.finish(),e.getRenderBuffer())),this.renderedResolution_=_,this.renderedRevision_=E,this.renderedRenderOrder_=b,this.renderedExtent_=y,this.wrappedRenderedExtent_=S,this.renderedCenter_=C,this.renderedProjection_=f,this.replayGroup_=nt,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,i,n,o,a){if(!i)return!1;let h=!1;if(Array.isArray(i))for(let c=0,d=i.length;c<d;++c)h=Od(n,t,i[c],e,this.boundHandleStyleImageChange_,o,a)||h;else h=Od(n,t,i,e,this.boundHandleStyleImageChange_,o,a);return h}}const CE=TE;class SE extends dl{constructor(t){super(t)}createRenderer(){return new CE(this)}}const zd=SE,Qt={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class PE extends be{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 "+Vm,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(Qt.ELEMENT,this.handleElementChanged),this.addChangeListener(Qt.MAP,this.handleMapChanged),this.addChangeListener(Qt.OFFSET,this.handleOffsetChanged),this.addChangeListener(Qt.POSITION,this.handlePositionChanged),this.addChangeListener(Qt.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(Qt.ELEMENT)}getId(){return this.id}getMap(){return this.get(Qt.MAP)||null}getOffset(){return this.get(Qt.OFFSET)}getPosition(){return this.get(Qt.POSITION)}getPositioning(){return this.get(Qt.POSITIONING)}handleElementChanged(){_u(this.element);const t=this.getElement();t&&this.element.appendChild(t)}handleMapChanged(){this.mapPostrenderListenerKey&&(Vs(this.element),wt(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const t=this.getMap();if(t){this.mapPostrenderListenerKey=ut(t,oi.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(Qt.ELEMENT,t)}setMap(t){this.set(Qt.MAP,t)}setOffset(t){this.set(Qt.OFFSET,t)}setPosition(t){this.set(Qt.POSITION,t)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(t){const e=this.getMap();if(!e||!e.getTargetElement()||!this.get(Qt.POSITION))return;const i=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),o=this.getRect(n,[Ym(n),Km(n)]);t=t||{};const a=t.margin===void 0?20:t.margin;if(!Yi(i,o)){const h=o[0]-i[0],c=i[2]-o[2],d=o[1]-i[1],f=i[3]-o[3],_=[0,0];if(h<0?_[0]=h-a:c<0&&(_[0]=Math.abs(c)+a),d<0?_[1]=d-a:f<0&&(_[1]=Math.abs(f)+a),_[0]!==0||_[1]!==0){const m=e.getView().getCenterInternal(),E=e.getPixelFromCoordinateInternal(m);if(!E)return;const v=[E[0]+_[0],E[1]+_[1]],b=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(v),duration:b.duration,easing:b.easing})}}}getRect(t,e){const i=t.getBoundingClientRect(),n=i.left+window.pageXOffset,o=i.top+window.pageYOffset;return[n,o,n+e[0],o+e[1]]}setPositioning(t){this.set(Qt.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 i=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(i,n)}updateRenderedPosition(t,e){const i=this.element.style,n=this.getOffset(),o=this.getPositioning();this.setVisible(!0);const a=Math.round(t[0]+n[0])+"px",h=Math.round(t[1]+n[1])+"px";let c="0%",d="0%";o=="bottom-right"||o=="center-right"||o=="top-right"?c="-100%":(o=="bottom-center"||o=="center-center"||o=="top-center")&&(c="-50%"),o=="bottom-left"||o=="bottom-center"||o=="bottom-right"?d="-100%":(o=="center-left"||o=="center-center"||o=="center-right")&&(d="-50%");const f=`translate(${c}, ${d}) translate(${a}, ${h})`;this.rendered.transform_!=f&&(this.rendered.transform_=f,i.transform=f)}getOptions(){return this.options}}const kE=PE,Nd=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],Bd={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"};class RE extends $s{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target}),this.on,this.once,this.un,this.keys_=t.keys!==void 0?t.keys:!1,this.source_=t.source,this.isInFullscreen_=!1,this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this),this.cssClassName_=t.className!==void 0?t.className:"ol-full-screen",this.documentListeners_=[],this.activeClassName_=t.activeClassName!==void 0?t.activeClassName.split(" "):[this.cssClassName_+"-true"],this.inactiveClassName_=t.inactiveClassName!==void 0?t.inactiveClassName.split(" "):[this.cssClassName_+"-false"];const e=t.label!==void 0?t.label:"⤢";this.labelNode_=typeof e=="string"?document.createTextNode(e):e;const i=t.labelActive!==void 0?t.labelActive:"×";this.labelActiveNode_=typeof i=="string"?document.createTextNode(i):i;const n=t.tipLabel?t.tipLabel:"Toggle full-screen";this.button_=document.createElement("button"),this.button_.title=n,this.button_.setAttribute("type","button"),this.button_.appendChild(this.labelNode_),this.button_.addEventListener(at.CLICK,this.handleClick_.bind(this),!1),this.setClassName_(this.button_,this.isInFullscreen_),this.element.className=`${this.cssClassName_} ${xr} ${js}`,this.element.appendChild(this.button_)}handleClick_(t){t.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){const t=this.getMap();if(!t)return;const e=t.getOwnerDocument();if(Gd(e))if(Ud(e))IE(e);else{let i;this.source_?i=typeof this.source_=="string"?e.getElementById(this.source_):this.source_:i=t.getTargetElement(),this.keys_?ME(i):Zd(i)}}handleFullScreenChange_(){const t=this.getMap();if(!t)return;const e=this.isInFullscreen_;this.isInFullscreen_=Ud(t.getOwnerDocument()),e!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(Hs(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(Bd.ENTERFULLSCREEN)):(Hs(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(Bd.LEAVEFULLSCREEN)),t.updateSize())}setClassName_(t,e){e?(t.classList.remove(...this.inactiveClassName_),t.classList.add(...this.activeClassName_)):(t.classList.remove(...this.activeClassName_),t.classList.add(...this.inactiveClassName_))}setMap(t){const e=this.getMap();e&&e.removeChangeListener(jt.TARGET,this.boundHandleMapTargetChange_),super.setMap(t),this.handleMapTargetChange_(),t&&t.addChangeListener(jt.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){const t=this.documentListeners_;for(let i=0,n=t.length;i<n;++i)wt(t[i]);t.length=0;const e=this.getMap();if(e){const i=e.getOwnerDocument();Gd(i)?this.element.classList.remove(uu):this.element.classList.add(uu);for(let n=0,o=Nd.length;n<o;++n)t.push(ut(i,Nd[n],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}}function Gd(r){const t=r.body;return!!(t.webkitRequestFullscreen||t.requestFullscreen&&r.fullscreenEnabled)}function Ud(r){return!!(r.webkitIsFullScreen||r.fullscreenElement)}function Zd(r){r.requestFullscreen?r.requestFullscreen():r.webkitRequestFullscreen&&r.webkitRequestFullscreen()}function ME(r){r.webkitRequestFullscreen?r.webkitRequestFullscreen():Zd(r)}function IE(r){r.exitFullscreen?r.exitFullscreen():r.webkitExitFullscreen&&r.webkitExitFullscreen()}const AE=RE,DE=V.defineComponent({name:"MapHeat",props:{coords:Object,loadMapa:Object,typeMap:String,abrirCerrarLoader:Function,onClickMarket:Function,configurationMap:{default:()=>({strokeColor:"#f47521",copyright:"&copy; 2021 Desarrollado por UTIC - Ministerio Público",height:"250px",maxZoom:20,iconMarker:{image:ts,color:"#f47521",iconUrl:"/image/gmap01.png",iconSize:[25,41],iconAnchor:[12,41],scale:1,class:"",type:"image"},dragMarker:!0})}},data:()=>({radius:10,blur:20,zoom:5,type:"0",olMap:null,heatLayer:null,pointLayer:null,countryLayer:null,overlay:null,showSetting:!1,cantidad:0}),watch:{radius(r){this.setRadius(r)},blur(r){this.setBlur(r)},coords(r){this.cantidad=r.features.length,this.updateSource(r),this.updatePointSource(r)},loadMapa(r){this.changeCountryLayer(r)},typeMap(r){this.changeTypeMap(r)},type(r){this.changeTypeMap(r)}},methods:{changeTypeMap(r){this.type=r,r==="0"?(this.heatLayer.setVisible(!0),this.pointLayer.setVisible(!1),this.olMap.removeEventListener("click",this.onClickListener)):(this.heatLayer.setVisible(!1),this.pointLayer.setVisible(!0),this.initClick())},initMap(){const r=`<span class='map-copyright-text' >${this.configurationMap.copyright}</span>`,t=new An({stroke:new to({color:this.configurationMap.strokeColor,width:3}),text:new Du({font:"12px Roboto",fill:new Qs({color:"#000"}),stroke:new to({color:"#fff",width:1})})});this.countryLayer=new zd({source:new co({url:`${this.loadMapa.data}`,format:new mo}),style:function(i){return t.getText().setText(i.get("name")),t}}),this.heatLayer=new zx({source:new co({features:[]}),visible:!1,radius:10,blur:25});try{this.pointLayer=this.configurationMap?new zd({source:new co({features:[]}),visible:!1,style:i=>{var a,h,c;return new An({image:new al({src:(h=(a=this.configurationMap)==null?void 0:a.iconMarker)==null?void 0:h.iconUrl,color:(c=this.configurationMap.iconMarker)==null?void 0:c.color,scale:this.configurationMap.iconMarker.scale}),zIndex:1})}}):void 0}catch(i){console.log(i)}this.olMap=new iv({controls:xu({attribution:!1}).extend([new AE({tipLabel:"Pantalla completa"})]).extend([new vu({collapsible:!1})]),layers:[new g0({source:new o0({attributions:r})}),this.countryLayer,this.heatLayer,this.pointLayer],target:this.$refs["map-root"],view:new Be({center:[0,0],zoom:this.zoom})});const e=Sc([this.loadMapa.lng,this.loadMapa.lat]);this.olMap.getView().adjustCenter(e),this.fitMap()},initClick(){const r=document.getElementById("popup"),t=document.getElementById("popup-closer");this.overlay=new kE({element:r,autoPan:!0}),this.olMap.addOverlay(this.overlay),t.onclick=()=>this.closeOverlay(),this.olMap.addEventListener("click",this.onClickListener)},closeOverlay(){const r=document.getElementById("popup-closer");return this.overlay.setPosition(void 0),r.blur(),!1},async onClickListener(r){this.changeTypeMap("1");const t=document.getElementById("popup-content"),e=document.getElementById("popup-closer");if(this.olMap.hasFeatureAtPixel(r.pixel)===!0){const i=this.olMap.getFeaturesAtPixel(r.pixel)[0];if(i.getGeometry().getType()==="Point"){const o=this.olMap.getFeaturesAtPixel(r.pixel)[0].getProperties(),a=r.coordinate;this.abrirCerrarLoader&&this.abrirCerrarLoader(!0);try{this.abrirCerrarLoader&&this.abrirCerrarLoader(!1);let h="";this.onClickMarket&&(h=await this.onClickMarket(o)),t.innerHTML=h;const c=this.olMap.getView(),d=i.getGeometry().getExtent(),f=c.getCenter(),_=c.getZoom();c.fit(d,{padding:[325,75,0,75],maxZoom:_});const m=c.getCenter();c.setCenter(f),c.animate({center:m})}catch{this.abrirCerrarLoader&&this.abrirCerrarLoader(!1)}this.overlay.setPosition(a)}}else this.overlay.setPosition(void 0),e.blur()},updateSource(r){if(r&&r.features.length===0){this.heatLayer.getSource().clear();return}if(r){const t=this.heatLayer.getSource(),e=new mo({featureProjection:"EPSG:3857"}).readFeatures(r);t.clear(),t.addFeatures(e)}},updatePointSource(r){if(r&&r.features.length===0){this.pointLayer.getSource().clear();return}if(r){const t=this.pointLayer.getSource(),e=new mo({featureProjection:"EPSG:3857"}).readFeatures(r);t.clear(),t.addFeatures(e)}},async changeCountryLayer(r){if(this.countryLayer){const e=new co({url:`${r.data}`,format:new mo});await this.countryLayer.setSource(e)}},fitMap(){this.countryLayer.addEventListener("change",this.countryFunction)},countryFunction(r){const t=this.olMap.getView();if(r.target.getSource().getFeatures()[0]){const i=r.target.getSource().getExtent(),n=t.getZoom(),o=t.getCenter();t.fit(i,{padding:[75,75,75,75],maxZoom:6});const a=t.getZoom(),h=t.getCenter();t.setCenter(o),t.setZoom(n),t.animate({center:h}),t.animate({zoom:a})}},setRadius(r){this.heatLayer.setRadius(parseInt(r,10))},setBlur(r){this.heatLayer.setBlur(parseInt(r,10))},irACiudad(){if(this.loadMapa&&this.loadMapa.country!=="Bolivia"){const r=this.olMap.getView(),t=r.getZoom(),e=r.getCenter();r.setCenter(Sc([this.loadMapa.lng,this.loadMapa.lat]));const i=13,n=r.getCenter();r.setCenter(e),r.setZoom(t),r.animate({center:n}),r.animate({zoom:i})}},toggleSettings(){this.showSetting=!this.showSetting}},mounted(){this.countryLayer=this.loadMapa,this.initMap()},beforeDestroy(){this.countryLayer.removeEventListener("change",this.countryFunction),this.olMap.removeEventListener("click",this.onClickListener)}}),vL="",xL="",ui=r=>(V.pushScopeId("data-v-bbe3bfd2"),r=r(),V.popScopeId(),r),OE={ref:"map-root",style:{width:"100%",height:"100%",position:"relative"}},FE={class:"btn-zoom-container ol-control"},zE=[ui(()=>V.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[V.createElementVNode("path",{d:"M278.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l9.4-9.4V224H109.3l9.4-9.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4H224v114.8l-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c12.5 12.5 32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-9.4 9.4V288h114.8l-9.4 9.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l9.4 9.4H288V109.3l9.4 9.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-64-64z"})],-1))],NE={class:"type-map-container ol-control"},BE=[ui(()=>V.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},[V.createElementVNode("path",{d:"M215.7 499.2C267 435 384 279.4 384 192 384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2 12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"})],-1))],GE=[ui(()=>V.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},[V.createElementVNode("path",{d:"m153.6 29.9 16-21.3c4-5.4 10.4-8.6 17.1-8.6C198.4 0 208 9.6 208 21.3v22.2c0 13.1 5.4 25.7 14.9 34.7l84.7 80.8c48.8 46.6 76.4 111.2 76.4 178.7C384 434 306 512 209.7 512H192C86 512 0 426 0 320v-3.8c0-48.8 19.4-95.6 53.9-130.1l3.5-3.5c4.2-4.2 10-6.6 16-6.6 12.5 0 22.6 10.1 22.6 22.6V288c0 35.3 28.7 64 64 64s64-28.7 64-64v-3.9c0-18-7.2-35.3-19.9-48l-38.6-38.6c-24-24-37.5-56.7-37.5-90.7 0-27.7 9-54.8 25.6-76.9z"})],-1))],UE={class:"btn-settings ol-control"},ZE=[ui(()=>V.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[V.createElementVNode("path",{d:"M495.9 166.6c3.2 8.7.5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4l-55.6 17.8c-8.8 2.8-18.6.3-24.5-6.8-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4c-1.1-8.4-1.7-16.9-1.7-25.5s.6-17.1 1.7-25.4l-43.3-39.4c-6.9-6.2-9.6-15.9-6.4-24.6 4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2 5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8 8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"})],-1))],jE={class:"control-container"},WE={class:"map-flex"},HE=ui(()=>V.createElementVNode("label",null,"Tamaño del radio",-1)),VE={class:"map-flex"},XE=ui(()=>V.createElementVNode("label",null,"Difuminado",-1)),YE={class:"cant-casos ol-attribution ol-unselectable ol-control ol-uncollapsible"},KE={class:"text-cantidad"},qE=ui(()=>V.createElementVNode("span",{class:"ol-bold"},"Casos: ",-1)),$E={id:"popup",class:"ol-popup"},JE=[ui(()=>V.createElementVNode("a",{id:"popup-closer",class:"ol-popup-closer"},null,-1)),ui(()=>V.createElementVNode("div",{id:"popup-content"},null,-1))];function QE(r,t,e,i,n,o){var a;return V.openBlock(),V.createElementBlock("div",{class:"map-container",style:V.normalizeStyle(`height:${(a=r.configurationMap)==null?void 0:a.height}`)},[V.createElementVNode("div",OE,[V.withDirectives(V.createElementVNode("div",FE,[V.createElementVNode("button",{title:"Ir a la ciudad",class:"jl2-button-map",onClick:t[0]||(t[0]=(...h)=>r.irACiudad&&r.irACiudad(...h))},zE)],512),[[V.vShow,r.loadMapa.country!=="Bolivia"]]),V.createElementVNode("div",NE,[V.createElementVNode("button",{title:"Mapa con Marcador",class:V.normalizeClass(["jl2-button-map",{"jl2-button-map-select":r.type=="1"}]),onClick:t[1]||(t[1]=()=>r.type="1")},BE,2),V.createElementVNode("button",{title:"Mapa de Calor",class:V.normalizeClass(["jl2-button-map",{"jl2-button-map-select":r.type=="0"}]),onClick:t[2]||(t[2]=()=>r.type="0")},GE,2)]),V.withDirectives(V.createElementVNode("div",UE,[V.createElementVNode("button",{title:"Ver Opciones",class:"jl2-button-map",onClick:t[3]||(t[3]=(...h)=>r.toggleSettings&&r.toggleSettings(...h))},ZE)],512),[[V.vShow,!r.showSetting&&r.type==="0"]]),V.withDirectives(V.createElementVNode("div",jE,[V.createElementVNode("a",{onClick:t[4]||(t[4]=(...h)=>r.toggleSettings&&r.toggleSettings(...h)),class:"ol-popup-closer"}),V.createElementVNode("div",WE,[HE,V.withDirectives(V.createElementVNode("input",{id:"radius",type:"range",min:"1",max:"50",step:"1","onUpdate:modelValue":t[5]||(t[5]=h=>r.radius=h)},null,512),[[V.vModelText,r.radius]])]),V.createElementVNode("div",VE,[XE,V.withDirectives(V.createElementVNode("input",{id:"blur",type:"range",min:"1",max:"50",step:"1","onUpdate:modelValue":t[6]||(t[6]=h=>r.blur=h)},null,512),[[V.vModelText,r.blur]])])],512),[[V.vShow,r.type==="0"&&r.showSetting]]),V.createElementVNode("div",YE,[V.createElementVNode("p",KE,[qE,V.createTextVNode(V.toDisplayString(r.cantidad),1)])])],512),V.withDirectives(V.createElementVNode("div",$E,JE,512),[[V.vShow,r.type==="1"]])],4)}const tw=qo(DE,[["render",QE],["__scopeId","data-v-bbe3bfd2"]]);de.CoordinatesVerifyPolygon=wg,de.MapHeatComponent=tw,de.MapSearchAddress=ap,de.MapView=sp,de.listenServiceGoogleMaps=Vf,de.searchAutomaticGoogleMaps=Yf,de.searchManualGoogleMaps=Xf,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});