UNPKG

xgis-ol

Version:

基于openlayers + ol-ext库进行封装

1 lines 1.32 MB
import{reactive as Ur,defineComponent as Wn,onMounted as De,watch as lt,resolveComponent as pn,openBlock as $e,createElementBlock as Ii,createElementVNode as Dt,createVNode as ee,ref as H,getCurrentInstance as Tt,computed as w,h as S,nextTick as he,Transition as fi,onBeforeUnmount as le,shallowReactive as BC,provide as Wr,onBeforeUpdate as xl,onUpdated as jC,inject as ji,markRaw as U1,withDirectives as Ri,onUnmounted as W1,Teleport as VC,onDeactivated as wr,toRaw as Xn,onActivated as Fo,onBeforeMount as k0,KeepAlive as X1,createApp as $C,vShow as pc,isRef as GC,unref as je,normalizeStyle as Oo,withCtx as qi,createCommentVNode as Vi,createBlock as En,Fragment as fc,renderList as K1,toDisplayString as wl,renderSlot as Da,withKeys as HC,withModifiers as UC}from"vue";import{Feature as WC,VectorTile as XC}from"ol";import{Icon as Xr,disableCache as KC,addCollection as Y1}from"@iconify/vue";class en{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}var Na="propertychange";class Sl{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function Kn(e,t){return e>t?1:e<t?-1:0}function YC(e,t){return e<t?1:e>t?-1:0}function mc(e,t,i){if(e[0]<=t)return 0;const n=e.length;if(t<=e[n-1])return n-1;if(typeof i=="function"){for(let r=1;r<n;++r){const o=e[r];if(o===t)return r;if(o<t)return i(t,e[r-1],o)>0?r-1:r}return n-1}if(i>0){for(let r=1;r<n;++r)if(e[r]<t)return r-1;return n-1}if(i<0){for(let r=1;r<n;++r)if(e[r]<=t)return r;return n-1}for(let r=1;r<n;++r){if(e[r]==t)return r;if(e[r]<t)return e[r-1]-t<t-e[r]?r-1:r}return n-1}function ZC(e,t,i){for(;t<i;){const n=e[t];e[t]=e[i],e[i]=n,++t,--i}}function Yn(e,t){const i=Array.isArray(t)?t:[t],n=i.length;for(let r=0;r<n;r++)e[e.length]=i[r]}function Kr(e,t){const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}function Ba(){return!0}function ja(){return!1}function Va(){}function Z1(e){let t,i,n;return function(){const r=Array.prototype.slice.call(arguments);return i&&this===n&&Kr(r,i)||(n=this,i=r,t=e.apply(this,arguments)),t}}function Do(e){return function(){let t;try{t=e()}catch(i){return Promise.reject(i)}return t instanceof Promise?t:Promise.resolve(t)}()}function Cl(e){for(const t in e)delete e[t]}function Yr(e){let t;for(t in e)return!1;return!t}class Ml extends Sl{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,i){if(!t||!i)return;const n=this.listeners_||(this.listeners_={}),r=n[t]||(n[t]=[]);r.includes(i)||r.push(i)}dispatchEvent(t){const i=typeof t=="string",n=i?t:t.type,r=this.listeners_&&this.listeners_[n];if(!r)return;const o=i?new en(t):t;o.target||(o.target=this.eventTarget_||this);const a=this.dispatching_||(this.dispatching_={}),s=this.pendingRemovals_||(this.pendingRemovals_={});let l;n in a||(a[n]=0,s[n]=0),++a[n];for(let u=0,c=r.length;u<c;++u)if(l="handleEvent"in r[u]?r[u].handleEvent(o):r[u].call(this,o),l===!1||o.propagationStopped){l=!1;break}if(--a[n]==0){let u=s[n];for(delete s[n];u--;)this.removeEventListener(n,Va);delete a[n]}return l}disposeInternal(){this.listeners_&&Cl(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)}removeEventListener(t,i){if(!this.listeners_)return;const n=this.listeners_[t];if(!n)return;const r=n.indexOf(i);r!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[r]=Va,++this.pendingRemovals_[t]):(n.splice(r,1),n.length===0&&delete this.listeners_[t]))}}var Le="change",Q1="error",T0="contextmenu",kl="click",QC="dblclick",gc="keydown",J1="keypress",JC="load",ty="touchmove",Tl="wheel";function fe(e,t,i,n,r){if(r){const a=i;i=function(){e.removeEventListener(t,i),a.apply(n??this,arguments)}}else n&&n!==e&&(i=i.bind(n));const o={target:e,type:t,listener:i};return e.addEventListener(t,i),o}function vc(e,t,i,n){return fe(e,t,i,n,!0)}function ze(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),Cl(e))}class El extends Ml{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(Le)}getRevision(){return this.revision_}onInternal(t,i){if(Array.isArray(t)){const n=t.length,r=new Array(n);for(let o=0;o<n;++o)r[o]=fe(this,t[o],i);return r}return fe(this,t,i)}onceInternal(t,i){let n;if(Array.isArray(t)){const r=t.length;n=new Array(r);for(let o=0;o<r;++o)n[o]=vc(this,t[o],i)}else n=vc(this,t,i);return i.ol_key=n,n}unInternal(t,i){const n=i.ol_key;if(n)fn(n);else if(Array.isArray(t))for(let r=0,o=t.length;r<o;++r)this.removeEventListener(t[r],i);else this.removeEventListener(t,i)}}function fn(e){if(Array.isArray(e))for(let t=0,i=e.length;t<i;++t)ze(e[t]);else ze(e)}function Xt(){throw new Error("Unimplemented abstract method.")}El.prototype.on,El.prototype.once,El.prototype.un;let t4=0;function Qt(e){return e.ol_uid||(e.ol_uid=String(++t4))}class ey extends en{constructor(t,i,n){super(t),this.key=i,this.oldValue=n}}class mn extends El{constructor(t){super(),this.on,this.once,this.un,Qt(this),this.values_=null,t!==void 0&&this.setProperties(t)}get(t){let i;return this.values_&&this.values_.hasOwnProperty(t)&&(i=this.values_[t]),i}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(t,i){let n;n=`change:${t}`,this.hasListener(n)&&this.dispatchEvent(new ey(n,t,i)),n=Na,this.hasListener(n)&&this.dispatchEvent(new ey(n,t,i))}addChangeListener(t,i){this.addEventListener(`change:${t}`,i)}removeChangeListener(t,i){this.removeEventListener(`change:${t}`,i)}set(t,i,n){const r=this.values_||(this.values_={});if(n)r[t]=i;else{const o=r[t];r[t]=i,o!==i&&this.notify(t,o)}}setProperties(t,i){for(const n in t)this.set(n,t[n],i)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,i){if(this.values_&&t in this.values_){const n=this.values_[t];delete this.values_[t],Yr(this.values_)&&(this.values_=null),i||this.notify(t,n)}}}var No="add",Bo="remove";const iy="length";class yc extends en{constructor(t,i,n){super(t),this.element=i,this.index=n}}class gn extends mn{constructor(t,i){if(super(),this.on,this.once,this.un,i=i||{},this.unique_=!!i.unique,this.array_=t||[],this.unique_)for(let n=0,r=this.array_.length;n<r;++n)this.assertUnique_(this.array_[n],n);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let i=0,n=t.length;i<n;++i)this.push(t[i]);return this}forEach(t){const i=this.array_;for(let n=0,r=i.length;n<r;++n)t(i[n],n,i)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(iy)}insertAt(t,i){if(t<0||t>this.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(i),this.array_.splice(t,0,i),this.updateLength_(),this.dispatchEvent(new yc(No,i,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const i=this.getLength();return this.insertAt(i,t),this.getLength()}remove(t){const i=this.array_;for(let n=0,r=i.length;n<r;++n)if(i[n]===t)return this.removeAt(n)}removeAt(t){if(t<0||t>=this.getLength())return;const i=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new yc(Bo,i,t)),i}setAt(t,i){if(t>=this.getLength())return void this.insertAt(t,i);if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(i,t);const n=this.array_[t];this.array_[t]=i,this.dispatchEvent(new yc(Bo,n,t)),this.dispatchEvent(new yc(No,i,t))}updateLength_(){this.set(iy,this.array_.length)}assertUnique_(t,i){for(let n=0,r=this.array_.length;n<r;++n)if(this.array_[n]===t&&n!==i)throw new Error("Duplicate item added to a unique collection")}}var _c="opacity",E0="visible",ny="extent",L0="zIndex",P0="maxResolution",I0="minResolution",R0="maxZoom",q0="minZoom",A0="source",ry="map";function Se(e,t){if(!e)throw new Error(t)}function Ue(e,t,i){return Math.min(Math.max(e,t),i)}function e4(e,t,i,n,r,o){const a=r-i,s=o-n;if(a!==0||s!==0){const l=((e-i)*a+(t-n)*s)/(a*a+s*s);l>1?(i=r,n=o):l>0&&(i+=a*l,n+=s*l)}return Sr(e,t,i,n)}function Sr(e,t,i,n){const r=i-e,o=n-t;return r*r+o*o}function oy(e){return 180*e/Math.PI}function Ln(e){return e*Math.PI/180}function Zr(e,t){const i=e%t;return i*t<0?i+t:i}function nn(e,t,i){return e+i*(t-e)}function Ll(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}function ay(e,t){return Math.round(Ll(e,t))}function bc(e,t){return Math.floor(Ll(e,t))}function Qr(e,t){return Math.ceil(Ll(e,t))}function z0(e,t,i){if(e>=t&&e<i)return e;const n=i-t;return((e-t)%n+n)%n+t}class sy extends mn{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const i=Object.assign({},t);typeof t.properties=="object"&&(delete i.properties,Object.assign(i,t.properties)),i[_c]=t.opacity!==void 0?t.opacity:1,Se(typeof i[_c]=="number","Layer opacity must be a number"),i[E0]=t.visible===void 0||t.visible,i[L0]=t.zIndex,i[P0]=t.maxResolution!==void 0?t.maxResolution:1/0,i[I0]=t.minResolution!==void 0?t.minResolution:0,i[q0]=t.minZoom!==void 0?t.minZoom:-1/0,i[R0]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=i.className!==void 0?i.className:"ol-layer",delete i.className,this.setProperties(i),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const i=this.state_||{layer:this,managed:t===void 0||t},n=this.getZIndex();return i.opacity=Ue(Math.round(100*this.getOpacity())/100,0,1),i.visible=this.getVisible(),i.extent=this.getExtent(),i.zIndex=n!==void 0||i.managed?n:1/0,i.maxResolution=this.getMaxResolution(),i.minResolution=Math.max(this.getMinResolution(),0),i.minZoom=this.getMinZoom(),i.maxZoom=this.getMaxZoom(),this.state_=i,i}getLayersArray(t){return Xt()}getLayerStatesArray(t){return Xt()}getExtent(){return this.get(ny)}getMaxResolution(){return this.get(P0)}getMinResolution(){return this.get(I0)}getMinZoom(){return this.get(q0)}getMaxZoom(){return this.get(R0)}getOpacity(){return this.get(_c)}getSourceState(){return Xt()}getVisible(){return this.get(E0)}getZIndex(){return this.get(L0)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(ny,t)}setMaxResolution(t){this.set(P0,t)}setMinResolution(t){this.set(I0,t)}setMaxZoom(t){this.set(R0,t)}setMinZoom(t){this.set(q0,t)}setOpacity(t){Se(typeof t=="number","Layer opacity must be a number"),this.set(_c,t)}setVisible(t){this.set(E0,t)}setZIndex(t){this.set(L0,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}var F0="prerender",O0="postrender",ly="precompose",i4="postcompose",D0="rendercomplete",rn=0,Pn=1,In={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};const N0=256,Cr={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class Zn{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Cr[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const Pl=6378137,$a=Math.PI*Pl,n4=[-$a,-$a,$a,$a],r4=[-180,-85,180,85],xc=Pl*Math.log(Math.tan(Math.PI/2));class Ga extends Zn{constructor(t){super({code:t,units:"m",extent:n4,global:!0,worldExtent:r4,getPointResolution:function(i,n){return i/Math.cosh(n[1]/Pl)}})}}const uy=[new Ga("EPSG:3857"),new Ga("EPSG:102100"),new Ga("EPSG:102113"),new Ga("EPSG:900913"),new Ga("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ga("http://www.opengis.net/gml/srs/epsg.xml#3857")];function o4(e,t,i,n){const r=e.length;i=i>1?i:2,n=n??i,t===void 0&&(t=i>2?e.slice():new Array(r));for(let o=0;o<r;o+=n){t[o]=$a*e[o]/180;let a=Pl*Math.log(Math.tan(Math.PI*(+e[o+1]+90)/360));a>xc?a=xc:a<-xc&&(a=-xc),t[o+1]=a}return t}function a4(e,t,i,n){const r=e.length;i=i>1?i:2,n=n??i,t===void 0&&(t=i>2?e.slice():new Array(r));for(let o=0;o<r;o+=n)t[o]=180*e[o]/$a,t[o+1]=360*Math.atan(Math.exp(e[o+1]/Pl))/Math.PI-90;return t}const cy=[-180,-90,180,90],s4=6378137*Math.PI/180;class jo extends Zn{constructor(t,i){super({code:t,units:"degrees",extent:cy,axisOrientation:i,global:!0,metersPerUnit:s4,worldExtent:cy})}}const hy=[new jo("CRS:84"),new jo("EPSG:4326","neu"),new jo("urn:ogc:def:crs:OGC:1.3:CRS84"),new jo("urn:ogc:def:crs:OGC:2:84"),new jo("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new jo("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new jo("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let B0={};function wc(e){return B0[e]||B0[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}let Ha={};function Vo(e,t,i){const n=e.getCode(),r=t.getCode();n in Ha||(Ha[n]={}),Ha[n][r]=i}function Sc(e,t){return e in Ha&&t in Ha[e]?Ha[e][t]:null}var dy=0,Cc=1,j0=2,V0=4,$0=8,G0=16;function Ua(e){const t=l4();for(let i=0,n=e.length;i<n;++i)Il(t,e[i]);return t}function Jr(e,t,i){return i?(i[0]=e[0]-t,i[1]=e[1]-t,i[2]=e[2]+t,i[3]=e[3]+t,i):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function py(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}function $o(e,t,i){let n,r;return n=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0,r=i<e[1]?e[1]-i:e[3]<i?i-e[3]:0,n*n+r*r}function Go(e,t){return H0(e,t[0],t[1])}function Rn(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}function H0(e,t,i){return e[0]<=t&&t<=e[2]&&e[1]<=i&&i<=e[3]}function U0(e,t){const i=e[0],n=e[1],r=e[2],o=e[3],a=t[0],s=t[1];let l=dy;return a<i?l|=G0:a>r&&(l|=V0),s<n?l|=$0:s>o&&(l|=j0),l===dy&&(l=Cc),l}function l4(){return[1/0,1/0,-1/0,-1/0]}function Qn(e,t,i,n,r){return r?(r[0]=e,r[1]=t,r[2]=i,r[3]=n,r):[e,t,i,n]}function Wa(e){return Qn(1/0,1/0,-1/0,-1/0,e)}function fy(e,t){const i=e[0],n=e[1];return Qn(i,n,i,n,t)}function W0(e,t,i,n,r){return my(Wa(r),e,t,i,n)}function Mr(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function X0(e,t){return t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3]),e}function Il(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function my(e,t,i,n,r){for(;i<n;i+=r)u4(e,t[i],t[i+1]);return e}function u4(e,t,i){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],i),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],i)}function K0(e,t){let i;return i=t(Mc(e)),i||(i=t(kc(e)),i||(i=t(Ec(e)),i||(i=t(vn(e)),i||!1)))}function Rl(e){let t=0;return Ho(e)||(t=ie(e)*We(e)),t}function Mc(e){return[e[0],e[1]]}function kc(e){return[e[2],e[1]]}function $i(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function c4(e,t){let i;if(t==="bottom-left")i=Mc(e);else if(t==="bottom-right")i=kc(e);else if(t==="top-left")i=vn(e);else{if(t!=="top-right")throw new Error("Invalid corner");i=Ec(e)}return i}function Tc(e,t,i,n,r){const[o,a,s,l,u,c,h,d]=function(p,f,m,_){const v=f*_[0]/2,b=f*_[1]/2,g=Math.cos(m),y=Math.sin(m),x=v*g,C=v*y,M=b*g,P=b*y,z=p[0],E=p[1];return[z-x+P,E-C-M,z-x-P,E-C+M,z+x-P,E+C+M,z+x+P,E+C-M,z-x+P,E-C-M]}(e,t,i,n);return Qn(Math.min(o,s,u,h),Math.min(a,l,c,d),Math.max(o,s,u,h),Math.max(a,l,c,d),r)}function We(e){return e[3]-e[1]}function Ai(e,t,i){const n=i||[1/0,1/0,-1/0,-1/0];return Ye(e,t)?(e[0]>t[0]?n[0]=e[0]:n[0]=t[0],e[1]>t[1]?n[1]=e[1]:n[1]=t[1],e[2]<t[2]?n[2]=e[2]:n[2]=t[2],e[3]<t[3]?n[3]=e[3]:n[3]=t[3]):Wa(n),n}function vn(e){return[e[0],e[3]]}function Ec(e){return[e[2],e[3]]}function ie(e){return e[2]-e[0]}function Ye(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function Ho(e){return e[2]<e[0]||e[3]<e[1]}function Lc(e,t,i,n){if(Ho(e))return Wa(i);let r=[];if(n>1){const s=e[2]-e[0],l=e[3]-e[1];for(let u=0;u<n;++u)r.push(e[0]+s*u/n,e[1],e[2],e[1]+l*u/n,e[2]-s*u/n,e[3],e[0],e[3]-l*u/n)}else r=[e[0],e[1],e[2],e[1],e[2],e[3],e[0],e[3]];t(r,r,2);const o=[],a=[];for(let s=0,l=r.length;s<l;s+=2)o.push(r[s]),a.push(r[s+1]);return function(s,l,u){return Qn(Math.min.apply(null,s),Math.min.apply(null,l),Math.max.apply(null,s),Math.max.apply(null,l),u)}(o,a,i)}function gy(e,t){const i=t.getExtent(),n=$i(e);if(t.canWrapX()&&(n[0]<i[0]||n[0]>=i[2])){const r=ie(i),o=Math.floor((n[0]-i[0])/r)*r;e[0]-=o,e[2]-=o}return e}function Y0(e,t,i){if(t.canWrapX()){const n=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[n[0],e[1],n[2],e[3]]];gy(e,t);const r=ie(n);if(ie(e)>r&&!i)return[[n[0],e[1],n[2],e[3]]];if(e[0]<n[0])return[[e[0]+r,e[1],n[2],e[3]],[n[0],e[1],e[2],e[3]]];if(e[2]>n[2])return[[e[0],e[1],n[2],e[3]],[n[0],e[1],e[2]-r,e[3]]]}return[e]}function Pc(e,t){let i=!0;for(let n=e.length-1;n>=0;--n)if(e[n]!=t[n]){i=!1;break}return i}function Z0(e,t){const i=Math.cos(t),n=Math.sin(t),r=e[0]*i-e[1]*n,o=e[1]*i+e[0]*n;return e[0]=r,e[1]=o,e}function vy(e,t){const i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n}function yy(e,t){return Math.sqrt(vy(e,t))}function _y(e,t){return function(i,n,r){return i?n.replace("{x}",i[0].toFixed(r)).replace("{y}",i[1].toFixed(r)):""}(e,"{x}, {y}",t)}function Q0(e,t){if(t.canWrapX()){const i=ie(t.getExtent()),n=by(e,t,i);n&&(e[0]-=n*i)}return e}function by(e,t,i){const n=t.getExtent();let r=0;return t.canWrapX()&&(e[0]<n[0]||e[0]>n[2])&&(i=i||ie(n),r=Math.floor((e[0]-n[0])/i)),r}const J0=63710088e-1;function ql(e,t,i){i=i||J0;const n=Ln(e[1]),r=Ln(t[1]),o=(r-n)/2,a=Ln(t[0]-e[0])/2,s=Math.sin(o)*Math.sin(o)+Math.sin(a)*Math.sin(a)*Math.cos(n)*Math.cos(r);return 2*i*Math.atan2(Math.sqrt(s),Math.sqrt(1-s))}function tp(e,t){let i=0;for(let n=0,r=e.length;n<r-1;++n)i+=ql(e[n],e[n+1],t);return i}function xy(e,t){const i=(t=t||{}).radius||J0,n=t.projection||"EPSG:3857",r=e.getType();r!=="GeometryCollection"&&(e=e.clone().transform(n,"EPSG:4326"));let o,a,s,l,u,c,h=0;switch(r){case"Point":case"MultiPoint":break;case"LineString":case"LinearRing":o=e.getCoordinates(),h=tp(o,i);break;case"MultiLineString":case"Polygon":for(o=e.getCoordinates(),s=0,l=o.length;s<l;++s)h+=tp(o[s],i);break;case"MultiPolygon":for(o=e.getCoordinates(),s=0,l=o.length;s<l;++s)for(a=o[s],u=0,c=a.length;u<c;++u)h+=tp(a[u],i);break;case"GeometryCollection":{const d=e.getGeometries();for(s=0,l=d.length;s<l;++s)h+=xy(d[s],t);break}default:throw new Error("Unsupported geometry type: "+r)}return h}function Ic(e,t){let i=0;const n=e.length;let r=e[n-1][0],o=e[n-1][1];for(let a=0;a<n;a++){const s=e[a][0],l=e[a][1];i+=Ln(s-r)*(2+Math.sin(Ln(o))+Math.sin(Ln(l))),r=s,o=l}return i*t*t/2}function wy(e,t){const i=(t=t||{}).radius||J0,n=t.projection||"EPSG:3857",r=e.getType();r!=="GeometryCollection"&&(e=e.clone().transform(n,"EPSG:4326"));let o,a,s,l,u,c,h=0;switch(r){case"Point":case"MultiPoint":case"LineString":case"MultiLineString":case"LinearRing":break;case"Polygon":for(o=e.getCoordinates(),h=Math.abs(Ic(o[0],i)),s=1,l=o.length;s<l;++s)h-=Math.abs(Ic(o[s],i));break;case"MultiPolygon":for(o=e.getCoordinates(),s=0,l=o.length;s<l;++s)for(a=o[s],h+=Math.abs(Ic(a[0],i)),u=1,c=a.length;u<c;++u)h-=Math.abs(Ic(a[u],i));break;case"GeometryCollection":{const d=e.getGeometries();for(s=0,l=d.length;s<l;++s)h+=wy(d[s],t);break}default:throw new Error("Unsupported geometry type: "+r)}return h}const Rc=.9996,Jn=.00669438,Sy=Jn*Jn,Cy=Sy*Jn,Uo=Jn/(1-Jn),My=Math.sqrt(1-Jn),Xa=(1-My)/(1+My),ky=Xa*Xa,ep=ky*Xa,ip=ep*Xa,Ty=ip*Xa,Ey=.9983242984503243,h4=15*Sy/256+45*Cy/1024,d4=35*Cy/3072,p4=1.5*Xa-27/32*ep+269/512*Ty,f4=21/16*ky-55/32*ip,m4=151/96*ep-417/128*Ty,g4=1097/512*ip,qc=6378137;function v4(e,t,i){const n=e-5e5,r=(i.north?t:t-1e7)/Rc/(qc*Ey),o=r+p4*Math.sin(2*r)+f4*Math.sin(4*r)+m4*Math.sin(6*r)+g4*Math.sin(8*r),a=Math.sin(o),s=a*a,l=Math.cos(o),u=a/l,c=u*u,h=c*c,d=1-Jn*s,p=Math.sqrt(1-Jn*s),f=Uo*l**2,m=f*f,_=n/(qc/p*Rc),v=_*_,b=v*_,g=b*_,y=g*_,x=o-u/((1-Jn)/d)*(v/2-g/24*(5+3*c+10*f-4*m-9*Uo))+y*_/720*(61+90*c+298*f+45*h-252*Uo-3*m);let C=(_-b/6*(1+2*c+f)+y/120*(5-2*f+28*c-3*m+8*Uo+24*h))/l;return C=z0(C+Ln(Ly(i.number)),-Math.PI,Math.PI),[oy(C),oy(x)]}function y4(e,t,i){e=z0(e,-180,180),t<-80?t=-80:t>84&&(t=84);const n=Ln(t),r=Math.sin(n),o=Math.cos(n),a=r/o,s=a*a,l=s*s,u=Ln(e),c=Ln(Ly(i.number)),h=qc/Math.sqrt(1-Jn*r**2),d=Uo*o**2,p=o*z0(u-c,-Math.PI,Math.PI),f=p*p,m=f*p,_=m*p,v=_*p,b=v*p,g=qc*(Ey*n-.002514607064228144*Math.sin(2*n)+h4*Math.sin(4*n)-d4*Math.sin(6*n)),y=Rc*h*(p+m/6*(1-s+d)+v/120*(5-18*s+l+72*d-58*Uo))+5e5;let x=Rc*(g+h*a*(f/2+_/24*(5-s+9*d+4*d**2)+b/720*(61-58*s+l+600*d-330*Uo)));return i.north||(x+=1e7),[y,x]}function Ly(e){return 6*(e-1)-180+3}const _4=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Py(e){let t=0;for(const r of _4){const o=e.match(r);if(o){t=parseInt(o[1]);break}}if(!t)return null;let i=0,n=!1;return t>32700&&t<32761?i=t-32700:t>32600&&t<32661&&(n=!0,i=t-32600),i?{number:i,north:n}:null}function Iy(e,t){return function(i,n,r,o){const a=i.length;r=r>1?r:2,o=o??r,n||(n=r>2?i.slice():new Array(a));for(let s=0;s<a;s+=o){const l=i[s],u=i[s+1],c=e(l,u,t);n[s]=c[0],n[s+1]=c[1]}return n}}function Ry(...e){console.warn(...e)}const b4=[function(e){const t=Py(e.getCode());return t?{forward:Iy(y4,t),inverse:Iy(v4,t)}:null}],x4=[function(e){return Py(e)?new Zn({code:e,units:"m"}):null}];let np=!0;function qy(e){np=!(e===void 0||e)}function rp(e,t){if(t!==void 0)for(let i=0,n=e.length;i<n;++i)t[i]=e[i];else t=e.slice();return t}function Al(e){(function(t,i){B0[t]=i})(e.getCode(),e),Vo(e,e,rp)}function ne(e){if(typeof e!="string")return e;const t=wc(e);if(t)return t;for(const i of x4){const n=i(e);if(n)return n}return null}function zl(e,t,i,n){let r;const o=(e=ne(e)).getPointResolutionFunc();if(o){if(r=o(t,i),n&&n!==e.getUnits()){const a=e.getMetersPerUnit();a&&(r=r*a/Cr[n])}}else{const a=e.getUnits();if(a=="degrees"&&!n||n=="degrees")r=t;else{const s=Ka(e,ne("EPSG:4326"));if(s||a==="degrees"){let u=[i[0]-t/2,i[1],i[0]+t/2,i[1],i[0],i[1]-t/2,i[0],i[1]+t/2];u=s(u,u,2),r=(ql(u.slice(0,2),u.slice(2,4))+ql(u.slice(4,6),u.slice(6,8)))/2}else r=t*e.getMetersPerUnit();const l=n?Cr[n]:e.getMetersPerUnit();l!==void 0&&(r/=l)}}return r}function op(e){(function(t){t.forEach(Al)})(e),e.forEach(function(t){e.forEach(function(i){t!==i&&Vo(t,i,rp)})})}function ap(e,t){return e?typeof e=="string"?ne(e):e:ne(t)}function sp(e){return function(t,i,n,r){const o=t.length;n=n!==void 0?n:2,r=r??n,i=i!==void 0?i:new Array(o);for(let a=0;a<o;a+=r){const s=e(t.slice(a,a+n)),l=s.length;for(let u=0,c=r;u<c;++u)i[a+u]=u>=l?t[a+u]:s[u]}return i}}function w4(e,t,i,n){const r=ne(e),o=ne(t);Vo(r,o,sp(i)),Vo(o,r,sp(n))}function lp(e,t){return qy(),to(e,"EPSG:4326",t!==void 0?t:"EPSG:3857")}function tr(e,t){if(e===t)return!0;const i=e.getUnits()===t.getUnits();return(e.getCode()===t.getCode()||Ka(e,t)===rp)&&i}function Ka(e,t){const i=e.getCode(),n=t.getCode();let r=Sc(i,n);if(r)return r;let o=null,a=null;for(const l of b4)o||(o=l(e)),a||(a=l(t));if(!o&&!a)return null;const s="EPSG:4326";if(a)if(o)r=up(o.inverse,a.forward);else{const l=Sc(i,s);l&&(r=up(l,a.forward))}else{const l=Sc(s,n);l&&(r=up(o.inverse,l))}return r&&(Al(e),Al(t),Vo(e,t,r)),r}function up(e,t){return function(i,n,r,o){return n=e(i,n,r,o),t(n,n,r,o)}}function Wo(e,t){return Ka(ne(e),ne(t))}function to(e,t,i){const n=Wo(t,i);if(!n){const r=ne(t).getCode(),o=ne(i).getCode();throw new Error(`No transform available between ${r} and ${o}`)}return n(e,void 0,e.length)}function cp(e,t){return e}function qn(e,t){return np&&!Pc(e,[0,0])&&e[0]>=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90&&(np=!1,Ry("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),e}function hp(e,t){return e}function er(e,t){return e}function Ay(e,t,i){return function(n){let r,o;if(e.canWrapX()){const a=e.getExtent(),s=ie(a);o=by(n=n.slice(0),e,s),o&&(n[0]=n[0]-o*s),n[0]=Ue(n[0],a[0],a[2]),n[1]=Ue(n[1],a[1],a[3]),r=i(n)}else r=i(n);return o&&t.canWrapX()&&(r[0]+=o*ie(t.getExtent())),r}}var zy,Fy,Oy;function Dy(e,t,i){return function(n,r,o,a,s){if(!n)return;if(!r&&!t)return n;const l=t?0:o[0]*r,u=t?0:o[1]*r,c=s?s[0]:0,h=s?s[1]:0;let d=e[0]+l/2+c,p=e[2]-l/2+c,f=e[1]+u/2+h,m=e[3]-u/2+h;d>p&&(d=(p+d)/2,p=d),f>m&&(f=(m+f)/2,m=f);let _=Ue(n[0],d,p),v=Ue(n[1],f,m);if(a&&i&&r){const b=30*r;_+=-b*Math.log(1+Math.max(0,d-n[0])/b)+b*Math.log(1+Math.max(0,n[0]-p)/b),v+=-b*Math.log(1+Math.max(0,f-n[1])/b)+b*Math.log(1+Math.max(0,n[1]-m)/b)}return[_,v]}}function S4(e){return e}function dp(e,t,i,n){const r=ie(t)/i[0],o=We(t)/i[1];return n?Math.min(e,Math.max(r,o)):Math.min(e,Math.min(r,o))}function pp(e,t,i){let n=Math.min(e,t);return n*=Math.log(1+50*Math.max(0,e/t-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/e-1))/50+1),Ue(n,i/2,2*t)}function Ny(e,t,i,n,r){return i=i===void 0||i,function(o,a,s,l){if(o!==void 0){const u=n?dp(e,n,s,r):e;return i&&l?pp(o,u,t):Ue(o,t,u)}}}function fp(e){if(e!==void 0)return 0}function By(e){if(e!==void 0)return e}function jy(e){return Math.pow(e,3)}function Ya(e){return 1-jy(1-e)}function C4(e){return 3*e*e-2*e*e*e}function M4(e){return e}op(uy),op(hy),zy=uy,Fy=o4,Oy=a4,hy.forEach(function(e){zy.forEach(function(t){Vo(e,t,Fy),Vo(t,e,Oy)})});const Vy=new Array(6);function $y(e){return mp(e,1,0,0,1,0,0)}function Ac(e,t){const i=e[0],n=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=t[0],u=t[1],c=t[2],h=t[3],d=t[4],p=t[5];return e[0]=i*l+r*u,e[1]=n*l+o*u,e[2]=i*c+r*h,e[3]=n*c+o*h,e[4]=i*d+r*p+a,e[5]=n*d+o*p+s,e}function mp(e,t,i,n,r,o,a){return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e[4]=o,e[5]=a,e}function ai(e,t){const i=t[0],n=t[1];return t[0]=e[0]*i+e[2]*n+e[4],t[1]=e[1]*i+e[3]*n+e[5],t}function gp(e,t,i){return Ac(e,mp(Vy,t,0,0,i,0,0))}function ir(e,t,i,n,r,o,a,s){const l=Math.sin(o),u=Math.cos(o);return e[0]=n*u,e[1]=r*l,e[2]=-n*l,e[3]=r*u,e[4]=a*n*u-s*n*l+t,e[5]=a*r*l+s*r*u+i,e}function Gy(e,t){const i=(n=t)[0]*n[3]-n[1]*n[2];var n;Se(i!==0,"Transformation matrix cannot be inverted");const r=t[0],o=t[1],a=t[2],s=t[3],l=t[4],u=t[5];return e[0]=s/i,e[1]=-o/i,e[2]=-a/i,e[3]=r/i,e[4]=(a*u-s*l)/i,e[5]=-(r*u-o*l)/i,e}const Hy=[1e6,1e6,1e6,1e6,2,2];function eo(e,t,i,n,r,o,a){o=o||[],a=a||2;let s=0;for(let l=t;l<i;l+=n){const u=e[l],c=e[l+1];o[s++]=r[0]*u+r[2]*c+r[4],o[s++]=r[1]*u+r[3]*c+r[5];for(let h=2;h<a;h++)o[s++]=e[l+h]}return o&&o.length!=s&&(o.length=s),o}function vp(e,t,i,n,r,o,a){a=a||[];const s=Math.cos(r),l=Math.sin(r),u=o[0],c=o[1];let h=0;for(let d=t;d<i;d+=n){const p=e[d]-u,f=e[d+1]-c;a[h++]=u+p*s-f*l,a[h++]=c+p*l+f*s;for(let m=d+2;m<d+n;++m)a[h++]=e[m]}return a&&a.length!=h&&(a.length=h),a}const Uy=[1,0,0,1,0,0];class Wy extends mn{constructor(){super(),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=Z1((t,i,n)=>{if(!n)return this.getSimplifiedGeometry(i);const r=this.clone();return r.applyTransform(n),r.getSimplifiedGeometry(i)})}simplifyTransformed(t,i){return this.simplifyTransformedInternal(this.getRevision(),t,i)}clone(){return Xt()}closestPointXY(t,i,n,r){return Xt()}containsXY(t,i){const n=this.getClosestPoint([t,i]);return n[0]===t&&n[1]===i}getClosestPoint(t,i){return i=i||[NaN,NaN],this.closestPointXY(t[0],t[1],i,1/0),i}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return Xt()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const i=this.computeExtent(this.extent_);(isNaN(i[0])||isNaN(i[1]))&&Wa(i),this.extentRevision_=this.getRevision()}return function(i,n){return n?(n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n):i}(this.extent_,t)}rotate(t,i){Xt()}scale(t,i,n){Xt()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return Xt()}getType(){return Xt()}applyTransform(t){Xt()}intersectsExtent(t){return Xt()}translate(t,i){Xt()}transform(t,i){const n=ne(t),r=n.getUnits()=="tile-pixels"?function(o,a,s){const l=n.getExtent(),u=n.getWorldExtent(),c=We(u)/We(l);ir(Uy,u[0],u[3],c,-c,0,0,0);const h=eo(o,0,o.length,s,Uy,a),d=Wo(n,i);return d?d(h,h,s):h}:Wo(n,i);return this.applyTransform(r),this}}class io extends Wy{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return W0(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return Xt()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const i=this.getSimplifiedGeometryInternal(t);return i.getFlatCoordinates().length<this.flatCoordinates.length?i:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,i){this.stride=zc(t),this.layout=t,this.flatCoordinates=i}setCoordinates(t,i){Xt()}setLayout(t,i,n){let r;if(t)r=zc(t);else{for(let o=0;o<n;++o){if(i.length===0)return this.layout="XY",void(this.stride=2);i=i[0]}r=i.length,t=Xo(r)}this.layout=t,this.stride=r}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(t,i){const n=this.getFlatCoordinates();if(n){const r=this.getStride();vp(n,0,n.length,r,t,i,n),this.changed()}}scale(t,i,n){i===void 0&&(i=t),n||(n=$i(this.getExtent()));const r=this.getFlatCoordinates();if(r){const o=this.getStride();(function(a,s,l,u,c,h,d,p){p=p||[];const f=d[0],m=d[1];let _=0;for(let v=s;v<l;v+=u){const b=a[v]-f,g=a[v+1]-m;p[_++]=f+c*b,p[_++]=m+h*g;for(let y=v+2;y<v+u;++y)p[_++]=a[y]}p&&p.length!=_&&(p.length=_)})(r,0,r.length,o,t,i,n,r),this.changed()}}translate(t,i){const n=this.getFlatCoordinates();if(n){const r=this.getStride();(function(o,a,s,l,u,c,h){h=h||[];let d=0;for(let p=a;p<s;p+=l){h[d++]=o[p]+u,h[d++]=o[p+1]+c;for(let f=p+2;f<p+l;++f)h[d++]=o[f]}h&&h.length!=d&&(h.length=d)})(n,0,n.length,r,t,i,n),this.changed()}}}function Xo(e){let t;return e==2?t="XY":e==3?t="XYZ":e==4&&(t="XYZM"),t}function zc(e){let t;return e=="XY"?t=2:e=="XYZ"||e=="XYM"?t=3:e=="XYZM"&&(t=4),t}function Xy(e,t,i,n,r,o,a){const s=e[t],l=e[t+1],u=e[i]-s,c=e[i+1]-l;let h;if(u===0&&c===0)h=t;else{const d=((r-s)*u+(o-l)*c)/(u*u+c*c);if(d>1)h=i;else{if(d>0){for(let p=0;p<n;++p)a[p]=nn(e[t+p],e[i+p],d);return void(a.length=n)}h=t}}for(let d=0;d<n;++d)a[d]=e[h+d];a.length=n}function yp(e,t,i,n,r){let o=e[t],a=e[t+1];for(t+=n;t<i;t+=n){const s=e[t],l=e[t+1],u=Sr(o,a,s,l);u>r&&(r=u),o=s,a=l}return r}function _p(e,t,i,n,r){for(let o=0,a=i.length;o<a;++o){const s=i[o];r=yp(e,t,s,n,r),t=s}return r}function bp(e,t,i,n,r,o,a,s,l,u,c){if(t==i)return u;let h,d;if(r===0){if(d=Sr(a,s,e[t],e[t+1]),d<u){for(h=0;h<n;++h)l[h]=e[t+h];return l.length=n,d}return u}c=c||[NaN,NaN];let p=t+n;for(;p<i;)if(Xy(e,p-n,p,n,a,s,c),d=Sr(a,s,c[0],c[1]),d<u){for(u=d,h=0;h<n;++h)l[h]=c[h];l.length=n,p+=n}else p+=n*Math.max((Math.sqrt(d)-Math.sqrt(u))/r|0,1);if(o&&(Xy(e,i-n,t,n,a,s,c),d=Sr(a,s,c[0],c[1]),d<u)){for(u=d,h=0;h<n;++h)l[h]=c[h];l.length=n}return u}function xp(e,t,i,n,r,o,a,s,l,u,c){c=c||[NaN,NaN];for(let h=0,d=i.length;h<d;++h){const p=i[h];u=bp(e,t,p,n,r,o,a,s,l,u,c),t=p}return u}function Ky(e,t,i,n){for(let r=0,o=i.length;r<o;++r)e[t++]=i[r];return t}function Fc(e,t,i,n){for(let r=0,o=i.length;r<o;++r){const a=i[r];for(let s=0;s<n;++s)e[t++]=a[s]}return t}function Fl(e,t,i,n,r){r=r||[];let o=0;for(let a=0,s=i.length;a<s;++a){const l=Fc(e,t,i[a],n);r[o++]=l,t=l}return r.length=o,r}function Yy(e,t,i,n,r){r=r||[];let o=0;for(let a=0,s=i.length;a<s;++a){const l=Fl(e,t,i[a],n,r[o]);l.length===0&&(l[0]=t),r[o++]=l,t=l[l.length-1]}return r.length=o,r}function Oc(e,t,i,n,r,o,a){const s=(i-t)/n;if(s<3){for(;t<i;t+=n)o[a++]=e[t],o[a++]=e[t+1];return a}const l=new Array(s);l[0]=1,l[s-1]=1;const u=[t,i-n];let c=0;for(;u.length>0;){const h=u.pop(),d=u.pop();let p=0;const f=e[d],m=e[d+1],_=e[h],v=e[h+1];for(let b=d+n;b<h;b+=n){const g=e4(e[b],e[b+1],f,m,_,v);g>p&&(c=b,p=g)}p>r&&(l[(c-t)/n]=1,d+n<c&&u.push(d,c),c+n<h&&u.push(c,h))}for(let h=0;h<s;++h)l[h]&&(o[a++]=e[t+h*n],o[a++]=e[t+h*n+1]);return a}function Zy(e,t,i,n,r,o,a,s){for(let l=0,u=i.length;l<u;++l){const c=i[l];a=Oc(e,t,c,n,r,o,a),s.push(a),t=c}return a}function Ko(e,t){return t*Math.round(e/t)}function k4(e,t,i,n,r,o,a){if(t==i)return a;let s,l,u=Ko(e[t],r),c=Ko(e[t+1],r);t+=n,o[a++]=u,o[a++]=c;do if(s=Ko(e[t],r),l=Ko(e[t+1],r),(t+=n)==i)return o[a++]=s,o[a++]=l,a;while(s==u&&l==c);for(;t<i;){const h=Ko(e[t],r),d=Ko(e[t+1],r);if(t+=n,h==s&&d==l)continue;const p=s-u,f=l-c,m=h-u,_=d-c;p*_==f*m&&(p<0&&m<p||p==m||p>0&&m>p)&&(f<0&&_<f||f==_||f>0&&_>f)?(s=h,l=d):(o[a++]=s,o[a++]=l,u=s,c=l,s=h,l=d)}return o[a++]=s,o[a++]=l,a}function wp(e,t,i,n,r,o,a,s){for(let l=0,u=i.length;l<u;++l){const c=i[l];a=k4(e,t,c,n,r,o,a),s.push(a),t=c}return a}function no(e,t,i,n,r){r=r!==void 0?r:[];let o=0;for(let a=t;a<i;a+=n)r[o++]=e.slice(a,a+n);return r.length=o,r}function Ol(e,t,i,n,r){r=r!==void 0?r:[];let o=0;for(let a=0,s=i.length;a<s;++a){const l=i[a];r[o++]=no(e,t,l,n,r[o]),t=l}return r.length=o,r}function Sp(e,t,i,n,r){r=r!==void 0?r:[];let o=0;for(let a=0,s=i.length;a<s;++a){const l=i[a];r[o++]=l.length===1&&l[0]===t?[]:Ol(e,t,l,n,r[o]),t=l[l.length-1]}return r.length=o,r}function Qy(e,t,i,n){let r=0;const o=e[i-n],a=e[i-n+1];let s=0,l=0;for(;t<i;t+=n){const u=e[t]-o,c=e[t+1]-a;r+=l*u-s*c,s=u,l=c}return r/2}function Jy(e,t,i,n){let r=0;for(let o=0,a=i.length;o<a;++o){const s=i[o];r+=Qy(e,t,s,n),t=s}return r}class hc extends io{constructor(t,i){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,i===void 0||Array.isArray(t[0])?this.setCoordinates(t,i):this.setFlatCoordinates(i,t)}clone(){return new hc(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,i,n,r){return r<$o(this.getExtent(),t,i)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(yp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),bp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,i,n,r))}getArea(){return Qy(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return no(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const i=[];return i.length=Oc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new hc(i,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,i){this.setLayout(i,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Fc(this.flatCoordinates,0,t,this.stride),this.changed()}}class Tn extends io{constructor(t,i){super(),this.setCoordinates(t,i)}clone(){const t=new Tn(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,i,n,r){const o=this.flatCoordinates,a=Sr(t,i,o[0],o[1]);if(a<r){const s=this.stride;for(let l=0;l<s;++l)n[l]=o[l];return n.length=s,a}return r}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return fy(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return H0(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ky(this.flatCoordinates,0,t,this.stride),this.changed()}}function T4(e,t,i,n,r){return!K0(r,function(o){return!Yo(e,t,i,n,o[0],o[1])})}function Yo(e,t,i,n,r,o){let a=0,s=e[i-n],l=e[i-n+1];for(;t<i;t+=n){const u=e[t],c=e[t+1];l<=o?c>o&&(u-s)*(o-l)-(r-s)*(c-l)>0&&a++:c<=o&&(u-s)*(o-l)-(r-s)*(c-l)<0&&a--,s=u,l=c}return a!==0}function Cp(e,t,i,n,r,o){if(i.length===0||!Yo(e,t,i[0],n,r,o))return!1;for(let a=1,s=i.length;a<s;++a)if(Yo(e,i[a-1],i[a],n,r,o))return!1;return!0}function Mp(e,t,i,n,r,o,a){let s,l,u,c,h,d,p;const f=r[o+1],m=[];for(let b=0,g=i.length;b<g;++b){const y=i[b];for(c=e[y-n],d=e[y-n+1],s=t;s<y;s+=n)h=e[s],p=e[s+1],(f<=d&&p<=f||d<=f&&f<=p)&&(u=(f-d)/(p-d)*(h-c)+c,m.push(u)),c=h,d=p}let _=NaN,v=-1/0;for(m.sort(Kn),c=m[0],s=1,l=m.length;s<l;++s){h=m[s];const b=Math.abs(h-c);b>v&&(u=(c+h)/2,Cp(e,t,i,n,u,f)&&(_=u,v=b)),c=h}return isNaN(_)&&(_=r[o]),a?(a.push(_,f,v),a):[_,f,v]}function t_(e,t,i,n,r){let o=[];for(let a=0,s=i.length;a<s;++a){const l=i[a];o=Mp(e,t,l,n,r,2*a,o),t=l[l.length-1]}return o}function e_(e,t,i,n,r){let o;for(t+=n;t<i;t+=n)if(o=r(e.slice(t-n,t),e.slice(t,t+n)),o)return o;return!1}function Dc(e,t,i,n,r){const o=my([1/0,1/0,-1/0,-1/0],e,t,i,n);return!!Ye(r,o)&&(!!Rn(r,o)||o[0]>=r[0]&&o[2]<=r[2]||o[1]>=r[1]&&o[3]<=r[3]||e_(e,t,i,n,function(a,s){return function(l,u,c){let h=!1;const d=U0(l,u),p=U0(l,c);if(d===Cc||p===Cc)h=!0;else{const f=l[0],m=l[1],_=l[2],v=l[3],b=u[0],g=u[1],y=c[0],x=c[1],C=(x-g)/(y-b);let M,P;p&j0&&!(d&j0)&&(M=y-(x-v)/C,h=M>=f&&M<=_),h||!(p&V0)||d&V0||(P=x-(y-_)*C,h=P>=m&&P<=v),h||!(p&$0)||d&$0||(M=y-(x-m)/C,h=M>=f&&M<=_),h||!(p&G0)||d&G0||(P=x-(y-f)*C,h=P>=m&&P<=v)}return h}(r,a,s)}))}function i_(e,t,i,n,r){return!!Dc(e,t,i,n,r)||!!Yo(e,t,i,n,r[0],r[1])||!!Yo(e,t,i,n,r[0],r[3])||!!Yo(e,t,i,n,r[2],r[1])||!!Yo(e,t,i,n,r[2],r[3])}function n_(e,t,i,n,r){if(!i_(e,t,i[0],n,r))return!1;if(i.length===1)return!0;for(let o=1,a=i.length;o<a;++o)if(T4(e,i[o-1],i[o],n,r)&&!Dc(e,i[o-1],i[o],n,r))return!1;return!0}function E4(e,t,i,n){for(;t<i-n;){for(let r=0;r<n;++r){const o=e[t+r];e[t+r]=e[i-n+r],e[i-n+r]=o}t+=n,i-=n}}function kp(e,t,i,n){let r=0,o=e[i-n],a=e[i-n+1];for(;t<i;t+=n){const s=e[t],l=e[t+1];r+=(s-o)*(l+a),o=s,a=l}return r===0?void 0:r>0}function Tp(e,t,i,n,r){r=r!==void 0&&r;for(let o=0,a=i.length;o<a;++o){const s=i[o],l=kp(e,t,s,n);if(o===0){if(r&&l||!r&&!l)return!1}else if(r&&!l||!r&&l)return!1;t=s}return!0}function r_(e,t,i,n,r){for(let o=0,a=i.length;o<a;++o){const s=i[o];if(!Tp(e,t,s,n,r))return!1;s.length&&(t=s[s.length-1])}return!0}function Nc(e,t,i,n,r){r=r!==void 0&&r;for(let o=0,a=i.length;o<a;++o){const s=i[o],l=kp(e,t,s,n);(o===0?r&&l||!r&&!l:r&&!l||!r&&l)&&E4(e,t,s,n),t=s}return t}function Ep(e,t,i,n,r){for(let o=0,a=i.length;o<a;++o)t=Nc(e,t,i[o],n,r);return t}function o_(e,t){const i=[];let n,r=0,o=0;for(let a=0,s=t.length;a<s;++a){const l=t[a],u=kp(e,r,l,2);if(n===void 0&&(n=u),u===n)i.push(t.slice(o,a+1));else{if(i.length===0)continue;i[i.length-1].push(t[o])}o=a+1,r=l}return i}class Ji extends io{constructor(t,i,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,i!==void 0&&n?(this.setFlatCoordinates(i,t),this.ends_=n):this.setCoordinates(t,i)}appendLinearRing(t){this.flatCoordinates?Yn(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new Ji(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,i,n,r){return r<$o(this.getExtent(),t,i)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(_p(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),xp(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,i,n,r))}containsXY(t,i){return Cp(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,i)}getArea(){return Jy(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let i;return t!==void 0?(i=this.getOrientedFlatCoordinates().slice(),Nc(i,0,this.ends_,this.stride,t)):i=this.flatCoordinates,Ol(i,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=$i(this.getExtent());this.flatInteriorPoint_=Mp(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Tn(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new hc(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,i=this.flatCoordinates,n=this.ends_,r=[];let o=0;for(let a=0,s=n.length;a<s;++a){const l=n[a],u=new hc(i.slice(o,l),t);r.push(u),o=l}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;Tp(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Nc(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const i=[],n=[];return i.length=wp(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,n),new Ji(i,"XY",n)}getType(){return"Polygon"}intersectsExtent(t){return n_(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,i){this.setLayout(i,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const n=Fl(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}}function Lp(e){if(Ho(e))throw new Error("Cannot create polygon from empty extent");const t=e[0],i=e[1],n=e[2],r=e[3],o=[t,i,t,r,n,r,n,i,t,i];return new Ji(o,"XY",[o.length])}function Bc(e,t){setTimeout(function(){e(t)},0)}function L4(e){return!(e.sourceCenter&&e.targetCenter&&!Pc(e.sourceCenter,e.targetCenter))&&e.sourceResolution===e.targetResolution&&e.sourceRotation===e.targetRotation}function Pp(e,t,i,n,r){const o=Math.cos(-r);let a=Math.sin(-r),s=e[0]*o-e[1]*a,l=e[1]*o+e[0]*a;return s+=(t[0]/2-i[0])*n,l+=(i[1]-t[1]/2)*n,a=-a,[s*o-l*a,l*o+s*a]}var on=class extends mn{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=ap(e.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,e.projection&&qy(),e.center&&(e.center=qn(e.center,this.projection_)),e.extent&&(e.extent=er(e.extent,this.projection_)),this.applyOptions_(e)}applyOptions_(e){const t=Object.assign({},e);for(const a in In)delete t[a];this.setProperties(t,!0);const i=function(a){let s,l,u,d=a.minZoom!==void 0?a.minZoom:0,p=a.maxZoom!==void 0?a.maxZoom:28;const f=a.zoomFactor!==void 0?a.zoomFactor:2,m=a.multiWorld!==void 0&&a.multiWorld,_=a.smoothResolutionConstraint===void 0||a.smoothResolutionConstraint,v=a.showFullExtent!==void 0&&a.showFullExtent,b=ap(a.projection,"EPSG:3857"),g=b.getExtent();let y=a.constrainOnlyCenter,x=a.extent;if(m||x||!b.isGlobal()||(y=!1,x=g),a.resolutions!==void 0){const C=a.resolutions;l=C[d],u=C[p]!==void 0?C[p]:C[C.length-1],s=a.constrainResolution?function(M,P,z,E){return P=P===void 0||P,function(L,T,I,k){if(L!==void 0){const R=M[0],q=M[M.length-1],A=z?dp(R,z,I,E):R;if(k)return P?pp(L,A,q):Ue(L,q,A);const j=Math.min(A,L),V=Math.floor(mc(M,j,T));return M[V]>A&&V<M.length-1?M[V+1]:M[V]}}}(C,_,!y&&x,v):Ny(l,u,_,!y&&x,v)}else{const C=(g?Math.max(ie(g),We(g)):360*Cr.degrees/b.getMetersPerUnit())/N0/Math.pow(2,0),M=C/Math.pow(2,28);l=a.maxResolution,l!==void 0?d=0:l=C/Math.pow(f,d),u=a.minResolution,u===void 0&&(u=a.maxZoom!==void 0?a.maxResolution!==void 0?l/Math.pow(f,p):C/Math.pow(f,p):M),p=d+Math.floor(Math.log(l/u)/Math.log(f)),u=l/Math.pow(f,p-d),s=a.constrainResolution?function(P,z,E,L,T,I){return L=L===void 0||L,E=E!==void 0?E:0,function(k,R,q,A){if(k!==void 0){const j=T?dp(z,T,q,I):z;if(A)return L?pp(k,j,E):Ue(k,E,j);const V=1e-9,B=Math.ceil(Math.log(z/j)/Math.log(P)-V),F=-R*(.5-V)+.5,tt=Math.min(j,k),it=Math.floor(Math.log(z/tt)/Math.log(P)+F),et=Math.max(B,it);return Ue(z/Math.pow(P,et),E,j)}}}(f,l,u,_,!y&&x,v):Ny(l,u,_,!y&&x,v)}return{constraint:s,maxResolution:l,minResolution:u,minZoom:d,zoomFactor:f}}(e);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=e.resolutions,this.padding_=e.padding,this.minZoom_=i.minZoom;const n=function(a){if(a.extent!==void 0){const l=a.smoothExtentConstraint===void 0||a.smoothExtentConstraint;return Dy(a.extent,a.constrainOnlyCenter,l)}const s=ap(a.projection,"EPSG:3857");if(a.multiWorld!==!0&&s.isGlobal()){const l=s.getExtent().slice();return l[0]=-1/0,l[2]=1/0,Dy(l,!1,!1)}return S4}(e),r=i.constraint,o=function(a){if(a.enableRotation===void 0||a.enableRotation){const l=a.constrainRotation;return l===void 0||l===!0?function(u){const c=u===void 0?Ln(5):u;return function(h,d){return d||h===void 0?h:Math.abs(h)<=c?0:h}}():l===!1?By:typeof l=="number"?function(u){const c=2*Math.PI/u;return function(h,d){return d?h:h!==void 0?h=Math.floor(h/c+.5)*c:void 0}}(l):By}return fp}(e);this.constraints_={center:n,resolution:r,rotation:o},this.setRotation(e.rotation!==void 0?e.rotation:0),this.setCenterInternal(e.center!==void 0?e.center:null),e.resolution!==void 0?this.setResolution(e.resolution):e.zoom!==void 0&&this.setZoom(e.zoom)}get padding(){return this.padding_}set padding(e){let t=this.padding_;this.padding_=e;const i=this.getCenterInternal();if(i){const n=e||[0,0,0,0];t=t||[0,0,0,0];const r=this.getResolution(),o=r/2*(n[3]-t[3]+t[1]-n[1]),a=r/2*(n[0]-t[0]+t[2]-n[2]);this.setCenterInternal([i[0]+o,i[1]-a])}}getUpdatedOptions_(e){const t=this.getProperties();return t.resolution!==void 0?t.resolution=this.getResolution():t.zoom=this.getZoom(),t.center=this.getCenterInternal(),t.rotation=this.getRotation(),Object.assign({},t,e)}animate(e){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const t=new Array(arguments.length);for(let i=0;i<t.length;++i){let n=arguments[i];n.center&&(n=Object.assign({},n),n.center=qn(n.center,this.getProjection())),n.anchor&&(n=Object.assign({},n),n.anchor=qn(n.anchor,this.getProjection())),t[i]=n}this.animateInternal.apply(this,t)}animateInternal(e){let t,i=arguments.length;i>1&&typeof arguments[i-1]=="function"&&(t=arguments[i-1],--i);let n=0;for(;n<i&&!this.isDef();++n){const u=arguments[n];u.center&&this.setCenterInternal(u.center),u.zoom!==void 0?this.setZoom(u.zoom):u.resolution&&this.setResolution(u.resolution),u.rotation!==void 0&&this.setRotation(u.rotation)}if(n===i)return void(t&&Bc(t,!0));let r=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,s=this.targetRotation_;const l=[];for(;n<i;++n){const u=arguments[n],c={start:r,complete:!1,anchor:u.anchor,duration:u.duration!==void 0?u.duration:1e3,easing:u.easing||C4,callback:t};if(u.center&&(c.sourceCenter=o,c.targetCenter=u.center.slice(),o=c.targetCenter),u.zoom!==void 0?(c.sourceResolution=a,c.targetResolution=this.getResolutionForZoom(u.zoom),a=c.targetResolution):u.resolution&&(c.sourceResolution=a,c.targetResolution=u.resolution,a=c.targetResolution),u.rotation!==void 0){c.sourceRotation=s;const h=Zr(u.rotation-s+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=s+h,s=c.targetRotation}L4(c)?c.complete=!0:r+=c.duration,l.push(c)}this.animations_.push(l),this.setHint(rn,1),this.updateAnimations_()}getAnimating(){return this.hints_[rn]>0}getInteracting(){return this.hints_[Pn]>0}cancelAnimations(){let e;this.setHint(rn,-this.hints_[rn]);for(let t=0,i=this.animations_.length;t<i;++t){const n=this.animations_[t];if(n[0].callback&&Bc(n[0].callback,!1),!e)for(let r=0,o=n.length;r<o;++r){const a=n[r];if(!a.complete){e=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=e,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;const e=Date.now();let t=!1;for(let i=this.animations_.length-1;i>=0;--i){const n=this.animations_[i];let r=!0;for(let o=0,a=n.length;o<a;++o){const s=n[o];if(s.complete)continue;const l=e-s.start;let u=s.duration>0?l/s.duration:1;u>=1?(s.complete=!0,u=1):r=!1;const c=s.easing(u);if(s.sourceCenter){const h=s.sourceCenter[0],d=s.sourceCenter[1],p=s.targetCenter[0],f=s.targetCenter[1];this.nextCenter_=s.targetCenter;const m=h+c*(p-h),_=d+c*(f-d);this.targetCenter_=[m,_]}if(s.sourceResolution&&s.targetResolution){const h=c===1?s.targetResolution:s.sourceResolution+c*(s.targetResolution-s.sourceResolution);if(s.anchor){const d=this.getViewportSize_(this.getRotation()),p=this.constraints_.resolution(h,0,d,!0);this.targetCenter_=this.calculateCenterZoom(p,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=h,this.applyTargetState_(!0)}if(s.sourceRotation!==void 0&&s.targetRotation!==void 0){const h=c===1?Zr(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+c*(s.targetRotation-s.sourceRotation);if(s.anchor){const d=this.cons