4 lines
179 KiB
JavaScript
4 lines
179 KiB
JavaScript
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerpolicy&&(r.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?r.credentials="include":s.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();class Es{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const ve=Es,nt={PROPERTYCHANGE:"propertychange"};class Cs{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}const un=Cs;function cn(i,e){return i>e?1:i<e?-1:0}function dn(i,e,t){const n=i.length;if(i[0]<=e)return 0;if(e<=i[n-1])return n-1;let s;if(t>0){for(s=1;s<n;++s)if(i[s]<e)return s-1}else if(t<0){for(s=1;s<n;++s)if(i[s]<=e)return s}else for(s=1;s<n;++s){if(i[s]==e)return s;if(i[s]<e)return typeof t=="function"?t(e,i[s-1],i[s])>0?s-1:s:i[s-1]-e<e-i[s]?s-1:s}return n-1}function Rs(i,e){const t=Array.isArray(e)?e:[e],n=t.length;for(let s=0;s<n;s++)i[i.length]=t[s]}function Mt(i,e){const t=i.length;if(t!==e.length)return!1;for(let n=0;n<t;n++)if(i[n]!==e[n])return!1;return!0}function vs(i,e,t){const n=e||cn;return i.every(function(s,r){if(r===0)return!0;const o=n(i[r-1],s);return!(o>0||t&&o===0)})}function vt(){return!0}function St(){return!1}function it(){}function xs(i){let e=!1,t,n,s;return function(){const r=Array.prototype.slice.call(arguments);return(!e||this!==s||!Mt(r,n))&&(e=!0,s=this,n=r,t=i.apply(this,arguments)),t}}function At(i){for(const e in i)delete i[e]}function Ps(i){let e;for(e in i)return!1;return!e}class Ls extends un{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;const n=this.listeners_||(this.listeners_={}),s=n[e]||(n[e]=[]);s.includes(t)||s.push(t)}dispatchEvent(e){const t=typeof e=="string",n=t?e:e.type,s=this.listeners_&&this.listeners_[n];if(!s)return;const r=t?new ve(e):e;r.target||(r.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});n in o||(o[n]=0,a[n]=0),++o[n];let l;for(let h=0,u=s.length;h<u;++h)if("handleEvent"in s[h]?l=s[h].handleEvent(r):l=s[h].call(this,r),l===!1||r.propagationStopped){l=!1;break}if(--o[n]===0){let h=a[n];for(delete a[n];h--;)this.removeEventListener(n,it);delete o[n]}return l}disposeInternal(){this.listeners_&&At(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,t){const n=this.listeners_&&this.listeners_[e];if(n){const s=n.indexOf(t);s!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(n[s]=it,++this.pendingRemovals_[e]):(n.splice(s,1),n.length===0&&delete this.listeners_[e]))}}}const gn=Ls,v={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 x(i,e,t,n,s){if(n&&n!==i&&(t=t.bind(n)),s){const o=t;t=function(){i.removeEventListener(e,t),o.apply(this,arguments)}}const r={target:i,type:e,listener:t};return i.addEventListener(e,t),r}function xt(i,e,t,n){return x(i,e,t,n,!0)}function A(i){i&&i.target&&(i.target.removeEventListener(i.type,i.listener),At(i))}class Ot extends gn{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(v.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){const n=e.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=x(this,e[r],t);return s}return x(this,e,t)}onceInternal(e,t){let n;if(Array.isArray(e)){const s=e.length;n=new Array(s);for(let r=0;r<s;++r)n[r]=xt(this,e[r],t)}else n=xt(this,e,t);return t.ol_key=n,n}unInternal(e,t){const n=t.ol_key;if(n)bs(n);else if(Array.isArray(e))for(let s=0,r=e.length;s<r;++s)this.removeEventListener(e[s],t);else this.removeEventListener(e,t)}}Ot.prototype.on;Ot.prototype.once;Ot.prototype.un;function bs(i){if(Array.isArray(i))for(let e=0,t=i.length;e<t;++e)A(i[e]);else A(i)}const Ri=Ot;function S(){throw new Error("Unimplemented abstract method.")}let Ds=0;function Y(i){return i.ol_uid||(i.ol_uid=String(++Ds))}class Un extends ve{constructor(e,t,n){super(e),this.key=t,this.oldValue=n}}class ws extends Ri{constructor(e){super(),this.on,this.once,this.un,Y(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}hasProperties(){return!!this.values_}notify(e,t){let n;n=`change:${e}`,this.hasListener(n)&&this.dispatchEvent(new Un(n,e,t)),n=nt.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new Un(n,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,n){const s=this.values_||(this.values_={});if(n)s[e]=t;else{const r=s[e];s[e]=t,r!==t&&this.notify(e,r)}}setProperties(e,t){for(const n in e)this.set(n,e[n],t)}applyProperties(e){!e.values_||Object.assign(this.values_||(this.values_={}),e.values_)}unset(e,t){if(this.values_&&e in this.values_){const n=this.values_[e];delete this.values_[e],Ps(this.values_)&&(this.values_=null),t||this.notify(e,n)}}}const se=ws,Is={1:"The view center is not defined",2:"The view resolution is not defined",3:"The view rotation is not defined",4:"`image` and `src` cannot be provided at the same time",5:"`imgSize` must be set when `image` is provided",7:"`format` must be set when `url` is set",8:"Unknown `serverType` configured",9:"`url` must be configured or set using `#setUrl()`",10:"The default `geometryFunction` can only handle `Point` geometries",11:"`options.featureTypes` must be an Array",12:"`options.geometryName` must also be provided when `options.bbox` is set",13:"Invalid corner",14:"Invalid color",15:"Tried to get a value for a key that does not exist in the cache",16:"Tried to set a value for a key that is used already",17:"`resolutions` must be sorted in descending order",18:"Either `origin` or `origins` must be configured, never both",19:"Number of `tileSizes` and `resolutions` must be equal",20:"Number of `origins` and `resolutions` must be equal",22:"Either `tileSize` or `tileSizes` must be configured, never both",24:"Invalid extent or geometry provided as `geometry`",25:"Cannot fit empty extent provided as `geometry`",26:"Features must have an id set",27:"Features must have an id set",28:'`renderMode` must be `"hybrid"` or `"vector"`',30:"The passed `feature` was already added to the source",31:"Tried to enqueue an `element` that was already added to the queue",32:"Transformation matrix cannot be inverted",33:"Invalid units",34:"Invalid geometry layout",36:"Unknown SRS type",37:"Unknown geometry type found",38:"`styleMapValue` has an unknown type",39:"Unknown geometry type",40:"Expected `feature` to have a geometry",41:"Expected an `ol/style/Style` or an array of `ol/style/Style.js`",42:"Question unknown, the answer is 42",43:"Expected `layers` to be an array or a `Collection`",47:"Expected `controls` to be an array or an `ol/Collection`",48:"Expected `interactions` to be an array or an `ol/Collection`",49:"Expected `overlays` to be an array or an `ol/Collection`",50:"`options.featureTypes` should be an Array",51:"Either `url` or `tileJSON` options must be provided",52:"Unknown `serverType` configured",53:"Unknown `tierSizeCalculation` configured",55:"The {-y} placeholder requires a tile grid with extent",56:"mapBrowserEvent must originate from a pointer event",57:"At least 2 conditions are required",59:"Invalid command found in the PBF",60:"Missing or invalid `size`",61:"Cannot determine IIIF Image API version from provided image information JSON",62:"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`",64:"Layer opacity must be a number",66:"`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`",67:"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both",68:"A VectorTile source can only be rendered if it has a projection compatible with the view projection",69:"`width` or `height` cannot be provided together with `scale`"};class Ms extends Error{constructor(e){const t=Is[e];super(t),this.code=e,this.name="AssertionError",this.message=t}}const vi=Ms,$={ADD:"add",REMOVE:"remove"},jn={LENGTH:"length"};class gt extends ve{constructor(e,t,n){super(e),this.element=t,this.index=n}}class Ss extends se{constructor(e,t){if(super(),this.on,this.once,this.un,t=t||{},this.unique_=!!t.unique,this.array_=e||[],this.unique_)for(let n=0,s=this.array_.length;n<s;++n)this.assertUnique_(this.array_[n],n);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let t=0,n=e.length;t<n;++t)this.push(e[t]);return this}forEach(e){const t=this.array_;for(let n=0,s=t.length;n<s;++n)e(t[n],n,t)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(jn.LENGTH)}insertAt(e,t){if(e<0||e>this.getLength())throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new gt($.ADD,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){this.unique_&&this.assertUnique_(e);const t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){const t=this.array_;for(let n=0,s=t.length;n<s;++n)if(t[n]===e)return this.removeAt(n)}removeAt(e){if(e<0||e>=this.getLength())return;const t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new gt($.REMOVE,t,e)),t}setAt(e,t){const n=this.getLength();if(e>=n){this.insertAt(e,t);return}if(e<0)throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(t,e);const s=this.array_[e];this.array_[e]=t,this.dispatchEvent(new gt($.REMOVE,s,e)),this.dispatchEvent(new gt($.ADD,t,e))}updateLength_(){this.set(jn.LENGTH,this.array_.length)}assertUnique_(e,t){for(let n=0,s=this.array_.length;n<s;++n)if(this.array_[n]===e&&n!==t)throw new vi(58)}}const ge=Ss,Re=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",As=Re.includes("firefox"),Os=Re.includes("safari")&&!Re.includes("chrom");Os&&(Re.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Re));const Ns=Re.includes("webkit")&&!Re.includes("edge"),Fs=Re.includes("macintosh"),xi=typeof devicePixelRatio<"u"?devicePixelRatio:1,Pi=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Gs=typeof Image<"u"&&Image.prototype.decode,Li=function(){let i=!1;try{const e=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return i}();function w(i,e){if(!i)throw new vi(e)}new Array(6);function Ue(){return[1,0,0,1,0,0]}function W(i,e){const t=e[0],n=e[1];return e[0]=i[0]*t+i[2]*n+i[4],e[1]=i[1]*t+i[3]*n+i[5],e}function st(i,e,t,n,s,r,o,a){const l=Math.sin(r),h=Math.cos(r);return i[0]=n*h,i[1]=s*l,i[2]=-n*l,i[3]=s*h,i[4]=o*n*h-a*n*l+e,i[5]=o*s*l+a*s*h+t,i}function bi(i,e){const t=ks(e);w(t!==0,32);const n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],l=e[5];return i[0]=o/t,i[1]=-s/t,i[2]=-r/t,i[3]=n/t,i[4]=(r*l-o*a)/t,i[5]=-(n*l-s*a)/t,i}function ks(i){return i[0]*i[3]-i[1]*i[2]}let Yn;function zs(i){const e="matrix("+i.join(", ")+")";if(Pi)return e;const t=Yn||(Yn=document.createElement("div"));return t.style.transform=e,t.style.transform}const z={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Hn(i){const e=De();for(let t=0,n=i.length;t<n;++t)Ct(e,i[t]);return e}function Xs(i,e){return e?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e):i.slice()}function Di(i,e,t){let n,s;return e<i[0]?n=i[0]-e:i[2]<e?n=e-i[2]:n=0,t<i[1]?s=i[1]-t:i[3]<t?s=t-i[3]:s=0,n*n+s*s}function fn(i,e){return Ii(i,e[0],e[1])}function wi(i,e){return i[0]<=e[0]&&e[2]<=i[2]&&i[1]<=e[1]&&e[3]<=i[3]}function Ii(i,e,t){return i[0]<=e&&e<=i[2]&&i[1]<=t&&t<=i[3]}function Vn(i,e){const t=i[0],n=i[1],s=i[2],r=i[3],o=e[0],a=e[1];let l=z.UNKNOWN;return o<t?l=l|z.LEFT:o>s&&(l=l|z.RIGHT),a<n?l=l|z.BELOW:a>r&&(l=l|z.ABOVE),l===z.UNKNOWN&&(l=z.INTERSECTING),l}function De(){return[1/0,1/0,-1/0,-1/0]}function We(i,e,t,n,s){return s?(s[0]=i,s[1]=e,s[2]=t,s[3]=n,s):[i,e,t,n]}function Nt(i){return We(1/0,1/0,-1/0,-1/0,i)}function Zs(i,e){const t=i[0],n=i[1];return We(t,n,t,n,e)}function Ks(i,e,t,n,s){const r=Nt(s);return Mi(r,i,e,t,n)}function Qt(i,e){return i[0]==e[0]&&i[2]==e[2]&&i[1]==e[1]&&i[3]==e[3]}function Us(i,e){return e[0]<i[0]&&(i[0]=e[0]),e[2]>i[2]&&(i[2]=e[2]),e[1]<i[1]&&(i[1]=e[1]),e[3]>i[3]&&(i[3]=e[3]),i}function Ct(i,e){e[0]<i[0]&&(i[0]=e[0]),e[0]>i[2]&&(i[2]=e[0]),e[1]<i[1]&&(i[1]=e[1]),e[1]>i[3]&&(i[3]=e[1])}function Mi(i,e,t,n,s){for(;t<n;t+=s)js(i,e[t],e[t+1]);return i}function js(i,e,t){i[0]=Math.min(i[0],e),i[1]=Math.min(i[1],t),i[2]=Math.max(i[2],e),i[3]=Math.max(i[3],t)}function Si(i,e){let t;return t=e(Ft(i)),t||(t=e(Gt(i)),t)||(t=e(kt(i)),t)||(t=e(we(i)),t)?t:!1}function en(i){let e=0;return _n(i)||(e=F(i)*ie(i)),e}function Ft(i){return[i[0],i[1]]}function Gt(i){return[i[2],i[1]]}function rt(i){return[(i[0]+i[2])/2,(i[1]+i[3])/2]}function Ys(i,e){let t;return e==="bottom-left"?t=Ft(i):e==="bottom-right"?t=Gt(i):e==="top-left"?t=we(i):e==="top-right"?t=kt(i):w(!1,13),t}function tn(i,e,t,n,s){const[r,o,a,l,h,u,c,d]=nn(i,e,t,n);return We(Math.min(r,a,h,c),Math.min(o,l,u,d),Math.max(r,a,h,c),Math.max(o,l,u,d),s)}function nn(i,e,t,n){const s=e*n[0]/2,r=e*n[1]/2,o=Math.cos(t),a=Math.sin(t),l=s*o,h=s*a,u=r*o,c=r*a,d=i[0],g=i[1];return[d-l+c,g-h-u,d-l-c,g-h+u,d+l-c,g+h+u,d+l+c,g+h-u,d-l+c,g-h-u]}function ie(i){return i[3]-i[1]}function tt(i,e,t){const n=t||De();return zt(i,e)?(i[0]>e[0]?n[0]=i[0]:n[0]=e[0],i[1]>e[1]?n[1]=i[1]:n[1]=e[1],i[2]<e[2]?n[2]=i[2]:n[2]=e[2],i[3]<e[3]?n[3]=i[3]:n[3]=e[3]):Nt(n),n}function we(i){return[i[0],i[3]]}function kt(i){return[i[2],i[3]]}function F(i){return i[2]-i[0]}function zt(i,e){return i[0]<=e[2]&&i[2]>=e[0]&&i[1]<=e[3]&&i[3]>=e[1]}function _n(i){return i[2]<i[0]||i[3]<i[1]}function Hs(i,e){return e?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e):i}function Vs(i,e,t){let n=!1;const s=Vn(i,e),r=Vn(i,t);if(s===z.INTERSECTING||r===z.INTERSECTING)n=!0;else{const o=i[0],a=i[1],l=i[2],h=i[3],u=e[0],c=e[1],d=t[0],g=t[1],f=(g-c)/(d-u);let _,p;!!(r&z.ABOVE)&&!(s&z.ABOVE)&&(_=d-(g-h)/f,n=_>=o&&_<=l),!n&&!!(r&z.RIGHT)&&!(s&z.RIGHT)&&(p=g-(d-l)*f,n=p>=a&&p<=h),!n&&!!(r&z.BELOW)&&!(s&z.BELOW)&&(_=d-(g-a)/f,n=_>=o&&_<=l),!n&&!!(r&z.LEFT)&&!(s&z.LEFT)&&(p=g-(d-o)*f,n=p>=a&&p<=h)}return n}function G(i,e,t){return Math.min(Math.max(i,e),t)}function Ws(i,e,t,n,s,r){const o=s-t,a=r-n;if(o!==0||a!==0){const l=((i-t)*o+(e-n)*a)/(o*o+a*a);l>1?(t=s,n=r):l>0&&(t+=o*l,n+=a*l)}return je(i,e,t,n)}function je(i,e,t,n){const s=t-i,r=n-e;return s*s+r*r}function Bs(i){const e=i.length;for(let n=0;n<e;n++){let s=n,r=Math.abs(i[n][n]);for(let a=n+1;a<e;a++){const l=Math.abs(i[a][n]);l>r&&(r=l,s=a)}if(r===0)return null;const o=i[s];i[s]=i[n],i[n]=o;for(let a=n+1;a<e;a++){const l=-i[a][n]/i[n][n];for(let h=n;h<e+1;h++)n==h?i[a][h]=0:i[a][h]+=l*i[n][h]}}const t=new Array(e);for(let n=e-1;n>=0;n--){t[n]=i[n][e]/i[n][n];for(let s=n-1;s>=0;s--)i[s][e]-=i[s][n]*t[n]}return t}function Rt(i){return i*Math.PI/180}function Ye(i,e){const t=i%e;return t*e<0?t+e:t}function $s(i,e,t){return i+t*(e-i)}function Ai(i,e){const t=Math.pow(10,e);return Math.round(i*t)/t}function ft(i,e){return Math.floor(Ai(i,e))}function _t(i,e){return Math.ceil(Ai(i,e))}const qs=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Js=/^([a-z]*)$|^hsla?\(.*\)$/i;function Qs(i){return typeof i=="string"?i:ir(i)}function er(i){const e=document.createElement("div");if(e.style.color=i,e.style.color!==""){document.body.appendChild(e);const t=getComputedStyle(e).color;return document.body.removeChild(e),t}return""}const tr=function(){const e={};let t=0;return function(n){let s;if(e.hasOwnProperty(n))s=e[n];else{if(t>=1024){let r=0;for(const o in e)(r++&3)===0&&(delete e[o],--t)}s=nr(n),e[n]=s,++t}return s}}();function Wn(i){return Array.isArray(i)?i:tr(i)}function nr(i){let e,t,n,s,r;if(Js.exec(i)&&(i=er(i)),qs.exec(i)){const o=i.length-1;let a;o<=4?a=1:a=2;const l=o===4||o===8;e=parseInt(i.substr(1+0*a,a),16),t=parseInt(i.substr(1+1*a,a),16),n=parseInt(i.substr(1+2*a,a),16),l?s=parseInt(i.substr(1+3*a,a),16):s=255,a==1&&(e=(e<<4)+e,t=(t<<4)+t,n=(n<<4)+n,l&&(s=(s<<4)+s)),r=[e,t,n,s/255]}else i.startsWith("rgba(")?(r=i.slice(5,-1).split(",").map(Number),Bn(r)):i.startsWith("rgb(")?(r=i.slice(4,-1).split(",").map(Number),r.push(1),Bn(r)):w(!1,14);return r}function Bn(i){return i[0]=G(i[0]+.5|0,0,255),i[1]=G(i[1]+.5|0,0,255),i[2]=G(i[2]+.5|0,0,255),i[3]=G(i[3],0,1),i}function ir(i){let e=i[0];e!=(e|0)&&(e=e+.5|0);let t=i[1];t!=(t|0)&&(t=t+.5|0);let n=i[2];n!=(n|0)&&(n=n+.5|0);const s=i[3]===void 0?1:Math.round(i[3]*100)/100;return"rgba("+e+","+t+","+n+","+s+")"}class sr{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 e=0;for(const t in this.cache_){const n=this.cache_[t];(e++&3)===0&&!n.hasListener()&&(delete this.cache_[t],--this.cacheSize_)}}}get(e,t,n){const s=$n(e,t,n);return s in this.cache_?this.cache_[s]:null}set(e,t,n,s){const r=$n(e,t,n);this.cache_[r]=s,++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function $n(i,e,t){const n=t?Qs(t):"null";return e+":"+i+":"+n}const Oi=new sr,L={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 rr extends se{constructor(e){super(),this.on,this.once,this.un,this.background_=e.background;const t=Object.assign({},e);typeof e.properties=="object"&&(delete t.properties,Object.assign(t,e.properties)),t[L.OPACITY]=e.opacity!==void 0?e.opacity:1,w(typeof t[L.OPACITY]=="number",64),t[L.VISIBLE]=e.visible!==void 0?e.visible:!0,t[L.Z_INDEX]=e.zIndex,t[L.MAX_RESOLUTION]=e.maxResolution!==void 0?e.maxResolution:1/0,t[L.MIN_RESOLUTION]=e.minResolution!==void 0?e.minResolution:0,t[L.MIN_ZOOM]=e.minZoom!==void 0?e.minZoom:-1/0,t[L.MAX_ZOOM]=e.maxZoom!==void 0?e.maxZoom:1/0,this.className_=t.className!==void 0?t.className:"ol-layer",delete t.className,this.setProperties(t),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){const t=this.state_||{layer:this,managed:e===void 0?!0:e},n=this.getZIndex();return t.opacity=G(Math.round(this.getOpacity()*100)/100,0,1),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=n===void 0&&!t.managed?1/0:n,t.maxResolution=this.getMaxResolution(),t.minResolution=Math.max(this.getMinResolution(),0),t.minZoom=this.getMinZoom(),t.maxZoom=this.getMaxZoom(),this.state_=t,t}getLayersArray(e){return S()}getLayerStatesArray(e){return S()}getExtent(){return this.get(L.EXTENT)}getMaxResolution(){return this.get(L.MAX_RESOLUTION)}getMinResolution(){return this.get(L.MIN_RESOLUTION)}getMinZoom(){return this.get(L.MIN_ZOOM)}getMaxZoom(){return this.get(L.MAX_ZOOM)}getOpacity(){return this.get(L.OPACITY)}getSourceState(){return S()}getVisible(){return this.get(L.VISIBLE)}getZIndex(){return this.get(L.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(L.EXTENT,e)}setMaxResolution(e){this.set(L.MAX_RESOLUTION,e)}setMinResolution(e){this.set(L.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(L.MAX_ZOOM,e)}setMinZoom(e){this.set(L.MIN_ZOOM,e)}setOpacity(e){w(typeof e=="number",64),this.set(L.OPACITY,e)}setVisible(e){this.set(L.VISIBLE,e)}setZIndex(e){this.set(L.Z_INDEX,e)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const Ni=rr,Ce={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class or extends Ni{constructor(e){const t=Object.assign({},e);delete t.source,super(t),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,e.render&&(this.render=e.render),e.map&&this.setMap(e.map),this.addChangeListener(L.SOURCE,this.handleSourcePropertyChange_);const n=e.source?e.source:null;this.setSource(n)}getLayersArray(e){return e=e||[],e.push(this),e}getLayerStatesArray(e){return e=e||[],e.push(this.getLayerState()),e}getSource(){return this.get(L.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const e=this.getSource();return e?e.getState():"undefined"}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!=="ready")&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(A(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const e=this.getSource();e&&(this.sourceChangeKey_=x(e,v.CHANGE,this.handleSourceChange_,this),e.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(e){return this.renderer_?this.renderer_.getFeatures(e):Promise.resolve([])}getData(e){return!this.renderer_||!this.rendered?null:this.renderer_.getData(e)}render(e,t){const n=this.getRenderer();if(n.prepareFrame(e))return this.rendered=!0,n.renderFrame(e,t)}unrender(){this.rendered=!1}setMapInternal(e){e||this.unrender(),this.set(L.MAP,e)}getMapInternal(){return this.get(L.MAP)}setMap(e){this.mapPrecomposeKey_&&(A(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(A(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=x(e,Ce.PRECOMPOSE,function(t){const s=t.frameState.layerStatesArray,r=this.getLayerState(!1);w(!s.some(function(o){return o.layer===r.layer}),67),s.push(r)},this),this.mapRenderKey_=x(this,v.CHANGE,e.render,e),this.changed())}setSource(e){this.set(L.SOURCE,e)}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 mn(i,e){if(!i.visible)return!1;const t=e.resolution;if(t<i.minResolution||t>=i.maxResolution)return!1;const n=e.zoom;return n>i.minZoom&&n<=i.maxZoom}const Tn=or;function ar(i,e){return i[0]+=+e[0],i[1]+=+e[1],i}function Pt(i,e){let t=!0;for(let n=i.length-1;n>=0;--n)if(i[n]!=e[n]){t=!1;break}return t}function pn(i,e){const t=Math.cos(e),n=Math.sin(e),s=i[0]*t-i[1]*n,r=i[1]*t+i[0]*n;return i[0]=s,i[1]=r,i}function lr(i,e){return i[0]*=e,i[1]*=e,i}function hr(i,e){if(e.canWrapX()){const t=F(e.getExtent()),n=ur(i,e,t);n&&(i[0]-=n*t)}return i}function ur(i,e,t){const n=e.getExtent();let s=0;return e.canWrapX()&&(i[0]<n[0]||i[0]>n[2])&&(t=t||F(n),s=Math.floor((i[0]-n[0])/t)),s}class cr extends un{constructor(e){super(),this.map_=e}dispatchRenderEvent(e,t){S()}calculateMatrices2D(e){const t=e.viewState,n=e.coordinateToPixelTransform,s=e.pixelToCoordinateTransform;st(n,e.size[0]/2,e.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]),bi(s,n)}forEachFeatureAtCoordinate(e,t,n,s,r,o,a,l){let h;const u=t.viewState;function c(m,R,b,P){return r.call(o,R,m?b:null,P)}const d=u.projection,g=hr(e.slice(),d),f=[[0,0]];if(d.canWrapX()&&s){const m=d.getExtent(),R=F(m);f.push([-R,0],[R,0])}const _=t.layerStatesArray,p=_.length,E=[],T=[];for(let m=0;m<f.length;m++)for(let R=p-1;R>=0;--R){const b=_[R],P=b.layer;if(P.hasRenderer()&&mn(b,u)&&a.call(l,P)){const I=P.getRenderer(),k=P.getSource();if(I&&k){const K=k.getWrapX()?g:e,Q=c.bind(null,b.managed);T[0]=K[0]+f[m][0],T[1]=K[1]+f[m][1],h=I.forEachFeatureAtCoordinate(T,t,n,Q,E)}if(h)return h}}if(E.length===0)return;const y=1/E.length;return E.forEach((m,R)=>m.distanceSq+=R*y),E.sort((m,R)=>m.distanceSq-R.distanceSq),E.some(m=>h=m.callback(m.feature,m.layer,m.geometry)),h}hasFeatureAtCoordinate(e,t,n,s,r,o){return this.forEachFeatureAtCoordinate(e,t,n,s,vt,this,r,o)!==void 0}getMap(){return this.map_}renderFrame(e){S()}scheduleExpireIconCache(e){Oi.canExpireCache()&&e.postRenderFunctions.push(dr)}}function dr(i,e){Oi.expire()}const gr=cr;class fr extends ve{constructor(e,t,n,s){super(e),this.inversePixelTransform=t,this.frameState=n,this.context=s}}const Fi=fr,mt="ol-hidden",_r="ol-selectable",Xt="ol-unselectable",yn="ol-control",qn="ol-collapsed";function Be(i,e,t,n){let s;return t&&t.length?s=t.shift():Pi?s=new OffscreenCanvas(i||300,e||300):s=document.createElement("canvas"),i&&(s.width=i),e&&(s.height=e),s.getContext("2d",n)}function En(i){const e=i.canvas;e.width=1,e.height=1,i.clearRect(0,0,1,1)}function mr(i){let e=i.offsetWidth;const t=getComputedStyle(i);return e+=parseInt(t.marginLeft,10)+parseInt(t.marginRight,10),e}function Tr(i){let e=i.offsetHeight;const t=getComputedStyle(i);return e+=parseInt(t.marginTop,10)+parseInt(t.marginBottom,10),e}function Jn(i,e){const t=e.parentNode;t&&t.replaceChild(i,e)}function Lt(i){return i&&i.parentNode?i.parentNode.removeChild(i):null}function Gi(i){for(;i.lastChild;)i.removeChild(i.lastChild)}function pr(i,e){const t=i.childNodes;for(let n=0;;++n){const s=t[n],r=e[n];if(!s&&!r)break;if(s!==r){if(!s){i.appendChild(r);continue}if(!r){i.removeChild(s),--n;continue}i.insertBefore(r,s)}}}const yr=new se;class Er extends gr{constructor(e){super(e),this.fontChangeListenerKey_=x(yr,nt.PROPERTYCHANGE,e.redrawText.bind(e)),this.element_=document.createElement("div");const t=this.element_.style;t.position="absolute",t.width="100%",t.height="100%",t.zIndex="0",this.element_.className=Xt+" ol-layers";const n=e.getViewport();n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,t){const n=this.getMap();if(n.hasListener(e)){const s=new Fi(e,void 0,t);n.dispatchEvent(s)}}disposeInternal(){A(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(Ce.PRECOMPOSE,e);const t=e.layerStatesArray.sort(function(o,a){return o.zIndex-a.zIndex}),n=e.viewState;this.children_.length=0;const s=[];let r=null;for(let o=0,a=t.length;o<a;++o){const l=t[o];e.layerIndex=o;const h=l.layer,u=h.getSourceState();if(!mn(l,n)||u!="ready"&&u!="undefined"){h.unrender();continue}const c=h.render(e,r);!c||(c!==r&&(this.children_.push(c),r=c),"getDeclutter"in h&&s.push(h))}for(let o=s.length-1;o>=0;--o)s[o].renderDeclutter(e);pr(this.element_,this.children_),this.dispatchRenderEvent(Ce.POSTCOMPOSE,e),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(e)}}const Cr=Er;class ye extends ve{constructor(e,t){super(e),this.layer=t}}const Yt={LAYERS:"layers"};class Cn extends Ni{constructor(e){e=e||{};const t=Object.assign({},e);delete t.layers;let n=e.layers;super(t),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Yt.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new ge(n.slice(),{unique:!0}):w(typeof n.getArray=="function",43):n=new ge(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(A),this.layersListenerKeys_.length=0;const e=this.getLayers();this.layersListenerKeys_.push(x(e,$.ADD,this.handleLayersAdd_,this),x(e,$.REMOVE,this.handleLayersRemove_,this));for(const n in this.listenerKeys_)this.listenerKeys_[n].forEach(A);At(this.listenerKeys_);const t=e.getArray();for(let n=0,s=t.length;n<s;n++){const r=t[n];this.registerLayerListeners_(r),this.dispatchEvent(new ye("addlayer",r))}this.changed()}registerLayerListeners_(e){const t=[x(e,nt.PROPERTYCHANGE,this.handleLayerChange_,this),x(e,v.CHANGE,this.handleLayerChange_,this)];e instanceof Cn&&t.push(x(e,"addlayer",this.handleLayerGroupAdd_,this),x(e,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[Y(e)]=t}handleLayerGroupAdd_(e){this.dispatchEvent(new ye("addlayer",e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new ye("removelayer",e.layer))}handleLayersAdd_(e){const t=e.element;this.registerLayerListeners_(t),this.dispatchEvent(new ye("addlayer",t)),this.changed()}handleLayersRemove_(e){const t=e.element,n=Y(t);this.listenerKeys_[n].forEach(A),delete this.listenerKeys_[n],this.dispatchEvent(new ye("removelayer",t)),this.changed()}getLayers(){return this.get(Yt.LAYERS)}setLayers(e){const t=this.getLayers();if(t){const n=t.getArray();for(let s=0,r=n.length;s<r;++s)this.dispatchEvent(new ye("removelayer",n[s]))}this.set(Yt.LAYERS,e)}getLayersArray(e){return e=e!==void 0?e:[],this.getLayers().forEach(function(t){t.getLayersArray(e)}),e}getLayerStatesArray(e){const t=e!==void 0?e:[],n=t.length;this.getLayers().forEach(function(o){o.getLayerStatesArray(t)});const s=this.getLayerState();let r=s.zIndex;!e&&s.zIndex===void 0&&(r=0);for(let o=n,a=t.length;o<a;o++){const l=t[o];l.opacity*=s.opacity,l.visible=l.visible&&s.visible,l.maxResolution=Math.min(l.maxResolution,s.maxResolution),l.minResolution=Math.max(l.minResolution,s.minResolution),l.minZoom=Math.max(l.minZoom,s.minZoom),l.maxZoom=Math.min(l.maxZoom,s.maxZoom),s.extent!==void 0&&(l.extent!==void 0?l.extent=tt(l.extent,s.extent):l.extent=s.extent),l.zIndex===void 0&&(l.zIndex=r)}return t}getSourceState(){return"ready"}}const Zt=Cn;class Rr extends ve{constructor(e,t,n){super(e),this.map=t,this.frameState=n!==void 0?n:null}}const ke=Rr;class vr extends ke{constructor(e,t,n,s,r,o){super(e,t,r),this.originalEvent=n,this.pixel_=null,this.coordinate_=null,this.dragging=s!==void 0?s:!1,this.activePointers=o}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(e){this.pixel_=e}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(e){this.coordinate_=e}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const pe=vr,M={SINGLECLICK:"singleclick",CLICK:v.CLICK,DBLCLICK:v.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},sn={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};class xr extends gn{constructor(e,t){super(e),this.map_=e,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=t===void 0?1:t,this.down_=null;const n=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=n,this.pointerdownListenerKey_=x(n,sn.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=x(n,sn.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(v.TOUCHMOVE,this.boundHandleTouchMove_,Li?{passive:!1}:!1)}emulateClick_(e){let t=new pe(M.CLICK,this.map_,e);this.dispatchEvent(t),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new pe(M.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const n=new pe(M.SINGLECLICK,this.map_,e);this.dispatchEvent(n)},250)}updateActivePointers_(e){const t=e,n=t.pointerId;if(t.type==M.POINTERUP||t.type==M.POINTERCANCEL){delete this.trackedTouches_[n];for(const s in this.trackedTouches_)if(this.trackedTouches_[s].target!==t.target){delete this.trackedTouches_[s];break}}else(t.type==M.POINTERDOWN||t.type==M.POINTERMOVE)&&(this.trackedTouches_[n]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);const t=new pe(M.POINTERUP,this.map_,e,void 0,void 0,this.activePointers_);this.dispatchEvent(t),this.emulateClicks_&&!t.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(e)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(A),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(e){return e.button===0}handlePointerDown_(e){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(e);const t=new pe(M.POINTERDOWN,this.map_,e,void 0,void 0,this.activePointers_);this.dispatchEvent(t),this.down_={};for(const n in e){const s=e[n];this.down_[n]=typeof s=="function"?it:s}if(this.dragListenerKeys_.length===0){const n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(x(n,M.POINTERMOVE,this.handlePointerMove_,this),x(n,M.POINTERUP,this.handlePointerUp_,this),x(this.element_,M.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(x(this.element_.getRootNode(),M.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;const t=new pe(M.POINTERDRAG,this.map_,e,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(t)}}relayMoveEvent_(e){this.originalPointerMoveEvent_=e;const t=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new pe(M.POINTERMOVE,this.map_,e,t))}handleTouchMove_(e){const t=this.originalPointerMoveEvent_;(!t||t.defaultPrevented)&&(typeof e.cancelable!="boolean"||e.cancelable===!0)&&e.preventDefault()}isMoving_(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(A(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(v.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(A(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(A),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const Pr=xr,ce={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Z={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},bt=1/0;class Lr{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,At(this.queuedElements_)}dequeue(){const e=this.elements_,t=this.priorities_,n=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));const s=this.keyFunction_(n);return delete this.queuedElements_[s],n}enqueue(e){w(!(this.keyFunction_(e)in this.queuedElements_),31);const t=this.priorityFunction_(e);return t!=bt?(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(e){return e*2+1}getRightChildIndex_(e){return e*2+2}getParentIndex_(e){return e-1>>1}heapify_(){let e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)}isEmpty(){return this.elements_.length===0}isKeyQueued(e){return e in this.queuedElements_}isQueued(e){return this.isKeyQueued(this.keyFunction_(e))}siftUp_(e){const t=this.elements_,n=this.priorities_,s=t.length,r=t[e],o=n[e],a=e;for(;e<s>>1;){const l=this.getLeftChildIndex_(e),h=this.getRightChildIndex_(e),u=h<s&&n[h]<n[l]?h:l;t[e]=t[u],n[e]=n[u],e=u}t[e]=r,n[e]=o,this.siftDown_(a,e)}siftDown_(e,t){const n=this.elements_,s=this.priorities_,r=n[t],o=s[t];for(;t>e;){const a=this.getParentIndex_(t);if(s[a]>o)n[t]=n[a],s[t]=s[a],t=a;else break}n[t]=r,s[t]=o}reprioritize(){const e=this.priorityFunction_,t=this.elements_,n=this.priorities_;let s=0;const r=t.length;let o,a,l;for(a=0;a<r;++a)o=t[a],l=e(o),l==bt?delete this.queuedElements_[this.keyFunction_(o)]:(n[s]=l,t[s++]=o);t.length=s,n.length=s,this.heapify_()}}const br=Lr,C={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class Dr extends br{constructor(e,t){super(function(n){return e.apply(null,n)},function(n){return n[0].getKey()}),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(e){const t=super.enqueue(e);return t&&e[0].addEventListener(v.CHANGE,this.boundHandleTileChange_),t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){const t=e.target,n=t.getState();if(n===C.LOADED||n===C.ERROR||n===C.EMPTY){n!==C.ERROR&&t.removeEventListener(v.CHANGE,this.boundHandleTileChange_);const s=t.getKey();s in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[s],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(e,t){let n=0,s,r,o;for(;this.tilesLoading_<e&&n<t&&this.getCount()>0;)r=this.dequeue()[0],o=r.getKey(),s=r.getState(),s===C.IDLE&&!(o in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++n,r.load())}}const wr=Dr;function Ir(i,e,t,n,s){if(!i||!(t in i.wantedTiles)||!i.wantedTiles[t][e.getKey()])return bt;const r=i.viewState.center,o=n[0]-r[0],a=n[1]-r[1];return 65536*Math.log(s)+Math.sqrt(o*o+a*a)/s}const B={ANIMATING:0,INTERACTING:1},q={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},Mr=42,Rn=256,ot={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class Sr{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||ot[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const ki=Sr,lt=6378137,Ze=Math.PI*lt,Ar=[-Ze,-Ze,Ze,Ze],Or=[-180,-85,180,85],Tt=lt*Math.log(Math.tan(Math.PI/2));class Ae extends ki{constructor(e){super({code:e,units:"m",extent:Ar,global:!0,worldExtent:Or,getPointResolution:function(t,n){return t/Math.cosh(n[1]/lt)}})}}const Qn=[new Ae("EPSG:3857"),new Ae("EPSG:102100"),new Ae("EPSG:102113"),new Ae("EPSG:900913"),new Ae("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ae("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Nr(i,e,t){const n=i.length;t=t>1?t:2,e===void 0&&(t>2?e=i.slice():e=new Array(n));for(let s=0;s<n;s+=t){e[s]=Ze*i[s]/180;let r=lt*Math.log(Math.tan(Math.PI*(+i[s+1]+90)/360));r>Tt?r=Tt:r<-Tt&&(r=-Tt),e[s+1]=r}return e}function Fr(i,e,t){const n=i.length;t=t>1?t:2,e===void 0&&(t>2?e=i.slice():e=new Array(n));for(let s=0;s<n;s+=t)e[s]=180*i[s]/Ze,e[s+1]=360*Math.atan(Math.exp(i[s+1]/lt))/Math.PI-90;return e}const Gr=6378137,ei=[-180,-90,180,90],kr=Math.PI*Gr/180;class Pe extends ki{constructor(e,t){super({code:e,units:"degrees",extent:ei,axisOrientation:t,global:!0,metersPerUnit:kr,worldExtent:ei})}}const ti=[new Pe("CRS:84"),new Pe("EPSG:4326","neu"),new Pe("urn:ogc:def:crs:OGC:1.3:CRS84"),new Pe("urn:ogc:def:crs:OGC:2:84"),new Pe("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Pe("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Pe("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let rn={};function zr(i){return rn[i]||rn[i.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Xr(i,e){rn[i]=e}let He={};function Dt(i,e,t){const n=i.getCode(),s=e.getCode();n in He||(He[n]={}),He[n][s]=t}function Zr(i,e){let t;return i in He&&e in He[i]&&(t=He[i][e]),t}const Kr=63710088e-1;function ni(i,e,t){t=t||Kr;const n=Rt(i[1]),s=Rt(e[1]),r=(s-n)/2,o=Rt(e[0]-i[0])/2,a=Math.sin(r)*Math.sin(r)+Math.sin(o)*Math.sin(o)*Math.cos(n)*Math.cos(s);return 2*t*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}const zi={info:1,warn:2,error:3,none:4};let Ur=zi.info;function Xi(...i){Ur>zi.warn||console.warn(...i)}let on=!0;function Zi(i){on=!(i===void 0?!0:i)}function vn(i,e){if(e!==void 0){for(let t=0,n=i.length;t<n;++t)e[t]=i[t];e=e}else e=i.slice();return e}function Ki(i,e){if(e!==void 0&&i!==e){for(let t=0,n=i.length;t<n;++t)e[t]=i[t];i=e}return i}function jr(i){Xr(i.getCode(),i),Dt(i,i,vn)}function Yr(i){i.forEach(jr)}function J(i){return typeof i=="string"?zr(i):i||null}function ii(i,e,t,n){i=J(i);let s;const r=i.getPointResolutionFunc();if(r){if(s=r(e,t),n&&n!==i.getUnits()){const o=i.getMetersPerUnit();o&&(s=s*o/ot[n])}}else{const o=i.getUnits();if(o=="degrees"&&!n||n=="degrees")s=e;else{const a=Pn(i,J("EPSG:4326"));if(a===Ki&&o!=="degrees")s=e*i.getMetersPerUnit();else{let h=[t[0]-e/2,t[1],t[0]+e/2,t[1],t[0],t[1]-e/2,t[0],t[1]+e/2];h=a(h,h,2);const u=ni(h.slice(0,2),h.slice(2,4)),c=ni(h.slice(4,6),h.slice(6,8));s=(u+c)/2}const l=n?ot[n]:i.getMetersPerUnit();l!==void 0&&(s/=l)}}return s}function si(i){Yr(i),i.forEach(function(e){i.forEach(function(t){e!==t&&Dt(e,t,vn)})})}function Hr(i,e,t,n){i.forEach(function(s){e.forEach(function(r){Dt(s,r,t),Dt(r,s,n)})})}function xn(i,e){if(i){if(typeof i=="string")return J(i)}else return J(e);return i}function Vr(i,e){return Zi(),Ui(i,"EPSG:4326",e!==void 0?e:"EPSG:3857")}function ze(i,e){if(i===e)return!0;const t=i.getUnits()===e.getUnits();return(i.getCode()===e.getCode()||Pn(i,e)===vn)&&t}function Pn(i,e){const t=i.getCode(),n=e.getCode();let s=Zr(t,n);return s||(s=Ki),s}function wt(i,e){const t=J(i),n=J(e);return Pn(t,n)}function Ui(i,e,t){return wt(e,t)(i,void 0,i.length)}function an(i,e){return i}function ue(i,e){return on&&!Pt(i,[0,0])&&i[0]>=-180&&i[0]<=180&&i[1]>=-90&&i[1]<=90&&(on=!1,Xi("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),i}function Wr(i,e){return i}function Ke(i,e){return i}function Br(){si(Qn),si(ti),Hr(ti,Qn,Nr,Fr)}Br();function ri(i,e,t){return function(n,s,r,o,a){if(!n)return;if(!s&&!e)return n;const l=e?0:r[0]*s,h=e?0:r[1]*s,u=a?a[0]:0,c=a?a[1]:0;let d=i[0]+l/2+u,g=i[2]-l/2+u,f=i[1]+h/2+c,_=i[3]-h/2+c;d>g&&(d=(g+d)/2,g=d),f>_&&(f=(_+f)/2,_=f);let p=G(n[0],d,g),E=G(n[1],f,_);if(o&&t&&s){const T=30*s;p+=-T*Math.log(1+Math.max(0,d-n[0])/T)+T*Math.log(1+Math.max(0,n[0]-g)/T),E+=-T*Math.log(1+Math.max(0,f-n[1])/T)+T*Math.log(1+Math.max(0,n[1]-_)/T)}return[p,E]}}function $r(i){return i}function Ln(i,e,t,n){const s=F(e)/t[0],r=ie(e)/t[1];return n?Math.min(i,Math.max(s,r)):Math.min(i,Math.min(s,r))}function bn(i,e,t){let n=Math.min(i,e);const s=50;return n*=Math.log(1+s*Math.max(0,i/e-1))/s+1,t&&(n=Math.max(n,t),n/=Math.log(1+s*Math.max(0,t/i-1))/s+1),G(n,t/2,e*2)}function qr(i,e,t,n){return e=e!==void 0?e:!0,function(s,r,o,a){if(s!==void 0){const l=i[0],h=i[i.length-1],u=t?Ln(l,t,o,n):l;if(a)return e?bn(s,u,h):G(s,h,u);const c=Math.min(u,s),d=Math.floor(dn(i,c,r));return i[d]>u&&d<i.length-1?i[d+1]:i[d]}}}function Jr(i,e,t,n,s,r){return n=n!==void 0?n:!0,t=t!==void 0?t:0,function(o,a,l,h){if(o!==void 0){const u=s?Ln(e,s,l,r):e;if(h)return n?bn(o,u,t):G(o,t,u);const c=1e-9,d=Math.ceil(Math.log(e/u)/Math.log(i)-c),g=-a*(.5-c)+.5,f=Math.min(u,o),_=Math.floor(Math.log(e/f)/Math.log(i)+g),p=Math.max(d,_),E=e/Math.pow(i,p);return G(E,t,u)}}}function oi(i,e,t,n,s){return t=t!==void 0?t:!0,function(r,o,a,l){if(r!==void 0){const h=n?Ln(i,n,a,s):i;return!t||!l?G(r,e,h):bn(r,h,e)}}}function Dn(i){if(i!==void 0)return 0}function ai(i){if(i!==void 0)return i}function Qr(i){const e=2*Math.PI/i;return function(t,n){if(n)return t;if(t!==void 0)return t=Math.floor(t/e+.5)*e,t}}function eo(i){return i=i||Rt(5),function(e,t){if(t)return e;if(e!==void 0)return Math.abs(e)<=i?0:e}}function ji(i){return Math.pow(i,3)}function $e(i){return 1-ji(1-i)}function to(i){return 3*i*i-2*i*i*i}function no(i){return i}function io(i,e,t,n,s,r){r=r||[];let o=0;for(let a=e;a<t;a+=n){const l=i[a],h=i[a+1];r[o++]=s[0]*l+s[2]*h+s[4],r[o++]=s[1]*l+s[3]*h+s[5]}return r&&r.length!=o&&(r.length=o),r}function so(i,e,t,n,s,r,o){o=o||[];const a=Math.cos(s),l=Math.sin(s),h=r[0],u=r[1];let c=0;for(let d=e;d<t;d+=n){const g=i[d]-h,f=i[d+1]-u;o[c++]=h+g*a-f*l,o[c++]=u+g*l+f*a;for(let _=d+2;_<d+n;++_)o[c++]=i[_]}return o&&o.length!=c&&(o.length=c),o}function ro(i,e,t,n,s,r,o,a){a=a||[];const l=o[0],h=o[1];let u=0;for(let c=e;c<t;c+=n){const d=i[c]-l,g=i[c+1]-h;a[u++]=l+s*d,a[u++]=h+r*g;for(let f=c+2;f<c+n;++f)a[u++]=i[f]}return a&&a.length!=u&&(a.length=u),a}function oo(i,e,t,n,s,r,o){o=o||[];let a=0;for(let l=e;l<t;l+=n){o[a++]=i[l]+s,o[a++]=i[l+1]+r;for(let h=l+2;h<l+n;++h)o[a++]=i[h]}return o&&o.length!=a&&(o.length=a),o}const li=Ue();class ao extends se{constructor(){super(),this.extent_=De(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=xs(function(e,t,n){if(!n)return this.getSimplifiedGeometry(t);const s=this.clone();return s.applyTransform(n),s.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return S()}closestPointXY(e,t,n,s){return S()}containsXY(e,t){const n=this.getClosestPoint([e,t]);return n[0]===e&&n[1]===t}getClosestPoint(e,t){return t=t||[NaN,NaN],this.closestPointXY(e[0],e[1],t,1/0),t}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return S()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&Nt(t),this.extentRevision_=this.getRevision()}return Hs(this.extent_,e)}rotate(e,t){S()}scale(e,t,n){S()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return S()}getType(){return S()}applyTransform(e){S()}intersectsExtent(e){return S()}translate(e,t){S()}transform(e,t){const n=J(e),s=n.getUnits()=="tile-pixels"?function(r,o,a){const l=n.getExtent(),h=n.getWorldExtent(),u=ie(h)/ie(l);return st(li,h[0],h[3],u,-u,0,0,0),io(r,0,r.length,a,li,o),wt(n,t)(r,o,a)}:wt(n,t);return this.applyTransform(s),this}}const lo=ao;class ho extends lo{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates=null}computeExtent(e){return Ks(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return S()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const t=this.getSimplifiedGeometryInternal(e);return t.getFlatCoordinates().length<this.flatCoordinates.length?t:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,t){this.stride=hi(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){S()}setLayout(e,t,n){let s;if(e)s=hi(e);else{for(let r=0;r<n;++r){if(t.length===0){this.layout="XY",this.stride=2;return}t=t[0]}s=t.length,e=uo(s)}this.layout=e,this.stride=s}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())}rotate(e,t){const n=this.getFlatCoordinates();if(n){const s=this.getStride();so(n,0,n.length,s,e,t,n),this.changed()}}scale(e,t,n){t===void 0&&(t=e),n||(n=rt(this.getExtent()));const s=this.getFlatCoordinates();if(s){const r=this.getStride();ro(s,0,s.length,r,e,t,n,s),this.changed()}}translate(e,t){const n=this.getFlatCoordinates();if(n){const s=this.getStride();oo(n,0,n.length,s,e,t,n),this.changed()}}}function uo(i){let e;return i==2?e="XY":i==3?e="XYZ":i==4&&(e="XYZM"),e}function hi(i){let e;return i=="XY"?e=2:i=="XYZ"||i=="XYM"?e=3:i=="XYZM"&&(e=4),e}const wn=ho;function ui(i,e,t,n,s,r,o){const a=i[e],l=i[e+1],h=i[t]-a,u=i[t+1]-l;let c;if(h===0&&u===0)c=e;else{const d=((s-a)*h+(r-l)*u)/(h*h+u*u);if(d>1)c=t;else if(d>0){for(let g=0;g<n;++g)o[g]=$s(i[e+g],i[t+g],d);o.length=n;return}else c=e}for(let d=0;d<n;++d)o[d]=i[c+d];o.length=n}function Yi(i,e,t,n,s){let r=i[e],o=i[e+1];for(e+=n;e<t;e+=n){const a=i[e],l=i[e+1],h=je(r,o,a,l);h>s&&(s=h),r=a,o=l}return s}function co(i,e,t,n,s){for(let r=0,o=t.length;r<o;++r){const a=t[r];s=Yi(i,e,a,n,s),e=a}return s}function Hi(i,e,t,n,s,r,o,a,l,h,u){if(e==t)return h;let c,d;if(s===0){if(d=je(o,a,i[e],i[e+1]),d<h){for(c=0;c<n;++c)l[c]=i[e+c];return l.length=n,d}return h}u=u||[NaN,NaN];let g=e+n;for(;g<t;)if(ui(i,g-n,g,n,o,a,u),d=je(o,a,u[0],u[1]),d<h){for(h=d,c=0;c<n;++c)l[c]=u[c];l.length=n,g+=n}else g+=n*Math.max((Math.sqrt(d)-Math.sqrt(h))/s|0,1);if(r&&(ui(i,t-n,e,n,o,a,u),d=je(o,a,u[0],u[1]),d<h)){for(h=d,c=0;c<n;++c)l[c]=u[c];l.length=n}return h}function go(i,e,t,n,s,r,o,a,l,h,u){u=u||[NaN,NaN];for(let c=0,d=t.length;c<d;++c){const g=t[c];h=Hi(i,e,g,n,s,r,o,a,l,h,u),e=g}return h}function fo(i,e,t,n){for(let s=0,r=t.length;s<r;++s)i[e++]=t[s];return e}function Vi(i,e,t,n){for(let s=0,r=t.length;s<r;++s){const o=t[s];for(let a=0;a<n;++a)i[e++]=o[a]}return e}function _o(i,e,t,n,s){s=s||[];let r=0;for(let o=0,a=t.length;o<a;++o){const l=Vi(i,e,t[o],n);s[r++]=l,e=l}return s.length=r,s}function mo(i,e,t,n,s,r,o){const a=(t-e)/n;if(a<3){for(;e<t;e+=n)r[o++]=i[e],r[o++]=i[e+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const h=[e,t-n];let u=0;for(;h.length>0;){const c=h.pop(),d=h.pop();let g=0;const f=i[d],_=i[d+1],p=i[c],E=i[c+1];for(let T=d+n;T<c;T+=n){const y=i[T],m=i[T+1],R=Ws(y,m,f,_,p,E);R>g&&(u=T,g=R)}g>s&&(l[(u-e)/n]=1,d+n<u&&h.push(d,u),u+n<c&&h.push(u,c))}for(let c=0;c<a;++c)l[c]&&(r[o++]=i[e+c*n],r[o++]=i[e+c*n+1]);return o}function Oe(i,e){return e*Math.round(i/e)}function To(i,e,t,n,s,r,o){if(e==t)return o;let a=Oe(i[e],s),l=Oe(i[e+1],s);e+=n,r[o++]=a,r[o++]=l;let h,u;do if(h=Oe(i[e],s),u=Oe(i[e+1],s),e+=n,e==t)return r[o++]=h,r[o++]=u,o;while(h==a&&u==l);for(;e<t;){const c=Oe(i[e],s),d=Oe(i[e+1],s);if(e+=n,c==h&&d==u)continue;const g=h-a,f=u-l,_=c-a,p=d-l;if(g*p==f*_&&(g<0&&_<g||g==_||g>0&&_>g)&&(f<0&&p<f||f==p||f>0&&p>f)){h=c,u=d;continue}r[o++]=h,r[o++]=u,a=h,l=u,h=c,u=d}return r[o++]=h,r[o++]=u,o}function po(i,e,t,n,s,r,o,a){for(let l=0,h=t.length;l<h;++l){const u=t[l];o=To(i,e,u,n,s,r,o),a.push(o),e=u}return o}function Wi(i,e,t,n,s){s=s!==void 0?s:[];let r=0;for(let o=e;o<t;o+=n)s[r++]=i.slice(o,o+n);return s.length=r,s}function yo(i,e,t,n,s){s=s!==void 0?s:[];let r=0;for(let o=0,a=t.length;o<a;++o){const l=t[o];s[r++]=Wi(i,e,l,n,s[r]),e=l}return s.length=r,s}function Bi(i,e,t,n){let s=0,r=i[t-n],o=i[t-n+1];for(;e<t;e+=n){const a=i[e],l=i[e+1];s+=o*a-r*l,r=a,o=l}return s/2}function Eo(i,e,t,n){let s=0;for(let r=0,o=t.length;r<o;++r){const a=t[r];s+=Bi(i,e,a,n),e=a}return s}class It extends wn{constructor(e,t){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}clone(){return new It(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,n,s){return s<Di(this.getExtent(),e,t)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Yi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Hi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,n,s))}getArea(){return Bi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Wi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const t=[];return t.length=mo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new It(t,"XY")}getType(){return"LinearRing"}intersectsExtent(e){return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Vi(this.flatCoordinates,0,e,this.stride),this.changed()}}const ci=It;class In extends wn{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){const e=new In(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,n,s){const r=this.flatCoordinates,o=je(e,t,r[0],r[1]);if(o<s){const a=this.stride;for(let l=0;l<a;++l)n[l]=r[l];return n.length=a,o}return s}getCoordinates(){return this.flatCoordinates?this.flatCoordinates.slice():[]}computeExtent(e){return Zs(this.flatCoordinates,e)}getType(){return"Point"}intersectsExtent(e){return Ii(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=fo(this.flatCoordinates,0,e,this.stride),this.changed()}}const Co=In;function Ro(i,e,t,n,s){return!Si(s,function(o){return!be(i,e,t,n,o[0],o[1])})}function be(i,e,t,n,s,r){let o=0,a=i[t-n],l=i[t-n+1];for(;e<t;e+=n){const h=i[e],u=i[e+1];l<=r?u>r&&(h-a)*(r-l)-(s-a)*(u-l)>0&&o++:u<=r&&(h-a)*(r-l)-(s-a)*(u-l)<0&&o--,a=h,l=u}return o!==0}function $i(i,e,t,n,s,r){if(t.length===0||!be(i,e,t[0],n,s,r))return!1;for(let o=1,a=t.length;o<a;++o)if(be(i,t[o-1],t[o],n,s,r))return!1;return!0}function vo(i,e,t,n,s,r,o){let a,l,h,u,c,d,g;const f=s[r+1],_=[];for(let T=0,y=t.length;T<y;++T){const m=t[T];for(u=i[m-n],d=i[m-n+1],a=e;a<m;a+=n)c=i[a],g=i[a+1],(f<=d&&g<=f||d<=f&&f<=g)&&(h=(f-d)/(g-d)*(c-u)+u,_.push(h)),u=c,d=g}let p=NaN,E=-1/0;for(_.sort(cn),u=_[0],a=1,l=_.length;a<l;++a){c=_[a];const T=Math.abs(c-u);T>E&&(h=(u+c)/2,$i(i,e,t,n,h,f)&&(p=h,E=T)),u=c}return isNaN(p)&&(p=s[r]),o?(o.push(p,f,E),o):[p,f,E]}function xo(i,e,t,n,s){let r;for(e+=n;e<t;e+=n)if(r=s(i.slice(e-n,e),i.slice(e,e+n)),r)return r;return!1}function qi(i,e,t,n,s){const r=Mi(De(),i,e,t,n);return zt(s,r)?wi(s,r)||r[0]>=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:xo(i,e,t,n,function(o,a){return Vs(s,o,a)}):!1}function Ji(i,e,t,n,s){return!!(qi(i,e,t,n,s)||be(i,e,t,n,s[0],s[1])||be(i,e,t,n,s[0],s[3])||be(i,e,t,n,s[2],s[1])||be(i,e,t,n,s[2],s[3]))}function Po(i,e,t,n,s){if(!Ji(i,e,t[0],n,s))return!1;if(t.length===1)return!0;for(let r=1,o=t.length;r<o;++r)if(Ro(i,t[r-1],t[r],n,s)&&!qi(i,t[r-1],t[r],n,s))return!1;return!0}function Lo(i,e,t,n){for(;e<t-n;){for(let s=0;s<n;++s){const r=i[e+s];i[e+s]=i[t-n+s],i[t-n+s]=r}e+=n,t-=n}}function Qi(i,e,t,n){let s=0,r=i[t-n],o=i[t-n+1];for(;e<t;e+=n){const a=i[e],l=i[e+1];s+=(a-r)*(l+o),r=a,o=l}return s===0?void 0:s>0}function bo(i,e,t,n,s){s=s!==void 0?s:!1;for(let r=0,o=t.length;r<o;++r){const a=t[r],l=Qi(i,e,a,n);if(r===0){if(s&&l||!s&&!l)return!1}else if(s&&!l||!s&&l)return!1;e=a}return!0}function di(i,e,t,n,s){s=s!==void 0?s:!1;for(let r=0,o=t.length;r<o;++r){const a=t[r],l=Qi(i,e,a,n);(r===0?s&&l||!s&&!l:s&&!l||!s&&l)&&Lo(i,e,a,n),e=a}return e}class at extends wn{constructor(e,t,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&n?(this.setFlatCoordinates(t,e),this.ends_=n):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?Rs(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new at(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,n,s){return s<Di(this.getExtent(),e,t)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(co(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),go(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,n,s))}containsXY(e,t){return $i(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return Eo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),di(t,0,this.ends_,this.stride,e)):t=this.flatCoordinates,yo(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=rt(this.getExtent());this.flatInteriorPoint_=vo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Co(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new ci(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){const e=this.layout,t=this.flatCoordinates,n=this.ends_,s=[];let r=0;for(let o=0,a=n.length;o<a;++o){const l=n[o],h=new ci(t.slice(r,l),e);s.push(h),r=l}return s}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;bo(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=di(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],n=[];return t.length=po(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),t,0,n),new at(t,"XY",n)}getType(){return"Polygon"}intersectsExtent(e){return Po(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const n=_o(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}}function gi(i){const e=i[0],t=i[1],n=i[2],s=i[3],r=[e,t,e,s,n,s,n,t,e,t];return new at(r,"XY",[r.length])}const Ht=0;class Do extends se{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=xn(e.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,e.projection&&Zi(),e.center&&(e.center=ue(e.center,this.projection_)),e.extent&&(e.extent=Ke(e.extent,this.projection_)),this.applyOptions_(e)}applyOptions_(e){const t=Object.assign({},e);for(const a in q)delete t[a];this.setProperties(t,!0);const n=Io(e);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=e.resolutions,this.padding_=e.padding,this.minZoom_=n.minZoom;const s=wo(e),r=n.constraint,o=Mo(e);this.constraints_={center:s,resolution:r,rotation:o},this.setRotation(e.rotation!==void 0?e.rotation:0),this.setCenterInternal(e.center!==void 0?e.center:null),e.resolution!==void 0?this.setResolution(e.resolution):e.zoom!==void 0&&this.setZoom(e.zoom)}get padding(){return this.padding_}set padding(e){let t=this.padding_;this.padding_=e;const n=this.getCenter();if(n){const s=e||[0,0,0,0];t=t||[0,0,0,0];const r=this.getResolution(),o=r/2*(s[3]-t[3]+t[1]-s[1]),a=r/2*(s[0]-t[0]+t[2]-s[2]);this.setCenterInternal([n[0]+o,n[1]-a])}}getUpdatedOptions_(e){const t=this.getProperties();return t.resolution!==void 0?t.resolution=this.getResolution():t.zoom=this.getZoom(),t.center=this.getCenterInternal(),t.rotation=this.getRotation(),Object.assign({},t,e)}animate(e){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const t=new Array(arguments.length);for(let n=0;n<t.length;++n){let s=arguments[n];s.center&&(s=Object.assign({},s),s.center=ue(s.center,this.getProjection())),s.anchor&&(s=Object.assign({},s),s.anchor=ue(s.anchor,this.getProjection())),t[n]=s}this.animateInternal.apply(this,t)}animateInternal(e){let t=arguments.length,n;t>1&&typeof arguments[t-1]=="function"&&(n=arguments[t-1],--t);let s=0;for(;s<t&&!this.isDef();++s){const u=arguments[s];u.center&&this.setCenterInternal(u.center),u.zoom!==void 0?this.setZoom(u.zoom):u.resolution&&this.setResolution(u.resolution),u.rotation!==void 0&&this.setRotation(u.rotation)}if(s===t){n&&pt(n,!0);return}let r=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_;const h=[];for(;s<t;++s){const u=arguments[s],c={start:r,complete:!1,anchor:u.anchor,duration:u.duration!==void 0?u.duration:1e3,easing:u.easing||to,callback:n};if(u.center&&(c.sourceCenter=o,c.targetCenter=u.center.slice(),o=c.targetCenter),u.zoom!==void 0?(c.sourceResolution=a,c.targetResolution=this.getResolutionForZoom(u.zoom),a=c.targetResolution):u.resolution&&(c.sourceResolution=a,c.targetResolution=u.resolution,a=c.targetResolution),u.rotation!==void 0){c.sourceRotation=l;const d=Ye(u.rotation-l+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=l+d,l=c.targetRotation}So(c)?c.complete=!0:r+=c.duration,h.push(c)}this.animations_.push(h),this.setHint(B.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[B.ANIMATING]>0}getInteracting(){return this.hints_[B.INTERACTING]>0}cancelAnimations(){this.setHint(B.ANIMATING,-this.hints_[B.ANIMATING]);let e;for(let t=0,n=this.animations_.length;t<n;++t){const s=this.animations_[t];if(s[0].callback&&pt(s[0].callback,!1),!e)for(let r=0,o=s.length;r<o;++r){const a=s[r];if(!a.complete){e=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=e,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;const e=Date.now();let t=!1;for(let n=this.animations_.length-1;n>=0;--n){const s=this.animations_[n];let r=!0;for(let o=0,a=s.length;o<a;++o){const l=s[o];if(l.complete)continue;const h=e-l.start;let u=l.duration>0?h/l.duration:1;u>=1?(l.complete=!0,u=1):r=!1;const c=l.easing(u);if(l.sourceCenter){const d=l.sourceCenter[0],g=l.sourceCenter[1],f=l.targetCenter[0],_=l.targetCenter[1];this.nextCenter_=l.targetCenter;const p=d+c*(f-d),E=g+c*(_-g);this.targetCenter_=[p,E]}if(l.sourceResolution&&l.targetResolution){const d=c===1?l.targetResolution:l.sourceResolution+c*(l.targetResolution-l.sourceResolution);if(l.anchor){const g=this.getViewportSize_(this.getRotation()),f=this.constraints_.resolution(d,0,g,!0);this.targetCenter_=this.calculateCenterZoom(f,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const d=c===1?Ye(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+c*(l.targetRotation-l.sourceRotation);if(l.anchor){const g=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(g,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),t=!0,!l.complete)break}if(r){this.animations_[n]=null,this.setHint(B.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=s[0].callback;o&&pt(o,!0)}}this.animations_=this.animations_.filter(Boolean),t&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,t){let n;const s=this.getCenterInternal();return s!==void 0&&(n=[s[0]-t[0],s[1]-t[1]],pn(n,e-this.getRotation()),ar(n,t)),n}calculateCenterZoom(e,t){let n;const s=this.getCenterInternal(),r=this.getResolution();if(s!==void 0&&r!==void 0){const o=t[0]-e*(t[0]-s[0])/r,a=t[1]-e*(t[1]-s[1])/r;n=[o,a]}return n}getViewportSize_(e){const t=this.viewportSize_;if(e){const n=t[0],s=t[1];return[Math.abs(n*Math.cos(e))+Math.abs(s*Math.sin(e)),Math.abs(n*Math.sin(e))+Math.abs(s*Math.cos(e))]}return t}setViewportSize(e){this.viewportSize_=Array.isArray(e)?e.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const e=this.getCenterInternal();return e&&an(e,this.getProjection())}getCenterInternal(){return this.get(q.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(e){return e!==void 0?(e[0]=this.hints_[0],e[1]=this.hints_[1],e):this.hints_.slice()}calculateExtent(e){const t=this.calculateExtentInternal(e);return Wr(t,this.getProjection())}calculateExtentInternal(e){e=e||this.getViewportSizeMinusPadding_();const t=this.getCenterInternal();w(t,1);const n=this.getResolution();w(n!==void 0,2);const s=this.getRotation();return w(s!==void 0,3),tn(t,n,s,e)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(e){this.applyOptions_(this.getUpdatedOptions_({maxZoom:e}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(e){this.applyOptions_(this.getUpdatedOptions_({minZoom:e}))}setConstrainResolution(e){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:e}))}getProjection(){return this.projection_}getResolution(){return this.get(q.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(Ke(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){t=t||this.getViewportSizeMinusPadding_();const n=F(e)/t[0],s=ie(e)/t[1];return Math.max(n,s)}getResolutionForValueFunction(e){e=e||2;const t=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,s=Math.log(t/n)/Math.log(e);return function(r){return t/Math.pow(e,r*s)}}getRotation(){return this.get(q.ROTATION)}getValueForResolutionFunction(e){const t=Math.log(e||2),n=this.getConstrainedResolution(this.maxResolution_),s=this.minResolution_,r=Math.log(n/s)/t;return function(o){return Math.log(n/o)/t/r}}getViewportSizeMinusPadding_(e){let t=this.getViewportSize_(e);const n=this.padding_;return n&&(t=[t[0]-n[1]-n[3],t[1]-n[0]-n[2]]),t}getState(){const e=this.getProjection(),t=this.getResolution(),n=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const o=this.getViewportSizeMinusPadding_();s=Vt(s,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],t,n)}return{center:s.slice(0),projection:e!==void 0?e:null,resolution:t,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getZoom(){let e;const t=this.getResolution();return t!==void 0&&(e=this.getZoomForResolution(t)),e}getZoomForResolution(e){let t=this.minZoom_||0,n,s;if(this.resolutions_){const r=dn(this.resolutions_,e,1);t=r,n=this.resolutions_[r],r==this.resolutions_.length-1?s=2:s=n/this.resolutions_[r+1]}else n=this.maxResolution_,s=this.zoomFactor_;return t+Math.log(n/e)/Math.log(s)}getResolutionForZoom(e){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;const t=G(Math.floor(e),0,this.resolutions_.length-2),n=this.resolutions_[t]/this.resolutions_[t+1];return this.resolutions_[t]/Math.pow(n,G(e-t,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,e-this.minZoom_)}fit(e,t){let n;if(w(Array.isArray(e)||typeof e.getSimplifiedGeometry=="function",24),Array.isArray(e)){w(!_n(e),25);const s=Ke(e,this.getProjection());n=gi(s)}else if(e.getType()==="Circle"){const s=Ke(e.getExtent(),this.getProjection());n=gi(s),n.rotate(this.getRotation(),rt(s))}else n=e;this.fitInternal(n,t)}rotatedExtentForGeometry(e){const t=this.getRotation(),n=Math.cos(t),s=Math.sin(-t),r=e.getFlatCoordinates(),o=e.getStride();let a=1/0,l=1/0,h=-1/0,u=-1/0;for(let c=0,d=r.length;c<d;c+=o){const g=r[c]*n-r[c+1]*s,f=r[c]*s+r[c+1]*n;a=Math.min(a,g),l=Math.min(l,f),h=Math.max(h,g),u=Math.max(u,f)}return[a,l,h,u]}fitInternal(e,t){t=t||{};let n=t.size;n||(n=this.getViewportSizeMinusPadding_());const s=t.padding!==void 0?t.padding:[0,0,0,0],r=t.nearest!==void 0?t.nearest:!1;let o;t.minResolution!==void 0?o=t.minResolution:t.maxZoom!==void 0?o=this.getResolutionForZoom(t.maxZoom):o=0;const a=this.rotatedExtentForGeometry(e);let l=this.getResolutionForExtentInternal(a,[n[0]-s[1]-s[3],n[1]-s[0]-s[2]]);l=isNaN(l)?o:Math.max(l,o),l=this.getConstrainedResolution(l,r?0:1);const h=this.getRotation(),u=Math.sin(h),c=Math.cos(h),d=rt(a);d[0]+=(s[1]-s[3])/2*l,d[1]+=(s[0]-s[2])/2*l;const g=d[0]*c-d[1]*u,f=d[1]*c+d[0]*u,_=this.getConstrainedCenter([g,f],l),p=t.callback?t.callback:it;t.duration!==void 0?this.animateInternal({resolution:l,center:_,duration:t.duration,easing:t.easing},p):(this.targetResolution_=l,this.targetCenter_=_,this.applyTargetState_(!1,!0),pt(p,!0))}centerOn(e,t,n){this.centerOnInternal(ue(e,this.getProjection()),t,n)}centerOnInternal(e,t,n){this.setCenterInternal(Vt(e,t,n,this.getResolution(),this.getRotation()))}calculateCenterShift(e,t,n,s){let r;const o=this.padding_;if(o&&e){const a=this.getViewportSizeMinusPadding_(-n),l=Vt(e,s,[a[0]/2+o[3],a[1]/2+o[0]],t,n);r=[e[0]-l[0],e[1]-l[1]]}return r}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(e){const t=an(this.targetCenter_,this.getProjection());this.setCenter([t[0]+e[0],t[1]+e[1]])}adjustCenterInternal(e){const t=this.targetCenter_;this.setCenterInternal([t[0]+e[0],t[1]+e[1]])}adjustResolution(e,t){t=t&&ue(t,this.getProjection()),this.adjustResolutionInternal(e,t)}adjustResolutionInternal(e,t){const n=this.getAnimating()||this.getInteracting(),s=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*e,0,s,n);t&&(this.targetCenter_=this.calculateCenterZoom(r,t)),this.targetResolution_*=e,this.applyTargetState_()}adjustZoom(e,t){this.adjustResolution(Math.pow(this.zoomFactor_,-e),t)}adjustRotation(e,t){t&&(t=ue(t,this.getProjection())),this.adjustRotationInternal(e,t)}adjustRotationInternal(e,t){const n=this.getAnimating()||this.getInteracting(),s=this.constraints_.rotation(this.targetRotation_+e,n);t&&(this.targetCenter_=this.calculateCenterRotate(s,t)),this.targetRotation_+=e,this.applyTargetState_()}setCenter(e){this.setCenterInternal(e&&ue(e,this.getProjection()))}setCenterInternal(e){this.targetCenter_=e,this.applyTargetState_()}setHint(e,t){return this.hints_[e]+=t,this.changed(),this.hints_[e]}setResolution(e){this.targetResolution_=e,this.applyTargetState_()}setRotation(e){this.targetRotation_=e,this.applyTargetState_()}setZoom(e){this.setResolution(this.getResolutionForZoom(e))}applyTargetState_(e,t){const n=this.getAnimating()||this.getInteracting()||t,s=this.constraints_.rotation(this.targetRotation_,n),r=this.getViewportSize_(s),o=this.constraints_.resolution(this.targetResolution_,0,r,n),a=this.constraints_.center(this.targetCenter_,o,r,n,this.calculateCenterShift(this.targetCenter_,o,s,r));this.get(q.ROTATION)!==s&&this.set(q.ROTATION,s),this.get(q.RESOLUTION)!==o&&(this.set(q.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),(!a||!this.get(q.CENTER)||!Pt(this.get(q.CENTER),a))&&this.set(q.CENTER,a),this.getAnimating()&&!e&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(e,t,n){e=e!==void 0?e:200;const s=t||0,r=this.constraints_.rotation(this.targetRotation_),o=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,s,o),l=this.constraints_.center(this.targetCenter_,a,o,!1,this.calculateCenterShift(this.targetCenter_,a,r,o));if(e===0&&!this.cancelAnchor_){this.targetResolution_=a,this.targetRotation_=r,this.targetCenter_=l,this.applyTargetState_();return}n=n||(e===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==a||this.getRotation()!==r||!this.getCenterInternal()||!Pt(this.getCenterInternal(),l))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:a,duration:e,easing:$e,anchor:n}))}beginInteraction(){this.resolveConstraints(0),this.setHint(B.INTERACTING,1)}endInteraction(e,t,n){n=n&&ue(n,this.getProjection()),this.endInteractionInternal(e,t,n)}endInteractionInternal(e,t,n){this.setHint(B.INTERACTING,-1),this.resolveConstraints(e,t,n)}getConstrainedCenter(e,t){const n=this.getViewportSize_(this.getRotation());return this.constraints_.center(e,t||this.getResolution(),n)}getConstrainedZoom(e,t){const n=this.getResolutionForZoom(e);return this.getZoomForResolution(this.getConstrainedResolution(n,t))}getConstrainedResolution(e,t){t=t||0;const n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(e,t,n)}}function pt(i,e){setTimeout(function(){i(e)},0)}function wo(i){if(i.extent!==void 0){const t=i.smoothExtentConstraint!==void 0?i.smoothExtentConstraint:!0;return ri(i.extent,i.constrainOnlyCenter,t)}const e=xn(i.projection,"EPSG:3857");if(i.multiWorld!==!0&&e.isGlobal()){const t=e.getExtent().slice();return t[0]=-1/0,t[2]=1/0,ri(t,!1,!1)}return $r}function Io(i){let e,t,n,o=i.minZoom!==void 0?i.minZoom:Ht,a=i.maxZoom!==void 0?i.maxZoom:28;const l=i.zoomFactor!==void 0?i.zoomFactor:2,h=i.multiWorld!==void 0?i.multiWorld:!1,u=i.smoothResolutionConstraint!==void 0?i.smoothResolutionConstraint:!0,c=i.showFullExtent!==void 0?i.showFullExtent:!1,d=xn(i.projection,"EPSG:3857"),g=d.getExtent();let f=i.constrainOnlyCenter,_=i.extent;if(!h&&!_&&d.isGlobal()&&(f=!1,_=g),i.resolutions!==void 0){const p=i.resolutions;t=p[o],n=p[a]!==void 0?p[a]:p[p.length-1],i.constrainResolution?e=qr(p,u,!f&&_,c):e=oi(t,n,u,!f&&_,c)}else{const E=(g?Math.max(F(g),ie(g)):360*ot.degrees/d.getMetersPerUnit())/Rn/Math.pow(2,Ht),T=E/Math.pow(2,28-Ht);t=i.maxResolution,t!==void 0?o=0:t=E/Math.pow(l,o),n=i.minResolution,n===void 0&&(i.maxZoom!==void 0?i.maxResolution!==void 0?n=t/Math.pow(l,a):n=E/Math.pow(l,a):n=T),a=o+Math.floor(Math.log(t/n)/Math.log(l)),n=t/Math.pow(l,a-o),i.constrainResolution?e=Jr(l,t,n,u,!f&&_,c):e=oi(t,n,u,!f&&_,c)}return{constraint:e,maxResolution:t,minResolution:n,minZoom:o,zoomFactor:l}}function Mo(i){if(i.enableRotation!==void 0?i.enableRotation:!0){const t=i.constrainRotation;return t===void 0||t===!0?eo():t===!1?ai:typeof t=="number"?Qr(t):ai}return Dn}function So(i){return!(i.sourceCenter&&i.targetCenter&&!Pt(i.sourceCenter,i.targetCenter)||i.sourceResolution!==i.targetResolution||i.sourceRotation!==i.targetRotation)}function Vt(i,e,t,n,s){const r=Math.cos(-s);let o=Math.sin(-s),a=i[0]*r-i[1]*o,l=i[1]*r+i[0]*o;a+=(e[0]/2-t[0])*n,l+=(t[1]-e[1]/2)*n,o=-o;const h=a*r-l*o,u=l*r+a*o;return[h,u]}const Ee=Do;class Ao extends se{constructor(e){super();const t=e.element;t&&!e.target&&!t.style.pointerEvents&&(t.style.pointerEvents="auto"),this.element=t||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){Lt(this.element),super.disposeInternal()}getMap(){return this.map_}setMap(e){this.map_&&Lt(this.element);for(let t=0,n=this.listenerKeys.length;t<n;++t)A(this.listenerKeys[t]);this.listenerKeys.length=0,this.map_=e,e&&((this.target_?this.target_:e.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==it&&this.listenerKeys.push(x(e,ce.POSTRENDER,this.render,this)),e.render())}render(e){}setTarget(e){this.target_=typeof e=="string"?document.getElementById(e):e}}const Mn=Ao;class Oo extends Mn{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=e.collapsed!==void 0?e.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=e.collapsible!==void 0,this.collapsible_=e.collapsible!==void 0?e.collapsible:!0,this.collapsible_||(this.collapsed_=!1);const t=e.className!==void 0?e.className:"ol-attribution",n=e.tipLabel!==void 0?e.tipLabel:"Attributions",s=e.expandClassName!==void 0?e.expandClassName:t+"-expand",r=e.collapseLabel!==void 0?e.collapseLabel:"\u203A",o=e.collapseClassName!==void 0?e.collapseClassName:t+"-collapse";typeof r=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=r,this.collapseLabel_.className=o):this.collapseLabel_=r;const a=e.label!==void 0?e.label:"i";typeof a=="string"?(this.label_=document.createElement("span"),this.label_.textContent=a,this.label_.className=s):this.label_=a;const l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=n,this.toggleButton_.appendChild(l),this.toggleButton_.addEventListener(v.CLICK,this.handleClick_.bind(this),!1);const h=t+" "+Xt+" "+yn+(this.collapsed_&&this.collapsible_?" "+qn:"")+(this.collapsible_?"":" ol-uncollapsible"),u=this.element;u.className=h,u.appendChild(this.toggleButton_),u.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(e){const t={},n=[];let s=!0;const r=e.layerStatesArray;for(let o=0,a=r.length;o<a;++o){const l=r[o];if(!mn(l,e.viewState))continue;const h=l.layer.getSource();if(!h)continue;const u=h.getAttributions();if(!u)continue;const c=u(e);if(!!c)if(s=s&&h.getAttributionsCollapsible()!==!1,Array.isArray(c))for(let d=0,g=c.length;d<g;++d)c[d]in t||(n.push(c[d]),t[c[d]]=!0);else c in t||(n.push(c),t[c]=!0)}return this.overrideCollapsible_||this.setCollapsible(s),n}updateElement_(e){if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const t=this.collectSourceAttributions_(e),n=t.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!Mt(t,this.renderedAttributions_)){Gi(this.ulElement_);for(let s=0,r=t.length;s<r;++s){const o=document.createElement("li");o.innerHTML=t[s],this.ulElement_.appendChild(o)}this.renderedAttributions_=t}}handleClick_(e){e.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(qn),this.collapsed_?Jn(this.collapseLabel_,this.label_):Jn(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(e){this.userCollapsed_=e,!(!this.collapsible_||this.collapsed_===e)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(e){this.updateElement_(e.frameState)}}const No=Oo;class Fo extends Mn{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target});const t=e.className!==void 0?e.className:"ol-rotate",n=e.label!==void 0?e.label:"\u21E7",s=e.compassClassName!==void 0?e.compassClassName:"ol-compass";this.label_=null,typeof n=="string"?(this.label_=document.createElement("span"),this.label_.className=s,this.label_.textContent=n):(this.label_=n,this.label_.classList.add(s));const r=e.tipLabel?e.tipLabel:"Reset rotation",o=document.createElement("button");o.className=t+"-reset",o.setAttribute("type","button"),o.title=r,o.appendChild(this.label_),o.addEventListener(v.CLICK,this.handleClick_.bind(this),!1);const a=t+" "+Xt+" "+yn,l=this.element;l.className=a,l.appendChild(o),this.callResetNorth_=e.resetNorth?e.resetNorth:void 0,this.duration_=e.duration!==void 0?e.duration:250,this.autoHide_=e.autoHide!==void 0?e.autoHide:!0,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(mt)}handleClick_(e){e.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const t=this.getMap().getView();if(!t)return;const n=t.getRotation();n!==void 0&&(this.duration_>0&&n%(2*Math.PI)!==0?t.animate({rotation:0,duration:this.duration_,easing:$e}):t.setRotation(0))}render(e){const t=e.frameState;if(!t)return;const n=t.viewState.rotation;if(n!=this.rotation_){const s="rotate("+n+"rad)";if(this.autoHide_){const r=this.element.classList.contains(mt);!r&&n===0?this.element.classList.add(mt):r&&n!==0&&this.element.classList.remove(mt)}this.label_.style.transform=s}this.rotation_=n}}const Go=Fo;class ko extends Mn{constructor(e){e=e||{},super({element:document.createElement("div"),target:e.target});const t=e.className!==void 0?e.className:"ol-zoom",n=e.delta!==void 0?e.delta:1,s=e.zoomInClassName!==void 0?e.zoomInClassName:t+"-in",r=e.zoomOutClassName!==void 0?e.zoomOutClassName:t+"-out",o=e.zoomInLabel!==void 0?e.zoomInLabel:"+",a=e.zoomOutLabel!==void 0?e.zoomOutLabel:"\u2013",l=e.zoomInTipLabel!==void 0?e.zoomInTipLabel:"Zoom in",h=e.zoomOutTipLabel!==void 0?e.zoomOutTipLabel:"Zoom out",u=document.createElement("button");u.className=s,u.setAttribute("type","button"),u.title=l,u.appendChild(typeof o=="string"?document.createTextNode(o):o),u.addEventListener(v.CLICK,this.handleClick_.bind(this,n),!1);const c=document.createElement("button");c.className=r,c.setAttribute("type","button"),c.title=h,c.appendChild(typeof a=="string"?document.createTextNode(a):a),c.addEventListener(v.CLICK,this.handleClick_.bind(this,-n),!1);const d=t+" "+Xt+" "+yn,g=this.element;g.className=d,g.appendChild(u),g.appendChild(c),this.duration_=e.duration!==void 0?e.duration:250}handleClick_(e,t){t.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){const n=this.getMap().getView();if(!n)return;const s=n.getZoom();if(s!==void 0){const r=n.getConstrainedZoom(s+e);this.duration_>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:r,duration:this.duration_,easing:$e})):n.setZoom(r)}}}const zo=ko;function Xo(i){i=i||{};const e=new ge;return(i.zoom!==void 0?i.zoom:!0)&&e.push(new zo(i.zoomOptions)),(i.rotate!==void 0?i.rotate:!0)&&e.push(new Go(i.rotateOptions)),(i.attribution!==void 0?i.attribution:!0)&&e.push(new No(i.attributionOptions)),e}const fi={ACTIVE:"active"};class Zo extends se{constructor(e){super(),this.on,this.once,this.un,e&&e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(fi.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(fi.ACTIVE,e)}setMap(e){this.map_=e}}function Ko(i,e,t){const n=i.getCenterInternal();if(n){const s=[n[0]+e[0],n[1]+e[1]];i.animateInternal({duration:t!==void 0?t:250,easing:no,center:i.getConstrainedCenter(s)})}}function Sn(i,e,t,n){const s=i.getZoom();if(s===void 0)return;const r=i.getConstrainedZoom(s+e),o=i.getResolutionForZoom(r);i.getAnimating()&&i.cancelAnimations(),i.animate({resolution:o,anchor:t,duration:n!==void 0?n:250,easing:$e})}const ht=Zo;class Uo extends ht{constructor(e){super(),e=e||{},this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:250}handleEvent(e){let t=!1;if(e.type==M.DBLCLICK){const n=e.originalEvent,s=e.map,r=e.coordinate,o=n.shiftKey?-this.delta_:this.delta_,a=s.getView();Sn(a,o,r,this.duration_),n.preventDefault(),t=!0}return!t}}const jo=Uo;class Yo extends ht{constructor(e){e=e||{},super(e),e.handleDownEvent&&(this.handleDownEvent=e.handleDownEvent),e.handleDragEvent&&(this.handleDragEvent=e.handleDragEvent),e.handleMoveEvent&&(this.handleMoveEvent=e.handleMoveEvent),e.handleUpEvent&&(this.handleUpEvent=e.handleUpEvent),e.stopDown&&(this.stopDown=e.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(e){return!1}handleDragEvent(e){}handleEvent(e){if(!e.originalEvent)return!0;let t=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==M.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==M.POINTERUP){const n=this.handleUpEvent(e);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(e.type==M.POINTERDOWN){const n=this.handleDownEvent(e);this.handlingDownUpSequence=n,t=this.stopDown(n)}else e.type==M.POINTERMOVE&&this.handleMoveEvent(e);return!t}handleMoveEvent(e){}handleUpEvent(e){return!1}stopDown(e){return e}updateTrackedPointers_(e){e.activePointers&&(this.targetPointers=e.activePointers)}}function An(i){const e=i.length;let t=0,n=0;for(let s=0;s<e;s++)t+=i[s].clientX,n+=i[s].clientY;return{clientX:t/e,clientY:n/e}}const ut=Yo;function ln(i){const e=arguments;return function(t){let n=!0;for(let s=0,r=e.length;s<r&&(n=n&&e[s](t),!!n);++s);return n}}const Ho=function(i){const e=i.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Vo=function(i){const e=i.map.getTargetElement(),t=i.map.getOwnerDocument().activeElement;return e.contains(t)},es=function(i){return i.map.getTargetElement().hasAttribute("tabindex")?Vo(i):!0},Wo=vt,ts=function(i){const e=i.originalEvent;return e.button==0&&!(Ns&&Fs&&e.ctrlKey)},ns=function(i){const e=i.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Bo=function(i){const e=i.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},is=function(i){const e=i.originalEvent,t=e.target.tagName;return t!=="INPUT"&&t!=="SELECT"&&t!=="TEXTAREA"&&!e.target.isContentEditable},Wt=function(i){const e=i.originalEvent;return w(e!==void 0,56),e.pointerType=="mouse"},$o=function(i){const e=i.originalEvent;return w(e!==void 0,56),e.isPrimary&&e.button===0};class qo extends ut{constructor(e){super({stopDown:St}),e=e||{},this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const t=e.condition?e.condition:ln(ns,$o);this.condition_=e.onFocusOnly?ln(es,t):t,this.noKinetic_=!1}handleDragEvent(e){const t=e.map;this.panning_||(this.panning_=!0,t.getView().beginInteraction());const n=this.targetPointers,s=t.getEventPixel(An(n));if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(s[0],s[1]),this.lastCentroid){const r=[this.lastCentroid[0]-s[0],s[1]-this.lastCentroid[1]],a=e.map.getView();lr(r,a.getResolution()),pn(r,a.getRotation()),a.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=s,this.lastPointersCount_=n.length,e.originalEvent.preventDefault()}handleUpEvent(e){const t=e.map,n=t.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const s=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),o=n.getCenterInternal(),a=t.getPixelFromCoordinateInternal(o),l=t.getCoordinateFromPixelInternal([a[0]-s*Math.cos(r),a[1]-s*Math.sin(r)]);n.animateInternal({center:n.getConstrainedCenter(l),duration:500,easing:$e})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(e){if(this.targetPointers.length>0&&this.condition_(e)){const n=e.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}const Jo=qo;class Qo extends ut{constructor(e){e=e||{},super({stopDown:St}),this.condition_=e.condition?e.condition:Ho,this.lastAngle_=void 0,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){if(!Wt(e))return;const t=e.map,n=t.getView();if(n.getConstraints().rotation===Dn)return;const s=t.getSize(),r=e.pixel,o=Math.atan2(s[1]/2-r[1],r[0]-s[0]/2);if(this.lastAngle_!==void 0){const a=o-this.lastAngle_;n.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(e){return Wt(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return Wt(e)&&ts(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}const ea=Qo;class ta extends un{constructor(e){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const e=this.startPixel_,t=this.endPixel_,n="px",s=this.element_.style;s.left=Math.min(e[0],t[0])+n,s.top=Math.min(e[1],t[1])+n,s.width=Math.abs(t[0]-e[0])+n,s.height=Math.abs(t[1]-e[1])+n}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const t=this.element_.style;t.left="inherit",t.top="inherit",t.width="inherit",t.height="inherit"}this.map_=e,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(e,t){this.startPixel_=e,this.endPixel_=t,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){const e=this.startPixel_,t=this.endPixel_,s=[e,[e[0],t[1]],t,[t[0],e[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);s[4]=s[0].slice(),this.geometry_?this.geometry_.setCoordinates([s]):this.geometry_=new at([s])}getGeometry(){return this.geometry_}}const na=ta,yt={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class Bt extends ve{constructor(e,t,n){super(e),this.coordinate=t,this.mapBrowserEvent=n}}class ia extends ut{constructor(e){super(),this.on,this.once,this.un,e=e||{},this.box_=new na(e.className||"ol-dragbox"),this.minArea_=e.minArea!==void 0?e.minArea:64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition?e.condition:ts,this.boxEndCondition_=e.boxEndCondition?e.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(e,t,n){const s=n[0]-t[0],r=n[1]-t[1];return s*s+r*r>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new Bt(yt.BOXDRAG,e.coordinate,e))}handleUpEvent(e){this.box_.setMap(null);const t=this.boxEndCondition_(e,this.startPixel_,e.pixel);return t&&this.onBoxEnd(e),this.dispatchEvent(new Bt(t?yt.BOXEND:yt.BOXCANCEL,e.coordinate,e)),!1}handleDownEvent(e){return this.condition_(e)?(this.startPixel_=e.pixel,this.box_.setMap(e.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Bt(yt.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}}const sa=ia;class ra extends sa{constructor(e){e=e||{};const t=e.condition?e.condition:Bo;super({condition:t,className:e.className||"ol-dragzoom",minArea:e.minArea}),this.duration_=e.duration!==void 0?e.duration:200,this.out_=e.out!==void 0?e.out:!1}onBoxEnd(e){const n=this.getMap().getView();let s=this.getGeometry();if(this.out_){const r=n.rotatedExtentForGeometry(s),o=n.getResolutionForExtentInternal(r),a=n.getResolution()/o;s=s.clone(),s.scale(a*a)}n.fitInternal(s,{duration:this.duration_,easing:$e})}}const oa=ra,Le={LEFT:37,UP:38,RIGHT:39,DOWN:40};class aa extends ht{constructor(e){super(),e=e||{},this.defaultCondition_=function(t){return ns(t)&&is(t)},this.condition_=e.condition!==void 0?e.condition:this.defaultCondition_,this.duration_=e.duration!==void 0?e.duration:100,this.pixelDelta_=e.pixelDelta!==void 0?e.pixelDelta:128}handleEvent(e){let t=!1;if(e.type==v.KEYDOWN){const n=e.originalEvent,s=n.keyCode;if(this.condition_(e)&&(s==Le.DOWN||s==Le.LEFT||s==Le.RIGHT||s==Le.UP)){const o=e.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,h=0;s==Le.DOWN?h=-a:s==Le.LEFT?l=-a:s==Le.RIGHT?l=a:h=a;const u=[l,h];pn(u,o.getRotation()),Ko(o,u,this.duration_),n.preventDefault(),t=!0}}return!t}}const la=aa;class ha extends ht{constructor(e){super(),e=e||{},this.condition_=e.condition?e.condition:is,this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:100}handleEvent(e){let t=!1;if(e.type==v.KEYDOWN||e.type==v.KEYPRESS){const n=e.originalEvent,s=n.charCode;if(this.condition_(e)&&(s=="+".charCodeAt(0)||s=="-".charCodeAt(0))){const r=e.map,o=s=="+".charCodeAt(0)?this.delta_:-this.delta_,a=r.getView();Sn(a,o,void 0,this.duration_),n.preventDefault(),t=!0}}return!t}}const ua=ha;class ca{constructor(e,t,n){this.decay_=e,this.minVelocity_=t,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,t){this.points_.push(e,t,Date.now())}end(){if(this.points_.length<6)return!1;const e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;let n=t-3;for(;n>0&&this.points_[n+2]>e;)n-=3;const s=this.points_[t+2]-this.points_[n+2];if(s<1e3/60)return!1;const r=this.points_[t]-this.points_[n],o=this.points_[t+1]-this.points_[n+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/s,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const da=ca;class ga extends ht{constructor(e){e=e||{},super(e),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=e.maxDelta!==void 0?e.maxDelta:1,this.duration_=e.duration!==void 0?e.duration:250,this.timeout_=e.timeout!==void 0?e.timeout:80,this.useAnchor_=e.useAnchor!==void 0?e.useAnchor:!0,this.constrainResolution_=e.constrainResolution!==void 0?e.constrainResolution:!1;const t=e.condition?e.condition:Wo;this.condition_=e.onFocusOnly?ln(es,t):t,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const e=this.getMap();if(!e)return;e.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}handleEvent(e){if(!this.condition_(e)||e.type!==v.WHEEL)return!0;const n=e.map,s=e.originalEvent;s.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.coordinate);let r;if(e.type==v.WHEEL&&(r=s.deltaY,As&&s.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(r/=xi),s.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=40)),r===0)return!1;this.lastDelta_=r;const o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(r)<4?"trackpad":"wheel");const a=n.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-r/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=r;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),l),!1}handleWheelZoom_(e){const t=e.getView();t.getAnimating()&&t.cancelAnimations();let n=-G(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),Sn(t,n,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(e){this.useAnchor_=e,e||(this.lastAnchor_=null)}}const fa=ga;class _a extends ut{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=St),super(t),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=e.threshold!==void 0?e.threshold:.3,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){let t=0;const n=this.targetPointers[0],s=this.targetPointers[1],r=Math.atan2(s.clientY-n.clientY,s.clientX-n.clientX);if(this.lastAngle_!==void 0){const l=r-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),t=l}this.lastAngle_=r;const o=e.map,a=o.getView();a.getConstraints().rotation!==Dn&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(An(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(t,this.anchor_)))}handleUpEvent(e){return this.targetPointers.length<2?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){if(this.targetPointers.length>=2){const t=e.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}}const ma=_a;class Ta extends ut{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=St),super(t),this.anchor_=null,this.duration_=e.duration!==void 0?e.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let t=1;const n=this.targetPointers[0],s=this.targetPointers[1],r=n.clientX-s.clientX,o=n.clientY-s.clientY,a=Math.sqrt(r*r+o*o);this.lastDistance_!==void 0&&(t=this.lastDistance_/a),this.lastDistance_=a;const l=e.map,h=l.getView();t!=1&&(this.lastScaleDelta_=t),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(An(this.targetPointers))),l.render(),h.adjustResolutionInternal(t,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){const n=e.map.getView(),s=this.lastScaleDelta_>1?1:-1;return n.endInteraction(this.duration_,s),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){const t=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}}const pa=Ta;function ya(i){i=i||{};const e=new ge,t=new da(-.005,.05,100);return(i.altShiftDragRotate!==void 0?i.altShiftDragRotate:!0)&&e.push(new ea),(i.doubleClickZoom!==void 0?i.doubleClickZoom:!0)&&e.push(new jo({delta:i.zoomDelta,duration:i.zoomDuration})),(i.dragPan!==void 0?i.dragPan:!0)&&e.push(new Jo({onFocusOnly:i.onFocusOnly,kinetic:t})),(i.pinchRotate!==void 0?i.pinchRotate:!0)&&e.push(new ma),(i.pinchZoom!==void 0?i.pinchZoom:!0)&&e.push(new pa({duration:i.zoomDuration})),(i.keyboard!==void 0?i.keyboard:!0)&&(e.push(new la),e.push(new ua({delta:i.zoomDelta,duration:i.zoomDuration}))),(i.mouseWheelZoom!==void 0?i.mouseWheelZoom:!0)&&e.push(new fa({onFocusOnly:i.onFocusOnly,duration:i.zoomDuration})),(i.shiftDragZoom!==void 0?i.shiftDragZoom:!0)&&e.push(new oa({duration:i.zoomDuration})),e}function _i(i){return i[0]>0&&i[1]>0}function Ea(i,e,t){return t===void 0&&(t=[0,0]),t[0]=i[0]*e+.5|0,t[1]=i[1]*e+.5|0,t}function de(i,e){return Array.isArray(i)?i:(e===void 0?e=[i,i]:(e[0]=i,e[1]=i),e)}function ss(i){if(i instanceof Tn){i.setMapInternal(null);return}i instanceof Zt&&i.getLayers().forEach(ss)}function rs(i,e){if(i instanceof Tn){i.setMapInternal(e);return}if(i instanceof Zt){const t=i.getLayers().getArray();for(let n=0,s=t.length;n<s;++n)rs(t[n],e)}}class Ca extends se{constructor(e){super(),e=e||{},this.on,this.once,this.un;const t=Ra(e);this.renderComplete_,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=e.maxTilesLoading!==void 0?e.maxTilesLoading:16,this.pixelRatio_=e.pixelRatio!==void 0?e.pixelRatio:xi,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=Ue(),this.pixelToCoordinateTransform_=Ue(),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_=e.moveTolerance,this.keyboardEventTarget_=t.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,this.resizeObserver_=new ResizeObserver(()=>this.updateSize()),this.controls=t.controls||Xo(),this.interactions=t.interactions||ya({onFocusOnly:!0}),this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new wr(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Z.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Z.VIEW,this.handleViewChanged_),this.addChangeListener(Z.SIZE,this.handleSizeChanged_),this.addChangeListener(Z.TARGET,this.handleTargetChanged_),this.setProperties(t.values);const n=this;e.view&&!(e.view instanceof Ee)&&e.view.then(function(s){n.setView(new Ee(s))}),this.controls.addEventListener($.ADD,s=>{s.element.setMap(this)}),this.controls.addEventListener($.REMOVE,s=>{s.element.setMap(null)}),this.interactions.addEventListener($.ADD,s=>{s.element.setMap(this)}),this.interactions.addEventListener($.REMOVE,s=>{s.element.setMap(null)}),this.overlays_.addEventListener($.ADD,s=>{this.addOverlayInternal_(s.element)}),this.overlays_.addEventListener($.REMOVE,s=>{const r=s.element.getId();r!==void 0&&delete this.overlayIdIndex_[r.toString()],s.element.setMap(null)}),this.controls.forEach(s=>{s.setMap(this)}),this.interactions.forEach(s=>{s.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(e){this.getControls().push(e)}addInteraction(e){this.getInteractions().push(e)}addLayer(e){this.getLayerGroup().getLayers().push(e)}handleLayerAdd_(e){rs(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){const t=e.getId();t!==void 0&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,t,n){if(!this.frameState_||!this.renderer_)return;const s=this.getCoordinateFromPixelInternal(e);n=n!==void 0?n:{};const r=n.hitTolerance!==void 0?n.hitTolerance:0,o=n.layerFilter!==void 0?n.layerFilter:vt,a=n.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(s,this.frameState_,r,a,t,null,o,null)}getFeaturesAtPixel(e,t){const n=[];return this.forEachFeatureAtPixel(e,function(s){n.push(s)},t),n}getAllLayers(){const e=[];function t(n){n.forEach(function(s){s instanceof Zt?t(s.getLayers()):e.push(s)})}return t(this.getLayers()),e}hasFeatureAtPixel(e,t){if(!this.frameState_||!this.renderer_)return!1;const n=this.getCoordinateFromPixelInternal(e);t=t!==void 0?t:{};const s=t.layerFilter!==void 0?t.layerFilter:vt,r=t.hitTolerance!==void 0?t.hitTolerance:0,o=t.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,r,o,s,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){const n=this.viewport_.getBoundingClientRect(),s=this.getSize(),r=n.width/s[0],o=n.height/s[1],a="changedTouches"in e?e.changedTouches[0]:e;return[(a.clientX-n.left)/r,(a.clientY-n.top)/o]}getTarget(){return this.get(Z.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return an(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){const t=this.frameState_;return t?W(t.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){const t=this.overlayIdIndex_[e.toString()];return t!==void 0?t:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Z.LAYERGROUP)}setLayers(e){const t=this.getLayerGroup();if(e instanceof ge){t.setLayers(e);return}const n=t.getLayers();n.clear(),n.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const e=this.getLayerGroup().getLayerStatesArray();for(let t=0,n=e.length;t<n;++t){const s=e[t];if(!s.visible)continue;const r=s.layer.getRenderer();if(r&&!r.ready)return!0;const o=s.layer.getSource();if(o&&o.loading)return!0}return!1}getPixelFromCoordinate(e){const t=ue(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)}getPixelFromCoordinateInternal(e){const t=this.frameState_;return t?W(t.coordinateToPixelTransform,e.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(Z.SIZE)}getView(){return this.get(Z.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const e=this.getTargetElement();return e?e.ownerDocument:document}getTilePriority(e,t,n,s){return Ir(this.frameState_,e,t,n,s)}handleBrowserEvent(e,t){t=t||e.type;const n=new pe(t,this,e);this.handleMapBrowserEvent(n)}handleMapBrowserEvent(e){if(!this.frameState_)return;const t=e.originalEvent,n=t.type;if(n===sn.POINTERDOWN||n===v.WHEEL||n===v.KEYDOWN){const s=this.getOwnerDocument(),r=this.viewport_.getRootNode?this.viewport_.getRootNode():s,o=t.target;if(this.overlayContainerStopEvent_.contains(o)||!(r===s?s.documentElement:r).contains(o))return}if(e.frameState=this.frameState_,this.dispatchEvent(e)!==!1){const s=this.getInteractions().getArray().slice();for(let r=s.length-1;r>=0;r--){const o=s[r];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(e)||e.propagationStopped)break}}}handlePostRender(){const e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){let s=this.maxTilesLoading_,r=s;if(e){const o=e.viewHints;if(o[B.ANIMATING]||o[B.INTERACTING]){const a=Date.now()-e.time>8;s=a?0:8,r=a?0:2}}t.getTilesLoading()<s&&(t.reprioritize(),t.loadMoreTiles(s,r))}e&&this.renderer_&&!e.animate&&(this.renderComplete_===!0?(this.hasListener(Ce.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(Ce.RENDERCOMPLETE,e),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new ke(ce.LOADEND,this,e)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new ke(ce.LOADSTART,this,e))));const n=this.postRenderFunctions_;for(let s=0,r=n.length;s<r;++s)n[s](this,e);n.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let n=0,s=this.targetChangeHandlerKeys_.length;n<s;++n)A(this.targetChangeHandlerKeys_[n]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(v.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(v.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,Lt(this.viewport_)}if(this.targetElement_){this.resizeObserver_.unobserve(this.targetElement_);const n=this.targetElement_.getRootNode();n instanceof ShadowRoot&&this.resizeObserver_.unobserve(n.host)}const e=this.getTarget(),t=typeof e=="string"?document.getElementById(e):e;if(this.targetElement_=t,!t)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{t.appendChild(this.viewport_),this.renderer_||(this.renderer_=new Cr(this)),this.mapBrowserEventHandler_=new Pr(this,this.moveTolerance_);for(const r in M)this.mapBrowserEventHandler_.addEventListener(M[r],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(v.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(v.WHEEL,this.boundHandleBrowserEvent_,Li?{passive:!1}:!1);const n=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.targetChangeHandlerKeys_=[x(n,v.KEYDOWN,this.handleBrowserEvent,this),x(n,v.KEYPRESS,this.handleBrowserEvent,this)];const s=t.getRootNode();s instanceof ShadowRoot&&this.resizeObserver_.observe(s.host),this.resizeObserver_.observe(t)}this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(A(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(A(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const e=this.getView();e&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=x(e,nt.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=x(e,v.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(A),this.layerGroupPropertyListenerKeys_=null);const e=this.getLayerGroup();e&&(this.handleLayerAdd_(new ye("addlayer",e)),this.layerGroupPropertyListenerKeys_=[x(e,nt.PROPERTYCHANGE,this.render,this),x(e,v.CHANGE,this.render,this),x(e,"addlayer",this.handleLayerAdd_,this),x(e,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){const e=this.getLayerGroup().getLayerStatesArray();for(let t=0,n=e.length;t<n;++t){const s=e[t].layer;s.hasRenderer()&&s.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(e){return this.getControls().remove(e)}removeInteraction(e){return this.getInteractions().remove(e)}removeLayer(e){return this.getLayerGroup().getLayers().remove(e)}handleLayerRemove_(e){ss(e.layer)}removeOverlay(e){return this.getOverlays().remove(e)}renderFrame_(e){const t=this.getSize(),n=this.getView(),s=this.frameState_;let r=null;if(t!==void 0&&_i(t)&&n&&n.isDef()){const o=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:tn(a.center,a.resolution,a.rotation,t),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:t,tileQueue:this.tileQueue_,time:e,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{},mapId:Y(this),renderTargets:{}},a.nextCenter&&a.nextResolution){const l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;r.nextExtent=tn(a.nextCenter,a.nextResolution,l,t)}}this.frameState_=r,this.renderer_.renderFrame(r),r&&(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),s&&(!this.previousExtent_||!_n(this.previousExtent_)&&!Qt(r.extent,this.previousExtent_))&&(this.dispatchEvent(new ke(ce.MOVESTART,this,s)),this.previousExtent_=Nt(this.previousExtent_)),this.previousExtent_&&!r.viewHints[B.ANIMATING]&&!r.viewHints[B.INTERACTING]&&!Qt(r.extent,this.previousExtent_)&&(this.dispatchEvent(new ke(ce.MOVEEND,this,r)),Xs(r.extent,this.previousExtent_))),this.dispatchEvent(new ke(ce.POSTRENDER,this,r)),this.renderComplete_=this.hasListener(ce.LOADSTART)||this.hasListener(ce.LOADEND)||this.hasListener(Ce.RENDERCOMPLETE)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(e){const t=this.getLayerGroup();t&&this.handleLayerRemove_(new ye("removelayer",t)),this.set(Z.LAYERGROUP,e)}setSize(e){this.set(Z.SIZE,e)}setTarget(e){this.set(Z.TARGET,e)}setView(e){if(!e||e instanceof Ee){this.set(Z.VIEW,e);return}this.set(Z.VIEW,new Ee);const t=this;e.then(function(n){t.setView(new Ee(n))})}updateSize(){const e=this.getTargetElement();let t;if(e){const s=getComputedStyle(e),r=e.offsetWidth-parseFloat(s.borderLeftWidth)-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight)-parseFloat(s.borderRightWidth),o=e.offsetHeight-parseFloat(s.borderTopWidth)-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)-parseFloat(s.borderBottomWidth);!isNaN(r)&&!isNaN(o)&&(t=[r,o],!_i(t)&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&Xi("No map visible because the map container's width or height are 0."))}const n=this.getSize();t&&(!n||!Mt(t,n))&&(this.setSize(t),this.updateViewportSize_())}updateViewportSize_(){const e=this.getView();if(e){let t;const n=getComputedStyle(this.viewport_);n.width&&n.height&&(t=[parseInt(n.width,10),parseInt(n.height,10)]),e.setViewportSize(t)}}}function Ra(i){let e=null;i.keyboardEventTarget!==void 0&&(e=typeof i.keyboardEventTarget=="string"?document.getElementById(i.keyboardEventTarget):i.keyboardEventTarget);const t={},n=i.layers&&typeof i.layers.getLayers=="function"?i.layers:new Zt({layers:i.layers});t[Z.LAYERGROUP]=n,t[Z.TARGET]=i.target,t[Z.VIEW]=i.view instanceof Ee?i.view:new Ee;let s;i.controls!==void 0&&(Array.isArray(i.controls)?s=new ge(i.controls.slice()):(w(typeof i.controls.getArray=="function",47),s=i.controls));let r;i.interactions!==void 0&&(Array.isArray(i.interactions)?r=new ge(i.interactions.slice()):(w(typeof i.interactions.getArray=="function",48),r=i.interactions));let o;return i.overlays!==void 0?Array.isArray(i.overlays)?o=new ge(i.overlays.slice()):(w(typeof i.overlays.getArray=="function",49),o=i.overlays):o=new ge,{controls:s,interactions:r,keyboardEventTarget:e,overlays:o,values:t}}const va=Ca;class xa extends gn{constructor(e,t,n){super(),n=n||{},this.tileCoord=e,this.state=t,this.interimTile=null,this.key="",this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(v.CHANGE)}release(){this.state===C.ERROR&&this.setState(C.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getInterimTile(){if(!this.interimTile)return this;let e=this.interimTile;do{if(e.getState()==C.LOADED)return this.transition_=0,e;e=e.interimTile}while(e);return this}refreshInterimChain(){if(!this.interimTile)return;let e=this.interimTile,t=this;do{if(e.getState()==C.LOADED){e.interimTile=null;break}else e.getState()==C.LOADING?t=e:e.getState()==C.IDLE?t.interimTile=e.interimTile:t=e;e=t.interimTile}while(e)}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==C.ERROR&&this.state>e)throw new Error("Tile load sequence violation");this.state=e,this.changed()}load(){S()}getAlpha(e,t){if(!this.transition_)return 1;let n=this.transitionStarts_[e];if(!n)n=t,this.transitionStarts_[e]=n;else if(n===-1)return 1;const s=t-n+1e3/60;return s>=this.transition_?1:ji(s/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}}const os=xa,et={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Pa(i,e,t){const n=i;let s=!0,r=!1,o=!1;const a=[xt(n,v.LOAD,function(){o=!0,r||e()})];return n.src&&Gs?(r=!0,n.decode().then(function(){s&&e()}).catch(function(l){s&&(o?e():t())})):a.push(xt(n,v.ERROR,t)),function(){s=!1,a.forEach(A)}}class La extends os{constructor(e,t,n,s,r,o){super(e,t,o),this.crossOrigin_=s,this.src_=n,this.key=n,this.image_=new Image,s!==null&&(this.image_.crossOrigin=s),this.unlisten_=null,this.tileLoadFunction_=r}getImage(){return this.image_}setImage(e){this.image_=e,this.state=C.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=C.ERROR,this.unlistenImage_(),this.image_=ba(),this.changed()}handleImageLoad_(){const e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=C.LOADED:this.state=C.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==C.ERROR&&(this.state=C.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==C.IDLE&&(this.state=C.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Pa(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function ba(){const i=Be(1,1);return i.fillStyle="rgba(0,0,0,0)",i.fillRect(0,0,1,1),i.canvas}const as=La,Da=.5,wa=10,mi=.25;class Ia{constructor(e,t,n,s,r,o){this.sourceProj_=e,this.targetProj_=t;let a={};const l=wt(this.targetProj_,this.sourceProj_);this.transformInv_=function(T){const y=T[0]+"/"+T[1];return a[y]||(a[y]=l(T)),a[y]},this.maxSourceExtent_=s,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!s&&!!this.sourceProj_.getExtent()&&F(s)==F(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?F(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?F(this.targetProj_.getExtent()):null;const h=we(n),u=kt(n),c=Gt(n),d=Ft(n),g=this.transformInv_(h),f=this.transformInv_(u),_=this.transformInv_(c),p=this.transformInv_(d),E=wa+(o?Math.max(0,Math.ceil(Math.log2(en(n)/(o*o*256*256)))):0);if(this.addQuad_(h,u,c,d,g,f,_,p,E),this.wrapsXInSource_){let T=1/0;this.triangles_.forEach(function(y,m,R){T=Math.min(T,y.source[0][0],y.source[1][0],y.source[2][0])}),this.triangles_.forEach(y=>{if(Math.max(y.source[0][0],y.source[1][0],y.source[2][0])-T>this.sourceWorldWidth_/2){const m=[[y.source[0][0],y.source[0][1]],[y.source[1][0],y.source[1][1]],[y.source[2][0],y.source[2][1]]];m[0][0]-T>this.sourceWorldWidth_/2&&(m[0][0]-=this.sourceWorldWidth_),m[1][0]-T>this.sourceWorldWidth_/2&&(m[1][0]-=this.sourceWorldWidth_),m[2][0]-T>this.sourceWorldWidth_/2&&(m[2][0]-=this.sourceWorldWidth_);const R=Math.min(m[0][0],m[1][0],m[2][0]);Math.max(m[0][0],m[1][0],m[2][0])-R<this.sourceWorldWidth_/2&&(y.source=m)}})}a={}}addTriangle_(e,t,n,s,r,o){this.triangles_.push({source:[s,r,o],target:[e,t,n]})}addQuad_(e,t,n,s,r,o,a,l,h){const u=Hn([r,o,a,l]),c=this.sourceWorldWidth_?F(u)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,g=this.sourceProj_.canWrapX()&&c>.5&&c<1;let f=!1;if(h>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const p=Hn([e,t,n,s]);f=F(p)/this.targetWorldWidth_>mi||f}!g&&this.sourceProj_.isGlobal()&&c&&(f=c>mi||f)}if(!f&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!zt(u,this.maxSourceExtent_))return;let _=0;if(!f&&(!isFinite(r[0])||!isFinite(r[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(h>0)f=!0;else if(_=(!isFinite(r[0])||!isFinite(r[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),_!=1&&_!=2&&_!=4&&_!=8)return}if(h>0){if(!f){const p=[(e[0]+n[0])/2,(e[1]+n[1])/2],E=this.transformInv_(p);let T;g?T=(Ye(r[0],d)+Ye(a[0],d))/2-Ye(E[0],d):T=(r[0]+a[0])/2-E[0];const y=(r[1]+a[1])/2-E[1];f=T*T+y*y>this.errorThresholdSquared_}if(f){if(Math.abs(e[0]-n[0])<=Math.abs(e[1]-n[1])){const p=[(t[0]+n[0])/2,(t[1]+n[1])/2],E=this.transformInv_(p),T=[(s[0]+e[0])/2,(s[1]+e[1])/2],y=this.transformInv_(T);this.addQuad_(e,t,p,T,r,o,E,y,h-1),this.addQuad_(T,p,n,s,y,E,a,l,h-1)}else{const p=[(e[0]+t[0])/2,(e[1]+t[1])/2],E=this.transformInv_(p),T=[(n[0]+s[0])/2,(n[1]+s[1])/2],y=this.transformInv_(T);this.addQuad_(e,p,T,s,r,E,y,l,h-1),this.addQuad_(p,t,n,T,E,o,a,y,h-1)}return}}if(g){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(_&11)==0&&this.addTriangle_(e,n,s,r,a,l),(_&14)==0&&this.addTriangle_(e,n,t,r,a,o),_&&((_&13)==0&&this.addTriangle_(t,s,e,o,l,r),(_&7)==0&&this.addTriangle_(t,s,n,o,l,a))}calculateSourceExtent(){const e=De();return this.triangles_.forEach(function(t,n,s){const r=t.source;Ct(e,r[0]),Ct(e,r[1]),Ct(e,r[2])}),e}getTriangles(){return this.triangles_}}const Ma=Ia;let $t;const Ve=[];function Ti(i,e,t,n,s){i.beginPath(),i.moveTo(0,0),i.lineTo(e,t),i.lineTo(n,s),i.closePath(),i.save(),i.clip(),i.fillRect(0,0,Math.max(e,n)+1,Math.max(t,s)),i.restore()}function qt(i,e){return Math.abs(i[e*4]-210)>2||Math.abs(i[e*4+3]-.75*255)>2}function Sa(){if($t===void 0){const i=Be(6,6,Ve);i.globalCompositeOperation="lighter",i.fillStyle="rgba(210, 0, 0, 0.75)",Ti(i,4,5,4,0),Ti(i,4,5,0,5);const e=i.getImageData(0,0,3,3).data;$t=qt(e,0)||qt(e,4)||qt(e,8),En(i),Ve.push(i.canvas)}return $t}function pi(i,e,t,n){const s=Ui(t,e,i);let r=ii(e,n,t);const o=e.getMetersPerUnit();o!==void 0&&(r*=o);const a=i.getMetersPerUnit();a!==void 0&&(r/=a);const l=i.getExtent();if(!l||fn(l,s)){const h=ii(i,r,s)/r;isFinite(h)&&h>0&&(r/=h)}return r}function Aa(i,e,t,n){const s=rt(t);let r=pi(i,e,s,n);return(!isFinite(r)||r<=0)&&Si(t,function(o){return r=pi(i,e,o,n),isFinite(r)&&r>0}),r}function Oa(i,e,t,n,s,r,o,a,l,h,u,c){const d=Be(Math.round(t*i),Math.round(t*e),Ve);if(c||(d.imageSmoothingEnabled=!1),l.length===0)return d.canvas;d.scale(t,t);function g(m){return Math.round(m*t)/t}d.globalCompositeOperation="lighter";const f=De();l.forEach(function(m,R,b){Us(f,m.extent)});const _=F(f),p=ie(f),E=Be(Math.round(t*_/n),Math.round(t*p/n),Ve);c||(E.imageSmoothingEnabled=!1);const T=t/n;l.forEach(function(m,R,b){const P=m.extent[0]-f[0],I=-(m.extent[3]-f[3]),k=F(m.extent),K=ie(m.extent);m.image.width>0&&m.image.height>0&&E.drawImage(m.image,h,h,m.image.width-2*h,m.image.height-2*h,P*T,I*T,k*T,K*T)});const y=we(o);return a.getTriangles().forEach(function(m,R,b){const P=m.source,I=m.target;let k=P[0][0],K=P[0][1],Q=P[1][0],fe=P[1][1],_e=P[2][0],qe=P[2][1];const ee=g((I[0][0]-y[0])/r),re=g(-(I[0][1]-y[1])/r),D=g((I[1][0]-y[0])/r),H=g(-(I[1][1]-y[1])/r),oe=g((I[2][0]-y[0])/r),te=g(-(I[2][1]-y[1])/r),xe=k,U=K;k=0,K=0,Q-=xe,fe-=U,_e-=xe,qe-=U;const ne=[[Q,fe,0,0,D-ee],[_e,qe,0,0,oe-ee],[0,0,Q,fe,H-re],[0,0,_e,qe,te-re]],N=Bs(ne);if(!!N){if(d.save(),d.beginPath(),Sa()||!c){d.moveTo(D,H);const O=4,Ie=ee-D,me=re-H;for(let j=0;j<O;j++)d.lineTo(D+g((j+1)*Ie/O),H+g(j*me/(O-1))),j!=O-1&&d.lineTo(D+g((j+1)*Ie/O),H+g((j+1)*me/(O-1)));d.lineTo(oe,te)}else d.moveTo(D,H),d.lineTo(ee,re),d.lineTo(oe,te);d.clip(),d.transform(N[0],N[2],N[1],N[3],ee,re),d.translate(f[0]-xe,f[3]-U),d.scale(n/t,-n/t),d.drawImage(E.canvas,0,0),d.restore()}}),En(E),Ve.push(E.canvas),u&&(d.save(),d.globalCompositeOperation="source-over",d.strokeStyle="black",d.lineWidth=1,a.getTriangles().forEach(function(m,R,b){const P=m.target,I=(P[0][0]-y[0])/r,k=-(P[0][1]-y[1])/r,K=(P[1][0]-y[0])/r,Q=-(P[1][1]-y[1])/r,fe=(P[2][0]-y[0])/r,_e=-(P[2][1]-y[1])/r;d.beginPath(),d.moveTo(K,Q),d.lineTo(I,k),d.lineTo(fe,_e),d.closePath(),d.stroke()}),d.restore()),d.canvas}class Na extends os{constructor(e,t,n,s,r,o,a,l,h,u,c,d){super(r,C.IDLE,{interpolate:!!d}),this.renderEdges_=c!==void 0?c:!1,this.pixelRatio_=a,this.gutter_=l,this.canvas_=null,this.sourceTileGrid_=t,this.targetTileGrid_=s,this.wrappedTileCoord_=o||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const g=s.getTileCoordExtent(this.wrappedTileCoord_),f=this.targetTileGrid_.getExtent();let _=this.sourceTileGrid_.getExtent();const p=f?tt(g,f):g;if(en(p)===0){this.state=C.EMPTY;return}const E=e.getExtent();E&&(_?_=tt(_,E):_=E);const T=s.getResolution(this.wrappedTileCoord_[0]),y=Aa(e,n,p,T);if(!isFinite(y)||y<=0){this.state=C.EMPTY;return}const m=u!==void 0?u:Da;if(this.triangulation_=new Ma(e,n,p,_,y*m,T),this.triangulation_.getTriangles().length===0){this.state=C.EMPTY;return}this.sourceZ_=t.getZForResolution(y);let R=this.triangulation_.calculateSourceExtent();if(_&&(e.canWrapX()?(R[1]=G(R[1],_[1],_[3]),R[3]=G(R[3],_[1],_[3])):R=tt(R,_)),!en(R))this.state=C.EMPTY;else{const b=t.getTileRangeForExtentAndZ(R,this.sourceZ_);for(let P=b.minX;P<=b.maxX;P++)for(let I=b.minY;I<=b.maxY;I++){const k=h(this.sourceZ_,P,I,a);k&&this.sourceTiles_.push(k)}this.sourceTiles_.length===0&&(this.state=C.EMPTY)}}getImage(){return this.canvas_}reproject_(){const e=[];if(this.sourceTiles_.forEach(t=>{t&&t.getState()==C.LOADED&&e.push({extent:this.sourceTileGrid_.getTileCoordExtent(t.tileCoord),image:t.getImage()})}),this.sourceTiles_.length=0,e.length===0)this.state=C.ERROR;else{const t=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(t),s=typeof n=="number"?n:n[0],r=typeof n=="number"?n:n[1],o=this.targetTileGrid_.getResolution(t),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Oa(s,r,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=C.LOADED}this.changed()}load(){if(this.state==C.IDLE){this.state=C.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(t=>{const n=t.getState();if(n==C.IDLE||n==C.LOADING){e++;const s=x(t,v.CHANGE,function(r){const o=t.getState();(o==C.LOADED||o==C.ERROR||o==C.EMPTY)&&(A(s),e--,e===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(s)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(t,n,s){t.getState()==C.IDLE&&t.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(A),this.sourcesListenerKeys_=null}release(){this.canvas_&&(En(this.canvas_.getContext("2d")),Ve.push(this.canvas_),this.canvas_=null),super.release()}}const hn=Na;class Fa{constructor(e){this.highWaterMark=e!==void 0?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(e){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(e){return this.entries_.hasOwnProperty(e)}forEach(e){let t=this.oldest_;for(;t;)e(t.value_,t.key_,this),t=t.newer}get(e,t){const n=this.entries_[e];return w(n!==void 0,15),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_}remove(e){const t=this.entries_[e];return w(t!==void 0,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_}getCount(){return this.count_}getKeys(){const e=new Array(this.count_);let t=0,n;for(n=this.newest_;n;n=n.older)e[t++]=n.key_;return e}getValues(){const e=new Array(this.count_);let t=0,n;for(n=this.newest_;n;n=n.older)e[t++]=n.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(e){if(!!this.containsKey(e))return this.entries_[e].value_}pop(){const e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_}replace(e,t){this.get(e),this.entries_[e].value_=t}set(e,t){w(!(e in this.entries_),16);const n={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[e]=n,++this.count_}setSize(e){this.highWaterMark=e}}const Ga=Fa;function yi(i,e,t,n){return n!==void 0?(n[0]=i,n[1]=e,n[2]=t,n):[i,e,t]}function Kt(i,e,t){return i+"/"+e+"/"+t}function ls(i){return Kt(i[0],i[1],i[2])}function ka(i){return i.split("/").map(Number)}function za(i){return(i[1]<<i[0])+i[2]}function Xa(i,e){const t=i[0],n=i[1],s=i[2];if(e.getMinZoom()>t||t>e.getMaxZoom())return!1;const r=e.getFullTileRange(t);return r?r.containsXY(n,s):!0}class Za extends Ga{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(e){for(;this.canExpireCache()&&!(this.peekLast().getKey()in e);)this.pop().release()}pruneExceptNewestZ(){if(this.getCount()===0)return;const e=this.peekFirstKey(),n=ka(e)[0];this.forEach(s=>{s.tileCoord[0]!==n&&(this.remove(ls(s.tileCoord)),s.release())})}}const hs=Za,Jt={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class Ka extends se{constructor(e){super(),this.projection=J(e.projection),this.attributions_=Ei(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible!==void 0?e.attributionsCollapsible:!0,this.loading=!1,this.state_=e.state!==void 0?e.state:"ready",this.wrapX_=e.wrapX!==void 0?e.wrapX:!1,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;const t=this;this.viewPromise_=new Promise(function(n,s){t.viewResolver=n,t.viewRejector=s})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=Ei(e),this.changed()}setState(e){this.state_=e,this.changed()}}function Ei(i){return i?Array.isArray(i)?function(e){return i}:typeof i=="function"?i:function(e){return[i]}:null}const Ua=Ka;class us{constructor(e,t,n,s){this.minX=e,this.maxX=t,this.minY=n,this.maxY=s}contains(e){return this.containsXY(e[1],e[2])}containsTileRange(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY}containsXY(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY}equals(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY}extend(e){e.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.maxY&&(this.maxY=e.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY}}function Ne(i,e,t,n,s){return s!==void 0?(s.minX=i,s.maxX=e,s.minY=t,s.maxY=n,s):new us(i,e,t,n)}const cs=us,Fe=[0,0,0],Te=5;class ja{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,w(vs(this.resolutions_,function(s,r){return r-s},!0),17);let t;if(!e.origins){for(let s=0,r=this.resolutions_.length-1;s<r;++s)if(!t)t=this.resolutions_[s]/this.resolutions_[s+1];else if(this.resolutions_[s]/this.resolutions_[s+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,w(this.origins_.length==this.resolutions_.length,20));const n=e.extent;n!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=we(n)),w(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,w(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:Rn,w(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=n!==void 0?n:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map(function(s,r){const o=new cs(Math.min(0,s[0]),Math.max(s[0]-1,-1),Math.min(0,s[1]),Math.max(s[1]-1,-1));if(n){const a=this.getTileRangeForExtentAndZ(n,r);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o},this):n&&this.calculateTileRanges_(n)}forEachTileCoord(e,t,n){const s=this.getTileRangeForExtentAndZ(e,t);for(let r=s.minX,o=s.maxX;r<=o;++r)for(let a=s.minY,l=s.maxY;a<=l;++a)n([t,r,a])}forEachTileCoordParentTileRange(e,t,n,s){let r,o,a,l=null,h=e[0]-1;for(this.zoomFactor_===2?(o=e[1],a=e[2]):l=this.getTileCoordExtent(e,s);h>=this.minZoom;){if(this.zoomFactor_===2?(o=Math.floor(o/2),a=Math.floor(a/2),r=Ne(o,o,a,a,n)):r=this.getTileRangeForExtentAndZ(l,h,n),t(h,r))return!0;--h}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,t,n){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){const r=e[1]*2,o=e[2]*2;return Ne(r,r+1,o,o+1,t)}const s=this.getTileCoordExtent(e,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(s,e[0]+1,t)}return null}getTileRangeForTileCoordAndZ(e,t,n){if(t>this.maxZoom||t<this.minZoom)return null;const s=e[0],r=e[1],o=e[2];if(t===s)return Ne(r,o,r,o,n);if(this.zoomFactor_){const l=Math.pow(this.zoomFactor_,t-s),h=Math.floor(r*l),u=Math.floor(o*l);if(t<s)return Ne(h,h,u,u,n);const c=Math.floor(l*(r+1))-1,d=Math.floor(l*(o+1))-1;return Ne(h,c,u,d,n)}const a=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(a,t,n)}getTileRangeExtent(e,t,n){const s=this.getOrigin(e),r=this.getResolution(e),o=de(this.getTileSize(e),this.tmpSize_),a=s[0]+t.minX*o[0]*r,l=s[0]+(t.maxX+1)*o[0]*r,h=s[1]+t.minY*o[1]*r,u=s[1]+(t.maxY+1)*o[1]*r;return We(a,h,l,u,n)}getTileRangeForExtentAndZ(e,t,n){this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,Fe);const s=Fe[1],r=Fe[2];this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,Fe);const o=Fe[1],a=Fe[2];return Ne(s,o,r,a,n)}getTileCoordCenter(e){const t=this.getOrigin(e[0]),n=this.getResolution(e[0]),s=de(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*s[0]*n,t[1]-(e[2]+.5)*s[1]*n]}getTileCoordExtent(e,t){const n=this.getOrigin(e[0]),s=this.getResolution(e[0]),r=de(this.getTileSize(e[0]),this.tmpSize_),o=n[0]+e[1]*r[0]*s,a=n[1]-(e[2]+1)*r[1]*s,l=o+r[0]*s,h=a+r[1]*s;return We(o,a,l,h,t)}getTileCoordForCoordAndResolution(e,t,n){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,n)}getTileCoordForXYAndResolution_(e,t,n,s,r){const o=this.getZForResolution(n),a=n/this.getResolution(o),l=this.getOrigin(o),h=de(this.getTileSize(o),this.tmpSize_);let u=a*(e-l[0])/n/h[0],c=a*(l[1]-t)/n/h[1];return s?(u=_t(u,Te)-1,c=_t(c,Te)-1):(u=ft(u,Te),c=ft(c,Te)),yi(o,u,c,r)}getTileCoordForXYAndZ_(e,t,n,s,r){const o=this.getOrigin(n),a=this.getResolution(n),l=de(this.getTileSize(n),this.tmpSize_);let h=(e-o[0])/a/l[0],u=(o[1]-t)/a/l[1];return s?(h=_t(h,Te)-1,u=_t(u,Te)-1):(h=ft(h,Te),u=ft(u,Te)),yi(n,h,u,r)}getTileCoordForCoordAndZ(e,t,n){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,n)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,t){const n=dn(this.resolutions_,e,t||0);return G(n,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,t){return Ji(t,0,t.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){const t=this.resolutions_.length,n=new Array(t);for(let s=this.minZoom;s<t;++s)n[s]=this.getTileRangeForExtentAndZ(e,s);this.fullTileRanges_=n}}const ds=ja;function gs(i){let e=i.getDefaultTileGrid();return e||(e=Wa(i),i.setDefaultTileGrid(e)),e}function Ya(i,e,t){const n=e[0],s=i.getTileCoordCenter(e),r=On(t);if(!fn(r,s)){const o=F(r),a=Math.ceil((r[0]-s[0])/o);return s[0]+=o*a,i.getTileCoordForCoordAndZ(s,n)}return e}function Ha(i,e,t,n){n=n!==void 0?n:"top-left";const s=fs(i,e,t);return new ds({extent:i,origin:Ys(i,n),resolutions:s,tileSize:t})}function Va(i){const e=i||{},t=e.extent||J("EPSG:3857").getExtent(),n={extent:t,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:fs(t,e.maxZoom,e.tileSize,e.maxResolution)};return new ds(n)}function fs(i,e,t,n){e=e!==void 0?e:Mr,t=de(t!==void 0?t:Rn);const s=ie(i),r=F(i);n=n>0?n:Math.max(r/t[0],s/t[1]);const o=e+1,a=new Array(o);for(let l=0;l<o;++l)a[l]=n/Math.pow(2,l);return a}function Wa(i,e,t,n){const s=On(i);return Ha(s,e,t,n)}function On(i){i=J(i);let e=i.getExtent();if(!e){const t=180*ot.degrees/i.getMetersPerUnit();e=We(-t,-t,t,t)}return e}class Ba extends Ua{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.opaque_=e.opaque!==void 0?e.opaque:!1,this.tilePixelRatio_=e.tilePixelRatio!==void 0?e.tilePixelRatio:1,this.tileGrid=e.tileGrid!==void 0?e.tileGrid:null;const t=[256,256];this.tileGrid&&de(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),t),this.tileCache=new hs(e.cacheSize||0),this.tmpSize=[0,0],this.key_=e.key||"",this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}canExpireCache(){return this.tileCache.canExpireCache()}expireCache(e,t){const n=this.getTileCacheForProjection(e);n&&n.expireCache(t)}forEachLoadedTile(e,t,n,s){const r=this.getTileCacheForProjection(e);if(!r)return!1;let o=!0,a,l,h;for(let u=n.minX;u<=n.maxX;++u)for(let c=n.minY;c<=n.maxY;++c)l=Kt(t,u,c),h=!1,r.containsKey(l)&&(a=r.get(l),h=a.getState()===C.LOADED,h&&(h=s(a)!==!1)),h||(o=!1);return o}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getOpaque(e){return this.opaque_}getResolutions(e){const t=e?this.getTileGridForProjection(e):this.tileGrid;return t?t.getResolutions():null}getTile(e,t,n,s,r){return S()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:gs(e)}getTileCacheForProjection(e){const t=this.getProjection();return w(t===null||ze(t,e),68),this.tileCache}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,n){const s=this.getTileGridForProjection(n),r=this.getTilePixelRatio(t),o=de(s.getTileSize(e),this.tmpSize);return r==1?o:Ea(o,r,this.tmpSize)}getTileCoordForTileUrlFunction(e,t){t=t!==void 0?t:this.getProjection();const n=this.getTileGridForProjection(t);return this.getWrapX()&&t.isGlobal()&&(e=Ya(n,e,t)),Xa(e,n)?e:null}clear(){this.tileCache.clear()}refresh(){this.clear(),super.refresh()}updateCacheSize(e,t){const n=this.getTileCacheForProjection(t);e>n.highWaterMark&&(n.highWaterMark=e)}useTile(e,t,n,s){}}class $a extends ve{constructor(e,t){super(e),this.tile=t}}const qa=Ba;function Ja(i,e){const t=/\{z\}/g,n=/\{x\}/g,s=/\{y\}/g,r=/\{-y\}/g;return function(o,a,l){if(!!o)return i.replace(t,o[0].toString()).replace(n,o[1].toString()).replace(s,o[2].toString()).replace(r,function(){const h=o[0],u=e.getFullTileRange(h);return w(u,55),(u.getHeight()-o[2]-1).toString()})}}function Qa(i,e){const t=i.length,n=new Array(t);for(let s=0;s<t;++s)n[s]=Ja(i[s],e);return el(n)}function el(i){return i.length===1?i[0]:function(e,t,n){if(!e)return;const s=za(e),r=Ye(s,i.length);return i[r](e,t,n)}}function tl(i){const e=[];let t=/\{([a-z])-([a-z])\}/.exec(i);if(t){const n=t[1].charCodeAt(0),s=t[2].charCodeAt(0);let r;for(r=n;r<=s;++r)e.push(i.replace(t[0],String.fromCharCode(r)));return e}if(t=/\{(\d+)-(\d+)\}/.exec(i),t){const n=parseInt(t[2],10);for(let s=parseInt(t[1],10);s<=n;s++)e.push(i.replace(t[0],s.toString()));return e}return e.push(i),e}class Nn extends qa{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===Nn.prototype.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(this.tileUrlFunction=e.tileUrlFunction),this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){const t=e.target,n=Y(t),s=t.getState();let r;s==C.LOADING?(this.tileLoadingKeys_[n]=!0,r=Jt.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],r=s==C.ERROR?Jt.TILELOADERROR:s==C.LOADED?Jt.TILELOADEND:void 0),r!=null&&this.dispatchEvent(new $a(r,t))}setTileLoadFunction(e){this.tileCache.clear(),this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,t){this.tileUrlFunction=e,this.tileCache.pruneExceptNewestZ(),typeof t<"u"?this.setKey(t):this.changed()}setUrl(e){const t=tl(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;const t=e.join(`
|
|
`);this.generateTileUrlFunction_?this.setTileUrlFunction(Qa(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,n){}useTile(e,t,n){const s=Kt(e,t,n);this.tileCache.containsKey(s)&&this.tileCache.get(s)}}const nl=Nn;class il extends nl{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:sl,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate!==void 0?e.interpolate:!0,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.tileClass=e.tileClass!==void 0?e.tileClass:as,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}canExpireCache(){if(this.tileCache.canExpireCache())return!0;for(const e in this.tileCacheForProjection)if(this.tileCacheForProjection[e].canExpireCache())return!0;return!1}expireCache(e,t){const n=this.getTileCacheForProjection(e);this.tileCache.expireCache(this.tileCache==n?t:{});for(const s in this.tileCacheForProjection){const r=this.tileCacheForProjection[s];r.expireCache(r==n?t:{})}}getGutterForProjection(e){return this.getProjection()&&e&&!ze(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getOpaque(e){return this.getProjection()&&e&&!ze(this.getProjection(),e)?!1:super.getOpaque(e)}getTileGridForProjection(e){const t=this.getProjection();if(this.tileGrid&&(!t||ze(t,e)))return this.tileGrid;const n=Y(e);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=gs(e)),this.tileGridForProjection[n]}getTileCacheForProjection(e){const t=this.getProjection();if(!t||ze(t,e))return this.tileCache;const n=Y(e);return n in this.tileCacheForProjection||(this.tileCacheForProjection[n]=new hs(this.tileCache.highWaterMark)),this.tileCacheForProjection[n]}createTile_(e,t,n,s,r,o){const a=[e,t,n],l=this.getTileCoordForTileUrlFunction(a,r),h=l?this.tileUrlFunction(l,s,r):void 0,u=new this.tileClass(a,h!==void 0?C.IDLE:C.EMPTY,h!==void 0?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(v.CHANGE,this.handleTileChange.bind(this)),u}getTile(e,t,n,s,r){const o=this.getProjection();if(!o||!r||ze(o,r))return this.getTileInternal(e,t,n,s,o||r);const a=this.getTileCacheForProjection(r),l=[e,t,n];let h;const u=ls(l);a.containsKey(u)&&(h=a.get(u));const c=this.getKey();if(h&&h.key==c)return h;const d=this.getTileGridForProjection(o),g=this.getTileGridForProjection(r),f=this.getTileCoordForTileUrlFunction(l,r),_=new hn(o,d,r,g,l,f,this.getTilePixelRatio(s),this.getGutter(),(p,E,T,y)=>this.getTileInternal(p,E,T,y,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return _.key=c,h?(_.interimTile=h,_.refreshInterimChain(),a.replace(u,_)):a.set(u,_),_}getTileInternal(e,t,n,s,r){let o=null;const a=Kt(e,t,n),l=this.getKey();if(!this.tileCache.containsKey(a))o=this.createTile_(e,t,n,s,r,l),this.tileCache.set(a,o);else if(o=this.tileCache.get(a),o.key!=l){const h=o;o=this.createTile_(e,t,n,s,r,l),h.getState()==C.IDLE?o.interimTile=h.interimTile:o.interimTile=h,o.refreshInterimChain(),this.tileCache.replace(a,o)}return o}setRenderReprojectionEdges(e){if(this.renderReprojectionEdges_!=e){this.renderReprojectionEdges_=e;for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear();this.changed()}}setTileGridForProjection(e,t){const n=J(e);if(n){const s=Y(n);s in this.tileGridForProjection||(this.tileGridForProjection[s]=t)}}clear(){super.clear();for(const e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear()}}function sl(i,e){i.getImage().src=e}const rl=il;class ol extends rl{constructor(e){e=e||{};const t=e.projection!==void 0?e.projection:"EPSG:3857",n=e.tileGrid!==void 0?e.tileGrid:Va({extent:On(t),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,opaque:e.opaque,projection:t,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0}getGutter(){return this.gutter_}}const al=ol,ll='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class hl extends al{constructor(e){e=e||{};let t;e.attributions!==void 0?t=e.attributions:t=[ll];const n=e.crossOrigin!==void 0?e.crossOrigin:"anonymous",s=e.url!==void 0?e.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:t,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:n,interpolate:e.interpolate,maxZoom:e.maxZoom!==void 0?e.maxZoom:19,opaque:e.opaque!==void 0?e.opaque:!0,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:s,wrapX:e.wrapX,zDirection:e.zDirection})}}const ul=hl,X={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class cl extends se{constructor(e){super(),this.on,this.once,this.un,this.options=e,this.id=e.id,this.insertFirst=e.insertFirst!==void 0?e.insertFirst:!0,this.stopEvent=e.stopEvent!==void 0?e.stopEvent:!0,this.element=document.createElement("div"),this.element.className=e.className!==void 0?e.className:"ol-overlay-container "+_r,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=e.autoPan===!0?{}:e.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(X.ELEMENT,this.handleElementChanged),this.addChangeListener(X.MAP,this.handleMapChanged),this.addChangeListener(X.OFFSET,this.handleOffsetChanged),this.addChangeListener(X.POSITION,this.handlePositionChanged),this.addChangeListener(X.POSITIONING,this.handlePositioningChanged),e.element!==void 0&&this.setElement(e.element),this.setOffset(e.offset!==void 0?e.offset:[0,0]),this.setPositioning(e.positioning||"top-left"),e.position!==void 0&&this.setPosition(e.position)}getElement(){return this.get(X.ELEMENT)}getId(){return this.id}getMap(){return this.get(X.MAP)||null}getOffset(){return this.get(X.OFFSET)}getPosition(){return this.get(X.POSITION)}getPositioning(){return this.get(X.POSITIONING)}handleElementChanged(){Gi(this.element);const e=this.getElement();e&&this.element.appendChild(e)}handleMapChanged(){this.mapPostrenderListenerKey&&(Lt(this.element),A(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const e=this.getMap();if(e){this.mapPostrenderListenerKey=x(e,ce.POSTRENDER,this.render,this),this.updatePixelPosition();const t=this.stopEvent?e.getOverlayContainerStopEvent():e.getOverlayContainer();this.insertFirst?t.insertBefore(this.element,t.childNodes[0]||null):t.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(e){this.set(X.ELEMENT,e)}setMap(e){this.set(X.MAP,e)}setOffset(e){this.set(X.OFFSET,e)}setPosition(e){this.set(X.POSITION,e)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(e){const t=this.getMap();if(!t||!t.getTargetElement()||!this.get(X.POSITION))return;const n=this.getRect(t.getTargetElement(),t.getSize()),s=this.getElement(),r=this.getRect(s,[mr(s),Tr(s)]);e=e||{};const o=e.margin===void 0?20:e.margin;if(!wi(n,r)){const a=r[0]-n[0],l=n[2]-r[2],h=r[1]-n[1],u=n[3]-r[3],c=[0,0];if(a<0?c[0]=a-o:l<0&&(c[0]=Math.abs(l)+o),h<0?c[1]=h-o:u<0&&(c[1]=Math.abs(u)+o),c[0]!==0||c[1]!==0){const d=t.getView().getCenterInternal(),g=t.getPixelFromCoordinateInternal(d);if(!g)return;const f=[g[0]+c[0],g[1]+c[1]],_=e.animation||{};t.getView().animateInternal({center:t.getCoordinateFromPixelInternal(f),duration:_.duration,easing:_.easing})}}}getRect(e,t){const n=e.getBoundingClientRect(),s=n.left+window.pageXOffset,r=n.top+window.pageYOffset;return[s,r,s+t[0],r+t[1]]}setPositioning(e){this.set(X.POSITIONING,e)}setVisible(e){this.rendered.visible!==e&&(this.element.style.display=e?"":"none",this.rendered.visible=e)}updatePixelPosition(){const e=this.getMap(),t=this.getPosition();if(!e||!e.isRendered()||!t){this.setVisible(!1);return}const n=e.getPixelFromCoordinate(t),s=e.getSize();this.updateRenderedPosition(n,s)}updateRenderedPosition(e,t){const n=this.element.style,s=this.getOffset(),r=this.getPositioning();this.setVisible(!0);const o=Math.round(e[0]+s[0])+"px",a=Math.round(e[1]+s[1])+"px";let l="0%",h="0%";r=="bottom-right"||r=="center-right"||r=="top-right"?l="-100%":(r=="bottom-center"||r=="center-center"||r=="top-center")&&(l="-50%"),r=="bottom-left"||r=="bottom-center"||r=="bottom-right"?h="-100%":(r=="center-left"||r=="center-center"||r=="center-right")&&(h="-50%");const u=`translate(${l}, ${h}) translate(${o}, ${a})`;this.rendered.transform_!=u&&(this.rendered.transform_=u,n.transform=u)}getOptions(){return this.options}}const dl=cl,Et={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class gl extends Tn{constructor(e){e=e||{};const t=Object.assign({},e);delete t.preload,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.setPreload(e.preload!==void 0?e.preload:0),this.setUseInterimTilesOnError(e.useInterimTilesOnError!==void 0?e.useInterimTilesOnError:!0)}getPreload(){return this.get(Et.PRELOAD)}setPreload(e){this.set(Et.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(Et.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(Et.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}}const fl=gl;class _l extends Ri{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.declutterExecutorGroup=null}getFeatures(e){return S()}getData(e){return null}prepareFrame(e){return S()}renderFrame(e,t){return S()}loadedTileCallback(e,t,n){e[t]||(e[t]={}),e[t][n.tileCoord.toString()]=n}createLoadedTileFinder(e,t,n){return(s,r)=>{const o=this.loadedTileCallback.bind(this,n,s);return e.forEachLoadedTile(t,s,r,o)}}forEachFeatureAtCoordinate(e,t,n,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){e.target.getState()===et.LOADED&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=et.LOADED&&t!=et.ERROR&&e.addEventListener(v.CHANGE,this.boundHandleImageChange_),t==et.IDLE&&(e.load(),t=e.getState()),t==et.LOADED}renderIfReadyAndVisible(){const e=this.getLayer();e&&e.getVisible()&&e.getSourceState()==="ready"&&e.changed()}disposeInternal(){delete this.layer_,super.disposeInternal()}}const ml=_l;let Xe=null;function Tl(){Xe=Be(1,1,void 0,{willReadFrequently:!0})}class pl extends ml{constructor(e){super(e),this.container=null,this.renderedResolution,this.tempTransform=Ue(),this.pixelTransform=Ue(),this.inversePixelTransform=Ue(),this.context=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(e,t,n){Xe||Tl(),Xe.clearRect(0,0,1,1);let s;try{Xe.drawImage(e,t,n,1,1,0,0,1,1),s=Xe.getImageData(0,0,1,1).data}catch{return Xe=null,null}return s}getBackground(e){let n=this.getLayer().getBackground();return typeof n=="function"&&(n=n(e.viewState.resolution)),n||void 0}useContainer(e,t,n){const s=this.getLayer().getClassName();let r,o;if(e&&e.className===s&&(!n||e&&e.style.backgroundColor&&Mt(Wn(e.style.backgroundColor),Wn(n)))){const a=e.firstElementChild;a instanceof HTMLCanvasElement&&(o=a.getContext("2d"))}if(o&&o.canvas.style.transform===t?(this.container=e,this.context=o,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){r=document.createElement("div"),r.className=s;let a=r.style;a.position="absolute",a.width="100%",a.height="100%",o=Be();const l=o.canvas;r.appendChild(l),a=l.style,a.position="absolute",a.left="0",a.transformOrigin="top left",this.container=r,this.context=o}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(e,t,n){const s=we(n),r=kt(n),o=Gt(n),a=Ft(n);W(t.coordinateToPixelTransform,s),W(t.coordinateToPixelTransform,r),W(t.coordinateToPixelTransform,o),W(t.coordinateToPixelTransform,a);const l=this.inversePixelTransform;W(l,s),W(l,r),W(l,o),W(l,a),e.save(),e.beginPath(),e.moveTo(Math.round(s[0]),Math.round(s[1])),e.lineTo(Math.round(r[0]),Math.round(r[1])),e.lineTo(Math.round(o[0]),Math.round(o[1])),e.lineTo(Math.round(a[0]),Math.round(a[1])),e.clip()}dispatchRenderEvent_(e,t,n){const s=this.getLayer();if(s.hasListener(e)){const r=new Fi(e,this.inversePixelTransform,n,t);s.dispatchEvent(r)}}preRender(e,t){this.frameState=t,this.dispatchRenderEvent_(Ce.PRERENDER,e,t)}postRender(e,t){this.dispatchRenderEvent_(Ce.POSTRENDER,e,t)}getRenderTransform(e,t,n,s,r,o,a){const l=r/2,h=o/2,u=s/t,c=-u,d=-e[0]+a,g=-e[1];return st(this.tempTransform,l,h,u,c,-n,d,g)}disposeInternal(){delete this.frameState,super.disposeInternal()}}const yl=pl;class El extends yl{constructor(e){super(e),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=De(),this.tmpTileRange_=new cs(0,0,0,0)}isDrawableTile(e){const t=this.getLayer(),n=e.getState(),s=t.getUseInterimTilesOnError();return n==C.LOADED||n==C.EMPTY||n==C.ERROR&&!s}getTile(e,t,n,s){const r=s.pixelRatio,o=s.viewState.projection,a=this.getLayer();let h=a.getSource().getTile(e,t,n,r,o);return h.getState()==C.ERROR&&a.getUseInterimTilesOnError()&&a.getPreload()>0&&(this.newTiles_=!0),this.isDrawableTile(h)||(h=h.getInterimTile()),h}getData(e){const t=this.frameState;if(!t)return null;const n=this.getLayer(),s=W(t.pixelToCoordinateTransform,e.slice()),r=n.getExtent();if(r&&!fn(r,s))return null;const o=t.pixelRatio,a=t.viewState.projection,l=t.viewState,h=n.getRenderSource(),u=h.getTileGridForProjection(l.projection),c=h.getTilePixelRatio(t.pixelRatio);for(let d=u.getZForResolution(l.resolution);d>=u.getMinZoom();--d){const g=u.getTileCoordForCoordAndZ(s,d),f=h.getTile(d,g[1],g[2],o,a);if(!(f instanceof as||f instanceof hn)||f instanceof hn&&f.getState()===C.EMPTY)return null;if(f.getState()!==C.LOADED)continue;const _=u.getOrigin(d),p=de(u.getTileSize(d)),E=u.getResolution(d),T=Math.floor(c*((s[0]-_[0])/E-g[1]*p[0])),y=Math.floor(c*((_[1]-s[1])/E-g[2]*p[1])),m=Math.round(c*h.getGutterForProjection(l.projection));return this.getImageData(f.getImage(),T+m,y+m)}return null}loadedTileCallback(e,t,n){return this.isDrawableTile(n)?super.loadedTileCallback(e,t,n):!1}prepareFrame(e){return!!this.getLayer().getSource()}renderFrame(e,t){const n=e.layerStatesArray[e.layerIndex],s=e.viewState,r=s.projection,o=s.resolution,a=s.center,l=s.rotation,h=e.pixelRatio,u=this.getLayer(),c=u.getSource(),d=c.getRevision(),g=c.getTileGridForProjection(r),f=g.getZForResolution(o,c.zDirection),_=g.getResolution(f);let p=e.extent;const E=e.viewState.resolution,T=c.getTilePixelRatio(h),y=Math.round(F(p)/E*h),m=Math.round(ie(p)/E*h),R=n.extent&&Ke(n.extent);R&&(p=tt(p,Ke(n.extent)));const b=_*y/2/T,P=_*m/2/T,I=[a[0]-b,a[1]-P,a[0]+b,a[1]+P],k=g.getTileRangeForExtentAndZ(p,f),K={};K[f]={};const Q=this.createLoadedTileFinder(c,r,K),fe=this.tmpExtent,_e=this.tmpTileRange_;this.newTiles_=!1;const qe=l?nn(s.center,E,l,e.size):void 0;for(let ne=k.minX;ne<=k.maxX;++ne)for(let N=k.minY;N<=k.maxY;++N){if(l&&!g.tileCoordIntersectsViewport([f,ne,N],qe))continue;const O=this.getTile(f,ne,N,e);if(this.isDrawableTile(O)){const j=Y(this);if(O.getState()==C.LOADED){K[f][O.tileCoord.toString()]=O;let Me=O.inTransition(j);Me&&n.opacity!==1&&(O.endTransition(j),Me=!1),!this.newTiles_&&(Me||!this.renderedTiles.includes(O))&&(this.newTiles_=!0)}if(O.getAlpha(j,e.time)===1)continue}const Ie=g.getTileCoordChildTileRange(O.tileCoord,_e,fe);let me=!1;Ie&&(me=Q(f+1,Ie)),me||g.forEachTileCoordParentTileRange(O.tileCoord,Q,_e,fe)}const ee=_/o*h/T;st(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/h,1/h,l,-y/2,-m/2);const re=zs(this.pixelTransform);this.useContainer(t,re,this.getBackground(e));const D=this.context,H=D.canvas;bi(this.inversePixelTransform,this.pixelTransform),st(this.tempTransform,y/2,m/2,ee,ee,0,-y/2,-m/2),H.width!=y||H.height!=m?(H.width=y,H.height=m):this.containerReused||D.clearRect(0,0,y,m),R&&this.clipUnrotated(D,e,R),c.getInterpolate()||(D.imageSmoothingEnabled=!1),this.preRender(D,e),this.renderedTiles.length=0;let oe=Object.keys(K).map(Number);oe.sort(cn);let te,xe,U;n.opacity===1&&(!this.containerReused||c.getOpaque(e.viewState.projection))?oe=oe.reverse():(te=[],xe=[]);for(let ne=oe.length-1;ne>=0;--ne){const N=oe[ne],O=c.getTilePixelSize(N,h,r),me=g.getResolution(N)/_,j=O[0]*me*ee,Me=O[1]*me*ee,Ut=g.getTileCoordForCoordAndZ(we(I),N),Fn=g.getTileCoordExtent(Ut),ct=W(this.tempTransform,[T*(Fn[0]-I[0])/_,T*(I[3]-Fn[3])/_]),_s=T*c.getGutterForProjection(r),Gn=K[N];for(const ms in Gn){const Se=Gn[ms],kn=Se.tileCoord,zn=Ut[1]-kn[1],Ts=Math.round(ct[0]-(zn-1)*j),Xn=Ut[2]-kn[2],ps=Math.round(ct[1]-(Xn-1)*Me),ae=Math.round(ct[0]-zn*j),le=Math.round(ct[1]-Xn*Me),Je=Ts-ae,Qe=ps-le,Zn=f===N,Kn=Zn&&Se.getAlpha(Y(this),e.time)!==1;let jt=!1;if(!Kn)if(te){U=[ae,le,ae+Je,le,ae+Je,le+Qe,ae,le+Qe];for(let dt=0,ys=te.length;dt<ys;++dt)if(f!==N&&N<xe[dt]){const V=te[dt];zt([ae,le,ae+Je,le+Qe],[V[0],V[3],V[4],V[7]])&&(jt||(D.save(),jt=!0),D.beginPath(),D.moveTo(U[0],U[1]),D.lineTo(U[2],U[3]),D.lineTo(U[4],U[5]),D.lineTo(U[6],U[7]),D.moveTo(V[6],V[7]),D.lineTo(V[4],V[5]),D.lineTo(V[2],V[3]),D.lineTo(V[0],V[1]),D.clip())}te.push(U),xe.push(N)}else D.clearRect(ae,le,Je,Qe);this.drawTileImage(Se,e,ae,le,Je,Qe,_s,Zn),te&&!Kn?(jt&&D.restore(),this.renderedTiles.unshift(Se)):this.renderedTiles.push(Se),this.updateUsedTiles(e.usedTiles,c,Se)}}return this.renderedRevision=d,this.renderedResolution=_,this.extentChanged=!this.renderedExtent_||!Qt(this.renderedExtent_,I),this.renderedExtent_=I,this.renderedPixelRatio=h,this.renderedProjection=r,this.manageTilePyramid(e,c,g,h,r,p,f,u.getPreload()),this.scheduleExpireCache(e,c),this.postRender(D,e),n.extent&&D.restore(),D.imageSmoothingEnabled=!0,re!==H.style.transform&&(H.style.transform=re),this.container}drawTileImage(e,t,n,s,r,o,a,l){const h=this.getTileImage(e);if(!h)return;const u=Y(this),c=t.layerStatesArray[t.layerIndex],d=c.opacity*(l?e.getAlpha(u,t.time):1),g=d!==this.context.globalAlpha;g&&(this.context.save(),this.context.globalAlpha=d),this.context.drawImage(h,a,a,h.width-2*a,h.height-2*a,n,s,r,o),g&&this.context.restore(),d!==c.opacity?t.animate=!0:l&&e.endTransition(u)}getImage(){const e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}scheduleExpireCache(e,t){if(t.canExpireCache()){const n=function(s,r,o){const a=Y(s);a in o.usedTiles&&s.expireCache(o.viewState.projection,o.usedTiles[a])}.bind(null,t);e.postRenderFunctions.push(n)}}updateUsedTiles(e,t,n){const s=Y(t);s in e||(e[s]={}),e[s][n.getKey()]=!0}manageTilePyramid(e,t,n,s,r,o,a,l,h){const u=Y(t);u in e.wantedTiles||(e.wantedTiles[u]={});const c=e.wantedTiles[u],d=e.tileQueue,g=n.getMinZoom(),f=e.viewState.rotation,_=f?nn(e.viewState.center,e.viewState.resolution,f,e.size):void 0;let p=0,E,T,y,m,R,b;for(b=g;b<=a;++b)for(T=n.getTileRangeForExtentAndZ(o,b,T),y=n.getResolution(b),m=T.minX;m<=T.maxX;++m)for(R=T.minY;R<=T.maxY;++R)f&&!n.tileCoordIntersectsViewport([b,m,R],_)||(a-b<=l?(++p,E=t.getTile(b,m,R,s,r),E.getState()==C.IDLE&&(c[E.getKey()]=!0,d.isKeyQueued(E.getKey())||d.enqueue([E,u,n.getTileCoordCenter(E.tileCoord),y])),h!==void 0&&h(E)):t.useTile(b,m,R,r));t.updateCacheSize(p,r)}}const Cl=El;class Rl extends fl{constructor(e){super(e)}createRenderer(){return new Cl(this)}}const vl=Rl,xl=new vl({source:new ul}),Pl=new va({layers:[xl],target:"map",view:new Ee({center:[0,0],zoom:2})});let Ll='{"ArrayOfObjTrainPositions":{"$":{"xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:xsd":"http://www.w3.org/2001/XMLSchema","xmlns":"http://api.irishrail.ie/realtime/"},"objTrainPositions":[{"TrainStatus":["N"],"TrainLatitude":["51.9018"],"TrainLongitude":["-8.4582"],"TrainCode":["A209"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A209\\nCork to Dublin Heuston\\nExpected Departure 09:25"],"Direction":["To Dublin Heuston"]},{"TrainStatus":["N"],"TrainLatitude":["51.9018"],"TrainLongitude":["-8.4582"],"TrainCode":["D557"],"TrainDate":["12 Jan 2023"],"PublicMessage":["D557\\nCork to Midleton\\nExpected Departure 09:15"],"Direction":["To Midleton"]},{"TrainStatus":["N"],"TrainLatitude":["51.9212"],"TrainLongitude":["-8.17579"],"TrainCode":["P556"],"TrainDate":["12 Jan 2023"],"PublicMessage":["P556\\nMidleton to Cork\\nExpected Departure 09:15"],"Direction":["To Cork"]},{"TrainStatus":["N"],"TrainLatitude":["52.6587"],"TrainLongitude":["-8.62397"],"TrainCode":["A782"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A782\\nLimerick to Galway\\nExpected Departure 09:20"],"Direction":["To Galway"]},{"TrainStatus":["N"],"TrainLatitude":["53.1855"],"TrainLongitude":["-6.80807"],"TrainCode":["P406"],"TrainDate":["12 Jan 2023"],"PublicMessage":["P406\\nNewbridge to Grand Canal Dock\\nExpected Departure 09:09"],"Direction":["Northbound"]},{"TrainStatus":["N"],"TrainLatitude":["53.2043"],"TrainLongitude":["-6.10046"],"TrainCode":["E811"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E811\\nBray to Malahide\\nExpected Departure 09:25"],"Direction":["Northbound"]},{"TrainStatus":["N"],"TrainLatitude":["53.2043"],"TrainLongitude":["-6.10046"],"TrainCode":["E912"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E912\\nBray to Howth\\nExpected Departure 09:15"],"Direction":["Northbound"]},{"TrainStatus":["N"],"TrainLatitude":["53.3464"],"TrainLongitude":["-6.29461"],"TrainCode":["A702"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A702\\nDublin Heuston to Galway\\nExpected Departure 09:25"],"Direction":["To Galway"]},{"TrainStatus":["N"],"TrainLatitude":["53.3891"],"TrainLongitude":["-6.07401"],"TrainCode":["E215"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E215\\nHowth to Bray\\nExpected Departure 09:20"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["0"],"TrainLongitude":["0"],"TrainCode":["A202"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A202\\n07:00 - Dublin Heuston to Cork (0 mins late)\\nDeparted Killarney Junction next stop Cork"],"Direction":["To Cork"]},{"TrainStatus":["R"],"TrainLatitude":["0"],"TrainLongitude":["0"],"TrainCode":["A700"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A700\\n07:35 - Dublin Heuston to Galway (3 mins late)\\nDeparted Athlone Midland Yard next stop Ballinasloe"],"Direction":["To Galway"]},{"TrainStatus":["R"],"TrainLatitude":["0"],"TrainLongitude":["0"],"TrainCode":["A802"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A802\\n09:08 - Athlone to Westport (3 mins late)\\nDeparted Athlone Midland Yard next stop Roscommon"],"Direction":["To Westport"]},{"TrainStatus":["R"],"TrainLatitude":["0"],"TrainLongitude":["0"],"TrainCode":["D204"],"TrainDate":["12 Jan 2023"],"PublicMessage":["D204\\n09:20 - Dublin Heuston to Portlaoise (-10 mins late)\\nArrived Inchicore Advance Starter next stop Park West and Cherry Orchard"],"Direction":["To Portlaoise"]},{"TrainStatus":["R"],"TrainLatitude":["0"],"TrainLongitude":["0"],"TrainCode":["D512"],"TrainDate":["12 Jan 2023"],"PublicMessage":["D512\\n08:50 - Mallow to Cork (0 mins late)\\nDeparted Killarney Junction next stop Cork"],"Direction":["To Cork"]},{"TrainStatus":["R"],"TrainLatitude":["52.5009"],"TrainLongitude":["-8.20003"],"TrainCode":["A303"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A303\\n07:05 - Tralee to Dublin Heuston (-2 mins late)\\nArrived Limerick Junction next stop Dublin Heuston"],"Direction":["To Dublin Heuston"]},{"TrainStatus":["R"],"TrainLatitude":["52.5828"],"TrainLongitude":["-8.38682"],"TrainCode":["A407"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A407\\n08:55 - Limerick to Dublin Heuston (1 mins late)\\nDeparted Drumkeen next stop Limerick Junction"],"Direction":["To Dublin Heuston"]},{"TrainStatus":["R"],"TrainLatitude":["52.6404"],"TrainLongitude":["-8.52719"],"TrainCode":["A425"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A425\\n09:03 - Limerick to Limerick Junction (1 mins late)\\nDeparted Killonan next stop Limerick Junction"],"Direction":["To Limerick Junction"]},{"TrainStatus":["R"],"TrainLatitude":["52.7878"],"TrainLongitude":["-7.82293"],"TrainCode":["A204"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A204\\n08:00 - Dublin Heuston to Cork (3 mins late)\\nDeparted Templemore next stop Thurles"],"Direction":["To Cork"]},{"TrainStatus":["R"],"TrainLatitude":["52.992"],"TrainLongitude":["-6.9762"],"TrainCode":["A500"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A500\\n07:20 - Dublin Heuston to Waterford (0 mins late)\\nDeparted Athy next stop Carlow"],"Direction":["To Waterford"]},{"TrainStatus":["R"],"TrainLatitude":["52.992"],"TrainLongitude":["-6.9762"],"TrainCode":["A502"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A502\\n08:26 - Dublin Heuston to Carlow (0 mins late)\\nDeparted Athy next stop Carlow"],"Direction":["To Carlow"]},{"TrainStatus":["R"],"TrainLatitude":["52.992"],"TrainLongitude":["-6.9762"],"TrainCode":["A507"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A507\\n07:50 - Waterford to Dublin Heuston (2 mins late)\\nDeparted Athy next stop Kildare"],"Direction":["To Dublin Heuston"]},{"TrainStatus":["R"],"TrainLatitude":["53.0371"],"TrainLongitude":["-7.30086"],"TrainCode":["P209"],"TrainDate":["12 Jan 2023"],"PublicMessage":["P209\\n09:13 - Portlaoise to Dublin Heuston (0 mins late)\\nDeparted Portlaoise next stop Portarlington"],"Direction":["To Dublin Heuston"]},{"TrainStatus":["R"],"TrainLatitude":["53.1454"],"TrainLongitude":["-7.06361"],"TrainCode":["A707"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A707\\n07:30 - Galway to Dublin Heuston (0 mins late)\\nArrived Monasterevin next stop Sallins"],"Direction":["To Dublin Heuston"]},{"TrainStatus":["R"],"TrainLatitude":["53.1454"],"TrainLongitude":["-7.06361"],"TrainCode":["D203"],"TrainDate":["12 Jan 2023"],"PublicMessage":["D203\\n08:22 - Dublin Heuston to Portlaoise (-3 mins late)\\nArrived Monasterevin next stop Portarlington"],"Direction":["To Portlaoise"]},{"TrainStatus":["R"],"TrainLatitude":["53.146"],"TrainLongitude":["-7.18055"],"TrainCode":["A405"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A405\\n07:40 - Limerick to Dublin Heuston (2 mins late)\\nDeparted Portarlington next stop Newbridge"],"Direction":["To Dublin Heuston"]},{"TrainStatus":["R"],"TrainLatitude":["53.2043"],"TrainLongitude":["-6.10046"],"TrainCode":["E105"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E105\\n07:52 - Malahide to Greystones (8 mins late)\\nDeparted Bray next stop Greystones"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.2364"],"TrainLongitude":["-6.11691"],"TrainCode":["E209"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E209\\n08:00 - Howth to Bray (6 mins late)\\nArrived Shankill next stop Bray"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.2756"],"TrainLongitude":["-6.10333"],"TrainCode":["E210"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E210\\n08:10 - Malahide to Bray (1 mins late)\\nDeparted Dalkey next stop Killiney"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.2756"],"TrainLongitude":["-6.10333"],"TrainCode":["E810"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E810\\n08:54 - Greystones to Malahide (-1 mins late)\\nArrived Dalkey next stop Glenageary"],"Direction":["Northbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.2878"],"TrainLongitude":["-6.12712"],"TrainCode":["P653"],"TrainDate":["12 Jan 2023"],"PublicMessage":["P653\\n07:54 - Maynooth to Bray (0 mins late)\\nArrived Sandycove next stop Bray"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.2878"],"TrainLongitude":["-6.12712"],"TrainCode":["P775"],"TrainDate":["12 Jan 2023"],"PublicMessage":["P775\\n09:00 - Bray to Dublin Connolly (-1 mins late)\\nDeparted Sandycove next stop Dun Laoghaire"],"Direction":["Northbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.2954"],"TrainLongitude":["-6.15206"],"TrainCode":["E211"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E211\\n08:20 - Howth to Bray (0 mins late)\\nArrived Salthill and Monkstown next stop Dun Laoghaire"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.2954"],"TrainLongitude":["-6.15206"],"TrainCode":["E911"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E911\\n08:55 - Bray to Howth (0 mins late)\\nArrived Salthill and Monkstown next stop Seapoint"],"Direction":["Northbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3099"],"TrainLongitude":["-6.19498"],"TrainCode":["E106"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E106\\n08:30 - Malahide to Greystones (1 mins late)\\nDeparted Booterstown next stop Blackrock"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3099"],"TrainLongitude":["-6.19498"],"TrainCode":["E809"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E809\\n08:45 - Bray to Malahide (2 mins late)\\nArrived Booterstown next stop Sydney Parade"],"Direction":["Northbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3223"],"TrainLongitude":["-6.52356"],"TrainCode":["A206"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A206\\n09:00 - Dublin Heuston to Cork (0 mins late)\\nDeparted Hazelhatch next stop Portlaoise"],"Direction":["To Cork"]},{"TrainStatus":["R"],"TrainLatitude":["53.334"],"TrainLongitude":["-6.37868"],"TrainCode":["P207"],"TrainDate":["12 Jan 2023"],"PublicMessage":["P207\\n08:12 - Portlaoise to Dublin Heuston (1 mins late)\\nDeparted Park West and Cherry Orchard next stop Dublin Heuston"],"Direction":["To Dublin Heuston"]},{"TrainStatus":["R"],"TrainLatitude":["53.3345"],"TrainLongitude":["-6.43038"],"TrainCode":["A205"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A205\\n07:00 - Cork to Dublin Heuston (-4 mins late)\\nDeparted Kishogue next stop Dublin Heuston"],"Direction":["To Dublin Heuston"]},{"TrainStatus":["R"],"TrainLatitude":["53.3347"],"TrainLongitude":["-6.22979"],"TrainCode":["P606"],"TrainDate":["12 Jan 2023"],"PublicMessage":["P606\\n07:58 - Drogheda to Bray (2 mins late)\\nArrived Lansdowne Road next stop Sydney Parade"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3353"],"TrainLongitude":["-6.45233"],"TrainCode":["D404"],"TrainDate":["12 Jan 2023"],"PublicMessage":["D404\\n08:31 - Grand Canal Dock to Hazelhatch (0 mins late)\\nDeparted Adamstown next stop Hazelhatch"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3397"],"TrainLongitude":["-6.23773"],"TrainCode":["E910"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E910\\n08:24 - Greystones to Howth (0 mins late)\\nArrived Grand Canal Dock next stop Dublin Pearse"],"Direction":["Northbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.347"],"TrainLongitude":["-6.25425"],"TrainCode":["D405"],"TrainDate":["12 Jan 2023"],"PublicMessage":["D405\\n09:11 - Grand Canal Dock to Hazelhatch (0 mins late)\\nArrived Tara Street next stop Dublin Connolly"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3531"],"TrainLongitude":["-6.24591"],"TrainCode":["D803"],"TrainDate":["12 Jan 2023"],"PublicMessage":["D803\\n09:10 - Dublin Connolly to Drogheda (4 mins late)\\nDeparted Dublin Connolly next stop Malahide"],"Direction":["Northbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3531"],"TrainLongitude":["-6.24591"],"TrainCode":["D908"],"TrainDate":["12 Jan 2023"],"PublicMessage":["D908\\n09:10 - Dublin Pearse to Maynooth (0 mins late)\\nArrived Dublin Connolly next stop Drumcondra"],"Direction":["Northbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3531"],"TrainLongitude":["-6.24591"],"TrainCode":["E212"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E212\\n08:41 - Howth to Bray (4 mins late)\\nDeparted Dublin Connolly next stop Tara Street"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3602"],"TrainLongitude":["-7.79847"],"TrainCode":["A803"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A803\\n07:15 - Westport to Dublin Heuston (0 mins late)\\nDeparted Clonydonnin next stop Clara"],"Direction":["To Dublin Heuston"]},{"TrainStatus":["R"],"TrainLatitude":["53.3629"],"TrainLongitude":["-6.22753"],"TrainCode":["E213"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E213\\n08:50 - Malahide to Bray (2 mins late)\\nDeparted Clontarf Road next stop Dublin Connolly"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3632"],"TrainLongitude":["-6.25908"],"TrainCode":["A902"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A902\\n09:05 - Dublin Connolly to Sligo (4 mins late)\\nArrived Drumcondra next stop Maynooth"],"Direction":["Northbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3704"],"TrainLongitude":["-6.50598"],"TrainCode":["A903"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A903\\n06:40 - Sligo to Dublin Connolly (5 mins late)\\nArrived Leixlip (Louisa Bridge) next stop Broombridge"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3752"],"TrainLongitude":["-6.31388"],"TrainCode":["P735"],"TrainDate":["12 Jan 2023"],"PublicMessage":["P735\\n08:40 - Maynooth to Dublin Connolly (5 mins late)\\nDeparted Pelletstown next stop Broombridge"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3776"],"TrainLongitude":["-6.39072"],"TrainCode":["D304"],"TrainDate":["12 Jan 2023"],"PublicMessage":["D304\\n09:00 - Docklands to M3 Parkway (0 mins late)\\nDeparted Coolmine next stop Clonsilla"],"Direction":["Northbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.378"],"TrainLongitude":["-6.58993"],"TrainCode":["P655"],"TrainDate":["12 Jan 2023"],"PublicMessage":["P655\\n09:10 - Maynooth to Dublin Pearse (5 mins late)\\nDeparted Maynooth next stop Leixlip (Louisa Bridge)"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3786"],"TrainLongitude":["-6.19131"],"TrainCode":["E107"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E107\\n09:00 - Howth to Greystones (0 mins late)\\nArrived Harmonstown next stop Killester"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3786"],"TrainLongitude":["-6.19131"],"TrainCode":["E908"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E908\\n08:15 - Bray to Howth (2 mins late)\\nArrived Harmonstown next stop Raheny"],"Direction":["Northbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3853"],"TrainLongitude":["-6.44205"],"TrainCode":["P306"],"TrainDate":["12 Jan 2023"],"PublicMessage":["P306\\n09:08 - M3 Parkway to Docklands (0 mins late)\\nArrived Hansfield next stop Clonsilla"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.3909"],"TrainLongitude":["-6.15672"],"TrainCode":["E807"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E807\\n07:54 - Greystones to Malahide (7 mins late)\\nArrived Howth Junction next stop Clongriffin"],"Direction":["Northbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.4032"],"TrainLongitude":["-6.14839"],"TrainCode":["P607"],"TrainDate":["12 Jan 2023"],"PublicMessage":["P607\\n08:30 - Drogheda to Dublin Pearse (1 mins late)\\nDeparted Clongriffin next stop Dublin Connolly"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.4509"],"TrainLongitude":["-6.15649"],"TrainCode":["A605"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A605\\n05:35 - Rosslare Europort to Dundalk (1 mins late)\\nArrived Malahide next stop Donabate"],"Direction":["Northbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.4509"],"TrainLongitude":["-6.15649"],"TrainCode":["E214"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E214\\n09:12 - Malahide to Bray (1 mins late)\\nDeparted Malahide next stop Portmarnock"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.6118"],"TrainLongitude":["-6.18226"],"TrainCode":["P701"],"TrainDate":["12 Jan 2023"],"PublicMessage":["P701\\n09:00 - Drogheda to Dublin Connolly (0 mins late)\\nArrived Balbriggan next stop Skerries"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.712"],"TrainLongitude":["-6.33538"],"TrainCode":["D802"],"TrainDate":["12 Jan 2023"],"PublicMessage":["D802\\n07:54 - Dublin Pearse to Dundalk (1 mins late)\\nDeparted Drogheda next stop Dundalk"],"Direction":["Northbound"]},{"TrainStatus":["R"],"TrainLatitude":["53.8591"],"TrainLongitude":["-7.9164"],"TrainCode":["A900"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A900\\n06:55 - Dublin Connolly to Sligo (0 mins late)\\nDeparted Dromod next stop Carrick on Shannon"],"Direction":["Northbound"]},{"TrainStatus":["R"],"TrainLatitude":["54.0007"],"TrainLongitude":["-6.41291"],"TrainCode":["A122"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A122\\n07:35 - Dublin Connolly to Belfast (7 mins late)\\nDeparted Dundalk next stop Newry"],"Direction":["Northbound"]},{"TrainStatus":["R"],"TrainLatitude":["54.0007"],"TrainLongitude":["-6.41291"],"TrainCode":["A123"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A123\\n08:00 - Belfast to Dublin Connolly (0 mins late)\\nArrived Dundalk next stop Dublin Connolly"],"Direction":["Southbound"]},{"TrainStatus":["R"],"TrainLatitude":["54.2723"],"TrainLongitude":["-8.48249"],"TrainCode":["A905"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A905\\n09:05 - Sligo to Dublin Connolly (1 mins late)\\nDeparted Sligo next stop Collooney"],"Direction":["Southbound"]},{"TrainStatus":["T"],"TrainLatitude":["53.1855"],"TrainLongitude":["-6.80807"],"TrainCode":["D403"],"TrainDate":["12 Jan 2023"],"PublicMessage":["D403\\n08:10 - Grand Canal Dock to Newbridge(3 mins late)\\nTERMINATED Newbridge at 09:07"],"Direction":["Southbound"]},{"TrainStatus":["T"],"TrainLatitude":["53.3433"],"TrainLongitude":["-6.24829"],"TrainCode":["P654"],"TrainDate":["12 Jan 2023"],"PublicMessage":["P654\\n08:15 - Maynooth to Dublin Pearse(0 mins late)\\nTERMINATED Dublin Pearse at 09:12"],"Direction":["Southbound"]},{"TrainStatus":["T"],"TrainLatitude":["53.3509"],"TrainLongitude":["-6.23929"],"TrainCode":["P305"],"TrainDate":["12 Jan 2023"],"PublicMessage":["P305\\n08:35 - M3 Parkway to Docklands(0 mins late)\\nTERMINATED Docklands at 09:12"],"Direction":["Southbound"]},{"TrainStatus":["T"],"TrainLatitude":["53.3531"],"TrainLongitude":["-6.24591"],"TrainCode":["A121"],"TrainDate":["12 Jan 2023"],"PublicMessage":["A121\\n06:50 - Belfast to Dublin Connolly(6 mins late)\\nTERMINATED Dublin Connolly at 09:06"],"Direction":["Southbound"]},{"TrainStatus":["T"],"TrainLatitude":["53.378"],"TrainLongitude":["-6.58993"],"TrainCode":["D907"],"TrainDate":["12 Jan 2023"],"PublicMessage":["D907\\n08:23 - Dublin Pearse to Maynooth(0 mins late)\\nTERMINATED Maynooth at 09:14"],"Direction":["Northbound"]},{"TrainStatus":["T"],"TrainLatitude":["53.3891"],"TrainLongitude":["-6.07401"],"TrainCode":["E907"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E907\\n07:55 - Bray to Howth(2 mins late)\\nTERMINATED Howth at 09:11"],"Direction":["Northbound"]},{"TrainStatus":["T"],"TrainLatitude":["53.4509"],"TrainLongitude":["-6.15649"],"TrainCode":["E806"],"TrainDate":["12 Jan 2023"],"PublicMessage":["E806\\n07:45 - Bray to Malahide(3 mins late)\\nTERMINATED Malahide at 09:07"],"Direction":["Northbound"]}]}}',bl=JSON.parse(Ll),Ge=bl.ArrayOfObjTrainPositions.objTrainPositions;const Ci=[];for(var he=0;he<Ge.length;he++)document.getElementById("overlays").innerHTML+="<div class='marker' id="+Ge[he].TrainCode+" title="+Ge[he].TrainCode+"></div>",Ci[he]=new dl({position:Vr([Ge[he].TrainLongitude,Ge[he].TrainLatitude]),positioning:"center-center",element:document.getElementById(String(Ge[he].TrainCode)),stopEvent:!1}),Pl.addOverlay(Ci[he]);
|
|
//# sourceMappingURL=index.235aa467.js.map
|