(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[9646],{"./public/app/features/dashboard/components/PanelEditor/OptionsPaneCategory.tsx":(t,e,n)=>{"use strict";n.d(e,{u:()=>h});var i=n("./node_modules/react/index.js"),r=n("./node_modules/@emotion/css/dist/emotion-css.esm.js"),o=n("./packages/grafana-ui/src/index.ts"),s=n("./public/app/features/dashboard/components/PanelEditor/state/reducers.ts"),a=n("./node_modules/react-use/esm/useLocalStorage.js"),l=n("./packages/grafana-e2e-selectors/src/index.ts"),u=n("./node_modules/react/jsx-runtime.js");const h=i.memo((({id:t,title:e,children:n,forceOpen:s,isOpenDefault:h,renderTitle:f,className:d,itemsCount:g,isNested:_=!1})=>{var y,v;const m=!1!==h,[x,w]=(0,a.Z)(p(t),{isExpanded:m}),[C,b]=(0,i.useState)(null!==(y=null==x?void 0:x.isExpanded)&&void 0!==y?y:m),S=(0,o.useStyles2)(c);(0,i.useEffect)((()=>{!C&&s&&s>0&&b(!0)}),[s,C]);const E=(0,i.useCallback)((()=>{w({isExpanded:!C}),b(!C)}),[w,b,C]);f||(f=function(t){return t||void 0===g||0===g?e:v||(v=(0,u.jsxs)("span",{children:[e," ",(0,u.jsx)(o.Counter,{value:g})]}))});const T=(0,r.cx)({[S.box]:!0,[S.boxNestedExpanded]:_&&C},d,"options-group"),O=(0,r.cx)(S.header,{[S.headerExpanded]:C,[S.headerNested]:_}),R=(0,r.cx)(S.body,{[S.bodyNested]:_});return(0,u.jsxs)("div",{className:T,"data-testid":"options-category","aria-label":l.wl.components.OptionsGroup.group(t),children:[(0,u.jsxs)("div",{className:O,onClick:E,"aria-label":l.wl.components.OptionsGroup.toggle(t),children:[(0,u.jsx)("div",{className:(0,r.cx)(S.toggle,"editor-options-group-toggle"),children:(0,u.jsx)(o.Icon,{name:C?"angle-down":"angle-right"})}),(0,u.jsx)("div",{className:S.title,role:"heading",children:f(C)})]}),C&&(0,u.jsx)("div",{className:R,children:n})]})})),c=t=>({box:r.css`
      border-top: 1px solid ${t.colors.border.weak};
    `,boxNestedExpanded:r.css`
      margin-bottom: ${t.spacing(2)};
    `,toggle:r.css`
      color: ${t.colors.text.secondary};
      margin-right: ${t.spacing(1)};
    `,title:r.css`
      flex-grow: 1;
      overflow: hidden;
    `,header:r.css`
      display: flex;
      cursor: pointer;
      align-items: baseline;
      padding: ${t.spacing(1)};
      color: ${t.colors.text.primary};
      font-weight: ${t.typography.fontWeightMedium};

      &:hover {
        background: ${t.colors.emphasize(t.colors.background.primary,.03)};
      }
    `,headerExpanded:r.css`
      color: ${t.colors.text.primary};
    `,headerNested:r.css`
      padding: ${t.spacing(.5,0,.5,0)};
    `,body:r.css`
      padding: ${t.spacing(1,2,1,4)};
    `,bodyNested:r.css`
      position: relative;
      padding-right: 0;
      &:before {
        content: '';
        position: absolute;
        top: 0;
        left: 8px;
        width: 1px;
        height: 100%;
        background: ${t.colors.border.weak};
      }
    `}),p=t=>`${s.jy}.optionGroup[${t}]`},"./public/app/features/dashboard/components/PanelEditor/OptionsPaneCategoryDescriptor.tsx":(t,e,n)=>{"use strict";n.d(e,{j:()=>s});n("./node_modules/react/index.js");var i=n("./public/app/features/dashboard/components/PanelEditor/OptionsPaneCategory.tsx"),r=n("./node_modules/react/jsx-runtime.js");function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class s{constructor(t){o(this,"items",[]),o(this,"categories",[]),o(this,"parent",void 0),this.props=t}addItem(t){return t.parent=this,this.items.push(t),this}addCategory(t){return t.props.isNested=!0,t.parent=this,this.categories.push(t),this}render(t){return this.props.customRender?this.props.customRender():(0,r.jsxs)(i.u,Object.assign({},this.props,{children:[this.items.map((t=>t.render())),this.categories.map((t=>t.render()))]}),this.props.title)}}},"./public/app/features/dashboard/components/PanelEditor/OptionsPaneItemDescriptor.tsx":(t,e,n)=>{"use strict";n.d(e,{a:()=>l});var i=n("./packages/grafana-e2e-selectors/src/index.ts"),r=n("./packages/grafana-ui/src/index.ts"),o=(n("./node_modules/react/index.js"),n("./node_modules/react-highlight-words/dist/main.js")),s=n.n(o),a=n("./node_modules/react/jsx-runtime.js");class l{constructor(t){var e,n,i;i=void 0,(n="parent")in(e=this)?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,this.props=t}getLabel(t){const{title:e,description:n}=this.props;if(!t)return this.parent.props.title===e?null:e;const i=[];return this.parent.parent&&i.push(this.highlightWord(this.parent.parent.props.title,t)),this.parent.props.title!==e&&i.push(this.highlightWord(this.parent.props.title,t)),(0,a.jsx)(r.Label,{description:n&&this.highlightWord(n,t),category:i,children:this.highlightWord(e,t)})}highlightWord(t,e){return(0,a.jsx)(s(),{textToHighlight:t,searchWords:[e],highlightClassName:"search-fragment-highlight"})}render(t){const{title:e,description:n,render:o,showIf:s,skipField:l}=this.props,u=`${this.parent.props.id} ${e}`;return s&&!s()?null:l?o():(0,a.jsx)(r.Field,{label:this.getLabel(t),description:n,"aria-label":i.wl.components.PanelEditor.OptionsPane.fieldLabel(u),children:o()},u)}}},"./public/app/features/dashboard/components/PanelEditor/getVizualizationOptions.tsx":(t,e,n)=>{"use strict";n.d(e,{m:()=>u,H:()=>h});n("./node_modules/react/index.js");var i=n("./node_modules/lodash/lodash.js"),r=n("./public/app/features/panel/panellinks/link_srv.ts"),o=n("./public/app/features/dashboard/components/PanelEditor/utils.ts"),s=n("./public/app/features/dashboard/components/PanelEditor/OptionsPaneItemDescriptor.tsx"),a=n("./public/app/features/dashboard/components/PanelEditor/OptionsPaneCategoryDescriptor.tsx"),l=n("./node_modules/react/jsx-runtime.js");function u(t){const{plugin:e,panel:n,onPanelOptionsChanged:u,onFieldConfigsChange:c,data:p,dashboard:f}=t,d=n.getOptions(),g=n.fieldConfig,_={},y={data:(null==p?void 0:p.series)||[],replaceVariables:n.replaceVariables,options:d,eventBus:f.events,getSuggestions:t=>p?(0,r.PW)(p.series,t):[]},v=t=>{var n;const i=null!==(n=t&&t[0])&&void 0!==n?n:`${e.meta.name}`,r=_[i];return r||(_[i]=new a.j({title:i,id:i}))};h(e.optionEditors.list(),v,((t,e)=>{const n=(0,o.hs)(y.options,t,e);u(n)}),y);for(const t of e.fieldConfigRegistry.list()){if(t.isCustom&&t.showIf&&!t.showIf(g.defaults.custom,null==p?void 0:p.series))continue;if(t.hideFromDefaults)continue;const e=v(t.category),n=t.editor,r=g.defaults,a=t.isCustom?r.custom?(0,i.get)(r.custom,t.path):void 0:(0,i.get)(r,t.path);t.getItemsCount&&(e.props.itemsCount=t.getItemsCount(a)),e.addItem(new s.a({title:t.name,description:t.description,render:function(){return(0,l.jsx)(n,{value:a,onChange:e=>{c((0,o.uJ)(g,t.path,e,t.isCustom))},item:t,context:y})}}))}return Object.values(_)}function h(t,e,n,r){for(const o of t){if(o.showIf&&!o.showIf(r.options,r.data))continue;const t=e(o.category),a=o.editor;t.addItem(new s.a({title:o.name,description:o.description,render:function(){return(0,l.jsx)(a,{value:(0,i.get)(r.options,o.path),onChange:t=>{n(o.path,t)},item:o,context:r})}}))}}},"./public/app/features/dashboard/components/PanelEditor/utils.ts":(t,e,n)=>{"use strict";n.d(e,{jF:()=>s,sY:()=>a,uJ:()=>l,hs:()=>u});var i=n("./node_modules/lodash/lodash.js"),r=n("./public/app/features/dashboard/components/PanelEditor/types.ts"),o=n("./public/app/core/constants.ts");function s(t,e,n,i){if(t===r.d1.Fill)return{width:e,height:n};const s=(window.innerWidth-60-4*o.hD)/o.cz*i.gridPos.w,a=o.K3*i.gridPos.h+48,l=Math.min(e/s,n/a);return s<=e&&a<=n?{width:s,height:a}:{width:s*l,height:a*l}}function a(t){return!1===(null==t?void 0:t.meta.skipDataQuery)}const l=(t,e,n,r)=>{let o=Object.assign({},t.defaults);const s=null==n||""===n;return r?o.custom?o.custom=s?(0,i.omit)(o.custom,e):u(o.custom,e,n):s||(o.custom=u(o.custom,e,n)):o=s?(0,i.omit)(o,e):u(o,e,n),Object.assign({},t,{defaults:o})};function u(t,e,n){const i=Array.isArray(e)?e:e.split("."),r=i.shift();if(r.endsWith("]")){const e=r.lastIndexOf("["),o=+r.substring(e+1,r.length-1),s=r.substr(0,e);let a=t[s];const l=Array.isArray(a)?[...a]:[];return i.length&&(a=l[o],null!=a&&"object"==typeof a||(a={}),n=u(a,i,n)),l[o]=n,Object.assign({},t,{[s]:l})}if(!i.length)return Object.assign({},t,{[r]:n});let o=t[r];return null!=o&&"object"==typeof o||(o={}),Object.assign({},t,{[r]:u(o,i,n)})}},"./public/app/plugins/panel/geomap/module.tsx":(t,e,n)=>{"use strict";n.r(e),n.d(e,{plugin:()=>Zp});var i=n("./packages/grafana-data/src/index.ts"),r=n("./node_modules/react/index.js"),o=n("./packages/grafana-ui/src/index.ts");const s="change",a="error",l="contextmenu",u="click",h="dblclick",c="keydown",p="keypress",f="load",d="resize",g="touchmove",_="wheel";const y=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();const v=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}();function m(t,e){return t>e?1:t<e?-1:0}function x(t,e,n){var i=t.length;if(t[0]<=e)return 0;if(e<=t[i-1])return i-1;var r=void 0;if(n>0){for(r=1;r<i;++r)if(t[r]<e)return r-1}else if(n<0){for(r=1;r<i;++r)if(t[r]<=e)return r}else for(r=1;r<i;++r){if(t[r]==e)return r;if(t[r]<e)return"function"==typeof n?n(e,t[r-1],t[r])>0?r-1:r:t[r-1]-e<e-t[r]?r-1:r}return i-1}function w(t,e,n){for(;e<n;){var i=t[e];t[e]=t[n],t[n]=i,++e,--n}}function C(t,e){for(var n=Array.isArray(e)?e:[e],i=n.length,r=0;r<i;r++)t[t.length]=n[r]}function b(t,e){var n=t.length;if(n!==e.length)return!1;for(var i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}function S(){return!0}function E(){return!1}function T(){}var O="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),i=1,r=arguments.length;i<r;++i){var o=arguments[i];if(null!=o)for(var s in o)o.hasOwnProperty(s)&&(n[s]=o[s])}return n};function R(t){for(var e in t)delete t[e]}var P="function"==typeof Object.values?Object.values:function(t){var e=[];for(var n in t)e.push(t[n]);return e};function I(t){var e;for(e in t)return!1;return!e}var F,M=(F=function(t,e){return(F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(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 n(){this.constructor=t}F(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const L=function(t){function e(e){var n=t.call(this)||this;return n.eventTarget_=e,n.pendingRemovals_=null,n.dispatching_=null,n.listeners_=null,n}return M(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var n=this.listeners_||(this.listeners_={}),i=n[t]||(n[t]=[]);-1===i.indexOf(e)&&i.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new v(t):t,n=e.type;e.target||(e.target=this.eventTarget_||this);var i,r=this.listeners_&&this.listeners_[n];if(r){var o=this.dispatching_||(this.dispatching_={}),s=this.pendingRemovals_||(this.pendingRemovals_={});n in o||(o[n]=0,s[n]=0),++o[n];for(var a=0,l=r.length;a<l;++a)if(!1===(i="handleEvent"in r[a]?r[a].handleEvent(e):r[a].call(this,e))||e.propagationStopped){i=!1;break}if(--o[n],0===o[n]){var u=s[n];for(delete s[n];u--;)this.removeEventListener(n,T);delete o[n]}return i}},e.prototype.disposeInternal=function(){this.listeners_&&R(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var n=this.listeners_&&this.listeners_[t];if(n){var i=n.indexOf(e);-1!==i&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[i]=T,++this.pendingRemovals_[t]):(n.splice(i,1),0===n.length&&delete this.listeners_[t]))}},e}(y),A=0,j=1,D=2,k=3,G=4;function z(){return function(){throw new Error("Unimplemented abstract method.")}()}var N=0;function B(t){return t.ol_uid||(t.ol_uid=String(++N))}var W="6.7.0";function U(t){return Math.pow(t,3)}function X(t){return 1-U(1-t)}function Y(t){return 3*t*t-2*t*t*t}function Z(t){return t}var V=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const K=function(t){function e(e,n,i){var r=t.call(this)||this,o=i||{};return r.tileCoord=e,r.state=n,r.interimTile=null,r.key="",r.transition_=void 0===o.transition?250:o.transition,r.transitionStarts_={},r}return V(e,t),e.prototype.changed=function(){this.dispatchEvent(s)},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()==D)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()==D){t.interimTile=null;break}t.getState()==j?e=t:t.getState()==A?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!==k&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){z()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var n=this.transitionStarts_[t];if(n){if(-1===n)return 1}else n=e,this.transitionStarts_[t]=n;var i=e-n+1e3/60;return i>=this.transition_?1:U(i/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}(L);var H="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",q=-1!==H.indexOf("firefox"),J=(-1!==H.indexOf("safari")&&H.indexOf("chrom"),-1!==H.indexOf("webkit")&&-1==H.indexOf("edge")),$=-1!==H.indexOf("macintosh"),Q="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,tt="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,et="undefined"!=typeof Image&&Image.prototype.decode,nt=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}();function it(t,e,n,i){var r;return n&&n.length?r=n.shift():tt?r=new OffscreenCanvas(t||300,e||300):(r=document.createElement("canvas")).style.all="initial",t&&(r.width=t),e&&(r.height=e),r.getContext("2d",i)}function rt(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function ot(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var st=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const at=function(t){function e(e,n,i,r){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=i,o.resolution=n,o.state=r,o}return st(e,t),e.prototype.changed=function(){this.dispatchEvent(s)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return z()},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(){z()},e}(L),lt=0,ut=1,ht=2,ct=3,pt="bottom-left",ft="bottom-right",dt="top-left",gt="top-right",_t=0,yt=1,vt=2,mt=4,xt=8,wt=16;var Ct=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const bt=function(t){function e(e){var n=this,i="Assertion failed. See https://openlayers.org/en/"+("v"+W.split("-")[0])+"/doc/errors/#"+e+" for details.";return(n=t.call(this,i)||this).code=e,n.name="AssertionError",n.message=i,n}return Ct(e,t),e}(Error);function St(t,e){if(!t)throw new bt(e)}function Et(t){for(var e=Lt(),n=0,i=t.length;n<i;++n)zt(e,t[n]);return e}function Tt(t,e,n){return n?(n[0]=t[0]-e,n[1]=t[1]-e,n[2]=t[2]+e,n[3]=t[3]+e,n):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function Ot(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Rt(t,e,n){var i,r;return(i=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*i+(r=n<t[1]?t[1]-n:t[3]<n?n-t[3]:0)*r}function Pt(t,e){return Ft(t,e[0],e[1])}function It(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function Ft(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function Mt(t,e){var n=t[0],i=t[1],r=t[2],o=t[3],s=e[0],a=e[1],l=_t;return s<n?l|=wt:s>r&&(l|=mt),a<i?l|=xt:a>o&&(l|=vt),l===_t&&(l=yt),l}function Lt(){return[1/0,1/0,-1/0,-1/0]}function At(t,e,n,i,r){return r?(r[0]=t,r[1]=e,r[2]=n,r[3]=i,r):[t,e,n,i]}function jt(t){return At(1/0,1/0,-1/0,-1/0,t)}function Dt(t,e,n,i,r){return Nt(jt(r),t,e,n,i)}function kt(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Gt(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function zt(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function Nt(t,e,n,i,r){for(;n<i;n+=r)Bt(t,e[n],e[n+1]);return t}function Bt(t,e,n){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],n)}function Wt(t,e){var n;return(n=e(Xt(t)))||(n=e(Yt(t)))||(n=e($t(t)))?n:(n=e(Jt(t)))||!1}function Ut(t){var e=0;return ee(t)||(e=Qt(t)*Ht(t)),e}function Xt(t){return[t[0],t[1]]}function Yt(t){return[t[2],t[1]]}function Zt(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function Vt(t,e){var n;return e===pt?n=Xt(t):e===ft?n=Yt(t):e===dt?n=Jt(t):e===gt?n=$t(t):St(!1,13),n}function Kt(t,e,n,i,r){var o=e*i[0]/2,s=e*i[1]/2,a=Math.cos(n),l=Math.sin(n),u=o*a,h=o*l,c=s*a,p=s*l,f=t[0],d=t[1],g=f-u+p,_=f-u-p,y=f+u-p,v=f+u+p,m=d-h-c,x=d-h+c,w=d+h+c,C=d+h-c;return At(Math.min(g,_,y,v),Math.min(m,x,w,C),Math.max(g,_,y,v),Math.max(m,x,w,C),r)}function Ht(t){return t[3]-t[1]}function qt(t,e,n){var i=n||[1/0,1/0,-1/0,-1/0];return te(t,e)?(t[0]>e[0]?i[0]=t[0]:i[0]=e[0],t[1]>e[1]?i[1]=t[1]:i[1]=e[1],t[2]<e[2]?i[2]=t[2]:i[2]=e[2],t[3]<e[3]?i[3]=t[3]:i[3]=e[3]):jt(i),i}function Jt(t){return[t[0],t[3]]}function $t(t){return[t[2],t[3]]}function Qt(t){return t[2]-t[0]}function te(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function ee(t){return t[2]<t[0]||t[3]<t[1]}function ne(t,e,n,i){var r=[];if(i>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a<i;++a)r.push(t[0]+o*a/i,t[1],t[2],t[1]+s*a/i,t[2]-o*a/i,t[3],t[0],t[3]-s*a/i);else r=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(r,r,2);for(var l=[],u=[],h=(a=0,r.length);a<h;a+=2)l.push(r[a]),u.push(r[a+1]);return function(t,e,n){return At(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),n)}(l,u,n)}function ie(t,e,n,i,r){if(i&&i!==t&&(n=n.bind(i)),r){var o=n;n=function(){t.removeEventListener(e,n),o.apply(this,arguments)}}var s={target:t,type:e,listener:n};return t.addEventListener(e,n),s}function re(t,e,n,i){return ie(t,e,n,i,!0)}function oe(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),R(t))}var se=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();!function(t){function e(e,n,i,r,o,s){var a=t.call(this,e,n,i,lt)||this;return a.src_=r,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=lt,a.imageLoadFunction_=s,a}se(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=ct,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Ht(this.extent)/this.image_.height),this.state=ht,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=lt&&this.state!=ct||(this.state=ut,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=ae(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=Ht(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(at);function ae(t,e,n){var i=t;if(i.src&&et){var r=i.decode(),o=!0;return r.then((function(){o&&e()})).catch((function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():n())})),function(){o=!1}}var s=[re(i,f,e),re(i,a,n)];return function(){s.forEach(oe)}}var le=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const ue=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e,n,s)||this;return a.crossOrigin_=r,a.src_=i,a.key=i,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.tileLoadFunction_=o,a}return le(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=D,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=k,this.unlistenImage_(),this.image_=((t=it(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=D:this.state=G,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==k&&(this.state=A,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==A&&(this.state=j,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=ae(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(K);var he={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"};var ce={};ce[he.RADIANS]=6370997/(2*Math.PI),ce[he.DEGREES]=2*Math.PI*6370997/360,ce[he.FEET]=.3048,ce[he.METERS]=1,ce[he.USFEET]=1200/3937;const pe=he;const fe=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||ce[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function de(t,e,n){return Math.min(Math.max(t,e),n)}var ge="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},_e="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function ye(t,e,n,i,r,o){var s=r-n,a=o-i;if(0!==s||0!==a){var l=((t-n)*s+(e-i)*a)/(s*s+a*a);l>1?(n=r,i=o):l>0&&(n+=s*l,i+=a*l)}return ve(t,e,n,i)}function ve(t,e,n,i){var r=n-t,o=i-e;return r*r+o*o}function me(t){return t*Math.PI/180}function xe(t,e){var n=t%e;return n*e<0?n+e:n}function we(t,e,n){return t+n*(e-t)}var Ce=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),be=6378137,Se=Math.PI*be,Ee=[-Se,-Se,Se,Se],Te=[-180,-85,180,85],Oe=be*Math.log(Math.tan(Math.PI/2)),Re=function(t){function e(e){return t.call(this,{code:e,units:pe.METERS,extent:Ee,global:!0,worldExtent:Te,getPointResolution:function(t,e){return t/ge(e[1]/be)}})||this}return Ce(e,t),e}(fe),Pe=[new Re("EPSG:3857"),new Re("EPSG:102100"),new Re("EPSG:102113"),new Re("EPSG:900913"),new Re("http://www.opengis.net/def/crs/EPSG/0/3857"),new Re("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ie(t,e,n){var i=t.length,r=n>1?n:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(i));for(var s=0;s<i;s+=r){o[s]=Se*t[s]/180;var a=be*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));a>Oe?a=Oe:a<-Oe&&(a=-Oe),o[s+1]=a}return o}function Fe(t,e,n){var i=t.length,r=n>1?n:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(i));for(var s=0;s<i;s+=r)o[s]=180*t[s]/Se,o[s+1]=360*Math.atan(Math.exp(t[s+1]/be))/Math.PI-90;return o}var Me=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Le=[-180,-90,180,90],Ae=6378137*Math.PI/180,je=function(t){function e(e,n){return t.call(this,{code:e,units:pe.DEGREES,extent:Le,axisOrientation:n,global:!0,metersPerUnit:Ae,worldExtent:Le})||this}return Me(e,t),e}(fe),De=[new je("CRS:84"),new je("EPSG:4326","neu"),new je("urn:ogc:def:crs:OGC:1.3:CRS84"),new je("urn:ogc:def:crs:OGC:2:84"),new je("http://www.opengis.net/def/crs/OGC/1.3/CRS84","neu"),new je("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new je("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],ke={};var Ge={};function ze(t,e,n){var i=t.getCode(),r=e.getCode();i in Ge||(Ge[i]={}),Ge[i][r]=n}var Ne=6371008.8;function Be(t,e,n){var i=n||Ne,r=me(t[1]),o=me(e[1]),s=(o-r)/2,a=me(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(r)*Math.cos(o);return 2*i*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function We(t,e,n){var i;if(void 0!==e){for(var r=0,o=t.length;r<o;++r)e[r]=t[r];i=e}else i=t.slice();return i}function Ue(t,e,n){if(void 0!==e&&t!==e){for(var i=0,r=t.length;i<r;++i)e[i]=t[i];t=e}return t}function Xe(t){!function(t,e){ke[t]=e}(t.getCode(),t),ze(t,t,We)}function Ye(t){return"string"==typeof t?ke[e=t]||ke[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function Ze(t,e,n,i){var r,o=(t=Ye(t)).getPointResolutionFunc();if(o){if(r=o(e,n),i&&i!==t.getUnits())(a=t.getMetersPerUnit())&&(r=r*a/ce[i])}else{var s=t.getUnits();if(s==pe.DEGREES&&!i||i==pe.DEGREES)r=e;else{var a,l=$e(t,Ye("EPSG:4326"));if(l===Ue&&s!==pe.DEGREES)r=e*t.getMetersPerUnit();else{var u=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];r=(Be((u=l(u,u,2)).slice(0,2),u.slice(2,4))+Be(u.slice(4,6),u.slice(6,8)))/2}void 0!==(a=i?ce[i]:t.getMetersPerUnit())&&(r/=a)}}return r}function Ve(t){!function(t){t.forEach(Xe)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&ze(e,t,We)}))}))}function Ke(t,e){return t?"string"==typeof t?Ye(t):t:Ye(e)}function He(t,e){return tn(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function qe(t,e){var n=tn(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),i=n[0];return(i<-180||i>180)&&(n[0]=xe(i+180,360)-180),n}function Je(t,e){if(t===e)return!0;var n=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||$e(t,e)===We)&&n}function $e(t,e){var n=function(t,e){var n;return t in Ge&&e in Ge[t]&&(n=Ge[t][e]),n}(t.getCode(),e.getCode());return n||(n=Ue),n}function Qe(t,e){return $e(Ye(t),Ye(e))}function tn(t,e,n){return Qe(e,n)(t,void 0,t.length)}function en(t,e,n,i){return ne(t,Qe(e,n),void 0,i)}var nn,rn,on,sn=null;function an(){return sn}function ln(t,e){return sn?tn(t,e,sn):t}function un(t,e){return sn?tn(t,sn,e):t}function hn(t,e){return sn?en(t,e,sn):t}function cn(t,e){return sn?en(t,sn,e):t}Ve(Pe),Ve(De),nn=Pe,rn=Ie,on=Fe,De.forEach((function(t){nn.forEach((function(e){ze(t,e,rn),ze(e,t,on)}))}));const pn=function(){function t(t,e,n,i,r,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=Qe(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=i,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&Qt(i)==Qt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Qt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Qt(this.targetProj_.getExtent()):null;var l=Jt(n),u=$t(n),h=Yt(n),c=Xt(n),p=this.transformInv_(l),f=this.transformInv_(u),d=this.transformInv_(h),g=this.transformInv_(c),_=10+(o?Math.max(0,Math.ceil(_e(Ut(n)/(o*o*256*256)))):0);if(this.addQuad_(l,u,h,c,p,f,d,g,_),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach((function(t,e,n){y=Math.min(y,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-y>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-y>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-y>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-y>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var n=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-n<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}s={}}return t.prototype.addTriangle_=function(t,e,n,i,r,o){this.triangles_.push({source:[i,r,o],target:[t,e,n]})},t.prototype.addQuad_=function(t,e,n,i,r,o,s,a,l){var u=Et([r,o,s,a]),h=this.sourceWorldWidth_?Qt(u)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&h>.5&&h<1,f=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)f=Qt(Et([t,e,n,i]))/this.targetWorldWidth_>.25||f;!p&&this.sourceProj_.isGlobal()&&h&&(f=h>.25||f)}if(!(!f&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||te(u,this.maxSourceExtent_)){var d=0;if(!(f||isFinite(r[0])&&isFinite(r[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)f=!0;else if(1!=(d=(isFinite(r[0])&&isFinite(r[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(l>0){if(!f){var g=[(t[0]+n[0])/2,(t[1]+n[1])/2],_=this.transformInv_(g),y=void 0;if(p)y=(xe(r[0],c)+xe(s[0],c))/2-xe(_[0],c);else y=(r[0]+s[0])/2-_[0];var v=(r[1]+s[1])/2-_[1];f=y*y+v*v>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){var m=[(e[0]+n[0])/2,(e[1]+n[1])/2],x=this.transformInv_(m),w=[(i[0]+t[0])/2,(i[1]+t[1])/2],C=this.transformInv_(w);this.addQuad_(t,e,m,w,r,o,x,C,l-1),this.addQuad_(w,m,n,i,C,x,s,a,l-1)}else{var b=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(b),E=[(n[0]+i[0])/2,(n[1]+i[1])/2],T=this.transformInv_(E);this.addQuad_(t,b,E,i,r,S,T,a,l-1),this.addQuad_(b,e,n,E,S,o,s,T,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,n,i,r,s,a),0==(14&d)&&this.addTriangle_(t,n,e,r,s,o),d&&(0==(13&d)&&this.addTriangle_(e,i,t,o,a,r),0==(7&d)&&this.addTriangle_(e,i,n,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,n,i){var r=e.source;zt(t,r[0]),zt(t,r[1]),zt(t,r[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();var fn,dn={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function gn(t,e,n,i,r){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(i,r),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,i)+1,Math.max(n,r)),t.restore()}function _n(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function yn(t,e,n,i){var r=tn(n,e,t),o=Ze(e,i,n),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var l=t.getExtent();if(!l||Pt(l,r)){var u=Ze(t,o,r)/o;isFinite(u)&&u>0&&(o/=u)}return o}function vn(t,e,n,i,r,o,s,a,l,u,h,c){var p=it(Math.round(n*t),Math.round(n*e));if(O(p,c),0===l.length)return p.canvas;function f(t){return Math.round(t*n)/n}p.scale(n,n),p.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,n){Gt(d,t.extent)}));var g=Qt(d),_=Ht(d),y=it(Math.round(n*g/i),Math.round(n*_/i));O(y,c);var v=n/i;l.forEach((function(t,e,n){var i=t.extent[0]-d[0],r=-(t.extent[3]-d[3]),o=Qt(t.extent),s=Ht(t.extent);t.image.width>0&&t.image.height>0&&y.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,i*v,r*v,o*v,s*v)}));var m=Jt(s);return a.getTriangles().forEach((function(t,e,r){var s=t.source,a=t.target,l=s[0][0],u=s[0][1],h=s[1][0],g=s[1][1],_=s[2][0],v=s[2][1],x=f((a[0][0]-m[0])/o),w=f(-(a[0][1]-m[1])/o),C=f((a[1][0]-m[0])/o),b=f(-(a[1][1]-m[1])/o),S=f((a[2][0]-m[0])/o),E=f(-(a[2][1]-m[1])/o),T=l,O=u;l=0,u=0;var R=function(t){for(var e=t.length,n=0;n<e;n++){for(var i=n,r=Math.abs(t[n][n]),o=n+1;o<e;o++){var s=Math.abs(t[o][n]);s>r&&(r=s,i=o)}if(0===r)return null;var a=t[i];t[i]=t[n],t[n]=a;for(var l=n+1;l<e;l++)for(var u=-t[l][n]/t[n][n],h=n;h<e+1;h++)n==h?t[l][h]=0:t[l][h]+=u*t[n][h]}for(var c=new Array(e),p=e-1;p>=0;p--){c[p]=t[p][e]/t[p][p];for(var f=p-1;f>=0;f--)t[f][e]-=t[f][p]*c[p]}return c}([[h-=T,g-=O,0,0,C-x],[_-=T,v-=O,0,0,S-x],[0,0,h,g,b-w],[0,0,_,v,E-w]]);if(R){if(p.save(),p.beginPath(),function(){if(void 0===fn){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",gn(t,4,5,4,0),gn(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;fn=_n(e,0)||_n(e,4)||_n(e,8)}return fn}()||c===dn){p.moveTo(C,b);for(var P=x-C,I=w-b,F=0;F<4;F++)p.lineTo(C+f((F+1)*P/4),b+f(F*I/3)),3!=F&&p.lineTo(C+f((F+1)*P/4),b+f((F+1)*I/3));p.lineTo(S,E)}else p.moveTo(C,b),p.lineTo(x,w),p.lineTo(S,E);p.clip(),p.transform(R[0],R[2],R[1],R[3],x,w),p.translate(d[0]-T,d[3]-O),p.scale(i/n,-i/n),p.drawImage(y.canvas,0,0),p.restore()}})),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,n){var i=t.target,r=(i[0][0]-m[0])/o,s=-(i[0][1]-m[1])/o,a=(i[1][0]-m[0])/o,l=-(i[1][1]-m[1])/o,u=(i[2][0]-m[0])/o,h=-(i[2][1]-m[1])/o;p.beginPath(),p.moveTo(a,l),p.lineTo(r,s),p.lineTo(u,h),p.closePath(),p.stroke()})),p.restore()),p.canvas}var mn=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const xn=function(t){function e(e,n,i,r,o,s,a,l,u,h,c,p){var f=t.call(this,o,A)||this;f.renderEdges_=void 0!==c&&c,f.contextOptions_=p,f.pixelRatio_=a,f.gutter_=l,f.canvas_=null,f.sourceTileGrid_=n,f.targetTileGrid_=r,f.wrappedTileCoord_=s||o,f.sourceTiles_=[],f.sourcesListenerKeys_=null,f.sourceZ_=0;var d=r.getTileCoordExtent(f.wrappedTileCoord_),g=f.targetTileGrid_.getExtent(),_=f.sourceTileGrid_.getExtent(),y=g?qt(d,g):d;if(0===Ut(y))return f.state=G,f;var v=e.getExtent();v&&(_=_?qt(_,v):v);var m=r.getResolution(f.wrappedTileCoord_[0]),x=function(t,e,n,i){var r=Zt(n),o=yn(t,e,r,i);return(!isFinite(o)||o<=0)&&Wt(n,(function(n){return o=yn(t,e,n,i),isFinite(o)&&o>0})),o}(e,i,y,m);if(!isFinite(x)||x<=0)return f.state=G,f;var w=void 0!==h?h:.5;if(f.triangulation_=new pn(e,i,y,_,x*w,m),0===f.triangulation_.getTriangles().length)return f.state=G,f;f.sourceZ_=n.getZForResolution(x);var C=f.triangulation_.calculateSourceExtent();if(_&&(e.canWrapX()?(C[1]=de(C[1],_[1],_[3]),C[3]=de(C[3],_[1],_[3])):C=qt(C,_)),Ut(C)){for(var b=n.getTileRangeForExtentAndZ(C,f.sourceZ_),S=b.minX;S<=b.maxX;S++)for(var E=b.minY;E<=b.maxY;E++){var T=u(f.sourceZ_,S,E,a);T&&f.sourceTiles_.push(T)}0===f.sourceTiles_.length&&(f.state=G)}else f.state=G;return f}return mn(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,n,i){e&&e.getState()==D&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=k;else{var e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),i="number"==typeof n?n:n[0],r="number"==typeof n?n:n[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=vn(i,r,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=D}this.changed()},e.prototype.load=function(){if(this.state==A){this.state=j,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,n,i){var r=e.getState();if(r==A||r==j){t++;var o=ie(e,s,(function(n){var i=e.getState();i!=D&&i!=k&&i!=G||(oe(o),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,n){t.getState()==A&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(oe),this.sourcesListenerKeys_=null},e}(K);const wn=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.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 n=this.entries_[t];return St(void 0!==n,15),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_},t.prototype.remove=function(t){var e=this.entries_[t];return St(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_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=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){St(!(t in this.entries_),16);var n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function Cn(t,e,n,i){return void 0!==i?(i[0]=t,i[1]=e,i[2]=n,i):[t,e,n]}function bn(t,e,n){return t+"/"+e+"/"+n}function Sn(t){return bn(t[0],t[1],t[2])}var En=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Tn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return En(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())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Sn(e.tileCoord)),e.release())}.bind(this))}},e}(wn),On="tileloadstart",Rn="tileloadend",Pn="tileloaderror",In="propertychange";var Fn=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Mn=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return Fn(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(s)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var n=t.length,i=new Array(n),r=0;r<n;++r)i[r]=ie(this,t[r],e);return i}return ie(this,t,e)},e.prototype.onceInternal=function(t,e){var n;if(Array.isArray(t)){var i=t.length;n=new Array(i);for(var r=0;r<i;++r)n[r]=re(this,t[r],e)}else n=re(this,t,e);return e.ol_key=n,n},e.prototype.unInternal=function(t,e){var n=e.ol_key;if(n)!function(t){if(Array.isArray(t))for(var e=0,n=t.length;e<n;++e)oe(t[e]);else oe(t)}(n);else if(Array.isArray(t))for(var i=0,r=t.length;i<r;++i)this.removeEventListener(t[i],e);else this.removeEventListener(t,e)},e}(L);Mn.prototype.on,Mn.prototype.once,Mn.prototype.un;const Ln=Mn;var An=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),jn=function(t){function e(e,n,i){var r=t.call(this,e)||this;return r.key=n,r.oldValue=i,r}return An(e,t),e}(v);const Dn=function(t){function e(e){var n=t.call(this)||this;return n.on,n.once,n.un,B(n),n.values_=null,void 0!==e&&n.setProperties(e),n}return An(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&O({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var n;n="change:"+t,this.dispatchEvent(new jn(n,t,e)),n=In,this.dispatchEvent(new jn(n,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:"+t,e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:"+t,e)},e.prototype.set=function(t,e,n){var i=this.values_||(this.values_={});if(n)i[t]=e;else{var r=i[t];i[t]=e,r!==e&&this.notify(t,r)}},e.prototype.setProperties=function(t,e){for(var n in t)this.set(n,t[n],e)},e.prototype.applyProperties=function(t){t.values_&&O(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var n=this.values_[t];delete this.values_[t],I(this.values_)&&(this.values_=null),e||this.notify(t,n)}},e}(Ln),kn="undefined",Gn="ready";var zn=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function Nn(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}const Bn=function(t){function e(e){var n=t.call(this)||this;return n.projection=Ye(e.projection),n.attributions_=Nn(e.attributions),n.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,n.loading=!1,n.state_=void 0!==e.state?e.state:Gn,n.wrapX_=void 0!==e.wrapX&&e.wrapX,n}return zn(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 z()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=Nn(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(Dn);var Wn=function(){function t(t,e,n,i){this.minX=t,this.maxX=e,this.minY=n,this.maxY=i}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 Un(t,e,n,i,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=n,r.maxY=i,r):new Wn(t,e,n,i)}const Xn=Wn;var Yn=256;function Zn(t){return t[0]>0&&t[1]>0}function Vn(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Kn=[0,0,0];const Hn=function(){function t(t){var e,n,i,r;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,St((e=this.resolutions_,n=!0,i=function(t,e){return e-t}||m,e.every((function(t,r){if(0===r)return!0;var o=i(e[r-1],t);return!(o>0||n&&0===o)}))),17),!t.origins)for(var o=0,s=this.resolutions_.length-1;o<s;++o)if(r){if(this.resolutions_[o]/this.resolutions_[o+1]!==r){r=void 0;break}}else r=this.resolutions_[o]/this.resolutions_[o+1];this.zoomFactor_=r,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,St(this.origins_.length==this.resolutions_.length,20));var a=t.extent;void 0===a||this.origin_||this.origins_||(this.origin_=Jt(a)),St(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,St(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,St(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==a?a: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 n=new Xn(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(a){var i=this.getTileRangeForExtentAndZ(a,e);n.minX=Math.max(i.minX,n.minX),n.maxX=Math.min(i.maxX,n.maxX),n.minY=Math.max(i.minY,n.minY),n.maxY=Math.min(i.maxY,n.maxY)}return n}),this):a&&this.calculateTileRanges_(a)}return t.prototype.forEachTileCoord=function(t,e,n){for(var i=this.getTileRangeForExtentAndZ(t,e),r=i.minX,o=i.maxX;r<=o;++r)for(var s=i.minY,a=i.maxY;s<=a;++s)n([e,r,s])},t.prototype.forEachTileCoordParentTileRange=function(t,e,n,i){var r,o,s=null,a=t[0]-1;for(2===this.zoomFactor_?(r=t[1],o=t[2]):s=this.getTileCoordExtent(t,i);a>=this.minZoom;){if(e(a,2===this.zoomFactor_?Un(r=Math.floor(r/2),r,o=Math.floor(o/2),o,n):this.getTileRangeForExtentAndZ(s,a,n)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,n){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var i=2*t[1],r=2*t[2];return Un(i,i+1,r,r+1,e)}var o=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,n){if(e>this.maxZoom||e<this.minZoom)return null;var i=t[0],r=t[1],o=t[2];if(e===i)return Un(r,o,r,o,n);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,e-i),a=Math.floor(r*s),l=Math.floor(o*s);return e<i?Un(a,a,l,l,n):Un(a,Math.floor(s*(r+1))-1,l,Math.floor(s*(o+1))-1,n)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,n)},t.prototype.getTileRangeExtent=function(t,e,n){var i=this.getOrigin(t),r=this.getResolution(t),o=Vn(this.getTileSize(t),this.tmpSize_),s=i[0]+e.minX*o[0]*r,a=i[0]+(e.maxX+1)*o[0]*r;return At(s,i[1]+e.minY*o[1]*r,a,i[1]+(e.maxY+1)*o[1]*r,n)},t.prototype.getTileRangeForExtentAndZ=function(t,e,n){var i=Kn;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,i);var r=i[1],o=i[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,i),Un(r,i[1],o,i[2],n)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),n=this.getResolution(t[0]),i=Vn(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*i[0]*n,e[1]-(t[2]+.5)*i[1]*n]},t.prototype.getTileCoordExtent=function(t,e){var n=this.getOrigin(t[0]),i=this.getResolution(t[0]),r=Vn(this.getTileSize(t[0]),this.tmpSize_),o=n[0]+t[1]*r[0]*i,s=n[1]-(t[2]+1)*r[1]*i;return At(o,s,o+r[0]*i,s+r[1]*i,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,n)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,n,i,r){var o=this.getZForResolution(n),s=n/this.getResolution(o),a=this.getOrigin(o),l=Vn(this.getTileSize(o),this.tmpSize_),u=i?.5:0,h=i?.5:0,c=Math.floor((t-a[0])/n+u),p=Math.floor((a[1]-e)/n+h),f=s*c/l[0],d=s*p/l[1];return i?(f=Math.ceil(f)-1,d=Math.ceil(d)-1):(f=Math.floor(f),d=Math.floor(d)),Cn(o,f,d,r)},t.prototype.getTileCoordForXYAndZ_=function(t,e,n,i,r){var o=this.getOrigin(n),s=this.getResolution(n),a=Vn(this.getTileSize(n),this.tmpSize_),l=i?.5:0,u=i?.5:0,h=Math.floor((t-o[0])/s+l),c=Math.floor((o[1]-e)/s+u),p=h/a[0],f=c/a[1];return i?(p=Math.ceil(p)-1,f=Math.ceil(f)-1):(p=Math.floor(p),f=Math.floor(f)),Cn(n,p,f,r)},t.prototype.getTileCoordForCoordAndZ=function(t,e,n){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,n)},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){return de(x(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,n=new Array(e),i=this.minZoom;i<e;++i)n[i]=this.getTileRangeForExtentAndZ(t,i);this.fullTileRanges_=n},t}();function qn(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,n,i){return function(t,e,n,i){var r=void 0!==i?i:dt,o=Jn(t,e,n);return new Hn({extent:t,origin:Vt(t,r),resolutions:o,tileSize:n})}($n(t),e,n,i)}(t),t.setDefaultTileGrid(e)),e}function Jn(t,e,n,i){for(var r=void 0!==e?e:42,o=Ht(t),s=Qt(t),a=Vn(void 0!==n?n:256),l=i>0?i:Math.max(s/a[0],o/a[1]),u=r+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function $n(t){var e=(t=Ye(t)).getExtent();if(!e){var n=180*ce[pe.DEGREES]/t.getMetersPerUnit();e=At(-n,-n,n,n)}return e}var Qn=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ti=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;n.on,n.once,n.un,n.opaque_=void 0!==e.opaque&&e.opaque,n.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,n.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var i=e.tileGrid;return i&&Vn(i.getTileSize(i.getMinZoom()),[256,256]),n.tileCache=new Tn(e.cacheSize||0),n.tmpSize=[0,0],n.key_=e.key||"",n.tileOptions={transition:e.transition},n.zDirection=e.zDirection?e.zDirection:0,n}return Qn(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);n&&n.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,n,i){var r=this.getTileCacheForProjection(t);if(!r)return!1;for(var o,s,a,l=!0,u=n.minX;u<=n.maxX;++u)for(var h=n.minY;h<=n.maxY;++h)s=bn(e,u,h),a=!1,r.containsKey(s)&&(a=(o=r.get(s)).getState()===D)&&(a=!1!==i(o)),a||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,n,i,r){return z()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:qn(t)},e.prototype.getTileCacheForProjection=function(t){return St(Je(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,n){var i,r,o,s=this.getTileGridForProjection(n),a=this.getTilePixelRatio(e),l=Vn(s.getTileSize(t),this.tmpSize);return 1==a?l:(i=l,r=a,void 0===(o=this.tmpSize)&&(o=[0,0]),o[0]=i[0]*r+.5|0,o[1]=i[1]*r+.5|0,o)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var n=void 0!==e?e:this.getProjection(),i=this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=function(t,e,n){var i=e[0],r=t.getTileCoordCenter(e),o=$n(n);if(Pt(o,r))return e;var s=Qt(o),a=Math.ceil((o[0]-r[0])/s);return r[0]+=s*a,t.getTileCoordForCoordAndZ(r,i)}(i,t,n)),function(t,e){var n=t[0],i=t[1],r=t[2];if(e.getMinZoom()>n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return!o||o.containsXY(i,r)}(t,i)?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 n=this.getTileCacheForProjection(e);t>n.highWaterMark&&(n.highWaterMark=t)},e.prototype.useTile=function(t,e,n,i){},e}(Bn),ei=function(t){function e(e,n){var i=t.call(this,e)||this;return i.tile=n,i}return Qn(e,t),e}(v);const ni=ti;function ii(t,e){var n=/\{z\}/g,i=/\{x\}/g,r=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){return s?t.replace(n,s[0].toString()).replace(i,s[1].toString()).replace(r,s[2].toString()).replace(o,(function(){var t=s[0],n=e.getFullTileRange(t);return St(n,55),(n.getHeight()-s[2]-1).toString()})):void 0}}function ri(t,e){for(var n=t.length,i=new Array(n),r=0;r<n;++r)i[r]=ii(t[r],e);return function(t){if(1===t.length)return t[0];return function(e,n,i){if(e){var r=xe(function(t){return(t[1]<<t[0])+t[2]}(e),t.length);return t[r](e,n,i)}}}(i)}var oi=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const si=function(t){function e(n){var i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tilePixelRatio:n.tilePixelRatio,wrapX:n.wrapX,transition:n.transition,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this;return i.generateTileUrlFunction_=i.tileUrlFunction===e.prototype.tileUrlFunction,i.tileLoadFunction=n.tileLoadFunction,n.tileUrlFunction&&(i.tileUrlFunction=n.tileUrlFunction),i.urls=null,n.urls?i.setUrls(n.urls):n.url&&i.setUrl(n.url),i.tileLoadingKeys_={},i}return oi(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,n=t.target,i=B(n),r=n.getState();r==j?(this.tileLoadingKeys_[i]=!0,e=On):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],e=r==k?Pn:r==D?Rn:void 0),null!=e&&this.dispatchEvent(new ei(e,n))},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=[],n=/\{([a-z])-([a-z])\}/.exec(t);if(n){var i=n[1].charCodeAt(0),r=n[2].charCodeAt(0),o=void 0;for(o=i;o<=r;++o)e.push(t.replace(n[0],String.fromCharCode(o)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(n[2],10),a=parseInt(n[1],10);a<=s;a++)e.push(t.replace(n[0],a.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(ri(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,n){},e.prototype.useTile=function(t,e,n){var i=bn(t,e,n);this.tileCache.containsKey(i)&&this.tileCache.get(i)},e}(ni);var ai=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function li(t,e){t.getImage().src=e}const ui=function(t){function e(e){var n=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:li,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return n.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,n.tileClass=void 0!==e.tileClass?e.tileClass:ue,n.tileCacheForProjection={},n.tileGridForProjection={},n.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,n.contextOptions_=!1===e.imageSmoothing?dn:void 0,n.renderReprojectionEdges_=!1,n}return ai(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 n=this.getTileCacheForProjection(t);for(var i in this.tileCache.expireCache(this.tileCache==n?e:{}),this.tileCacheForProjection){var r=this.tileCacheForProjection[i];r.expireCache(r==n?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Je(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Je(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Je(e,t)){var n=B(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=qn(t)),this.tileGridForProjection[n]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Je(e,t))return this.tileCache;var n=B(t);return n in this.tileCacheForProjection||(this.tileCacheForProjection[n]=new Tn(this.tileCache.highWaterMark)),this.tileCacheForProjection[n]},e.prototype.createTile_=function(t,e,n,i,r,o){var a=[t,e,n],l=this.getTileCoordForTileUrlFunction(a,r),u=l?this.tileUrlFunction(l,i,r):void 0,h=new this.tileClass(a,void 0!==u?A:G,void 0!==u?u:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=o,h.addEventListener(s,this.handleTileChange.bind(this)),h},e.prototype.getTile=function(t,e,n,i,r){var o=this.getProjection();if(o&&r&&!Je(o,r)){var s=this.getTileCacheForProjection(r),a=[t,e,n],l=void 0,u=Sn(a);s.containsKey(u)&&(l=s.get(u));var h=this.getKey();if(l&&l.key==h)return l;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(r),f=this.getTileCoordForTileUrlFunction(a,r),d=new xn(o,c,r,p,a,f,this.getTilePixelRatio(i),this.getGutter(),function(t,e,n,i){return this.getTileInternal(t,e,n,i,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return d.key=h,l?(d.interimTile=l,d.refreshInterimChain(),s.replace(u,d)):s.set(u,d),d}return this.getTileInternal(t,e,n,i,o||r)},e.prototype.getTileInternal=function(t,e,n,i,r){var o=null,s=bn(t,e,n),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var l=o;o=this.createTile_(t,e,n,i,r,a),l.getState()==A?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,n,i,r,a),this.tileCache.set(s,o);return o},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 n=Ye(t);if(n){var i=B(n);i in this.tileGridForProjection||(this.tileGridForProjection[i]=e)}},e}(si);var hi=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const ci=function(t){function e(e){var n=e||{},i=void 0!==n.projection?n.projection:"EPSG:3857",r=void 0!==n.tileGrid?n.tileGrid:function(t){var e=t||{},n=e.extent||Ye("EPSG:3857").getExtent(),i={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Jn(n,e.maxZoom,e.tileSize,e.maxResolution)};return new Hn(i)}({extent:$n(i),maxResolution:n.maxResolution,maxZoom:n.maxZoom,minZoom:n.minZoom,tileSize:n.tileSize});return t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,imageSmoothing:n.imageSmoothing,opaque:n.opaque,projection:i,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this}return hi(e,t),e}(ui),pi="opacity",fi="visible",di="extent",gi="zIndex",_i="maxResolution",yi="minResolution",vi="maxZoom",mi="minZoom",xi="source";var wi=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Ci=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var i=O({},e);return"object"==typeof e.properties&&(delete i.properties,O(i,e.properties)),i[pi]=void 0!==e.opacity?e.opacity:1,St("number"==typeof i[pi],64),i[fi]=void 0===e.visible||e.visible,i[gi]=e.zIndex,i[_i]=void 0!==e.maxResolution?e.maxResolution:1/0,i[yi]=void 0!==e.minResolution?e.minResolution:0,i[mi]=void 0!==e.minZoom?e.minZoom:-1/0,i[vi]=void 0!==e.maxZoom?e.maxZoom:1/0,n.className_=void 0!==i.className?e.className:"ol-layer",delete i.className,n.setProperties(i),n.state_=null,n}return wi(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},n=this.getZIndex();return e.opacity=de(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==n||e.managed?n: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 z()},e.prototype.getLayerStatesArray=function(t){return z()},e.prototype.getExtent=function(){return this.get(di)},e.prototype.getMaxResolution=function(){return this.get(_i)},e.prototype.getMinResolution=function(){return this.get(yi)},e.prototype.getMinZoom=function(){return this.get(mi)},e.prototype.getMaxZoom=function(){return this.get(vi)},e.prototype.getOpacity=function(){return this.get(pi)},e.prototype.getSourceState=function(){return z()},e.prototype.getVisible=function(){return this.get(fi)},e.prototype.getZIndex=function(){return this.get(gi)},e.prototype.setExtent=function(t){this.set(di,t)},e.prototype.setMaxResolution=function(t){this.set(_i,t)},e.prototype.setMinResolution=function(t){this.set(yi,t)},e.prototype.setMaxZoom=function(t){this.set(vi,t)},e.prototype.setMinZoom=function(t){this.set(mi,t)},e.prototype.setOpacity=function(t){St("number"==typeof t,64),this.set(pi,t)},e.prototype.setVisible=function(t){this.set(fi,t)},e.prototype.setZIndex=function(t){this.set(gi,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(Dn),bi="prerender",Si="postrender",Ei="precompose",Ti="postcompose",Oi="rendercomplete";var Ri=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function Pi(t,e){if(!t.visible)return!1;var n=e.resolution;if(n<t.minResolution||n>=t.maxResolution)return!1;var i=e.zoom;return i>t.minZoom&&i<=t.maxZoom}const Ii=function(t){function e(e){var n=this,i=O({},e);delete i.source,(n=t.call(this,i)||this).on,n.once,n.un,n.mapPrecomposeKey_=null,n.mapRenderKey_=null,n.sourceChangeKey_=null,n.renderer_=null,e.render&&(n.render=e.render),e.map&&n.setMap(e.map),n.addChangeListener(xi,n.handleSourcePropertyChange_);var r=e.source?e.source:null;return n.setSource(r),n}return Ri(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(xi)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():kn},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(oe(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=ie(t,s,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.render=function(t,e){var n=this.getRenderer();if(n.prepareFrame(t))return n.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(oe(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(oe(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=ie(t,Ei,(function(t){var e=t.frameState.layerStatesArray,n=this.getLayerState(!1);St(!e.some((function(t){return t.layer===n.layer})),67),e.push(n)}),this),this.mapRenderKey_=ie(this,s,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(xi,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.setSource(null),t.prototype.disposeInternal.call(this)},e}(Ci),Fi="preload",Mi="useInterimTilesOnError";var Li=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Ai=function(t){function e(e){var n=this,i=e||{},r=O({},i);return delete r.preload,delete r.useInterimTilesOnError,(n=t.call(this,r)||this).on,n.once,n.un,n.setPreload(void 0!==i.preload?i.preload:0),n.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError),n}return Li(e,t),e.prototype.getPreload=function(){return this.get(Fi)},e.prototype.setPreload=function(t){this.set(Fi,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Mi)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Mi,t)},e}(Ii);var ji=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Di=function(t){function e(e){var n=t.call(this)||this;return n.boundHandleImageChange_=n.handleImageChange_.bind(n),n.layer_=e,n.declutterExecutorGroup=null,n}return ji(e,t),e.prototype.getFeatures=function(t){return z()},e.prototype.prepareFrame=function(t){return z()},e.prototype.renderFrame=function(t,e){return z()},e.prototype.loadedTileCallback=function(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n},e.prototype.createLoadedTileFinder=function(t,e,n){return function(i,r){var o=this.loadedTileCallback.bind(this,n,i);return t.forEachLoadedTile(e,i,r,o)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,r){},e.prototype.getDataAtPixel=function(t,e,n){return z()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===ht&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=ht&&e!=ct&&t.addEventListener(s,this.boundHandleImageChange_),e==lt&&(t.load(),e=t.getState()),e==ht},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Gn&&t.changed()},e}(Ln);var ki=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Gi=function(t){function e(e,n,i,r){var o=t.call(this,e)||this;return o.inversePixelTransform=n,o.frameState=i,o.context=r,o}return ki(e,t),e}(v);var zi,Ni=new Array(6);function Bi(t){return Ui(t,1,0,0,1,0,0)}function Wi(t,e){var n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=e[0],u=e[1],h=e[2],c=e[3],p=e[4],f=e[5];return t[0]=n*l+r*u,t[1]=i*l+o*u,t[2]=n*h+r*c,t[3]=i*h+o*c,t[4]=n*p+r*f+s,t[5]=i*p+o*f+a,t}function Ui(t,e,n,i,r,o,s){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=o,t[5]=s,t}function Xi(t,e){var n=e[0],i=e[1];return e[0]=t[0]*n+t[2]*i+t[4],e[1]=t[1]*n+t[3]*i+t[5],e}function Yi(t,e,n,i,r,o,s,a){var l=Math.sin(o),u=Math.cos(o);return t[0]=i*u,t[1]=r*l,t[2]=-i*l,t[3]=r*u,t[4]=s*i*u-a*i*l+e,t[5]=s*r*l+a*r*u+n,t}function Zi(t,e){var n,i=(n=e)[0]*n[3]-n[1]*n[2];St(0!==i,32);var r=e[0],o=e[1],s=e[2],a=e[3],l=e[4],u=e[5];return t[0]=a/i,t[1]=-o/i,t[2]=-s/i,t[3]=r/i,t[4]=(s*u-a*l)/i,t[5]=-(r*u-o*l)/i,t}function Vi(t){var e="matrix("+t.join(", ")+")";if(tt)return e;var n=zi||(zi=document.createElement("div"));return n.style.transform=e,n.style.transform}var Ki=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Hi=function(t){function e(e){var n=t.call(this,e)||this;return n.container=null,n.renderedResolution,n.tempTransform=[1,0,0,1,0,0],n.pixelTransform=[1,0,0,1,0,0],n.inversePixelTransform=[1,0,0,1,0,0],n.context=null,n.containerReused=!1,n}return Ki(e,t),e.prototype.useContainer=function(t,e,n){var i,r,o=this.getLayer().getClassName();t&&""===t.style.opacity&&t.className===o&&((a=t.firstElementChild)instanceof HTMLCanvasElement&&(r=a.getContext("2d")));if(!r||0!==r.canvas.width&&r.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=r,this.containerReused=!0),!this.container){(i=document.createElement("div")).className=o;var s=i.style;s.position="absolute",s.width="100%",s.height="100%";var a=(r=it()).canvas;i.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=i,this.context=r}},e.prototype.clipUnrotated=function(t,e,n){var i=Jt(n),r=$t(n),o=Yt(n),s=Xt(n);Xi(e.coordinateToPixelTransform,i),Xi(e.coordinateToPixelTransform,r),Xi(e.coordinateToPixelTransform,o),Xi(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;Xi(a,i),Xi(a,r),Xi(a,o),Xi(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,n){var i=this.getLayer();if(i.hasListener(t)){var r=new Gi(t,this.inversePixelTransform,n,e);i.dispatchEvent(r)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(bi,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Si,t,e)},e.prototype.getRenderTransform=function(t,e,n,i,r,o,s){var a=r/2,l=o/2,u=i/e,h=-u,c=-t[0]+s,p=-t[1];return Yi(this.tempTransform,a,l,u,h,-n,c,p)},e.prototype.getDataAtPixel=function(t,e,n){var i,r=Xi(this.inversePixelTransform,t.slice()),o=this.context,s=this.getLayer().getExtent();if(s&&!Pt(s,Xi(e.pixelToCoordinateTransform,t.slice())))return null;try{var a=Math.round(r[0]),l=Math.round(r[1]),u=document.createElement("canvas"),h=u.getContext("2d");u.width=1,u.height=1,h.clearRect(0,0,1,1),h.drawImage(o.canvas,a,l,1,1,0,0,1,1),i=h.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:i}return 0===i[3]?null:i},e}(Di);var qi=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ji=function(t){function e(e){var n=t.call(this,e)||this;return n.extentChanged=!0,n.renderedExtent_=null,n.renderedPixelRatio,n.renderedProjection=null,n.renderedRevision,n.renderedTiles=[],n.newTiles_=!1,n.tmpExtent=[1/0,1/0,-1/0,-1/0],n.tmpTileRange_=new Xn(0,0,0,0),n}return qi(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),n=t.getState(),i=e.getUseInterimTilesOnError();return n==D||n==G||n==k&&!i},e.prototype.getTile=function(t,e,n,i){var r=i.pixelRatio,o=i.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,n,r,o);return a.getState()==k&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(D)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,n,i){return!!this.isDrawableTile(i)&&t.prototype.loadedTileCallback.call(this,e,n,i)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var n=t.layerStatesArray[t.layerIndex],i=t.viewState,r=i.projection,o=i.resolution,s=i.center,a=i.rotation,l=t.pixelRatio,u=this.getLayer(),h=u.getSource(),c=h.getRevision(),p=h.getTileGridForProjection(r),f=p.getZForResolution(o,h.zDirection),d=p.getResolution(f),g=t.extent,_=n.extent&&cn(n.extent,r);_&&(g=qt(g,cn(n.extent,r)));var y=h.getTilePixelRatio(l),v=Math.round(t.size[0]*y),x=Math.round(t.size[1]*y);if(a){var w=Math.round(Math.sqrt(v*v+x*x));v=w,x=w}var C=d*v/2/y,b=d*x/2/y,S=[s[0]-C,s[1]-b,s[0]+C,s[1]+b],E=p.getTileRangeForExtentAndZ(g,f),T={};T[f]={};var R=this.createLoadedTileFinder(h,r,T),P=this.tmpExtent,I=this.tmpTileRange_;this.newTiles_=!1;for(var F=E.minX;F<=E.maxX;++F)for(var M=E.minY;M<=E.maxY;++M){var L=this.getTile(f,F,M,t);if(this.isDrawableTile(L)){var A=B(this);if(L.getState()==D){T[f][L.tileCoord.toString()]=L;var j=L.inTransition(A);this.newTiles_||!j&&-1!==this.renderedTiles.indexOf(L)||(this.newTiles_=!0)}if(1===L.getAlpha(A,t.time))continue}var k=p.getTileCoordChildTileRange(L.tileCoord,I,P),G=!1;k&&(G=R(f+1,k)),G||p.forEachTileCoordParentTileRange(L.tileCoord,R,I,P)}var z=d/o;Yi(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/y,1/y,a,-v/2,-x/2);var N=Vi(this.pixelTransform);this.useContainer(e,N,n.opacity);var W=this.context,U=W.canvas;Zi(this.inversePixelTransform,this.pixelTransform),Yi(this.tempTransform,v/2,x/2,z,z,0,-v/2,-x/2),U.width!=v||U.height!=x?(U.width=v,U.height=x):this.containerReused||W.clearRect(0,0,v,x),_&&this.clipUnrotated(W,t,_),O(W,h.getContextOptions()),this.preRender(W,t),this.renderedTiles.length=0;var X,Y,Z,V=Object.keys(T).map(Number);V.sort(m),1!==n.opacity||this.containerReused&&!h.getOpaque(t.viewState.projection)?(X=[],Y=[]):V=V.reverse();for(var K=V.length-1;K>=0;--K){var H=V[K],q=h.getTilePixelSize(H,l,r),J=p.getResolution(H)/d,$=q[0]*J*z,Q=q[1]*J*z,tt=p.getTileCoordForCoordAndZ(Jt(S),H),et=p.getTileCoordExtent(tt),nt=Xi(this.tempTransform,[y*(et[0]-S[0])/d,y*(S[3]-et[3])/d]),it=y*h.getGutterForProjection(r),rt=T[H];for(var ot in rt){var st=(L=rt[ot]).tileCoord,at=tt[1]-st[1],lt=Math.round(nt[0]-(at-1)*$),ut=tt[2]-st[2],ht=Math.round(nt[1]-(ut-1)*Q),ct=lt-(F=Math.round(nt[0]-at*$)),pt=ht-(M=Math.round(nt[1]-ut*Q)),ft=f===H;if(!(j=ft&&1!==L.getAlpha(B(this),t.time)))if(X){W.save(),Z=[F,M,F+ct,M,F+ct,M+pt,F,M+pt];for(var dt=0,gt=X.length;dt<gt;++dt)if(f!==H&&H<Y[dt]){var _t=X[dt];W.beginPath(),W.moveTo(Z[0],Z[1]),W.lineTo(Z[2],Z[3]),W.lineTo(Z[4],Z[5]),W.lineTo(Z[6],Z[7]),W.moveTo(_t[6],_t[7]),W.lineTo(_t[4],_t[5]),W.lineTo(_t[2],_t[3]),W.lineTo(_t[0],_t[1]),W.clip()}X.push(Z),Y.push(H)}else W.clearRect(F,M,ct,pt);this.drawTileImage(L,t,F,M,ct,pt,it,ft,n.opacity),X&&!j?(W.restore(),this.renderedTiles.unshift(L)):this.renderedTiles.push(L),this.updateUsedTiles(t.usedTiles,h,L)}}return this.renderedRevision=c,this.renderedResolution=d,this.extentChanged=!this.renderedExtent_||!kt(this.renderedExtent_,S),this.renderedExtent_=S,this.renderedPixelRatio=l,this.renderedProjection=r,this.manageTilePyramid(t,h,p,l,r,g,f,u.getPreload()),this.scheduleExpireCache(t,h),this.postRender(W,t),n.extent&&W.restore(),N!==U.style.transform&&(U.style.transform=N),this.container},e.prototype.drawTileImage=function(t,e,n,i,r,o,s,a,l){var u=this.getTileImage(t);if(u){var h=B(this),c=a?t.getAlpha(h,e.time):1,p=l*c,f=p!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=p),this.context.drawImage(u,s,s,u.width-2*s,u.height-2*s,n,i,r,o),f&&this.context.restore(),1!==c?e.animate=!0:a&&t.endTransition(h)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var n=function(t,e,n){var i=B(t);i in n.usedTiles&&t.expireCache(n.viewState.projection,n.usedTiles[i])}.bind(null,e);t.postRenderFunctions.push(n)}},e.prototype.updateUsedTiles=function(t,e,n){var i=B(e);i in t||(t[i]={}),t[i][n.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,n,i,r,o,s,a,l){var u=B(e);u in t.wantedTiles||(t.wantedTiles[u]={});var h,c,p,f,d,g,_=t.wantedTiles[u],y=t.tileQueue,v=0;for(g=n.getMinZoom();g<=s;++g)for(c=n.getTileRangeForExtentAndZ(o,g,c),p=n.getResolution(g),f=c.minX;f<=c.maxX;++f)for(d=c.minY;d<=c.maxY;++d)s-g<=a?(++v,(h=e.getTile(g,f,d,i,r)).getState()==A&&(_[h.getKey()]=!0,y.isKeyQueued(h.getKey())||y.enqueue([h,u,n.getTileCoordCenter(h.tileCoord),p])),void 0!==l&&l(h)):e.useTile(g,f,d,r);e.updateCacheSize(v,r)},e}(Hi);Ji.prototype.getLayer;const $i=Ji;var Qi=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const tr=function(t){function e(e){return t.call(this,e)||this}return Qi(e,t),e.prototype.createRenderer=function(){return new $i(this)},e}(Ai);let er;!function(t){t.Auto="auto",t.Light="light",t.Dark="dark"}(er||(er={}));const nr={theme:er.Auto,showLabels:!0},ir={id:"carto",name:"CARTO reference map",isBaseMap:!0,defaultOptions:nr,create:async(t,e,n)=>({init:()=>{const t=Object.assign({},nr,e.config);let i=t.theme;return i&&i!==er.Auto||(i=n.isDark?"dark":"light"),t.showLabels?i+="_all":i+="_nolabels",new tr({source:new ci({attributions:'<a href="https://carto.com/attribution/">© CARTO</a>',url:`https://{1-4}.basemaps.cartocdn.com/${i}/{z}/{x}/{y}.png`})})}}),registerOptionsUI:t=>{t.addRadio({path:"config.theme",name:"Theme",settings:{options:[{value:er.Auto,label:"Auto",description:"Match grafana theme"},{value:er.Light,label:"Light"},{value:er.Dark,label:"Dark"}]},defaultValue:nr.theme}).addBooleanSwitch({path:"config.showLabels",name:"Show labels",description:"",defaultValue:nr.showLabels})}},rr=[ir];var or=n("./public/app/core/config.ts");const sr="https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",ar={url:sr+"/tile/{z}/{y}/{x}",attribution:`Tiles © <a href="${sr}">ArcGIS</a>`},lr={id:"xyz",name:"XYZ Tile layer",isBaseMap:!0,create:async(t,e,n)=>({init:()=>{const t=Object.assign({},e.config);var n;t.url||(t.url=ar.url,t.attribution=null!==(n=t.attribution)&&void 0!==n?n:ar.attribution);return new tr({source:new ci({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:ar.url}}).addTextInput({path:"config.attribution",name:"Attribution",settings:{placeholder:ar.attribution}})}},ur=[lr],hr="custom",cr="streets",pr=new i.Registry((()=>[{id:cr,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:hr,name:"Custom MapServer",description:"Use a custom MapServer with pre-cached values",slug:""}])),fr=[{id:"esri-xyz",name:"ArcGIS MapServer",isBaseMap:!0,create:async(t,e,n)=>{var i;const r=Object.assign({},e.config),o=pr.getIfExists(null!==(i=r.server)&&void 0!==i?i:cr);if(o.id!==hr){const t="https://services.arcgisonline.com/ArcGIS/rest/services/";r.url=`${t}${o.slug}/MapServer/tile/{z}/{y}/{x}`,r.attribution=`Tiles © <a href="${t}${o.slug}/MapServer">ArcGIS</a>`}const s=Object.assign({},e,{config:r});return lr.create(t,s,n)},registerOptionsUI:t=>{t.addSelect({path:"config.server",name:"Server instance",settings:{options:pr.selectOptions().options}}).addTextInput({path:"config.url",name:"URL template",description:"Must include {x}, {y} or {-y}, and {z} placeholders",settings:{placeholder:ar.url},showIf:t=>{var e;return(null===(e=t.config)||void 0===e?void 0:e.server)===hr}}).addTextInput({path:"config.attribution",name:"Attribution",settings:{placeholder:ar.attribution},showIf:t=>{var e;return(null===(e=t.config)||void 0===e?void 0:e.server)===hr}})},defaultOptions:{server:cr}}];var dr=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const gr=function(t){function e(e){var n,i=e||{};n=void 0!==i.attributions?i.attributions:['&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.'];var r=void 0!==i.crossOrigin?i.crossOrigin:"anonymous",o=void 0!==i.url?i.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:n,attributionsCollapsible:!1,cacheSize:i.cacheSize,crossOrigin:r,imageSmoothing:i.imageSmoothing,maxZoom:void 0!==i.maxZoom?i.maxZoom:19,opaque:void 0===i.opaque||i.opaque,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileLoadFunction:i.tileLoadFunction,transition:i.transition,url:o,wrapX:i.wrapX,zDirection:i.zDirection})||this}return dr(e,t),e}(ci),_r=[...[{id:"osm-standard",name:"Open Street Map",isBaseMap:!0,create:async(t,e)=>({init:()=>new tr({source:new gr})})}],...rr,...fr,...ur];var yr=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const vr=function(t){function e(e){var n=t.call(this)||this;if(n.on,n.once,n.un,n.id_=void 0,n.geometryName_="geometry",n.style_=null,n.styleFunction_=void 0,n.geometryChangeKey_=null,n.addChangeListener(n.geometryName_,n.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var i=e;n.setGeometry(i)}else{var r=e;n.setProperties(r)}return n}return yr(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var n=this.getGeometry();n&&t.setGeometry(n.clone());var i=this.getStyle();return i&&t.setStyle(i),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(oe(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=ie(t,s,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(St("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(Dn);var mr=n("./node_modules/rbush/rbush.min.js");const xr=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Vn(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 z()},t.prototype.getImage=function(t){return z()},t.prototype.getHitDetectionImage=function(){return z()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return z()},t.prototype.getImageSize=function(){return z()},t.prototype.getOrigin=function(){return z()},t.prototype.getSize=function(){return z()},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_=Vn(t)},t.prototype.listenImageChange=function(t){z()},t.prototype.load=function(){z()},t.prototype.unlistenImageChange=function(t){z()},t}();var wr=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Cr=/^([a-z]*)$|^hsla?\(.*\)$/i;function br(t){return"string"==typeof t?t:Rr(t)}function Sr(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var n=getComputedStyle(e).color;return document.body.removeChild(e),n}return""}var Er=function(){var t={},e=0;return function(n){var i;if(t.hasOwnProperty(n))i=t[n];else{if(e>=1024){var r=0;for(var o in t)0==(3&r++)&&(delete t[o],--e)}i=function(t){var e,n,i,r,o;Cr.exec(t)&&(t=Sr(t));if(wr.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var l=4===s||8===s;e=parseInt(t.substr(1+0*a,a),16),n=parseInt(t.substr(1+1*a,a),16),i=parseInt(t.substr(1+2*a,a),16),r=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,n=(n<<4)+n,i=(i<<4)+i,l&&(r=(r<<4)+r)),o=[e,n,i,r/255]}else 0==t.indexOf("rgba(")?Or(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Or(o)):St(!1,14);return o}(n),t[n]=i,++e}return i}}();function Tr(t){return Array.isArray(t)?t:Er(t)}function Or(t){return t[0]=de(t[0]+.5|0,0,255),t[1]=de(t[1]+.5|0,0,255),t[2]=de(t[2]+.5|0,0,255),t[3]=de(t[3],0,1),t}function Rr(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var n=t[1];n!=(0|n)&&(n=n+.5|0);var i=t[2];return i!=(0|i)&&(i=i+.5|0),"rgba("+e+","+n+","+i+","+(void 0===t[3]?1:t[3])+")"}function Pr(t){return Array.isArray(t)?Rr(t):t}var Ir="ol-hidden",Fr="ol-unselectable",Mr="ol-control",Lr="ol-collapsed",Ar=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"),jr=["style","variant","weight","size","lineHeight","family"],Dr=function(t){var e=t.match(Ar);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},i=0,r=jr.length;i<r;++i){var o=e[i+1];void 0!==o&&(n[jr[i]]=o)}return n.families=n.family.split(/,\s?/),n},kr="10px sans-serif",Gr="#000",zr="round",Nr=[],Br="round",Wr="#000",Ur="center",Xr="middle",Yr=[0,0,0,0],Zr=new Dn;(new L).setSize=function(){console.warn("labelCache is deprecated.")};var Vr,Kr,Hr=null,qr={},Jr=function(){var t,e,n="32px ",i=["monospace","serif"],r=i.length,o="wmytzilWMYTZIL@#/&?$%10";function s(t,s,a){for(var l=!0,u=0;u<r;++u){var h=i[u];if(e=to(t+" "+s+" "+n+h,o),a!=h){var c=to(t+" "+s+" "+n+a+","+h,o);l=l&&c!=e}}return!!l}function a(){for(var e=!0,n=Zr.getKeys(),i=0,r=n.length;i<r;++i){var o=n[i];Zr.get(o)<100&&(s.apply(this,o.split("\n"))?(R(qr),Hr=null,Vr=void 0,Zr.set(o,100)):(Zr.set(o,Zr.get(o)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var n=Dr(e);if(n)for(var i=n.families,r=0,o=i.length;r<o;++r){var l=i[r],u=n.style+"\n"+n.weight+"\n"+l;void 0===Zr.get(u)&&(Zr.set(u,100,!0),s(n.style,n.weight,l)||(Zr.set(u,0,!0),void 0===t&&(t=setInterval(a,32))))}}}(),$r=function(t){var e=qr[t];if(null==e){if(tt){var n=Dr(t),i=Qr(t,"Žg");e=(isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight))*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else Kr||((Kr=document.createElement("div")).innerHTML="M",Kr.style.minHeight="0",Kr.style.maxHeight="none",Kr.style.height="auto",Kr.style.padding="0",Kr.style.border="none",Kr.style.position="absolute",Kr.style.display="block",Kr.style.left="-99999px"),Kr.style.font=t,document.body.appendChild(Kr),e=Kr.offsetHeight,document.body.removeChild(Kr);qr[t]=e}return e};function Qr(t,e){return Hr||(Hr=it(1,1)),t!=Vr&&(Hr.font=t,Vr=Hr.font),Hr.measureText(e)}function to(t,e){return Qr(t,e).width}function eo(t,e,n){if(e in n)return n[e];var i=to(t,e);return n[e]=i,i}function no(t,e,n,i,r,o,s,a,l,u,h){t.save(),1!==n&&(t.globalAlpha*=n),e&&t.setTransform.apply(t,e),i.contextInstructions?(t.translate(l,u),t.scale(h[0],h[1]),function(t,e){for(var n=t.contextInstructions,i=0,r=n.length;i<r;i+=2)Array.isArray(n[i+1])?e[n[i]].apply(e,n[i+1]):e[n[i]]=n[i+1]}(i,t)):h[0]<0||h[1]<0?(t.translate(l,u),t.scale(h[0],h[1]),t.drawImage(i,r,o,s,a,0,0,s,a)):t.drawImage(i,r,o,s,a,l,u,s*h[0],a*h[1]),t.restore()}var io=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const ro=function(t){function e(e){var n=this,i=void 0!==e.rotateWithView&&e.rotateWithView;return(n=t.call(this,{opacity:1,rotateWithView:i,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,n.hitDetectionCanvas_=null,n.fill_=void 0!==e.fill?e.fill:null,n.origin_=[0,0],n.points_=e.points,n.radius_=void 0!==e.radius?e.radius:e.radius1,n.radius2_=e.radius2,n.angle_=void 0!==e.angle?e.angle:0,n.stroke_=void 0!==e.stroke?e.stroke:null,n.anchor_=null,n.size_=null,n.renderOptions_=null,n.render(),n}return io(e,t),e.prototype.clone=function(){var t=this.getScale(),n=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 n.setOpacity(this.getOpacity()),n},e.prototype.getAnchor=function(){return this.anchor_},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 n=this.renderOptions_,i=it(n.size*t,n.size*t);this.draw_(n,i,t),e=i.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 ht},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,n){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var i=this.radius_,r=void 0===this.radius2_?i:this.radius2_;if(i<r){var o=i;i=r,r=o}var s=void 0===this.radius2_?this.points_:2*this.points_,a=2*Math.PI/s,l=r*Math.sin(a),u=i-Math.sqrt(r*r-l*l),h=Math.sqrt(l*l+u*u),c=h/l;if("miter"===t&&c<=n)return c*e;var p=e/2/c,f=e/2*(u/h),d=Math.sqrt((i+p)*(i+p)+f*f)-i;if(void 0===this.radius2_||"bevel"===t)return 2*d;var g=i*Math.sin(a),_=r-Math.sqrt(i*i-g*g),y=Math.sqrt(g*g+_*_)/g;if(y<=n){var v=y*e/2-r-i;return 2*Math.max(d,v)}return 2*d},e.prototype.createRenderOptions=function(){var t,e=Br,n=0,i=null,r=0,o=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Wr),t=Pr(t),void 0===(o=this.stroke_.getWidth())&&(o=1),i=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=Br),void 0===(n=this.stroke_.getMiterLimit())&&(n=10));var s=this.calculateLineJoinSize_(e,o,n),a=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*a+s),lineDash:i,lineDashOffset:r,lineJoin:e,miterLimit:n}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size,e=this.getDisplacement();this.canvas_={},this.anchor_=[t/2-e[0],t/2+e[1]],this.size_=[t,t]},e.prototype.draw_=function(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var i=this.fill_.getColor();null===i&&(i=Gr),e.fillStyle=Pr(i),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(),n=0;if("string"==typeof e&&(e=Tr(e)),null===e?n=1:Array.isArray(e)&&(n=4===e.length?e[3]:1),0===n){var i=it(t.size,t.size);this.hitDetectionCanvas_=i.canvas,this.drawHitDetectionCanvas_(t,i)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,n=this.radius_;if(e===1/0)t.arc(0,0,n,0,2*Math.PI);else{var i=void 0===this.radius2_?n:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var r=this.angle_-Math.PI/2,o=2*Math.PI/e,s=0;s<e;s++){var a=r+s*o,l=s%2==0?n:i;t.lineTo(l*Math.cos(a),l*Math.sin(a))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=Gr,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}(xr);var oo=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const so=function(t){function e(e){var n=e||{};return t.call(this,{points:1/0,fill:n.fill,radius:n.radius,stroke:n.stroke,scale:void 0!==n.scale?n.scale:1,rotation:void 0!==n.rotation?n.rotation:0,rotateWithView:void 0!==n.rotateWithView&&n.rotateWithView,displacement:void 0!==n.displacement?n.displacement:[0,0]})||this}return oo(e,t),e.prototype.clone=function(){var t=this.getScale(),n=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 n.setOpacity(this.getOpacity()),n},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(ro);const ao=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 lo=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 uo=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=po,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.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.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_=po,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var ho=null;function co(t,e){if(!ho){var n=new ao({color:"rgba(255,255,255,0.4)"}),i=new lo({color:"#3399CC",width:1.25});ho=[new uo({image:new so({fill:n,stroke:i,radius:5}),fill:n,stroke:i})]}return ho}function po(t){return t.getGeometry()}const fo=uo;var go=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),_o="renderOrder";const yo=function(t){function e(e){var n=this,i=e||{},r=O({},i);return delete r.style,delete r.renderBuffer,delete r.updateWhileAnimating,delete r.updateWhileInteracting,(n=t.call(this,r)||this).declutter_=void 0!==i.declutter&&i.declutter,n.renderBuffer_=void 0!==i.renderBuffer?i.renderBuffer:100,n.style_=null,n.styleFunction_=void 0,n.setStyle(i.style),n.updateWhileAnimating_=void 0!==i.updateWhileAnimating&&i.updateWhileAnimating,n.updateWhileInteracting_=void 0!==i.updateWhileInteracting&&i.updateWhileInteracting,n}return go(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(_o)},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 mr(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(_o,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:co,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var n;Array.isArray(t)?n=t:(St("function"==typeof t.getZIndex,41),n=[t]),e=function(){return n}}return e}(this.style_),this.changed()},e}(Ii);var vo={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},mo=[vo.FILL],xo=[vo.STROKE],wo=[vo.BEGIN_PATH],Co=[vo.CLOSE_PATH];const bo=vo,So="Point",Eo="LineString",To="LinearRing",Oo="Polygon",Ro="MultiPoint",Po="MultiLineString",Io="MultiPolygon",Fo="GeometryCollection",Mo="Circle";const Lo=function(){function t(){}return t.prototype.drawCustom=function(t,e,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}();function Ao(t,e,n,i,r){for(var o=void 0!==r?r:[],s=0,a=e;a<n;a+=i)o[s++]=t.slice(a,a+i);return o.length=s,o}function jo(t,e,n,i,r){for(var o=void 0!==r?r:[],s=0,a=0,l=n.length;a<l;++a){var u=n[a];o[s++]=Ao(t,e,u,i,o[s]),e=u}return o.length=s,o}function Do(t,e,n,i,r){for(var o=void 0!==r?r:[],s=0,a=0,l=n.length;a<l;++a){var u=n[a];o[s++]=jo(t,e,u,i,o[s]),e=u[u.length-1]}return o.length=s,o}var ko=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Go=function(t){function e(e,n,i,r){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=n,o.pixelRatio=r,o.maxLineWidth=0,o.resolution=i,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return ko(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 n=this.getBufferedMaxExtent(),i=this.tmpCoordinate_,r=this.coordinates,o=r.length,s=0,a=t.length;s<a;s+=e)i[0]=t[s],i[1]=t[s+1],Pt(n,i)&&(r[o++]=i[0],r[o++]=i[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,n,i,r,o){var s=this.coordinates,a=s.length,l=this.getBufferedMaxExtent();o&&(e+=i);var u,h,c,p=t[e],f=t[e+1],d=this.tmpCoordinate_,g=!0;for(u=e+i;u<n;u+=i)d[0]=t[u],d[1]=t[u+1],(c=Mt(l,d))!==h?(g&&(s[a++]=p,s[a++]=f,g=!1),s[a++]=d[0],s[a++]=d[1]):c===yt?(s[a++]=d[0],s[a++]=d[1],g=!1):g=!0,p=d[0],f=d[1],h=c;return(r&&g||u===e+i)&&(s[a++]=p,s[a++]=f),a},e.prototype.drawCustomCoordinates_=function(t,e,n,i,r){for(var o=0,s=n.length;o<s;++o){var a=n[o],l=this.appendFlatLineCoordinates(t,e,a,i,!1,!1);r.push(l),e=a}return e},e.prototype.drawCustom=function(t,e,n){this.beginGeometry(t,e);var i,r,o,s,a,l=t.getType(),u=t.getStride(),h=this.coordinates.length;if(l==Io){i=t.getOrientedFlatCoordinates(),s=[];var c=t.getEndss();a=0;for(var p=0,f=c.length;p<f;++p){var d=[];a=this.drawCustomCoordinates_(i,a,c[p],u,d),s.push(d)}this.instructions.push([bo.CUSTOM,h,s,t,n,Do])}else l==Oo||l==Po?(o=[],i=l==Oo?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),a=this.drawCustomCoordinates_(i,0,t.getEnds(),u,o),this.instructions.push([bo.CUSTOM,h,o,t,n,jo])):l==Eo||l==Mo?(i=t.getFlatCoordinates(),r=this.appendFlatLineCoordinates(i,0,i.length,u,!1,!1),this.instructions.push([bo.CUSTOM,h,r,t,n,Ao])):l==Ro?(i=t.getFlatCoordinates(),(r=this.appendFlatPointCoordinates(i,u))>h&&this.instructions.push([bo.CUSTOM,h,r,t,n,Ao])):l==So&&(i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),r=this.coordinates.length,this.instructions.push([bo.CUSTOM,h,r,t,n]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[bo.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[bo.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 n,i,r=e.length,o=-1;for(t=0;t<r;++t)(i=(n=e[t])[0])==bo.END_GEOMETRY?o=t:i==bo.BEGIN_GEOMETRY&&(n[2]=t,w(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var n=this.state;if(t){var i=t.getColor();n.fillStyle=Pr(i||Gr)}else n.fillStyle=void 0;if(e){var r=e.getColor();n.strokeStyle=Pr(r||Wr);var o=e.getLineCap();n.lineCap=void 0!==o?o:zr;var s=e.getLineDash();n.lineDash=s?s.slice():Nr;var a=e.getLineDashOffset();n.lineDashOffset=a||0;var l=e.getLineJoin();n.lineJoin=void 0!==l?l:Br;var u=e.getWidth();n.lineWidth=void 0!==u?u:1;var h=e.getMiterLimit();n.miterLimit=void 0!==h?h:10,n.lineWidth>this.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,n=[bo.SET_FILL_STYLE,e];return"string"!=typeof e&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[bo.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 n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var n=t.strokeStyle,i=t.lineCap,r=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=i||r!=t.currentLineDash&&!b(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==n&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=i,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[bo.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Ot(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Tt(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Lo);var zo=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const No=function(t){function e(e,n,i,r){var o=t.call(this,e,n,i,r)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return zo(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),i=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(n,i);this.instructions.push([bo.DRAW_IMAGE,r,o,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([bo.DRAW_IMAGE,r,o,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 n=t.getFlatCoordinates(),i=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(n,i);this.instructions.push([bo.DRAW_IMAGE,r,o,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([bo.DRAW_IMAGE,r,o,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 n=t.getAnchor(),i=t.getSize(),r=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=r,this.image_=o,this.height_=i[1],this.opacity_=t.getOpacity(),this.originX_=s[0]*this.imagePixelRatio_,this.originY_=s[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=i[0],this.declutterImageWithText_=e},e}(Go);var Bo=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Wo=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return Bo(e,t),e.prototype.drawFlatCoordinates_=function(t,e,n,i){var r=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,n,i,!1,!1),s=[bo.MOVE_TO_LINE_TO,r,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),n},e.prototype.drawLineString=function(t,e){var n=this.state,i=n.strokeStyle,r=n.lineWidth;if(void 0!==i&&void 0!==r){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([bo.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Nr,0],wo);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(xo),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var n=this.state,i=n.strokeStyle,r=n.lineWidth;if(void 0!==i&&void 0!==r){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([bo.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],wo);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinates_(s,l,o[u],a);this.hitDetectionInstructions.push(xo),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(xo),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(xo),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(wo)},e}(Go);function Uo(t,e,n,i,r,o,s){var a=(n-e)/i;if(a<3){for(;e<n;e+=i)o[s++]=t[e],o[s++]=t[e+1];return s}var l=new Array(a);l[0]=1,l[a-1]=1;for(var u=[e,n-i],h=0;u.length>0;){for(var c=u.pop(),p=u.pop(),f=0,d=t[p],g=t[p+1],_=t[c],y=t[c+1],v=p+i;v<c;v+=i){var m=ye(t[v],t[v+1],d,g,_,y);m>f&&(h=v,f=m)}f>r&&(l[(h-e)/i]=1,p+i<h&&u.push(p,h),h+i<c&&u.push(h,c))}for(v=0;v<a;++v)l[v]&&(o[s++]=t[e+v*i],o[s++]=t[e+v*i+1]);return s}function Xo(t,e,n,i,r,o,s,a){for(var l=0,u=n.length;l<u;++l){var h=n[l];s=Uo(t,e,h,i,r,o,s),a.push(s),e=h}return s}function Yo(t,e){return e*Math.round(t/e)}function Zo(t,e,n,i,r,o,s){if(e==n)return s;var a,l,u=Yo(t[e],r),h=Yo(t[e+1],r);e+=i,o[s++]=u,o[s++]=h;do{if(a=Yo(t[e],r),l=Yo(t[e+1],r),(e+=i)==n)return o[s++]=a,o[s++]=l,s}while(a==u&&l==h);for(;e<n;){var c=Yo(t[e],r),p=Yo(t[e+1],r);if(e+=i,c!=a||p!=l){var f=a-u,d=l-h,g=c-u,_=p-h;f*_==d*g&&(f<0&&g<f||f==g||f>0&&g>f)&&(d<0&&_<d||d==_||d>0&&_>d)?(a=c,l=p):(o[s++]=a,o[s++]=l,u=a,h=l,a=c,l=p)}}return o[s++]=a,o[s++]=l,s}function Vo(t,e,n,i,r,o,s,a){for(var l=0,u=n.length;l<u;++l){var h=n[l];s=Zo(t,e,h,i,r,o,s),a.push(s),e=h}return s}var Ko=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Ho=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return Ko(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,n,i){var r=this.state,o=void 0!==r.fillStyle,s=void 0!==r.strokeStyle,a=n.length;this.instructions.push(wo),this.hitDetectionInstructions.push(wo);for(var l=0;l<a;++l){var u=n[l],h=this.coordinates.length,c=this.appendFlatLineCoordinates(t,e,u,i,!0,!s),p=[bo.MOVE_TO_LINE_TO,h,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),s&&(this.instructions.push(Co),this.hitDetectionInstructions.push(Co)),e=u}return o&&(this.instructions.push(mo),this.hitDetectionInstructions.push(mo)),s&&(this.instructions.push(xo),this.hitDetectionInstructions.push(xo)),e},e.prototype.drawCircle=function(t,e){var n=this.state,i=n.fillStyle,r=n.strokeStyle;if(void 0!==i||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([bo.SET_FILL_STYLE,Gr]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([bo.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var o=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,s,!1,!1);var l=[bo.CIRCLE,a];this.instructions.push(wo,l),this.hitDetectionInstructions.push(wo,l),void 0!==n.fillStyle&&(this.instructions.push(mo),this.hitDetectionInstructions.push(mo)),void 0!==n.strokeStyle&&(this.instructions.push(xo),this.hitDetectionInstructions.push(xo)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var n=this.state,i=n.fillStyle,r=n.strokeStyle;if(void 0!==i||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([bo.SET_FILL_STYLE,Gr]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([bo.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var o=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,o,a),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var n=this.state,i=n.fillStyle,r=n.strokeStyle;if(void 0!==i||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([bo.SET_FILL_STYLE,Gr]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([bo.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);for(var o=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinatess_(s,l,o[u],a);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var n=this.coordinates,i=0,r=n.length;i<r;++i)n[i]=Yo(n[i],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),qo="line";function Jo(t,e,n,i,r){var o,s,a,l,u,h,c,p,f,d=n,g=n,_=0,y=0,v=n;for(o=n;o<i;o+=r){var m=e[o],x=e[o+1];void 0!==l&&(p=m-l,f=x-u,a=Math.sqrt(p*p+f*f),void 0!==h&&(y+=s,Math.acos((h*p+c*f)/(s*a))>t&&(y>_&&(_=y,d=v,g=o),y=0,v=o-r)),s=a,h=p,c=f),l=m,u=x}return(y+=a)>_?[v,o]:[d,g]}var $o=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Qo={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};var ts={Circle:Ho,Default:Go,Image:No,LineString:Wo,Polygon:Ho,Text:function(t){function e(e,n,i,r){var o=t.call(this,e,n,i,r)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return $o(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 n=this.textFillState_,i=this.textStrokeState_,r=this.textState_;if(""!==this.text_&&r&&(n||i)){var o=this.coordinates,s=o.length,a=t.getType(),l=null,u=t.getStride();if(r.placement!==qo||a!=Eo&&a!=Po&&a!=Oo&&a!=Io){var h=r.overflow?null:[];switch(a){case So:case Ro:l=t.getFlatCoordinates();break;case Eo:l=t.getFlatMidpoint();break;case Mo:l=t.getCenter();break;case Po:l=t.getFlatMidpoints(),u=2;break;case Oo:l=t.getFlatInteriorPoint(),r.overflow||h.push(l[2]/this.resolution),u=3;break;case Io:var c=t.getFlatInteriorPoints();l=[];for(C=0,b=c.length;C<b;C+=3)r.overflow||h.push(c[C+2]/this.resolution),l.push(c[C],c[C+1]);if(0===l.length)return;u=2}if((I=this.appendFlatPointCoordinates(l,u))===s)return;if(h&&(I-s)/2!=l.length/u){var p=s/2;h=h.filter((function(t,e){var n=o[2*(p+e)]===l[e*u]&&o[2*(p+e)+1]===l[e*u+1];return n||--p,n}))}this.saveTextStates_(),(r.backgroundFill||r.backgroundStroke)&&(this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke),r.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),r.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var f=r.padding;if(f!=Yr&&(r.scale[0]<0||r.scale[1]<0)){var d=r.padding[0],g=r.padding[1],_=r.padding[2],y=r.padding[3];r.scale[0]<0&&(g=-g,y=-y),r.scale[1]<0&&(d=-d,_=-_),f=[d,g,_,y]}var v=this.pixelRatio;this.instructions.push([bo.DRAW_IMAGE,s,I,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,f==Yr?Yr:f.map((function(t){return t*v})),!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);var m=1/v;this.hitDetectionInstructions.push([bo.DRAW_IMAGE,s,I,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,this.declutterImageWithText_,f,!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),this.endGeometry(e)}else{if(!te(this.getBufferedMaxExtent(),t.getExtent()))return;var x=void 0;if(l=t.getFlatCoordinates(),a==Eo)x=[l.length];else if(a==Po)x=t.getEnds();else if(a==Oo)x=t.getEnds().slice(0,1);else if(a==Io){var w=t.getEndss();x=[];for(var C=0,b=w.length;C<b;++C)x.push(w[C][0])}this.beginGeometry(t,e);for(var S=r.textAlign,E=0,T=void 0,O=0,R=x.length;O<R;++O){if(null==S){var P=Jo(r.maxAngle,l,E,x[O],u);E=P[0],T=P[1]}else T=x[O];for(var C=E;C<T;C+=u)o.push(l[C],l[C+1]);var I=o.length;E=x[O],this.drawChars_(s,I),s=I}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,i=this.strokeKey_;t&&(i in this.strokeStates||(this.strokeStates[i]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||Ur,textBaseline:e.textBaseline||Xr,scale:e.scale});var o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))},e.prototype.drawChars_=function(t,e){var n=this.textStrokeState_,i=this.textState_,r=this.strokeKey_,o=this.textKey_,s=this.fillKey_;this.saveTextStates_();var a=this.pixelRatio,l=Qo[i.textBaseline],u=this.textOffsetY_*a,h=this.text_,c=n?n.lineWidth*Math.abs(i.scale[0])/2:0;this.instructions.push([bo.DRAW_CHARS,t,e,l,i.overflow,s,i.maxAngle,a,u,r,c*a,h,o,1]),this.hitDetectionInstructions.push([bo.DRAW_CHARS,t,e,l,i.overflow,s,i.maxAngle,1,u,r,c,h,o,1/a])},e.prototype.setTextStyle=function(t,e){var n,i,r;if(t){var o=t.getFill();o?((i=this.textFillState_)||(i={},this.textFillState_=i),i.fillStyle=Pr(o.getColor()||Gr)):(i=null,this.textFillState_=i);var s=t.getStroke();if(s){(r=this.textStrokeState_)||(r={},this.textStrokeState_=r);var a=s.getLineDash(),l=s.getLineDashOffset(),u=s.getWidth(),h=s.getMiterLimit();r.lineCap=s.getLineCap()||zr,r.lineDash=a?a.slice():Nr,r.lineDashOffset=void 0===l?0:l,r.lineJoin=s.getLineJoin()||Br,r.lineWidth=void 0===u?1:u,r.miterLimit=void 0===h?10:h,r.strokeStyle=Pr(s.getColor()||Wr)}else r=null,this.textStrokeState_=r;n=this.textState_;var c=t.getFont()||kr;Jr(c);var p=t.getScaleArray();n.overflow=t.getOverflow(),n.font=c,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.textBaseline=t.getTextBaseline()||Xr,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||Yr,n.scale=void 0===p?[1,1]:p;var f=t.getOffsetX(),d=t.getOffsetY(),g=t.getRotateWithView(),_=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===f?0:f,this.textOffsetY_=void 0===d?0:d,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===_?0:_,this.strokeKey_=r?("string"==typeof r.strokeStyle?r.strokeStyle:B(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.textBaseline||"?"),this.fillKey_=i?"string"==typeof i.fillStyle?i.fillStyle:"|"+B(i.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(Go)};const es=function(){function t(t,e,n,i){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=i,this.resolution_=n,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var n=this.buildersByZIndex_[e];for(var i in n){var r=n[i].finish();t[e][i]=r}}return t},t.prototype.getBuilder=function(t,e){var n=void 0!==t?t.toString():"0",i=this.buildersByZIndex_[n];void 0===i&&(i={},this.buildersByZIndex_[n]=i);var r=i[e];void 0===r&&(r=new(0,ts[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[e]=r);return r},t}(),ns="Circle",is="Default",rs="Image",os="LineString",ss="Polygon",as="Text";function ls(t,e,n,i,r,o){for(var s=o||[],a=0,l=e;l<n;l+=i){var u=t[l],h=t[l+1];s[a++]=r[0]*u+r[2]*h+r[4],s[a++]=r[1]*u+r[3]*h+r[5]}return o&&s.length!=a&&(s.length=a),s}function us(t,e,n,i,r,o,s){for(var a=s||[],l=Math.cos(r),u=Math.sin(r),h=o[0],c=o[1],p=0,f=e;f<n;f+=i){var d=t[f]-h,g=t[f+1]-c;a[p++]=h+d*l-g*u,a[p++]=c+d*u+g*l;for(var _=f+2;_<f+i;++_)a[p++]=t[_]}return s&&a.length!=p&&(a.length=p),a}function hs(t,e,n,i,r,o,s,a,l,u,h,c){var p=t[e],f=t[e+1],d=0,g=0,_=0,y=0;function v(){d=p,g=f,p=t[e+=i],f=t[e+1],y+=_,_=Math.sqrt((p-d)*(p-d)+(f-g)*(f-g))}do{v()}while(e<n-i&&y+_<o);for(var m=(o-y)/_,x=we(d,p,m),w=we(g,f,m),C=e-i,b=y,S=o+a*l(u,r,h);e<n-i&&y+_<S;)v();var E,T=we(d,p,m=(S-y)/_),O=we(g,f,m);if(c){var R=[x,w,T,O];us(R,0,4,2,c,R,R),E=R[0]>R[2]}else E=x>T;var P,I=Math.PI,F=[],M=C+i===e;if(_=0,y=b,p=t[e=C],f=t[e+1],M){v();var L=Math.atan2(f-g,p-d);E&&(L+=L>0?-I:I);var A=(T+x)/2,j=(O+w)/2;return F[0]=[A,j,(S-o)/2,L,r],F}for(var D=0,k=r.length;D<k;){v();var G=Math.atan2(f-g,p-d);if(E&&(G+=G>0?-I:I),void 0!==P){var z=G-P;if(z+=z>I?-2*I:z<-I?2*I:0,Math.abs(z)>s)return null}P=G;for(var N=D,B=0;D<k;++D){var W=a*l(u,r[E?k-D-1:D],h);if(e+i<n&&y+_<o+B+W/2)break;B+=W}if(D!==N){var U=E?r.substring(k-N,k-D):r.substring(N,D);A=we(d,p,m=(o+B/2-y)/_),j=we(g,f,m);F.push([A,j,B/2,G,U]),o+=B}}return F}function cs(t,e,n,i){for(var r=t[e],o=t[e+1],s=0,a=e+i;a<n;a+=i){var l=t[a],u=t[a+1];s+=Math.sqrt((l-r)*(l-r)+(u-o)*(u-o)),r=l,o=u}return s}var ps=[1/0,1/0,-1/0,-1/0],fs=[],ds=[],gs=[],_s=[];function ys(t){return t[3].declutterBox}var vs=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 ms(t,e){return"start"!==e&&"end"!==e||vs.test(t)||(e="start"===e?"left":"right"),Qo[e]}const xs=function(){function t(t,e,n,i){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,n,i){var r=t+e+n+i;if(this.labels_[r])return this.labels_[r];var o=i?this.strokeStates[i]:null,s=n?this.fillStates[n]:null,a=this.textStates[e],l=this.pixelRatio,u=[a.scale[0]*l,a.scale[1]*l],h=ms(t,a.textAlign||Ur),c=i&&o.lineWidth?o.lineWidth:0,p=t.split("\n"),f=p.length,d=[],g=function(t,e,n){for(var i=e.length,r=0,o=0;o<i;++o){var s=to(t,e[o]);r=Math.max(r,s),n.push(s)}return r}(a.font,p,d),_=$r(a.font),y=g+c,v=[],m=(y+2)*u[0],x=(_*f+c)*u[1],w={width:m<0?Math.floor(m):Math.ceil(m),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:v};(1==u[0]&&1==u[1]||v.push("scale",u),v.push("font",a.font),i)&&(v.push("strokeStyle",o.strokeStyle),v.push("lineWidth",c),v.push("lineCap",o.lineCap),v.push("lineJoin",o.lineJoin),v.push("miterLimit",o.miterLimit),(tt?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(v.push("setLineDash",[o.lineDash]),v.push("lineDashOffset",o.lineDashOffset)));n&&v.push("fillStyle",s.fillStyle),v.push("textBaseline","middle"),v.push("textAlign","center");var C,b=.5-h,S=h*y+b*c;if(i)for(C=0;C<f;++C)v.push("strokeText",[p[C],S+b*d[C],.5*(c+_)+C*_]);if(n)for(C=0;C<f;++C)v.push("fillText",[p[C],S+b*d[C],.5*(c+_)+C*_]);return this.labels_[r]=w,w},t.prototype.replayTextBackground_=function(t,e,n,i,r,o,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,i),t.lineTo.apply(t,r),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,n,i,r,o,s,a,l,u,h,c,p,f,d,g){var _,y=n-(s*=c[0]),v=i-(a*=c[1]),m=r+l>t?t-l:r,x=o+u>e?e-u:o,w=f[3]+m*c[0]+f[1],C=f[0]+x*c[1]+f[2],b=y-f[3],S=v-f[0];return(d||0!==h)&&(fs[0]=b,_s[0]=b,fs[1]=S,ds[1]=S,ds[0]=b+w,gs[0]=ds[0],gs[1]=S+C,_s[1]=gs[1]),0!==h?(Xi(_=Yi([1,0,0,1,0,0],n,i,1,1,h,-n,-i),fs),Xi(_,ds),Xi(_,gs),Xi(_,_s),At(Math.min(fs[0],ds[0],gs[0],_s[0]),Math.min(fs[1],ds[1],gs[1],_s[1]),Math.max(fs[0],ds[0],gs[0],_s[0]),Math.max(fs[1],ds[1],gs[1],_s[1]),ps)):At(Math.min(b,b+w),Math.min(S,S+C),Math.max(b,b+w),Math.max(S,S+C),ps),p&&(y=Math.round(y),v=Math.round(v)),{drawImageX:y,drawImageY:v,drawImageW:m,drawImageH:x,originX:l,originY:u,declutterBox:{minX:ps[0],minY:ps[1],maxX:ps[2],maxY:ps[3],value:g},canvasTransform:_,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,n,i,r,o,s){var a=!(!o&&!s),l=i.declutterBox,u=t.canvas,h=s?s[2]*i.scale[0]/2:0;return l.minX-h<=u.width/e&&l.maxX+h>=0&&l.minY-h<=u.height/e&&l.maxY+h>=0&&(a&&this.replayTextBackground_(t,fs,ds,gs,_s,o,s),no(t,i.canvasTransform,r,n,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=Xi(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(e[0]%n,e[1]%n),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,n,i){var r=this.textStates[e],o=this.createLabel(t,e,i,n),s=this.strokeStates[n],a=this.pixelRatio,l=ms(t,r.textAlign||Ur),u=Qo[r.textBaseline||Xr],h=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:l*(o.width/a-2*r.scale[0])+2*(.5-l)*h,anchorY:u*o.height/a+2*(.5-u)*h}},t.prototype.execute_=function(t,e,n,i,r,o,s,a){var l,u,h;this.pixelCoordinates_&&b(n,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=ls(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),u=this.renderedTransform_,h=n,u[0]=h[0],u[1]=h[1],u[2]=h[2],u[3]=h[3],u[4]=h[4],u[5]=h[5]);for(var c,p,f,d,g,_,y,v,m,x,w,C,S,E,T,O,R=0,P=i.length,I=0,F=0,M=0,L=null,A=null,j=this.coordinateCache_,D=this.viewRotation_,k=Math.round(1e12*Math.atan2(-n[1],n[0]))/1e12,G={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:D},z=this.instructions!=i||this.overlaps?0:200;R<P;){var N=i[R];switch(N[0]){case bo.BEGIN_GEOMETRY:S=N[1],O=N[3],S.getGeometry()?void 0===s||te(s,O.getExtent())?++R:R=N[2]+1:R=N[2];break;case bo.BEGIN_PATH:F>z&&(this.fill_(t),F=0),M>z&&(t.stroke(),M=0),F||M||(t.beginPath(),d=NaN,g=NaN),++R;break;case bo.CIRCLE:var B=l[I=N[1]],W=l[I+1],U=l[I+2]-B,X=l[I+3]-W,Y=Math.sqrt(U*U+X*X);t.moveTo(B+Y,W),t.arc(B,W,Y,0,2*Math.PI,!0),++R;break;case bo.CLOSE_PATH:t.closePath(),++R;break;case bo.CUSTOM:I=N[1],c=N[2];var Z=N[3],V=N[4],K=6==N.length?N[5]:void 0;G.geometry=Z,G.feature=S,R in j||(j[R]=[]);var H=j[R];K?K(l,I,c,2,H):(H[0]=l[I],H[1]=l[I+1],H.length=2),V(H,G),++R;break;case bo.DRAW_IMAGE:I=N[1],c=N[2],v=N[3],p=N[4],f=N[5];var q=N[6],J=N[7],$=N[8],Q=N[9],tt=N[10],et=N[11],nt=N[12],it=N[13],rt=N[14];if(!v&&N.length>=19){m=N[18],x=N[19],w=N[20],C=N[21];var ot=this.drawLabelWithPointPlacement_(m,x,w,C);v=ot.label,N[3]=v;var st=N[22];p=(ot.anchorX-st)*this.pixelRatio,N[4]=p;var at=N[23];f=(ot.anchorY-at)*this.pixelRatio,N[5]=f,q=v.height,N[6]=q,it=v.width,N[13]=it}var lt=void 0;N.length>24&&(lt=N[24]);var ut=void 0,ht=void 0,ct=void 0;N.length>16?(ut=N[15],ht=N[16],ct=N[17]):(ut=Yr,ht=!1,ct=!1),tt&&k?et+=D:tt||k||(et-=D);for(var pt=0;I<c;I+=2)if(!(lt&&lt[pt++]<it/this.pixelRatio)){var ft=[t,e,v,Nt=this.calculateImageOrLabelDimensions_(v.width,v.height,l[I],l[I+1],it,q,p,f,$,Q,et,nt,r,ut,ht||ct,S),J,ht?L:null,ct?A:null],dt=void 0,gt=void 0;if(a&&rt){var _t=c-I;if(!rt[_t]){rt[_t]=ft;continue}if(dt=rt[_t],delete rt[_t],gt=ys(dt),a.collides(gt))continue}a&&a.collides(Nt.declutterBox)||(dt&&(a&&a.insert(gt),this.replayImageOrLabel_.apply(this,dt)),a&&a.insert(Nt.declutterBox),this.replayImageOrLabel_.apply(this,ft))}++R;break;case bo.DRAW_CHARS:var yt=N[1],vt=N[2],mt=N[3],xt=N[4];C=N[5];var wt=N[6],Ct=N[7],bt=N[8];w=N[9];var St=N[10];m=N[11],x=N[12];var Et=[N[13],N[13]],Tt=this.textStates[x],Ot=Tt.font,Rt=[Tt.scale[0]*Ct,Tt.scale[1]*Ct],Pt=void 0;Ot in this.widths_?Pt=this.widths_[Ot]:(Pt={},this.widths_[Ot]=Pt);var It=cs(l,yt,vt,2),Ft=Math.abs(Rt[0])*eo(Ot,m,Pt);if(xt||Ft<=It){var Mt=this.textStates[x].textAlign,Lt=hs(l,yt,vt,2,m,(It-Ft)*Qo[Mt],wt,Math.abs(Rt[0]),eo,Ot,Pt,k?0:this.viewRotation_);t:if(Lt){var At=[],jt=void 0,Dt=void 0,kt=void 0,Gt=void 0,zt=void 0;if(w)for(jt=0,Dt=Lt.length;jt<Dt;++jt){kt=(zt=Lt[jt])[4],Gt=this.createLabel(kt,x,"",w),p=zt[2]+(Rt[0]<0?-St:St),f=mt*Gt.height+2*(.5-mt)*St*Rt[1]/Rt[0]-bt;var Nt=this.calculateImageOrLabelDimensions_(Gt.width,Gt.height,zt[0],zt[1],Gt.width,Gt.height,p,f,0,0,zt[3],Et,!1,Yr,!1,S);if(a&&a.collides(Nt.declutterBox))break t;At.push([t,e,Gt,Nt,1,null,null])}if(C)for(jt=0,Dt=Lt.length;jt<Dt;++jt){kt=(zt=Lt[jt])[4],Gt=this.createLabel(kt,x,C,""),p=zt[2],f=mt*Gt.height-bt;Nt=this.calculateImageOrLabelDimensions_(Gt.width,Gt.height,zt[0],zt[1],Gt.width,Gt.height,p,f,0,0,zt[3],Et,!1,Yr,!1,S);if(a&&a.collides(Nt.declutterBox))break t;At.push([t,e,Gt,Nt,1,null,null])}a&&a.load(At.map(ys));for(var Bt=0,Wt=At.length;Bt<Wt;++Bt)this.replayImageOrLabel_.apply(this,At[Bt])}}++R;break;case bo.END_GEOMETRY:if(void 0!==o){var Ut=o(S=N[1],O);if(Ut)return Ut}++R;break;case bo.FILL:z?F++:this.fill_(t),++R;break;case bo.MOVE_TO_LINE_TO:for(I=N[1],c=N[2],E=l[I],y=(T=l[I+1])+.5|0,(_=E+.5|0)===d&&y===g||(t.moveTo(E,T),d=_,g=y),I+=2;I<c;I+=2)_=(E=l[I])+.5|0,y=(T=l[I+1])+.5|0,I!=c-2&&_===d&&y===g||(t.lineTo(E,T),d=_,g=y);++R;break;case bo.SET_FILL_STYLE:L=N,this.alignFill_=N[2],F&&(this.fill_(t),F=0,M&&(t.stroke(),M=0)),t.fillStyle=N[1],++R;break;case bo.SET_STROKE_STYLE:A=N,M&&(t.stroke(),M=0),this.setStrokeStyle_(t,N),++R;break;case bo.STROKE:z?M++:t.stroke(),++R;break;default:++R}}F&&this.fill_(t),M&&t.stroke()},t.prototype.execute=function(t,e,n,i,r,o){this.viewRotation_=i,this.execute_(t,e,n,this.instructions,r,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,n,i,r){return this.viewRotation_=n,this.execute_(t,1,e,this.hitDetectionInstructions,!0,i,r)},t}();var ws=[ss,ns,os,rs,as,is],Cs=function(){function t(t,e,n,i,r,o){this.maxExtent_=t,this.overlaps_=i,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(r)}return t.prototype.clip=function(t,e){var n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var n=this.executorsByZIndex_[e];void 0===n&&(n={},this.executorsByZIndex_[e]=n);var i=t[e];for(var r in i){var o=i[r];n[r]=new xs(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var n=this.executorsByZIndex_[e],i=0,r=t.length;i<r;++i)if(t[i]in n)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,r,o){var s=2*(i=Math.round(i))+1,a=Yi(this.hitDetectionTransform_,i+.5,i+.5,1/e,-1/e,-n,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=it(s,s));var u,h=this.hitDetectionContext_;h.canvas.width!==s||h.canvas.height!==s?(h.canvas.width=s,h.canvas.height=s):l||h.clearRect(0,0,s,s),void 0!==this.renderBuffer_&&(zt(u=[1/0,1/0,-1/0,-1/0],t),Tt(u,e*(this.renderBuffer_+i),u));var c,p=function(t){if(void 0!==bs[t])return bs[t];for(var e=2*t+1,n=t*t,i=new Array(n+1),r=0;r<=t;++r)for(var o=0;o<=t;++o){var s=r*r+o*o;if(s>n)break;var a=i[s];a||(a=[],i[s]=a),a.push(4*((t+r)*e+(t+o))+3),r>0&&a.push(4*((t-r)*e+(t+o))+3),o>0&&(a.push(4*((t+r)*e+(t-o))+3),r>0&&a.push(4*((t-r)*e+(t-o))+3))}for(var l=[],u=(r=0,i.length);r<u;++r)i[r]&&l.push.apply(l,i[r]);return bs[t]=l,l}(i);function f(t,e){for(var n=h.getImageData(0,0,s,s).data,a=0,l=p.length;a<l;a++)if(n[p[a]]>0){if(!o||c!==rs&&c!==as||-1!==o.indexOf(t)){var u=(p[a]-3)/4,f=i-u%s,d=i-(u/s|0),g=r(t,e,f*f+d*d);if(g)return g}h.clearRect(0,0,s,s);break}}var d,g,_,y,v,x=Object.keys(this.executorsByZIndex_).map(Number);for(x.sort(m),d=x.length-1;d>=0;--d){var w=x[d].toString();for(_=this.executorsByZIndex_[w],g=ws.length-1;g>=0;--g)if(void 0!==(y=_[c=ws[g]])&&(v=y.executeHitDetection(h,a,n,f,u)))return v}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var n=e[0],i=e[1],r=e[2],o=e[3],s=[n,i,n,o,r,o,r,i];return ls(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return I(this.executorsByZIndex_)},t.prototype.execute=function(t,e,n,i,r,o,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(m),this.maxExtent_&&(t.save(),this.clip(t,n));var l,u,h,c,p,f,d=o||ws;for(s&&a.reverse(),l=0,u=a.length;l<u;++l){var g=a[l].toString();for(p=this.executorsByZIndex_[g],h=0,c=d.length;h<c;++h){void 0!==(f=p[d[h]])&&f.execute(t,e,n,i,r,s)}}this.maxExtent_&&t.restore()},t}(),bs={};const Ss=Cs,Es=0,Ts=1;var Os=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rs=[1,0,0,1,0,0];const Ps=function(t){function e(){var e,n,i,r,o,s=t.call(this)||this;return s.extent_=[1/0,1/0,-1/0,-1/0],s.extentRevision_=-1,s.simplifiedGeometryMaxMinSquaredTolerance=0,s.simplifiedGeometryRevision=0,s.simplifyTransformedInternal=(e=function(t,e,n){if(!n)return this.getSimplifiedGeometry(e);var i=this.clone();return i.applyTransform(n),i.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===r&&b(t,i)||(o=!0,r=this,i=t,n=e.apply(this,arguments)),n}),s}return Os(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return z()},e.prototype.closestPointXY=function(t,e,n,i){return z()},e.prototype.containsXY=function(t,e){var n=this.getClosestPoint([t,e]);return n[0]===t&&n[1]===e},e.prototype.getClosestPoint=function(t,e){var n=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],n,1/0),n},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return z()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&jt(e),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},e.prototype.rotate=function(t,e){z()},e.prototype.scale=function(t,e,n){z()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return z()},e.prototype.getType=function(){return z()},e.prototype.applyTransform=function(t){z()},e.prototype.intersectsExtent=function(t){return z()},e.prototype.translate=function(t,e){z()},e.prototype.transform=function(t,e){var n=Ye(t),i=n.getUnits()==pe.TILE_PIXELS?function(t,i,r){var o=n.getExtent(),s=n.getWorldExtent(),a=Ht(s)/Ht(o);return Yi(Rs,s[0],s[3],a,-a,0,0,0),ls(t,0,t.length,r,Rs,i),Qe(n,e)(t,i,r)}:Qe(n,e);return this.applyTransform(i),this},e}(Dn),Is="XY",Fs="XYZ",Ms="XYM",Ls="XYZM";var As=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function js(t){var e;return t==Is?e=2:t==Fs||t==Ms?e=3:t==Ls&&(e=4),e}const Ds=function(t){function e(){var e=t.call(this)||this;return e.layout=Is,e.stride=2,e.flatCoordinates=null,e}return As(e,t),e.prototype.computeExtent=function(t){return Dt(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return z()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=js(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){z()},e.prototype.setLayout=function(t,e,n){var i;if(t)i=js(t);else{for(var r=0;r<n;++r){if(0===e.length)return this.layout=Is,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Is:3==t?e=Fs:4==t&&(e=Ls);return e}(i=e.length)}this.layout=t,this.stride=i},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var n=this.getFlatCoordinates();if(n){var i=this.getStride();us(n,0,n.length,i,t,e,n),this.changed()}},e.prototype.scale=function(t,e,n){var i=e;void 0===i&&(i=t);var r=n;r||(r=Zt(this.getExtent()));var o=this.getFlatCoordinates();if(o){var s=this.getStride();!function(t,e,n,i,r,o,s,a){for(var l=a||[],u=s[0],h=s[1],c=0,p=e;p<n;p+=i){var f=t[p]-u,d=t[p+1]-h;l[c++]=u+r*f,l[c++]=h+o*d;for(var g=p+2;g<p+i;++g)l[c++]=t[g]}a&&l.length!=c&&(l.length=c)}(o,0,o.length,s,t,i,r,o),this.changed()}},e.prototype.translate=function(t,e){var n=this.getFlatCoordinates();if(n){var i=this.getStride();!function(t,e,n,i,r,o,s){for(var a=s||[],l=0,u=e;u<n;u+=i){a[l++]=t[u]+r,a[l++]=t[u+1]+o;for(var h=u+2;h<u+i;++h)a[l++]=t[h]}s&&a.length!=l&&(a.length=l)}(n,0,n.length,i,t,e,n),this.changed()}},e}(Ps);var ks=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Gs=function(t){function e(e,n,i,r,o,s,a){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=n,l.extent_=i,l.transform_=r,l.viewRotation_=o,l.squaredTolerance_=s,l.userTransform_=a,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return ks(e,t),e.prototype.drawImages_=function(t,e,n,i){if(this.image_){var r=ls(t,e,n,i,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.tmpLocalTransform_,a=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=a*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,h=r.length;u<h;u+=2){var c=r[u]-this.imageAnchorX_,p=r[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var f=c+this.imageAnchorX_,d=p+this.imageAnchorY_;Yi(s,f,d,1,1,l,-f,-d),o.setTransform.apply(o,s),o.translate(f,d),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=a)}},e.prototype.drawText_=function(t,e,n,i){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var r=ls(t,e,n,i,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<n;e+=i){var a=r[e]+this.textOffsetX_,l=r[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=Yi(this.tmpLocalTransform_,a,l,1,1,s,-a,-l);o.setTransform.apply(o,u),o.translate(a,l),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,a,l),this.textFillState_&&o.fillText(this.text_,a,l)}}},e.prototype.moveToLineTo_=function(t,e,n,i,r){var o=this.context_,s=ls(t,e,n,i,this.transform_,this.pixelCoordinates_);o.moveTo(s[0],s[1]);var a=s.length;r&&(a-=2);for(var l=2;l<a;l+=2)o.lineTo(s[l],s[l+1]);return r&&o.closePath(),n},e.prototype.drawRings_=function(t,e,n,i){for(var r=0,o=n.length;r<o;++r)e=this.moveToLineTo_(t,e,n[r],i,!0);return e},e.prototype.drawCircle=function(t){if(te(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,n){var i=t.getFlatCoordinates();if(i){var r=t.getStride();return ls(i,0,i.length,r,e,n)}return null}(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],i=e[3]-e[1],r=Math.sqrt(n*n+i*i),o=this.context_;o.beginPath(),o.arc(e[0],e[1],r,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.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 So:this.drawPoint(t);break;case Eo:this.drawLineString(t);break;case Oo:this.drawPolygon(t);break;case Ro:this.drawMultiPoint(t);break;case Po:this.drawMultiLineString(t);break;case Io:this.drawMultiPolygon(t);break;case Fo:this.drawGeometryCollection(t);break;case Mo:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var n=e.getGeometryFunction()(t);n&&te(this.extent_,n.getExtent())&&(this.setStyle(e),this.drawGeometry(n))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),n=0,i=e.length;n<i;++n)this.drawGeometry(e[n])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),te(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var i=t.getFlatMidpoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(te(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var n=this.context_,i=t.getFlatCoordinates(),r=0,o=t.getEnds(),s=t.getStride();n.beginPath();for(var a=0,l=o.length;a<l;++a)r=this.moveToLineTo_(i,r,o[a],s,!1);n.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),te(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 n=t.getFlatInteriorPoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),te(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_,n=t.getOrientedFlatCoordinates(),i=0,r=t.getEndss(),o=t.getStride();e.beginPath();for(var s=0,a=r.length;s<a;++s){var l=r[s];i=this.drawRings_(n,i,l,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var u=t.getFlatInteriorPoints();this.drawText_(u,0,u.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.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_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(b(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.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_,n=this.contextTextState_,i=t.textAlign?t.textAlign:Ur;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=i&&(n.textAlign=i,e.textAlign=i),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=i,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:i,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var n=this;if(t){var i=t.getColor();this.fillState_={fillStyle:Pr(i||Gr)}}else this.fillState_=null;if(e){var r=e.getColor(),o=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),h=e.getMiterLimit(),c=s||Nr;this.strokeState_={lineCap:void 0!==o?o:zr,lineDash:1===this.pixelRatio_?c:c.map((function(t){return t*n.pixelRatio_})),lineDashOffset:(a||0)*this.pixelRatio_,lineJoin:void 0!==l?l:Br,lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==h?h:10,strokeStyle:Pr(r||Wr)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var n=t.getAnchor(),i=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*this.pixelRatio_,this.imageAnchorY_=n[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=i[0],this.imageOriginY_=i[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 n=e.getColor();this.textFillState_={fillStyle:Pr(n||Gr)}}else this.textFillState_=null;var i=t.getStroke();if(i){var r=i.getColor(),o=i.getLineCap(),s=i.getLineDash(),a=i.getLineDashOffset(),l=i.getLineJoin(),u=i.getWidth(),h=i.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:zr,lineDash:s||Nr,lineDashOffset:a||0,lineJoin:void 0!==l?l:Br,lineWidth:void 0!==u?u:1,miterLimit:void 0!==h?h:10,strokeStyle:Pr(r||Wr)}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),f=t.getOffsetY(),d=t.getRotateWithView(),g=t.getRotation(),_=t.getScaleArray(),y=t.getText(),v=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==c?c:kr,textAlign:void 0!==v?v:Ur,textBaseline:void 0!==m?m:Xr},this.text_=void 0!==y?y:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==f?this.pixelRatio_*f:0,this.textRotateWithView_=void 0!==d&&d,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*_[0],this.pixelRatio_*_[1]]}else this.text_=""},e}(Lo),zs="fraction",Ns="pixels",Bs="bottom-left",Ws="bottom-right",Us="top-left",Xs="top-right";var Ys=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 n=this.cache_[e];0!=(3&t++)||n.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,n){var i=Zs(t,e,n);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(t,e,n,i){var r=Zs(t,e,n);this.cache_[r]=i,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function Zs(t,e,n){return e+":"+t+":"+(n?br(n):"null")}var Vs=new Ys,Ks=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Hs=null,qs=function(t){function e(e,n,i,r,o,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==r&&(a.image_.crossOrigin=r),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=o,a.size_=i,a.src_=n,a.tainted_,a}return Ks(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===ht){Hs||(Hs=it(1,1)),Hs.drawImage(this.image_,0,0);try{Hs.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Hs=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(s)},e.prototype.handleImageError_=function(){this.imageState_=ct,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=ht,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],n=it(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.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_==lt){this.imageState_=ut;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=ae(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]){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 n=e.getContext("2d");if(n.scale(t,t),n.drawImage(this.image_,0,0),n.globalCompositeOperation="multiply","multiply"===n.globalCompositeOperation||this.isTainted_())n.fillStyle=br(this.color_),n.fillRect(0,0,e.width/t,e.height/t),n.globalCompositeOperation="destination-in",n.drawImage(this.image_,0,0);else{for(var i=n.getImageData(0,0,e.width,e.height),r=i.data,o=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,l=this.color_[3],u=0,h=r.length;u<h;u+=4)r[u]*=o,r[u+1]*=s,r[u+2]*=a,r[u+3]*=l;n.putImageData(i,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(L);var Js=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const $s=function(t){function e(e){var n=this,i=e||{},r=void 0!==i.opacity?i.opacity:1,o=void 0!==i.rotation?i.rotation:0,s=void 0!==i.scale?i.scale:1,a=void 0!==i.rotateWithView&&i.rotateWithView;(n=t.call(this,{opacity:r,rotation:o,scale:s,displacement:void 0!==i.displacement?i.displacement:[0,0],rotateWithView:a})||this).anchor_=void 0!==i.anchor?i.anchor:[.5,.5],n.normalizedAnchor_=null,n.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:Us,n.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:zs,n.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:zs,n.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var l=void 0!==i.img?i.img:null,u=void 0!==i.imgSize?i.imgSize:null,h=i.src;St(!(void 0!==h&&l),4),St(!l||l&&u,5),void 0!==h&&0!==h.length||!l||(h=l.src||B(l)),St(void 0!==h&&h.length>0,6);var c=void 0!==i.src?lt:ht;return n.color_=void 0!==i.color?Tr(i.color):null,n.iconImage_=function(t,e,n,i,r,o){var s=Vs.get(e,i,o);return s||(s=new qs(t,e,n,i,r,o),Vs.set(e,i,o,s)),s}(l,h,u,n.crossOrigin_,c,n.color_),n.offset_=void 0!==i.offset?i.offset:[0,0],n.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:Us,n.origin_=null,n.size_=void 0!==i.size?i.size:null,n}return Js(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_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==zs||this.anchorYUnits_==zs){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==zs&&(t[0]*=e[0]),this.anchorYUnits_==zs&&(t[1]*=e[1])}if(this.anchorOrigin_!=Us){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Xs&&this.anchorOrigin_!=Ws||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Bs&&this.anchorOrigin_!=Ws||(t[1]=-t[1]+e[1])}var n=this.getDisplacement();return t[0]-=n[0],t[1]+=n[1],this.normalizedAnchor_=t,this.normalizedAnchor_},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_!=Us){var e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),this.offsetOrigin_!=Xs&&this.offsetOrigin_!=Ws||(t[0]=n[0]-e[0]-t[0]),this.offsetOrigin_!=Bs&&this.offsetOrigin_!=Ws||(t[1]=n[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(s,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(s,t)},e}(xr);var Qs=.5;var ta={Point:function(t,e,n,i,r){var o,s=n.getImage(),a=n.getText();r&&(t=r,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=ht)return;var l=t.getBuilder(n.getZIndex(),rs);l.setImageStyle(s,o),l.drawPoint(e,i)}if(a&&a.getText()){var u=t.getBuilder(n.getZIndex(),as);u.setTextStyle(a,o),u.drawText(e,i)}},LineString:function(t,e,n,i,r){var o=n.getStroke();if(o){var s=t.getBuilder(n.getZIndex(),os);s.setFillStrokeStyle(null,o),s.drawLineString(e,i)}var a=n.getText();if(a&&a.getText()){var l=(r||t).getBuilder(n.getZIndex(),as);l.setTextStyle(a),l.drawText(e,i)}},Polygon:function(t,e,n,i,r){var o=n.getFill(),s=n.getStroke();if(o||s){var a=t.getBuilder(n.getZIndex(),ss);a.setFillStrokeStyle(o,s),a.drawPolygon(e,i)}var l=n.getText();if(l&&l.getText()){var u=(r||t).getBuilder(n.getZIndex(),as);u.setTextStyle(l),u.drawText(e,i)}},MultiPoint:function(t,e,n,i,r){var o,s=n.getImage(),a=n.getText();r&&(t=r,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=ht)return;var l=t.getBuilder(n.getZIndex(),rs);l.setImageStyle(s,o),l.drawMultiPoint(e,i)}if(a&&a.getText()){var u=(r||t).getBuilder(n.getZIndex(),as);u.setTextStyle(a,o),u.drawText(e,i)}},MultiLineString:function(t,e,n,i,r){var o=n.getStroke();if(o){var s=t.getBuilder(n.getZIndex(),os);s.setFillStrokeStyle(null,o),s.drawMultiLineString(e,i)}var a=n.getText();if(a&&a.getText()){var l=(r||t).getBuilder(n.getZIndex(),as);l.setTextStyle(a),l.drawText(e,i)}},MultiPolygon:function(t,e,n,i,r){var o=n.getFill(),s=n.getStroke();if(s||o){var a=t.getBuilder(n.getZIndex(),ss);a.setFillStrokeStyle(o,s),a.drawMultiPolygon(e,i)}var l=n.getText();if(l&&l.getText()){var u=(r||t).getBuilder(n.getZIndex(),as);u.setTextStyle(l),u.drawText(e,i)}},GeometryCollection:function(t,e,n,i,r){var o,s,a=e.getGeometriesArray();for(o=0,s=a.length;o<s;++o){(0,ta[a[o].getType()])(t,a[o],n,i,r)}},Circle:function(t,e,n,i,r){var o=n.getFill(),s=n.getStroke();if(o||s){var a=t.getBuilder(n.getZIndex(),ns);a.setFillStrokeStyle(o,s),a.drawCircle(e,i)}var l=n.getText();if(l&&l.getText()){var u=(r||t).getBuilder(n.getZIndex(),as);u.setTextStyle(l),u.drawText(e,i)}}};function ea(t,e){return parseInt(B(t),10)-parseInt(B(e),10)}function na(t,e){return.5*t/e}function ia(t,e,n,i,r,o,s){var a=!1,l=n.getImage();if(l){var u=l.getImageState();u==ht||u==ct?l.unlistenImageChange(r):(u==lt&&l.load(),u=l.getImageState(),l.listenImageChange(r),a=!0)}return function(t,e,n,i,r,o){var s=n.getGeometryFunction()(e);if(!s)return;var a=s.simplifyTransformed(i,r);if(n.getRenderer())ra(t,a,n,e);else{(0,ta[a.getType()])(t,a,n,e,o)}}(t,e,n,i,o,s),a}function ra(t,e,n,i){if(e.getType()!=Fo)t.getBuilder(n.getZIndex(),is).drawCustom(e,i,n.getRenderer());else for(var r=e.getGeometries(),o=0,s=r.length;o<s;++o)ra(t,r[o],n,i)}function oa(t,e){for(var n=!0,i=t.length-1;i>=0;--i)if(t[i]!=e[i]){n=!1;break}return n}function sa(t,e){var n=Math.cos(e),i=Math.sin(e),r=t[0]*n-t[1]*i,o=t[1]*n+t[0]*i;return t[0]=r,t[1]=o,t}function aa(t,e){if(e.canWrapX()){var n=Qt(e.getExtent()),i=function(t,e,n){var i=e.getExtent(),r=0;if(e.canWrapX()&&(t[0]<i[0]||t[0]>i[2])){var o=n||Qt(i);r=Math.floor((t[0]-i[0])/o)}return r}(t,e,n);i&&(t[0]-=i*n)}return t}var la=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const ua=function(t){function e(e){var n=t.call(this,e)||this;return n.boundHandleStyleImageChange_=n.handleStyleImageChange_.bind(n),n.animatingOrInteracting_,n.dirty_=!1,n.hitDetectionImageData_=null,n.renderedFeatures_=null,n.renderedRevision_=-1,n.renderedResolution_=NaN,n.renderedExtent_=[1/0,1/0,-1/0,-1/0],n.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],n.renderedRotation_,n.renderedCenter_=null,n.renderedProjection_=null,n.renderedRenderOrder_=null,n.replayGroup_=null,n.replayGroupChanged=!0,n.declutterExecutorGroup=null,n.clipping=!0,n}return la(e,t),e.prototype.useContainer=function(e,n,i){i<1&&(e=null),t.prototype.useContainer.call(this,e,n,i)},e.prototype.renderWorlds=function(t,e,n){var i=e.extent,r=e.viewState,o=r.center,s=r.resolution,a=r.projection,l=r.rotation,u=a.getExtent(),h=this.getLayer().getSource(),c=e.pixelRatio,p=e.viewHints,f=!(p[Es]||p[Ts]),d=this.context,g=Math.round(e.size[0]*c),_=Math.round(e.size[1]*c),y=h.getWrapX()&&a.canWrapX(),v=y?Qt(u):null,m=y?Math.ceil((i[2]-u[2])/v)+1:1,x=y?Math.floor((i[0]-u[0])/v):0;do{var w=this.getRenderTransform(o,s,l,c,g,_,x*v);t.execute(d,1,w,l,f,void 0,n)}while(++x<m)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var n=t.pixelRatio,i=t.layerStatesArray[t.layerIndex];!function(t,e,n){Ui(t,e,0,0,n,0,0)}(this.pixelTransform,1/n,1/n),Zi(this.inversePixelTransform,this.pixelTransform);var r=Vi(this.pixelTransform);this.useContainer(e,r,i.opacity);var o=this.context,s=o.canvas,a=this.replayGroup_,l=this.declutterExecutorGroup;if((!a||a.isEmpty())&&(!l||l.isEmpty()))return!this.containerReused&&s.width>0&&(s.width=0),this.container;var u=Math.round(t.size[0]*n),h=Math.round(t.size[1]*n);s.width!=u||s.height!=h?(s.width=u,s.height=h,s.style.transform!==r&&(s.style.transform=r)):this.containerReused||o.clearRect(0,0,u,h),this.preRender(o,t);var c=t.viewState,p=c.projection,f=!1,d=!0;if(i.extent&&this.clipping){var g=cn(i.extent,p);(f=(d=te(g,t.extent))&&!It(g,t.extent))&&this.clipUnrotated(o,t,g)}d&&this.renderWorlds(a,t),f&&o.restore(),this.postRender(o,t);var _=i.opacity,y=this.container;return _!==parseFloat(y.style.opacity)&&(y.style.opacity=1===_?"":String(_)),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 n=[this.context.canvas.width,this.context.canvas.height];Xi(this.pixelTransform,n);var i=this.renderedCenter_,r=this.renderedResolution_,o=this.renderedRotation_,s=this.renderedProjection_,a=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],h=n[0]*Qs,c=n[1]*Qs;u.push(this.getRenderTransform(i,r,o,Qs,h,c,0).slice());var p=l.getSource(),f=s.getExtent();if(p.getWrapX()&&s.canWrapX()&&!It(f,a)){for(var d=a[0],g=Qt(f),_=0,y=void 0;d<f[0];)y=g*--_,u.push(this.getRenderTransform(i,r,o,Qs,h,c,y).slice()),d+=g;for(_=0,d=a[2];d>f[2];)y=g*++_,u.push(this.getRenderTransform(i,r,o,Qs,h,c,y).slice()),d-=g}this.hitDetectionImageData_=function(t,e,n,i,r,o,s){var a=it(t[0]*Qs,t[1]*Qs);a.imageSmoothingEnabled=!1;for(var l=a.canvas,u=new Gs(a,Qs,r,null,s),h=n.length,c=Math.floor(16777215/h),p={},f=1;f<=h;++f){var d=n[f-1],g=d.getStyleFunction()||i;if(i){var _=g(d,o);if(_){Array.isArray(_)||(_=[_]);for(var y="#"+("000000"+(f*c).toString(16)).slice(-6),v=0,x=_.length;v<x;++v){var w=_[v],C=w.getGeometryFunction()(d);if(C&&te(r,C.getExtent())){var b=w.clone(),S=b.getFill();S&&S.setColor(y);var E=b.getStroke();E&&(E.setColor(y),E.setLineDash(null)),b.setText(void 0);var T=w.getImage();if(T&&0!==T.getOpacity()){var O=T.getImageSize();if(!O)continue;var R=it(O[0],O[1],void 0,{alpha:!1}),P=R.canvas;R.fillStyle=y,R.fillRect(0,0,P.width,P.height),b.setImage(new $s({img:P,imgSize:O,anchor:T.getAnchor(),anchorXUnits:Ns,anchorYUnits:Ns,offset:T.getOrigin(),opacity:1,size:T.getSize(),scale:T.getScale(),rotation:T.getRotation(),rotateWithView:T.getRotateWithView()}))}var I=b.getZIndex()||0;(L=p[I])||(L={},p[I]=L,L[Oo]=[],L[Mo]=[],L[Eo]=[],L[So]=[]),L[C.getType().replace("Multi","")].push(C,b)}}}}}for(var F=Object.keys(p).map(Number).sort(m),M=(f=0,F.length);f<M;++f){var L=p[F[f]];for(var A in L){var j=L[A];for(v=0,x=j.length;v<x;v+=2){u.setStyle(j[v+1]);for(var D=0,k=e.length;D<k;++D)u.setTransform(e[D]),u.drawGeometry(j[v])}}}return a.getImageData(0,0,l.width,l.height)}(n,u,this.renderedFeatures_,l.getStyleFunction(),a,r,o)}e(function(t,e,n){var i=[];if(n){var r=Math.floor(Math.round(t[0])*Qs),o=Math.floor(Math.round(t[1])*Qs),s=4*(de(r,0,n.width-1)+de(o,0,n.height-1)*n.width),a=n.data[s],l=n.data[s+1],u=n.data[s+2]+256*(l+256*a),h=Math.floor(16777215/e.length);u&&u%h==0&&i.push(e[u/h-1])}return i}(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,r){var o=this;if(this.replayGroup_){var s,a=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),h={},c=function(t,e,n){var o=B(t),s=h[o];if(s){if(!0!==s&&n<s.distanceSq){if(0===n)return h[o]=!0,r.splice(r.lastIndexOf(s),1),i(t,u,e);s.geometry=e,s.distanceSq=n}}else{if(0===n)return h[o]=!0,i(t,u,e);r.push(h[o]={feature:t,layer:u,geometry:e,distanceSq:n,callback:i})}},p=[this.replayGroup_];return this.declutterExecutorGroup&&p.push(this.declutterExecutorGroup),p.some((function(i){return s=i.forEachFeatureAtCoordinate(t,a,l,n,c,i===o.declutterExecutorGroup?e.declutterTree.all().map((function(t){return t.value})):null)})),s}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),n=e.getSource();if(!n)return!1;var i=t.viewHints[Es],r=t.viewHints[Ts],o=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&i||!s&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var a=t.extent,l=t.viewState,u=l.projection,h=l.resolution,c=t.pixelRatio,p=e.getRevision(),f=e.getRenderBuffer(),d=e.getRenderOrder();void 0===d&&(d=ea);var g=l.center.slice(),_=Tt(a,f*h),y=_.slice(),v=[_.slice()],m=u.getExtent();if(n.getWrapX()&&u.canWrapX()&&!It(m,t.extent)){var x=Qt(m),w=Math.max(Qt(_)/2,x);_[0]=m[0]-w,_[2]=m[2]+w,aa(g,u);var C=function(t,e){var n=e.getExtent(),i=Zt(t);if(e.canWrapX()&&(i[0]<n[0]||i[0]>=n[2])){var r=Qt(n),o=Math.floor((i[0]-n[0])/r)*r;t[0]-=o,t[2]-=o}return t}(v[0],u);C[0]<m[0]&&C[2]<m[2]?v.push([C[0]+x,C[1],C[2]+x,C[3]]):C[0]>m[0]&&C[2]>m[2]&&v.push([C[0]-x,C[1],C[2]-x,C[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&It(this.wrappedRenderedExtent_,_))return b(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=g,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var S,E=new es(na(h,c),_,h,c);this.getLayer().getDeclutter()&&(S=new es(na(h,c),_,h,c));var T,O=an();if(O){for(var R=0,P=v.length;R<P;++R)n.loadFeatures(hn(v[R],u),h,O);T=$e(O,u)}else for(R=0,P=v.length;R<P;++R)n.loadFeatures(v[R],h,u);var I=function(t,e){var n=na(t,e);return n*n}(h,c),F=function(t){var n,i=t.getStyleFunction()||e.getStyleFunction();if(i&&(n=i(t,h)),n){var r=this.renderFeature(t,I,n,E,T,S);this.dirty_=this.dirty_||r}}.bind(this),M=hn(_,u),L=n.getFeaturesInExtent(M);d&&L.sort(d);for(R=0,P=L.length;R<P;++R)F(L[R]);this.renderedFeatures_=L;var A=E.finish(),j=new Ss(_,h,c,n.getOverlaps(),A,e.getRenderBuffer());return S&&(this.declutterExecutorGroup=new Ss(_,h,c,n.getOverlaps(),S.finish(),e.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=d,this.renderedExtent_=y,this.wrappedRenderedExtent_=_,this.renderedCenter_=g,this.renderedProjection_=u,this.replayGroup_=j,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,n,i,r,o){if(!n)return!1;var s=!1;if(Array.isArray(n))for(var a=0,l=n.length;a<l;++a)s=ia(i,t,n[a],e,this.boundHandleStyleImageChange_,r,o)||s;else s=ia(i,t,n,e,this.boundHandleStyleImageChange_,r,o);return s},e}(Hi);var ha=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const ca=function(t){function e(e){return t.call(this,e)||this}return ha(e,t),e.prototype.createRenderer=function(){return new ua(this)},e}(yo),pa="add",fa="remove";var da=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ga="length",_a=function(t){function e(e,n,i){var r=t.call(this,e)||this;return r.element=n,r.index=i,r}return da(e,t),e}(v);const ya=function(t){function e(e,n){var i=t.call(this)||this;i.on,i.once,i.un;var r=n||{};if(i.unique_=!!r.unique,i.array_=e||[],i.unique_)for(var o=0,s=i.array_.length;o<s;++o)i.assertUnique_(i.array_[o],o);return i.updateLength_(),i}return da(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,n=t.length;e<n;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,n=0,i=e.length;n<i;++n)t(e[n],n,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(ga)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new _a(pa,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_,n=0,i=e.length;n<i;++n)if(e[n]===t)return this.removeAt(n)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new _a(fa,e,t)),e},e.prototype.setAt=function(t,e){var n=this.getLength();if(t<n){this.unique_&&this.assertUnique_(e,t);var i=this.array_[t];this.array_[t]=e,this.dispatchEvent(new _a(fa,i,t)),this.dispatchEvent(new _a(pa,e,t))}else{for(var r=n;r<t;++r)this.insertAt(r,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(ga,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var n=0,i=this.array_.length;n<i;++n)if(this.array_[n]===t&&n!==e)throw new bt(58)},e}(Dn);const va=function(){function t(t){this.rbush_=new mr(t),this.items_={}}return t.prototype.insert=function(t,e){var n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(n),this.items_[B(e)]=n},t.prototype.load=function(t,e){for(var n=new Array(e.length),i=0,r=e.length;i<r;i++){var o=t[i],s=e[i],a={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:s};n[i]=a,this.items_[B(s)]=a}this.rbush_.load(n)},t.prototype.remove=function(t){var e=B(t),n=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(n)},t.prototype.update=function(t,e){var n=this.items_[B(e)];kt([n.minX,n.minY,n.maxX,n.maxY],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 n,i=0,r=t.length;i<r;i++)if(n=e(t[i]))return n;return n},t.prototype.isEmpty=function(){return I(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return At(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}(),ma="addfeature",xa="changefeature",wa="clear",Ca="removefeature",ba="featuresloadstart",Sa="featuresloadend",Ea="featuresloaderror";function Ta(t,e){return[[-1/0,-1/0,1/0,1/0]]}const Oa="arraybuffer",Ra="json",Pa="text",Ia="xml";var Fa=!1;function Ma(t,e){return function(n,i,r,o,s){var a=this;!function(t,e,n,i,r,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(n,i,r):t,!0),e.getType()==Oa&&(a.responseType="arraybuffer"),a.withCredentials=Fa,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var i=e.getType(),l=void 0;i==Ra||i==Pa?l=a.responseText:i==Ia?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):i==Oa&&(l=a.response),l?o(e.readFeatures(l,{extent:n,featureProjection:r}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}(t,e,n,i,r,(function(t,e){a.addFeatures(t),void 0!==o&&o(t)}),s||T)}}var La=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Aa=function(t){function e(e,n,i){var r=t.call(this,e)||this;return r.feature=n,r.features=i,r}return La(e,t),e}(v);const ja=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,{attributions:i.attributions,projection:void 0,state:Gn,wrapX:void 0===i.wrapX||i.wrapX})||this).on,n.once,n.un,n.loader_=T,n.format_=i.format,n.overlaps_=void 0===i.overlaps||i.overlaps,n.url_=i.url,void 0!==i.loader?n.loader_=i.loader:void 0!==n.url_&&(St(n.format_,7),n.loader_=Ma(n.url_,n.format_)),n.strategy_=void 0!==i.strategy?i.strategy:Ta;var r,o,s=void 0===i.useSpatialIndex||i.useSpatialIndex;return n.featuresRtree_=s?new va:null,n.loadedExtentsRtree_=new va,n.loadingExtentsCount_=0,n.nullGeometryFeatures_={},n.idIndex_={},n.uidIndex_={},n.featureChangeKeys_={},n.featuresCollection_=null,Array.isArray(i.features)?o=i.features:i.features&&(o=(r=i.features).getArray()),s||void 0!==r||(r=new ya(o)),void 0!==o&&n.addFeaturesInternal(o),void 0!==r&&n.bindFeaturesCollection_(r),n}return La(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=B(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var n=t.getGeometry();if(n){var i=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(i,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Aa(ma,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[ie(e,s,this.handleFeatureChange_,this),ie(e,In,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var n=!0,i=e.getId();return void 0!==i&&(i.toString()in this.idIndex_?n=!1:this.idIndex_[i.toString()]=e),n&&(St(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),n},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],n=[],i=[],r=0,o=t.length;r<o;r++){var s=B(l=t[r]);this.addToIndex_(s,l)&&n.push(l)}r=0;for(var a=n.length;r<a;r++){var l;s=B(l=n[r]);this.setupChangeEvents_(s,l);var u=l.getGeometry();if(u){var h=u.getExtent();e.push(h),i.push(l)}else this.nullGeometryFeatures_[s]=l}this.featuresRtree_&&this.featuresRtree_.load(e,i);r=0;for(var c=n.length;r<c;r++)this.dispatchEvent(new Aa(ma,n[r]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(ma,(function(n){e||(e=!0,t.push(n.feature),e=!1)})),this.addEventListener(Ca,(function(n){e||(e=!0,t.remove(n.feature),e=!1)})),t.addEventListener(pa,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(fa,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(oe)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var n in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var i=new Aa(wa);this.dispatchEvent(i),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 n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,(function(n){return n.getGeometry().intersectsCoordinate(t)?e(n):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(n){if(n.getGeometry().intersectsExtent(t)){var i=e(n);if(i)return i}}))},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(),I(this.nullGeometryFeatures_)||C(t,P(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 n=t[0],i=t[1],r=null,o=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],l=e||S;return this.featuresRtree_.forEachInExtent(a,(function(t){if(l(t)){var e=t.getGeometry(),u=s;if((s=e.closestPointXY(n,i,o,s))<u){r=t;var h=Math.sqrt(s);a[0]=n-h,a[1]=i-h,a[2]=n+h,a[3]=i+h}}})),r},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,n=B(e),i=e.getGeometry();if(i){var r=i.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(r,e)):this.featuresRtree_&&this.featuresRtree_.update(r,e)}else n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);var o=e.getId();if(void 0!==o){var s=o.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new Aa(xa,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:B(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&I(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,n){for(var i=this.loadedExtentsRtree_,r=this.strategy_(t,e),o=function(t,o){var a=r[t];i.forEachInExtent(a,(function(t){return It(t.extent,a)}))||(++s.loadingExtentsCount_,s.dispatchEvent(new Aa(ba)),s.loader_.call(s,a,e,n,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Aa(Sa,void 0,t))}.bind(s),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Aa(Ea))}.bind(s)),i.insert(a,{extent:a.slice()}))},s=this,a=0,l=r.length;a<l;++a)o(a);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,n=this.loadedExtentsRtree_;n.forEachInExtent(t,(function(n){if(kt(n.extent,t))return e=n,!0})),e&&n.remove(e)},e.prototype.removeFeature=function(t){var e=B(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=B(t);this.featureChangeKeys_[e].forEach(oe),delete this.featureChangeKeys_[e];var n=t.getId();void 0!==n&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Aa(Ca,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var n in this.idIndex_)if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){St(this.format_,7),this.url_=t,this.setLoader(Ma(t,this.format_))},e}(Bn);var Da=n("./node_modules/tinycolor2/tinycolor.js"),ka=n.n(Da);function Ga(t,e,n,i){for(var r=0,o=n.length;r<o;++r)for(var s=n[r],a=0;a<i;++a)t[e++]=s[a];return e}function za(t,e,n,i,r){for(var o=r||[],s=0,a=0,l=n.length;a<l;++a){var u=Ga(t,e,n[a],i);o[s++]=u,e=u}return o.length=s,o}var Na=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Ba=function(t){function e(e,n){var i=t.call(this)||this;return i.setCoordinates(e,n),i}return Na(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,i){var r=this.flatCoordinates,o=ve(t,e,r[0],r[1]);if(o<i){for(var s=this.stride,a=0;a<s;++a)n[a]=r[a];return n.length=s,o}return i},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return e=this.flatCoordinates,n=t,i=e[0],r=e[1],At(i,r,i,r,n);var e,n,i,r},e.prototype.getType=function(){return So},e.prototype.intersectsExtent=function(t){return Ft(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=function(t,e,n,i){for(var r=0,o=n.length;r<o;++r)t[e++]=n[r];return e}(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ds);var Wa=n("./packages/grafana-runtime/src/index.ts");function Ua(t,e){if(Array.isArray(e)){const n=e[0];if(n.latitude&&n.longitude&&(n.key||n.keys))return function(t,e){let n=0;const i=new Map;for(const t of e){const e={coords:[t.longitude,t.latitude]};if(t.name&&(i.set(t.name,e),i.set(t.name.toUpperCase(),e),e.props={name:t.name}),t.key&&(i.set(t.key,e),i.set(t.key.toUpperCase(),e)),t.keys)for(const n of t.keys)i.set(n,e),i.set(n.toUpperCase(),e);n++}return{path:t,find:t=>{let e=i.get(t);return e||(e=i.get(t.toUpperCase())),e},count:n,examples:t=>{const e=[];if(i.size<1)e.push("no values found");else for(const n of i.keys())if(e.push(n),e.length>=t)break;return e}}}(t,e)}return{path:t,error:"Unable to parse locations",find:t=>{},examples:t=>[]}}const Xa={},Ya="public/gazetteer/countries.json";async function Za(t){t||(t=Ya);let e=Xa[t];if(!e){try{e=Ua(t,await(0,Wa.getBackendSrv)().get(t))}catch(n){console.warn("Error loading placename lookup",t,n),e={path:t,error:"Error loading URL",find:t=>{},examples:t=>[]}}Xa[t]=e}return e}function Va(t){if(null==t||!t.length)return;const e=[16,8,4,2,1];let n=!0;const i=[],r=[];let o;i[0]=-90,i[1]=90,r[0]=-180,r[1]=180,t.split("").forEach((t=>{o="0123456789bcdefghjkmnpqrstuvwxyz".indexOf(t),e.forEach((t=>{Ka(n?r:i,o,t),n=!n}))}));const s=(i[0]+i[1])/2;return[(r[0]+r[1])/2,s]}function Ka(t,e,n){e&n?t[0]=(t[0]+t[1])/2:t[1]=(t[0]+t[1])/2}function Ha(t){return e=>{for(const n of e.fields)if(t(n,e,[]))return n}}function qa(t){return e=>{for(const n of e.fields){if(t.has(n.name.toLowerCase()))return n;const r=(0,i.getFieldDisplayName)(n,e);if(t.has(r))return n}}}const Ja={mode:i.FrameGeometrySourceMode.Auto,geohash:qa(new Set(["geohash"])),latitude:qa(new Set(["latitude","lat"])),longitude:qa(new Set(["longitude","lon","lng"])),h3:qa(new Set(["h3"])),wkt:qa(new Set(["wkt"])),lookup:qa(new Set(["lookup"]))};async function $a(t){var e;const n=Object.assign({},Ja,{mode:null!==(e=null==t?void 0:t.mode)&&void 0!==e?e:i.FrameGeometrySourceMode.Auto});switch(n.mode){case i.FrameGeometrySourceMode.Geohash:null!=t&&t.geohash&&(n.geohash=Ha((0,i.getFieldMatcher)({id:i.FieldMatcherID.byName,options:t.geohash})));break;case i.FrameGeometrySourceMode.Lookup:null!=t&&t.lookup&&(n.lookup=Ha((0,i.getFieldMatcher)({id:i.FieldMatcherID.byName,options:t.lookup}))),n.gazetteer=await Za(null==t?void 0:t.gazetteer);break;case i.FrameGeometrySourceMode.Coords:null!=t&&t.latitude&&(n.latitude=Ha((0,i.getFieldMatcher)({id:i.FieldMatcherID.byName,options:t.latitude}))),null!=t&&t.longitude&&(n.longitude=Ha((0,i.getFieldMatcher)({id:i.FieldMatcherID.byName,options:t.longitude})))}return n}function Qa(t,e){const n={points:[]};if(null==t||!t.length)return n;const r=function(t,e){var n;const r={mode:null!==(n=e.mode)&&void 0!==n?n:i.FrameGeometrySourceMode.Auto};if(r.mode===i.FrameGeometrySourceMode.Auto){if(r.latitude=e.latitude(t),r.longitude=e.longitude(t),r.latitude&&r.longitude)return r.mode=i.FrameGeometrySourceMode.Coords,r;if(r.geohash=e.geohash(t),r.geohash)return r.mode=i.FrameGeometrySourceMode.Geohash,r;if(r.lookup=e.geohash(t),r.lookup)return r.mode=i.FrameGeometrySourceMode.Lookup,r}switch(r.mode){case i.FrameGeometrySourceMode.Coords:r.latitude=e.latitude(t),r.longitude=e.longitude(t);break;case i.FrameGeometrySourceMode.Geohash:r.geohash=e.geohash(t);break;case i.FrameGeometrySourceMode.Lookup:r.lookup=e.lookup(t)}return r}(t,e);switch(r.mode){case i.FrameGeometrySourceMode.Coords:r.latitude&&r.longitude?n.points=function(t,e){const n=e.values.length,i=new Array(n);for(let r=0;r<n;r++)i[r]=new Ba(He([t.values.get(r),e.values.get(r)]));return i}(r.longitude,r.latitude):n.warning="Missing latitude/longitude fields";break;case i.FrameGeometrySourceMode.Geohash:r.geohash?n.points=function(t){const e=t.values.length,n=new Array(e);for(let i=0;i<e;i++){const e=Va(t.values.get(i));e&&(n[i]=new Ba(He(e)))}return n}(r.geohash):n.warning="Missing geohash field";break;case i.FrameGeometrySourceMode.Lookup:r.lookup?e.gazetteer?n.points=function(t,e){const n=e.values.length,i=new Array(n);for(let r=0;r<n;r++){const n=t.find(e.values.get(r));null!=n&&n.coords&&(i[r]=new Ba(He(n.coords)))}return i}(e.gazetteer,r.lookup):n.warning="Gazetteer not found":n.warning="Missing lookup field";break;case i.FrameGeometrySourceMode.Auto:n.warning="Unable to find location fields"}return n}var tl=n("./public/app/features/dimensions/index.ts"),el=n("./public/app/features/dimensions/editors/index.ts"),nl=n("./node_modules/react/jsx-runtime.js");class il extends r.Component{constructor(t){var e,n,i;super(t),i=void 0,(n="sub")in(e=this)?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,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,nl.jsx)(this.props.child,Object.assign({},t))}}var rl,ol=n("./node_modules/@emotion/css/dist/emotion-css.esm.js"),sl=n("./public/app/plugins/panel/state-timeline/utils.ts"),al=n("./packages/grafana-data/src/field/scale.ts");function ll(t){var e,n;const{color:r}=t,s=(0,o.useTheme2)();if(!r||!r.field&&r.fixed)return(0,nl.jsx)(nl.Fragment,{});const a=ul(s),l=t=>`${(0,i.formattedValueToString)(r.field.display(t))}`,u=(0,i.getFieldColorModeForField)(r.field);if(u.isContinuous&&u.getColors){var h;const t=u.getColors(or.vc.theme2),e=(0,al.dz)(r.field);return(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)(o.Label,{children:null==r||null===(h=r.field)||void 0===h?void 0:h.name}),(0,nl.jsxs)("div",{className:a.gradientContainer,style:{backgroundImage:`linear-gradient(to right, ${t.map((t=>t)).join(", ")}`},children:[(0,nl.jsx)("div",{style:{color:s.colors.getContrastText(t[0])},children:l(e.min)}),(0,nl.jsx)("div",{style:{color:s.colors.getContrastText(t[t.length-1])},children:l(e.max)})]})]})}const c=null===(e=r.field)||void 0===e||null===(n=e.config)||void 0===n?void 0:n.thresholds;if(!c||c.steps.length<2)return rl||(rl=(0,nl.jsx)("div",{}));const p=(0,sl.Ur)(r.field.config,or.vc.theme2);return(0,nl.jsx)("div",{className:a.infoWrap,children:(0,nl.jsx)("div",{className:a.legend,children:p.map(((t,e)=>(0,nl.jsxs)("div",{className:a.legendItem,children:[(0,nl.jsx)("i",{style:{background:t.color}}),t.label]},`${e}/${t.label}`)))})})}const ul=(0,o.stylesFactory)((t=>({infoWrap:ol.css`
    background: ${t.colors.background.secondary};
    border-radius: 2px;
    padding: ${t.spacing(1)};
  `,legend:ol.css`
    line-height: 18px;
    display: flex;
    flex-direction: column;
    font-size: ${t.typography.bodySmall.fontSize};

    i {
      width: 18px;
      height: 18px;
      float: left;
      margin-right: 8px;
      opacity: 0.7;
    }
  `,legendItem:ol.css`
    white-space: nowrap;
  `,gradientContainer:ol.css`
    min-width: 200px;
    display: flex;
    justify-content: space-between;
    font-size: ${t.typography.bodySmall.fontSize};
    padding: ${t.spacing(0,.5)};
  `}))),hl={id:"circle",name:"Circle",hasFill:!0,make:(t,e,n)=>new fo({image:new so({stroke:new lo({color:t}),fill:new ao({color:e}),radius:n})})},cl=new i.Registry((()=>[hl,{id:"square",name:"Square",hasFill:!0,make:(t,e,n)=>new fo({image:new ro({fill:new ao({color:e}),stroke:new lo({color:t,width:1}),points:4,radius:n,angle:Math.PI/4})})},{id:"triangle",name:"Triangle",hasFill:!0,make:(t,e,n)=>new fo({image:new ro({fill:new ao({color:e}),stroke:new lo({color:t,width:1}),points:3,radius:n,rotation:Math.PI/4,angle:0})})},{id:"star",name:"Star",hasFill:!0,make:(t,e,n)=>new fo({image:new ro({fill:new ao({color:e}),stroke:new lo({color:t,width:1}),points:5,radius:n,radius2:.4*n,angle:0})})},{id:"cross",name:"Cross",hasFill:!1,make:(t,e,n)=>new fo({image:new ro({fill:new ao({color:e}),stroke:new lo({color:t,width:1}),points:4,radius:n,radius2:0,angle:0})})},{id:"x",name:"X",hasFill:!1,make:(t,e,n)=>new fo({image:new ro({fill:new ao({color:e}),stroke:new lo({color:t,width:1}),points:4,radius:n,radius2:0,angle:Math.PI/4})})}]));var pl=n("./node_modules/rxjs/dist/esm5/internal/ReplaySubject.js");const fl={size:{fixed:5,min:2,max:15},color:{fixed:"dark-green"},fillOpacity:.4,shape:"circle",showLegend:!0},dl="markers",gl={type:dl,config:fl,location:{mode:i.FrameGeometrySourceMode.Auto}},_l={id:dl,name:"Markers",description:"use markers to render each data point",isBaseMap:!1,showLocation:!0,create:async(t,e,n)=>{var i;const r=await $a(e.location),o=new ca({}),s=Object.assign({},fl,null==e?void 0:e.config),a=new pl.t(1);let l=null;s.showLegend&&(l=(0,nl.jsx)(il,{watch:a,initialSubProps:{},child:ll}));const u=null!==(i=cl.getIfExists(s.shape))&&void 0!==i?i:hl;return{init:()=>o,legend:l,update:t=>{var i;if(null===(i=t.series)||void 0===i||!i.length)return;const h=[];for(const i of t.series){var c,p;const t=Qa(i,r);if(t.warning){console.log("Could not find locations",t.warning);continue}const o=(0,tl.PX)(i,s.color,n),f=(0,tl.W8)(i,s.size),d=null!==(c=null===(p=e.config)||void 0===p?void 0:p.fillOpacity)&&void 0!==c?c:fl.fillOpacity;for(let e=0;e<i.length;e++){const n=o.get(e),r=ka()(n).setAlpha(d).toRgbString(),s=f.get(e),a=new vr(t.points[e]);a.setProperties({frame:i,rowIndex:e}),a.setStyle(u.make(n,r,s)),h.push(a)}l&&a.next({color:o,size:f});break}const f=new ja({features:h});o.setSource(f)}}},registerOptionsUI:t=>{t.addCustomEditor({id:"config.color",path:"config.color",name:"Marker Color",editor:el.Lm,settings:{},defaultValue:{fixed:"grey"}}).addCustomEditor({id:"config.size",path:"config.size",name:"Marker Size",editor:el.cL,settings:{min:1,max:100},defaultValue:{fixed:5,min:1,max:20}}).addSelect({path:"config.shape",name:"Marker Shape",settings:{options:cl.selectOptions().options},defaultValue:"circle"}).addSliderInput({path:"config.fillOpacity",name:"Fill opacity",defaultValue:fl.fillOpacity,settings:{min:0,max:1,step:.1},showIf:t=>{var e,n;return null===(e=cl.getIfExists(null===(n=t.config)||void 0===n?void 0:n.shape))||void 0===e?void 0:e.hasFill}}).addBooleanSwitch({path:"config.showLegend",name:"Show legend",description:"Show legend",defaultValue:fl.showLegend})},defaultOptions:fl};var yl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function vl(t){for(var e=[],n=0,i=t.length;n<i;++n)e.push(t[n].clone());return e}const ml=function(t){function e(e){var n=t.call(this)||this;return n.geometries_=e||null,n.changeEventsKeys_=[],n.listenGeometriesChange_(),n}return yl(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(oe),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(ie(this.geometries_[t],s,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,i){if(i<Rt(this.getExtent(),t,e))return i;for(var r=this.geometries_,o=0,s=r.length;o<s;++o)i=r[o].closestPointXY(t,e,n,i);return i},e.prototype.containsXY=function(t,e){for(var n=this.geometries_,i=0,r=n.length;i<r;++i)if(n[i].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){jt(t);for(var e=this.geometries_,n=0,i=e.length;n<i;++n)Gt(t,e[n].getExtent());return t},e.prototype.getGeometries=function(){return vl(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,n=0,i=e.length;n<i;++n)e[n].getType()===this.getType()?t=t.concat(e[n].getGeometriesArrayRecursive()):t.push(e[n]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var n=[],i=this.geometries_,r=!1,o=0,s=i.length;o<s;++o){var a=i[o],l=a.getSimplifiedGeometry(t);n.push(l),l!==a&&(r=!0)}if(r){var u=new e(null);return u.setGeometriesArray(n),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return Fo},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,n=0,i=e.length;n<i;++n)if(e[n].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var n=this.geometries_,i=0,r=n.length;i<r;++i)n[i].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,n){var i=n;i||(i=Zt(this.getExtent()));for(var r=this.geometries_,o=0,s=r.length;o<s;++o)r[o].scale(t,e,i);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(vl(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,n=0,i=e.length;n<i;++n)e[n].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var n=this.geometries_,i=0,r=n.length;i<r;++i)n[i].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Ps);const xl=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var n;if(e){var i=e.dataProjection?Ye(e.dataProjection):this.readProjection(t);e.extent&&i&&i.getUnits()===pe.TILE_PIXELS&&(i=Ye(i)).setWorldExtent(e.extent),n={dataProjection:i,featureProjection:e.featureProjection}}return this.adaptOptions(n)},t.prototype.adaptOptions=function(t){return O({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return z()},t.prototype.readFeature=function(t,e){return z()},t.prototype.readFeatures=function(t,e){return z()},t.prototype.readGeometry=function(t,e){return z()},t.prototype.readProjection=function(t){return z()},t.prototype.writeFeature=function(t,e){return z()},t.prototype.writeFeatures=function(t,e){return z()},t.prototype.writeGeometry=function(t,e){return z()},t}();function wl(t,e,n){var i,r=n?Ye(n.featureProjection):null,o=n?Ye(n.dataProjection):null;if(i=r&&o&&!Je(r,o)?(e?t.clone():t).transform(e?r:o,e?o:r):t,e&&n&&void 0!==n.decimals){var s=Math.pow(10,n.decimals);i===t&&(i=t.clone()),i.applyTransform((function(t){for(var e=0,n=t.length;e<n;++e)t[e]=Math.round(t[e]*s)/s;return t}))}return i}var Cl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function bl(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}const Sl=function(t){function e(){return t.call(this)||this}return Cl(e,t),e.prototype.getType=function(){return Ra},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(bl(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(bl(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return z()},e.prototype.readFeaturesFromObject=function(t,e){return z()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(bl(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return z()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(bl(t))},e.prototype.readProjectionFromObject=function(t){return z()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return z()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return z()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return z()},e}(xl);function El(t,e,n,i,r,o,s){var a,l=t[e],u=t[e+1],h=t[n]-l,c=t[n+1]-u;if(0===h&&0===c)a=e;else{var p=((r-l)*h+(o-u)*c)/(h*h+c*c);if(p>1)a=n;else{if(p>0){for(var f=0;f<i;++f)s[f]=we(t[e+f],t[n+f],p);return void(s.length=i)}a=e}}for(f=0;f<i;++f)s[f]=t[a+f];s.length=i}function Tl(t,e,n,i,r){var o=t[e],s=t[e+1];for(e+=i;e<n;e+=i){var a=t[e],l=t[e+1],u=ve(o,s,a,l);u>r&&(r=u),o=a,s=l}return r}function Ol(t,e,n,i,r){for(var o=0,s=n.length;o<s;++o){var a=n[o];r=Tl(t,e,a,i,r),e=a}return r}function Rl(t,e,n,i,r,o,s,a,l,u,h){if(e==n)return u;var c,p;if(0===r){if((p=ve(s,a,t[e],t[e+1]))<u){for(c=0;c<i;++c)l[c]=t[e+c];return l.length=i,p}return u}for(var f=h||[NaN,NaN],d=e+i;d<n;)if(El(t,d-i,d,i,s,a,f),(p=ve(s,a,f[0],f[1]))<u){for(u=p,c=0;c<i;++c)l[c]=f[c];l.length=i,d+=i}else d+=i*Math.max((Math.sqrt(p)-Math.sqrt(u))/r|0,1);if(o&&(El(t,n-i,e,i,s,a,f),(p=ve(s,a,f[0],f[1]))<u)){for(u=p,c=0;c<i;++c)l[c]=f[c];l.length=i}return u}function Pl(t,e,n,i,r,o,s,a,l,u,h){for(var c=h||[NaN,NaN],p=0,f=n.length;p<f;++p){var d=n[p];u=Rl(t,e,d,i,r,o,s,a,l,u,c),e=d}return u}function Il(t,e,n,i,r){var o;for(e+=i;e<n;e+=i)if(o=r(t.slice(e-i,e),t.slice(e,e+i)))return o;return!1}function Fl(t,e,n,i,r,o,s){var a,l,u=(n-e)/i;if(1===u)a=e;else if(2===u)a=e,l=r;else if(0!==u){for(var h=t[e],c=t[e+1],p=0,f=[0],d=e+i;d<n;d+=i){var g=t[d],_=t[d+1];p+=Math.sqrt((g-h)*(g-h)+(_-c)*(_-c)),f.push(p),h=g,c=_}var y=r*p,v=function(t,e,n){for(var i,r,o=n||m,s=0,a=t.length,l=!1;s<a;)(r=+o(t[i=s+(a-s>>1)],e))<0?s=i+1:(a=i,l=!r);return l?s:~s}(f,y);v<0?(l=(y-f[-v-2])/(f[-v-1]-f[-v-2]),a=e+(-v-2)*i):a=e+v*i}var x=s>1?s:2,w=o||new Array(x);for(d=0;d<x;++d)w[d]=void 0===a?NaN:void 0===l?t[a+d]:we(t[a+d],t[a+i+d],l);return w}function Ml(t,e,n,i,r,o){if(n==e)return null;var s;if(r<t[e+i-1])return o?((s=t.slice(e,e+i))[i-1]=r,s):null;if(t[n-1]<r)return o?((s=t.slice(n-i,n))[i-1]=r,s):null;if(r==t[e+i-1])return t.slice(e,e+i);for(var a=e/i,l=n/i;a<l;){var u=a+l>>1;r<t[(u+1)*i-1]?l=u:a=u+1}var h=t[a*i-1];if(r==h)return t.slice((a-1)*i,(a-1)*i+i);var c=(r-h)/(t[(a+1)*i-1]-h);s=[];for(var p=0;p<i-1;++p)s.push(we(t[(a-1)*i+p],t[a*i+p],c));return s.push(r),s}function Ll(t,e,n,i,r){return!Wt(r,(function(r){return!Al(t,e,n,i,r[0],r[1])}))}function Al(t,e,n,i,r,o){for(var s=0,a=t[n-i],l=t[n-i+1];e<n;e+=i){var u=t[e],h=t[e+1];l<=o?h>o&&(u-a)*(o-l)-(r-a)*(h-l)>0&&s++:h<=o&&(u-a)*(o-l)-(r-a)*(h-l)<0&&s--,a=u,l=h}return 0!==s}function jl(t,e,n,i,r,o){if(0===n.length)return!1;if(!Al(t,e,n[0],i,r,o))return!1;for(var s=1,a=n.length;s<a;++s)if(Al(t,n[s-1],n[s],i,r,o))return!1;return!0}function Dl(t,e,n,i,r){var o=Nt([1/0,1/0,-1/0,-1/0],t,e,n,i);return!!te(r,o)&&(!!It(r,o)||(o[0]>=r[0]&&o[2]<=r[2]||(o[1]>=r[1]&&o[3]<=r[3]||Il(t,e,n,i,(function(t,e){return function(t,e,n){var i=!1,r=Mt(t,e),o=Mt(t,n);if(r===yt||o===yt)i=!0;else{var s=t[0],a=t[1],l=t[2],u=t[3],h=e[0],c=e[1],p=n[0],f=n[1],d=(f-c)/(p-h),g=void 0,_=void 0;o&vt&&!(r&vt)&&(i=(g=p-(f-u)/d)>=s&&g<=l),i||!(o&mt)||r&mt||(i=(_=f-(p-l)*d)>=a&&_<=u),i||!(o&xt)||r&xt||(i=(g=p-(f-a)/d)>=s&&g<=l),i||!(o&wt)||r&wt||(i=(_=f-(p-s)*d)>=a&&_<=u)}return i}(r,t,e)})))))}function kl(t,e,n,i,r){if(!function(t,e,n,i,r){return!!(Dl(t,e,n,i,r)||Al(t,e,n,i,r[0],r[1])||Al(t,e,n,i,r[0],r[3])||Al(t,e,n,i,r[2],r[1])||Al(t,e,n,i,r[2],r[3]))}(t,e,n[0],i,r))return!1;if(1===n.length)return!0;for(var o=1,s=n.length;o<s;++o)if(Ll(t,n[o-1],n[o],i,r)&&!Dl(t,n[o-1],n[o],i,r))return!1;return!0}var Gl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const zl=function(t){function e(e,n){var i=t.call(this)||this;return i.flatMidpoint_=null,i.flatMidpointRevision_=-1,i.maxDelta_=-1,i.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?i.setCoordinates(e,n):i.setFlatCoordinates(n,e),i}return Gl(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?C(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,i){return i<Rt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Tl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Rl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,n,i))},e.prototype.forEachSegment=function(t){return Il(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=Ms&&this.layout!=Ls)return null;var n=void 0!==e&&e;return Ml(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n)},e.prototype.getCoordinates=function(){return Ao(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return Fl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return cs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[];return n.length=Uo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,Is)},e.prototype.getType=function(){return Eo},e.prototype.intersectsExtent=function(t){return Dl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ga(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ds);var Nl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Bl=function(t){function e(e,n,i){var r=t.call(this)||this;if(r.ends_=[],r.maxDelta_=-1,r.maxDeltaRevision_=-1,Array.isArray(e[0]))r.setCoordinates(e,n);else if(void 0!==n&&i)r.setFlatCoordinates(n,e),r.ends_=i;else{for(var o=r.getLayout(),s=e,a=[],l=[],u=0,h=s.length;u<h;++u){var c=s[u];0===u&&(o=c.getLayout()),C(a,c.getFlatCoordinates()),l.push(a.length)}r.setFlatCoordinates(o,a),r.ends_=l}return r}return Nl(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?C(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,i){return i<Rt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ol(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pl(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,n,i))},e.prototype.getCoordinateAtM=function(t,e,n){if(this.layout!=Ms&&this.layout!=Ls||0===this.flatCoordinates.length)return null;var i=void 0!==e&&e,r=void 0!==n&&n;return function(t,e,n,i,r,o,s){if(s)return Ml(t,e,n[n.length-1],i,r,o);var a;if(r<t[i-1])return o?((a=t.slice(0,i))[i-1]=r,a):null;if(t[t.length-1]<r)return o?((a=t.slice(t.length-i))[i-1]=r,a):null;for(var l=0,u=n.length;l<u;++l){var h=n[l];if(e!=h){if(r<t[e+i-1])return null;if(r<=t[h-1])return Ml(t,e,h,i,r,!1);e=h}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,i,r)},e.prototype.getCoordinates=function(){return jo(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new zl(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,n=this.layout,i=[],r=0,o=0,s=e.length;o<s;++o){var a=e[o],l=new zl(t.slice(r,a),n);i.push(l),r=a}return i},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,n=0,i=this.ends_,r=this.stride,o=0,s=i.length;o<s;++o){var a=i[o];C(t,Fl(e,n,a,r,.5)),n=a}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],i=[];return n.length=Xo(this.flatCoordinates,0,this.ends_,this.stride,t,n,0,i),new e(n,Is,i)},e.prototype.getType=function(){return Po},e.prototype.intersectsExtent=function(t){return function(t,e,n,i,r){for(var o=0,s=n.length;o<s;++o){if(Dl(t,e,n[o],i,r))return!0;e=n[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var n=za(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(Ds);var Wl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Ul=function(t){function e(e,n){var i=t.call(this)||this;return n&&!Array.isArray(e[0])?i.setFlatCoordinates(n,e):i.setCoordinates(e,n),i}return Wl(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?C(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,i){if(i<Rt(this.getExtent(),t,e))return i;for(var r=this.flatCoordinates,o=this.stride,s=0,a=r.length;s<a;s+=o){var l=ve(t,e,r[s],r[s+1]);if(l<i){i=l;for(var u=0;u<o;++u)n[u]=r[s+u];n.length=o}}return i},e.prototype.getCoordinates=function(){return Ao(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new Ba(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,n=this.stride,i=[],r=0,o=t.length;r<o;r+=n){var s=new Ba(t.slice(r,r+n),e);i.push(s)}return i},e.prototype.getType=function(){return Ro},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,n=this.stride,i=0,r=e.length;i<r;i+=n){if(Ft(t,e[i],e[i+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ga(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ds);function Xl(t,e,n,i){for(var r=0,o=t[n-i],s=t[n-i+1];e<n;e+=i){var a=t[e],l=t[e+1];r+=s*a-o*l,o=a,s=l}return r/2}function Yl(t,e,n,i){for(var r=0,o=0,s=n.length;o<s;++o){var a=n[o];r+=Xl(t,e,a,i),e=a}return r}var Zl=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Vl=function(t){function e(e,n){var i=t.call(this)||this;return i.maxDelta_=-1,i.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?i.setCoordinates(e,n):i.setFlatCoordinates(n,e),i}return Zl(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,n,i){return i<Rt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Tl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Rl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,n,i))},e.prototype.getArea=function(){return Xl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return Ao(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[];return n.length=Uo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,Is)},e.prototype.getType=function(){return To},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ga(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ds);function Kl(t,e,n,i,r,o,s){for(var a,l,u,h,c,p,f,d=r[o+1],g=[],_=0,y=n.length;_<y;++_){var v=n[_];for(h=t[v-i],p=t[v-i+1],a=e;a<v;a+=i)c=t[a],f=t[a+1],(d<=p&&f<=d||p<=d&&d<=f)&&(u=(d-p)/(f-p)*(c-h)+h,g.push(u)),h=c,p=f}var x=NaN,w=-1/0;for(g.sort(m),h=g[0],a=1,l=g.length;a<l;++a){c=g[a];var C=Math.abs(c-h);C>w&&jl(t,e,n,i,u=(h+c)/2,d)&&(x=u,w=C),h=c}return isNaN(x)&&(x=r[o]),s?(s.push(x,d,w),s):[x,d,w]}function Hl(t,e,n,i){for(;e<n-i;){for(var r=0;r<i;++r){var o=t[e+r];t[e+r]=t[n-i+r],t[n-i+r]=o}e+=i,n-=i}}function ql(t,e,n,i){for(var r=0,o=t[n-i],s=t[n-i+1];e<n;e+=i){var a=t[e],l=t[e+1];r+=(a-o)*(l+s),o=a,s=l}return 0===r?void 0:r>0}function Jl(t,e,n,i,r){for(var o=void 0!==r&&r,s=0,a=n.length;s<a;++s){var l=n[s],u=ql(t,e,l,i);if(0===s){if(o&&u||!o&&!u)return!1}else if(o&&!u||!o&&u)return!1;e=l}return!0}function $l(t,e,n,i,r){for(var o=void 0!==r&&r,s=0,a=n.length;s<a;++s){var l=n[s],u=ql(t,e,l,i);(0===s?o&&u||!o&&!u:o&&!u||!o&&u)&&Hl(t,e,l,i),e=l}return e}function Ql(t,e,n,i,r){for(var o=0,s=n.length;o<s;++o)e=$l(t,e,n[o],i,r);return e}var tu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),eu=function(t){function e(e,n,i){var r=t.call(this)||this;return r.ends_=[],r.flatInteriorPointRevision_=-1,r.flatInteriorPoint_=null,r.maxDelta_=-1,r.maxDeltaRevision_=-1,r.orientedRevision_=-1,r.orientedFlatCoordinates_=null,void 0!==n&&i?(r.setFlatCoordinates(n,e),r.ends_=i):r.setCoordinates(e,n),r}return tu(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?C(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,i){return i<Rt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ol(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pl(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,n,i))},e.prototype.containsXY=function(t,e){return jl(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return Yl(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?$l(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,jo(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=Zt(this.getExtent());this.flatInteriorPoint_=Kl(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new Ba(this.getFlatInteriorPoint(),Ms)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new Vl(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.ends_,i=[],r=0,o=0,s=n.length;o<s;++o){var a=n[o],l=new Vl(e.slice(r,a),t);i.push(l),r=a}return i},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Jl(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=$l(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],i=[];return n.length=Vo(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),n,0,i),new e(n,Is,i)},e.prototype.getType=function(){return Oo},e.prototype.intersectsExtent=function(t){return kl(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var n=za(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(Ds);const nu=eu;function iu(t){var e=t[0],n=t[1],i=t[2],r=t[3],o=[e,n,e,r,i,r,i,n,e,n];return new eu(o,Is,[o.length])}var ru=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const ou=function(t){function e(e,n,i){var r=t.call(this)||this;if(r.endss_=[],r.flatInteriorPointsRevision_=-1,r.flatInteriorPoints_=null,r.maxDelta_=-1,r.maxDeltaRevision_=-1,r.orientedRevision_=-1,r.orientedFlatCoordinates_=null,!i&&!Array.isArray(e[0])){for(var o=r.getLayout(),s=e,a=[],l=[],u=0,h=s.length;u<h;++u){var c=s[u];0===u&&(o=c.getLayout());for(var p=a.length,f=c.getEnds(),d=0,g=f.length;d<g;++d)f[d]+=p;C(a,c.getFlatCoordinates()),l.push(f)}n=o,e=a,i=l}return void 0!==n&&i?(r.setFlatCoordinates(n,e),r.endss_=i):r.setCoordinates(e,n),r}return ru(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var n=this.flatCoordinates.length;C(this.flatCoordinates,t.getFlatCoordinates());for(var i=0,r=(e=t.getEnds().slice()).length;i<r;++i)e[i]+=n}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,n=new Array(t),i=0;i<t;++i)n[i]=this.endss_[i].slice();var r=new e(this.flatCoordinates.slice(),this.layout,n);return r.applyProperties(this),r},e.prototype.closestPointXY=function(t,e,n,i){return i<Rt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,n,i,r){for(var o=0,s=n.length;o<s;++o){var a=n[o];r=Ol(t,e,a,i,r),e=a[a.length-1]}return r}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,n,i,r,o,s,a,l,u,h){for(var c=h||[NaN,NaN],p=0,f=n.length;p<f;++p){var d=n[p];u=Pl(t,e,d,i,r,o,s,a,l,u,c),e=d[d.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,n,i))},e.prototype.containsXY=function(t,e){return function(t,e,n,i,r,o){if(0===n.length)return!1;for(var s=0,a=n.length;s<a;++s){var l=n[s];if(jl(t,e,l,i,r,o))return!0;e=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,n,i){for(var r=0,o=0,s=n.length;o<s;++o){var a=n[o];r+=Yl(t,e,a,i),e=a[a.length-1]}return r}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Ql(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,Do(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=function(t,e,n,i){for(var r=[],o=[1/0,1/0,-1/0,-1/0],s=0,a=n.length;s<a;++s){var l=n[s];o=Dt(t,e,l[0],i),r.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=l[l.length-1]}return r}(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=function(t,e,n,i,r){for(var o=[],s=0,a=n.length;s<a;++s){var l=n[s];o=Kl(t,e,l,i,r,2*s,o),e=l[l.length-1]}return o}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new Ul(this.getFlatInteriorPoints().slice(),Ms)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,n,i,r){for(var o=0,s=n.length;o<s;++o){var a=n[o];if(!Jl(t,e,a,i,r))return!1;a.length&&(e=a[a.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ql(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],i=[];return n.length=function(t,e,n,i,r,o,s,a){for(var l=0,u=n.length;l<u;++l){var h=n[l],c=[];s=Vo(t,e,h,i,r,o,s,c),a.push(c),e=h[h.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),n,0,i),new e(n,Is,i)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var n=this.endss_[t-1];e=n[n.length-1]}var i=this.endss_[t].slice(),r=i[i.length-1];if(0!==e)for(var o=0,s=i.length;o<s;++o)i[o]-=e;return new nu(this.flatCoordinates.slice(e,r),this.layout,i)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.endss_,i=[],r=0,o=0,s=n.length;o<s;++o){var a=n[o].slice(),l=a[a.length-1];if(0!==r)for(var u=0,h=a.length;u<h;++u)a[u]-=r;var c=new nu(e.slice(r,l),t,a);i.push(c),r=l}return i},e.prototype.getType=function(){return Io},e.prototype.intersectsExtent=function(t){return function(t,e,n,i,r){for(var o=0,s=n.length;o<s;++o){var a=n[o];if(kl(t,e,a,i,r))return!0;e=a[a.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var n=function(t,e,n,i,r){for(var o=r||[],s=0,a=0,l=n.length;a<l;++a){var u=za(t,e,n[a],i,o[s]);o[s++]=u,e=u[u.length-1]}return o.length=s,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===n.length)this.flatCoordinates.length=0;else{var i=n[n.length-1];this.flatCoordinates.length=0===i.length?0:i[i.length-1]}this.changed()},e}(Ds);var su=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function au(t,e){if(!t)return null;var n;switch(t.type){case So:n=function(t){return new Ba(t.coordinates)}(t);break;case Eo:n=function(t){return new zl(t.coordinates)}(t);break;case Oo:n=function(t){return new nu(t.coordinates)}(t);break;case Ro:n=function(t){return new Ul(t.coordinates)}(t);break;case Po:n=function(t){return new Bl(t.coordinates)}(t);break;case Io:n=function(t){return new ou(t.coordinates)}(t);break;case Fo:n=function(t,e){var n=t.geometries.map((function(t){return au(t,e)}));return new ml(n)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return wl(n,!1,e)}function lu(t,e){var n,i=(t=wl(t,!0,e)).getType();switch(i){case So:n=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case Eo:n=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case Oo:n=function(t,e){var n;e&&(n=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(n)}}(t,e);break;case Ro:n=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case Po:n=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case Io:n=function(t,e){var n;e&&(n=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(n)}}(t,e);break;case Fo:n=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var n=O({},e);return delete n.featureProjection,lu(t,n)}))}}(t,e);break;case Mo:n={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+i)}return n}const uu=function(t){function e(e){var n=this,i=e||{};return(n=t.call(this)||this).dataProjection=Ye(i.dataProjection?i.dataProjection:"EPSG:4326"),i.featureProjection&&(n.defaultFeatureProjection=Ye(i.featureProjection)),n.geometryName_=i.geometryName,n.extractGeometryName_=i.extractGeometryName,n.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],n}return su(e,t),e.prototype.readFeatureFromObject=function(t,e){var n=null,i=au((n="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),r=new vr;return this.geometryName_?r.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in n!==void 0&&r.setGeometryName(n.geometry_name),r.setGeometry(i),"id"in n&&r.setId(n.id),n.properties&&r.setProperties(n.properties,!0),r},e.prototype.readFeaturesFromObject=function(t,e){var n=null;if("FeatureCollection"===t.type){n=[];for(var i=t.features,r=0,o=i.length;r<o;++r)n.push(this.readFeatureFromObject(i[r],e))}else n=[this.readFeatureFromObject(t,e)];return n},e.prototype.readGeometryFromObject=function(t,e){return au(t,e)},e.prototype.readProjectionFromObject=function(t){var e,n=t.crs;return n?"name"==n.type?e=Ye(n.properties.name):"EPSG"===n.type?e=Ye("EPSG:"+n.properties.code):St(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var n={type:"Feature",geometry:null,properties:null},i=t.getId();if(void 0!==i&&(n.id=i),!t.hasProperties())return n;var r=t.getProperties(),o=t.getGeometry();return o&&(n.geometry=lu(o,e),delete r[t.getGeometryName()]),I(r)||(n.properties=r),n},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var n=[],i=0,r=t.length;i<r;++i)n.push(this.writeFeatureObject(t[i],e));return{type:"FeatureCollection",features:n}},e.prototype.writeGeometryObject=function(t,e){return lu(t,this.adaptOptions(e))},e}(Sl),hu={src:"public/maps/countries.geojson"},cu={id:"geojson-value-mapper",name:"Map values to GeoJSON file",description:"color features based on query results",isBaseMap:!1,state:i.PluginState.alpha,create:async(t,e,n)=>{const i=Object.assign({},hu,e.config),r=new ja({url:i.src,format:new uu}),o=new ca({source:r});return{init:()=>o,update:t=>{console.log("todo... find values matching the ID and update"),r.getFeatures().forEach((t=>{console.log("Find: ",t.getId(),t.getProperties())}))}}},registerOptionsUI:t=>{t.addSelect({path:"config.src",name:"GeoJSON URL",settings:{options:[{label:"public/maps/countries.geojson",value:"public/maps/countries.geojson"},{label:"public/maps/usa-states.geojson",value:"public/maps/usa-states.geojson"}],allowCustomValue:!0},defaultValue:hu.src})},defaultOptions:hu};var pu,fu=34962,du=34963,gu=35048,_u=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function yu(t,e){for(var n=_u.length,i=0;i<n;++i)try{var r=t.getContext(_u[i],e);if(r)return r}catch(t){}return null}var vu=35044;function mu(t){switch(t){case fu:return Float32Array;case du:return Uint32Array;default:return Float32Array}}const xu=function(){function t(t,e){this.array=null,this.type=t,St(t===fu||t===du,62),this.usage=void 0!==e?e:vu}return t.prototype.ofSize=function(t){this.array=new(mu(this.type))(t)},t.prototype.fromArray=function(t){this.array=mu(this.type).from(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(mu(this.type))(t)},t.prototype.getType=function(){return this.type},t.prototype.getArray=function(){return this.array},t.prototype.getUsage=function(){return this.usage},t.prototype.getSize=function(){return this.array?this.array.length:0},t}(),wu="webglcontextlost",Cu="webglcontextrestored";const bu=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 n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,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(n);var i=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(i,t.fragmentShader||"\n  precision mediump float;\n   \n  uniform sampler2D u_image;\n   \n  varying vec2 v_texCoord;\n   \n  void main() {\n    gl_FragColor = texture2D(u_image, v_texCoord);\n  }\n"),e.compileShader(i),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,n),e.attachShader(this.renderTargetProgram_,i),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.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(n){this.uniforms_.push({value:t.uniforms[n],location:e.getUniformLocation(this.renderTargetProgram_,n)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(t){var e=this.getGL(),n=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,n[0],n[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==n[0]||this.renderTargetTextureSize_[1]!==n[1]){this.renderTargetTextureSize_=n;var i=e.RGBA,r=e.RGBA,o=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,0,i,n[0],n[1],0,r,o,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){var n=this.getGL(),i=t.size;n.bindFramebuffer(n.FRAMEBUFFER,e?e.getFrameBuffer():null),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,this.renderTargetTexture_),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,n.ONE_MINUS_SRC_ALPHA),n.viewport(0,0,n.drawingBufferWidth,n.drawingBufferHeight),n.bindBuffer(n.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),n.useProgram(this.renderTargetProgram_),n.enableVertexAttribArray(this.renderTargetAttribLocation_),n.vertexAttribPointer(this.renderTargetAttribLocation_,2,n.FLOAT,!1,0,0),n.uniform2f(this.renderTargetUniformLocation_,i[0],i[1]),n.uniform1i(this.renderTargetTextureLocation_,0),this.applyUniforms(t),n.drawArrays(n.TRIANGLES,0,6)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(t){var e,n=this.getGL(),i=1;this.uniforms_.forEach((function(r){if((e="function"==typeof r.value?r.value(t):r.value)instanceof HTMLCanvasElement||e instanceof ImageData)r.texture||(r.texture=n.createTexture()),n.activeTexture(n["TEXTURE"+i]),n.bindTexture(n.TEXTURE_2D,r.texture),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),e instanceof ImageData?n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,e.width,e.height,0,n.UNSIGNED_BYTE,new Uint8Array(e.data)):n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),n.uniform1i(r.location,i++);else if(Array.isArray(e))switch(e.length){case 2:return void n.uniform2f(r.location,e[0],e[1]);case 3:return void n.uniform3f(r.location,e[0],e[1],e[2]);case 4:return void n.uniform4f(r.location,e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&n.uniform1f(r.location,e)}))},t}();function Su(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 Eu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Tu="u_projectionMatrix",Ou="u_offsetScaleMatrix",Ru="u_offsetRotateMatrix",Pu="u_time",Iu="u_zoom",Fu="u_resolution",Mu={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126};function Lu(t){switch(t){case Mu.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Mu.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Mu.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Mu.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}const Au=function(t){function e(e){var n=t.call(this)||this,i=e||{};n.boundHandleWebGLContextLost_=n.handleWebGLContextLost.bind(n),n.boundHandleWebGLContextRestored_=n.handleWebGLContextRestored.bind(n),n.canvas_=document.createElement("canvas"),n.canvas_.style.position="absolute",n.canvas_.style.left="0",n.gl_=yu(n.canvas_);var r,o,s=n.getGL();if(n.bufferCache_={},n.currentProgram_=null,St((r=function(){if(!pu){var t=yu(document.createElement("canvas"));t&&(pu=t.getSupportedExtensions())}return pu}(),o="OES_element_index_uint",r.indexOf(o)>=0),63),s.getExtension("OES_element_index_uint"),n.canvas_.addEventListener(wu,n.boundHandleWebGLContextLost_),n.canvas_.addEventListener(Cu,n.boundHandleWebGLContextRestored_),n.offsetRotateMatrix_=[1,0,0,1,0,0],n.offsetScaleMatrix_=[1,0,0,1,0,0],n.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n.uniformLocations_={},n.attribLocations_={},n.uniforms_=[],i.uniforms)for(var a in i.uniforms)n.uniforms_.push({name:a,value:i.uniforms[a]});return n.postProcessPasses_=i.postProcesses?i.postProcesses.map((function(t){return new bu({webGlContext:s,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new bu({webGlContext:s})],n.shaderCompileErrors_=null,n.startTime_=Date.now(),n}return Eu(e,t),e.prototype.bindBuffer=function(t){var e=this.getGL(),n=B(t),i=this.bufferCache_[n];i||(i={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[n]=i);e.bindBuffer(t.getType(),i.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(),n=B(t),i=this.bufferCache_[n];i&&!e.isContextLost()&&e.deleteBuffer(i.webGlBuffer),delete this.bufferCache_[n]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(wu,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(Cu,this.boundHandleWebGLContextRestored_)},e.prototype.prepareDraw=function(t,e){var n=this.getGL(),i=this.getCanvas(),r=t.size,o=t.pixelRatio;i.width=r[0]*o,i.height=r[1]*o,i.style.width=r[0]+"px",i.style.height=r[1]+"px",n.useProgram(this.currentProgram_);for(var s=this.postProcessPasses_.length-1;s>=0;s--)this.postProcessPasses_[s].init(t);n.bindTexture(n.TEXTURE_2D,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,e?n.ZERO:n.ONE_MINUS_SRC_ALPHA),n.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,n){var i=this.getGL(),r=e.getSize();i.bindFramebuffer(i.FRAMEBUFFER,e.getFramebuffer()),i.viewport(0,0,r[0],r[1]),i.bindTexture(i.TEXTURE_2D,e.getTexture()),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,n?i.ZERO:i.ONE_MINUS_SRC_ALPHA),i.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var n=this.getGL(),i=n.UNSIGNED_INT,r=e-t,o=4*t;n.drawElements(n.TRIANGLES,r,i,o)},e.prototype.finalizeDraw=function(t){for(var e=0;e<this.postProcessPasses_.length;e++)this.postProcessPasses_[e].apply(t,this.postProcessPasses_[e+1]||null)},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.applyFrameState=function(t){var e=t.size,n=t.viewState.rotation,i=Bi(this.offsetScaleMatrix_);!function(t,e,n){Wi(t,Ui(Ni,e,0,0,n,0,0))}(i,2/e[0],2/e[1]);var r=Bi(this.offsetRotateMatrix_);0!==n&&function(t,e){var n=Math.cos(e),i=Math.sin(e);Wi(t,Ui(Ni,n,i,-i,n,0,0))}(r,-n),this.setUniformMatrixValue(Ou,Su(this.tmpMat4_,i)),this.setUniformMatrixValue(Ru,Su(this.tmpMat4_,r)),this.setUniformFloatValue(Pu,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(Iu,t.viewState.zoom),this.setUniformFloatValue(Fu,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var e,n=this.getGL(),i=0;this.uniforms_.forEach(function(r){if((e="function"==typeof r.value?r.value(t):r.value)instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageData)r.texture||(r.prevValue=void 0,r.texture=n.createTexture()),n.activeTexture(n["TEXTURE"+i]),n.bindTexture(n.TEXTURE_2D,r.texture),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),(!(e instanceof HTMLImageElement)||e.complete)&&r.prevValue!==e&&(r.prevValue=e,n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e)),n.uniform1i(this.getUniformLocation(r.name),i++);else if(Array.isArray(e)&&6===e.length)this.setUniformMatrixValue(r.name,Su(this.tmpMat4_,e));else if(Array.isArray(e)&&e.length<=4)switch(e.length){case 2:return void n.uniform2f(this.getUniformLocation(r.name),e[0],e[1]);case 3:return void n.uniform3f(this.getUniformLocation(r.name),e[0],e[1],e[2]);case 4:return void n.uniform4f(this.getUniformLocation(r.name),e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&n.uniform1f(this.getUniformLocation(r.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 n=this.getGL(),i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i},e.prototype.getProgram=function(t,e){var n=this.getGL(),i=this.compileShader(t,n.FRAGMENT_SHADER),r=this.compileShader(e,n.VERTEX_SHADER),o=n.createProgram();if(n.attachShader(o,i),n.attachShader(o,r),n.linkProgram(o),!n.getShaderParameter(i,n.COMPILE_STATUS)){var s="Fragment shader compliation failed: "+n.getShaderInfoLog(i);throw new Error(s)}if(n.deleteShader(i),!n.getShaderParameter(r,n.COMPILE_STATUS)){s="Vertex shader compilation failed: "+n.getShaderInfoLog(r);throw new Error(s)}if(n.deleteShader(r),!n.getProgramParameter(o,n.LINK_STATUS)){s="GL program linking failed: "+n.getShaderInfoLog(r);throw new Error(s)}return o},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 n=t.size,i=t.viewState.rotation,r=t.viewState.resolution,o=t.viewState.center;return Bi(e),Yi(e,0,0,2/(r*n[0]),2/(r*n[1]),-i,-o[0],-o[1]),e},e.prototype.setUniformFloatValue=function(t,e){this.getGL().uniform1f(this.getUniformLocation(t),e)},e.prototype.setUniformMatrixValue=function(t,e){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,e)},e.prototype.enableAttributeArray_=function(t,e,n,i,r){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,e,n,!1,i,r))},e.prototype.enableAttributes=function(t){for(var e=function(t){for(var e=0,n=0;n<t.length;n++){var i=t[n];e+=i.size*Lu(i.type)}return e}(t),n=0,i=0;i<t.length;i++){var r=t[i];this.enableAttributeArray_(r.name,r.size,r.type||5126,e,n),n+=r.size*Lu(r.type)}},e.prototype.handleWebGLContextLost=function(){R(this.bufferCache_),this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,e,n){var i=this.getGL(),r=n||i.createTexture(),o=i.RGBA,s=i.RGBA,a=i.UNSIGNED_BYTE;return i.bindTexture(i.TEXTURE_2D,r),e?i.texImage2D(i.TEXTURE_2D,0,o,s,a,e):i.texImage2D(i.TEXTURE_2D,0,o,t[0],t[1],0,s,a,null),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),r},e}(y);var ju=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Du="GENERATE_BUFFERS",ku=function(t){function e(e,n){var i=t.call(this,e)||this,r=n||{};return i.helper=new Au({postProcesses:r.postProcesses,uniforms:r.uniforms}),void 0!==r.className&&(i.helper.getCanvas().className=r.className),i}return ju(e,t),e.prototype.disposeInternal=function(){this.helper.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.dispatchRenderEvent_=function(t,e){var n=this.getLayer();if(n.hasListener(t)){var i=new Gi(t,null,e,null);n.dispatchEvent(i)}},e.prototype.preRender=function(t){this.dispatchRenderEvent_(bi,t)},e.prototype.postRender=function(t){this.dispatchRenderEvent_(Si,t)},e}(Di);const Gu=ku;var zu=new Uint8Array(4);const Nu=function(){function t(t,e){this.helper_=t;var n=t.getGL();this.texture_=n.createTexture(),this.framebuffer_=n.createFramebuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}return t.prototype.setSize=function(t){b(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 zu[0]=0,zu[1]=0,zu[2]=0,zu[3]=0,zu;this.readAll();var n=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return zu[0]=this.data_[4*n],zu[1]=this.data_[4*n+1],zu[2]=this.data_[4*n+2],zu[3]=this.data_[4*n+3],zu},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 Bu=new Blob(['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,u){var a=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=u?u.vertexPosition:0,h=u?u.indexPosition:0,d=b/a;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=a,l,v,1),c.length&&i.set(c,b+3),o(i,b+=a,l,v,2),c.length&&i.set(c,b+3),o(i,b+=a,l,v,3),c.length&&i.set(c,b+3),b+=a,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=r.customAttributesCount,s=2+o,u=new Float32Array(r.renderInstructions),a=u.length/s,l=4*a*(o+3),v=new Uint32Array(6*a),c=new Float32Array(l),g=null,b=0;b<u.length;b+=s)g=i(u,b,c,v,o,g);var h=e({vertexBuffer:c.buffer,indexBuffer:v.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[c.buffer,v.buffer,u.buffer])}};'],{type:"application/javascript"}),Wu=URL.createObjectURL(Bu);var Uu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Xu=function(t){function e(e,n){var i=this,r=n.uniforms||{},o=[1,0,0,1,0,0];r[Tu]=o,(i=t.call(this,e,{className:n.className,uniforms:r,postProcesses:n.postProcesses})||this).sourceRevision_=-1,i.verticesBuffer_=new xu(fu,gu),i.hitVerticesBuffer_=new xu(fu,gu),i.indicesBuffer_=new xu(du,gu),i.program_=i.helper.getProgram(n.fragmentShader,n.vertexShader),i.hitDetectionEnabled_=!(!n.hitFragmentShader||!n.hitVertexShader),i.hitProgram_=i.hitDetectionEnabled_&&i.helper.getProgram(n.hitFragmentShader,n.hitVertexShader);var s=n.attributes?n.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:Mu.FLOAT}})):[];i.attributes=[{name:"a_position",size:2,type:Mu.FLOAT},{name:"a_index",size:1,type:Mu.FLOAT}].concat(s),i.hitDetectionAttributes=[{name:"a_position",size:2,type:Mu.FLOAT},{name:"a_index",size:1,type:Mu.FLOAT},{name:"a_hitColor",size:4,type:Mu.FLOAT},{name:"a_featureUid",size:1,type:Mu.FLOAT}].concat(s),i.customAttributes=n.attributes?n.attributes:[],i.previousExtent_=[1/0,1/0,-1/0,-1/0],i.currentTransform_=o,i.renderTransform_=[1,0,0,1,0,0],i.invertRenderTransform_=[1,0,0,1,0,0],i.renderInstructions_=new Float32Array(0),i.hitRenderInstructions_=new Float32Array(0),i.hitRenderTarget_=i.hitDetectionEnabled_&&new Nu(i.helper),i.worker_=new Worker(Wu),i.worker_.addEventListener("message",function(t){var e=t.data;if(e.type===Du){var n=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_=n,Zi(this.invertRenderTransform_,this.renderTransform_),e.hitDetection?this.hitRenderInstructions_=new Float32Array(t.data.renderInstructions):this.renderInstructions_=new Float32Array(t.data.renderInstructions),this.getLayer().changed()}}.bind(i)),i.featureCache_={},i.featureCount_=0;var a=i.getLayer().getSource();return i.sourceListenKeys_=[ie(a,ma,i.handleSourceFeatureAdded_,i),ie(a,xa,i.handleSourceFeatureChanged_,i),ie(a,Ca,i.handleSourceFeatureDelete_,i),ie(a,wa,i.handleSourceFeatureClear_,i)],a.forEachFeature(function(t){this.featureCache_[B(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(i)),i}return Uu(e,t),e.prototype.handleSourceFeatureAdded_=function(t){var e=t.feature;this.featureCache_[B(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var e=t.feature;this.featureCache_[B(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var e=t.feature;delete this.featureCache_[B(e)],this.featureCount_--},e.prototype.handleSourceFeatureClear_=function(){this.featureCache_={},this.featureCount_=0},e.prototype.renderFrame=function(t){this.preRender(t);var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e),this.helper.finalizeDraw(t);var n=this.helper.getCanvas(),i=t.layerStatesArray[t.layerIndex].opacity;return i!==parseFloat(n.style.opacity)&&(n.style.opacity=String(i)),this.hitDetectionEnabled_&&(this.renderHitDetection(t),this.hitRenderTarget_.clearCachedData()),this.postRender(t),n},e.prototype.prepareFrame=function(t){var e=this.getLayer(),n=e.getSource(),i=t.viewState,r=!t.viewHints[Es]&&!t.viewHints[Ts],o=!kt(this.previousExtent_,t.extent),s=this.sourceRevision_<n.getRevision();if(s&&(this.sourceRevision_=n.getRevision()),r&&(o||s)){var a=i.projection,l=i.resolution,u=e instanceof yo?e.getRenderBuffer():0,h=Tt(t.extent,u*l);n.loadFeatures(h,l,a),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.makeProjectionTransform(t,this.currentTransform_),Wi(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=[1,0,0,1,0,0];this.helper.makeProjectionTransform(t,e);var n,i,r=(2+this.customAttributes.length)*this.featureCount_;if(this.renderInstructions_&&this.renderInstructions_.length===r||(this.renderInstructions_=new Float32Array(r)),this.hitDetectionEnabled_){var o=(7+this.customAttributes.length)*this.featureCount_;this.hitRenderInstructions_&&this.hitRenderInstructions_.length===o||(this.hitRenderInstructions_=new Float32Array(o))}var s,a,l,u,h,c=[],p=[],f=0,d=0;for(var g in this.featureCache_)if((i=(n=this.featureCache_[g]).geometry)&&i.getType()===So){c[0]=i.getFlatCoordinates()[0],c[1]=i.getFlatCoordinates()[1],Xi(e,c),a=d+6,l=void 0,u=void 0,h=void 0,u=256,h=255,(l=p||[])[0]=Math.floor(a/u/u/u)/h,l[1]=Math.floor(a/u/u)%u/h,l[2]=Math.floor(a/u)%u/h,l[3]=a%u/h,s=l,this.renderInstructions_[f++]=c[0],this.renderInstructions_[f++]=c[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[d++]=c[0],this.hitRenderInstructions_[d++]=c[1],this.hitRenderInstructions_[d++]=s[0],this.hitRenderInstructions_[d++]=s[1],this.hitRenderInstructions_[d++]=s[2],this.hitRenderInstructions_[d++]=s[3],this.hitRenderInstructions_[d++]=Number(g));for(var _=void 0,y=0;y<this.customAttributes.length;y++)_=this.customAttributes[y].callback(n.feature,n.properties),this.renderInstructions_[f++]=_,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[d++]=_)}var v={type:Du,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(v.projectionTransform=e,this.worker_.postMessage(v,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var m={type:Du,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};m.projectionTransform=e,m.hitDetection=!0,this.worker_.postMessage(m,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,r){if(St(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var o=Xi(e.coordinateToPixelTransform,t.slice()),s=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),a=function(t){var e=0,n=256,i=255;return e+=Math.round(t[0]*n*n*n*i),e+=Math.round(t[1]*n*n*i),e+=Math.round(t[2]*n*i),e+Math.round(t[3]*i)}([s[0]/255,s[1]/255,s[2]/255,s[3]/255]),l=this.hitRenderInstructions_[a],u=Math.floor(l).toString(),h=this.getLayer().getSource().getFeatureByUid(u);return h?i(h,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){oe(t)})),this.sourceListenKeys_=null,t.prototype.disposeInternal.call(this)},e}(Gu);var Yu=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Zu="blur",Vu="gradient",Ku="radius",Hu=["#00f","#0ff","#0f0","#ff0","#f00"];const qu=function(t){function e(e){var n=this,i=e||{},r=O({},i);delete r.gradient,delete r.radius,delete r.blur,delete r.weight,(n=t.call(this,r)||this).gradient_=null,n.addChangeListener(Vu,n.handleGradientChanged_),n.setGradient(i.gradient?i.gradient:Hu),n.setBlur(void 0!==i.blur?i.blur:15),n.setRadius(void 0!==i.radius?i.radius:8);var o=i.weight?i.weight:"weight";return n.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,n.setRenderOrder(null),n}return Yu(e,t),e.prototype.getBlur=function(){return this.get(Zu)},e.prototype.getGradient=function(){return this.get(Vu)},e.prototype.getRadius=function(){return this.get(Ku)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=1,n=256,i=it(e,n),r=i.createLinearGradient(0,0,e,n),o=1/(t.length-1),s=0,a=t.length;s<a;++s)r.addColorStop(s*o,t[s]);return i.fillStyle=r,i.fillRect(0,0,e,n),i.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(Zu,t)},e.prototype.setGradient=function(t){this.set(Vu,t)},e.prototype.setRadius=function(t){this.set(Ku,t)},e.prototype.createRenderer=function(){return new Xu(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?de(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(Ku)+this.get(Zu))}.bind(this),u_blurSlope:function(){return this.get(Ku)/Math.max(1,this.get(Zu))}.bind(this)},postProcesses:[{fragmentShader:"\n            precision mediump float;\n\n            uniform sampler2D u_image;\n            uniform sampler2D u_gradientTexture;\n\n            varying vec2 v_texCoord;\n\n            void main() {\n              vec4 color = texture2D(u_image, v_texCoord);\n              gl_FragColor.a = color.a;\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)}}]})},e.prototype.renderDeclutter=function(){},e}(ca),Ju={weight:{fixed:1,min:0,max:1},blur:15,radius:5},$u={icon:"https://openlayers.org/en/latest/examples/data/icon.png"},Qu=[_l,{id:"heatmap",name:"Heatmap",description:"visualizes a heatmap of the data",isBaseMap:!1,showLocation:!0,create:async(t,e,n)=>{const r=Object.assign({},Ju,e.config),o=await $a(e.location),s=new ja,a=new qu({source:s,blur:r.blur,radius:r.radius,weight:function(t){return t.get("value")}});return{init:()=>a,update:t=>{var e;const l=t.series[0];a.getSource().getFeatures().forEach((t=>{a.getSource().removeFeature(t)}));const u=Qa(l,o);if(u.warning)return void console.log("WARN",u.warning);const h=(0,tl.W8)(l,r.weight);for(let t=0;t<l.length;t++){const e=new vr({geometry:u.points[t],value:h.get(t)});s.addFeature(e)}a.setSource(s);let c=["#00f","#0ff","#0f0","#ff0","#f00"];const p=null!==(e=h.field)&&void 0!==e?e:l.fields.find((t=>t.type===i.FieldType.number));if(p){const t=(0,i.getFieldColorModeForField)(p);t.isContinuous&&t.getColors&&(c=t.getColors(n))}a.setGradient(c)}}},registerOptionsUI:t=>{t.addCustomEditor({id:"config.weight",path:"config.weight",name:"Weight values",description:"Scale the distribution for each row",editor:el.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:Ju.radius,settings:{min:1,max:50,step:1}}).addSliderInput({path:"config.blur",description:"configures the amount of blur of clusters",name:"Blur",defaultValue:Ju.blur,settings:{min:1,max:50,step:1}})},defaultOptions:Ju},{id:"last-point-tracker",name:"Icon at last point",description:"Show an icon at the last point",isBaseMap:!1,showLocation:!0,state:i.PluginState.alpha,create:async(t,e,n)=>{const i=new vr({}),r=Object.assign({},$u,e.config);i.setStyle(new fo({image:new $s({src:r.icon})}));const o=new ja({features:[i]}),s=new ca({source:o}),a=await $a(e.location);return{init:()=>s,update:t=>{const e=t.series[0];if(e&&e.length){var n;const t=Qa(e,a);if(t.warning)return void console.log("WARN",t.warning);if(null!==(n=t.points)&&void 0!==n&&n.length){const e=t.points[t.points.length-1];i.setGeometry(e)}}}}},defaultOptions:$u},cu],th={type:"default",config:{}},eh={id:th.type,name:"Default base layer",isBaseMap:!0,create:(t,e,n)=>{var i;const r=null===or.vc||void 0===or.vc||null===(i=or.vc.geomapDefaultBaseLayerConfig)||void 0===i?void 0:i.type;if(r){const e=nh.getIfExists(r);if(!e)throw new Error("Invalid basemap configuraiton on server");return e.create(t,or.vc.geomapDefaultBaseLayerConfig,n)}return ir.create(t,e,n)}},nh=new i.Registry((()=>[eh,..._r,...Qu]));var ih=n("./public/app/features/dashboard/components/PanelEditor/OptionsPaneCategoryDescriptor.tsx"),rh=n("./public/app/features/dashboard/components/PanelEditor/utils.ts"),oh=n("./public/app/features/dashboard/components/PanelEditor/getVizualizationOptions.tsx");const sh=[{label:"Countries",description:"Lookup countries by name, two letter code, or three leter code",value:Ya},{label:"USA States",description:"Lookup states by name or 2 ",value:"public/gazetteer/usa-states.json"}],ah=({value:t,onChange:e,context:n})=>{const i=lh((0,o.useTheme2)()),[s,a]=(0,r.useState)();(0,r.useEffect)((()=>{!async function(){const e=await Za(t);a(e)}()}),[t,a]);const{current:l,options:u}=(0,r.useMemo)((()=>{let t=[...sh],e=t.find((t=>t.value===(null==s?void 0:s.path)));return!e&&s&&(e={label:s.path,value:s.path},t.push(e)),{options:t,current:e}}),[s]);return(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)(o.Select,{menuShouldPortal:!0,value:l,options:u,onChange:t=>e(t.value),allowCustomValue:!0,formatCreateLabel:t=>`Load from URL: ${t}`}),s&&(0,nl.jsxs)(nl.Fragment,{children:[s.error&&(0,nl.jsx)(o.Alert,{title:s.error,severity:"warning"}),s.count&&(0,nl.jsxs)("div",{className:i.keys,children:[(0,nl.jsxs)("b",{children:["(",s.count,")"]}),s.examples(10).map((t=>(0,nl.jsxs)("span",{children:[t,","]},t)))," ","&ellipsis;"]})]})]})},lh=(0,o.stylesFactory)((t=>({keys:ol.css`
      margin-top: 4px;
      text-overflow: ellipsis;
      overflow: hidden;
      white-space: nowrap;

      > span {
        margin-left: 4px;
      }
    `})));var uh;const hh=({options:t,onChange:e,data:n,filter:s})=>{const a=(0,r.useMemo)((()=>nh.selectOptions(null!=t&&t.type?[t.type]:[th.type],s)),[null==t?void 0:t.type,s]),l=(0,r.useMemo)((()=>{const e=nh.getIfExists(null==t?void 0:t.type);if(!e||!(e.registerOptionsUI||e.showLocation||e.showOpacity))return null;const n=new i.PanelOptionsEditorBuilder;return e.showLocation&&n.addRadio({path:"location.mode",name:"Location",description:"",defaultValue:i.FrameGeometrySourceMode.Auto,settings:{options:[{value:i.FrameGeometrySourceMode.Auto,label:"Auto"},{value:i.FrameGeometrySourceMode.Coords,label:"Coords"},{value:i.FrameGeometrySourceMode.Geohash,label:"Geohash"},{value:i.FrameGeometrySourceMode.Lookup,label:"Lookup"}]}}).addFieldNamePicker({path:"location.latitude",name:"Latitude field",settings:{filter:t=>t.type===i.FieldType.number,noFieldsMessage:"No numeric fields found"},showIf:t=>{var e;return(null===(e=t.location)||void 0===e?void 0:e.mode)===i.FrameGeometrySourceMode.Coords}}).addFieldNamePicker({path:"location.longitude",name:"Longitude field",settings:{filter:t=>t.type===i.FieldType.number,noFieldsMessage:"No numeric fields found"},showIf:t=>{var e;return(null===(e=t.location)||void 0===e?void 0:e.mode)===i.FrameGeometrySourceMode.Coords}}).addFieldNamePicker({path:"location.geohash",name:"Geohash field",settings:{filter:t=>t.type===i.FieldType.string,noFieldsMessage:"No strings fields found"},showIf:t=>{var e;return(null===(e=t.location)||void 0===e?void 0:e.mode)===i.FrameGeometrySourceMode.Geohash}}).addFieldNamePicker({path:"location.lookup",name:"Lookup field",settings:{filter:t=>t.type===i.FieldType.string,noFieldsMessage:"No strings fields found"},showIf:t=>{var e;return(null===(e=t.location)||void 0===e?void 0:e.mode)===i.FrameGeometrySourceMode.Lookup}}).addCustomEditor({id:"gazetteer",path:"location.gazetteer",name:"Gazetteer",editor:ah,showIf:t=>{var e;return(null===(e=t.location)||void 0===e?void 0:e.mode)===i.FrameGeometrySourceMode.Lookup}}),e.registerOptionsUI&&e.registerOptionsUI(n),e.showOpacity,n}),[null==t?void 0:t.type]),u=(0,r.useMemo)((()=>{const i=nh.getIfExists(null==t?void 0:t.type);if(!l||!i)return null;const r=new ih.j({id:"Layer config",title:"Layer config"}),o={data:n,options:t},s=Object.assign({},t,{type:i.id,config:Object.assign({},i.defaultOptions,null==t?void 0:t.config)});(!t||i.defaultOptions&&!t.config)&&e(s);const a=l.getRegistry();return(0,oh.H)(a.list(),(t=>r),((t,n)=>{e((0,rh.hs)(s,t,n))}),o),(0,nl.jsxs)(nl.Fragment,{children:[uh||(uh=(0,nl.jsx)("br",{})),r.items.map((t=>t.render()))]})}),[l,e,n,t]);return(0,nl.jsxs)("div",{children:[(0,nl.jsx)(o.Select,{menuShouldPortal:!0,options:a.options,value:a.current,onChange:n=>{const i=nh.getIfExists(n.value);i?e(Object.assign({},t,{type:i.id,config:Object.assign({},i.defaultOptions)})):console.warn("layer does not exist",n)}}),u]})};var ch;function ph(t){return!!t.isBaseMap&&(t.state!==i.PluginState.alpha||or.Oh)}const fh=({value:t,onChange:e,context:n})=>or.vc.geomapDisableCustomBaseLayer?ch||(ch=(0,nl.jsx)("div",{children:"The base layer is configured by the server admin."})):(0,nl.jsx)(hh,{options:t,data:n.data,onChange:e,filter:ph});function dh(t){return!t.isBaseMap&&(t.state!==i.PluginState.alpha||or.Oh)}const gh=({value:t,onChange:e,context:n})=>(0,nl.jsx)(hh,{options:null!=t&&t.length?t[0]:void 0,data:n.data,onChange:t=>{console.log("Change overlays:",t),e([t])},filter:dh});var _h=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function yh(t,e){Vs.expire()}const vh=function(t){function e(e){var n=t.call(this)||this;return n.map_=e,n}return _h(e,t),e.prototype.dispatchRenderEvent=function(t,e){z()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,n=t.coordinateToPixelTransform,i=t.pixelToCoordinateTransform;Yi(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Zi(i,n)},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,r,o,s,a){var l,u=e.viewState;function h(t,e,n,i){return r.call(o,e,t?n:null,i)}var c=u.projection,p=aa(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&i){var d=Qt(c.getExtent());f.push([-d,0],[d,0])}for(var g=e.layerStatesArray,_=g.length,y=[],v=[],m=0;m<f.length;m++)for(var x=_-1;x>=0;--x){var w=g[x],C=w.layer;if(C.hasRenderer()&&Pi(w,u)&&s.call(a,C)){var b=C.getRenderer(),S=C.getSource();if(b&&S){var E=S.getWrapX()?p:t,T=h.bind(null,w.managed);v[0]=E[0]+f[m][0],v[1]=E[1]+f[m][1],l=b.forEachFeatureAtCoordinate(v,e,n,T,y)}if(l)return l}}if(0!==y.length){var O=1/y.length;return y.forEach((function(t,e){return t.distanceSq+=e*O})),y.sort((function(t,e){return t.distanceSq-e.distanceSq})),y.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,n,i,r){return z()},e.prototype.hasFeatureAtCoordinate=function(t,e,n,i,r,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,n,i,S,this,r,o)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){z()},e.prototype.scheduleExpireIconCache=function(t){Vs.canExpireCache()&&t.postRenderFunctions.push(yh)},e}(y);var mh=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const xh=function(t){function e(e){var n=t.call(this,e)||this;n.fontChangeListenerKey_=ie(Zr,In,e.redrawText.bind(e)),n.element_=document.createElement("div");var i=n.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",n.element_.className="ol-unselectable ol-layers";var r=e.getViewport();return r.insertBefore(n.element_,r.firstChild||null),n.children_=[],n.renderedVisible_=!0,n}return mh(e,t),e.prototype.dispatchRenderEvent=function(t,e){var n=this.getMap();if(n.hasListener(t)){var i=new Gi(t,void 0,e);n.dispatchEvent(i)}},e.prototype.disposeInternal=function(){oe(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(Ei,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),n=t.viewState;this.children_.length=0;for(var i=[],r=null,o=0,s=e.length;o<s;++o){var a=e[o];if(t.layerIndex=o,Pi(a,n)&&(a.sourceState==Gn||a.sourceState==kn)){var l=a.layer,u=l.render(t,r);u&&(u!==r&&(this.children_.push(u),r=u),"getDeclutter"in l&&i.push(l))}}for(o=i.length-1;o>=0;--o)i[o].renderDeclutter(t);!function(t,e){for(var n=t.childNodes,i=0;;++i){var r=n[i],o=e[i];if(!r&&!o)break;r!==o&&(r?o?t.insertBefore(o,r):(t.removeChild(r),--i):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(Ti,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,n,i,r){for(var o=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var l=s[a],u=l.layer;if(u.hasRenderer()&&Pi(l,o)&&r(u)){var h=u.getRenderer().getDataAtPixel(t,e,n);if(h){var c=i(u,h);if(c)return c}}}},e}(vh);var wh=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ch="layers";const bh=function(t){function e(e){var n=this,i=e||{},r=O({},i);delete r.layers;var o=i.layers;return(n=t.call(this,r)||this).on,n.once,n.un,n.layersListenerKeys_=[],n.listenerKeys_={},n.addChangeListener(Ch,n.handleLayersChanged_),o?Array.isArray(o)?o=new ya(o.slice(),{unique:!0}):St("function"==typeof o.getArray,43):o=new ya(void 0,{unique:!0}),n.setLayers(o),n}return wh(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(oe),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(ie(t,pa,this.handleLayersAdd_,this),ie(t,fa,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(oe);R(this.listenerKeys_);for(var n=t.getArray(),i=0,r=n.length;i<r;i++){var o=n[i];this.listenerKeys_[B(o)]=[ie(o,In,this.handleLayerChange_,this),ie(o,s,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[B(e)]=[ie(e,In,this.handleLayerChange_,this),ie(e,s,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=B(t.element);this.listenerKeys_[e].forEach(oe),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(Ch)},e.prototype.setLayers=function(t){this.set(Ch,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:[],n=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var i=this.getLayerState(),r=i.zIndex;t||void 0!==i.zIndex||(r=0);for(var o=n,s=e.length;o<s;o++){var a=e[o];a.opacity*=i.opacity,a.visible=a.visible&&i.visible,a.maxResolution=Math.min(a.maxResolution,i.maxResolution),a.minResolution=Math.max(a.minResolution,i.minResolution),a.minZoom=Math.max(a.minZoom,i.minZoom),a.maxZoom=Math.min(a.maxZoom,i.maxZoom),void 0!==i.extent&&(void 0!==a.extent?a.extent=qt(a.extent,i.extent):a.extent=i.extent),void 0===a.zIndex&&(a.zIndex=r)}return e},e.prototype.getSourceState=function(){return Gn},e}(Ci);var Sh=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Eh=function(t){function e(e,n,i){var r=t.call(this,e)||this;return r.map=n,r.frameState=void 0!==i?i:null,r}return Sh(e,t),e}(v);var Th=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Oh=function(t){function e(e,n,i,r,o){var s=t.call(this,e,n,o)||this;return s.originalEvent=i,s.pixel_=null,s.coordinate_=null,s.dragging=void 0!==r&&r,s}return Th(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}(Eh),Rh={SINGLECLICK:"singleclick",CLICK:u,DBLCLICK:h,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Ph="pointermove",Ih="pointerdown";var Fh=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Mh=function(t){function e(e,n){var i=t.call(this,e)||this;i.map_=e,i.clickTimeoutId_,i.emulateClicks_=!1,i.dragging_=!1,i.dragListenerKeys_=[],i.moveTolerance_=void 0===n?1:n,i.down_=null;var r=i.map_.getViewport();return i.activePointers_=0,i.trackedTouches_={},i.element_=r,i.pointerdownListenerKey_=ie(r,Ih,i.handlePointerDown_,i),i.originalPointerMoveEvent_,i.relayedListenerKey_=ie(r,Ph,i.relayEvent_,i),i.boundHandleTouchMove_=i.handleTouchMove_.bind(i),i.element_.addEventListener(g,i.boundHandleTouchMove_,!!nt&&{passive:!1}),i}return Fh(e,t),e.prototype.emulateClick_=function(t){var e=new Oh(Rh.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Oh(Rh.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new Oh(Rh.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==Rh.POINTERUP||e.type==Rh.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==Rh.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new Oh(Rh.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(oe),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 Oh(Rh.POINTERDOWN,this.map_,t);for(var n in this.dispatchEvent(e),this.down_={},t){var i=t[n];this.down_[n]="function"==typeof i?T:i}if(0===this.dragListenerKeys_.length){var r=this.map_.getOwnerDocument();this.dragListenerKeys_.push(ie(r,Rh.POINTERMOVE,this.handlePointerMove_,this),ie(r,Rh.POINTERUP,this.handlePointerUp_,this),ie(this.element_,Rh.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==r&&this.dragListenerKeys_.push(ie(this.element_.getRootNode(),Rh.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new Oh(Rh.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 Oh(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_&&(oe(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(g,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(oe(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(oe),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(L),Lh="postrender",Ah="movestart",jh="moveend",Dh="layergroup",kh="size",Gh="target",zh="view";var Nh=1/0;const Bh=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,R(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,n=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var i=this.keyFunction_(n);return delete this.queuedElements_[i],n},t.prototype.enqueue=function(t){St(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=Nh&&(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_,n=this.priorities_,i=e.length,r=e[t],o=n[t],s=t;t<i>>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<i&&n[l]<n[a]?l:a;e[t]=e[u],n[t]=n[u],t=u}e[t]=r,n[t]=o,this.siftDown_(s,t)},t.prototype.siftDown_=function(t,e){for(var n=this.elements_,i=this.priorities_,r=n[e],o=i[e];e>t;){var s=this.getParentIndex_(e);if(!(i[s]>o))break;n[e]=n[s],i[e]=i[s],e=s}n[e]=r,i[e]=o},t.prototype.reprioritize=function(){var t,e,n,i=this.priorityFunction_,r=this.elements_,o=this.priorities_,s=0,a=r.length;for(e=0;e<a;++e)(n=i(t=r[e]))==Nh?delete this.queuedElements_[this.keyFunction_(t)]:(o[s]=n,r[s++]=t);r.length=s,o.length=s,this.heapify_()},t}();var Wh=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Uh=function(t){function e(e,n){var i=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return i.boundHandleTileChange_=i.handleTileChange.bind(i),i.tileChangeCallback_=n,i.tilesLoading_=0,i.tilesLoadingKeys_={},i}return Wh(e,t),e.prototype.enqueue=function(e){var n=t.prototype.enqueue.call(this,e);n&&e[0].addEventListener(s,this.boundHandleTileChange_);return n},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,n=e.getState();if(n===D||n===k||n===G){e.removeEventListener(s,this.boundHandleTileChange_);var i=e.getKey();i in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[i],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var n,i,r=0;this.tilesLoading_<t&&r<e&&this.getCount()>0;)i=(n=this.dequeue()[0]).getKey(),n.getState()!==A||i in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[i]=!0,++this.tilesLoading_,++r,n.load())},e}(Bh);const Xh="center",Yh="resolution",Zh="rotation";function Vh(t,e,n){return function(i,r,o,s,a){if(i){var l=e?0:o[0]*r,u=e?0:o[1]*r,h=a?a[0]:0,c=a?a[1]:0,p=t[0]+l/2+h,f=t[2]-l/2+h,d=t[1]+u/2+c,g=t[3]-u/2+c;p>f&&(f=p=(f+p)/2),d>g&&(g=d=(g+d)/2);var _=de(i[0],p,f),y=de(i[1],d,g),v=30*r;return s&&n&&(_+=-v*Math.log(1+Math.max(0,p-i[0])/v)+v*Math.log(1+Math.max(0,i[0]-f)/v),y+=-v*Math.log(1+Math.max(0,d-i[1])/v)+v*Math.log(1+Math.max(0,i[1]-g)/v)),[_,y]}}}function Kh(t){return t}function Hh(t,e,n,i){var r=Qt(e)/n[0],o=Ht(e)/n[1];return i?Math.min(t,Math.max(r,o)):Math.min(t,Math.min(r,o))}function qh(t,e,n){var i=Math.min(t,e);return i*=Math.log(1+50*Math.max(0,t/e-1))/50+1,n&&(i=Math.max(i,n),i/=Math.log(1+50*Math.max(0,n/t-1))/50+1),de(i,n/2,2*e)}function Jh(t,e,n,i,r){return function(o,s,a,l){if(void 0!==o){var u=i?Hh(t,i,a,r):t;return(void 0===n||n)&&l?qh(o,u,e):de(o,e,u)}}}function $h(t){return void 0!==t?0:void 0}function Qh(t){return void 0!==t?t:void 0}var tc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function ec(t,e){setTimeout((function(){t(e)}),0)}function nc(t){return!(t.sourceCenter&&t.targetCenter&&!oa(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function ic(t,e,n,i,r){var o=Math.cos(-r),s=Math.sin(-r),a=t[0]*o-t[1]*s,l=t[1]*o+t[0]*s;return[(a+=(e[0]/2-n[0])*i)*o-(l+=(n[1]-e[1]/2)*i)*(s=-s),l*o+a*s]}const rc=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var i=O({},e);return n.hints_=[0,0],n.animations_=[],n.updateAnimationKey_,n.projection_=Ke(i.projection,"EPSG:3857"),n.viewportSize_=[100,100],n.targetCenter_=null,n.targetResolution_,n.targetRotation_,n.cancelAnchor_=void 0,i.center&&(i.center=un(i.center,n.projection_)),i.extent&&(i.extent=cn(i.extent,n.projection_)),n.applyOptions_(i),n}return tc(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,n,i,r=28,o=2,s=void 0!==t.minZoom?t.minZoom:0,a=void 0!==t.maxZoom?t.maxZoom:r,l=void 0!==t.zoomFactor?t.zoomFactor:o,u=void 0!==t.multiWorld&&t.multiWorld,h=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,c=void 0!==t.showFullExtent&&t.showFullExtent,p=Ke(t.projection,"EPSG:3857"),f=p.getExtent(),d=t.constrainOnlyCenter,g=t.extent;u||g||!p.isGlobal()||(d=!1,g=f);if(void 0!==t.resolutions){var _=t.resolutions;n=_[s],i=void 0!==_[a]?_[a]:_[_.length-1],e=t.constrainResolution?function(t,e,n,i){return function(r,o,s,a){if(void 0!==r){var l=t[0],u=t[t.length-1],h=n?Hh(l,n,s,i):l;if(a)return void 0===e||e?qh(r,h,u):de(r,u,h);var c=Math.min(h,r),p=Math.floor(x(t,c,o));return t[p]>h&&p<t.length-1?t[p+1]:t[p]}}}(_,h,!d&&g,c):Jh(n,i,h,!d&&g,c)}else{var y=(f?Math.max(Qt(f),Ht(f)):360*ce[pe.DEGREES]/p.getMetersPerUnit())/Yn/Math.pow(o,0),v=y/Math.pow(o,r-0);void 0!==(n=t.maxResolution)?s=0:n=y/Math.pow(l,s),void 0===(i=t.minResolution)&&(i=void 0!==t.maxZoom?void 0!==t.maxResolution?n/Math.pow(l,a):y/Math.pow(l,a):v),a=s+Math.floor(Math.log(n/i)/Math.log(l)),i=n/Math.pow(l,a-s),e=t.constrainResolution?function(t,e,n,i,r,o){return function(s,a,l,u){if(void 0!==s){var h=r?Hh(e,r,l,o):e,c=void 0!==n?n:0;if(u)return void 0===i||i?qh(s,h,c):de(s,c,h);var p=Math.ceil(Math.log(e/h)/Math.log(t)-1e-9),f=-a*(.5-1e-9)+.5,d=Math.min(h,s),g=Math.floor(Math.log(e/d)/Math.log(t)+f),_=Math.max(p,g);return de(e/Math.pow(t,_),c,h)}}}(l,n,i,h,!d&&g,c):Jh(n,i,h,!d&&g,c)}return{constraint:e,maxResolution:n,minResolution:i,minZoom:s,zoomFactor:l}}(t);this.maxResolution_=e.maxResolution,this.minResolution_=e.minResolution,this.zoomFactor_=e.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=e.minZoom;var n=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Vh(t.extent,t.constrainOnlyCenter,e)}var n=Ke(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&n.isGlobal()){var i=n.getExtent().slice();return i[0]=-1/0,i[2]=1/0,Vh(i,!1,!1)}return Kh}(t),i=e.constraint,r=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(o=r||me(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=o?0:t:void 0}):!1===e?Qh:"number"==typeof e?(n=e,i=2*Math.PI/n,function(t,e){return e?t:void 0!==t?t=Math.floor(t/i+.5)*i:void 0}):Qh}return $h;var n,i;var r,o}(t);this.constraints_={center:n,resolution:i,rotation:r},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),this.setProperties({}),this.options_=t},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var n=this.getCenter();if(n){var i=t||[0,0,0,0];e=e||[0,0,0,0];var r=this.getResolution(),o=r/2*(i[3]-e[3]+e[1]-i[1]),s=r/2*(i[0]-e[0]+e[2]-i[2]);this.setCenterInternal([n[0]+o,n[1]-s])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=O({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),O({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),n=0;n<e.length;++n){var i=arguments[n];i.center&&((i=O({},i)).center=un(i.center,this.getProjection())),i.anchor&&((i=O({},i)).anchor=un(i.anchor,this.getProjection())),e[n]=i}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,n=arguments.length;if(n>1&&"function"==typeof arguments[n-1]&&(e=arguments[n-1],--n),!this.isDef()){var i=arguments[n-1];return i.center&&this.setCenterInternal(i.center),void 0!==i.zoom&&this.setZoom(i.zoom),void 0!==i.rotation&&this.setRotation(i.rotation),void(e&&ec(e,!0))}for(var r=Date.now(),o=this.targetCenter_.slice(),s=this.targetResolution_,a=this.targetRotation_,l=[],u=0;u<n;++u){var h=arguments[u],c={start:r,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||Y,callback:e};if(h.center&&(c.sourceCenter=o,c.targetCenter=h.center.slice(),o=c.targetCenter),void 0!==h.zoom?(c.sourceResolution=s,c.targetResolution=this.getResolutionForZoom(h.zoom),s=c.targetResolution):h.resolution&&(c.sourceResolution=s,c.targetResolution=h.resolution,s=c.targetResolution),void 0!==h.rotation){c.sourceRotation=a;var p=xe(h.rotation-a+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=a+p,a=c.targetRotation}nc(c)?c.complete=!0:r+=c.duration,l.push(c)}this.animations_.push(l),this.setHint(Es,1),this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[Es]>0},e.prototype.getInteracting=function(){return this.hints_[Ts]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Es,-this.hints_[Es]);for(var e=0,n=this.animations_.length;e<n;++e){var i=this.animations_[e];if(i[0].callback&&ec(i[0].callback,!1),!t)for(var r=0,o=i.length;r<o;++r){var s=i[r];if(!s.complete){t=s.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t},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,n=this.animations_.length-1;n>=0;--n){for(var i=this.animations_[n],r=!0,o=0,s=i.length;o<s;++o){var a=i[o];if(!a.complete){var l=t-a.start,u=a.duration>0?l/a.duration:1;u>=1?(a.complete=!0,u=1):r=!1;var h=a.easing(u);if(a.sourceCenter){var c=a.sourceCenter[0],p=a.sourceCenter[1],f=c+h*(a.targetCenter[0]-c),d=p+h*(a.targetCenter[1]-p);this.targetCenter_=[f,d]}if(a.sourceResolution&&a.targetResolution){var g=1===h?a.targetResolution:a.sourceResolution+h*(a.targetResolution-a.sourceResolution);if(a.anchor){var _=this.getViewportSize_(this.getRotation()),y=this.constraints_.resolution(g,0,_,!0);this.targetCenter_=this.calculateCenterZoom(y,a.anchor)}this.targetResolution_=g,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var v=1===h?xe(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+h*(a.targetRotation-a.sourceRotation);if(a.anchor){var m=this.constraints_.rotation(v,!0);this.targetCenter_=this.calculateCenterRotate(m,a.anchor)}this.targetRotation_=v}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(r){this.animations_[n]=null,this.setHint(Es,-1);var x=i[0].callback;x&&ec(x,!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 n,i,r,o=this.getCenterInternal();return void 0!==o&&(sa(n=[o[0]-e[0],o[1]-e[1]],t-this.getRotation()),r=e,(i=n)[0]+=+r[0],i[1]+=+r[1]),n},e.prototype.calculateCenterZoom=function(t,e){var n,i=this.getCenterInternal(),r=this.getResolution();void 0!==i&&void 0!==r&&(n=[e[0]-t*(e[0]-i[0])/r,e[1]-t*(e[1]-i[1])/r]);return n},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var n=e[0],i=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(i*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(i*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?ln(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Xh)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.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){return hn(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),n=this.getCenterInternal();St(n,1);var i=this.getResolution();St(void 0!==i,2);var r=this.getRotation();return St(void 0!==r,3),Kt(n,i,r,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(Yh)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(cn(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var n=e||this.getViewportSizeMinusPadding_(),i=Qt(t)/n[0],r=Ht(t)/n[1];return Math.max(i,r)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,n=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,r=Math.log(n/i)/Math.log(e);return function(t){return n/Math.pow(e,t*r)}},e.prototype.getRotation=function(){return this.get(Zh)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,r=Math.log(n/i)/e;return function(t){return Math.log(n/t)/e/r}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),n=this.getRotation(),i=this.getCenterInternal(),r=this.padding_;if(r){var o=this.getViewportSizeMinusPadding_();i=ic(i,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],e,n)}return{center:i.slice(0),projection:void 0!==t?t:null,resolution:e,rotation:n,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,n,i=this.minZoom_||0;if(this.resolutions_){var r=x(this.resolutions_,t,1);i=r,e=this.resolutions_[r],n=r==this.resolutions_.length-1?2:e/this.resolutions_[r+1]}else e=this.maxResolution_,n=this.zoomFactor_;return i+Math.log(e/t)/Math.log(n)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=de(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,de(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var n;if(St(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))St(!ee(t),25),n=iu(i=cn(t,this.getProjection()));else if(t.getType()===Mo){var i;(n=iu(i=cn(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),Zt(i))}else{var r=an();n=r?t.clone().transform(r,this.getProjection()):t}this.fitInternal(n,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),n=Math.cos(e),i=Math.sin(-e),r=t.getFlatCoordinates(),o=t.getStride(),s=1/0,a=1/0,l=-1/0,u=-1/0,h=0,c=r.length;h<c;h+=o){var p=r[h]*n-r[h+1]*i,f=r[h]*i+r[h+1]*n;s=Math.min(s,p),a=Math.min(a,f),l=Math.max(l,p),u=Math.max(u,f)}return[s,a,l,u]},e.prototype.fitInternal=function(t,e){var n=e||{},i=n.size;i||(i=this.getViewportSizeMinusPadding_());var r,o=void 0!==n.padding?n.padding:[0,0,0,0],s=void 0!==n.nearest&&n.nearest;r=void 0!==n.minResolution?n.minResolution:void 0!==n.maxZoom?this.getResolutionForZoom(n.maxZoom):0;var a=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(a,[i[0]-o[1]-o[3],i[1]-o[0]-o[2]]);l=isNaN(l)?r:Math.max(l,r),l=this.getConstrainedResolution(l,s?0:1);var u=this.getRotation(),h=Math.sin(u),c=Math.cos(u),p=Zt(a);p[0]+=(o[1]-o[3])/2*l,p[1]+=(o[0]-o[2])/2*l;var f=p[0]*c-p[1]*h,d=p[1]*c+p[0]*h,g=this.getConstrainedCenter([f,d],l),_=n.callback?n.callback:T;void 0!==n.duration?this.animateInternal({resolution:l,center:g,duration:n.duration,easing:n.easing},_):(this.targetResolution_=l,this.targetCenter_=g,this.applyTargetState_(!1,!0),ec(_,!0))},e.prototype.centerOn=function(t,e,n){this.centerOnInternal(un(t,this.getProjection()),e,n)},e.prototype.centerOnInternal=function(t,e,n){this.setCenterInternal(ic(t,e,n,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,n,i){var r,o=this.padding_;if(o&&t){var s=this.getViewportSizeMinusPadding_(-n),a=ic(t,i,[s[0]/2+o[3],s[1]/2+o[0]],e,n);r=[t[0]-a[0],t[1]-a[1]]}return r},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=ln(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 n=e&&un(e,this.getProjection());this.adjustResolutionInternal(t,n)},e.prototype.adjustResolutionInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),i=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,i,n);e&&(this.targetCenter_=this.calculateCenterZoom(r,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=un(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),i=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(i,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(un(t,this.getProjection()))},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 n=this.getAnimating()||this.getInteracting()||e,i=this.constraints_.rotation(this.targetRotation_,n),r=this.getViewportSize_(i),o=this.constraints_.resolution(this.targetResolution_,0,r,n),s=this.constraints_.center(this.targetCenter_,o,r,n,this.calculateCenterShift(this.targetCenter_,o,i,r));this.get(Zh)!==i&&this.set(Zh,i),this.get(Yh)!==o&&this.set(Yh,o),this.get(Xh)&&oa(this.get(Xh),s)||this.set(Xh,s),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,n){var i=void 0!==t?t:200,r=e||0,o=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(o),a=this.constraints_.resolution(this.targetResolution_,r,s),l=this.constraints_.center(this.targetCenter_,a,s,!1,this.calculateCenterShift(this.targetCenter_,a,o,s));if(0===i&&!this.cancelAnchor_)return this.targetResolution_=a,this.targetRotation_=o,this.targetCenter_=l,void this.applyTargetState_();var u=n||(0===i?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===a&&this.getRotation()===o&&this.getCenterInternal()&&oa(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:l,resolution:a,duration:i,easing:X,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Ts,1)},e.prototype.endInteraction=function(t,e,n){var i=n&&un(n,this.getProjection());this.endInteractionInternal(t,e,i)},e.prototype.endInteractionInternal=function(t,e,n){this.setHint(Ts,-1),this.resolveConstraints(t,e,n)},e.prototype.getConstrainedCenter=function(t,e){var n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),n)},e.prototype.getConstrainedZoom=function(t,e){var n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,e))},e.prototype.getConstrainedResolution=function(t,e){var n=e||0,i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,n,i)},e}(Dn);var oc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const sc=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var i=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var n,i,r,o={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new bh({layers:t.layers});o[Dh]=s,o[Gh]=t.target,o[zh]=void 0!==t.view?t.view:new rc,void 0!==t.controls&&(Array.isArray(t.controls)?n=new ya(t.controls.slice()):(St("function"==typeof t.controls.getArray,47),n=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?i=new ya(t.interactions.slice()):(St("function"==typeof t.interactions.getArray,48),i=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?r=new ya(t.overlays.slice()):(St("function"==typeof t.overlays.getArray,49),r=t.overlays):r=new ya;return{controls:n,interactions:i,keyboardEventTarget:e,overlays:r,values:o}}(e);return n.boundHandleBrowserEvent_=n.handleBrowserEvent.bind(n),n.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,n.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:Q,n.postRenderTimeoutHandle_,n.animationDelayKey_,n.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(n),n.coordinateToPixelTransform_=[1,0,0,1,0,0],n.pixelToCoordinateTransform_=[1,0,0,1,0,0],n.frameIndex_=0,n.frameState_=null,n.previousExtent_=null,n.viewPropertyListenerKey_=null,n.viewChangeListenerKey_=null,n.layerGroupPropertyListenerKeys_=null,n.viewport_=document.createElement("div"),n.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),n.viewport_.style.position="relative",n.viewport_.style.overflow="hidden",n.viewport_.style.width="100%",n.viewport_.style.height="100%",n.overlayContainer_=document.createElement("div"),n.overlayContainer_.style.position="absolute",n.overlayContainer_.style.zIndex="0",n.overlayContainer_.style.width="100%",n.overlayContainer_.style.height="100%",n.overlayContainer_.style.pointerEvents="none",n.overlayContainer_.className="ol-overlaycontainer",n.viewport_.appendChild(n.overlayContainer_),n.overlayContainerStopEvent_=document.createElement("div"),n.overlayContainerStopEvent_.style.position="absolute",n.overlayContainerStopEvent_.style.zIndex="0",n.overlayContainerStopEvent_.style.width="100%",n.overlayContainerStopEvent_.style.height="100%",n.overlayContainerStopEvent_.style.pointerEvents="none",n.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",n.viewport_.appendChild(n.overlayContainerStopEvent_),n.mapBrowserEventHandler_=null,n.moveTolerance_=e.moveTolerance,n.keyboardEventTarget_=i.keyboardEventTarget,n.keyHandlerKeys_=null,n.controls=i.controls||new ya,n.interactions=i.interactions||new ya,n.overlays_=i.overlays,n.overlayIdIndex_={},n.renderer_=null,n.handleResize_,n.postRenderFunctions_=[],n.tileQueue_=new Uh(n.getTilePriority.bind(n),n.handleTileChange_.bind(n)),n.addChangeListener(Dh,n.handleLayerGroupChanged_),n.addChangeListener(zh,n.handleViewChanged_),n.addChangeListener(kh,n.handleSizeChanged_),n.addChangeListener(Gh,n.handleTargetChanged_),n.setProperties(i.values),n.controls.addEventListener(pa,function(t){t.element.setMap(this)}.bind(n)),n.controls.addEventListener(fa,function(t){t.element.setMap(null)}.bind(n)),n.interactions.addEventListener(pa,function(t){t.element.setMap(this)}.bind(n)),n.interactions.addEventListener(fa,function(t){t.element.setMap(null)}.bind(n)),n.overlays_.addEventListener(pa,function(t){this.addOverlayInternal_(t.element)}.bind(n)),n.overlays_.addEventListener(fa,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(n)),n.controls.forEach(function(t){t.setMap(this)}.bind(n)),n.interactions.forEach(function(t){t.setMap(this)}.bind(n)),n.overlays_.forEach(n.addOverlayInternal_.bind(n)),n}return oc(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.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,n){if(this.frameState_){var i=this.getCoordinateFromPixelInternal(t),r=void 0!==(n=void 0!==n?n:{}).hitTolerance?n.hitTolerance:0,o=void 0!==n.layerFilter?n.layerFilter:S,s=!1!==n.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(i,this.frameState_,r,s,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var n=[];return this.forEachFeatureAtPixel(t,(function(t){n.push(t)}),e),n},e.prototype.forEachLayerAtPixel=function(t,e,n){if(this.frameState_){var i=n||{},r=void 0!==i.hitTolerance?i.hitTolerance:0,o=i.layerFilter||S;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,r,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var n=this.getCoordinateFromPixelInternal(t),i=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:S,r=void 0!==e.hitTolerance?e.hitTolerance:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,r,o,i,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(),n="changedTouches"in t?t.changedTouches[0]:t;return[n.clientX-e.left,n.clientY-e.top]},e.prototype.getTarget=function(){return this.get(Gh)},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 ln(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?Xi(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(Dh)},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var i=t[e].layer.getSource();if(i&&i.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=un(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?Xi(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(kh)},e.prototype.getView=function(){return this.get(zh)},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,n,i){return function(t,e,n,i,r){if(!t||!(n in t.wantedTiles))return Nh;if(!t.wantedTiles[n][e.getKey()])return Nh;var o=t.viewState.center,s=i[0]-o[0],a=i[1]-o[1];return 65536*Math.log(r)+Math.sqrt(s*s+a*a)/r}(this.frameState_,t,e,n,i)},e.prototype.handleBrowserEvent=function(t,e){var n=e||t.type,i=new Oh(n,this,t);this.handleMapBrowserEvent(i)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,n=e.type;if(n===Ih||n===_||n===c){var i=this.getOwnerDocument(),r=this.viewport_.getRootNode?this.viewport_.getRootNode():i,o=e.target;if(this.overlayContainerStopEvent_.contains(o)||!(r===i?i.documentElement:r).contains(o))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var s=this.getInteractions().getArray().slice(),a=s.length-1;a>=0;a--){var l=s[a];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var n=this.maxTilesLoading_,i=n;if(t){var r=t.viewHints;if(r[Es]||r[Ts]){var o=Date.now()-t.time>8;n=o?0:8,i=o?0:2}}e.getTilesLoading()<n&&(e.reprioritize(),e.loadMoreTiles(n,i))}!t||!this.hasListener(Oi)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(Oi,t);for(var s=this.postRenderFunctions_,a=0,l=s.length;a<l;++a)s[a](this,t);s.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.mapBrowserEventHandler_){for(var e=0,n=this.keyHandlerKeys_.length;e<n;++e)oe(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(l,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(_,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(d,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,ot(this.viewport_)}if(t){for(var i in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new Mh(this,this.moveTolerance_),Rh)this.mapBrowserEventHandler_.addEventListener(Rh[i],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(l,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(_,this.boundHandleBrowserEvent_,!!nt&&{passive:!1});var r=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[ie(r,c,this.handleBrowserEvent,this),ie(r,p,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(d,this.handleResize_,!1))}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_&&(oe(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(oe(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=ie(t,In,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=ie(t,s,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(oe),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[ie(t,In,this.render,this),ie(t,s,this.render,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,n=t.length;e<n;++e){var i=t[e].layer;i.hasRenderer()&&i.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.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,n=this.getSize(),i=this.getView(),r=this.frameState_,o=null;if(void 0!==n&&Zn(n)&&i&&i.isDef()){var s=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=i.getState();o={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:Kt(a.center,a.resolution,a.rotation,n),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:n,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:s,wantedTiles:{}}}if(this.frameState_=o,this.renderer_.renderFrame(o),o){if(o.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions),r)(!this.previousExtent_||!ee(this.previousExtent_)&&!kt(o.extent,this.previousExtent_))&&(this.dispatchEvent(new Eh(Ah,this,r)),this.previousExtent_=jt(this.previousExtent_));this.previousExtent_&&!o.viewHints[Es]&&!o.viewHints[Ts]&&!kt(o.extent,this.previousExtent_)&&(this.dispatchEvent(new Eh(jh,this,o)),Ot(o.extent,this.previousExtent_))}this.dispatchEvent(new Eh(Lh,this,o)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(Dh,t)},e.prototype.setSize=function(t){this.set(kh,t)},e.prototype.setTarget=function(t){this.set(Gh,t)},e.prototype.setView=function(t){this.set(zh,t)},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var n=getComputedStyle(t),i=t.offsetWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderRightWidth),r=t.offsetHeight-parseFloat(n.borderTopWidth)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderBottomWidth);isNaN(i)||isNaN(r)||!Zn(e=[i,r])&&(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,n=getComputedStyle(this.viewport_);n.width&&n.height&&(e=[parseInt(n.width,10),parseInt(n.height,10)]),t.setViewportSize(e)}},e}(Dn);var ac=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const lc=function(t){function e(e){var n=t.call(this)||this,i=e.element;return!i||e.target||i.style.pointerEvents||(i.style.pointerEvents="auto"),n.element=i||null,n.target_=null,n.map_=null,n.listenerKeys=[],e.render&&(n.render=e.render),e.target&&n.setTarget(e.target),n}return ac(e,t),e.prototype.disposeInternal=function(){ot(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&ot(this.element);for(var e=0,n=this.listenerKeys.length;e<n;++e)oe(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==T&&this.listenerKeys.push(ie(t,Lh,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}(Dn);var uc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const hc=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this).ulElement_=document.createElement("ul"),n.collapsed_=void 0===i.collapsed||i.collapsed,n.userCollapsed_=n.collapsed_,n.overrideCollapsible_=void 0!==i.collapsible,n.collapsible_=void 0===i.collapsible||i.collapsible,n.collapsible_||(n.collapsed_=!1);var r=void 0!==i.className?i.className:"ol-attribution",o=void 0!==i.tipLabel?i.tipLabel:"Attributions",s=void 0!==i.expandClassName?i.expandClassName:r+"-expand",a=void 0!==i.collapseLabel?i.collapseLabel:"»",l=void 0!==i.collapseClassName?i.collapseClassName:r+"-collpase";"string"==typeof a?(n.collapseLabel_=document.createElement("span"),n.collapseLabel_.textContent=a,n.collapseLabel_.className=l):n.collapseLabel_=a;var h=void 0!==i.label?i.label:"i";"string"==typeof h?(n.label_=document.createElement("span"),n.label_.textContent=h,n.label_.className=s):n.label_=h;var c=n.collapsible_&&!n.collapsed_?n.collapseLabel_:n.label_;n.toggleButton_=document.createElement("button"),n.toggleButton_.setAttribute("type","button"),n.toggleButton_.setAttribute("aria-expanded",String(!n.collapsed_)),n.toggleButton_.title=o,n.toggleButton_.appendChild(c),n.toggleButton_.addEventListener(u,n.handleClick_.bind(n),!1);var p=r+" "+"ol-unselectable "+Mr+(n.collapsed_&&n.collapsible_?" ol-collapsed":"")+(n.collapsible_?"":" ol-uncollapsible"),f=n.element;return f.className=p,f.appendChild(n.toggleButton_),f.appendChild(n.ulElement_),n.renderedAttributions_=[],n.renderedVisible_=!0,n}return uc(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},n=[],i=!0,r=t.layerStatesArray,o=0,s=r.length;o<s;++o){var a=r[o];if(Pi(a,t.viewState)){var l=a.layer.getSource();if(l){var u=l.getAttributions();if(u){var h=u(t);if(h)if(i=i&&!1!==l.getAttributionsCollapsible(),Array.isArray(h))for(var c=0,p=h.length;c<p;++c)h[c]in e||(n.push(h[c]),e[h[c]]=!0);else h in e||(n.push(h),e[h]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(i),n},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),n=e.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!b(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var i=0,r=e.length;i<r;++i){var o=document.createElement("li");o.innerHTML=e[i],this.ulElement_.appendChild(o)}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(Lr),this.collapsed_?rt(this.collapseLabel_,this.label_):rt(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}(lc);var cc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const pc=function(t){function e(e){var n=this,i=e||{};n=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this;var r=void 0!==i.className?i.className:"ol-rotate",o=void 0!==i.label?i.label:"⇧",s=void 0!==i.compassClassName?i.compassClassName:"ol-compass";n.label_=null,"string"==typeof o?(n.label_=document.createElement("span"),n.label_.className=s,n.label_.textContent=o):(n.label_=o,n.label_.classList.add(s));var a=i.tipLabel?i.tipLabel:"Reset rotation",l=document.createElement("button");l.className=r+"-reset",l.setAttribute("type","button"),l.title=a,l.appendChild(n.label_),l.addEventListener(u,n.handleClick_.bind(n),!1);var h=r+" "+"ol-unselectable "+Mr,c=n.element;return c.className=h,c.appendChild(l),n.callResetNorth_=i.resetNorth?i.resetNorth:void 0,n.duration_=void 0!==i.duration?i.duration:250,n.autoHide_=void 0===i.autoHide||i.autoHide,n.rotation_=void 0,n.autoHide_&&n.element.classList.add(Ir),n}return cc(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:X}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var n=e.viewState.rotation;if(n!=this.rotation_){var i="rotate("+n+"rad)";if(this.autoHide_){var r=this.element.classList.contains(Ir);r||0!==n?r&&0!==n&&this.element.classList.remove(Ir):this.element.classList.add(Ir)}this.label_.style.transform=i}this.rotation_=n}},e}(lc);var fc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const dc=function(t){function e(e){var n=this,i=e||{};n=t.call(this,{element:document.createElement("div"),target:i.target})||this;var r=void 0!==i.className?i.className:"ol-zoom",o=void 0!==i.delta?i.delta:1,s=void 0!==i.zoomInClassName?i.zoomInClassName:r+"-in",a=void 0!==i.zoomOutClassName?i.zoomOutClassName:r+"-out",l=void 0!==i.zoomInLabel?i.zoomInLabel:"+",h=void 0!==i.zoomOutLabel?i.zoomOutLabel:"−",c=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",p=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",f=document.createElement("button");f.className=s,f.setAttribute("type","button"),f.title=c,f.appendChild("string"==typeof l?document.createTextNode(l):l),f.addEventListener(u,n.handleClick_.bind(n,o),!1);var d=document.createElement("button");d.className=a,d.setAttribute("type","button"),d.title=p,d.appendChild("string"==typeof h?document.createTextNode(h):h),d.addEventListener(u,n.handleClick_.bind(n,-o),!1);var g=r+" "+"ol-unselectable "+Mr,_=n.element;return _.className=g,_.appendChild(f),_.appendChild(d),n.duration_=void 0!==i.duration?i.duration:250,n}return fc(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 n=e.getZoom();if(void 0!==n){var i=e.getConstrainedZoom(n+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:i,duration:this.duration_,easing:X})):e.setZoom(i)}}},e}(lc);const gc="active";var _c=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function yc(t,e,n,i){var r=t.getZoom();if(void 0!==r){var o=t.getConstrainedZoom(r+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:n,duration:void 0!==i?i:250,easing:X})}}const vc=function(t){function e(e){var n=t.call(this)||this;return n.on,n.once,n.un,e&&e.handleEvent&&(n.handleEvent=e.handleEvent),n.map_=null,n.setActive(!0),n}return _c(e,t),e.prototype.getActive=function(){return this.get(gc)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(gc,t)},e.prototype.setMap=function(t){this.map_=t},e}(Dn);var mc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const xc=function(t){function e(e){var n=t.call(this)||this,i=e||{};return n.delta_=i.delta?i.delta:1,n.duration_=void 0!==i.duration?i.duration:250,n}return mc(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Rh.DBLCLICK){var n=t.originalEvent,i=t.map,r=t.coordinate,o=n.shiftKey?-this.delta_:this.delta_;yc(i.getView(),o,r,this.duration_),n.preventDefault(),e=!0}return!e},e}(vc);var wc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function Cc(t){for(var e=t.length,n=0,i=0,r=0;r<e;r++)n+=t[r].clientX,i+=t[r].clientY;return[n/e,i/e]}const bc=function(t){function e(e){var n=this,i=e||{};return n=t.call(this,i)||this,i.handleDownEvent&&(n.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(n.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(n.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(n.handleUpEvent=i.handleUpEvent),i.stopDown&&(n.stopDown=i.stopDown),n.handlingDownUpSequence=!1,n.trackedPointers_={},n.targetPointers=[],n}return wc(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==Rh.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Rh.POINTERUP){var n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==Rh.POINTERDOWN){var i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==Rh.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===Rh.POINTERDOWN||e===Rh.POINTERDRAG||e===Rh.POINTERUP}(t)){var e=t.originalEvent,n=e.pointerId.toString();t.type==Rh.POINTERUP?delete this.trackedPointers_[n]:(t.type==Rh.POINTERDOWN||n in this.trackedPointers_)&&(this.trackedPointers_[n]=e),this.targetPointers=P(this.trackedPointers_)}},e}(vc);function Sc(t){var e=arguments;return function(t){for(var n=!0,i=0,r=e.length;i<r&&(n=n&&e[i](t));++i);return n}}var Ec=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Tc=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},Oc=S,Rc=function(t){var e=t.originalEvent;return 0==e.button&&!(J&&$&&e.ctrlKey)},Pc=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Ic=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Fc=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},Mc=function(t){var e=t.originalEvent;return St(void 0!==e,56),"mouse"==e.pointerType},Lc=function(t){var e=t.originalEvent;return St(void 0!==e,56),e.isPrimary&&0===e.button},Ac=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const jc=function(t){function e(e){var n=t.call(this,{stopDown:E})||this,i=e||{};n.kinetic_=i.kinetic,n.lastCentroid=null,n.lastPointersCount_,n.panning_=!1;var r=i.condition?i.condition:Sc(Pc,Lc);return n.condition_=i.onFocusOnly?Sc(Tc,r):r,n.noKinetic_=!1,n}return Ac(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,n=Cc(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var i=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],r=t.map.getView();!function(t,e){t[0]*=e,t[1]*=e}(i,r.getResolution()),sa(i,r.getRotation()),r.adjustCenterInternal(i)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,n=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var i=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),o=n.getCenterInternal(),s=e.getPixelFromCoordinateInternal(o),a=e.getCoordinateFromPixelInternal([s[0]-i*Math.cos(r),s[1]-i*Math.sin(r)]);n.animateInternal({center:n.getConstrainedCenter(a),duration:500,easing:X})}return this.panning_&&(this.panning_=!1,n.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}(bc);var Dc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const kc=function(t){function e(e){var n=this,i=e||{};return(n=t.call(this,{stopDown:E})||this).condition_=i.condition?i.condition:Ec,n.lastAngle_=void 0,n.duration_=void 0!==i.duration?i.duration:250,n}return Dc(e,t),e.prototype.handleDragEvent=function(t){if(Mc(t)){var e=t.map,n=e.getView();if(n.getConstraints().rotation!==$h){var i=e.getSize(),r=t.pixel,o=Math.atan2(i[1]/2-r[1],r[0]-i[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_;n.adjustRotationInternal(-s)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!Mc(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!Mc(t)&&(!(!Rc(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(bc);var Gc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const zc=function(t){function e(e){var n=t.call(this)||this;return n.geometry_=null,n.element_=document.createElement("div"),n.element_.style.position="absolute",n.element_.style.pointerEvents="auto",n.element_.className="ol-box "+e,n.map_=null,n.startPixel_=null,n.endPixel_=null,n}return Gc(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,n="px",i=this.element_.style;i.left=Math.min(t[0],e[0])+n,i.top=Math.min(t[1],e[1])+n,i.width=Math.abs(e[0]-t[0])+n,i.height=Math.abs(e[1]-t[1])+n},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_,n=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new nu([n])},e.prototype.getGeometry=function(){return this.geometry_},e}(y);var Nc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Bc="boxstart",Wc="boxdrag",Uc="boxend",Xc="boxcancel",Yc=function(t){function e(e,n,i){var r=t.call(this,e)||this;return r.coordinate=n,r.mapBrowserEvent=i,r}return Nc(e,t),e}(v);const Zc=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var i=e||{};return n.box_=new zc(i.className||"ol-dragbox"),n.minArea_=void 0!==i.minArea?i.minArea:64,i.onBoxEnd&&(n.onBoxEnd=i.onBoxEnd),n.startPixel_=null,n.condition_=i.condition?i.condition:Rc,n.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:n.defaultBoxEndCondition,n}return Nc(e,t),e.prototype.defaultBoxEndCondition=function(t,e,n){var i=n[0]-e[0],r=n[1]-e[1];return i*i+r*r>=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 Yc(Wc,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 Yc(e?Uc:Xc,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 Yc(Bc,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(bc);var Vc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const Kc=function(t){function e(e){var n=this,i=e||{},r=i.condition?i.condition:Ic;return(n=t.call(this,{condition:r,className:i.className||"ol-dragzoom",minArea:i.minArea})||this).duration_=void 0!==i.duration?i.duration:200,n.out_=void 0!==i.out&&i.out,n}return Vc(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),n=this.getGeometry();if(this.out_){var i=e.rotatedExtentForGeometry(n),r=e.getResolutionForExtentInternal(i),o=e.getResolution()/r;(n=n.clone()).scale(o*o)}e.fitInternal(n,{duration:this.duration_,easing:X})},e}(Zc),Hc=37,qc=38,Jc=39,$c=40;var Qc=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const tp=function(t){function e(e){var n=t.call(this)||this,i=e||{};return n.defaultCondition_=function(t){return Pc(t)&&Fc(t)},n.condition_=void 0!==i.condition?i.condition:n.defaultCondition_,n.duration_=void 0!==i.duration?i.duration:100,n.pixelDelta_=void 0!==i.pixelDelta?i.pixelDelta:128,n}return Qc(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==c){var n=t.originalEvent,i=n.keyCode;if(this.condition_(t)&&(i==$c||i==Hc||i==Jc||i==qc)){var r=t.map.getView(),o=r.getResolution()*this.pixelDelta_,s=0,a=0;i==$c?a=-o:i==Hc?s=-o:i==Jc?s=o:a=o;var l=[s,a];sa(l,r.getRotation()),function(t,e,n){var i=t.getCenterInternal();if(i){var r=[i[0]+e[0],i[1]+e[1]];t.animateInternal({duration:void 0!==n?n:250,easing:Z,center:t.getConstrainedCenter(r)})}}(r,l,this.duration_),n.preventDefault(),e=!0}}return!e},e}(vc);var ep=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const np=function(t){function e(e){var n=t.call(this)||this,i=e||{};return n.condition_=i.condition?i.condition:Fc,n.delta_=i.delta?i.delta:1,n.duration_=void 0!==i.duration?i.duration:100,n}return ep(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==c||t.type==p){var n=t.originalEvent,i=n.charCode;if(this.condition_(t)&&(i=="+".charCodeAt(0)||i=="-".charCodeAt(0))){var r=t.map,o=i=="+".charCodeAt(0)?this.delta_:-this.delta_;yc(r.getView(),o,void 0,this.duration_),n.preventDefault(),e=!0}}return!e},e}(vc);const ip=function(){function t(t,e,n){this.decay_=t,this.minVelocity_=e,this.delay_=n,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 n=e-3;n>0&&this.points_[n+2]>t;)n-=3;var i=this.points_[e+2]-this.points_[n+2];if(i<1e3/60)return!1;var r=this.points_[e]-this.points_[n],o=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/i,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}();var rp=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),op="trackpad",sp="wheel";const ap=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,i)||this).totalDelta_=0,n.lastDelta_=0,n.maxDelta_=void 0!==i.maxDelta?i.maxDelta:1,n.duration_=void 0!==i.duration?i.duration:250,n.timeout_=void 0!==i.timeout?i.timeout:80,n.useAnchor_=void 0===i.useAnchor||i.useAnchor,n.constrainResolution_=void 0!==i.constrainResolution&&i.constrainResolution;var r=i.condition?i.condition:Oc;return n.condition_=i.onFocusOnly?Sc(Tc,r):r,n.lastAnchor_=null,n.startTime_=void 0,n.timeoutId_,n.mode_=void 0,n.trackpadEventGap_=400,n.trackpadTimeoutId_,n.deltaPerZoom_=300,n}return rp(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!==_)return!0;var e,n=t.map,i=t.originalEvent;if(i.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==_&&(e=i.deltaY,q&&i.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=Q),i.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var r=Date.now();void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?op:sp);var o=n.getView();if(this.mode_===op&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=r,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var n=-de(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),yc(e,n,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}(vc);var lp=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const up=function(t){function e(e){var n=this,i=e||{},r=i;return r.stopDown||(r.stopDown=E),(n=t.call(this,r)||this).anchor_=null,n.lastAngle_=void 0,n.rotating_=!1,n.rotationDelta_=0,n.threshold_=void 0!==i.threshold?i.threshold:.3,n.duration_=void 0!==i.duration?i.duration:250,n}return lp(e,t),e.prototype.handleDragEvent=function(t){var e=0,n=this.targetPointers[0],i=this.targetPointers[1],r=Math.atan2(i.clientY-n.clientY,i.clientX-n.clientX);if(void 0!==this.lastAngle_){var o=r-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=r;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==$h){var l=s.getViewport().getBoundingClientRect(),u=Cc(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(u),this.rotating_&&(s.render(),a.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(bc);var hp=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const cp=function(t){function e(e){var n=this,i=e||{},r=i;return r.stopDown||(r.stopDown=E),(n=t.call(this,r)||this).anchor_=null,n.duration_=void 0!==i.duration?i.duration:400,n.lastDistance_=void 0,n.lastScaleDelta_=1,n}return hp(e,t),e.prototype.handleDragEvent=function(t){var e=1,n=this.targetPointers[0],i=this.targetPointers[1],r=n.clientX-i.clientX,o=n.clientY-i.clientY,s=Math.sqrt(r*r+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var u=a.getViewport().getBoundingClientRect(),h=Cc(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=a.getCoordinateFromPixelInternal(h),a.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),!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}(bc);function pp(t){var e=t||{},n=new ya,i=new ip(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&n.push(new kc),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&n.push(new xc({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&n.push(new jc({onFocusOnly:e.onFocusOnly,kinetic:i})),(void 0===e.pinchRotate||e.pinchRotate)&&n.push(new up),(void 0===e.pinchZoom||e.pinchZoom)&&n.push(new cp({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(n.push(new tp),n.push(new np({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&n.push(new ap({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&n.push(new Kc({duration:e.zoomDuration})),n}var fp=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();const dp=function(t){function e(e){return(e=O({},e)).controls||(e.controls=function(t){var e=t||{},n=new ya;return(void 0===e.zoom||e.zoom)&&n.push(new dc(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&n.push(new pc(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&n.push(new hc(e.attributionOptions)),n}()),e.interactions||(e.interactions=pp({onFocusOnly:!0})),t.call(this,e)||this}return fp(e,t),e.prototype.createRenderer=function(){return new xh(this)},e}(sc);var gp=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),_p="units",yp="degrees",vp="imperial",mp="nautical",xp="metric",wp="us",Cp=[1,2,5],bp=25.4/.28;const Sp=function(t){function e(e){var n=this,i=e||{},r=void 0!==i.className?i.className:i.bar?"ol-scale-bar":"ol-scale-line";return(n=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this).on,n.once,n.un,n.innerElement_=document.createElement("div"),n.innerElement_.className=r+"-inner",n.element.className=r+" "+Fr,n.element.appendChild(n.innerElement_),n.viewState_=null,n.minWidth_=void 0!==i.minWidth?i.minWidth:64,n.renderedVisible_=!1,n.renderedWidth_=void 0,n.renderedHTML_="",n.addChangeListener(_p,n.handleUnitsChanged_),n.setUnits(i.units||xp),n.scaleBar_=i.bar||!1,n.scaleBarSteps_=i.steps||4,n.scaleBarText_=i.text||!1,n.dpi_=i.dpi||void 0,n}return gp(e,t),e.prototype.getUnits=function(){return this.get(_p)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(_p,t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,n=t.projection,i=this.getUnits(),r=i==yp?pe.DEGREES:pe.METERS,o=Ze(n,t.resolution,e,r),s=this.minWidth_*(this.dpi_||bp)/bp,a=s*o,l="";if(i==yp){var u=ce[pe.DEGREES];(a*=u)<u/60?(l="″",o*=3600):a<u?(l="′",o*=60):l="°"}else i==vp?a<.9144?(l="in",o/=.0254):a<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):i==mp?(o/=1852,l="nm"):i==xp?a<.001?(l="μm",o*=1e6):a<1?(l="mm",o*=1e3):a<1e3?l="m":(l="km",o/=1e3):i==wp?a<.9144?(l="in",o*=39.37):a<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):St(!1,33);for(var h,c,p,f,d=3*Math.floor(Math.log(s*o)/Math.log(10));;){p=Math.floor(d/3);var g=Math.pow(10,p);if(h=Cp[(d%3+3)%3]*g,c=Math.round(h/o),isNaN(c))return this.element.style.display="none",void(this.renderedVisible_=!1);if(c>=s)break;++d}f=this.scaleBar_?this.createScaleBar(c,h,l):h.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=f&&(this.innerElement_.innerHTML=f,this.renderedHTML_=f),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,n){for(var i="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),r=[],o=t/this.scaleBarSteps_,s="#ffffff",a=0;a<this.scaleBarSteps_;a++)0===a&&r.push(this.createMarker("absolute",a)),r.push('<div><div class="ol-scale-singlebar" style="width: '+o+"px;background-color: "+s+';"></div>'+this.createMarker("relative",a)+(a%2==0||2===this.scaleBarSteps_?this.createStepText(a,t,!1,e,n):"")+"</div>"),a===this.scaleBarSteps_-1&&r.push(this.createStepText(a+1,t,!0,e,n)),s="#ffffff"===s?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+i+"</div>":"")+r.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,n,i,r){var o=(0===t?0:Math.round(i/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+r);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: "+(n?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=Ze(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||bp,n=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*n*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(lc);let Ep;!function(t){t.Zero="zero",t.Coordinates="coords"}(Ep||(Ep={}));const Tp=new i.Registry((()=>[{id:Ep.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:Ep.Coordinates,name:"Coordinates"}]));class Op extends r.PureComponent{constructor(t){var e,n,i;super(t),e=this,n="style",i=Rp(Wa.config.theme),n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i}render(){const{topRight:t,bottomLeft:e}=this.props;return(0,nl.jsxs)("div",{className:this.style.overlay,children:[Boolean(null==t?void 0:t.length)&&(0,nl.jsx)("div",{className:this.style.TR,children:t}),Boolean(null==e?void 0:e.length)&&(0,nl.jsx)("div",{className:this.style.BL,children:e})]})}}const Rp=(0,o.stylesFactory)((t=>({overlay:ol.css`
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 500;
    pointer-events: none;
  `,TR:ol.css`
    position: absolute;
    top: 8px;
    right: 8px;
    pointer-events: auto;
  `,BL:ol.css`
    position: absolute;
    bottom: 8px;
    left: 8px;
    pointer-events: auto;
  `})));var Pp,Ip;function Fp(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Mp extends r.PureComponent{constructor(t){super(t),Fp(this,"style",Lp(or.vc.theme)),Fp(this,"updateViewState",(()=>{const t=this.props.map.getView();this.setState({zoom:t.getZoom(),center:tn(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,nl.jsx)("div",{className:this.style.infoWrap,children:(0,nl.jsx)("table",{children:(0,nl.jsxs)("tbody",{children:[(0,nl.jsxs)("tr",{children:[Pp||(Pp=(0,nl.jsx)("th",{children:"Zoom:"})),(0,nl.jsx)("td",{children:null==t?void 0:t.toFixed(1)})]}),(0,nl.jsxs)("tr",{children:[Ip||(Ip=(0,nl.jsx)("th",{children:"Center: "})),(0,nl.jsxs)("td",{children:[e[0].toFixed(5),", ",e[1].toFixed(5)]})]})]})})})}}const Lp=(0,o.stylesFactory)((t=>({infoWrap:ol.css`
    color: ${t.colors.text};
    background: ${ka()(t.colors.panelBg).setAlpha(.7).toString()};
    border-radius: 2px;
    padding: 8px;
  `})));var Ap=n("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js");n("./node_modules/ol/ol.css");var jp=n("./public/app/plugins/panel/geomap/components/DataHoverView.tsx");function Dp(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}let kp,Gp;class zp extends r.Component{constructor(t){var e;super(t),Dp(this,"globalCSS",(e=Wa.config.theme2,Ap.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);
    }
  `)),Dp(this,"counter",0),Dp(this,"map",void 0),Dp(this,"basemap",void 0),Dp(this,"layers",[]),Dp(this,"mouseWheelZoom",void 0),Dp(this,"style",Np(Wa.config.theme)),Dp(this,"hoverPayload",{point:{},pageX:-1,pageY:-1}),Dp(this,"hoverEvent",new i.DataHoverEvent(this.hoverPayload)),Dp(this,"initMapRef",(async t=>{if(this.map&&this.map.dispose(),!t)return void(this.map=void 0);const{options:e}=this.props;this.map=new dp({view:this.initMapView(e.view),pixelRatio:1,layers:[],controls:[],target:t,interactions:pp({mouseWheelZoom:!1})}),this.mouseWheelZoom=new ap,this.map.addInteraction(this.mouseWheelZoom),this.initControls(e.controls),this.initBasemap(e.basemap),await this.initLayers(e.layers),this.forceUpdate(),this.map.on("pointermove",this.pointerMoveListener),this.map.getViewport().addEventListener("mouseout",(t=>{this.props.eventBus.publish(new i.DataHoverClearEvent({point:{}}))}))})),Dp(this,"pointerMoveListener",(t=>{if(!this.map)return;const e=t.originalEvent,n=this.map.getEventPixel(e),i=qe(this.map.getCoordinateFromPixel(n)),{hoverPayload:r}=this;r.pageX=e.pageX,r.pageY=e.pageY,r.point={lat:i[1],lon:i[0]},r.data=void 0,r.columnIndex=void 0,r.rowIndex=void 0;let o={};const s=[];this.map.forEachFeatureAtPixel(n,((t,e,n)=>{if(!r.data){const e=t.getProperties(),n=e.frame;n&&(r.data=o.data=n,r.rowIndex=o.rowIndex=e.rowIndex)}s.push({feature:t,layer:e,geo:n})})),this.hoverPayload.features=s.length?s:void 0,this.props.eventBus.publish(this.hoverEvent);const a=this.state.ttip;o.data===(null==a?void 0:a.data)&&o.rowIndex===(null==a?void 0:a.rowIndex)||this.setState({ttip:Object.assign({},r)})})),this.state={}}componentDidMount(){Gp=this}shouldComponentUpdate(t){if(!this.map)return!0;this.props.height===t.height&&this.props.width===t.width||this.map.updateSize();let e=!1;return this.props.options!==t.options&&(e=this.optionsChanged(t.options)),(e||this.props.data!==t.data)&&this.dataChanged(t.data),!0}optionsChanged(t){let e=!1;const n=this.props.options;var i,r;(console.log("options changed!",t),t.view!==n.view&&(console.log("View changed"),this.map.setView(this.initMapView(t.view))),t.controls!==n.controls)&&(console.log("Controls changed"),this.initControls(null!==(i=t.controls)&&void 0!==i?i:{showZoom:!0,showAttribution:!0}));(t.basemap!==n.basemap&&(console.log("Basemap changed"),this.initBasemap(t.basemap),e=!0),t.layers!==n.layers)&&(console.log("layers changed"),this.initLayers(null!==(r=t.layers)&&void 0!==r?r:[]),e=!0);return e}dataChanged(t){for(const e of this.layers)e.handler.update&&e.handler.update(t)}async initBasemap(t){var e,n;if(!this.map)return;null!==(e=t)&&void 0!==e&&e.type&&!Wa.config.geomapDisableCustomBaseLayer||(t=th);const i=null!==(n=nh.getIfExists(t.type))&&void 0!==n?n:eh,r=(await i.create(this.map,t,Wa.config.theme2)).init();this.basemap&&(this.map.removeLayer(this.basemap),this.basemap.dispose()),this.basemap=r,this.map.getLayers().insertAt(0,this.basemap)}async initLayers(t){for(const t of this.layers)this.map.removeLayer(t.layer),t.layer.dispose();t||(t=[]);const e=[];this.layers=[];for(const n of t){const t=nh.getIfExists(n.type);if(!t){console.warn("unknown layer type: ",n);continue}const i=await t.create(this.map,n,Wa.config.theme2),r=i.init();r.___handler=i,this.map.addLayer(r),this.layers.push({config:n,layer:r,handler:i}),i.legend&&e.push((0,nl.jsx)("div",{children:i.legend},""+this.counter++))}this.setState({bottomLeft:e}),this.dataChanged(this.props.data)}initMapView(t){let e=new rc({center:[0,0],zoom:1,showFullExtent:!0});t.shared&&(kp?e=kp:kp=e);const n=Tp.getIfExists(t.id);if(n){let a;var i,r,o,s;if(null==n.lat)if(n.id===Ep.Coordinates)a=[null!==(i=t.lon)&&void 0!==i?i:0,null!==(r=t.lat)&&void 0!==r?r:0];else console.log("TODO, view requires special handling",n);else a=[null!==(o=n.lon)&&void 0!==o?o:0,null!==(s=n.lat)&&void 0!==s?s:0];a&&e.setCenter(He(a))}return t.maxZoom&&e.setMaxZoom(t.maxZoom),t.minZoom&&e.setMaxZoom(t.minZoom),t.zoom&&e.setZoom(t.zoom),e}initControls(t){if(!this.map)return;this.map.getControls().clear(),t.showZoom&&this.map.addControl(new dc),t.showScale&&this.map.addControl(new Sp({units:t.scaleUnits,minWidth:100})),this.mouseWheelZoom.setActive(Boolean(t.mouseWheelZoom)),t.showAttribution&&this.map.addControl(new hc({collapsed:!0,collapsible:!0}));let e=[];t.showDebug&&(e=[(0,nl.jsx)(Mp,{map:this.map},"debug")]),this.setState({topRight:e})}render(){const{ttip:t,topRight:e,bottomLeft:n}=this.state;return(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)(Ap.xB,{styles:this.globalCSS}),(0,nl.jsxs)("div",{className:this.style.wrap,children:[(0,nl.jsx)("div",{className:this.style.map,ref:this.initMapRef}),(0,nl.jsx)(Op,{bottomLeft:n,topRight:e})]}),(0,nl.jsx)(o.Portal,{children:t&&t.data&&(0,nl.jsx)(o.VizTooltipContainer,{position:{x:t.pageX,y:t.pageY},offset:{x:10,y:10},children:(0,nl.jsx)(jp.H,Object.assign({},t))})})]})}}const Np=(0,o.stylesFactory)((t=>({wrap:ol.css`
    position: relative;
    width: 100%;
    height: 100%;
  `,map:ol.css`
    position: absolute;
    z-index: 0;
    width: 100%;
    height: 100%;
  `})));var Bp,Wp=n("./public/app/features/dimensions/editors/NumberInput.tsx");const Up=({value:t,onChange:e,context:n})=>{var i;const s=(0,r.useMemo)((()=>{const e=[];return null!=t&&t.id?e.push(t.id):e.push(Tp.list()[0].id),Tp.selectOptions(e)}),[null==t?void 0:t.id]),a=(0,r.useCallback)((()=>{const n=null==Gp?void 0:Gp.map;if(n){const i=n.getView(),r=i.getCenter();if(r){const n=qe(r,i.getProjection());e(Object.assign({},t,{id:Ep.Coordinates,lon:+n[0].toFixed(6),lat:+n[1].toFixed(6),zoom:+i.getZoom().toFixed(2)}))}}}),[t,e]),l=(0,r.useCallback)((n=>{const i=Tp.getIfExists(n.value);var r,o,s;i&&e(Object.assign({},t,{id:i.id,lat:null!==(r=i.lat)&&void 0!==r?r:t.lat,lon:null!==(o=i.lon)&&void 0!==o?o:t.lon,zoom:null!==(s=i.zoom)&&void 0!==s?s:t.zoom}))}),[t,e]);return(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)(o.InlineFieldRow,{children:(0,nl.jsx)(o.InlineField,{label:"View",labelWidth:10,grow:!0,children:(0,nl.jsx)(o.Select,{menuShouldPortal:!0,options:s.options,value:s.current,onChange:l})})}),(null==t?void 0:t.id)===Ep.Coordinates&&(0,nl.jsxs)(nl.Fragment,{children:[(0,nl.jsx)(o.InlineFieldRow,{children:(0,nl.jsx)(o.InlineField,{label:"Latitude",labelWidth:10,grow:!0,children:(0,nl.jsx)(Wp.Y,{value:t.lat,min:-90,max:90,step:.001,onChange:n=>{e(Object.assign({},t,{lat:n}))}})})}),(0,nl.jsx)(o.InlineFieldRow,{children:(0,nl.jsx)(o.InlineField,{label:"Longitude",labelWidth:10,grow:!0,children:(0,nl.jsx)(Wp.Y,{value:t.lon,min:-180,max:180,step:.001,onChange:n=>{e(Object.assign({},t,{lon:n}))}})})})]}),(0,nl.jsx)(o.InlineFieldRow,{children:(0,nl.jsx)(o.InlineField,{label:"Zoom",labelWidth:10,grow:!0,children:(0,nl.jsx)(Wp.Y,{value:null!==(i=t.zoom)&&void 0!==i?i:1,min:1,max:18,step:.01,onChange:n=>{e(Object.assign({},t,{zoom:n}))}})})}),(0,nl.jsx)(o.VerticalGroup,{children:(0,nl.jsx)(o.Button,{variant:"secondary",size:"sm",fullWidth:!0,onClick:a,children:Bp||(Bp=(0,nl.jsx)("span",{children:"Use current map settings"}))})})]})},Xp={id:Ep.Zero,lat:0,lon:0,zoom:1};function Yp(t){const e=+t;return isNaN(e)?void 0:e}const Zp=new i.PanelPlugin(zp).setNoPadding().setPanelChangeHandler(((t,e,n,r)=>{if("grafana-worldmap-panel"===e&&n.angular){const{fieldConfig:e,options:o}=function(t){const e={defaults:{},overrides:[]},n={view:{id:Ep.Zero},controls:{showZoom:!0,mouseWheelZoom:Boolean(t.mouseWheelZoom)},basemap:{type:"default"},layers:[]};let r=Yp(t.decimals);r&&(e.defaults.decimals=r);if(t.thresholds&&t.colors){const n=t.thresholds.split(",").map((t=>Number(t.trim()))),r=[];for(const e of t.colors){const t=r.length-1;t>=0?r.push({value:n[t],color:e}):r.push({value:-1/0,color:e})}e.defaults.thresholds={mode:i.ThresholdsMode.Absolute,steps:r}}r=Yp(t.initialZoom),r&&(n.view.zoom=r);const o={"(0°, 0°)":Ep.Zero,"North America":"north-america",Europe:"europe","West Asia":"west-asia","SE Asia":"se-asia","Last GeoHash":Ep.Coordinates};return n.view.id=o[t.mapCenter],n.view.lat=Yp(t.mapCenterLatitude),n.view.lon=Yp(t.mapCenterLongitude),{fieldConfig:e,options:n}}(Object.assign({},n.angular,{fieldConfig:r}));return t.fieldConfig=e,o}return{}})).useFieldConfig().setPanelOptions((t=>{let e=["Map view"];t.addCustomEditor({category:e,id:"view",path:"view",name:"Initial view",description:"This location will show when the panel first loads",editor:Up,defaultValue:Xp}),t.addBooleanSwitch({category:e,path:"view.shared",description:"Use the same view across multiple panels.  Note: this may require a dashboard reload.",name:"Share view",defaultValue:Xp.shared}),t.addCustomEditor({category:["Base layer"],id:"basemap",path:"basemap",name:"Base layer",editor:fh,defaultValue:th}),t.addCustomEditor({category:["Data layer"],id:"layers",path:"layers",name:"Data layer",editor:gh,defaultValue:[gl]}),e=["Map controls"],t.addBooleanSwitch({category:e,path:"controls.showZoom",description:"show buttons in the upper left",name:"Show zoom control",defaultValue:!0}).addBooleanSwitch({category:e,path:"controls.mouseWheelZoom",name:"Mouse wheel zoom",defaultValue:!0}).addBooleanSwitch({category:e,path:"controls.showAttribution",name:"Show attribution",description:"Show the map source attribution info in the lower right",defaultValue:!0}).addBooleanSwitch({category:e,path:"controls.showScale",name:"Show scale",description:"Indicate map scale",defaultValue:!1}).addBooleanSwitch({category:e,path:"controls.showDebug",name:"Show debug",description:"show map info",defaultValue:!1})}))},"./node_modules/css-loader/dist/runtime/api.js":t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,i){"string"==typeof t&&(t=[[null,t,""]]);var r={};if(i)for(var o=0;o<this.length;o++){var s=this[o][0];null!=s&&(r[s]=!0)}for(var a=0;a<t.length;a++){var l=[].concat(t[a]);i&&r[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),e.push(l))}},e}},"./node_modules/css-loader/dist/runtime/cssWithMappingToString.js":t=>{"use strict";function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var i,r,o=[],s=!0,a=!1;try{for(n=n.call(t);!(s=(i=n.next()).done)&&(o.push(i.value),!e||o.length!==e);s=!0);}catch(t){a=!0,r=t}finally{try{s||null==n.return||n.return()}finally{if(a)throw r}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}t.exports=function(t){var n=e(t,4),i=n[1],r=n[3];if(!r)return i;if("function"==typeof btoa){var o=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o),a="/*# ".concat(s," */"),l=r.sources.map((function(t){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(t," */")}));return[i].concat(l).concat([a]).join("\n")}return[i].join("\n")}},"./node_modules/rbush/rbush.min.js":function(t){t.exports=function(){"use strict";function t(t,i,r,o,s){!function t(n,i,r,o,s){for(;o>r;){if(o-r>600){var a=o-r+1,l=i-r+1,u=Math.log(a),h=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*h*(a-h)/a)*(l-a/2<0?-1:1);t(n,i,Math.max(r,Math.floor(i-l*h/a+c)),Math.min(o,Math.floor(i+(a-l)*h/a+c)),s)}var p=n[i],f=r,d=o;for(e(n,r,i),s(n[o],p)>0&&e(n,r,o);f<d;){for(e(n,f,d),f++,d--;s(n[f],p)<0;)f++;for(;s(n[d],p)>0;)d--}0===s(n[r],p)?e(n,r,d):e(n,++d,o),d<=i&&(r=d+1),i<=d&&(o=d-1)}}(t,i,r||0,o||t.length-1,s||n)}function e(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function n(t,e){return t<e?-1:t>e?1:0}var i=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 r(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i<e.length;i++)if(n(t,e[i]))return i;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,i,r){r||(r=d(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var o=e;o<n;o++){var s=t.children[o];a(r,t.leaf?i(s):s)}return r}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function h(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 f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,n,i,r,o){for(var s=[n,i];s.length;)if(!((i=s.pop())-(n=s.pop())<=r)){var a=n+Math.ceil((i-n)/r/2)*r;t(e,a,n,i,o),s.push(n,a,a,i)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!f(t,e))return n;for(var i=this.toBBox,r=[];e;){for(var o=0;o<e.children.length;o++){var s=e.children[o],a=e.leaf?i(s):s;f(t,a)&&(e.leaf?n.push(s):p(t,a)?this._all(s,n):r.push(s))}e=r.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!f(t,e))return!1;for(var n=[];e;){for(var i=0;i<e.children.length;i++){var r=e.children[i],o=e.leaf?this.toBBox(r):r;if(f(t,o)){if(e.leaf||p(t,o))return!0;n.push(r)}}e=n.pop()}return!1},i.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 n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=d([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,i,o,s=this.data,a=this.toBBox(t),l=[],u=[];s||l.length;){if(s||(s=l.pop(),i=l[l.length-1],n=u.pop(),o=!0),s.leaf){var h=r(t,s.children,e);if(-1!==h)return s.children.splice(h,1),l.push(s),this._condense(l),this}o||s.leaf||!p(s,a)?i?(n++,s=i.children[n],o=!1):s=null:(l.push(s),u.push(n),n=0,i=s,s=s.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,i){var r,s=n-e+1,a=this._maxEntries;if(s<=a)return o(r=d(t.slice(e,n+1)),this.toBBox),r;i||(i=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,i-1))),(r=d([])).leaf=!1,r.height=i;var l=Math.ceil(s/a),u=l*Math.ceil(Math.sqrt(a));g(t,e,n,u,this.compareMinX);for(var h=e;h<=n;h+=u){var c=Math.min(h+u-1,n);g(t,h,c,l,this.compareMinY);for(var p=h;p<=c;p+=l){var f=Math.min(p+l-1,c);r.children.push(this._build(t,p,f,i-1))}}return o(r,this.toBBox),r},i.prototype._chooseSubtree=function(t,e,n,i){for(;i.push(e),!e.leaf&&i.length-1!==n;){for(var r=1/0,o=1/0,s=void 0,a=0;a<e.children.length;a++){var l=e.children[a],u=h(l),c=(p=t,f=l,(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-u);c<o?(o=c,r=u<r?u:r,s=l):c===o&&u<r&&(r=u,s=l)}e=s||e.children[0]}var p,f;return e},i.prototype._insert=function(t,e,n){var i=n?t:this.toBBox(t),r=[],o=this._chooseSubtree(i,this.data,e,r);for(o.children.push(t),a(o,i);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(i,r,e)},i.prototype._split=function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var s=this._chooseSplitIndex(n,r,i),a=d(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},i.prototype._splitRoot=function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var i,r,o,a,l,u,c,p=1/0,f=1/0,d=e;d<=n-e;d++){var g=s(t,0,d,this.toBBox),_=s(t,d,n,this.toBBox),y=(r=g,o=_,a=void 0,l=void 0,u=void 0,c=void 0,a=Math.max(r.minX,o.minX),l=Math.max(r.minY,o.minY),u=Math.min(r.maxX,o.maxX),c=Math.min(r.maxY,o.maxY),Math.max(0,u-a)*Math.max(0,c-l)),v=h(g)+h(_);y<p?(p=y,i=d,f=v<f?v:f):y===p&&v<f&&(f=v,i=d)}return i||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var i=t.leaf?this.compareMinX:l,r=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,n,i)<this._allDistMargin(t,e,n,r)&&t.children.sort(i)},i.prototype._allDistMargin=function(t,e,n,i){t.children.sort(i);for(var r=this.toBBox,o=s(t,0,e,r),l=s(t,n-e,n,r),u=c(o)+c(l),h=e;h<n-e;h++){var p=t.children[h];a(o,t.leaf?r(p):p),u+=c(o)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];a(l,t.leaf?r(d):d),u+=c(l)}return u},i.prototype._adjustParentBBoxes=function(t,e,n){for(var i=n;i>=0;i--)a(e[i],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},i}()},"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i<e.length;i++)if(e[i].identifier===t){n=i;break}return n}function i(t,i){for(var o={},s=[],a=0;a<t.length;a++){var l=t[a],u=i.base?l[0]+i.base:l[0],h=o[u]||0,c="".concat(u," ").concat(h);o[u]=h+1;var p=n(c),f={css:l[1],media:l[2],sourceMap:l[3]};-1!==p?(e[p].references++,e[p].updater(f)):e.push({identifier:c,updater:r(f,i),references:1}),s.push(c)}return s}function r(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n.update(t=e)}else n.remove()}}t.exports=function(t,r){var o=i(t=t||[],r=r||{});return function(t){t=t||[];for(var s=0;s<o.length;s++){var a=n(o[s]);e[a].references--}for(var l=i(t,r),u=0;u<o.length;u++){var h=n(o[u]);0===e[h].references&&(e[h].updater(),e.splice(h,1))}o=l}}},"./node_modules/style-loader/dist/runtime/insertBySelector.js":t=>{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},"./node_modules/style-loader/dist/runtime/insertStyleElement.js":t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e),e}},"./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},"./node_modules/style-loader/dist/runtime/styleDomAPI.js":t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i=n.css,r=n.media,o=n.sourceMap;r?t.setAttribute("media",r):t.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleTagTransform(i,t)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},"./node_modules/style-loader/dist/runtime/styleTagTransform.js":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))}}}}]);
//# sourceMappingURL=9646.8128b05ac04b15cbf98d.js.map