(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[898],{38576:(t,e,i)=>{"use strict";i.d(e,{f:()=>r});i(68404);var n=i(69783),o=i(45916);const r=t=>{let{onChange:e,options:i,label:r}=t;return(0,o.jsx)(n.ValuePicker,{icon:"plus",label:r,variant:"secondary",options:i,onChange:e,isFullWidth:!0})}},12641:(t,e,i)=>{"use strict";i.d(e,{E:()=>c});var n=i(36636),o=i(68404),r=i(48435),a=i(90923),s=i(69783),l=i(45916);const h=t=>{let{name:e,onChange:i,verifyLayerNameUniqueness:n}=t;const r=(0,s.useStyles)(u),[a,h]=(0,o.useState)(!1),[c,p]=(0,o.useState)(null),d=t=>{h(!1),c?p(null):e!==t&&i(t)};return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:r.wrapper,children:[!a&&(0,l.jsxs)("button",{className:r.layerNameWrapper,title:"Edit layer name",onClick:t=>{h(!0)},"data-testid":"layer-name-div",children:[(0,l.jsx)("span",{className:r.layerName,children:e}),(0,l.jsx)(s.Icon,{name:"pen",className:r.layerEditIcon,size:"sm"})]}),a&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Input,{type:"text",defaultValue:e,onBlur:t=>{d(t.currentTarget.value.trim())},autoFocus:!0,onKeyDown:t=>{"Enter"===t.key&&d(t.target.value)},onFocus:t=>{t.target.select()},invalid:null!==c,onChange:t=>{const i=t.currentTarget.value.trim();0!==i.length?!n||n(i)||i===e?c&&p(null):p("Layer name already exists"):p("An empty layer name is not allowed")},className:r.layerNameInput,"data-testid":"layer-name-input"}),c&&(0,l.jsx)(s.FieldValidationMessage,{horizontal:!0,children:c})]})]})})},u=t=>({wrapper:n.css`
      label: Wrapper;
      display: flex;
      align-items: center;
      margin-left: ${t.spacing.xs};
    `,layerNameWrapper:n.css`
      display: flex;
      cursor: pointer;
      border: 1px solid transparent;
      border-radius: ${t.border.radius.md};
      align-items: center;
      padding: 0 0 0 ${t.spacing.xs};
      margin: 0;
      background: transparent;

      &:hover {
        background: ${t.colors.bg3};
        border: 1px dashed ${t.colors.border3};
      }

      &:focus {
        border: 2px solid ${t.colors.formInputBorderActive};
      }

      &:hover,
      &:focus {
        .query-name-edit-icon {
          visibility: visible;
        }
      }
    `,layerName:n.css`
      font-weight: ${t.typography.weight.semibold};
      color: ${t.colors.textBlue};
      cursor: pointer;
      overflow: hidden;
      margin-left: ${t.spacing.xs};
    `,layerEditIcon:(0,n.cx)(n.css`
        margin-left: ${t.spacing.md};
        visibility: hidden;
      `,"query-name-edit-icon"),layerNameInput:n.css`
      max-width: 300px;
      margin: -4px 0;
    `}),c=t=>{let{layers:e,getLayerInfo:i,onDragEnd:o,onSelect:u,onDelete:c,onDuplicate:d,showActions:f,selection:g,excludeBaseLayer:_,onNameChange:v,verifyLayerNameUniqueness:y}=t;const m=p(a.config.theme),x=t=>t?`${m.row} ${m.sel}`:m.row;return(0,l.jsx)(r.Z5,{onDragEnd:o,children:(0,l.jsx)(r.bK,{droppableId:"droppable",children:(t,o)=>(0,l.jsxs)("div",Object.assign({},t.droppableProps,{ref:t.innerRef,children:[(()=>{const t=[],o=_?1:0,a=_?2:1;for(let p=e.length-1;p>=o;p--){const o=e[p],_=o.getName(),b=Boolean(null==g?void 0:g.includes(_));t.push((0,l.jsx)(r._l,{draggableId:_,index:t.length,children:(t,r)=>(0,l.jsxs)("div",Object.assign({className:x(b),ref:t.innerRef},t.draggableProps,t.dragHandleProps,{onMouseDown:()=>u(o),children:[(0,l.jsx)(h,{name:_,onChange:t=>v(o,t),verifyLayerNameUniqueness:null!=y?y:void 0}),(0,l.jsxs)("div",{className:m.textWrapper,children:["  ",i(o)]}),f(o)&&(0,l.jsxs)(l.Fragment,{children:[d?(0,l.jsx)(s.IconButton,{name:"copy",title:"Duplicate",className:m.actionIcon,onClick:()=>d(o)}):null,(0,l.jsx)(s.IconButton,{name:"trash-alt",title:"remove",className:(0,n.cx)(m.actionIcon,m.dragIcon),onClick:()=>c(o)})]}),e.length>a&&(0,l.jsx)(s.Icon,{title:"Drag and drop to reorder",name:"draggabledots",size:"lg",className:m.dragIcon})]}))},_))}return t})(),t.placeholder]}))})})};c.defaultProps={isGroup:()=>!1};const p=(0,s.stylesFactory)((t=>({wrapper:n.css`
    margin-bottom: ${t.spacing.md};
  `,row:n.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:n.css`
    border: 1px solid ${t.colors.formInputBorderActive};
    &:hover {
      border: 1px solid ${t.colors.formInputBorderActive};
    }
  `,dragIcon:n.css`
    cursor: drag;
  `,actionIcon:n.css`
    color: ${t.colors.textWeak};
    &:hover {
      color: ${t.colors.text};
    }
  `,typeWrapper:n.css`
    color: ${t.colors.textBlue};
    margin-right: 5px;
  `,textWrapper:n.css`
    display: flex;
    align-items: center;
    flex-grow: 1;
    overflow: hidden;
    margin-right: ${t.spacing.sm};
  `})))},88599:(t,e,i)=>{"use strict";i.r(e),i.d(e,{plugin:()=>Su});var n=i(68404),o=i(43215),r=i(90923),a=i(69783),s=i(36636),l=i(71443),h=i(82897),u=i(90486),c=i(49571),p=i(92963),d=i(30764),f=i(32043),g=i(27867),_=i(66996),v=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,y=/^([a-z]*)$|^hsla?\(.*\)$/i;function m(t){return"string"==typeof t?t:T(t)}function x(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 b,w,C=(b={},w=0,function(t){var e;if(b.hasOwnProperty(t))e=b[t];else{if(w>=1024){var i=0;for(var n in b)0==(3&i++)&&(delete b[n],--w)}e=function(t){var e,i,n,o,r;if(y.exec(t)&&(t=x(t)),v.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),n=parseInt(t.substr(1+2*s,s),16),o=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(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(")?E(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),E(r)):(0,g.h)(!1,14);return r}(t),b[t]=e,++w}return e});function S(t){return Array.isArray(t)?t:C(t)}function E(t){return t[0]=(0,_.uZ)(t[0]+.5|0,0,255),t[1]=(0,_.uZ)(t[1]+.5|0,0,255),t[2]=(0,_.uZ)(t[2]+.5|0,0,255),t[3]=(0,_.uZ)(t[3],0,1),t}function T(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)+")"}var R=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=I(t,e,i);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,i,n){var o=I(t,e,i);this.cache_[o]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function I(t,e,i){return e+":"+t+":"+(i?m(i):"null")}var O=new R,L=i(56417);const P="opacity",F="visible",A="extent",M="zIndex",j="maxResolution",k="minResolution",D="maxZoom",N="minZoom",z="source",B="map";var G,Z=i(40682),W=(G=function(t,e){return G=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])},G(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}G(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});const U=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un,i.background_=e.background;var n=(0,Z.f0)({},e);return"object"==typeof e.properties&&(delete n.properties,(0,Z.f0)(n,e.properties)),n[P]=void 0!==e.opacity?e.opacity:1,(0,g.h)("number"==typeof n[P],64),n[F]=void 0===e.visible||e.visible,n[M]=e.zIndex,n[j]=void 0!==e.maxResolution?e.maxResolution:1/0,n[k]=void 0!==e.minResolution?e.minResolution:0,n[N]=void 0!==e.minZoom?e.minZoom:-1/0,n[D]=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 W(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,_.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,p.O3)()},e.prototype.getLayerStatesArray=function(t){return(0,p.O3)()},e.prototype.getExtent=function(){return this.get(A)},e.prototype.getMaxResolution=function(){return this.get(j)},e.prototype.getMinResolution=function(){return this.get(k)},e.prototype.getMinZoom=function(){return this.get(N)},e.prototype.getMaxZoom=function(){return this.get(D)},e.prototype.getOpacity=function(){return this.get(P)},e.prototype.getSourceState=function(){return(0,p.O3)()},e.prototype.getVisible=function(){return this.get(F)},e.prototype.getZIndex=function(){return this.get(M)},e.prototype.setBackground=function(t){this.background_=t,this.changed()},e.prototype.setExtent=function(t){this.set(A,t)},e.prototype.setMaxResolution=function(t){this.set(j,t)},e.prototype.setMinResolution=function(t){this.set(k,t)},e.prototype.setMaxZoom=function(t){this.set(D,t)},e.prototype.setMinZoom=function(t){this.set(N,t)},e.prototype.setOpacity=function(t){(0,g.h)("number"==typeof t,64),this.set(P,t)},e.prototype.setVisible=function(t){this.set(F,t)},e.prototype.setZIndex=function(t){this.set(M,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(L.Z);var X=i(76702);const V="prerender",Y="postrender",K="precompose",H="postcompose",q="rendercomplete",$="undefined",J="ready";var Q=i(91084),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)}}(),et=function(t){function e(e){var i=this,n=(0,Z.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(z,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(z)||null},e.prototype.getRenderSource=function(){return this.getSource()},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():$},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&((0,Q.bN)(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=(0,Q.oL)(t,X.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(B,t)},e.prototype.getMapInternal=function(){return this.get(B)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&((0,Q.bN)(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&((0,Q.bN)(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=(0,Q.oL)(t,K,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);(0,g.h)(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=(0,Q.oL)(this,X.Z.CHANGE,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(z,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}(U);function it(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 nt=et;var ot=i(42957),rt=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 at(t,e){O.expire()}const st=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return rt(e,t),e.prototype.dispatchRenderEvent=function(t,e){(0,p.O3)()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;(0,d.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,d.nb)(n,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o,r,a,s){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,ot.Cf)(t.slice(),c),d=[[0,0]];if(c.canWrapX()&&n){var g=c.getExtent(),_=(0,f.dz)(g);d.push([-_,0],[_,0])}for(var v=e.layerStatesArray,y=v.length,m=[],x=[],b=0;b<d.length;b++)for(var w=y-1;w>=0;--w){var C=v[w],S=C.layer;if(S.hasRenderer()&&it(C,h)&&a.call(s,S)){var E=S.getRenderer(),T=S.getSource();if(E&&T){var R=T.getWrapX()?p:t,I=u.bind(null,C.managed);x[0]=R[0]+d[b][0],x[1]=R[1]+d[b][1],l=E.forEachFeatureAtCoordinate(x,e,i,I,m)}if(l)return l}}if(0!==m.length){var O=1/m.length;return m.forEach((function(t,e){return t.distanceSq+=e*O})),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,p.O3)()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,n,o,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,c.uX,this,o,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){(0,p.O3)()},e.prototype.scheduleExpireIconCache=function(t){O.canExpireCache()&&t.postRenderFunctions.push(at)},e}(u.Z);var lt=i(19345),ht=i(29520),ut=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 ct=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 ut(e,t),e}(ht.ZP);var pt="ol-hidden",dt="ol-unselectable",ft="ol-control",gt="ol-collapsed",_t=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"),vt=["style","variant","weight","size","lineHeight","family"],yt=function(t){var e=t.match(_t);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,o=vt.length;n<o;++n){var r=e[n+1];void 0!==r&&(i[vt[n]]=r)}return i.families=i.family.split(/,\s?/),i};function mt(t){return 1===t?"":String(Math.round(100*t)/100)}var xt=i(32173),bt=i(89241);function wt(t,e,i,n){var o;return o=i&&i.length?i.shift():bt.Id?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(o.width=t),e&&(o.height=e),o.getContext("2d",n)}function Ct(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function St(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var Et="10px sans-serif",Tt="#000",Rt="round",It=[],Ot="round",Lt="#000",Pt="center",Ft="middle",At=[0,0,0,0],Mt=new L.Z;(new xt.Z).setSize=function(){console.warn("labelCache is deprecated.")};var jt,kt,Dt=null,Nt={},zt=function(){var t,e,i="32px ",n=["monospace","serif"],o=n.length,r="wmytzilWMYTZIL@#/&?$%10";function a(t,a,s){for(var l=!0,h=0;h<o;++h){var u=n[h];if(e=Zt(t+" "+a+" "+i+u,r),s!=u){var c=Zt(t+" "+a+" "+i+s+","+u,r);l=l&&c!=e}}return!!l}function s(){for(var e=!0,i=Mt.getKeys(),n=0,o=i.length;n<o;++n){var r=i[n];Mt.get(r)<100&&(a.apply(this,r.split("\n"))?((0,Z.ZH)(Nt),Dt=null,jt=void 0,Mt.set(r,100)):(Mt.set(r,Mt.get(r)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var i=yt(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===Mt.get(h)&&(Mt.set(h,100,!0),a(i.style,i.weight,l)||(Mt.set(h,0,!0),void 0===t&&(t=setInterval(s,32))))}}}(),Bt=function(t){var e=Nt[t];if(null==e){if(bt.Id){var i=yt(t),n=Gt(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else kt||((kt=document.createElement("div")).innerHTML="M",kt.style.minHeight="0",kt.style.maxHeight="none",kt.style.height="auto",kt.style.padding="0",kt.style.border="none",kt.style.position="absolute",kt.style.display="block",kt.style.left="-99999px"),kt.style.font=t,document.body.appendChild(kt),e=kt.offsetHeight,document.body.removeChild(kt);Nt[t]=e}return e};function Gt(t,e){return Dt||(Dt=wt(1,1)),t!=jt&&(Dt.font=t,jt=Dt.font),Dt.measureText(e)}function Zt(t,e){return Gt(t,e).width}function Wt(t,e,i){if(e in i)return i[e];var n=Zt(t,e);return i[e]=n,n}function Ut(t,e,i,n,o,r,a,s,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,a,s,0,0,a,s)):t.drawImage(n,o,r,a,s,l,h,a*u[0],s*u[1]),t.restore()}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)}}();const Vt=function(t){function e(e){var i=t.call(this,e)||this;i.fontChangeListenerKey_=(0,Q.oL)(Mt,lt.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 Xt(e,t),e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap();if(i.hasListener(t)){var n=new ct(t,void 0,e);i.dispatchEvent(n)}},e.prototype.disposeInternal=function(){(0,Q.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(K,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,a=e.length;r<a;++r){var s=e[r];t.layerIndex=r;var l=s.layer,h=l.getSourceState();if(!it(s,i)||h!=J&&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(H,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,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],h=l.layer;if(h.hasRenderer()&&it(l,r)&&o(h)){var u=h.getRenderer().getDataAtPixel(t,e,i);if(u){var c=n(h,u);if(c)return c}}}},e}(st);var Yt=i(77171);const Kt="add",Ht="remove";var qt=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)}}(),$t="length",Jt=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.element=i,o.index=n,o}return qt(e,t),e}(ht.ZP),Qt=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,a=n.array_.length;r<a;++r)n.assertUnique_(n.array_[r],r);return n.updateLength_(),n}return qt(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($t)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new Jt(Kt,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 Jt(Ht,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 Jt(Ht,n,t)),this.dispatchEvent(new Jt(Kt,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($t,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 Yt.Z(58)},e}(L.Z);const te=Qt;var ee=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)}}(),ie=function(t){function e(e,i){var n=t.call(this,e)||this;return n.layer=i,n}return ee(e,t),e}(ht.ZP),ne="layers",oe=function(t){function e(e){var i=this,n=e||{},o=(0,Z.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(ne,i.handleLayersChanged_),r?Array.isArray(r)?r=new te(r.slice(),{unique:!0}):(0,g.h)("function"==typeof r.getArray,43):r=new te(void 0,{unique:!0}),i.setLayers(r),i}return ee(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Q.bN),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push((0,Q.oL)(t,Kt,this.handleLayersAdd_,this),(0,Q.oL)(t,Ht,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(Q.bN);(0,Z.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 ie("addlayer",r))}this.changed()},e.prototype.registerLayerListeners_=function(t){var i=[(0,Q.oL)(t,lt.Z.PROPERTYCHANGE,this.handleLayerChange_,this),(0,Q.oL)(t,X.Z.CHANGE,this.handleLayerChange_,this)];t instanceof e&&i.push((0,Q.oL)(t,"addlayer",this.handleLayerGroupAdd_,this),(0,Q.oL)(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[(0,p.sq)(t)]=i},e.prototype.handleLayerGroupAdd_=function(t){this.dispatchEvent(new ie("addlayer",t.layer))},e.prototype.handleLayerGroupRemove_=function(t){this.dispatchEvent(new ie("removelayer",t.layer))},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new ie("addlayer",e)),this.changed()},e.prototype.handleLayersRemove_=function(t){var e=t.element,i=(0,p.sq)(e);this.listenerKeys_[i].forEach(Q.bN),delete this.listenerKeys_[i],this.dispatchEvent(new ie("removelayer",e)),this.changed()},e.prototype.getLayers=function(){return this.get(ne)},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 ie("removelayer",i[n]));this.set(ne,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,a=e.length;r<a;r++){var s=e[r];s.opacity*=n.opacity,s.visible=s.visible&&n.visible,s.maxResolution=Math.min(s.maxResolution,n.maxResolution),s.minResolution=Math.max(s.minResolution,n.minResolution),s.minZoom=Math.max(s.minZoom,n.minZoom),s.maxZoom=Math.min(s.maxZoom,n.maxZoom),void 0!==n.extent&&(void 0!==s.extent?s.extent=(0,f.Ed)(s.extent,n.extent):s.extent=n.extent),void 0===s.zIndex&&(s.zIndex=o)}return e},e.prototype.getSourceState=function(){return J},e}(U);const re=oe;var ae=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 se=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 ae(e,t),e}(ht.ZP);var le=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 he=function(t){function e(e,i,n,o,r){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}return le(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}(se),ue={SINGLECLICK:"singleclick",CLICK:X.Z.CLICK,DBLCLICK:X.Z.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},ce="pointermove",pe="pointerdown";var de=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 fe=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_=0,n.trackedTouches_={},n.element_=o,n.pointerdownListenerKey_=(0,Q.oL)(o,pe,n.handlePointerDown_,n),n.originalPointerMoveEvent_,n.relayedListenerKey_=(0,Q.oL)(o,ce,n.relayEvent_,n),n.boundHandleTouchMove_=n.handleTouchMove_.bind(n),n.element_.addEventListener(X.Z.TOUCHMOVE,n.boundHandleTouchMove_,!!bt.bM&&{passive:!1}),n}return de(e,t),e.prototype.emulateClick_=function(t){var e=new he(ue.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new he(ue.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new he(ue.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==ue.POINTERUP||e.type==ue.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==ue.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new he(ue.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(Q.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_,this.updateActivePointers_(t);var e=new he(ue.POINTERDOWN,this.map_,t);for(var i in this.dispatchEvent(e),this.down_={},t){var n=t[i];this.down_[i]="function"==typeof n?c.Zn:n}if(0===this.dragListenerKeys_.length){var o=this.map_.getOwnerDocument();this.dragListenerKeys_.push((0,Q.oL)(o,ue.POINTERMOVE,this.handlePointerMove_,this),(0,Q.oL)(o,ue.POINTERUP,this.handlePointerUp_,this),(0,Q.oL)(this.element_,ue.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==o&&this.dragListenerKeys_.push((0,Q.oL)(this.element_.getRootNode(),ue.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new he(ue.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new he(t.type,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,Q.bN)(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(X.Z.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&((0,Q.bN)(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Q.bN),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(xt.Z),ge="postrender",_e="movestart",ve="moveend",ye="loadstart",me="loadend",xe="layergroup",be="size",we="target",Ce="view";var Se=1/0;const Ee=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,Z.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,g.h)(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=Se&&(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],a=t;t<n>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),h=l<n&&i[l]<i[s]?l:s;e[t]=e[h],i[t]=i[h],t=h}e[t]=o,i[t]=r,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,n=this.priorities_,o=i[e],r=n[e];e>t;){var a=this.getParentIndex_(e);if(!(n[a]>r))break;i[e]=i[a],n[e]=n[a],e=a}i[e]=o,n[e]=r},t.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,o=this.elements_,r=this.priorities_,a=0,s=o.length;for(e=0;e<s;++e)(i=n(t=o[e]))==Se?delete this.queuedElements_[this.keyFunction_(t)]:(r[a]=i,o[a++]=t);o.length=a,r.length=a,this.heapify_()},t}(),Te=0,Re=1,Ie=2,Oe=3,Le=4;var Pe=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)}}(),Fe=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 Pe(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(X.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===Ie||i===Oe||i===Le){e.removeEventListener(X.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()!==Te||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++o,i.load())},e}(Ee);const Ae=Fe;var Me=i(5509),je=i(81850);const ke=0,De=1,Ne={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var ze=256,Be=i(94617);function Ge(t,e,i){return function(n,o,r,a,s){if(n){if(!o&&!e)return n;var l=e?0:r[0]*o,h=e?0:r[1]*o,u=s?s[0]:0,c=s?s[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 v=(0,_.uZ)(n[0],p,d),y=(0,_.uZ)(n[1],f,g);if(a&&i&&o){var m=30*o;v+=-m*Math.log(1+Math.max(0,p-n[0])/m)+m*Math.log(1+Math.max(0,n[0]-d)/m),y+=-m*Math.log(1+Math.max(0,f-n[1])/m)+m*Math.log(1+Math.max(0,n[1]-g)/m)}return[v,y]}}}function Ze(t){return t}var We=i(58741);function Ue(t,e,i,n){var o=(0,f.dz)(e)/i[0],r=(0,f.Cr)(e)/i[1];return n?Math.min(t,Math.max(o,r)):Math.min(t,Math.min(o,r))}function Xe(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,_.uZ)(n,i/2,2*e)}function Ve(t,e,i,n,o){return function(r,a,s,l){if(void 0!==r){var h=n?Ue(t,n,s,o):t;return(void 0===i||i)&&l?Xe(r,h,e):(0,_.uZ)(r,e,h)}}}function Ye(t){return void 0!==t?0:void 0}function Ke(t){return void 0!==t?t:void 0}function He(t){return Math.pow(t,3)}function qe(t){return 1-He(1-t)}function $e(t){return 3*t*t-2*t*t*t}function Je(t){return t}var Qe=i(86902),ti=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 ei(t,e){setTimeout((function(){t(e)}),0)}function ii(t){return!(t.sourceCenter&&t.targetCenter&&!(0,ot.fS)(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function ni(t,e,i,n,o){var r=Math.cos(-o),a=Math.sin(-o),s=t[0]*r-t[1]*a,l=t[1]*r+t[0]*a;return[(s+=(e[0]/2-i[0])*n)*r-(l+=(i[1]-e[1]/2)*n)*(a=-a),l*r+s*a]}const oi=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var n=(0,Z.f0)({},e);return i.hints_=[0,0],i.animations_=[],i.updateAnimationKey_,i.projection_=(0,Be.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,Be.h_)(),n.center&&(n.center=(0,Be.Vs)(n.center,i.projection_)),n.extent&&(n.extent=(0,Be.dY)(n.extent,i.projection_)),i.applyOptions_(n),i}return ti(e,t),e.prototype.applyOptions_=function(t){var e=(0,Z.f0)({},t);for(var i in Ne)delete e[i];this.setProperties(e,!0);var n=function(t){var e,i,n,o=28,r=2,a=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:o,l=void 0!==t.zoomFactor?t.zoomFactor:r,h=void 0!==t.multiWorld&&t.multiWorld,u=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,c=void 0!==t.showFullExtent&&t.showFullExtent,p=(0,Be.UQ)(t.projection,"EPSG:3857"),d=p.getExtent(),g=t.constrainOnlyCenter,v=t.extent;h||v||!p.isGlobal()||(g=!1,v=d);if(void 0!==t.resolutions){var y=t.resolutions;i=y[a],n=void 0!==y[s]?y[s]:y[y.length-1],e=t.constrainResolution?function(t,e,i,n){return function(o,r,a,s){if(void 0!==o){var l=t[0],h=t[t.length-1],u=i?Ue(l,i,a,n):l;if(s)return void 0===e||e?Xe(o,u,h):(0,_.uZ)(o,h,u);var c=Math.min(u,o),p=Math.floor((0,We.h7)(t,c,r));return t[p]>u&&p<t.length-1?t[p+1]:t[p]}}}(y,u,!g&&v,c):Ve(i,n,u,!g&&v,c)}else{var m=(d?Math.max((0,f.dz)(d),(0,f.Cr)(d)):360*Be.Wm[je.ZP.DEGREES]/p.getMetersPerUnit())/ze/Math.pow(r,0),x=m/Math.pow(r,o-0);void 0!==(i=t.maxResolution)?a=0:i=m/Math.pow(l,a),void 0===(n=t.minResolution)&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(l,s):m/Math.pow(l,s):x),s=a+Math.floor(Math.log(i/n)/Math.log(l)),n=i/Math.pow(l,s-a),e=t.constrainResolution?function(t,e,i,n,o,r){return function(a,s,l,h){if(void 0!==a){var u=o?Ue(e,o,l,r):e,c=void 0!==i?i:0;if(h)return void 0===n||n?Xe(a,u,c):(0,_.uZ)(a,c,u);var p=Math.ceil(Math.log(e/u)/Math.log(t)-1e-9),d=-s*(.5-1e-9)+.5,f=Math.min(u,a),g=Math.floor(Math.log(e/f)/Math.log(t)+d),v=Math.max(p,g),y=e/Math.pow(t,v);return(0,_.uZ)(y,c,u)}}}(l,i,n,u,!g&&v,c):Ve(i,n,u,!g&&v,c)}return{constraint:e,maxResolution:i,minResolution:n,minZoom:a,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 Ge(t.extent,t.constrainOnlyCenter,e)}var i=(0,Be.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,Ge(n,!1,!1)}return Ze}(t),r=n.constraint,a=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(r=o||(0,_.Yr)(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=r?0:t:void 0}):!1===e?Ke:"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}):Ke}return Ye;var i,n;var o,r}(t);this.constraints_={center:o,resolution:r,rotation:a},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]),a=o/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([i[0]+r,i[1]-a])}},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,Z.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,Z.f0)({},n)).center=(0,Be.Vs)(n.center,this.getProjection())),n.anchor&&((n=(0,Z.f0)({},n)).anchor=(0,Be.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(),a=this.targetCenter_.slice(),s=this.targetResolution_,l=this.targetRotation_,h=[];n<i;++n){var u=arguments[n],c={start:r,complete:!1,anchor:u.anchor,duration:void 0!==u.duration?u.duration:1e3,easing:u.easing||$e,callback:e};if(u.center&&(c.sourceCenter=a,c.targetCenter=u.center.slice(),a=c.targetCenter),void 0!==u.zoom?(c.sourceResolution=s,c.targetResolution=this.getResolutionForZoom(u.zoom),s=c.targetResolution):u.resolution&&(c.sourceResolution=s,c.targetResolution=u.resolution,s=c.targetResolution),void 0!==u.rotation){c.sourceRotation=l;var p=(0,_.$W)(u.rotation-l+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=l+p,l=c.targetRotation}ii(c)?c.complete=!0:r+=c.duration,h.push(c)}this.animations_.push(h),this.setHint(ke,1),this.updateAnimations_()}else e&&ei(e,!0)},e.prototype.getAnimating=function(){return this.hints_[ke]>0},e.prototype.getInteracting=function(){return this.hints_[De]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(ke,-this.hints_[ke]);for(var e=0,i=this.animations_.length;e<i;++e){var n=this.animations_[e];if(n[0].callback&&ei(n[0].callback,!1),!t)for(var o=0,r=n.length;o<r;++o){var a=n[o];if(!a.complete){t=a.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,a=n.length;r<a;++r){var s=n[r];if(!s.complete){var l=t-s.start,h=s.duration>0?l/s.duration:1;h>=1?(s.complete=!0,h=1):o=!1;var u=s.easing(h);if(s.sourceCenter){var c=s.sourceCenter[0],p=s.sourceCenter[1],d=s.targetCenter[0],f=s.targetCenter[1];this.nextCenter_=s.targetCenter;var g=c+u*(d-c),v=p+u*(f-p);this.targetCenter_=[g,v]}if(s.sourceResolution&&s.targetResolution){var y=1===u?s.targetResolution:s.sourceResolution+u*(s.targetResolution-s.sourceResolution);if(s.anchor){var m=this.getViewportSize_(this.getRotation()),x=this.constraints_.resolution(y,0,m,!0);this.targetCenter_=this.calculateCenterZoom(x,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=y,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var b=1===u?(0,_.$W)(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+u*(s.targetRotation-s.sourceRotation);if(s.anchor){var w=this.constraints_.rotation(b,!0);this.targetCenter_=this.calculateCenterRotate(w,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=b}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(o){this.animations_[i]=null,this.setHint(ke,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var C=n[0].callback;C&&ei(C,!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,ot.U1)(i,t-this.getRotation()),(0,ot.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,Be.lO)(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Ne.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,Be.Fj)(e,this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();(0,g.h)(i,1);var n=this.getResolution();(0,g.h)(void 0!==n,2);var o=this.getRotation();return(0,g.h)(void 0!==o,3),(0,f.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(Ne.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal((0,Be.dY)(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSizeMinusPadding_(),n=(0,f.dz)(t)/i[0],o=(0,f.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(Ne.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=ni(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,We.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,_.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,_.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,g.h)(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t)){(0,g.h)(!(0,f.xb)(t),25);var n=(0,Be.dY)(t,this.getProjection());i=(0,Qe.oJ)(n)}else if(t.getType()===Me.Z.CIRCLE){n=(0,Be.dY)(t.getExtent(),this.getProjection());(i=(0,Qe.oJ)(n)).rotate(this.getRotation(),(0,f.qg)(n))}else{var o=(0,Be.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(),a=1/0,s=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;a=Math.min(a,p),s=Math.min(s,d),l=Math.max(l,p),h=Math.max(h,d)}return[a,s,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],a=void 0!==i.nearest&&i.nearest;o=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;var s=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(s,[n[0]-r[1]-r[3],n[1]-r[0]-r[2]]);l=isNaN(l)?o:Math.max(l,o),l=this.getConstrainedResolution(l,a?0:1);var h=this.getRotation(),u=Math.sin(h),p=Math.cos(h),d=(0,f.qg)(s);d[0]+=(r[1]-r[3])/2*l,d[1]+=(r[0]-r[2])/2*l;var g=d[0]*p-d[1]*u,_=d[1]*p+d[0]*u,v=this.getConstrainedCenter([g,_],l),y=i.callback?i.callback:c.Zn;void 0!==i.duration?this.animateInternal({resolution:l,center:v,duration:i.duration,easing:i.easing},y):(this.targetResolution_=l,this.targetCenter_=v,this.applyTargetState_(!1,!0),ei(y,!0))},e.prototype.centerOn=function(t,e,i){this.centerOnInternal((0,Be.Vs)(t,this.getProjection()),e,i)},e.prototype.centerOnInternal=function(t,e,i){this.setCenterInternal(ni(t,e,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,i,n){var o,r=this.padding_;if(r&&t){var a=this.getViewportSizeMinusPadding_(-i),s=ni(t,n,[a[0]/2+r[3],a[1]/2+r[0]],e,i);o=[t[0]-s[0],t[1]-s[1]]}return o},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=(0,Be.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,Be.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,Be.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,Be.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),a=this.constraints_.center(this.targetCenter_,r,o,i,this.calculateCenterShift(this.targetCenter_,r,n,o));this.get(Ne.ROTATION)!==n&&this.set(Ne.ROTATION,n),this.get(Ne.RESOLUTION)!==r&&(this.set(Ne.RESOLUTION,r),this.set("zoom",this.getZoom(),!0)),a&&this.get(Ne.CENTER)&&(0,ot.fS)(this.get(Ne.CENTER),a)||this.set(Ne.CENTER,a),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_),a=this.getViewportSize_(r),s=this.constraints_.resolution(this.targetResolution_,o,a),l=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,r,a));if(0===n&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=r,this.targetCenter_=l,void this.applyTargetState_();var h=i||(0===n?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===r&&this.getCenterInternal()&&(0,ot.fS)(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:s,duration:n,easing:qe,anchor:h}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(De,1)},e.prototype.endInteraction=function(t,e,i){var n=i&&(0,Be.Vs)(i,this.getProjection());this.endInteractionInternal(t,e,n)},e.prototype.endInteractionInternal=function(t,e,i){this.setHint(De,-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}(L.Z);function ri(t){return t[0]>0&&t[1]>0}function ai(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var si=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 li(t){t instanceof nt?t.setMapInternal(null):t instanceof re&&t.getLayers().forEach(li)}function hi(t,e){if(t instanceof nt)t.setMapInternal(e);else if(t instanceof re)for(var i=t.getLayers().getArray(),n=0,o=i.length;n<o;++n)hi(i[n],e)}var ui=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={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new re({layers:t.layers});r[xe]=a,r[we]=t.target,r[Ce]=t.view instanceof oi?t.view:new oi,void 0!==t.controls&&(Array.isArray(t.controls)?i=new te(t.controls.slice()):((0,g.h)("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?n=new te(t.interactions.slice()):((0,g.h)("function"==typeof t.interactions.getArray,48),n=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?o=new te(t.overlays.slice()):((0,g.h)("function"==typeof t.overlays.getArray,49),o=t.overlays):o=new te;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:bt.MP,i.postRenderTimeoutHandle_,i.animationDelayKey_,i.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(i),i.coordinateToPixelTransform_=(0,d.Ue)(),i.pixelToCoordinateTransform_=(0,d.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 te,i.interactions=n.interactions||new te,i.overlays_=n.overlays,i.overlayIdIndex_={},i.renderer_=null,i.postRenderFunctions_=[],i.tileQueue_=new Ae(i.getTilePriority.bind(i),i.handleTileChange_.bind(i)),i.addChangeListener(xe,i.handleLayerGroupChanged_),i.addChangeListener(Ce,i.handleViewChanged_),i.addChangeListener(be,i.handleSizeChanged_),i.addChangeListener(we,i.handleTargetChanged_),i.setProperties(n.values);var o=i;return!e.view||e.view instanceof oi||e.view.then((function(t){o.setView(new oi(t))})),i.controls.addEventListener(Kt,function(t){t.element.setMap(this)}.bind(i)),i.controls.addEventListener(Ht,function(t){t.element.setMap(null)}.bind(i)),i.interactions.addEventListener(Kt,function(t){t.element.setMap(this)}.bind(i)),i.interactions.addEventListener(Ht,function(t){t.element.setMap(null)}.bind(i)),i.overlays_.addEventListener(Kt,function(t){this.addOverlayInternal_(t.element)}.bind(i)),i.overlays_.addEventListener(Ht,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 si(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){hi(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.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:c.uX,a=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,o,a,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 re?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||c.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:c.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(we)},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,Be.lO)(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?(0,d.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(xe)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof te)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,Be.Vs)(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?(0,d.nn)(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(be)},e.prototype.getView=function(){return this.get(Ce)},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 Se;if(!t.wantedTiles[i][e.getKey()])return Se;var r=t.viewState.center,a=n[0]-r[0],s=n[1]-r[1];return 65536*Math.log(o)+Math.sqrt(a*a+s*s)/o}(this.frameState_,t,e,i,n)},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,n=new he(i,this,t);this.handleMapBrowserEvent(n)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,i=e.type;if(i===pe||i===X.Z.WHEEL||i===X.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 a=this.getInteractions().getArray().slice(),s=a.length-1;s>=0;s--){var l=a[s];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[ke]||o[De]){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(q)&&this.renderer_.dispatchRenderEvent(q,t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new se(me,this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new se(ye,this,t))));for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.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,Q.bN)(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(X.Z.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(X.Z.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,St(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 fe(this,this.moveTolerance_),ue)this.mapBrowserEventHandler_.addEventListener(ue[n],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(X.Z.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(X.Z.WHEEL,this.boundHandleBrowserEvent_,!!bt.bM&&{passive:!1});var o=this.getOwnerDocument().defaultView,r=this.keyboardEventTarget_?this.keyboardEventTarget_:i;this.targetChangeHandlerKeys_=[(0,Q.oL)(r,X.Z.KEYDOWN,this.handleBrowserEvent,this),(0,Q.oL)(r,X.Z.KEYPRESS,this.handleBrowserEvent,this),(0,Q.oL)(o,X.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,Q.bN)(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&((0,Q.bN)(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=(0,Q.oL)(t,lt.Z.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=(0,Q.oL)(t,X.Z.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Q.bN),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.handleLayerAdd_(new ie("addlayer",t)),this.layerGroupPropertyListenerKeys_=[(0,Q.oL)(t,lt.Z.PROPERTYCHANGE,this.render,this),(0,Q.oL)(t,X.Z.CHANGE,this.render,this),(0,Q.oL)(t,"addlayer",this.handleLayerAdd_,this),(0,Q.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){li(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&&ri(i)&&n&&n.isDef()){var a=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=n.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:(0,f.p8)(s.center,s.resolution,s.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:s,viewHints:a,wantedTiles:{},mapId:(0,p.sq)(this),renderTargets:{}},s.nextCenter&&s.nextResolution){var l=isNaN(s.nextRotation)?s.rotation:s.nextRotation;r.nextExtent=(0,f.p8)(s.nextCenter,s.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,f.xb)(this.previousExtent_)&&!(0,f.fS)(r.extent,this.previousExtent_))&&(this.dispatchEvent(new se(_e,this,o)),this.previousExtent_=(0,f.YN)(this.previousExtent_));this.previousExtent_&&!r.viewHints[ke]&&!r.viewHints[De]&&!(0,f.fS)(r.extent,this.previousExtent_)&&(this.dispatchEvent(new se(ve,this,r)),(0,f.d9)(r.extent,this.previousExtent_))}this.dispatchEvent(new se(ge,this,r)),this.renderComplete_=this.hasListener(ye)||this.hasListener(me)||this.hasListener(q)?!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 ie("removelayer",e)),this.set(xe,t)},e.prototype.setSize=function(t){this.set(be,t)},e.prototype.setTarget=function(t){this.set(we,t)},e.prototype.setView=function(t){if(!t||t instanceof oi)this.set(Ce,t);else{this.set(Ce,new oi);var e=this;t.then((function(t){e.setView(new oi(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)||!ri(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}(L.Z);const ci=ui;var pi=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 di=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 pi(e,t),e.prototype.disposeInternal=function(){St(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&St(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)(0,Q.bN)(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,t)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==c.Zn&&this.listenerKeys.push((0,Q.oL)(t,ge,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}(L.Z);var 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)}}();const gi=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",a=void 0!==n.expandClassName?n.expandClassName:o+"-expand",s=void 0!==n.collapseLabel?n.collapseLabel:"›",l=void 0!==n.collapseClassName?n.collapseClassName:o+"-collapse";"string"==typeof s?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=s,i.collapseLabel_.className=l):i.collapseLabel_=s;var h=void 0!==n.label?n.label:"i";"string"==typeof h?(i.label_=document.createElement("span"),i.label_.textContent=h,i.label_.className=a):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(X.Z.CLICK,i.handleClick_.bind(i),!1);var c=o+" "+"ol-unselectable "+ft+(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 fi(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],n=!0,o=t.layerStatesArray,r=0,a=o.length;r<a;++r){var s=o[r];if(it(s,t.viewState)){var l=s.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,We.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(gt),this.collapsed_?Ct(this.collapseLabel_,this.label_):Ct(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}(di);var _i=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 vi=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:"⇧",a=void 0!==n.compassClassName?n.compassClassName:"ol-compass";i.label_=null,"string"==typeof r?(i.label_=document.createElement("span"),i.label_.className=a,i.label_.textContent=r):(i.label_=r,i.label_.classList.add(a));var s=n.tipLabel?n.tipLabel:"Reset rotation",l=document.createElement("button");l.className=o+"-reset",l.setAttribute("type","button"),l.title=s,l.appendChild(i.label_),l.addEventListener(X.Z.CLICK,i.handleClick_.bind(i),!1);var h=o+" "+"ol-unselectable "+ft,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(pt),i}return _i(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:qe}):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(pt);o||0!==i?o&&0!==i&&this.element.classList.remove(pt):this.element.classList.add(pt)}this.label_.style.transform=n}this.rotation_=i}},e}(di);var yi=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 mi=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,a=void 0!==n.zoomInClassName?n.zoomInClassName:o+"-in",s=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=a,p.setAttribute("type","button"),p.title=u,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(X.Z.CLICK,i.handleClick_.bind(i,r),!1);var d=document.createElement("button");d.className=s,d.setAttribute("type","button"),d.title=c,d.appendChild("string"==typeof h?document.createTextNode(h):h),d.addEventListener(X.Z.CLICK,i.handleClick_.bind(i,-r),!1);var f=o+" "+"ol-unselectable "+ft,g=i.element;return g.className=f,g.appendChild(p),g.appendChild(d),i.duration_=void 0!==n.duration?n.duration:250,i}return yi(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:qe})):e.setZoom(n)}}},e}(di);const xi="active";var bi=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 wi(t,e,i,n){var o=t.getZoom();if(void 0!==o){var r=t.getConstrainedZoom(o+e),a=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:i,duration:void 0!==n?n:250,easing:qe})}}const Ci=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 bi(e,t),e.prototype.getActive=function(){return this.get(xi)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(xi,t)},e.prototype.setMap=function(t){this.map_=t},e}(L.Z);var Si=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 Ei=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 Si(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==ue.DBLCLICK){var i=t.originalEvent,n=t.map,o=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;wi(n.getView(),r,o,this.duration_),i.preventDefault(),e=!0}return!e},e}(Ci);var Ti=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 Ri(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 Ii=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.trackedPointers_={},i.targetPointers=[],i}return Ti(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==ue.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==ue.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==ue.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==ue.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){if(function(t){var e=t.type;return e===ue.POINTERDOWN||e===ue.POINTERDRAG||e===ue.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==ue.POINTERUP?delete this.trackedPointers_[i]:(t.type==ue.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=(0,Z.KX)(this.trackedPointers_)}},e}(Ci);function Oi(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 Li=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Pi=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)},Fi=c.uX,Ai=function(t){var e=t.originalEvent;return 0==e.button&&!(bt.G$&&bt.tK&&e.ctrlKey)},Mi=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},ji=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},ki=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},Di=function(t){var e=t.originalEvent;return(0,g.h)(void 0!==e,56),"mouse"==e.pointerType},Ni=function(t){var e=t.originalEvent;return(0,g.h)(void 0!==e,56),e.isPrimary&&0===e.button},zi=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 Bi=function(t){function e(e){var i=t.call(this,{stopDown:c.Dv})||this,n=e||{};i.kinetic_=n.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var o=n.condition?n.condition:Oi(Mi,Ni);return i.condition_=n.onFocusOnly?Oi(Pi,o):o,i.noKinetic_=!1,i}return zi(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,i=Ri(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,ot.bA)(n,o.getResolution()),(0,ot.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(),a=e.getPixelFromCoordinateInternal(r),s=e.getCoordinateFromPixelInternal([a[0]-n*Math.cos(o),a[1]-n*Math.sin(o)]);i.animateInternal({center:i.getConstrainedCenter(s),duration:500,easing:qe})}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}(Ii);var Gi=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 Zi=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,{stopDown:c.Dv})||this).condition_=n.condition?n.condition:Li,i.lastAngle_=void 0,i.duration_=void 0!==n.duration?n.duration:250,i}return Gi(e,t),e.prototype.handleDragEvent=function(t){if(Di(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Ye){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 a=r-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!Di(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!Di(t)&&(!(!Ai(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(Ii);var Wi=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 Ui=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 Wi(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 Qe.ZP([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(u.Z);var Xi=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)}}(),Vi="boxstart",Yi="boxdrag",Ki="boxend",Hi="boxcancel",qi=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.coordinate=i,o.mapBrowserEvent=n,o}return Xi(e,t),e}(ht.ZP);const $i=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var n=e||{};return i.box_=new Ui(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:Ai,i.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:i.defaultBoxEndCondition,i}return Xi(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 qi(Yi,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 qi(e?Ki:Hi,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 qi(Vi,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Ii);var Ji=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 Qi=function(t){function e(e){var i=this,n=e||{},o=n.condition?n.condition:ji;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 Ji(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:qe})},e}($i),tn=37,en=38,nn=39,on=40;var rn=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 an=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.defaultCondition_=function(t){return Mi(t)&&ki(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 rn(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==X.Z.KEYDOWN){var i=t.originalEvent,n=i.keyCode;if(this.condition_(t)&&(n==on||n==tn||n==nn||n==en)){var o=t.map.getView(),r=o.getResolution()*this.pixelDelta_,a=0,s=0;n==on?s=-r:n==tn?a=-r:n==nn?a=r:s=r;var l=[a,s];(0,ot.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:Je,center:t.getConstrainedCenter(o)})}}(o,l,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Ci);var sn=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 ln=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.condition_=n.condition?n.condition:ki,i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:100,i}return sn(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==X.Z.KEYDOWN||t.type==X.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_;wi(o.getView(),r,void 0,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Ci);const hn=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 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)}}(),cn="trackpad",pn="wheel";const dn=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:Fi;return i.condition_=n.onFocusOnly?Oi(Pi,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 un(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().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!==X.Z.WHEEL)return!0;var e,i=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==X.Z.WHEEL&&(e=n.deltaY,bt.V&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=bt.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?cn:pn);var r=i.getView();if(this.mode_===cn&&!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 a=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-(0,_.uZ)(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),wi(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}(Ci);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)}}();const gn=function(t){function e(e){var i=this,n=e||{},o=n;return o.stopDown||(o.stopDown=c.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 fn(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 a=t.map,s=a.getView();if(s.getConstraints().rotation!==Ye){var l=a.getViewport().getBoundingClientRect(),h=Ri(this.targetPointers);h[0]-=l.left,h[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(h),this.rotating_&&(a.render(),s.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}(Ii);var _n=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){var i=this,n=e||{},o=n;return o.stopDown||(o.stopDown=c.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 _n(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,a=Math.sqrt(o*o+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,l=s.getView();1!=e&&(this.lastScaleDelta_=e);var h=s.getViewport().getBoundingClientRect(),u=Ri(this.targetPointers);u[0]-=h.left,u[1]-=h.top,this.anchor_=s.getCoordinateFromPixelInternal(u),s.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}(Ii);function yn(t){var e=t||{},i=new te,n=new hn(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new Zi),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Ei({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new Bi({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new gn),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new vn({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new an),i.push(new ln({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new dn({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new Qi({duration:e.zoomDuration})),i}var mn=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 xn=function(t){function e(e){return(e=(0,Z.f0)({},e)).controls||(e.controls=function(t){var e=t||{},i=new te;return(void 0===e.zoom||e.zoom)&&i.push(new mi(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new vi(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new gi(e.attributionOptions)),i}()),e.interactions||(e.interactions=yn({onFocusOnly:!0})),t.call(this,e)||this}return mn(e,t),e.prototype.createRenderer=function(){return new Vt(this)},e}(ci);var bn=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="units",Cn="degrees",Sn="imperial",En="nautical",Tn="metric",Rn="us",In=[1,2,5],On=25.4/.28,Ln=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+" "+dt,i.element.appendChild(i.innerElement_),i.viewState_=null,i.minWidth_=void 0!==n.minWidth?n.minWidth:64,i.renderedVisible_=!1,i.renderedWidth_=void 0,i.renderedHTML_="",i.addChangeListener(wn,i.handleUnitsChanged_),i.setUnits(n.units||Tn),i.scaleBar_=n.bar||!1,i.scaleBarSteps_=n.steps||4,i.scaleBarText_=n.text||!1,i.dpi_=n.dpi||void 0,i}return bn(e,t),e.prototype.getUnits=function(){return this.get(wn)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(wn,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==Cn?je.ZP.DEGREES:je.ZP.METERS,r=(0,Be._Q)(i,t.resolution,e,o),a=this.minWidth_*(this.dpi_||On)/On,s=a*r,l="";if(n==Cn){var h=Be.Wm[je.ZP.DEGREES];(s*=h)<h/60?(l="″",r*=3600):s<h?(l="′",r*=60):l="°"}else n==Sn?s<.9144?(l="in",r/=.0254):s<1609.344?(l="ft",r/=.3048):(l="mi",r/=1609.344):n==En?(r/=1852,l="nm"):n==Tn?s<.001?(l="μm",r*=1e6):s<1?(l="mm",r*=1e3):s<1e3?l="m":(l="km",r/=1e3):n==Rn?s<.9144?(l="in",r*=39.37):s<1609.344?(l="ft",r/=.30480061):(l="mi",r/=1609.3472):(0,g.h)(!1,33);for(var u,c,p,d,f=3*Math.floor(Math.log(a*r)/Math.log(10));;){p=Math.floor(f/3);var _=Math.pow(10,p);if(u=In[(f%3+3)%3]*_,c=Math.round(u/r),isNaN(c))return this.element.style.display="none",void(this.renderedVisible_=!1);if(c>=a)break;++f}d=this.scaleBar_?this.createScaleBar(c,u,l):u.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=d&&(this.innerElement_.innerHTML=d,this.renderedHTML_=d),this.renderedWidth_!=c&&(this.innerElement_.style.width=c+"px",this.renderedWidth_=c),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_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&o.push(this.createMarker("absolute",s)),o.push('<div><div class="ol-scale-singlebar" style="width: '+r+"px;background-color: "+a+';"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,i):"")+"</div>"),s===this.scaleBarSteps_-1&&o.push(this.createStepText(s+1,t,!0,e,i)),a="#ffffff"===a?"#000000":"#ffffff";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,Be._Q)(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,je.ZP.METERS),e=this.dpi_||On;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}(di);const Pn=Ln;var Fn=i(43788);const An=0,Mn=1,jn=2,kn=3;var Dn=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=ai(t.scale),this.displacement_=t.displacement}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()})},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.getAnchor=function(){return(0,p.O3)()},t.prototype.getImage=function(t){return(0,p.O3)()},t.prototype.getHitDetectionImage=function(){return(0,p.O3)()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return(0,p.O3)()},t.prototype.getImageSize=function(){return(0,p.O3)()},t.prototype.getOrigin=function(){return(0,p.O3)()},t.prototype.getSize=function(){return(0,p.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_=ai(t)},t.prototype.listenImageChange=function(t){(0,p.O3)()},t.prototype.load=function(){(0,p.O3)()},t.prototype.unlistenImageChange=function(t){(0,p.O3)()},t}();const Nn=Dn;function zn(t){return Array.isArray(t)?T(t):t}var Bn=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]})||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 Bn(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()});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.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=wt(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 jn},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.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 a=void 0===this.radius2_?this.points_:2*this.points_,s=2*Math.PI/a,l=o*Math.sin(s),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(s),_=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=Ot,i=0,n=null,o=0,r=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Lt),t=zn(t),void 0===(r=this.stroke_.getWidth())&&(r=1),n=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=Ot),void 0===(i=this.stroke_.getMiterLimit())&&(i=10));var a=this.calculateLineJoinSize_(e,r,i),s=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:r,size:Math.ceil(2*s+a),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=Tt),e.fillStyle=zn(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=S(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var n=wt(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,a=0;a<e;a++){var s=o+a*r,l=a%2==0?i:n;t.lineTo(l*Math.cos(s),l*Math.sin(s))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=Tt,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}(Nn);const Zn=Gn;var Wn=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)}}(),Un=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]})||this}return Wn(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()});return i.setOpacity(this.getOpacity()),i},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(Zn);const Xn=Un;const Vn=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 Yn=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 Kn=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=$n,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_=$n,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var Hn=null;function qn(t,e){if(!Hn){var i=new Vn({color:"rgba(255,255,255,0.4)"}),n=new Yn({color:"#3399CC",width:1.25});Hn=[new Kn({image:new Xn({fill:i,stroke:n,radius:5}),fill:i,stroke:n})]}return Hn}function $n(t){return t.getGeometry()}const Jn=Kn;var Qn=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)}}(),to="renderOrder",eo=function(t){function e(e){var i=this,n=e||{},o=(0,Z.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 Qn(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(to)},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 Fn(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(to,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:qn,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,g.h)("function"==typeof t.getZIndex,41),i=[t]),e=function(){return i}}return e}(this.style_),this.changed()},e}(nt);const io=eo;var no={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},oo=[no.FILL],ro=[no.STROKE],ao=[no.BEGIN_PATH],so=[no.CLOSE_PATH];const lo=no;var ho=i(55244);const uo=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 co=i(87946),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=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 po(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,a=0,s=t.length;a<s;a+=e)n[0]=t[a],n[1]=t[a+1],(0,f.b8)(i,n)&&(o[r++]=n[0],o[r++]=n[1]);return r},e.prototype.appendFlatLineCoordinates=function(t,e,i,n,o,r){var a=this.coordinates,s=a.length,l=this.getBufferedMaxExtent();r&&(e+=n);var h,u,c,p=t[e],d=t[e+1],g=this.tmpCoordinate_,_=!0;for(h=e+n;h<i;h+=n)g[0]=t[h],g[1]=t[h+1],(c=(0,f.pX)(l,g))!==u?(_&&(a[s++]=p,a[s++]=d,_=!1),a[s++]=g[0],a[s++]=g[1]):c===ho.Z.INTERSECTING?(a[s++]=g[0],a[s++]=g[1],_=!1):_=!0,p=g[0],d=g[1],u=c;return(o&&_||h===e+n)&&(a[s++]=p,a[s++]=d),s},e.prototype.drawCustomCoordinates_=function(t,e,i,n,o){for(var r=0,a=i.length;r<a;++r){var s=i[r],l=this.appendFlatLineCoordinates(t,e,s,n,!1,!1);o.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,i,n){this.beginGeometry(t,e);var o,r,a,s,l,h=t.getType(),u=t.getStride(),c=this.coordinates.length;switch(h){case Me.Z.MULTI_POLYGON:o=t.getOrientedFlatCoordinates(),s=[];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),s.push(g)}this.instructions.push([lo.CUSTOM,c,s,t,i,co.ug]),this.hitDetectionInstructions.push([lo.CUSTOM,c,s,t,n||i,co.ug]);break;case Me.Z.POLYGON:case Me.Z.MULTI_LINE_STRING:a=[],o=h==Me.Z.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(o,0,t.getEnds(),u,a),this.instructions.push([lo.CUSTOM,c,a,t,i,co.o1]),this.hitDetectionInstructions.push([lo.CUSTOM,c,a,t,n||i,co.o1]);break;case Me.Z.LINE_STRING:case Me.Z.CIRCLE:o=t.getFlatCoordinates(),r=this.appendFlatLineCoordinates(o,0,o.length,u,!1,!1),this.instructions.push([lo.CUSTOM,c,r,t,i,co.Ml]),this.hitDetectionInstructions.push([lo.CUSTOM,c,r,t,n||i,co.Ml]);break;case Me.Z.MULTI_POINT:o=t.getFlatCoordinates(),(r=this.appendFlatPointCoordinates(o,u))>c&&(this.instructions.push([lo.CUSTOM,c,r,t,i,co.Ml]),this.hitDetectionInstructions.push([lo.CUSTOM,c,r,t,n||i,co.Ml]));break;case Me.Z.POINT:o=t.getFlatCoordinates(),this.coordinates.push(o[0],o[1]),r=this.coordinates.length,this.instructions.push([lo.CUSTOM,c,r,t,i]),this.hitDetectionInstructions.push([lo.CUSTOM,c,r,t,n||i])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[lo.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[lo.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])==lo.END_GEOMETRY?r=t:n==lo.BEGIN_GEOMETRY&&(i[2]=t,(0,We.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=zn(n||Tt)}else i.fillStyle=void 0;if(e){var o=e.getColor();i.strokeStyle=zn(o||Lt);var r=e.getLineCap();i.lineCap=void 0!==r?r:Rt;var a=e.getLineDash();i.lineDash=a?a.slice():It;var s=e.getLineDashOffset();i.lineDashOffset=s||0;var l=e.getLineJoin();i.lineJoin=void 0!==l?l:Ot;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=[lo.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[lo.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,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||o!=t.currentLineDash&&!(0,We.fS)(t.currentLineDash,o)||t.currentLineDashOffset!=r||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=o,t.currentLineDashOffset=r,t.currentLineJoin=a,t.currentLineWidth=s,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=[lo.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=(0,f.d9)(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;(0,f.f3)(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(uo);const go=fo;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)}}();const vo=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.declutterImageWithText_=void 0,r}return _o(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([lo.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.originY_,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.declutterImageWithText_]),this.hitDetectionInstructions.push([lo.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.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([lo.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.originY_,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.declutterImageWithText_]),this.hitDetectionInstructions.push([lo.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.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.getHitDetectionImage(),r=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=o,this.image_=r,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterImageWithText_=e},e}(go);var 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 mo=function(t){function e(e,i,n,o){return t.call(this,e,i,n,o)||this}return yo(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,n){var o=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),a=[lo.MOVE_TO_LINE_TO,o,r];return this.instructions.push(a),this.hitDetectionInstructions.push(a),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([lo.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,It,0],ao);var r=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(r,0,r.length,a),this.hitDetectionInstructions.push(ro),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([lo.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],ao);for(var r=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,h=0,u=r.length;h<u;++h)l=this.drawFlatCoordinates_(a,l,r[h],s);this.hitDetectionInstructions.push(ro),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(ro),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(ro),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(ao)},e}(go);var xo=i(42346),bo=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 wo=function(t){function e(e,i,n,o){return t.call(this,e,i,n,o)||this}return bo(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,i,n){var o=this.state,r=void 0!==o.fillStyle,a=void 0!==o.strokeStyle,s=i.length;this.instructions.push(ao),this.hitDetectionInstructions.push(ao);for(var l=0;l<s;++l){var h=i[l],u=this.coordinates.length,c=this.appendFlatLineCoordinates(t,e,h,n,!0,!a),p=[lo.MOVE_TO_LINE_TO,u,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),a&&(this.instructions.push(so),this.hitDetectionInstructions.push(so)),e=h}return r&&(this.instructions.push(oo),this.hitDetectionInstructions.push(oo)),a&&(this.instructions.push(ro),this.hitDetectionInstructions.push(ro)),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([lo.SET_FILL_STYLE,Tt]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([lo.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatLineCoordinates(r,0,r.length,a,!1,!1);var l=[lo.CIRCLE,s];this.instructions.push(ao,l),this.hitDetectionInstructions.push(ao,l),void 0!==i.fillStyle&&(this.instructions.push(oo),this.hitDetectionInstructions.push(oo)),void 0!==i.strokeStyle&&(this.instructions.push(ro),this.hitDetectionInstructions.push(ro)),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([lo.SET_FILL_STYLE,Tt]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([lo.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,r,s),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([lo.SET_FILL_STYLE,Tt]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([lo.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var r=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),l=0,h=0,u=r.length;h<u;++h)l=this.drawFlatCoordinatess_(a,l,r[h],s);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,xo.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}(go),Co="point",So="line";function Eo(t,e,i,n,o){var r,a,s,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,s=Math.sqrt(p*p+d*d),void 0!==u&&(v+=a,Math.acos((u*p+c*d)/(a*s))>t&&(v>_&&(_=v,f=y,g=r),v=0,y=r-o)),a=s,u=p,c=d),l=m,h=x}return(v+=s)>_?[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)}}(),Ro={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,a=r.length,s=t.getType(),l=null,h=t.getStride();if(o.placement!==So||s!=Me.Z.LINE_STRING&&s!=Me.Z.MULTI_LINE_STRING&&s!=Me.Z.POLYGON&&s!=Me.Z.MULTI_POLYGON){var u=o.overflow?null:[];switch(s){case Me.Z.POINT:case Me.Z.MULTI_POINT:l=t.getFlatCoordinates();break;case Me.Z.LINE_STRING:l=t.getFlatMidpoint();break;case Me.Z.CIRCLE:l=t.getCenter();break;case Me.Z.MULTI_LINE_STRING:l=t.getFlatMidpoints(),h=2;break;case Me.Z.POLYGON:l=t.getFlatInteriorPoint(),o.overflow||u.push(l[2]/this.resolution),h=3;break;case Me.Z.MULTI_POLYGON:var c=t.getFlatInteriorPoints();l=[];for(C=0,S=c.length;C<S;C+=3)o.overflow||u.push(c[C+2]/this.resolution),l.push(c[C],c[C+1]);if(0===l.length)return;h=2}if((P=this.appendFlatPointCoordinates(l,h))===a)return;if(u&&(P-a)/2!=l.length/h){var p=a/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!=At&&(o.scale[0]<0||o.scale[1]<0)){var g=o.padding[0],_=o.padding[1],v=o.padding[2],y=o.padding[3];o.scale[0]<0&&(_=-_,y=-y),o.scale[1]<0&&(g=-g,v=-v),d=[g,_,v,y]}var m=this.pixelRatio;this.instructions.push([lo.DRAW_IMAGE,a,P,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,d==At?At:d.map((function(t){return t*m})),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,u]);var x=1/m;this.hitDetectionInstructions.push([lo.DRAW_IMAGE,a,P,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[x,x],NaN,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,f.kK)(this.getBufferedMaxExtent(),t.getExtent()))return;var b=void 0;if(l=t.getFlatCoordinates(),s==Me.Z.LINE_STRING)b=[l.length];else if(s==Me.Z.MULTI_LINE_STRING)b=t.getEnds();else if(s==Me.Z.POLYGON)b=t.getEnds().slice(0,1);else if(s==Me.Z.MULTI_POLYGON){var w=t.getEndss();b=[];for(var C=0,S=w.length;C<S;++C)b.push(w[C][0])}this.beginGeometry(t,e);for(var E=o.textAlign,T=0,R=void 0,I=0,O=b.length;I<O;++I){if(null==E){var L=Eo(o.maxAngle,l,T,b[I],h);T=L[0],R=L[1]}else R=b[I];for(var C=T;C<R;C+=h)r.push(l[C],l[C+1]);var P=r.length;T=b[I],this.drawChars_(a,P),a=P}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||Pt,textBaseline:e.textBaseline||Ft,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_,a=this.fillKey_;this.saveTextStates_();var s=this.pixelRatio,l=Ro[n.textBaseline],h=this.textOffsetY_*s,u=this.text_,c=i?i.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([lo.DRAW_CHARS,t,e,l,n.overflow,a,n.maxAngle,s,h,o,c*s,u,r,1]),this.hitDetectionInstructions.push([lo.DRAW_CHARS,t,e,l,n.overflow,a,n.maxAngle,1,h,o,c,u,r,1/s])},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=zn(r.getColor()||Tt)):(n=null,this.textFillState_=n);var a=t.getStroke();if(a){(o=this.textStrokeState_)||(o={},this.textStrokeState_=o);var s=a.getLineDash(),l=a.getLineDashOffset(),h=a.getWidth(),u=a.getMiterLimit();o.lineCap=a.getLineCap()||Rt,o.lineDash=s?s.slice():It,o.lineDashOffset=void 0===l?0:l,o.lineJoin=a.getLineJoin()||Ot,o.lineWidth=void 0===h?1:h,o.miterLimit=void 0===u?10:u,o.strokeStyle=zn(a.getColor()||Lt)}else o=null,this.textStrokeState_=o;i=this.textState_;var c=t.getFont()||Et;zt(c);var d=t.getScaleArray();i.overflow=t.getOverflow(),i.font=c,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||Ft,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||At,i.scale=void 0===d?[1,1]:d;var f=t.getOffsetX(),g=t.getOffsetY(),_=t.getRotateWithView(),v=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===f?0:f,this.textOffsetY_=void 0===g?0:g,this.textRotateWithView_=void 0!==_&&_,this.textRotation_=void 0===v?0:v,this.strokeKey_=o?("string"==typeof o.strokeStyle?o.strokeStyle:(0,p.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.textBaseline||"?"),this.fillKey_=n?"string"==typeof n.fillStyle?n.fillStyle:"|"+(0,p.sq)(n.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(go);var Oo={Circle:wo,Default:go,Image:vo,LineString:mo,Polygon:wo,Text:Io};const Lo=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,Oo[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=o);return o},t}();var Po=i(59191),Fo=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 Fo(e,t),e.prototype.getFeatures=function(t){return(0,p.O3)()},e.prototype.getData=function(t){return null},e.prototype.prepareFrame=function(t){return(0,p.O3)()},e.prototype.renderFrame=function(t,e){return(0,p.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()===jn&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=jn&&e!=kn&&t.addEventListener(X.Z.CHANGE,this.boundHandleImageChange_),e==An&&(t.load(),e=t.getState()),e==jn},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==J&&t.changed()},e.prototype.disposeInternal=function(){delete this.layer_,t.prototype.disposeInternal.call(this)},e}(Po.Z);const Mo=Ao;var jo=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)}}(),ko=null;const Do=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=(0,d.Ue)(),i.pixelTransform=(0,d.Ue)(),i.inversePixelTransform=(0,d.Ue)(),i.context=null,i.containerReused=!1,i.pixelContext_=null,i.frameState=null,i}return jo(e,t),e.prototype.getImageData=function(t,e,i){var n,o;ko||((n=document.createElement("canvas")).width=1,n.height=1,ko=n.getContext("2d")),ko.clearRect(0,0,1,1);try{ko.drawImage(t,e,i,1,1,0,0,1,1),o=ko.getImageData(0,0,1,1).data}catch(t){return 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,n){var o,r,a=this.getLayer().getClassName();t&&t.className===a&&""===t.style.opacity&&1===i&&(!n||t.style.backgroundColor&&(0,We.fS)(S(t.style.backgroundColor),S(n)))&&((l=t.firstElementChild)instanceof HTMLCanvasElement&&(r=l.getContext("2d")));if(r&&r.canvas.style.transform===e?(this.container=t,this.context=r,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(o=document.createElement("div")).className=a;var s=o.style;s.position="absolute",s.width="100%",s.height="100%",n&&(s.backgroundColor=n);var l=(r=wt()).canvas;o.appendChild(l),(s=l.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=o,this.context=r}},e.prototype.clipUnrotated=function(t,e,i){var n=(0,f.rL)(i),o=(0,f.Xv)(i),r=(0,f.w$)(i),a=(0,f.hC)(i);(0,d.nn)(e.coordinateToPixelTransform,n),(0,d.nn)(e.coordinateToPixelTransform,o),(0,d.nn)(e.coordinateToPixelTransform,r),(0,d.nn)(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;(0,d.nn)(s,n),(0,d.nn)(s,o),(0,d.nn)(s,r),(0,d.nn)(s,a),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(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var n=this.getLayer();if(n.hasListener(t)){var o=new ct(t,this.inversePixelTransform,i,e);n.dispatchEvent(o)}},e.prototype.preRender=function(t,e){this.frameState=e,this.dispatchRenderEvent_(V,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Y,t,e)},e.prototype.getRenderTransform=function(t,e,i,n,o,r,a){var s=o/2,l=r/2,h=n/e,u=-h,c=-t[0]+a,p=-t[1];return(0,d.qC)(this.tempTransform,s,l,h,u,-i,c,p)},e.prototype.getDataAtPixel=function(t,e,i){var n=(0,d.nn)(this.inversePixelTransform,t.slice()),o=this.context,r=this.getLayer().getExtent();if(r){var a=(0,d.nn)(e.pixelToCoordinateTransform,t.slice());if(!(0,f.b8)(r,a))return null}var s,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),s=u.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?(this.pixelContext_=null,new Uint8Array):s}return 0===s[3]?null:s},e.prototype.disposeInternal=function(){delete this.frameState,t.prototype.disposeInternal.call(this)},e}(Mo),No="Circle",zo="Default",Bo="Image",Go="LineString",Zo="Polygon",Wo="Text";var Uo=i(93918);function Xo(t,e,i,n,o,r,a,s,l,h,u,c){var p=t[e],d=t[e+1],f=0,g=0,v=0,y=0;function m(){f=p,g=d,p=t[e+=n],d=t[e+1],y+=v,v=Math.sqrt((p-f)*(p-f)+(d-g)*(d-g))}do{m()}while(e<i-n&&y+v<r);for(var x=0===v?0:(r-y)/v,b=(0,_.t7)(f,p,x),w=(0,_.t7)(g,d,x),C=e-n,S=y,E=r+s*l(h,o,u);e<i-n&&y+v<E;)m();x=0===v?0:(E-y)/v;var T,R=(0,_.t7)(f,p,x),I=(0,_.t7)(g,d,x);if(c){var O=[b,w,R,I];(0,Uo.U1)(O,0,4,2,c,O,O),T=O[0]>O[2]}else T=b>R;var L,P=Math.PI,F=[],A=C+n===e;if(v=0,y=S,p=t[e=C],d=t[e+1],A){m(),L=Math.atan2(d-g,p-f),T&&(L+=L>0?-P:P);var M=(R+b)/2,j=(I+w)/2;return F[0]=[M,j,(E-r)/2,L,o],F}for(var k=0,D=o.length;k<D;){m();var N=Math.atan2(d-g,p-f);if(T&&(N+=N>0?-P:P),void 0!==L){var z=N-L;if(z+=z>P?-2*P:z<-P?2*P:0,Math.abs(z)>a)return null}L=N;for(var B=k,G=0;k<D;++k){var Z=s*l(h,o[T?D-k-1:k],u);if(e+n<i&&y+v<r+G+Z/2)break;G+=Z}if(k!==B){var W=T?o.substring(D-B,D-k):o.substring(B,k);x=0===v?0:(r+G/2-y)/v;M=(0,_.t7)(f,p,x),j=(0,_.t7)(g,d,x);F.push([M,j,G/2,N,W]),r+=G}}return F}var Vo=i(90045),Yo=(0,f.lJ)(),Ko=[],Ho=[],qo=[],$o=[];function Jo(t){return t[3].declutterBox}var Qo=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 tr(t,e){return"start"!==e&&"end"!==e||Qo.test(t)||(e="start"===e?"left":"right"),Ro[e]}function er(t,e,i){return i>0&&t.push("\n",""),t.push(e,""),t}var ir=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,d.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,a=i?this.fillStates[i]:null,s=this.textStates[e],l=this.pixelRatio,h=[s.scale[0]*l,s.scale[1]*l],u=Array.isArray(t),c=tr(u?t[0]:t,s.textAlign||Pt),p=n&&r.lineWidth?r.lineWidth:0,d=u?t:t.split("\n").reduce(er,[]),f=function(t,e){for(var i=[],n=[],o=[],r=0,a=0,s=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=Zt(p,c);i.push(d),a+=d;var f=Bt(p);n.push(f),l=Math.max(l,f)}else r=Math.max(r,a),o.push(a),a=0,s+=l}return{width:r,height:s,widths:i,heights:n,lineWidths:o}}(s,d),g=f.width,_=f.height,v=f.widths,y=f.heights,m=f.lineWidths,x=g+p,b=[],w=(x+2)*h[0],C=(_+p)*h[1],S={width:w<0?Math.floor(w):Math.ceil(w),height:C<0?Math.floor(C):Math.ceil(C),contextInstructions:b};(1==h[0]&&1==h[1]||b.push("scale",h),n)&&(b.push("strokeStyle",r.strokeStyle),b.push("lineWidth",p),b.push("lineCap",r.lineCap),b.push("lineJoin",r.lineJoin),b.push("miterLimit",r.miterLimit),(bt.Id?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(b.push("setLineDash",[r.lineDash]),b.push("lineDashOffset",r.lineDashOffset)));i&&b.push("fillStyle",a.fillStyle),b.push("textBaseline","middle"),b.push("textAlign","center");for(var E,T=.5-c,R=c*x+T*p,I=[],O=[],L=0,P=0,F=0,A=0,M=0,j=d.length;M<j;M+=2){var k=d[M];if("\n"!==k){var D=d[M+1]||s.font;D!==E&&(n&&I.push("font",D),i&&O.push("font",D),E=D),L=Math.max(L,y[F]);var N=[k,R+T*v[F]+c*(v[F]-m[A]),.5*(p+L)+P];R+=v[F],n&&I.push("strokeText",N),i&&O.push("fillText",N),++F}else P+=L,L=0,R=c*x+T*p,++A}return Array.prototype.push.apply(b,I),Array.prototype.push.apply(b,O),this.labels_[o]=S,S},t.prototype.replayTextBackground_=function(t,e,i,n,o,r,a){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)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,i,n,o,r,a,s,l,h,u,c,p,g,_,v){var y,m=i-(a*=c[0]),x=n-(s*=c[1]),b=o+l>t?t-l:o,w=r+h>e?e-h:r,C=g[3]+b*c[0]+g[1],S=g[0]+w*c[1]+g[2],E=m-g[3],T=x-g[0];return(_||0!==u)&&(Ko[0]=E,$o[0]=E,Ko[1]=T,Ho[1]=T,Ho[0]=E+C,qo[0]=Ho[0],qo[1]=T+S,$o[1]=qo[1]),0!==u?(y=(0,d.qC)((0,d.Ue)(),i,n,1,1,u,-i,-n),(0,d.nn)(y,Ko),(0,d.nn)(y,Ho),(0,d.nn)(y,qo),(0,d.nn)(y,$o),(0,f.T9)(Math.min(Ko[0],Ho[0],qo[0],$o[0]),Math.min(Ko[1],Ho[1],qo[1],$o[1]),Math.max(Ko[0],Ho[0],qo[0],$o[0]),Math.max(Ko[1],Ho[1],qo[1],$o[1]),Yo)):(0,f.T9)(Math.min(E,E+C),Math.min(T,T+S),Math.max(E,E+C),Math.max(T,T+S),Yo),p&&(m=Math.round(m),x=Math.round(x)),{drawImageX:m,drawImageY:x,drawImageW:b,drawImageH:w,originX:l,originY:h,declutterBox:{minX:Yo[0],minY:Yo[1],maxX:Yo[2],maxY:Yo[3],value:v},canvasTransform:y,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,i,n,o,r,a){var s=!(!r&&!a),l=n.declutterBox,h=t.canvas,u=a?a[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&&(s&&this.replayTextBackground_(t,Ko,Ho,qo,$o,r,a),Ut(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,d.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),a=this.strokeStates[i],s=this.pixelRatio,l=tr(Array.isArray(t)?t[0]:t,o.textAlign||Pt),h=Ro[o.textBaseline||Ft],u=a&&a.lineWidth?a.lineWidth:0;return{label:r,anchorX:l*(r.width/s-2*o.scale[0])+2*(.5-l)*u,anchorY:h*r.height/s+2*(.5-h)*u}},t.prototype.execute_=function(t,e,i,n,o,r,a,s){var l;this.pixelCoordinates_&&(0,We.fS)(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=(0,Uo.vT)(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),(0,d.lk)(this.renderedTransform_,i));for(var h,u,c,p,g,_,v,y,m,x,b,w,C,S,E,T,R=0,I=n.length,O=0,L=0,P=0,F=null,A=null,M=this.coordinateCache_,j=this.viewRotation_,k=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,D={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:j},N=this.instructions!=n||this.overlaps?0:200;R<I;){var z=n[R];switch(z[0]){case lo.BEGIN_GEOMETRY:C=z[1],T=z[3],C.getGeometry()?void 0===a||(0,f.kK)(a,T.getExtent())?++R:R=z[2]+1:R=z[2];break;case lo.BEGIN_PATH:L>N&&(this.fill_(t),L=0),P>N&&(t.stroke(),P=0),L||P||(t.beginPath(),p=NaN,g=NaN),++R;break;case lo.CIRCLE:var B=l[O=z[1]],G=l[O+1],Z=l[O+2]-B,W=l[O+3]-G,U=Math.sqrt(Z*Z+W*W);t.moveTo(B+U,G),t.arc(B,G,U,0,2*Math.PI,!0),++R;break;case lo.CLOSE_PATH:t.closePath(),++R;break;case lo.CUSTOM:O=z[1],h=z[2];var X=z[3],V=z[4],Y=6==z.length?z[5]:void 0;D.geometry=X,D.feature=C,R in M||(M[R]=[]);var K=M[R];Y?Y(l,O,h,2,K):(K[0]=l[O],K[1]=l[O+1],K.length=2),V(K,D),++R;break;case lo.DRAW_IMAGE:O=z[1],h=z[2],y=z[3],u=z[4],c=z[5];var H=z[6],q=z[7],$=z[8],J=z[9],Q=z[10],tt=z[11],et=z[12],it=z[13],nt=z[14];if(!y&&z.length>=19){m=z[18],x=z[19],b=z[20],w=z[21];var ot=this.drawLabelWithPointPlacement_(m,x,b,w);y=ot.label,z[3]=y;var rt=z[22];u=(ot.anchorX-rt)*this.pixelRatio,z[4]=u;var at=z[23];c=(ot.anchorY-at)*this.pixelRatio,z[5]=c,H=y.height,z[6]=H,it=y.width,z[13]=it}var st=void 0;z.length>24&&(st=z[24]);var lt=void 0,ht=void 0,ut=void 0;z.length>16?(lt=z[15],ht=z[16],ut=z[17]):(lt=At,ht=!1,ut=!1),Q&&k?tt+=j:Q||k||(tt-=j);for(var ct=0;O<h;O+=2)if(!(st&&st[ct++]<it/this.pixelRatio)){var pt=[t,e,y,Bt=this.calculateImageOrLabelDimensions_(y.width,y.height,l[O],l[O+1],it,H,u,c,$,J,tt,et,o,lt,ht||ut,C),q,ht?F:null,ut?A:null],dt=void 0,ft=void 0;if(s&&nt){var gt=h-O;if(!nt[gt]){nt[gt]=pt;continue}if(dt=nt[gt],delete nt[gt],ft=Jo(dt),s.collides(ft))continue}s&&s.collides(Bt.declutterBox)||(dt&&(s&&s.insert(ft),this.replayImageOrLabel_.apply(this,dt)),s&&s.insert(Bt.declutterBox),this.replayImageOrLabel_.apply(this,pt))}++R;break;case lo.DRAW_CHARS:var _t=z[1],vt=z[2],yt=z[3],mt=z[4];w=z[5];var xt=z[6],bt=z[7],wt=z[8];b=z[9];var Ct=z[10];m=z[11],x=z[12];var St=[z[13],z[13]],Et=this.textStates[x],Tt=Et.font,Rt=[Et.scale[0]*bt,Et.scale[1]*bt],It=void 0;Tt in this.widths_?It=this.widths_[Tt]:(It={},this.widths_[Tt]=It);var Ot=(0,Vo.W)(l,_t,vt,2),Lt=Math.abs(Rt[0])*Wt(Tt,m,It);if(mt||Lt<=Ot){var Pt=this.textStates[x].textAlign,Ft=Xo(l,_t,vt,2,m,(Ot-Lt)*Ro[Pt],xt,Math.abs(Rt[0]),Wt,Tt,It,k?0:this.viewRotation_);t:if(Ft){var Mt=[],jt=void 0,kt=void 0,Dt=void 0,Nt=void 0,zt=void 0;if(b)for(jt=0,kt=Ft.length;jt<kt;++jt){Dt=(zt=Ft[jt])[4],Nt=this.createLabel(Dt,x,"",b),u=zt[2]+(Rt[0]<0?-Ct:Ct),c=yt*Nt.height+2*(.5-yt)*Ct*Rt[1]/Rt[0]-wt;var Bt=this.calculateImageOrLabelDimensions_(Nt.width,Nt.height,zt[0],zt[1],Nt.width,Nt.height,u,c,0,0,zt[3],St,!1,At,!1,C);if(s&&s.collides(Bt.declutterBox))break t;Mt.push([t,e,Nt,Bt,1,null,null])}if(w)for(jt=0,kt=Ft.length;jt<kt;++jt){Dt=(zt=Ft[jt])[4],Nt=this.createLabel(Dt,x,w,""),u=zt[2],c=yt*Nt.height-wt;Bt=this.calculateImageOrLabelDimensions_(Nt.width,Nt.height,zt[0],zt[1],Nt.width,Nt.height,u,c,0,0,zt[3],St,!1,At,!1,C);if(s&&s.collides(Bt.declutterBox))break t;Mt.push([t,e,Nt,Bt,1,null,null])}s&&s.load(Mt.map(Jo));for(var Gt=0,Zt=Mt.length;Gt<Zt;++Gt)this.replayImageOrLabel_.apply(this,Mt[Gt])}}++R;break;case lo.END_GEOMETRY:if(void 0!==r){var Ut=r(C=z[1],T);if(Ut)return Ut}++R;break;case lo.FILL:N?L++:this.fill_(t),++R;break;case lo.MOVE_TO_LINE_TO:for(O=z[1],h=z[2],S=l[O],v=(E=l[O+1])+.5|0,(_=S+.5|0)===p&&v===g||(t.moveTo(S,E),p=_,g=v),O+=2;O<h;O+=2)_=(S=l[O])+.5|0,v=(E=l[O+1])+.5|0,O!=h-2&&_===p&&v===g||(t.lineTo(S,E),p=_,g=v);++R;break;case lo.SET_FILL_STYLE:F=z,this.alignFill_=z[2],L&&(this.fill_(t),L=0,P&&(t.stroke(),P=0)),t.fillStyle=z[1],++R;break;case lo.SET_STROKE_STYLE:A=z,P&&(t.stroke(),P=0),this.setStrokeStyle_(t,z),++R;break;case lo.STROKE:N?P++:t.stroke(),++R;break;default:++R}}L&&this.fill_(t),P&&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 nr=ir;var or=[Zo,No,Go,Bo,Wo,zo],rr=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,d.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 nr(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 a=2*(n=Math.round(n))+1,s=(0,d.qC)(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-i,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=wt(a,a));var h,u=this.hitDetectionContext_;u.canvas.width!==a||u.canvas.height!==a?(u.canvas.width=a,u.canvas.height=a):l||u.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(h=(0,f.lJ)(),(0,f.Wj)(h,t),(0,f.f3)(h,e*(this.renderBuffer_+n),h));var c,p=function(t){if(void 0!==ar[t])return ar[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 a=o*o+r*r;if(a>i)break;var s=n[a];s||(s=[],n[a]=s),s.push(4*((t+o)*e+(t+r))+3),o>0&&s.push(4*((t-o)*e+(t+r))+3),r>0&&(s.push(4*((t+o)*e+(t-r))+3),o>0&&s.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 ar[t]=l,l}(n);function g(t,e){for(var i=u.getImageData(0,0,a,a).data,s=0,l=p.length;s<l;s++)if(i[p[s]]>0){if(!r||c!==Bo&&c!==Wo||-1!==r.indexOf(t)){var h=(p[s]-3)/4,d=n-h%a,f=n-(h/a|0),g=o(t,e,d*d+f*f);if(g)return g}u.clearRect(0,0,a,a);break}}var _,v,y,m,x,b=Object.keys(this.executorsByZIndex_).map(Number);for(b.sort(We.kK),_=b.length-1;_>=0;--_){var w=b[_].toString();for(y=this.executorsByZIndex_[w],v=or.length-1;v>=0;--v)if(void 0!==(m=y[c=or[v]])&&(x=m.executeHitDetection(u,s,i,g,h)))return x}},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],a=[i,n,i,r,o,r,o,n];return(0,Uo.vT)(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return(0,Z.xb)(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,n,o,r,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(We.kK),this.maxExtent_&&(t.save(),this.clip(t,i));var l,h,u,c,p,d,f=r||or;for(a&&s.reverse(),l=0,h=s.length;l<h;++l){var g=s[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,a)}}this.maxExtent_&&t.restore()},t}(),ar={};const sr=rr;var lr=i(80354),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)}}();const ur=function(t){function e(e,i,n,o,r,a,s){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=n,l.transform_=o,l.viewRotation_=r,l.squaredTolerance_=a,l.userTransform_=s,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,d.Ue)(),l}return hr(e,t),e.prototype.drawImages_=function(t,e,i,n){if(this.image_){var o=(0,Uo.vT)(t,e,i,n,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.tmpLocalTransform_,s=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=s*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 f=c+this.imageAnchorX_,g=p+this.imageAnchorY_;(0,d.qC)(a,f,g,1,1,l,-f,-g),r.setTransform.apply(r,a),r.translate(f,g),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=s)}},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,Uo.vT)(t,e,i,n,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=n){var s=o[e]+this.textOffsetX_,l=o[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var h=(0,d.qC)(this.tmpLocalTransform_,s,l,1,1,a,-s,-l);r.setTransform.apply(r,h),r.translate(s,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_,s,l),this.textFillState_&&r.fillText(this.text_,s,l)}}},e.prototype.moveToLineTo_=function(t,e,i,n,o){var r=this.context_,a=(0,Uo.vT)(t,e,i,n,this.transform_,this.pixelCoordinates_);r.moveTo(a[0],a[1]);var s=a.length;o&&(s-=2);for(var l=2;l<s;l+=2)r.lineTo(a[l],a[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,f.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,lr.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 Me.Z.POINT:this.drawPoint(t);break;case Me.Z.LINE_STRING:this.drawLineString(t);break;case Me.Z.POLYGON:this.drawPolygon(t);break;case Me.Z.MULTI_POINT:this.drawMultiPoint(t);break;case Me.Z.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case Me.Z.MULTI_POLYGON:this.drawMultiPolygon(t);break;case Me.Z.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case Me.Z.CIRCLE:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&(0,f.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,f.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,f.kK)(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,n=t.getFlatCoordinates(),o=0,r=t.getEnds(),a=t.getStride();i.beginPath();for(var s=0,l=r.length;s<l;++s)o=this.moveToLineTo_(n,o,r[s],a,!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,f.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,f.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 a=0,s=o.length;a<s;++a){var l=o[a];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,We.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:Pt;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:zn(n||Tt)}}else this.fillState_=null;if(e){var o=e.getColor(),r=e.getLineCap(),a=e.getLineDash(),s=e.getLineDashOffset(),l=e.getLineJoin(),h=e.getWidth(),u=e.getMiterLimit(),c=a||It;this.strokeState_={lineCap:void 0!==r?r:Rt,lineDash:1===this.pixelRatio_?c:c.map((function(t){return t*i.pixelRatio_})),lineDashOffset:(s||0)*this.pixelRatio_,lineJoin:void 0!==l?l:Ot,lineWidth:(void 0!==h?h:1)*this.pixelRatio_,miterLimit:void 0!==u?u:10,strokeStyle:zn(o||Lt)}}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:zn(i||Tt)}}else this.textFillState_=null;var n=t.getStroke();if(n){var o=n.getColor(),r=n.getLineCap(),a=n.getLineDash(),s=n.getLineDashOffset(),l=n.getLineJoin(),h=n.getWidth(),u=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:Rt,lineDash:a||It,lineDashOffset:s||0,lineJoin:void 0!==l?l:Ot,lineWidth:void 0!==h?h:1,miterLimit:void 0!==u?u:10,strokeStyle:zn(o||Lt)}}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:Et,textAlign:void 0!==y?y:Pt,textBaseline:void 0!==m?m:Ft},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}(uo),cr="fraction",pr="pixels",dr="bottom-left",fr="bottom-right",gr="top-left",_r="top-right";var vr=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 yr=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 vr(e,t),e.prototype.changed=function(){this.dispatchEvent(X.Z.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return(0,p.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,p.O3)()},e}(xt.Z);var mr=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,a){var s=t.call(this,e,i,n,An)||this;return s.src_=o,s.image_=new Image,null!==r&&(s.image_.crossOrigin=r),s.unlisten_=null,s.state=An,s.imageLoadFunction_=a,s}mr(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=kn,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=(0,f.Cr)(this.extent)/this.image_.height),this.state=jn,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=An&&this.state!=kn||(this.state=Mn,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=xr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=(0,f.Cr)(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(yr);function xr(t,e,i){var n=t,o=!0,r=!1,a=!1,s=[(0,Q.Vx)(n,X.Z.LOAD,(function(){a=!0,r||e()}))];return n.src&&bt.Tp?(r=!0,n.decode().then((function(){o&&e()})).catch((function(t){o&&(a?e():i())}))):s.push((0,Q.Vx)(n,X.Z.ERROR,i)),function(){o=!1,s.forEach(Q.bN)}}var br=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)}}(),wr=null,Cr=function(t){function e(e,i,n,o,r,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==o&&(s.image_.crossOrigin=o),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=r,s.size_=n,s.src_=i,s.tainted_,s}return br(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===jn){wr||(wr=wt(1,1)),wr.drawImage(this.image_,0,0);try{wr.getImageData(0,0,1,1),this.tainted_=!1}catch(t){wr=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(X.Z.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=kn,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=jn,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=wt(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_==An){this.imageState_=Mn;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=xr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===jn){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=m(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,a=this.color_[1]/255,s=this.color_[2]/255,l=this.color_[3],h=0,u=o.length;h<u;h+=4)o[h]*=r,o[h+1]*=a,o[h+2]*=s,o[h+3]*=l;i.putImageData(n,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(xt.Z);var Sr=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,a=void 0!==n.scale?n.scale:1,s=void 0!==n.rotateWithView&&n.rotateWithView;(i=t.call(this,{opacity:o,rotation:r,scale:a,displacement:void 0!==n.displacement?n.displacement:[0,0],rotateWithView:s})||this).anchor_=void 0!==n.anchor?n.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=void 0!==n.anchorOrigin?n.anchorOrigin:gr,i.anchorXUnits_=void 0!==n.anchorXUnits?n.anchorXUnits:cr,i.anchorYUnits_=void 0!==n.anchorYUnits?n.anchorYUnits:cr,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,g.h)(!(void 0!==h&&l),4),(0,g.h)(!l||l&&i.imgSize_,5),void 0!==h&&0!==h.length||!l||(h=l.src||(0,p.sq)(l)),(0,g.h)(void 0!==h&&h.length>0,6);var u=void 0!==n.src?An:jn;return i.color_=void 0!==n.color?S(n.color):null,i.iconImage_=function(t,e,i,n,o,r){var a=O.get(e,n,r);return a||(a=new Cr(t,e,i,n,o,r),O.set(e,n,r,a)),a}(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:gr,i.origin_=null,i.size_=void 0!==n.size?n.size:null,i}return Sr(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()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==cr||this.anchorYUnits_==cr){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==cr&&(t[0]*=e[0]),this.anchorYUnits_==cr&&(t[1]*=e[1])}if(this.anchorOrigin_!=gr){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=_r&&this.anchorOrigin_!=fr||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=dr&&this.anchorOrigin_!=fr||(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_!=gr){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=_r&&this.offsetOrigin_!=fr||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=dr&&this.offsetOrigin_!=fr||(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(X.Z.CHANGE,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(X.Z.CHANGE,t)},e}(Nn);const Tr=Er;var Rr=.5;var Ir={Point:function(t,e,i,n,o){var r,a=i.getImage(),s=i.getText();o&&(t=o,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=jn)return;var l=t.getBuilder(i.getZIndex(),Bo);l.setImageStyle(a,r),l.drawPoint(e,n)}if(s&&s.getText()){var h=t.getBuilder(i.getZIndex(),Wo);h.setTextStyle(s,r),h.drawText(e,n)}},LineString:function(t,e,i,n,o){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Go);a.setFillStrokeStyle(null,r),a.drawLineString(e,n)}var s=i.getText();if(s&&s.getText()){var l=(o||t).getBuilder(i.getZIndex(),Wo);l.setTextStyle(s),l.drawText(e,n)}},Polygon:function(t,e,i,n,o){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Zo);s.setFillStrokeStyle(r,a),s.drawPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var h=(o||t).getBuilder(i.getZIndex(),Wo);h.setTextStyle(l),h.drawText(e,n)}},MultiPoint:function(t,e,i,n,o){var r,a=i.getImage(),s=i.getText();o&&(t=o,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=jn)return;var l=t.getBuilder(i.getZIndex(),Bo);l.setImageStyle(a,r),l.drawMultiPoint(e,n)}if(s&&s.getText()){var h=(o||t).getBuilder(i.getZIndex(),Wo);h.setTextStyle(s,r),h.drawText(e,n)}},MultiLineString:function(t,e,i,n,o){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Go);a.setFillStrokeStyle(null,r),a.drawMultiLineString(e,n)}var s=i.getText();if(s&&s.getText()){var l=(o||t).getBuilder(i.getZIndex(),Wo);l.setTextStyle(s),l.drawText(e,n)}},MultiPolygon:function(t,e,i,n,o){var r=i.getFill(),a=i.getStroke();if(a||r){var s=t.getBuilder(i.getZIndex(),Zo);s.setFillStrokeStyle(r,a),s.drawMultiPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var h=(o||t).getBuilder(i.getZIndex(),Wo);h.setTextStyle(l),h.drawText(e,n)}},GeometryCollection:function(t,e,i,n,o){var r,a,s=e.getGeometriesArray();for(r=0,a=s.length;r<a;++r){(0,Ir[s[r].getType()])(t,s[r],i,n,o)}},Circle:function(t,e,i,n,o){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),No);s.setFillStrokeStyle(r,a),s.drawCircle(e,n)}var l=i.getText();if(l&&l.getText()){var h=(o||t).getBuilder(i.getZIndex(),Wo);h.setTextStyle(l),h.drawText(e,n)}}};function Or(t,e){return parseInt((0,p.sq)(t),10)-parseInt((0,p.sq)(e),10)}function Lr(t,e){return.5*t/e}function Pr(t,e,i,n,o,r,a){var s=!1,l=i.getImage();if(l){var h=l.getImageState();h==jn||h==kn?l.unlistenImageChange(o):(h==An&&l.load(),h=l.getImageState(),l.listenImageChange(o),s=!0)}return function(t,e,i,n,o,r){var a=i.getGeometryFunction()(e);if(!a)return;var s=a.simplifyTransformed(n,o);if(i.getRenderer())Fr(t,s,i,e);else{(0,Ir[s.getType()])(t,s,i,e,r)}}(t,e,i,n,r,a),s}function Fr(t,e,i,n){if(e.getType()!=Me.Z.GEOMETRY_COLLECTION)t.getBuilder(i.getZIndex(),zo).drawCustom(e,n,i.getRenderer(),i.getHitDetectionRenderer());else for(var o=e.getGeometries(),r=0,a=o.length;r<a;++r)Fr(t,o[r],i,n)}var Ar=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)}}(),Mr=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.animatingOrInteracting_,i.dirty_=!1,i.hitDetectionImageData_=null,i.renderedFeatures_=null,i.renderedRevision_=-1,i.renderedResolution_=NaN,i.renderedExtent_=(0,f.lJ)(),i.wrappedRenderedExtent_=(0,f.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}return Ar(e,t),e.prototype.renderWorlds=function(t,e,i){var n=e.extent,o=e.viewState,r=o.center,a=o.resolution,s=o.projection,l=o.rotation,h=s.getExtent(),u=this.getLayer().getSource(),c=e.pixelRatio,p=e.viewHints,d=!(p[ke]||p[De]),g=this.context,_=Math.round(e.size[0]*c),v=Math.round(e.size[1]*c),y=u.getWrapX()&&s.canWrapX(),m=y?(0,f.dz)(h):null,x=y?Math.ceil((n[2]-h[2])/m)+1:1,b=y?Math.floor((n[0]-h[0])/m):0;do{var w=this.getRenderTransform(r,a,l,c,_,v,b*m);t.execute(g,1,w,l,d,void 0,i)}while(++b<x)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var i=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];(0,d.n3)(this.pixelTransform,1/i,1/i),(0,d.nb)(this.inversePixelTransform,this.pixelTransform);var o=(0,d.BB)(this.pixelTransform);this.useContainer(e,o,n.opacity,this.getBackground(t));var r=this.context,a=r.canvas,s=this.replayGroup_,l=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!l||l.isEmpty()))return null;var h=Math.round(t.size[0]*i),u=Math.round(t.size[1]*i);a.width!=h||a.height!=u?(a.width=h,a.height=u,a.style.transform!==o&&(a.style.transform=o)):this.containerReused||r.clearRect(0,0,h,u),this.preRender(r,t);var c=t.viewState,p=c.projection,g=!1,_=!0;if(n.extent&&this.clipping){var v=(0,Be.dY)(n.extent,p);(g=(_=(0,f.kK)(v,t.extent))&&!(0,f.r4)(v,t.extent))&&this.clipUnrotated(r,t,v)}_&&this.renderWorlds(s,t),g&&r.restore(),this.postRender(r,t);var y=mt(n.opacity),m=this.container;return y!==m.style.opacity&&(m.style.opacity=y),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,d.nn)(this.pixelTransform,i);var n=this.renderedCenter_,o=this.renderedResolution_,r=this.renderedRotation_,a=this.renderedProjection_,s=this.wrappedRenderedExtent_,l=this.getLayer(),h=[],u=i[0]*Rr,c=i[1]*Rr;h.push(this.getRenderTransform(n,o,r,Rr,u,c,0).slice());var p=l.getSource(),g=a.getExtent();if(p.getWrapX()&&a.canWrapX()&&!(0,f.r4)(g,s)){for(var v=s[0],y=(0,f.dz)(g),m=0,x=void 0;v<g[0];)x=y*--m,h.push(this.getRenderTransform(n,o,r,Rr,u,c,x).slice()),v+=y;for(m=0,v=s[2];v>g[2];)x=y*++m,h.push(this.getRenderTransform(n,o,r,Rr,u,c,x).slice()),v-=y}this.hitDetectionImageData_=function(t,e,i,n,o,r,a){var s=wt(t[0]*Rr,t[1]*Rr);s.imageSmoothingEnabled=!1;for(var l=s.canvas,h=new ur(s,Rr,o,null,a),u=i.length,c=Math.floor(16777215/u),p={},d=1;d<=u;++d){var g=i[d-1],_=g.getStyleFunction()||n;if(n){var v=_(g,r);if(v){Array.isArray(v)||(v=[v]);for(var y="#"+("000000"+(d*c).toString(16)).slice(-6),m=0,x=v.length;m<x;++m){var b=v[m],w=b.getGeometryFunction()(g);if(w&&(0,f.kK)(o,w.getExtent())){var C=b.clone(),S=C.getFill();S&&S.setColor(y);var E=C.getStroke();E&&(E.setColor(y),E.setLineDash(null)),C.setText(void 0);var T=b.getImage();if(T&&0!==T.getOpacity()){var R=T.getImageSize();if(!R)continue;var I=wt(R[0],R[1],void 0,{alpha:!1}),O=I.canvas;I.fillStyle=y,I.fillRect(0,0,O.width,O.height),C.setImage(new Tr({img:O,imgSize:R,anchor:T.getAnchor(),anchorXUnits:pr,anchorYUnits:pr,offset:T.getOrigin(),opacity:1,size:T.getSize(),scale:T.getScale(),rotation:T.getRotation(),rotateWithView:T.getRotateWithView()}))}var L=C.getZIndex()||0;(A=p[L])||(A={},p[L]=A,A[Me.Z.POLYGON]=[],A[Me.Z.CIRCLE]=[],A[Me.Z.LINE_STRING]=[],A[Me.Z.POINT]=[]),A[w.getType().replace("Multi","")].push(w,C)}}}}}for(var P=Object.keys(p).map(Number).sort(We.kK),F=(d=0,P.length);d<F;++d){var A=p[P[d]];for(var M in A){var j=A[M];for(m=0,x=j.length;m<x;m+=2){h.setStyle(j[m+1]);for(var k=0,D=e.length;k<D;++k)h.setTransform(e[k]),h.drawGeometry(j[m])}}}return s.getImageData(0,0,l.width,l.height)}(i,h,this.renderedFeatures_,l.getStyleFunction(),s,o,r)}e(function(t,e,i){var n=[];if(i){var o=Math.floor(Math.round(t[0])*Rr),r=Math.floor(Math.round(t[1])*Rr),a=4*((0,_.uZ)(o,0,i.width-1)+(0,_.uZ)(r,0,i.height-1)*i.width),s=i.data[a],l=i.data[a+1],h=i.data[a+2]+256*(l+256*s),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 a,s=e.viewState.resolution,l=e.viewState.rotation,h=this.getLayer(),u={},c=function(t,e,i){var r=(0,p.sq)(t),a=u[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return u[r]=!0,o.splice(o.lastIndexOf(a),1),n(t,h,e);a.geometry=e,a.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})}},d=[this.replayGroup_];return this.declutterExecutorGroup&&d.push(this.declutterExecutorGroup),d.some((function(n){return a=n.forEachFeatureAtCoordinate(t,s,l,i,c,n===r.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map((function(t){return t.value})):null)})),a}},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[ke],o=t.viewHints[De],r=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!r&&n||!a&&o)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,l=t.viewState,h=l.projection,u=l.resolution,c=t.pixelRatio,p=e.getRevision(),d=e.getRenderBuffer(),g=e.getRenderOrder();void 0===g&&(g=Or);var _=l.center.slice(),v=(0,f.f3)(s,d*u),y=v.slice(),m=[v.slice()],x=h.getExtent();if(i.getWrapX()&&h.canWrapX()&&!(0,f.r4)(x,t.extent)){var b=(0,f.dz)(x),w=Math.max((0,f.dz)(v)/2,b);v[0]=x[0]-w,v[2]=x[2]+w,(0,ot.Cf)(_,h);var C=(0,f.Cf)(m[0],h);C[0]<x[0]&&C[2]<x[2]?m.push([C[0]+b,C[1],C[2]+b,C[3]]):C[0]>x[0]&&C[2]>x[2]&&m.push([C[0]-b,C[1],C[2]-b,C[3]])}if(!this.dirty_&&this.renderedResolution_==u&&this.renderedRevision_==p&&this.renderedRenderOrder_==g&&(0,f.r4)(this.wrappedRenderedExtent_,v))return(0,We.fS)(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=_,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var S,E=new Lo(Lr(u,c),v,u,c);this.getLayer().getDeclutter()&&(S=new Lo(Lr(u,c),v,u,c));var T,R=(0,Be.Cs)();if(R){for(var I=0,O=m.length;I<O;++I){var L=m[I],P=(0,Be.Fj)(L,h);i.loadFeatures(P,(0,Be.on)(u,h),R)}T=(0,Be.WO)(R,h)}else for(I=0,O=m.length;I<O;++I)i.loadFeatures(m[I],u,h);var F=function(t,e){var i=Lr(t,e);return i*i}(u,c),A=function(t){var i,n=t.getStyleFunction()||e.getStyleFunction();if(n&&(i=n(t,u)),i){var o=this.renderFeature(t,F,i,E,T,S);this.dirty_=this.dirty_||o}}.bind(this),M=(0,Be.Fj)(v,h),j=i.getFeaturesInExtent(M);g&&j.sort(g);for(I=0,O=j.length;I<O;++I)A(j[I]);this.renderedFeatures_=j;var k=E.finish(),D=new sr(v,u,c,i.getOverlaps(),k,e.getRenderBuffer());return S&&(this.declutterExecutorGroup=new sr(v,u,c,i.getOverlaps(),S.finish(),e.getRenderBuffer())),this.renderedResolution_=u,this.renderedRevision_=p,this.renderedRenderOrder_=g,this.renderedExtent_=y,this.wrappedRenderedExtent_=v,this.renderedCenter_=_,this.renderedProjection_=h,this.replayGroup_=D,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,n,o,r){if(!i)return!1;var a=!1;if(Array.isArray(i))for(var s=0,l=i.length;s<l;++s)a=Pr(n,t,i[s],e,this.boundHandleStyleImageChange_,o,r)||a;else a=Pr(n,t,i,e,this.boundHandleStyleImageChange_,o,r);return a},e}(Do);const jr=Mr;var 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)}}();const Dr=function(t){function e(e){return t.call(this,e)||this}return kr(e,t),e.prototype.createRenderer=function(){return new jr(this)},e}(io);var Nr=i(99918),zr=i(80574),Br=i(21169),Gr=i(45916);class Zr extends n.PureComponent{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,"style",Wr(r.config.theme))}render(){const{topRight:t,bottomLeft:e}=this.props;return(0,Gr.jsxs)("div",{className:this.style.overlay,children:[Boolean(null==t?void 0:t.length)&&(0,Gr.jsx)("div",{className:this.style.TR,children:t}),Boolean(null==e?void 0:e.length)&&(0,Gr.jsx)("div",{className:this.style.BL,style:this.props.blStyle,children:e})]})}}const Wr=(0,a.stylesFactory)((t=>({overlay:s.css`
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 500;
    pointer-events: none;
  `,TR:s.css`
    position: absolute;
    top: 8px;
    right: 8px;
    pointer-events: auto;
  `,BL:s.css`
    position: absolute;
    bottom: 8px;
    left: 8px;
    pointer-events: auto;
  `})));var Ur=i(4914),Xr=i(46386),Vr=i(6347),Yr=i(95716);const Kr=["geometry"];const Hr=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(),Kr);e=new o.ArrayDataFrame([t])}return(0,Gr.jsx)(Yr.H,{data:e,rowIndex:n})},qr=t=>{let{layers:e,activeTabIndex:i}=t;const o=(0,a.useStyles2)(Jr),[r,s]=(0,n.useState)(new Map);return(0,Gr.jsx)(a.TabContent,{children:e.map(((t,e)=>e===i&&(0,Gr.jsx)("div",{children:(0,Gr.jsx)("div",{children:t.features.map(((e,i)=>{var n;const l=null!==(n=e.getId())&&void 0!==n?n:i;return t.features.length>1?(0,Gr.jsx)(a.Collapse,{collapsible:!0,label:$r(e,i),isOpen:r.get(l),onToggle:()=>{((t,e)=>{s(new Map(r.set(t,e)))})(l,!r.get(l))},className:o.collapsibleRow,children:(0,Gr.jsx)(Hr,{feature:e})},l):(0,Gr.jsx)(Hr,{feature:e},l)}))})},t.layer.getName())))})},$r=(t,e)=>{const i=["Name","name","Title","ID","id"];let n=t.getProperties(),r="";const a=t.get("frame");if(a){const e=t.get("rowIndex");for(const t of a.fields)if(t.type===o.FieldType.string){const i=(0,o.getFieldDisplayName)(t,a);r||(r=i),n[i]=t.values.get(e)}}for(let t of i){const e=n[t];if(e)return e}if(r)return`${r}: ${n[r]}`;for(let t of Object.keys(n)){const e=n[t];if((0,h.isString)(e))return`${t}: ${e}`}return`Match: ${e+1}`},Jr=t=>({collapsibleRow:s.css`
    margin-bottom: 0px;
  `}),Qr=t=>{let{layers:e,setActiveTabIndex:i,activeTabIndex:n}=t;return(0,Gr.jsx)(a.TabsBar,{children:e&&e.map(((t,e)=>(0,Gr.jsx)(a.Tab,{label:t.layer.getName(),active:e===n,counter:t.features.length>1?t.features.length:null,onChangeTab:()=>{i(e)}},e)))})},ta=t=>{let{layers:e,onClose:i,isOpen:o}=t;const[r,a]=(0,n.useState)(0);return e?(0,Gr.jsxs)(Gr.Fragment,{children:[o&&(0,Gr.jsx)(Vr.P,{style:{zIndex:1},onClick:i}),(0,Gr.jsx)(Qr,{layers:e,setActiveTabIndex:a,activeTabIndex:r}),(0,Gr.jsx)(qr,{layers:e,activeTabIndex:r})]}):null},ea=t=>{let{ttip:e,onClose:i,isOpen:o}=t;const r=(0,n.createRef)(),{overlayProps:s}=(0,Xr.Ir)({onClose:i,isDismissable:!0,isOpen:o},r),{dialogProps:l}=(0,Ur.R)({},r);return(0,Gr.jsx)(Gr.Fragment,{children:e&&e.layers&&(0,Gr.jsx)(a.VizTooltipContainer,{position:{x:e.pageX,y:e.pageY},offset:{x:10,y:10},allowPointerEvents:!0,children:(0,Gr.jsx)("section",Object.assign({ref:r},s,l,{children:(0,Gr.jsx)(ta,{layers:e.layers,isOpen:o,onClose:i})}))})})};var ia,na,oa=i(35008),ra=i.n(oa),aa=i(78837);function sa(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class la extends n.PureComponent{constructor(t){super(t),sa(this,"style",ha(aa.vc.theme)),sa(this,"updateViewState",(()=>{const t=this.props.map.getView();this.setState({zoom:t.getZoom(),center:(0,Be.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,Gr.jsx)("div",{className:this.style.infoWrap,children:(0,Gr.jsx)("table",{children:(0,Gr.jsxs)("tbody",{children:[(0,Gr.jsxs)("tr",{children:[ia||(ia=(0,Gr.jsx)("th",{children:"Zoom:"})),(0,Gr.jsx)("td",{children:null==t?void 0:t.toFixed(1)})]}),(0,Gr.jsxs)("tr",{children:[na||(na=(0,Gr.jsx)("th",{children:"Center: "})),(0,Gr.jsxs)("td",{children:[e[0].toFixed(5),", ",e[1].toFixed(5)]})]})]})})})}}const ha=(0,a.stylesFactory)((t=>({infoWrap:s.css`
    color: ${t.colors.text};
    background: ${ra()(t.colors.panelBg).setAlpha(.7).toString()};
    border-radius: 2px;
    padding: 8px;
  `})));i(73658);var ua=i(56536),ca=i(48567);class pa 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,Gr.jsx)(this.props.child,Object.assign({},t))}}var da,fa=i(45062),ga=i(36845),_a=i(11146),va=i(81952),ya=i(62597),ma=i(2937);function xa(t){var e,i,r,l,h,u,c;const{layerName:p,styleConfig:d,layer:f}=t,g=(0,a.useStyles2)(ba),_=(0,ya.Z)(null!==(e=null==f||null===(i=f.__state)||void 0===i?void 0:i.mouseEvents)&&void 0!==e?e:(0,ma.of)(void 0)),v=null==d||null===(r=d.dims)||void 0===r||null===(l=r.color)||void 0===l?void 0:l.field,y=(0,n.useMemo)((()=>{if(!v||!_)return;const t=_.getProperties();if(!t.frame)return;const e=t.rowIndex;return v.values.get(e)}),[_,v]);if(!d)return(0,Gr.jsx)(Gr.Fragment,{});const{color:m,opacity:x}=null!==(h=null==d?void 0:d.base)&&void 0!==h?h:{},b=null==d||null===(u=d.config.symbol)||void 0===u?void 0:u.fixed;if(m&&b&&!v)return(0,Gr.jsxs)("div",{className:g.infoWrap,children:[(0,Gr.jsx)("div",{className:g.layerName,children:p}),(0,Gr.jsx)("div",{className:(0,s.cx)(g.layerBody,g.fixedColorContainer),children:(0,Gr.jsx)(_a.Z,{src:`public/${b}`,className:g.legendSymbol,title:"Symbol",style:{fill:m,opacity:x}})})]});if(!v)return(0,Gr.jsx)(Gr.Fragment,{});const w=(0,o.getFieldColorModeForField)(v);if(w.isContinuous&&w.getColors){const t=w.getColors(aa.vc.theme2),e=(0,ga.dz)(v),i=v.display?t=>(0,o.formattedValueToString)(v.display(t)):t=>`${t}`;return(0,Gr.jsxs)("div",{className:g.infoWrap,children:[(0,Gr.jsx)("div",{className:g.layerName,children:p}),(0,Gr.jsx)("div",{className:(0,s.cx)(g.layerBody,g.colorScaleWrapper),children:(0,Gr.jsx)(va.q,{hoverValue:y,colorPalette:t,min:e.min,max:e.max,display:i,useStopsPercentage:!1})})]})}const C=null==v||null===(c=v.config)||void 0===c?void 0:c.thresholds;if(!C||C.steps.length<2)return da||(da=(0,Gr.jsx)("div",{}));const S=(0,fa.Ur)(v.config,aa.vc.theme2);return(0,Gr.jsxs)("div",{className:g.infoWrap,children:[(0,Gr.jsx)("div",{className:g.layerName,children:p}),(0,Gr.jsx)("div",{className:(0,s.cx)(g.layerBody,g.legend),children:S.map(((t,e)=>(0,Gr.jsxs)("div",{className:g.legendItem,children:[(0,Gr.jsx)("i",{style:{background:t.color}}),t.label]},`${e}/${t.label}`)))})]})}const ba=t=>({infoWrap:s.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:s.css`
    font-size: ${t.typography.body.fontSize};
  `,layerBody:s.css`
    padding-left: 10px;
  `,legend:s.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:s.css`
    white-space: nowrap;
  `,fixedColorContainer:s.css`
    min-width: 80px;
    font-size: ${t.typography.bodySmall.fontSize};
    padding-top: 5px;
  `,legendSymbol:s.css`
    height: 18px;
    width: 18px;
    margin: auto;
  `,colorScaleWrapper:s.css`
    min-width: 200px;
    font-size: ${t.typography.bodySmall.fontSize};
    padding-top: 10px;
  `});var wa=i(61928);let Ca;!function(t){t.Point="point",t.Line="line",t.Polygon="polygon",t.Any="*any*"}(Ca||(Ca={}));let Sa,Ea;!function(t){t.Left="left",t.Center="center",t.Right="right"}(Sa||(Sa={})),function(t){t.Top="top",t.Middle="middle",t.Bottom="bottom"}(Ea||(Ea={}));const Ta=Object.freeze({size:{fixed:5,min:2,max:15},color:{fixed:"dark-green"},opacity:.4,symbol:{mode:ca.Q8.Fixed,fixed:"img/icons/marker/circle.svg"},textConfig:{fontSize:12,textAlign:Sa.Center,textBaseline:Ea.Middle,offsetX:0,offsetY:0},rotation:{fixed:0,mode:ca.eK.Mod,min:-360,max:360}});var Ra=i(85282),Ia=i(16386),Oa=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_=ai(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Vn({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:Co,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(),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.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_=ai(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.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 La=Oa;var Pa;!function(t){t.circle="circle",t.square="square",t.triangle="triangle",t.star="star",t.cross="cross",t.x="x"}(Pa||(Pa={}));const Fa="img/icons/marker/circle.svg",Aa="img/icons/marker/square.svg",Ma="img/icons/marker/triangle.svg",ja="img/icons/marker/star.svg",ka="img/icons/marker/cross.svg",Da="img/icons/marker/x-mark.svg";function Na(t){const e=null==t.opacity?.8:t.opacity;if(1===e)return new Vn({color:t.color});if(e>0){const i=ra()(t.color).setAlpha(e).toRgbString();return new Vn({color:i})}}const za=t=>{var e;if(!t.text)return;const i=r.config.theme2.typography.fontFamily,n=Object.assign({},Ta.textConfig,t.textConfig);return new La(Object.assign({text:t.text,fill:new Vn({color:null!==(e=t.color)&&void 0!==e?e:Ta.color.fixed}),font:`normal ${n.fontSize}px ${i}`},n))},Ba=t=>new Jn({text:za(t)}),Ga=t=>{var e,i;const n=new Yn({color:t.color,width:null!==(e=t.lineWidth)&&void 0!==e?e:1});return new Jn({image:new Xn({stroke:n,fill:Na(t),radius:null!==(i=t.size)&&void 0!==i?i:5}),text:za(t),stroke:n})},Za=t=>{var e;return new Jn({fill:Na(t),stroke:new Yn({color:t.color,width:null!==(e=t.lineWidth)&&void 0!==e?e:1}),text:za(t)})},Wa=t=>{var e;const i=null!==(e=t.size)&&void 0!==e?e:5,n=new Yn({color:"#F00",width:1});return[new Jn({image:new Zn({stroke:n,points:4,radius:i,angle:Math.PI/4})}),new Jn({image:new Zn({stroke:n,points:4,radius:i,radius2:0,angle:0})})]},Ua=[{id:Pa.circle,name:"Circle",aliasIds:[Fa],make:Ga},{id:Pa.square,name:"Square",aliasIds:[Aa],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 Jn({image:new Zn({stroke:new Yn({color:t.color,width:null!==(n=t.lineWidth)&&void 0!==n?n:1}),fill:Na(t),points:4,radius:o,rotation:r*Math.PI/180+Math.PI/4}),text:za(t)})}},{id:Pa.triangle,name:"Triangle",aliasIds:[Ma],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 Jn({image:new Zn({stroke:new Yn({color:t.color,width:null!==(n=t.lineWidth)&&void 0!==n?n:1}),fill:Na(t),points:3,radius:o,rotation:r*Math.PI/180,angle:0}),text:za(t)})}},{id:Pa.star,name:"Star",aliasIds:[ja],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 Jn({image:new Zn({stroke:new Yn({color:t.color,width:null!==(n=t.lineWidth)&&void 0!==n?n:1}),fill:Na(t),points:5,radius:o,radius2:.4*o,angle:0,rotation:r*Math.PI/180}),text:za(t)})}},{id:Pa.cross,name:"Cross",aliasIds:[ka],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 Jn({image:new Zn({stroke:new Yn({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:za(t)})}},{id:Pa.x,name:"X",aliasIds:[Da],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 Jn({image:new Zn({stroke:new Yn({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:za(t)})}}];const Xa=new o.Registry((()=>Ua));async function Va(t,e){if(!t)return e?Ba:Ga;let i=Xa.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;const o=(new DOMParser).parseFromString(t,"image/svg+xml").getElementsByTagName("svg")[0];if(!o)return"";const r=null!=e?e:100,a=null!==(i=o.getAttribute("width"))&&void 0!==i?i:r,s=null!==(n=o.getAttribute("height"))&&void 0!==n?n:r;o.setAttribute("fill","#fff"),o.setAttribute("width",`${a}px`),o.setAttribute("height",`${s}px`);const l=(new XMLSerializer).serializeToString(o);return`data:image/svg+xml,${encodeURIComponent(l)}`})).catch((t=>(console.error(t),"")))}((0,ca.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,a=null!==(n=t.rotation)&&void 0!==n?n:0;return[new Jn({image:new Tr({src:e,color:t.color,opacity:null!==(o=t.opacity)&&void 0!==o?o:1,scale:(5+r)/100,rotation:a*Math.PI/180}),text:null!=t&&t.text?za(t):void 0}),new Jn({image:new Zn({fill:new Vn({color:"rgba(0,0,0,0)"}),points:4,radius:t.size,rotation:a*Math.PI/180+Math.PI/4})})]}:Wa},Xa.register(i),i.make}return Wa}function Ya(t){var e,i;const n=null==t?void 0:t.text;return!!n&&(!(n.mode!==ca.xy.Fixed||null===(e=n.fixed)||void 0===e||!e.length)||!(n.mode!==ca.xy.Field||null===(i=n.field)||void 0===i||!i.length))}async function Ka(t){var e,i,n,o,a,s,l,h,u,c,p,d,f,g,_;t||(t=Ta);const v=Ya(t),y={},m=await Va(null===(e=t.symbol)||void 0===e?void 0:e.fixed,v),x={config:t,hasText:v,fields:y,base:{color:r.config.theme2.visualization.getColorByName(null!==(i=null===(n=t.color)||void 0===n?void 0:n.fixed)&&void 0!==i?i:Ta.color.fixed),opacity:null!==(o=t.opacity)&&void 0!==o?o:Ta.opacity,lineWidth:null!==(a=t.lineWidth)&&void 0!==a?a:1,size:null!==(s=null===(l=t.size)||void 0===l?void 0:l.fixed)&&void 0!==s?s:Ta.size.fixed,rotation:null!==(h=null===(u=t.rotation)||void 0===u?void 0:u.fixed)&&void 0!==h?h:Ta.rotation.fixed},maker:m};var b,w,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===(b=t.text)||void 0===b?void 0:b.fixed,x.base.textConfig=null!==(w=t.textConfig)&&void 0!==w?w:Ta.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,l,u,c,p,d,f,g,_,v,y;let{value:m,context:x,onChange:b,item:w}=t;const C=w.settings,S=t=>{b(Object.assign({},m,{symbol:t}))},E=t=>{b(Object.assign({},m,{color:t}))},T=t=>{b(Object.assign({},m,{opacity:t}))},R=t=>{b(Object.assign({},m,{rotation:t}))};let I=!1;if(null!=C&&C.layerInfo){const t=(0,ya.Z)(null==C?void 0:C.layerInfo);I=(null==t?void 0:t.geometryType)===Ca.Point}const O=Ya(m);var L,P,F,A,M;return null!=C&&C.simpleFixedValues?(0,Gr.jsxs)(Gr.Fragment,{children:[I&&(0,Gr.jsxs)(Gr.Fragment,{children:[(0,Gr.jsx)(a.InlineFieldRow,{children:(0,Gr.jsx)(a.InlineField,{label:"Symbol",children:(0,Gr.jsx)(Ra.Lv,{value:null!==(L=null==m?void 0:m.symbol)&&void 0!==L?L:Ta.symbol,context:x,onChange:S,item:{settings:{resourceType:"icon",folderName:Ia.QS.Marker,placeholderText:O?"Select a symbol":"Select a symbol or add a text label",placeholderValue:Ta.symbol.fixed,showSourceRadio:!1}}})})}),(0,Gr.jsx)(a.Field,{label:"Rotation angle",children:(0,Gr.jsx)(Ra.k9,{value:null!==(P=null==m?void 0:m.rotation)&&void 0!==P?P:Ta.rotation,context:x,onChange:R,item:{settings:{min:Ta.rotation.min,max:Ta.rotation.max}}})})]}),(0,Gr.jsx)(a.InlineFieldRow,{children:(0,Gr.jsx)(a.InlineField,{label:"Color",labelWidth:10,children:(0,Gr.jsx)(a.InlineLabel,{width:4,children:(0,Gr.jsx)(a.ColorPicker,{color:null!==(F=null==m||null===(A=m.color)||void 0===A?void 0:A.fixed)&&void 0!==F?F:Ta.color.fixed,onChange:t=>{E({fixed:t})}})})})}),(0,Gr.jsx)(a.InlineFieldRow,{children:(0,Gr.jsx)(a.InlineField,{label:"Opacity",labelWidth:10,grow:!0,children:(0,Gr.jsx)(a.SliderValueEditor,{value:null!==(M=null==m?void 0:m.opacity)&&void 0!==M?M:Ta.opacity,context:x,onChange:T,item:{settings:{min:0,max:1,step:.1}}})})})]}):(0,Gr.jsxs)(Gr.Fragment,{children:[(0,Gr.jsx)(a.Field,{label:"Size",children:(0,Gr.jsx)(Ra.cL,{value:null!==(e=null==m?void 0:m.size)&&void 0!==e?e:Ta.size,context:x,onChange:t=>{b(Object.assign({},m,{size:t}))},item:{settings:{min:1,max:100}}})}),(0,Gr.jsx)(a.Field,{label:"Symbol",children:(0,Gr.jsx)(Ra.Lv,{value:null!==(i=null==m?void 0:m.symbol)&&void 0!==i?i:Ta.symbol,context:x,onChange:S,item:{settings:{resourceType:"icon",folderName:Ia.QS.Marker,placeholderText:O?"Select a symbol":"Select a symbol or add a text label",placeholderValue:Ta.symbol.fixed,showSourceRadio:!1}}})}),(0,Gr.jsx)(a.Field,{label:"Color",children:(0,Gr.jsx)(Ra.Lm,{value:null!==(n=null==m?void 0:m.color)&&void 0!==n?n:Ta.color,context:x,onChange:E,item:{}})}),(0,Gr.jsx)(a.Field,{label:"Fill opacity",children:(0,Gr.jsx)(a.SliderValueEditor,{value:null!==(o=null==m?void 0:m.opacity)&&void 0!==o?o:Ta.opacity,context:x,onChange:T,item:{settings:{min:0,max:1,step:.1}}})}),(null==C?void 0:C.displayRotation)&&(0,Gr.jsx)(a.Field,{label:"Rotation angle",children:(0,Gr.jsx)(Ra.k9,{value:null!==(r=null==m?void 0:m.rotation)&&void 0!==r?r:Ta.rotation,context:x,onChange:R,item:{settings:{min:Ta.rotation.min,max:Ta.rotation.max}}})}),(0,Gr.jsx)(a.Field,{label:"Text label",children:(0,Gr.jsx)(Ra.$2,{value:null!==(s=null==m?void 0:m.text)&&void 0!==s?s:Ia.qj,context:x,onChange:t=>{b(Object.assign({},m,{text:t}))},item:{}})}),O&&(0,Gr.jsxs)(Gr.Fragment,{children:[(0,Gr.jsxs)(a.HorizontalGroup,{children:[(0,Gr.jsx)(a.Field,{label:"Font size",children:(0,Gr.jsx)(a.NumberValueEditor,{value:null!==(l=null==m||null===(u=m.textConfig)||void 0===u?void 0:u.fontSize)&&void 0!==l?l:Ta.textConfig.fontSize,context:x,onChange:t=>{b(Object.assign({},m,{textConfig:Object.assign({},m.textConfig,{fontSize:t})}))},item:{}})}),(0,Gr.jsx)(a.Field,{label:"X offset",children:(0,Gr.jsx)(a.NumberValueEditor,{value:null!==(c=null==m||null===(p=m.textConfig)||void 0===p?void 0:p.offsetX)&&void 0!==c?c:Ta.textConfig.offsetX,context:x,onChange:t=>{b(Object.assign({},m,{textConfig:Object.assign({},m.textConfig,{offsetX:t})}))},item:{}})}),(0,Gr.jsx)(a.Field,{label:"Y offset",children:(0,Gr.jsx)(a.NumberValueEditor,{value:null!==(d=null==m||null===(f=m.textConfig)||void 0===f?void 0:f.offsetY)&&void 0!==d?d:Ta.textConfig.offsetY,context:x,onChange:t=>{b(Object.assign({},m,{textConfig:Object.assign({},m.textConfig,{offsetY:t})}))},item:{}})})]}),(0,Gr.jsx)(a.Field,{label:"Align",children:(0,Gr.jsx)(a.RadioButtonGroup,{value:null!==(g=null==m||null===(_=m.textConfig)||void 0===_?void 0:_.textAlign)&&void 0!==g?g:Ta.textConfig.textAlign,onChange:t=>{b(Object.assign({},m,{textConfig:Object.assign({},m.textConfig,{textAlign:t})}))},options:[{value:Sa.Left,label:(0,h.capitalize)(Sa.Left)},{value:Sa.Center,label:(0,h.capitalize)(Sa.Center)},{value:Sa.Right,label:(0,h.capitalize)(Sa.Right)}]})}),(0,Gr.jsx)(a.Field,{label:"Baseline",children:(0,Gr.jsx)(a.RadioButtonGroup,{value:null!==(v=null==m||null===(y=m.textConfig)||void 0===y?void 0:y.textBaseline)&&void 0!==v?v:Ta.textConfig.textBaseline,onChange:t=>{b(Object.assign({},m,{textConfig:Object.assign({},m.textConfig,{textBaseline:t})}))},options:[{value:Ea.Top,label:(0,h.capitalize)(Ea.Top)},{value:Ea.Middle,label:(0,h.capitalize)(Ea.Middle)},{value:Ea.Bottom,label:(0,h.capitalize)(Ea.Bottom)}]})})]})]})};var qa=i(41393),$a=function(){function t(t){this.rbush_=new Fn(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,p.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],a=e[n],s={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:a};i[n]=s,this.items_[(0,p.sq)(a)]=s}this.rbush_.load(i)},t.prototype.remove=function(t){var e=(0,p.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,p.sq)(e)],n=[i.minX,i.minY,i.maxX,i.maxY];(0,f.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,Z.xb)(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return(0,f.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 Ja=$a;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)}}();function ts(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}const es=function(t){function e(e){var i=t.call(this)||this;i.projection=(0,Be.U2)(e.projection),i.attributions_=ts(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:J,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 Qa(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,p.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_=ts(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(L.Z),is="addfeature",ns="changefeature",os="clear",rs="removefeature",as="featuresloadstart",ss="featuresloadend",ls="featuresloaderror";function hs(t,e){return[[-1/0,-1/0,1/0,1/0]]}var us=i(50615),cs=!1;function ps(t,e){return function(i,n,o,r,a){var s=this;!function(t,e,i,n,o,r,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(i,n,o):t,!0),e.getType()==us.Z.ARRAY_BUFFER&&(s.responseType="arraybuffer"),s.withCredentials=cs,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var n=e.getType(),l=void 0;n==us.Z.JSON||n==us.Z.TEXT?l=s.responseText:n==us.Z.XML?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):n==us.Z.ARRAY_BUFFER&&(l=s.response),l?r(e.readFeatures(l,{extent:i,featureProjection:o}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}(t,e,i,n,o,(function(t,e){s.addFeatures(t),void 0!==r&&r(t)}),a||c.Zn)}}var ds=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)}}(),fs=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.feature=i,o.features=n,o}return ds(e,t),e}(ht.ZP),gs=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{attributions:n.attributions,interpolate:!0,projection:void 0,state:J,wrapX:void 0===n.wrapX||n.wrapX})||this).on,i.once,i.un,i.loader_=c.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,g.h)(i.format_,7),i.loader_=ps(i.url_,i.format_)),i.strategy_=void 0!==n.strategy?n.strategy:hs;var o,r,a=void 0===n.useSpatialIndex||n.useSpatialIndex;return i.featuresRtree_=a?new Ja:null,i.loadedExtentsRtree_=new Ja,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()),a||void 0!==o||(o=new te(r)),void 0!==r&&i.addFeaturesInternal(r),void 0!==o&&i.bindFeaturesCollection_(o),i}return ds(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=(0,p.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 fs(is,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[(0,Q.oL)(e,X.Z.CHANGE,this.handleFeatureChange_,this),(0,Q.oL)(e,lt.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,g.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 a=t[o],s=(0,p.sq)(a);this.addToIndex_(s,a)&&i.push(a)}o=0;for(var l=i.length;o<l;o++){a=i[o],s=(0,p.sq)(a);this.setupChangeEvents_(s,a);var h=a.getGeometry();if(h){var u=h.getExtent();e.push(u),n.push(a)}else this.nullGeometryFeatures_[s]=a}if(this.featuresRtree_&&this.featuresRtree_.load(e,n),this.hasListener(is)){o=0;for(var c=i.length;o<c;o++)this.dispatchEvent(new fs(is,i[o]))}},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(is,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(rs,(function(i){e||(e=!0,t.remove(i.feature),e=!1)})),t.addEventListener(Kt,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(Ht,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(Q.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 fs(os);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,Z.xb)(this.nullGeometryFeatures_)||(0,We.l7)(t,(0,Z.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){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):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],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||c.uX;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),h=a;if((a=e.closestPointXY(i,n,r,a))<h){o=t;var u=Math.sqrt(a);s[0]=i-u,s[1]=n-u,s[2]=i+u,s[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,p.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 a=r.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new fs(ns,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:(0,p.sq)(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&(0,Z.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 s=o[t];n.forEachInExtent(s,(function(t){return(0,f.r4)(t.extent,s)}))||(++a.loadingExtentsCount_,a.dispatchEvent(new fs(as)),a.loader_.call(a,s,e,i,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new fs(ss,void 0,t))}.bind(a),function(){--this.loadingExtentsCount_,this.dispatchEvent(new fs(ls))}.bind(a)),n.insert(s,{extent:s.slice()}))},a=this,s=0,l=o.length;s<l;++s)r(s);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,f.fS)(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){if(t){var e=(0,p.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,p.sq)(t),i=this.featureChangeKeys_[e];if(i){i.forEach(Q.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 fs(rs,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,g.h)(this.format_,7),this.url_=t,this.setLoader(ps(t,this.format_))},e}(es);const _s=gs;class vs extends _s{constructor(t){super({}),this.location=t}update(t){this.clear(!0);const e=(0,ua.g6)(t,this.location);if(e.field){for(let i=0;i<t.length;i++)this.addFeatureInternal(new qa.Z({frame:t,rowIndex:i,geometry:e.field.values.get(i)}));this.changed()}else this.changed()}}const ys={style:Ta,showLegend:!0},ms="markers",xs={type:ms,name:"",config:ys,location:{mode:o.FrameGeometrySourceMode.Auto},tooltip:!0},bs={id:ms,name:"Markers",description:"Use markers to render each data point",isBaseMap:!1,showLocation:!0,create:async(t,e,i)=>{const n=Object.assign({},ys,null==e?void 0:e.config),o=await Ka(n.style),r=await(0,ua.cJ)(e.location),a=new vs(r),s=new Dr({source:a}),l=new wa.t(1);let u=null;return n.showLegend&&(u=(0,Gr.jsx)(pa,{watch:l,initialSubProps:{},child:xa})),o.fields?s.setStyle((t=>{const e=t.get("rowIndex"),i=o.dims;if(!i||!(0,h.isNumber)(e))return o.maker(o.base);const n=Object.assign({},o.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)),o.maker(n)})):s.setStyle(o.maker(o.base)),{init:()=>s,legend:u,update:t=>{var n;if(null!==(n=t.series)&&void 0!==n&&n.length)for(const n of t.series){if(o.fields){const t={};var r,h,c;if(o.fields.color)t.color=(0,ca.PX)(n,null!==(r=o.config.color)&&void 0!==r?r:Ta.color,i);if(o.fields.size)t.size=(0,ca.W8)(n,null!==(h=o.config.size)&&void 0!==h?h:Ta.size);if(o.fields.text&&(t.text=(0,ca.Bw)(n,o.config.text)),o.fields.rotation)t.rotation=(0,ca.yq)(n,null!==(c=o.config.rotation)&&void 0!==c?c:Ta.rotation);o.dims=t}var p;if(u)l.next({styleConfig:o,size:null===(p=o.dims)||void 0===p?void 0:p.size,layerName:e.name,layer:s});a.update(n);break}else a.clear()},registerOptionsUI:t=>{t.addCustomEditor({id:"config.style",path:"config.style",name:"Styles",editor:Ha,settings:{displayRotation:!0},defaultValue:ys.style}).addBooleanSwitch({path:"config.showLegend",name:"Show legend",description:"Show map legend",defaultValue:ys.showLegend})}}},defaultOptions:ys},ws="preload",Cs="useInterimTilesOnError";var Ss=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 Es=function(t){function e(e){var i=this,n=e||{},o=(0,Z.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 Ss(e,t),e.prototype.getPreload=function(){return this.get(ws)},e.prototype.setPreload=function(t){this.set(ws,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Cs)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Cs,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(nt);var Ts=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)}}(),Rs=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 Ts(e,t),e.prototype.changed=function(){this.dispatchEvent(X.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()==Ie)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()==Ie){t.interimTile=null;break}t.getState()==Re?e=t:t.getState()==Te?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!==Oe&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){(0,p.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:He(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}(xt.Z);const Is=Rs;var Os=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)}}(),Ls=function(t){function e(e,i,n,o,r,a){var s=t.call(this,e,i,a)||this;return s.crossOrigin_=o,s.src_=n,s.key=n,s.image_=new Image,null!==o&&(s.image_.crossOrigin=o),s.unlisten_=null,s.tileLoadFunction_=r,s}return Os(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=Ie,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=Oe,this.unlistenImage_(),this.image_=((t=wt(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=Ie:this.state=Le,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Oe&&(this.state=Te,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Te&&(this.state=Re,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=xr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Is);const Ps=Ls;var Fs=function(){function t(t,e,i,n,o,r){this.sourceProj_=t,this.targetProj_=e;var a={},s=(0,Be.Ck)(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return a[e]||(a[e]=s(t)),a[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&(0,f.dz)(n)==(0,f.dz)(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?(0,f.dz)(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?(0,f.dz)(this.targetProj_.getExtent()):null;var l=(0,f.rL)(i),h=(0,f.Xv)(i),u=(0,f.w$)(i),c=(0,f.hC)(i),p=this.transformInv_(l),d=this.transformInv_(h),g=this.transformInv_(u),v=this.transformInv_(c),y=10+(r?Math.max(0,Math.ceil((0,_.k3)((0,f.bg)(i)/(r*r*256*256)))):0);if(this.addQuad_(l,h,u,c,p,d,g,v,y),this.wrapsXInSource_){var m=1/0;this.triangles_.forEach((function(t,e,i){m=Math.min(m,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])-m>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]-m>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-m>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-m>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))}a={}}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,a,s,l){var h=(0,f.hI)([o,r,a,s]),u=this.sourceWorldWidth_?(0,f.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 g=(0,f.hI)([t,e,i,n]);d=(0,f.dz)(g)/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,f.kK)(h,this.maxSourceExtent_)){var v=0;if(!(d||isFinite(o[0])&&isFinite(o[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])))if(l>0)d=!0;else if(1!=(v=(isFinite(o[0])&&isFinite(o[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(a[0])&&isFinite(a[1])?0:2)+(isFinite(s[0])&&isFinite(s[1])?0:1))&&2!=v&&4!=v&&8!=v)return;if(l>0){if(!d){var y=[(t[0]+i[0])/2,(t[1]+i[1])/2],m=this.transformInv_(y),x=void 0;if(p)x=((0,_.$W)(o[0],c)+(0,_.$W)(a[0],c))/2-(0,_.$W)(m[0],c);else x=(o[0]+a[0])/2-m[0];var b=(o[1]+a[1])/2-m[1];d=x*x+b*b>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],C=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,C,E,l-1),this.addQuad_(S,w,i,n,E,C,a,s,l-1)}else{var T=[(t[0]+e[0])/2,(t[1]+e[1])/2],R=this.transformInv_(T),I=[(i[0]+n[0])/2,(i[1]+n[1])/2],O=this.transformInv_(I);this.addQuad_(t,T,I,n,o,R,O,s,l-1),this.addQuad_(T,e,i,I,R,r,a,O,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&v)&&this.addTriangle_(t,i,n,o,a,s),0==(14&v)&&this.addTriangle_(t,i,e,o,a,r),v&&(0==(13&v)&&this.addTriangle_(e,n,t,r,s,o),0==(7&v)&&this.addTriangle_(e,n,i,r,s,a))}},t.prototype.calculateSourceExtent=function(){var t=(0,f.lJ)();return this.triangles_.forEach((function(e,i,n){var o=e.source;(0,f.Wj)(t,o[0]),(0,f.Wj)(t,o[1]),(0,f.Wj)(t,o[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();const As=Fs;var Ms,js={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},ks={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0};function Ds(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 Ns(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function zs(t,e,i,n){var o=(0,Be.vs)(i,e,t),r=(0,Be._Q)(e,n,i),a=e.getMetersPerUnit();void 0!==a&&(r*=a);var s=t.getMetersPerUnit();void 0!==s&&(r/=s);var l=t.getExtent();if(!l||(0,f.b8)(l,o)){var h=(0,Be._Q)(t,r,o)/r;isFinite(h)&&h>0&&(r/=h)}return r}function Bs(t,e,i,n,o,r,a,s,l,h,u,c){var p=wt(Math.round(i*t),Math.round(i*e));if(c||(0,Z.f0)(p,js),0===l.length)return p.canvas;function d(t){return Math.round(t*i)/i}p.scale(i,i),p.globalCompositeOperation="lighter";var g=(0,f.lJ)();l.forEach((function(t,e,i){(0,f.l7)(g,t.extent)}));var v=(0,f.dz)(g),y=(0,f.Cr)(g),m=wt(Math.round(i*v/n),Math.round(i*y/n));c||(0,Z.f0)(m,js);var x=i/n;l.forEach((function(t,e,i){var n=t.extent[0]-g[0],o=-(t.extent[3]-g[3]),r=(0,f.dz)(t.extent),a=(0,f.Cr)(t.extent);t.image.width>0&&t.image.height>0&&m.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,n*x,o*x,r*x,a*x)}));var b=(0,f.rL)(a);return s.getTriangles().forEach((function(t,e,o){var a=t.source,s=t.target,l=a[0][0],h=a[0][1],u=a[1][0],f=a[1][1],v=a[2][0],y=a[2][1],x=d((s[0][0]-b[0])/r),w=d(-(s[0][1]-b[1])/r),C=d((s[1][0]-b[0])/r),S=d(-(s[1][1]-b[1])/r),E=d((s[2][0]-b[0])/r),T=d(-(s[2][1]-b[1])/r),R=l,I=h;l=0,h=0;var O=[[u-=R,f-=I,0,0,C-x],[v-=R,y-=I,0,0,E-x],[0,0,u,f,S-w],[0,0,v,y,T-w]],L=(0,_.SV)(O);if(L){if(p.save(),p.beginPath(),function(){if(void 0===Ms){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Ds(t,4,5,4,0),Ds(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;Ms=Ns(e,0)||Ns(e,4)||Ns(e,8)}return Ms}()||!c){p.moveTo(C,S);for(var P=x-C,F=w-S,A=0;A<4;A++)p.lineTo(C+d((A+1)*P/4),S+d(A*F/3)),3!=A&&p.lineTo(C+d((A+1)*P/4),S+d((A+1)*F/3));p.lineTo(E,T)}else p.moveTo(C,S),p.lineTo(x,w),p.lineTo(E,T);p.clip(),p.transform(L[0],L[2],L[1],L[3],x,w),p.translate(g[0]-R,g[3]-I),p.scale(n/i,-n/i),p.drawImage(m.canvas,0,0),p.restore()}})),u&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,s.getTriangles().forEach((function(t,e,i){var n=t.target,o=(n[0][0]-b[0])/r,a=-(n[0][1]-b[1])/r,s=(n[1][0]-b[0])/r,l=-(n[1][1]-b[1])/r,h=(n[2][0]-b[0])/r,u=-(n[2][1]-b[1])/r;p.beginPath(),p.moveTo(s,l),p.lineTo(o,a),p.lineTo(h,u),p.closePath(),p.stroke()})),p.restore()),p.canvas}var Gs=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)}}(),Zs=function(t){function e(e,i,n,o,r,a,s,l,h,u,c,p){var d=t.call(this,r,Te,{interpolate:!!p})||this;d.renderEdges_=void 0!==c&&c,d.pixelRatio_=s,d.gutter_=l,d.canvas_=null,d.sourceTileGrid_=i,d.targetTileGrid_=o,d.wrappedTileCoord_=a||r,d.sourceTiles_=[],d.sourcesListenerKeys_=null,d.sourceZ_=0;var g=o.getTileCoordExtent(d.wrappedTileCoord_),v=d.targetTileGrid_.getExtent(),y=d.sourceTileGrid_.getExtent(),m=v?(0,f.Ed)(g,v):g;if(0===(0,f.bg)(m))return d.state=Le,d;var x=e.getExtent();x&&(y=y?(0,f.Ed)(y,x):x);var b=o.getResolution(d.wrappedTileCoord_[0]),w=function(t,e,i,n){var o=(0,f.qg)(i),r=zs(t,e,o,n);return(!isFinite(r)||r<=0)&&(0,f.H6)(i,(function(i){return r=zs(t,e,i,n),isFinite(r)&&r>0})),r}(e,n,m,b);if(!isFinite(w)||w<=0)return d.state=Le,d;var C=void 0!==u?u:.5;if(d.triangulation_=new As(e,n,m,y,w*C,b),0===d.triangulation_.getTriangles().length)return d.state=Le,d;d.sourceZ_=i.getZForResolution(w);var S=d.triangulation_.calculateSourceExtent();if(y&&(e.canWrapX()?(S[1]=(0,_.uZ)(S[1],y[1],y[3]),S[3]=(0,_.uZ)(S[3],y[1],y[3])):S=(0,f.Ed)(S,y)),(0,f.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 I=h(d.sourceZ_,T,R,s);I&&d.sourceTiles_.push(I)}0===d.sourceTiles_.length&&(d.state=Le)}else d.state=Le;return d}return Gs(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()==Ie&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Oe;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),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Bs(n,o,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),r,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=Ie}this.changed()},e.prototype.load=function(){if(this.state==Te){this.state=Re,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var o=e.getState();if(o==Te||o==Re){t++;var r=(0,Q.oL)(e,X.Z.CHANGE,(function(i){var n=e.getState();n!=Ie&&n!=Oe&&n!=Le||((0,Q.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()==Te&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Q.bN),this.sourcesListenerKeys_=null},e}(Is);const Ws=Zs;var Us=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 Xs(t,e,i,n,o){return void 0!==o?(o.minX=t,o.maxX=e,o.minY=i,o.maxY=n,o):new Us(t,e,i,n)}const Vs=Us;var Ys=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)}}(),Ks=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,f.lJ)(),i.tmpTileRange_=new Vs(0,0,0,0),i}return Ys(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==Ie||i==Le||i==Oe&&!n},e.prototype.getTile=function(t,e,i,n){var o=n.pixelRatio,r=n.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,i,o,r);return s.getState()==Oe&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(Ie)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var i=this.getLayer(),n=(0,d.nn)(e.pixelToCoordinateTransform,t.slice()),o=i.getExtent();if(o&&!(0,f.b8)(o,n))return null;for(var r=e.pixelRatio,a=e.viewState.projection,s=e.viewState,l=i.getRenderSource(),h=l.getTileGridForProjection(s.projection),u=l.getTilePixelRatio(e.pixelRatio),c=h.getZForResolution(s.resolution);c>=h.getMinZoom();--c){var p=h.getTileCoordForCoordAndZ(n,c),g=l.getTile(c,p[1],p[2],r,a);if(!(g instanceof Ps||g instanceof Ws))return null;if(g.getState()===Ie){var _=h.getOrigin(c),v=ai(h.getTileSize(c)),y=h.getResolution(c),m=Math.floor(u*((n[0]-_[0])/y-p[1]*v[0])),x=Math.floor(u*((_[1]-n[1])/y-p[2]*v[1]));return this.getImageData(g.getImage(),m,x)}}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,a=n.center,s=n.rotation,l=t.pixelRatio,h=this.getLayer(),u=h.getSource(),c=u.getRevision(),g=u.getTileGridForProjection(o),_=g.getZForResolution(r,u.zDirection),v=g.getResolution(_),y=t.extent,m=i.extent&&(0,Be.dY)(i.extent,o);m&&(y=(0,f.Ed)(y,(0,Be.dY)(i.extent,o)));var x=u.getTilePixelRatio(l),b=Math.round(t.size[0]*x),w=Math.round(t.size[1]*x);if(s){var C=Math.round(Math.sqrt(b*b+w*w));b=C,w=C}var S=v*b/2/x,E=v*w/2/x,T=[a[0]-S,a[1]-E,a[0]+S,a[1]+E],R=g.getTileRangeForExtentAndZ(y,_),I={};I[_]={};var O=this.createLoadedTileFinder(u,o,I),L=this.tmpExtent,P=this.tmpTileRange_;this.newTiles_=!1;for(var F=R.minX;F<=R.maxX;++F)for(var A=R.minY;A<=R.maxY;++A){var M=this.getTile(_,F,A,t);if(this.isDrawableTile(M)){var j=(0,p.sq)(this);if(M.getState()==Ie){I[_][M.tileCoord.toString()]=M;var k=M.inTransition(j);this.newTiles_||!k&&-1!==this.renderedTiles.indexOf(M)||(this.newTiles_=!0)}if(1===M.getAlpha(j,t.time))continue}var D=g.getTileCoordChildTileRange(M.tileCoord,P,L),N=!1;D&&(N=O(_+1,D)),N||g.forEachTileCoordParentTileRange(M.tileCoord,O,P,L)}var z=v/r;(0,d.qC)(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/x,1/x,s,-b/2,-w/2);var B=(0,d.BB)(this.pixelTransform);this.useContainer(e,B,i.opacity,this.getBackground(t));var G=this.context,W=G.canvas;(0,d.nb)(this.inversePixelTransform,this.pixelTransform),(0,d.qC)(this.tempTransform,b/2,w/2,z,z,0,-b/2,-w/2),W.width!=b||W.height!=w?(W.width=b,W.height=w):this.containerReused||G.clearRect(0,0,b,w),m&&this.clipUnrotated(G,t,m),u.getInterpolate()||(0,Z.f0)(G,js),this.preRender(G,t),this.renderedTiles.length=0;var U,X,V,Y=Object.keys(I).map(Number);Y.sort(We.kK),1!==i.opacity||this.containerReused&&!u.getOpaque(t.viewState.projection)?(U=[],X=[]):Y=Y.reverse();for(var K=Y.length-1;K>=0;--K){var H=Y[K],q=u.getTilePixelSize(H,l,o),$=g.getResolution(H)/v,J=q[0]*$*z,Q=q[1]*$*z,tt=g.getTileCoordForCoordAndZ((0,f.rL)(T),H),et=g.getTileCoordExtent(tt),it=(0,d.nn)(this.tempTransform,[x*(et[0]-T[0])/v,x*(T[3]-et[3])/v]),nt=x*u.getGutterForProjection(o),ot=I[H];for(var rt in ot){var at=(M=ot[rt]).tileCoord,st=tt[1]-at[1],lt=Math.round(it[0]-(st-1)*J),ht=tt[2]-at[2],ut=Math.round(it[1]-(ht-1)*Q),ct=lt-(F=Math.round(it[0]-st*J)),pt=ut-(A=Math.round(it[1]-ht*Q)),dt=_===H,ft=!1;if(!(k=dt&&1!==M.getAlpha((0,p.sq)(this),t.time)))if(U){V=[F,A,F+ct,A,F+ct,A+pt,F,A+pt];for(var gt=0,_t=U.length;gt<_t;++gt)if(_!==H&&H<X[gt]){var vt=U[gt];(0,f.kK)([F,A,F+ct,A+pt],[vt[0],vt[3],vt[4],vt[7]])&&(ft||(G.save(),ft=!0),G.beginPath(),G.moveTo(V[0],V[1]),G.lineTo(V[2],V[3]),G.lineTo(V[4],V[5]),G.lineTo(V[6],V[7]),G.moveTo(vt[6],vt[7]),G.lineTo(vt[4],vt[5]),G.lineTo(vt[2],vt[3]),G.lineTo(vt[0],vt[1]),G.clip())}U.push(V),X.push(H)}else G.clearRect(F,A,ct,pt);this.drawTileImage(M,t,F,A,ct,pt,nt,dt),U&&!k?(ft&&G.restore(),this.renderedTiles.unshift(M)):this.renderedTiles.push(M),this.updateUsedTiles(t.usedTiles,u,M)}}this.renderedRevision=c,this.renderedResolution=v,this.extentChanged=!this.renderedExtent_||!(0,f.fS)(this.renderedExtent_,T),this.renderedExtent_=T,this.renderedPixelRatio=l,this.renderedProjection=o,this.manageTilePyramid(t,u,g,l,o,y,_,h.getPreload()),this.scheduleExpireCache(t,u),this.postRender(G,t),i.extent&&G.restore(),(0,Z.f0)(G,ks),B!==W.style.transform&&(W.style.transform=B);var yt=mt(i.opacity),xt=this.container;return yt!==xt.style.opacity&&(xt.style.opacity=yt),this.container},e.prototype.drawTileImage=function(t,e,i,n,o,r,a,s){var l=this.getTileImage(t);if(l){var h=(0,p.sq)(this),u=s?t.getAlpha(h,e.time):1,c=u!==this.context.globalAlpha;c&&(this.context.save(),this.context.globalAlpha=u),this.context.drawImage(l,a,a,l.width-2*a,l.height-2*a,i,n,o,r),c&&this.context.restore(),1!==u?e.animate=!0:s&&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,p.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,p.sq)(e);n in t||(t[n]={}),t[n][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,i,n,o,r,a,s,l){var h=(0,p.sq)(e);h in t.wantedTiles||(t.wantedTiles[h]={});var u,c,d,f,g,_,v=t.wantedTiles[h],y=t.tileQueue,m=0;for(_=i.getMinZoom();_<=a;++_)for(c=i.getTileRangeForExtentAndZ(r,_,c),d=i.getResolution(_),f=c.minX;f<=c.maxX;++f)for(g=c.minY;g<=c.maxY;++g)a-_<=s?(++m,(u=e.getTile(_,f,g,n,o)).getState()==Te&&(v[u.getKey()]=!0,y.isKeyQueued(u.getKey())||y.enqueue([u,h,i.getTileCoordCenter(u.tileCoord),d])),void 0!==l&&l(u)):e.useTile(_,f,g,o);e.updateCacheSize(m,o)},e}(Do);const Hs=Ks;var qs=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 $s=function(t){function e(e){return t.call(this,e)||this}return qs(e,t),e.prototype.createRenderer=function(){return new Hs(this)},e}(Es);const Js=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,g.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,g.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.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,g.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 Qs(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function tl(t,e,i){return t+"/"+e+"/"+i}function el(t){return tl(t[0],t[1],t[2])}var il=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)}}(),nl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return il(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(el(t.tileCoord)),t.release())}.bind(this))}},e}(Js);const ol=nl,rl="tileloadstart",al="tileloadend",sl="tileloaderror";var ll=i(33046),hl=[0,0,0],ul=function(){function t(t){var e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,(0,g.h)((0,We.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,g.h)(this.origins_.length==this.resolutions_.length,20));var o=t.extent;void 0===o||this.origin_||this.origins_||(this.origin_=(0,f.rL)(o)),(0,g.h)(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,(0,g.h)(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:ze,(0,g.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 Vs(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 a=n.minY,s=n.maxY;a<=s;++a)i([e,o,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,i,n){var o,r,a=null,s=t[0]-1;for(2===this.zoomFactor_?(o=t[1],r=t[2]):a=this.getTileCoordExtent(t,n);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?Xs(o=Math.floor(o/2),o,r=Math.floor(r/2),r,i):this.getTileRangeForExtentAndZ(a,s,i)))return!0;--s}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 Xs(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 Xs(o,r,o,r,i);if(this.zoomFactor_){var a=Math.pow(this.zoomFactor_,e-n),s=Math.floor(o*a),l=Math.floor(r*a);return e<n?Xs(s,s,l,l,i):Xs(s,Math.floor(a*(o+1))-1,l,Math.floor(a*(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=ai(this.getTileSize(t),this.tmpSize_),a=n[0]+e.minX*r[0]*o,s=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,f.T9)(a,l,s,h,i)},t.prototype.getTileRangeForExtentAndZ=function(t,e,i){var n=hl;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),Xs(o,n[1],r,n[2],i)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=ai(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=ai(this.getTileSize(t[0]),this.tmpSize_),r=i[0]+t[1]*o[0]*n,a=i[1]-(t[2]+1)*o[1]*n,s=r+o[0]*n,l=a+o[1]*n;return(0,f.T9)(r,a,s,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),a=i/this.getResolution(r),s=this.getOrigin(r),l=ai(this.getTileSize(r),this.tmpSize_),h=a*(t-s[0])/i/l[0],u=a*(s[1]-e)/i/l[1];return n?(h=(0,_.mD)(h,5)-1,u=(0,_.mD)(u,5)-1):(h=(0,_.GW)(h,5),u=(0,_.GW)(u,5)),Qs(r,h,u,o)},t.prototype.getTileCoordForXYAndZ_=function(t,e,i,n,o){var r=this.getOrigin(i),a=this.getResolution(i),s=ai(this.getTileSize(i),this.tmpSize_),l=(t-r[0])/a/s[0],h=(r[1]-e)/a/s[1];return n?(l=(0,_.mD)(l,5)-1,h=(0,_.mD)(h,5)-1):(l=(0,_.GW)(l,5),h=(0,_.GW)(h,5)),Qs(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,We.h7)(this.resolutions_,t,e||0);return(0,_.uZ)(i,this.minZoom,this.maxZoom)},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 cl=ul;function pl(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:ll.Z.TOP_LEFT,r=dl(t,e,i);return new cl({extent:t,origin:(0,f.g0)(t,o),resolutions:r,tileSize:i})}(fl(t),e,i,n)}(t),t.setDefaultTileGrid(e)),e}function dl(t,e,i,n){for(var o=void 0!==e?e:42,r=(0,f.Cr)(t),a=(0,f.dz)(t),s=ai(void 0!==i?i:ze),l=n>0?n:Math.max(a/s[0],r/s[1]),h=o+1,u=new Array(h),c=0;c<h;++c)u[c]=l/Math.pow(2,c);return u}function fl(t){var e=(t=(0,Be.U2)(t)).getExtent();if(!e){var i=180*Be.Wm[je.ZP.DEGREES]/t.getMetersPerUnit();e=(0,f.T9)(-i,-i,i,i)}return e}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)}}(),_l=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&&ai(i.tileGrid.getTileSize(i.tileGrid.getMinZoom()),[256,256]),i.tileCache=new ol(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 gl(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,a,s,l=!0,h=i.minX;h<=i.maxX;++h)for(var u=i.minY;u<=i.maxY;++u)a=tl(e,h,u),s=!1,o.containsKey(a)&&(s=(r=o.get(a)).getState()===Ie)&&(s=!1!==n(r)),s||(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,p.O3)()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:pl(t)},e.prototype.getTileCacheForProjection=function(t){return(0,g.h)((0,Be.OP)(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var n,o,r,a=this.getTileGridForProjection(i),s=this.getTilePixelRatio(e),l=ai(a.getTileSize(t),this.tmpSize);return 1==s?l:(n=l,o=s,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=fl(i);if((0,f.b8)(r,o))return e;var a=(0,f.dz)(r),s=Math.ceil((r[0]-o[0])/a);return o[0]+=a*s,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}(es),vl=function(t){function e(e,i){var n=t.call(this,e)||this;return n.tile=i,n}return gl(e,t),e}(ht.ZP);const yl=_l;function ml(t,e){var i=/\{z\}/g,n=/\{x\}/g,o=/\{y\}/g,r=/\{-y\}/g;return function(a,s,l){return a?t.replace(i,a[0].toString()).replace(n,a[1].toString()).replace(o,a[2].toString()).replace(r,(function(){var t=a[0],i=e.getFullTileRange(t);return(0,g.h)(i,55),(i.getHeight()-a[2]-1).toString()})):void 0}}function xl(t,e){for(var i=t.length,n=new Array(i),o=0;o<i;++o)n[o]=ml(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,_.$W)(o,t.length);return t[r](e,i,n)}}}(n)}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)}}(),wl=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 bl(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,p.sq)(i),o=i.getState();o==Re?(this.tileLoadingKeys_[n]=!0,e=rl):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=o==Oe?sl:o==Ie?al:void 0),null!=e&&this.dispatchEvent(new vl(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 a=parseInt(i[2],10),s=parseInt(i[1],10);s<=a;s++)e.push(t.replace(i[0],s.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(xl(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,i){},e.prototype.useTile=function(t,e,i){var n=tl(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(yl);const Cl=wl;var Sl=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)}}(),El=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:Tl,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:Ps,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.renderReprojectionEdges_=!1,i}return Sl(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,Be.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,Be.OP)(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!(0,Be.OP)(e,t)){var i=(0,p.sq)(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=pl(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||(0,Be.OP)(e,t))return this.tileCache;var i=(0,p.sq)(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new ol(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,n,o,r){var a=[t,e,i],s=this.getTileCoordForTileUrlFunction(a,o),l=s?this.tileUrlFunction(s,n,o):void 0,h=new this.tileClass(a,void 0!==l?Te:Le,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=r,h.addEventListener(X.Z.CHANGE,this.handleTileChange.bind(this)),h},e.prototype.getTile=function(t,e,i,n,o){var r=this.getProjection();if(r&&o&&!(0,Be.OP)(r,o)){var a=this.getTileCacheForProjection(o),s=[t,e,i],l=void 0,h=el(s);a.containsKey(h)&&(l=a.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(s,o),f=new Ws(r,c,o,p,s,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(),a.replace(h,f)):a.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,a=tl(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)){if((r=this.tileCache.get(a)).key!=s){var l=r;r=this.createTile_(t,e,i,n,o,s),l.getState()==Te?r.interimTile=l.interimTile:r.interimTile=l,r.refreshInterimChain(),this.tileCache.replace(a,r)}}else r=this.createTile_(t,e,i,n,o,s),this.tileCache.set(a,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,Be.U2)(t);if(i){var n=(0,p.sq)(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(Cl);function Tl(t,e){t.getImage().src=e}const Rl=El;var Il=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 Ol=function(t){function e(e){var i=e||{},n=void 0===i.imageSmoothing||i.imageSmoothing;void 0!==i.interpolate&&(n=i.interpolate);var o=void 0!==i.projection?i.projection:"EPSG:3857",r=void 0!==i.tileGrid?i.tileGrid:function(t){var e=t||{},i=e.extent||(0,Be.U2)("EPSG:3857").getExtent(),n={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:dl(i,e.maxZoom,e.tileSize,e.maxResolution)};return new cl(n)}({extent:fl(o),maxResolution:i.maxResolution,maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});return t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,interpolate:n,opaque:i.opaque,projection:o,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this}return Il(e,t),e}(Rl);let Ll;!function(t){t.Auto="auto",t.Light="light",t.Dark="dark"}(Ll||(Ll={}));const Pl={theme:Ll.Auto,showLabels:!0},Fl={id:"carto",name:"CARTO reference map",isBaseMap:!0,defaultOptions:Pl,create:async(t,e,i)=>({init:()=>{const t=Object.assign({},Pl,e.config);let n=t.theme;return n&&n!==Ll.Auto||(n=i.isDark?"dark":"light"),t.showLabels?n+="_all":n+="_nolabels",new $s({source:new Ol({attributions:'<a href="https://carto.com/attribution/">© CARTO</a>',url:`https://{1-4}.basemaps.cartocdn.com/${n}/{z}/{x}/{y}.png`})})},registerOptionsUI:t=>{t.addRadio({path:"config.theme",name:"Theme",settings:{options:[{value:Ll.Auto,label:"Auto",description:"Match grafana theme"},{value:Ll.Light,label:"Light"},{value:Ll.Dark,label:"Dark"}]},defaultValue:Pl.theme}).addBooleanSwitch({path:"config.showLabels",name:"Show labels",description:"",defaultValue:Pl.showLabels})}})},Al=[Fl],Ml="https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",jl={url:Ml+"/tile/{z}/{y}/{x}",attribution:`Tiles © <a href="${Ml}">ArcGIS</a>`},kl={id:"xyz",name:"XYZ Tile layer",isBaseMap:!0,create:async(t,e,i)=>({init:()=>{const t=Object.assign({},e.config);var i;t.url||(t.url=jl.url,t.attribution=null!==(i=t.attribution)&&void 0!==i?i:jl.attribution);return new $s({source:new Ol({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:jl.url}}).addTextInput({path:"config.attribution",name:"Attribution",settings:{placeholder:jl.attribution}})}})},Dl=[kl],Nl="custom",zl="streets",Bl=new o.Registry((()=>[{id:zl,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:Nl,name:"Custom MapServer",description:"Use a custom MapServer with pre-cached values",slug:""}])),Gl=[{id:"esri-xyz",name:"ArcGIS MapServer",isBaseMap:!0,create:async(t,e,i)=>{var n;const o=Object.assign({},e.config),r=Bl.getIfExists(null!==(n=o.server)&&void 0!==n?n:zl);if(r.id!==Nl){const t="https://services.arcgisonline.com/ArcGIS/rest/services/";o.url=`${t}${r.slug}/MapServer/tile/{z}/{y}/{x}`,o.attribution=`Tiles © <a href="${t}${r.slug}/MapServer">ArcGIS</a>`}const a=Object.assign({},e,{config:o});return kl.create(t,a,i).then((t=>(t.registerOptionsUI=t=>{t.addSelect({path:"config.server",name:"Server instance",settings:{options:Bl.selectOptions().options}}).addTextInput({path:"config.url",name:"URL template",description:"Must include {x}, {y} or {-y}, and {z} placeholders",settings:{placeholder:jl.url},showIf:t=>{var e;return(null===(e=t.config)||void 0===e?void 0:e.server)===Nl}}).addTextInput({path:"config.attribution",name:"Attribution",settings:{placeholder:jl.attribution},showIf:t=>{var e;return(null===(e=t.config)||void 0===e?void 0:e.server)===Nl}})},t)))},defaultOptions:{server:zl}}];var Zl=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,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",a=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:a,wrapX:n.wrapX,zDirection:n.zDirection})||this}return Zl(e,t),e}(Ol),Ul=[...[{id:"osm-standard",name:"Open Street Map",isBaseMap:!0,create:async(t,e)=>({init:()=>new $s({source:new Wl})})}],...Al,...Gl,...Dl];var Xl=i(95166);let Vl;!function(t){t.Zero="zero",t.Coordinates="coords",t.Fit="fit"}(Vl||(Vl={}));const Yl=new o.Registry((()=>[{id:Vl.Fit,name:"Fit data layers",zoom:15},{id:Vl.Zero,name:"(0°, 0°)",lat:0,lon:0},{id:"north-america",name:"North America",lat:40,lon:-100,zoom:4},{id:"europe",name:"Europe",lat:46,lon:14,zoom:4},{id:"west-asia",name:"West Asia",lat:26,lon:53,zoom:4},{id:"se-asia",name:"South-east Asia",lat:10,lon:106,zoom:4},{id:Vl.Coordinates,name:"Coordinates"}])),Kl={id:Vl.Zero,lat:0,lon:0,zoom:1};let Hl;!function(t){t.EQ="eq",t.NEQ="neq",t.LT="lt",t.LTE="lte",t.GT="gt",t.GTE="gte"}(Hl||(Hl={}));const ql=(t,e)=>{const i=e.get(t.property);switch(t.operation){case Hl.EQ:return`${i}`==`${t.value}`;case Hl.NEQ:return i!==t.value;case Hl.GT:return i>t.value;case Hl.GTE:return i>=t.value;case Hl.LT:return i<t.value;case Hl.LTE:return i<=t.value;default:return!1}};var $l=i(42724);function Jl(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 Ql=[{label:"==",value:Hl.EQ},{label:"!=",value:Hl.NEQ},{label:">",value:Hl.GT},{label:">=",value:Hl.GTE},{label:"<",value:Hl.LT},{label:"<=",value:Hl.LTE}],th=t=>{var e,i;const{value:o,onChange:r,item:s,context:l}=t,h=s.settings,{features:u,layerInfo:c}=h,p=(0,ya.Z)(c),d=(0,ya.Z)(u),f=(0,n.useMemo)((()=>{var t,e;const i=null==o||null===(t=o.check)||void 0===t?void 0:t.property;return i&&d&&(null===(e=o.check)||void 0===e?void 0:e.operation)===Hl.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}(d,i).map((t=>{let e;return e=!isNaN(Number(t))?{value:Number(t),label:t}:{value:t,label:t},e})):[]}),[d,o]),g=(0,a.useStyles2)(eh),_=(0,n.useCallback)((t=>{r(Object.assign({},o,{check:Object.assign({},o.check,{property:null==t?void 0:t.value})}))}),[r,o]),v=(0,n.useCallback)((t=>{var e;r(Object.assign({},o,{check:Object.assign({},o.check,{operation:null!==(e=t.value)&&void 0!==e?e:Hl.EQ})}))}),[r,o]),y=(0,n.useCallback)((t=>{r(Object.assign({},o,{check:Object.assign({},o.check,{value:null==t?void 0:t.value})}))}),[r,o]),m=(0,n.useCallback)((t=>{r(Object.assign({},o,{check:Object.assign({},o.check,{value:t})}))}),[r,o]),x=(0,n.useCallback)((t=>{r(Object.assign({},o,{style:t}))}),[r,o]),b=(0,n.useCallback)((()=>{r(void 0)}),[r]),w=null!==(e=o.check)&&void 0!==e?e:ah.check,C=Jl(w.property,null==p?void 0:p.propertes),S=Jl(w.value,f);return(0,Gr.jsxs)("div",{className:g.rule,children:[(0,Gr.jsxs)(a.InlineFieldRow,{className:g.row,children:[(0,Gr.jsx)(a.InlineField,{label:"Rule",labelWidth:10,grow:!0,children:(0,Gr.jsx)(a.Select,{placeholder:"Feature property",value:C.current,options:C.options,onChange:_,"aria-label":"Feature property",isClearable:!0,allowCustomValue:!0})}),(0,Gr.jsx)(a.InlineField,{className:g.inline,children:(0,Gr.jsx)(a.Select,{value:Ql.find((t=>t.value===w.operation)),options:Ql,onChange:v,"aria-label":"Comparison operator",width:8})}),(0,Gr.jsx)(a.InlineField,{className:g.inline,grow:!0,children:(0,Gr.jsxs)("div",{className:g.flexRow,children:[(w.operation===Hl.EQ||w.operation===Hl.NEQ)&&(0,Gr.jsx)(a.Select,{placeholder:"value",value:S.current,options:S.options,onChange:y,"aria-label":"Comparison value",isClearable:!0,allowCustomValue:!0}),w.operation!==Hl.EQ&&(0,Gr.jsx)($l.Y,{value:isNaN(Number(w.value))?0:Number(w.value),placeholder:"numeric value",onChange:m},`${w.property}/${w.operation}`)]})}),(0,Gr.jsx)(a.Button,{size:"md",icon:"trash-alt",onClick:()=>b(),variant:"secondary","aria-label":"Delete style rule",className:g.button})]}),(0,Gr.jsx)("div",{children:(0,Gr.jsx)(Ha,{value:null!==(i=o.style)&&void 0!==i?i:Ta,context:l,onChange:x,item:{settings:{simpleFixedValues:!0,layerInfo:c}}})})]})},eh=t=>({rule:s.css`
    margin-bottom: ${t.spacing(1)};
  `,row:s.css`
    display: flex;
    margin-bottom: 4px;
  `,inline:s.css`
    margin-bottom: 0;
    margin-left: 4px;
  `,button:s.css`
    margin-left: 4px;
  `,flexRow:s.css`
    display: flex;
    flex-direction: row;
    align-items: flex-start;
  `}),ih=t=>{const{value:e,onChange:i,context:o,item:r}=t,s=(0,a.useTheme2)(),l=r.settings,h=(0,n.useCallback)((()=>{const{palette:t}=s.visualization,n={fixed:t[Math.floor(Math.random()*t.length)]},o=[...e,Object.assign({},ah,{style:Object.assign({},Ta,{color:n})})];i(o)}),[i,e,s.visualization]),u=(0,n.useCallback)((t=>n=>{const o=[...e];n?o[t]=n:o.splice(t,1),i(o)}),[i,e]),c=e&&e.map(((t,e)=>{var i;const n={settings:l};return(0,Gr.jsx)(th,{value:t,onChange:u(e),context:o,item:n},`${e}-${null===(i=t.check)||void 0===i?void 0:i.property}`)}));return(0,Gr.jsxs)(Gr.Fragment,{children:[c,(0,Gr.jsx)(a.Button,{size:"sm",icon:"plus",onClick:h,variant:"secondary","aria-label":"Add geomap style rule",children:"Add style rule"})]})};var nh=i(11590),oh=i(10010);const rh={src:"public/maps/countries.geojson",rules:[],style:Ta},ah={style:Ta,check:{property:"",operation:Hl.EQ,value:""}};let sh;const lh={id:"geojson",name:"GeoJSON",description:"Load static data from a geojson file",isBaseMap:!1,state:o.PluginState.beta,create:async(t,e,i)=>{const n=Object.assign({},rh,e.config),o=new _s({url:n.src,format:new Xl.Z}),a=new wa.t,s=o.on("change",(()=>{"ready"==o.getState()&&((0,Po.B)(s),a.next(o.getFeatures()))})),l=[];if(n.rules)for(const t of n.rules)if(t.style){const e=await Ka(t.style);l.push({state:e,rule:t.check})}{const t=await Ka(n.style);l.push({state:t})}const h=new Dr({source:o,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||ql(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):Za(n)}return i?(e.point||(e.point=e.state.maker(e.state.base)),e.point):(e.poly||(e.poly=Za(e.state.base)),e.poly)}}});return{init:()=>h,update:t=>{console.log("todo... find values matching the ID and update")},registerOptionsUI:t=>{var e;const i=a.pipe((0,nh.P)(),(0,oh.U)((t=>function(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=Ca.Any;if(1===e.size)switch(e.values().next().value){case"Point":case"MultiPoint":n=Ca.Point;break;case"Line":case"MultiLine":n=Ca.Line;break;case"Polygon":n=Ca.Polygon}return{geometryType:n,propertes:Array.from(i.keys()).map((t=>({label:t,value:t})))}}(t))));sh||async function(){if(sh)return;sh=[];const t=await(0,r.getDataSourceSrv)().get("-- Grafana --");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}`;sh.push({value:i,label:i})}}))}})}(),t.addSelect({path:"config.src",name:"GeoJSON URL",settings:{options:null!==(e=sh)&&void 0!==e?e:[],allowCustomValue:!0},defaultValue:rh.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:rh.style}).addCustomEditor({id:"config.rules",path:"config.rules",name:"Style rules",description:"Apply styles based on feature properties",editor:ih,settings:{features:a,layerInfo:i},defaultValue:[]})}}},defaultOptions:rh};var hh=34962,uh=34963,ch=35048,ph=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function dh(t,e){for(var i=(0,Z.f0)({preserveDrawingBuffer:!0,antialias:!bt.ME},e),n=ph.length,o=0;o<n;++o)try{var r=t.getContext(ph[o],i);if(r)return r}catch(t){}return null}var fh=35044,gh=function(){function t(t,e){this.array=null,this.type=t,(0,g.h)(t===hh||t===uh,62),this.usage=void 0!==e?e:fh}return t.prototype.ofSize=function(t){this.array=new(_h(this.type))(t)},t.prototype.fromArray=function(t){var e=_h(this.type);this.array=e.from?e.from(t):new e(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(_h(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 _h(t){return t===uh?Uint32Array:Float32Array}const vh=gh,yh="webglcontextlost",mh="webglcontextrestored";const xh=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 a=(0,p.sq)(o.canvas);if(!t.renderTargets[a]){var s=o.getContextAttributes();s&&s.preserveDrawingBuffer&&(o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT)),t.renderTargets[a]=!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 bh(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 wh=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)}}(),Ch="u_projectionMatrix",Sh="u_offsetScaleMatrix",Eh="u_offsetRotateMatrix",Th="u_time",Rh="u_zoom",Ih="u_resolution",Oh={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126},Lh={};function Ph(t){return"shared/"+t}var Fh=0;var Ah=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?Ph(o.canvasCacheKey):(i="unique/"+Fh,Fh+=1,i),n.canvas_=function(t){var e=Lh[t];if(!e){var i=document.createElement("canvas");i.style.position="absolute",i.style.left="0",e={users:0,canvas:i},Lh[t]=e}return e.users+=1,e.canvas}(n.canvasCacheKey_),n.gl_=dh(n.canvas_),n.bufferCache_={},n.extensionCache_={},n.currentProgram_=null,n.canvas_.addEventListener(yh,n.boundHandleWebGLContextLost_),n.canvas_.addEventListener(mh,n.boundHandleWebGLContextRestored_),n.offsetRotateMatrix_=(0,d.Ue)(),n.offsetScaleMatrix_=(0,d.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 xh({webGlContext:r,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new xh({webGlContext:r})],n.shaderCompileErrors_=null,n.startTime_=Date.now(),n}return wh(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_===Ph(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,p.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,p.sq)(t),n=this.bufferCache_[i];n&&!e.isContextLost()&&e.deleteBuffer(n.webGlBuffer),delete this.bufferCache_[i]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(yh,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(mh,this.boundHandleWebGLContextRestored_),function(t){var e=Lh[t];if(e&&(e.users-=1,!(e.users>0))){var i=dh(e.canvas).getExtension("WEBGL_lose_context");i&&i.loseContext(),delete Lh[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 a=this.postProcessPasses_.length-1;a>=0;a--)this.postProcessPasses_[a].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,d.mc)(this.offsetScaleMatrix_);(0,d.bA)(n,2/e[0],2/e[1]);var o=(0,d.mc)(this.offsetRotateMatrix_);0!==i&&(0,d.U1)(o,-i),this.setUniformMatrixValue(Sh,bh(this.tmpMat4_,n)),this.setUniformMatrixValue(Eh,bh(this.tmpMat4_,o)),this.setUniformFloatValue(Th,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(Rh,t.viewState.zoom),this.setUniformFloatValue(Ih,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,bh(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 a="Fragment shader compliation failed: ".concat(i.getShaderInfoLog(n));throw new Error(a)}if(i.deleteShader(n),!i.getShaderParameter(o,i.COMPILE_STATUS)){a="Vertex shader compilation failed: ".concat(i.getShaderInfoLog(o));throw new Error(a)}if(i.deleteShader(o),!i.getProgramParameter(r,i.LINK_STATUS)){a="GL program linking failed: ".concat(i.getShaderInfoLog(o));throw new Error(a)}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,d.mc)(e),(0,d.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*Mh(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*Mh(o.type)}},e.prototype.handleWebGLContextLost=function(){(0,Z.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,a=n.RGBA,s=n.UNSIGNED_BYTE;return n.bindTexture(n.TEXTURE_2D,o),e?n.texImage2D(n.TEXTURE_2D,0,r,a,s,e):n.texImage2D(n.TEXTURE_2D,0,r,t[0],t[1],0,a,s,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}(u.Z);function Mh(t){switch(t){case Oh.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Oh.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Oh.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Oh.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}const jh=Ah;var kh=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)}}(),Dh="GENERATE_BUFFERS",Nh=function(t){function e(e,i){var n=t.call(this,e)||this,o=i||{};return n.inversePixelTransform_=(0,d.Ue)(),n.pixelContext_=null,n.postProcesses_=o.postProcesses,n.uniforms_=o.uniforms,n.helper,e.addChangeListener(B,n.removeHelper.bind(n)),n.dispatchPreComposeEvent=n.dispatchPreComposeEvent.bind(n),n.dispatchPostComposeEvent=n.dispatchPostComposeEvent.bind(n),n}return kh(e,t),e.prototype.dispatchPreComposeEvent=function(t,e){var i=this.getLayer();if(i.hasListener(K)){var n=new ct(K,void 0,e,t);i.dispatchEvent(n)}},e.prototype.dispatchPostComposeEvent=function(t,e){var i=this.getLayer();if(i.hasListener(H)){var n=new ct(H,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,a=t.layerStatesArray.length;r<a;r++){var s=t.layerStatesArray[r].layer,l=s.getRenderer();if(l instanceof e){var h=s.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 jh({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,d.qC)(this.inversePixelTransform_,0,0,i.pixelRatio,-i.pixelRatio,0,0,-i.size[1]);var o=new ct(t,this.inversePixelTransform_,i,e);n.dispatchEvent(o)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(V,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Y,t,e)},e.prototype.getDataAtPixel=function(t,e,i){var n=(0,d.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 a=(0,d.nn)(e.pixelToCoordinateTransform,t.slice());if(!(0,f.b8)(r,a))return null}var s=o.getContextAttributes();if(!s||!s.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}(Mo);function zh(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 Bh=Nh;var Gh=new Uint8Array(4);const Zh=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,We.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 Gh[0]=0,Gh[1]=0,Gh[2]=0,Gh[3]=0,Gh;this.readAll();var i=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return Gh[0]=this.data_[4*i],Gh[1]=this.data_[4*i+1],Gh[2]=this.data_[4*i+2],Gh[3]=this.data_[4*i+3],Gh},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 Wh=i(87743).Buffer;var Uh=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 Xh=function(t){function e(e,i){var n=this,o=i.uniforms||{},r=(0,d.Ue)();o[Ch]=r,(n=t.call(this,e,{uniforms:o,postProcesses:i.postProcesses})||this).ready=!1,n.sourceRevision_=-1,n.verticesBuffer_=new vh(hh,ch),n.hitVerticesBuffer_=new vh(hh,ch),n.indicesBuffer_=new vh(uh,ch),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 a=i.attributes?i.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:Oh.FLOAT}})):[];n.attributes=[{name:"a_position",size:2,type:Oh.FLOAT},{name:"a_index",size:1,type:Oh.FLOAT}].concat(a),n.hitDetectionAttributes=[{name:"a_position",size:2,type:Oh.FLOAT},{name:"a_index",size:1,type:Oh.FLOAT},{name:"a_hitColor",size:4,type:Oh.FLOAT},{name:"a_featureUid",size:1,type:Oh.FLOAT}].concat(a),n.customAttributes=i.attributes?i.attributes:[],n.previousExtent_=(0,f.lJ)(),n.currentTransform_=r,n.renderTransform_=(0,d.Ue)(),n.invertRenderTransform_=(0,d.Ue)(),n.renderInstructions_=new Float32Array(0),n.hitRenderInstructions_=new Float32Array(0),n.hitRenderTarget_,n.generateBuffersRun_=0,n.worker_=function(){var t='var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,a){var u=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=a?a.vertexPosition:0,h=a?a.indexPosition:0,d=b/u;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=u,l,v,1),c.length&&i.set(c,b+3),o(i,b+=u,l,v,2),c.length&&i.set(c,b+3),o(i,b+=u,l,v,3),c.length&&i.set(c,b+3),b+=u,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o,s=r.customAttributesCount,a=2+s,u=new Float32Array(r.renderInstructions),l=u.length/a,v=4*l*(s+3),c=new Uint32Array(6*l),g=new Float32Array(v),b=0;b<u.length;b+=a)o=i(u,b,g,c,s,o);var h=e({vertexBuffer:g.buffer,indexBuffer:c.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[g.buffer,c.buffer,u.buffer])}};';return new Worker("undefined"==typeof Blob?"data:application/javascript;base64,"+Wh.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===Dh){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,d.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 s=n.getLayer().getSource();return n.sourceListenKeys_=[(0,Q.oL)(s,is,n.handleSourceFeatureAdded_,n),(0,Q.oL)(s,ns,n.handleSourceFeatureChanged_,n),(0,Q.oL)(s,rs,n.handleSourceFeatureDelete_,n),(0,Q.oL)(s,os,n.handleSourceFeatureClear_,n)],s.forEachFeature(function(t){this.featureCache_[(0,p.sq)(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(n)),n}return Uh(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 Zh(this.helper))},e.prototype.handleSourceFeatureAdded_=function(t){var e=t.feature;this.featureCache_[(0,p.sq)(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var e=t.feature;this.featureCache_[(0,p.sq)(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var e=t.feature;delete this.featureCache_[(0,p.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=this.indicesBuffer_.getSize();this.helper.drawElements(0,i),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);var n=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderHitDetection(t),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),n},e.prototype.prepareFrameInternal=function(t){var e=this.getLayer(),i=e.getSource(),n=t.viewState,o=!t.viewHints[ke]&&!t.viewHints[De],r=!(0,f.fS)(this.previousExtent_,t.extent),a=this.sourceRevision_<i.getRevision();if(a&&(this.sourceRevision_=i.getRevision()),o&&(r||a)){var s=n.projection,l=n.resolution,h=e instanceof io?e.getRenderBuffer():0,u=(0,f.f3)(t.extent,h*l);i.loadFeatures(u,l,s),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.makeProjectionTransform(t,this.currentTransform_),(0,d.Jp)(this.currentTransform_,this.invertRenderTransform_),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,d.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 a,s=[],l=[],h=0,u=0;for(var c in this.featureCache_)if((n=(i=this.featureCache_[c]).geometry)&&n.getType()===Me.Z.POINT){s[0]=n.getFlatCoordinates()[0],s[1]=n.getFlatCoordinates()[1],(0,d.nn)(e,s),a=zh(u+6,l),this.renderInstructions_[h++]=s[0],this.renderInstructions_[h++]=s[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[u++]=s[0],this.hitRenderInstructions_[u++]=s[1],this.hitRenderInstructions_[u++]=a[0],this.hitRenderInstructions_[u++]=a[1],this.hitRenderInstructions_[u++]=a[2],this.hitRenderInstructions_[u++]=a[3],this.hitRenderInstructions_[u++]=Number(c));for(var p=void 0,f=0;f<this.customAttributes.length;f++)p=this.customAttributes[f].callback(i.feature,i.properties),this.renderInstructions_[h++]=p,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[u++]=p)}var g={type:Dh,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(g.projectionTransform=e,g.generateBuffersRun=++this.generateBuffersRun_,this.ready=!1,this.worker_.postMessage(g,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var _={type:Dh,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};_.projectionTransform=e,_.hitDetection=!0,this.worker_.postMessage(_,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o){if((0,g.h)(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var r=(0,d.nn)(e.coordinateToPixelTransform,t.slice()),a=this.hitRenderTarget_.readPixel(r[0]/2,r[1]/2),s=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)}([a[0]/255,a[1]/255,a[2]/255,a[3]/255]),l=this.hitRenderInstructions_[s],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){if(this.hitVerticesBuffer_.getSize()){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);var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e)}},e.prototype.disposeInternal=function(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach((function(t){(0,Q.bN)(t)})),this.sourceListenKeys_=null,t.prototype.disposeInternal.call(this)},e}(Bh);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="blur",Kh="gradient",Hh="radius",qh=["#00f","#0ff","#0f0","#ff0","#f00"];const $h=function(t){function e(e){var i=this,n=e||{},o=(0,Z.f0)({},n);delete o.gradient,delete o.radius,delete o.blur,delete o.weight,(i=t.call(this,o)||this).gradient_=null,i.addChangeListener(Kh,i.handleGradientChanged_),i.setGradient(n.gradient?n.gradient:qh),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 Vh(e,t),e.prototype.getBlur=function(){return this.get(Yh)},e.prototype.getGradient=function(){return this.get(Kh)},e.prototype.getRadius=function(){return this.get(Hh)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=1,i=256,n=wt(e,i),o=n.createLinearGradient(0,0,e,i),r=1/(t.length-1),a=0,s=t.length;a<s;++a)o.addColorStop(a*r,t[a]);return n.fillStyle=o,n.fillRect(0,0,e,i),n.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(Yh,t)},e.prototype.setGradient=function(t){this.set(Kh,t)},e.prototype.setRadius=function(t){this.set(Hh,t)},e.prototype.createRenderer=function(){return new Xh(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?(0,_.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(Hh)+this.get(Yh))}.bind(this),u_blurSlope:function(){return this.get(Hh)/Math.max(1,this.get(Yh))}.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}(io),Jh={weight:{fixed:1,min:0,max:1},blur:15,radius:5},Qh={id:"heatmap",name:"Heatmap",description:"Visualizes a heatmap of the data",isBaseMap:!1,showLocation:!0,create:async(t,e,i)=>{const n=Object.assign({},Jh,e.config),r=await(0,ua.cJ)(e.location),a=new vs(r),s="_weight",l=new $h({source:a,blur:n.blur,radius:n.radius,weight:t=>t.get(s)});return{init:()=>l,update:t=>{var e;const r=t.series[0];if(!r)return;a.update(r);const h=(0,ca.W8)(r,n.weight);a.forEachFeature((t=>{const e=t.get("rowIndex");null!=e&&t.set(s,h.get(e))}));let u=["#00f","#0ff","#0f0","#ff0","#f00"];const c=null!==(e=h.field)&&void 0!==e?e:r.fields.find((t=>t.type===o.FieldType.number));if(c){const t=(0,o.getFieldColorModeForField)(c);t.isContinuous&&t.getColors&&(u=t.getColors(i))}l.setGradient(u)},registerOptionsUI:t=>{t.addCustomEditor({id:"config.weight",path:"config.weight",name:"Weight values",description:"Scale the distribution for each row",editor:Ra.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:Jh.radius,settings:{min:1,max:50,step:1}}).addSliderInput({path:"config.blur",description:"Configures the amount of blur of clusters",name:"Blur",defaultValue:Jh.blur,settings:{min:1,max:50,step:1}})}}},defaultOptions:Jh},tu={icon:"https://openlayers.org/en/latest/examples/data/icon.png"},eu={id:"last-point-tracker",name:"Icon at last point",description:"Show an icon at the last point",isBaseMap:!1,showLocation:!0,state:o.PluginState.alpha,create:async(t,e,i)=>{const n=new qa.Z({}),o=Object.assign({},tu,e.config);n.setStyle(new Jn({image:new Tr({src:o.icon})}));const r=new _s({features:[n]}),a=new Dr({source:r}),s=await(0,ua.cJ)(e.location);return{init:()=>a,update:t=>{const e=t.series[0];if(e&&e.length){const t=(0,ua.g6)(e,s);if(!t.field)return;n.setGeometry(t.field.values.get(e.length-1))}}}},defaultOptions:tu},iu=[bs,Qh,eu,lh],nu={type:"default",name:"",config:{}},ou={id:nu.type,name:"Default base layer",isBaseMap:!0,create:(t,e,i)=>{var n;const o=null===aa.vc||void 0===aa.vc||null===(n=aa.vc.geomapDefaultBaseLayerConfig)||void 0===n?void 0:n.type;if(o){const e=ru.getIfExists(o);if(!e)throw new Error("Invalid basemap configuration on server");return e.create(t,aa.vc.geomapDefaultBaseLayerConfig,i)}return Fl.create(t,e,i)}},ru=new o.Registry((()=>[ou,...Ul,...iu]));function au(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}let su;class lu extends n.Component{constructor(t){var e;super(t),au(this,"panelContext",{}),au(this,"subs",new Nr.w0),au(this,"globalCSS",(e=r.config.theme2,l.iv`
    .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.secondary}; //rgba(255,255,255,0.4);
    }
    .ol-control:hover {
      background-color: ${e.colors.action.hover}; // 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);
    }
  `)),au(this,"mouseWheelZoom",void 0),au(this,"style",hu(r.config.theme)),au(this,"hoverPayload",{point:{},pageX:-1,pageY:-1}),au(this,"hoverEvent",new o.DataHoverEvent(this.hoverPayload)),au(this,"map",void 0),au(this,"mapDiv",void 0),au(this,"layers",[]),au(this,"byName",new Map),au(this,"getNextLayerName",(()=>{let t=this.layers.length;for(;t<100;){const e="Layer "+t++;if(!this.byName.has(e))return e}return`Layer ${Date.now()}`})),au(this,"actions",{selectLayer:t=>{const e=this.layers.findIndex((e=>e.options.name===t));this.panelContext.onInstanceStateChange&&this.panelContext.onInstanceStateChange({map:this.map,layers:this.layers,selected:e,actions:this.actions})},canRename:t=>!this.byName.has(t),deleteLayer:t=>{const e=[];for(const n of this.layers){var i;if(n.options.name===t)null===(i=this.map)||void 0===i||i.removeLayer(n.layer);else e.push(n)}this.layers=e,this.doOptionsUpdate(0)},addlayer:t=>{const e=ru.getIfExists(t);e&&this.initLayer(this.map,{type:e.id,name:this.getNextLayerName(),config:(0,h.cloneDeep)(e.defaultOptions),location:e.showLocation?{mode:o.FrameGeometrySourceMode.Auto}:void 0,tooltip:!0},!1).then((t=>{var e;this.layers=this.layers.slice(0),this.layers.push(t),null===(e=this.map)||void 0===e||e.addLayer(t.layer),this.doOptionsUpdate(this.layers.length-1)}))},reorder:(t,e)=>{var i;const n=Array.from(this.layers),[o]=n.splice(t,1);n.splice(e,0,o),this.layers=n,this.doOptionsUpdate(e);const r=null===(i=this.map)||void 0===i?void 0:i.getLayers();r.clear(),this.layers.forEach((t=>r.push(t.layer)))}}),au(this,"initMapRef",(async t=>{if(this.mapDiv=t,this.map&&this.map.dispose(),!t)return void(this.map=void 0);const{options:e}=this.props,i=this.map=new xn({view:this.initMapView(e.view,void 0),pixelRatio:1,layers:[],controls:[],target:t,interactions:yn({mouseWheelZoom:!1})});this.byName.clear();const n=[];try{var r,a;n.push(await this.initLayer(i,null!==(r=e.basemap)&&void 0!==r?r:nu,!0));const t=null!==(a=e.layers)&&void 0!==a?a:[xs];for(const e of t)n.push(await this.initLayer(i,e,!1))}catch(t){console.error("error loading layers",t)}for(const t of n)i.addLayer(t.layer);this.layers=n,this.map=i,this.initViewExtent(i.getView(),e.view,i.getLayers()),this.mouseWheelZoom=new dn,this.map.addInteraction(this.mouseWheelZoom),this.initControls(e.controls),this.forceUpdate(),this.map.on("singleclick",this.pointerClickListener),this.map.on("pointermove",this.pointerMoveListener),this.map.getViewport().addEventListener("mouseout",(t=>{this.props.eventBus.publish(new o.DataHoverClearEvent)})),this.panelContext.onInstanceStateChange&&this.panelContext.onInstanceStateChange({map:this.map,layers:n,selected:n.length-1,actions:this.actions}),this.setState({legends:this.getLegends()})})),au(this,"clearTooltip",(()=>{this.state.ttip&&!this.state.ttipOpen&&this.tooltipPopupClosed()})),au(this,"tooltipPopupClosed",(()=>{this.setState({ttipOpen:!1,ttip:void 0})})),au(this,"pointerClickListener",(t=>{this.pointerMoveListener(t)&&(t.preventDefault(),t.stopPropagation(),this.setState({ttipOpen:!0}))})),au(this,"pointerMoveListener",(t=>{if(!this.map||this.state.ttipOpen)return!1;const e=t.originalEvent,i=this.map.getEventPixel(e),n=(0,Be.bU)(this.map.getCoordinateFromPixel(i)),{hoverPayload:o}=this;o.pageX=e.pageX,o.pageY=e.pageY,o.point={lat:n[1],lon:n[0]},o.data=void 0,o.columnIndex=void 0,o.rowIndex=void 0,o.layers=void 0;const r=[],a=new Map;let s={};return this.map.forEachFeatureAtPixel(i,((t,e,i)=>{const n=e.__state;if(!o.data){const e=t.getProperties(),i=e.frame;i&&(o.data=s.data=i,o.rowIndex=s.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),r.push(e)),e.features.push(t)}}),{layerFilter:t=>!1!==t.__state.options.tooltip}),this.hoverPayload.layers=r.length?r:void 0,this.props.eventBus.publish(this.hoverEvent),this.setState({ttip:Object.assign({},o)}),r.length||this.layers.forEach((t=>{t.mouseEvents.next(void 0)})),!!r.length})),au(this,"updateLayer",(async(t,e)=>{var i;if(!this.map)return!1;const n=this.byName.get(t);if(!n)return!1;let o=-1;const r=null===(i=this.map)||void 0===i?void 0:i.getLayers();for(let t=0;t<(null==r?void 0:r.getLength());t++)if(r.item(t)===n.layer){o=t;break}if(e.name!==t){if(e.name){if(this.byName.has(e.name))return!1}else e.name=t;console.log("Layer name changed",t,">>>",e.name),this.byName.delete(t),t=e.name,this.byName.set(t,n)}n.options.type,e.type;const a=this.layers.slice(0);try{const t=await this.initLayer(this.map,e,n.isBasemap);a[o]=t,r.setAt(o,t.layer),t.handler.update&&t.handler.update(this.props.data)}catch(t){return console.warn("ERROR",t),!1}return this.setState({legends:[]}),this.layers=a,this.doOptionsUpdate(o),!0})),this.state={ttipOpen:!1,legends:[]},this.subs.add(this.props.eventBus.subscribe(Br.Yr,(t=>{this.mapDiv&&this.props.id===t.payload&&this.initMapRef(this.mapDiv)})))}componentDidMount(){this.panelContext=this.context}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()}doOptionsUpdate(t){const{options:e,onOptionsChange:i}=this.props,n=this.layers;i(Object.assign({},e,{basemap:n[0].options,layers:n.slice(1).map((t=>t.options))})),this.panelContext.onInstanceStateChange&&this.panelContext.onInstanceStateChange({map:this.map,layers:n,selected:t,actions:this.actions}),this.setState({legends:this.getLegends()})}optionsChanged(t){const e=this.props.options;var i;(console.log("options changed!",t),t.view!==e.view&&(console.log("View changed"),this.map.setView(this.initMapView(t.view,this.map.getLayers()))),t.controls!==e.controls)&&(console.log("Controls changed"),this.initControls(null!==(i=t.controls)&&void 0!==i?i:{showZoom:!0,showAttribution:!0}))}dataChanged(t){for(const e of this.layers)e.handler.update&&e.handler.update(t)}async initLayer(t,e,i){var n,o;!i||null!==(n=e)&&void 0!==n&&n.type&&!r.config.geomapDisableCustomBaseLayer||(e=nu),null!==(o=e)&&void 0!==o&&o.type||(e={type:ms,name:this.getNextLayerName(),config:{}});const a=ru.getIfExists(e.type);if(!a)return Promise.reject("unknown layer: "+e.type);const s=await a.create(t,e,r.config.theme2),l=s.init();s.update&&s.update(this.props.data),e.name||(e.name=this.getNextLayerName());const h=e.name,u={isBasemap:i,options:e,layer:l,handler:s,mouseEvents:new zr.x,getName:()=>h,onChange:t=>{this.updateLayer(h,t)}};return this.byName.set(h,u),u.layer.__state=u,u}initMapView(t,e){let i=new oi({center:[0,0],zoom:1,showFullExtent:!0});return t.shared&&(su?i=su:su=i),e&&this.initViewExtent(i,t,e),i}initViewExtent(t,e,i){const n=Yl.getIfExists(e.id);if(n){let u;var o,r,a,s;if(null==n.lat)if(n.id===Vl.Coordinates)u=[null!==(o=e.lon)&&void 0!==o?o:0,null!==(r=e.lat)&&void 0!==r?r:0];else if(n.id===Vl.Fit){var l,h=i.getArray().filter((t=>t instanceof Dr)).map((t=>{var e;return null!==(e=t.getSource().getExtent())&&void 0!==e?e:[]})).reduce(f.l7,(0,f.lJ)());if(!(0,f.xb)(h))t.fit(h,{padding:[30,30,30,30],maxZoom:null!==(l=e.zoom)&&void 0!==l?l:e.maxZoom})}else console.log("TODO, view requires special handling",n);else u=[null!==(a=n.lon)&&void 0!==a?a:0,null!==(s=n.lat)&&void 0!==s?s:0];u&&t.setCenter((0,Be.mi)(u))}e.maxZoom&&t.setMaxZoom(e.maxZoom),e.minZoom&&t.setMaxZoom(e.minZoom),e.zoom&&(null==n?void 0:n.id)!==Vl.Fit&&t.setZoom(e.zoom)}initControls(t){if(!this.map)return;this.map.getControls().clear(),t.showZoom&&this.map.addControl(new mi),t.showScale&&this.map.addControl(new Pn({units:t.scaleUnits,minWidth:100})),this.mouseWheelZoom.setActive(Boolean(t.mouseWheelZoom)),t.showAttribution&&this.map.addControl(new gi({collapsed:!0,collapsible:!0}));let e=[];t.showDebug&&(e=[(0,Gr.jsx)(la,{map:this.map},"debug")]),this.setState({topRight:e})}getLegends(){const t=[];for(const e of this.layers)e.handler.legend&&t.push((0,Gr.jsx)("div",{children:e.handler.legend},e.options.name));return t}render(){const{ttip:t,ttipOpen:e,topRight:i,legends:n}=this.state,o=this.props.options.controls.showScale;return(0,Gr.jsxs)(Gr.Fragment,{children:[(0,Gr.jsx)(l.xB,{styles:this.globalCSS}),(0,Gr.jsxs)("div",{className:this.style.wrap,onMouseLeave:this.clearTooltip,children:[(0,Gr.jsx)("div",{className:this.style.map,ref:this.initMapRef}),(0,Gr.jsx)(Zr,{bottomLeft:n,topRight:i,blStyle:{bottom:o?"35px":"8px"}})]}),(0,Gr.jsx)(ea,{ttip:t,isOpen:e,onClose:this.tooltipPopupClosed})]})}}au(lu,"contextType",a.PanelContextRoot);const hu=(0,a.stylesFactory)((t=>({wrap:s.css`
    position: relative;
    width: 100%;
    height: 100%;
  `,map:s.css`
    position: absolute;
    z-index: 0;
    width: 100%;
    height: 100%;
  `})));var uu,cu,pu=i(38576),du=i(12641),fu=i(64593),gu=i(93067);function _u(t){return{category:t.category,path:"--",defaultValue:t.basemaps?nu:xs,values:e=>({getContext:e=>Object.assign({},e,{options:t.state.options,instanceState:t.state}),getValue:e=>(0,h.get)(t.state.options,e),onChange:(e,i)=>{const{state:n}=t,{options:r}=n;if("type"===e&&i){const t=ru.getIfExists(i);if(t){console.log("Change layer type:",i,n);const e=Object.assign({},r,{type:t.id,config:Object.assign({},t.defaultOptions)});var a;if(t.showLocation)null!==(a=e.location)&&void 0!==a&&a.mode?delete e.location:e.location={mode:o.FrameGeometrySourceMode.Auto};return void n.onChange(e)}}n.onChange((0,fu.hs)(r,e,i))}}),build:(e,i)=>{if(!t.state)return void console.log("MISSING LAYER!!!",t);const{handler:n,options:o}=t.state,r=ru.getIfExists(null==o?void 0:o.type),a=ru.selectOptions(null!=o&&o.type?[o.type]:[nu.type],t.basemaps?vu:yu);e.addSelect({path:"type",name:"Layer type",settings:{options:a.options}}),r&&o.type!==nu.type&&(r.showLocation&&(0,gu.C)("Location","location.",e,o.location),n.registerOptionsUI&&n.registerOptionsUI(e),r.showOpacity,(0,h.isEqual)(t.category,["Base layer"])||e.addBooleanSwitch({path:"tooltip",name:"Display tooltip",description:"Show the tooltip for layer",defaultValue:!0}))}}}function vu(t){return!!t.isBaseMap&&(t.state!==o.PluginState.alpha||aa.Oh)}function yu(t){return!t.isBaseMap&&(t.state!==o.PluginState.alpha||aa.Oh)}const mu=t=>{var e,i;const{layers:n,selected:o,actions:r}=null!==(e=t.context.instanceState)&&void 0!==e?e:{};if(!n||!r)return uu||(uu=(0,Gr.jsx)("div",{children:"No layers?"}));const s=o?[null===(i=n[o])||void 0===i?void 0:i.getName()]:[];return(0,Gr.jsxs)(Gr.Fragment,{children:[(0,Gr.jsx)(a.Container,{children:(0,Gr.jsx)(pu.f,{onChange:t=>r.addlayer(t.value),options:ru.selectOptions(void 0,yu).options,label:"Add layer"})}),cu||(cu=(0,Gr.jsx)("br",{})),(0,Gr.jsx)(du.E,{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,a=-1*(e.source.index-r),s=-1*(e.destination.index-r);o.reorder(a,s)},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})]})};var xu;const bu=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(Yl.list()[0].id),Yl.selectOptions(t)}),[null==i?void 0:i.id]),l=(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,Be.bU)(n,t.getProjection());o(Object.assign({},i,{id:Vl.Coordinates,lon:+e[0].toFixed(6),lat:+e[1].toFixed(6),zoom:+t.getZoom().toFixed(2)}))}}}),[i,o,r.instanceState]),h=(0,n.useCallback)((t=>{const e=Yl.getIfExists(t.value);var n,r,a;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!==(a=e.zoom)&&void 0!==a?a:null==i?void 0:i.zoom}))}),[i,o]);return(0,Gr.jsxs)(Gr.Fragment,{children:[(0,Gr.jsx)(a.InlineFieldRow,{children:(0,Gr.jsx)(a.InlineField,{label:"View",labelWidth:10,grow:!0,children:(0,Gr.jsx)(a.Select,{options:s.options,value:s.current,onChange:h})})}),(null==i?void 0:i.id)===Vl.Coordinates&&(0,Gr.jsxs)(Gr.Fragment,{children:[(0,Gr.jsx)(a.InlineFieldRow,{children:(0,Gr.jsx)(a.InlineField,{label:"Latitude",labelWidth:10,grow:!0,children:(0,Gr.jsx)($l.Y,{value:i.lat,min:-90,max:90,step:.001,onChange:t=>{o(Object.assign({},i,{lat:t}))}})})}),(0,Gr.jsx)(a.InlineFieldRow,{children:(0,Gr.jsx)(a.InlineField,{label:"Longitude",labelWidth:10,grow:!0,children:(0,Gr.jsx)($l.Y,{value:i.lon,min:-180,max:180,step:.001,onChange:t=>{o(Object.assign({},i,{lon:t}))}})})})]}),(0,Gr.jsx)(a.InlineFieldRow,{children:(0,Gr.jsx)(a.InlineField,{label:"Zoom",labelWidth:10,grow:!0,children:(0,Gr.jsx)($l.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,Gr.jsx)(a.VerticalGroup,{children:(0,Gr.jsx)(a.Button,{variant:"secondary",size:"sm",fullWidth:!0,onClick:l,children:xu||(xu=(0,Gr.jsx)("span",{children:"Use current map settings"}))})})]})};function wu(t){const e=+t;return isNaN(e)?void 0:e}var Cu;const Su=new o.PanelPlugin(lu).setNoPadding().setPanelChangeHandler(((t,e,i,n)=>{if("grafana-worldmap-panel"===e&&i.angular){const{fieldConfig:e,options:r}=function(t){const e={defaults:{},overrides:[]},i={view:{id:Vl.Zero},controls:{showZoom:!0,mouseWheelZoom:Boolean(t.mouseWheelZoom)},basemap:{type:"default",name:"Basemap"},layers:[]};let n=wu(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:o.ThresholdsMode.Absolute,steps:n}}n=wu(t.initialZoom),n&&(i.view.zoom=n);const r={"(0°, 0°)":Vl.Zero,"North America":"north-america",Europe:"europe","West Asia":"west-asia","SE Asia":"se-asia","Last GeoHash":Vl.Coordinates};return i.view.id=r[t.mapCenter],i.view.lat=wu(t.mapCenterLatitude),i.view.lon=wu(t.mapCenterLongitude),{fieldConfig:e,options:i}}(Object.assign({},i.angular,{fieldConfig:n}));return t.fieldConfig=e,r}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,h.cloneDeep)(Ta),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=Xa.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:ca.Q8.Fixed}),Object.assign({},t.options,{layers:[Object.assign({},e,{config:n})]})}}}return t.options})).useFieldConfig({useCustomConfig:t=>{a.commonOptionsBuilder.addHideFrom(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:bu,defaultValue:Kl}),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:Kl.shared});const n=e.instanceState;if(null!=n&&n.layers){t.addCustomEditor({category:["Data layer"],id:"layers",path:"",name:"",editor:mu});const e=n.layers[n.selected];n.selected&&e&&t.addNestedOptions(_u({state:e,category:["Data layer"],basemaps:!1}));const i=n.layers[0];r.config.geomapDisableCustomBaseLayer?t.addCustomEditor({category:["Base layer"],id:"layers",path:"",name:"",editor:()=>Cu||(Cu=(0,Gr.jsx)("div",{children:"The base layer is configured by the server admin."}))}):i&&t.addNestedOptions(_u({state:i,category:["Base layer"],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.showDebug",name:"Show debug",description:"Show map info",defaultValue:!1})}))},28116: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 a={};if(n)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var h=0;h<t.length;h++){var u=[].concat(t[h]);n&&a[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}},96293: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," */"),a=i.sources.map((function(t){return"/*# sourceURL=".concat(i.sourceRoot||"").concat(t," */")}));return[e].concat(a).concat([r]).join("\n")}return[e].join("\n")}},62597:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(68404),o=i(40268);const r=function(t,e){var i=(0,n.useState)(e),r=i[0],a=i[1];return(0,o.Z)((function(){var e=t.subscribe(a);return function(){return e.unsubscribe()}}),[t]),r}},24897: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={},a=[],s=0;s<t.length;s++){var l=t[s],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=s,e.splice(s,0,{identifier:c,updater:f,references:1})}a.push(c)}return a}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 a=0;a<r.length;a++){var s=i(r[a]);e[s].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}}},87414: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)}},33254:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},24532:(t,e,i)=>{"use strict";t.exports=function(t){var e=i.nc;e&&t.setAttribute("nonce",e)}},54533: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)}}}},24406: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))}}},43788:function(t){t.exports=function(){"use strict";function t(t,n,o,r,a){!function t(i,n,o,r,a){for(;r>o;){if(r-o>600){var s=r-o+1,l=n-o+1,h=Math.log(s),u=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*u*(s-u)/s)*(l-s/2<0?-1:1);t(i,n,Math.max(o,Math.floor(n-l*u/s+c)),Math.min(r,Math.floor(n+(s-l)*u/s+c)),a)}var p=i[n],d=o,f=r;for(e(i,o,n),a(i[r],p)>0&&e(i,o,r);d<f;){for(e(i,d,f),d++,f--;a(i[d],p)<0;)d++;for(;a(i[f],p)>0;)f--}0===a(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,a||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){a(t,0,t.children.length,e,t)}function a(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 a=t.children[r];s(o,t.leaf?n(a):a)}return o}function s(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 a=[i,n];a.length;)if(!((n=a.pop())-(i=a.pop())<=o)){var s=i+Math.ceil((n-i)/o/2)*o;t(e,s,i,n,r),a.push(i,s,s,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 a=e.children[r],s=e.leaf?n(a):a;d(t,s)&&(e.leaf?i.push(a):p(t,s)?this._all(a,i):o.push(a))}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,a=this.data,s=this.toBBox(t),l=[],h=[];a||l.length;){if(a||(a=l.pop(),n=l[l.length-1],i=h.pop(),r=!0),a.leaf){var u=o(t,a.children,e);if(-1!==u)return a.children.splice(u,1),l.push(a),this._condense(l),this}r||a.leaf||!p(a,s)?n?(i++,a=n.children[i],r=!1):a=null:(l.push(a),h.push(i),i=0,n=a,a=a.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,a=i-e+1,s=this._maxEntries;if(a<=s)return r(o=f(t.slice(e,i+1)),this.toBBox),o;n||(n=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,n-1))),(o=f([])).leaf=!1,o.height=n;var l=Math.ceil(a/s),h=l*Math.ceil(Math.sqrt(s));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,a=void 0,s=0;s<e.children.length;s++){var l=e.children[s],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,a=l):c===r&&h<o&&(o=h,a=l)}e=a||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),s(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 a=this._chooseSplitIndex(i,o,n),s=f(i.children.splice(a,i.children.length-a));s.height=i.height,s.leaf=i.leaf,r(i,this.toBBox),r(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)},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,s,l,h,c,p=1/0,d=1/0,f=e;f<=i-e;f++){var g=a(t,0,f,this.toBBox),_=a(t,f,i,this.toBBox),v=(o=g,r=_,s=void 0,l=void 0,h=void 0,c=void 0,s=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-s)*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=a(t,0,e,o),l=a(t,i-e,i,o),h=c(r)+c(l),u=e;u<i-e;u++){var p=t.children[u];s(r,t.leaf?o(p):p),h+=c(r)}for(var d=i-e-1;d>=e;d--){var f=t.children[d];s(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--)s(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=898.46352345bec1eb52ae0e.js.map