(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[8857],{91866:(t,e,i)=>{"use strict";i.d(e,{q:()=>a});var n=i(77813),o=i(76687),r=i(27668),s=i(52010);const a=t=>{let{colorPalette:e,min:i,max:n,display:a,hoverValue:u,useStopsPercentage:c}=t;const[p,d]=(0,o.useState)([]),[f,g]=(0,o.useState)({isShown:!1,value:0}),[_,v]=(0,o.useState)(null),y=(0,r.l4)(),m=h(y,p);(0,o.useEffect)((()=>{d(l({colorArray:e,stops:10,useStopsPercentage:c}))}),[e,c]);return(0,o.useEffect)((()=>{v(null==u?null:function(t){if(t>1)return 100;if(t<0)return 0;return 100*t}((u-i)/(n-i)))}),[u,i,n]),(0,s.jsxs)("div",{className:m.scaleWrapper,onMouseMove:t=>{const e=t.nativeEvent.offsetX,o=t.target.offsetWidth,r=Math.floor(100*e/o+1),s=Math.floor((n-i)*r/100+i);g({isShown:!0,value:s}),v(r)},onMouseLeave:()=>{g({isShown:!1,value:0})},children:[(0,s.jsx)("div",{className:m.scaleGradient,children:a&&(f.isShown||void 0!==u)&&(0,s.jsx)("div",{className:m.followerContainer,children:(0,s.jsx)("div",{className:m.follower,style:{left:`${_}%`}})})}),a&&(0,s.jsxs)("div",{className:m.followerContainer,children:[(0,s.jsxs)("div",{className:m.legendValues,children:[(0,s.jsx)("span",{children:a(i)}),(0,s.jsx)("span",{children:a(n)})]}),null!=_&&(f.isShown||void 0!==u)&&(0,s.jsx)("span",{className:m.hoverValue,style:{left:`${_}%`},children:a(null!=u?u:f.value)})]})]})},l=t=>{let{colorArray:e,stops:i,useStopsPercentage:n=!0}=t;const o=e.length;if(n&&o<=20){const t=1/o*100;let i=0;const n=[];for(const o of e)i>0?n.push(`${o} ${i}%`):n.push(o),i+=t,n.push(`${o} ${i}%`);return n}const r=e[o-1],s=Math.ceil(o/i),a=new Set;for(let t=0;t<o;t+=s)a.add(e[t]);return a.add(r),[...a]};const h=(t,e)=>({scaleWrapper:n.css`
    width: 100%;
    font-size: 11px;
    opacity: 1;
  `,scaleGradient:n.css`
    background: linear-gradient(90deg, ${e.join()});
    height: 10px;
    pointer-events: none;
  `,legendValues:n.css`
    display: flex;
    justify-content: space-between;
    pointer-events: none;
  `,hoverValue:n.css`
    position: absolute;
    margin-top: -14px;
    padding: 3px 15px;
    background: ${t.colors.background.primary};
    transform: translateX(-50%);
  `,followerContainer:n.css`
    position: relative;
    pointer-events: none;
    white-space: nowrap;
  `,follower:n.css`
    position: absolute;
    height: 14px;
    width: 14px;
    border-radius: 50%;
    transform: translateX(-50%) translateY(-50%);
    border: 2px solid ${t.colors.text.primary};
    margin-top: 5px;
  `})},34725:(t,e,i)=>{"use strict";i.d(e,{f:()=>r});i(76687);var n=i(58574),o=i(52010);const r=t=>{let{onChange:e,options:i,label:r}=t;return(0,o.jsx)(n.b,{icon:"plus",label:r,variant:"secondary",options:i,onChange:e,isFullWidth:!0})}},42059:(t,e,i)=>{"use strict";i.r(e),i.d(e,{plugin:()=>mp});var n=i(76687),o=i(92394),r=i(67273),s=i(7705),a=i(77813),l=i(35879),h=i(41659),u=i(96361);const c=0,p=1,d={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var f=256,g=i(97601),_=i(28344),v=i(80937),y=i(26167),m=i(38008),x=i(35599);function w(t,e,i){return function(n,o,r,s,a){if(n){if(!o&&!e)return n;var l=e?0:r[0]*o,h=e?0:r[1]*o,u=a?a[0]:0,c=a?a[1]:0,p=t[0]+l/2+u,d=t[2]-l/2+u,f=t[1]+h/2+c,g=t[3]-h/2+c;p>d&&(d=p=(d+p)/2),f>g&&(g=f=(g+f)/2);var _=(0,x.uZ)(n[0],p,d),v=(0,x.uZ)(n[1],f,g);if(s&&i&&o){var y=30*o;_+=-y*Math.log(1+Math.max(0,p-n[0])/y)+y*Math.log(1+Math.max(0,n[0]-d)/y),v+=-y*Math.log(1+Math.max(0,f-n[1])/y)+y*Math.log(1+Math.max(0,n[1]-g)/y)}return[_,v]}}}function b(t){return t}var C=i(90690),S=i(10594);function E(t,e,i,n){var o=(0,C.dz)(e)/i[0],r=(0,C.Cr)(e)/i[1];return n?Math.min(t,Math.max(o,r)):Math.min(t,Math.min(o,r))}function T(t,e,i){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/t-1))/50+1),(0,x.uZ)(n,i/2,2*e)}function R(t,e,i,n,o){return function(r,s,a,l){if(void 0!==r){var h=n?E(t,n,a,o):t;return(void 0===i||i)&&l?T(r,h,e):(0,x.uZ)(r,e,h)}}}function O(t){return void 0!==t?0:void 0}function P(t){return void 0!==t?t:void 0}function I(t){return Math.pow(t,3)}function L(t){return 1-I(1-t)}function M(t){return 3*t*t-2*t*t*t}function F(t){return t}var A,k=i(79826),D=(A=function(t,e){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},A(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}A(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});function j(t,e){setTimeout((function(){t(e)}),0)}function z(t){return!(t.sourceCenter&&t.targetCenter&&!(0,v.fS)(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function B(t,e,i,n,o){var r=Math.cos(-o),s=Math.sin(-o),a=t[0]*r-t[1]*s,l=t[1]*r+t[0]*s;return[(a+=(e[0]/2-i[0])*n)*r-(l+=(i[1]-e[1]/2)*n)*(s=-s),l*r+a*s]}const N=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var n=(0,m.f0)({},e);return i.hints_=[0,0],i.animations_=[],i.updateAnimationKey_,i.projection_=(0,g.UQ)(n.projection,"EPSG:3857"),i.viewportSize_=[100,100],i.targetCenter_=null,i.targetResolution_,i.targetRotation_,i.nextCenter_=null,i.nextResolution_,i.nextRotation_,i.cancelAnchor_=void 0,n.projection&&(0,g.h_)(),n.center&&(n.center=(0,g.Vs)(n.center,i.projection_)),n.extent&&(n.extent=(0,g.dY)(n.extent,i.projection_)),i.applyOptions_(n),i}return D(e,t),e.prototype.applyOptions_=function(t){var e=(0,m.f0)({},t);for(var i in d)delete e[i];this.setProperties(e,!0);var n=function(t){var e,i,n,o=28,r=2,s=void 0!==t.minZoom?t.minZoom:0,a=void 0!==t.maxZoom?t.maxZoom:o,l=void 0!==t.zoomFactor?t.zoomFactor:r,h=void 0!==t.multiWorld&&t.multiWorld,c=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,p=void 0!==t.showFullExtent&&t.showFullExtent,d=(0,g.UQ)(t.projection,"EPSG:3857"),_=d.getExtent(),v=t.constrainOnlyCenter,y=t.extent;h||y||!d.isGlobal()||(v=!1,y=_);if(void 0!==t.resolutions){var m=t.resolutions;i=m[s],n=void 0!==m[a]?m[a]:m[m.length-1],e=t.constrainResolution?function(t,e,i,n){return function(o,r,s,a){if(void 0!==o){var l=t[0],h=t[t.length-1],u=i?E(l,i,s,n):l;if(a)return void 0===e||e?T(o,u,h):(0,x.uZ)(o,h,u);var c=Math.min(u,o),p=Math.floor((0,S.h7)(t,c,r));return t[p]>u&&p<t.length-1?t[p+1]:t[p]}}}(m,c,!v&&y,p):R(i,n,c,!v&&y,p)}else{var w=(_?Math.max((0,C.dz)(_),(0,C.Cr)(_)):360*g.Wm[u.ZP.DEGREES]/d.getMetersPerUnit())/f/Math.pow(r,0),b=w/Math.pow(r,o-0);void 0!==(i=t.maxResolution)?s=0:i=w/Math.pow(l,s),void 0===(n=t.minResolution)&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(l,a):w/Math.pow(l,a):b),a=s+Math.floor(Math.log(i/n)/Math.log(l)),n=i/Math.pow(l,a-s),e=t.constrainResolution?function(t,e,i,n,o,r){return function(s,a,l,h){if(void 0!==s){var u=o?E(e,o,l,r):e,c=void 0!==i?i:0;if(h)return void 0===n||n?T(s,u,c):(0,x.uZ)(s,c,u);var p=Math.ceil(Math.log(e/u)/Math.log(t)-1e-9),d=-a*(.5-1e-9)+.5,f=Math.min(u,s),g=Math.floor(Math.log(e/f)/Math.log(t)+d),_=Math.max(p,g),v=e/Math.pow(t,_);return(0,x.uZ)(v,c,u)}}}(l,i,n,c,!v&&y,p):R(i,n,c,!v&&y,p)}return{constraint:e,maxResolution:i,minResolution:n,minZoom:s,zoomFactor:l}}(t);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=n.minZoom;var o=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return w(t.extent,t.constrainOnlyCenter,e)}var i=(0,g.UQ)(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&i.isGlobal()){var n=i.getExtent().slice();return n[0]=-1/0,n[2]=1/0,w(n,!1,!1)}return b}(t),r=n.constraint,s=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(r=o||(0,x.Yr)(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=r?0:t:void 0}):!1===e?P:"number"==typeof e?(i=e,n=2*Math.PI/i,function(t,e){return e?t:void 0!==t?t=Math.floor(t/n+.5)*n:void 0}):P}return O;var i,n;var o,r}(t);this.constraints_={center:o,resolution:r,rotation:s},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var i=this.getCenter();if(i){var n=t||[0,0,0,0];e=e||[0,0,0,0];var o=this.getResolution(),r=o/2*(n[3]-e[3]+e[1]-n[1]),s=o/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([i[0]+r,i[1]-s])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=this.getProperties();return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),(0,m.f0)({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),i=0;i<e.length;++i){var n=arguments[i];n.center&&((n=(0,m.f0)({},n)).center=(0,g.Vs)(n.center,this.getProjection())),n.anchor&&((n=(0,m.f0)({},n)).anchor=(0,g.Vs)(n.anchor,this.getProjection())),e[i]=n}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,i=arguments.length;i>1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i);for(var n=0;n<i&&!this.isDef();++n){var o=arguments[n];o.center&&this.setCenterInternal(o.center),void 0!==o.zoom?this.setZoom(o.zoom):o.resolution&&this.setResolution(o.resolution),void 0!==o.rotation&&this.setRotation(o.rotation)}if(n!==i){for(var r=Date.now(),s=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_,h=[];n<i;++n){var u=arguments[n],p={start:r,complete:!1,anchor:u.anchor,duration:void 0!==u.duration?u.duration:1e3,easing:u.easing||M,callback:e};if(u.center&&(p.sourceCenter=s,p.targetCenter=u.center.slice(),s=p.targetCenter),void 0!==u.zoom?(p.sourceResolution=a,p.targetResolution=this.getResolutionForZoom(u.zoom),a=p.targetResolution):u.resolution&&(p.sourceResolution=a,p.targetResolution=u.resolution,a=p.targetResolution),void 0!==u.rotation){p.sourceRotation=l;var d=(0,x.$W)(u.rotation-l+Math.PI,2*Math.PI)-Math.PI;p.targetRotation=l+d,l=p.targetRotation}z(p)?p.complete=!0:r+=p.duration,h.push(p)}this.animations_.push(h),this.setHint(c,1),this.updateAnimations_()}else e&&j(e,!0)},e.prototype.getAnimating=function(){return this.hints_[c]>0},e.prototype.getInteracting=function(){return this.hints_[p]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(c,-this.hints_[c]);for(var e=0,i=this.animations_.length;e<i;++e){var n=this.animations_[e];if(n[0].callback&&j(n[0].callback,!1),!t)for(var o=0,r=n.length;o<r;++o){var s=n[o];if(!s.complete){t=s.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,i=this.animations_.length-1;i>=0;--i){for(var n=this.animations_[i],o=!0,r=0,s=n.length;r<s;++r){var a=n[r];if(!a.complete){var l=t-a.start,h=a.duration>0?l/a.duration:1;h>=1?(a.complete=!0,h=1):o=!1;var u=a.easing(h);if(a.sourceCenter){var p=a.sourceCenter[0],d=a.sourceCenter[1],f=a.targetCenter[0],g=a.targetCenter[1];this.nextCenter_=a.targetCenter;var _=p+u*(f-p),v=d+u*(g-d);this.targetCenter_=[_,v]}if(a.sourceResolution&&a.targetResolution){var y=1===u?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);if(a.anchor){var m=this.getViewportSize_(this.getRotation()),w=this.constraints_.resolution(y,0,m,!0);this.targetCenter_=this.calculateCenterZoom(w,a.anchor)}this.nextResolution_=a.targetResolution,this.targetResolution_=y,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var b=1===u?(0,x.$W)(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);if(a.anchor){var C=this.constraints_.rotation(b,!0);this.targetCenter_=this.calculateCenterRotate(C,a.anchor)}this.nextRotation_=a.targetRotation,this.targetRotation_=b}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(o){this.animations_[i]=null,this.setHint(c,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var S=n[0].callback;S&&j(S,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var i,n=this.getCenterInternal();return void 0!==n&&(i=[n[0]-e[0],n[1]-e[1]],(0,v.U1)(i,t-this.getRotation()),(0,v.IH)(i,e)),i},e.prototype.calculateCenterZoom=function(t,e){var i,n=this.getCenterInternal(),o=this.getResolution();void 0!==n&&void 0!==o&&(i=[e[0]-t*(e[0]-n[0])/o,e[1]-t*(e[1]-n[1])/o]);return i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?(0,g.lO)(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(d.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){var e=this.calculateExtentInternal(t);return(0,g.Fj)(e,this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();(0,y.h)(i,1);var n=this.getResolution();(0,y.h)(void 0!==n,2);var o=this.getRotation();return(0,y.h)(void 0!==o,3),(0,C.p8)(i,n,o,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(d.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal((0,g.dY)(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSizeMinusPadding_(),n=(0,C.dz)(t)/i[0],o=(0,C.Cr)(t)/i[1];return Math.max(n,o)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,o=Math.log(i/n)/Math.log(e);return function(t){return i/Math.pow(e,t*o)}},e.prototype.getRotation=function(){return this.get(d.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,o=Math.log(i/n)/e;return function(t){return Math.log(i/t)/e/o}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),n=this.getCenterInternal(),o=this.padding_;if(o){var r=this.getViewportSizeMinusPadding_();n=B(n,this.getViewportSize_(),[r[0]/2+o[3],r[1]/2+o[0]],e,i)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,n=this.minZoom_||0;if(this.resolutions_){var o=(0,S.h7)(this.resolutions_,t,1);n=o,e=this.resolutions_[o],i=o==this.resolutions_.length-1?2:e/this.resolutions_[o+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=(0,x.uZ)(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,(0,x.uZ)(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if((0,y.h)(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t)){(0,y.h)(!(0,C.xb)(t),25);var n=(0,g.dY)(t,this.getProjection());i=(0,k.oJ)(n)}else if("Circle"===t.getType()){n=(0,g.dY)(t.getExtent(),this.getProjection());(i=(0,k.oJ)(n)).rotate(this.getRotation(),(0,C.qg)(n))}else{var o=(0,g.Cs)();i=o?t.clone().transform(o,this.getProjection()):t}this.fitInternal(i,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),i=Math.cos(e),n=Math.sin(-e),o=t.getFlatCoordinates(),r=t.getStride(),s=1/0,a=1/0,l=-1/0,h=-1/0,u=0,c=o.length;u<c;u+=r){var p=o[u]*i-o[u+1]*n,d=o[u]*n+o[u+1]*i;s=Math.min(s,p),a=Math.min(a,d),l=Math.max(l,p),h=Math.max(h,d)}return[s,a,l,h]},e.prototype.fitInternal=function(t,e){var i=e||{},n=i.size;n||(n=this.getViewportSizeMinusPadding_());var o,r=void 0!==i.padding?i.padding:[0,0,0,0],s=void 0!==i.nearest&&i.nearest;o=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;var a=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(a,[n[0]-r[1]-r[3],n[1]-r[0]-r[2]]);l=isNaN(l)?o:Math.max(l,o),l=this.getConstrainedResolution(l,s?0:1);var h=this.getRotation(),u=Math.sin(h),c=Math.cos(h),p=(0,C.qg)(a);p[0]+=(r[1]-r[3])/2*l,p[1]+=(r[0]-r[2])/2*l;var d=p[0]*c-p[1]*u,f=p[1]*c+p[0]*u,g=this.getConstrainedCenter([d,f],l),v=i.callback?i.callback:_.Zn;void 0!==i.duration?this.animateInternal({resolution:l,center:g,duration:i.duration,easing:i.easing},v):(this.targetResolution_=l,this.targetCenter_=g,this.applyTargetState_(!1,!0),j(v,!0))},e.prototype.centerOn=function(t,e,i){this.centerOnInternal((0,g.Vs)(t,this.getProjection()),e,i)},e.prototype.centerOnInternal=function(t,e,i){this.setCenterInternal(B(t,e,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,i,n){var o,r=this.padding_;if(r&&t){var s=this.getViewportSizeMinusPadding_(-i),a=B(t,n,[s[0]/2+r[3],s[1]/2+r[0]],e,i);o=[t[0]-a[0],t[1]-a[1]]}return o},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=(0,g.lO)(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var i=e&&(0,g.Vs)(e,this.getProjection());this.adjustResolutionInternal(t,i)},e.prototype.adjustResolutionInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),o=this.constraints_.resolution(this.targetResolution_*t,0,n,i);e&&(this.targetCenter_=this.calculateCenterZoom(o,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=(0,g.Vs)(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(t?(0,g.Vs)(t,this.getProjection()):t)},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var i=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,i),o=this.getViewportSize_(n),r=this.constraints_.resolution(this.targetResolution_,0,o,i),s=this.constraints_.center(this.targetCenter_,r,o,i,this.calculateCenterShift(this.targetCenter_,r,n,o));this.get(d.ROTATION)!==n&&this.set(d.ROTATION,n),this.get(d.RESOLUTION)!==r&&(this.set(d.RESOLUTION,r),this.set("zoom",this.getZoom(),!0)),s&&this.get(d.CENTER)&&(0,v.fS)(this.get(d.CENTER),s)||this.set(d.CENTER,s),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,i){var n=void 0!==t?t:200,o=e||0,r=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,o,s),l=this.constraints_.center(this.targetCenter_,a,s,!1,this.calculateCenterShift(this.targetCenter_,a,r,s));if(0===n&&!this.cancelAnchor_)return this.targetResolution_=a,this.targetRotation_=r,this.targetCenter_=l,void this.applyTargetState_();var h=i||(0===n?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===a&&this.getRotation()===r&&this.getCenterInternal()&&(0,v.fS)(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:a,duration:n,easing:L,anchor:h}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(p,1)},e.prototype.endInteraction=function(t,e,i){var n=i&&(0,g.Vs)(i,this.getProjection());this.endInteractionInternal(t,e,n)},e.prototype.endInteractionInternal=function(t,e,i){this.setHint(p,-1),this.resolveConstraints(t,e,i)},e.prototype.getConstrainedCenter=function(t,e){var i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)},e.prototype.getConstrainedZoom=function(t,e){var i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))},e.prototype.getConstrainedResolution=function(t,e){var i=e||0,n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,n)},e}(h.Z),G="postrender",W="movestart",Z="moveend",U="loadstart",V="loadend";var X=i(73138),Y=i(68454);function K(t,e,i,n){var o;return o=i&&i.length?i.shift():Y.Id?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(o.width=t),e&&(o.height=e),o.getContext("2d",n)}function H(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function q(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function $(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var J=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Q=function(t){function e(e){var i=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),i.element=n||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return J(e,t),e.prototype.disposeInternal=function(){$(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&$(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)(0,X.bN)(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,t)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==_.Zn&&this.listenerKeys.push((0,X.oL)(t,G,this.render,this)),t.render())},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(h.Z);var tt=i(65927),et="ol-hidden",it="ol-unselectable",nt="ol-control",ot="ol-collapsed",rt=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"),st=["style","variant","weight","size","lineHeight","family"],at=function(t){var e=t.match(rt);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,o=st.length;n<o;++n){var r=e[n+1];void 0!==r&&(i[st[n]]=r)}return i.families=i.family.split(/,\s?/),i};const lt="opacity",ht="visible",ut="extent",ct="zIndex",pt="maxResolution",dt="minResolution",ft="maxZoom",gt="minZoom",_t="source",vt="map";var yt=i(63260),mt=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const xt=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un,i.background_=e.background;var n=(0,m.f0)({},e);return"object"==typeof e.properties&&(delete n.properties,(0,m.f0)(n,e.properties)),n[lt]=void 0!==e.opacity?e.opacity:1,(0,y.h)("number"==typeof n[lt],64),n[ht]=void 0===e.visible||e.visible,n[ct]=e.zIndex,n[pt]=void 0!==e.maxResolution?e.maxResolution:1/0,n[dt]=void 0!==e.minResolution?e.minResolution:0,n[gt]=void 0!==e.minZoom?e.minZoom:-1/0,n[ft]=void 0!==e.maxZoom?e.maxZoom:1/0,i.className_=void 0!==n.className?n.className:"ol-layer",delete n.className,i.setProperties(n),i.state_=null,i}return mt(e,t),e.prototype.getBackground=function(){return this.background_},e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=(0,x.uZ)(Math.round(100*this.getOpacity())/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i||e.managed?i:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return(0,yt.O3)()},e.prototype.getLayerStatesArray=function(t){return(0,yt.O3)()},e.prototype.getExtent=function(){return this.get(ut)},e.prototype.getMaxResolution=function(){return this.get(pt)},e.prototype.getMinResolution=function(){return this.get(dt)},e.prototype.getMinZoom=function(){return this.get(gt)},e.prototype.getMaxZoom=function(){return this.get(ft)},e.prototype.getOpacity=function(){return this.get(lt)},e.prototype.getSourceState=function(){return(0,yt.O3)()},e.prototype.getVisible=function(){return this.get(ht)},e.prototype.getZIndex=function(){return this.get(ct)},e.prototype.setBackground=function(t){this.background_=t,this.changed()},e.prototype.setExtent=function(t){this.set(ut,t)},e.prototype.setMaxResolution=function(t){this.set(pt,t)},e.prototype.setMinResolution=function(t){this.set(dt,t)},e.prototype.setMaxZoom=function(t){this.set(ft,t)},e.prototype.setMinZoom=function(t){this.set(gt,t)},e.prototype.setOpacity=function(t){(0,y.h)("number"==typeof t,64),this.set(lt,t)},e.prototype.setVisible=function(t){this.set(ht,t)},e.prototype.setZIndex=function(t){this.set(ct,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(h.Z),wt="prerender",bt="postrender",Ct="precompose",St="postcompose",Et="rendercomplete";var Tt=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Rt=function(t){function e(e){var i=this,n=(0,m.f0)({},e);delete n.source,(i=t.call(this,n)||this).on,i.once,i.un,i.mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,i.rendered=!1,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addChangeListener(_t,i.handleSourcePropertyChange_);var o=e.source?e.source:null;return i.setSource(o),i}return Tt(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(_t)||null},e.prototype.getRenderSource=function(){return this.getSource()},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():"undefined"},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&((0,X.bN)(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=(0,X.oL)(t,tt.Z.CHANGE,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise((function(t){return t([])}))},e.prototype.getData=function(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null},e.prototype.render=function(t,e){var i=this.getRenderer();if(i.prepareFrame(t))return this.rendered=!0,i.renderFrame(t,e)},e.prototype.unrender=function(){this.rendered=!1},e.prototype.setMapInternal=function(t){t||this.unrender(),this.set(vt,t)},e.prototype.getMapInternal=function(){return this.get(vt)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&((0,X.bN)(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&((0,X.bN)(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=(0,X.oL)(t,Ct,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);(0,y.h)(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=(0,X.oL)(this,tt.Z.CHANGE,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(_t,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(xt);function Ot(t,e){if(!t.visible)return!1;var i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}const Pt=Rt;var It=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Lt=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).ulElement_=document.createElement("ul"),i.collapsed_=void 0===n.collapsed||n.collapsed,i.userCollapsed_=i.collapsed_,i.overrideCollapsible_=void 0!==n.collapsible,i.collapsible_=void 0===n.collapsible||n.collapsible,i.collapsible_||(i.collapsed_=!1);var o=void 0!==n.className?n.className:"ol-attribution",r=void 0!==n.tipLabel?n.tipLabel:"Attributions",s=void 0!==n.expandClassName?n.expandClassName:o+"-expand",a=void 0!==n.collapseLabel?n.collapseLabel:"›",l=void 0!==n.collapseClassName?n.collapseClassName:o+"-collapse";"string"==typeof a?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=a,i.collapseLabel_.className=l):i.collapseLabel_=a;var h=void 0!==n.label?n.label:"i";"string"==typeof h?(i.label_=document.createElement("span"),i.label_.textContent=h,i.label_.className=s):i.label_=h;var u=i.collapsible_&&!i.collapsed_?i.collapseLabel_:i.label_;i.toggleButton_=document.createElement("button"),i.toggleButton_.setAttribute("type","button"),i.toggleButton_.setAttribute("aria-expanded",String(!i.collapsed_)),i.toggleButton_.title=r,i.toggleButton_.appendChild(u),i.toggleButton_.addEventListener(tt.Z.CLICK,i.handleClick_.bind(i),!1);var c=o+" "+"ol-unselectable "+nt+(i.collapsed_&&i.collapsible_?" ol-collapsed":"")+(i.collapsible_?"":" ol-uncollapsible"),p=i.element;return p.className=c,p.appendChild(i.toggleButton_),p.appendChild(i.ulElement_),i.renderedAttributions_=[],i.renderedVisible_=!0,i}return It(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],n=!0,o=t.layerStatesArray,r=0,s=o.length;r<s;++r){var a=o[r];if(Ot(a,t.viewState)){var l=a.layer.getSource();if(l){var h=l.getAttributions();if(h){var u=h(t);if(u)if(n=n&&!1!==l.getAttributionsCollapsible(),Array.isArray(u))for(var c=0,p=u.length;c<p;++c)u[c]in e||(i.push(u[c]),e[u[c]]=!0);else u in e||(i.push(u),e[u]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(n),i},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!(0,S.fS)(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var n=0,o=e.length;n<o;++n){var r=document.createElement("li");r.innerHTML=e[n],this.ulElement_.appendChild(r)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(ot),this.collapsed_?q(this.collapseLabel_,this.label_):q(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(Q);var Mt=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ft="units",At="degrees",kt="imperial",Dt="nautical",jt="metric",zt="us",Bt=[1,2,5],Nt=25.4/.28,Gt=function(t){function e(e){var i=this,n=e||{},o=void 0!==n.className?n.className:n.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).on,i.once,i.un,i.innerElement_=document.createElement("div"),i.innerElement_.className=o+"-inner",i.element.className=o+" "+it,i.element.appendChild(i.innerElement_),i.viewState_=null,i.minWidth_=void 0!==n.minWidth?n.minWidth:64,i.maxWidth_=n.maxWidth,i.renderedVisible_=!1,i.renderedWidth_=void 0,i.renderedHTML_="",i.addChangeListener(Ft,i.handleUnitsChanged_),i.setUnits(n.units||jt),i.scaleBar_=n.bar||!1,i.scaleBarSteps_=n.steps||4,i.scaleBarText_=n.text||!1,i.dpi_=n.dpi||void 0,i}return Mt(e,t),e.prototype.getUnits=function(){return this.get(Ft)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(Ft,t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,i=t.projection,n=this.getUnits(),o=n==At?u.ZP.DEGREES:u.ZP.METERS,r=(0,g._Q)(i,t.resolution,e,o),s=this.minWidth_*(this.dpi_||Nt)/Nt,a=void 0!==this.maxWidth_?this.maxWidth_*(this.dpi_||Nt)/Nt:void 0,l=s*r,h="";if(n==At){var c=g.Wm[u.ZP.DEGREES];(l*=c)<c/60?(h="″",r*=3600):l<c?(h="′",r*=60):h="°"}else n==kt?l<.9144?(h="in",r/=.0254):l<1609.344?(h="ft",r/=.3048):(h="mi",r/=1609.344):n==Dt?(r/=1852,h="NM"):n==jt?l<.001?(h="μm",r*=1e6):l<1?(h="mm",r*=1e3):l<1e3?h="m":(h="km",r/=1e3):n==zt?l<.9144?(h="in",r*=39.37):l<1609.344?(h="ft",r/=.30480061):(h="mi",r/=1609.3472):(0,y.h)(!1,33);for(var p,d,f,_,v,m,x,w=3*Math.floor(Math.log(s*r)/Math.log(10));;){f=Math.floor(w/3);var b=Math.pow(10,f);if(p=Bt[(w%3+3)%3]*b,d=Math.round(p/r),isNaN(d))return this.element.style.display="none",void(this.renderedVisible_=!1);if(void 0!==a&&d>=a){p=_,d=v,f=m;break}if(d>=s)break;_=p,v=d,m=f,++w}x=this.scaleBar_?this.createScaleBar(d,p,h):p.toFixed(f<0?-f:0)+" "+h,this.renderedHTML_!=x&&(this.innerElement_.innerHTML=x,this.renderedHTML_=x),this.renderedWidth_!=d&&(this.innerElement_.style.width=d+"px",this.renderedWidth_=d),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,i){for(var n="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),o=[],r=t/this.scaleBarSteps_,s="ol-scale-singlebar-odd",a=0;a<this.scaleBarSteps_;a++)0===a&&o.push(this.createMarker("absolute",a)),o.push('<div><div class="ol-scale-singlebar '+s+'" style="width: '+r+'px;"></div>'+this.createMarker("relative",a)+(a%2==0||2===this.scaleBarSteps_?this.createStepText(a,t,!1,e,i):"")+"</div>"),a===this.scaleBarSteps_-1&&o.push(this.createStepText(a+1,t,!0,e,i)),s="ol-scale-singlebar-odd"===s?"ol-scale-singlebar-even":"ol-scale-singlebar-odd";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+n+"</div>":"")+o.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,i,n,o){var r=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+o);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(i?e+"px":"unset")+';">'+r+"</div>"},e.prototype.getScaleForResolution=function(){var t=(0,g._Q)(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,u.ZP.METERS),e=this.dpi_||Nt;return parseFloat(t.toString())*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(Q);const Wt=Gt;var Zt=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ut=function(t){function e(e){var i=this,n=e||{};i=t.call(this,{element:document.createElement("div"),target:n.target})||this;var o=void 0!==n.className?n.className:"ol-zoom",r=void 0!==n.delta?n.delta:1,s=void 0!==n.zoomInClassName?n.zoomInClassName:o+"-in",a=void 0!==n.zoomOutClassName?n.zoomOutClassName:o+"-out",l=void 0!==n.zoomInLabel?n.zoomInLabel:"+",h=void 0!==n.zoomOutLabel?n.zoomOutLabel:"–",u=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",c=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=s,p.setAttribute("type","button"),p.title=u,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(tt.Z.CLICK,i.handleClick_.bind(i,r),!1);var d=document.createElement("button");d.className=a,d.setAttribute("type","button"),d.title=c,d.appendChild("string"==typeof h?document.createTextNode(h):h),d.addEventListener(tt.Z.CLICK,i.handleClick_.bind(i,-r),!1);var f=o+" "+"ol-unselectable "+nt,g=i.element;return g.className=f,g.appendChild(p),g.appendChild(d),i.duration_=void 0!==n.duration?n.duration:250,i}return Zt(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getZoom();if(void 0!==i){var n=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:L})):e.setZoom(n)}}},e}(Q),Vt="active";var Xt=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Yt(t,e,i,n){var o=t.getZoom();if(void 0!==o){var r=t.getConstrainedZoom(o+e),s=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:i,duration:void 0!==n?n:250,easing:L})}}const Kt=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return Xt(e,t),e.prototype.getActive=function(){return this.get(Vt)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Vt,t)},e.prototype.setMap=function(t){this.map_=t},e}(h.Z),Ht={SINGLECLICK:"singleclick",CLICK:tt.Z.CLICK,DBLCLICK:tt.Z.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};function qt(t){var e=arguments;return function(t){for(var i=!0,n=0,o=e.length;n<o&&(i=i&&e[n](t));++n);return i}}var $t=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Jt=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){var e=t.map.getTargetElement(),i=t.map.getOwnerDocument().activeElement;return e.contains(i)}(t)},Qt=_.uX,te=function(t){var e=t.originalEvent;return 0==e.button&&!(Y.G$&&Y.tK&&e.ctrlKey)},ee=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},ie=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},ne=function(t){var e=t.originalEvent,i=e.target.tagName;return"INPUT"!==i&&"SELECT"!==i&&"TEXTAREA"!==i&&!e.target.isContentEditable},oe=function(t){var e=t.originalEvent;return(0,y.h)(void 0!==e,56),"mouse"==e.pointerType},re=function(t){var e=t.originalEvent;return(0,y.h)(void 0!==e,56),e.isPrimary&&0===e.button},se=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ae="trackpad",le="wheel";const he=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,n)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,i.duration_=void 0!==n.duration?n.duration:250,i.timeout_=void 0!==n.timeout?n.timeout:80,i.useAnchor_=void 0===n.useAnchor||n.useAnchor,i.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var o=n.condition?n.condition:Qt;return i.condition_=n.onFocusOnly?qt(Jt,o):o,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return se(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var t=this.getMap();t&&t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==tt.Z.WHEEL)return!0;var e,i=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==tt.Z.WHEEL&&(e=n.deltaY,Y.V&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=Y.MP),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var o=Date.now();void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?ae:le);var r=i.getView();if(this.mode_===ae&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-(0,x.uZ)(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Yt(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Kt);var ue=i(18919),ce=i(82302),pe=i(98189),de=i(20821),fe=i(80410),ge=i(27668),_e=i(52010);const ve=t=>{var e;let{topRight1:i,topRight2:n,bottomLeft:o,blStyle:r}=t;const s=null!==(e=i&&i.length>0)&&void 0!==e&&e,a=(0,ge.wW)(ye(s));return(0,_e.jsxs)("div",{className:a.overlay,children:[Boolean(null==i?void 0:i.length)&&(0,_e.jsx)("div",{className:a.TR1,children:i}),Boolean(null==n?void 0:n.length)&&(0,_e.jsx)("div",{className:a.TR2,children:n}),Boolean(null==o?void 0:o.length)&&(0,_e.jsx)("div",{className:a.BL,style:r,children:o})]})},ye=t=>e=>({overlay:a.css`
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 500;
    pointer-events: none;
  `,TR1:a.css`
    right: 0.5em;
    pointer-events: auto;
    position: absolute;
    top: 0.5em;
  `,TR2:a.css`
    position: absolute;
    top: ${t?"80":"8"}px;
    right: 8px;
    pointer-events: auto;
  `,BL:a.css`
    position: absolute;
    bottom: 8px;
    left: 8px;
    pointer-events: auto;
  `});var me=i(12491),xe=i(76796),we=i(31504),be=i(70468),Ce=i(64341),Se=i(86832),Ee=i(72671),Te=i(20202),Re=i(6102),Oe=i(27091),Pe=i(97397),Ie=i(54643);const Le=["geometry"];const Me=t=>{let e,{feature:i}=t,n=0;if(!i)return null;if(e=i.get("frame"),e)n=i.get("rowIndex");else{const t=function(t,e){if(null==t)return{};var i,n,o={},r=Object.keys(t);for(n=0;n<r.length;n++)i=r[n],e.indexOf(i)>=0||(o[i]=t[i]);return o}(i.getProperties(),Le);e=new Pe.i([t])}return(0,_e.jsx)(Ie.H,{data:e,rowIndex:n})},Fe=t=>{let{layers:e,activeTabIndex:i}=t;const o=(0,ge.wW)(ke),[r,s]=(0,n.useState)(new Map);return(0,_e.jsx)(Re.I,{children:e.map(((t,e)=>e===i&&(0,_e.jsx)("div",{children:(0,_e.jsx)("div",{children:t.features.map(((e,i)=>{var n;const a=null!==(n=e.getId())&&void 0!==n?n:i;return t.features.length>1?(0,_e.jsx)(Oe.U,{collapsible:!0,label:Ae(e,i),isOpen:r.get(a),onToggle:()=>{((t,e)=>{s(new Map(r.set(t,e)))})(a,!r.get(a))},className:o.collapsibleRow,children:(0,_e.jsx)(Me,{feature:e})},a):(0,_e.jsx)(Me,{feature:e},a)}))})},t.layer.getName())))})},Ae=(t,e)=>{const i=["Name","name","Title","ID","id"];let n=t.getProperties(),o="";const r=t.get("frame");if(r){const e=t.get("rowIndex");for(const t of r.fields)if(t.type===Ee.fS.string){const i=(0,Te.C)(t,r);o||(o=i),n[i]=t.values.get(e)}}for(let t of i){const e=n[t];if(e)return e}if(o)return`${o}: ${n[o]}`;for(let t of Object.keys(n)){const e=n[t];if((0,Se.isString)(e))return`${t}: ${e}`}return`Match: ${e+1}`},ke=t=>({collapsibleRow:a.css`
    margin-bottom: 0px;
  `});var De=i(88018),je=i(69187);const ze=t=>{let{layers:e,setActiveTabIndex:i,activeTabIndex:n}=t;return(0,_e.jsx)(De.J,{children:e&&e.map(((t,e)=>(0,_e.jsx)(je.O,{label:t.layer.getName(),active:e===n,counter:t.features.length>1?t.features.length:null,onChangeTab:()=>{i(e)}},e)))})},Be=t=>{let{layers:e,onClose:i,isOpen:o}=t;const[r,s]=(0,n.useState)(0);return e?(0,_e.jsxs)(_e.Fragment,{children:[o&&(0,_e.jsx)(Ce.P,{style:{zIndex:1},onClick:i}),(0,_e.jsx)(ze,{layers:e,setActiveTabIndex:s,activeTabIndex:r}),(0,_e.jsx)(Fe,{layers:e,activeTabIndex:r})]}):null},Ne=t=>{let{ttip:e,onClose:i,isOpen:o}=t;const r=(0,n.createRef)(),{overlayProps:s}=(0,xe.Ir)({onClose:i,isDismissable:!0,isOpen:o},r),{dialogProps:a}=(0,me.R)({},r);return(0,_e.jsx)(_e.Fragment,{children:e&&e.layers&&(0,_e.jsx)(we.h_,{children:(0,_e.jsx)(be.S,{position:{x:e.pageX,y:e.pageY},offset:{x:10,y:10},allowPointerEvents:!0,children:(0,_e.jsx)("section",Object.assign({ref:r},s,a,{children:(0,_e.jsx)(Be,{layers:e.layers,isOpen:o,onClose:i})}))})})})};var Ge,We,Ze=i(32172),Ue=i.n(Ze),Ve=i(28441),Xe=i(72e3);function Ye(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Ke extends n.PureComponent{constructor(t){super(t),Ye(this,"style",He(Xe.vc.theme)),Ye(this,"updateViewState",(()=>{const t=this.props.map.getView();this.setState({zoom:t.getZoom(),center:(0,g.vs)(t.getCenter(),t.getProjection(),"EPSG:4326")})})),this.state={zoom:0,center:[0,0]}}componentDidMount(){this.props.map.on("moveend",this.updateViewState),this.updateViewState()}render(){const{zoom:t,center:e}=this.state;return(0,_e.jsx)("div",{className:this.style.infoWrap,"aria-label":Ve.wl.components.DebugOverlay.wrapper,children:(0,_e.jsx)("table",{children:(0,_e.jsxs)("tbody",{children:[(0,_e.jsxs)("tr",{children:[Ge||(Ge=(0,_e.jsx)("th",{children:"Zoom:"})),(0,_e.jsx)("td",{children:null==t?void 0:t.toFixed(1)})]}),(0,_e.jsxs)("tr",{children:[We||(We=(0,_e.jsx)("th",{children:"Center: "})),(0,_e.jsxs)("td",{children:[e[0].toFixed(5),", ",e[1].toFixed(5)]})]})]})})})}}const He=(0,de.B)((t=>({infoWrap:a.css`
    color: ${t.colors.text};
    background: ${Ue()(t.colors.panelBg).setAlpha(.7).toString()};
    border-radius: 2px;
    padding: 8px;
  `})));var qe=i(81377),$e=i(55312),Je=i(62533),Qe=i(2338),ti=i(63469);const ei=[{value:"length",label:"Length",geometry:"LineString",units:[{label:"Metric (m/km)",value:"m",format:t=>(0,ti.Cf)("lengthm")(t)},{label:"Feet (ft)",value:"ft",format:t=>(0,ti.Cf)("lengthft")(3.28084*t)},{label:"Miles (mi)",value:"mi",format:t=>(0,ti.Cf)("lengthmi")(t/1609)},{label:"Nautical miles (nmi)",value:"nmi",format:t=>(0,ti.Cf)("nmi")(t/1852)}],getUnit:t=>{var e,i;const n=ei[0].units;return null!==(e=t)&&void 0!==e&&e.endsWith("2")&&(t=t.substring(0,t.length-1)),null!==(i=n.find((e=>e.value===t)))&&void 0!==i?i:n[0]}},{value:"area",label:"Area",geometry:"Polygon",units:[{label:"Square Meters (m²)",value:"m2",format:t=>(0,ti.Cf)("areaM2")(t)},{label:"Square Kilometers (km²)",value:"km2",format:t=>(0,ti.q2)("km²")(1e-6*t)},{label:"Square Feet (ft²)",value:"ft2",format:t=>(0,ti.Cf)("areaF2")(10.76391*t)},{label:"Square Miles (mi²)",value:"mi2",format:t=>(0,ti.Cf)("areaMI2")(3.861e-7*t)},{label:"Acres",value:"acre2",format:t=>(0,ti.q2)("acre")(247105e-9*t)},{label:"Hectare",value:"hectare2",format:t=>(0,ti.q2)("ha")(1e-4*t)}],getUnit:t=>{var e,i;const n=ei[1].units;return null!==(e=t)&&void 0!==e&&e.endsWith("2")||(t+="2"),null!==(i=n.find((e=>e.value===t)))&&void 0!==i?i:n[0]}}];var ii=i(59226),ni=i(12003),oi=i(57258);const ri="add",si="remove";var ai=i(56866),li=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),hi="length",ui=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.element=i,o.index=n,o}return li(e,t),e}(ai.ZP),ci=function(t){function e(e,i){var n=t.call(this)||this;n.on,n.once,n.un;var o=i||{};if(n.unique_=!!o.unique,n.array_=e||[],n.unique_)for(var r=0,s=n.array_.length;r<s;++r)n.assertUnique_(n.array_[r],r);return n.updateLength_(),n}return li(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,i=0,n=e.length;i<n;++i)t(e[i],i,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(hi)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new ui(ri,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,i=0,n=e.length;i<n;++i)if(e[i]===t)return this.removeAt(i)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new ui(si,e,t)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new ui(si,n,t)),this.dispatchEvent(new ui(ri,e,t))}else{for(var o=i;o<t;++o)this.insertAt(o,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(hi,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var i=0,n=this.array_.length;i<n;++i)if(this.array_[i]===t&&i!==e)throw new oi.Z(58)},e}(h.Z);const pi=ci;var di=i(84168),fi=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function gi(t){for(var e=t.length,i=0,n=0,o=0;o<e;o++)i+=t[o].clientX,n+=t[o].clientY;return[i/e,n/e]}const _i=function(t){function e(e){var i=this,n=e||{};return i=t.call(this,n)||this,n.handleDownEvent&&(i.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(i.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(i.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(i.handleUpEvent=n.handleUpEvent),n.stopDown&&(i.stopDown=n.stopDown),i.handlingDownUpSequence=!1,i.targetPointers=[],i}return fi(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Ht.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Ht.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==Ht.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==Ht.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){t.activePointers&&(this.targetPointers=t.activePointers)},e}(Kt);var vi=i(38085),yi=function(){function t(t){this.rbush_=new vi(t),this.items_={}}return t.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[(0,yt.sq)(e)]=i},t.prototype.load=function(t,e){for(var i=new Array(e.length),n=0,o=e.length;n<o;n++){var r=t[n],s=e[n],a={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:s};i[n]=a,this.items_[(0,yt.sq)(s)]=a}this.rbush_.load(i)},t.prototype.remove=function(t){var e=(0,yt.sq)(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},t.prototype.update=function(t,e){var i=this.items_[(0,yt.sq)(e)],n=[i.minX,i.minY,i.maxX,i.maxY];(0,C.fS)(n,t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var i,n=0,o=t.length;n<o;n++)if(i=e(t[n]))return i;return i},t.prototype.isEmpty=function(){return(0,m.xb)(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return(0,C.T9)(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}();const mi=yi,xi="addfeature",wi="changefeature",bi="clear",Ci="removefeature",Si="featuresloadstart",Ei="featuresloadend",Ti="featuresloaderror",Ri=0,Oi=1,Pi=2,Ii=3;function Li(t){return t[0]>0&&t[1]>0}function Mi(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Fi=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Mi(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getDeclutterMode=function(){return this.declutterMode_},t.prototype.getAnchor=function(){return(0,yt.O3)()},t.prototype.getImage=function(t){return(0,yt.O3)()},t.prototype.getHitDetectionImage=function(){return(0,yt.O3)()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return(0,yt.O3)()},t.prototype.getImageSize=function(){return(0,yt.O3)()},t.prototype.getOrigin=function(){return(0,yt.O3)()},t.prototype.getSize=function(){return(0,yt.O3)()},t.prototype.setDisplacement=function(t){this.displacement_=t},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Mi(t)},t.prototype.listenImageChange=function(t){(0,yt.O3)()},t.prototype.load=function(){(0,yt.O3)()},t.prototype.unlistenImageChange=function(t){(0,yt.O3)()},t}();const Ai=Fi;var ki=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Di=/^([a-z]*)$|^hsla?\(.*\)$/i;function ji(t){return"string"==typeof t?t:Ui(t)}function zi(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}var Bi,Ni,Gi=(Bi={},Ni=0,function(t){var e;if(Bi.hasOwnProperty(t))e=Bi[t];else{if(Ni>=1024){var i=0;for(var n in Bi)0==(3&i++)&&(delete Bi[n],--Ni)}e=function(t){var e,i,n,o,r;if(Di.exec(t)&&(t=zi(t)),ki.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var l=4===s||8===s;e=parseInt(t.substr(1+0*a,a),16),i=parseInt(t.substr(1+1*a,a),16),n=parseInt(t.substr(1+2*a,a),16),o=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,i=(i<<4)+i,n=(n<<4)+n,l&&(o=(o<<4)+o)),r=[e,i,n,o/255]}else 0==t.indexOf("rgba(")?Zi(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),Zi(r)):(0,y.h)(!1,14);return r}(t),Bi[t]=e,++Ni}return e});function Wi(t){return Array.isArray(t)?t:Gi(t)}function Zi(t){return t[0]=(0,x.uZ)(t[0]+.5|0,0,255),t[1]=(0,x.uZ)(t[1]+.5|0,0,255),t[2]=(0,x.uZ)(t[2]+.5|0,0,255),t[3]=(0,x.uZ)(t[3],0,1),t}function Ui(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}function Vi(t){return Array.isArray(t)?Ui(t):t}var Xi=i(95833),Yi="10px sans-serif",Ki="#000",Hi="round",qi=[],$i="round",Ji="#000",Qi="center",tn="middle",en=[0,0,0,0],nn=new h.Z;(new Xi.Z).setSize=function(){console.warn("labelCache is deprecated.")};var on,rn,sn=null,an={},ln=function(){var t,e,i="32px ",n=["monospace","serif"],o=n.length,r="wmytzilWMYTZIL@#/&?$%10";function s(t,s,a){for(var l=!0,h=0;h<o;++h){var u=n[h];if(e=cn(t+" "+s+" "+i+u,r),a!=u){var c=cn(t+" "+s+" "+i+a+","+u,r);l=l&&c!=e}}return!!l}function a(){for(var e=!0,i=nn.getKeys(),n=0,o=i.length;n<o;++n){var r=i[n];nn.get(r)<100&&(s.apply(this,r.split("\n"))?((0,m.ZH)(an),sn=null,on=void 0,nn.set(r,100)):(nn.set(r,nn.get(r)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var i=at(e);if(i)for(var n=i.families,o=0,r=n.length;o<r;++o){var l=n[o],h=i.style+"\n"+i.weight+"\n"+l;void 0===nn.get(h)&&(nn.set(h,100,!0),s(i.style,i.weight,l)||(nn.set(h,0,!0),void 0===t&&(t=setInterval(a,32))))}}}(),hn=function(t){var e=an[t];if(null==e){if(Y.Id){var i=at(t),n=un(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else rn||((rn=document.createElement("div")).innerHTML="M",rn.style.minHeight="0",rn.style.maxHeight="none",rn.style.height="auto",rn.style.padding="0",rn.style.border="none",rn.style.position="absolute",rn.style.display="block",rn.style.left="-99999px"),rn.style.font=t,document.body.appendChild(rn),e=rn.offsetHeight,document.body.removeChild(rn);an[t]=e}return e};function un(t,e){return sn||(sn=K(1,1)),t!=on&&(sn.font=t,on=sn.font),sn.measureText(e)}function cn(t,e){return un(t,e).width}function pn(t,e,i){if(e in i)return i[e];var n=e.split("\n").reduce((function(e,i){return Math.max(e,cn(t,i))}),0);return i[e]=n,n}function dn(t,e,i,n,o,r,s,a,l,h,u){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,h),t.scale(u[0],u[1]),function(t,e){for(var i=t.contextInstructions,n=0,o=i.length;n<o;n+=2)Array.isArray(i[n+1])?e[i[n]].apply(e,i[n+1]):e[i[n]]=i[n+1]}(n,t)):u[0]<0||u[1]<0?(t.translate(l,h),t.scale(u[0],u[1]),t.drawImage(n,o,r,s,a,0,0,s,a)):t.drawImage(n,o,r,s,a,l,h,s*u[0],a*u[1]),t.restore()}var fn=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gn=function(t){function e(e){var i=this,n=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:n,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0],declutterMode:e.declutterMode})||this).canvas_=void 0,i.hitDetectionCanvas_=null,i.fill_=void 0!==e.fill?e.fill:null,i.origin_=[0,0],i.points_=e.points,i.radius_=void 0!==e.radius?e.radius:e.radius1,i.radius2_=e.radius2,i.angle_=void 0!==e.angle?e.angle:0,i.stroke_=void 0!==e.stroke?e.stroke:null,i.size_=null,i.renderOptions_=null,i.render(),i}return fn(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return i.setOpacity(this.getOpacity()),i},e.prototype.getAnchor=function(){var t=this.size_;if(!t)return null;var e=this.getDisplacement();return[t[0]/2-e[0],t[1]/2+e[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.setFill=function(t){this.fill_=t,this.render()},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var i=this.renderOptions_,n=K(i.size*t,i.size*t);this.draw_(i,n,t),e=n.canvas,this.canvas_[t]=e}return e},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return Pi},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.setStroke=function(t){this.stroke_=t,this.render()},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,i){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var n=this.radius_,o=void 0===this.radius2_?n:this.radius2_;if(n<o){var r=n;n=o,o=r}var s=void 0===this.radius2_?this.points_:2*this.points_,a=2*Math.PI/s,l=o*Math.sin(a),h=n-Math.sqrt(o*o-l*l),u=Math.sqrt(l*l+h*h),c=u/l;if("miter"===t&&c<=i)return c*e;var p=e/2/c,d=e/2*(h/u),f=Math.sqrt((n+p)*(n+p)+d*d)-n;if(void 0===this.radius2_||"bevel"===t)return 2*f;var g=n*Math.sin(a),_=o-Math.sqrt(n*n-g*g),v=Math.sqrt(g*g+_*_)/g;if(v<=i){var y=v*e/2-o-n;return 2*Math.max(f,y)}return 2*f},e.prototype.createRenderOptions=function(){var t,e=$i,i=0,n=null,o=0,r=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Ji),t=Vi(t),void 0===(r=this.stroke_.getWidth())&&(r=1),n=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=$i),void 0===(i=this.stroke_.getMiterLimit())&&(i=10));var s=this.calculateLineJoinSize_(e,r,i),a=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:r,size:Math.ceil(2*a+s),lineDash:n,lineDashOffset:o,lineJoin:e,miterLimit:i}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},e.prototype.draw_=function(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var n=this.fill_.getColor();null===n&&(n=Ki),e.fillStyle=Vi(n),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),i=0;if("string"==typeof e&&(e=Wi(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var n=K(t.size,t.size);this.hitDetectionCanvas_=n.canvas,this.drawHitDetectionCanvas_(t,n)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,i=this.radius_;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{var n=void 0===this.radius2_?i:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var o=this.angle_-Math.PI/2,r=2*Math.PI/e,s=0;s<e;s++){var a=o+s*r,l=s%2==0?i:n;t.lineTo(l*Math.cos(a),l*Math.sin(a))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=Ki,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e}(Ai);const _n=gn;var vn=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),yn=function(t){function e(e){var i=e||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,scale:void 0!==i.scale?i.scale:1,rotation:void 0!==i.rotation?i.rotation:0,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView,displacement:void 0!==i.displacement?i.displacement:[0,0],declutterMode:i.declutterMode})||this}return vn(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return i.setOpacity(this.getOpacity()),i},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(_n);const mn=yn;const xn=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}();const wn=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}();var bn=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=Tn,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Tn,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var Cn=null;function Sn(t,e){if(!Cn){var i=new xn({color:"rgba(255,255,255,0.4)"}),n=new wn({color:"#3399CC",width:1.25});Cn=[new bn({image:new mn({fill:i,stroke:n,radius:5}),fill:i,stroke:n})]}return Cn}function En(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t.Polygon=[new bn({fill:new xn({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new bn({stroke:new wn({color:e,width:5})}),new bn({stroke:new wn({color:i,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new bn({image:new mn({radius:6,fill:new xn({color:i}),stroke:new wn({color:e,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function Tn(t){return t.getGeometry()}const Rn=bn;var On=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Pn="renderOrder",In=function(t){function e(e){var i=this,n=e||{},o=(0,m.f0)({},n);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,(i=t.call(this,o)||this).declutter_=void 0!==n.declutter&&n.declutter,i.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(n.style),i.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,i.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,i}return On(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(Pn)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new vi(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(Pn,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:Sn,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;Array.isArray(t)?i=t:((0,y.h)("function"==typeof t.getZIndex,41),i=[t]),e=function(){return i}}return e}(this.style_),this.changed()},e}(Pt);const Ln=In;var Mn={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},Fn=[Mn.FILL],An=[Mn.STROKE],kn=[Mn.BEGIN_PATH],Dn=[Mn.CLOSE_PATH];const jn=Mn;var zn=i(86041);const Bn=function(){function t(){}return t.prototype.drawCustom=function(t,e,i,n){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}();var Nn=i(58295),Gn=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Wn=function(t){function e(e,i,n,o){var r=t.call(this)||this;return r.tolerance=e,r.maxExtent=i,r.pixelRatio=o,r.maxLineWidth=0,r.resolution=n,r.beginGeometryInstruction1_=null,r.beginGeometryInstruction2_=null,r.bufferedMaxExtent_=null,r.instructions=[],r.coordinates=[],r.tmpCoordinate_=[],r.hitDetectionInstructions=[],r.state={},r}return Gn(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var i=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,o=this.coordinates,r=o.length,s=0,a=t.length;s<a;s+=e)n[0]=t[s],n[1]=t[s+1],(0,C.b8)(i,n)&&(o[r++]=n[0],o[r++]=n[1]);return r},e.prototype.appendFlatLineCoordinates=function(t,e,i,n,o,r){var s=this.coordinates,a=s.length,l=this.getBufferedMaxExtent();r&&(e+=n);var h,u,c,p=t[e],d=t[e+1],f=this.tmpCoordinate_,g=!0;for(h=e+n;h<i;h+=n)f[0]=t[h],f[1]=t[h+1],(c=(0,C.pX)(l,f))!==u?(g&&(s[a++]=p,s[a++]=d,g=!1),s[a++]=f[0],s[a++]=f[1]):c===zn.Z.INTERSECTING?(s[a++]=f[0],s[a++]=f[1],g=!1):g=!0,p=f[0],d=f[1],u=c;return(o&&g||h===e+n)&&(s[a++]=p,s[a++]=d),a},e.prototype.drawCustomCoordinates_=function(t,e,i,n,o){for(var r=0,s=i.length;r<s;++r){var a=i[r],l=this.appendFlatLineCoordinates(t,e,a,n,!1,!1);o.push(l),e=a}return e},e.prototype.drawCustom=function(t,e,i,n){this.beginGeometry(t,e);var o,r,s,a,l,h=t.getType(),u=t.getStride(),c=this.coordinates.length;switch(h){case"MultiPolygon":o=t.getOrientedFlatCoordinates(),a=[];var p=t.getEndss();l=0;for(var d=0,f=p.length;d<f;++d){var g=[];l=this.drawCustomCoordinates_(o,l,p[d],u,g),a.push(g)}this.instructions.push([jn.CUSTOM,c,a,t,i,Nn.ug]),this.hitDetectionInstructions.push([jn.CUSTOM,c,a,t,n||i,Nn.ug]);break;case"Polygon":case"MultiLineString":s=[],o="Polygon"==h?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(o,0,t.getEnds(),u,s),this.instructions.push([jn.CUSTOM,c,s,t,i,Nn.o1]),this.hitDetectionInstructions.push([jn.CUSTOM,c,s,t,n||i,Nn.o1]);break;case"LineString":case"Circle":o=t.getFlatCoordinates(),r=this.appendFlatLineCoordinates(o,0,o.length,u,!1,!1),this.instructions.push([jn.CUSTOM,c,r,t,i,Nn.Ml]),this.hitDetectionInstructions.push([jn.CUSTOM,c,r,t,n||i,Nn.Ml]);break;case"MultiPoint":o=t.getFlatCoordinates(),(r=this.appendFlatPointCoordinates(o,u))>c&&(this.instructions.push([jn.CUSTOM,c,r,t,i,Nn.Ml]),this.hitDetectionInstructions.push([jn.CUSTOM,c,r,t,n||i,Nn.Ml]));break;case"Point":o=t.getFlatCoordinates(),this.coordinates.push(o[0],o[1]),r=this.coordinates.length,this.instructions.push([jn.CUSTOM,c,r,t,i]),this.hitDetectionInstructions.push([jn.CUSTOM,c,r,t,n||i])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[jn.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[jn.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,n,o=e.length,r=-1;for(t=0;t<o;++t)(n=(i=e[t])[0])==jn.END_GEOMETRY?r=t:n==jn.BEGIN_GEOMETRY&&(i[2]=t,(0,S.FZ)(this.hitDetectionInstructions,r,t),r=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var n=t.getColor();i.fillStyle=Vi(n||Ki)}else i.fillStyle=void 0;if(e){var o=e.getColor();i.strokeStyle=Vi(o||Ji);var r=e.getLineCap();i.lineCap=void 0!==r?r:Hi;var s=e.getLineDash();i.lineDash=s?s.slice():qi;var a=e.getLineDashOffset();i.lineDashOffset=a||0;var l=e.getLineJoin();i.lineJoin=void 0!==l?l:$i;var h=e.getWidth();i.lineWidth=void 0!==h?h:1;var u=e.getMiterLimit();i.miterLimit=void 0!==u?u:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[jn.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[jn.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,o=t.lineDash,r=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||o!=t.currentLineDash&&!(0,S.fS)(t.currentLineDash,o)||t.currentLineDashOffset!=r||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=o,t.currentLineDashOffset=r,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[jn.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=(0,C.d9)(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;(0,C.f3)(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Bn);const Zn=Wn;var Un=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Vn=function(t){function e(e,i,n,o){var r=t.call(this,e,i,n,o)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterMode_=void 0,r.declutterImageWithText_=void 0,r}return Un(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(i,n);this.instructions.push([jn.DRAW_IMAGE,o,r,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([jn.DRAW_IMAGE,o,r,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(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(i,n);this.instructions.push([jn.DRAW_IMAGE,o,r,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([jn.DRAW_IMAGE,o,r,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(e)}},e.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,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),n=t.getSize(),o=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=o[0],this.originY_=o[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e},e}(Zn);var Xn=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Yn=function(t){function e(e,i,n,o){return t.call(this,e,i,n,o)||this}return Xn(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,n){var o=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),s=[jn.MOVE_TO_LINE_TO,o,r];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([jn.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,qi,0],kn);var r=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(r,0,r.length,s),this.hitDetectionInstructions.push(An),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([jn.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],kn);for(var r=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,h=0,u=r.length;h<u;++h)l=this.drawFlatCoordinates_(s,l,r[h],a);this.hitDetectionInstructions.push(An),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(An),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(An),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(kn)},e}(Zn);var Kn=i(4174),Hn=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const qn=function(t){function e(e,i,n,o){return t.call(this,e,i,n,o)||this}return Hn(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,i,n){var o=this.state,r=void 0!==o.fillStyle,s=void 0!==o.strokeStyle,a=i.length;this.instructions.push(kn),this.hitDetectionInstructions.push(kn);for(var l=0;l<a;++l){var h=i[l],u=this.coordinates.length,c=this.appendFlatLineCoordinates(t,e,h,n,!0,!s),p=[jn.MOVE_TO_LINE_TO,u,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),s&&(this.instructions.push(Dn),this.hitDetectionInstructions.push(Dn)),e=h}return r&&(this.instructions.push(Fn),this.hitDetectionInstructions.push(Fn)),s&&(this.instructions.push(An),this.hitDetectionInstructions.push(An)),e},e.prototype.drawCircle=function(t,e){var i=this.state,n=i.fillStyle,o=i.strokeStyle;if(void 0!==n||void 0!==o){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([jn.SET_FILL_STYLE,Ki]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([jn.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatLineCoordinates(r,0,r.length,s,!1,!1);var l=[jn.CIRCLE,a];this.instructions.push(kn,l),this.hitDetectionInstructions.push(kn,l),void 0!==i.fillStyle&&(this.instructions.push(Fn),this.hitDetectionInstructions.push(Fn)),void 0!==i.strokeStyle&&(this.instructions.push(An),this.hitDetectionInstructions.push(An)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,n=i.fillStyle,o=i.strokeStyle;if(void 0!==n||void 0!==o){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([jn.SET_FILL_STYLE,Ki]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([jn.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,r,a),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,n=i.fillStyle,o=i.strokeStyle;if(void 0!==n||void 0!==o){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([jn.SET_FILL_STYLE,Ki]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([jn.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var r=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),l=0,h=0,u=r.length;h<u;++h)l=this.drawFlatCoordinatess_(s,l,r[h],a);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var i=this.coordinates,n=0,o=i.length;n<o;++n)i[n]=(0,Kn.uZ)(i[n],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(Zn),$n="point",Jn="line";function Qn(t,e,i,n,o){var r,s,a,l,h,u,c,p,d,f=i,g=i,_=0,v=0,y=i;for(r=i;r<n;r+=o){var m=e[r],x=e[r+1];void 0!==l&&(p=m-l,d=x-h,a=Math.sqrt(p*p+d*d),void 0!==u&&(v+=s,Math.acos((u*p+c*d)/(s*a))>t&&(v>_&&(_=v,f=y,g=r),v=0,y=r-o)),s=a,u=p,c=d),l=m,h=x}return(v+=a)>_?[y,r]:[f,g]}var to=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),eo={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},io=function(t){function e(e,i,n,o){var r=t.call(this,e,i,n,o)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return to(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,n=this.textStrokeState_,o=this.textState_;if(""!==this.text_&&o&&(i||n)){var r=this.coordinates,s=r.length,a=t.getType(),l=null,h=t.getStride();if(o.placement!==Jn||"LineString"!=a&&"MultiLineString"!=a&&"Polygon"!=a&&"MultiPolygon"!=a){var u=o.overflow?null:[];switch(a){case"Point":case"MultiPoint":l=t.getFlatCoordinates();break;case"LineString":l=t.getFlatMidpoint();break;case"Circle":l=t.getCenter();break;case"MultiLineString":l=t.getFlatMidpoints(),h=2;break;case"Polygon":l=t.getFlatInteriorPoint(),o.overflow||u.push(l[2]/this.resolution),h=3;break;case"MultiPolygon":var c=t.getFlatInteriorPoints();l=[];for(b=0,S=c.length;b<S;b+=3)o.overflow||u.push(c[b+2]/this.resolution),l.push(c[b],c[b+1]);if(0===l.length)return;h=2}if((L=this.appendFlatPointCoordinates(l,h))===s)return;if(u&&(L-s)/2!=l.length/h){var p=s/2;u=u.filter((function(t,e){var i=r[2*(p+e)]===l[e*h]&&r[2*(p+e)+1]===l[e*h+1];return i||--p,i}))}this.saveTextStates_(),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var d=o.padding;if(d!=en&&(o.scale[0]<0||o.scale[1]<0)){var f=o.padding[0],g=o.padding[1],_=o.padding[2],v=o.padding[3];o.scale[0]<0&&(g=-g,v=-v),o.scale[1]<0&&(f=-f,_=-_),d=[f,g,_,v]}var y=this.pixelRatio;this.instructions.push([jn.DRAW_IMAGE,s,L,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,d==en?en:d.map((function(t){return t*y})),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,u]);var m=1/y;this.hitDetectionInstructions.push([jn.DRAW_IMAGE,s,L,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,void 0,this.declutterImageWithText_,d,!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,u]),this.endGeometry(e)}else{if(!(0,C.kK)(this.getBufferedMaxExtent(),t.getExtent()))return;var x=void 0;if(l=t.getFlatCoordinates(),"LineString"==a)x=[l.length];else if("MultiLineString"==a)x=t.getEnds();else if("Polygon"==a)x=t.getEnds().slice(0,1);else if("MultiPolygon"==a){var w=t.getEndss();x=[];for(var b=0,S=w.length;b<S;++b)x.push(w[b][0])}this.beginGeometry(t,e);for(var E=o.textAlign,T=0,R=void 0,O=0,P=x.length;O<P;++O){if(null==E){var I=Qn(o.maxAngle,l,T,x[O],h);T=I[0],R=I[1]}else R=x[O];for(var b=T;b<R;b+=h)r.push(l[b],l[b+1]);var L=r.length;T=x[O],this.drawChars_(s,L),s=L}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,n=this.strokeKey_;t&&(n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var o=this.textKey_;o in this.textStates||(this.textStates[o]={font:e.font,textAlign:e.textAlign||Qi,justify:e.justify,textBaseline:e.textBaseline||tn,scale:e.scale});var r=this.fillKey_;i&&(r in this.fillStates||(this.fillStates[r]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e){var i=this.textStrokeState_,n=this.textState_,o=this.strokeKey_,r=this.textKey_,s=this.fillKey_;this.saveTextStates_();var a=this.pixelRatio,l=eo[n.textBaseline],h=this.textOffsetY_*a,u=this.text_,c=i?i.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([jn.DRAW_CHARS,t,e,l,n.overflow,s,n.maxAngle,a,h,o,c*a,u,r,1]),this.hitDetectionInstructions.push([jn.DRAW_CHARS,t,e,l,n.overflow,s,n.maxAngle,1,h,o,c,u,r,1/a])},e.prototype.setTextStyle=function(t,e){var i,n,o;if(t){var r=t.getFill();r?((n=this.textFillState_)||(n={},this.textFillState_=n),n.fillStyle=Vi(r.getColor()||Ki)):(n=null,this.textFillState_=n);var s=t.getStroke();if(s){(o=this.textStrokeState_)||(o={},this.textStrokeState_=o);var a=s.getLineDash(),l=s.getLineDashOffset(),h=s.getWidth(),u=s.getMiterLimit();o.lineCap=s.getLineCap()||Hi,o.lineDash=a?a.slice():qi,o.lineDashOffset=void 0===l?0:l,o.lineJoin=s.getLineJoin()||$i,o.lineWidth=void 0===h?1:h,o.miterLimit=void 0===u?10:u,o.strokeStyle=Vi(s.getColor()||Ji)}else o=null,this.textStrokeState_=o;i=this.textState_;var c=t.getFont()||Yi;ln(c);var p=t.getScaleArray();i.overflow=t.getOverflow(),i.font=c,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||tn,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||en,i.scale=void 0===p?[1,1]:p;var d=t.getOffsetX(),f=t.getOffsetY(),g=t.getRotateWithView(),_=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===_?0:_,this.strokeKey_=o?("string"==typeof o.strokeStyle?o.strokeStyle:(0,yt.sq)(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=n?"string"==typeof n.fillStyle?n.fillStyle:"|"+(0,yt.sq)(n.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(Zn);var no={Circle:qn,Default:Zn,Image:Vn,LineString:Yn,Polygon:qn,Text:io};const oo=function(){function t(t,e,i,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=i,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var i=this.buildersByZIndex_[e];for(var n in i){var o=i[n].finish();t[e][n]=o}}return t},t.prototype.getBuilder=function(t,e){var i=void 0!==t?t.toString():"0",n=this.buildersByZIndex_[i];void 0===n&&(n={},this.buildersByZIndex_[i]=n);var o=n[e];void 0===o&&(o=new(0,no[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=o);return o},t}();var ro=i(60563),so=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ao=function(t){function e(e){var i=t.call(this)||this;return i.ready=!0,i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return so(e,t),e.prototype.getFeatures=function(t){return(0,yt.O3)()},e.prototype.getData=function(t){return null},e.prototype.prepareFrame=function(t){return(0,yt.O3)()},e.prototype.renderFrame=function(t,e){return(0,yt.O3)()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(n,o){var r=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,o,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o){},e.prototype.getDataAtPixel=function(t,e,i){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===Pi&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Pi&&e!=Ii&&t.addEventListener(tt.Z.CHANGE,this.boundHandleImageChange_),e==Ri&&(t.load(),e=t.getState()),e==Pi},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()},e.prototype.disposeInternal=function(){delete this.layer_,t.prototype.disposeInternal.call(this)},e}(ro.Z);const lo=ao;var ho=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const uo=function(t){function e(e,i,n,o){var r=t.call(this,e)||this;return r.inversePixelTransform=i,r.frameState=n,r.context=o,r}return ho(e,t),e}(ai.ZP);var co=i(22803),po=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fo=[],go=null;const _o=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=(0,co.Ue)(),i.pixelTransform=(0,co.Ue)(),i.inversePixelTransform=(0,co.Ue)(),i.context=null,i.containerReused=!1,i.pixelContext_=null,i.frameState=null,i}return po(e,t),e.prototype.getImageData=function(t,e,i){var n,o;go||((n=document.createElement("canvas")).width=1,n.height=1,go=n.getContext("2d")),go.clearRect(0,0,1,1);try{go.drawImage(t,e,i,1,1,0,0,1,1),o=go.getImageData(0,0,1,1).data}catch(t){return go=null,null}return o},e.prototype.getBackground=function(t){var e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0},e.prototype.useContainer=function(t,e,i){var n,o,r=this.getLayer().getClassName();t&&t.className===r&&(!i||t&&t.style.backgroundColor&&(0,S.fS)(Wi(t.style.backgroundColor),Wi(i)))&&((a=t.firstElementChild)instanceof HTMLCanvasElement&&(o=a.getContext("2d")));if(o&&o.canvas.style.transform===e?(this.container=t,this.context=o,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(n=document.createElement("div")).className=r;var s=n.style;s.position="absolute",s.width="100%",s.height="100%";var a=(o=K()).canvas;n.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=n,this.context=o}this.containerReused||!i||this.container.style.backgroundColor||(this.container.style.backgroundColor=i)},e.prototype.clipUnrotated=function(t,e,i){var n=(0,C.rL)(i),o=(0,C.Xv)(i),r=(0,C.w$)(i),s=(0,C.hC)(i);(0,co.nn)(e.coordinateToPixelTransform,n),(0,co.nn)(e.coordinateToPixelTransform,o),(0,co.nn)(e.coordinateToPixelTransform,r),(0,co.nn)(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;(0,co.nn)(a,n),(0,co.nn)(a,o),(0,co.nn)(a,r),(0,co.nn)(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var n=this.getLayer();if(n.hasListener(t)){var o=new uo(t,this.inversePixelTransform,i,e);n.dispatchEvent(o)}},e.prototype.preRender=function(t,e){this.frameState=e,this.dispatchRenderEvent_(wt,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(bt,t,e)},e.prototype.getRenderTransform=function(t,e,i,n,o,r,s){var a=o/2,l=r/2,h=n/e,u=-h,c=-t[0]+s,p=-t[1];return(0,co.qC)(this.tempTransform,a,l,h,u,-i,c,p)},e.prototype.getDataAtPixel=function(t,e,i){var n=(0,co.nn)(this.inversePixelTransform,t.slice()),o=this.context,r=this.getLayer().getExtent();if(r){var s=(0,co.nn)(e.pixelToCoordinateTransform,t.slice());if(!(0,C.b8)(r,s))return null}var a,l=Math.round(n[0]),h=Math.round(n[1]),u=this.pixelContext_;if(!u){var c=document.createElement("canvas");c.width=1,c.height=1,u=c.getContext("2d"),this.pixelContext_=u}u.clearRect(0,0,1,1);try{u.drawImage(o.canvas,l,h,1,1,0,0,1,1),a=u.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?(this.pixelContext_=null,new Uint8Array):a}return 0===a[3]?null:a},e.prototype.disposeInternal=function(){delete this.frameState,t.prototype.disposeInternal.call(this)},e}(lo);var vo=i(55759);function yo(t,e,i,n,o,r,s,a,l,h,u,c){var p=t[e],d=t[e+1],f=0,g=0,_=0,v=0;function y(){f=p,g=d,p=t[e+=n],d=t[e+1],v+=_,_=Math.sqrt((p-f)*(p-f)+(d-g)*(d-g))}do{y()}while(e<i-n&&v+_<r);for(var m=0===_?0:(r-v)/_,w=(0,x.t7)(f,p,m),b=(0,x.t7)(g,d,m),C=e-n,S=v,E=r+a*l(h,o,u);e<i-n&&v+_<E;)y();m=0===_?0:(E-v)/_;var T,R=(0,x.t7)(f,p,m),O=(0,x.t7)(g,d,m);if(c){var P=[w,b,R,O];(0,vo.U1)(P,0,4,2,c,P,P),T=P[0]>P[2]}else T=w>R;var I,L=Math.PI,M=[],F=C+n===e;if(_=0,v=S,p=t[e=C],d=t[e+1],F){y(),I=Math.atan2(d-g,p-f),T&&(I+=I>0?-L:L);var A=(R+w)/2,k=(O+b)/2;return M[0]=[A,k,(E-r)/2,I,o],M}for(var D=0,j=(o=o.replace(/\n/g," ")).length;D<j;){y();var z=Math.atan2(d-g,p-f);if(T&&(z+=z>0?-L:L),void 0!==I){var B=z-I;if(B+=B>L?-2*L:B<-L?2*L:0,Math.abs(B)>s)return null}I=z;for(var N=D,G=0;D<j;++D){var W=a*l(h,o[T?j-D-1:D],u);if(e+n<i&&v+_<r+G+W/2)break;G+=W}if(D!==N){var Z=T?o.substring(j-N,j-D):o.substring(N,D);m=0===_?0:(r+G/2-v)/_;A=(0,x.t7)(f,p,m),k=(0,x.t7)(g,d,m);M.push([A,k,G/2,z,Z]),r+=G}}return M}var mo=i(87125),xo=(0,C.lJ)(),wo=[],bo=[],Co=[],So=[];function Eo(t){return t[3].declutterBox}var To=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function Ro(t,e){return"start"!==e&&"end"!==e||To.test(t)||(e="start"===e?"left":"right"),eo[e]}function Oo(t,e,i){return i>0&&t.push("\n",""),t.push(e,""),t}var Po=function(){function t(t,e,i,n){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=(0,co.Ue)(),this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,i,n){var o=t+e+i+n;if(this.labels_[o])return this.labels_[o];var r=n?this.strokeStates[n]:null,s=i?this.fillStates[i]:null,a=this.textStates[e],l=this.pixelRatio,h=[a.scale[0]*l,a.scale[1]*l],u=Array.isArray(t),c=a.justify?eo[a.justify]:Ro(Array.isArray(t)?t[0]:t,a.textAlign||Qi),p=n&&r.lineWidth?r.lineWidth:0,d=u?t:t.split("\n").reduce(Oo,[]),f=function(t,e){for(var i=[],n=[],o=[],r=0,s=0,a=0,l=0,h=0,u=e.length;h<=u;h+=2){var c=e[h];if("\n"!==c&&h!==u){var p=e[h+1]||t.font,d=cn(p,c);i.push(d),s+=d;var f=hn(p);n.push(f),l=Math.max(l,f)}else r=Math.max(r,s),o.push(s),s=0,a+=l}return{width:r,height:a,widths:i,heights:n,lineWidths:o}}(a,d),g=f.width,_=f.height,v=f.widths,y=f.heights,m=f.lineWidths,x=g+p,w=[],b=(x+2)*h[0],C=(_+p)*h[1],S={width:b<0?Math.floor(b):Math.ceil(b),height:C<0?Math.floor(C):Math.ceil(C),contextInstructions:w};(1==h[0]&&1==h[1]||w.push("scale",h),n)&&(w.push("strokeStyle",r.strokeStyle),w.push("lineWidth",p),w.push("lineCap",r.lineCap),w.push("lineJoin",r.lineJoin),w.push("miterLimit",r.miterLimit),(Y.Id?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(w.push("setLineDash",[r.lineDash]),w.push("lineDashOffset",r.lineDashOffset)));i&&w.push("fillStyle",s.fillStyle),w.push("textBaseline","middle"),w.push("textAlign","center");for(var E,T=.5-c,R=c*x+T*p,O=[],P=[],I=0,L=0,M=0,F=0,A=0,k=d.length;A<k;A+=2){var D=d[A];if("\n"!==D){var j=d[A+1]||a.font;j!==E&&(n&&O.push("font",j),i&&P.push("font",j),E=j),I=Math.max(I,y[M]);var z=[D,R+T*v[M]+c*(v[M]-m[F]),.5*(p+I)+L];R+=v[M],n&&O.push("strokeText",z),i&&P.push("fillText",z),++M}else L+=I,I=0,R=c*x+T*p,++F}return Array.prototype.push.apply(w,O),Array.prototype.push.apply(w,P),this.labels_[o]=S,S},t.prototype.replayTextBackground_=function(t,e,i,n,o,r,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,o),t.lineTo.apply(t,e),r&&(this.alignFill_=r[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,i,n,o,r,s,a,l,h,u,c,p,d,f,g){var _,v=i-(s*=c[0]),y=n-(a*=c[1]),m=o+l>t?t-l:o,x=r+h>e?e-h:r,w=d[3]+m*c[0]+d[1],b=d[0]+x*c[1]+d[2],S=v-d[3],E=y-d[0];return(f||0!==u)&&(wo[0]=S,So[0]=S,wo[1]=E,bo[1]=E,bo[0]=S+w,Co[0]=bo[0],Co[1]=E+b,So[1]=Co[1]),0!==u?(_=(0,co.qC)((0,co.Ue)(),i,n,1,1,u,-i,-n),(0,co.nn)(_,wo),(0,co.nn)(_,bo),(0,co.nn)(_,Co),(0,co.nn)(_,So),(0,C.T9)(Math.min(wo[0],bo[0],Co[0],So[0]),Math.min(wo[1],bo[1],Co[1],So[1]),Math.max(wo[0],bo[0],Co[0],So[0]),Math.max(wo[1],bo[1],Co[1],So[1]),xo)):(0,C.T9)(Math.min(S,S+w),Math.min(E,E+b),Math.max(S,S+w),Math.max(E,E+b),xo),p&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:m,drawImageH:x,originX:l,originY:h,declutterBox:{minX:xo[0],minY:xo[1],maxX:xo[2],maxY:xo[3],value:g},canvasTransform:_,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,i,n,o,r,s){var a=!(!r&&!s),l=n.declutterBox,h=t.canvas,u=s?s[2]*n.scale[0]/2:0;return l.minX-u<=h.width/e&&l.maxX+u>=0&&l.minY-u<=h.height/e&&l.maxY+u>=0&&(a&&this.replayTextBackground_(t,wo,bo,Co,So,r,s),dn(t,n.canvasTransform,o,i,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=(0,co.nn)(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,i,n){var o=this.textStates[e],r=this.createLabel(t,e,n,i),s=this.strokeStates[i],a=this.pixelRatio,l=Ro(Array.isArray(t)?t[0]:t,o.textAlign||Qi),h=eo[o.textBaseline||tn],u=s&&s.lineWidth?s.lineWidth:0;return{label:r,anchorX:l*(r.width/a-2*o.scale[0])+2*(.5-l)*u,anchorY:h*r.height/a+2*(.5-h)*u}},t.prototype.execute_=function(t,e,i,n,o,r,s,a){var l;this.pixelCoordinates_&&(0,S.fS)(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=(0,vo.vT)(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),(0,co.lk)(this.renderedTransform_,i));for(var h,u,c,p,d,f,g,_,v,y,m,x,w,b,E,T,R=0,O=n.length,P=0,I=0,L=0,M=null,F=null,A=this.coordinateCache_,k=this.viewRotation_,D=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k},z=this.instructions!=n||this.overlaps?0:200;R<O;){var B=n[R];switch(B[0]){case jn.BEGIN_GEOMETRY:w=B[1],T=B[3],w.getGeometry()?void 0===s||(0,C.kK)(s,T.getExtent())?++R:R=B[2]+1:R=B[2];break;case jn.BEGIN_PATH:I>z&&(this.fill_(t),I=0),L>z&&(t.stroke(),L=0),I||L||(t.beginPath(),p=NaN,d=NaN),++R;break;case jn.CIRCLE:var N=l[P=B[1]],G=l[P+1],W=l[P+2]-N,Z=l[P+3]-G,U=Math.sqrt(W*W+Z*Z);t.moveTo(N+U,G),t.arc(N,G,U,0,2*Math.PI,!0),++R;break;case jn.CLOSE_PATH:t.closePath(),++R;break;case jn.CUSTOM:P=B[1],h=B[2];var V=B[3],X=B[4],Y=6==B.length?B[5]:void 0;j.geometry=V,j.feature=w,R in A||(A[R]=[]);var K=A[R];Y?Y(l,P,h,2,K):(K[0]=l[P],K[1]=l[P+1],K.length=2),X(K,j),++R;break;case jn.DRAW_IMAGE:P=B[1],h=B[2],_=B[3],u=B[4],c=B[5];var H=B[6],q=B[7],$=B[8],J=B[9],Q=B[10],tt=B[11],et=B[12],it=B[13],nt=B[14],ot=B[15];if(!_&&B.length>=20){v=B[19],y=B[20],m=B[21],x=B[22];var rt=this.drawLabelWithPointPlacement_(v,y,m,x);_=rt.label,B[3]=_;var st=B[23];u=(rt.anchorX-st)*this.pixelRatio,B[4]=u;var at=B[24];c=(rt.anchorY-at)*this.pixelRatio,B[5]=c,H=_.height,B[6]=H,it=_.width,B[13]=it}var lt=void 0;B.length>25&&(lt=B[25]);var ht=void 0,ut=void 0,ct=void 0;B.length>17?(ht=B[16],ut=B[17],ct=B[18]):(ht=en,ut=!1,ct=!1),Q&&D?tt+=k:Q||D||(tt-=k);for(var pt=0;P<h;P+=2)if(!(lt&&lt[pt++]<it/this.pixelRatio)){var dt=[t,e,_,Nt=this.calculateImageOrLabelDimensions_(_.width,_.height,l[P],l[P+1],it,H,u,c,$,J,tt,et,o,ht,ut||ct,w),q,ut?M:null,ct?F:null];if(a){if("none"===nt)continue;if("obstacle"===nt){a.insert(Nt.declutterBox);continue}var ft=void 0,gt=void 0;if(ot){var _t=h-P;if(!ot[_t]){ot[_t]=dt;continue}if(ft=ot[_t],delete ot[_t],gt=Eo(ft),a.collides(gt))continue}if(a.collides(Nt.declutterBox))continue;ft&&(a.insert(gt),this.replayImageOrLabel_.apply(this,ft)),a.insert(Nt.declutterBox)}this.replayImageOrLabel_.apply(this,dt)}++R;break;case jn.DRAW_CHARS:var vt=B[1],yt=B[2],mt=B[3],xt=B[4];x=B[5];var wt=B[6],bt=B[7],Ct=B[8];m=B[9];var St=B[10];v=B[11],y=B[12];var Et=[B[13],B[13]],Tt=this.textStates[y],Rt=Tt.font,Ot=[Tt.scale[0]*bt,Tt.scale[1]*bt],Pt=void 0;Rt in this.widths_?Pt=this.widths_[Rt]:(Pt={},this.widths_[Rt]=Pt);var It=(0,mo.W)(l,vt,yt,2),Lt=Math.abs(Ot[0])*pn(Rt,v,Pt);if(xt||Lt<=It){var Mt=this.textStates[y].textAlign,Ft=yo(l,vt,yt,2,v,(It-Lt)*eo[Mt],wt,Math.abs(Ot[0]),pn,Rt,Pt,D?0:this.viewRotation_);t:if(Ft){var At=[],kt=void 0,Dt=void 0,jt=void 0,zt=void 0,Bt=void 0;if(m)for(kt=0,Dt=Ft.length;kt<Dt;++kt){jt=(Bt=Ft[kt])[4],zt=this.createLabel(jt,y,"",m),u=Bt[2]+(Ot[0]<0?-St:St),c=mt*zt.height+2*(.5-mt)*St*Ot[1]/Ot[0]-Ct;var Nt=this.calculateImageOrLabelDimensions_(zt.width,zt.height,Bt[0],Bt[1],zt.width,zt.height,u,c,0,0,Bt[3],Et,!1,en,!1,w);if(a&&a.collides(Nt.declutterBox))break t;At.push([t,e,zt,Nt,1,null,null])}if(x)for(kt=0,Dt=Ft.length;kt<Dt;++kt){jt=(Bt=Ft[kt])[4],zt=this.createLabel(jt,y,x,""),u=Bt[2],c=mt*zt.height-Ct;Nt=this.calculateImageOrLabelDimensions_(zt.width,zt.height,Bt[0],Bt[1],zt.width,zt.height,u,c,0,0,Bt[3],Et,!1,en,!1,w);if(a&&a.collides(Nt.declutterBox))break t;At.push([t,e,zt,Nt,1,null,null])}a&&a.load(At.map(Eo));for(var Gt=0,Wt=At.length;Gt<Wt;++Gt)this.replayImageOrLabel_.apply(this,At[Gt])}}++R;break;case jn.END_GEOMETRY:if(void 0!==r){var Zt=r(w=B[1],T);if(Zt)return Zt}++R;break;case jn.FILL:z?I++:this.fill_(t),++R;break;case jn.MOVE_TO_LINE_TO:for(P=B[1],h=B[2],b=l[P],g=(E=l[P+1])+.5|0,(f=b+.5|0)===p&&g===d||(t.moveTo(b,E),p=f,d=g),P+=2;P<h;P+=2)f=(b=l[P])+.5|0,g=(E=l[P+1])+.5|0,P!=h-2&&f===p&&g===d||(t.lineTo(b,E),p=f,d=g);++R;break;case jn.SET_FILL_STYLE:M=B,this.alignFill_=B[2],I&&(this.fill_(t),I=0,L&&(t.stroke(),L=0)),t.fillStyle=B[1],++R;break;case jn.SET_STROKE_STYLE:F=B,L&&(t.stroke(),L=0),this.setStrokeStyle_(t,B),++R;break;case jn.STROKE:z?L++:t.stroke(),++R;break;default:++R}}I&&this.fill_(t),L&&t.stroke()},t.prototype.execute=function(t,e,i,n,o,r){this.viewRotation_=n,this.execute_(t,e,i,this.instructions,o,void 0,void 0,r)},t.prototype.executeHitDetection=function(t,e,i,n,o){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,n,o)},t}();const Io=Po;var Lo=["Polygon","Circle","LineString","Image","Text","Default"],Mo=function(){function t(t,e,i,n,o,r){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=r,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=(0,co.Ue)(),this.createExecutors_(o)}return t.prototype.clip=function(t,e){var i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var i=this.executorsByZIndex_[e];void 0===i&&(i={},this.executorsByZIndex_[e]=i);var n=t[e];for(var o in n){var r=n[o];i[o]=new Io(this.resolution_,this.pixelRatio_,this.overlaps_,r)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var i=this.executorsByZIndex_[e],n=0,o=t.length;n<o;++n)if(t[n]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o,r){var s=2*(n=Math.round(n))+1,a=(0,co.qC)(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-i,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=K(s,s));var h,u=this.hitDetectionContext_;u.canvas.width!==s||u.canvas.height!==s?(u.canvas.width=s,u.canvas.height=s):l||u.clearRect(0,0,s,s),void 0!==this.renderBuffer_&&(h=(0,C.lJ)(),(0,C.Wj)(h,t),(0,C.f3)(h,e*(this.renderBuffer_+n),h));var c,p=function(t){if(void 0!==Fo[t])return Fo[t];for(var e=2*t+1,i=t*t,n=new Array(i+1),o=0;o<=t;++o)for(var r=0;r<=t;++r){var s=o*o+r*r;if(s>i)break;var a=n[s];a||(a=[],n[s]=a),a.push(4*((t+o)*e+(t+r))+3),o>0&&a.push(4*((t-o)*e+(t+r))+3),r>0&&(a.push(4*((t+o)*e+(t-r))+3),o>0&&a.push(4*((t-o)*e+(t-r))+3))}for(var l=[],h=(o=0,n.length);o<h;++o)n[o]&&l.push.apply(l,n[o]);return Fo[t]=l,l}(n);function d(t,e){for(var i=u.getImageData(0,0,s,s).data,a=0,l=p.length;a<l;a++)if(i[p[a]]>0){if(!r||"Image"!==c&&"Text"!==c||-1!==r.indexOf(t)){var h=(p[a]-3)/4,d=n-h%s,f=n-(h/s|0),g=o(t,e,d*d+f*f);if(g)return g}u.clearRect(0,0,s,s);break}}var f,g,_,v,y,m=Object.keys(this.executorsByZIndex_).map(Number);for(m.sort(S.kK),f=m.length-1;f>=0;--f){var x=m[f].toString();for(_=this.executorsByZIndex_[x],g=Lo.length-1;g>=0;--g)if(void 0!==(v=_[c=Lo[g]])&&(y=v.executeHitDetection(u,a,i,d,h)))return y}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],n=e[1],o=e[2],r=e[3],s=[i,n,i,r,o,r,o,n];return(0,vo.vT)(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return(0,m.xb)(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,n,o,r,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(S.kK),this.maxExtent_&&(t.save(),this.clip(t,i));var l,h,u,c,p,d,f=r||Lo;for(s&&a.reverse(),l=0,h=a.length;l<h;++l){var g=a[l].toString();for(p=this.executorsByZIndex_[g],u=0,c=f.length;u<c;++u){void 0!==(d=p[f[u]])&&d.execute(t,e,i,n,o,s)}}this.maxExtent_&&t.restore()},t}(),Fo={};const Ao=Mo;var ko=i(35898),Do=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const jo=function(t){function e(e,i,n,o,r,s,a){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=n,l.transform_=o,l.viewRotation_=r,l.squaredTolerance_=s,l.userTransform_=a,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=(0,co.Ue)(),l}return Do(e,t),e.prototype.drawImages_=function(t,e,i,n){if(this.image_){var o=(0,vo.vT)(t,e,i,n,this.transform_,this.pixelCoordinates_),r=this.context_,s=this.tmpLocalTransform_,a=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=a*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var h=0,u=o.length;h<u;h+=2){var c=o[h]-this.imageAnchorX_,p=o[h+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var d=c+this.imageAnchorX_,f=p+this.imageAnchorY_;(0,co.qC)(s,d,f,1,1,l,-d,-f),r.setTransform.apply(r,s),r.translate(d,f),r.scale(this.imageScale_[0],this.imageScale_[1]),r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),r.setTransform(1,0,0,1,0,0)}else r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(r.globalAlpha=a)}},e.prototype.drawText_=function(t,e,i,n){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var o=(0,vo.vT)(t,e,i,n,this.transform_,this.pixelCoordinates_),r=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<i;e+=n){var a=o[e]+this.textOffsetX_,l=o[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]){var h=(0,co.qC)(this.tmpLocalTransform_,a,l,1,1,s,-a,-l);r.setTransform.apply(r,h),r.translate(a,l),r.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&r.strokeText(this.text_,0,0),this.textFillState_&&r.fillText(this.text_,0,0),r.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&r.strokeText(this.text_,a,l),this.textFillState_&&r.fillText(this.text_,a,l)}}},e.prototype.moveToLineTo_=function(t,e,i,n,o){var r=this.context_,s=(0,vo.vT)(t,e,i,n,this.transform_,this.pixelCoordinates_);r.moveTo(s[0],s[1]);var a=s.length;o&&(a-=2);for(var l=2;l<a;l+=2)r.lineTo(s[l],s[l+1]);return o&&r.closePath(),i},e.prototype.drawRings_=function(t,e,i,n){for(var o=0,r=i.length;o<r;++o)e=this.moveToLineTo_(t,e,i[o],n,!0);return e},e.prototype.drawCircle=function(t){if((0,C.kK)(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=(0,ko.Kr)(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],n=e[3]-e[1],o=Math.sqrt(i*i+n*n),r=this.context_;r.beginPath(),r.arc(e[0],e[1],o,0,2*Math.PI),this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&(0,C.kK)(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,n=e.length;i<n;++i)this.drawGeometry(e[i])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),(0,C.kK)(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var n=t.getFlatMidpoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if((0,C.kK)(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,n=t.getFlatCoordinates(),o=0,r=t.getEnds(),s=t.getStride();i.beginPath();for(var a=0,l=r.length;a<l;++a)o=this.moveToLineTo_(n,o,r[a],s,!1);i.stroke()}if(""!==this.text_){var h=t.getFlatMidpoints();this.drawText_(h,0,h.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),(0,C.kK)(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var i=t.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),(0,C.kK)(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getOrientedFlatCoordinates(),n=0,o=t.getEndss(),r=t.getStride();e.beginPath();for(var s=0,a=o.length;s<a;++s){var l=o[s];n=this.drawRings_(i,n,l,r)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var h=t.getFlatInteriorPoints();this.drawText_(h,0,h.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&((0,S.fS)(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,n=t.textAlign?t.textAlign:Qi;i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=n&&(i.textAlign=n,e.textAlign=n),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var i=this;if(t){var n=t.getColor();this.fillState_={fillStyle:Vi(n||Ki)}}else this.fillState_=null;if(e){var o=e.getColor(),r=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),l=e.getLineJoin(),h=e.getWidth(),u=e.getMiterLimit(),c=s||qi;this.strokeState_={lineCap:void 0!==r?r:Hi,lineDash:1===this.pixelRatio_?c:c.map((function(t){return t*i.pixelRatio_})),lineDashOffset:(a||0)*this.pixelRatio_,lineJoin:void 0!==l?l:$i,lineWidth:(void 0!==h?h:1)*this.pixelRatio_,miterLimit:void 0!==u?u:10,strokeStyle:Vi(o||Ji)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var i=t.getAnchor(),n=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*this.pixelRatio_,this.imageAnchorY_=i[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=n[0],this.imageOriginY_=n[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var i=e.getColor();this.textFillState_={fillStyle:Vi(i||Ki)}}else this.textFillState_=null;var n=t.getStroke();if(n){var o=n.getColor(),r=n.getLineCap(),s=n.getLineDash(),a=n.getLineDashOffset(),l=n.getLineJoin(),h=n.getWidth(),u=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:Hi,lineDash:s||qi,lineDashOffset:a||0,lineJoin:void 0!==l?l:$i,lineWidth:void 0!==h?h:1,miterLimit:void 0!==u?u:10,strokeStyle:Vi(o||Ji)}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),d=t.getOffsetY(),f=t.getRotateWithView(),g=t.getRotation(),_=t.getScaleArray(),v=t.getText(),y=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==c?c:Yi,textAlign:void 0!==y?y:Qi,textBaseline:void 0!==m?m:tn},this.text_=void 0!==v?Array.isArray(v)?v.reduce((function(t,e,i){return t+(i%2?" ":e)}),""):v:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==d?this.pixelRatio_*d:0,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*_[0],this.pixelRatio_*_[1]]}else this.text_=""},e}(Bn),zo="fraction",Bo="pixels",No="bottom-left",Go="bottom-right",Wo="top-left",Zo="top-right";var Uo=function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var n=Vo(t,e,i);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,i,n){var o=Vo(t,e,i);this.cache_[o]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function Vo(t,e,i){return e+":"+t+":"+(i?ji(i):"null")}var Xo=new Uo,Yo=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ko=function(t){function e(e,i,n,o){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=n,r.resolution=i,r.state=o,r}return Yo(e,t),e.prototype.changed=function(){this.dispatchEvent(tt.Z.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return(0,yt.O3)()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){(0,yt.O3)()},e}(Xi.Z);var Ho=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();!function(t){function e(e,i,n,o,r,s){var a=t.call(this,e,i,n,Ri)||this;return a.src_=o,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.state=Ri,a.imageLoadFunction_=s,a}Ho(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Ii,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=(0,C.Cr)(this.extent)/this.image_.height),this.state=Pi,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Ri&&this.state!=Ii||(this.state=Oi,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=qo(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=(0,C.Cr)(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Ko);function qo(t,e,i){var n=t,o=!0,r=!1,s=!1,a=[(0,X.Vx)(n,tt.Z.LOAD,(function(){s=!0,r||e()}))];return n.src&&Y.Tp?(r=!0,n.decode().then((function(){o&&e()})).catch((function(t){o&&(s?e():i())}))):a.push((0,X.Vx)(n,tt.Z.ERROR,i)),function(){o=!1,a.forEach(X.bN)}}var $o=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Jo=null,Qo=function(t){function e(e,i,n,o,r,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==o&&(a.image_.crossOrigin=o),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=r,a.size_=n,a.src_=i,a.tainted_,a}return $o(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Pi){Jo||(Jo=K(1,1)),Jo.drawImage(this.image_,0,0);try{Jo.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Jo=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(tt.Z.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=Ii,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Pi,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_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],i=K(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Ri){this.imageState_=Oi;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=qo(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===Pi){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply","multiply"===i.globalCompositeOperation||this.isTainted_())i.fillStyle=ji(this.color_),i.fillRect(0,0,e.width/t,e.height/t),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var n=i.getImageData(0,0,e.width,e.height),o=n.data,r=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,l=this.color_[3],h=0,u=o.length;h<u;h+=4)o[h]*=r,o[h+1]*=s,o[h+2]*=a,o[h+3]*=l;i.putImageData(n,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Xi.Z);var tr=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),er=function(t){function e(e){var i=this,n=e||{},o=void 0!==n.opacity?n.opacity:1,r=void 0!==n.rotation?n.rotation:0,s=void 0!==n.scale?n.scale:1,a=void 0!==n.rotateWithView&&n.rotateWithView;(i=t.call(this,{opacity:o,rotation:r,scale:s,displacement:void 0!==n.displacement?n.displacement:[0,0],rotateWithView:a,declutterMode:n.declutterMode})||this).anchor_=void 0!==n.anchor?n.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=void 0!==n.anchorOrigin?n.anchorOrigin:Wo,i.anchorXUnits_=void 0!==n.anchorXUnits?n.anchorXUnits:zo,i.anchorYUnits_=void 0!==n.anchorYUnits?n.anchorYUnits:zo,i.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null;var l=void 0!==n.img?n.img:null;i.imgSize_=n.imgSize;var h=n.src;(0,y.h)(!(void 0!==h&&l),4),(0,y.h)(!l||l&&i.imgSize_,5),void 0!==h&&0!==h.length||!l||(h=l.src||(0,yt.sq)(l)),(0,y.h)(void 0!==h&&h.length>0,6);var u=void 0!==n.src?Ri:Pi;return i.color_=void 0!==n.color?Wi(n.color):null,i.iconImage_=function(t,e,i,n,o,r){var s=Xo.get(e,n,r);return s||(s=new Qo(t,e,i,n,o,r),Xo.set(e,n,r,s)),s}(l,h,void 0!==i.imgSize_?i.imgSize_:null,i.crossOrigin_,u,i.color_),i.offset_=void 0!==n.offset?n.offset:[0,0],i.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:Wo,i.origin_=null,i.size_=void 0!==n.size?n.size:null,i}return tr(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({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:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==zo||this.anchorYUnits_==zo){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==zo&&(t[0]*=e[0]),this.anchorYUnits_==zo&&(t[1]*=e[1])}if(this.anchorOrigin_!=Wo){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Zo&&this.anchorOrigin_!=Go||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=No&&this.anchorOrigin_!=Go||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var i=this.getDisplacement();return[t[0]-i[0],t[1]+i[1]]},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Wo){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=Zo&&this.offsetOrigin_!=Go||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=No&&this.offsetOrigin_!=Go||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(tt.Z.CHANGE,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(tt.Z.CHANGE,t)},e}(Ai);const ir=er;var nr=.5;var or={Point:function(t,e,i,n,o){var r,s=i.getImage(),a=i.getText();if(s){if(s.getImageState()!=Pi)return;var l=t;if(o){var h=s.getDeclutterMode();if("none"!==h)if(l=o,"obstacle"===h){var u=t.getBuilder(i.getZIndex(),"Image");u.setImageStyle(s,r),u.drawPoint(e,n)}else a&&a.getText()&&(r={})}var c=l.getBuilder(i.getZIndex(),"Image");c.setImageStyle(s,r),c.drawPoint(e,n)}if(a&&a.getText()){var p=t;o&&(p=o);var d=p.getBuilder(i.getZIndex(),"Text");d.setTextStyle(a,r),d.drawText(e,n)}},LineString:function(t,e,i,n,o){var r=i.getStroke();if(r){var s=t.getBuilder(i.getZIndex(),"LineString");s.setFillStrokeStyle(null,r),s.drawLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(o||t).getBuilder(i.getZIndex(),"Text");l.setTextStyle(a),l.drawText(e,n)}},Polygon:function(t,e,i,n,o){var r=i.getFill(),s=i.getStroke();if(r||s){var a=t.getBuilder(i.getZIndex(),"Polygon");a.setFillStrokeStyle(r,s),a.drawPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var h=(o||t).getBuilder(i.getZIndex(),"Text");h.setTextStyle(l),h.drawText(e,n)}},MultiPoint:function(t,e,i,n,o){var r,s=i.getImage(),a=i.getText();if(s){if(s.getImageState()!=Pi)return;var l=t;if(o){var h=s.getDeclutterMode();if("none"!==h)if(l=o,"obstacle"===h){var u=t.getBuilder(i.getZIndex(),"Image");u.setImageStyle(s,r),u.drawMultiPoint(e,n)}else a&&a.getText()&&(r={})}var c=l.getBuilder(i.getZIndex(),"Image");c.setImageStyle(s,r),c.drawMultiPoint(e,n)}if(a&&a.getText()){var p=t;o&&(p=o);var d=p.getBuilder(i.getZIndex(),"Text");d.setTextStyle(a,r),d.drawText(e,n)}},MultiLineString:function(t,e,i,n,o){var r=i.getStroke();if(r){var s=t.getBuilder(i.getZIndex(),"LineString");s.setFillStrokeStyle(null,r),s.drawMultiLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(o||t).getBuilder(i.getZIndex(),"Text");l.setTextStyle(a),l.drawText(e,n)}},MultiPolygon:function(t,e,i,n,o){var r=i.getFill(),s=i.getStroke();if(s||r){var a=t.getBuilder(i.getZIndex(),"Polygon");a.setFillStrokeStyle(r,s),a.drawMultiPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var h=(o||t).getBuilder(i.getZIndex(),"Text");h.setTextStyle(l),h.drawText(e,n)}},GeometryCollection:function(t,e,i,n,o){var r,s,a=e.getGeometriesArray();for(r=0,s=a.length;r<s;++r){(0,or[a[r].getType()])(t,a[r],i,n,o)}},Circle:function(t,e,i,n,o){var r=i.getFill(),s=i.getStroke();if(r||s){var a=t.getBuilder(i.getZIndex(),"Circle");a.setFillStrokeStyle(r,s),a.drawCircle(e,n)}var l=i.getText();if(l&&l.getText()){var h=(o||t).getBuilder(i.getZIndex(),"Text");h.setTextStyle(l),h.drawText(e,n)}}};function rr(t,e){return parseInt((0,yt.sq)(t),10)-parseInt((0,yt.sq)(e),10)}function sr(t,e){return.5*t/e}function ar(t,e,i,n,o,r,s){var a=!1,l=i.getImage();if(l){var h=l.getImageState();h==Pi||h==Ii?l.unlistenImageChange(o):(h==Ri&&l.load(),l.listenImageChange(o),a=!0)}return function(t,e,i,n,o,r){var s=i.getGeometryFunction()(e);if(!s)return;var a=s.simplifyTransformed(n,o);if(i.getRenderer())lr(t,a,i,e);else{(0,or[a.getType()])(t,a,i,e,r)}}(t,e,i,n,r,s),a}function lr(t,e,i,n){if("GeometryCollection"!=e.getType())t.getBuilder(i.getZIndex(),"Default").drawCustom(e,n,i.getRenderer(),i.getHitDetectionRenderer());else for(var o=e.getGeometries(),r=0,s=o.length;r<s;++r)lr(t,o[r],i,n)}var hr=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ur=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.animatingOrInteracting_,i.hitDetectionImageData_=null,i.renderedFeatures_=null,i.renderedRevision_=-1,i.renderedResolution_=NaN,i.renderedExtent_=(0,C.lJ)(),i.wrappedRenderedExtent_=(0,C.lJ)(),i.renderedRotation_,i.renderedCenter_=null,i.renderedProjection_=null,i.renderedRenderOrder_=null,i.replayGroup_=null,i.replayGroupChanged=!0,i.declutterExecutorGroup=null,i.clipping=!0,i.compositionContext_=null,i.opacity_=1,i}return hr(e,t),e.prototype.renderWorlds=function(t,e,i){var n=e.extent,o=e.viewState,r=o.center,s=o.resolution,a=o.projection,l=o.rotation,h=a.getExtent(),u=this.getLayer().getSource(),d=e.pixelRatio,f=e.viewHints,g=!(f[c]||f[p]),_=this.compositionContext_,v=Math.round(e.size[0]*d),y=Math.round(e.size[1]*d),m=u.getWrapX()&&a.canWrapX(),x=m?(0,C.dz)(h):null,w=m?Math.ceil((n[2]-h[2])/x)+1:1,b=m?Math.floor((n[0]-h[0])/x):0;do{var S=this.getRenderTransform(r,s,l,d,v,y,b*x);t.execute(_,1,S,l,g,void 0,i)}while(++b<w)},e.prototype.setupCompositionContext_=function(){if(1!==this.opacity_){var t=K(this.context.canvas.width,this.context.canvas.height,fo);this.compositionContext_=t}else this.compositionContext_=this.context},e.prototype.releaseCompositionContext_=function(){if(1!==this.opacity_){var t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,H(this.compositionContext_),fo.push(this.compositionContext_.canvas),this.compositionContext_=null}},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.releaseCompositionContext_())},e.prototype.renderFrame=function(t,e){var i=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];(0,co.n3)(this.pixelTransform,1/i,1/i),(0,co.nb)(this.inversePixelTransform,this.pixelTransform);var o=(0,co.BB)(this.pixelTransform);this.useContainer(e,o,this.getBackground(t));var r=this.context,s=r.canvas,a=this.replayGroup_,l=this.declutterExecutorGroup;if((!a||a.isEmpty())&&(!l||l.isEmpty()))return null;var h=Math.round(t.size[0]*i),u=Math.round(t.size[1]*i);s.width!=h||s.height!=u?(s.width=h,s.height=u,s.style.transform!==o&&(s.style.transform=o)):this.containerReused||r.clearRect(0,0,h,u),this.preRender(r,t);var c=t.viewState,p=c.projection;this.opacity_=n.opacity,this.setupCompositionContext_();var d=!1,f=!0;if(n.extent&&this.clipping){var _=(0,g.dY)(n.extent,p);(d=(f=(0,C.kK)(_,t.extent))&&!(0,C.r4)(_,t.extent))&&this.clipUnrotated(this.compositionContext_,t,_)}return f&&this.renderWorlds(a,t),d&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(r,t),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];(0,co.nn)(this.pixelTransform,i);var n=this.renderedCenter_,o=this.renderedResolution_,r=this.renderedRotation_,s=this.renderedProjection_,a=this.wrappedRenderedExtent_,l=this.getLayer(),h=[],u=i[0]*nr,c=i[1]*nr;h.push(this.getRenderTransform(n,o,r,nr,u,c,0).slice());var p=l.getSource(),d=s.getExtent();if(p.getWrapX()&&s.canWrapX()&&!(0,C.r4)(d,a)){for(var f=a[0],g=(0,C.dz)(d),_=0,v=void 0;f<d[0];)v=g*--_,h.push(this.getRenderTransform(n,o,r,nr,u,c,v).slice()),f+=g;for(_=0,f=a[2];f>d[2];)v=g*++_,h.push(this.getRenderTransform(n,o,r,nr,u,c,v).slice()),f-=g}this.hitDetectionImageData_=function(t,e,i,n,o,r,s){var a=K(t[0]*nr,t[1]*nr);a.imageSmoothingEnabled=!1;for(var l=a.canvas,h=new jo(a,nr,o,null,s),u=i.length,c=Math.floor(16777215/u),p={},d=1;d<=u;++d){var f=i[d-1],g=f.getStyleFunction()||n;if(n){var _=g(f,r);if(_){Array.isArray(_)||(_=[_]);for(var v="#"+("000000"+(d*c).toString(16)).slice(-6),y=0,m=_.length;y<m;++y){var x=_[y],w=x.getGeometryFunction()(f);if(w&&(0,C.kK)(o,w.getExtent())){var b=x.clone(),E=b.getFill();E&&E.setColor(v);var T=b.getStroke();T&&(T.setColor(v),T.setLineDash(null)),b.setText(void 0);var R=x.getImage();if(R&&0!==R.getOpacity()){var O=R.getImageSize();if(!O)continue;var P=K(O[0],O[1],void 0,{alpha:!1}),I=P.canvas;P.fillStyle=v,P.fillRect(0,0,I.width,I.height),b.setImage(new ir({img:I,imgSize:O,anchor:R.getAnchor(),anchorXUnits:Bo,anchorYUnits:Bo,offset:R.getOrigin(),opacity:1,size:R.getSize(),scale:R.getScale(),rotation:R.getRotation(),rotateWithView:R.getRotateWithView()}))}var L=b.getZIndex()||0;(A=p[L])||(A={},p[L]=A,A.Polygon=[],A.Circle=[],A.LineString=[],A.Point=[]),A[w.getType().replace("Multi","")].push(w,b)}}}}}for(var M=Object.keys(p).map(Number).sort(S.kK),F=(d=0,M.length);d<F;++d){var A=p[M[d]];for(var k in A){var D=A[k];for(y=0,m=D.length;y<m;y+=2){h.setStyle(D[y+1]);for(var j=0,z=e.length;j<z;++j)h.setTransform(e[j]),h.drawGeometry(D[y])}}}return a.getImageData(0,0,l.width,l.height)}(i,h,this.renderedFeatures_,l.getStyleFunction(),a,o,r)}e(function(t,e,i){var n=[];if(i){var o=Math.floor(Math.round(t[0])*nr),r=Math.floor(Math.round(t[1])*nr),s=4*((0,x.uZ)(o,0,i.width-1)+(0,x.uZ)(r,0,i.height-1)*i.width),a=i.data[s],l=i.data[s+1],h=i.data[s+2]+256*(l+256*a),u=Math.floor(16777215/e.length);h&&h%u==0&&n.push(e[h/u-1])}return n}(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o){var r=this;if(this.replayGroup_){var s,a=e.viewState.resolution,l=e.viewState.rotation,h=this.getLayer(),u={},c=function(t,e,i){var r=(0,yt.sq)(t),s=u[r];if(s){if(!0!==s&&i<s.distanceSq){if(0===i)return u[r]=!0,o.splice(o.lastIndexOf(s),1),n(t,h,e);s.geometry=e,s.distanceSq=i}}else{if(0===i)return u[r]=!0,n(t,h,e);o.push(u[r]={feature:t,layer:h,geometry:e,distanceSq:i,callback:n})}},p=[this.replayGroup_];return this.declutterExecutorGroup&&p.push(this.declutterExecutorGroup),p.some((function(n){return s=n.forEachFeatureAtCoordinate(t,a,l,i,c,n===r.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map((function(t){return t.value})):null)})),s}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),i=e.getSource();if(!i)return!1;var n=t.viewHints[c],o=t.viewHints[p],r=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(this.ready&&!r&&n||!s&&o)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var a=t.extent,l=t.viewState,h=l.projection,u=l.resolution,d=t.pixelRatio,f=e.getRevision(),_=e.getRenderBuffer(),y=e.getRenderOrder();void 0===y&&(y=rr);var m=l.center.slice(),x=(0,C.f3)(a,_*u),w=x.slice(),b=[x.slice()],E=h.getExtent();if(i.getWrapX()&&h.canWrapX()&&!(0,C.r4)(E,t.extent)){var T=(0,C.dz)(E),R=Math.max((0,C.dz)(x)/2,T);x[0]=E[0]-R,x[2]=E[2]+R,(0,v.Cf)(m,h);var O=(0,C.Cf)(b[0],h);O[0]<E[0]&&O[2]<E[2]?b.push([O[0]+T,O[1],O[2]+T,O[3]]):O[0]>E[0]&&O[2]>E[2]&&b.push([O[0]-T,O[1],O[2]-T,O[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==f&&this.renderedRenderOrder_==y&&(0,C.r4)(this.wrappedRenderedExtent_,x))return(0,S.fS)(this.renderedExtent_,w)||(this.hitDetectionImageData_=null,this.renderedExtent_=w),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var P,I=new oo(sr(u,d),x,u,d);this.getLayer().getDeclutter()&&(P=new oo(sr(u,d),x,u,d));var L,M=(0,g.Cs)();if(M){for(var F=0,A=b.length;F<A;++F){var k=b[F],D=(0,g.Fj)(k,h);i.loadFeatures(D,(0,g.on)(u,h),M)}L=(0,g.WO)(M,h)}else for(F=0,A=b.length;F<A;++F)i.loadFeatures(b[F],u,h);var j=function(t,e){var i=sr(t,e);return i*i}(u,d),z=!0,B=function(t){var i,n=t.getStyleFunction()||e.getStyleFunction();if(n&&(i=n(t,u)),i){var o=this.renderFeature(t,j,i,I,L,P);z=z&&!o}}.bind(this),N=(0,g.Fj)(x,h),G=i.getFeaturesInExtent(N);y&&G.sort(y);for(F=0,A=G.length;F<A;++F)B(G[F]);this.renderedFeatures_=G,this.ready=z;var W=I.finish(),Z=new Ao(x,u,d,i.getOverlaps(),W,e.getRenderBuffer());return P&&(this.declutterExecutorGroup=new Ao(x,u,d,i.getOverlaps(),P.finish(),e.getRenderBuffer())),this.renderedResolution_=u,this.renderedRevision_=f,this.renderedRenderOrder_=y,this.renderedExtent_=w,this.wrappedRenderedExtent_=x,this.renderedCenter_=m,this.renderedProjection_=h,this.replayGroup_=Z,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,n,o,r){if(!i)return!1;var s=!1;if(Array.isArray(i))for(var a=0,l=i.length;a<l;++a)s=ar(n,t,i[a],e,this.boundHandleStyleImageChange_,o,r)||s;else s=ar(n,t,i,e,this.boundHandleStyleImageChange_,o,r);return s},e}(_o);const cr=ur;var pr=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const dr=function(t){function e(e){return t.call(this,e)||this}return pr(e,t),e.prototype.createRenderer=function(){return new cr(this)},e}(Ln);var fr=i(17169),gr=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function _r(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}const vr=function(t){function e(e){var i=t.call(this)||this;i.projection=(0,g.U2)(e.projection),i.attributions_=_r(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:"ready",i.wrapX_=void 0!==e.wrapX&&e.wrapX,i.interpolate_=!!e.interpolate,i.viewResolver=null,i.viewRejector=null;var n=i;return i.viewPromise_=new Promise((function(t,e){n.viewResolver=t,n.viewRejector=e})),i}return gr(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return(0,yt.O3)()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getInterpolate=function(){return this.interpolate_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=_r(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(h.Z);function yr(t,e){return[[-1/0,-1/0,1/0,1/0]]}var mr=!1;function xr(t,e){return function(i,n,o,r,s){var a=this;!function(t,e,i,n,o,r,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(i,n,o):t,!0),"arraybuffer"==e.getType()&&(a.responseType="arraybuffer"),a.withCredentials=mr,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var n=e.getType(),l=void 0;"json"==n||"text"==n?l=a.responseText:"xml"==n?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):"arraybuffer"==n&&(l=a.response),l?r(e.readFeatures(l,{extent:i,featureProjection:o}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}(t,e,i,n,o,(function(t,e){a.addFeatures(t),void 0!==r&&r(t)}),s||_.Zn)}}var wr=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),br=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.feature=i,o.features=n,o}return wr(e,t),e}(ai.ZP),Cr=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{attributions:n.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===n.wrapX||n.wrapX})||this).on,i.once,i.un,i.loader_=_.Zn,i.format_=n.format,i.overlaps_=void 0===n.overlaps||n.overlaps,i.url_=n.url,void 0!==n.loader?i.loader_=n.loader:void 0!==i.url_&&((0,y.h)(i.format_,7),i.loader_=xr(i.url_,i.format_)),i.strategy_=void 0!==n.strategy?n.strategy:yr;var o,r,s=void 0===n.useSpatialIndex||n.useSpatialIndex;return i.featuresRtree_=s?new mi:null,i.loadedExtentsRtree_=new mi,i.loadingExtentsCount_=0,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(n.features)?r=n.features:n.features&&(r=(o=n.features).getArray()),s||void 0!==o||(o=new pi(r)),void 0!==r&&i.addFeaturesInternal(r),void 0!==o&&i.bindFeaturesCollection_(o),i}return wr(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=(0,yt.sq)(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new br(xi,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[(0,X.oL)(e,tt.Z.CHANGE,this.handleFeatureChange_,this),(0,X.oL)(e,fr.Z.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e),i&&((0,y.h)(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],n=[],o=0,r=t.length;o<r;o++){var s=t[o],a=(0,yt.sq)(s);this.addToIndex_(a,s)&&i.push(s)}o=0;for(var l=i.length;o<l;o++){s=i[o],a=(0,yt.sq)(s);this.setupChangeEvents_(a,s);var h=s.getGeometry();if(h){var u=h.getExtent();e.push(u),n.push(s)}else this.nullGeometryFeatures_[a]=s}if(this.featuresRtree_&&this.featuresRtree_.load(e,n),this.hasListener(xi)){o=0;for(var c=i.length;o<c;o++)this.dispatchEvent(new br(xi,i[o]))}},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(xi,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(Ci,(function(i){e||(e=!0,t.remove(i.feature),e=!1)})),t.addEventListener(ri,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(si,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(X.bN)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var i=function(t){this.removeFeatureInternal(t)}.bind(this);for(var n in this.featuresRtree_.forEach(i),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var o=new br(bi);this.dispatchEvent(o),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?e(i):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(i){if(i.getGeometry().intersectsExtent(t)){var n=e(i);if(n)return n}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),(0,m.xb)(this.nullGeometryFeatures_)||(0,S.l7)(t,(0,m.KX)(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t,e){var i=this;if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);var n=(0,C.MV)(t,e);return[].concat.apply([],n.map((function(t){return i.featuresRtree_.getInExtent(t)})))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var i=t[0],n=t[1],o=null,r=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],l=e||_.uX;return this.featuresRtree_.forEachInExtent(a,(function(t){if(l(t)){var e=t.getGeometry(),h=s;if((s=e.closestPointXY(i,n,r,s))<h){o=t;var u=Math.sqrt(s);a[0]=i-u,a[1]=n-u,a[2]=i+u,a[3]=n+u}}})),o},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,i=(0,yt.sq)(e),n=e.getGeometry();if(n){var o=n.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var r=e.getId();if(void 0!==r){var s=r.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new br(wi,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:(0,yt.sq)(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&(0,m.xb)(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()},e.prototype.loadFeatures=function(t,e,i){for(var n=this.loadedExtentsRtree_,o=this.strategy_(t,e,i),r=function(t,r){var a=o[t];n.forEachInExtent(a,(function(t){return(0,C.r4)(t.extent,a)}))||(++s.loadingExtentsCount_,s.dispatchEvent(new br(Si)),s.loader_.call(s,a,e,i,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new br(Ei,void 0,t))}.bind(s),function(){--this.loadingExtentsCount_,this.dispatchEvent(new br(Ti))}.bind(s)),n.insert(a,{extent:a.slice()}))},s=this,a=0,l=o.length;a<l;++a)r(a);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if((0,C.fS)(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){if(t){var e=(0,yt.sq)(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}},e.prototype.removeFeatureInternal=function(t){var e=(0,yt.sq)(t),i=this.featureChangeKeys_[e];if(i){i.forEach(X.bN),delete this.featureChangeKeys_[e];var n=t.getId();return void 0!==n&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new br(Ci,t)),t}},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){(0,y.h)(this.format_,7),this.url_=t,this.setLoader(xr(t,this.format_))},e}(vr);const Sr=Cr;var Er=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Tr=[0,0,0,0],Rr=[],Or="modifystart",Pr="modifyend",Ir=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.features=i,o.mapBrowserEvent=n,o}return Er(e,t),e}(ai.ZP),Lr=function(t){function e(e){var i,n,o=t.call(this,e)||this;if(o.on,o.once,o.un,o.boundHandleFeatureChange_=o.handleFeatureChange_.bind(o),o.condition_=e.condition?e.condition:re,o.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&function(t){return t.type==Ht.SINGLECLICK}(t)},o.deleteCondition_=e.deleteCondition?e.deleteCondition:o.defaultDeleteCondition_,o.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Qt,o.vertexFeature_=null,o.vertexSegments_=null,o.lastPixel_=[0,0],o.ignoreNextSingleClick_=!1,o.featuresBeingModified_=null,o.rBush_=new mi,o.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,o.snappedToVertex_=!1,o.changingFeature_=!1,o.dragSegments_=[],o.overlay_=new dr({source:new Sr({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(i=En(),function(t,e){return i.Point}),updateWhileAnimating:!0,updateWhileInteracting:!0}),o.SEGMENT_WRITERS_={Point:o.writePointGeometry_.bind(o),LineString:o.writeLineStringGeometry_.bind(o),LinearRing:o.writeLineStringGeometry_.bind(o),Polygon:o.writePolygonGeometry_.bind(o),MultiPoint:o.writeMultiPointGeometry_.bind(o),MultiLineString:o.writeMultiLineStringGeometry_.bind(o),MultiPolygon:o.writeMultiPolygonGeometry_.bind(o),Circle:o.writeCircleGeometry_.bind(o),GeometryCollection:o.writeGeometryCollectionGeometry_.bind(o)},o.source_=null,o.hitDetection_=null,e.features?n=e.features:e.source&&(o.source_=e.source,n=new pi(o.source_.getFeatures()),o.source_.addEventListener(xi,o.handleSourceAdd_.bind(o)),o.source_.addEventListener(Ci,o.handleSourceRemove_.bind(o))),!n)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(o.hitDetection_=e.hitDetection),o.features_=n,o.features_.forEach(o.addFeature_.bind(o)),o.features_.addEventListener(ri,o.handleFeatureAdd_.bind(o)),o.features_.addEventListener(si,o.handleFeatureRemove_.bind(o)),o.lastPointerEvent_=null,o.delta_=[0,0],o.snapToPointer_=void 0===e.snapToPointer?!o.hitDetection_:e.snapToPointer,o}return Er(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}var n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,n),t.addEventListener(tt.Z.CHANGE,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new pi;for(var i=this.featuresBeingModified_.getArray(),n=0,o=e.length;n<o;++n)for(var r=e[n],s=0,a=r.length;s<a;++s){var l=r[s].feature;l&&-1===i.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new Ir(Or,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(tt.Z.CHANGE,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var n=i.length-1;n>=0;--n){for(var o=i[n],r=this.dragSegments_.length-1;r>=0;--r)this.dragSegments_[r][0]===o&&this.dragSegments_.splice(r,1);e.remove(o)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),n={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,o=i.length;n<o;++n){var r=i[n],s={feature:t,geometry:e,depth:[n],index:n,segment:[r,r]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,o=i.length-1;n<o;++n){var r=i.slice(n,n+2),s={feature:t,geometry:e,index:n,segment:r};this.rBush_.insert((0,C.hI)(r),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,o=i.length;n<o;++n)for(var r=i[n],s=0,a=r.length-1;s<a;++s){var l=r.slice(s,s+2),h={feature:t,geometry:e,depth:[n],index:s,segment:l};this.rBush_.insert((0,C.hI)(l),h)}},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,o=i.length;n<o;++n)for(var r=i[n],s=0,a=r.length-1;s<a;++s){var l=r.slice(s,s+2),h={feature:t,geometry:e,depth:[n],index:s,segment:l};this.rBush_.insert((0,C.hI)(l),h)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,o=i.length;n<o;++n)for(var r=i[n],s=0,a=r.length;s<a;++s)for(var l=r[s],h=0,u=l.length-1;h<u;++h){var c=l.slice(h,h+2),p={feature:t,geometry:e,depth:[s,n],index:h,segment:c};this.rBush_.insert((0,C.hI)(c),p)}},e.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),n={feature:t,geometry:e,index:0,segment:[i,i]},o={feature:t,geometry:e,index:1,segment:[i,i]},r=[n,o];n.featureSegments=r,o.featureSegments=r,this.rBush_.insert((0,C.HK)(i),n);var s=e,a=(0,g.Cs)();if(a&&this.getMap()){var l=this.getMap().getView().getProjection();s=s.clone().transform(a,l),s=(0,k.Bb)(s).transform(l,a)}this.rBush_.insert(s.getExtent(),o)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),n=0;n<i.length;++n){var o=i[n];(0,this.SEGMENT_WRITERS_[o.getType()])(t,o)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,i){var n=this.vertexFeature_;n?n.getGeometry().setCoordinates(t):(n=new di.Z(new ni.Z(t)),this.vertexFeature_=n,this.overlay_.getSource().addFeature(n));return n.set("features",e),n.set("geometries",i),n},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=Ht.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(i=!(e.type!=Ht.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==Ht.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!i);var i},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],i=[],n=[],o=0,r=this.dragSegments_.length;o<r;++o){var s=this.dragSegments_[o],a=s[0],l=a.feature;-1===i.indexOf(l)&&i.push(l);var h=a.geometry;-1===n.indexOf(h)&&n.push(h);for(var u=a.depth,c=void 0,p=a.segment,d=s[1];e.length<h.getStride();)e.push(p[d][e.length]);switch(h.getType()){case"Point":c=e,p[0]=e,p[1]=e;break;case"MultiPoint":(c=h.getCoordinates())[a.index]=e,p[0]=e,p[1]=e;break;case"LineString":(c=h.getCoordinates())[a.index+d]=e,p[d]=e;break;case"MultiLineString":case"Polygon":(c=h.getCoordinates())[u[0]][a.index+d]=e,p[d]=e;break;case"MultiPolygon":(c=h.getCoordinates())[u[1]][u[0]][a.index+d]=e,p[d]=e;break;case"Circle":if(p[0]=e,p[1]=e,0===a.index)this.changingFeature_=!0,h.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;var f=t.map.getView().getProjection(),_=(0,v.TE)((0,g.Vs)(h.getCenter(),f),(0,g.Vs)(e,f)),y=(0,g.Cs)();if(y){var m=h.clone().transform(y,f);m.setRadius(_),_=m.transform(f,y).getRadius()}h.setRadius(_),this.changingFeature_=!1}}c&&this.setGeometryCoordinates_(h,c)}this.createOrUpdateVertexFeature_(e,i,n)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var i=this.vertexFeature_;if(i){var n=t.map.getView().getProjection(),o=[],r=i.getGeometry().getCoordinates(),s=(0,C.hI)([r]),a=this.rBush_.getInExtent(s),l={};a.sort(Mr);for(var h=0,u=a.length;h<u;++h){var c=a[h],p=c.segment,d=(0,yt.sq)(c.geometry),f=c.depth;if(f&&(d+="-"+f.join("-")),l[d]||(l[d]=new Array(2)),"Circle"!==c.geometry.getType()||1!==c.index)if(!(0,v.fS)(p[0],r)||l[d][0])if(!(0,v.fS)(p[1],r)||l[d][1])(0,yt.sq)(p)in this.vertexSegments_&&!l[d][0]&&!l[d][1]&&this.insertVertexCondition_(t)&&o.push(c);else{if(l[d][0]&&0===l[d][0].index){var g=c.geometry.getCoordinates();switch(c.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":g=g[f[1]];case"Polygon":if(c.index!==g[f[0]].length-2)continue}}this.dragSegments_.push([c,1]),l[d][1]=c}else this.dragSegments_.push([c,0]),l[d][0]=c;else{var _=Ar(e,c,n);(0,v.fS)(_,r)&&!l[d][0]&&(this.dragSegments_.push([c,0]),l[d][0]=c)}}o.length&&this.willModifyFeatures_(t,[o]);for(var y=o.length-1;y>=0;--y)this.insertVertex_(o[y],r)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],n=i.geometry;if("Circle"===n.getType()){var o=n.getCenter(),r=i.featureSegments[0],s=i.featureSegments[1];r.segment[0]=o,r.segment[1]=o,s.segment[0]=o,s.segment[1]=o,this.rBush_.update((0,C.HK)(o),r);var a=n,l=(0,g.Cs)();if(l){var h=t.map.getView().getProjection();a=a.clone().transform(l,h),a=(0,k.Bb)(a).transform(h,l)}this.rBush_.update(a.getExtent(),s)}else this.rBush_.update((0,C.hI)(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new Ir(Pr,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,i){var n,o,r=this,s=i||e.getCoordinateFromPixel(t),a=e.getView().getProjection();if(this.hitDetection_){var l="object"==typeof this.hitDetection_?function(t){return t===r.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,i){if("Point"===(i=i||t.getGeometry()).getType()&&(0,S.q9)(r.features_.getArray(),t)){o=i;var s=i.getFlatCoordinates().slice(0,2);n=[{feature:t,geometry:i,segment:[s,s]}]}return!0}),{layerFilter:l})}if(!n){var h=(0,g.dY)((0,C.HK)(s,Tr),a),u=e.getView().getResolution()*this.pixelTolerance_,c=(0,g.Fj)((0,C.f3)(h,u,Tr),a);n=this.rBush_.getInExtent(c)}if(n&&n.length>0){var p=n.sort((function(t,e){return Fr(s,t,a)-Fr(s,e,a)}))[0],d=p.segment,f=Ar(s,p,a),_=e.getPixelFromCoordinate(f),y=(0,v.TE)(t,_);if(o||y<=this.pixelTolerance_){var m={};if(m[(0,yt.sq)(d)]=!0,this.snapToPointer_||(this.delta_[0]=f[0]-s[0],this.delta_[1]=f[1]-s[1]),"Circle"===p.geometry.getType()&&1===p.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(f,[p.feature],[p.geometry]);else{var x=e.getPixelFromCoordinate(d[0]),w=e.getPixelFromCoordinate(d[1]),b=(0,v.bI)(_,x),E=(0,v.bI)(_,w);y=Math.sqrt(Math.min(b,E)),this.snappedToVertex_=y<=this.pixelTolerance_,this.snappedToVertex_&&(f=b>E?d[1]:d[0]),this.createOrUpdateVertexFeature_(f,[p.feature],[p.geometry]);var T={};T[(0,yt.sq)(p.geometry)]=!0;for(var R=1,O=n.length;R<O;++R){var P=n[R].segment;if(!((0,v.fS)(d[0],P[0])&&(0,v.fS)(d[1],P[1])||(0,v.fS)(d[0],P[1])&&(0,v.fS)(d[1],P[0])))break;var I=(0,yt.sq)(n[R].geometry);I in T||(T[I]=!0,m[(0,yt.sq)(P)]=!0)}}return void(this.vertexSegments_=m)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var i,n=t.segment,o=t.feature,r=t.geometry,s=t.depth,a=t.index;e.length<r.getStride();)e.push(0);switch(r.getType()){case"MultiLineString":case"Polygon":(i=r.getCoordinates())[s[0]].splice(a+1,0,e);break;case"MultiPolygon":(i=r.getCoordinates())[s[1]][s[0]].splice(a+1,0,e);break;case"LineString":(i=r.getCoordinates()).splice(a+1,0,e);break;default:return}this.setGeometryCoordinates_(r,i);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(r,a,s,1);var h={segment:[n[0],e],feature:o,geometry:r,depth:s,index:a};l.insert((0,C.hI)(h.segment),h),this.dragSegments_.push([h,1]);var u={segment:[e,n[1]],feature:o,geometry:r,depth:s,index:a+1};l.insert((0,C.hI)(u.segment),u),this.dragSegments_.push([u,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=Ht.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new Ir(Pr,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,i,n,o,r,s,a,l,h,u,c=this.dragSegments_,p={},d=!1;for(o=c.length-1;o>=0;--o)h=(i=c[o])[0],u=(0,yt.sq)(h.feature),h.depth&&(u+="-"+h.depth.join("-")),u in p||(p[u]={}),0===i[1]?(p[u].right=h,p[u].index=h.index):1==i[1]&&(p[u].left=h,p[u].index=h.index+1);for(u in p){switch(l=p[u].right,s=p[u].left,(a=(r=p[u].index)-1)<0&&(a=0),t=e=(n=(h=void 0!==s?s:l).geometry).getCoordinates(),d=!1,n.getType()){case"MultiLineString":e[h.depth[0]].length>2&&(e[h.depth[0]].splice(r,1),d=!0);break;case"LineString":e.length>2&&(e.splice(r,1),d=!0);break;case"MultiPolygon":t=t[h.depth[1]];case"Polygon":(t=t[h.depth[0]]).length>4&&(r==t.length-1&&(r=0),t.splice(r,1),d=!0,0===r&&(t.pop(),t.push(t[0]),a=t.length-1))}if(d){this.setGeometryCoordinates_(n,e);var f=[];if(void 0!==s&&(this.rBush_.remove(s),f.push(s.segment[0])),void 0!==l&&(this.rBush_.remove(l),f.push(l.segment[1])),void 0!==s&&void 0!==l){var g={depth:h.depth,feature:h.feature,geometry:h.geometry,index:a,segment:f};this.rBush_.insert((0,C.hI)(g.segment),g)}this.updateSegmentIndices_(n,r,h.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),c.length=0}}return d},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,i,n){this.rBush_.forEachInExtent(t.getExtent(),(function(o){o.geometry===t&&(void 0===i||void 0===o.depth||(0,S.fS)(o.depth,i))&&o.index>e&&(o.index+=n)}))},e}(_i);function Mr(t,e){return t.index-e.index}function Fr(t,e,i){var n=e.geometry;if("Circle"===n.getType()){var o=n;if(1===e.index){var r=(0,g.Cs)();r&&(o=o.clone().transform(r,i));var s=(0,v.bI)(o.getCenter(),(0,g.Vs)(t,i)),a=Math.sqrt(s)-o.getRadius();return a*a}}var l=(0,g.Vs)(t,i);return Rr[0]=(0,g.Vs)(e.segment[0],i),Rr[1]=(0,g.Vs)(e.segment[1],i),(0,v.Bs)(l,Rr)}function Ar(t,e,i){var n=e.geometry;if("Circle"===n.getType()&&1===e.index){var o=n,r=(0,g.Cs)();return r&&(o=o.clone().transform(r,i)),(0,g.lO)(o.getClosestPoint((0,g.Vs)(t,i)),i)}var s=(0,g.Vs)(t,i);return Rr[0]=(0,g.Vs)(e.segment[0],i),Rr[1]=(0,g.Vs)(e.segment[1],i),(0,g.lO)((0,v.oL)(s,Rr),i)}const kr=Lr;var Dr=i(27525),jr=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),zr=function(t){function e(e,i,n){var o=t.call(this)||this;if(void 0!==n&&void 0===i)o.setFlatCoordinates(n,e);else{var r=i||0;o.setCenterAndRadius(e,r,n)}return o}return jr(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,n){var o=this.flatCoordinates,r=t-o[0],s=e-o[1],a=r*r+s*s;if(a<n){if(0===a)for(var l=0;l<this.stride;++l)i[l]=o[l];else{var h=this.getRadius()/Math.sqrt(a);i[0]=o[0]+h*r,i[1]=o[1]+h*s;for(l=2;l<this.stride;++l)i[l]=o[l]}return i.length=this.stride,a}return n},e.prototype.containsXY=function(t,e){var i=this.flatCoordinates,n=t-i[0],o=e-i[1];return n*n+o*o<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,i=e[this.stride]-e[0];return(0,C.T9)(e[0]-i,e[1]-i,e[0]+i,e[1]+i,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return"Circle"},e.prototype.intersectsExtent=function(t){var e=this.getExtent();if((0,C.kK)(t,e)){var i=this.getCenter();return t[0]<=i[0]&&t[2]>=i[0]||(t[1]<=i[1]&&t[3]>=i[1]||(0,C.H6)(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+i;for(var o=1;o<e;++o)n[e+o]=t[o];this.setFlatCoordinates(this.layout,n),this.changed()},e.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var n=this.flatCoordinates,o=(0,Dr.IG)(n,0,t,this.stride);n[o++]=n[0]+e;for(var r=1,s=this.stride;r<s;++r)n[o++]=n[r];n.length=o,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var i=this.getCenter(),n=this.getStride();this.setCenter((0,vo.U1)(i,0,i.length,n,t,e,i)),this.changed()},e.prototype.translate=function(t,e){var i=this.getCenter(),n=this.getStride();this.setCenter((0,vo.Iu)(i,0,i.length,n,t,e,i)),this.changed()},e}(ko.ZP);zr.prototype.transform;const Br=zr;var Nr=i(57927),Gr=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Wr=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.map=i,o.frameState=void 0!==n?n:null,o}return Gr(e,t),e}(ai.ZP);var Zr=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ur=function(t){function e(e,i,n,o,r,s){var a=t.call(this,e,i,r)||this;return a.originalEvent=n,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==o&&o,a.activePointers=s,a}return Zr(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(Wr);var Vr=i(60768),Xr=i(43321),Yr=i(78960),Kr=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Hr="Point",qr="LineString",$r="Polygon",Jr="Circle",Qr="drawstart",ts="drawend",es="drawabort",is=function(t){function e(e,i){var n=t.call(this,e)||this;return n.feature=i,n}return Kr(e,t),e}(ai.ZP);function ns(){var t=En();return function(e,i){return t[e.getGeometry().getType()]}}const os=function(t){function e(e){var i=this,n=e;n.stopDown||(n.stopDown=_.Dv),(i=t.call(this,n)||this).on,i.once,i.un,i.shouldHandle_=!1,i.downPx_=null,i.downTimeout_,i.lastDragTime_,i.pointerType_,i.freehand_=!1,i.source_=e.source?e.source:null,i.features_=e.features?e.features:null,i.snapTolerance_=e.snapTolerance?e.snapTolerance:12,i.type_=e.type,i.mode_=function(t){switch(t){case"Point":case"MultiPoint":return Hr;case"LineString":case"MultiLineString":return qr;case"Polygon":case"MultiPolygon":return $r;case"Circle":return Jr;default:throw new Error("Invalid type: "+t)}}(i.type_),i.stopClick_=!!e.stopClick,i.minPoints_=e.minPoints?e.minPoints:i.mode_===$r?3:2,i.maxPoints_=i.mode_===Jr?2:e.maxPoints?e.maxPoints:1/0,i.finishCondition_=e.finishCondition?e.finishCondition:_.uX,i.geometryLayout_=e.geometryLayout?e.geometryLayout:Nr.Z.XY;var o=e.geometryFunction;if(!o){var r,s=i.mode_;if(s===Jr)o=function(t,e,i){var n=e||new Br([NaN,NaN]),o=(0,g.Vs)(t[0],i),r=(0,v.bI)(o,(0,g.Vs)(t[t.length-1],i));n.setCenterAndRadius(o,Math.sqrt(r),this.geometryLayout_);var s=(0,g.Cs)();return s&&n.transform(i,s),n};else s===Hr?r=ni.Z:s===qr?r=ii.Z:s===$r&&(r=k.ZP),o=function(t,e,i){return e?s===$r?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])],this.geometryLayout_):e.setCoordinates([],this.geometryLayout_):e.setCoordinates(t,this.geometryLayout_):e=new r(t,this.geometryLayout_),e}}return i.geometryFunction_=o,i.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,i.finishCoordinate_=null,i.sketchFeature_=null,i.sketchPoint_=null,i.sketchCoords_=null,i.sketchLine_=null,i.sketchLineCoords_=null,i.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,i.overlay_=new dr({source:new Sr({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:ns(),updateWhileInteracting:!0}),i.geometryName_=e.geometryName,i.condition_=e.condition?e.condition:ee,i.freehandCondition_,e.freehand?i.freehandCondition_=Qt:i.freehandCondition_=e.freehandCondition?e.freehandCondition:ie,i.addChangeListener(Vt,i.updateState_),i}return Kr(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===tt.Z.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==Hr&&this.freehandCondition_(e);var i=e.type===Ht.POINTERMOVE,n=!0;!this.freehand_&&this.lastDragTime_&&e.type===Ht.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===Ht.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===Ht.POINTERDOWN?n=!1:i&&this.getPointerCount()<2?(n=e.type===Ht.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===Ht.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===Ht.DBLCLICK&&(n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new Ur(Ht.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(t.coordinate),!i&&this.freehand_?this.finishDrawing():this.freehand_||i&&this.mode_!==Hr||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,i=t.pixel,n=e[0]-i[0],o=e[1]-i[1],r=n*n+o*o;if(this.shouldHandle_=this.freehand_?r>this.squaredClickTolerance_:r<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,n=[this.finishCoordinate_],o=this.mode_;if(o===Hr)e=!0;else if(o===Jr)e=2===this.sketchCoords_.length;else if(o===qr)i=this.sketchCoords_.length>this.minPoints_;else if(o===$r){var r=this.sketchCoords_;i=r[0].length>this.minPoints_,n=[r[0][0],r[0][r[0].length-2]]}if(i)for(var s=this.getMap(),a=0,l=n.length;a<l;a++){var h=n[a],u=s.getPixelFromCoordinate(h),c=t[0]-u[0],p=t[1]-u[1],d=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(c*c+p*p)<=d){this.finishCoordinate_=h;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new di.Z(new ni.Z(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new di.Z);var e=t.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new ii.Z(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))},e.prototype.startDrawing_=function(t){for(var e=this.getMap().getView().getProjection(),i=(0,ko.tP)(this.geometryLayout_);t.length<i;)t.push(0);this.finishCoordinate_=t,this.mode_===Hr?this.sketchCoords_=t.slice():this.mode_===$r?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new di.Z(new ii.Z(this.sketchLineCoords_)));var n=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new di.Z,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(n),this.updateSketchFeatures_(),this.dispatchEvent(new is(Qr,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){for(var e,i,n=this.getMap(),o=this.sketchFeature_.getGeometry(),r=n.getView().getProjection(),s=(0,ko.tP)(this.geometryLayout_);t.length<s;)t.push(0);(this.mode_===Hr?i=this.sketchCoords_:this.mode_===$r?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(n.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=t[0],i[1]=t[1],this.geometryFunction_(this.sketchCoords_,o,r),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if("Polygon"===o.getType()&&this.mode_!==$r)this.createOrUpdateCustomSketchLine_(o);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,i,n=this.sketchFeature_.getGeometry(),o=this.getMap().getView().getProjection(),r=this.mode_;r===qr||r===Jr?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,n,o)):r===$r&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,n,o)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),n=this.mode_;if(n===qr||n===Jr){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var o=this.finishCoordinate_.slice();t[t.length-1]=o,this.createOrUpdateSketchPoint_(o)}this.geometryFunction_(t,e,i),"Polygon"===e.getType()&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(n===$r){(t=this.sketchCoords_[0]).splice(-2,1);var r=this.sketchLine_.getGeometry();if(t.length>=2){o=t[t.length-2].slice();t[t.length-1]=o,this.createOrUpdateSketchPoint_(o)}r.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry(),n=this.getMap().getView().getProjection();this.mode_===qr?(e.pop(),this.geometryFunction_(e,i,n)):this.mode_===$r&&(e[0].pop(),this.geometryFunction_(e,i,n),e=i.getCoordinates()),"MultiPoint"===this.type_?t.setGeometry(new Xr.Z([e])):"MultiLineString"===this.type_?t.setGeometry(new Vr.Z([e])):"MultiPolygon"===this.type_&&t.setGeometry(new Yr.Z([e])),this.dispatchEvent(new is(ts,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new is(es,t))},e.prototype.appendCoordinates=function(t){var e,i=this.mode_,n=!this.sketchFeature_;if(n&&this.startDrawing_(t[0]),i===qr||i===Jr)e=this.sketchCoords_;else{if(i!==$r)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}n&&e.shift(),e.pop();for(var o=0;o<t.length;o++)this.addToDrawing_(t[o]);var r=t[t.length-1];this.addToDrawing_(r),this.modifyDrawing_(r)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new di.Z(new ni.Z(i)),this.updateSketchFeatures_(),this.dispatchEvent(new is(Qr,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(_i);var rs=i(32911),ss=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=Mi(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new xn({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:$n,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getJustify=function(){return this.justify_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Mi(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setJustify=function(t){this.justify_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}();const as=ss;function ls(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class hs extends dr{constructor(){super({source:new Sr}),ls(this,"opts",{action:"length",unit:"m"}),ls(this,"segmentStyle",new Rn({text:new as({font:"12px Calibri,sans-serif",fill:new xn({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new xn({color:"rgba(0, 0, 0, 0.4)"}),padding:[2,2,2,2],textBaseline:"bottom",offsetY:-12}),image:new _n({radius:6,points:3,angle:Math.PI,displacement:[0,8],fill:new xn({color:"rgba(0, 0, 0, 0.4)"})})})),ls(this,"segmentStyles",[this.segmentStyle]),ls(this,"shapeStyle",[new Rn({fill:new xn({color:"rgba(255, 255, 255, 0.2)"}),image:new mn({radius:5,stroke:new wn({color:"rgba(0, 0, 0, 0.7)"}),fill:new xn({color:"rgba(255, 255, 255, 0.2)"})})}),new Rn({stroke:new wn({color:[0,0,0,1],width:2,lineDash:[4,8],lineDashOffset:6})}),new Rn({stroke:new wn({color:[255,255,255,1],width:2,lineDash:[4,8]})})]),ls(this,"labelStyle",new Rn({text:new as({font:"14px Calibri,sans-serif",fill:new xn({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new xn({color:"rgba(0, 0, 0, 0.7)"}),padding:[3,3,3,3],textBaseline:"bottom",offsetY:-15}),image:new _n({radius:8,points:3,angle:Math.PI,displacement:[0,10],fill:new xn({color:"rgba(0, 0, 0, 0.7)"})})})),ls(this,"tipStyle",new Rn({text:new as({font:"12px Calibri,sans-serif",fill:new xn({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new xn({color:"rgba(0, 0, 0, 0.4)"}),padding:[2,2,2,2],textAlign:"left",offsetX:15})})),ls(this,"modifyStyle",new Rn({image:new mn({radius:5,stroke:new wn({color:"rgba(0, 0, 0, 0.7)"}),fill:new xn({color:"rgba(0, 0, 0, 0.4)"})}),text:new as({text:"Drag to modify",font:"12px Calibri,sans-serif",fill:new xn({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new xn({color:"rgba(0, 0, 0, 0.7)"}),padding:[2,2,2,2],textAlign:"left",offsetX:15})})),ls(this,"modify",new kr({source:this.getSource(),style:this.modifyStyle})),ls(this,"tipPoint",void 0),ls(this,"draw",void 0),this.setStyle((t=>this.styleFunction(t,!1))),this.setVisible(!0)}setOptions(t){var e;this.opts=t,null===(e=this.getSource())||void 0===e||e.refresh()}getMapMeasurement(t){let e=0,i=ei[0];return"area"===this.opts.action?(i=ei[1],e=(0,rs.bg)(t)):e=(0,rs.xA)(t),(0,ti.zc)(i.getUnit(this.opts.unit).format(e))}styleFunction(t,e,i,n){const o=[...this.shapeStyle],r=t.getGeometry();if(r){const t=r.getType();let s,a,l;if(!i||i===t)if("Polygon"===t){const t=r;s=t.getInteriorPoint(),a=this.getMapMeasurement(r),l=new ii.Z(t.getCoordinates()[0])}else"LineString"===t&&(l=r,s=new ni.Z(l.getLastCoordinate()),a=this.getMapMeasurement(r));if(e&&l){let t=0;l.forEachSegment(((e,i)=>{const n=new ii.Z([e,i]),r=this.getMapMeasurement(n);this.segmentStyles.length-1<t&&this.segmentStyles.push(this.segmentStyle.clone());const s=new ni.Z(n.getCoordinateAt(.5));this.segmentStyles[t].setGeometry(s),this.segmentStyles[t].getText().setText(r),o.push(this.segmentStyles[t]),t++}))}a&&(this.labelStyle.setGeometry(s),this.labelStyle.getText().setText(a),o.push(this.labelStyle)),n&&"Point"===t&&!this.modify.getOverlay().getSource().getFeatures().length&&(this.tipPoint=r,this.tipStyle.getText().setText(n),o.push(this.tipStyle))}return o}addInteraction(t,e,i,n){const o=e,r=" Click to continue "+("Polygon"===o?"polygon":"line")+" \n (double-click to end) ",s=" Click to start ";let a=s;this.draw=new os({source:this.getSource(),type:o,style:t=>this.styleFunction(t,i,o,a)}),this.draw.on("drawstart",(()=>{n&&this.getSource().clear(),this.modify.setActive(!1),a=r})),this.draw.on("drawend",(()=>{this.modifyStyle.setGeometry(this.tipPoint),this.modify.setActive(!0),t.once("pointermove",(()=>{this.modifyStyle.setGeometry("")})),a=s})),this.modify.setActive(!0),t.addInteraction(this.draw)}}const us=t=>{let{map:e,menuActiveState:i}=t;const o=(0,n.useRef)(new hs),r=cs(Xe.vc.theme2),[s,a]=(0,n.useState)(!0),[l,h]=(0,n.useState)(!1),[u,c]=(0,n.useState)({action:ei[0].value,unit:ei[0].units[0].value}),p=(0,n.useMemo)((()=>{var t;const e=null!==(t=ei.find((t=>t.value===u.action)))&&void 0!==t?t:ei[0],i=e.getUnit(u.unit);return o.current.setOptions(u),{current:i,options:e.units}}),[u]);function d(){if(h(!l),i(!l),l)e.removeInteraction(o.current.draw),o.current.setVisible(!1);else{var t;s&&(a(!1),o.current.setZIndex(1),e.addLayer(o.current),e.addInteraction(o.current.modify)),o.current.setVisible(!0),e.removeInteraction(o.current.draw);const i=null!==(t=ei.find((t=>t.value===u.action)))&&void 0!==t?t:ei[0];o.current.addInteraction(e,i.geometry,false,true)}}return(0,_e.jsx)("div",{className:`${r.infoWrap} ${l?null:r.infoWrapClosed}`,children:l?(0,_e.jsxs)("div",{children:[(0,_e.jsxs)("div",{className:r.rowGroup,children:[(0,_e.jsx)(qe.S,{value:u.action,options:ei,size:"md",fullWidth:!1,onChange:t=>{var i;e.removeInteraction(o.current.draw);const n=null!==(i=ei.find((e=>e.value===t)))&&void 0!==i?i:ei[0],r=n.getUnit(u.unit);c(Object.assign({},u,{action:n.value,unit:r.value})),o.current.addInteraction(e,n.geometry,false,true)}}),(0,_e.jsx)($e.zx,{className:r.button,icon:"times",variant:"secondary",size:"sm",onClick:d})]}),(0,_e.jsx)(Je.Ph,{className:r.unitSelect,value:p.current,options:p.options,isSearchable:!1,onChange:t=>{var e,i;const n=null!==(e=ei.find((t=>t.value===u.action)))&&void 0!==e?e:ei[0],o=null!==(i=n.getUnit(t.value))&&void 0!==i?i:n.units[0];c(Object.assign({},u,{unit:o.value}))}})]}):(0,_e.jsx)(Qe.h,{className:r.icon,name:"ruler-combined",tooltip:"show measure tools",tooltipPlacement:"left",onClick:d})})},cs=(0,de.B)((t=>({button:a.css`
    margin-left: auto;
  `,icon:a.css`
    background-color: ${t.colors.secondary.main};
    display: inline-block;
    height: 19.25px;
    margin: 1px;
    width: 19.25px;
  `,infoWrap:a.css`
    color: ${t.colors.text};
    background-color: ${t.colors.background.secondary};
    border-radius: 4px;
    padding: 2px;
  `,infoWrapClosed:a.css`
    height: 25.25px;
    width: 25.25px;
  `,rowGroup:a.css`
    display: flex;
    justify-content: flex-end;
  `,unitSelect:a.css`
    min-width: 200px;
  `})));i(48599),i(66502);var ps=i(1191),ds=i(94228);class fs extends n.Component{constructor(t){super(t),function(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(this,"sub",void 0),this.state={subProps:t.initialSubProps}}componentDidMount(){this.sub=this.props.watch.subscribe({next:t=>{this.setState({subProps:t})},complete:()=>{},error:t=>{}})}componentWillUnmount(){this.sub&&this.sub.unsubscribe()}render(){const{subProps:t}=this.state;return(0,_e.jsx)(this.props.child,Object.assign({},t))}}var gs,_s=i(91597),vs=i(98800),ys=i(36996),ms=i(33309),xs=i(91866),ws=i(35743),bs=i(5076);function Cs(t){var e,i,o,r,s,l,h;const{layerName:u,styleConfig:c,layer:p}=t,d=(0,ge.wW)(Ss),f=(0,_s.Z)(null!==(e=null==p||null===(i=p.__state)||void 0===i?void 0:i.mouseEvents)&&void 0!==e?e:(0,vs.of)(void 0)),g=null==c||null===(o=c.dims)||void 0===o||null===(r=o.color)||void 0===r?void 0:r.field,_=(0,n.useMemo)((()=>{if(!g||!f)return;const t=f.getProperties();if(!t.frame)return;const e=t.rowIndex;return g.values.get(e)}),[f,g]);if(!c)return(0,_e.jsx)(_e.Fragment,{});const{color:v,opacity:y}=null!==(s=null==c?void 0:c.base)&&void 0!==s?s:{},m=null==c||null===(l=c.config.symbol)||void 0===l?void 0:l.fixed;if(v&&m&&!g)return(0,_e.jsxs)("div",{className:d.infoWrap,children:[(0,_e.jsx)("div",{className:d.layerName,children:u}),(0,_e.jsx)("div",{className:(0,a.cx)(d.layerBody,d.fixedColorContainer),children:(0,_e.jsx)(ws.V,{src:`public/${m}`,className:d.legendSymbol,title:"Symbol",style:{fill:v,opacity:y}})})]});if(!g)return(0,_e.jsx)(_e.Fragment,{});const x=(0,ys.fD)(g);if(x.isContinuous&&x.getColors){const t=x.getColors(Xe.vc.theme2),e=(0,ms.dz)(g),i=g.display?t=>(0,ti.zc)(g.display(t)):t=>`${t}`;return(0,_e.jsxs)("div",{className:d.infoWrap,children:[(0,_e.jsx)("div",{className:d.layerName,children:u}),(0,_e.jsx)("div",{className:(0,a.cx)(d.layerBody,d.colorScaleWrapper),children:(0,_e.jsx)(xs.q,{hoverValue:_,colorPalette:t,min:e.min,max:e.max,display:i,useStopsPercentage:!1})})]})}const w=null==g||null===(h=g.config)||void 0===h?void 0:h.thresholds;if(!w||w.steps.length<2)return gs||(gs=(0,_e.jsx)("div",{}));const b=(0,bs.Ur)(g.config,Xe.vc.theme2);return(0,_e.jsxs)("div",{className:d.infoWrap,children:[(0,_e.jsx)("div",{className:d.layerName,children:u}),(0,_e.jsx)("div",{className:(0,a.cx)(d.layerBody,d.legend),children:b.map(((t,e)=>(0,_e.jsxs)("div",{className:d.legendItem,children:[(0,_e.jsx)("i",{style:{background:t.color}}),t.label]},`${e}/${t.label}`)))})]})}const Ss=t=>({infoWrap:a.css`
    display: flex;
    flex-direction: column;
    background: ${t.colors.background.secondary};
    border-radius: 1px;
    padding: ${t.spacing(1)};
    border-bottom: 2px solid ${t.colors.border.strong};
    min-width: 150px;
  `,layerName:a.css`
    font-size: ${t.typography.body.fontSize};
  `,layerBody:a.css`
    padding-left: 10px;
  `,legend:a.css`
    line-height: 18px;
    display: flex;
    flex-direction: column;
    font-size: ${t.typography.bodySmall.fontSize};
    padding: 5px 10px 0;

    i {
      width: 15px;
      height: 15px;
      float: left;
      margin-right: 8px;
      opacity: 0.7;
      border-radius: 50%;
    }
  `,legendItem:a.css`
    white-space: nowrap;
  `,fixedColorContainer:a.css`
    min-width: 80px;
    font-size: ${t.typography.bodySmall.fontSize};
    padding-top: 5px;
  `,legendSymbol:a.css`
    height: 18px;
    width: 18px;
    margin: auto;
  `,colorScaleWrapper:a.css`
    min-width: 200px;
    font-size: ${t.typography.bodySmall.fontSize};
    padding-top: 10px;
  `});var Es=i(46844),Ts=i(71980);let Rs;!function(t){t.Point="point",t.Line="line",t.Polygon="polygon",t.Any="*any*"}(Rs||(Rs={}));let Os,Ps;!function(t){t.Left="left",t.Center="center",t.Right="right"}(Os||(Os={})),function(t){t.Top="top",t.Middle="middle",t.Bottom="bottom"}(Ps||(Ps={}));const Is=Object.freeze({size:{fixed:5,min:2,max:15},color:{fixed:"dark-green"},opacity:.4,symbol:{mode:Ts.Q8.Fixed,fixed:"img/icons/marker/circle.svg"},textConfig:{fontSize:12,textAlign:Os.Center,textBaseline:Ps.Middle,offsetX:0,offsetY:0},rotation:{fixed:0,mode:Ts.eK.Mod,min:-360,max:360}});var Ls,Ms=i(23277),Fs=i(50385),As=i(45550),ks=i(97770),Ds=i(79064),js=i(7053),zs=i(25229),Bs=i(52522),Ns=i(95931),Gs=i(71721),Ws=i(21460),Zs=i(12845);!function(t){t.circle="circle",t.square="square",t.triangle="triangle",t.star="star",t.cross="cross",t.x="x"}(Ls||(Ls={}));const Us="img/icons/marker/circle.svg",Vs="img/icons/marker/square.svg",Xs="img/icons/marker/triangle.svg",Ys="img/icons/marker/star.svg",Ks="img/icons/marker/cross.svg",Hs="img/icons/marker/x-mark.svg";function qs(t){const e=null==t.opacity?.8:t.opacity;if(1===e)return new xn({color:t.color});if(e>0){const i=Ue()(t.color).setAlpha(e).toRgbString();return new xn({color:i})}}function $s(t){const e=null==t.opacity?.8:t.opacity;var i;if(1===e)return new wn({color:t.color,width:null!==(i=t.lineWidth)&&void 0!==i?i:1});if(e>0){var n;const i=Ue()(t.color).setAlpha(e).toRgbString();return new wn({color:i,width:null!==(n=t.lineWidth)&&void 0!==n?n:1})}}const Js=t=>{var e;if(!t.text)return;const i=r.v.theme2.typography.fontFamily,n=Object.assign({},Is.textConfig,t.textConfig);return new as(Object.assign({text:t.text,fill:new xn({color:null!==(e=t.color)&&void 0!==e?e:Is.color.fixed}),font:`normal ${n.fontSize}px ${i}`},n))},Qs=t=>new Rn({text:Js(t)}),ta=t=>{var e,i;const n=new wn({color:t.color,width:null!==(e=t.lineWidth)&&void 0!==e?e:1});return new Rn({image:new mn({stroke:n,fill:qs(t),radius:null!==(i=t.size)&&void 0!==i?i:5}),text:Js(t),stroke:n})},ea=t=>{var e;return new Rn({fill:qs(t),stroke:new wn({color:t.color,width:null!==(e=t.lineWidth)&&void 0!==e?e:1}),text:Js(t)})},ia=t=>new Rn({fill:qs(t),stroke:$s(t),text:Js(t)}),na=t=>{var e;const i=null!==(e=t.size)&&void 0!==e?e:5,n=new wn({color:"#F00",width:1});return[new Rn({image:new _n({stroke:n,points:4,radius:i,angle:Math.PI/4})}),new Rn({image:new _n({stroke:n,points:4,radius:i,radius2:0,angle:0})})]},oa=[{id:Ls.circle,name:"Circle",aliasIds:[Us],make:ta},{id:Ls.square,name:"Square",aliasIds:[Vs],make:t=>{var e,i,n;const o=null!==(e=t.size)&&void 0!==e?e:5,r=null!==(i=t.rotation)&&void 0!==i?i:0;return new Rn({image:new _n({stroke:new wn({color:t.color,width:null!==(n=t.lineWidth)&&void 0!==n?n:1}),fill:qs(t),points:4,radius:o,rotation:r*Math.PI/180+Math.PI/4}),text:Js(t)})}},{id:Ls.triangle,name:"Triangle",aliasIds:[Xs],make:t=>{var e,i,n;const o=null!==(e=t.size)&&void 0!==e?e:5,r=null!==(i=t.rotation)&&void 0!==i?i:0;return new Rn({image:new _n({stroke:new wn({color:t.color,width:null!==(n=t.lineWidth)&&void 0!==n?n:1}),fill:qs(t),points:3,radius:o,rotation:r*Math.PI/180,angle:0}),text:Js(t)})}},{id:Ls.star,name:"Star",aliasIds:[Ys],make:t=>{var e,i,n;const o=null!==(e=t.size)&&void 0!==e?e:5,r=null!==(i=t.rotation)&&void 0!==i?i:0;return new Rn({image:new _n({stroke:new wn({color:t.color,width:null!==(n=t.lineWidth)&&void 0!==n?n:1}),fill:qs(t),points:5,radius:o,radius2:.4*o,angle:0,rotation:r*Math.PI/180}),text:Js(t)})}},{id:Ls.cross,name:"Cross",aliasIds:[Ks],make:t=>{var e,i,n;const o=null!==(e=t.size)&&void 0!==e?e:5,r=null!==(i=t.rotation)&&void 0!==i?i:0;return new Rn({image:new _n({stroke:new wn({color:t.color,width:null!==(n=t.lineWidth)&&void 0!==n?n:1}),points:4,radius:o,radius2:0,angle:0,rotation:r*Math.PI/180}),text:Js(t)})}},{id:Ls.x,name:"X",aliasIds:[Hs],make:t=>{var e,i,n;const o=null!==(e=t.size)&&void 0!==e?e:5,r=null!==(i=t.rotation)&&void 0!==i?i:0;return new Rn({image:new _n({stroke:new wn({color:t.color,width:null!==(n=t.lineWidth)&&void 0!==n?n:1}),points:4,radius:o,radius2:0,rotation:r*Math.PI/180+Math.PI/4}),text:Js(t)})}}];const ra=new Zs.B((()=>oa));async function sa(t,e){if(!t)return e?Qs:ta;let i=ra.getIfExists(t);if(i)return i.make;if(t.endsWith(".svg")){const e=await async function(t,e){return fetch(t,{method:"GET"}).then((t=>t.text())).then((t=>{var i,n;t=Ws.sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0}});const o=(new DOMParser).parseFromString(t,"image/svg+xml").getElementsByTagName("svg")[0];if(!o)return"";const r=null!=e?e:100,s=null!==(i=o.getAttribute("width"))&&void 0!==i?i:r,a=null!==(n=o.getAttribute("height"))&&void 0!==n?n:r;o.setAttribute("fill","#fff"),o.setAttribute("width",`${s}px`),o.setAttribute("height",`${a}px`);const l=(new XMLSerializer).serializeToString(o);return`data:image/svg+xml,${encodeURIComponent(l)}`})).catch((t=>(console.error(t),"")))}((0,Ts.t7)(t));return i={id:t,name:t,aliasIds:[],make:e?t=>{var i,n,o;const r=null!==(i=t.size)&&void 0!==i?i:5,s=null!==(n=t.rotation)&&void 0!==n?n:0;return[new Rn({image:new ir({src:e,color:t.color,opacity:null!==(o=t.opacity)&&void 0!==o?o:1,scale:(5+r)/100,rotation:s*Math.PI/180}),text:null!=t&&t.text?Js(t):void 0}),new Rn({image:new _n({fill:new xn({color:"rgba(0,0,0,0)"}),points:4,radius:t.size,rotation:s*Math.PI/180+Math.PI/4})})]}:na},ra.register(i),i.make}return na}function aa(t){var e,i;const n=null==t?void 0:t.text;return!!n&&(!(n.mode!==Ts.xy.Fixed||null===(e=n.fixed)||void 0===e||!e.length)||!(n.mode!==Ts.xy.Field||null===(i=n.field)||void 0===i||!i.length))}async function la(t){var e,i,n,o,s,a,l,h,u,c,p,d,f,g,_;t||(t=Is);const v=aa(t),y={},m=await sa(null===(e=t.symbol)||void 0===e?void 0:e.fixed,v),x={config:t,hasText:v,fields:y,base:{color:r.v.theme2.visualization.getColorByName(null!==(i=null===(n=t.color)||void 0===n?void 0:n.fixed)&&void 0!==i?i:Is.color.fixed),opacity:null!==(o=t.opacity)&&void 0!==o?o:Is.opacity,lineWidth:null!==(s=t.lineWidth)&&void 0!==s?s:1,size:null!==(a=null===(l=t.size)||void 0===l?void 0:l.fixed)&&void 0!==a?a:Is.size.fixed,rotation:null!==(h=null===(u=t.rotation)||void 0===u?void 0:u.fixed)&&void 0!==h?h:Is.rotation.fixed},maker:m};var w,b,C,S;(null!==(c=t.color)&&void 0!==c&&null!==(p=c.field)&&void 0!==p&&p.length&&(y.color=t.color.field),null!==(d=t.size)&&void 0!==d&&null!==(f=d.field)&&void 0!==f&&f.length&&(y.size=t.size.field),null!==(g=t.rotation)&&void 0!==g&&null!==(_=g.field)&&void 0!==_&&_.length&&(y.rotation=t.rotation.field),v)&&(x.base.text=null===(w=t.text)||void 0===w?void 0:w.fixed,x.base.textConfig=null!==(b=t.textConfig)&&void 0!==b?b:Is.textConfig,null!==(C=t.text)&&void 0!==C&&null!==(S=C.field)&&void 0!==S&&S.length&&(y.text=t.text.field));return Object.keys(y).length||(x.fields=void 0),x}const ha=t=>{var e,i,n,o,r,s,a,l,h,u,c,p,d,f,g,_,v;let{value:y,context:m,onChange:x,item:w}=t;const b=w.settings,C=t=>{x(Object.assign({},y,{symbol:t}))},S=t=>{x(Object.assign({},y,{color:t}))},E=t=>{x(Object.assign({},y,{opacity:t}))},T=t=>{x(Object.assign({},y,{rotation:t}))},R=(0,_s.Z)(null!==(e=null==b?void 0:b.layerInfo)&&void 0!==e?e:(0,vs.of)()),O=(null==R?void 0:R.geometryType)===Rs.Point,P=aa(y);var I,L,M,F,A;return null!=b&&b.simpleFixedValues?(0,_e.jsxs)(_e.Fragment,{children:[O&&(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(Ms.Z,{children:(0,_e.jsx)(Fs._,{label:"Symbol",children:(0,_e.jsx)(Ns.Lv,{value:null!==(I=null==y?void 0:y.symbol)&&void 0!==I?I:Is.symbol,context:m,onChange:C,item:{settings:{resourceType:"icon",folderName:Gs.QS.Marker,placeholderText:P?"Select a symbol":"Select a symbol or add a text label",placeholderValue:Is.symbol.fixed,showSourceRadio:!1}}})})}),(0,_e.jsx)(As.g,{label:"Rotation angle",children:(0,_e.jsx)(Ns.k9,{value:null!==(L=null==y?void 0:y.rotation)&&void 0!==L?L:Is.rotation,context:m,onChange:T,item:{settings:{min:Is.rotation.min,max:Is.rotation.max}}})})]}),(0,_e.jsx)(Ms.Z,{children:(0,_e.jsx)(Fs._,{label:"Color",labelWidth:10,children:(0,_e.jsx)(ks.W,{width:4,children:(0,_e.jsx)(Ds.zH,{color:null!==(M=null==y||null===(F=y.color)||void 0===F?void 0:F.fixed)&&void 0!==M?M:Is.color.fixed,onChange:t=>{S({fixed:t})}})})})}),(0,_e.jsx)(Ms.Z,{children:(0,_e.jsx)(Fs._,{label:"Opacity",labelWidth:10,grow:!0,children:(0,_e.jsx)(Bs.p,{value:null!==(A=null==y?void 0:y.opacity)&&void 0!==A?A:Is.opacity,context:m,onChange:E,item:{settings:{min:0,max:1,step:.1}}})})})]}):(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(As.g,{label:"Size",children:(0,_e.jsx)(Ns.cL,{value:null!==(i=null==y?void 0:y.size)&&void 0!==i?i:Is.size,context:m,onChange:t=>{x(Object.assign({},y,{size:t}))},item:{settings:{min:1,max:100}}})}),(0,_e.jsx)(As.g,{label:"Symbol",children:(0,_e.jsx)(Ns.Lv,{value:null!==(n=null==y?void 0:y.symbol)&&void 0!==n?n:Is.symbol,context:m,onChange:C,item:{settings:{resourceType:"icon",folderName:Gs.QS.Marker,placeholderText:P?"Select a symbol":"Select a symbol or add a text label",placeholderValue:Is.symbol.fixed,showSourceRadio:!1}}})}),(0,_e.jsx)(As.g,{label:"Color",children:(0,_e.jsx)(Ns.Lm,{value:null!==(o=null==y?void 0:y.color)&&void 0!==o?o:Is.color,context:m,onChange:S,item:{}})}),(0,_e.jsx)(As.g,{label:"Fill opacity",children:(0,_e.jsx)(Bs.p,{value:null!==(r=null==y?void 0:y.opacity)&&void 0!==r?r:Is.opacity,context:m,onChange:E,item:{settings:{min:0,max:1,step:.1}}})}),(null==b?void 0:b.displayRotation)&&(0,_e.jsx)(As.g,{label:"Rotation angle",children:(0,_e.jsx)(Ns.k9,{value:null!==(s=null==y?void 0:y.rotation)&&void 0!==s?s:Is.rotation,context:m,onChange:T,item:{settings:{min:Is.rotation.min,max:Is.rotation.max}}})}),(0,_e.jsx)(As.g,{label:"Text label",children:(0,_e.jsx)(Ns.$2,{value:null!==(a=null==y?void 0:y.text)&&void 0!==a?a:Gs.qj,context:m,onChange:t=>{x(Object.assign({},y,{text:t}))},item:{}})}),P&&(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsxs)(js.Lh,{children:[(0,_e.jsx)(As.g,{label:"Font size",children:(0,_e.jsx)(zs.w,{value:null!==(l=null==y||null===(h=y.textConfig)||void 0===h?void 0:h.fontSize)&&void 0!==l?l:Is.textConfig.fontSize,context:m,onChange:t=>{x(Object.assign({},y,{textConfig:Object.assign({},y.textConfig,{fontSize:t})}))},item:{}})}),(0,_e.jsx)(As.g,{label:"X offset",children:(0,_e.jsx)(zs.w,{value:null!==(u=null==y||null===(c=y.textConfig)||void 0===c?void 0:c.offsetX)&&void 0!==u?u:Is.textConfig.offsetX,context:m,onChange:t=>{x(Object.assign({},y,{textConfig:Object.assign({},y.textConfig,{offsetX:t})}))},item:{}})}),(0,_e.jsx)(As.g,{label:"Y offset",children:(0,_e.jsx)(zs.w,{value:null!==(p=null==y||null===(d=y.textConfig)||void 0===d?void 0:d.offsetY)&&void 0!==p?p:Is.textConfig.offsetY,context:m,onChange:t=>{x(Object.assign({},y,{textConfig:Object.assign({},y.textConfig,{offsetY:t})}))},item:{}})})]}),(0,_e.jsx)(As.g,{label:"Align",children:(0,_e.jsx)(qe.S,{value:null!==(f=null==y||null===(g=y.textConfig)||void 0===g?void 0:g.textAlign)&&void 0!==f?f:Is.textConfig.textAlign,onChange:t=>{x(Object.assign({},y,{textConfig:Object.assign({},y.textConfig,{textAlign:t})}))},options:[{value:Os.Left,label:(0,Se.capitalize)(Os.Left)},{value:Os.Center,label:(0,Se.capitalize)(Os.Center)},{value:Os.Right,label:(0,Se.capitalize)(Os.Right)}]})}),(0,_e.jsx)(As.g,{label:"Baseline",children:(0,_e.jsx)(qe.S,{value:null!==(_=null==y||null===(v=y.textConfig)||void 0===v?void 0:v.textBaseline)&&void 0!==_?_:Is.textConfig.textBaseline,onChange:t=>{x(Object.assign({},y,{textConfig:Object.assign({},y.textConfig,{textBaseline:t})}))},options:[{value:Ps.Top,label:(0,Se.capitalize)(Ps.Top)},{value:Ps.Middle,label:(0,Se.capitalize)(Ps.Middle)},{value:Ps.Bottom,label:(0,Se.capitalize)(Ps.Bottom)}]})})]})]})};class ua extends Sr{constructor(t){super({}),this.location=t}update(t){this.clear(!0);const e=(0,ds.g6)(t,this.location);if(e.field){for(let i=0;i<t.length;i++)this.addFeatureInternal(new di.Z({frame:t,rowIndex:i,geometry:e.field.values.get(i)}));this.changed()}else this.changed()}updateLineString(t){this.clear(!0);const e=(0,ds.g6)(t,this.location);if(!e.field)return void this.changed();const i=e.field,n=new ii.Z(i.values.toArray().map((t=>t.getCoordinates())));this.addFeatureInternal(new di.Z({frame:t,rowIndex:0,geometry:n})),this.changed()}}var ca=i(83523),pa=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function da(t,e){Xo.expire()}const fa=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return pa(e,t),e.prototype.dispatchRenderEvent=function(t,e){(0,yt.O3)()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;(0,co.qC)(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),(0,co.nb)(n,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o,r,s,a){var l,h=e.viewState;function u(t,e,i,n){return o.call(r,e,t?i:null,n)}var c=h.projection,p=(0,v.Cf)(t.slice(),c),d=[[0,0]];if(c.canWrapX()&&n){var f=c.getExtent(),g=(0,C.dz)(f);d.push([-g,0],[g,0])}for(var _=e.layerStatesArray,y=_.length,m=[],x=[],w=0;w<d.length;w++)for(var b=y-1;b>=0;--b){var S=_[b],E=S.layer;if(E.hasRenderer()&&Ot(S,h)&&s.call(a,E)){var T=E.getRenderer(),R=E.getSource();if(T&&R){var O=R.getWrapX()?p:t,P=u.bind(null,S.managed);x[0]=O[0]+d[w][0],x[1]=O[1]+d[w][1],l=T.forEachFeatureAtCoordinate(x,e,i,P,m)}if(l)return l}}if(0!==m.length){var I=1/m.length;return m.forEach((function(t,e){return t.distanceSq+=e*I})),m.sort((function(t,e){return t.distanceSq-e.distanceSq})),m.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,n,o){return(0,yt.O3)()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,n,o,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,_.uX,this,o,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){(0,yt.O3)()},e.prototype.scheduleExpireIconCache=function(t){Xo.canExpireCache()&&t.postRenderFunctions.push(da)},e}(ca.Z);var ga=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const _a=function(t){function e(e){var i=t.call(this,e)||this;i.fontChangeListenerKey_=(0,X.oL)(nn,fr.Z.PROPERTYCHANGE,e.redrawText.bind(e)),i.element_=document.createElement("div");var n=i.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",i.element_.className="ol-unselectable ol-layers";var o=e.getViewport();return o.insertBefore(i.element_,o.firstChild||null),i.children_=[],i.renderedVisible_=!0,i}return ga(e,t),e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap();if(i.hasListener(t)){var n=new uo(t,void 0,e);i.dispatchEvent(n)}},e.prototype.disposeInternal=function(){(0,X.bN)(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(Ct,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),i=t.viewState;this.children_.length=0;for(var n=[],o=null,r=0,s=e.length;r<s;++r){var a=e[r];t.layerIndex=r;var l=a.layer,h=l.getSourceState();if(!Ot(a,i)||"ready"!=h&&"undefined"!=h)l.unrender();else{var u=l.render(t,o);u&&(u!==o&&(this.children_.push(u),o=u),"getDeclutter"in l&&n.push(l))}}for(r=n.length-1;r>=0;--r)n[r].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,n=0;;++n){var o=i[n],r=e[n];if(!o&&!r)break;o!==r&&(o?r?t.insertBefore(r,o):(t.removeChild(o),--n):t.appendChild(r))}}(this.element_,this.children_),this.dispatchRenderEvent(St,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,n,o){for(var r=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var l=s[a],h=l.layer;if(h.hasRenderer()&&Ot(l,r)&&o(h)){var u=h.getRenderer().getDataAtPixel(t,e,i);if(u){var c=n(h,u);if(c)return c}}}},e}(fa);var va=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ya=function(t){function e(e,i){var n=t.call(this,e)||this;return n.layer=i,n}return va(e,t),e}(ai.ZP),ma="layers",xa=function(t){function e(e){var i=this,n=e||{},o=(0,m.f0)({},n);delete o.layers;var r=n.layers;return(i=t.call(this,o)||this).on,i.once,i.un,i.layersListenerKeys_=[],i.listenerKeys_={},i.addChangeListener(ma,i.handleLayersChanged_),r?Array.isArray(r)?r=new pi(r.slice(),{unique:!0}):(0,y.h)("function"==typeof r.getArray,43):r=new pi(void 0,{unique:!0}),i.setLayers(r),i}return va(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(X.bN),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push((0,X.oL)(t,ri,this.handleLayersAdd_,this),(0,X.oL)(t,si,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(X.bN);(0,m.ZH)(this.listenerKeys_);for(var i=t.getArray(),n=0,o=i.length;n<o;n++){var r=i[n];this.registerLayerListeners_(r),this.dispatchEvent(new ya("addlayer",r))}this.changed()},e.prototype.registerLayerListeners_=function(t){var i=[(0,X.oL)(t,fr.Z.PROPERTYCHANGE,this.handleLayerChange_,this),(0,X.oL)(t,tt.Z.CHANGE,this.handleLayerChange_,this)];t instanceof e&&i.push((0,X.oL)(t,"addlayer",this.handleLayerGroupAdd_,this),(0,X.oL)(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[(0,yt.sq)(t)]=i},e.prototype.handleLayerGroupAdd_=function(t){this.dispatchEvent(new ya("addlayer",t.layer))},e.prototype.handleLayerGroupRemove_=function(t){this.dispatchEvent(new ya("removelayer",t.layer))},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new ya("addlayer",e)),this.changed()},e.prototype.handleLayersRemove_=function(t){var e=t.element,i=(0,yt.sq)(e);this.listenerKeys_[i].forEach(X.bN),delete this.listenerKeys_[i],this.dispatchEvent(new ya("removelayer",e)),this.changed()},e.prototype.getLayers=function(){return this.get(ma)},e.prototype.setLayers=function(t){var e=this.getLayers();if(e)for(var i=e.getArray(),n=0,o=i.length;n<o;++n)this.dispatchEvent(new ya("removelayer",i[n]));this.set(ma,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],i=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var n=this.getLayerState(),o=n.zIndex;t||void 0!==n.zIndex||(o=0);for(var r=i,s=e.length;r<s;r++){var a=e[r];a.opacity*=n.opacity,a.visible=a.visible&&n.visible,a.maxResolution=Math.min(a.maxResolution,n.maxResolution),a.minResolution=Math.max(a.minResolution,n.minResolution),a.minZoom=Math.max(a.minZoom,n.minZoom),a.maxZoom=Math.min(a.maxZoom,n.maxZoom),void 0!==n.extent&&(void 0!==a.extent?a.extent=(0,C.Ed)(a.extent,n.extent):a.extent=n.extent),void 0===a.zIndex&&(a.zIndex=o)}return e},e.prototype.getSourceState=function(){return"ready"},e}(xt);const wa=xa,ba="pointermove",Ca="pointerdown";var Sa=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ea=function(t){function e(e,i){var n=t.call(this,e)||this;n.map_=e,n.clickTimeoutId_,n.emulateClicks_=!1,n.dragging_=!1,n.dragListenerKeys_=[],n.moveTolerance_=void 0===i?1:i,n.down_=null;var o=n.map_.getViewport();return n.activePointers_=[],n.trackedTouches_={},n.element_=o,n.pointerdownListenerKey_=(0,X.oL)(o,Ca,n.handlePointerDown_,n),n.originalPointerMoveEvent_,n.relayedListenerKey_=(0,X.oL)(o,ba,n.relayMoveEvent_,n),n.boundHandleTouchMove_=n.handleTouchMove_.bind(n),n.element_.addEventListener(tt.Z.TOUCHMOVE,n.boundHandleTouchMove_,!!Y.bM&&{passive:!1}),n}return Sa(e,t),e.prototype.emulateClick_=function(t){var e=new Ur(Ht.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Ur(Ht.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new Ur(Ht.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t,i=e.pointerId;if(e.type==Ht.POINTERUP||e.type==Ht.POINTERCANCEL){for(var n in delete this.trackedTouches_[i],this.trackedTouches_)if(this.trackedTouches_[n].target!==e.target){delete this.trackedTouches_[n];break}}else e.type!=Ht.POINTERDOWN&&e.type!=Ht.POINTERMOVE||(this.trackedTouches_[i]=e);this.activePointers_=(0,m.KX)(this.trackedTouches_)},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new Ur(Ht.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_.length&&(this.dragListenerKeys_.forEach(X.bN),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_.length,this.updateActivePointers_(t);var e=new Ur(Ht.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);for(var i in this.dispatchEvent(e),this.down_={},t){var n=t[i];this.down_[i]="function"==typeof n?_.Zn:n}if(0===this.dragListenerKeys_.length){var o=this.map_.getOwnerDocument();this.dragListenerKeys_.push((0,X.oL)(o,Ht.POINTERMOVE,this.handlePointerMove_,this),(0,X.oL)(o,Ht.POINTERUP,this.handlePointerUp_,this),(0,X.oL)(this.element_,Ht.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==o&&this.dragListenerKeys_.push((0,X.oL)(this.element_.getRootNode(),Ht.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;var e=new Ur(Ht.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}},e.prototype.relayMoveEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new Ur(Ht.POINTERMOVE,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&((0,X.bN)(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(tt.Z.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&((0,X.bN)(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(X.bN),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(Xi.Z),Ta="layergroup",Ra="size",Oa="target",Pa="view";var Ia=1/0;const La=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,(0,m.ZH)(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},t.prototype.enqueue=function(t){(0,y.h)(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=Ia&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,o=e[t],r=i[t],s=t;t<n>>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),h=l<n&&i[l]<i[a]?l:a;e[t]=e[h],i[t]=i[h],t=h}e[t]=o,i[t]=r,this.siftDown_(s,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,n=this.priorities_,o=i[e],r=n[e];e>t;){var s=this.getParentIndex_(e);if(!(n[s]>r))break;i[e]=i[s],n[e]=n[s],e=s}i[e]=o,n[e]=r},t.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,o=this.elements_,r=this.priorities_,s=0,a=o.length;for(e=0;e<a;++e)(i=n(t=o[e]))==Ia?delete this.queuedElements_[this.keyFunction_(t)]:(r[s]=i,o[s++]=t);o.length=s,r.length=s,this.heapify_()},t}(),Ma=0,Fa=1,Aa=2,ka=3,Da=4;var ja=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),za=function(t){function e(e,i){var n=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return n.boundHandleTileChange_=n.handleTileChange.bind(n),n.tileChangeCallback_=i,n.tilesLoading_=0,n.tilesLoadingKeys_={},n}return ja(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(tt.Z.CHANGE,this.boundHandleTileChange_);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(i===Aa||i===ka||i===Da){e.removeEventListener(tt.Z.CHANGE,this.boundHandleTileChange_);var n=e.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,n,o=0;this.tilesLoading_<t&&o<e&&this.getCount()>0;)n=(i=this.dequeue()[0]).getKey(),i.getState()!==Ma||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++o,i.load())},e}(La);const Ba=za;var Na=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Ga(t){t instanceof Pt?t.setMapInternal(null):t instanceof wa&&t.getLayers().forEach(Ga)}function Wa(t,e){if(t instanceof Pt)t.setMapInternal(e);else if(t instanceof wa)for(var i=t.getLayers().getArray(),n=0,o=i.length;n<o;++n)Wa(i[n],e)}var Za=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var n=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,n,o,r={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new wa({layers:t.layers});r[Ta]=s,r[Oa]=t.target,r[Pa]=t.view instanceof N?t.view:new N,void 0!==t.controls&&(Array.isArray(t.controls)?i=new pi(t.controls.slice()):((0,y.h)("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?n=new pi(t.interactions.slice()):((0,y.h)("function"==typeof t.interactions.getArray,48),n=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?o=new pi(t.overlays.slice()):((0,y.h)("function"==typeof t.overlays.getArray,49),o=t.overlays):o=new pi;return{controls:i,interactions:n,keyboardEventTarget:e,overlays:o,values:r}}(e);i.renderComplete_,i.loaded_=!0,i.boundHandleBrowserEvent_=i.handleBrowserEvent.bind(i),i.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,i.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:Y.MP,i.postRenderTimeoutHandle_,i.animationDelayKey_,i.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(i),i.coordinateToPixelTransform_=(0,co.Ue)(),i.pixelToCoordinateTransform_=(0,co.Ue)(),i.frameIndex_=0,i.frameState_=null,i.previousExtent_=null,i.viewPropertyListenerKey_=null,i.viewChangeListenerKey_=null,i.layerGroupPropertyListenerKeys_=null,i.viewport_=document.createElement("div"),i.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),i.viewport_.style.position="relative",i.viewport_.style.overflow="hidden",i.viewport_.style.width="100%",i.viewport_.style.height="100%",i.overlayContainer_=document.createElement("div"),i.overlayContainer_.style.position="absolute",i.overlayContainer_.style.zIndex="0",i.overlayContainer_.style.width="100%",i.overlayContainer_.style.height="100%",i.overlayContainer_.style.pointerEvents="none",i.overlayContainer_.className="ol-overlaycontainer",i.viewport_.appendChild(i.overlayContainer_),i.overlayContainerStopEvent_=document.createElement("div"),i.overlayContainerStopEvent_.style.position="absolute",i.overlayContainerStopEvent_.style.zIndex="0",i.overlayContainerStopEvent_.style.width="100%",i.overlayContainerStopEvent_.style.height="100%",i.overlayContainerStopEvent_.style.pointerEvents="none",i.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",i.viewport_.appendChild(i.overlayContainerStopEvent_),i.mapBrowserEventHandler_=null,i.moveTolerance_=e.moveTolerance,i.keyboardEventTarget_=n.keyboardEventTarget,i.targetChangeHandlerKeys_=null,i.controls=n.controls||new pi,i.interactions=n.interactions||new pi,i.overlays_=n.overlays,i.overlayIdIndex_={},i.renderer_=null,i.postRenderFunctions_=[],i.tileQueue_=new Ba(i.getTilePriority.bind(i),i.handleTileChange_.bind(i)),i.addChangeListener(Ta,i.handleLayerGroupChanged_),i.addChangeListener(Pa,i.handleViewChanged_),i.addChangeListener(Ra,i.handleSizeChanged_),i.addChangeListener(Oa,i.handleTargetChanged_),i.setProperties(n.values);var o=i;return!e.view||e.view instanceof N||e.view.then((function(t){o.setView(new N(t))})),i.controls.addEventListener(ri,function(t){t.element.setMap(this)}.bind(i)),i.controls.addEventListener(si,function(t){t.element.setMap(null)}.bind(i)),i.interactions.addEventListener(ri,function(t){t.element.setMap(this)}.bind(i)),i.interactions.addEventListener(si,function(t){t.element.setMap(null)}.bind(i)),i.overlays_.addEventListener(ri,function(t){this.addOverlayInternal_(t.element)}.bind(i)),i.overlays_.addEventListener(si,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(i)),i.controls.forEach(function(t){t.setMap(this)}.bind(i)),i.interactions.forEach(function(t){t.setMap(this)}.bind(i)),i.overlays_.forEach(i.addOverlayInternal_.bind(i)),i}return Na(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.handleLayerAdd_=function(t){Wa(t.layer,this)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,i){if(this.frameState_&&this.renderer_){var n=this.getCoordinateFromPixelInternal(t),o=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,r=void 0!==i.layerFilter?i.layerFilter:_.uX,s=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,o,s,e,null,r,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),e),i},e.prototype.getAllLayers=function(){var t=[];return function e(i){i.forEach((function(i){i instanceof wa?e(i.getLayers()):t.push(i)}))}(this.getLayers()),t},e.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_&&this.renderer_){var n=i||{},o=void 0!==n.hitTolerance?n.hitTolerance:0,r=n.layerFilter||_.uX;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,o,e,r)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_||!this.renderer_)return!1;var i=this.getCoordinateFromPixelInternal(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:_.uX,o=void 0!==e.hitTolerance?e.hitTolerance:0,r=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,o,r,n,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},e.prototype.getTarget=function(){return this.get(Oa)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return(0,g.lO)(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?(0,co.nn)(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(Ta)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof pi)e.setLayers(t);else{var i=e.getLayers();i.clear(),i.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoadingOrNotReady=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var n=t[e];if(n.visible){var o=n.layer.getRenderer();if(o&&!o.ready)return!0;var r=n.layer.getSource();if(r&&r.loading)return!0}}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=(0,g.Vs)(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?(0,co.nn)(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(Ra)},e.prototype.getView=function(){return this.get(Pa)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,e,i,n){return function(t,e,i,n,o){if(!t||!(i in t.wantedTiles))return Ia;if(!t.wantedTiles[i][e.getKey()])return Ia;var r=t.viewState.center,s=n[0]-r[0],a=n[1]-r[1];return 65536*Math.log(o)+Math.sqrt(s*s+a*a)/o}(this.frameState_,t,e,i,n)},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,n=new Ur(i,this,t);this.handleMapBrowserEvent(n)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,i=e.type;if(i===Ca||i===tt.Z.WHEEL||i===tt.Z.KEYDOWN){var n=this.getOwnerDocument(),o=this.viewport_.getRootNode?this.viewport_.getRootNode():n,r=e.target;if(this.overlayContainerStopEvent_.contains(r)||!(o===n?n.documentElement:o).contains(r))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var s=this.getInteractions().getArray().slice(),a=s.length-1;a>=0;a--){var l=s[a];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,n=i;if(t){var o=t.viewHints;if(o[c]||o[p]){var r=Date.now()-t.time>8;i=r?0:8,n=r?0:2}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,n))}t&&this.renderer_&&!t.animate&&(!0===this.renderComplete_?(this.hasListener(Et)&&this.renderer_.dispatchRenderEvent(Et,t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new Wr(V,this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new Wr(U,this,t))));for(var s=this.postRenderFunctions_,a=0,l=s.length;a<l;++a)s[a](this,t);s.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){if(this.mapBrowserEventHandler_){for(var t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)(0,X.bN)(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(tt.Z.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(tt.Z.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,$(this.viewport_)}var i=this.getTargetElement();if(i){for(var n in i.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new Ea(this,this.moveTolerance_),Ht)this.mapBrowserEventHandler_.addEventListener(Ht[n],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(tt.Z.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(tt.Z.WHEEL,this.boundHandleBrowserEvent_,!!Y.bM&&{passive:!1});var o=this.getOwnerDocument().defaultView,r=this.keyboardEventTarget_?this.keyboardEventTarget_:i;this.targetChangeHandlerKeys_=[(0,X.oL)(r,tt.Z.KEYDOWN,this.handleBrowserEvent,this),(0,X.oL)(r,tt.Z.KEYPRESS,this.handleBrowserEvent,this),(0,X.oL)(o,tt.Z.RESIZE,this.updateSize,this)]}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&((0,X.bN)(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&((0,X.bN)(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=(0,X.oL)(t,fr.Z.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=(0,X.oL)(t,tt.Z.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(X.bN),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.handleLayerAdd_(new ya("addlayer",t)),this.layerGroupPropertyListenerKeys_=[(0,X.oL)(t,fr.Z.PROPERTYCHANGE,this.render,this),(0,X.oL)(t,tt.Z.CHANGE,this.render,this),(0,X.oL)(t,"addlayer",this.handleLayerAdd_,this),(0,X.oL)(t,"removelayer",this.handleLayerRemove_,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var n=t[e].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.handleLayerRemove_=function(t){Ga(t.layer)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,i=this.getSize(),n=this.getView(),o=this.frameState_,r=null;if(void 0!==i&&Li(i)&&n&&n.isDef()){var s=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:(0,C.p8)(a.center,a.resolution,a.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:s,wantedTiles:{},mapId:(0,yt.sq)(this),renderTargets:{}},a.nextCenter&&a.nextResolution){var l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;r.nextExtent=(0,C.p8)(a.nextCenter,a.nextResolution,l,i)}}if(this.frameState_=r,this.renderer_.renderFrame(r),r){if(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),o)(!this.previousExtent_||!(0,C.xb)(this.previousExtent_)&&!(0,C.fS)(r.extent,this.previousExtent_))&&(this.dispatchEvent(new Wr(W,this,o)),this.previousExtent_=(0,C.YN)(this.previousExtent_));this.previousExtent_&&!r.viewHints[c]&&!r.viewHints[p]&&!(0,C.fS)(r.extent,this.previousExtent_)&&(this.dispatchEvent(new Wr(Z,this,r)),(0,C.d9)(r.extent,this.previousExtent_))}this.dispatchEvent(new Wr(G,this,r)),this.renderComplete_=this.hasListener(U)||this.hasListener(V)||this.hasListener(Et)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){var e=this.getLayerGroup();e&&this.handleLayerRemove_(new ya("removelayer",e)),this.set(Ta,t)},e.prototype.setSize=function(t){this.set(Ra,t)},e.prototype.setTarget=function(t){this.set(Oa,t)},e.prototype.setView=function(t){if(!t||t instanceof N)this.set(Pa,t);else{this.set(Pa,new N);var e=this;t.then((function(t){e.setView(new N(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var i=getComputedStyle(t),n=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),o=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(n)||isNaN(o)||!Li(e=[n,o])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0.")}this.setSize(e),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(h.Z);const Ua=Za;var Va=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Xa=function(t){function e(e){var i=this,n=e||{};i=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this;var o=void 0!==n.className?n.className:"ol-rotate",r=void 0!==n.label?n.label:"⇧",s=void 0!==n.compassClassName?n.compassClassName:"ol-compass";i.label_=null,"string"==typeof r?(i.label_=document.createElement("span"),i.label_.className=s,i.label_.textContent=r):(i.label_=r,i.label_.classList.add(s));var a=n.tipLabel?n.tipLabel:"Reset rotation",l=document.createElement("button");l.className=o+"-reset",l.setAttribute("type","button"),l.title=a,l.appendChild(i.label_),l.addEventListener(tt.Z.CLICK,i.handleClick_.bind(i),!1);var h=o+" "+"ol-unselectable "+nt,u=i.element;return u.className=h,u.appendChild(l),i.callResetNorth_=n.resetNorth?n.resetNorth:void 0,i.duration_=void 0!==n.duration?n.duration:250,i.autoHide_=void 0===n.autoHide||n.autoHide,i.rotation_=void 0,i.autoHide_&&i.element.classList.add(et),i}return Va(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:L}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var n="rotate("+i+"rad)";if(this.autoHide_){var o=this.element.classList.contains(et);o||0!==i?o&&0!==i&&this.element.classList.remove(et):this.element.classList.add(et)}this.label_.style.transform=n}this.rotation_=i}},e}(Q);var Ya=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ka=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:250,i}return Ya(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Ht.DBLCLICK){var i=t.originalEvent,n=t.map,o=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;Yt(n.getView(),r,o,this.duration_),i.preventDefault(),e=!0}return!e},e}(Kt);var Ha=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const qa=function(t){function e(e){var i=t.call(this,{stopDown:_.Dv})||this,n=e||{};i.kinetic_=n.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var o=n.condition?n.condition:qt(ee,re);return i.condition_=n.onFocusOnly?qt(Jt,o):o,i.noKinetic_=!1,i}return Ha(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,i=gi(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){var n=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]],o=t.map.getView();(0,v.bA)(n,o.getResolution()),(0,v.U1)(n,o.getRotation()),o.adjustCenterInternal(n)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),o=this.kinetic_.getAngle(),r=i.getCenterInternal(),s=e.getPixelFromCoordinateInternal(r),a=e.getCoordinateFromPixelInternal([s[0]-n*Math.cos(o),s[1]-n*Math.sin(o)]);i.animateInternal({center:i.getConstrainedCenter(a),duration:500,easing:L})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(_i);var $a=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ja=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,{stopDown:_.Dv})||this).condition_=n.condition?n.condition:$t,i.lastAngle_=void 0,i.duration_=void 0!==n.duration?n.duration:250,i}return $a(e,t),e.prototype.handleDragEvent=function(t){if(oe(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==O){var n=e.getSize(),o=t.pixel,r=Math.atan2(n[1]/2-o[1],o[0]-n[0]/2);if(void 0!==this.lastAngle_){var s=r-this.lastAngle_;i.adjustRotationInternal(-s)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!oe(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!oe(t)&&(!(!te(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(_i);var Qa=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const tl=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return Qa(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new k.ZP([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(ca.Z);var el=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),il="boxstart",nl="boxdrag",rl="boxend",sl="boxcancel",al=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.coordinate=i,o.mapBrowserEvent=n,o}return el(e,t),e}(ai.ZP);const ll=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var n=e||{};return i.box_=new tl(n.className||"ol-dragbox"),i.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(i.onBoxEnd=n.onBoxEnd),i.startPixel_=null,i.condition_=n.condition?n.condition:te,i.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:i.defaultBoxEndCondition,i}return el(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var n=i[0]-e[0],o=i[1]-e[1];return n*n+o*o>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new al(nl,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new al(e?rl:sl,t.coordinate,t)),!1},e.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 al(il,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(_i);var hl=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ul=function(t){function e(e){var i=this,n=e||{},o=n.condition?n.condition:ie;return(i=t.call(this,{condition:o,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,i.out_=void 0!==n.out&&n.out,i}return hl(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),i=this.getGeometry();if(this.out_){var n=e.rotatedExtentForGeometry(i),o=e.getResolutionForExtentInternal(n),r=e.getResolution()/o;(i=i.clone()).scale(r*r)}e.fitInternal(i,{duration:this.duration_,easing:L})},e}(ll),cl=37,pl=38,dl=39,fl=40;var gl=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const _l=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.defaultCondition_=function(t){return ee(t)&&ne(t)},i.condition_=void 0!==n.condition?n.condition:i.defaultCondition_,i.duration_=void 0!==n.duration?n.duration:100,i.pixelDelta_=void 0!==n.pixelDelta?n.pixelDelta:128,i}return gl(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==tt.Z.KEYDOWN){var i=t.originalEvent,n=i.keyCode;if(this.condition_(t)&&(n==fl||n==cl||n==dl||n==pl)){var o=t.map.getView(),r=o.getResolution()*this.pixelDelta_,s=0,a=0;n==fl?a=-r:n==cl?s=-r:n==dl?s=r:a=r;var l=[s,a];(0,v.U1)(l,o.getRotation()),function(t,e,i){var n=t.getCenterInternal();if(n){var o=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:F,center:t.getConstrainedCenter(o)})}}(o,l,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Kt);var vl=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const yl=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.condition_=n.condition?n.condition:ne,i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:100,i}return vl(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==tt.Z.KEYDOWN||t.type==tt.Z.KEYPRESS){var i=t.originalEvent,n=i.charCode;if(this.condition_(t)&&(n=="+".charCodeAt(0)||n=="-".charCodeAt(0))){var o=t.map,r=n=="+".charCodeAt(0)?this.delta_:-this.delta_;Yt(o.getView(),r,void 0,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Kt);const ml=function(){function t(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var i=e-3;i>0&&this.points_[i+2]>t;)i-=3;var n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;var o=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,o),this.initialVelocity_=Math.sqrt(o*o+r*r)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}();var xl=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const wl=function(t){function e(e){var i=this,n=e||{},o=n;return o.stopDown||(o.stopDown=_.Dv),(i=t.call(this,o)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==n.threshold?n.threshold:.3,i.duration_=void 0!==n.duration?n.duration:250,i}return xl(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],n=this.targetPointers[1],o=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){var r=o-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=o;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==O){var l=s.getViewport().getBoundingClientRect(),h=gi(this.targetPointers);h[0]-=l.left,h[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(h),this.rotating_&&(s.render(),a.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(_i);var bl=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Cl=function(t){function e(e){var i=this,n=e||{},o=n;return o.stopDown||(o.stopDown=_.Dv),(i=t.call(this,o)||this).anchor_=null,i.duration_=void 0!==n.duration?n.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return bl(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],n=this.targetPointers[1],o=i.clientX-n.clientX,r=i.clientY-n.clientY,s=Math.sqrt(o*o+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var h=a.getViewport().getBoundingClientRect(),u=gi(this.targetPointers);u[0]-=h.left,u[1]-=h.top,this.anchor_=a.getCoordinateFromPixelInternal(u),a.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(_i);function Sl(t){var e=t||{},i=new pi,n=new ml(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new Ja),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Ka({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new qa({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new wl),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Cl({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new _l),i.push(new yl({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new he({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new ul({duration:e.zoomDuration})),i}var El=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Tl=function(t){function e(e){return(e=(0,m.f0)({},e)).controls||(e.controls=function(t){var e=t||{},i=new pi;return(void 0===e.zoom||e.zoom)&&i.push(new Ut(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new Xa(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new Lt(e.attributionOptions)),i}()),e.interactions||(e.interactions=Sl({onFocusOnly:!0})),t.call(this,e)||this}return El(e,t),e.prototype.createRenderer=function(){return new _a(this)},e}(Ua);var Rl=i(52424);function Ol(t,e,i,n){const o={};var r,s,a;if(n&&Object.keys(n).length)o.color=(0,Ts.PX)(t,null!==(r=n.color)&&void 0!==r?r:Is.color,i),o.size=(0,Ts.W8)(t,null!==(s=n.size)&&void 0!==s?s:Is.size),o.rotation=(0,Ts.yq)(t,null!==(a=n.rotation)&&void 0!==a?a:Is.rotation),n.text&&(n.text.field||n.text.fixed)&&(o.text=(0,Ts.Bw)(t,n.text));else if(e.fields){var l,h,u;if(e.fields.color)o.color=(0,Ts.PX)(t,null!==(l=e.config.color)&&void 0!==l?l:Is.color,i);if(e.fields.size)o.size=(0,Ts.W8)(t,null!==(h=e.config.size)&&void 0!==h?h:Is.size);if(e.fields.text&&(o.text=(0,Ts.Bw)(t,e.config.text)),e.fields.rotation)o.rotation=(0,Ts.yq)(t,null!==(u=e.config.rotation)&&void 0!==u?u:Is.rotation)}return o}let Pl;function Il(){return Pl||(Pl=[],async function(){const t=await(0,Rl.e)();for(let e of["maps","gazetteer"])t.listFiles(e).subscribe({next:t=>{t.forEach((t=>{if(t.name.endsWith(".geojson")){const i=`public/${e}/${t.name}`;Pl.push({value:i,label:i})}}))}})}()),Pl}const Ll=(t,e,i)=>{t.panelContext&&t.panelContext.onInstanceStateChange&&t.panelContext.onInstanceStateChange({map:t.map,layers:e,selected:i,actions:t.actions})},Ml=t=>{let e=t.layers.length;for(;e<100;){const i="Layer "+e++;if(!t.byName.has(i))return i}return`Layer ${Date.now()}`},Fl={style:Is,showLegend:!0},Al="markers",kl={type:Al,name:"",config:Fl,location:{mode:ps.q.Auto},tooltip:!0},Dl={id:Al,name:"Markers",description:"Use markers to render each data point",isBaseMap:!1,showLocation:!0,hideOpacity:!0,create:async(t,e,i,n)=>{const o=Object.assign({},Fl,null==e?void 0:e.config),r=await la(o.style),s=await(0,ds.cJ)(e.location),a=new ua(s),l=new dr({source:a}),h=new Es.t(1);let u=null;return o.showLegend&&(u=(0,_e.jsx)(fs,{watch:h,initialSubProps:{},child:Cs})),r.fields?l.setStyle((t=>{const e=t.get("rowIndex"),i=r.dims;if(!i||!(0,Se.isNumber)(e))return r.maker(r.base);const n=Object.assign({},r.base);return i.color&&(n.color=i.color.get(e)),i.size&&(n.size=i.size.get(e)),i.text&&(n.text=i.text.get(e)),i.rotation&&(n.rotation=i.rotation.get(e)),r.maker(n)})):l.setStyle(r.maker(r.base)),{init:()=>l,legend:u,update:t=>{var i;if(null!==(i=t.series)&&void 0!==i&&i.length)for(const i of t.series){var o;if(r.dims=Ol(i,r,n),u)h.next({styleConfig:r,size:null===(o=r.dims)||void 0===o?void 0:o.size,layerName:e.name,layer:l});a.update(i);break}else a.clear()},registerOptionsUI:t=>{t.addCustomEditor({id:"config.style",path:"config.style",name:"Styles",editor:ha,settings:{displayRotation:!0},defaultValue:Fl.style}).addBooleanSwitch({path:"config.showLegend",name:"Show legend",description:"Show map legend",defaultValue:Fl.showLegend})}}},defaultOptions:Fl};var jl=i(37729);const zl="preload",Bl="useInterimTilesOnError";var Nl=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Gl=function(t){function e(e){var i=this,n=e||{},o=(0,m.f0)({},n);return delete o.preload,delete o.useInterimTilesOnError,(i=t.call(this,o)||this).on,i.once,i.un,i.setPreload(void 0!==n.preload?n.preload:0),i.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),i}return Nl(e,t),e.prototype.getPreload=function(){return this.get(zl)},e.prototype.setPreload=function(t){this.set(zl,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Bl)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Bl,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(Pt);var Wl=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Zl=function(t){function e(e,i,n){var o=t.call(this)||this,r=n||{};return o.tileCoord=e,o.state=i,o.interimTile=null,o.key="",o.transition_=void 0===r.transition?250:r.transition,o.transitionStarts_={},o.interpolate=!!r.interpolate,o}return Wl(e,t),e.prototype.changed=function(){this.dispatchEvent(tt.Z.CHANGE)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==Aa)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==Aa){t.interimTile=null;break}t.getState()==Fa?e=t:t.getState()==Ma?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==ka&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){(0,yt.O3)()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var n=e-i+1e3/60;return n>=this.transition_?1:I(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(Xi.Z);const Ul=Zl;var Vl=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Xl=function(t){function e(e,i,n,o,r,s){var a=t.call(this,e,i,s)||this;return a.crossOrigin_=o,a.src_=n,a.key=n,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.tileLoadFunction_=r,a}return Vl(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=Aa,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=ka,this.unlistenImage_(),this.image_=((t=K(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=Aa:this.state=Da,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==ka&&(this.state=Ma,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Ma&&(this.state=Fa,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=qo(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Ul);const Yl=function(){function t(t,e,i,n,o,r){this.sourceProj_=t,this.targetProj_=e;var s={},a=(0,g.Ck)(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&(0,C.dz)(n)==(0,C.dz)(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?(0,C.dz)(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?(0,C.dz)(this.targetProj_.getExtent()):null;var l=(0,C.rL)(i),h=(0,C.Xv)(i),u=(0,C.w$)(i),c=(0,C.hC)(i),p=this.transformInv_(l),d=this.transformInv_(h),f=this.transformInv_(u),_=this.transformInv_(c),v=10+(r?Math.max(0,Math.ceil((0,x.k3)((0,C.bg)(i)/(r*r*256*256)))):0);if(this.addQuad_(l,h,u,c,p,d,f,_,v),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach((function(t,e,i){y=Math.min(y,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-y>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-y>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-y>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-y>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}s={}}return t.prototype.addTriangle_=function(t,e,i,n,o,r){this.triangles_.push({source:[n,o,r],target:[t,e,i]})},t.prototype.addQuad_=function(t,e,i,n,o,r,s,a,l){var h=(0,C.hI)([o,r,s,a]),u=this.sourceWorldWidth_?(0,C.dz)(h)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&u>.5&&u<1,d=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var f=(0,C.hI)([t,e,i,n]);d=(0,C.dz)(f)/this.targetWorldWidth_>.25||d}!p&&this.sourceProj_.isGlobal()&&u&&(d=u>.25||d)}if(!(!d&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||(0,C.kK)(h,this.maxSourceExtent_)){var g=0;if(!(d||isFinite(o[0])&&isFinite(o[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)d=!0;else if(1!=(g=(isFinite(o[0])&&isFinite(o[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=g&&4!=g&&8!=g)return;if(l>0){if(!d){var _=[(t[0]+i[0])/2,(t[1]+i[1])/2],v=this.transformInv_(_),y=void 0;if(p)y=((0,x.$W)(o[0],c)+(0,x.$W)(s[0],c))/2-(0,x.$W)(v[0],c);else y=(o[0]+s[0])/2-v[0];var m=(o[1]+s[1])/2-v[1];d=y*y+m*m>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var w=[(e[0]+i[0])/2,(e[1]+i[1])/2],b=this.transformInv_(w),S=[(n[0]+t[0])/2,(n[1]+t[1])/2],E=this.transformInv_(S);this.addQuad_(t,e,w,S,o,r,b,E,l-1),this.addQuad_(S,w,i,n,E,b,s,a,l-1)}else{var T=[(t[0]+e[0])/2,(t[1]+e[1])/2],R=this.transformInv_(T),O=[(i[0]+n[0])/2,(i[1]+n[1])/2],P=this.transformInv_(O);this.addQuad_(t,T,O,n,o,R,P,a,l-1),this.addQuad_(T,e,i,O,R,r,s,P,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&g)&&this.addTriangle_(t,i,n,o,s,a),0==(14&g)&&this.addTriangle_(t,i,e,o,s,r),g&&(0==(13&g)&&this.addTriangle_(e,n,t,r,a,o),0==(7&g)&&this.addTriangle_(e,n,i,r,a,s))}},t.prototype.calculateSourceExtent=function(){var t=(0,C.lJ)();return this.triangles_.forEach((function(e,i,n){var o=e.source;(0,C.Wj)(t,o[0]),(0,C.Wj)(t,o[1]),(0,C.Wj)(t,o[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();var Kl,Hl={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},ql={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},$l=[];function Jl(t,e,i,n,o){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,o),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,o)),t.restore()}function Ql(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function th(t,e,i,n){var o=(0,g.vs)(i,e,t),r=(0,g._Q)(e,n,i),s=e.getMetersPerUnit();void 0!==s&&(r*=s);var a=t.getMetersPerUnit();void 0!==a&&(r/=a);var l=t.getExtent();if(!l||(0,C.b8)(l,o)){var h=(0,g._Q)(t,r,o)/r;isFinite(h)&&h>0&&(r/=h)}return r}function eh(t,e,i,n,o,r,s,a,l,h,u,c){var p=K(Math.round(i*t),Math.round(i*e),$l);if(c||(0,m.f0)(p,Hl),0===l.length)return p.canvas;function d(t){return Math.round(t*i)/i}p.scale(i,i),p.globalCompositeOperation="lighter";var f=(0,C.lJ)();l.forEach((function(t,e,i){(0,C.l7)(f,t.extent)}));var g=(0,C.dz)(f),_=(0,C.Cr)(f),v=K(Math.round(i*g/n),Math.round(i*_/n));c||(0,m.f0)(v,Hl);var y=i/n;l.forEach((function(t,e,i){var n=t.extent[0]-f[0],o=-(t.extent[3]-f[3]),r=(0,C.dz)(t.extent),s=(0,C.Cr)(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,n*y,o*y,r*y,s*y)}));var w=(0,C.rL)(s);return a.getTriangles().forEach((function(t,e,o){var s=t.source,a=t.target,l=s[0][0],h=s[0][1],u=s[1][0],g=s[1][1],_=s[2][0],y=s[2][1],m=d((a[0][0]-w[0])/r),b=d(-(a[0][1]-w[1])/r),C=d((a[1][0]-w[0])/r),S=d(-(a[1][1]-w[1])/r),E=d((a[2][0]-w[0])/r),T=d(-(a[2][1]-w[1])/r),R=l,O=h;l=0,h=0;var P=[[u-=R,g-=O,0,0,C-m],[_-=R,y-=O,0,0,E-m],[0,0,u,g,S-b],[0,0,_,y,T-b]],I=(0,x.SV)(P);if(I){if(p.save(),p.beginPath(),function(){if(void 0===Kl){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Jl(t,4,5,4,0),Jl(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;Kl=Ql(e,0)||Ql(e,4)||Ql(e,8)}return Kl}()||!c){p.moveTo(C,S);for(var L=m-C,M=b-S,F=0;F<4;F++)p.lineTo(C+d((F+1)*L/4),S+d(F*M/3)),3!=F&&p.lineTo(C+d((F+1)*L/4),S+d((F+1)*M/3));p.lineTo(E,T)}else p.moveTo(C,S),p.lineTo(m,b),p.lineTo(E,T);p.clip(),p.transform(I[0],I[2],I[1],I[3],m,b),p.translate(f[0]-R,f[3]-O),p.scale(n/i,-n/i),p.drawImage(v.canvas,0,0),p.restore()}})),u&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var n=t.target,o=(n[0][0]-w[0])/r,s=-(n[0][1]-w[1])/r,a=(n[1][0]-w[0])/r,l=-(n[1][1]-w[1])/r,h=(n[2][0]-w[0])/r,u=-(n[2][1]-w[1])/r;p.beginPath(),p.moveTo(a,l),p.lineTo(o,s),p.lineTo(h,u),p.closePath(),p.stroke()})),p.restore()),p.canvas}var ih=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),nh=function(t){function e(e,i,n,o,r,s,a,l,h,u,c,p){var d=t.call(this,r,Ma,{interpolate:!!p})||this;d.renderEdges_=void 0!==c&&c,d.pixelRatio_=a,d.gutter_=l,d.canvas_=null,d.sourceTileGrid_=i,d.targetTileGrid_=o,d.wrappedTileCoord_=s||r,d.sourceTiles_=[],d.sourcesListenerKeys_=null,d.sourceZ_=0;var f=o.getTileCoordExtent(d.wrappedTileCoord_),g=d.targetTileGrid_.getExtent(),_=d.sourceTileGrid_.getExtent(),v=g?(0,C.Ed)(f,g):f;if(0===(0,C.bg)(v))return d.state=Da,d;var y=e.getExtent();y&&(_=_?(0,C.Ed)(_,y):y);var m=o.getResolution(d.wrappedTileCoord_[0]),w=function(t,e,i,n){var o=(0,C.qg)(i),r=th(t,e,o,n);return(!isFinite(r)||r<=0)&&(0,C.H6)(i,(function(i){return r=th(t,e,i,n),isFinite(r)&&r>0})),r}(e,n,v,m);if(!isFinite(w)||w<=0)return d.state=Da,d;var b=void 0!==u?u:.5;if(d.triangulation_=new Yl(e,n,v,_,w*b,m),0===d.triangulation_.getTriangles().length)return d.state=Da,d;d.sourceZ_=i.getZForResolution(w);var S=d.triangulation_.calculateSourceExtent();if(_&&(e.canWrapX()?(S[1]=(0,x.uZ)(S[1],_[1],_[3]),S[3]=(0,x.uZ)(S[3],_[1],_[3])):S=(0,C.Ed)(S,_)),(0,C.bg)(S)){for(var E=i.getTileRangeForExtentAndZ(S,d.sourceZ_),T=E.minX;T<=E.maxX;T++)for(var R=E.minY;R<=E.maxY;R++){var O=h(d.sourceZ_,T,R,a);O&&d.sourceTiles_.push(O)}0===d.sourceTiles_.length&&(d.state=Da)}else d.state=Da;return d}return ih(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&e.getState()==Aa&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=ka;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],o="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=eh(n,o,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),r,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=Aa}this.changed()},e.prototype.load=function(){if(this.state==Ma){this.state=Fa,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var o=e.getState();if(o==Ma||o==Fa){t++;var r=(0,X.oL)(e,tt.Z.CHANGE,(function(i){var n=e.getState();n!=Aa&&n!=ka&&n!=Da||((0,X.bN)(r),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,i){t.getState()==Ma&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(X.bN),this.sourcesListenerKeys_=null},e.prototype.release=function(){this.canvas_&&(H(this.canvas_.getContext("2d")),$l.push(this.canvas_),this.canvas_=null),t.prototype.release.call(this)},e}(Ul);const oh=nh;var rh=function(){function t(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function sh(t,e,i,n,o){return void 0!==o?(o.minX=t,o.maxX=e,o.minY=i,o.maxY=n,o):new rh(t,e,i,n)}const ah=rh;var lh=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),hh=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=(0,C.lJ)(),i.tmpTileRange_=new ah(0,0,0,0),i}return lh(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==Aa||i==Da||i==ka&&!n},e.prototype.getTile=function(t,e,i,n){var o=n.pixelRatio,r=n.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,i,o,r);return a.getState()==ka&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(Aa)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var i=this.getLayer(),n=(0,co.nn)(e.pixelToCoordinateTransform,t.slice()),o=i.getExtent();if(o&&!(0,C.b8)(o,n))return null;for(var r=e.pixelRatio,s=e.viewState.projection,a=e.viewState,l=i.getRenderSource(),h=l.getTileGridForProjection(a.projection),u=l.getTilePixelRatio(e.pixelRatio),c=h.getZForResolution(a.resolution);c>=h.getMinZoom();--c){var p=h.getTileCoordForCoordAndZ(n,c),d=l.getTile(c,p[1],p[2],r,s);if(!(d instanceof Xl||d instanceof oh))return null;if(d.getState()===Aa){var f=h.getOrigin(c),g=Mi(h.getTileSize(c)),_=h.getResolution(c),v=Math.floor(u*((n[0]-f[0])/_-p[1]*g[0])),y=Math.floor(u*((f[1]-n[1])/_-p[2]*g[1])),m=Math.round(u*l.getGutterForProjection(a.projection));return this.getImageData(d.getImage(),v+m,y+m)}}return null},e.prototype.loadedTileCallback=function(e,i,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,i,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],n=t.viewState,o=n.projection,r=n.resolution,s=n.center,a=n.rotation,l=t.pixelRatio,h=this.getLayer(),u=h.getSource(),c=u.getRevision(),p=u.getTileGridForProjection(o),d=p.getZForResolution(r,u.zDirection),f=p.getResolution(d),_=t.extent,v=t.viewState.resolution,y=u.getTilePixelRatio(l),x=Math.round((0,C.dz)(_)/v*l),w=Math.round((0,C.Cr)(_)/v*l),b=i.extent&&(0,g.dY)(i.extent,o);b&&(_=(0,C.Ed)(_,(0,g.dY)(i.extent,o)));var E=f*x/2/y,T=f*w/2/y,R=[s[0]-E,s[1]-T,s[0]+E,s[1]+T],O=p.getTileRangeForExtentAndZ(_,d),P={};P[d]={};var I=this.createLoadedTileFinder(u,o,P),L=this.tmpExtent,M=this.tmpTileRange_;this.newTiles_=!1;for(var F=a?(0,C.dY)(n.center,v,a,t.size):void 0,A=O.minX;A<=O.maxX;++A)for(var k=O.minY;k<=O.maxY;++k)if(!a||p.tileCoordIntersectsViewport([d,A,k],F)){var D=this.getTile(d,A,k,t);if(this.isDrawableTile(D)){var j=(0,yt.sq)(this);if(D.getState()==Aa)P[d][D.tileCoord.toString()]=D,(st=D.inTransition(j))&&1!==i.opacity&&(D.endTransition(j),st=!1),this.newTiles_||!st&&-1!==this.renderedTiles.indexOf(D)||(this.newTiles_=!0);if(1===D.getAlpha(j,t.time))continue}var z=p.getTileCoordChildTileRange(D.tileCoord,M,L),B=!1;z&&(B=I(d+1,z)),B||p.forEachTileCoordParentTileRange(D.tileCoord,I,M,L)}var N=f/r*l/y;(0,co.qC)(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/l,1/l,a,-x/2,-w/2);var G=(0,co.BB)(this.pixelTransform);this.useContainer(e,G,this.getBackground(t));var W=this.context,Z=W.canvas;(0,co.nb)(this.inversePixelTransform,this.pixelTransform),(0,co.qC)(this.tempTransform,x/2,w/2,N,N,0,-x/2,-w/2),Z.width!=x||Z.height!=w?(Z.width=x,Z.height=w):this.containerReused||W.clearRect(0,0,x,w),b&&this.clipUnrotated(W,t,b),u.getInterpolate()||(0,m.f0)(W,Hl),this.preRender(W,t),this.renderedTiles.length=0;var U,V,X,Y=Object.keys(P).map(Number);Y.sort(S.kK),1!==i.opacity||this.containerReused&&!u.getOpaque(t.viewState.projection)?(U=[],V=[]):Y=Y.reverse();for(var K=Y.length-1;K>=0;--K){var H=Y[K],q=u.getTilePixelSize(H,l,o),$=p.getResolution(H)/f,J=q[0]*$*N,Q=q[1]*$*N,tt=p.getTileCoordForCoordAndZ((0,C.rL)(R),H),et=p.getTileCoordExtent(tt),it=(0,co.nn)(this.tempTransform,[y*(et[0]-R[0])/f,y*(R[3]-et[3])/f]),nt=y*u.getGutterForProjection(o),ot=P[H];for(var rt in ot){var st,at=(D=ot[rt]).tileCoord,lt=tt[1]-at[1],ht=Math.round(it[0]-(lt-1)*J),ut=tt[2]-at[2],ct=Math.round(it[1]-(ut-1)*Q),pt=ht-(A=Math.round(it[0]-lt*J)),dt=ct-(k=Math.round(it[1]-ut*Q)),ft=d===H,gt=!1;if(!(st=ft&&1!==D.getAlpha((0,yt.sq)(this),t.time)))if(U){X=[A,k,A+pt,k,A+pt,k+dt,A,k+dt];for(var _t=0,vt=U.length;_t<vt;++_t)if(d!==H&&H<V[_t]){var mt=U[_t];(0,C.kK)([A,k,A+pt,k+dt],[mt[0],mt[3],mt[4],mt[7]])&&(gt||(W.save(),gt=!0),W.beginPath(),W.moveTo(X[0],X[1]),W.lineTo(X[2],X[3]),W.lineTo(X[4],X[5]),W.lineTo(X[6],X[7]),W.moveTo(mt[6],mt[7]),W.lineTo(mt[4],mt[5]),W.lineTo(mt[2],mt[3]),W.lineTo(mt[0],mt[1]),W.clip())}U.push(X),V.push(H)}else W.clearRect(A,k,pt,dt);this.drawTileImage(D,t,A,k,pt,dt,nt,ft),U&&!st?(gt&&W.restore(),this.renderedTiles.unshift(D)):this.renderedTiles.push(D),this.updateUsedTiles(t.usedTiles,u,D)}}return this.renderedRevision=c,this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!(0,C.fS)(this.renderedExtent_,R),this.renderedExtent_=R,this.renderedPixelRatio=l,this.renderedProjection=o,this.manageTilePyramid(t,u,p,l,o,_,d,h.getPreload()),this.scheduleExpireCache(t,u),this.postRender(W,t),i.extent&&W.restore(),(0,m.f0)(W,ql),G!==Z.style.transform&&(Z.style.transform=G),this.container},e.prototype.drawTileImage=function(t,e,i,n,o,r,s,a){var l=this.getTileImage(t);if(l){var h=(0,yt.sq)(this),u=e.layerStatesArray[e.layerIndex],c=u.opacity*(a?t.getAlpha(h,e.time):1),p=c!==this.context.globalAlpha;p&&(this.context.save(),this.context.globalAlpha=c),this.context.drawImage(l,s,s,l.width-2*s,l.height-2*s,i,n,o,r),p&&this.context.restore(),c!==u.opacity?e.animate=!0:a&&t.endTransition(h)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var i=function(t,e,i){var n=(0,yt.sq)(t);n in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[n])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i){var n=(0,yt.sq)(e);n in t||(t[n]={}),t[n][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,i,n,o,r,s,a,l){var h=(0,yt.sq)(e);h in t.wantedTiles||(t.wantedTiles[h]={});var u,c,p,d,f,g,_=t.wantedTiles[h],v=t.tileQueue,y=i.getMinZoom(),m=t.viewState.rotation,x=m?(0,C.dY)(t.viewState.center,t.viewState.resolution,m,t.size):void 0,w=0;for(g=y;g<=s;++g)for(c=i.getTileRangeForExtentAndZ(r,g,c),p=i.getResolution(g),d=c.minX;d<=c.maxX;++d)for(f=c.minY;f<=c.maxY;++f)m&&!i.tileCoordIntersectsViewport([g,d,f],x)||(s-g<=a?(++w,(u=e.getTile(g,d,f,n,o)).getState()==Ma&&(_[u.getKey()]=!0,v.isKeyQueued(u.getKey())||v.enqueue([u,h,i.getTileCoordCenter(u.tileCoord),p])),void 0!==l&&l(u)):e.useTile(g,d,f,o));e.updateCacheSize(w,o)},e}(_o);const uh=hh;var ch=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ph=function(t){function e(e){return t.call(this,e)||this}return ch(e,t),e.prototype.createRenderer=function(){return new uh(this)},e}(Gl);const dh=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var i=this.entries_[t];return(0,y.h)(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return(0,y.h)(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.peek=function(t){if(this.containsKey(t))return this.entries_[t].value_},t.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_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){(0,y.h)(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function fh(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function gh(t,e,i){return t+"/"+e+"/"+i}function _h(t){return gh(t[0],t[1],t[2])}var vh=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),yh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vh(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=function(t){return t.split("/").map(Number)}(this.peekFirstKey()),e=t[0];this.forEach(function(t){t.tileCoord[0]!==e&&(this.remove(_h(t.tileCoord)),t.release())}.bind(this))}},e}(dh);const mh=yh,xh="tileloadstart",wh="tileloadend",bh="tileloaderror";var Ch=i(6302),Sh=[0,0,0],Eh=function(){function t(t){var e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,(0,y.h)((0,S.pT)(this.resolutions_,(function(t,e){return e-t}),!0),17),!t.origins)for(var i=0,n=this.resolutions_.length-1;i<n;++i)if(e){if(this.resolutions_[i]/this.resolutions_[i+1]!==e){e=void 0;break}}else e=this.resolutions_[i]/this.resolutions_[i+1];this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,(0,y.h)(this.origins_.length==this.resolutions_.length,20));var o=t.extent;void 0===o||this.origin_||this.origins_||(this.origin_=(0,C.rL)(o)),(0,y.h)(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,(0,y.h)(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:f,(0,y.h)(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==o?o:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var i=new ah(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(o){var n=this.getTileRangeForExtentAndZ(o,e);i.minX=Math.max(n.minX,i.minX),i.maxX=Math.min(n.maxX,i.maxX),i.minY=Math.max(n.minY,i.minY),i.maxY=Math.min(n.maxY,i.maxY)}return i}),this):o&&this.calculateTileRanges_(o)}return t.prototype.forEachTileCoord=function(t,e,i){for(var n=this.getTileRangeForExtentAndZ(t,e),o=n.minX,r=n.maxX;o<=r;++o)for(var s=n.minY,a=n.maxY;s<=a;++s)i([e,o,s])},t.prototype.forEachTileCoordParentTileRange=function(t,e,i,n){var o,r,s=null,a=t[0]-1;for(2===this.zoomFactor_?(o=t[1],r=t[2]):s=this.getTileCoordExtent(t,n);a>=this.minZoom;){if(e(a,2===this.zoomFactor_?sh(o=Math.floor(o/2),o,r=Math.floor(r/2),r,i):this.getTileRangeForExtentAndZ(s,a,i)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var n=2*t[1],o=2*t[2];return sh(n,n+1,o,o+1,e)}var r=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;var n=t[0],o=t[1],r=t[2];if(e===n)return sh(o,r,o,r,i);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,e-n),a=Math.floor(o*s),l=Math.floor(r*s);return e<n?sh(a,a,l,l,i):sh(a,Math.floor(s*(o+1))-1,l,Math.floor(s*(r+1))-1,i)}var h=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(h,e,i)},t.prototype.getTileRangeExtent=function(t,e,i){var n=this.getOrigin(t),o=this.getResolution(t),r=Mi(this.getTileSize(t),this.tmpSize_),s=n[0]+e.minX*r[0]*o,a=n[0]+(e.maxX+1)*r[0]*o,l=n[1]+e.minY*r[1]*o,h=n[1]+(e.maxY+1)*r[1]*o;return(0,C.T9)(s,l,a,h,i)},t.prototype.getTileRangeForExtentAndZ=function(t,e,i){var n=Sh;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,n);var o=n[1],r=n[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,n),sh(o,n[1],r,n[2],i)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=Mi(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*i,e[1]-(t[2]+.5)*n[1]*i]},t.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),n=this.getResolution(t[0]),o=Mi(this.getTileSize(t[0]),this.tmpSize_),r=i[0]+t[1]*o[0]*n,s=i[1]-(t[2]+1)*o[1]*n,a=r+o[0]*n,l=s+o[1]*n;return(0,C.T9)(r,s,a,l,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,i,n,o){var r=this.getZForResolution(i),s=i/this.getResolution(r),a=this.getOrigin(r),l=Mi(this.getTileSize(r),this.tmpSize_),h=s*(t-a[0])/i/l[0],u=s*(a[1]-e)/i/l[1];return n?(h=(0,x.mD)(h,5)-1,u=(0,x.mD)(u,5)-1):(h=(0,x.GW)(h,5),u=(0,x.GW)(u,5)),fh(r,h,u,o)},t.prototype.getTileCoordForXYAndZ_=function(t,e,i,n,o){var r=this.getOrigin(i),s=this.getResolution(i),a=Mi(this.getTileSize(i),this.tmpSize_),l=(t-r[0])/s/a[0],h=(r[1]-e)/s/a[1];return n?(l=(0,x.mD)(l,5)-1,h=(0,x.mD)(h,5)-1):(l=(0,x.GW)(l,5),h=(0,x.GW)(h,5)),fh(i,l,h,o)},t.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){var i=(0,S.h7)(this.resolutions_,t,e||0);return(0,x.uZ)(i,this.minZoom,this.maxZoom)},t.prototype.tileCoordIntersectsViewport=function(t,e){return(0,Ch.mV)(e,0,e.length,2,this.getTileCoordExtent(t))},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),n=this.minZoom;n<e;++n)i[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=i},t}();const Th=Eh;function Rh(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,i,n){return function(t,e,i,n){var o=void 0!==n?n:"top-left",r=Oh(t,e,i);return new Th({extent:t,origin:(0,C.g0)(t,o),resolutions:r,tileSize:i})}(Ph(t),e,i,n)}(t),t.setDefaultTileGrid(e)),e}function Oh(t,e,i,n){for(var o=void 0!==e?e:42,r=(0,C.Cr)(t),s=(0,C.dz)(t),a=Mi(void 0!==i?i:f),l=n>0?n:Math.max(s/a[0],r/a[1]),h=o+1,u=new Array(h),c=0;c<h;++c)u[c]=l/Math.pow(2,c);return u}function Ph(t){var e=(t=(0,g.U2)(t)).getExtent();if(!e){var i=180*g.Wm[u.ZP.DEGREES]/t.getMetersPerUnit();e=(0,C.T9)(-i,-i,i,i)}return e}var Ih=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Lh=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate})||this;i.on,i.once,i.un,i.opaque_=void 0!==e.opaque&&e.opaque,i.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,i.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;return i.tileGrid&&Mi(i.tileGrid.getTileSize(i.tileGrid.getMinZoom()),[256,256]),i.tileCache=new mh(e.cacheSize||0),i.tmpSize=[0,0],i.key_=e.key||"",i.tileOptions={transition:e.transition,interpolate:e.interpolate},i.zDirection=e.zDirection?e.zDirection:0,i}return Ih(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,i,n){var o=this.getTileCacheForProjection(t);if(!o)return!1;for(var r,s,a,l=!0,h=i.minX;h<=i.maxX;++h)for(var u=i.minY;u<=i.maxY;++u)s=gh(e,h,u),a=!1,o.containsKey(s)&&(a=(r=o.get(s)).getState()===Aa)&&(a=!1!==n(r)),a||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},e.prototype.getTile=function(t,e,i,n,o){return(0,yt.O3)()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Rh(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return(0,y.h)(null===e||(0,g.OP)(e,t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var n,o,r,s=this.getTileGridForProjection(i),a=this.getTilePixelRatio(e),l=Mi(s.getTileSize(t),this.tmpSize);return 1==a?l:(n=l,o=a,void 0===(r=this.tmpSize)&&(r=[0,0]),r[0]=n[0]*o+.5|0,r[1]=n[1]*o+.5|0,r)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),n=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var n=e[0],o=t.getTileCoordCenter(e),r=Ph(i);if((0,C.b8)(r,o))return e;var s=(0,C.dz)(r),a=Math.ceil((r[0]-o[0])/s);return o[0]+=s*a,t.getTileCoordForCoordAndZ(o,n)}(n,t,i)),function(t,e){var i=t[0],n=t[1],o=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var r=e.getFullTileRange(i);return!r||r.containsXY(n,o)}(t,n)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,n){},e}(vr),Mh=function(t){function e(e,i){var n=t.call(this,e)||this;return n.tile=i,n}return Ih(e,t),e}(ai.ZP);const Fh=Lh;function Ah(t,e){var i=/\{z\}/g,n=/\{x\}/g,o=/\{y\}/g,r=/\{-y\}/g;return function(s,a,l){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(o,s[2].toString()).replace(r,(function(){var t=s[0],i=e.getFullTileRange(t);return(0,y.h)(i,55),(i.getHeight()-s[2]-1).toString()})):void 0}}function kh(t,e){for(var i=t.length,n=new Array(i),o=0;o<i;++o)n[o]=Ah(t[o],e);return function(t){if(1===t.length)return t[0];return function(e,i,n){if(e){var o=function(t){return(t[1]<<t[0])+t[2]}(e),r=(0,x.$W)(o,t.length);return t[r](e,i,n)}}}(n)}var Dh=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),jh=function(t){function e(i){var n=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,interpolate:i.interpolate,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(n.tileUrlFunction=i.tileUrlFunction),n.urls=null,i.urls?n.setUrls(i.urls):i.url&&n.setUrl(i.url),n.tileLoadingKeys_={},n}return Dh(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,n=(0,yt.sq)(i),o=i.getState();o==Fa?(this.tileLoadingKeys_[n]=!0,e=xh):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=o==ka?bh:o==Aa?wh:void 0),null!=e&&this.dispatchEvent(new Mh(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var n=i[1].charCodeAt(0),o=i[2].charCodeAt(0),r=void 0;for(r=n;r<=o;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(i[2],10),a=parseInt(i[1],10);a<=s;a++)e.push(t.replace(i[0],a.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(kh(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,i){},e.prototype.useTile=function(t,e,i){var n=gh(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(Fh);const zh=jh;var Bh=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Nh=function(t){function e(e){var i=this,n=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(n=e.interpolate),(i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Gh,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:n,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this).crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,i.tileClass=void 0!==e.tileClass?e.tileClass:Xl,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.renderReprojectionEdges_=!1,i}return Bh(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var o=this.tileCacheForProjection[n];o.expireCache(o==i?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!(0,g.OP)(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var e=t.prototype.getKey.call(this);return this.getInterpolate()||(e+=":disable-interpolation"),e},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!(0,g.OP)(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!(0,g.OP)(e,t)){var i=(0,yt.sq)(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Rh(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||(0,g.OP)(e,t))return this.tileCache;var i=(0,yt.sq)(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new mh(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,n,o,r){var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,o),l=a?this.tileUrlFunction(a,n,o):void 0,h=new this.tileClass(s,void 0!==l?Ma:Da,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=r,h.addEventListener(tt.Z.CHANGE,this.handleTileChange.bind(this)),h},e.prototype.getTile=function(t,e,i,n,o){var r=this.getProjection();if(r&&o&&!(0,g.OP)(r,o)){var s=this.getTileCacheForProjection(o),a=[t,e,i],l=void 0,h=_h(a);s.containsKey(h)&&(l=s.get(h));var u=this.getKey();if(l&&l.key==u)return l;var c=this.getTileGridForProjection(r),p=this.getTileGridForProjection(o),d=this.getTileCoordForTileUrlFunction(a,o),f=new oh(r,c,o,p,a,d,this.getTilePixelRatio(n),this.getGutter(),function(t,e,i,n){return this.getTileInternal(t,e,i,n,r)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return f.key=u,l?(f.interimTile=l,f.refreshInterimChain(),s.replace(h,f)):s.set(h,f),f}return this.getTileInternal(t,e,i,n,r||o)},e.prototype.getTileInternal=function(t,e,i,n,o){var r=null,s=gh(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((r=this.tileCache.get(s)).key!=a){var l=r;r=this.createTile_(t,e,i,n,o,a),l.getState()==Ma?r.interimTile=l.interimTile:r.interimTile=l,r.refreshInterimChain(),this.tileCache.replace(s,r)}}else r=this.createTile_(t,e,i,n,o,a),this.tileCache.set(s,r);return r},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=(0,g.U2)(t);if(i){var n=(0,yt.sq)(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(zh);function Gh(t,e){t.getImage().src=e}const Wh=Nh;var Zh=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Uh=function(t){function e(e){var i=this,n=e||{},o=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(o=n.interpolate);var r=void 0!==n.projection?n.projection:"EPSG:3857",s=void 0!==n.tileGrid?n.tileGrid:function(t){var e=t||{},i=e.extent||(0,g.U2)("EPSG:3857").getExtent(),n={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Oh(i,e.maxZoom,e.tileSize,e.maxResolution)};return new Th(n)}({extent:Ph(r),maxResolution:n.maxResolution,maxZoom:n.maxZoom,minZoom:n.minZoom,tileSize:n.tileSize});return(i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:o,opaque:n.opaque,projection:r,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileGrid:s,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this).gutter_=void 0!==n.gutter?n.gutter:0,i}return Zh(e,t),e.prototype.getGutter=function(){return this.gutter_},e}(Wh);let Vh;!function(t){t.Auto="auto",t.Light="light",t.Dark="dark"}(Vh||(Vh={}));const Xh={theme:Vh.Auto,showLabels:!0},Yh={id:"carto",name:"CARTO basemap",description:"Add layer CARTO Raster basemaps",isBaseMap:!0,defaultOptions:Xh,create:async(t,e,i,n)=>({init:()=>{const t=Object.assign({},Xh,e.config);let i=t.theme;return i&&i!==Vh.Auto||(i=n.isDark?"dark":"light"),t.showLabels?i+="_all":i+="_nolabels",new ph({source:new Uh({attributions:'<a href="https://carto.com/attribution/">© CARTO</a>',url:`https://{1-4}.basemaps.cartocdn.com/${i}/{z}/{x}/{y}.png`})})},registerOptionsUI:t=>{t.addRadio({path:"config.theme",name:"Theme",settings:{options:[{value:Vh.Auto,label:"Auto",description:"Match grafana theme"},{value:Vh.Light,label:"Light"},{value:Vh.Dark,label:"Dark"}]},defaultValue:Xh.theme}).addBooleanSwitch({path:"config.showLabels",name:"Show labels",description:"",defaultValue:Xh.showLabels})}})},Kh=[Yh],Hh="https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",qh={url:Hh+"/tile/{z}/{y}/{x}",attribution:`Tiles © <a href="${Hh}">ArcGIS</a>`},$h={id:"xyz",name:"XYZ Tile layer",description:"Add map from a generic tile layer",isBaseMap:!0,create:async(t,e,i,n)=>({init:()=>{const t=Object.assign({},e.config);var i;t.url||(t.url=qh.url,t.attribution=null!==(i=t.attribution)&&void 0!==i?i:qh.attribution);return new ph({source:new Uh({url:t.url,attributions:t.attribution}),minZoom:t.minZoom,maxZoom:t.maxZoom})},registerOptionsUI:t=>{t.addTextInput({path:"config.url",name:"URL template",description:"Must include {x}, {y} or {-y}, and {z} placeholders",settings:{placeholder:qh.url}}).addTextInput({path:"config.attribution",name:"Attribution",settings:{placeholder:qh.attribution}})}})},Jh=[$h],Qh="custom",tu="streets",eu=new Zs.B((()=>[{id:tu,name:"World Street Map",slug:"World_Street_Map"},{id:"world-imagery",name:"World Imagery",slug:"World_Imagery"},{id:"world-physical",name:"World Physical",slug:"World_Physical_Map"},{id:"topo",name:"Topographic",slug:"World_Topo_Map"},{id:"usa-topo",name:"USA Topographic",slug:"USA_Topo_Maps"},{id:"ocean",name:"World Ocean",slug:"Ocean/World_Ocean_Base"},{id:Qh,name:"Custom MapServer",description:"Use a custom MapServer with pre-cached values",slug:""}])),iu=[{id:"esri-xyz",name:"ArcGIS MapServer",description:"Add layer from an ESRI ArcGIS MapServer",isBaseMap:!0,create:async(t,e,i,n)=>{var o;const r=Object.assign({},e.config),s=eu.getIfExists(null!==(o=r.server)&&void 0!==o?o:tu);if(s.id!==Qh){const t="https://services.arcgisonline.com/ArcGIS/rest/services/";r.url=`${t}${s.slug}/MapServer/tile/{z}/{y}/{x}`,r.attribution=`Tiles © <a href="${t}${s.slug}/MapServer">ArcGIS</a>`}const a=Object.assign({},e,{config:r});return $h.create(t,a,i,n).then((t=>(t.registerOptionsUI=t=>{t.addSelect({path:"config.server",name:"Server instance",settings:{options:eu.selectOptions().options}}).addTextInput({path:"config.url",name:"URL template",description:"Must include {x}, {y} or {-y}, and {z} placeholders",settings:{placeholder:qh.url},showIf:t=>{var e;return(null===(e=t.config)||void 0===e?void 0:e.server)===Qh}}).addTextInput({path:"config.attribution",name:"Attribution",settings:{placeholder:qh.attribution},showIf:t=>{var e;return(null===(e=t.config)||void 0===e?void 0:e.server)===Qh}})},t)))},defaultOptions:{server:tu}}];var nu=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ou=function(t){function e(e){var i,n=e||{},o=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(o=n.interpolate),i=void 0!==n.attributions?n.attributions:['&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.'];var r=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",s=void 0!==n.url?n.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:n.cacheSize,crossOrigin:r,interpolate:o,maxZoom:void 0!==n.maxZoom?n.maxZoom:19,opaque:void 0===n.opaque||n.opaque,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:s,wrapX:n.wrapX,zDirection:n.zDirection})||this}return nu(e,t),e}(Uh),ru=[...[{id:"osm-standard",name:"Open Street Map",description:"Add map from a collaborative free geographic world database",isBaseMap:!0,create:async(t,e,i)=>({init:()=>new ph({source:new ou})})}],...Kh,...iu,...Jh];var su=i(31477);let au;!function(t){t.Zero="zero",t.Coordinates="coords",t.Fit="fit"}(au||(au={}));const lu=new Zs.B((()=>[{id:au.Fit,name:"Fit to data",zoom:15},{id:au.Zero,name:"(0°, 0°)",lat:0,lon:0},{id:au.Coordinates,name:"Coordinates"},{id:"north-america",name:"North America",lat:40,lon:-100,zoom:4},{id:"south-america",name:"South America",lat:-20,lon:-60,zoom:3},{id:"europe",name:"Europe",lat:46,lon:14,zoom:4},{id:"africa",name:"Africa",lat:0,lon:30,zoom:3},{id:"west-asia",name:"West Asia",lat:26,lon:53,zoom:4},{id:"s-asia",name:"South Asia",lat:19.5,lon:80,zoom:4},{id:"se-asia",name:"South-East Asia",lat:10,lon:106,zoom:4},{id:"e-asia",name:"East Asia",lat:33,lon:120,zoom:4},{id:"australia",name:"Australia",lat:-25,lon:135,zoom:4},{id:"oceania",name:"Oceania",lat:-10,lon:-140,zoom:3}]));let hu;!function(t){t.None="none",t.Details="details"}(hu||(hu={}));const uu={id:au.Zero,lat:0,lon:0,zoom:1,allLayers:!0};let cu;!function(t){t.EQ="eq",t.NEQ="neq",t.LT="lt",t.LTE="lte",t.GT="gt",t.GTE="gte"}(cu||(cu={}));const pu=(t,e)=>{const i=e.get(t.property);switch(t.operation){case cu.EQ:return`${i}`==`${t.value}`;case cu.NEQ:return i!==t.value;case cu.GT:return i>t.value;case cu.GTE:return i>=t.value;case cu.LT:return i<t.value;case cu.LTE:return i<=t.value;default:return!1}};var du=i(30681);function fu(t){const e=new Set,i=new Set;t.some(((t,n)=>{for(const n of Object.keys(t.getProperties())){if("geometry"===n)continue;i.add(n);const o=t.getGeometry();o&&e.add(o.getType())}return n>10}));let n=Rs.Any;if(1===e.size)switch(e.values().next().value){case"Point":case"MultiPoint":n=Rs.Point;break;case"Line":case"MultiLine":n=Rs.Line;break;case"Polygon":n=Rs.Polygon}return{geometryType:n,propertes:Array.from(i.keys()).map((t=>({label:t,value:t})))}}function gu(t,e){if(t&&!e){const e={label:`${t}`,value:t};return{options:[e],current:e}}e||(e=[]);let i=e.find((e=>e.value===t));return t&&!i&&(i={label:`${t} (not found)`,value:t},e.push(i)),{options:e,current:i}}const _u=[{label:"==",value:cu.EQ},{label:"!=",value:cu.NEQ},{label:">",value:cu.GT},{label:">=",value:cu.GTE},{label:"<",value:cu.LT},{label:"<=",value:cu.LTE}],vu=t=>{var e,i;const{value:o,onChange:r,item:s,context:a}=t,l=s.settings,{features:h,layerInfo:u}=l,c=(0,_s.Z)(u),p=(0,_s.Z)(h),d=(0,n.useMemo)((()=>{var t,e;const i=null==o||null===(t=o.check)||void 0===t?void 0:t.property;return i&&p&&(null===(e=o.check)||void 0===e?void 0:e.operation)===cu.EQ?function(t,e){const i=new Set;for(const n of t){const t=n.get(e);null!=t&&i.add(`${t}`)}const n=Array.from(i);return n.sort(),n}(p,i).map((t=>{let e;return e=!isNaN(Number(t))?{value:Number(t),label:t}:{value:t,label:t},e})):[]}),[p,o]),f=(0,ge.wW)(yu),g=(0,n.useCallback)((t=>{r(Object.assign({},o,{check:Object.assign({},o.check,{property:null==t?void 0:t.value})}))}),[r,o]),_=(0,n.useCallback)((t=>{var e;r(Object.assign({},o,{check:Object.assign({},o.check,{operation:null!==(e=t.value)&&void 0!==e?e:cu.EQ})}))}),[r,o]),v=(0,n.useCallback)((t=>{r(Object.assign({},o,{check:Object.assign({},o.check,{value:null==t?void 0:t.value})}))}),[r,o]),y=(0,n.useCallback)((t=>{r(Object.assign({},o,{check:Object.assign({},o.check,{value:t})}))}),[r,o]),m=(0,n.useCallback)((t=>{r(Object.assign({},o,{style:t}))}),[r,o]),x=(0,n.useCallback)((()=>{r(void 0)}),[r]),w=null!==(e=o.check)&&void 0!==e?e:Cu.check,b=gu(w.property,null==c?void 0:c.propertes),C=gu(w.value,d);return(0,_e.jsxs)("div",{className:f.rule,children:[(0,_e.jsxs)(Ms.Z,{className:f.row,children:[(0,_e.jsx)(Fs._,{label:"Rule",labelWidth:10,grow:!0,children:(0,_e.jsx)(Je.Ph,{placeholder:"Feature property",value:b.current,options:b.options,onChange:g,"aria-label":"Feature property",isClearable:!0,allowCustomValue:!0})}),(0,_e.jsx)(Fs._,{className:f.inline,children:(0,_e.jsx)(Je.Ph,{value:_u.find((t=>t.value===w.operation)),options:_u,onChange:_,"aria-label":"Comparison operator",width:8})}),(0,_e.jsx)(Fs._,{className:f.inline,grow:!0,children:(0,_e.jsxs)("div",{className:f.flexRow,children:[(w.operation===cu.EQ||w.operation===cu.NEQ)&&(0,_e.jsx)(Je.Ph,{placeholder:"value",value:C.current,options:C.options,onChange:v,"aria-label":"Comparison value",isClearable:!0,allowCustomValue:!0}),w.operation!==cu.EQ&&(0,_e.jsx)(du.Y,{value:isNaN(Number(w.value))?0:Number(w.value),placeholder:"numeric value",onChange:y},`${w.property}/${w.operation}`)]})}),(0,_e.jsx)($e.zx,{size:"md",icon:"trash-alt",onClick:()=>x(),variant:"secondary","aria-label":"Delete style rule",className:f.button})]}),(0,_e.jsx)("div",{children:(0,_e.jsx)(ha,{value:null!==(i=o.style)&&void 0!==i?i:Is,context:a,onChange:m,item:{settings:{simpleFixedValues:!0,layerInfo:u}}})})]})},yu=t=>({rule:a.css`
    margin-bottom: ${t.spacing(1)};
  `,row:a.css`
    display: flex;
    margin-bottom: 4px;
  `,inline:a.css`
    margin-bottom: 0;
    margin-left: 4px;
  `,button:a.css`
    margin-left: 4px;
  `,flexRow:a.css`
    display: flex;
    flex-direction: row;
    align-items: flex-start;
  `}),mu=t=>{const{value:e,onChange:i,context:o,item:r}=t,s=(0,ge.l4)(),a=r.settings,l=(0,n.useCallback)((()=>{const{palette:t}=s.visualization,n={fixed:t[Math.floor(Math.random()*t.length)]},o=[...e,Object.assign({},Cu,{style:Object.assign({},Is,{color:n})})];i(o)}),[i,e,s.visualization]),h=(0,n.useCallback)((t=>n=>{const o=[...e];n?o[t]=n:o.splice(t,1),i(o)}),[i,e]),u=e&&e.map(((t,e)=>{var i;const n={settings:a};return(0,_e.jsx)(vu,{value:t,onChange:h(e),context:o,item:n},`${e}-${null===(i=t.check)||void 0===i?void 0:i.property}`)}));return(0,_e.jsxs)(_e.Fragment,{children:[u,(0,_e.jsx)($e.zx,{size:"sm",icon:"plus",onClick:l,variant:"secondary","aria-label":"Add geomap style rule",children:"Add style rule"})]})};var xu=i(12089),wu=i(20709);const bu={src:"public/maps/countries.geojson",rules:[],style:Is},Cu={style:Is,check:{property:"",operation:cu.EQ,value:""}},Su={id:"geojson",name:"GeoJSON",description:"Load static data from a geojson file",isBaseMap:!1,state:jl.BV.beta,create:async(t,e,i,n)=>{const o=Object.assign({},bu,e.config),r=new Sr({url:o.src,format:new su.Z}),s=new Es.t,a=r.on("change",(()=>{"ready"==r.getState()&&((0,ro.B)(a),s.next(r.getFeatures()))})),l=[];if(o.rules)for(const t of o.rules)if(t.style){const e=await la(t.style);l.push({state:e,rule:t.check})}{const t=await la(o.style);l.push({state:t})}const h=new dr({source:r,style:t=>{var e;const i="Point"===(null===(e=t.getGeometry())||void 0===e?void 0:e.getType());for(const e of l)if(!e.rule||pu(e.rule,t)){if(e.state.fields){const n=Object.assign({},e.state.base),{text:o}=e.state.fields;return o&&(n.text=`${t.get(o)}`),i?e.state.maker(n):ea(n)}return i?(e.point||(e.point=e.state.maker(e.state.base)),e.point):(e.poly||(e.poly=ea(e.state.base)),e.poly)}}});return{init:()=>h,registerOptionsUI:t=>{var e;const i=s.pipe((0,xu.P)(),(0,wu.U)((t=>fu(t))));t.addSelect({path:"config.src",name:"GeoJSON URL",settings:{options:null!==(e=Il())&&void 0!==e?e:[],allowCustomValue:!0},defaultValue:bu.src}).addCustomEditor({id:"config.style",path:"config.style",name:"Default style",description:"The style to apply when no rules above match",editor:ha,settings:{simpleFixedValues:!0,layerInfo:i},defaultValue:bu.style}).addCustomEditor({id:"config.rules",path:"config.rules",name:"Style rules",description:"Apply styles based on feature properties",editor:mu,settings:{features:s,layerInfo:i},defaultValue:[]})}}},defaultOptions:bu};var Eu=34962,Tu=34963,Ru=35048,Ou=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function Pu(t,e){for(var i=(0,m.f0)({preserveDrawingBuffer:!0,antialias:!Y.ME},e),n=Ou.length,o=0;o<n;++o)try{var r=t.getContext(Ou[o],i);if(r)return r}catch(t){}return null}var Iu=35044,Lu=function(){function t(t,e){this.array=null,this.type=t,(0,y.h)(t===Eu||t===Tu,62),this.usage=void 0!==e?e:Iu}return t.prototype.ofSize=function(t){this.array=new(Mu(this.type))(t)},t.prototype.fromArray=function(t){var e=Mu(this.type);this.array=e.from?e.from(t):new e(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(Mu(this.type))(t)},t.prototype.getType=function(){return this.type},t.prototype.getArray=function(){return this.array},t.prototype.getUsage=function(){return this.usage},t.prototype.getSize=function(){return this.array?this.array.length:0},t}();function Mu(t){return t===Tu?Uint32Array:Float32Array}const Fu=Lu,Au="webglcontextlost",ku="webglcontextrestored";const Du=function(){function t(t){this.gl_=t.webGlContext;var e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer();var i=e.createShader(e.VERTEX_SHADER);e.shaderSource(i,t.vertexShader||"\n  precision mediump float;\n  \n  attribute vec2 a_position;\n  varying vec2 v_texCoord;\n  varying vec2 v_screenCoord;\n  \n  uniform vec2 u_screenSize;\n   \n  void main() {\n    v_texCoord = a_position * 0.5 + 0.5;\n    v_screenCoord = v_texCoord * u_screenSize;\n    gl_Position = vec4(a_position, 0.0, 1.0);\n  }\n"),e.compileShader(i);var n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,t.fragmentShader||"\n  precision mediump float;\n   \n  uniform sampler2D u_image;\n  uniform float u_opacity;\n   \n  varying vec2 v_texCoord;\n   \n  void main() {\n    gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;\n  }\n"),e.compileShader(n),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,i),e.attachShader(this.renderTargetProgram_,n),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(i){this.uniforms_.push({value:t.uniforms[i],location:e.getUniformLocation(this.renderTargetProgram_,i)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(t){var e=this.getGL(),i=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,i[0],i[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==i[0]||this.renderTargetTextureSize_[1]!==i[1]){this.renderTargetTextureSize_=i;var n=e.RGBA,o=e.RGBA,r=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,0,n,i[0],i[1],0,o,r,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0)}},t.prototype.apply=function(t,e,i,n){var o=this.getGL(),r=t.size;if(o.bindFramebuffer(o.FRAMEBUFFER,e?e.getFrameBuffer():null),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,this.renderTargetTexture_),!e){var s=(0,yt.sq)(o.canvas);if(!t.renderTargets[s]){var a=o.getContextAttributes();a&&a.preserveDrawingBuffer&&(o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT)),t.renderTargets[s]=!0}}o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),o.viewport(0,0,o.drawingBufferWidth,o.drawingBufferHeight),o.bindBuffer(o.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),o.useProgram(this.renderTargetProgram_),o.enableVertexAttribArray(this.renderTargetAttribLocation_),o.vertexAttribPointer(this.renderTargetAttribLocation_,2,o.FLOAT,!1,0,0),o.uniform2f(this.renderTargetUniformLocation_,r[0],r[1]),o.uniform1i(this.renderTargetTextureLocation_,0);var l=t.layerStatesArray[t.layerIndex].opacity;o.uniform1f(this.renderTargetOpacityLocation_,l),this.applyUniforms(t),i&&i(o,t),o.drawArrays(o.TRIANGLES,0,6),n&&n(o,t)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(t){var e,i=this.getGL(),n=1;this.uniforms_.forEach((function(o){if((e="function"==typeof o.value?o.value(t):o.value)instanceof HTMLCanvasElement||e instanceof ImageData)o.texture||(o.texture=i.createTexture()),i.activeTexture(i["TEXTURE".concat(n)]),i.bindTexture(i.TEXTURE_2D,o.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),e instanceof ImageData?i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,e.width,e.height,0,i.UNSIGNED_BYTE,new Uint8Array(e.data)):i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e),i.uniform1i(o.location,n++);else if(Array.isArray(e))switch(e.length){case 2:return void i.uniform2f(o.location,e[0],e[1]);case 3:return void i.uniform3f(o.location,e[0],e[1],e[2]);case 4:return void i.uniform4f(o.location,e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&i.uniform1f(o.location,e)}))},t}();function ju(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}var zu=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Bu="u_projectionMatrix",Nu="u_offsetScaleMatrix",Gu="u_offsetRotateMatrix",Wu="u_time",Zu="u_zoom",Uu="u_resolution",Vu={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126},Xu={};function Yu(t){return"shared/"+t}var Ku=0;var Hu=function(t){function e(e){var i,n=t.call(this)||this,o=e||{};n.boundHandleWebGLContextLost_=n.handleWebGLContextLost.bind(n),n.boundHandleWebGLContextRestored_=n.handleWebGLContextRestored.bind(n),n.canvasCacheKey_=o.canvasCacheKey?Yu(o.canvasCacheKey):(i="unique/"+Ku,Ku+=1,i),n.canvas_=function(t){var e=Xu[t];if(!e){var i=document.createElement("canvas");i.style.position="absolute",i.style.left="0",e={users:0,canvas:i},Xu[t]=e}return e.users+=1,e.canvas}(n.canvasCacheKey_),n.gl_=Pu(n.canvas_),n.bufferCache_={},n.extensionCache_={},n.currentProgram_=null,n.canvas_.addEventListener(Au,n.boundHandleWebGLContextLost_),n.canvas_.addEventListener(ku,n.boundHandleWebGLContextRestored_),n.offsetRotateMatrix_=(0,co.Ue)(),n.offsetScaleMatrix_=(0,co.Ue)(),n.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n.uniformLocations_={},n.attribLocations_={},n.uniforms_=[],o.uniforms&&n.setUniforms(o.uniforms);var r=n.getGL();return n.postProcessPasses_=o.postProcesses?o.postProcesses.map((function(t){return new Du({webGlContext:r,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new Du({webGlContext:r})],n.shaderCompileErrors_=null,n.startTime_=Date.now(),n}return zu(e,t),e.prototype.setUniforms=function(t){for(var e in this.uniforms_=[],t)this.uniforms_.push({name:e,value:t[e]});this.uniformLocations_={}},e.prototype.canvasCacheKeyMatches=function(t){return this.canvasCacheKey_===Yu(t)},e.prototype.getExtension=function(t){if(t in this.extensionCache_)return this.extensionCache_[t];var e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e},e.prototype.bindBuffer=function(t){var e=this.getGL(),i=(0,yt.sq)(t),n=this.bufferCache_[i];n||(n={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[i]=n);e.bindBuffer(t.getType(),n.webGlBuffer)},e.prototype.flushBufferData=function(t){var e=this.getGL();this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())},e.prototype.deleteBuffer=function(t){var e=this.getGL(),i=(0,yt.sq)(t),n=this.bufferCache_[i];n&&!e.isContextLost()&&e.deleteBuffer(n.webGlBuffer),delete this.bufferCache_[i]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(Au,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(ku,this.boundHandleWebGLContextRestored_),function(t){var e=Xu[t];if(e&&(e.users-=1,!(e.users>0))){var i=Pu(e.canvas).getExtension("WEBGL_lose_context");i&&i.loseContext(),delete Xu[t]}}(this.canvasCacheKey_),delete this.gl_,delete this.canvas_},e.prototype.prepareDraw=function(t,e){var i=this.getGL(),n=this.getCanvas(),o=t.size,r=t.pixelRatio;n.width=o[0]*r,n.height=o[1]*r,n.style.width=o[0]+"px",n.style.height=o[1]+"px",i.useProgram(this.currentProgram_);for(var s=this.postProcessPasses_.length-1;s>=0;s--)this.postProcessPasses_[s].init(t);i.bindTexture(i.TEXTURE_2D,null),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,e?i.ZERO:i.ONE_MINUS_SRC_ALPHA),i.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,i){var n=this.getGL(),o=e.getSize();n.bindFramebuffer(n.FRAMEBUFFER,e.getFramebuffer()),n.viewport(0,0,o[0],o[1]),n.bindTexture(n.TEXTURE_2D,e.getTexture()),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,i?n.ZERO:n.ONE_MINUS_SRC_ALPHA),n.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var i=this.getGL();this.getExtension("OES_element_index_uint");var n=i.UNSIGNED_INT,o=e-t,r=4*t;i.drawElements(i.TRIANGLES,o,n,r)},e.prototype.finalizeDraw=function(t,e,i){for(var n=0,o=this.postProcessPasses_.length;n<o;n++)n===o-1?this.postProcessPasses_[n].apply(t,null,e,i):this.postProcessPasses_[n].apply(t,this.postProcessPasses_[n+1])},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.applyFrameState=function(t){var e=t.size,i=t.viewState.rotation,n=(0,co.mc)(this.offsetScaleMatrix_);(0,co.bA)(n,2/e[0],2/e[1]);var o=(0,co.mc)(this.offsetRotateMatrix_);0!==i&&(0,co.U1)(o,-i),this.setUniformMatrixValue(Nu,ju(this.tmpMat4_,n)),this.setUniformMatrixValue(Gu,ju(this.tmpMat4_,o)),this.setUniformFloatValue(Wu,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(Zu,t.viewState.zoom),this.setUniformFloatValue(Uu,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var e,i=this.getGL(),n=0;this.uniforms_.forEach(function(o){if((e="function"==typeof o.value?o.value(t):o.value)instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageData)o.texture||(o.prevValue=void 0,o.texture=i.createTexture()),i.activeTexture(i["TEXTURE".concat(n)]),i.bindTexture(i.TEXTURE_2D,o.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),(!(e instanceof HTMLImageElement)||e.complete)&&o.prevValue!==e&&(o.prevValue=e,i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e)),i.uniform1i(this.getUniformLocation(o.name),n++);else if(Array.isArray(e)&&6===e.length)this.setUniformMatrixValue(o.name,ju(this.tmpMat4_,e));else if(Array.isArray(e)&&e.length<=4)switch(e.length){case 2:return void i.uniform2f(this.getUniformLocation(o.name),e[0],e[1]);case 3:return void i.uniform3f(this.getUniformLocation(o.name),e[0],e[1],e[2]);case 4:return void i.uniform4f(this.getUniformLocation(o.name),e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&i.uniform1f(this.getUniformLocation(o.name),e)}.bind(this))},e.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,this.uniformLocations_={},this.attribLocations_={},!0)},e.prototype.compileShader=function(t,e){var i=this.getGL(),n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n},e.prototype.getProgram=function(t,e){var i=this.getGL(),n=this.compileShader(t,i.FRAGMENT_SHADER),o=this.compileShader(e,i.VERTEX_SHADER),r=i.createProgram();if(i.attachShader(r,n),i.attachShader(r,o),i.linkProgram(r),!i.getShaderParameter(n,i.COMPILE_STATUS)){var s="Fragment shader compliation failed: ".concat(i.getShaderInfoLog(n));throw new Error(s)}if(i.deleteShader(n),!i.getShaderParameter(o,i.COMPILE_STATUS)){s="Vertex shader compilation failed: ".concat(i.getShaderInfoLog(o));throw new Error(s)}if(i.deleteShader(o),!i.getProgramParameter(r,i.LINK_STATUS)){s="GL program linking failed: ".concat(i.getShaderInfoLog(o));throw new Error(s)}return r},e.prototype.getUniformLocation=function(t){return void 0===this.uniformLocations_[t]&&(this.uniformLocations_[t]=this.getGL().getUniformLocation(this.currentProgram_,t)),this.uniformLocations_[t]},e.prototype.getAttributeLocation=function(t){return void 0===this.attribLocations_[t]&&(this.attribLocations_[t]=this.getGL().getAttribLocation(this.currentProgram_,t)),this.attribLocations_[t]},e.prototype.makeProjectionTransform=function(t,e){var i=t.size,n=t.viewState.rotation,o=t.viewState.resolution,r=t.viewState.center;return(0,co.mc)(e),(0,co.qC)(e,0,0,2/(o*i[0]),2/(o*i[1]),-n,-r[0],-r[1]),e},e.prototype.setUniformFloatValue=function(t,e){this.getGL().uniform1f(this.getUniformLocation(t),e)},e.prototype.setUniformFloatVec4=function(t,e){this.getGL().uniform4fv(this.getUniformLocation(t),e)},e.prototype.setUniformMatrixValue=function(t,e){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,e)},e.prototype.enableAttributeArray_=function(t,e,i,n,o){var r=this.getAttributeLocation(t);r<0||(this.getGL().enableVertexAttribArray(r),this.getGL().vertexAttribPointer(r,e,i,!1,n,o))},e.prototype.enableAttributes=function(t){for(var e=function(t){for(var e=0,i=0;i<t.length;i++){var n=t[i];e+=n.size*qu(n.type)}return e}(t),i=0,n=0;n<t.length;n++){var o=t[n];this.enableAttributeArray_(o.name,o.size,o.type||5126,e,i),i+=o.size*qu(o.type)}},e.prototype.handleWebGLContextLost=function(){(0,m.ZH)(this.bufferCache_),this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,e,i){var n=this.getGL(),o=i||n.createTexture(),r=n.RGBA,s=n.RGBA,a=n.UNSIGNED_BYTE;return n.bindTexture(n.TEXTURE_2D,o),e?n.texImage2D(n.TEXTURE_2D,0,r,s,a,e):n.texImage2D(n.TEXTURE_2D,0,r,t[0],t[1],0,s,a,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),o},e}(ca.Z);function qu(t){switch(t){case Vu.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Vu.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Vu.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Vu.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}const $u=Hu;var Ju=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Qu="GENERATE_BUFFERS",tc=function(t){function e(e,i){var n=t.call(this,e)||this,o=i||{};return n.inversePixelTransform_=(0,co.Ue)(),n.pixelContext_=null,n.postProcesses_=o.postProcesses,n.uniforms_=o.uniforms,n.helper,e.addChangeListener(vt,n.removeHelper.bind(n)),n.dispatchPreComposeEvent=n.dispatchPreComposeEvent.bind(n),n.dispatchPostComposeEvent=n.dispatchPostComposeEvent.bind(n),n}return Ju(e,t),e.prototype.dispatchPreComposeEvent=function(t,e){var i=this.getLayer();if(i.hasListener(Ct)){var n=new uo(Ct,void 0,e,t);i.dispatchEvent(n)}},e.prototype.dispatchPostComposeEvent=function(t,e){var i=this.getLayer();if(i.hasListener(St)){var n=new uo(St,void 0,e,t);i.dispatchEvent(n)}},e.prototype.reset=function(t){this.uniforms_=t.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)},e.prototype.removeHelper=function(){this.helper&&(this.helper.dispose(),delete this.helper)},e.prototype.prepareFrame=function(t){if(this.getLayer().getRenderSource()){for(var i=!0,n=-1,o=void 0,r=0,s=t.layerStatesArray.length;r<s;r++){var a=t.layerStatesArray[r].layer,l=a.getRenderer();if(l instanceof e){var h=a.getClassName();if((i||h!==o)&&(n+=1,i=!1),o=h,l===this)break}else i=!0}var u="map/"+t.mapId+"/group/"+n;this.helper&&this.helper.canvasCacheKeyMatches(u)||(this.removeHelper(),this.helper=new $u({postProcesses:this.postProcesses_,uniforms:this.uniforms_,canvasCacheKey:u}),o&&(this.helper.getCanvas().className=o),this.afterHelperCreated())}return this.prepareFrameInternal(t)},e.prototype.afterHelperCreated=function(){},e.prototype.prepareFrameInternal=function(t){return!0},e.prototype.disposeInternal=function(){this.removeHelper(),t.prototype.disposeInternal.call(this)},e.prototype.dispatchRenderEvent_=function(t,e,i){var n=this.getLayer();if(n.hasListener(t)){(0,co.qC)(this.inversePixelTransform_,0,0,i.pixelRatio,-i.pixelRatio,0,0,-i.size[1]);var o=new uo(t,this.inversePixelTransform_,i,e);n.dispatchEvent(o)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(wt,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(bt,t,e)},e.prototype.getDataAtPixel=function(t,e,i){var n=(0,co.nn)([e.pixelRatio,0,0,e.pixelRatio,0,0],t.slice()),o=this.helper.getGL();if(!o)return null;var r=this.getLayer().getExtent();if(r){var s=(0,co.nn)(e.pixelToCoordinateTransform,t.slice());if(!(0,C.b8)(r,s))return null}var a=o.getContextAttributes();if(!a||!a.preserveDrawingBuffer)return new Uint8Array;var l,h=Math.round(n[0]),u=Math.round(n[1]),c=this.pixelContext_;if(!c){var p=document.createElement("canvas");p.width=1,p.height=1,c=p.getContext("2d"),this.pixelContext_=c}c.clearRect(0,0,1,1);try{c.drawImage(o.canvas,h,u,1,1,0,0,1,1),l=c.getImageData(0,0,1,1).data}catch(t){return l}return 0===l[3]?null:l},e}(lo);function ec(t,e){var i=e||[],n=256,o=255;return i[0]=Math.floor(t/n/n/n)/o,i[1]=Math.floor(t/n/n)%n/o,i[2]=Math.floor(t/n)%n/o,i[3]=t%n/o,i}const ic=tc;var nc=new Uint8Array(4);const oc=function(){function t(t,e){this.helper_=t;var i=t.getGL();this.texture_=i.createTexture(),this.framebuffer_=i.createFramebuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}return t.prototype.setSize=function(t){(0,S.fS)(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())},t.prototype.getSize=function(){return this.size_},t.prototype.clearCachedData=function(){this.dataCacheDirty_=!0},t.prototype.readAll=function(){if(this.dataCacheDirty_){var t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_},t.prototype.readPixel=function(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return nc[0]=0,nc[1]=0,nc[2]=0,nc[3]=0,nc;this.readAll();var i=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return nc[0]=this.data_[4*i],nc[1]=this.data_[4*i+1],nc[2]=this.data_[4*i+2],nc[3]=this.data_[4*i+3],nc},t.prototype.getTexture=function(){return this.texture_},t.prototype.getFramebuffer=function(){return this.framebuffer_},t.prototype.updateSize_=function(){var t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(t[0]*t[1]*4)},t}();var rc=i(45640).Buffer;var sc=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ac=function(t){function e(e,i){var n=this,o=i.uniforms||{},r=(0,co.Ue)();o[Bu]=r,(n=t.call(this,e,{uniforms:o,postProcesses:i.postProcesses})||this).ready=!1,n.sourceRevision_=-1,n.verticesBuffer_=new Fu(Eu,Ru),n.hitVerticesBuffer_=new Fu(Eu,Ru),n.indicesBuffer_=new Fu(Tu,Ru),n.vertexShader_=i.vertexShader,n.fragmentShader_=i.fragmentShader,n.program_,n.hitDetectionEnabled_=!(!i.hitFragmentShader||!i.hitVertexShader),n.hitVertexShader_=i.hitVertexShader,n.hitFragmentShader_=i.hitFragmentShader,n.hitProgram_;var s=i.attributes?i.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:Vu.FLOAT}})):[];n.attributes=[{name:"a_position",size:2,type:Vu.FLOAT},{name:"a_index",size:1,type:Vu.FLOAT}].concat(s),n.hitDetectionAttributes=[{name:"a_position",size:2,type:Vu.FLOAT},{name:"a_index",size:1,type:Vu.FLOAT},{name:"a_hitColor",size:4,type:Vu.FLOAT},{name:"a_featureUid",size:1,type:Vu.FLOAT}].concat(s),n.customAttributes=i.attributes?i.attributes:[],n.previousExtent_=(0,C.lJ)(),n.currentTransform_=r,n.renderTransform_=(0,co.Ue)(),n.invertRenderTransform_=(0,co.Ue)(),n.renderInstructions_=new Float32Array(0),n.hitRenderInstructions_=new Float32Array(0),n.hitRenderTarget_,n.generateBuffersRun_=0,n.worker_=function(){var t='const e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const t=Object(e);for(let e=1,n=arguments.length;e<n;++e){const n=arguments[e];if(null!=n)for(const e in n)n.hasOwnProperty(e)&&(t[e]=n[e])}return t},n="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"";n.indexOf("firefox");-1!==n.indexOf("safari")&&-1==n.indexOf("chrom")&&(n.indexOf("version/15.4")>=0||n.match(/cpu (os|iphone os) 15_4 like mac os x/)),-1!==n.indexOf("webkit")&&n.indexOf("edge"),n.indexOf("macintosh"),"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&(self,WorkerGlobalScope),function(){let e=!1;try{const n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,n),window.removeEventListener("_",null,n)}catch(e){}}(),new Array(6);const t="GENERATE_BUFFERS",o=[],r={vertexPosition:0,indexPosition:0};function i(e,n,t,o,r){e[n+0]=t,e[n+1]=o,e[n+2]=r}function s(e,n,t,s,f,c){const l=3+f,a=e[n+0],u=e[n+1],d=o;d.length=f;for(let t=0;t<d.length;t++)d[t]=e[n+2+t];let g=c?c.vertexPosition:0,x=c?c.indexPosition:0;const h=g/l;return i(t,g,a,u,0),d.length&&t.set(d,g+3),g+=l,i(t,g,a,u,1),d.length&&t.set(d,g+3),g+=l,i(t,g,a,u,2),d.length&&t.set(d,g+3),g+=l,i(t,g,a,u,3),d.length&&t.set(d,g+3),g+=l,s[x++]=h,s[x++]=h+1,s[x++]=h+3,s[x++]=h+1,s[x++]=h+2,s[x++]=h+3,r.vertexPosition=g,r.indexPosition=x,r}const f=self;f.onmessage=n=>{const o=n.data;if(o.type===t){const n=3,t=2,r=o.customAttributesCount,i=t+r,c=new Float32Array(o.renderInstructions),l=c.length/i,a=4*l*(r+n),u=new Uint32Array(6*l),d=new Float32Array(a);let g;for(let e=0;e<c.length;e+=i)g=s(c,e,d,u,r,g);const x=e({vertexBuffer:d.buffer,indexBuffer:u.buffer,renderInstructions:c.buffer},o);f.postMessage(x,[d.buffer,u.buffer,c.buffer])}};';return new Worker("undefined"==typeof Blob?"data:application/javascript;base64,"+rc.from(t,"binary").toString("base64"):URL.createObjectURL(new Blob([t],{type:"application/javascript"})))}(),n.worker_.addEventListener("message",function(t){var e=t.data;if(e.type===Qu){var i=e.projectionTransform;e.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(e.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=i,(0,co.nb)(this.invertRenderTransform_,this.renderTransform_),e.hitDetection?this.hitRenderInstructions_=new Float32Array(t.data.renderInstructions):(this.renderInstructions_=new Float32Array(t.data.renderInstructions),e.generateBuffersRun===this.generateBuffersRun_&&(this.ready=!0)),this.getLayer().changed()}}.bind(n)),n.featureCache_={},n.featureCount_=0;var a=n.getLayer().getSource();return n.sourceListenKeys_=[(0,X.oL)(a,xi,n.handleSourceFeatureAdded_,n),(0,X.oL)(a,wi,n.handleSourceFeatureChanged_,n),(0,X.oL)(a,Ci,n.handleSourceFeatureDelete_,n),(0,X.oL)(a,bi,n.handleSourceFeatureClear_,n)],a.forEachFeature(function(t){this.featureCache_[(0,yt.sq)(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(n)),n}return sc(e,t),e.prototype.afterHelperCreated=function(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitProgram_=this.helper.getProgram(this.hitFragmentShader_,this.hitVertexShader_),this.hitRenderTarget_=new oc(this.helper))},e.prototype.handleSourceFeatureAdded_=function(t){var e=t.feature;this.featureCache_[(0,yt.sq)(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var e=t.feature;this.featureCache_[(0,yt.sq)(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var e=t.feature;delete this.featureCache_[(0,yt.sq)(e)],this.featureCount_--},e.prototype.handleSourceFeatureClear_=function(){this.featureCache_={},this.featureCount_=0},e.prototype.renderFrame=function(t){var e=this.helper.getGL();this.preRender(e,t);var i=t.viewState.projection,n=this.getLayer().getSource().getWrapX()&&i.canWrapX(),o=i.getExtent(),r=t.extent,s=n?(0,C.dz)(o):null,a=n?Math.ceil((r[2]-o[2])/s)+1:1,l=n?Math.floor((r[0]-o[0])/s):0,h=l,u=this.indicesBuffer_.getSize();do{this.helper.makeProjectionTransform(t,this.currentTransform_),(0,co.Iu)(this.currentTransform_,h*s,0),(0,co.Jp)(this.currentTransform_,this.invertRenderTransform_),this.helper.applyUniforms(t),this.helper.drawElements(0,u)}while(++h<a);this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);var c=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderHitDetection(t,l,a,s),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),c},e.prototype.prepareFrameInternal=function(t){var e=this.getLayer(),i=e.getSource(),n=t.viewState,o=!t.viewHints[c]&&!t.viewHints[p],r=!(0,C.fS)(this.previousExtent_,t.extent),s=this.sourceRevision_<i.getRevision();if(s&&(this.sourceRevision_=i.getRevision()),o&&(r||s)){var a=n.projection,l=n.resolution,h=e instanceof Ln?e.getRenderBuffer():0,u=(0,C.f3)(t.extent,h*l);i.loadFeatures(u,l,a),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.useProgram(this.program_),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0},e.prototype.rebuildBuffers_=function(t){var e=(0,co.Ue)();this.helper.makeProjectionTransform(t,e);var i,n,o=(2+this.customAttributes.length)*this.featureCount_;if(this.renderInstructions_&&this.renderInstructions_.length===o||(this.renderInstructions_=new Float32Array(o)),this.hitDetectionEnabled_){var r=(7+this.customAttributes.length)*this.featureCount_;this.hitRenderInstructions_&&this.hitRenderInstructions_.length===r||(this.hitRenderInstructions_=new Float32Array(r))}var s,a=[],l=[],h=0,u=0;for(var c in this.featureCache_)if((n=(i=this.featureCache_[c]).geometry)&&"Point"===n.getType()){a[0]=n.getFlatCoordinates()[0],a[1]=n.getFlatCoordinates()[1],(0,co.nn)(e,a),s=ec(u+6,l),this.renderInstructions_[h++]=a[0],this.renderInstructions_[h++]=a[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[u++]=a[0],this.hitRenderInstructions_[u++]=a[1],this.hitRenderInstructions_[u++]=s[0],this.hitRenderInstructions_[u++]=s[1],this.hitRenderInstructions_[u++]=s[2],this.hitRenderInstructions_[u++]=s[3],this.hitRenderInstructions_[u++]=Number(c));for(var p=void 0,d=0;d<this.customAttributes.length;d++)p=this.customAttributes[d].callback(i.feature,i.properties),this.renderInstructions_[h++]=p,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[u++]=p)}var f={type:Qu,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(f.projectionTransform=e,f.generateBuffersRun=++this.generateBuffersRun_,this.ready=!1,this.worker_.postMessage(f,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var g={type:Qu,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};g.projectionTransform=e,g.hitDetection=!0,this.worker_.postMessage(g,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o){if((0,y.h)(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var r=(0,co.nn)(e.coordinateToPixelTransform,t.slice()),s=this.hitRenderTarget_.readPixel(r[0]/2,r[1]/2),a=function(t){var e=0,i=256,n=255;return e+=Math.round(t[0]*i*i*i*n),e+=Math.round(t[1]*i*i*n),e+=Math.round(t[2]*i*n),e+Math.round(t[3]*n)}([s[0]/255,s[1]/255,s[2]/255,s[3]/255]),l=this.hitRenderInstructions_[a],h=Math.floor(l).toString(),u=this.getLayer().getSource().getFeatureByUid(h);return u?n(u,this.getLayer(),null):void 0}},e.prototype.renderHitDetection=function(t,e,i,n){if(this.hitVerticesBuffer_.getSize()){var o=e;this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.useProgram(this.hitProgram_),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0),this.helper.bindBuffer(this.hitVerticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.hitDetectionAttributes);do{this.helper.makeProjectionTransform(t,this.currentTransform_),(0,co.Iu)(this.currentTransform_,o*n,0),(0,co.Jp)(this.currentTransform_,this.invertRenderTransform_),this.helper.applyUniforms(t);var r=this.indicesBuffer_.getSize();this.helper.drawElements(0,r)}while(++o<i)}},e.prototype.disposeInternal=function(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach((function(t){(0,X.bN)(t)})),this.sourceListenKeys_=null,t.prototype.disposeInternal.call(this)},e}(ic);var lc=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),hc="blur",uc="gradient",cc="radius",pc=["#00f","#0ff","#0f0","#ff0","#f00"];const dc=function(t){function e(e){var i=this,n=e||{},o=(0,m.f0)({},n);delete o.gradient,delete o.radius,delete o.blur,delete o.weight,(i=t.call(this,o)||this).gradient_=null,i.addChangeListener(uc,i.handleGradientChanged_),i.setGradient(n.gradient?n.gradient:pc),i.setBlur(void 0!==n.blur?n.blur:15),i.setRadius(void 0!==n.radius?n.radius:8);var r=n.weight?n.weight:"weight";return i.weightFunction_="string"==typeof r?function(t){return t.get(r)}:r,i.setRenderOrder(null),i}return lc(e,t),e.prototype.getBlur=function(){return this.get(hc)},e.prototype.getGradient=function(){return this.get(uc)},e.prototype.getRadius=function(){return this.get(cc)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=1,i=256,n=K(e,i),o=n.createLinearGradient(0,0,e,i),r=1/(t.length-1),s=0,a=t.length;s<a;++s)o.addColorStop(s*r,t[s]);return n.fillStyle=o,n.fillRect(0,0,e,i),n.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(hc,t)},e.prototype.setGradient=function(t){this.set(uc,t)},e.prototype.setRadius=function(t){this.set(cc,t)},e.prototype.createRenderer=function(){return new ac(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?(0,x.uZ)(e,0,1):1}.bind(this)}],vertexShader:"\n        precision mediump float;\n        uniform mat4 u_projectionMatrix;\n        uniform mat4 u_offsetScaleMatrix;\n        uniform float u_size;\n        attribute vec2 a_position;\n        attribute float a_index;\n        attribute float a_weight;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n\n        void main(void) {\n          mat4 offsetMatrix = u_offsetScaleMatrix;\n          float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n          float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n          vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n          gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n          float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n          float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n          v_texCoord = vec2(u, v);\n          v_weight = a_weight;\n        }",fragmentShader:"\n        precision mediump float;\n        uniform float u_blurSlope;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n\n        void main(void) {\n          vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n          float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n          float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n          float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n          gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n        }",hitVertexShader:"\n        precision mediump float;\n        uniform mat4 u_projectionMatrix;\n        uniform mat4 u_offsetScaleMatrix;\n        uniform float u_size;\n        attribute vec2 a_position;\n        attribute float a_index;\n        attribute float a_weight;\n        attribute vec4 a_hitColor;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n        varying vec4 v_hitColor;\n\n        void main(void) {\n          mat4 offsetMatrix = u_offsetScaleMatrix;\n          float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n          float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n          vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n          gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n          float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n          float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n          v_texCoord = vec2(u, v);\n          v_hitColor = a_hitColor;\n          v_weight = a_weight;\n        }",hitFragmentShader:"\n        precision mediump float;\n        uniform float u_blurSlope;\n\n        varying vec2 v_texCoord;\n        varying float v_weight;\n        varying vec4 v_hitColor;\n\n        void main(void) {\n          vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n          float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n          float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n          float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n          if (alpha < 0.05) {\n            discard;\n          }\n\n          gl_FragColor = v_hitColor;\n        }",uniforms:{u_size:function(){return 2*(this.get(cc)+this.get(hc))}.bind(this),u_blurSlope:function(){return this.get(cc)/Math.max(1,this.get(hc))}.bind(this)},postProcesses:[{fragmentShader:"\n            precision mediump float;\n\n            uniform sampler2D u_image;\n            uniform sampler2D u_gradientTexture;\n            uniform float u_opacity;\n\n            varying vec2 v_texCoord;\n\n            void main() {\n              vec4 color = texture2D(u_image, v_texCoord);\n              gl_FragColor.a = color.a * u_opacity;\n              gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n              gl_FragColor.rgb *= gl_FragColor.a;\n            }",uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this),u_opacity:function(){return this.getOpacity()}.bind(this)}}]})},e.prototype.renderDeclutter=function(){},e}(Ln),fc={weight:{fixed:1,min:0,max:1},blur:15,radius:5},gc={id:"heatmap",name:"Heatmap",description:"Visualizes a heatmap of the data",isBaseMap:!1,showLocation:!0,create:async(t,e,i,n)=>{const o=Object.assign({},fc,e.config),r=await(0,ds.cJ)(e.location),s=new ua(r),a="_weight",l=new dc({source:s,blur:o.blur,radius:o.radius,weight:t=>t.get(a)});return{init:()=>l,update:t=>{var e;const i=t.series[0];if(!i)return;s.update(i);const r=(0,Ts.W8)(i,o.weight);s.forEachFeature((t=>{const e=t.get("rowIndex");null!=e&&t.set(a,r.get(e))}));let h=["#00f","#0ff","#0f0","#ff0","#f00"];const u=null!==(e=r.field)&&void 0!==e?e:i.fields.find((t=>t.type===Ee.fS.number));if(u){const t=(0,ys.fD)(u);t.isContinuous&&t.getColors&&(h=t.getColors(n))}l.setGradient(h)},registerOptionsUI:t=>{t.addCustomEditor({id:"config.weight",path:"config.weight",name:"Weight values",description:"Scale the distribution for each row",editor:Ns.cL,settings:{min:0,max:1,hideRange:!0},defaultValue:{fixed:1,min:0,max:1}}).addSliderInput({path:"config.radius",description:"Configures the size of clusters",name:"Radius",defaultValue:fc.radius,settings:{min:1,max:50,step:1}}).addSliderInput({path:"config.blur",description:"Configures the amount of blur of clusters",name:"Blur",defaultValue:fc.blur,settings:{min:1,max:50,step:1}})}}},defaultOptions:fc},_c={icon:"https://openlayers.org/en/latest/examples/data/icon.png"},vc={id:"last-point-tracker",name:"Icon at last point",description:"Show an icon at the last point",isBaseMap:!1,showLocation:!0,state:jl.BV.alpha,create:async(t,e,i,n)=>{const o=new di.Z({}),r=Object.assign({},_c,e.config);o.setStyle(new Rn({image:new ir({src:r.icon})}));const s=new Sr({features:[o]}),a=new dr({source:s}),l=await(0,ds.cJ)(e.location);return{init:()=>a,update:t=>{const e=t.series[0];if(e&&e.length){const t=(0,ds.g6)(e,l);if(!t.field)return;o.setGeometry(t.field.values.get(e.length-1))}}}},defaultOptions:_c};var yc=i(49175),mc=i(8290);const xc={style:Object.assign({},Is,{opacity:1,lineWidth:2})},wc="route",bc=(ps.q.Auto,{id:wc,name:"Route",description:"Render data points as a route",isBaseMap:!1,showLocation:!0,state:jl.BV.alpha,create:async(t,e,i,n)=>{const o=Object.assign({},xc,null==e?void 0:e.config),r=await la(o.style),s=await(0,ds.cJ)(e.location),a=new ua(s),l=new dr({source:a});r.fields?l.setStyle((t=>{const e=t.get("rowIndex"),i=r.dims;if(!i||!(0,Se.isNumber)(e))return ia(r.base);const n=Object.assign({},r.base);return i.color&&(n.color=i.color.get(e)),ia(n)})):l.setStyle(ia(r.base));const h=new di.Z({}),u=(r.base.lineWidth||6)+2,c=new Rn({image:new mn({radius:u,stroke:new wn({color:(0,mc.alpha)(r.base.color,.4),width:u+2}),fill:new xn({color:r.base.color})})}),p=new dr({source:new Sr({features:[h]}),style:c}),d=new wa({layers:[l,p]}),f=new ue.w0;return f.add(i.getStream(ce.es).pipe((0,yc.p)(8)).subscribe({next:t=>{var e,i;const n=a.getFeatures()[0],o=null==n?void 0:n.get("frame"),r=null===(e=t.payload)||void 0===e||null===(i=e.point)||void 0===i?void 0:i.time;if(o&&r){const t=o.fields.find((t=>t.name===Ee.Ls));if(t){const e=function(t,e){if(0===t.length)return null;if(1===t.length)return 0;const i=t.length-1;if(e<t[0])return 0;if(e>t[i])return i;const n=Math.abs(Math.round(i*(e-t[0])/(t[i]-t[0])));if(e<t[n]){for(let i=n;i>0;i--)if(e>t[i])return i;return 0}for(let o=n;o<i;o++)if(e<t[o])return o;return i}(t.values.toArray(),r);if(null!==e){const t=(0,ds.g6)(o,s);t.field&&(h.setGeometry(t.field.values.get(e)),h.setStyle(c))}}}}})),f.add(i.subscribe(ce.xH,(t=>{h.setStyle(new Rn({}))}))),{init:()=>d,dispose:()=>f.unsubscribe(),update:t=>{var e;if(null!==(e=t.series)&&void 0!==e&&e.length)for(const e of t.series){if(r.fields){const t={};var i;if(r.fields.color)t.color=(0,Ts.PX)(e,null!==(i=r.config.color)&&void 0!==i?i:Is.color,n);r.dims=t}a.updateLineString(e);break}},registerOptionsUI:t=>{t.addCustomEditor({id:"config.style",path:"config.style",name:"Style",editor:ha,settings:{simpleFixedValues:!0},defaultValue:xc.style}).addSliderInput({path:"config.style.lineWidth",name:"Line width",defaultValue:xc.style.lineWidth,settings:{min:1,max:10,step:1}})}}},defaultOptions:xc});window.ol&&!ol.ext&&(ol.ext={});var Cc=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t};window.ol&&(ol.inherits||(ol.inherits=Cc)),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),window.Element&&!Element.prototype.remove&&(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)});var Sc=function(t){(t=t||{}).loader=this._loader,t.strategy=yr,Sr.call(this,t),this.set("time",t.time||new Date),this.set("step",t.step||1)};Cc(Sc,Sr),function(){function t(t){var e=Math.PI/180,i=t-2451545,n=280.46+.9856474*i,o=357.528+.9856003*i;return o%=360,{lambda:(n%=360)+1.915*Math.sin(o*e)+.02*Math.sin(2*o*e),R:1.00014-.01671*Math.cos(o*e)-.0014*Math.cos(2*o*e)}}function e(t){var e=(t-2451545)/36525;return 23.43929111-e*(46.836769/3600-e*(1831e-7/3600+e*(5.565e-7-e*(1.6e-10-4.34e-8*e/3600))))}function i(t,e){var i=180/Math.PI,n=Math.PI/180,o=Math.atan(Math.cos(e*n)*Math.tan(t*n))*i,r=Math.asin(Math.sin(e*n)*Math.sin(t*n))*i;return{alpha:o+=90*Math.floor(t/90)-90*Math.floor(o/90),delta:r}}Sc.prototype._loader=function(t,e,i){var n=this.getCoordinates(this.get("time")),o=new k.ZP([n]);o.transform("EPSG:4326",i),this.addFeature(new di.Z(o))},Sc.prototype.setTime=function(t){this.set("time",t),this.refresh()},Sc.prototype.getSunPosition=function(n){var o=(n?new Date(n):new Date)/864e5+2440587.5,r=(18.697374558+24.06570982441908*(o-2451545))%24,s=t(o),a=e(o),l=i(s.lambda,a);return[l.alpha-15*r,l.delta]},Sc.getNightLat=function(n,o){var r=180/Math.PI,s=Math.PI/180,a=(o?new Date(o):new Date)/864e5+2440587.5,l=(18.697374558+24.06570982441908*(a-2451545))%24,h=t(a),u=e(a),c=i(h.lambda,u),p=15*l+n-c.alpha;return Math.atan(-Math.cos(p*s)/Math.tan(c.delta*s))*r},Sc.prototype.getCoordinates=function(n,o){for(var r=180/Math.PI,s=Math.PI/180,a=(n?new Date(n):new Date)/864e5+2440587.5,l=(18.697374558+24.06570982441908*(a-2451545))%24,h=[],u=t(a),c=e(a),p=i(u.lambda,c),d=this.get("step")||1,f=-180;f<=180;f+=d){var g=f,_=15*l+g-p.alpha,v=Math.atan(-Math.cos(_*s)/Math.tan(p.delta*s))*r;h.push([g,v])}switch(o){case"line":break;case"day":p.delta*=-1;default:v=p.delta<0?90:-90;for(var y=180;y>=-180;y-=d)h.push([y,v]);h.push(h[0])}if("daynight"===o){var m=[];h.forEach((function(t){m.push(t.slice())})),m[0][1]=-m[0][1],m[m.length-1][1]=-m[0][1],m[m.length-1][1]=-m[0][1],h=[h,m]}return h}}();const Ec=Sc;let Tc;!function(t){t.From="from",t.To="to"}(Tc||(Tc={}));const Rc={show:Tc.To,sun:!1,nightColor:"#a7a6ba4D"},Oc="dayNight",Pc={id:Oc,name:"Night / Day",description:"Show day and night regions",isBaseMap:!1,state:jl.BV.alpha,create:async(t,e,i,n)=>{const o=Object.assign({},Rc,null==e?void 0:e.config),r=new Ec({}),s=Object.getPrototypeOf(r),a=new Ec({}),l=(Object.getPrototypeOf(a),new dr({source:r,style:new Rn({fill:new xn({color:n.visualization.getColorByName(o.nightColor)})})})),h=new dr({source:new Sr({features:[]}),style:new Rn({stroke:new wn({color:"#607D8B",width:1.5,lineDash:[2,3]})})}),u=new di.Z({geometry:new ni.Z([])}),c=new dr({source:new Sr({features:[u]}),style:new Rn({image:new mn({radius:13,fill:new xn({color:"rgb(253,184,19)"})})})}),p=new di.Z({geometry:new ni.Z([])}),d=new Rn({image:new mn({radius:13,stroke:new wn({color:"rgb(253,184,19)",width:1.5})})}),f=new Rn({image:new mn({radius:15,stroke:new wn({color:"#607D8B",width:1.5,lineDash:[2,3]})})}),_=new dr({source:new Sr({features:[p]}),style:[f,d]}),v=new wa({layers:o.sun?[l,c,_,h]:[l,h]}),y=new ue.w0;return{init:()=>v,dispose:()=>y.unsubscribe(),update:t=>{const e=new Date(t.timeRange.from.valueOf()),i=new Date(t.timeRange.to.valueOf());let n=new Date,a=[];var l;(n=o.show===Tc.From?e:i,r.setTime(n),o.sun)&&(a=s.getSunPosition(n),null===(l=u.getGeometry())||void 0===l||l.setCoordinates((0,g.mi)(a)))},registerOptionsUI:t=>{var i;null!==(i=e.config)&&void 0!==i&&i.nightColor||(e.config=Object.assign({},Rc,e.config)),t.addRadio({path:"config.show",name:"Show",settings:{options:[{label:"From",value:Tc.From},{label:"To",value:Tc.To}]},defaultValue:Rc.show}),t.addColorPicker({path:"config.nightColor",name:"Night region color",description:"Pick color of night region",defaultValue:Rc.nightColor,settings:[{enableNamedColors:!1}]}),t.addBooleanSwitch({path:"config.sun",name:"Display sun",description:"Show the sun",defaultValue:Rc.sun})}}},defaultOptions:Rc},Ic={src:"public/maps/countries.geojson",rules:[],style:Is,dataStyle:{}},Lc=(cu.EQ,{id:"dynamic-geojson",name:"Dynamic GeoJSON",description:"Style a geojson file based on query results",isBaseMap:!1,state:jl.BV.alpha,create:async(t,e,i,n)=>{const o=Object.assign({},Ic,e.config),r=new Sr({url:o.src,format:new su.Z}),s=new Es.t,a=r.on("change",(()=>{"ready"==r.getState()&&((0,ro.B)(a),s.next(r.getFeatures()))})),l=[];if(o.rules)for(const t of o.rules)if(t.style){const e=await la(t.style);l.push({state:e,rule:t.check})}{const t=await la(o.style);l.push({state:t})}const h=await la(o.style),u=new Map,c=new dr({source:r,style:t=>{var e;const i=u.get(t.getId()),n=h.dims;var o,r;if(i&&n)return new Rn({fill:new xn({color:null===(o=n.color)||void 0===o?void 0:o.get(i)}),stroke:new wn({color:h.base.color,width:null!==(r=h.base.lineWidth)&&void 0!==r?r:1})});const s="Point"===(null===(e=t.getGeometry())||void 0===e?void 0:e.getType());for(const e of l)if(!e.rule||pu(e.rule,t)){if(e.state.fields){const i=Object.assign({},e.state.base),{text:n}=e.state.fields;return n&&(i.text=`${t.get(n)}`),s?e.state.maker(i):ea(i)}return s?(e.point||(e.point=e.state.maker(e.state.base)),e.point):(e.poly||(e.poly=ea(e.state.base)),e.poly)}}});return{init:()=>c,update:t=>{const e=t.series[0];if(e){const t=(0,Ts.PI)(e,o.idField);t&&(u.clear(),t.values.toArray().forEach(((t,e)=>u.set(t,e)))),h.dims=Ol(e,h,n,o.dataStyle)}c.changed()},registerOptionsUI:t=>{var e;const i=s.pipe((0,xu.P)(),(0,wu.U)((t=>fu(t))));t.addSelect({path:"config.src",name:"GeoJSON URL",settings:{options:null!==(e=Il())&&void 0!==e?e:[],allowCustomValue:!0},defaultValue:Ic.src}).addFieldNamePicker({path:"config.idField",name:"ID Field"}).addCustomEditor({id:"config.dataStyle",path:"config.dataStyle",name:"Data style",editor:ha,settings:{displayRotation:!1},defaultValue:Ic.dataStyle}).addCustomEditor({id:"config.style",path:"config.style",name:"Default style",description:"The style to apply when no rules above match",editor:ha,settings:{simpleFixedValues:!0,layerInfo:i},defaultValue:Ic.style})}}},defaultOptions:Ic}),Mc=[Dl,gc,vc,Su,Lc,Pc,bc],Fc={type:"default",name:"",config:{}},Ac={id:Fc.type,name:"Default base layer",isBaseMap:!0,create:(t,e,i,n)=>{var o;const r=null===Xe.vc||void 0===Xe.vc||null===(o=Xe.vc.geomapDefaultBaseLayerConfig)||void 0===o?void 0:o.type;if(r){const e=kc.getIfExists(r);if(!e)throw new Error("Invalid basemap configuration on server");return e.create(t,Xe.vc.geomapDefaultBaseLayerConfig,i,n)}return Yh.create(t,e,i,n)}},kc=new Zs.B((()=>[Ac,...ru,...Mc]));function Dc(t,e){const i={options:[],current:[]},n=[];for(const o of t){const t={label:o.name,value:o.id,description:o.description};if(o.state===jl.BV.alpha){if(!Xe.Oh)continue;t.label=`${o.name} (Alpha)`,t.icon="bolt",n.push(t)}else i.options.push(t);o.id===e&&i.current.push(t)}for(const t of n)i.options.push(t);return i}function jc(t,e){return Dc(t?[Ac,...ru]:[...Mc,...ru],e)}var zc=i(34246),Bc=i(95466);const Nc=(t,e,i)=>{if(t.update){let n=i;if(e.filterData){const t=(0,Bc.b9)(e.filterData);n=Object.assign({},n,{series:n.series.filter(t)})}t.update(n)}};async function Gc(t,e,i,n){var o,s;!n||null!==(o=i)&&void 0!==o&&o.type&&!r.v.geomapDisableCustomBaseLayer||(i=Fc),null!==(s=i)&&void 0!==s&&s.type||(i={type:Al,name:Ml(t),config:{}});const a=kc.getIfExists(i.type);if(!a)return Promise.reject("unknown layer: "+i.type);const l=await a.create(e,i,t.props.eventBus,r.v.theme2),h=l.init();null!=i.opacity&&h.setOpacity(i.opacity),i.name||(i.name=Ml(t));const u=i.name,c={isBasemap:n,options:i,layer:h,handler:l,mouseEvents:new zc.x,getName:()=>u,onChange:e=>{!async function(t,e,i){var n;if(!t.map)return!1;const o=t.byName.get(e);if(!o)return!1;let r=-1;const s=null===(n=t.map)||void 0===n?void 0:n.getLayers();for(let t=0;t<(null==s?void 0:s.getLength());t++)if(s.item(t)===o.layer){r=t;break}if(i.name!==e){if(i.name){if(t.byName.has(i.name))return!1}else i.name=e;t.byName.delete(e),e=i.name,t.byName.set(e,o)}o.options.type,i.type;const a=t.layers.slice(0);try{var l,h,u;const e=await Gc(t,t.map,i,o.isBasemap);null===(l=a[r])||void 0===l||null===(h=(u=l.handler).dispose)||void 0===h||h.call(u),a[r]=e,s.setAt(r,e.layer),Nc(e.handler,i,t.props.data)}catch(t){return console.warn("ERROR",t),!1}t.setState({legends:[]}),t.layers=a,t.doOptionsUpdate(r)}(t,u,e)}};return t.byName.set(u,c),c.layer.__state=c,Nc(l,i,t.props.data),c}const Wc=t=>null==t?void 0:t.__state;function Zc(t){return t.getLayers().getArray().filter((t=>t instanceof dr)).map((t=>{var e;return t instanceof dr&&null!==(e=t.getSource().getExtent())&&void 0!==e?e:[]}))}const Uc=(t,e)=>{if(e.state.measureMenuActive)return!0;if(!e.map||e.state.ttipOpen)return!1;const i=t.originalEvent,n=e.map.getEventPixel(i),o=(0,g.bU)(e.map.getCoordinateFromPixel(n)),{hoverPayload:r}=e;r.pageX=i.pageX,r.pageY=i.pageY,r.point={lat:o[1],lon:o[0]},r.data=void 0,r.columnIndex=void 0,r.rowIndex=void 0,r.layers=void 0;const s=[],a=new Map;let l={};e.map.forEachFeatureAtPixel(n,((t,e,i)=>{const n=Wc(e);if(!r.data){const e=t.getProperties(),i=e.frame;i&&(r.data=l.data=i,r.rowIndex=l.rowIndex=e.rowIndex),null!=n&&n.mouseEvents&&n.mouseEvents.next(t)}if(n){let e=a.get(n);e||(e={layer:n,features:[]},a.set(n,e),s.push(e)),e.features.push(t)}}),{layerFilter:t=>{var e;const i=Wc(t);return!1!==(null==i||null===(e=i.options)||void 0===e?void 0:e.tooltip)}}),e.hoverPayload.layers=s.length?s:void 0,e.props.eventBus.publish(e.hoverEvent),e.setState({ttip:Object.assign({},r)}),s.length||e.layers.forEach((t=>{t.mouseEvents.next(void 0)}));const h=Boolean(s.length);return e.mapDiv.style.cursor=h?"pointer":"auto",h};function Vc(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}let Xc;class Yc extends n.Component{constructor(t){var e,i;super(t),Vc(this,"panelContext",void 0),Vc(this,"subs",new ue.w0),Vc(this,"globalCSS",(e=r.v.theme2,l.css`
    .ol-scale-line {
      background: ${e.colors.border.weak}; // rgba(0,60,136,0.3);
    }
    .ol-scale-line-inner {
      border: 1px solid ${e.colors.text.primary}; // #eee;
      border-top: 0px;
      color: ${e.colors.text.primary}; //  #eee;
    }
    .ol-control {
      background-color: ${e.colors.background.primary}; //rgba(255,255,255,0.4);
    }
    .ol-control:hover {
      background-color: ${e.colors.background.secondary}; // rgba(255,255,255,0.6);
    }
    .ol-control button {
      color: ${e.colors.secondary.text}; // white;
      background-color: ${e.colors.secondary.main}; // rgba(0,60,136,0.5);
    }
    .ol-control button:hover {
      background-color: ${e.colors.secondary.shade}; // rgba(0,60,136,0.5);
    }
    .ol-control button:focus {
      background-color: ${e.colors.secondary.main}; // rgba(0,60,136,0.5);
    }
    .ol-attribution ul {
      color: ${e.colors.text.primary}; //  #000;
      text-shadow: none;
    }
    .ol-attribution:not(.ol-collapsed) {
      background-color: ${e.colors.background.secondary}; // rgba(255,255,255,0.8);
    }
  `)),Vc(this,"mouseWheelZoom",void 0),Vc(this,"style",Kc(r.v.theme)),Vc(this,"hoverPayload",{point:{},pageX:-1,pageY:-1}),Vc(this,"hoverEvent",new ce.es(this.hoverPayload)),Vc(this,"map",void 0),Vc(this,"mapDiv",void 0),Vc(this,"layers",[]),Vc(this,"byName",new Map),Vc(this,"actions",(i=this,{selectLayer:t=>{const e=i.layers.findIndex((e=>e.options.name===t));i.panelContext&&i.panelContext.onInstanceStateChange&&i.panelContext.onInstanceStateChange({map:i.map,layers:i.layers,selected:e,actions:i.actions})},canRename:t=>!i.byName.has(t),deleteLayer:t=>{const e=[];for(const o of i.layers){var n;o.options.name===t?null===(n=i.map)||void 0===n||n.removeLayer(o.layer):e.push(o)}i.layers=e,i.doOptionsUpdate(0)},addlayer:t=>{const e=kc.getIfExists(t);e&&Gc(i,i.map,{type:e.id,name:Ml(i),config:(0,Se.cloneDeep)(e.defaultOptions),location:e.showLocation?{mode:ps.q.Auto}:void 0,tooltip:!0},!1).then((t=>{var e;i.layers=i.layers.slice(0),i.layers.push(t),null===(e=i.map)||void 0===e||e.addLayer(t.layer),i.doOptionsUpdate(i.layers.length-1)}))},reorder:(t,e)=>{var n;const o=Array.from(i.layers),[r]=o.splice(t,1);o.splice(e,0,r),i.layers=o,i.doOptionsUpdate(e);const s=null===(n=i.map)||void 0===n?void 0:n.getLayers();s.clear(),i.layers.forEach((t=>s.push(t.layer)))}})),Vc(this,"initMapRef",(async t=>{var e;if(this.mapDiv=t,this.map&&this.map.dispose(),!t)return void(this.map=void 0);const{options:i}=this.props,n=((t,e,i)=>{const[n]=t.initMapView(e.view,void 0);return t.map=new Tl({view:n,pixelRatio:1,layers:[],controls:[],target:i,interactions:Sl({mouseWheelZoom:!1})})})(this,i,t);this.byName.clear();const o=[];try{var r;o.push(await Gc(this,n,null!==(r=i.basemap)&&void 0!==r?r:Fc,!0)),i.layers||(i.layers=[kl]);for(const t of i.layers)o.push(await Gc(this,n,t,!1))}catch(t){console.error("error loading layers",t)}for(const t of o)n.addLayer(t.layer);this.layers=o,this.map=n,this.initViewExtent(n.getView(),i.view),this.mouseWheelZoom=new he,null===(e=this.map)||void 0===e||e.addInteraction(this.mouseWheelZoom),((t,e)=>{t.initControls(e.controls),t.forceUpdate()})(this,i),(t=>{var e,i,n;null===(e=t.map)||void 0===e||e.on("singleclick",t.pointerClickListener),null===(i=t.map)||void 0===i||i.on("pointermove",t.pointerMoveListener),null===(n=t.map)||void 0===n||n.getViewport().addEventListener("mouseout",(e=>{t.props.eventBus.publish(new ce.xH)}))})(this),Ll(this,o,o.length-1),this.setState({legends:this.getLegends()})})),Vc(this,"clearTooltip",(()=>{this.state.ttip&&!this.state.ttipOpen&&this.tooltipPopupClosed()})),Vc(this,"tooltipPopupClosed",(()=>{this.setState({ttipOpen:!1,ttip:void 0})})),Vc(this,"pointerClickListener",(t=>{((t,e)=>{Uc(t,e)&&(t.preventDefault(),t.stopPropagation(),e.mapDiv.style.cursor="auto",e.setState({ttipOpen:!0}))})(t,this)})),Vc(this,"pointerMoveListener",(t=>{Uc(t,this)})),Vc(this,"initMapView",((t,e)=>{let i=new N({center:[0,0],zoom:1,showFullExtent:!0});return t.shared&&(e?i=e:e=i),this.initViewExtent(i,t),[e,i]})),this.state={ttipOpen:!1,legends:[]},this.subs.add(this.props.eventBus.subscribe(fe.Yr,(t=>{this.mapDiv&&this.props.id===t.payload&&this.initMapRef(this.mapDiv)})))}componentDidMount(){this.panelContext=this.context}componentWillUnmount(){this.subs.unsubscribe();for(const i of this.layers){var t,e;null===(t=(e=i.handler).dispose)||void 0===t||t.call(e)}}shouldComponentUpdate(t){return!this.map||(this.props.height===t.height&&this.props.width===t.width||this.map.updateSize(),this.props.data!==t.data&&this.dataChanged(t.data),this.props.options!==t.options&&this.optionsChanged(t.options),!0)}componentDidUpdate(t){!this.map||this.props.height===t.height&&this.props.width===t.width||this.map.updateSize(),this.map&&this.props.data!==t.data&&this.dataChanged(this.props.data)}doOptionsUpdate(t){var e;const{options:i,onOptionsChange:n}=this.props,o=this.layers;null===(e=this.map)||void 0===e||e.getLayers().forEach((t=>{var e,i;t instanceof hs&&(null===(e=this.map)||void 0===e||e.removeLayer(t),null===(i=this.map)||void 0===i||i.addLayer(t))})),n(Object.assign({},i,{basemap:o[0].options,layers:o.slice(1).map((t=>t.options))})),Ll(this,o,t),this.setState({legends:this.getLegends()})}optionsChanged(t){const e=this.props.options;if(t.view!==e.view){const[e,i]=this.initMapView(t.view,Xc);Xc=e,this.map&&i&&this.map.setView(i)}var i;t.controls!==e.controls&&this.initControls(null!==(i=t.controls)&&void 0!==i?i:{showZoom:!0,showAttribution:!0})}dataChanged(t){if(t===this.props.data)for(const t of this.layers)Nc(t.handler,t.options,this.props.data);const e=lu.getIfExists(this.props.options.view.id);if(e&&e.id===au.Fit){const[,t]=this.initMapView(this.props.options.view);this.map&&t&&this.map.setView(t)}}initViewExtent(t,e){const i=lu.getIfExists(e.id);if(i){let u;var n,o,r,s;if(null==i.lat){if(i.id===au.Coordinates)u=[null!==(n=e.lon)&&void 0!==n?n:0,null!==(o=e.lat)&&void 0!==o?o:0];else if(i.id===au.Fit){const i=function(){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).filter((t=>t.layer instanceof dr||t.layer instanceof wa)).flatMap((n=>{const o=n.layer;if(o instanceof wa)return Zc(o);if(o instanceof dr){var r,s;if(t)return null!==(r=[o.getSource().getExtent()])&&void 0!==r?r:[];if(e&&i===n.options.name){const t=o.getSource().getFeatures(),e=t[t.length-1],i=null==e?void 0:e.getGeometry();var a;return i&&null!==(a=[i.getExtent()])&&void 0!==a?a:[]}return e||i!==n.options.name?[]:null!==(s=[o.getSource().getExtent()])&&void 0!==s?s:[]}return[]})).reduce(C.l7,(0,C.lJ)())}(this.layers,e.allLayers,e.lastOnly,e.layer);if(!(0,C.xb)(i)){var a,l,h;const n=null!==(a=e.padding)&&void 0!==a?a:5,o=t.getResolutionForExtent(i,null===(l=this.map)||void 0===l?void 0:l.getSize()),r=null!==(h=e.zoom)&&void 0!==h?h:e.maxZoom;t.fit(i,{maxZoom:r}),t.setResolution(o*(n/100+1));const s=t.getZoom();s&&r&&s>r&&t.setZoom(r)}}}else u=[null!==(r=i.lon)&&void 0!==r?r:0,null!==(s=i.lat)&&void 0!==s?s:0];u&&t.setCenter((0,g.mi)(u))}e.maxZoom&&t.setMaxZoom(e.maxZoom),e.minZoom&&t.setMaxZoom(e.minZoom),e.zoom&&(null==i?void 0:i.id)!==au.Fit&&t.setZoom(e.zoom)}initControls(t){if(!this.map)return;this.map.getControls().clear(),t.showZoom&&this.map.addControl(new Ut),t.showScale&&this.map.addControl(new Wt({units:t.scaleUnits,minWidth:100})),this.mouseWheelZoom.setActive(Boolean(t.mouseWheelZoom)),t.showAttribution&&this.map.addControl(new Lt({collapsed:!0,collapsible:!0}));let e=[];t.showMeasure&&(e=[(0,_e.jsx)(us,{map:this.map,menuActiveState:t=>{this.setState({ttipOpen:t,measureMenuActive:t})}},"measure")]);let i=[];t.showDebug&&(i=[(0,_e.jsx)(Ke,{map:this.map},"debug")]),this.setState({topRight1:e,topRight2:i})}getLegends(){const t=[];for(const e of this.layers)e.handler.legend&&t.push((0,_e.jsx)("div",{children:e.handler.legend},e.options.name));return t}render(){var t;let{ttip:e,ttipOpen:i,topRight1:n,legends:o,topRight2:r}=this.state;const{options:s}=this.props,a=s.controls.showScale;return i||(null===(t=s.tooltip)||void 0===t?void 0:t.mode)!==hu.None||(e=void 0),(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(l.Global,{styles:this.globalCSS}),(0,_e.jsxs)("div",{className:this.style.wrap,onMouseLeave:this.clearTooltip,children:[(0,_e.jsx)("div",{className:this.style.map,ref:this.initMapRef}),(0,_e.jsx)(ve,{bottomLeft:o,topRight1:n,topRight2:r,blStyle:{bottom:a?"35px":"8px"}})]}),(0,_e.jsx)(Ne,{ttip:e,isOpen:i,onClose:this.tooltipPopupClosed})]})}}Vc(Yc,"contextType",pe.bb);const Kc=(0,de.B)((t=>({wrap:a.css`
    position: relative;
    width: 100%;
    height: 100%;
  `,map:a.css`
    position: absolute;
    z-index: 0;
    width: 100%;
    height: 100%;
  `})));var Hc=i(34725),qc=i(56618),$c=i(39756),Jc=i(14722);const Qc=t=>{let{layers:e,getLayerInfo:i,onDragEnd:n,onSelect:o,onDelete:s,onDuplicate:l,showActions:h,selection:u,excludeBaseLayer:c,onNameChange:p,verifyLayerNameUniqueness:d}=t;const f=tp(r.v.theme),g=t=>t?`${f.row} ${f.sel}`:f.row;return(0,_e.jsx)(qc.Z5,{onDragEnd:n,children:(0,_e.jsx)(qc.bK,{droppableId:"droppable",children:(t,n)=>(0,_e.jsxs)("div",Object.assign({},t.droppableProps,{ref:t.innerRef,"data-testid":"layer-drag-drop-list",children:[(()=>{const t=[],n=c?1:0,r=c?2:1;for(let c=e.length-1;c>=n;c--){const n=e[c],_=n.getName(),v=Boolean(null==u?void 0:u.includes(_));t.push((0,_e.jsx)(qc._l,{draggableId:_,index:t.length,children:(t,u)=>(0,_e.jsxs)("div",Object.assign({className:g(v),ref:t.innerRef},t.draggableProps,t.dragHandleProps,{onMouseDown:()=>o(n),children:[(0,_e.jsx)(Jc.X,{name:_,onChange:t=>p(n,t),verifyLayerNameUniqueness:null!=d?d:void 0}),(0,_e.jsxs)("div",{className:f.textWrapper,children:["  ",i(n)]}),h(n)&&(0,_e.jsxs)(_e.Fragment,{children:[l?(0,_e.jsx)(Qe.h,{name:"copy",title:"Duplicate",ariaLabel:"Duplicate button",className:f.actionIcon,onClick:()=>l(n)}):null,(0,_e.jsx)(Qe.h,{name:"trash-alt",title:"remove",ariaLabel:"Remove button",className:(0,a.cx)(f.actionIcon,f.dragIcon),onClick:()=>s(n)})]}),e.length>r&&(0,_e.jsx)($c.J,{"aria-label":"Drag and drop icon",title:"Drag and drop to reorder",name:"draggabledots",size:"lg",className:f.dragIcon})]}))},_))}return t})(),t.placeholder]}))})})};Qc.defaultProps={isGroup:()=>!1};const tp=(0,de.B)((t=>({wrapper:a.css`
    margin-bottom: ${t.spacing.md};
  `,row:a.css`
    padding: ${t.spacing.xs} ${t.spacing.sm};
    border-radius: ${t.border.radius.sm};
    background: ${t.colors.bg2};
    min-height: ${t.spacing.formInputHeight}px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
    cursor: pointer;

    border: 1px solid ${t.colors.formInputBorder};
    &:hover {
      border: 1px solid ${t.colors.formInputBorderHover};
    }
  `,sel:a.css`
    border: 1px solid ${t.colors.formInputBorderActive};
    &:hover {
      border: 1px solid ${t.colors.formInputBorderActive};
    }
  `,dragIcon:a.css`
    cursor: drag;
  `,actionIcon:a.css`
    color: ${t.colors.textWeak};
    &:hover {
      color: ${t.colors.text};
    }
  `,typeWrapper:a.css`
    color: ${t.colors.textBlue};
    margin-right: 5px;
  `,textWrapper:a.css`
    display: flex;
    align-items: center;
    flex-grow: 1;
    overflow: hidden;
    margin-right: ${t.spacing.sm};
  `})));var ep,ip;const np=t=>{var e,i;const{layers:n,selected:o,actions:r}=null!==(e=t.context.instanceState)&&void 0!==e?e:{};if(!n||!r)return ep||(ep=(0,_e.jsx)("div",{children:"No layers?"}));const s=o?[null===(i=n[o])||void 0===i?void 0:i.getName()]:[];return(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(js.W2,{children:(0,_e.jsx)(Hc.f,{onChange:t=>r.addlayer(t.value),options:jc(!1).options,label:"Add layer"})}),ip||(ip=(0,_e.jsx)("br",{})),(0,_e.jsx)(Qc,{layers:n,showActions:()=>n.length>2,getLayerInfo:t=>t.options.type,onDragEnd:e=>{var i;if(!e.destination)return;const{layers:n,actions:o}=null!==(i=t.context.instanceState)&&void 0!==i?i:{};if(!n||!o)return;const r=n.length-1,s=-1*(e.source.index-r),a=-1*(e.destination.index-r);o.reorder(s,a)},onSelect:t=>{r.selectLayer(t.options.name)},onDelete:t=>{r.deleteLayer(t.options.name)},selection:s,excludeBaseLayer:!0,onNameChange:(t,e)=>{t.onChange(Object.assign({},t.options,{name:e}))},verifyLayerNameUniqueness:r.canRename})]})},op=t=>{let{labelWidth:e,value:i,onChange:n}=t;return(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(Ms.Z,{children:(0,_e.jsx)(Fs._,{label:"Latitude",labelWidth:e,grow:!0,children:(0,_e.jsx)(du.Y,{value:i.lat,min:-90,max:90,step:.001,onChange:t=>{n(Object.assign({},i,{lat:t}))}})})}),(0,_e.jsx)(Ms.Z,{children:(0,_e.jsx)(Fs._,{label:"Longitude",labelWidth:e,grow:!0,children:(0,_e.jsx)(du.Y,{value:i.lon,min:-180,max:180,step:.001,onChange:t=>{n(Object.assign({},i,{lon:t}))}})})})]})};var rp,sp;!function(t){t.all="all",t.layer="layer",t.last="last"}(rp||(rp={})),function(t){t.all="All layers",t.layer="Layer",t.last="Last value"}(sp||(sp={}));const ap=Object.values(rp).map((t=>({label:sp[t],value:t}))),lp=t=>{var e,i,o;let{labelWidth:r,value:s,onChange:a,context:l}=t;const h=(0,n.useMemo)((()=>{var t;return null!==(t=l.options)&&void 0!==t&&t.layers?l.options.layers.map((t=>({label:t.name,value:t.name,description:void 0}))):[]}),[null===(e=l.options)||void 0===e?void 0:e.layers]),u=(0,n.useCallback)((t=>{a(Object.assign({},s,{layer:t.value}))}),[s,a]),c=(0,_e.jsx)(Ms.Z,{children:(0,_e.jsx)(Fs._,{label:"Layer",labelWidth:r,grow:!0,children:(0,_e.jsx)(Je.Ph,{options:h,onChange:u,placeholder:null===(i=h[0])||void 0===i?void 0:i.label})})}),p=(0,_e.jsx)(Ms.Z,{children:(0,_e.jsx)(Fs._,{label:"Padding",labelWidth:r,grow:!0,tooltip:"sets padding in relative percent beyond data extent",children:(0,_e.jsx)(du.Y,{value:null!==(o=null==s?void 0:s.padding)&&void 0!==o?o:5,min:0,step:1,onChange:t=>{a(Object.assign({},s,{padding:t}))}})})}),d=s.allLayers?rp.all:!s.allLayers&&s.lastOnly?rp.last:rp.layer;return(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(Ms.Z,{children:(0,_e.jsx)(Fs._,{label:"Data",labelWidth:r,grow:!0,children:(0,_e.jsx)(qe.S,{value:d,options:ap,onChange:t=>{t===rp.all||s.layer?a(Object.assign({},s,{allLayers:t===String(rp.all),lastOnly:t===String(rp.last)})):a(Object.assign({},s,{allLayers:t===String(rp.all),lastOnly:t===String(rp.last),layer:h[0].value}))}})})}),!(null!=s&&s.allLayers)&&c,!(null!=s&&s.lastOnly)&&p]})};var hp;const up=t=>{var e;let{value:i,onChange:o,context:r}=t;const s=(0,n.useMemo)((()=>{const t=[];return null!=i&&i.id?t.push(i.id):t.push(lu.list()[0].id),lu.selectOptions(t)}),[null==i?void 0:i.id]),a=(0,n.useCallback)((()=>{var t;const e=null===(t=r.instanceState)||void 0===t?void 0:t.map;if(e){const t=e.getView(),n=t.getCenter();if(n){const e=(0,g.bU)(n,t.getProjection());o(Object.assign({},i,{id:au.Coordinates,lon:+e[0].toFixed(6),lat:+e[1].toFixed(6),zoom:+t.getZoom().toFixed(2)}))}}}),[i,o,r.instanceState]),l=(0,n.useCallback)((t=>{const e=lu.getIfExists(t.value);var n,r,s;e&&o(Object.assign({},i,{id:e.id,lat:null!==(n=e.lat)&&void 0!==n?n:null==i?void 0:i.lat,lon:null!==(r=e.lon)&&void 0!==r?r:null==i?void 0:i.lon,zoom:null!==(s=e.zoom)&&void 0!==s?s:null==i?void 0:i.zoom}))}),[i,o]);return(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(Ms.Z,{children:(0,_e.jsx)(Fs._,{label:"View",labelWidth:10,grow:!0,children:(0,_e.jsx)(Je.Ph,{options:s.options,value:s.current,onChange:l})})}),i.id===au.Coordinates&&(0,_e.jsx)(op,{labelWidth:10,value:i,onChange:o}),i.id===au.Fit&&(0,_e.jsx)(lp,{labelWidth:10,value:i,onChange:o,context:r}),(0,_e.jsx)(Ms.Z,{children:(0,_e.jsx)(Fs._,{label:(null==i?void 0:i.id)===au.Fit?"Max Zoom":"Zoom",labelWidth:10,grow:!0,children:(0,_e.jsx)(du.Y,{value:null!==(e=null==i?void 0:i.zoom)&&void 0!==e?e:1,min:1,max:18,step:.01,onChange:t=>{o(Object.assign({},i,{zoom:t}))}})})}),(0,_e.jsx)(js.wc,{children:(0,_e.jsx)($e.zx,{variant:"secondary",size:"sm",fullWidth:!0,onClick:a,children:hp||(hp=(0,_e.jsx)("span",{children:"Use current map settings"}))})})]})};var cp=i(47566),pp=i(82150),dp=i(40840);const fp=t=>{let{value:e,context:i,onChange:o,item:r}=t;const s=(0,n.useMemo)((()=>i.data.map((t=>({value:t.refId,label:`Query: ${t.refId} (size: ${t.length})`,description:t.fields.map((t=>(0,Te.C)(t))).join(", ")})))),[i.data]),[a,l]=(0,n.useState)({refIds:[],value:void 0}),h=(0,n.useMemo)((()=>{var t;return null!==(t=s.find((t=>t.value===(null==e?void 0:e.options))))&&void 0!==t?t:((t,e,i)=>{if(!i)return;return t.find((t=>!e.some((e=>t===e))))||void 0})(s,a.refIds,a.value)}),[e,s,a]),u=(0,n.useCallback)((t=>{o(null!=t&&t.value?{id:dp.E4.byRefId,options:t.value}:void 0)}),[o]);return s===a.refIds&&(null==h?void 0:h.value)===a.value||l({refIds:s,value:null==h?void 0:h.value}),(0,_e.jsx)(Je.Ph,{options:s,onChange:u,isClearable:!0,placeholder:"Change filter",value:h})};function gp(t){return{category:t.category,path:"--",defaultValue:t.basemaps?Fc:kl,values:e=>({getContext:e=>Object.assign({},e,{options:t.state.options,instanceState:t.state}),getValue:e=>(0,Se.get)(t.state.options,e),onChange:(e,i)=>{const{state:n}=t,{options:o}=n;if("type"===e&&i){const t=kc.getIfExists(i);if(t){const e=Object.assign({},o,{type:t.id,config:Object.assign({},t.defaultOptions)});var r;if(t.showLocation)null!==(r=e.location)&&void 0!==r&&r.mode?delete e.location:e.location={mode:ps.q.Auto};return void n.onChange(e)}}n.onChange((0,cp.hs)(o,e,i))}}),build:(e,i)=>{if(!t.state)return;const{handler:n,options:o}=t.state,r=kc.getIfExists(null==o?void 0:o.type),s=jc(t.basemaps,null!=o&&o.type?o.type:Fc.type);e.addSelect({path:"type",name:"Layer type",settings:{options:s.options}}),n.update&&e.addCustomEditor({id:"filterData",path:"filterData",name:"Data",editor:fp,defaultValue:void 0}),r&&o.type!==Fc.type&&(r.showLocation&&(0,pp.C)("Location","location.",e,o.location),n.registerOptionsUI&&n.registerOptionsUI(e),(0,Se.isEqual)(t.category,["Base layer"])||(r.hideOpacity||e.addSliderInput({path:"opacity",name:"Opacity",defaultValue:1,settings:{min:0,max:1,step:.1}}),e.addBooleanSwitch({path:"tooltip",name:"Display tooltip",description:"Show the tooltip for layer",defaultValue:!0})))}}}var _p=i(50049);function vp(t){const e=+t;return isNaN(e)?void 0:e}var yp;const mp=new o.c(Yc).setNoPadding().setPanelChangeHandler(((t,e,i,n)=>{if("grafana-worldmap-panel"===e&&i.angular){const{fieldConfig:e,options:o}=function(t){const e={defaults:{},overrides:[]},i={view:{id:au.Zero},controls:{showZoom:!0,mouseWheelZoom:Boolean(t.mouseWheelZoom)},basemap:{type:"default",name:"Basemap"},layers:[],tooltip:{mode:hu.Details}};let n=vp(t.decimals);n&&(e.defaults.decimals=n);if(t.thresholds&&t.colors){const i=t.thresholds.split(",").map((t=>Number(t.trim()))),n=[];for(const e of t.colors){const t=n.length-1;t>=0?n.push({value:i[t],color:e}):n.push({value:-1/0,color:e})}e.defaults.thresholds={mode:_p.H.Absolute,steps:n}}n=vp(t.initialZoom),n&&(i.view.zoom=n);const o={"(0°, 0°)":au.Zero,"North America":"north-america",Europe:"europe","West Asia":"west-asia","SE Asia":"se-asia","Last GeoHash":au.Coordinates};return i.view.id=o[t.mapCenter],i.view.lat=vp(t.mapCenterLatitude),i.view.lon=vp(t.mapCenterLongitude),{fieldConfig:e,options:i}}(Object.assign({},i.angular,{fieldConfig:n}));return t.fieldConfig=e,o}return{}})).setMigrationHandler((t=>{var e;const i=null!==(e=null==t?void 0:t.pluginVersion)&&void 0!==e?e:"";if(i.startsWith("8.1")||i.startsWith("8.2")){var n;const e=null===(n=t.options)||void 0===n?void 0:n.layers;if(1===(null==e?void 0:e.length)){const e=t.options.layers[0];if("markers"===(null==e?void 0:e.type)&&e.config){const i=e.config,n={style:(0,Se.cloneDeep)(Is),showLegend:Boolean(i.showLegend)};i.size&&(n.style.size=i.size),i.color&&(n.style.color=i.color),i.fillOpacity&&(n.style.opacity=i.fillOpacity);const o=function(t){var e;const i=ra.getIfExists(t);if(null!=i&&null!==(e=i.aliasIds)&&void 0!==e&&e.length)return i.aliasIds[0]}(i.shape);return o&&(n.style.symbol={fixed:o,mode:Ts.Q8.Fixed}),Object.assign({},t.options,{layers:[Object.assign({},e,{config:n})]})}}}return t.options})).useFieldConfig({useCustomConfig:t=>{s.B(t)}}).setPanelOptions(((t,e)=>{let i=["Map view"];t.addCustomEditor({category:i,id:"view",path:"view",name:"Initial view",description:"This location will show when the panel first loads.",editor:up,defaultValue:uu}),t.addBooleanSwitch({category:i,path:"view.shared",description:"Use the same view across multiple panels.  Note: this may require a dashboard reload.",name:"Share view",defaultValue:uu.shared});const n=e.instanceState;if(null!=n&&n.layers){const e=["Map layers"],i=["Basemap layer"];t.addCustomEditor({category:e,id:"layers",path:"",name:"",editor:np});const o=n.layers[n.selected];n.selected&&o&&t.addNestedOptions(gp({state:o,category:e,basemaps:!1}));const s=n.layers[0];r.v.geomapDisableCustomBaseLayer?t.addCustomEditor({category:i,id:"layers",path:"",name:"",editor:()=>yp||(yp=(0,_e.jsx)("div",{children:"The basemap layer is configured by the server admin."}))}):s&&t.addNestedOptions(gp({state:s,category:i,basemaps:!0}))}else;i=["Map controls"],t.addBooleanSwitch({category:i,path:"controls.showZoom",description:"Show zoom control buttons in the upper left corner",name:"Show zoom control",defaultValue:!0}).addBooleanSwitch({category:i,path:"controls.mouseWheelZoom",description:"Enable zoom control via mouse wheel",name:"Mouse wheel zoom",defaultValue:!0}).addBooleanSwitch({category:i,path:"controls.showAttribution",name:"Show attribution",description:"Show the map source attribution info in the lower right",defaultValue:!0}).addBooleanSwitch({category:i,path:"controls.showScale",name:"Show scale",description:"Indicate map scale",defaultValue:!1}).addBooleanSwitch({category:i,path:"controls.showMeasure",name:"Show measure tools",description:"Show tools for making measurements on the map",defaultValue:!1}).addBooleanSwitch({category:i,path:"controls.showDebug",name:"Show debug",description:"Show map info",defaultValue:!1}).addRadio({category:i,path:"tooltip.mode",name:"Tooltip",defaultValue:hu.Details,settings:{options:[{label:"None",value:hu.None,description:"Show contents on click, not hover"},{label:"Details",value:hu.Details,description:"Show popup on hover"}]}})}))},93163:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i="",n=void 0!==e[5];return e[4]&&(i+="@supports (".concat(e[4],") {")),e[2]&&(i+="@media ".concat(e[2]," {")),n&&(i+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),i+=t(e),n&&(i+="}"),e[2]&&(i+="}"),e[4]&&(i+="}"),i})).join("")},e.i=function(t,i,n,o,r){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(n)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var h=0;h<t.length;h++){var u=[].concat(t[h]);n&&s[u[0]]||(void 0!==r&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=r),i&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=i):u[2]=i),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},77380:t=>{"use strict";t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},85185:t=>{"use strict";t.exports=function(t){var e=t[1],i=t[3];if(!i)return e;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(i)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),r="/*# ".concat(o," */"),s=i.sources.map((function(t){return"/*# sourceURL=".concat(i.sourceRoot||"").concat(t," */")}));return[e].concat(s).concat([r]).join("\n")}return[e].join("\n")}},81509:t=>{"use strict";var e=[];function i(t){for(var i=-1,n=0;n<e.length;n++)if(e[n].identifier===t){i=n;break}return i}function n(t,n){for(var r={},s=[],a=0;a<t.length;a++){var l=t[a],h=n.base?l[0]+n.base:l[0],u=r[h]||0,c="".concat(h," ").concat(u);r[h]=u+1;var p=i(c),d={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==p)e[p].references++,e[p].updater(d);else{var f=o(d,n);n.byIndex=a,e.splice(a,0,{identifier:c,updater:f,references:1})}s.push(c)}return s}function o(t,e){var i=e.domAPI(e);i.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;i.update(t=e)}else i.remove()}}t.exports=function(t,o){var r=n(t=t||[],o=o||{});return function(t){t=t||[];for(var s=0;s<r.length;s++){var a=i(r[s]);e[a].references--}for(var l=n(t,o),h=0;h<r.length;h++){var u=i(r[h]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}r=l}}},30480:t=>{"use strict";var e={};t.exports=function(t,i){var n=function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}e[t]=i}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(i)}},21982:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},5936:(t,e,i)=>{"use strict";t.exports=function(t){var e=i.nc;e&&t.setAttribute("nonce",e)}},80405:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(i){!function(t,e,i){var n="";i.supports&&(n+="@supports (".concat(i.supports,") {")),i.media&&(n+="@media ".concat(i.media," {"));var o=void 0!==i.layer;o&&(n+="@layer".concat(i.layer.length>0?" ".concat(i.layer):""," {")),n+=i.css,o&&(n+="}"),i.media&&(n+="}"),i.supports&&(n+="}");var r=i.sourceMap;r&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleTagTransform(n,t,e.options)}(e,t,i)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},84191:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},38085:function(t){t.exports=function(){"use strict";function t(t,n,o,r,s){!function t(i,n,o,r,s){for(;r>o;){if(r-o>600){var a=r-o+1,l=n-o+1,h=Math.log(a),u=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*u*(a-u)/a)*(l-a/2<0?-1:1);t(i,n,Math.max(o,Math.floor(n-l*u/a+c)),Math.min(r,Math.floor(n+(a-l)*u/a+c)),s)}var p=i[n],d=o,f=r;for(e(i,o,n),s(i[r],p)>0&&e(i,o,r);d<f;){for(e(i,d,f),d++,f--;s(i[d],p)<0;)d++;for(;s(i[f],p)>0;)f--}0===s(i[o],p)?e(i,o,f):e(i,++f,r),f<=n&&(o=f+1),n<=f&&(r=f-1)}}(t,n,o||0,r||t.length-1,s||i)}function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return t<e?-1:t>e?1:0}var n=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function r(t,e){s(t,0,t.children.length,e,t)}function s(t,e,i,n,o){o||(o=f(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var r=e;r<i;r++){var s=t.children[r];a(o,t.leaf?n(s):s)}return o}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function h(t,e){return t.minY-e.minY}function u(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function d(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function f(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,i,n,o,r){for(var s=[i,n];s.length;)if(!((n=s.pop())-(i=s.pop())<=o)){var a=i+Math.ceil((n-i)/o/2)*o;t(e,a,i,n,r),s.push(i,a,a,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var e=this.data,i=[];if(!d(t,e))return i;for(var n=this.toBBox,o=[];e;){for(var r=0;r<e.children.length;r++){var s=e.children[r],a=e.leaf?n(s):s;d(t,a)&&(e.leaf?i.push(s):p(t,a)?this._all(s,i):o.push(s))}e=o.pop()}return i},n.prototype.collides=function(t){var e=this.data;if(!d(t,e))return!1;for(var i=[];e;){for(var n=0;n<e.children.length;n++){var o=e.children[n],r=e.leaf?this.toBBox(o):o;if(d(t,r)){if(e.leaf||p(t,r))return!0;i.push(o)}}e=i.pop()}return!1},n.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var i=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var n=this.data;this.data=i,i=n}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},n.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},n.prototype.clear=function(){return this.data=f([]),this},n.prototype.remove=function(t,e){if(!t)return this;for(var i,n,r,s=this.data,a=this.toBBox(t),l=[],h=[];s||l.length;){if(s||(s=l.pop(),n=l[l.length-1],i=h.pop(),r=!0),s.leaf){var u=o(t,s.children,e);if(-1!==u)return s.children.splice(u,1),l.push(s),this._condense(l),this}r||s.leaf||!p(s,a)?n?(i++,s=n.children[i],r=!1):s=null:(l.push(s),h.push(i),i=0,n=s,s=s.children[0])}return this},n.prototype.toBBox=function(t){return t},n.prototype.compareMinX=function(t,e){return t.minX-e.minX},n.prototype.compareMinY=function(t,e){return t.minY-e.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(t){return this.data=t,this},n.prototype._all=function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},n.prototype._build=function(t,e,i,n){var o,s=i-e+1,a=this._maxEntries;if(s<=a)return r(o=f(t.slice(e,i+1)),this.toBBox),o;n||(n=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,n-1))),(o=f([])).leaf=!1,o.height=n;var l=Math.ceil(s/a),h=l*Math.ceil(Math.sqrt(a));g(t,e,i,h,this.compareMinX);for(var u=e;u<=i;u+=h){var c=Math.min(u+h-1,i);g(t,u,c,l,this.compareMinY);for(var p=u;p<=c;p+=l){var d=Math.min(p+l-1,c);o.children.push(this._build(t,p,d,n-1))}}return r(o,this.toBBox),o},n.prototype._chooseSubtree=function(t,e,i,n){for(;n.push(e),!e.leaf&&n.length-1!==i;){for(var o=1/0,r=1/0,s=void 0,a=0;a<e.children.length;a++){var l=e.children[a],h=u(l),c=(p=t,d=l,(Math.max(d.maxX,p.maxX)-Math.min(d.minX,p.minX))*(Math.max(d.maxY,p.maxY)-Math.min(d.minY,p.minY))-h);c<r?(r=c,o=h<o?h:o,s=l):c===r&&h<o&&(o=h,s=l)}e=s||e.children[0]}var p,d;return e},n.prototype._insert=function(t,e,i){var n=i?t:this.toBBox(t),o=[],r=this._chooseSubtree(n,this.data,e,o);for(r.children.push(t),a(r,n);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(n,o,e)},n.prototype._split=function(t,e){var i=t[e],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);var s=this._chooseSplitIndex(i,o,n),a=f(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,r(i,this.toBBox),r(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},n.prototype._splitRoot=function(t,e){this.data=f([t,e]),this.data.height=t.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,e,i){for(var n,o,r,a,l,h,c,p=1/0,d=1/0,f=e;f<=i-e;f++){var g=s(t,0,f,this.toBBox),_=s(t,f,i,this.toBBox),v=(o=g,r=_,a=void 0,l=void 0,h=void 0,c=void 0,a=Math.max(o.minX,r.minX),l=Math.max(o.minY,r.minY),h=Math.min(o.maxX,r.maxX),c=Math.min(o.maxY,r.maxY),Math.max(0,h-a)*Math.max(0,c-l)),y=u(g)+u(_);v<p?(p=v,n=f,d=y<d?y:d):v===p&&y<d&&(d=y,n=f)}return n||i-e},n.prototype._chooseSplitAxis=function(t,e,i){var n=t.leaf?this.compareMinX:l,o=t.leaf?this.compareMinY:h;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,o)&&t.children.sort(n)},n.prototype._allDistMargin=function(t,e,i,n){t.children.sort(n);for(var o=this.toBBox,r=s(t,0,e,o),l=s(t,i-e,i,o),h=c(r)+c(l),u=e;u<i-e;u++){var p=t.children[u];a(r,t.leaf?o(p):p),h+=c(r)}for(var d=i-e-1;d>=e;d--){var f=t.children[d];a(l,t.leaf?o(f):f),h+=c(l)}return h},n.prototype._adjustParentBBoxes=function(t,e,i){for(var n=i;n>=0;n--)a(e[n],t)},n.prototype._condense=function(t){for(var e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():r(t[e],this.toBBox)},n}()}}]);
//# sourceMappingURL=8857.19772a212a1bca9216ba.js.map