const x3=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))Z(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&Z(i)}).observe(document,{childList:!0,subtree:!0});function T(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerpolicy&&(r.referrerPolicy=e.referrerpolicy),e.crossorigin==="use-credentials"?r.credentials="include":e.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function Z(e){if(e.ep)return;e.ep=!0;const r=T(e);fetch(e.href,r)}};x3();function F(){return function(){throw new Error("Unimplemented abstract method.")}()}var w3=0;function z(n){return n.ol_uid||(n.ol_uid=String(++w3))}var O3="6.15.1",R3=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),S3=function(n){R3(t,n);function t(T){var Z=this,e="v"+O3.split("-")[0],r="Assertion failed. See https://openlayers.org/en/"+e+"/doc/errors/#"+T+" for details.";return Z=n.call(this,r)||this,Z.code=T,Z.name="AssertionError",Z.message=r,Z}return t}(Error);const V7=S3;var I3=function(){function n(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return n.prototype.preventDefault=function(){this.defaultPrevented=!0},n.prototype.stopPropagation=function(){this.propagationStopped=!0},n}();const V1=I3,U2={PROPERTYCHANGE:"propertychange"};var P3=function(){function n(){this.disposed=!1}return n.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},n.prototype.disposeInternal=function(){},n}();const _5=P3;function L3(n,t,T){for(var Z,e,r=T||x2,i=0,o=n.length,a=!1;i>1),e=+r(n[Z],t),e<0?i=Z+1:(o=Z,a=!e);return a?i:~i}function x2(n,t){return n>t?1:n0){for(e=1;e0?e-1:e:n[e-1]-t0||T&&i===0)})}function W2(){return!0}function g4(){return!1}function w2(){}function F3(n){var t=!1,T,Z,e;return function(){var r=Array.prototype.slice.call(arguments);return(!t||this!==e||!R2(r,Z))&&(t=!0,e=this,Z=r,T=n.apply(this,arguments)),T}}var e1=typeof Object.assign=="function"?Object.assign:function(n,t){if(n==null)throw new TypeError("Cannot convert undefined or null to object");for(var T=Object(n),Z=1,e=arguments.length;Z0:!1},t.prototype.removeEventListener=function(T,Z){var e=this.listeners_&&this.listeners_[T];if(e){var r=e.indexOf(Z);r!==-1&&(this.pendingRemovals_&&T in this.pendingRemovals_?(e[r]=w2,++this.pendingRemovals_[T]):(e.splice(r,1),e.length===0&&delete this.listeners_[T]))}},t}(_5);const $2=N3,j={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 B(n,t,T,Z,e){if(Z&&Z!==n&&(T=T.bind(Z)),e){var r=T;T=function(){n.removeEventListener(t,T),r.apply(this,arguments)}}var i={target:n,type:t,listener:T};return n.addEventListener(t,T),i}function i4(n,t,T,Z){return B(n,t,T,Z,!0)}function H(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),P0(n))}var G3=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),_4=function(n){G3(t,n);function t(){var T=n.call(this)||this;return T.on=T.onInternal,T.once=T.onceInternal,T.un=T.unInternal,T.revision_=0,T}return t.prototype.changed=function(){++this.revision_,this.dispatchEvent(j.CHANGE)},t.prototype.getRevision=function(){return this.revision_},t.prototype.onInternal=function(T,Z){if(Array.isArray(T)){for(var e=T.length,r=new Array(e),i=0;i0;)this.pop()},t.prototype.extend=function(T){for(var Z=0,e=T.length;Z=0||s2.match(/cpu (os|iphone os) 15_4 like mac os x/));var U3=s2.indexOf("webkit")!==-1&&s2.indexOf("edge")==-1,K3=s2.indexOf("macintosh")!==-1,T8=typeof devicePixelRatio<"u"?devicePixelRatio:1,y4=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,V3=typeof Image<"u"&&Image.prototype.decode,Z8=function(){var n=!1;try{var t=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return n}();new Array(6);function F1(){return[1,0,0,1,0,0]}function $3(n,t,T,Z,e,r,i){return n[0]=t,n[1]=T,n[2]=Z,n[3]=e,n[4]=r,n[5]=i,n}function H3(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n}function t1(n,t){var T=t[0],Z=t[1];return t[0]=n[0]*T+n[2]*Z+n[4],t[1]=n[1]*T+n[3]*Z+n[5],t}function q3(n,t,T){return $3(n,t,0,0,T,0,0)}function K1(n,t,T,Z,e,r,i,o){var a=Math.sin(r),s=Math.cos(r);return n[0]=Z*s,n[1]=e*a,n[2]=-Z*a,n[3]=e*s,n[4]=i*Z*s-o*Z*a+t,n[5]=i*e*a+o*e*s+T,n}function m5(n,t){var T=J3(t);X(T!==0,32);var Z=t[0],e=t[1],r=t[2],i=t[3],o=t[4],a=t[5];return n[0]=i/T,n[1]=-e/T,n[2]=-r/T,n[3]=Z/T,n[4]=(r*a-i*o)/T,n[5]=-(Z*a-e*o)/T,n}function J3(n){return n[0]*n[3]-n[1]*n[2]}var t7;function t8(n){var t="matrix("+n.join(", ")+")";if(y4)return t;var T=t7||(t7=document.createElement("div"));return T.style.transform=t,T.style.transform}const r1={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function e7(n){for(var t=C1(),T=0,Z=n.length;Te&&(a=a|r1.RIGHT),or&&(a=a|r1.ABOVE),a===r1.UNKNOWN&&(a=r1.INTERSECTING),a}function C1(){return[1/0,1/0,-1/0,-1/0]}function D1(n,t,T,Z,e){return e?(e[0]=n,e[1]=t,e[2]=T,e[3]=Z,e):[n,t,T,Z]}function A0(n){return D1(1/0,1/0,-1/0,-1/0,n)}function T9(n,t){var T=n[0],Z=n[1];return D1(T,Z,T,Z,t)}function n8(n,t,T,Z,e){var r=A0(e);return i8(r,n,t,T,Z)}function y0(n,t){return n[0]==t[0]&&n[2]==t[2]&&n[1]==t[1]&&n[3]==t[3]}function r8(n,t){return t[0]n[2]&&(n[2]=t[2]),t[1]n[3]&&(n[3]=t[3]),n}function v0(n,t){t[0]n[2]&&(n[2]=t[0]),t[1]n[3]&&(n[3]=t[1])}function i8(n,t,T,Z,e){for(;Tt[0]?Z[0]=n[0]:Z[0]=t[0],n[1]>t[1]?Z[1]=n[1]:Z[1]=t[1],n[2]=t[0]&&n[1]<=t[3]&&n[3]>=t[1]}function x5(n){return n[2]=i&&p<=a),!Z&&!!(r&r1.RIGHT)&&!(e&r1.RIGHT)&&(d=c-(u-a)*f,Z=d>=o&&d<=s),!Z&&!!(r&r1.BELOW)&&!(e&r1.BELOW)&&(p=u-(c-o)/f,Z=p>=i&&p<=a),!Z&&!!(r&r1.LEFT)&&!(e&r1.LEFT)&&(d=c-(u-i)*f,Z=d>=o&&d<=s)}return Z}function r9(n,t,T,Z){var e=[];if(Z>1)for(var r=n[2]-n[0],i=n[3]-n[1],o=0;o=T[2])){var e=q(T),r=Math.floor((Z[0]-T[0])/e),i=r*e;n[0]-=i,n[2]-=i}return n}function i9(n,t){if(t.canWrapX()){var T=t.getExtent();if(!isFinite(n[0])||!isFinite(n[2]))return[[T[0],n[1],T[2],n[3]]];a8(n,t);var Z=q(T);if(q(n)>Z)return[[T[0],n[1],T[2],n[3]]];if(n[0]T[2])return[[n[0],n[1],T[2],n[3]],[T[0],n[1],n[2]-Z,n[3]]]}return[n]}var o9=function(){function n(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return n.prototype.canWrapX=function(){return this.canWrapX_},n.prototype.getCode=function(){return this.code_},n.prototype.getExtent=function(){return this.extent_},n.prototype.getUnits=function(){return this.units_},n.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||E1[this.units_]},n.prototype.getWorldExtent=function(){return this.worldExtent_},n.prototype.getAxisOrientation=function(){return this.axisOrientation_},n.prototype.isGlobal=function(){return this.global_},n.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)},n.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},n.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},n.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)},n.prototype.setWorldExtent=function(t){this.worldExtent_=t},n.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},n.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},n}();const s8=o9;function n1(n,t,T){return Math.min(Math.max(n,t),T)}var a9=function(){var n;return"cosh"in Math?n=Math.cosh:n=function(t){var T=Math.exp(t);return(T+1/T)/2},n}(),s9=function(){var n;return"log2"in Math?n=Math.log2:n=function(t){return Math.log(t)*Math.LOG2E},n}();function l9(n,t,T,Z,e,r){var i=e-T,o=r-Z;if(i!==0||o!==0){var a=((n-T)*i+(t-Z)*o)/(i*i+o*o);a>1?(T=e,Z=r):a>0&&(T+=i*a,Z+=o*a)}return E2(n,t,T,Z)}function E2(n,t,T,Z){var e=T-n,r=Z-t;return e*e+r*r}function u9(n){for(var t=n.length,T=0;Te&&(e=i,Z=r)}if(e===0)return null;var o=n[Z];n[Z]=n[T],n[T]=o;for(var a=T+1;a=0;u--){h[u]=n[u][t]/n[u][u];for(var c=u-1;c>=0;c--)n[c][t]-=n[c][u]*h[u]}return h}function n4(n){return n*Math.PI/180}function B2(n,t){var T=n%t;return T*t<0?T+t:T}function W1(n,t,T){return n+T*(t-n)}function l8(n,t){var T=Math.pow(10,t);return Math.round(n*T)/T}function K0(n,t){return Math.floor(l8(n,t))}function V0(n,t){return Math.ceil(l8(n,t))}var h9=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),M0=6378137,Y2=Math.PI*M0,c9=[-Y2,-Y2,Y2,Y2],f9=[-180,-85,180,85],$0=M0*Math.log(Math.tan(Math.PI/2)),F2=function(n){h9(t,n);function t(T){return n.call(this,{code:T,units:z1.METERS,extent:c9,global:!0,worldExtent:f9,getPointResolution:function(Z,e){return Z/a9(e[1]/M0)}})||this}return t}(s8),n7=[new F2("EPSG:3857"),new F2("EPSG:102100"),new F2("EPSG:102113"),new F2("EPSG:900913"),new F2("http://www.opengis.net/def/crs/EPSG/0/3857"),new F2("http://www.opengis.net/gml/srs/epsg.xml#3857")];function p9(n,t,T){var Z=n.length,e=T>1?T:2,r=t;r===void 0&&(e>2?r=n.slice():r=new Array(Z));for(var i=0;i$0?o=$0:o<-$0&&(o=-$0),r[i+1]=o}return r}function d9(n,t,T){var Z=n.length,e=T>1?T:2,r=t;r===void 0&&(e>2?r=n.slice():r=new Array(Z));for(var i=0;i=0;--Z)if(n[Z]!=t[Z]){T=!1;break}return T}function w5(n,t){var T=Math.cos(t),Z=Math.sin(t),e=n[0]*T-n[1]*Z,r=n[1]*T+n[0]*Z;return n[0]=e,n[1]=r,n}function x9(n,t){return n[0]*=t,n[1]*=t,n}function u8(n,t){if(t.canWrapX()){var T=q(t.getExtent()),Z=w9(n,t,T);Z&&(n[0]-=Z*T)}return n}function w9(n,t,T){var Z=t.getExtent(),e=0;if(t.canWrapX()&&(n[0]Z[2])){var r=T||q(Z);e=Math.floor((n[0]-Z[0])/r)}return e}var O9=63710088e-1;function o7(n,t,T){var Z=T||O9,e=n4(n[1]),r=n4(t[1]),i=(r-e)/2,o=n4(t[0]-n[0])/2,a=Math.sin(i)*Math.sin(i)+Math.sin(o)*Math.sin(o)*Math.cos(e)*Math.cos(r);return 2*Z*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}var e5=!0;function R9(n){var t=n===void 0?!0:n;e5=!t}function O5(n,t,T){var Z;if(t!==void 0){for(var e=0,r=n.length;e=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(e5=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n)}function r5(n,t){return w1?c8(n,t,w1):n}function g2(n,t){return w1?c8(n,w1,t):n}function M9(n,t){if(!w1)return n;var T=Z1(t).getUnits(),Z=w1.getUnits();return T&&Z?n*E1[T]/E1[Z]:n}function F9(){s7(n7),s7(i7),P9(i7,n7,p9,d9)}F9();function C2(n,t,T,Z,e,r){for(var i=r||[],o=0,a=t;a1)h=T;else if(u>0){for(var c=0;ce&&(e=s),r=o,i=a}return e}function P5(n,t,T,Z,e){for(var r=0,i=T.length;r0;){for(var h=s.pop(),u=s.pop(),c=0,f=n[u],p=n[u+1],d=n[h],g=n[h+1],v=u+Z;vc&&(l=v,c=m)}c>e&&(a[(l-t)/Z]=1,u+Z0&&p>c)&&(f<0&&d0&&d>f)){s=h,l=u;continue}r[i++]=s,r[i++]=l,o=s,a=l,s=h,l=u}}return r[i++]=s,r[i++]=l,i}function v8(n,t,T,Z,e,r,i,o){for(var a=0,s=T.length;ar&&(s-o)*(r-a)-(e-o)*(l-a)>0&&i++:l<=r&&(s-o)*(r-a)-(e-o)*(l-a)<0&&i--,o=s,a=l}return i!==0}function D5(n,t,T,Z,e,r){if(T.length===0||!_2(n,t,T[0],Z,e,r))return!1;for(var i=1,o=T.length;iy&&(s=(l+h)/2,D5(n,t,T,Z,s,f)&&(_=s,y=m)),l=h}return isNaN(_)&&(_=e[r]),i?(i.push(_,f,y),i):[_,f,y]}function e6(n,t,T,Z,e){for(var r=[],i=0,o=T.length;i=e[0]&&r[2]<=e[2]||r[1]>=e[1]&&r[3]<=e[3]?!0:m8(n,t,T,Z,function(i,o){return n9(e,i,o)}):!1}function n6(n,t,T,Z,e){for(var r=0,i=T.length;r0}function w8(n,t,T,Z,e){for(var r=e!==void 0?e:!1,i=0,o=T.length;i1?i:2,y=r||new Array(_),f=0;f<_;++f)y[f]=o===void 0?NaN:a===void 0?n[o+f]:W1(n[o+f],n[o+Z+f],a);return y}function a5(n,t,T,Z,e,r){if(T==t)return null;var i;if(e>1;e0&&n[1]>0}function f6(n,t,T){return T===void 0&&(T=[0,0]),T[0]=n[0]*t+.5|0,T[1]=n[1]*t+.5|0,T}function S1(n,t){return Array.isArray(n)?n:(t===void 0?t=[n,n]:(t[0]=n,t[1]=n),t)}var p6=function(){function n(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=S1(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}return n.prototype.clone=function(){var t=this.getScale();return new n({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},n.prototype.getOpacity=function(){return this.opacity_},n.prototype.getRotateWithView=function(){return this.rotateWithView_},n.prototype.getRotation=function(){return this.rotation_},n.prototype.getScale=function(){return this.scale_},n.prototype.getScaleArray=function(){return this.scaleArray_},n.prototype.getDisplacement=function(){return this.displacement_},n.prototype.getDeclutterMode=function(){return this.declutterMode_},n.prototype.getAnchor=function(){return F()},n.prototype.getImage=function(t){return F()},n.prototype.getHitDetectionImage=function(){return F()},n.prototype.getPixelRatio=function(t){return 1},n.prototype.getImageState=function(){return F()},n.prototype.getImageSize=function(){return F()},n.prototype.getOrigin=function(){return F()},n.prototype.getSize=function(){return F()},n.prototype.setDisplacement=function(t){this.displacement_=t},n.prototype.setOpacity=function(t){this.opacity_=t},n.prototype.setRotateWithView=function(t){this.rotateWithView_=t},n.prototype.setRotation=function(t){this.rotation_=t},n.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=S1(t)},n.prototype.listenImageChange=function(t){F()},n.prototype.load=function(){F()},n.prototype.unlistenImageChange=function(t){F()},n}();const P8=p6;var d6=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,v6=/^([a-z]*)$|^hsla?\(.*\)$/i;function L8(n){return typeof n=="string"?n:A8(n)}function g6(n){var t=document.createElement("div");if(t.style.color=n,t.style.color!==""){document.body.appendChild(t);var T=getComputedStyle(t).color;return document.body.removeChild(t),T}else return""}var _6=function(){var n=1024,t={},T=0;return function(Z){var e;if(t.hasOwnProperty(Z))e=t[Z];else{if(T>=n){var r=0;for(var i in t)(r++&3)===0&&(delete t[i],--T)}e=y6(Z),t[Z]=e,++T}return e}}();function l4(n){return Array.isArray(n)?n:_6(n)}function y6(n){var t,T,Z,e,r;if(v6.exec(n)&&(n=g6(n)),d6.exec(n)){var i=n.length-1,o=void 0;i<=4?o=1:o=2;var a=i===4||i===8;t=parseInt(n.substr(1+0*o,o),16),T=parseInt(n.substr(1+1*o,o),16),Z=parseInt(n.substr(1+2*o,o),16),a?e=parseInt(n.substr(1+3*o,o),16):e=255,o==1&&(t=(t<<4)+t,T=(T<<4)+T,Z=(Z<<4)+Z,a&&(e=(e<<4)+e)),r=[t,T,Z,e/255]}else n.indexOf("rgba(")==0?(r=n.slice(5,-1).split(",").map(Number),v7(r)):n.indexOf("rgb(")==0?(r=n.slice(4,-1).split(",").map(Number),r.push(1),v7(r)):X(!1,14);return r}function v7(n){return n[0]=n1(n[0]+.5|0,0,255),n[1]=n1(n[1]+.5|0,0,255),n[2]=n1(n[2]+.5|0,0,255),n[3]=n1(n[3],0,1),n}function A8(n){var t=n[0];t!=(t|0)&&(t=t+.5|0);var T=n[1];T!=(T|0)&&(T=T+.5|0);var Z=n[2];Z!=(Z|0)&&(Z=Z+.5|0);var e=n[3]===void 0?1:Math.round(n[3]*100)/100;return"rgba("+t+","+T+","+Z+","+e+")"}function M1(n){return Array.isArray(n)?A8(n):n}function g1(n,t,T,Z){var e;return T&&T.length?e=T.shift():y4?e=new OffscreenCanvas(n||300,t||300):e=document.createElement("canvas"),n&&(e.width=n),t&&(e.height=t),e.getContext("2d",Z)}function M8(n){var t=n.canvas;t.width=1,t.height=1,n.clearRect(0,0,1,1)}function m6(n){var t=n.offsetWidth,T=getComputedStyle(n);return t+=parseInt(T.marginLeft,10)+parseInt(T.marginRight,10),t}function E6(n){var t=n.offsetHeight,T=getComputedStyle(n);return t+=parseInt(T.marginTop,10)+parseInt(T.marginBottom,10),t}function g7(n,t){var T=t.parentNode;T&&T.replaceChild(n,t)}function u4(n){return n&&n.parentNode?n.parentNode.removeChild(n):null}function F8(n){for(;n.lastChild;)n.removeChild(n.lastChild)}function C6(n,t){for(var T=n.childNodes,Z=0;;++Z){var e=T[Z],r=t[Z];if(!e&&!r)break;if(e!==r){if(!e){n.appendChild(r);continue}if(!r){n.removeChild(e),--Z;continue}n.insertBefore(r,e)}}}var H0="ol-hidden",x6="ol-selectable",R4="ol-unselectable",N5="ol-control",_7="ol-collapsed",w6=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),y7=["style","variant","weight","size","lineHeight","family"],D8=function(n){var t=n.match(w6);if(!t)return null;for(var T={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},Z=0,e=y7.length;Z=n.maxResolution)return!1;var Z=t.zoom;return Z>n.minZoom&&Z<=n.maxZoom}const S4=W6;function B6(n,t,T,Z,e){X8(n,t,T||0,Z||n.length-1,e||z6)}function X8(n,t,T,Z,e){for(;Z>T;){if(Z-T>600){var r=Z-T+1,i=t-T+1,o=Math.log(r),a=.5*Math.exp(2*o/3),s=.5*Math.sqrt(o*a*(r-a)/r)*(i-r/2<0?-1:1),l=Math.max(T,Math.floor(t-i*a/r+s)),h=Math.min(Z,Math.floor(t+(r-i)*a/r+s));X8(n,t,l,h,e)}var u=n[t],c=T,f=Z;for(l0(n,T,t),e(n[Z],u)>0&&l0(n,T,Z);c0;)f--}e(n[T],u)===0?l0(n,T,f):(f++,l0(n,f,Z)),f<=t&&(T=f+1),t<=f&&(Z=f-1)}}function l0(n,t,T){var Z=n[t];n[t]=n[T],n[T]=Z}function z6(n,t){return nt?1:0}class Y8{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let T=this.data;const Z=[];if(!J0(t,T))return Z;const e=this.toBBox,r=[];for(;T;){for(let i=0;i=0&&r[T].children.length>this._maxEntries;)this._split(r,T),T--;this._adjustParentBBoxes(e,r,T)}_split(t,T){const Z=t[T],e=Z.children.length,r=this._minEntries;this._chooseSplitAxis(Z,r,e);const i=this._chooseSplitIndex(Z,r,e),o=j2(Z.children.splice(i,Z.children.length-i));o.height=Z.height,o.leaf=Z.leaf,D2(Z,this.toBBox),D2(o,this.toBBox),T?t[T-1].children.push(o):this._splitRoot(Z,o)}_splitRoot(t,T){this.data=j2([t,T]),this.data.height=t.height+1,this.data.leaf=!1,D2(this.data,this.toBBox)}_chooseSplitIndex(t,T,Z){let e,r=1/0,i=1/0;for(let o=T;o<=Z-T;o++){const a=p0(t,0,o,this.toBBox),s=p0(t,o,Z,this.toBBox),l=H6(a,s),h=j4(a)+j4(s);l=T;s--){const l=t.children[s];d0(o,t.leaf?r(l):l),a+=q0(o)}return a}_adjustParentBBoxes(t,T,Z){for(let e=Z;e>=0;e--)d0(T[e],t)}_condense(t){for(let T=t.length-1,Z;T>=0;T--)t[T].children.length===0?T>0?(Z=t[T-1].children,Z.splice(Z.indexOf(t[T]),1)):this.clear():D2(t[T],this.toBBox)}}function U6(n,t,T){if(!T)return t.indexOf(n);for(let Z=0;Z=n.minX&&t.maxY>=n.minY}function j2(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function C7(n,t,T,Z,e){const r=[t,T];for(;r.length;){if(T=r.pop(),t=r.pop(),T-t<=Z)continue;const i=t+Math.ceil((T-t)/Z/2)*Z;B6(n,i,t,T,e),r.push(t,i,i,T)}}var q6=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),x7={RENDER_ORDER:"renderOrder"},J6=function(n){q6(t,n);function t(T){var Z=this,e=T||{},r=e1({},e);return delete r.style,delete r.renderBuffer,delete r.updateWhileAnimating,delete r.updateWhileInteracting,Z=n.call(this,r)||this,Z.declutter_=e.declutter!==void 0?e.declutter:!1,Z.renderBuffer_=e.renderBuffer!==void 0?e.renderBuffer:100,Z.style_=null,Z.styleFunction_=void 0,Z.setStyle(e.style),Z.updateWhileAnimating_=e.updateWhileAnimating!==void 0?e.updateWhileAnimating:!1,Z.updateWhileInteracting_=e.updateWhileInteracting!==void 0?e.updateWhileInteracting:!1,Z}return t.prototype.getDeclutter=function(){return this.declutter_},t.prototype.getFeatures=function(T){return n.prototype.getFeatures.call(this,T)},t.prototype.getRenderBuffer=function(){return this.renderBuffer_},t.prototype.getRenderOrder=function(){return this.get(x7.RENDER_ORDER)},t.prototype.getStyle=function(){return this.style_},t.prototype.getStyleFunction=function(){return this.styleFunction_},t.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},t.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},t.prototype.renderDeclutter=function(T){T.declutterTree||(T.declutterTree=new Y8(9)),this.getRenderer().renderDeclutter(T)},t.prototype.setRenderOrder=function(T){this.set(x7.RENDER_ORDER,T)},t.prototype.setStyle=function(T){this.style_=T!==void 0?T:b6,this.styleFunction_=T===null?void 0:G6(this.style_),this.changed()},t}(S4);const Q6=J6;var F0={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Q0=[F0.FILL],o2=[F0.STROKE],m2=[F0.BEGIN_PATH],w7=[F0.CLOSE_PATH];const N=F0;var TT=function(){function n(){}return n.prototype.drawCustom=function(t,T,Z,e){},n.prototype.drawGeometry=function(t){},n.prototype.setStyle=function(t){},n.prototype.drawCircle=function(t,T){},n.prototype.drawFeature=function(t,T){},n.prototype.drawGeometryCollection=function(t,T){},n.prototype.drawLineString=function(t,T){},n.prototype.drawMultiLineString=function(t,T){},n.prototype.drawMultiPoint=function(t,T){},n.prototype.drawMultiPolygon=function(t,T){},n.prototype.drawPoint=function(t,T){},n.prototype.drawPolygon=function(t,T){},n.prototype.drawText=function(t,T){},n.prototype.setFillStrokeStyle=function(t,T){},n.prototype.setImageStyle=function(t,T){},n.prototype.setTextStyle=function(t,T){},n}();const W8=TT;var ZT=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),tT=function(n){ZT(t,n);function t(T,Z,e,r){var i=n.call(this)||this;return i.tolerance=T,i.maxExtent=Z,i.pixelRatio=r,i.maxLineWidth=0,i.resolution=e,i.beginGeometryInstruction1_=null,i.beginGeometryInstruction2_=null,i.bufferedMaxExtent_=null,i.instructions=[],i.coordinates=[],i.tmpCoordinate_=[],i.hitDetectionInstructions=[],i.state={},i}return t.prototype.applyPixelRatio=function(T){var Z=this.pixelRatio;return Z==1?T:T.map(function(e){return e*Z})},t.prototype.appendFlatPointCoordinates=function(T,Z){for(var e=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,o=i.length,a=0,s=T.length;aa&&(this.instructions.push([N.CUSTOM,a,l,T,e,i2]),this.hitDetectionInstructions.push([N.CUSTOM,a,l,T,r||e,i2]));break;case"Point":s=T.getFlatCoordinates(),this.coordinates.push(s[0],s[1]),l=this.coordinates.length,this.instructions.push([N.CUSTOM,a,l,T,e]),this.hitDetectionInstructions.push([N.CUSTOM,a,l,T,r||e]);break}this.endGeometry(Z)},t.prototype.beginGeometry=function(T,Z){this.beginGeometryInstruction1_=[N.BEGIN_GEOMETRY,Z,0,T],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[N.BEGIN_GEOMETRY,Z,0,T],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},t.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},t.prototype.reverseHitDetectionInstructions=function(){var T=this.hitDetectionInstructions;T.reverse();var Z,e=T.length,r,i,o=-1;for(Z=0;Zthis.maxLineWidth&&(this.maxLineWidth=e.lineWidth,this.bufferedMaxExtent_=null)}else e.strokeStyle=void 0,e.lineCap=void 0,e.lineDash=null,e.lineDashOffset=void 0,e.lineJoin=void 0,e.lineWidth=void 0,e.miterLimit=void 0},t.prototype.createFill=function(T){var Z=T.fillStyle,e=[N.SET_FILL_STYLE,Z];return typeof Z!="string"&&e.push(!0),e},t.prototype.applyStroke=function(T){this.instructions.push(this.createStroke(T))},t.prototype.createStroke=function(T){return[N.SET_STROKE_STYLE,T.strokeStyle,T.lineWidth*this.pixelRatio,T.lineCap,T.lineJoin,T.miterLimit,this.applyPixelRatio(T.lineDash),T.lineDashOffset*this.pixelRatio]},t.prototype.updateFillStyle=function(T,Z){var e=T.fillStyle;(typeof e!="string"||T.currentFillStyle!=e)&&(e!==void 0&&this.instructions.push(Z.call(this,T)),T.currentFillStyle=e)},t.prototype.updateStrokeStyle=function(T,Z){var e=T.strokeStyle,r=T.lineCap,i=T.lineDash,o=T.lineDashOffset,a=T.lineJoin,s=T.lineWidth,l=T.miterLimit;(T.currentStrokeStyle!=e||T.currentLineCap!=r||i!=T.currentLineDash&&!R2(T.currentLineDash,i)||T.currentLineDashOffset!=o||T.currentLineJoin!=a||T.currentLineWidth!=s||T.currentMiterLimit!=l)&&(e!==void 0&&Z.call(this,T),T.currentStrokeStyle=e,T.currentLineCap=r,T.currentLineDash=i,T.currentLineDashOffset=o,T.currentLineJoin=a,T.currentLineWidth=s,T.currentMiterLimit=l)},t.prototype.endGeometry=function(T){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var Z=[N.END_GEOMETRY,T];this.instructions.push(Z),this.hitDetectionInstructions.push(Z)},t.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=e8(this.maxExtent),this.maxLineWidth>0)){var T=this.resolution*(this.maxLineWidth+1)/2;E5(this.bufferedMaxExtent_,T,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},t}(W8);const D0=tT;var eT=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),nT=function(n){eT(t,n);function t(T,Z,e,r){var i=n.call(this,T,Z,e,r)||this;return i.hitDetectionImage_=null,i.image_=null,i.imagePixelRatio_=void 0,i.anchorX_=void 0,i.anchorY_=void 0,i.height_=void 0,i.opacity_=void 0,i.originX_=void 0,i.originY_=void 0,i.rotateWithView_=void 0,i.rotation_=void 0,i.scale_=void 0,i.width_=void 0,i.declutterMode_=void 0,i.declutterImageWithText_=void 0,i}return t.prototype.drawPoint=function(T,Z){if(!!this.image_){this.beginGeometry(T,Z);var e=T.getFlatCoordinates(),r=T.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(e,r);this.instructions.push([N.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([N.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(Z)}},t.prototype.drawMultiPoint=function(T,Z){if(!!this.image_){this.beginGeometry(T,Z);var e=T.getFlatCoordinates(),r=T.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(e,r);this.instructions.push([N.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([N.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(Z)}},t.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,n.prototype.finish.call(this)},t.prototype.setImageStyle=function(T,Z){var e=T.getAnchor(),r=T.getSize(),i=T.getOrigin();this.imagePixelRatio_=T.getPixelRatio(this.pixelRatio),this.anchorX_=e[0],this.anchorY_=e[1],this.hitDetectionImage_=T.getHitDetectionImage(),this.image_=T.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=T.getOpacity(),this.originX_=i[0],this.originY_=i[1],this.rotateWithView_=T.getRotateWithView(),this.rotation_=T.getRotation(),this.scale_=T.getScaleArray(),this.width_=r[0],this.declutterMode_=T.getDeclutterMode(),this.declutterImageWithText_=Z},t}(D0);const rT=nT;var iT=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),oT=function(n){iT(t,n);function t(T,Z,e,r){return n.call(this,T,Z,e,r)||this}return t.prototype.drawFlatCoordinates_=function(T,Z,e,r){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(T,Z,e,r,!1,!1),a=[N.MOVE_TO_LINE_TO,i,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),e},t.prototype.drawLineString=function(T,Z){var e=this.state,r=e.strokeStyle,i=e.lineWidth;if(!(r===void 0||i===void 0)){this.updateStrokeStyle(e,this.applyStroke),this.beginGeometry(T,Z),this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,x0,w0],m2);var o=T.getFlatCoordinates(),a=T.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(o2),this.endGeometry(Z)}},t.prototype.drawMultiLineString=function(T,Z){var e=this.state,r=e.strokeStyle,i=e.lineWidth;if(!(r===void 0||i===void 0)){this.updateStrokeStyle(e,this.applyStroke),this.beginGeometry(T,Z),this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash,e.lineDashOffset],m2);for(var o=T.getEnds(),a=T.getFlatCoordinates(),s=T.getStride(),l=0,h=0,u=o.length;hn&&(a>o&&(o=a,r=s,i=h),a=0,s=h-e)),u=c,d=v,g=_),f=y,p=m}return a+=c,a>o?[s,h]:[r,i]}var hT=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),_0={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},cT=function(n){hT(t,n);function t(T,Z,e,r){var i=n.call(this,T,Z,e,r)||this;return i.labels_=null,i.text_="",i.textOffsetX_=0,i.textOffsetY_=0,i.textRotateWithView_=void 0,i.textRotation_=0,i.textFillState_=null,i.fillStates={},i.textStrokeState_=null,i.strokeStates={},i.textState_={},i.textStates={},i.textKey_="",i.fillKey_="",i.strokeKey_="",i.declutterImageWithText_=void 0,i}return t.prototype.finish=function(){var T=n.prototype.finish.call(this);return T.textStates=this.textStates,T.fillStates=this.fillStates,T.strokeStates=this.strokeStates,T},t.prototype.drawText=function(T,Z){var e=this.textFillState_,r=this.textStrokeState_,i=this.textState_;if(!(this.text_===""||!i||!e&&!r)){var o=this.coordinates,a=o.length,s=T.getType(),l=null,h=T.getStride();if(i.placement===j6.LINE&&(s=="LineString"||s=="MultiLineString"||s=="Polygon"||s=="MultiPolygon")){if(!d1(this.getBufferedMaxExtent(),T.getExtent()))return;var u=void 0;if(l=T.getFlatCoordinates(),s=="LineString")u=[l.length];else if(s=="MultiLineString")u=T.getEnds();else if(s=="Polygon")u=T.getEnds().slice(0,1);else if(s=="MultiPolygon"){var c=T.getEndss();u=[];for(var f=0,p=c.length;fO[2]}else A=y>S;var R=Math.PI,D=[],b=C+Z===t;t=C,d=0,g=E,u=n[t],c=n[t+1];var I;if(b){v(),I=Math.atan2(c-p,u-f),A&&(I+=I>0?-R:R);var L=(S+y)/2,M=(P+m)/2;return D[0]=[L,M,(w-r)/2,I,e],D}e=e.replace(/\n/g," ");for(var Y=0,W=e.length;Y0?-R:R),I!==void 0){var x=K-I;if(x+=x>R?-2*R:x<-R?2*R:0,Math.abs(x)>i)return null}I=K;for(var Q=Y,V=0;Y0&&n.push(` `,""),n.push(t,""),n}var ST=function(){function n(t,T,Z,e){this.overlaps=Z,this.pixelRatio=T,this.resolution=t,this.alignFill_,this.instructions=e.instructions,this.coordinates=e.coordinates,this.coordinateCache_={},this.renderedTransform_=F1(),this.hitDetectionInstructions=e.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=e.fillStates||{},this.strokeStates=e.strokeStates||{},this.textStates=e.textStates||{},this.widths_={},this.labels_={}}return n.prototype.createLabel=function(t,T,Z,e){var r=t+T+Z+e;if(this.labels_[r])return this.labels_[r];var i=e?this.strokeStates[e]:null,o=Z?this.fillStates[Z]:null,a=this.textStates[T],s=this.pixelRatio,l=[a.scale[0]*s,a.scale[1]*s],h=Array.isArray(t),u=a.justify?_0[a.justify]:P7(Array.isArray(t)?t[0]:t,a.textAlign||S0),c=e&&i.lineWidth?i.lineWidth:0,f=h?t:t.split(` `).reduce(RT,[]),p=I6(a,f),d=p.width,g=p.height,v=p.widths,_=p.heights,y=p.lineWidths,m=d+c,C=[],E=(m+2)*l[0],w=(g+c)*l[1],S={width:E<0?Math.floor(E):Math.ceil(E),height:w<0?Math.floor(w):Math.ceil(w),contextInstructions:C};if((l[0]!=1||l[1]!=1)&&C.push("scale",l),e){C.push("strokeStyle",i.strokeStyle),C.push("lineWidth",c),C.push("lineCap",i.lineCap),C.push("lineJoin",i.lineJoin),C.push("miterLimit",i.miterLimit);var P=y4?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;P.prototype.setLineDash&&(C.push("setLineDash",[i.lineDash]),C.push("lineDashOffset",i.lineDashOffset))}Z&&C.push("fillStyle",o.fillStyle),C.push("textBaseline","middle"),C.push("textAlign","center");for(var A=.5-u,O=u*m+A*c,R=[],D=[],b=0,I=0,L=0,M=0,Y,W=0,K=f.length;Wt?t-s:r,y=i+l>T?T-l:i,m=f[3]+_*u[0]+f[1],C=f[0]+y*u[1]+f[2],E=g-f[3],w=v-f[0];(p||h!==0)&&(J1[0]=E,Q1[0]=E,J1[1]=w,G1[1]=w,G1[0]=E+m,b1[0]=G1[0],b1[1]=w+C,Q1[1]=b1[1]);var S;return h!==0?(S=K1(F1(),Z,e,1,1,h,-Z,-e),t1(S,J1),t1(S,G1),t1(S,b1),t1(S,Q1),D1(Math.min(J1[0],G1[0],b1[0],Q1[0]),Math.min(J1[1],G1[1],b1[1],Q1[1]),Math.max(J1[0],G1[0],b1[0],Q1[0]),Math.max(J1[1],G1[1],b1[1],Q1[1]),N2)):D1(Math.min(E,E+m),Math.min(w,w+C),Math.max(E,E+m),Math.max(w,w+C),N2),c&&(g=Math.round(g),v=Math.round(v)),{drawImageX:g,drawImageY:v,drawImageW:_,drawImageH:y,originX:s,originY:l,declutterBox:{minX:N2[0],minY:N2[1],maxX:N2[2],maxY:N2[3],value:d},canvasTransform:S,scale:u}},n.prototype.replayImageOrLabel_=function(t,T,Z,e,r,i,o){var a=!!(i||o),s=e.declutterBox,l=t.canvas,h=o?o[2]*e.scale[0]/2:0,u=s.minX-h<=l.width/T&&s.maxX+h>=0&&s.minY-h<=l.height/T&&s.maxY+h>=0;return u&&(a&&this.replayTextBackground_(t,J1,G1,b1,Q1,i,o),P6(t,e.canvasTransform,r,Z,e.originX,e.originY,e.drawImageW,e.drawImageH,e.drawImageX,e.drawImageY,e.scale)),!0},n.prototype.fill_=function(t){if(this.alignFill_){var T=t1(this.renderedTransform_,[0,0]),Z=512*this.pixelRatio;t.save(),t.translate(T[0]%Z,T[1]%Z),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},n.prototype.setStrokeStyle_=function(t,T){t.strokeStyle=T[1],t.lineWidth=T[2],t.lineCap=T[3],t.lineJoin=T[4],t.miterLimit=T[5],t.setLineDash&&(t.lineDashOffset=T[7],t.setLineDash(T[6]))},n.prototype.drawLabelWithPointPlacement_=function(t,T,Z,e){var r=this.textStates[T],i=this.createLabel(t,T,e,Z),o=this.strokeStates[Z],a=this.pixelRatio,s=P7(Array.isArray(t)?t[0]:t,r.textAlign||S0),l=_0[r.textBaseline||c4],h=o&&o.lineWidth?o.lineWidth:0,u=i.width/a-2*r.scale[0],c=s*u+2*(.5-s)*h,f=l*i.height/a+2*(.5-l)*h;return{label:i,anchorX:c,anchorY:f}},n.prototype.execute_=function(t,T,Z,e,r,i,o,a){var s;this.pixelCoordinates_&&R2(Z,this.renderedTransform_)?s=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),s=C2(this.coordinates,0,this.coordinates.length,2,Z,this.pixelCoordinates_),H3(this.renderedTransform_,Z));for(var l=0,h=e.length,u=0,c,f,p,d,g,v,_,y,m,C,E,w,S=0,P=0,A=null,O=null,R=this.coordinateCache_,D=this.viewRotation_,b=Math.round(Math.atan2(-Z[1],Z[0])*1e12)/1e12,I={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:D},L=this.instructions!=e||this.overlaps?0:200,M,Y,W,K;lL&&(this.fill_(t),S=0),P>L&&(t.stroke(),P=0),!S&&!P&&(t.beginPath(),d=NaN,g=NaN),++l;break;case N.CIRCLE:u=x[1];var V=s[u],k=s[u+1],i1=s[u+2],c1=s[u+3],o1=i1-V,L2=c1-k,v1=Math.sqrt(o1*o1+L2*L2);t.moveTo(V+v1,k),t.arc(V,k,v1,0,2*Math.PI,!0),++l;break;case N.CLOSE_PATH:t.closePath(),++l;break;case N.CUSTOM:u=x[1],c=x[2];var J2=x[3],P1=x[4],Q2=x.length==6?x[5]:void 0;I.geometry=J2,I.feature=M,l in R||(R[l]=[]);var l2=R[l];Q2?Q2(s,u,c,2,l2):(l2[0]=s[u],l2[1]=s[u+1],l2.length=2),P1(l2,I),++l;break;case N.DRAW_IMAGE:u=x[1],c=x[2],y=x[3],f=x[4],p=x[5];var A2=x[6],b0=x[7],j0=x[8],T0=x[9],Z0=x[10],$1=x[11],L4=x[12],u2=x[13],k0=x[14],H1=x[15];if(!y&&x.length>=20){m=x[19],C=x[20],E=x[21],w=x[22];var M2=this.drawLabelWithPointPlacement_(m,C,E,w);y=M2.label,x[3]=y;var A4=x[23];f=(M2.anchorX-A4)*this.pixelRatio,x[4]=f;var X0=x[24];p=(M2.anchorY-X0)*this.pixelRatio,x[5]=p,A2=y.height,x[6]=A2,u2=y.width,x[13]=u2}var t0=void 0;x.length>25&&(t0=x[25]);var N1=void 0,L1=void 0,h2=void 0;x.length>17?(N1=x[16],L1=x[17],h2=x[18]):(N1=y2,L1=!1,h2=!1),Z0&&b?$1+=D:!Z0&&!b&&($1-=D);for(var e0=0;u0){if(!i||c!=="Image"&&c!=="Text"||i.indexOf(C)!==-1){var A=(u[S]-3)/4,O=e-A%o,R=e-(A/o|0),D=r(C,E,O*O+R*R);if(D)return D}l.clearRect(0,0,o,o);break}}var p=Object.keys(this.executorsByZIndex_).map(Number);p.sort(x2);var d,g,v,_,y;for(d=p.length-1;d>=0;--d){var m=p[d].toString();for(v=this.executorsByZIndex_[m],g=X4.length-1;g>=0;--g)if(c=X4[g],_=v[c],_!==void 0&&(y=_.executeHitDetection(l,a,Z,f,h),y))return y}},n.prototype.getClipCoords=function(t){var T=this.maxExtent_;if(!T)return null;var Z=T[0],e=T[1],r=T[2],i=T[3],o=[Z,e,Z,i,r,i,r,e];return C2(o,0,8,2,t,o),o},n.prototype.isEmpty=function(){return K2(this.executorsByZIndex_)},n.prototype.execute=function(t,T,Z,e,r,i,o){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(x2),this.maxExtent_&&(t.save(),this.clip(t,Z));var s=i||X4,l,h,u,c,f,p;for(o&&a.reverse(),l=0,h=a.length;lT)break;var o=Z[i];o||(o=[],Z[i]=o),o.push(((n+e)*t+(n+r))*4+3),e>0&&o.push(((n-e)*t+(n+r))*4+3),r>0&&(o.push(((n+e)*t+(n-r))*4+3),e>0&&o.push(((n-e)*t+(n-r))*4+3))}for(var a=[],e=0,s=Z.length;ethis.maxCacheSize_},n.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var T in this.cache_){var Z=this.cache_[T];(t++&3)===0&&!Z.hasListener()&&(delete this.cache_[T],--this.cacheSize_)}}},n.prototype.get=function(t,T,Z){var e=A7(t,T,Z);return e in this.cache_?this.cache_[e]:null},n.prototype.set=function(t,T,Z,e){var r=A7(t,T,Z);this.cache_[r]=e,++this.cacheSize_},n.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},n}();function A7(n,t,T){var Z=T?L8(T):"null";return t+":"+n+":"+Z}var d4=new DT,NT=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),GT=function(n){NT(t,n);function t(T,Z,e,r){var i=n.call(this)||this;return i.extent=T,i.pixelRatio_=e,i.resolution=Z,i.state=r,i}return t.prototype.changed=function(){this.dispatchEvent(j.CHANGE)},t.prototype.getExtent=function(){return this.extent},t.prototype.getImage=function(){return F()},t.prototype.getPixelRatio=function(){return this.pixelRatio_},t.prototype.getResolution=function(){return this.resolution},t.prototype.getState=function(){return this.state},t.prototype.load=function(){F()},t}($2);const bT=GT;var jT=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}();(function(n){jT(t,n);function t(T,Z,e,r,i,o){var a=n.call(this,T,Z,e,$.IDLE)||this;return a.src_=r,a.image_=new Image,i!==null&&(a.image_.crossOrigin=i),a.unlisten_=null,a.state=$.IDLE,a.imageLoadFunction_=o,a}return t.prototype.getImage=function(){return this.image_},t.prototype.handleImageError_=function(){this.state=$.ERROR,this.unlistenImage_(),this.changed()},t.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=x1(this.extent)/this.image_.height),this.state=$.LOADED,this.unlistenImage_(),this.changed()},t.prototype.load=function(){(this.state==$.IDLE||this.state==$.ERROR)&&(this.state=$.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=G5(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},t.prototype.setImage=function(T){this.image_=T,this.resolution=x1(this.extent)/this.image_.height},t.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},t})(bT);function G5(n,t,T){var Z=n,e=!0,r=!1,i=!1,o=[i4(Z,j.LOAD,function(){i=!0,r||t()})];return Z.src&&V3?(r=!0,Z.decode().then(function(){e&&t()}).catch(function(a){e&&(i?t():T())})):o.push(i4(Z,j.ERROR,T)),function(){e=!1,o.forEach(H)}}var kT=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),u0=null,XT=function(n){kT(t,n);function t(T,Z,e,r,i,o){var a=n.call(this)||this;return a.hitDetectionImage_=null,a.image_=T||new Image,r!==null&&(a.image_.crossOrigin=r),a.canvas_={},a.color_=o,a.unlisten_=null,a.imageState_=i,a.size_=e,a.src_=Z,a.tainted_,a}return t.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===$.LOADED){u0||(u0=g1(1,1)),u0.drawImage(this.image_,0,0);try{u0.getImageData(0,0,1,1),this.tainted_=!1}catch{u0=null,this.tainted_=!0}}return this.tainted_===!0},t.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(j.CHANGE)},t.prototype.handleImageError_=function(){this.imageState_=$.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},t.prototype.handleImageLoad_=function(){this.imageState_=$.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},t.prototype.getImage=function(T){return this.replaceColor_(T),this.canvas_[T]?this.canvas_[T]:this.image_},t.prototype.getPixelRatio=function(T){return this.replaceColor_(T),this.canvas_[T]?T:1},t.prototype.getImageState=function(){return this.imageState_},t.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var T=this.size_[0],Z=this.size_[1],e=g1(T,Z);e.fillRect(0,0,T,Z),this.hitDetectionImage_=e.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},t.prototype.getSize=function(){return this.size_},t.prototype.getSrc=function(){return this.src_},t.prototype.load=function(){if(this.imageState_==$.IDLE){this.imageState_=$.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=G5(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},t.prototype.replaceColor_=function(T){if(!(!this.color_||this.canvas_[T]||this.imageState_!==$.LOADED)){var Z=document.createElement("canvas");this.canvas_[T]=Z,Z.width=Math.ceil(this.image_.width*T),Z.height=Math.ceil(this.image_.height*T);var e=Z.getContext("2d");if(e.scale(T,T),e.drawImage(this.image_,0,0),e.globalCompositeOperation="multiply",e.globalCompositeOperation==="multiply"||this.isTainted_())e.fillStyle=L8(this.color_),e.fillRect(0,0,Z.width/T,Z.height/T),e.globalCompositeOperation="destination-in",e.drawImage(this.image_,0,0);else{for(var r=e.getImageData(0,0,Z.width,Z.height),i=r.data,o=this.color_[0]/255,a=this.color_[1]/255,s=this.color_[2]/255,l=this.color_[3],h=0,u=i.length;h0,6);var h=e.src!==void 0?$.IDLE:$.LOADED;return Z.color_=e.color!==void 0?l4(e.color):null,Z.iconImage_=YT(s,l,Z.imgSize_!==void 0?Z.imgSize_:null,Z.crossOrigin_,h,Z.color_),Z.offset_=e.offset!==void 0?e.offset:[0,0],Z.offsetOrigin_=e.offsetOrigin!==void 0?e.offsetOrigin:y1.TOP_LEFT,Z.origin_=null,Z.size_=e.size!==void 0?e.size:null,Z}return t.prototype.clone=function(){var T=this.getScale();return new t({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(T)?T.slice():T,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getAnchor=function(){var T=this.normalizedAnchor_;if(!T){T=this.anchor_;var Z=this.getSize();if(this.anchorXUnits_==e2.FRACTION||this.anchorYUnits_==e2.FRACTION){if(!Z)return null;T=this.anchor_.slice(),this.anchorXUnits_==e2.FRACTION&&(T[0]*=Z[0]),this.anchorYUnits_==e2.FRACTION&&(T[1]*=Z[1])}if(this.anchorOrigin_!=y1.TOP_LEFT){if(!Z)return null;T===this.anchor_&&(T=this.anchor_.slice()),(this.anchorOrigin_==y1.TOP_RIGHT||this.anchorOrigin_==y1.BOTTOM_RIGHT)&&(T[0]=-T[0]+Z[0]),(this.anchorOrigin_==y1.BOTTOM_LEFT||this.anchorOrigin_==y1.BOTTOM_RIGHT)&&(T[1]=-T[1]+Z[1])}this.normalizedAnchor_=T}var e=this.getDisplacement();return[T[0]-e[0],T[1]+e[1]]},t.prototype.setAnchor=function(T){this.anchor_=T,this.normalizedAnchor_=null},t.prototype.getColor=function(){return this.color_},t.prototype.getImage=function(T){return this.iconImage_.getImage(T)},t.prototype.getPixelRatio=function(T){return this.iconImage_.getPixelRatio(T)},t.prototype.getImageSize=function(){return this.iconImage_.getSize()},t.prototype.getImageState=function(){return this.iconImage_.getImageState()},t.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},t.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var T=this.offset_;if(this.offsetOrigin_!=y1.TOP_LEFT){var Z=this.getSize(),e=this.iconImage_.getSize();if(!Z||!e)return null;T=T.slice(),(this.offsetOrigin_==y1.TOP_RIGHT||this.offsetOrigin_==y1.BOTTOM_RIGHT)&&(T[0]=e[0]-Z[0]-T[0]),(this.offsetOrigin_==y1.BOTTOM_LEFT||this.offsetOrigin_==y1.BOTTOM_RIGHT)&&(T[1]=e[1]-Z[1]-T[1])}return this.origin_=T,this.origin_},t.prototype.getSrc=function(){return this.iconImage_.getSrc()},t.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},t.prototype.listenImageChange=function(T){this.iconImage_.addEventListener(j.CHANGE,T)},t.prototype.load=function(){this.iconImage_.load()},t.prototype.unlistenImageChange=function(T){this.iconImage_.removeEventListener(j.CHANGE,T)},t}(P8);const h5=BT;var A1=.5;function zT(n,t,T,Z,e,r,i){var o=n[0]*A1,a=n[1]*A1,s=g1(o,a);s.imageSmoothingEnabled=!1;for(var l=s.canvas,h=new FT(s,A1,e,null,i),u=T.length,c=Math.floor((256*256*256-1)/u),f={},p=1;p<=u;++p){var d=T[p-1],g=d.getStyleFunction()||Z;if(!!Z){var v=g(d,r);if(!!v){Array.isArray(v)||(v=[v]);for(var _=p*c,y="#"+("000000"+_.toString(16)).slice(-6),m=0,C=v.length;mp[2];)++v,_=g*v,h.push(this.getRenderTransform(r,i,o,A1,u,c,_).slice()),d-=g}this.hitDetectionImageData_=zT(e,h,this.renderedFeatures_,l.getStyleFunction(),s,i,o)}Z(UT(T,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},t.prototype.forEachFeatureAtCoordinate=function(T,Z,e,r,i){var o=this;if(!!this.replayGroup_){var a=Z.viewState.resolution,s=Z.viewState.rotation,l=this.getLayer(),h={},u=function(p,d,g){var v=z(p),_=h[v];if(_){if(_!==!0&&g<_.distanceSq){if(g===0)return h[v]=!0,i.splice(i.lastIndexOf(_),1),r(p,l,d);_.geometry=d,_.distanceSq=g}}else{if(g===0)return h[v]=!0,r(p,l,d);i.push(h[v]={feature:p,layer:l,geometry:d,distanceSq:g,callback:r})}},c,f=[this.replayGroup_];return this.declutterExecutorGroup&&f.push(this.declutterExecutorGroup),f.some(function(p){return c=p.forEachFeatureAtCoordinate(T,a,s,e,u,p===o.declutterExecutorGroup&&Z.declutterTree?Z.declutterTree.all().map(function(d){return d.value}):null)}),c}},t.prototype.handleFontsChanged=function(){var T=this.getLayer();T.getVisible()&&this.replayGroup_&&T.changed()},t.prototype.handleStyleImageChange_=function(T){this.renderIfReadyAndVisible()},t.prototype.prepareFrame=function(T){var Z=this.getLayer(),e=Z.getSource();if(!e)return!1;var r=T.viewHints[u1.ANIMATING],i=T.viewHints[u1.INTERACTING],o=Z.getUpdateWhileAnimating(),a=Z.getUpdateWhileInteracting();if(this.ready&&!o&&r||!a&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=T.extent,l=T.viewState,h=l.projection,u=l.resolution,c=T.pixelRatio,f=Z.getRevision(),p=Z.getRenderBuffer(),d=Z.getRenderOrder();d===void 0&&(d=VT);var g=l.center.slice(),v=E5(s,p*u),_=v.slice(),y=[v.slice()],m=h.getExtent();if(e.getWrapX()&&h.canWrapX()&&!v2(m,T.extent)){var C=q(m),E=Math.max(q(v)/2,C);v[0]=m[0]-E,v[2]=m[2]+E,u8(g,h);var w=a8(y[0],h);w[0]m[0]&&w[2]>m[2]&&y.push([w[0]-C,w[1],w[2]-C,w[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==f&&this.renderedRenderOrder_==d&&v2(this.wrappedRenderedExtent_,v))return R2(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=g,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var S=new R7(c5(u,c),v,u,c),P;this.getLayer().getDeclutter()&&(P=new R7(c5(u,c),v,u,c));var A=f8(),O;if(A){for(var R=0,D=y.length;R=200&&o.status<300){var s=t.getType(),l=void 0;s=="json"||s=="text"?l=o.responseText:s=="xml"?(l=o.responseXML,l||(l=new DOMParser().parseFromString(o.responseText,"application/xml"))):s=="arraybuffer"&&(l=o.response),l?r(t.readFeatures(l,{extent:T,featureProjection:e}),t.readProjection(l)):i()}else i()},o.onerror=i,o.send()}function N7(n,t){return function(T,Z,e,r,i){var o=this;pZ(n,t,T,Z,e,function(a,s){o.addFeatures(a),r!==void 0&&r(a)},i||w2)}}var $8=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),T2=function(n){$8(t,n);function t(T,Z,e){var r=n.call(this,T)||this;return r.feature=Z,r.features=e,r}return t}(V1),dZ=function(n){$8(t,n);function t(T){var Z=this,e=T||{};Z=n.call(this,{attributions:e.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:e.wrapX!==void 0?e.wrapX:!0})||this,Z.on,Z.once,Z.un,Z.loader_=w2,Z.format_=e.format,Z.overlaps_=e.overlaps===void 0?!0:e.overlaps,Z.url_=e.url,e.loader!==void 0?Z.loader_=e.loader:Z.url_!==void 0&&(X(Z.format_,7),Z.loader_=N7(Z.url_,Z.format_)),Z.strategy_=e.strategy!==void 0?e.strategy:cZ;var r=e.useSpatialIndex!==void 0?e.useSpatialIndex:!0;Z.featuresRtree_=r?new F7:null,Z.loadedExtentsRtree_=new F7,Z.loadingExtentsCount_=0,Z.nullGeometryFeatures_={},Z.idIndex_={},Z.uidIndex_={},Z.featureChangeKeys_={},Z.featuresCollection_=null;var i,o;return Array.isArray(e.features)?o=e.features:e.features&&(i=e.features,o=i.getArray()),!r&&i===void 0&&(i=new m1(o)),o!==void 0&&Z.addFeaturesInternal(o),i!==void 0&&Z.bindFeaturesCollection_(i),Z}return t.prototype.addFeature=function(T){this.addFeatureInternal(T),this.changed()},t.prototype.addFeatureInternal=function(T){var Z=z(T);if(!this.addToIndex_(Z,T)){this.featuresCollection_&&this.featuresCollection_.remove(T);return}this.setupChangeEvents_(Z,T);var e=T.getGeometry();if(e){var r=e.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,T)}else this.nullGeometryFeatures_[Z]=T;this.dispatchEvent(new T2(O1.ADDFEATURE,T))},t.prototype.setupChangeEvents_=function(T,Z){this.featureChangeKeys_[T]=[B(Z,j.CHANGE,this.handleFeatureChange_,this),B(Z,U2.PROPERTYCHANGE,this.handleFeatureChange_,this)]},t.prototype.addToIndex_=function(T,Z){var e=!0,r=Z.getId();return r!==void 0&&(r.toString()in this.idIndex_?e=!1:this.idIndex_[r.toString()]=Z),e&&(X(!(T in this.uidIndex_),30),this.uidIndex_[T]=Z),e},t.prototype.addFeatures=function(T){this.addFeaturesInternal(T),this.changed()},t.prototype.addFeaturesInternal=function(T){for(var Z=[],e=[],r=[],i=0,o=T.length;i0},t.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),n.prototype.refresh.call(this)},t.prototype.removeLoadedExtent=function(T){var Z=this.loadedExtentsRtree_,e;Z.forEachInExtent(T,function(r){if(y0(r.extent,T))return e=r,!0}),e&&Z.remove(e)},t.prototype.removeFeature=function(T){if(!!T){var Z=z(T);Z in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[Z]:this.featuresRtree_&&this.featuresRtree_.remove(T);var e=this.removeFeatureInternal(T);e&&this.changed()}},t.prototype.removeFeatureInternal=function(T){var Z=z(T),e=this.featureChangeKeys_[Z];if(!!e){e.forEach(H),delete this.featureChangeKeys_[Z];var r=T.getId();return r!==void 0&&delete this.idIndex_[r.toString()],delete this.uidIndex_[Z],this.dispatchEvent(new T2(O1.REMOVEFEATURE,T)),T}},t.prototype.removeFromIdIndex_=function(T){var Z=!1;for(var e in this.idIndex_)if(this.idIndex_[e]===T){delete this.idIndex_[e],Z=!0;break}return Z},t.prototype.setLoader=function(T){this.loader_=T},t.prototype.setUrl=function(T){X(this.format_,7),this.url_=T,this.setLoader(N7(T,this.format_))},t}(V8);const c0=dZ,G={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function H8(n){return Math.pow(n,3)}function q2(n){return 1-H8(1-n)}function vZ(n){return 3*n*n-2*n*n*n}function gZ(n){return n}var _Z=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),yZ=function(n){_Z(t,n);function t(T,Z,e){var r=n.call(this)||this,i=e||{};return r.tileCoord=T,r.state=Z,r.interimTile=null,r.key="",r.transition_=i.transition===void 0?250:i.transition,r.transitionStarts_={},r.interpolate=!!i.interpolate,r}return t.prototype.changed=function(){this.dispatchEvent(j.CHANGE)},t.prototype.release=function(){},t.prototype.getKey=function(){return this.key+"/"+this.tileCoord},t.prototype.getInterimTile=function(){if(!this.interimTile)return this;var T=this.interimTile;do{if(T.getState()==G.LOADED)return this.transition_=0,T;T=T.interimTile}while(T);return this},t.prototype.refreshInterimChain=function(){if(!!this.interimTile){var T=this.interimTile,Z=this;do{if(T.getState()==G.LOADED){T.interimTile=null;break}else T.getState()==G.LOADING?Z=T:T.getState()==G.IDLE?Z.interimTile=T.interimTile:Z=T;T=Z.interimTile}while(T)}},t.prototype.getTileCoord=function(){return this.tileCoord},t.prototype.getState=function(){return this.state},t.prototype.setState=function(T){if(this.state!==G.ERROR&&this.state>T)throw new Error("Tile load sequence violation");this.state=T,this.changed()},t.prototype.load=function(){F()},t.prototype.getAlpha=function(T,Z){if(!this.transition_)return 1;var e=this.transitionStarts_[T];if(!e)e=Z,this.transitionStarts_[T]=e;else if(e===-1)return 1;var r=Z-e+1e3/60;return r>=this.transition_?1:H8(r/this.transition_)},t.prototype.inTransition=function(T){return this.transition_?this.transitionStarts_[T]!==-1:!1},t.prototype.endTransition=function(T){this.transition_&&(this.transitionStarts_[T]=-1)},t}($2);const q8=yZ;var mZ=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),EZ=function(n){mZ(t,n);function t(T,Z,e,r,i,o){var a=n.call(this,T,Z,o)||this;return a.crossOrigin_=r,a.src_=e,a.key=e,a.image_=new Image,r!==null&&(a.image_.crossOrigin=r),a.unlisten_=null,a.tileLoadFunction_=i,a}return t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(T){this.image_=T,this.state=G.LOADED,this.unlistenImage_(),this.changed()},t.prototype.handleImageError_=function(){this.state=G.ERROR,this.unlistenImage_(),this.image_=CZ(),this.changed()},t.prototype.handleImageLoad_=function(){var T=this.image_;T.naturalWidth&&T.naturalHeight?this.state=G.LOADED:this.state=G.EMPTY,this.unlistenImage_(),this.changed()},t.prototype.load=function(){this.state==G.ERROR&&(this.state=G.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==G.IDLE&&(this.state=G.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=G5(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},t.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},t}(q8);function CZ(){var n=g1(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}const J8=EZ;var xZ=function(){function n(t,T,Z){this.decay_=t,this.minVelocity_=T,this.delay_=Z,this.points_=[],this.angle_=0,this.initialVelocity_=0}return n.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},n.prototype.update=function(t,T){this.points_.push(t,T,Date.now())},n.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,T=this.points_.length-3;if(this.points_[T+2]0&&this.points_[Z+2]>t;)Z-=3;var e=this.points_[T+2]-this.points_[Z+2];if(e<1e3/60)return!1;var r=this.points_[T]-this.points_[Z],i=this.points_[T+1]-this.points_[Z+1];return this.angle_=Math.atan2(i,r),this.initialVelocity_=Math.sqrt(r*r+i*i)/e,this.initialVelocity_>this.minVelocity_},n.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},n.prototype.getAngle=function(){return this.angle_},n}();const wZ=xZ;var OZ=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),RZ=function(n){OZ(t,n);function t(T){var Z=n.call(this)||this;return Z.map_=T,Z}return t.prototype.dispatchRenderEvent=function(T,Z){F()},t.prototype.calculateMatrices2D=function(T){var Z=T.viewState,e=T.coordinateToPixelTransform,r=T.pixelToCoordinateTransform;K1(e,T.size[0]/2,T.size[1]/2,1/Z.resolution,-1/Z.resolution,-Z.rotation,-Z.center[0],-Z.center[1]),m5(r,e)},t.prototype.forEachFeatureAtCoordinate=function(T,Z,e,r,i,o,a,s){var l,h=Z.viewState;function u(b,I,L,M){return i.call(o,I,b?L:null,M)}var c=h.projection,f=u8(T.slice(),c),p=[[0,0]];if(c.canWrapX()&&r){var d=c.getExtent(),g=q(d);p.push([-g,0],[g,0])}for(var v=Z.layerStatesArray,_=v.length,y=[],m=[],C=0;C=0;--E){var w=v[E],S=w.layer;if(S.hasRenderer()&&p4(w,h)&&a.call(s,S)){var P=S.getRenderer(),A=S.getSource();if(P&&A){var O=A.getWrapX()?f:T,R=u.bind(null,w.managed);m[0]=O[0]+p[C][0],m[1]=O[1]+p[C][1],l=P.forEachFeatureAtCoordinate(m,Z,e,R,y)}if(l)return l}}if(y.length!==0){var D=1/y.length;return y.forEach(function(b,I){return b.distanceSq+=I*D}),y.sort(function(b,I){return b.distanceSq-I.distanceSq}),y.some(function(b){return l=b.callback(b.feature,b.layer,b.geometry)}),l}},t.prototype.forEachLayerAtPixel=function(T,Z,e,r,i){return F()},t.prototype.hasFeatureAtCoordinate=function(T,Z,e,r,i,o){var a=this.forEachFeatureAtCoordinate(T,Z,e,r,W2,this,i,o);return a!==void 0},t.prototype.getMap=function(){return this.map_},t.prototype.renderFrame=function(T){F()},t.prototype.scheduleExpireIconCache=function(T){d4.canExpireCache()&&T.postRenderFunctions.push(SZ)},t}(_5);function SZ(n,t){d4.expire()}const IZ=RZ;var PZ=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),LZ=function(n){PZ(t,n);function t(T){var Z=n.call(this,T)||this;Z.fontChangeListenerKey_=B(X1,U2.PROPERTYCHANGE,T.redrawText.bind(T)),Z.element_=document.createElement("div");var e=Z.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",Z.element_.className=R4+" ol-layers";var r=T.getViewport();return r.insertBefore(Z.element_,r.firstChild||null),Z.children_=[],Z.renderedVisible_=!0,Z}return t.prototype.dispatchRenderEvent=function(T,Z){var e=this.getMap();if(e.hasListener(T)){var r=new B8(T,void 0,Z);e.dispatchEvent(r)}},t.prototype.disposeInternal=function(){H(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),n.prototype.disposeInternal.call(this)},t.prototype.renderFrame=function(T){if(!T){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(T),this.dispatchRenderEvent(a2.PRECOMPOSE,T);var Z=T.layerStatesArray.sort(function(c,f){return c.zIndex-f.zIndex}),e=T.viewState;this.children_.length=0;for(var r=[],i=null,o=0,a=Z.length;o=0;--o)r[o].renderDeclutter(T);C6(this.element_,this.children_),this.dispatchRenderEvent(a2.POSTCOMPOSE,T),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(T)},t.prototype.forEachLayerAtPixel=function(T,Z,e,r,i){for(var o=Z.viewState,a=Z.layerStatesArray,s=a.length,l=s-1;l>=0;--l){var h=a[l],u=h.layer;if(u.hasRenderer()&&p4(h,o)&&i(u)){var c=u.getRenderer(),f=c.getDataAtPixel(T,Z,e);if(f){var p=r(u,f);if(p)return p}}}},t}(IZ);const AZ=LZ;var Q8=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),n2=function(n){Q8(t,n);function t(T,Z){var e=n.call(this,T)||this;return e.layer=Z,e}return t}(V1),W4={LAYERS:"layers"},MZ=function(n){Q8(t,n);function t(T){var Z=this,e=T||{},r=e1({},e);delete r.layers;var i=e.layers;return Z=n.call(this,r)||this,Z.on,Z.once,Z.un,Z.layersListenerKeys_=[],Z.listenerKeys_={},Z.addChangeListener(W4.LAYERS,Z.handleLayersChanged_),i?Array.isArray(i)?i=new m1(i.slice(),{unique:!0}):X(typeof i.getArray=="function",43):i=new m1(void 0,{unique:!0}),Z.setLayers(i),Z}return t.prototype.handleLayerChange_=function(){this.changed()},t.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(H),this.layersListenerKeys_.length=0;var T=this.getLayers();this.layersListenerKeys_.push(B(T,p1.ADD,this.handleLayersAdd_,this),B(T,p1.REMOVE,this.handleLayersRemove_,this));for(var Z in this.listenerKeys_)this.listenerKeys_[Z].forEach(H);P0(this.listenerKeys_);for(var e=T.getArray(),r=0,i=e.length;rthis.moveTolerance_||Math.abs(T.clientY-this.down_.clientY)>this.moveTolerance_},t.prototype.disposeInternal=function(){this.relayedListenerKey_&&(H(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(j.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(H(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(H),this.dragListenerKeys_.length=0,this.element_=null,n.prototype.disposeInternal.call(this)},t}($2);const kZ=jZ,Y1={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},l1={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var v4=1/0,XZ=function(){function n(t,T){this.priorityFunction_=t,this.keyFunction_=T,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return n.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,P0(this.queuedElements_)},n.prototype.dequeue=function(){var t=this.elements_,T=this.priorities_,Z=t[0];t.length==1?(t.length=0,T.length=0):(t[0]=t.pop(),T[0]=T.pop(),this.siftUp_(0));var e=this.keyFunction_(Z);return delete this.queuedElements_[e],Z},n.prototype.enqueue=function(t){X(!(this.keyFunction_(t)in this.queuedElements_),31);var T=this.priorityFunction_(t);return T!=v4?(this.elements_.push(t),this.priorities_.push(T),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},n.prototype.getCount=function(){return this.elements_.length},n.prototype.getLeftChildIndex_=function(t){return t*2+1},n.prototype.getRightChildIndex_=function(t){return t*2+2},n.prototype.getParentIndex_=function(t){return t-1>>1},n.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},n.prototype.isEmpty=function(){return this.elements_.length===0},n.prototype.isKeyQueued=function(t){return t in this.queuedElements_},n.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},n.prototype.siftUp_=function(t){for(var T=this.elements_,Z=this.priorities_,e=T.length,r=T[t],i=Z[t],o=t;t>1;){var a=this.getLeftChildIndex_(t),s=this.getRightChildIndex_(t),l=st;){var o=this.getParentIndex_(T);if(e[o]>i)Z[T]=Z[o],e[T]=e[o],T=o;else break}Z[T]=r,e[T]=i},n.prototype.reprioritize=function(){var t=this.priorityFunction_,T=this.elements_,Z=this.priorities_,e=0,r=T.length,i,o,a;for(o=0;o0;)i=this.dequeue()[0],o=i.getKey(),r=i.getState(),r===G.IDLE&&!(o in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++e,i.load())},t}(YZ);const zZ=BZ;function UZ(n,t,T,Z,e){if(!n||!(T in n.wantedTiles)||!n.wantedTiles[T][t.getKey()])return v4;var r=n.viewState.center,i=Z[0]-r[0],o=Z[1]-r[1];return 65536*Math.log(e)+Math.sqrt(i*i+o*o)/e}const R1={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var KZ=42,b5=256;function G7(n,t,T){return function(Z,e,r,i,o){if(!!Z){if(!e&&!t)return Z;var a=t?0:r[0]*e,s=t?0:r[1]*e,l=o?o[0]:0,h=o?o[1]:0,u=n[0]+a/2+l,c=n[2]-a/2+l,f=n[1]+s/2+h,p=n[3]-s/2+h;u>c&&(u=(c+u)/2,c=u),f>p&&(f=(p+f)/2,p=f);var d=n1(Z[0],u,c),g=n1(Z[1],f,p);if(i&&T&&e){var v=30*e;d+=-v*Math.log(1+Math.max(0,u-Z[0])/v)+v*Math.log(1+Math.max(0,Z[0]-c)/v),g+=-v*Math.log(1+Math.max(0,f-Z[1])/v)+v*Math.log(1+Math.max(0,Z[1]-p)/v)}return[d,g]}}}function VZ(n){return n}function j5(n,t,T,Z){var e=q(t)/T[0],r=x1(t)/T[1];return Z?Math.min(n,Math.max(e,r)):Math.min(n,Math.min(e,r))}function k5(n,t,T){var Z=Math.min(n,t),e=50;return Z*=Math.log(1+e*Math.max(0,n/t-1))/e+1,T&&(Z=Math.max(Z,T),Z/=Math.log(1+e*Math.max(0,T/n-1))/e+1),n1(Z,T/2,t*2)}function $Z(n,t,T,Z){return function(e,r,i,o){if(e!==void 0){var a=n[0],s=n[n.length-1],l=T?j5(a,T,i,Z):a;if(o){var h=t!==void 0?t:!0;return h?k5(e,l,s):n1(e,s,l)}var u=Math.min(l,e),c=Math.floor(y5(n,u,r));return n[c]>l&&c1&&typeof arguments[Z-1]=="function"&&(e=arguments[Z-1],--Z);for(var r=0;r0},t.prototype.getInteracting=function(){return this.hints_[u1.INTERACTING]>0},t.prototype.cancelAnimations=function(){this.setHint(u1.ANIMATING,-this.hints_[u1.ANIMATING]);for(var T,Z=0,e=this.animations_.length;Z=0;--e){for(var r=this.animations_[e],i=!0,o=0,a=r.length;o0?l/s.duration:1;h>=1?(s.complete=!0,h=1):i=!1;var u=s.easing(h);if(s.sourceCenter){var c=s.sourceCenter[0],f=s.sourceCenter[1],p=s.targetCenter[0],d=s.targetCenter[1];this.nextCenter_=s.targetCenter;var g=c+u*(p-c),v=f+u*(d-f);this.targetCenter_=[g,v]}if(s.sourceResolution&&s.targetResolution){var _=u===1?s.targetResolution:s.sourceResolution+u*(s.targetResolution-s.sourceResolution);if(s.anchor){var y=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(_,0,y,!0);this.targetCenter_=this.calculateCenterZoom(m,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=_,this.applyTargetState_(!0)}if(s.sourceRotation!==void 0&&s.targetRotation!==void 0){var C=u===1?B2(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+u*(s.targetRotation-s.sourceRotation);if(s.anchor){var E=this.constraints_.rotation(C,!0);this.targetCenter_=this.calculateCenterRotate(E,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=C}if(this.applyTargetState_(!0),Z=!0,!s.complete)break}}if(i){this.animations_[e]=null,this.setHint(u1.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var w=r[0].callback;w&&T4(w,!0)}}this.animations_=this.animations_.filter(Boolean),Z&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},t.prototype.calculateCenterRotate=function(T,Z){var e,r=this.getCenterInternal();return r!==void 0&&(e=[r[0]-Z[0],r[1]-Z[1]],w5(e,T-this.getRotation()),C9(e,Z)),e},t.prototype.calculateCenterZoom=function(T,Z){var e,r=this.getCenterInternal(),i=this.getResolution();if(r!==void 0&&i!==void 0){var o=Z[0]-T*(Z[0]-r[0])/i,a=Z[1]-T*(Z[1]-r[1])/i;e=[o,a]}return e},t.prototype.getViewportSize_=function(T){var Z=this.viewportSize_;if(T){var e=Z[0],r=Z[1];return[Math.abs(e*Math.cos(T))+Math.abs(r*Math.sin(T)),Math.abs(e*Math.sin(T))+Math.abs(r*Math.cos(T))]}else return Z},t.prototype.setViewportSize=function(T){this.viewportSize_=Array.isArray(T)?T.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},t.prototype.getCenter=function(){var T=this.getCenterInternal();return T&&n5(T,this.getProjection())},t.prototype.getCenterInternal=function(){return this.get(R1.CENTER)},t.prototype.getConstraints=function(){return this.constraints_},t.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},t.prototype.getHints=function(T){return T!==void 0?(T[0]=this.hints_[0],T[1]=this.hints_[1],T):this.hints_.slice()},t.prototype.calculateExtent=function(T){var Z=this.calculateExtentInternal(T);return r5(Z,this.getProjection())},t.prototype.calculateExtentInternal=function(T){var Z=T||this.getViewportSizeMinusPadding_(),e=this.getCenterInternal();X(e,1);var r=this.getResolution();X(r!==void 0,2);var i=this.getRotation();return X(i!==void 0,3),T5(e,r,i,Z)},t.prototype.getMaxResolution=function(){return this.maxResolution_},t.prototype.getMinResolution=function(){return this.minResolution_},t.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},t.prototype.setMaxZoom=function(T){this.applyOptions_(this.getUpdatedOptions_({maxZoom:T}))},t.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},t.prototype.setMinZoom=function(T){this.applyOptions_(this.getUpdatedOptions_({minZoom:T}))},t.prototype.setConstrainResolution=function(T){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:T}))},t.prototype.getProjection=function(){return this.projection_},t.prototype.getResolution=function(){return this.get(R1.RESOLUTION)},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getResolutionForExtent=function(T,Z){return this.getResolutionForExtentInternal(g2(T,this.getProjection()),Z)},t.prototype.getResolutionForExtentInternal=function(T,Z){var e=Z||this.getViewportSizeMinusPadding_(),r=q(T)/e[0],i=x1(T)/e[1];return Math.max(r,i)},t.prototype.getResolutionForValueFunction=function(T){var Z=T||2,e=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(e/r)/Math.log(Z);return function(o){var a=e/Math.pow(Z,o*i);return a}},t.prototype.getRotation=function(){return this.get(R1.ROTATION)},t.prototype.getValueForResolutionFunction=function(T){var Z=Math.log(T||2),e=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(e/r)/Z;return function(o){var a=Math.log(e/o)/Z/i;return a}},t.prototype.getViewportSizeMinusPadding_=function(T){var Z=this.getViewportSize_(T),e=this.padding_;return e&&(Z=[Z[0]-e[1]-e[3],Z[1]-e[0]-e[2]]),Z},t.prototype.getState=function(){var T=this.getProjection(),Z=this.getResolution(),e=this.getRotation(),r=this.getCenterInternal(),i=this.padding_;if(i){var o=this.getViewportSizeMinusPadding_();r=z4(r,this.getViewportSize_(),[o[0]/2+i[3],o[1]/2+i[0]],Z,e)}return{center:r.slice(0),projection:T!==void 0?T:null,resolution:Z,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:e,zoom:this.getZoom()}},t.prototype.getZoom=function(){var T,Z=this.getResolution();return Z!==void 0&&(T=this.getZoomForResolution(Z)),T},t.prototype.getZoomForResolution=function(T){var Z=this.minZoom_||0,e,r;if(this.resolutions_){var i=y5(this.resolutions_,T,1);Z=i,e=this.resolutions_[i],i==this.resolutions_.length-1?r=2:r=e/this.resolutions_[i+1]}else e=this.maxResolution_,r=this.zoomFactor_;return Z+Math.log(e/T)/Math.log(r)},t.prototype.getResolutionForZoom=function(T){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var Z=n1(Math.floor(T),0,this.resolutions_.length-2),e=this.resolutions_[Z]/this.resolutions_[Z+1];return this.resolutions_[Z]/Math.pow(e,n1(T-Z,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,T-this.minZoom_)},t.prototype.fit=function(T,Z){var e;if(X(Array.isArray(T)||typeof T.getSimplifiedGeometry=="function",24),Array.isArray(T)){X(!x5(T),25);var r=g2(T,this.getProjection());e=p7(r)}else if(T.getType()==="Circle"){var r=g2(T.getExtent(),this.getProjection());e=p7(r),e.rotate(this.getRotation(),O2(r))}else{var i=f8();i?e=T.clone().transform(i,this.getProjection()):e=T}this.fitInternal(e,Z)},t.prototype.rotatedExtentForGeometry=function(T){for(var Z=this.getRotation(),e=Math.cos(Z),r=Math.sin(-Z),i=T.getFlatCoordinates(),o=T.getStride(),a=1/0,s=1/0,l=-1/0,h=-1/0,u=0,c=i.length;u=0;s--){var l=a[s];if(!(l.getMap()!==this||!l.getActive()||!this.getTargetElement())){var h=l.handleEvent(T);if(!h||T.propagationStopped)break}}}},t.prototype.handlePostRender=function(){var T=this.frameState_,Z=this.tileQueue_;if(!Z.isEmpty()){var e=this.maxTilesLoading_,r=e;if(T){var i=T.viewHints;if(i[u1.ANIMATING]||i[u1.INTERACTING]){var o=Date.now()-T.time>8;e=o?0:8,r=o?0:2}}Z.getTilesLoading()0;if(this.renderedVisible_!=e&&(this.element.style.display=e?"":"none",this.renderedVisible_=e),!R2(Z,this.renderedAttributions_)){F8(this.ulElement_);for(var r=0,i=Z.length;r0&&e%(2*Math.PI)!==0?Z.animate({rotation:0,duration:this.duration_,easing:q2}):Z.setRotation(0))}},t.prototype.render=function(T){var Z=T.frameState;if(!!Z){var e=Z.viewState.rotation;if(e!=this.rotation_){var r="rotate("+e+"rad)";if(this.autoHide_){var i=this.element.classList.contains(H0);!i&&e===0?this.element.classList.add(H0):i&&e!==0&&this.element.classList.remove(H0)}this.label_.style.transform=r}this.rotation_=e}},t}(Y5);const dt=pt;var vt=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),gt=function(n){vt(t,n);function t(T){var Z=this,e=T||{};Z=n.call(this,{element:document.createElement("div"),target:e.target})||this;var r=e.className!==void 0?e.className:"ol-zoom",i=e.delta!==void 0?e.delta:1,o=e.zoomInClassName!==void 0?e.zoomInClassName:r+"-in",a=e.zoomOutClassName!==void 0?e.zoomOutClassName:r+"-out",s=e.zoomInLabel!==void 0?e.zoomInLabel:"+",l=e.zoomOutLabel!==void 0?e.zoomOutLabel:"\u2013",h=e.zoomInTipLabel!==void 0?e.zoomInTipLabel:"Zoom in",u=e.zoomOutTipLabel!==void 0?e.zoomOutTipLabel:"Zoom out",c=document.createElement("button");c.className=o,c.setAttribute("type","button"),c.title=h,c.appendChild(typeof s=="string"?document.createTextNode(s):s),c.addEventListener(j.CLICK,Z.handleClick_.bind(Z,i),!1);var f=document.createElement("button");f.className=a,f.setAttribute("type","button"),f.title=u,f.appendChild(typeof l=="string"?document.createTextNode(l):l),f.addEventListener(j.CLICK,Z.handleClick_.bind(Z,-i),!1);var p=r+" "+R4+" "+N5,d=Z.element;return d.className=p,d.appendChild(c),d.appendChild(f),Z.duration_=e.duration!==void 0?e.duration:250,Z}return t.prototype.handleClick_=function(T,Z){Z.preventDefault(),this.zoomByDelta_(T)},t.prototype.zoomByDelta_=function(T){var Z=this.getMap(),e=Z.getView();if(!!e){var r=e.getZoom();if(r!==void 0){var i=e.getConstrainedZoom(r+T);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:i,duration:this.duration_,easing:q2})):e.setZoom(i)}}},t}(Y5);const _t=gt;var yt=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),s1={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"},mt=function(n){yt(t,n);function t(T){var Z=n.call(this)||this;Z.on,Z.once,Z.un,Z.options=T,Z.id=T.id,Z.insertFirst=T.insertFirst!==void 0?T.insertFirst:!0,Z.stopEvent=T.stopEvent!==void 0?T.stopEvent:!0,Z.element=document.createElement("div"),Z.element.className=T.className!==void 0?T.className:"ol-overlay-container "+x6,Z.element.style.position="absolute",Z.element.style.pointerEvents="auto";var e=T.autoPan;return e&&typeof e!="object"&&(e={animation:T.autoPanAnimation,margin:T.autoPanMargin}),Z.autoPan=e||!1,Z.rendered={transform_:"",visible:!0},Z.mapPostrenderListenerKey=null,Z.addChangeListener(s1.ELEMENT,Z.handleElementChanged),Z.addChangeListener(s1.MAP,Z.handleMapChanged),Z.addChangeListener(s1.OFFSET,Z.handleOffsetChanged),Z.addChangeListener(s1.POSITION,Z.handlePositionChanged),Z.addChangeListener(s1.POSITIONING,Z.handlePositioningChanged),T.element!==void 0&&Z.setElement(T.element),Z.setOffset(T.offset!==void 0?T.offset:[0,0]),Z.setPositioning(T.positioning||"top-left"),T.position!==void 0&&Z.setPosition(T.position),Z}return t.prototype.getElement=function(){return this.get(s1.ELEMENT)},t.prototype.getId=function(){return this.id},t.prototype.getMap=function(){return this.get(s1.MAP)||null},t.prototype.getOffset=function(){return this.get(s1.OFFSET)},t.prototype.getPosition=function(){return this.get(s1.POSITION)},t.prototype.getPositioning=function(){return this.get(s1.POSITIONING)},t.prototype.handleElementChanged=function(){F8(this.element);var T=this.getElement();T&&this.element.appendChild(T)},t.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(u4(this.element),H(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var T=this.getMap();if(T){this.mapPostrenderListenerKey=B(T,Y1.POSTRENDER,this.render,this),this.updatePixelPosition();var Z=this.stopEvent?T.getOverlayContainerStopEvent():T.getOverlayContainer();this.insertFirst?Z.insertBefore(this.element,Z.childNodes[0]||null):Z.appendChild(this.element),this.performAutoPan()}},t.prototype.render=function(){this.updatePixelPosition()},t.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},t.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},t.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},t.prototype.setElement=function(T){this.set(s1.ELEMENT,T)},t.prototype.setMap=function(T){this.set(s1.MAP,T)},t.prototype.setOffset=function(T){this.set(s1.OFFSET,T)},t.prototype.setPosition=function(T){this.set(s1.POSITION,T)},t.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},t.prototype.panIntoView=function(T){var Z=this.getMap();if(!(!Z||!Z.getTargetElement()||!this.get(s1.POSITION))){var e=this.getRect(Z.getTargetElement(),Z.getSize()),r=this.getElement(),i=this.getRect(r,[m6(r),E6(r)]),o=T||{},a=o.margin===void 0?20:o.margin;if(!v2(e,i)){var s=i[0]-e[0],l=e[2]-i[2],h=i[1]-e[1],u=e[3]-i[3],c=[0,0];if(s<0?c[0]=s-a:l<0&&(c[0]=Math.abs(l)+a),h<0?c[1]=h-a:u<0&&(c[1]=Math.abs(u)+a),c[0]!==0||c[1]!==0){var f=Z.getView().getCenterInternal(),p=Z.getPixelFromCoordinateInternal(f);if(!p)return;var d=[p[0]+c[0],p[1]+c[1]],g=o.animation||{};Z.getView().animateInternal({center:Z.getCoordinateFromPixelInternal(d),duration:g.duration,easing:g.easing})}}}},t.prototype.getRect=function(T,Z){var e=T.getBoundingClientRect(),r=e.left+window.pageXOffset,i=e.top+window.pageYOffset;return[r,i,r+Z[0],i+Z[1]]},t.prototype.setPositioning=function(T){this.set(s1.POSITIONING,T)},t.prototype.setVisible=function(T){this.rendered.visible!==T&&(this.element.style.display=T?"":"none",this.rendered.visible=T)},t.prototype.updatePixelPosition=function(){var T=this.getMap(),Z=this.getPosition();if(!T||!T.isRendered()||!Z){this.setVisible(!1);return}var e=T.getPixelFromCoordinate(Z),r=T.getSize();this.updateRenderedPosition(e,r)},t.prototype.updateRenderedPosition=function(T,Z){var e=this.element.style,r=this.getOffset(),i=this.getPositioning();this.setVisible(!0);var o=Math.round(T[0]+r[0])+"px",a=Math.round(T[1]+r[1])+"px",s="0%",l="0%";i=="bottom-right"||i=="center-right"||i=="top-right"?s="-100%":(i=="bottom-center"||i=="center-center"||i=="top-center")&&(s="-50%"),i=="bottom-left"||i=="bottom-center"||i=="bottom-right"?l="-100%":(i=="center-left"||i=="center-center"||i=="center-right")&&(l="-50%");var h="translate(".concat(s,", ").concat(l,") translate(").concat(o,", ").concat(a,")");this.rendered.transform_!=h&&(this.rendered.transform_=h,e.transform=h,e.msTransform=h)},t.prototype.getOptions=function(){return this.options},t}(I1);const k7=mt;function Et(n){var t=n||{},T=new m1,Z=t.zoom!==void 0?t.zoom:!0;Z&&T.push(new _t(t.zoomOptions));var e=t.rotate!==void 0?t.rotate:!0;e&&T.push(new dt(t.rotateOptions));var r=t.attribution!==void 0?t.attribution:!0;return r&&T.push(new ct(t.attributionOptions)),T}const X7={ACTIVE:"active"};var Ct=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),xt=function(n){Ct(t,n);function t(T){var Z=n.call(this)||this;return Z.on,Z.once,Z.un,T&&T.handleEvent&&(Z.handleEvent=T.handleEvent),Z.map_=null,Z.setActive(!0),Z}return t.prototype.getActive=function(){return this.get(X7.ACTIVE)},t.prototype.getMap=function(){return this.map_},t.prototype.handleEvent=function(T){return!0},t.prototype.setActive=function(T){this.set(X7.ACTIVE,T)},t.prototype.setMap=function(T){this.map_=T},t}(I1);function wt(n,t,T){var Z=n.getCenterInternal();if(Z){var e=[Z[0]+t[0],Z[1]+t[1]];n.animateInternal({duration:T!==void 0?T:250,easing:gZ,center:n.getConstrainedCenter(e)})}}function W5(n,t,T,Z){var e=n.getZoom();if(e!==void 0){var r=n.getConstrainedZoom(e+t),i=n.getResolutionForZoom(r);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:i,anchor:T,duration:Z!==void 0?Z:250,easing:q2})}}const N0=xt;var Ot=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),Rt=function(n){Ot(t,n);function t(T){var Z=n.call(this)||this,e=T||{};return Z.delta_=e.delta?e.delta:1,Z.duration_=e.duration!==void 0?e.duration:250,Z}return t.prototype.handleEvent=function(T){var Z=!1;if(T.type==J.DBLCLICK){var e=T.originalEvent,r=T.map,i=T.coordinate,o=e.shiftKey?-this.delta_:this.delta_,a=r.getView();W5(a,o,i,this.duration_),e.preventDefault(),Z=!0}return!Z},t}(N0);const St=Rt;var It=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),Pt=function(n){It(t,n);function t(T){var Z=this,e=T||{};return Z=n.call(this,e)||this,e.handleDownEvent&&(Z.handleDownEvent=e.handleDownEvent),e.handleDragEvent&&(Z.handleDragEvent=e.handleDragEvent),e.handleMoveEvent&&(Z.handleMoveEvent=e.handleMoveEvent),e.handleUpEvent&&(Z.handleUpEvent=e.handleUpEvent),e.stopDown&&(Z.stopDown=e.stopDown),Z.handlingDownUpSequence=!1,Z.targetPointers=[],Z}return t.prototype.getPointerCount=function(){return this.targetPointers.length},t.prototype.handleDownEvent=function(T){return!1},t.prototype.handleDragEvent=function(T){},t.prototype.handleEvent=function(T){if(!T.originalEvent)return!0;var Z=!1;if(this.updateTrackedPointers_(T),this.handlingDownUpSequence){if(T.type==J.POINTERDRAG)this.handleDragEvent(T),T.originalEvent.preventDefault();else if(T.type==J.POINTERUP){var e=this.handleUpEvent(T);this.handlingDownUpSequence=e&&this.targetPointers.length>0}}else if(T.type==J.POINTERDOWN){var r=this.handleDownEvent(T);this.handlingDownUpSequence=r,Z=this.stopDown(r)}else T.type==J.POINTERMOVE&&this.handleMoveEvent(T);return!Z},t.prototype.handleMoveEvent=function(T){},t.prototype.handleUpEvent=function(T){return!1},t.prototype.stopDown=function(T){return T},t.prototype.updateTrackedPointers_=function(T){T.activePointers&&(this.targetPointers=T.activePointers)},t}(N0);function B5(n){for(var t=n.length,T=0,Z=0,e=0;e0&&this.condition_(T)){var Z=T.map,e=Z.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},t}(G0);const bt=Gt;var jt=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),kt=function(n){jt(t,n);function t(T){var Z=this,e=T||{};return Z=n.call(this,{stopDown:g4})||this,Z.condition_=e.condition?e.condition:Lt,Z.lastAngle_=void 0,Z.duration_=e.duration!==void 0?e.duration:250,Z}return t.prototype.handleDragEvent=function(T){if(!!U4(T)){var Z=T.map,e=Z.getView();if(e.getConstraints().rotation!==X5){var r=Z.getSize(),i=T.pixel,o=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(this.lastAngle_!==void 0){var a=o-this.lastAngle_;e.adjustRotationInternal(-a)}this.lastAngle_=o}}},t.prototype.handleUpEvent=function(T){if(!U4(T))return!0;var Z=T.map,e=Z.getView();return e.endInteraction(this.duration_),!1},t.prototype.handleDownEvent=function(T){if(!U4(T))return!1;if(e3(T)&&this.condition_(T)){var Z=T.map;return Z.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},t}(G0);const Xt=kt;var Yt=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),Wt=function(n){Yt(t,n);function t(T){var Z=n.call(this)||this;return Z.geometry_=null,Z.element_=document.createElement("div"),Z.element_.style.position="absolute",Z.element_.style.pointerEvents="auto",Z.element_.className="ol-box "+T,Z.map_=null,Z.startPixel_=null,Z.endPixel_=null,Z}return t.prototype.disposeInternal=function(){this.setMap(null)},t.prototype.render_=function(){var T=this.startPixel_,Z=this.endPixel_,e="px",r=this.element_.style;r.left=Math.min(T[0],Z[0])+e,r.top=Math.min(T[1],Z[1])+e,r.width=Math.abs(Z[0]-T[0])+e,r.height=Math.abs(Z[1]-T[1])+e},t.prototype.setMap=function(T){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var Z=this.element_.style;Z.left="inherit",Z.top="inherit",Z.width="inherit",Z.height="inherit"}this.map_=T,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},t.prototype.setPixels=function(T,Z){this.startPixel_=T,this.endPixel_=Z,this.createOrUpdateGeometry(),this.render_()},t.prototype.createOrUpdateGeometry=function(){var T=this.startPixel_,Z=this.endPixel_,e=[T,[T[0],Z[1]],Z,[Z[0],T[1]]],r=e.map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new s4([r])},t.prototype.getGeometry=function(){return this.geometry_},t}(_5);const Bt=Wt;var i3=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),Z4={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},K4=function(n){i3(t,n);function t(T,Z,e){var r=n.call(this,T)||this;return r.coordinate=Z,r.mapBrowserEvent=e,r}return t}(V1),zt=function(n){i3(t,n);function t(T){var Z=n.call(this)||this;Z.on,Z.once,Z.un;var e=T||{};return Z.box_=new Bt(e.className||"ol-dragbox"),Z.minArea_=e.minArea!==void 0?e.minArea:64,e.onBoxEnd&&(Z.onBoxEnd=e.onBoxEnd),Z.startPixel_=null,Z.condition_=e.condition?e.condition:e3,Z.boxEndCondition_=e.boxEndCondition?e.boxEndCondition:Z.defaultBoxEndCondition,Z}return t.prototype.defaultBoxEndCondition=function(T,Z,e){var r=e[0]-Z[0],i=e[1]-Z[1];return r*r+i*i>=this.minArea_},t.prototype.getGeometry=function(){return this.box_.getGeometry()},t.prototype.handleDragEvent=function(T){this.box_.setPixels(this.startPixel_,T.pixel),this.dispatchEvent(new K4(Z4.BOXDRAG,T.coordinate,T))},t.prototype.handleUpEvent=function(T){this.box_.setMap(null);var Z=this.boxEndCondition_(T,this.startPixel_,T.pixel);return Z&&this.onBoxEnd(T),this.dispatchEvent(new K4(Z?Z4.BOXEND:Z4.BOXCANCEL,T.coordinate,T)),!1},t.prototype.handleDownEvent=function(T){return this.condition_(T)?(this.startPixel_=T.pixel,this.box_.setMap(T.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new K4(Z4.BOXSTART,T.coordinate,T)),!0):!1},t.prototype.onBoxEnd=function(T){},t}(G0);const Ut=zt;var Kt=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),Vt=function(n){Kt(t,n);function t(T){var Z=this,e=T||{},r=e.condition?e.condition:Ft;return Z=n.call(this,{condition:r,className:e.className||"ol-dragzoom",minArea:e.minArea})||this,Z.duration_=e.duration!==void 0?e.duration:200,Z.out_=e.out!==void 0?e.out:!1,Z}return t.prototype.onBoxEnd=function(T){var Z=this.getMap(),e=Z.getView(),r=this.getGeometry();if(this.out_){var i=e.rotatedExtentForGeometry(r),o=e.getResolutionForExtentInternal(i),a=e.getResolution()/o;r=r.clone(),r.scale(a*a)}e.fitInternal(r,{duration:this.duration_,easing:q2})},t}(Ut);const $t=Vt,f2={LEFT:37,UP:38,RIGHT:39,DOWN:40};var Ht=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),qt=function(n){Ht(t,n);function t(T){var Z=n.call(this)||this,e=T||{};return Z.defaultCondition_=function(r){return n3(r)&&r3(r)},Z.condition_=e.condition!==void 0?e.condition:Z.defaultCondition_,Z.duration_=e.duration!==void 0?e.duration:100,Z.pixelDelta_=e.pixelDelta!==void 0?e.pixelDelta:128,Z}return t.prototype.handleEvent=function(T){var Z=!1;if(T.type==j.KEYDOWN){var e=T.originalEvent,r=e.keyCode;if(this.condition_(T)&&(r==f2.DOWN||r==f2.LEFT||r==f2.RIGHT||r==f2.UP)){var i=T.map,o=i.getView(),a=o.getResolution()*this.pixelDelta_,s=0,l=0;r==f2.DOWN?l=-a:r==f2.LEFT?s=-a:r==f2.RIGHT?s=a:l=a;var h=[s,l];w5(h,o.getRotation()),wt(o,h,this.duration_),e.preventDefault(),Z=!0}}return!Z},t}(N0);const Jt=qt;var Qt=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),Te=function(n){Qt(t,n);function t(T){var Z=n.call(this)||this,e=T||{};return Z.condition_=e.condition?e.condition:r3,Z.delta_=e.delta?e.delta:1,Z.duration_=e.duration!==void 0?e.duration:100,Z}return t.prototype.handleEvent=function(T){var Z=!1;if(T.type==j.KEYDOWN||T.type==j.KEYPRESS){var e=T.originalEvent,r=e.charCode;if(this.condition_(T)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var i=T.map,o=r=="+".charCodeAt(0)?this.delta_:-this.delta_,a=i.getView();W5(a,o,void 0,this.duration_),e.preventDefault(),Z=!0}}return!Z},t}(N0);const Ze=Te;var te=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),V4={TRACKPAD:"trackpad",WHEEL:"wheel"},ee=function(n){te(t,n);function t(T){var Z=this,e=T||{};Z=n.call(this,e)||this,Z.totalDelta_=0,Z.lastDelta_=0,Z.maxDelta_=e.maxDelta!==void 0?e.maxDelta:1,Z.duration_=e.duration!==void 0?e.duration:250,Z.timeout_=e.timeout!==void 0?e.timeout:80,Z.useAnchor_=e.useAnchor!==void 0?e.useAnchor:!0,Z.constrainResolution_=e.constrainResolution!==void 0?e.constrainResolution:!1;var r=e.condition?e.condition:Mt;return Z.condition_=e.onFocusOnly?p5(t3,r):r,Z.lastAnchor_=null,Z.startTime_=void 0,Z.timeoutId_,Z.mode_=void 0,Z.trackpadEventGap_=400,Z.trackpadTimeoutId_,Z.deltaPerZoom_=300,Z}return t.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var T=this.getMap();if(!!T){var Z=T.getView();Z.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}},t.prototype.handleEvent=function(T){if(!this.condition_(T))return!0;var Z=T.type;if(Z!==j.WHEEL)return!0;var e=T.map,r=T.originalEvent;r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=T.coordinate);var i;if(T.type==j.WHEEL&&(i=r.deltaY,B3&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(i/=T8),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(i*=40)),i===0)return!1;this.lastDelta_=i;var o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(i)<4?V4.TRACKPAD:V4.WHEEL);var a=e.getView();if(this.mode_===V4.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(-i/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=i;var s=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,e),s),!1},t.prototype.handleWheelZoom_=function(T){var Z=T.getView();Z.getAnimating()&&Z.cancelAnimations();var e=-n1(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(Z.getConstrainResolution()||this.constrainResolution_)&&(e=e?e>0?1:-1:0),W5(Z,e,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},t.prototype.setMouseAnchor=function(T){this.useAnchor_=T,T||(this.lastAnchor_=null)},t}(N0);const ne=ee;var re=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),ie=function(n){re(t,n);function t(T){var Z=this,e=T||{},r=e;return r.stopDown||(r.stopDown=g4),Z=n.call(this,r)||this,Z.anchor_=null,Z.lastAngle_=void 0,Z.rotating_=!1,Z.rotationDelta_=0,Z.threshold_=e.threshold!==void 0?e.threshold:.3,Z.duration_=e.duration!==void 0?e.duration:250,Z}return t.prototype.handleDragEvent=function(T){var Z=0,e=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-e.clientY,r.clientX-e.clientX);if(this.lastAngle_!==void 0){var o=i-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),Z=o}this.lastAngle_=i;var a=T.map,s=a.getView();if(s.getConstraints().rotation!==X5){var l=a.getViewport().getBoundingClientRect(),h=B5(this.targetPointers);h[0]-=l.left,h[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(h),this.rotating_&&(a.render(),s.adjustRotationInternal(Z,this.anchor_))}},t.prototype.handleUpEvent=function(T){if(this.targetPointers.length<2){var Z=T.map,e=Z.getView();return e.endInteraction(this.duration_),!1}else return!0},t.prototype.handleDownEvent=function(T){if(this.targetPointers.length>=2){var Z=T.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||Z.getView().beginInteraction(),!0}else return!1},t}(G0);const oe=ie;var ae=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),se=function(n){ae(t,n);function t(T){var Z=this,e=T||{},r=e;return r.stopDown||(r.stopDown=g4),Z=n.call(this,r)||this,Z.anchor_=null,Z.duration_=e.duration!==void 0?e.duration:400,Z.lastDistance_=void 0,Z.lastScaleDelta_=1,Z}return t.prototype.handleDragEvent=function(T){var Z=1,e=this.targetPointers[0],r=this.targetPointers[1],i=e.clientX-r.clientX,o=e.clientY-r.clientY,a=Math.sqrt(i*i+o*o);this.lastDistance_!==void 0&&(Z=this.lastDistance_/a),this.lastDistance_=a;var s=T.map,l=s.getView();Z!=1&&(this.lastScaleDelta_=Z);var h=s.getViewport().getBoundingClientRect(),u=B5(this.targetPointers);u[0]-=h.left,u[1]-=h.top,this.anchor_=s.getCoordinateFromPixelInternal(u),s.render(),l.adjustResolutionInternal(Z,this.anchor_)},t.prototype.handleUpEvent=function(T){if(this.targetPointers.length<2){var Z=T.map,e=Z.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),!1}else return!0},t.prototype.handleDownEvent=function(T){if(this.targetPointers.length>=2){var Z=T.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||Z.getView().beginInteraction(),!0}else return!1},t}(G0);const le=se;var ue=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),he=function(n){ue(t,n);function t(T,Z,e){var r=n.call(this)||this;if(r.ends_=[],r.maxDelta_=-1,r.maxDeltaRevision_=-1,Array.isArray(T[0]))r.setCoordinates(T,Z);else if(Z!==void 0&&e)r.setFlatCoordinates(Z,T),r.ends_=e;else{for(var i=r.getLayout(),o=T,a=[],s=[],l=0,h=o.length;l0&&this.getCount()>this.highWaterMark},n.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},n.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},n.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},n.prototype.forEach=function(t){for(var T=this.oldest_;T;)t(T.value_,T.key_,this),T=T.newer},n.prototype.get=function(t,T){var Z=this.entries_[t];return X(Z!==void 0,15),Z===this.newest_||(Z===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(Z.newer.older=Z.older,Z.older.newer=Z.newer),Z.newer=null,Z.older=this.newest_,this.newest_.newer=Z,this.newest_=Z),Z.value_},n.prototype.remove=function(t){var T=this.entries_[t];return X(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_[t],--this.count_,T.value_},n.prototype.getCount=function(){return this.count_},n.prototype.getKeys=function(){var t=new Array(this.count_),T=0,Z;for(Z=this.newest_;Z;Z=Z.older)t[T++]=Z.key_;return t},n.prototype.getValues=function(){var t=new Array(this.count_),T=0,Z;for(Z=this.newest_;Z;Z=Z.older)t[T++]=Z.value_;return t},n.prototype.peekLast=function(){return this.oldest_.value_},n.prototype.peekLastKey=function(){return this.oldest_.key_},n.prototype.peekFirstKey=function(){return this.newest_.key_},n.prototype.peek=function(t){if(!!this.containsKey(t))return this.entries_[t].value_},n.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},n.prototype.replace=function(t,T){this.get(t),this.entries_[t].value_=T},n.prototype.set=function(t,T){X(!(t in this.entries_),16);var Z={key_:t,newer:null,older:this.newest_,value_:T};this.newest_?this.newest_.newer=Z:this.oldest_=Z,this.newest_=Z,this.entries_[t]=Z,++this.count_},n.prototype.setSize=function(t){this.highWaterMark=t},n}();const we=xe;function Y7(n,t,T,Z){return Z!==void 0?(Z[0]=n,Z[1]=t,Z[2]=T,Z):[n,t,T]}function P4(n,t,T){return n+"/"+t+"/"+T}function a3(n){return P4(n[0],n[1],n[2])}function Oe(n){return n.split("/").map(Number)}function Re(n){return(n[1]<T||T>t.getMaxZoom())return!1;var r=t.getFullTileRange(T);return r?r.containsXY(Z,e):!0}var Ie=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),Pe=function(n){Ie(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.expireCache=function(T){for(;this.canExpireCache();){var Z=this.peekLast();if(Z.getKey()in T)break;this.pop().release()}},t.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var T=this.peekFirstKey(),Z=Oe(T),e=Z[0];this.forEach(function(r){r.tileCoord[0]!==e&&(this.remove(a3(r.tileCoord)),r.release())}.bind(this))}},t}(we);const s3=Pe;var l3=function(){function n(t,T,Z,e){this.minX=t,this.maxX=T,this.minY=Z,this.maxY=e}return n.prototype.contains=function(t){return this.containsXY(t[1],t[2])},n.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},n.prototype.containsXY=function(t,T){return this.minX<=t&&t<=this.maxX&&this.minY<=T&&T<=this.maxY},n.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},n.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},n.prototype.getHeight=function(){return this.maxY-this.minY+1},n.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},n.prototype.getWidth=function(){return this.maxX-this.minX+1},n.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},n}();function G2(n,t,T,Z,e){return e!==void 0?(e.minX=n,e.maxX=t,e.minY=T,e.maxY=Z,e):new l3(n,t,T,Z)}const u3=l3;var Le=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),Ae=function(n){Le(t,n);function t(T){var Z=n.call(this)||this;return Z.geometries_=T||null,Z.changeEventsKeys_=[],Z.listenGeometriesChange_(),Z}return t.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(H),this.changeEventsKeys_.length=0},t.prototype.listenGeometriesChange_=function(){if(!!this.geometries_)for(var T=0,Z=this.geometries_.length;Tthis.sourceWorldWidth_/2){var y=[[_.source[0][0],_.source[0][1]],[_.source[1][0],_.source[1][1]],[_.source[2][0],_.source[2][1]]];y[0][0]-v>this.sourceWorldWidth_/2&&(y[0][0]-=this.sourceWorldWidth_),y[1][0]-v>this.sourceWorldWidth_/2&&(y[1][0]-=this.sourceWorldWidth_),y[2][0]-v>this.sourceWorldWidth_/2&&(y[2][0]-=this.sourceWorldWidth_);var m=Math.min(y[0][0],y[1][0],y[2][0]),C=Math.max(y[0][0],y[1][0],y[2][0]);C-m.5&&h<1,f=!1;if(s>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var p=e7([t,T,Z,e]),d=q(p)/this.targetWorldWidth_;f=d>B7||f}!c&&this.sourceProj_.isGlobal()&&h&&(f=h>B7||f)}if(!(!f&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3])&&!d1(l,this.maxSourceExtent_))){var g=0;if(!f&&(!isFinite(r[0])||!isFinite(r[1])||!isFinite(i[0])||!isFinite(i[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1]))){if(s>0)f=!0;else if(g=(!isFinite(r[0])||!isFinite(r[1])?8:0)+(!isFinite(i[0])||!isFinite(i[1])?4:0)+(!isFinite(o[0])||!isFinite(o[1])?2:0)+(!isFinite(a[0])||!isFinite(a[1])?1:0),g!=1&&g!=2&&g!=4&&g!=8)return}if(s>0){if(!f){var v=[(t[0]+Z[0])/2,(t[1]+Z[1])/2],_=this.transformInv_(v),y=void 0;if(c){var m=(B2(r[0],u)+B2(o[0],u))/2;y=m-B2(_[0],u)}else y=(r[0]+o[0])/2-_[0];var C=(r[1]+o[1])/2-_[1],E=y*y+C*C;f=E>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-Z[0])<=Math.abs(t[1]-Z[1])){var w=[(T[0]+Z[0])/2,(T[1]+Z[1])/2],S=this.transformInv_(w),P=[(e[0]+t[0])/2,(e[1]+t[1])/2],A=this.transformInv_(P);this.addQuad_(t,T,w,P,r,i,S,A,s-1),this.addQuad_(P,w,Z,e,A,S,o,a,s-1)}else{var O=[(t[0]+T[0])/2,(t[1]+T[1])/2],R=this.transformInv_(O),D=[(Z[0]+e[0])/2,(Z[1]+e[1])/2],b=this.transformInv_(D);this.addQuad_(t,O,D,e,r,R,b,a,s-1),this.addQuad_(O,T,Z,D,R,i,o,b,s-1)}return}}if(c){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(g&11)==0&&this.addTriangle_(t,Z,e,r,o,a),(g&14)==0&&this.addTriangle_(t,Z,T,r,o,i),g&&((g&13)==0&&this.addTriangle_(T,e,t,i,a,r),(g&7)==0&&this.addTriangle_(T,e,Z,i,a,o))}},n.prototype.calculateSourceExtent=function(){var t=C1();return this.triangles_.forEach(function(T,Z,e){var r=T.source;v0(t,r[0]),v0(t,r[1]),v0(t,r[2])}),t},n.prototype.getTriangles=function(){return this.triangles_},n}();const nn=en;var $4,c3=[];function z7(n,t,T,Z,e){n.beginPath(),n.moveTo(0,0),n.lineTo(t,T),n.lineTo(Z,e),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(t,Z)+1,Math.max(T,e)),n.restore()}function H4(n,t){return Math.abs(n[t*4]-210)>2||Math.abs(n[t*4+3]-.75*255)>2}function rn(){if($4===void 0){var n=document.createElement("canvas").getContext("2d");n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",z7(n,4,5,4,0),z7(n,4,5,0,5);var t=n.getImageData(0,0,3,3).data;$4=H4(t,0)||H4(t,4)||H4(t,8)}return $4}function U7(n,t,T,Z){var e=S5(T,t,n),r=a7(t,Z,T),i=t.getMetersPerUnit();i!==void 0&&(r*=i);var o=n.getMetersPerUnit();o!==void 0&&(r/=o);var a=n.getExtent();if(!a||L0(a,e)){var s=a7(n,r,e)/r;isFinite(s)&&s>0&&(r/=s)}return r}function on(n,t,T,Z){var e=O2(T),r=U7(n,t,e,Z);return(!isFinite(r)||r<=0)&&o8(T,function(i){return r=U7(n,t,i,Z),isFinite(r)&&r>0}),r}function an(n,t,T,Z,e,r,i,o,a,s,l,h){var u=g1(Math.round(T*n),Math.round(T*t),c3);if(h||e1(u,g5),a.length===0)return u.canvas;u.scale(T,T);function c(y){return Math.round(y*T)/T}u.globalCompositeOperation="lighter";var f=C1();a.forEach(function(y,m,C){r8(f,y.extent)});var p=q(f),d=x1(f),g=g1(Math.round(T*p/Z),Math.round(T*d/Z));h||e1(g,g5);var v=T/Z;a.forEach(function(y,m,C){var E=y.extent[0]-f[0],w=-(y.extent[3]-f[3]),S=q(y.extent),P=x1(y.extent);y.image.width>0&&y.image.height>0&&g.drawImage(y.image,s,s,y.image.width-2*s,y.image.height-2*s,E*v,w*v,S*v,P*v)});var _=I2(i);return o.getTriangles().forEach(function(y,m,C){var E=y.source,w=y.target,S=E[0][0],P=E[0][1],A=E[1][0],O=E[1][1],R=E[2][0],D=E[2][1],b=c((w[0][0]-_[0])/r),I=c(-(w[0][1]-_[1])/r),L=c((w[1][0]-_[0])/r),M=c(-(w[1][1]-_[1])/r),Y=c((w[2][0]-_[0])/r),W=c(-(w[2][1]-_[1])/r),K=S,x=P;S=0,P=0,A-=K,O-=x,R-=K,D-=x;var Q=[[A,O,0,0,L-b],[R,D,0,0,Y-b],[0,0,A,O,M-I],[0,0,R,D,W-I]],V=u9(Q);if(!!V){if(u.save(),u.beginPath(),rn()||!h){u.moveTo(L,M);for(var k=4,i1=b-L,c1=I-M,o1=0;o10&&(this.newTiles_=!0):l.setState(G.LOADED)),this.isDrawableTile(l)||(l=l.getInterimTile()),l},t.prototype.getData=function(T){var Z=this.frameState;if(!Z)return null;var e=this.getLayer(),r=t1(Z.pixelToCoordinateTransform,T.slice()),i=e.getExtent();if(i&&!L0(i,r))return null;for(var o=Z.pixelRatio,a=Z.viewState.projection,s=Z.viewState,l=e.getRenderSource(),h=l.getTileGridForProjection(s.projection),u=l.getTilePixelRatio(Z.pixelRatio),c=h.getZForResolution(s.resolution);c>=h.getMinZoom();--c){var f=h.getTileCoordForCoordAndZ(r,c),p=l.getTile(c,f[1],f[2],o,a);if(!(p instanceof J8||p instanceof f3))return null;if(p.getState()===G.LOADED){var d=h.getOrigin(c),g=S1(h.getTileSize(c)),v=h.getResolution(c),_=Math.floor(u*((r[0]-d[0])/v-f[1]*g[0])),y=Math.floor(u*((d[1]-r[1])/v-f[2]*g[1])),m=Math.round(u*l.getGutterForProjection(s.projection));return this.getImageData(p.getImage(),_+m,y+m)}}return null},t.prototype.loadedTileCallback=function(T,Z,e){return this.isDrawableTile(e)?n.prototype.loadedTileCallback.call(this,T,Z,e):!1},t.prototype.prepareFrame=function(T){return!!this.getLayer().getSource()},t.prototype.renderFrame=function(T,Z){var e=T.layerStatesArray[T.layerIndex],r=T.viewState,i=r.projection,o=r.resolution,a=r.center,s=r.rotation,l=T.pixelRatio,h=this.getLayer(),u=h.getSource(),c=u.getRevision(),f=u.getTileGridForProjection(i),p=f.getZForResolution(o,u.zDirection),d=f.getResolution(p),g=T.extent,v=T.viewState.resolution,_=u.getTilePixelRatio(l),y=Math.round(q(g)/v*l),m=Math.round(x1(g)/v*l),C=e.extent&&g2(e.extent,i);C&&(g=g0(g,g2(e.extent,i)));var E=d*y/2/_,w=d*m/2/_,S=[a[0]-E,a[1]-w,a[0]+E,a[1]+w],P=f.getTileRangeForExtentAndZ(g,p),A={};A[p]={};var O=this.createLoadedTileFinder(u,i,A),R=this.tmpExtent,D=this.tmpTileRange_;this.newTiles_=!1;for(var b=s?Z5(r.center,v,s,T.size):void 0,I=P.minX;I<=P.maxX;++I)for(var L=P.minY;L<=P.maxY;++L)if(!(s&&!f.tileCoordIntersectsViewport([p,I,L],b))){var M=this.getTile(p,I,L,T);if(this.isDrawableTile(M)){var Y=z(this);if(M.getState()==G.LOADED){A[p][M.tileCoord.toString()]=M;var W=M.inTransition(Y);W&&e.opacity!==1&&(M.endTransition(Y),W=!1),!this.newTiles_&&(W||this.renderedTiles.indexOf(M)===-1)&&(this.newTiles_=!0)}if(M.getAlpha(Y,T.time)===1)continue}var K=f.getTileCoordChildTileRange(M.tileCoord,D,R),x=!1;K&&(x=O(p+1,K)),x||f.forEachTileCoordParentTileRange(M.tileCoord,O,D,R)}var Q=d/o*l/_;K1(this.pixelTransform,T.size[0]/2,T.size[1]/2,1/l,1/l,s,-y/2,-m/2);var V=t8(this.pixelTransform);this.useContainer(Z,V,this.getBackground(T));var k=this.context,i1=k.canvas;m5(this.inversePixelTransform,this.pixelTransform),K1(this.tempTransform,y/2,m/2,Q,Q,0,-y/2,-m/2),i1.width!=y||i1.height!=m?(i1.width=y,i1.height=m):this.containerReused||k.clearRect(0,0,y,m),C&&this.clipUnrotated(k,T,C),u.getInterpolate()||e1(k,g5),this.preRender(k,T),this.renderedTiles.length=0;var c1=Object.keys(A).map(Number);c1.sort(x2);var o1,L2,v1;e.opacity===1&&(!this.containerReused||u.getOpaque(T.viewState.projection))?c1=c1.reverse():(o1=[],L2=[]);for(var J2=c1.length-1;J2>=0;--J2){var P1=c1[J2],Q2=u.getTilePixelSize(P1,l,i),l2=f.getResolution(P1),A2=l2/d,b0=Q2[0]*A2*Q,j0=Q2[1]*A2*Q,T0=f.getTileCoordForCoordAndZ(I2(S),P1),Z0=f.getTileCoordExtent(T0),$1=t1(this.tempTransform,[_*(Z0[0]-S[0])/d,_*(S[3]-Z0[3])/d]),L4=_*u.getGutterForProjection(i),u2=A[P1];for(var k0 in u2){var M=u2[k0],H1=M.tileCoord,M2=T0[1]-H1[1],A4=Math.round($1[0]-(M2-1)*b0),X0=T0[2]-H1[2],t0=Math.round($1[1]-(X0-1)*j0),I=Math.round($1[0]-M2*b0),L=Math.round($1[1]-X0*j0),N1=A4-I,L1=t0-L,h2=p===P1,W=h2&&M.getAlpha(z(this),T.time)!==1,e0=!1;if(!W)if(o1){v1=[I,L,I+N1,L,I+N1,L+L1,I,L+L1];for(var h1=0,Y0=o1.length;h1=this.minZoom;){if(this.zoomFactor_===2?(i=Math.floor(i/2),o=Math.floor(o/2),r=G2(i,i,o,o,Z)):r=this.getTileRangeForExtentAndZ(a,s,Z),T(s,r))return!0;--s}return!1},n.prototype.getExtent=function(){return this.extent_},n.prototype.getMaxZoom=function(){return this.maxZoom},n.prototype.getMinZoom=function(){return this.minZoom},n.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},n.prototype.getResolution=function(t){return this.resolutions_[t]},n.prototype.getResolutions=function(){return this.resolutions_},n.prototype.getTileCoordChildTileRange=function(t,T,Z){if(t[0]this.maxZoom||T0?Z:Math.max(i/o[0],r/o[1]),s=e+1,l=new Array(s),h=0;he.highWaterMark&&(e.highWaterMark=T)},t.prototype.useTile=function(T,Z,e,r){},t}(V8),mn=function(n){g3(t,n);function t(T,Z){var e=n.call(this,T)||this;return e.tile=Z,e}return t}(V1);const En=yn;function Cn(n,t){var T=/\{z\}/g,Z=/\{x\}/g,e=/\{y\}/g,r=/\{-y\}/g;return function(i,o,a){if(i)return n.replace(T,i[0].toString()).replace(Z,i[1].toString()).replace(e,i[2].toString()).replace(r,function(){var s=i[0],l=t.getFullTileRange(s);X(l,55);var h=l.getHeight()-i[2]-1;return h.toString()})}}function xn(n,t){for(var T=n.length,Z=new Array(T),e=0;eO.json()),T=t.lastStageFinished,Z=K7.features.slice(0,T),e=K7.features.slice(T),r=new c0,i=new c0;for(const O of Z)r.addFeature(new f0().readFeature(O));for(const O of e)i.addFeature(new f0().readFeature(O));const o=new h0({source:r,style:n.lineOrange}),a=new h0({source:i,style:n.lineGrey}),s=new c0({features:new f0().readFeatures(qn)}),l=new h0({source:s,style:n.circleBlack}),h=new c0,u=new Q7({geometry:new C0([8.918618,44.407408]),name:"Support Van",trackable:!0});h.addFeature(u);const c=new h0({source:h,style:n.iconVan}),f=new c0;f.addFeatures(new f0().readFeatures(Tr));const p=new h0({source:f,style:n.lineOrange}),d=new r2({center:[10.6,46.9],zoom:6.6});window.view=d;const g=new Ce({target:"map",layers:[new jn({source:new Un}),o,a,p,l,c],view:d});setTimeout(()=>{const O=new f0().readFeature(e[0]);d.fit(O.getGeometry(),{maxZoom:10,duration:1e3})},3e3);const v=document.getElementById("popup"),_=new k7({element:v,positioning:"bottom-center",stopEvent:!1});g.addOverlay(_);let y;function m(){y&&(y.dispose(),y=void 0)}function C(O){const R=document.createElement("div"),D=document.createElement("div");return D.textContent=O.get("name"),R.append(D),R.innerHTML}g.on("click",function(O){const R=g.forEachFeatureAtPixel(O.pixel,function(D){return D});m(),R&&(_.setPosition(O.coordinate),y=new bootstrap.Popover(v,{placement:"top",html:!0,content:C(R)}),y.show())}),g.on("pointermove",function(O){g.getTargetElement().style.cursor=g.hasFeatureAtPixel(O.pixel)?"pointer":""}),g.on("movestart",m);const E=1e4,w={};function S(O){if(document.getElementById(`user-${O}`))return;const R=document.createElement("img");R.src=`https://r2b22.kip.pe/avatars/${O}.png`,R.id=`user-${O}`,R.style="width: 40px; height: 40px; border-radius: 20px;",document.getElementById("people").append(R)}function P(O){if(w[O])return;const R=new k7({stopEvent:!1,positioning:"center-center",element:document.getElementById(`user-${O}`)});w[O]=R,g.addOverlay(R)}function A(O=!1){fetch("https://r2b22.kip.pe/last.json").then(R=>R.json()).then(R=>{const D=R.find(I=>I.name=="satoshithevan"),b=[D.lon,D.lat];u.getGeometry().setCoordinates(b);for(const I of R){if(!t.participants.includes(I.name))continue;S(I.name),P(I.name),w[I.name].setPosition([I.lon,I.lat])}}),O&&setInterval(A,E)}A(!0)}Zr(); //# sourceMappingURL=index.2d0ee7b9.js.map