@opensystemslab/map 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,9 +30,9 @@ const ct=t=>e=>{return"function"==typeof e?(i=t,o=e,window.customElements.define
30
30
  * @license
31
31
  * Copyright 2017 Google LLC
32
32
  * SPDX-License-Identifier: BSD-3-Clause
33
- */function mt(t){return ft(l(s({},t),{state:!0,attribute:!1}))}var vt=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}(),yt="propertychange",_t=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function bt(t,e){return t>e?1:t<e?-1:0}function xt(t,e,i){var o=t.length;if(t[0]<=e)return 0;if(e<=t[o-1])return o-1;var n=void 0;if(i>0){for(n=1;n<o;++n)if(t[n]<e)return n-1}else if(i<0){for(n=1;n<o;++n)if(t[n]<=e)return n}else for(n=1;n<o;++n){if(t[n]==e)return n;if(t[n]<e)return"function"==typeof i?i(e,t[n-1],t[n])>0?n-1:n:t[n-1]-e<e-t[n]?n-1:n}return o-1}function kt(t,e,i){for(;e<i;){var o=t[e];t[e]=t[i],t[i]=o,++e,--i}}function wt(t,e){for(var i=Array.isArray(e)?e:[e],o=i.length,n=0;n<o;n++)t[t.length]=i[n]}function St(t,e){var i=t.length;if(i!==e.length)return!1;for(var o=0;o<i;o++)if(t[o]!==e[o])return!1;return!0}function Ct(){return!0}function zt(){return!1}function Et(){}var Tt="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),o=1,n=arguments.length;o<n;++o){var r=arguments[o];if(null!=r)for(var a in r)r.hasOwnProperty(a)&&(i[a]=r[a])}return i};function Pt(t){for(var e in t)delete t[e]}var Ot="function"==typeof Object.values?Object.values:function(t){var e=[];for(var i in t)e.push(t[i]);return e};function Ft(t){var e;for(e in t)return!1;return!e}var Rt,It=(Rt=function(t,e){return(Rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}Rt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),Mt=function(t){function e(e){var i=t.call(this)||this;return i.eventTarget_=e,i.pendingRemovals_=null,i.dispatching_=null,i.listeners_=null,i}return It(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var i=this.listeners_||(this.listeners_={}),o=i[t]||(i[t]=[]);-1===o.indexOf(e)&&o.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new vt(t):t,i=e.type;e.target||(e.target=this.eventTarget_||this);var o,n=this.listeners_&&this.listeners_[i];if(n){var r=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in r||(r[i]=0,a[i]=0),++r[i];for(var s=0,l=n.length;s<l;++s)if(!1===(o="handleEvent"in n[s]?n[s].handleEvent(e):n[s].call(this,e))||e.propagationStopped){o=!1;break}if(--r[i],0===r[i]){var u=a[i];for(delete a[i];u--;)this.removeEventListener(i,Et);delete r[i]}return o}},e.prototype.disposeInternal=function(){this.listeners_&&Pt(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 i=this.listeners_&&this.listeners_[t];if(i){var o=i.indexOf(e);-1!==o&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[o]=Et,++this.pendingRemovals_[t]):(i.splice(o,1),0===i.length&&delete this.listeners_[t]))}},e}(_t),jt="change",Dt="error",At="contextmenu",Lt="click",Gt="dblclick",Nt="keydown",Bt="keypress",Vt="load",qt="resize",Wt="touchmove",Ut="wheel";function Xt(t,e,i,o,n){if(o&&o!==t&&(i=i.bind(o)),n){var r=i;i=function(){t.removeEventListener(e,i),r.apply(this,arguments)}}var a={target:t,type:e,listener:i};return t.addEventListener(e,i),a}function Kt(t,e,i,o){return Xt(t,e,i,o,!0)}function Yt(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Pt(t))}var Zt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ht=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 Zt(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(jt)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=Xt(this,t[n],e);return o}return Xt(this,t,e)},e.prototype.onceInternal=function(t,e){var i;if(Array.isArray(t)){var o=t.length;i=new Array(o);for(var n=0;n<o;++n)i[n]=Kt(this,t[n],e)}else i=Kt(this,t,e);return e.ol_key=i,i},e.prototype.unInternal=function(t,e){var i=e.ol_key;if(i)!function(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;++e)Yt(t[e]);else Yt(t)}(i);else if(Array.isArray(t))for(var o=0,n=t.length;o<n;++o)this.removeEventListener(t[o],e);else this.removeEventListener(t,e)},e}(Mt);Ht.prototype.on,Ht.prototype.once,Ht.prototype.un;var $t=Ht;function Jt(){return function(){throw new Error("Unimplemented abstract method.")}()}var Qt=0;function te(t){return t.ol_uid||(t.ol_uid=String(++Qt))}var ee=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ie=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.key=i,n.oldValue=o,n}return ee(e,t),e}(vt),oe=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,te(i),i.values_=null,void 0!==e&&i.setProperties(e),i}return ee(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_&&Tt({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var i;i="change:"+t,this.dispatchEvent(new ie(i,t,e)),i=yt,this.dispatchEvent(new ie(i,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,i){var o=this.values_||(this.values_={});if(i)o[t]=e;else{var n=o[t];o[t]=e,n!==e&&this.notify(t,n)}},e.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},e.prototype.applyProperties=function(t){t.values_&&Tt(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var i=this.values_[t];delete this.values_[t],Ft(this.values_)&&(this.values_=null),e||this.notify(t,i)}},e}($t),ne="postrender",re="movestart",ae="moveend",se="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",le=-1!==se.indexOf("firefox");-1!==se.indexOf("safari")&&se.indexOf("chrom");var ue=-1!==se.indexOf("webkit")&&-1==se.indexOf("edge"),pe=-1!==se.indexOf("macintosh"),he="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,de="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,ce="undefined"!=typeof Image&&Image.prototype.decode,ge=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(i){}return t}();function fe(t,e,i,o){var n;return i&&i.length?n=i.shift():de?n=new OffscreenCanvas(t||300,e||300):(n=document.createElement("canvas")).style.all="unset",t&&(n.width=t),e&&(n.height=e),n.getContext("2d",o)}function me(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function ve(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var ye=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_e=function(t){function e(e){var i=t.call(this)||this,o=e.element;return!o||e.target||o.style.pointerEvents||(o.style.pointerEvents="auto"),i.element=o||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return ye(e,t),e.prototype.disposeInternal=function(){ve(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&ve(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)Yt(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==Et&&this.listenerKeys.push(Xt(t,ne,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}(oe),be=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"),xe=["style","variant","weight","size","lineHeight","family"],ke=function(t){var e=t.match(be);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},o=0,n=xe.length;o<n;++o){var r=e[o+1];void 0!==r&&(i[xe[o]]=r)}return i.families=i.family.split(/,\s?/),i};function we(t){return 1===t?"":String(Math.round(100*t)/100)}var Se="opacity",Ce="visible",ze="extent",Ee="zIndex",Te="maxResolution",Pe="minResolution",Oe="maxZoom",Fe="minZoom",Re="source",Ie=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Me=function(t){function e(e){var i=this,o="Assertion failed. See https://openlayers.org/en/"+("v"+"6.9.0".split("-")[0])+"/doc/errors/#"+e+" for details.";return(i=t.call(this,o)||this).code=e,i.name="AssertionError",i.message=o,i}return Ie(e,t),e}(Error);function je(t,e){if(!t)throw new Me(e)}function De(t,e,i){return Math.min(Math.max(t,e),i)}var Ae="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Le="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Ge(t,e,i,o,n,r){var a=n-i,s=r-o;if(0!==a||0!==s){var l=((t-i)*a+(e-o)*s)/(a*a+s*s);l>1?(i=n,o=r):l>0&&(i+=a*l,o+=s*l)}return Ne(t,e,i,o)}function Ne(t,e,i,o){var n=i-t,r=o-e;return n*n+r*r}function Be(t){return t*Math.PI/180}function Ve(t,e){var i=t%e;return i*e<0?i+e:i}function qe(t,e,i){return t+i*(e-t)}var We=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ue=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=Tt({},e);return"object"==typeof e.properties&&(delete o.properties,Tt(o,e.properties)),o[Se]=void 0!==e.opacity?e.opacity:1,je("number"==typeof o[Se],64),o[Ce]=void 0===e.visible||e.visible,o[Ee]=e.zIndex,o[Te]=void 0!==e.maxResolution?e.maxResolution:1/0,o[Pe]=void 0!==e.minResolution?e.minResolution:0,o[Fe]=void 0!==e.minZoom?e.minZoom:-1/0,o[Oe]=void 0!==e.maxZoom?e.maxZoom:1/0,i.className_=void 0!==o.className?e.className:"ol-layer",delete o.className,i.setProperties(o),i.state_=null,i}return We(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},i=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!==i||e.managed?i:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return Jt()},e.prototype.getLayerStatesArray=function(t){return Jt()},e.prototype.getExtent=function(){return this.get(ze)},e.prototype.getMaxResolution=function(){return this.get(Te)},e.prototype.getMinResolution=function(){return this.get(Pe)},e.prototype.getMinZoom=function(){return this.get(Fe)},e.prototype.getMaxZoom=function(){return this.get(Oe)},e.prototype.getOpacity=function(){return this.get(Se)},e.prototype.getSourceState=function(){return Jt()},e.prototype.getVisible=function(){return this.get(Ce)},e.prototype.getZIndex=function(){return this.get(Ee)},e.prototype.setExtent=function(t){this.set(ze,t)},e.prototype.setMaxResolution=function(t){this.set(Te,t)},e.prototype.setMinResolution=function(t){this.set(Pe,t)},e.prototype.setMaxZoom=function(t){this.set(Oe,t)},e.prototype.setMinZoom=function(t){this.set(Fe,t)},e.prototype.setOpacity=function(t){je("number"==typeof t,64),this.set(Se,t)},e.prototype.setVisible=function(t){this.set(Ce,t)},e.prototype.setZIndex=function(t){this.set(Ee,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(oe),Xe="prerender",Ke="postrender",Ye="precompose",Ze="postcompose",He="rendercomplete",$e="undefined",Je="ready",Qe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ti(t,e){if(!t.visible)return!1;var i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;var o=e.zoom;return o>t.minZoom&&o<=t.maxZoom}var ei=function(t){function e(e){var i=this,o=Tt({},e);delete o.source,(i=t.call(this,o)||this).on,i.once,i.un,i.mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addChangeListener(Re,i.handleSourcePropertyChange_);var n=e.source?e.source:null;return i.setSource(n),i}return Qe(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(Re)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():$e},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Yt(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=Xt(t,jt,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 i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Yt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Yt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Xt(t,Ye,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);je(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=Xt(this,jt,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Re,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Ue),ii=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),oi=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).ulElement_=document.createElement("ul"),i.collapsed_=void 0===o.collapsed||o.collapsed,i.userCollapsed_=i.collapsed_,i.overrideCollapsible_=void 0!==o.collapsible,i.collapsible_=void 0===o.collapsible||o.collapsible,i.collapsible_||(i.collapsed_=!1);var n=void 0!==o.className?o.className:"ol-attribution",r=void 0!==o.tipLabel?o.tipLabel:"Attributions",a=void 0!==o.expandClassName?o.expandClassName:n+"-expand",s=void 0!==o.collapseLabel?o.collapseLabel:"›",l=void 0!==o.collapseClassName?o.collapseClassName:n+"-collpase";"string"==typeof s?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=s,i.collapseLabel_.className=l):i.collapseLabel_=s;var u=void 0!==o.label?o.label:"i";"string"==typeof u?(i.label_=document.createElement("span"),i.label_.textContent=u,i.label_.className=a):i.label_=u;var p=i.collapsible_&&!i.collapsed_?i.collapseLabel_:i.label_;i.toggleButton_=document.createElement("button"),i.toggleButton_.setAttribute("type","button"),i.toggleButton_.setAttribute("aria-expanded",String(!i.collapsed_)),i.toggleButton_.title=r,i.toggleButton_.appendChild(p),i.toggleButton_.addEventListener(Lt,i.handleClick_.bind(i),!1);var h=n+" ol-unselectable ol-control"+(i.collapsed_&&i.collapsible_?" ol-collapsed":"")+(i.collapsible_?"":" ol-uncollapsible"),d=i.element;return d.className=h,d.appendChild(i.toggleButton_),d.appendChild(i.ulElement_),i.renderedAttributions_=[],i.renderedVisible_=!0,i}return ii(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],o=!0,n=t.layerStatesArray,r=0,a=n.length;r<a;++r){var s=n[r];if(ti(s,t.viewState)){var l=s.layer.getSource();if(l){var u=l.getAttributions();if(u){var p=u(t);if(p)if(o=o&&!1!==l.getAttributionsCollapsible(),Array.isArray(p))for(var h=0,d=p.length;h<d;++h)p[h]in e||(i.push(p[h]),e[p[h]]=!0);else p in e||(i.push(p),e[p]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(o),i},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!St(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var o=0,n=e.length;o<n;++o){var r=document.createElement("li");r.innerHTML=e[o],this.ulElement_.appendChild(r)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?me(this.collapseLabel_,this.label_):me(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}(_e),ni="add",ri="remove",ai=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),si="length",li=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.element=i,n.index=o,n}return ai(e,t),e}(vt),ui=function(t){function e(e,i){var o=t.call(this)||this;o.on,o.once,o.un;var n=i||{};if(o.unique_=!!n.unique,o.array_=e||[],o.unique_)for(var r=0,a=o.array_.length;r<a;++r)o.assertUnique_(o.array_[r],r);return o.updateLength_(),o}return ai(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,i=0,o=e.length;i<o;++i)t(e[i],i,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(si)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new li(ni,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,i=0,o=e.length;i<o;++i)if(e[i]===t)return this.removeAt(i)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new li(ri,e,t)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var o=this.array_[t];this.array_[t]=e,this.dispatchEvent(new li(ri,o,t)),this.dispatchEvent(new li(ni,e,t))}else{for(var n=i;n<t;++n)this.insertAt(n,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(si,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var i=0,o=this.array_.length;i<o;++i)if(this.array_[i]===t&&i!==e)throw new Me(58)},e}(oe);function pi(t){return Math.pow(t,3)}function hi(t){return 1-pi(1-t)}function di(t){return 3*t*t-2*t*t*t}function ci(t){return t}var gi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),fi=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this;var n=void 0!==o.className?o.className:"ol-rotate",r=void 0!==o.label?o.label:"⇧",a=void 0!==o.compassClassName?o.compassClassName:"ol-compass";i.label_=null,"string"==typeof r?(i.label_=document.createElement("span"),i.label_.className=a,i.label_.textContent=r):(i.label_=r,i.label_.classList.add(a));var s=o.tipLabel?o.tipLabel:"Reset rotation",l=document.createElement("button");l.className=n+"-reset",l.setAttribute("type","button"),l.title=s,l.appendChild(i.label_),l.addEventListener(Lt,i.handleClick_.bind(i),!1);var u=n+" ol-unselectable ol-control",p=i.element;return p.className=u,p.appendChild(l),i.callResetNorth_=o.resetNorth?o.resetNorth:void 0,i.duration_=void 0!==o.duration?o.duration:250,i.autoHide_=void 0===o.autoHide||o.autoHide,i.rotation_=void 0,i.autoHide_&&i.element.classList.add("ol-hidden"),i}return gi(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:hi}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var o="rotate("+i+"rad)";if(this.autoHide_){var n=this.element.classList.contains("ol-hidden");n||0!==i?n&&0!==i&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")}this.label_.style.transform=o}this.rotation_=i}},e}(_e),mi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),vi=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),target:o.target})||this;var n=void 0!==o.className?o.className:"ol-zoom",r=void 0!==o.delta?o.delta:1,a=void 0!==o.zoomInClassName?o.zoomInClassName:n+"-in",s=void 0!==o.zoomOutClassName?o.zoomOutClassName:n+"-out",l=void 0!==o.zoomInLabel?o.zoomInLabel:"+",u=void 0!==o.zoomOutLabel?o.zoomOutLabel:"–",p=void 0!==o.zoomInTipLabel?o.zoomInTipLabel:"Zoom in",h=void 0!==o.zoomOutTipLabel?o.zoomOutTipLabel:"Zoom out",d=document.createElement("button");d.className=a,d.setAttribute("type","button"),d.title=p,d.appendChild("string"==typeof l?document.createTextNode(l):l),d.addEventListener(Lt,i.handleClick_.bind(i,r),!1);var c=document.createElement("button");c.className=s,c.setAttribute("type","button"),c.title=h,c.appendChild("string"==typeof u?document.createTextNode(u):u),c.addEventListener(Lt,i.handleClick_.bind(i,-r),!1);var g=n+" ol-unselectable ol-control",f=i.element;return f.className=g,f.appendChild(d),f.appendChild(c),i.duration_=void 0!==o.duration?o.duration:250,i}return mi(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getZoom();if(void 0!==i){var o=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:o,duration:this.duration_,easing:hi})):e.setZoom(o)}}},e}(_e),yi="pointermove",_i="pointerdown",bi={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},xi={};xi[bi.RADIANS]=6370997/(2*Math.PI),xi[bi.DEGREES]=2*Math.PI*6370997/360,xi[bi.FEET]=.3048,xi[bi.METERS]=1,xi[bi.USFEET]=1200/3937;var ki=bi,wi=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_||xi[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}(),Si=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ci=6378137*Math.PI,zi=[-Ci,-Ci,Ci,Ci],Ei=[-180,-85,180,85],Ti=6378137*Math.log(Math.tan(Math.PI/2)),Pi=function(t){function e(e){return t.call(this,{code:e,units:ki.METERS,extent:zi,global:!0,worldExtent:Ei,getPointResolution:function(t,e){return t/Ae(e[1]/6378137)}})||this}return Si(e,t),e}(wi),Oi=[new Pi("EPSG:3857"),new Pi("EPSG:102100"),new Pi("EPSG:102113"),new Pi("EPSG:900913"),new Pi("http://www.opengis.net/def/crs/EPSG/0/3857"),new Pi("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Fi(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n){r[a]=Ci*t[a]/180;var s=6378137*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));s>Ti?s=Ti:s<-Ti&&(s=-Ti),r[a+1]=s}return r}function Ri(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n)r[a]=180*t[a]/Ci,r[a+1]=360*Math.atan(Math.exp(t[a+1]/6378137))/Math.PI-90;return r}var Ii=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Mi=[-180,-90,180,90],ji=6378137*Math.PI/180,Di=function(t){function e(e,i){return t.call(this,{code:e,units:ki.DEGREES,extent:Mi,axisOrientation:i,global:!0,metersPerUnit:ji,worldExtent:Mi})||this}return Ii(e,t),e}(wi),Ai=[new Di("CRS:84"),new Di("EPSG:4326","neu"),new Di("urn:ogc:def:crs:OGC:1.3:CRS84"),new Di("urn:ogc:def:crs:OGC:2:84"),new Di("http://www.opengis.net/def/crs/OGC/1.3/CRS84","neu"),new Di("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Di("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],Li={};var Gi={};function Ni(t,e,i){var o=t.getCode(),n=e.getCode();o in Gi||(Gi[o]={}),Gi[o][n]=i}var Bi="bottom-left",Vi="bottom-right",qi="top-left",Wi="top-right",Ui=0,Xi=1,Ki=2,Yi=4,Zi=8,Hi=16;function $i(t){for(var e=ro(),i=0,o=t.length;i<o;++i)co(e,t[i]);return e}function Ji(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function Qi(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function to(t,e,i){var o,n;return(o=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*o+(n=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*n}function eo(t,e){return oo(t,e[0],e[1])}function io(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function oo(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function no(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=e[0],s=e[1],l=Ui;return a<i?l|=Hi:a>n&&(l|=Yi),s<o?l|=Zi:s>r&&(l|=Ki),l===Ui&&(l=Xi),l}function ro(){return[1/0,1/0,-1/0,-1/0]}function ao(t,e,i,o,n){return n?(n[0]=t,n[1]=e,n[2]=i,n[3]=o,n):[t,e,i,o]}function so(t){return ao(1/0,1/0,-1/0,-1/0,t)}function lo(t,e){var i=t[0],o=t[1];return ao(i,o,i,o,e)}function uo(t,e,i,o,n){return go(so(n),t,e,i,o)}function po(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function ho(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 co(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 go(t,e,i,o,n){for(;i<o;i+=n)fo(t,e[i],e[i+1]);return t}function fo(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function mo(t,e){var i;return(i=e(yo(t)))||(i=e(_o(t)))||(i=e(zo(t)))?i:(i=e(Co(t)))||!1}function vo(t){var e=0;return Po(t)||(e=Eo(t)*wo(t)),e}function yo(t){return[t[0],t[1]]}function _o(t){return[t[2],t[1]]}function bo(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function xo(t,e){var i;return e===Bi?i=yo(t):e===Vi?i=_o(t):e===qi?i=Co(t):e===Wi?i=zo(t):je(!1,13),i}function ko(t,e,i,o,n){var r=e*o[0]/2,a=e*o[1]/2,s=Math.cos(i),l=Math.sin(i),u=r*s,p=r*l,h=a*s,d=a*l,c=t[0],g=t[1],f=c-u+d,m=c-u-d,v=c+u-d,y=c+u+d,_=g-p-h,b=g-p+h,x=g+p+h,k=g+p-h;return ao(Math.min(f,m,v,y),Math.min(_,b,x,k),Math.max(f,m,v,y),Math.max(_,b,x,k),n)}function wo(t){return t[3]-t[1]}function So(t,e,i){var o=i||[1/0,1/0,-1/0,-1/0];return To(t,e)?(t[0]>e[0]?o[0]=t[0]:o[0]=e[0],t[1]>e[1]?o[1]=t[1]:o[1]=e[1],t[2]<e[2]?o[2]=t[2]:o[2]=e[2],t[3]<e[3]?o[3]=t[3]:o[3]=e[3]):so(o),o}function Co(t){return[t[0],t[3]]}function zo(t){return[t[2],t[3]]}function Eo(t){return t[2]-t[0]}function To(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Po(t){return t[2]<t[0]||t[3]<t[1]}function Oo(t,e,i,o){var n=[];if(o>1)for(var r=t[2]-t[0],a=t[3]-t[1],s=0;s<o;++s)n.push(t[0]+r*s/o,t[1],t[2],t[1]+a*s/o,t[2]-r*s/o,t[3],t[0],t[3]-a*s/o);else n=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(n,n,2);for(var l=[],u=[],p=(s=0,n.length);s<p;s+=2)l.push(n[s]),u.push(n[s+1]);return function(t,e,i){return ao(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),i)}(l,u,i)}var Fo="Point",Ro="LineString",Io="LinearRing",Mo="Polygon",jo="MultiPoint",Do="MultiLineString",Ao="MultiPolygon",Lo="GeometryCollection",Go="Circle";function No(t,e,i){var o=i||6371008.8,n=Be(t[1]),r=Be(e[1]),a=(r-n)/2,s=Be(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(n)*Math.cos(r);return 2*o*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function Bo(t,e){for(var i=0,o=t.length,n=t[o-1][0],r=t[o-1][1],a=0;a<o;a++){var s=t[a][0],l=t[a][1];i+=Be(s-n)*(2+Math.sin(Be(r))+Math.sin(Be(l))),n=s,r=l}return i*e*e/2}function Vo(t,e){var i=e||{},o=i.radius||6371008.8,n=i.projection||"EPSG:3857",r=t.getType();r!==Lo&&(t=t.clone().transform(n,"EPSG:4326"));var a,s,l,u,p,h,d=0;switch(r){case Fo:case jo:case Ro:case Do:case Io:break;case Mo:for(a=t.getCoordinates(),d=Math.abs(Bo(a[0],o)),l=1,u=a.length;l<u;++l)d-=Math.abs(Bo(a[l],o));break;case Ao:for(l=0,u=(a=t.getCoordinates()).length;l<u;++l)for(s=a[l],d+=Math.abs(Bo(s[0],o)),p=1,h=s.length;p<h;++p)d-=Math.abs(Bo(s[p],o));break;case Lo:var c=t.getGeometries();for(l=0,u=c.length;l<u;++l)d+=Vo(c[l],e);break;default:throw new Error("Unsupported geometry type: "+r)}return d}function qo(t,e){var i,o,n=t[0],r=t[1],a=e[0],s=e[1],l=a[0],u=a[1],p=s[0],h=s[1],d=p-l,c=h-u,g=0===d&&0===c?0:(d*(n-l)+c*(r-u))/(d*d+c*c||0);return g<=0?(i=l,o=u):g>=1?(i=p,o=h):(i=l+g*d,o=u+g*c),[i,o]}function Wo(t,e){for(var i=!0,o=t.length-1;o>=0;--o)if(t[o]!=e[o]){i=!1;break}return i}function Uo(t,e){var i=Math.cos(e),o=Math.sin(e),n=t[0]*i-t[1]*o,r=t[1]*i+t[0]*o;return t[0]=n,t[1]=r,t}function Xo(t,e){var i=t[0]-e[0],o=t[1]-e[1];return i*i+o*o}function Ko(t,e){return Math.sqrt(Xo(t,e))}function Yo(t,e){return Xo(t,qo(t,e))}function Zo(t,e){if(e.canWrapX()){var i=Eo(e.getExtent()),o=function(t,e,i){var o=e.getExtent(),n=0;if(e.canWrapX()&&(t[0]<o[0]||t[0]>o[2])){var r=i||Eo(o);n=Math.floor((t[0]-o[0])/r)}return n}(t,e,i);o&&(t[0]-=o*i)}return t}function Ho(t,e,i){var o;if(void 0!==e){for(var n=0,r=t.length;n<r;++n)e[n]=t[n];o=e}else o=t.slice();return o}function $o(t,e,i){if(void 0!==e&&t!==e){for(var o=0,n=t.length;o<n;++o)e[o]=t[o];t=e}return t}function Jo(t){!function(t,e){Li[t]=e}(t.getCode(),t),Ni(t,t,Ho)}function Qo(t){return"string"==typeof t?Li[e=t]||Li[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function tn(t,e,i,o){var n,r=(t=Qo(t)).getPointResolutionFunc();if(r){if(n=r(e,i),o&&o!==t.getUnits())(s=t.getMetersPerUnit())&&(n=n*s/xi[o])}else{var a=t.getUnits();if(a==ki.DEGREES&&!o||o==ki.DEGREES)n=e;else{var s,l=an(t,Qo("EPSG:4326"));if(l===$o&&a!==ki.DEGREES)n=e*t.getMetersPerUnit();else{var u=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];n=(No((u=l(u,u,2)).slice(0,2),u.slice(2,4))+No(u.slice(4,6),u.slice(6,8)))/2}void 0!==(s=o?xi[o]:t.getMetersPerUnit())&&(n/=s)}}return n}function en(t){!function(t){t.forEach(Jo)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Ni(e,t,Ho)}))}))}function on(t,e){return t?"string"==typeof t?Qo(t):t:Qo(e)}function nn(t,e){return ln(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function rn(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||an(t,e)===Ho)&&i}function an(t,e){var i=function(t,e){var i;return t in Gi&&e in Gi[t]&&(i=Gi[t][e]),i}(t.getCode(),e.getCode());return i||(i=$o),i}function sn(t,e){return an(Qo(t),Qo(e))}function ln(t,e,i){return sn(e,i)(t,void 0,t.length)}var un,pn,hn;function dn(t,e){return t}function cn(t,e){return t}function gn(t,e){return t}function fn(t,e){return t}en(Oi),en(Ai),un=Oi,pn=Fi,hn=Ri,Ai.forEach((function(t){un.forEach((function(e){Ni(t,e,pn),Ni(e,t,hn)}))}));var mn,vn=new Array(6);function yn(t){return bn(t,1,0,0,1,0,0)}function _n(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=t[4],s=t[5],l=e[0],u=e[1],p=e[2],h=e[3],d=e[4],c=e[5];return t[0]=i*l+n*u,t[1]=o*l+r*u,t[2]=i*p+n*h,t[3]=o*p+r*h,t[4]=i*d+n*c+a,t[5]=o*d+r*c+s,t}function bn(t,e,i,o,n,r,a){return t[0]=e,t[1]=i,t[2]=o,t[3]=n,t[4]=r,t[5]=a,t}function xn(t,e){var i=e[0],o=e[1];return e[0]=t[0]*i+t[2]*o+t[4],e[1]=t[1]*i+t[3]*o+t[5],e}function kn(t,e,i){return _n(t,bn(vn,e,0,0,i,0,0))}function wn(t,e,i,o,n,r,a,s){var l=Math.sin(r),u=Math.cos(r);return t[0]=o*u,t[1]=n*l,t[2]=-o*l,t[3]=n*u,t[4]=a*o*u-s*o*l+e,t[5]=a*n*l+s*n*u+i,t}function Sn(t,e){var i,o=(i=e)[0]*i[3]-i[1]*i[2];je(0!==o,32);var n=e[0],r=e[1],a=e[2],s=e[3],l=e[4],u=e[5];return t[0]=s/o,t[1]=-r/o,t[2]=-a/o,t[3]=n/o,t[4]=(a*u-s*l)/o,t[5]=-(n*u-r*l)/o,t}function Cn(t){var e="matrix("+t.join(", ")+")";if(de)return e;var i=mn||(mn=document.createElement("div"));return i.style.transform=e,i.style.transform}var zn=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,En=/^([a-z]*)$|^hsla?\(.*\)$/i;function Tn(t){return"string"==typeof t?t:Mn(t)}var Pn,On,Fn=(Pn={},On=0,function(t){var e;if(Pn.hasOwnProperty(t))e=Pn[t];else{if(On>=1024){var i=0;for(var o in Pn)0==(3&i++)&&(delete Pn[o],--On)}e=function(t){var e,i,o,n,r;if(En.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}(t)),zn.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),o=parseInt(t.substr(1+2*s,s),16),n=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,o=(o<<4)+o,l&&(n=(n<<4)+n)),r=[e,i,o,n/255]}else 0==t.indexOf("rgba(")?In(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),In(r)):je(!1,14);return r}(t),Pn[t]=e,++On}return e});function Rn(t){return Array.isArray(t)?t:Fn(t)}function In(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 Mn(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var o=t[2];return o!=(0|o)&&(o=o+.5|0),"rgba("+e+","+i+","+o+","+(void 0===t[3]?1:t[3])+")"}function jn(t,e,i){return e+":"+t+":"+(i?Tn(i):"null")}var Dn=new(function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var o=jn(t,e,i);return o in this.cache_?this.cache_[o]:null},t.prototype.set=function(t,e,i,o){var n=jn(t,e,i);this.cache_[n]=o,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),An=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Ln(t,e){Dn.expire()}var Gn=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return An(e,t),e.prototype.dispatchRenderEvent=function(t,e){Jt()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,o=t.pixelToCoordinateTransform;wn(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Sn(o,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r,a,s){var l,u=e.viewState;function p(t,e,i,o){return n.call(r,e,t?i:null,o)}var h=u.projection,d=Zo(t.slice(),h),c=[[0,0]];if(h.canWrapX()&&o){var g=Eo(h.getExtent());c.push([-g,0],[g,0])}for(var f=e.layerStatesArray,m=f.length,v=[],y=[],_=0;_<c.length;_++)for(var b=m-1;b>=0;--b){var x=f[b],k=x.layer;if(k.hasRenderer()&&ti(x,u)&&a.call(s,k)){var w=k.getRenderer(),S=k.getSource();if(w&&S){var C=S.getWrapX()?d:t,z=p.bind(null,x.managed);y[0]=C[0]+c[_][0],y[1]=C[1]+c[_][1],l=w.forEachFeatureAtCoordinate(y,e,i,z,v)}if(l)return l}}if(0!==v.length){var E=1/v.length;return v.forEach((function(t,e){return t.distanceSq+=e*E})),v.sort((function(t,e){return t.distanceSq-e.distanceSq})),v.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,o,n){return Jt()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,o,n,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,o,Ct,this,n,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){Jt()},e.prototype.scheduleExpireIconCache=function(t){Dn.canExpireCache()&&t.postRenderFunctions.push(Ln)},e}(_t),Nn=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Bn=function(t){function e(e,i,o,n){var r=t.call(this,e)||this;return r.inversePixelTransform=i,r.frameState=o,r.context=n,r}return Nn(e,t),e}(vt),Vn=[],qn=[0,0,0,0],Wn=new oe;(new Mt).setSize=function(){console.warn("labelCache is deprecated.")};var Un,Xn,Kn=null,Yn={},Zn=function(){var t,e,i="32px ",o=["monospace","serif"],n=o.length,r="wmytzilWMYTZIL@#/&?$%10";function a(t,a,s){for(var l=!0,u=0;u<n;++u){var p=o[u];if(e=Jn(t+" "+a+" "+i+p,r),s!=p){var h=Jn(t+" "+a+" "+i+s+","+p,r);l=l&&h!=e}}return!!l}function s(){for(var e=!0,i=Wn.getKeys(),o=0,n=i.length;o<n;++o){var r=i[o];Wn.get(r)<100&&(a.apply(this,r.split("\n"))?(Pt(Yn),Kn=null,Un=void 0,Wn.set(r,100)):(Wn.set(r,Wn.get(r)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var i=ke(e);if(i)for(var o=i.families,n=0,r=o.length;n<r;++n){var l=o[n],u=i.style+"\n"+i.weight+"\n"+l;void 0===Wn.get(u)&&(Wn.set(u,100,!0),a(i.style,i.weight,l)||(Wn.set(u,0,!0),void 0===t&&(t=setInterval(s,32))))}}}(),Hn=function(t){var e=Yn[t];if(null==e){if(de){var i=ke(t),o=$n(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(o.actualBoundingBoxAscent+o.actualBoundingBoxDescent)}else Xn||((Xn=document.createElement("div")).innerHTML="M",Xn.style.minHeight="0",Xn.style.maxHeight="none",Xn.style.height="auto",Xn.style.padding="0",Xn.style.border="none",Xn.style.position="absolute",Xn.style.display="block",Xn.style.left="-99999px"),Xn.style.font=t,document.body.appendChild(Xn),e=Xn.offsetHeight,document.body.removeChild(Xn);Yn[t]=e}return e};function $n(t,e){return Kn||(Kn=fe(1,1)),t!=Un&&(Kn.font=t,Un=Kn.font),Kn.measureText(e)}function Jn(t,e){return $n(t,e).width}function Qn(t,e,i){if(e in i)return i[e];var o=Jn(t,e);return i[e]=o,o}function tr(t,e,i,o,n,r,a,s,l,u,p){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),o.contextInstructions?(t.translate(l,u),t.scale(p[0],p[1]),function(t,e){for(var i=t.contextInstructions,o=0,n=i.length;o<n;o+=2)Array.isArray(i[o+1])?e[i[o]].apply(e,i[o+1]):e[i[o]]=i[o+1]}(o,t)):p[0]<0||p[1]<0?(t.translate(l,u),t.scale(p[0],p[1]),t.drawImage(o,n,r,a,s,0,0,a,s)):t.drawImage(o,n,r,a,s,l,u,a*p[0],s*p[1]),t.restore()}var er=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ir=function(t){function e(e){var i=t.call(this,e)||this;i.fontChangeListenerKey_=Xt(Wn,yt,e.redrawText.bind(e)),i.element_=document.createElement("div");var o=i.element_.style;o.position="absolute",o.width="100%",o.height="100%",o.zIndex="0",i.element_.className="ol-unselectable ol-layers";var n=e.getViewport();return n.insertBefore(i.element_,n.firstChild||null),i.children_=[],i.renderedVisible_=!0,i}return er(e,t),e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap();if(i.hasListener(t)){var o=new Bn(t,void 0,e);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){Yt(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(Ye,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),i=t.viewState;this.children_.length=0;for(var o=[],n=null,r=0,a=e.length;r<a;++r){var s=e[r];if(t.layerIndex=r,ti(s,i)&&(s.sourceState==Je||s.sourceState==$e)){var l=s.layer,u=l.render(t,n);u&&(u!==n&&(this.children_.push(u),n=u),"getDeclutter"in l&&o.push(l))}}for(r=o.length-1;r>=0;--r)o[r].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,o=0;;++o){var n=i[o],r=e[o];if(!n&&!r)break;n!==r&&(n?r?t.insertBefore(r,n):(t.removeChild(n),--o):t.appendChild(r))}}(this.element_,this.children_),this.dispatchRenderEvent(Ze,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,o,n){for(var r=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],u=l.layer;if(u.hasRenderer()&&ti(l,r)&&n(u)){var p=u.getRenderer().getDataAtPixel(t,e,i);if(p){var h=o(u,p);if(h)return h}}}},e}(Gn),or="layergroup",nr="size",rr="target",ar="view",sr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),lr="layers",ur=function(t){function e(e){var i=this,o=e||{},n=Tt({},o);delete n.layers;var r=o.layers;return(i=t.call(this,n)||this).on,i.once,i.un,i.layersListenerKeys_=[],i.listenerKeys_={},i.addChangeListener(lr,i.handleLayersChanged_),r?Array.isArray(r)?r=new ui(r.slice(),{unique:!0}):je("function"==typeof r.getArray,43):r=new ui(void 0,{unique:!0}),i.setLayers(r),i}return sr(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Yt),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(Xt(t,ni,this.handleLayersAdd_,this),Xt(t,ri,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(Yt);Pt(this.listenerKeys_);for(var i=t.getArray(),o=0,n=i.length;o<n;o++){var r=i[o];this.listenerKeys_[te(r)]=[Xt(r,yt,this.handleLayerChange_,this),Xt(r,jt,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[te(e)]=[Xt(e,yt,this.handleLayerChange_,this),Xt(e,jt,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=te(t.element);this.listenerKeys_[e].forEach(Yt),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(lr)},e.prototype.setLayers=function(t){this.set(lr,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],i=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var o=this.getLayerState(),n=o.zIndex;t||void 0!==o.zIndex||(n=0);for(var r=i,a=e.length;r<a;r++){var s=e[r];s.opacity*=o.opacity,s.visible=s.visible&&o.visible,s.maxResolution=Math.min(s.maxResolution,o.maxResolution),s.minResolution=Math.max(s.minResolution,o.minResolution),s.minZoom=Math.max(s.minZoom,o.minZoom),s.maxZoom=Math.min(s.maxZoom,o.maxZoom),void 0!==o.extent&&(void 0!==s.extent?s.extent=So(s.extent,o.extent):s.extent=o.extent),void 0===s.zIndex&&(s.zIndex=n)}return e},e.prototype.getSourceState=function(){return Je},e}(Ue),pr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hr=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.map=i,n.frameState=void 0!==o?o:null,n}return pr(e,t),e}(vt),dr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),cr=function(t){function e(e,i,o,n,r){var a=t.call(this,e,i,r)||this;return a.originalEvent=o,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==n&&n,a}return dr(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}(hr),gr={SINGLECLICK:"singleclick",CLICK:Lt,DBLCLICK:Gt,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},fr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),mr=function(t){function e(e,i){var o=t.call(this,e)||this;o.map_=e,o.clickTimeoutId_,o.emulateClicks_=!1,o.dragging_=!1,o.dragListenerKeys_=[],o.moveTolerance_=void 0===i?1:i,o.down_=null;var n=o.map_.getViewport();return o.activePointers_=0,o.trackedTouches_={},o.element_=n,o.pointerdownListenerKey_=Xt(n,_i,o.handlePointerDown_,o),o.originalPointerMoveEvent_,o.relayedListenerKey_=Xt(n,yi,o.relayEvent_,o),o.boundHandleTouchMove_=o.handleTouchMove_.bind(o),o.element_.addEventListener(Wt,o.boundHandleTouchMove_,!!ge&&{passive:!1}),o}return fr(e,t),e.prototype.emulateClick_=function(t){var e=new cr(gr.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new cr(gr.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new cr(gr.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==gr.POINTERUP||e.type==gr.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==gr.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new cr(gr.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(Yt),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 cr(gr.POINTERDOWN,this.map_,t);for(var i in this.dispatchEvent(e),this.down_={},t){var o=t[i];this.down_[i]="function"==typeof o?Et:o}if(0===this.dragListenerKeys_.length){var n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Xt(n,gr.POINTERMOVE,this.handlePointerMove_,this),Xt(n,gr.POINTERUP,this.handlePointerUp_,this),Xt(this.element_,gr.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(Xt(this.element_.getRootNode(),gr.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new cr(gr.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 cr(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_&&(Yt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Wt,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Yt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Yt),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(Mt),vr=1/0,yr=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,Pt(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var o=this.keyFunction_(i);return delete this.queuedElements_[o],i},t.prototype.enqueue=function(t){je(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=vr&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,o=e.length,n=e[t],r=i[t],a=t;t<o>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<o&&i[l]<i[s]?l:s;e[t]=e[u],i[t]=i[u],t=u}e[t]=n,i[t]=r,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,o=this.priorities_,n=i[e],r=o[e];e>t;){var a=this.getParentIndex_(e);if(!(o[a]>r))break;i[e]=i[a],o[e]=o[a],e=a}i[e]=n,o[e]=r},t.prototype.reprioritize=function(){var t,e,i,o=this.priorityFunction_,n=this.elements_,r=this.priorities_,a=0,s=n.length;for(e=0;e<s;++e)(i=o(t=n[e]))==vr?delete this.queuedElements_[this.keyFunction_(t)]:(r[a]=i,n[a++]=t);n.length=a,r.length=a,this.heapify_()},t}(),_r=0,br=1,xr=2,kr=3,wr=4,Sr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Cr=function(t){function e(e,i){var o=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return o.boundHandleTileChange_=o.handleTileChange.bind(o),o.tileChangeCallback_=i,o.tilesLoading_=0,o.tilesLoadingKeys_={},o}return Sr(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(jt,this.boundHandleTileChange_);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(i===xr||i===kr||i===wr){e.removeEventListener(jt,this.boundHandleTileChange_);var o=e.getKey();o in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[o],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,o,n=0;this.tilesLoading_<t&&n<e&&this.getCount()>0;)o=(i=this.dequeue()[0]).getKey(),i.getState()!==_r||o in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++n,i.load())},e}(yr);var zr=0,Er=1,Tr="center",Pr="resolution",Or="rotation";function Fr(t,e,i){return function(o,n,r,a,s){if(o){var l=e?0:r[0]*n,u=e?0:r[1]*n,p=s?s[0]:0,h=s?s[1]:0,d=t[0]+l/2+p,c=t[2]-l/2+p,g=t[1]+u/2+h,f=t[3]-u/2+h;d>c&&(c=d=(c+d)/2),g>f&&(f=g=(f+g)/2);var m=De(o[0],d,c),v=De(o[1],g,f),y=30*n;return a&&i&&(m+=-y*Math.log(1+Math.max(0,d-o[0])/y)+y*Math.log(1+Math.max(0,o[0]-c)/y),v+=-y*Math.log(1+Math.max(0,g-o[1])/y)+y*Math.log(1+Math.max(0,o[1]-f)/y)),[m,v]}}}function Rr(t){return t}function Ir(t,e,i,o){var n=Eo(e)/i[0],r=wo(e)/i[1];return o?Math.min(t,Math.max(n,r)):Math.min(t,Math.min(n,r))}function Mr(t,e,i){var o=Math.min(t,e);return o*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(o=Math.max(o,i),o/=Math.log(1+50*Math.max(0,i/t-1))/50+1),De(o,i/2,2*e)}function jr(t,e,i,o,n){return function(r,a,s,l){if(void 0!==r){var u=o?Ir(t,o,s,n):t;return(void 0===i||i)&&l?Mr(r,u,e):De(r,e,u)}}}function Dr(t){return void 0!==t?0:void 0}function Ar(t){return void 0!==t?t:void 0}var Lr="XY",Gr="XYZ",Nr="XYM",Br="XYZM";function Vr(t,e,i,o,n,r){for(var a=r||[],s=0,l=e;l<i;l+=o){var u=t[l],p=t[l+1];a[s++]=n[0]*u+n[2]*p+n[4],a[s++]=n[1]*u+n[3]*p+n[5]}return r&&a.length!=s&&(a.length=s),a}function qr(t,e,i,o,n,r,a){for(var s=a||[],l=Math.cos(n),u=Math.sin(n),p=r[0],h=r[1],d=0,c=e;c<i;c+=o){var g=t[c]-p,f=t[c+1]-h;s[d++]=p+g*l-f*u,s[d++]=h+g*u+f*l;for(var m=c+2;m<c+o;++m)s[d++]=t[m]}return a&&s.length!=d&&(s.length=d),s}function Wr(t,e,i,o,n,r,a){for(var s=a||[],l=0,u=e;u<i;u+=o){s[l++]=t[u]+n,s[l++]=t[u+1]+r;for(var p=u+2;p<u+o;++p)s[l++]=t[p]}return a&&s.length!=l&&(s.length=l),s}var Ur=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Xr=[1,0,0,1,0,0],Kr=function(t){function e(){var e,i,o,n,r,a=t.call(this)||this;return a.extent_=[1/0,1/0,-1/0,-1/0],a.extentRevision_=-1,a.simplifiedGeometryMaxMinSquaredTolerance=0,a.simplifiedGeometryRevision=0,a.simplifyTransformedInternal=(e=function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);var o=this.clone();return o.applyTransform(i),o.getSimplifiedGeometry(e)},r=!1,function(){var t=Array.prototype.slice.call(arguments);return r&&this===n&&St(t,o)||(r=!0,n=this,o=t,i=e.apply(this,arguments)),i}),a}return Ur(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return Jt()},e.prototype.closestPointXY=function(t,e,i,o){return Jt()},e.prototype.containsXY=function(t,e){var i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e},e.prototype.getClosestPoint=function(t,e){var i=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return Jt()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&so(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){Jt()},e.prototype.scale=function(t,e,i){Jt()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return Jt()},e.prototype.getType=function(){return Jt()},e.prototype.applyTransform=function(t){Jt()},e.prototype.intersectsExtent=function(t){return Jt()},e.prototype.translate=function(t,e){Jt()},e.prototype.transform=function(t,e){var i=Qo(t),o=i.getUnits()==ki.TILE_PIXELS?function(t,o,n){var r=i.getExtent(),a=i.getWorldExtent(),s=wo(a)/wo(r);return wn(Xr,a[0],a[3],s,-s,0,0,0),Vr(t,0,t.length,n,Xr,o),sn(i,e)(t,o,n)}:sn(i,e);return this.applyTransform(o),this},e}(oe),Yr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Zr(t){var e;return t==Lr?e=2:t==Gr||t==Nr?e=3:t==Br&&(e=4),e}var Hr=function(t){function e(){var e=t.call(this)||this;return e.layout=Lr,e.stride=2,e.flatCoordinates=null,e}return Yr(e,t),e.prototype.computeExtent=function(t){return uo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return Jt()},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=Zr(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){Jt()},e.prototype.setLayout=function(t,e,i){var o;if(t)o=Zr(t);else{for(var n=0;n<i;++n){if(0===e.length)return this.layout=Lr,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Lr:3==t?e=Gr:4==t&&(e=Br);return e}(o=e.length)}this.layout=t,this.stride=o},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var i=this.getFlatCoordinates();if(i){var o=this.getStride();qr(i,0,i.length,o,t,e,i),this.changed()}},e.prototype.scale=function(t,e,i){var o=e;void 0===o&&(o=t);var n=i;n||(n=bo(this.getExtent()));var r=this.getFlatCoordinates();if(r){var a=this.getStride();!function(t,e,i,o,n,r,a,s){for(var l=s||[],u=a[0],p=a[1],h=0,d=e;d<i;d+=o){var c=t[d]-u,g=t[d+1]-p;l[h++]=u+n*c,l[h++]=p+r*g;for(var f=d+2;f<d+o;++f)l[h++]=t[f]}s&&l.length!=h&&(l.length=h)}(r,0,r.length,a,t,o,n,r),this.changed()}},e.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var o=this.getStride();Wr(i,0,i.length,o,t,e,i),this.changed()}},e}(Kr);function $r(t,e,i,o,n,r,a){var s,l=t[e],u=t[e+1],p=t[i]-l,h=t[i+1]-u;if(0===p&&0===h)s=e;else{var d=((n-l)*p+(r-u)*h)/(p*p+h*h);if(d>1)s=i;else{if(d>0){for(var c=0;c<o;++c)a[c]=qe(t[e+c],t[i+c],d);return void(a.length=o)}s=e}}for(c=0;c<o;++c)a[c]=t[s+c];a.length=o}function Jr(t,e,i,o,n){var r=t[e],a=t[e+1];for(e+=o;e<i;e+=o){var s=t[e],l=t[e+1],u=Ne(r,a,s,l);u>n&&(n=u),r=s,a=l}return n}function Qr(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=Jr(t,e,s,o,n),e=s}return n}function ta(t,e,i,o,n,r,a,s,l,u,p){if(e==i)return u;var h,d;if(0===n){if((d=Ne(a,s,t[e],t[e+1]))<u){for(h=0;h<o;++h)l[h]=t[e+h];return l.length=o,d}return u}for(var c=p||[NaN,NaN],g=e+o;g<i;)if($r(t,g-o,g,o,a,s,c),(d=Ne(a,s,c[0],c[1]))<u){for(u=d,h=0;h<o;++h)l[h]=c[h];l.length=o,g+=o}else g+=o*Math.max((Math.sqrt(d)-Math.sqrt(u))/n|0,1);if(r&&($r(t,i-o,e,o,a,s,c),(d=Ne(a,s,c[0],c[1]))<u)){for(u=d,h=0;h<o;++h)l[h]=c[h];l.length=o}return u}function ea(t,e,i,o,n,r,a,s,l,u,p){for(var h=p||[NaN,NaN],d=0,c=i.length;d<c;++d){var g=i[d];u=ta(t,e,g,o,n,r,a,s,l,u,h),e=g}return u}function ia(t,e,i,o){for(var n=0,r=i.length;n<r;++n)t[e++]=i[n];return e}function oa(t,e,i,o){for(var n=0,r=i.length;n<r;++n)for(var a=i[n],s=0;s<o;++s)t[e++]=a[s];return e}function na(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=oa(t,e,i[s],o);r[a++]=u,e=u}return r.length=a,r}function ra(t,e,i,o,n,r,a){var s=(i-e)/o;if(s<3){for(;e<i;e+=o)r[a++]=t[e],r[a++]=t[e+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[e,i-o],p=0;u.length>0;){for(var h=u.pop(),d=u.pop(),c=0,g=t[d],f=t[d+1],m=t[h],v=t[h+1],y=d+o;y<h;y+=o){var _=Ge(t[y],t[y+1],g,f,m,v);_>c&&(p=y,c=_)}c>n&&(l[(p-e)/o]=1,d+o<p&&u.push(d,p),p+o<h&&u.push(p,h))}for(y=0;y<s;++y)l[y]&&(r[a++]=t[e+y*o],r[a++]=t[e+y*o+1]);return a}function aa(t,e){return e*Math.round(t/e)}function sa(t,e,i,o,n,r,a){if(e==i)return a;var s,l,u=aa(t[e],n),p=aa(t[e+1],n);e+=o,r[a++]=u,r[a++]=p;do{if(s=aa(t[e],n),l=aa(t[e+1],n),(e+=o)==i)return r[a++]=s,r[a++]=l,a}while(s==u&&l==p);for(;e<i;){var h=aa(t[e],n),d=aa(t[e+1],n);if(e+=o,h!=s||d!=l){var c=s-u,g=l-p,f=h-u,m=d-p;c*m==g*f&&(c<0&&f<c||c==f||c>0&&f>c)&&(g<0&&m<g||g==m||g>0&&m>g)?(s=h,l=d):(r[a++]=s,r[a++]=l,u=s,p=l,s=h,l=d)}}return r[a++]=s,r[a++]=l,a}function la(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=sa(t,e,p,o,n,r,a),s.push(a),e=p}return a}function ua(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=e;s<i;s+=o)r[a++]=t.slice(s,s+o);return r.length=a,r}function pa(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=ua(t,e,u,o,r[a]),e=u}return r.length=a,r}function ha(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=pa(t,e,u,o,r[a]),e=u[u.length-1]}return r.length=a,r}function da(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=a*s-r*l,r=s,a=l}return n/2}function ca(t,e,i,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=da(t,e,s,o),e=s}return n}var ga=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),fa=function(t){function e(e,i){var o=t.call(this)||this;return o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return ga(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,o){return o<to(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Jr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.getArea=function(){return da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=ra(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Lr)},e.prototype.getType=function(){return Io},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=oa(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Hr),ma=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),va=function(t){function e(e,i){var o=t.call(this)||this;return o.setCoordinates(e,i),o}return ma(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,i,o){var n=this.flatCoordinates,r=Ne(t,e,n[0],n[1]);if(r<o){for(var a=this.stride,s=0;s<a;++s)i[s]=n[s];return i.length=a,r}return o},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return lo(this.flatCoordinates,t)},e.prototype.getType=function(){return Fo},e.prototype.intersectsExtent=function(t){return oo(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=ia(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Hr);function ya(t,e,i,o,n){return!mo(n,(function(n){return!_a(t,e,i,o,n[0],n[1])}))}function _a(t,e,i,o,n,r){for(var a=0,s=t[i-o],l=t[i-o+1];e<i;e+=o){var u=t[e],p=t[e+1];l<=r?p>r&&(u-s)*(r-l)-(n-s)*(p-l)>0&&a++:p<=r&&(u-s)*(r-l)-(n-s)*(p-l)<0&&a--,s=u,l=p}return 0!==a}function ba(t,e,i,o,n,r){if(0===i.length)return!1;if(!_a(t,e,i[0],o,n,r))return!1;for(var a=1,s=i.length;a<s;++a)if(_a(t,i[a-1],i[a],o,n,r))return!1;return!0}function xa(t,e,i,o,n,r,a){for(var s,l,u,p,h,d,c,g=n[r+1],f=[],m=0,v=i.length;m<v;++m){var y=i[m];for(p=t[y-o],d=t[y-o+1],s=e;s<y;s+=o)h=t[s],c=t[s+1],(g<=d&&c<=g||d<=g&&g<=c)&&(u=(g-d)/(c-d)*(h-p)+p,f.push(u)),p=h,d=c}var _=NaN,b=-1/0;for(f.sort(bt),p=f[0],s=1,l=f.length;s<l;++s){h=f[s];var x=Math.abs(h-p);x>b&&ba(t,e,i,o,u=(p+h)/2,g)&&(_=u,b=x),p=h}return isNaN(_)&&(_=n[r]),a?(a.push(_,g,b),a):[_,g,b]}function ka(t,e,i,o,n){for(var r=[],a=0,s=i.length;a<s;++a){var l=i[a];r=xa(t,e,l,o,n,2*a,r),e=l[l.length-1]}return r}function wa(t,e,i,o,n){var r;for(e+=o;e<i;e+=o)if(r=n(t.slice(e-o,e),t.slice(e,e+o)))return r;return!1}function Sa(t,e,i,o,n){var r=go([1/0,1/0,-1/0,-1/0],t,e,i,o);return!!To(n,r)&&(!!io(n,r)||(r[0]>=n[0]&&r[2]<=n[2]||(r[1]>=n[1]&&r[3]<=n[3]||wa(t,e,i,o,(function(t,e){return function(t,e,i){var o=!1,n=no(t,e),r=no(t,i);if(n===Xi||r===Xi)o=!0;else{var a=t[0],s=t[1],l=t[2],u=t[3],p=e[0],h=e[1],d=i[0],c=i[1],g=(c-h)/(d-p),f=void 0,m=void 0;r&Ki&&!(n&Ki)&&(o=(f=d-(c-u)/g)>=a&&f<=l),o||!(r&Yi)||n&Yi||(o=(m=c-(d-l)*g)>=s&&m<=u),o||!(r&Zi)||n&Zi||(o=(f=d-(c-s)/g)>=a&&f<=l),o||!(r&Hi)||n&Hi||(o=(m=c-(d-a)*g)>=s&&m<=u)}return o}(n,t,e)})))))}function Ca(t,e,i,o,n){if(!function(t,e,i,o,n){return!!(Sa(t,e,i,o,n)||_a(t,e,i,o,n[0],n[1])||_a(t,e,i,o,n[0],n[3])||_a(t,e,i,o,n[2],n[1])||_a(t,e,i,o,n[2],n[3]))}(t,e,i[0],o,n))return!1;if(1===i.length)return!0;for(var r=1,a=i.length;r<a;++r)if(ya(t,i[r-1],i[r],o,n)&&!Sa(t,i[r-1],i[r],o,n))return!1;return!0}function za(t,e,i,o){for(;e<i-o;){for(var n=0;n<o;++n){var r=t[e+n];t[e+n]=t[i-o+n],t[i-o+n]=r}e+=o,i-=o}}function Ea(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=(s-r)*(l+a),r=s,a=l}return 0===n?void 0:n>0}function Ta(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Ea(t,e,l,o);if(0===a){if(r&&u||!r&&!u)return!1}else if(r&&!u||!r&&u)return!1;e=l}return!0}function Pa(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Ea(t,e,l,o);(0===a?r&&u||!r&&!u:r&&!u||!r&&u)&&za(t,e,l,o),e=l}return e}function Oa(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r)e=Pa(t,e,i[r],o,n);return e}var Fa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ra=function(t){function e(e,i,o){var n=t.call(this)||this;return n.ends_=[],n.flatInteriorPointRevision_=-1,n.flatInteriorPoint_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,void 0!==i&&o?(n.setFlatCoordinates(i,e),n.ends_=o):n.setCoordinates(e,i),n}return Fa(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?wt(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,i,o){return o<to(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Qr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ea(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return ba(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return ca(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Pa(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,pa(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=bo(this.getExtent());this.flatInteriorPoint_=xa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new va(this.getFlatInteriorPoint(),Nr)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new fa(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,i=this.ends_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r],l=new fa(e.slice(n,s),t);o.push(l),n=s}return o},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Ta(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Pa(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=la(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,o),new e(i,Lr,o)},e.prototype.getType=function(){return Mo},e.prototype.intersectsExtent=function(t){return Ca(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=na(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Hr),Ia=Ra;function Ma(t){var e=t[0],i=t[1],o=t[2],n=t[3],r=[e,i,e,n,o,n,o,i,e,i];return new Ra(r,Lr,[r.length])}function ja(t,e,i){for(var o=e||32,n=t.getStride(),r=t.getLayout(),a=t.getCenter(),s=n*(o+1),l=new Array(s),u=0;u<s;u+=n){l[u]=0,l[u+1]=0;for(var p=2;p<n;p++)l[u+p]=a[p]}var h=[l.length],d=new Ra(l,r,h);return function(t,e,i,o){for(var n=t.getFlatCoordinates(),r=t.getStride(),a=n.length/r-1,s=o||0,l=0;l<=a;++l){var u=l*r,p=s+2*Ve(l,a)*Math.PI/a;n[u]=e[0]+i*Math.cos(p),n[u+1]=e[1]+i*Math.sin(p)}t.changed()}(d,a,t.getRadius(),i),d}var Da=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Aa(t,e){setTimeout((function(){t(e)}),0)}function La(t){return!(t.sourceCenter&&t.targetCenter&&!Wo(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Ga(t,e,i,o,n){var r=Math.cos(-n),a=Math.sin(-n),s=t[0]*r-t[1]*a,l=t[1]*r+t[0]*a;return[(s+=(e[0]/2-i[0])*o)*r-(l+=(i[1]-e[1]/2)*o)*(a=-a),l*r+s*a]}var Na=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=Tt({},e);return i.hints_=[0,0],i.animations_=[],i.updateAnimationKey_,i.projection_=on(o.projection,"EPSG:3857"),i.viewportSize_=[100,100],i.targetCenter_=null,i.targetResolution_,i.targetRotation_,i.nextCenter_=null,i.nextResolution_,i.nextRotation_,i.cancelAnchor_=void 0,o.center&&(o.center=cn(o.center,i.projection_)),o.extent&&(o.extent=fn(o.extent,i.projection_)),i.applyOptions_(o),i}return Da(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,i,o,n=28,r=2,a=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:n,l=void 0!==t.zoomFactor?t.zoomFactor:r,u=void 0!==t.multiWorld&&t.multiWorld,p=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,h=void 0!==t.showFullExtent&&t.showFullExtent,d=on(t.projection,"EPSG:3857"),c=d.getExtent(),g=t.constrainOnlyCenter,f=t.extent;u||f||!d.isGlobal()||(g=!1,f=c);if(void 0!==t.resolutions){var m=t.resolutions;i=m[a],o=void 0!==m[s]?m[s]:m[m.length-1],e=t.constrainResolution?function(t,e,i,o){return function(n,r,a,s){if(void 0!==n){var l=t[0],u=t[t.length-1],p=i?Ir(l,i,a,o):l;if(s)return void 0===e||e?Mr(n,p,u):De(n,u,p);var h=Math.min(p,n),d=Math.floor(xt(t,h,r));return t[d]>p&&d<t.length-1?t[d+1]:t[d]}}}(m,p,!g&&f,h):jr(i,o,p,!g&&f,h)}else{var v=(c?Math.max(Eo(c),wo(c)):360*xi[ki.DEGREES]/d.getMetersPerUnit())/256/Math.pow(r,0),y=v/Math.pow(r,n-0);void 0!==(i=t.maxResolution)?a=0:i=v/Math.pow(l,a),void 0===(o=t.minResolution)&&(o=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(l,s):v/Math.pow(l,s):y),s=a+Math.floor(Math.log(i/o)/Math.log(l)),o=i/Math.pow(l,s-a),e=t.constrainResolution?function(t,e,i,o,n,r){return function(a,s,l,u){if(void 0!==a){var p=n?Ir(e,n,l,r):e,h=void 0!==i?i:0;if(u)return void 0===o||o?Mr(a,p,h):De(a,h,p);var d=Math.ceil(Math.log(e/p)/Math.log(t)-1e-9),c=-s*(.5-1e-9)+.5,g=Math.min(p,a),f=Math.floor(Math.log(e/g)/Math.log(t)+c),m=Math.max(d,f);return De(e/Math.pow(t,m),h,p)}}}(l,i,o,p,!g&&f,h):jr(i,o,p,!g&&f,h)}return{constraint:e,maxResolution:i,minResolution:o,minZoom:a,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 i=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Fr(t.extent,t.constrainOnlyCenter,e)}var i=on(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&i.isGlobal()){var o=i.getExtent().slice();return o[0]=-1/0,o[2]=1/0,Fr(o,!1,!1)}return Rr}(t),o=e.constraint,n=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(r=n||Be(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=r?0:t:void 0}):!1===e?Ar:"number"==typeof e?(i=e,o=2*Math.PI/i,function(t,e){return e?t:void 0!==t?t=Math.floor(t/o+.5)*o:void 0}):Ar}return Dr;var i,o;var n,r}(t);this.constraints_={center:i,resolution:o,rotation:n},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 i=this.getCenter();if(i){var o=t||[0,0,0,0];e=e||[0,0,0,0];var n=this.getResolution(),r=n/2*(o[3]-e[3]+e[1]-o[1]),a=n/2*(o[0]-e[0]+e[2]-o[2]);this.setCenterInternal([i[0]+r,i[1]-a])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=Tt({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Tt({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),i=0;i<e.length;++i){var o=arguments[i];o.center&&((o=Tt({},o)).center=cn(o.center,this.getProjection())),o.anchor&&((o=Tt({},o)).anchor=cn(o.anchor,this.getProjection())),e[i]=o}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,i=arguments.length;i>1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i);for(var o=0;o<i&&!this.isDef();++o){var n=arguments[o];n.center&&this.setCenterInternal(n.center),void 0!==n.zoom?this.setZoom(n.zoom):n.resolution&&this.setResolution(n.resolution),void 0!==n.rotation&&this.setRotation(n.rotation)}if(o!==i){for(var r=Date.now(),a=this.targetCenter_.slice(),s=this.targetResolution_,l=this.targetRotation_,u=[];o<i;++o){var p=arguments[o],h={start:r,complete:!1,anchor:p.anchor,duration:void 0!==p.duration?p.duration:1e3,easing:p.easing||di,callback:e};if(p.center&&(h.sourceCenter=a,h.targetCenter=p.center.slice(),a=h.targetCenter),void 0!==p.zoom?(h.sourceResolution=s,h.targetResolution=this.getResolutionForZoom(p.zoom),s=h.targetResolution):p.resolution&&(h.sourceResolution=s,h.targetResolution=p.resolution,s=h.targetResolution),void 0!==p.rotation){h.sourceRotation=l;var d=Ve(p.rotation-l+Math.PI,2*Math.PI)-Math.PI;h.targetRotation=l+d,l=h.targetRotation}La(h)?h.complete=!0:r+=h.duration,u.push(h)}this.animations_.push(u),this.setHint(zr,1),this.updateAnimations_()}else e&&Aa(e,!0)},e.prototype.getAnimating=function(){return this.hints_[zr]>0},e.prototype.getInteracting=function(){return this.hints_[Er]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(zr,-this.hints_[zr]);for(var e=0,i=this.animations_.length;e<i;++e){var o=this.animations_[e];if(o[0].callback&&Aa(o[0].callback,!1),!t)for(var n=0,r=o.length;n<r;++n){var a=o[n];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,i=this.animations_.length-1;i>=0;--i){for(var o=this.animations_[i],n=!0,r=0,a=o.length;r<a;++r){var s=o[r];if(!s.complete){var l=t-s.start,u=s.duration>0?l/s.duration:1;u>=1?(s.complete=!0,u=1):n=!1;var p=s.easing(u);if(s.sourceCenter){var h=s.sourceCenter[0],d=s.sourceCenter[1],c=s.targetCenter[0],g=s.targetCenter[1];this.nextCenter_=s.targetCenter;var f=h+p*(c-h),m=d+p*(g-d);this.targetCenter_=[f,m]}if(s.sourceResolution&&s.targetResolution){var v=1===p?s.targetResolution:s.sourceResolution+p*(s.targetResolution-s.sourceResolution);if(s.anchor){var y=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(v,0,y,!0);this.targetCenter_=this.calculateCenterZoom(_,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=v,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var b=1===p?Ve(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+p*(s.targetRotation-s.sourceRotation);if(s.anchor){var x=this.constraints_.rotation(b,!0);this.targetCenter_=this.calculateCenterRotate(x,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=b}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(n){this.animations_[i]=null,this.setHint(zr,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var k=o[0].callback;k&&Aa(k,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var i,o,n,r=this.getCenterInternal();return void 0!==r&&(Uo(i=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),n=e,(o=i)[0]+=+n[0],o[1]+=+n[1]),i},e.prototype.calculateCenterZoom=function(t,e){var i,o=this.getCenterInternal(),n=this.getResolution();void 0!==o&&void 0!==n&&(i=[e[0]-t*(e[0]-o[0])/n,e[1]-t*(e[1]-o[1])/n]);return i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],o=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(o*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(o*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?dn(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Tr)},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 gn(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();je(i,1);var o=this.getResolution();je(void 0!==o,2);var n=this.getRotation();return je(void 0!==n,3),ko(i,o,n,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(Pr)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(fn(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSizeMinusPadding_(),o=Eo(t)/i[0],n=wo(t)/i[1];return Math.max(o,n)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/Math.log(e);return function(t){return i/Math.pow(e,t*n)}},e.prototype.getRotation=function(){return this.get(Or)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/e;return function(t){return Math.log(i/t)/e/n}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),o=this.getCenterInternal(),n=this.padding_;if(n){var r=this.getViewportSizeMinusPadding_();o=Ga(o,this.getViewportSize_(),[r[0]/2+n[3],r[1]/2+n[0]],e,i)}return{center:o.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,o=this.minZoom_||0;if(this.resolutions_){var n=xt(this.resolutions_,t,1);o=n,e=this.resolutions_[n],i=n==this.resolutions_.length-1?2:e/this.resolutions_[n+1]}else e=this.maxResolution_,i=this.zoomFactor_;return o+Math.log(e/t)/Math.log(i)},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),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,De(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(je(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))je(!Po(t),25),i=Ma(o=fn(t,this.getProjection()));else if(t.getType()===Go){var o;(i=Ma(o=fn(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),bo(o))}else{i=t}this.fitInternal(i,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),i=Math.cos(e),o=Math.sin(-e),n=t.getFlatCoordinates(),r=t.getStride(),a=1/0,s=1/0,l=-1/0,u=-1/0,p=0,h=n.length;p<h;p+=r){var d=n[p]*i-n[p+1]*o,c=n[p]*o+n[p+1]*i;a=Math.min(a,d),s=Math.min(s,c),l=Math.max(l,d),u=Math.max(u,c)}return[a,s,l,u]},e.prototype.fitInternal=function(t,e){var i=e||{},o=i.size;o||(o=this.getViewportSizeMinusPadding_());var n,r=void 0!==i.padding?i.padding:[0,0,0,0],a=void 0!==i.nearest&&i.nearest;n=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;var s=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(s,[o[0]-r[1]-r[3],o[1]-r[0]-r[2]]);l=isNaN(l)?n:Math.max(l,n),l=this.getConstrainedResolution(l,a?0:1);var u=this.getRotation(),p=Math.sin(u),h=Math.cos(u),d=bo(s);d[0]+=(r[1]-r[3])/2*l,d[1]+=(r[0]-r[2])/2*l;var c=d[0]*h-d[1]*p,g=d[1]*h+d[0]*p,f=this.getConstrainedCenter([c,g],l),m=i.callback?i.callback:Et;void 0!==i.duration?this.animateInternal({resolution:l,center:f,duration:i.duration,easing:i.easing},m):(this.targetResolution_=l,this.targetCenter_=f,this.applyTargetState_(!1,!0),Aa(m,!0))},e.prototype.centerOn=function(t,e,i){this.centerOnInternal(cn(t,this.getProjection()),e,i)},e.prototype.centerOnInternal=function(t,e,i){this.setCenterInternal(Ga(t,e,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,i,o){var n,r=this.padding_;if(r&&t){var a=this.getViewportSizeMinusPadding_(-i),s=Ga(t,o,[a[0]/2+r[3],a[1]/2+r[0]],e,i);n=[t[0]-s[0],t[1]-s[1]]}return n},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=dn(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var i=e&&cn(e,this.getProjection());this.adjustResolutionInternal(t,i)},e.prototype.adjustResolutionInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(this.targetResolution_*t,0,o,i);e&&(this.targetCenter_=this.calculateCenterZoom(n,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=cn(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(o,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(cn(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 i=this.getAnimating()||this.getInteracting()||e,o=this.constraints_.rotation(this.targetRotation_,i),n=this.getViewportSize_(o),r=this.constraints_.resolution(this.targetResolution_,0,n,i),a=this.constraints_.center(this.targetCenter_,r,n,i,this.calculateCenterShift(this.targetCenter_,r,o,n));this.get(Or)!==o&&this.set(Or,o),this.get(Pr)!==r&&this.set(Pr,r),this.get(Tr)&&Wo(this.get(Tr),a)||this.set(Tr,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,i){var o=void 0!==t?t:200,n=e||0,r=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(r),s=this.constraints_.resolution(this.targetResolution_,n,a),l=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,r,a));if(0===o&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=r,this.targetCenter_=l,void this.applyTargetState_();var u=i||(0===o?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===r&&this.getCenterInternal()&&Wo(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:s,duration:o,easing:hi,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Er,1)},e.prototype.endInteraction=function(t,e,i){var o=i&&cn(i,this.getProjection());this.endInteractionInternal(t,e,o)},e.prototype.endInteractionInternal=function(t,e,i){this.setHint(Er,-1),this.resolveConstraints(t,e,i)},e.prototype.getConstrainedCenter=function(t,e){var i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)},e.prototype.getConstrainedZoom=function(t,e){var i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))},e.prototype.getConstrainedResolution=function(t,e){var i=e||0,o=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,o)},e}(oe);function Ba(t){return t[0]>0&&t[1]>0}function Va(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var qa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var Wa=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,o,n,r={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new ur({layers:t.layers});r[or]=a,r[rr]=t.target,r[ar]=t.view instanceof Na?t.view:new Na,void 0!==t.controls&&(Array.isArray(t.controls)?i=new ui(t.controls.slice()):(je("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?o=new ui(t.interactions.slice()):(je("function"==typeof t.interactions.getArray,48),o=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?n=new ui(t.overlays.slice()):(je("function"==typeof t.overlays.getArray,49),n=t.overlays):n=new ui;return{controls:i,interactions:o,keyboardEventTarget:e,overlays:n,values:r}}(e);i.boundHandleBrowserEvent_=i.handleBrowserEvent.bind(i),i.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,i.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:he,i.postRenderTimeoutHandle_,i.animationDelayKey_,i.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(i),i.coordinateToPixelTransform_=[1,0,0,1,0,0],i.pixelToCoordinateTransform_=[1,0,0,1,0,0],i.frameIndex_=0,i.frameState_=null,i.previousExtent_=null,i.viewPropertyListenerKey_=null,i.viewChangeListenerKey_=null,i.layerGroupPropertyListenerKeys_=null,i.viewport_=document.createElement("div"),i.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),i.viewport_.style.position="relative",i.viewport_.style.overflow="hidden",i.viewport_.style.width="100%",i.viewport_.style.height="100%",i.overlayContainer_=document.createElement("div"),i.overlayContainer_.style.position="absolute",i.overlayContainer_.style.zIndex="0",i.overlayContainer_.style.width="100%",i.overlayContainer_.style.height="100%",i.overlayContainer_.style.pointerEvents="none",i.overlayContainer_.className="ol-overlaycontainer",i.viewport_.appendChild(i.overlayContainer_),i.overlayContainerStopEvent_=document.createElement("div"),i.overlayContainerStopEvent_.style.position="absolute",i.overlayContainerStopEvent_.style.zIndex="0",i.overlayContainerStopEvent_.style.width="100%",i.overlayContainerStopEvent_.style.height="100%",i.overlayContainerStopEvent_.style.pointerEvents="none",i.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",i.viewport_.appendChild(i.overlayContainerStopEvent_),i.mapBrowserEventHandler_=null,i.moveTolerance_=e.moveTolerance,i.keyboardEventTarget_=o.keyboardEventTarget,i.keyHandlerKeys_=null,i.controls=o.controls||new ui,i.interactions=o.interactions||new ui,i.overlays_=o.overlays,i.overlayIdIndex_={},i.renderer_=null,i.handleResize_,i.postRenderFunctions_=[],i.tileQueue_=new Cr(i.getTilePriority.bind(i),i.handleTileChange_.bind(i)),i.addChangeListener(or,i.handleLayerGroupChanged_),i.addChangeListener(ar,i.handleViewChanged_),i.addChangeListener(nr,i.handleSizeChanged_),i.addChangeListener(rr,i.handleTargetChanged_),i.setProperties(o.values);var n=i;return!e.view||e.view instanceof Na||e.view.then((function(t){n.setView(new Na(t))})),i.controls.addEventListener(ni,function(t){t.element.setMap(this)}.bind(i)),i.controls.addEventListener(ri,function(t){t.element.setMap(null)}.bind(i)),i.interactions.addEventListener(ni,function(t){t.element.setMap(this)}.bind(i)),i.interactions.addEventListener(ri,function(t){t.element.setMap(null)}.bind(i)),i.overlays_.addEventListener(ni,function(t){this.addOverlayInternal_(t.element)}.bind(i)),i.overlays_.addEventListener(ri,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(i)),i.controls.forEach(function(t){t.setMap(this)}.bind(i)),i.interactions.forEach(function(t){t.setMap(this)}.bind(i)),i.overlays_.forEach(i.addOverlayInternal_.bind(i)),i}return qa(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,i){if(this.frameState_){var o=this.getCoordinateFromPixelInternal(t),n=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,r=void 0!==i.layerFilter?i.layerFilter:Ct,a=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(o,this.frameState_,n,a,e,null,r,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),e),i},e.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_){var o=i||{},n=void 0!==o.hitTolerance?o.hitTolerance:0,r=o.layerFilter||Ct;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,n,e,r)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixelInternal(t),o=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:Ct,n=void 0!==e.hitTolerance?e.hitTolerance:0,r=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,n,r,o,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},e.prototype.getTarget=function(){return this.get(rr)},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 dn(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?xn(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(or)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof ui)e.setLayers(t);else{var i=e.getLayers();i.clear(),i.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var o=t[e].layer.getSource();if(o&&o.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=cn(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?xn(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(nr)},e.prototype.getView=function(){return this.get(ar)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,e,i,o){return function(t,e,i,o,n){if(!t||!(i in t.wantedTiles))return vr;if(!t.wantedTiles[i][e.getKey()])return vr;var r=t.viewState.center,a=o[0]-r[0],s=o[1]-r[1];return 65536*Math.log(n)+Math.sqrt(a*a+s*s)/n}(this.frameState_,t,e,i,o)},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,o=new cr(i,this,t);this.handleMapBrowserEvent(o)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,i=e.type;if(i===_i||i===Ut||i===Nt){var o=this.getOwnerDocument(),n=this.viewport_.getRootNode?this.viewport_.getRootNode():o,r=e.target;if(this.overlayContainerStopEvent_.contains(r)||!(n===o?o.documentElement:n).contains(r))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var a=this.getInteractions().getArray().slice(),s=a.length-1;s>=0;s--){var l=a[s];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,o=i;if(t){var n=t.viewHints;if(n[zr]||n[Er]){var r=Date.now()-t.time>8;i=r?0:8,o=r?0:2}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,o))}!t||!this.hasListener(He)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(He,t);for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.mapBrowserEventHandler_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)Yt(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(At,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(Ut,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(qt,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,ve(this.viewport_)}if(t){for(var o in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new mr(this,this.moveTolerance_),gr)this.mapBrowserEventHandler_.addEventListener(gr[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(At,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(Ut,this.boundHandleBrowserEvent_,!!ge&&{passive:!1});var n=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[Xt(n,Nt,this.handleBrowserEvent,this),Xt(n,Bt,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(qt,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_&&(Yt(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Yt(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=Xt(t,yt,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=Xt(t,jt,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Yt),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[Xt(t,yt,this.render,this),Xt(t,jt,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,i=t.length;e<i;++e){var o=t[e].layer;o.hasRenderer()&&o.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,i=this.getSize(),o=this.getView(),n=this.frameState_,r=null;if(void 0!==i&&Ba(i)&&o&&o.isDef()){var a=o.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=o.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:ko(s.center,s.resolution,s.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:s,viewHints:a,wantedTiles:{}},s.nextCenter&&s.nextResolution){var l=isNaN(s.nextRotation)?s.rotation:s.nextRotation;r.nextExtent=ko(s.nextCenter,s.nextResolution,l,i)}}if(this.frameState_=r,this.renderer_.renderFrame(r),r){if(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),n)(!this.previousExtent_||!Po(this.previousExtent_)&&!po(r.extent,this.previousExtent_))&&(this.dispatchEvent(new hr(re,this,n)),this.previousExtent_=so(this.previousExtent_));this.previousExtent_&&!r.viewHints[zr]&&!r.viewHints[Er]&&!po(r.extent,this.previousExtent_)&&(this.dispatchEvent(new hr(ae,this,r)),Qi(r.extent,this.previousExtent_))}this.dispatchEvent(new hr(ne,this,r)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(or,t)},e.prototype.setSize=function(t){this.set(nr,t)},e.prototype.setTarget=function(t){this.set(rr,t)},e.prototype.setView=function(t){if(!t||t instanceof Na)this.set(ar,t);else{this.set(ar,new Na);var e=this;t.then((function(t){e.setView(new Na(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var i=getComputedStyle(t),o=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),n=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(o)||isNaN(n)||!Ba(e=[o,n])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0.")}this.setSize(e),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(oe),Ua=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Xa="degrees",Ka="imperial",Ya="nautical",Za="metric",Ha="us",$a=[1,2,5],Ja=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.className?o.className:o.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).on,i.once,i.un,i.innerElement_=document.createElement("div"),i.innerElement_.className=n+"-inner",i.element.className=n+" ol-unselectable",i.element.appendChild(i.innerElement_),i.viewState_=null,i.minWidth_=void 0!==o.minWidth?o.minWidth:64,i.renderedVisible_=!1,i.renderedWidth_=void 0,i.renderedHTML_="",i.addChangeListener("units",i.handleUnitsChanged_),i.setUnits(o.units||Za),i.scaleBar_=o.bar||!1,i.scaleBarSteps_=o.steps||4,i.scaleBarText_=o.text||!1,i.dpi_=o.dpi||void 0,i}return Ua(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,i=t.projection,o=this.getUnits(),n=o==Xa?ki.DEGREES:ki.METERS,r=tn(i,t.resolution,e,n),a=this.minWidth_*(this.dpi_||90.7142857142857)/90.7142857142857,s=a*r,l="";if(o==Xa){var u=xi[ki.DEGREES];(s*=u)<u/60?(l="″",r*=3600):s<u?(l="′",r*=60):l="°"}else o==Ka?s<.9144?(l="in",r/=.0254):s<1609.344?(l="ft",r/=.3048):(l="mi",r/=1609.344):o==Ya?(r/=1852,l="nm"):o==Za?s<.001?(l="μm",r*=1e6):s<1?(l="mm",r*=1e3):s<1e3?l="m":(l="km",r/=1e3):o==Ha?s<.9144?(l="in",r*=39.37):s<1609.344?(l="ft",r/=.30480061):(l="mi",r/=1609.3472):je(!1,33);for(var p,h,d,c,g=3*Math.floor(Math.log(a*r)/Math.log(10));;){d=Math.floor(g/3);var f=Math.pow(10,d);if(p=$a[(g%3+3)%3]*f,h=Math.round(p/r),isNaN(h))return this.element.style.display="none",void(this.renderedVisible_=!1);if(h>=a)break;++g}c=this.scaleBar_?this.createScaleBar(h,p,l):p.toFixed(d<0?-d:0)+" "+l,this.renderedHTML_!=c&&(this.innerElement_.innerHTML=c,this.renderedHTML_=c),this.renderedWidth_!=h&&(this.innerElement_.style.width=h+"px",this.renderedWidth_=h),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,i){for(var o="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),n=[],r=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&n.push(this.createMarker("absolute",s)),n.push('<div><div class="ol-scale-singlebar" style="width: '+r+"px;background-color: "+a+';"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,i):"")+"</div>"),s===this.scaleBarSteps_-1&&n.push(this.createStepText(s+1,t,!0,e,i)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+o+"</div>":"")+n.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,i,o,n){var r=(0===t?0:Math.round(o/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+n);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(i?e+"px":"unset")+';">'+r+"</div>"},e.prototype.getScaleForResolution=function(){var t=tn(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||90.7142857142857,i=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*i*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(_e);function Qa(t){var e=t||{},i=new ui;return(void 0===e.zoom||e.zoom)&&i.push(new vi(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new fi(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new oi(e.attributionOptions)),i}var ts=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var es=function(t){function e(e){var i=t.call(this)||this;if(i.on,i.once,i.un,i.id_=void 0,i.geometryName_="geometry",i.style_=null,i.styleFunction_=void 0,i.geometryChangeKey_=null,i.addChangeListener(i.geometryName_,i.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var o=e;i.setGeometry(o)}else{var n=e;i.setProperties(n)}return i}return ts(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var o=this.getStyle();return o&&t.setStyle(o),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_&&(Yt(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=Xt(t,jt,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:(je("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}(oe),is=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var i;if(e){var o=e.dataProjection?Qo(e.dataProjection):this.readProjection(t);e.extent&&o&&o.getUnits()===ki.TILE_PIXELS&&(o=Qo(o)).setWorldExtent(e.extent),i={dataProjection:o,featureProjection:e.featureProjection}}return this.adaptOptions(i)},t.prototype.adaptOptions=function(t){return Tt({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return Jt()},t.prototype.readFeature=function(t,e){return Jt()},t.prototype.readFeatures=function(t,e){return Jt()},t.prototype.readGeometry=function(t,e){return Jt()},t.prototype.readProjection=function(t){return Jt()},t.prototype.writeFeature=function(t,e){return Jt()},t.prototype.writeFeatures=function(t,e){return Jt()},t.prototype.writeGeometry=function(t,e){return Jt()},t}();function os(t,e,i){var o,n=i?Qo(i.featureProjection):null,r=i?Qo(i.dataProjection):null;if(o=n&&r&&!rn(n,r)?(e?t.clone():t).transform(e?n:r,e?r:n):t,e&&i&&void 0!==i.decimals){var a=Math.pow(10,i.decimals);o===t&&(o=t.clone()),o.applyTransform((function(t){for(var e=0,i=t.length;e<i;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return o}var ns="arraybuffer",rs="json",as="text",ss="xml",ls=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function us(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var ps=function(t){function e(){return t.call(this)||this}return ls(e,t),e.prototype.getType=function(){return rs},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(us(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(us(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return Jt()},e.prototype.readFeaturesFromObject=function(t,e){return Jt()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(us(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return Jt()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(us(t))},e.prototype.readProjectionFromObject=function(t){return Jt()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return Jt()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return Jt()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return Jt()},e}(is);function hs(t,e,i,o,n,r,a){var s,l,u=(i-e)/o;if(1===u)s=e;else if(2===u)s=e,l=n;else if(0!==u){for(var p=t[e],h=t[e+1],d=0,c=[0],g=e+o;g<i;g+=o){var f=t[g],m=t[g+1];d+=Math.sqrt((f-p)*(f-p)+(m-h)*(m-h)),c.push(d),p=f,h=m}var v=n*d,y=function(t,e,i){for(var o,n,r=i||bt,a=0,s=t.length,l=!1;a<s;)(n=+r(t[o=a+(s-a>>1)],e))<0?a=o+1:(s=o,l=!n);return l?a:~a}(c,v);y<0?(l=(v-c[-y-2])/(c[-y-1]-c[-y-2]),s=e+(-y-2)*o):s=e+y*o}var _=a>1?a:2,b=r||new Array(_);for(g=0;g<_;++g)b[g]=void 0===s?NaN:void 0===l?t[s+g]:qe(t[s+g],t[s+o+g],l);return b}function ds(t,e,i,o,n,r){if(i==e)return null;var a;if(n<t[e+o-1])return r?((a=t.slice(e,e+o))[o-1]=n,a):null;if(t[i-1]<n)return r?((a=t.slice(i-o,i))[o-1]=n,a):null;if(n==t[e+o-1])return t.slice(e,e+o);for(var s=e/o,l=i/o;s<l;){var u=s+l>>1;n<t[(u+1)*o-1]?l=u:s=u+1}var p=t[s*o-1];if(n==p)return t.slice((s-1)*o,(s-1)*o+o);var h=(n-p)/(t[(s+1)*o-1]-p);a=[];for(var d=0;d<o-1;++d)a.push(qe(t[(s-1)*o+d],t[s*o+d],h));return a.push(n),a}function cs(t,e,i,o){for(var n=t[e],r=t[e+1],a=0,s=e+o;s<i;s+=o){var l=t[s],u=t[s+1];a+=Math.sqrt((l-n)*(l-n)+(u-r)*(u-r)),n=l,r=u}return a}var gs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),fs=function(t){function e(e,i){var o=t.call(this)||this;return o.flatMidpoint_=null,o.flatMidpointRevision_=-1,o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return gs(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?wt(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,i,o){return o<to(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Jr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.forEachSegment=function(t){return wa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=Nr&&this.layout!=Br)return null;var i=void 0!==e&&e;return ds(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return hs(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 i=[];return i.length=ra(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Lr)},e.prototype.getType=function(){return Ro},e.prototype.intersectsExtent=function(t){return Sa(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=oa(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Hr),ms=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),vs=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.ends_=[],n.maxDelta_=-1,n.maxDeltaRevision_=-1,Array.isArray(e[0]))n.setCoordinates(e,i);else if(void 0!==i&&o)n.setFlatCoordinates(i,e),n.ends_=o;else{for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var h=a[u];0===u&&(r=h.getLayout()),wt(s,h.getFlatCoordinates()),l.push(s.length)}n.setFlatCoordinates(r,s),n.ends_=l}return n}return ms(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?wt(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,i,o){return o<to(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Qr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ea(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.getCoordinateAtM=function(t,e,i){if(this.layout!=Nr&&this.layout!=Br||0===this.flatCoordinates.length)return null;var o=void 0!==e&&e,n=void 0!==i&&i;return function(t,e,i,o,n,r,a){if(a)return ds(t,e,i[i.length-1],o,n,r);var s;if(n<t[o-1])return r?((s=t.slice(0,o))[o-1]=n,s):null;if(t[t.length-1]<n)return r?((s=t.slice(t.length-o))[o-1]=n,s):null;for(var l=0,u=i.length;l<u;++l){var p=i[l];if(e!=p){if(n<t[e+o-1])return null;if(n<=t[p-1])return ds(t,e,p,o,n,!1);e=p}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,o,n)},e.prototype.getCoordinates=function(){return pa(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 fs(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_,i=this.layout,o=[],n=0,r=0,a=e.length;r<a;++r){var s=e[r],l=new fs(t.slice(n,s),i);o.push(l),n=s}return o},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,o=this.ends_,n=this.stride,r=0,a=o.length;r<a;++r){var s=o[r];wt(t,hs(e,i,s,n,.5)),i=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=ra(t,e,p,o,n,r,a),s.push(a),e=p}return a}(this.flatCoordinates,0,this.ends_,this.stride,t,i,0,o),new e(i,Lr,o)},e.prototype.getType=function(){return Do},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){if(Sa(t,e,i[r],o,n))return!0;e=i[r]}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 i=na(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Hr),ys=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_s=function(t){function e(e,i){var o=t.call(this)||this;return i&&!Array.isArray(e[0])?o.setFlatCoordinates(i,e):o.setCoordinates(e,i),o}return ys(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?wt(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,i,o){if(o<to(this.getExtent(),t,e))return o;for(var n=this.flatCoordinates,r=this.stride,a=0,s=n.length;a<s;a+=r){var l=Ne(t,e,n[a],n[a+1]);if(l<o){o=l;for(var u=0;u<r;++u)i[u]=n[a+u];i.length=r}}return o},e.prototype.getCoordinates=function(){return ua(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 va(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,i=this.stride,o=[],n=0,r=t.length;n<r;n+=i){var a=new va(t.slice(n,n+i),e);o.push(a)}return o},e.prototype.getType=function(){return jo},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,i=this.stride,o=0,n=e.length;o<n;o+=i){if(oo(t,e[o],e[o+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=oa(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Hr);function bs(t,e,i,o){for(var n=[],r=[1/0,1/0,-1/0,-1/0],a=0,s=i.length;a<s;++a){var l=i[a];r=uo(t,e,l[0],o),n.push((r[0]+r[2])/2,(r[1]+r[3])/2),e=l[l.length-1]}return n}var xs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ks=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.endss_=[],n.flatInteriorPointsRevision_=-1,n.flatInteriorPoints_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,!o&&!Array.isArray(e[0])){for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var h=a[u];0===u&&(r=h.getLayout());for(var d=s.length,c=h.getEnds(),g=0,f=c.length;g<f;++g)c[g]+=d;wt(s,h.getFlatCoordinates()),l.push(c)}i=r,e=s,o=l}return void 0!==i&&o?(n.setFlatCoordinates(i,e),n.endss_=o):n.setCoordinates(e,i),n}return xs(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;wt(this.flatCoordinates,t.getFlatCoordinates());for(var o=0,n=(e=t.getEnds().slice()).length;o<n;++o)e[o]+=i}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,i=new Array(t),o=0;o<t;++o)i[o]=this.endss_[o].slice();var n=new e(this.flatCoordinates.slice(),this.layout,i);return n.applyProperties(this),n},e.prototype.closestPointXY=function(t,e,i,o){return o<to(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=Qr(t,e,s,o,n),e=s[s.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,o,n,r,a,s,l,u,p){for(var h=p||[NaN,NaN],d=0,c=i.length;d<c;++d){var g=i[d];u=ea(t,e,g,o,n,r,a,s,l,u,h),e=g[g.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return function(t,e,i,o,n,r){if(0===i.length)return!1;for(var a=0,s=i.length;a<s;++a){var l=i[a];if(ba(t,e,l,o,n,r))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,i,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=ca(t,e,s,o),e=s[s.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Oa(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,ha(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=bs(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=ka(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new _s(this.getFlatInteriorPoints().slice(),Nr)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(!Ta(t,e,s,o,n))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Oa(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l],h=[];a=la(t,e,p,o,n,r,a,h),s.push(h),e=p[p.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,o),new e(i,Lr,o)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var i=this.endss_[t-1];e=i[i.length-1]}var o=this.endss_[t].slice(),n=o[o.length-1];if(0!==e)for(var r=0,a=o.length;r<a;++r)o[r]-=e;return new Ia(this.flatCoordinates.slice(e,n),this.layout,o)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r].slice(),l=s[s.length-1];if(0!==n)for(var u=0,p=s.length;u<p;++u)s[u]-=n;var h=new Ia(e.slice(n,l),t,s);o.push(h),n=l}return o},e.prototype.getType=function(){return Ao},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(Ca(t,e,s,o,n))return!0;e=s[s.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 i=function(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=na(t,e,i[s],o,r[a]);r[a++]=u,e=u[u.length-1]}return r.length=a,r}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var o=i[i.length-1];this.flatCoordinates.length=0===o.length?0:o[o.length-1]}this.changed()},e}(Hr),ws=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Ss(t){for(var e=[],i=0,o=t.length;i<o;++i)e.push(t[i].clone());return e}var Cs=function(t){function e(e){var i=t.call(this)||this;return i.geometries_=e||null,i.changeEventsKeys_=[],i.listenGeometriesChange_(),i}return ws(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(Yt),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(Xt(this.geometries_[t],jt,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,i,o){if(o<to(this.getExtent(),t,e))return o;for(var n=this.geometries_,r=0,a=n.length;r<a;++r)o=n[r].closestPointXY(t,e,i,o);return o},e.prototype.containsXY=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)if(i[o].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){so(t);for(var e=this.geometries_,i=0,o=e.length;i<o;++i)ho(t,e[i].getExtent());return t},e.prototype.getGeometries=function(){return Ss(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,i=0,o=e.length;i<o;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);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 i=[],o=this.geometries_,n=!1,r=0,a=o.length;r<a;++r){var s=o[r],l=s.getSimplifiedGeometry(t);i.push(l),l!==s&&(n=!0)}if(n){var u=new e(null);return u.setGeometriesArray(i),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return Lo},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,i=0,o=e.length;i<o;++i)if(e[i].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)i[o].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,i){var o=i;o||(o=bo(this.getExtent()));for(var n=this.geometries_,r=0,a=n.length;r<a;++r)n[r].scale(t,e,o);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(Ss(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_,i=0,o=e.length;i<o;++i)e[i].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)i[o].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Kr),zs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Es(t,e){if(!t)return null;var i;switch(t.type){case Fo:i=function(t){return new va(t.coordinates)}(t);break;case Ro:i=function(t){return new fs(t.coordinates)}(t);break;case Mo:i=function(t){return new Ia(t.coordinates)}(t);break;case jo:i=function(t){return new _s(t.coordinates)}(t);break;case Do:i=function(t){return new vs(t.coordinates)}(t);break;case Ao:i=function(t){return new ks(t.coordinates)}(t);break;case Lo:i=function(t,e){var i=t.geometries.map((function(t){return Es(t,e)}));return new Cs(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return os(i,!1,e)}function Ts(t,e){var i,o=(t=os(t,!0,e)).getType();switch(o){case Fo:i=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case Ro:i=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case Mo:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}(t,e);break;case jo:i=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case Do:i=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case Ao:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Lo:i=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var i=Tt({},e);return delete i.featureProjection,Ts(t,i)}))}}(t,e);break;case Go:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+o)}return i}var Ps=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this)||this).dataProjection=Qo(o.dataProjection?o.dataProjection:"EPSG:4326"),o.featureProjection&&(i.defaultFeatureProjection=Qo(o.featureProjection)),i.geometryName_=o.geometryName,i.extractGeometryName_=o.extractGeometryName,i.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],i}return zs(e,t),e.prototype.readFeatureFromObject=function(t,e){var i=null,o=Es((i="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),n=new es;return this.geometryName_?n.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&n.setGeometryName(i.geometry_name),n.setGeometry(o),"id"in i&&n.setId(i.id),i.properties&&n.setProperties(i.properties,!0),n},e.prototype.readFeaturesFromObject=function(t,e){var i=null;if("FeatureCollection"===t.type){i=[];for(var o=t.features,n=0,r=o.length;n<r;++n)i.push(this.readFeatureFromObject(o[n],e))}else i=[this.readFeatureFromObject(t,e)];return i},e.prototype.readGeometryFromObject=function(t,e){return Es(t,e)},e.prototype.readProjectionFromObject=function(t){var e,i=t.crs;return i?"name"==i.type?e=Qo(i.properties.name):"EPSG"===i.type?e=Qo("EPSG:"+i.properties.code):je(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={type:"Feature",geometry:null,properties:null},o=t.getId();if(void 0!==o&&(i.id=o),!t.hasProperties())return i;var n=t.getProperties(),r=t.getGeometry();return r&&(i.geometry=Ts(r,e),delete n[t.getGeometryName()]),Ft(n)||(i.properties=n),i},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],o=0,n=t.length;o<n;++o)i.push(this.writeFeatureObject(t[o],e));return{type:"FeatureCollection",features:i}},e.prototype.writeGeometryObject=function(t,e){return Ts(t,this.adaptOptions(e))},e}(ps),Os=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}(),Fs="fraction",Rs="pixels",Is="bottom-left",Ms="bottom-right",js="top-left",Ds="top-right",As=0,Ls=1,Gs=2,Ns=3,Bs=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Va(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 Jt()},t.prototype.getImage=function(t){return Jt()},t.prototype.getHitDetectionImage=function(){return Jt()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return Jt()},t.prototype.getImageSize=function(){return Jt()},t.prototype.getOrigin=function(){return Jt()},t.prototype.getSize=function(){return Jt()},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_=Va(t)},t.prototype.listenImageChange=function(t){Jt()},t.prototype.load=function(){Jt()},t.prototype.unlistenImageChange=function(t){Jt()},t}(),Vs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),qs=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=o,r.resolution=i,r.state=n,r}return Vs(e,t),e.prototype.changed=function(){this.dispatchEvent(jt)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return Jt()},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(){Jt()},e}(Mt),Ws=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Us(t,e,i){var o=t;if(o.src&&ce){var n=o.decode(),r=!0;return n.then((function(){r&&e()})).catch((function(t){r&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){r=!1}}var a=[Kt(o,Vt,e),Kt(o,Dt,i)];return function(){a.forEach(Yt)}}!function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,o,As)||this;return s.src_=n,s.image_=new Image,null!==r&&(s.image_.crossOrigin=r),s.unlisten_=null,s.state=As,s.imageLoadFunction_=a,s}Ws(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Ns,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=wo(this.extent)/this.image_.height),this.state=Gs,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=As&&this.state!=Ns||(this.state=Ls,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Us(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=wo(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(qs);var Xs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ks=null,Ys=function(t){function e(e,i,o,n,r,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==n&&(s.image_.crossOrigin=n),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=r,s.size_=o,s.src_=i,s.tainted_,s}return Xs(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Gs){Ks||(Ks=fe(1,1)),Ks.drawImage(this.image_,0,0);try{Ks.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Ks=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(jt)},e.prototype.handleImageError_=function(){this.imageState_=Ns,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Gs,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],i=fe(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==As){this.imageState_=Ls;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Us(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===Gs){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply","multiply"===i.globalCompositeOperation||this.isTainted_())i.fillStyle=Tn(this.color_),i.fillRect(0,0,e.width/t,e.height/t),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var o=i.getImageData(0,0,e.width,e.height),n=o.data,r=this.color_[0]/255,a=this.color_[1]/255,s=this.color_[2]/255,l=this.color_[3],u=0,p=n.length;u<p;u+=4)n[u]*=r,n[u+1]*=a,n[u+2]*=s,n[u+3]*=l;i.putImageData(o,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Mt);var Zs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Hs=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.opacity?o.opacity:1,r=void 0!==o.rotation?o.rotation:0,a=void 0!==o.scale?o.scale:1,s=void 0!==o.rotateWithView&&o.rotateWithView;(i=t.call(this,{opacity:n,rotation:r,scale:a,displacement:void 0!==o.displacement?o.displacement:[0,0],rotateWithView:s})||this).anchor_=void 0!==o.anchor?o.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=void 0!==o.anchorOrigin?o.anchorOrigin:js,i.anchorXUnits_=void 0!==o.anchorXUnits?o.anchorXUnits:Fs,i.anchorYUnits_=void 0!==o.anchorYUnits?o.anchorYUnits:Fs,i.crossOrigin_=void 0!==o.crossOrigin?o.crossOrigin:null;var l=void 0!==o.img?o.img:null,u=void 0!==o.imgSize?o.imgSize:null,p=o.src;je(!(void 0!==p&&l),4),je(!l||l&&u,5),void 0!==p&&0!==p.length||!l||(p=l.src||te(l)),je(void 0!==p&&p.length>0,6);var h=void 0!==o.src?As:Gs;return i.color_=void 0!==o.color?Rn(o.color):null,i.iconImage_=function(t,e,i,o,n,r){var a=Dn.get(e,o,r);return a||(a=new Ys(t,e,i,o,n,r),Dn.set(e,o,r,a)),a}(l,p,u,i.crossOrigin_,h,i.color_),i.offset_=void 0!==o.offset?o.offset:[0,0],i.offsetOrigin_=void 0!==o.offsetOrigin?o.offsetOrigin:js,i.origin_=null,i.size_=void 0!==o.size?o.size:null,i}return Zs(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_==Fs||this.anchorYUnits_==Fs){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Fs&&(t[0]*=e[0]),this.anchorYUnits_==Fs&&(t[1]*=e[1])}if(this.anchorOrigin_!=js){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Ds&&this.anchorOrigin_!=Ms||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Is&&this.anchorOrigin_!=Ms||(t[1]=-t[1]+e[1])}var i=this.getDisplacement();return t[0]-=i[0],t[1]+=i[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_!=js){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=Ds&&this.offsetOrigin_!=Ms||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=Is&&this.offsetOrigin_!=Ms||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(jt,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(jt,t)},e}(Bs),$s=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}();function Js(t){return Array.isArray(t)?Mn(t):t}var Qs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),tl=function(t){function e(e){var i=this,o=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:o,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_=void 0,i.hitDetectionCanvas_=null,i.fill_=void 0!==e.fill?e.fill:null,i.origin_=[0,0],i.points_=e.points,i.radius_=void 0!==e.radius?e.radius:e.radius1,i.radius2_=e.radius2,i.angle_=void 0!==e.angle?e.angle:0,i.stroke_=void 0!==e.stroke?e.stroke:null,i.anchor_=null,i.size_=null,i.renderOptions_=null,i.render(),i}return Qs(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.getAnchor=function(){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 i=this.renderOptions_,o=fe(i.size*t,i.size*t);this.draw_(i,o,t),e=o.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 Gs},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,i){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var o=this.radius_,n=void 0===this.radius2_?o:this.radius2_;if(o<n){var r=o;o=n,n=r}var a=void 0===this.radius2_?this.points_:2*this.points_,s=2*Math.PI/a,l=n*Math.sin(s),u=o-Math.sqrt(n*n-l*l),p=Math.sqrt(l*l+u*u),h=p/l;if("miter"===t&&h<=i)return h*e;var d=e/2/h,c=e/2*(u/p),g=Math.sqrt((o+d)*(o+d)+c*c)-o;if(void 0===this.radius2_||"bevel"===t)return 2*g;var f=o*Math.sin(s),m=n-Math.sqrt(o*o-f*f),v=Math.sqrt(f*f+m*m)/f;if(v<=i){var y=v*e/2-n-o;return 2*Math.max(g,y)}return 2*g},e.prototype.createRenderOptions=function(){var t,e="round",i=0,o=null,n=0,r=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t="#000"),t=Js(t),void 0===(r=this.stroke_.getWidth())&&(r=1),o=this.stroke_.getLineDash(),n=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e="round"),void 0===(i=this.stroke_.getMiterLimit())&&(i=10));var a=this.calculateLineJoinSize_(e,r,i),s=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:r,size:Math.ceil(2*s+a),lineDash:o,lineDashOffset:n,lineJoin:e,miterLimit:i}},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,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var o=this.fill_.getColor();null===o&&(o="#000"),e.fillStyle=Js(o),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),i=0;if("string"==typeof e&&(e=Rn(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var o=fe(t.size,t.size);this.hitDetectionCanvas_=o.canvas,this.drawHitDetectionCanvas_(t,o)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,i=this.radius_;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{var o=void 0===this.radius2_?i:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var n=this.angle_-Math.PI/2,r=2*Math.PI/e,a=0;a<e;a++){var s=n+a*r,l=a%2==0?i:o;t.lineTo(l*Math.cos(s),l*Math.sin(s))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle="#000",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}(Bs),el=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),il=function(t){function e(e){var i=e||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,scale:void 0!==i.scale?i.scale:1,rotation:void 0!==i.rotation?i.rotation:0,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this}return el(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(tl),ol=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=sl,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=sl,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var nl=null;function rl(t,e){if(!nl){var i=new Os({color:"rgba(255,255,255,0.4)"}),o=new $s({color:"#3399CC",width:1.25});nl=[new ol({image:new il({fill:i,stroke:o,radius:5}),fill:i,stroke:o})]}return nl}function al(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t[Mo]=[new ol({fill:new Os({color:[255,255,255,.5]})})],t[Ao]=t[Mo],t[Ro]=[new ol({stroke:new $s({color:e,width:5})}),new ol({stroke:new $s({color:i,width:3})})],t[Do]=t[Ro],t[Go]=t[Mo].concat(t[Ro]),t[Fo]=[new ol({image:new il({radius:6,fill:new Os({color:i}),stroke:new $s({color:e,width:1.5})}),zIndex:1/0})],t[jo]=t[Fo],t[Lo]=t[Mo].concat(t[Ro],t[Fo]),t}function sl(t){return t.getGeometry()}var ll=ol,ul="point",pl="line",hl=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=Va(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Os({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:ul,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Va(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}();function dl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var cl={
33
+ */function mt(t){return ft(l(s({},t),{state:!0,attribute:!1}))}var vt=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}(),yt="propertychange",_t=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function bt(t,e){return t>e?1:t<e?-1:0}function xt(t,e,i){var o=t.length;if(t[0]<=e)return 0;if(e<=t[o-1])return o-1;var n=void 0;if(i>0){for(n=1;n<o;++n)if(t[n]<e)return n-1}else if(i<0){for(n=1;n<o;++n)if(t[n]<=e)return n}else for(n=1;n<o;++n){if(t[n]==e)return n;if(t[n]<e)return"function"==typeof i?i(e,t[n-1],t[n])>0?n-1:n:t[n-1]-e<e-t[n]?n-1:n}return o-1}function kt(t,e,i){for(;e<i;){var o=t[e];t[e]=t[i],t[i]=o,++e,--i}}function wt(t,e){for(var i=Array.isArray(e)?e:[e],o=i.length,n=0;n<o;n++)t[t.length]=i[n]}function St(t,e){var i=t.length;if(i!==e.length)return!1;for(var o=0;o<i;o++)if(t[o]!==e[o])return!1;return!0}function Ct(){return!0}function zt(){return!1}function Et(){}var Tt="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),o=1,n=arguments.length;o<n;++o){var r=arguments[o];if(null!=r)for(var a in r)r.hasOwnProperty(a)&&(i[a]=r[a])}return i};function Pt(t){for(var e in t)delete t[e]}var Ot="function"==typeof Object.values?Object.values:function(t){var e=[];for(var i in t)e.push(t[i]);return e};function Ft(t){var e;for(e in t)return!1;return!e}var Rt,It=(Rt=function(t,e){return(Rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}Rt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),Mt=function(t){function e(e){var i=t.call(this)||this;return i.eventTarget_=e,i.pendingRemovals_=null,i.dispatching_=null,i.listeners_=null,i}return It(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var i=this.listeners_||(this.listeners_={}),o=i[t]||(i[t]=[]);-1===o.indexOf(e)&&o.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new vt(t):t,i=e.type;e.target||(e.target=this.eventTarget_||this);var o,n=this.listeners_&&this.listeners_[i];if(n){var r=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in r||(r[i]=0,a[i]=0),++r[i];for(var s=0,l=n.length;s<l;++s)if(!1===(o="handleEvent"in n[s]?n[s].handleEvent(e):n[s].call(this,e))||e.propagationStopped){o=!1;break}if(--r[i],0===r[i]){var u=a[i];for(delete a[i];u--;)this.removeEventListener(i,Et);delete r[i]}return o}},e.prototype.disposeInternal=function(){this.listeners_&&Pt(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 i=this.listeners_&&this.listeners_[t];if(i){var o=i.indexOf(e);-1!==o&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[o]=Et,++this.pendingRemovals_[t]):(i.splice(o,1),0===i.length&&delete this.listeners_[t]))}},e}(_t),jt="change",Dt="error",At="contextmenu",Lt="click",Gt="dblclick",Nt="keydown",Bt="keypress",Vt="load",qt="resize",Wt="touchmove",Ut="wheel";function Xt(t,e,i,o,n){if(o&&o!==t&&(i=i.bind(o)),n){var r=i;i=function(){t.removeEventListener(e,i),r.apply(this,arguments)}}var a={target:t,type:e,listener:i};return t.addEventListener(e,i),a}function Kt(t,e,i,o){return Xt(t,e,i,o,!0)}function Yt(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Pt(t))}var Zt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ht=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 Zt(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(jt)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=Xt(this,t[n],e);return o}return Xt(this,t,e)},e.prototype.onceInternal=function(t,e){var i;if(Array.isArray(t)){var o=t.length;i=new Array(o);for(var n=0;n<o;++n)i[n]=Kt(this,t[n],e)}else i=Kt(this,t,e);return e.ol_key=i,i},e.prototype.unInternal=function(t,e){var i=e.ol_key;if(i)!function(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;++e)Yt(t[e]);else Yt(t)}(i);else if(Array.isArray(t))for(var o=0,n=t.length;o<n;++o)this.removeEventListener(t[o],e);else this.removeEventListener(t,e)},e}(Mt);Ht.prototype.on,Ht.prototype.once,Ht.prototype.un;var $t=Ht;function Jt(){return function(){throw new Error("Unimplemented abstract method.")}()}var Qt=0;function te(t){return t.ol_uid||(t.ol_uid=String(++Qt))}var ee=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ie=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.key=i,n.oldValue=o,n}return ee(e,t),e}(vt),oe=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,te(i),i.values_=null,void 0!==e&&i.setProperties(e),i}return ee(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_&&Tt({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var i;i="change:"+t,this.dispatchEvent(new ie(i,t,e)),i=yt,this.dispatchEvent(new ie(i,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,i){var o=this.values_||(this.values_={});if(i)o[t]=e;else{var n=o[t];o[t]=e,n!==e&&this.notify(t,n)}},e.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},e.prototype.applyProperties=function(t){t.values_&&Tt(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var i=this.values_[t];delete this.values_[t],Ft(this.values_)&&(this.values_=null),e||this.notify(t,i)}},e}($t),ne="postrender",re="movestart",ae="moveend",se="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",le=-1!==se.indexOf("firefox");-1!==se.indexOf("safari")&&se.indexOf("chrom");var ue=-1!==se.indexOf("webkit")&&-1==se.indexOf("edge"),pe=-1!==se.indexOf("macintosh"),he="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,de="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,ce="undefined"!=typeof Image&&Image.prototype.decode,ge=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(i){}return t}();function fe(t,e,i,o){var n;return i&&i.length?n=i.shift():de?n=new OffscreenCanvas(t||300,e||300):(n=document.createElement("canvas")).style.all="unset",t&&(n.width=t),e&&(n.height=e),n.getContext("2d",o)}function me(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function ve(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var ye=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_e=function(t){function e(e){var i=t.call(this)||this,o=e.element;return!o||e.target||o.style.pointerEvents||(o.style.pointerEvents="auto"),i.element=o||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return ye(e,t),e.prototype.disposeInternal=function(){ve(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&ve(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)Yt(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==Et&&this.listenerKeys.push(Xt(t,ne,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}(oe),be=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"),xe=["style","variant","weight","size","lineHeight","family"],ke=function(t){var e=t.match(be);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},o=0,n=xe.length;o<n;++o){var r=e[o+1];void 0!==r&&(i[xe[o]]=r)}return i.families=i.family.split(/,\s?/),i};function we(t){return 1===t?"":String(Math.round(100*t)/100)}var Se="opacity",Ce="visible",ze="extent",Ee="zIndex",Te="maxResolution",Pe="minResolution",Oe="maxZoom",Fe="minZoom",Re="source",Ie=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Me=function(t){function e(e){var i=this,o="Assertion failed. See https://openlayers.org/en/"+("v"+"6.9.0".split("-")[0])+"/doc/errors/#"+e+" for details.";return(i=t.call(this,o)||this).code=e,i.name="AssertionError",i.message=o,i}return Ie(e,t),e}(Error);function je(t,e){if(!t)throw new Me(e)}function De(t,e,i){return Math.min(Math.max(t,e),i)}var Ae="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Le="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Ge(t,e,i,o,n,r){var a=n-i,s=r-o;if(0!==a||0!==s){var l=((t-i)*a+(e-o)*s)/(a*a+s*s);l>1?(i=n,o=r):l>0&&(i+=a*l,o+=s*l)}return Ne(t,e,i,o)}function Ne(t,e,i,o){var n=i-t,r=o-e;return n*n+r*r}function Be(t){return t*Math.PI/180}function Ve(t,e){var i=t%e;return i*e<0?i+e:i}function qe(t,e,i){return t+i*(e-t)}var We=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ue=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=Tt({},e);return"object"==typeof e.properties&&(delete o.properties,Tt(o,e.properties)),o[Se]=void 0!==e.opacity?e.opacity:1,je("number"==typeof o[Se],64),o[Ce]=void 0===e.visible||e.visible,o[Ee]=e.zIndex,o[Te]=void 0!==e.maxResolution?e.maxResolution:1/0,o[Pe]=void 0!==e.minResolution?e.minResolution:0,o[Fe]=void 0!==e.minZoom?e.minZoom:-1/0,o[Oe]=void 0!==e.maxZoom?e.maxZoom:1/0,i.className_=void 0!==o.className?e.className:"ol-layer",delete o.className,i.setProperties(o),i.state_=null,i}return We(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},i=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!==i||e.managed?i:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return Jt()},e.prototype.getLayerStatesArray=function(t){return Jt()},e.prototype.getExtent=function(){return this.get(ze)},e.prototype.getMaxResolution=function(){return this.get(Te)},e.prototype.getMinResolution=function(){return this.get(Pe)},e.prototype.getMinZoom=function(){return this.get(Fe)},e.prototype.getMaxZoom=function(){return this.get(Oe)},e.prototype.getOpacity=function(){return this.get(Se)},e.prototype.getSourceState=function(){return Jt()},e.prototype.getVisible=function(){return this.get(Ce)},e.prototype.getZIndex=function(){return this.get(Ee)},e.prototype.setExtent=function(t){this.set(ze,t)},e.prototype.setMaxResolution=function(t){this.set(Te,t)},e.prototype.setMinResolution=function(t){this.set(Pe,t)},e.prototype.setMaxZoom=function(t){this.set(Oe,t)},e.prototype.setMinZoom=function(t){this.set(Fe,t)},e.prototype.setOpacity=function(t){je("number"==typeof t,64),this.set(Se,t)},e.prototype.setVisible=function(t){this.set(Ce,t)},e.prototype.setZIndex=function(t){this.set(Ee,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(oe),Xe="prerender",Ke="postrender",Ye="precompose",Ze="postcompose",He="rendercomplete",$e="undefined",Je="ready",Qe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ti(t,e){if(!t.visible)return!1;var i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;var o=e.zoom;return o>t.minZoom&&o<=t.maxZoom}var ei=function(t){function e(e){var i=this,o=Tt({},e);delete o.source,(i=t.call(this,o)||this).on,i.once,i.un,i.mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addChangeListener(Re,i.handleSourcePropertyChange_);var n=e.source?e.source:null;return i.setSource(n),i}return Qe(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(Re)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():$e},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Yt(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=Xt(t,jt,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 i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Yt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Yt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Xt(t,Ye,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);je(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=Xt(this,jt,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Re,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Ue),ii=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),oi=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).ulElement_=document.createElement("ul"),i.collapsed_=void 0===o.collapsed||o.collapsed,i.userCollapsed_=i.collapsed_,i.overrideCollapsible_=void 0!==o.collapsible,i.collapsible_=void 0===o.collapsible||o.collapsible,i.collapsible_||(i.collapsed_=!1);var n=void 0!==o.className?o.className:"ol-attribution",r=void 0!==o.tipLabel?o.tipLabel:"Attributions",a=void 0!==o.expandClassName?o.expandClassName:n+"-expand",s=void 0!==o.collapseLabel?o.collapseLabel:"›",l=void 0!==o.collapseClassName?o.collapseClassName:n+"-collpase";"string"==typeof s?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=s,i.collapseLabel_.className=l):i.collapseLabel_=s;var u=void 0!==o.label?o.label:"i";"string"==typeof u?(i.label_=document.createElement("span"),i.label_.textContent=u,i.label_.className=a):i.label_=u;var p=i.collapsible_&&!i.collapsed_?i.collapseLabel_:i.label_;i.toggleButton_=document.createElement("button"),i.toggleButton_.setAttribute("type","button"),i.toggleButton_.setAttribute("aria-expanded",String(!i.collapsed_)),i.toggleButton_.title=r,i.toggleButton_.appendChild(p),i.toggleButton_.addEventListener(Lt,i.handleClick_.bind(i),!1);var h=n+" ol-unselectable ol-control"+(i.collapsed_&&i.collapsible_?" ol-collapsed":"")+(i.collapsible_?"":" ol-uncollapsible"),d=i.element;return d.className=h,d.appendChild(i.toggleButton_),d.appendChild(i.ulElement_),i.renderedAttributions_=[],i.renderedVisible_=!0,i}return ii(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],o=!0,n=t.layerStatesArray,r=0,a=n.length;r<a;++r){var s=n[r];if(ti(s,t.viewState)){var l=s.layer.getSource();if(l){var u=l.getAttributions();if(u){var p=u(t);if(p)if(o=o&&!1!==l.getAttributionsCollapsible(),Array.isArray(p))for(var h=0,d=p.length;h<d;++h)p[h]in e||(i.push(p[h]),e[p[h]]=!0);else p in e||(i.push(p),e[p]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(o),i},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!St(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var o=0,n=e.length;o<n;++o){var r=document.createElement("li");r.innerHTML=e[o],this.ulElement_.appendChild(r)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?me(this.collapseLabel_,this.label_):me(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}(_e),ni="add",ri="remove",ai=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),si="length",li=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.element=i,n.index=o,n}return ai(e,t),e}(vt),ui=function(t){function e(e,i){var o=t.call(this)||this;o.on,o.once,o.un;var n=i||{};if(o.unique_=!!n.unique,o.array_=e||[],o.unique_)for(var r=0,a=o.array_.length;r<a;++r)o.assertUnique_(o.array_[r],r);return o.updateLength_(),o}return ai(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,i=0,o=e.length;i<o;++i)t(e[i],i,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(si)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new li(ni,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,i=0,o=e.length;i<o;++i)if(e[i]===t)return this.removeAt(i)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new li(ri,e,t)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var o=this.array_[t];this.array_[t]=e,this.dispatchEvent(new li(ri,o,t)),this.dispatchEvent(new li(ni,e,t))}else{for(var n=i;n<t;++n)this.insertAt(n,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(si,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var i=0,o=this.array_.length;i<o;++i)if(this.array_[i]===t&&i!==e)throw new Me(58)},e}(oe);function pi(t){return Math.pow(t,3)}function hi(t){return 1-pi(1-t)}function di(t){return 3*t*t-2*t*t*t}function ci(t){return t}var gi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),fi=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this;var n=void 0!==o.className?o.className:"ol-rotate",r=void 0!==o.label?o.label:"⇧",a=void 0!==o.compassClassName?o.compassClassName:"ol-compass";i.label_=null,"string"==typeof r?(i.label_=document.createElement("span"),i.label_.className=a,i.label_.textContent=r):(i.label_=r,i.label_.classList.add(a));var s=o.tipLabel?o.tipLabel:"Reset rotation",l=document.createElement("button");l.className=n+"-reset",l.setAttribute("type","button"),l.title=s,l.appendChild(i.label_),l.addEventListener(Lt,i.handleClick_.bind(i),!1);var u=n+" ol-unselectable ol-control",p=i.element;return p.className=u,p.appendChild(l),i.callResetNorth_=o.resetNorth?o.resetNorth:void 0,i.duration_=void 0!==o.duration?o.duration:250,i.autoHide_=void 0===o.autoHide||o.autoHide,i.rotation_=void 0,i.autoHide_&&i.element.classList.add("ol-hidden"),i}return gi(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:hi}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var o="rotate("+i+"rad)";if(this.autoHide_){var n=this.element.classList.contains("ol-hidden");n||0!==i?n&&0!==i&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")}this.label_.style.transform=o}this.rotation_=i}},e}(_e),mi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),vi=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),target:o.target})||this;var n=void 0!==o.className?o.className:"ol-zoom",r=void 0!==o.delta?o.delta:1,a=void 0!==o.zoomInClassName?o.zoomInClassName:n+"-in",s=void 0!==o.zoomOutClassName?o.zoomOutClassName:n+"-out",l=void 0!==o.zoomInLabel?o.zoomInLabel:"+",u=void 0!==o.zoomOutLabel?o.zoomOutLabel:"–",p=void 0!==o.zoomInTipLabel?o.zoomInTipLabel:"Zoom in",h=void 0!==o.zoomOutTipLabel?o.zoomOutTipLabel:"Zoom out",d=document.createElement("button");d.className=a,d.setAttribute("type","button"),d.title=p,d.appendChild("string"==typeof l?document.createTextNode(l):l),d.addEventListener(Lt,i.handleClick_.bind(i,r),!1);var c=document.createElement("button");c.className=s,c.setAttribute("type","button"),c.title=h,c.appendChild("string"==typeof u?document.createTextNode(u):u),c.addEventListener(Lt,i.handleClick_.bind(i,-r),!1);var g=n+" ol-unselectable ol-control",f=i.element;return f.className=g,f.appendChild(d),f.appendChild(c),i.duration_=void 0!==o.duration?o.duration:250,i}return mi(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getZoom();if(void 0!==i){var o=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:o,duration:this.duration_,easing:hi})):e.setZoom(o)}}},e}(_e),yi="pointermove",_i="pointerdown",bi={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},xi={};xi[bi.RADIANS]=6370997/(2*Math.PI),xi[bi.DEGREES]=2*Math.PI*6370997/360,xi[bi.FEET]=.3048,xi[bi.METERS]=1,xi[bi.USFEET]=1200/3937;var ki=bi,wi=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_||xi[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}(),Si=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ci=6378137*Math.PI,zi=[-Ci,-Ci,Ci,Ci],Ei=[-180,-85,180,85],Ti=6378137*Math.log(Math.tan(Math.PI/2)),Pi=function(t){function e(e){return t.call(this,{code:e,units:ki.METERS,extent:zi,global:!0,worldExtent:Ei,getPointResolution:function(t,e){return t/Ae(e[1]/6378137)}})||this}return Si(e,t),e}(wi),Oi=[new Pi("EPSG:3857"),new Pi("EPSG:102100"),new Pi("EPSG:102113"),new Pi("EPSG:900913"),new Pi("http://www.opengis.net/def/crs/EPSG/0/3857"),new Pi("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Fi(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n){r[a]=Ci*t[a]/180;var s=6378137*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));s>Ti?s=Ti:s<-Ti&&(s=-Ti),r[a+1]=s}return r}function Ri(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n)r[a]=180*t[a]/Ci,r[a+1]=360*Math.atan(Math.exp(t[a+1]/6378137))/Math.PI-90;return r}var Ii=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Mi=[-180,-90,180,90],ji=6378137*Math.PI/180,Di=function(t){function e(e,i){return t.call(this,{code:e,units:ki.DEGREES,extent:Mi,axisOrientation:i,global:!0,metersPerUnit:ji,worldExtent:Mi})||this}return Ii(e,t),e}(wi),Ai=[new Di("CRS:84"),new Di("EPSG:4326","neu"),new Di("urn:ogc:def:crs:OGC:1.3:CRS84"),new Di("urn:ogc:def:crs:OGC:2:84"),new Di("http://www.opengis.net/def/crs/OGC/1.3/CRS84","neu"),new Di("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Di("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],Li={};var Gi={};function Ni(t,e,i){var o=t.getCode(),n=e.getCode();o in Gi||(Gi[o]={}),Gi[o][n]=i}var Bi="bottom-left",Vi="bottom-right",qi="top-left",Wi="top-right",Ui=0,Xi=1,Ki=2,Yi=4,Zi=8,Hi=16;function $i(t){for(var e=ro(),i=0,o=t.length;i<o;++i)co(e,t[i]);return e}function Ji(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function Qi(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function to(t,e,i){var o,n;return(o=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*o+(n=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*n}function eo(t,e){return oo(t,e[0],e[1])}function io(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function oo(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function no(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=e[0],s=e[1],l=Ui;return a<i?l|=Hi:a>n&&(l|=Yi),s<o?l|=Zi:s>r&&(l|=Ki),l===Ui&&(l=Xi),l}function ro(){return[1/0,1/0,-1/0,-1/0]}function ao(t,e,i,o,n){return n?(n[0]=t,n[1]=e,n[2]=i,n[3]=o,n):[t,e,i,o]}function so(t){return ao(1/0,1/0,-1/0,-1/0,t)}function lo(t,e){var i=t[0],o=t[1];return ao(i,o,i,o,e)}function uo(t,e,i,o,n){return go(so(n),t,e,i,o)}function po(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function ho(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 co(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 go(t,e,i,o,n){for(;i<o;i+=n)fo(t,e[i],e[i+1]);return t}function fo(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function mo(t,e){var i;return(i=e(yo(t)))||(i=e(_o(t)))||(i=e(zo(t)))?i:(i=e(Co(t)))||!1}function vo(t){var e=0;return Po(t)||(e=Eo(t)*wo(t)),e}function yo(t){return[t[0],t[1]]}function _o(t){return[t[2],t[1]]}function bo(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function xo(t,e){var i;return e===Bi?i=yo(t):e===Vi?i=_o(t):e===qi?i=Co(t):e===Wi?i=zo(t):je(!1,13),i}function ko(t,e,i,o,n){var r=e*o[0]/2,a=e*o[1]/2,s=Math.cos(i),l=Math.sin(i),u=r*s,p=r*l,h=a*s,d=a*l,c=t[0],g=t[1],f=c-u+d,m=c-u-d,v=c+u-d,y=c+u+d,_=g-p-h,b=g-p+h,x=g+p+h,k=g+p-h;return ao(Math.min(f,m,v,y),Math.min(_,b,x,k),Math.max(f,m,v,y),Math.max(_,b,x,k),n)}function wo(t){return t[3]-t[1]}function So(t,e,i){var o=i||[1/0,1/0,-1/0,-1/0];return To(t,e)?(t[0]>e[0]?o[0]=t[0]:o[0]=e[0],t[1]>e[1]?o[1]=t[1]:o[1]=e[1],t[2]<e[2]?o[2]=t[2]:o[2]=e[2],t[3]<e[3]?o[3]=t[3]:o[3]=e[3]):so(o),o}function Co(t){return[t[0],t[3]]}function zo(t){return[t[2],t[3]]}function Eo(t){return t[2]-t[0]}function To(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Po(t){return t[2]<t[0]||t[3]<t[1]}function Oo(t,e,i,o){var n=[];if(o>1)for(var r=t[2]-t[0],a=t[3]-t[1],s=0;s<o;++s)n.push(t[0]+r*s/o,t[1],t[2],t[1]+a*s/o,t[2]-r*s/o,t[3],t[0],t[3]-a*s/o);else n=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(n,n,2);for(var l=[],u=[],p=(s=0,n.length);s<p;s+=2)l.push(n[s]),u.push(n[s+1]);return function(t,e,i){return ao(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),i)}(l,u,i)}var Fo="Point",Ro="LineString",Io="LinearRing",Mo="Polygon",jo="MultiPoint",Do="MultiLineString",Ao="MultiPolygon",Lo="GeometryCollection",Go="Circle";function No(t,e,i){var o=i||6371008.8,n=Be(t[1]),r=Be(e[1]),a=(r-n)/2,s=Be(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(n)*Math.cos(r);return 2*o*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function Bo(t,e){for(var i=0,o=t.length,n=t[o-1][0],r=t[o-1][1],a=0;a<o;a++){var s=t[a][0],l=t[a][1];i+=Be(s-n)*(2+Math.sin(Be(r))+Math.sin(Be(l))),n=s,r=l}return i*e*e/2}function Vo(t,e){var i=e||{},o=i.radius||6371008.8,n=i.projection||"EPSG:3857",r=t.getType();r!==Lo&&(t=t.clone().transform(n,"EPSG:4326"));var a,s,l,u,p,h,d=0;switch(r){case Fo:case jo:case Ro:case Do:case Io:break;case Mo:for(a=t.getCoordinates(),d=Math.abs(Bo(a[0],o)),l=1,u=a.length;l<u;++l)d-=Math.abs(Bo(a[l],o));break;case Ao:for(l=0,u=(a=t.getCoordinates()).length;l<u;++l)for(s=a[l],d+=Math.abs(Bo(s[0],o)),p=1,h=s.length;p<h;++p)d-=Math.abs(Bo(s[p],o));break;case Lo:var c=t.getGeometries();for(l=0,u=c.length;l<u;++l)d+=Vo(c[l],e);break;default:throw new Error("Unsupported geometry type: "+r)}return d}function qo(t,e){var i,o,n=t[0],r=t[1],a=e[0],s=e[1],l=a[0],u=a[1],p=s[0],h=s[1],d=p-l,c=h-u,g=0===d&&0===c?0:(d*(n-l)+c*(r-u))/(d*d+c*c||0);return g<=0?(i=l,o=u):g>=1?(i=p,o=h):(i=l+g*d,o=u+g*c),[i,o]}function Wo(t,e){for(var i=!0,o=t.length-1;o>=0;--o)if(t[o]!=e[o]){i=!1;break}return i}function Uo(t,e){var i=Math.cos(e),o=Math.sin(e),n=t[0]*i-t[1]*o,r=t[1]*i+t[0]*o;return t[0]=n,t[1]=r,t}function Xo(t,e){var i=t[0]-e[0],o=t[1]-e[1];return i*i+o*o}function Ko(t,e){return Math.sqrt(Xo(t,e))}function Yo(t,e){return Xo(t,qo(t,e))}function Zo(t,e){if(e.canWrapX()){var i=Eo(e.getExtent()),o=function(t,e,i){var o=e.getExtent(),n=0;if(e.canWrapX()&&(t[0]<o[0]||t[0]>o[2])){var r=i||Eo(o);n=Math.floor((t[0]-o[0])/r)}return n}(t,e,i);o&&(t[0]-=o*i)}return t}function Ho(t,e,i){var o;if(void 0!==e){for(var n=0,r=t.length;n<r;++n)e[n]=t[n];o=e}else o=t.slice();return o}function $o(t,e,i){if(void 0!==e&&t!==e){for(var o=0,n=t.length;o<n;++o)e[o]=t[o];t=e}return t}function Jo(t){!function(t,e){Li[t]=e}(t.getCode(),t),Ni(t,t,Ho)}function Qo(t){return"string"==typeof t?Li[e=t]||Li[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function tn(t,e,i,o){var n,r=(t=Qo(t)).getPointResolutionFunc();if(r){if(n=r(e,i),o&&o!==t.getUnits())(s=t.getMetersPerUnit())&&(n=n*s/xi[o])}else{var a=t.getUnits();if(a==ki.DEGREES&&!o||o==ki.DEGREES)n=e;else{var s,l=an(t,Qo("EPSG:4326"));if(l===$o&&a!==ki.DEGREES)n=e*t.getMetersPerUnit();else{var u=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];n=(No((u=l(u,u,2)).slice(0,2),u.slice(2,4))+No(u.slice(4,6),u.slice(6,8)))/2}void 0!==(s=o?xi[o]:t.getMetersPerUnit())&&(n/=s)}}return n}function en(t){!function(t){t.forEach(Jo)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Ni(e,t,Ho)}))}))}function on(t,e){return t?"string"==typeof t?Qo(t):t:Qo(e)}function nn(t,e){return ln(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function rn(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||an(t,e)===Ho)&&i}function an(t,e){var i=function(t,e){var i;return t in Gi&&e in Gi[t]&&(i=Gi[t][e]),i}(t.getCode(),e.getCode());return i||(i=$o),i}function sn(t,e){return an(Qo(t),Qo(e))}function ln(t,e,i){return sn(e,i)(t,void 0,t.length)}var un,pn,hn;function dn(t,e){return t}function cn(t,e){return t}function gn(t,e){return t}function fn(t,e){return t}en(Oi),en(Ai),un=Oi,pn=Fi,hn=Ri,Ai.forEach((function(t){un.forEach((function(e){Ni(t,e,pn),Ni(e,t,hn)}))}));var mn,vn=new Array(6);function yn(t){return bn(t,1,0,0,1,0,0)}function _n(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=t[4],s=t[5],l=e[0],u=e[1],p=e[2],h=e[3],d=e[4],c=e[5];return t[0]=i*l+n*u,t[1]=o*l+r*u,t[2]=i*p+n*h,t[3]=o*p+r*h,t[4]=i*d+n*c+a,t[5]=o*d+r*c+s,t}function bn(t,e,i,o,n,r,a){return t[0]=e,t[1]=i,t[2]=o,t[3]=n,t[4]=r,t[5]=a,t}function xn(t,e){var i=e[0],o=e[1];return e[0]=t[0]*i+t[2]*o+t[4],e[1]=t[1]*i+t[3]*o+t[5],e}function kn(t,e,i){return _n(t,bn(vn,e,0,0,i,0,0))}function wn(t,e,i,o,n,r,a,s){var l=Math.sin(r),u=Math.cos(r);return t[0]=o*u,t[1]=n*l,t[2]=-o*l,t[3]=n*u,t[4]=a*o*u-s*o*l+e,t[5]=a*n*l+s*n*u+i,t}function Sn(t,e){var i,o=(i=e)[0]*i[3]-i[1]*i[2];je(0!==o,32);var n=e[0],r=e[1],a=e[2],s=e[3],l=e[4],u=e[5];return t[0]=s/o,t[1]=-r/o,t[2]=-a/o,t[3]=n/o,t[4]=(a*u-s*l)/o,t[5]=-(n*u-r*l)/o,t}function Cn(t){var e="matrix("+t.join(", ")+")";if(de)return e;var i=mn||(mn=document.createElement("div"));return i.style.transform=e,i.style.transform}var zn=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,En=/^([a-z]*)$|^hsla?\(.*\)$/i;function Tn(t){return"string"==typeof t?t:Mn(t)}var Pn,On,Fn=(Pn={},On=0,function(t){var e;if(Pn.hasOwnProperty(t))e=Pn[t];else{if(On>=1024){var i=0;for(var o in Pn)0==(3&i++)&&(delete Pn[o],--On)}e=function(t){var e,i,o,n,r;if(En.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}(t)),zn.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),o=parseInt(t.substr(1+2*s,s),16),n=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,o=(o<<4)+o,l&&(n=(n<<4)+n)),r=[e,i,o,n/255]}else 0==t.indexOf("rgba(")?In(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),In(r)):je(!1,14);return r}(t),Pn[t]=e,++On}return e});function Rn(t){return Array.isArray(t)?t:Fn(t)}function In(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 Mn(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var o=t[2];return o!=(0|o)&&(o=o+.5|0),"rgba("+e+","+i+","+o+","+(void 0===t[3]?1:t[3])+")"}function jn(t,e,i){return e+":"+t+":"+(i?Tn(i):"null")}var Dn=new(function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var o=jn(t,e,i);return o in this.cache_?this.cache_[o]:null},t.prototype.set=function(t,e,i,o){var n=jn(t,e,i);this.cache_[n]=o,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),An=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Ln(t,e){Dn.expire()}var Gn=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return An(e,t),e.prototype.dispatchRenderEvent=function(t,e){Jt()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,o=t.pixelToCoordinateTransform;wn(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Sn(o,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r,a,s){var l,u=e.viewState;function p(t,e,i,o){return n.call(r,e,t?i:null,o)}var h=u.projection,d=Zo(t.slice(),h),c=[[0,0]];if(h.canWrapX()&&o){var g=Eo(h.getExtent());c.push([-g,0],[g,0])}for(var f=e.layerStatesArray,m=f.length,v=[],y=[],_=0;_<c.length;_++)for(var b=m-1;b>=0;--b){var x=f[b],k=x.layer;if(k.hasRenderer()&&ti(x,u)&&a.call(s,k)){var w=k.getRenderer(),S=k.getSource();if(w&&S){var C=S.getWrapX()?d:t,z=p.bind(null,x.managed);y[0]=C[0]+c[_][0],y[1]=C[1]+c[_][1],l=w.forEachFeatureAtCoordinate(y,e,i,z,v)}if(l)return l}}if(0!==v.length){var E=1/v.length;return v.forEach((function(t,e){return t.distanceSq+=e*E})),v.sort((function(t,e){return t.distanceSq-e.distanceSq})),v.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,o,n){return Jt()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,o,n,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,o,Ct,this,n,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){Jt()},e.prototype.scheduleExpireIconCache=function(t){Dn.canExpireCache()&&t.postRenderFunctions.push(Ln)},e}(_t),Nn=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Bn=function(t){function e(e,i,o,n){var r=t.call(this,e)||this;return r.inversePixelTransform=i,r.frameState=o,r.context=n,r}return Nn(e,t),e}(vt),Vn=[],qn=[0,0,0,0],Wn=new oe;(new Mt).setSize=function(){console.warn("labelCache is deprecated.")};var Un,Xn,Kn=null,Yn={},Zn=function(){var t,e,i="32px ",o=["monospace","serif"],n=o.length,r="wmytzilWMYTZIL@#/&?$%10";function a(t,a,s){for(var l=!0,u=0;u<n;++u){var p=o[u];if(e=Jn(t+" "+a+" "+i+p,r),s!=p){var h=Jn(t+" "+a+" "+i+s+","+p,r);l=l&&h!=e}}return!!l}function s(){for(var e=!0,i=Wn.getKeys(),o=0,n=i.length;o<n;++o){var r=i[o];Wn.get(r)<100&&(a.apply(this,r.split("\n"))?(Pt(Yn),Kn=null,Un=void 0,Wn.set(r,100)):(Wn.set(r,Wn.get(r)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var i=ke(e);if(i)for(var o=i.families,n=0,r=o.length;n<r;++n){var l=o[n],u=i.style+"\n"+i.weight+"\n"+l;void 0===Wn.get(u)&&(Wn.set(u,100,!0),a(i.style,i.weight,l)||(Wn.set(u,0,!0),void 0===t&&(t=setInterval(s,32))))}}}(),Hn=function(t){var e=Yn[t];if(null==e){if(de){var i=ke(t),o=$n(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(o.actualBoundingBoxAscent+o.actualBoundingBoxDescent)}else Xn||((Xn=document.createElement("div")).innerHTML="M",Xn.style.minHeight="0",Xn.style.maxHeight="none",Xn.style.height="auto",Xn.style.padding="0",Xn.style.border="none",Xn.style.position="absolute",Xn.style.display="block",Xn.style.left="-99999px"),Xn.style.font=t,document.body.appendChild(Xn),e=Xn.offsetHeight,document.body.removeChild(Xn);Yn[t]=e}return e};function $n(t,e){return Kn||(Kn=fe(1,1)),t!=Un&&(Kn.font=t,Un=Kn.font),Kn.measureText(e)}function Jn(t,e){return $n(t,e).width}function Qn(t,e,i){if(e in i)return i[e];var o=Jn(t,e);return i[e]=o,o}function tr(t,e,i,o,n,r,a,s,l,u,p){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),o.contextInstructions?(t.translate(l,u),t.scale(p[0],p[1]),function(t,e){for(var i=t.contextInstructions,o=0,n=i.length;o<n;o+=2)Array.isArray(i[o+1])?e[i[o]].apply(e,i[o+1]):e[i[o]]=i[o+1]}(o,t)):p[0]<0||p[1]<0?(t.translate(l,u),t.scale(p[0],p[1]),t.drawImage(o,n,r,a,s,0,0,a,s)):t.drawImage(o,n,r,a,s,l,u,a*p[0],s*p[1]),t.restore()}var er=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ir=function(t){function e(e){var i=t.call(this,e)||this;i.fontChangeListenerKey_=Xt(Wn,yt,e.redrawText.bind(e)),i.element_=document.createElement("div");var o=i.element_.style;o.position="absolute",o.width="100%",o.height="100%",o.zIndex="0",i.element_.className="ol-unselectable ol-layers";var n=e.getViewport();return n.insertBefore(i.element_,n.firstChild||null),i.children_=[],i.renderedVisible_=!0,i}return er(e,t),e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap();if(i.hasListener(t)){var o=new Bn(t,void 0,e);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){Yt(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(Ye,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),i=t.viewState;this.children_.length=0;for(var o=[],n=null,r=0,a=e.length;r<a;++r){var s=e[r];if(t.layerIndex=r,ti(s,i)&&(s.sourceState==Je||s.sourceState==$e)){var l=s.layer,u=l.render(t,n);u&&(u!==n&&(this.children_.push(u),n=u),"getDeclutter"in l&&o.push(l))}}for(r=o.length-1;r>=0;--r)o[r].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,o=0;;++o){var n=i[o],r=e[o];if(!n&&!r)break;n!==r&&(n?r?t.insertBefore(r,n):(t.removeChild(n),--o):t.appendChild(r))}}(this.element_,this.children_),this.dispatchRenderEvent(Ze,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,o,n){for(var r=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],u=l.layer;if(u.hasRenderer()&&ti(l,r)&&n(u)){var p=u.getRenderer().getDataAtPixel(t,e,i);if(p){var h=o(u,p);if(h)return h}}}},e}(Gn),or="layergroup",nr="size",rr="target",ar="view",sr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),lr="layers",ur=function(t){function e(e){var i=this,o=e||{},n=Tt({},o);delete n.layers;var r=o.layers;return(i=t.call(this,n)||this).on,i.once,i.un,i.layersListenerKeys_=[],i.listenerKeys_={},i.addChangeListener(lr,i.handleLayersChanged_),r?Array.isArray(r)?r=new ui(r.slice(),{unique:!0}):je("function"==typeof r.getArray,43):r=new ui(void 0,{unique:!0}),i.setLayers(r),i}return sr(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Yt),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(Xt(t,ni,this.handleLayersAdd_,this),Xt(t,ri,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(Yt);Pt(this.listenerKeys_);for(var i=t.getArray(),o=0,n=i.length;o<n;o++){var r=i[o];this.listenerKeys_[te(r)]=[Xt(r,yt,this.handleLayerChange_,this),Xt(r,jt,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[te(e)]=[Xt(e,yt,this.handleLayerChange_,this),Xt(e,jt,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=te(t.element);this.listenerKeys_[e].forEach(Yt),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(lr)},e.prototype.setLayers=function(t){this.set(lr,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],i=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var o=this.getLayerState(),n=o.zIndex;t||void 0!==o.zIndex||(n=0);for(var r=i,a=e.length;r<a;r++){var s=e[r];s.opacity*=o.opacity,s.visible=s.visible&&o.visible,s.maxResolution=Math.min(s.maxResolution,o.maxResolution),s.minResolution=Math.max(s.minResolution,o.minResolution),s.minZoom=Math.max(s.minZoom,o.minZoom),s.maxZoom=Math.min(s.maxZoom,o.maxZoom),void 0!==o.extent&&(void 0!==s.extent?s.extent=So(s.extent,o.extent):s.extent=o.extent),void 0===s.zIndex&&(s.zIndex=n)}return e},e.prototype.getSourceState=function(){return Je},e}(Ue),pr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hr=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.map=i,n.frameState=void 0!==o?o:null,n}return pr(e,t),e}(vt),dr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),cr=function(t){function e(e,i,o,n,r){var a=t.call(this,e,i,r)||this;return a.originalEvent=o,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==n&&n,a}return dr(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}(hr),gr={SINGLECLICK:"singleclick",CLICK:Lt,DBLCLICK:Gt,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},fr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),mr=function(t){function e(e,i){var o=t.call(this,e)||this;o.map_=e,o.clickTimeoutId_,o.emulateClicks_=!1,o.dragging_=!1,o.dragListenerKeys_=[],o.moveTolerance_=void 0===i?1:i,o.down_=null;var n=o.map_.getViewport();return o.activePointers_=0,o.trackedTouches_={},o.element_=n,o.pointerdownListenerKey_=Xt(n,_i,o.handlePointerDown_,o),o.originalPointerMoveEvent_,o.relayedListenerKey_=Xt(n,yi,o.relayEvent_,o),o.boundHandleTouchMove_=o.handleTouchMove_.bind(o),o.element_.addEventListener(Wt,o.boundHandleTouchMove_,!!ge&&{passive:!1}),o}return fr(e,t),e.prototype.emulateClick_=function(t){var e=new cr(gr.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new cr(gr.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new cr(gr.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==gr.POINTERUP||e.type==gr.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==gr.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new cr(gr.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(Yt),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 cr(gr.POINTERDOWN,this.map_,t);for(var i in this.dispatchEvent(e),this.down_={},t){var o=t[i];this.down_[i]="function"==typeof o?Et:o}if(0===this.dragListenerKeys_.length){var n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Xt(n,gr.POINTERMOVE,this.handlePointerMove_,this),Xt(n,gr.POINTERUP,this.handlePointerUp_,this),Xt(this.element_,gr.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(Xt(this.element_.getRootNode(),gr.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new cr(gr.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 cr(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_&&(Yt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Wt,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Yt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Yt),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(Mt),vr=1/0,yr=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,Pt(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var o=this.keyFunction_(i);return delete this.queuedElements_[o],i},t.prototype.enqueue=function(t){je(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=vr&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,o=e.length,n=e[t],r=i[t],a=t;t<o>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<o&&i[l]<i[s]?l:s;e[t]=e[u],i[t]=i[u],t=u}e[t]=n,i[t]=r,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,o=this.priorities_,n=i[e],r=o[e];e>t;){var a=this.getParentIndex_(e);if(!(o[a]>r))break;i[e]=i[a],o[e]=o[a],e=a}i[e]=n,o[e]=r},t.prototype.reprioritize=function(){var t,e,i,o=this.priorityFunction_,n=this.elements_,r=this.priorities_,a=0,s=n.length;for(e=0;e<s;++e)(i=o(t=n[e]))==vr?delete this.queuedElements_[this.keyFunction_(t)]:(r[a]=i,n[a++]=t);n.length=a,r.length=a,this.heapify_()},t}(),_r=0,br=1,xr=2,kr=3,wr=4,Sr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Cr=function(t){function e(e,i){var o=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return o.boundHandleTileChange_=o.handleTileChange.bind(o),o.tileChangeCallback_=i,o.tilesLoading_=0,o.tilesLoadingKeys_={},o}return Sr(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(jt,this.boundHandleTileChange_);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(i===xr||i===kr||i===wr){e.removeEventListener(jt,this.boundHandleTileChange_);var o=e.getKey();o in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[o],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,o,n=0;this.tilesLoading_<t&&n<e&&this.getCount()>0;)o=(i=this.dequeue()[0]).getKey(),i.getState()!==_r||o in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++n,i.load())},e}(yr);var zr=0,Er=1,Tr="center",Pr="resolution",Or="rotation";function Fr(t,e,i){return function(o,n,r,a,s){if(o){var l=e?0:r[0]*n,u=e?0:r[1]*n,p=s?s[0]:0,h=s?s[1]:0,d=t[0]+l/2+p,c=t[2]-l/2+p,g=t[1]+u/2+h,f=t[3]-u/2+h;d>c&&(c=d=(c+d)/2),g>f&&(f=g=(f+g)/2);var m=De(o[0],d,c),v=De(o[1],g,f),y=30*n;return a&&i&&(m+=-y*Math.log(1+Math.max(0,d-o[0])/y)+y*Math.log(1+Math.max(0,o[0]-c)/y),v+=-y*Math.log(1+Math.max(0,g-o[1])/y)+y*Math.log(1+Math.max(0,o[1]-f)/y)),[m,v]}}}function Rr(t){return t}function Ir(t,e,i,o){var n=Eo(e)/i[0],r=wo(e)/i[1];return o?Math.min(t,Math.max(n,r)):Math.min(t,Math.min(n,r))}function Mr(t,e,i){var o=Math.min(t,e);return o*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(o=Math.max(o,i),o/=Math.log(1+50*Math.max(0,i/t-1))/50+1),De(o,i/2,2*e)}function jr(t,e,i,o,n){return function(r,a,s,l){if(void 0!==r){var u=o?Ir(t,o,s,n):t;return(void 0===i||i)&&l?Mr(r,u,e):De(r,e,u)}}}function Dr(t){return void 0!==t?0:void 0}function Ar(t){return void 0!==t?t:void 0}var Lr="XY",Gr="XYZ",Nr="XYM",Br="XYZM";function Vr(t,e,i,o,n,r){for(var a=r||[],s=0,l=e;l<i;l+=o){var u=t[l],p=t[l+1];a[s++]=n[0]*u+n[2]*p+n[4],a[s++]=n[1]*u+n[3]*p+n[5]}return r&&a.length!=s&&(a.length=s),a}function qr(t,e,i,o,n,r,a){for(var s=a||[],l=Math.cos(n),u=Math.sin(n),p=r[0],h=r[1],d=0,c=e;c<i;c+=o){var g=t[c]-p,f=t[c+1]-h;s[d++]=p+g*l-f*u,s[d++]=h+g*u+f*l;for(var m=c+2;m<c+o;++m)s[d++]=t[m]}return a&&s.length!=d&&(s.length=d),s}function Wr(t,e,i,o,n,r,a){for(var s=a||[],l=0,u=e;u<i;u+=o){s[l++]=t[u]+n,s[l++]=t[u+1]+r;for(var p=u+2;p<u+o;++p)s[l++]=t[p]}return a&&s.length!=l&&(s.length=l),s}var Ur=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Xr=[1,0,0,1,0,0],Kr=function(t){function e(){var e,i,o,n,r,a=t.call(this)||this;return a.extent_=[1/0,1/0,-1/0,-1/0],a.extentRevision_=-1,a.simplifiedGeometryMaxMinSquaredTolerance=0,a.simplifiedGeometryRevision=0,a.simplifyTransformedInternal=(e=function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);var o=this.clone();return o.applyTransform(i),o.getSimplifiedGeometry(e)},r=!1,function(){var t=Array.prototype.slice.call(arguments);return r&&this===n&&St(t,o)||(r=!0,n=this,o=t,i=e.apply(this,arguments)),i}),a}return Ur(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return Jt()},e.prototype.closestPointXY=function(t,e,i,o){return Jt()},e.prototype.containsXY=function(t,e){var i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e},e.prototype.getClosestPoint=function(t,e){var i=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return Jt()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&so(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){Jt()},e.prototype.scale=function(t,e,i){Jt()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return Jt()},e.prototype.getType=function(){return Jt()},e.prototype.applyTransform=function(t){Jt()},e.prototype.intersectsExtent=function(t){return Jt()},e.prototype.translate=function(t,e){Jt()},e.prototype.transform=function(t,e){var i=Qo(t),o=i.getUnits()==ki.TILE_PIXELS?function(t,o,n){var r=i.getExtent(),a=i.getWorldExtent(),s=wo(a)/wo(r);return wn(Xr,a[0],a[3],s,-s,0,0,0),Vr(t,0,t.length,n,Xr,o),sn(i,e)(t,o,n)}:sn(i,e);return this.applyTransform(o),this},e}(oe),Yr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Zr(t){var e;return t==Lr?e=2:t==Gr||t==Nr?e=3:t==Br&&(e=4),e}var Hr=function(t){function e(){var e=t.call(this)||this;return e.layout=Lr,e.stride=2,e.flatCoordinates=null,e}return Yr(e,t),e.prototype.computeExtent=function(t){return uo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return Jt()},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=Zr(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){Jt()},e.prototype.setLayout=function(t,e,i){var o;if(t)o=Zr(t);else{for(var n=0;n<i;++n){if(0===e.length)return this.layout=Lr,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Lr:3==t?e=Gr:4==t&&(e=Br);return e}(o=e.length)}this.layout=t,this.stride=o},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var i=this.getFlatCoordinates();if(i){var o=this.getStride();qr(i,0,i.length,o,t,e,i),this.changed()}},e.prototype.scale=function(t,e,i){var o=e;void 0===o&&(o=t);var n=i;n||(n=bo(this.getExtent()));var r=this.getFlatCoordinates();if(r){var a=this.getStride();!function(t,e,i,o,n,r,a,s){for(var l=s||[],u=a[0],p=a[1],h=0,d=e;d<i;d+=o){var c=t[d]-u,g=t[d+1]-p;l[h++]=u+n*c,l[h++]=p+r*g;for(var f=d+2;f<d+o;++f)l[h++]=t[f]}s&&l.length!=h&&(l.length=h)}(r,0,r.length,a,t,o,n,r),this.changed()}},e.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var o=this.getStride();Wr(i,0,i.length,o,t,e,i),this.changed()}},e}(Kr);function $r(t,e,i,o,n,r,a){var s,l=t[e],u=t[e+1],p=t[i]-l,h=t[i+1]-u;if(0===p&&0===h)s=e;else{var d=((n-l)*p+(r-u)*h)/(p*p+h*h);if(d>1)s=i;else{if(d>0){for(var c=0;c<o;++c)a[c]=qe(t[e+c],t[i+c],d);return void(a.length=o)}s=e}}for(c=0;c<o;++c)a[c]=t[s+c];a.length=o}function Jr(t,e,i,o,n){var r=t[e],a=t[e+1];for(e+=o;e<i;e+=o){var s=t[e],l=t[e+1],u=Ne(r,a,s,l);u>n&&(n=u),r=s,a=l}return n}function Qr(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=Jr(t,e,s,o,n),e=s}return n}function ta(t,e,i,o,n,r,a,s,l,u,p){if(e==i)return u;var h,d;if(0===n){if((d=Ne(a,s,t[e],t[e+1]))<u){for(h=0;h<o;++h)l[h]=t[e+h];return l.length=o,d}return u}for(var c=p||[NaN,NaN],g=e+o;g<i;)if($r(t,g-o,g,o,a,s,c),(d=Ne(a,s,c[0],c[1]))<u){for(u=d,h=0;h<o;++h)l[h]=c[h];l.length=o,g+=o}else g+=o*Math.max((Math.sqrt(d)-Math.sqrt(u))/n|0,1);if(r&&($r(t,i-o,e,o,a,s,c),(d=Ne(a,s,c[0],c[1]))<u)){for(u=d,h=0;h<o;++h)l[h]=c[h];l.length=o}return u}function ea(t,e,i,o,n,r,a,s,l,u,p){for(var h=p||[NaN,NaN],d=0,c=i.length;d<c;++d){var g=i[d];u=ta(t,e,g,o,n,r,a,s,l,u,h),e=g}return u}function ia(t,e,i,o){for(var n=0,r=i.length;n<r;++n)t[e++]=i[n];return e}function oa(t,e,i,o){for(var n=0,r=i.length;n<r;++n)for(var a=i[n],s=0;s<o;++s)t[e++]=a[s];return e}function na(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=oa(t,e,i[s],o);r[a++]=u,e=u}return r.length=a,r}function ra(t,e,i,o,n,r,a){var s=(i-e)/o;if(s<3){for(;e<i;e+=o)r[a++]=t[e],r[a++]=t[e+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[e,i-o],p=0;u.length>0;){for(var h=u.pop(),d=u.pop(),c=0,g=t[d],f=t[d+1],m=t[h],v=t[h+1],y=d+o;y<h;y+=o){var _=Ge(t[y],t[y+1],g,f,m,v);_>c&&(p=y,c=_)}c>n&&(l[(p-e)/o]=1,d+o<p&&u.push(d,p),p+o<h&&u.push(p,h))}for(y=0;y<s;++y)l[y]&&(r[a++]=t[e+y*o],r[a++]=t[e+y*o+1]);return a}function aa(t,e){return e*Math.round(t/e)}function sa(t,e,i,o,n,r,a){if(e==i)return a;var s,l,u=aa(t[e],n),p=aa(t[e+1],n);e+=o,r[a++]=u,r[a++]=p;do{if(s=aa(t[e],n),l=aa(t[e+1],n),(e+=o)==i)return r[a++]=s,r[a++]=l,a}while(s==u&&l==p);for(;e<i;){var h=aa(t[e],n),d=aa(t[e+1],n);if(e+=o,h!=s||d!=l){var c=s-u,g=l-p,f=h-u,m=d-p;c*m==g*f&&(c<0&&f<c||c==f||c>0&&f>c)&&(g<0&&m<g||g==m||g>0&&m>g)?(s=h,l=d):(r[a++]=s,r[a++]=l,u=s,p=l,s=h,l=d)}}return r[a++]=s,r[a++]=l,a}function la(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=sa(t,e,p,o,n,r,a),s.push(a),e=p}return a}function ua(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=e;s<i;s+=o)r[a++]=t.slice(s,s+o);return r.length=a,r}function pa(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=ua(t,e,u,o,r[a]),e=u}return r.length=a,r}function ha(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=pa(t,e,u,o,r[a]),e=u[u.length-1]}return r.length=a,r}function da(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=a*s-r*l,r=s,a=l}return n/2}function ca(t,e,i,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=da(t,e,s,o),e=s}return n}var ga=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),fa=function(t){function e(e,i){var o=t.call(this)||this;return o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return ga(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,o){return o<to(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Jr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.getArea=function(){return da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=ra(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Lr)},e.prototype.getType=function(){return Io},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=oa(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Hr),ma=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),va=function(t){function e(e,i){var o=t.call(this)||this;return o.setCoordinates(e,i),o}return ma(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,i,o){var n=this.flatCoordinates,r=Ne(t,e,n[0],n[1]);if(r<o){for(var a=this.stride,s=0;s<a;++s)i[s]=n[s];return i.length=a,r}return o},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return lo(this.flatCoordinates,t)},e.prototype.getType=function(){return Fo},e.prototype.intersectsExtent=function(t){return oo(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=ia(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Hr);function ya(t,e,i,o,n){return!mo(n,(function(n){return!_a(t,e,i,o,n[0],n[1])}))}function _a(t,e,i,o,n,r){for(var a=0,s=t[i-o],l=t[i-o+1];e<i;e+=o){var u=t[e],p=t[e+1];l<=r?p>r&&(u-s)*(r-l)-(n-s)*(p-l)>0&&a++:p<=r&&(u-s)*(r-l)-(n-s)*(p-l)<0&&a--,s=u,l=p}return 0!==a}function ba(t,e,i,o,n,r){if(0===i.length)return!1;if(!_a(t,e,i[0],o,n,r))return!1;for(var a=1,s=i.length;a<s;++a)if(_a(t,i[a-1],i[a],o,n,r))return!1;return!0}function xa(t,e,i,o,n,r,a){for(var s,l,u,p,h,d,c,g=n[r+1],f=[],m=0,v=i.length;m<v;++m){var y=i[m];for(p=t[y-o],d=t[y-o+1],s=e;s<y;s+=o)h=t[s],c=t[s+1],(g<=d&&c<=g||d<=g&&g<=c)&&(u=(g-d)/(c-d)*(h-p)+p,f.push(u)),p=h,d=c}var _=NaN,b=-1/0;for(f.sort(bt),p=f[0],s=1,l=f.length;s<l;++s){h=f[s];var x=Math.abs(h-p);x>b&&ba(t,e,i,o,u=(p+h)/2,g)&&(_=u,b=x),p=h}return isNaN(_)&&(_=n[r]),a?(a.push(_,g,b),a):[_,g,b]}function ka(t,e,i,o,n){for(var r=[],a=0,s=i.length;a<s;++a){var l=i[a];r=xa(t,e,l,o,n,2*a,r),e=l[l.length-1]}return r}function wa(t,e,i,o,n){var r;for(e+=o;e<i;e+=o)if(r=n(t.slice(e-o,e),t.slice(e,e+o)))return r;return!1}function Sa(t,e,i,o,n){var r=go([1/0,1/0,-1/0,-1/0],t,e,i,o);return!!To(n,r)&&(!!io(n,r)||(r[0]>=n[0]&&r[2]<=n[2]||(r[1]>=n[1]&&r[3]<=n[3]||wa(t,e,i,o,(function(t,e){return function(t,e,i){var o=!1,n=no(t,e),r=no(t,i);if(n===Xi||r===Xi)o=!0;else{var a=t[0],s=t[1],l=t[2],u=t[3],p=e[0],h=e[1],d=i[0],c=i[1],g=(c-h)/(d-p),f=void 0,m=void 0;r&Ki&&!(n&Ki)&&(o=(f=d-(c-u)/g)>=a&&f<=l),o||!(r&Yi)||n&Yi||(o=(m=c-(d-l)*g)>=s&&m<=u),o||!(r&Zi)||n&Zi||(o=(f=d-(c-s)/g)>=a&&f<=l),o||!(r&Hi)||n&Hi||(o=(m=c-(d-a)*g)>=s&&m<=u)}return o}(n,t,e)})))))}function Ca(t,e,i,o,n){if(!function(t,e,i,o,n){return!!(Sa(t,e,i,o,n)||_a(t,e,i,o,n[0],n[1])||_a(t,e,i,o,n[0],n[3])||_a(t,e,i,o,n[2],n[1])||_a(t,e,i,o,n[2],n[3]))}(t,e,i[0],o,n))return!1;if(1===i.length)return!0;for(var r=1,a=i.length;r<a;++r)if(ya(t,i[r-1],i[r],o,n)&&!Sa(t,i[r-1],i[r],o,n))return!1;return!0}function za(t,e,i,o){for(;e<i-o;){for(var n=0;n<o;++n){var r=t[e+n];t[e+n]=t[i-o+n],t[i-o+n]=r}e+=o,i-=o}}function Ea(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=(s-r)*(l+a),r=s,a=l}return 0===n?void 0:n>0}function Ta(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Ea(t,e,l,o);if(0===a){if(r&&u||!r&&!u)return!1}else if(r&&!u||!r&&u)return!1;e=l}return!0}function Pa(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Ea(t,e,l,o);(0===a?r&&u||!r&&!u:r&&!u||!r&&u)&&za(t,e,l,o),e=l}return e}function Oa(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r)e=Pa(t,e,i[r],o,n);return e}var Fa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ra=function(t){function e(e,i,o){var n=t.call(this)||this;return n.ends_=[],n.flatInteriorPointRevision_=-1,n.flatInteriorPoint_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,void 0!==i&&o?(n.setFlatCoordinates(i,e),n.ends_=o):n.setCoordinates(e,i),n}return Fa(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?wt(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,i,o){return o<to(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Qr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ea(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return ba(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return ca(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Pa(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,pa(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=bo(this.getExtent());this.flatInteriorPoint_=xa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new va(this.getFlatInteriorPoint(),Nr)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new fa(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,i=this.ends_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r],l=new fa(e.slice(n,s),t);o.push(l),n=s}return o},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Ta(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Pa(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=la(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,o),new e(i,Lr,o)},e.prototype.getType=function(){return Mo},e.prototype.intersectsExtent=function(t){return Ca(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=na(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Hr),Ia=Ra;function Ma(t){var e=t[0],i=t[1],o=t[2],n=t[3],r=[e,i,e,n,o,n,o,i,e,i];return new Ra(r,Lr,[r.length])}function ja(t,e,i){for(var o=e||32,n=t.getStride(),r=t.getLayout(),a=t.getCenter(),s=n*(o+1),l=new Array(s),u=0;u<s;u+=n){l[u]=0,l[u+1]=0;for(var p=2;p<n;p++)l[u+p]=a[p]}var h=[l.length],d=new Ra(l,r,h);return function(t,e,i,o){for(var n=t.getFlatCoordinates(),r=t.getStride(),a=n.length/r-1,s=o||0,l=0;l<=a;++l){var u=l*r,p=s+2*Ve(l,a)*Math.PI/a;n[u]=e[0]+i*Math.cos(p),n[u+1]=e[1]+i*Math.sin(p)}t.changed()}(d,a,t.getRadius(),i),d}var Da=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Aa(t,e){setTimeout((function(){t(e)}),0)}function La(t){return!(t.sourceCenter&&t.targetCenter&&!Wo(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Ga(t,e,i,o,n){var r=Math.cos(-n),a=Math.sin(-n),s=t[0]*r-t[1]*a,l=t[1]*r+t[0]*a;return[(s+=(e[0]/2-i[0])*o)*r-(l+=(i[1]-e[1]/2)*o)*(a=-a),l*r+s*a]}var Na=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=Tt({},e);return i.hints_=[0,0],i.animations_=[],i.updateAnimationKey_,i.projection_=on(o.projection,"EPSG:3857"),i.viewportSize_=[100,100],i.targetCenter_=null,i.targetResolution_,i.targetRotation_,i.nextCenter_=null,i.nextResolution_,i.nextRotation_,i.cancelAnchor_=void 0,o.center&&(o.center=cn(o.center,i.projection_)),o.extent&&(o.extent=fn(o.extent,i.projection_)),i.applyOptions_(o),i}return Da(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,i,o,n=28,r=2,a=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:n,l=void 0!==t.zoomFactor?t.zoomFactor:r,u=void 0!==t.multiWorld&&t.multiWorld,p=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,h=void 0!==t.showFullExtent&&t.showFullExtent,d=on(t.projection,"EPSG:3857"),c=d.getExtent(),g=t.constrainOnlyCenter,f=t.extent;u||f||!d.isGlobal()||(g=!1,f=c);if(void 0!==t.resolutions){var m=t.resolutions;i=m[a],o=void 0!==m[s]?m[s]:m[m.length-1],e=t.constrainResolution?function(t,e,i,o){return function(n,r,a,s){if(void 0!==n){var l=t[0],u=t[t.length-1],p=i?Ir(l,i,a,o):l;if(s)return void 0===e||e?Mr(n,p,u):De(n,u,p);var h=Math.min(p,n),d=Math.floor(xt(t,h,r));return t[d]>p&&d<t.length-1?t[d+1]:t[d]}}}(m,p,!g&&f,h):jr(i,o,p,!g&&f,h)}else{var v=(c?Math.max(Eo(c),wo(c)):360*xi[ki.DEGREES]/d.getMetersPerUnit())/256/Math.pow(r,0),y=v/Math.pow(r,n-0);void 0!==(i=t.maxResolution)?a=0:i=v/Math.pow(l,a),void 0===(o=t.minResolution)&&(o=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(l,s):v/Math.pow(l,s):y),s=a+Math.floor(Math.log(i/o)/Math.log(l)),o=i/Math.pow(l,s-a),e=t.constrainResolution?function(t,e,i,o,n,r){return function(a,s,l,u){if(void 0!==a){var p=n?Ir(e,n,l,r):e,h=void 0!==i?i:0;if(u)return void 0===o||o?Mr(a,p,h):De(a,h,p);var d=Math.ceil(Math.log(e/p)/Math.log(t)-1e-9),c=-s*(.5-1e-9)+.5,g=Math.min(p,a),f=Math.floor(Math.log(e/g)/Math.log(t)+c),m=Math.max(d,f);return De(e/Math.pow(t,m),h,p)}}}(l,i,o,p,!g&&f,h):jr(i,o,p,!g&&f,h)}return{constraint:e,maxResolution:i,minResolution:o,minZoom:a,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 i=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Fr(t.extent,t.constrainOnlyCenter,e)}var i=on(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&i.isGlobal()){var o=i.getExtent().slice();return o[0]=-1/0,o[2]=1/0,Fr(o,!1,!1)}return Rr}(t),o=e.constraint,n=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(r=n||Be(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=r?0:t:void 0}):!1===e?Ar:"number"==typeof e?(i=e,o=2*Math.PI/i,function(t,e){return e?t:void 0!==t?t=Math.floor(t/o+.5)*o:void 0}):Ar}return Dr;var i,o;var n,r}(t);this.constraints_={center:i,resolution:o,rotation:n},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 i=this.getCenter();if(i){var o=t||[0,0,0,0];e=e||[0,0,0,0];var n=this.getResolution(),r=n/2*(o[3]-e[3]+e[1]-o[1]),a=n/2*(o[0]-e[0]+e[2]-o[2]);this.setCenterInternal([i[0]+r,i[1]-a])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=Tt({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Tt({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),i=0;i<e.length;++i){var o=arguments[i];o.center&&((o=Tt({},o)).center=cn(o.center,this.getProjection())),o.anchor&&((o=Tt({},o)).anchor=cn(o.anchor,this.getProjection())),e[i]=o}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,i=arguments.length;i>1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i);for(var o=0;o<i&&!this.isDef();++o){var n=arguments[o];n.center&&this.setCenterInternal(n.center),void 0!==n.zoom?this.setZoom(n.zoom):n.resolution&&this.setResolution(n.resolution),void 0!==n.rotation&&this.setRotation(n.rotation)}if(o!==i){for(var r=Date.now(),a=this.targetCenter_.slice(),s=this.targetResolution_,l=this.targetRotation_,u=[];o<i;++o){var p=arguments[o],h={start:r,complete:!1,anchor:p.anchor,duration:void 0!==p.duration?p.duration:1e3,easing:p.easing||di,callback:e};if(p.center&&(h.sourceCenter=a,h.targetCenter=p.center.slice(),a=h.targetCenter),void 0!==p.zoom?(h.sourceResolution=s,h.targetResolution=this.getResolutionForZoom(p.zoom),s=h.targetResolution):p.resolution&&(h.sourceResolution=s,h.targetResolution=p.resolution,s=h.targetResolution),void 0!==p.rotation){h.sourceRotation=l;var d=Ve(p.rotation-l+Math.PI,2*Math.PI)-Math.PI;h.targetRotation=l+d,l=h.targetRotation}La(h)?h.complete=!0:r+=h.duration,u.push(h)}this.animations_.push(u),this.setHint(zr,1),this.updateAnimations_()}else e&&Aa(e,!0)},e.prototype.getAnimating=function(){return this.hints_[zr]>0},e.prototype.getInteracting=function(){return this.hints_[Er]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(zr,-this.hints_[zr]);for(var e=0,i=this.animations_.length;e<i;++e){var o=this.animations_[e];if(o[0].callback&&Aa(o[0].callback,!1),!t)for(var n=0,r=o.length;n<r;++n){var a=o[n];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,i=this.animations_.length-1;i>=0;--i){for(var o=this.animations_[i],n=!0,r=0,a=o.length;r<a;++r){var s=o[r];if(!s.complete){var l=t-s.start,u=s.duration>0?l/s.duration:1;u>=1?(s.complete=!0,u=1):n=!1;var p=s.easing(u);if(s.sourceCenter){var h=s.sourceCenter[0],d=s.sourceCenter[1],c=s.targetCenter[0],g=s.targetCenter[1];this.nextCenter_=s.targetCenter;var f=h+p*(c-h),m=d+p*(g-d);this.targetCenter_=[f,m]}if(s.sourceResolution&&s.targetResolution){var v=1===p?s.targetResolution:s.sourceResolution+p*(s.targetResolution-s.sourceResolution);if(s.anchor){var y=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(v,0,y,!0);this.targetCenter_=this.calculateCenterZoom(_,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=v,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var b=1===p?Ve(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+p*(s.targetRotation-s.sourceRotation);if(s.anchor){var x=this.constraints_.rotation(b,!0);this.targetCenter_=this.calculateCenterRotate(x,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=b}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(n){this.animations_[i]=null,this.setHint(zr,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var k=o[0].callback;k&&Aa(k,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var i,o,n,r=this.getCenterInternal();return void 0!==r&&(Uo(i=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),n=e,(o=i)[0]+=+n[0],o[1]+=+n[1]),i},e.prototype.calculateCenterZoom=function(t,e){var i,o=this.getCenterInternal(),n=this.getResolution();void 0!==o&&void 0!==n&&(i=[e[0]-t*(e[0]-o[0])/n,e[1]-t*(e[1]-o[1])/n]);return i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],o=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(o*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(o*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?dn(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Tr)},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 gn(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();je(i,1);var o=this.getResolution();je(void 0!==o,2);var n=this.getRotation();return je(void 0!==n,3),ko(i,o,n,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(Pr)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(fn(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSizeMinusPadding_(),o=Eo(t)/i[0],n=wo(t)/i[1];return Math.max(o,n)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/Math.log(e);return function(t){return i/Math.pow(e,t*n)}},e.prototype.getRotation=function(){return this.get(Or)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/e;return function(t){return Math.log(i/t)/e/n}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),o=this.getCenterInternal(),n=this.padding_;if(n){var r=this.getViewportSizeMinusPadding_();o=Ga(o,this.getViewportSize_(),[r[0]/2+n[3],r[1]/2+n[0]],e,i)}return{center:o.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,o=this.minZoom_||0;if(this.resolutions_){var n=xt(this.resolutions_,t,1);o=n,e=this.resolutions_[n],i=n==this.resolutions_.length-1?2:e/this.resolutions_[n+1]}else e=this.maxResolution_,i=this.zoomFactor_;return o+Math.log(e/t)/Math.log(i)},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),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,De(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(je(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))je(!Po(t),25),i=Ma(o=fn(t,this.getProjection()));else if(t.getType()===Go){var o;(i=Ma(o=fn(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),bo(o))}else{i=t}this.fitInternal(i,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),i=Math.cos(e),o=Math.sin(-e),n=t.getFlatCoordinates(),r=t.getStride(),a=1/0,s=1/0,l=-1/0,u=-1/0,p=0,h=n.length;p<h;p+=r){var d=n[p]*i-n[p+1]*o,c=n[p]*o+n[p+1]*i;a=Math.min(a,d),s=Math.min(s,c),l=Math.max(l,d),u=Math.max(u,c)}return[a,s,l,u]},e.prototype.fitInternal=function(t,e){var i=e||{},o=i.size;o||(o=this.getViewportSizeMinusPadding_());var n,r=void 0!==i.padding?i.padding:[0,0,0,0],a=void 0!==i.nearest&&i.nearest;n=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;var s=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(s,[o[0]-r[1]-r[3],o[1]-r[0]-r[2]]);l=isNaN(l)?n:Math.max(l,n),l=this.getConstrainedResolution(l,a?0:1);var u=this.getRotation(),p=Math.sin(u),h=Math.cos(u),d=bo(s);d[0]+=(r[1]-r[3])/2*l,d[1]+=(r[0]-r[2])/2*l;var c=d[0]*h-d[1]*p,g=d[1]*h+d[0]*p,f=this.getConstrainedCenter([c,g],l),m=i.callback?i.callback:Et;void 0!==i.duration?this.animateInternal({resolution:l,center:f,duration:i.duration,easing:i.easing},m):(this.targetResolution_=l,this.targetCenter_=f,this.applyTargetState_(!1,!0),Aa(m,!0))},e.prototype.centerOn=function(t,e,i){this.centerOnInternal(cn(t,this.getProjection()),e,i)},e.prototype.centerOnInternal=function(t,e,i){this.setCenterInternal(Ga(t,e,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,i,o){var n,r=this.padding_;if(r&&t){var a=this.getViewportSizeMinusPadding_(-i),s=Ga(t,o,[a[0]/2+r[3],a[1]/2+r[0]],e,i);n=[t[0]-s[0],t[1]-s[1]]}return n},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=dn(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var i=e&&cn(e,this.getProjection());this.adjustResolutionInternal(t,i)},e.prototype.adjustResolutionInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(this.targetResolution_*t,0,o,i);e&&(this.targetCenter_=this.calculateCenterZoom(n,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=cn(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(o,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(cn(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 i=this.getAnimating()||this.getInteracting()||e,o=this.constraints_.rotation(this.targetRotation_,i),n=this.getViewportSize_(o),r=this.constraints_.resolution(this.targetResolution_,0,n,i),a=this.constraints_.center(this.targetCenter_,r,n,i,this.calculateCenterShift(this.targetCenter_,r,o,n));this.get(Or)!==o&&this.set(Or,o),this.get(Pr)!==r&&this.set(Pr,r),this.get(Tr)&&Wo(this.get(Tr),a)||this.set(Tr,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,i){var o=void 0!==t?t:200,n=e||0,r=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(r),s=this.constraints_.resolution(this.targetResolution_,n,a),l=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,r,a));if(0===o&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=r,this.targetCenter_=l,void this.applyTargetState_();var u=i||(0===o?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===r&&this.getCenterInternal()&&Wo(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:s,duration:o,easing:hi,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Er,1)},e.prototype.endInteraction=function(t,e,i){var o=i&&cn(i,this.getProjection());this.endInteractionInternal(t,e,o)},e.prototype.endInteractionInternal=function(t,e,i){this.setHint(Er,-1),this.resolveConstraints(t,e,i)},e.prototype.getConstrainedCenter=function(t,e){var i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)},e.prototype.getConstrainedZoom=function(t,e){var i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))},e.prototype.getConstrainedResolution=function(t,e){var i=e||0,o=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,o)},e}(oe);function Ba(t){return t[0]>0&&t[1]>0}function Va(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var qa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var Wa=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,o,n,r={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new ur({layers:t.layers});r[or]=a,r[rr]=t.target,r[ar]=t.view instanceof Na?t.view:new Na,void 0!==t.controls&&(Array.isArray(t.controls)?i=new ui(t.controls.slice()):(je("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?o=new ui(t.interactions.slice()):(je("function"==typeof t.interactions.getArray,48),o=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?n=new ui(t.overlays.slice()):(je("function"==typeof t.overlays.getArray,49),n=t.overlays):n=new ui;return{controls:i,interactions:o,keyboardEventTarget:e,overlays:n,values:r}}(e);i.boundHandleBrowserEvent_=i.handleBrowserEvent.bind(i),i.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,i.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:he,i.postRenderTimeoutHandle_,i.animationDelayKey_,i.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(i),i.coordinateToPixelTransform_=[1,0,0,1,0,0],i.pixelToCoordinateTransform_=[1,0,0,1,0,0],i.frameIndex_=0,i.frameState_=null,i.previousExtent_=null,i.viewPropertyListenerKey_=null,i.viewChangeListenerKey_=null,i.layerGroupPropertyListenerKeys_=null,i.viewport_=document.createElement("div"),i.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),i.viewport_.style.position="relative",i.viewport_.style.overflow="hidden",i.viewport_.style.width="100%",i.viewport_.style.height="100%",i.overlayContainer_=document.createElement("div"),i.overlayContainer_.style.position="absolute",i.overlayContainer_.style.zIndex="0",i.overlayContainer_.style.width="100%",i.overlayContainer_.style.height="100%",i.overlayContainer_.style.pointerEvents="none",i.overlayContainer_.className="ol-overlaycontainer",i.viewport_.appendChild(i.overlayContainer_),i.overlayContainerStopEvent_=document.createElement("div"),i.overlayContainerStopEvent_.style.position="absolute",i.overlayContainerStopEvent_.style.zIndex="0",i.overlayContainerStopEvent_.style.width="100%",i.overlayContainerStopEvent_.style.height="100%",i.overlayContainerStopEvent_.style.pointerEvents="none",i.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",i.viewport_.appendChild(i.overlayContainerStopEvent_),i.mapBrowserEventHandler_=null,i.moveTolerance_=e.moveTolerance,i.keyboardEventTarget_=o.keyboardEventTarget,i.keyHandlerKeys_=null,i.controls=o.controls||new ui,i.interactions=o.interactions||new ui,i.overlays_=o.overlays,i.overlayIdIndex_={},i.renderer_=null,i.handleResize_,i.postRenderFunctions_=[],i.tileQueue_=new Cr(i.getTilePriority.bind(i),i.handleTileChange_.bind(i)),i.addChangeListener(or,i.handleLayerGroupChanged_),i.addChangeListener(ar,i.handleViewChanged_),i.addChangeListener(nr,i.handleSizeChanged_),i.addChangeListener(rr,i.handleTargetChanged_),i.setProperties(o.values);var n=i;return!e.view||e.view instanceof Na||e.view.then((function(t){n.setView(new Na(t))})),i.controls.addEventListener(ni,function(t){t.element.setMap(this)}.bind(i)),i.controls.addEventListener(ri,function(t){t.element.setMap(null)}.bind(i)),i.interactions.addEventListener(ni,function(t){t.element.setMap(this)}.bind(i)),i.interactions.addEventListener(ri,function(t){t.element.setMap(null)}.bind(i)),i.overlays_.addEventListener(ni,function(t){this.addOverlayInternal_(t.element)}.bind(i)),i.overlays_.addEventListener(ri,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(i)),i.controls.forEach(function(t){t.setMap(this)}.bind(i)),i.interactions.forEach(function(t){t.setMap(this)}.bind(i)),i.overlays_.forEach(i.addOverlayInternal_.bind(i)),i}return qa(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,i){if(this.frameState_){var o=this.getCoordinateFromPixelInternal(t),n=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,r=void 0!==i.layerFilter?i.layerFilter:Ct,a=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(o,this.frameState_,n,a,e,null,r,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),e),i},e.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_){var o=i||{},n=void 0!==o.hitTolerance?o.hitTolerance:0,r=o.layerFilter||Ct;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,n,e,r)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixelInternal(t),o=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:Ct,n=void 0!==e.hitTolerance?e.hitTolerance:0,r=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,n,r,o,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},e.prototype.getTarget=function(){return this.get(rr)},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 dn(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?xn(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(or)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof ui)e.setLayers(t);else{var i=e.getLayers();i.clear(),i.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var o=t[e].layer.getSource();if(o&&o.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=cn(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?xn(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(nr)},e.prototype.getView=function(){return this.get(ar)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,e,i,o){return function(t,e,i,o,n){if(!t||!(i in t.wantedTiles))return vr;if(!t.wantedTiles[i][e.getKey()])return vr;var r=t.viewState.center,a=o[0]-r[0],s=o[1]-r[1];return 65536*Math.log(n)+Math.sqrt(a*a+s*s)/n}(this.frameState_,t,e,i,o)},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,o=new cr(i,this,t);this.handleMapBrowserEvent(o)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,i=e.type;if(i===_i||i===Ut||i===Nt){var o=this.getOwnerDocument(),n=this.viewport_.getRootNode?this.viewport_.getRootNode():o,r=e.target;if(this.overlayContainerStopEvent_.contains(r)||!(n===o?o.documentElement:n).contains(r))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var a=this.getInteractions().getArray().slice(),s=a.length-1;s>=0;s--){var l=a[s];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,o=i;if(t){var n=t.viewHints;if(n[zr]||n[Er]){var r=Date.now()-t.time>8;i=r?0:8,o=r?0:2}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,o))}!t||!this.hasListener(He)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(He,t);for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.mapBrowserEventHandler_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)Yt(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(At,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(Ut,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(qt,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,ve(this.viewport_)}if(t){for(var o in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new mr(this,this.moveTolerance_),gr)this.mapBrowserEventHandler_.addEventListener(gr[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(At,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(Ut,this.boundHandleBrowserEvent_,!!ge&&{passive:!1});var n=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[Xt(n,Nt,this.handleBrowserEvent,this),Xt(n,Bt,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(qt,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_&&(Yt(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Yt(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=Xt(t,yt,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=Xt(t,jt,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Yt),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[Xt(t,yt,this.render,this),Xt(t,jt,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,i=t.length;e<i;++e){var o=t[e].layer;o.hasRenderer()&&o.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,i=this.getSize(),o=this.getView(),n=this.frameState_,r=null;if(void 0!==i&&Ba(i)&&o&&o.isDef()){var a=o.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=o.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:ko(s.center,s.resolution,s.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:s,viewHints:a,wantedTiles:{}},s.nextCenter&&s.nextResolution){var l=isNaN(s.nextRotation)?s.rotation:s.nextRotation;r.nextExtent=ko(s.nextCenter,s.nextResolution,l,i)}}if(this.frameState_=r,this.renderer_.renderFrame(r),r){if(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),n)(!this.previousExtent_||!Po(this.previousExtent_)&&!po(r.extent,this.previousExtent_))&&(this.dispatchEvent(new hr(re,this,n)),this.previousExtent_=so(this.previousExtent_));this.previousExtent_&&!r.viewHints[zr]&&!r.viewHints[Er]&&!po(r.extent,this.previousExtent_)&&(this.dispatchEvent(new hr(ae,this,r)),Qi(r.extent,this.previousExtent_))}this.dispatchEvent(new hr(ne,this,r)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(or,t)},e.prototype.setSize=function(t){this.set(nr,t)},e.prototype.setTarget=function(t){this.set(rr,t)},e.prototype.setView=function(t){if(!t||t instanceof Na)this.set(ar,t);else{this.set(ar,new Na);var e=this;t.then((function(t){e.setView(new Na(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var i=getComputedStyle(t),o=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),n=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(o)||isNaN(n)||!Ba(e=[o,n])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0.")}this.setSize(e),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(oe),Ua=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Xa="degrees",Ka="imperial",Ya="nautical",Za="metric",Ha="us",$a=[1,2,5],Ja=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.className?o.className:o.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).on,i.once,i.un,i.innerElement_=document.createElement("div"),i.innerElement_.className=n+"-inner",i.element.className=n+" ol-unselectable",i.element.appendChild(i.innerElement_),i.viewState_=null,i.minWidth_=void 0!==o.minWidth?o.minWidth:64,i.renderedVisible_=!1,i.renderedWidth_=void 0,i.renderedHTML_="",i.addChangeListener("units",i.handleUnitsChanged_),i.setUnits(o.units||Za),i.scaleBar_=o.bar||!1,i.scaleBarSteps_=o.steps||4,i.scaleBarText_=o.text||!1,i.dpi_=o.dpi||void 0,i}return Ua(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,i=t.projection,o=this.getUnits(),n=o==Xa?ki.DEGREES:ki.METERS,r=tn(i,t.resolution,e,n),a=this.minWidth_*(this.dpi_||90.7142857142857)/90.7142857142857,s=a*r,l="";if(o==Xa){var u=xi[ki.DEGREES];(s*=u)<u/60?(l="″",r*=3600):s<u?(l="′",r*=60):l="°"}else o==Ka?s<.9144?(l="in",r/=.0254):s<1609.344?(l="ft",r/=.3048):(l="mi",r/=1609.344):o==Ya?(r/=1852,l="nm"):o==Za?s<.001?(l="μm",r*=1e6):s<1?(l="mm",r*=1e3):s<1e3?l="m":(l="km",r/=1e3):o==Ha?s<.9144?(l="in",r*=39.37):s<1609.344?(l="ft",r/=.30480061):(l="mi",r/=1609.3472):je(!1,33);for(var p,h,d,c,g=3*Math.floor(Math.log(a*r)/Math.log(10));;){d=Math.floor(g/3);var f=Math.pow(10,d);if(p=$a[(g%3+3)%3]*f,h=Math.round(p/r),isNaN(h))return this.element.style.display="none",void(this.renderedVisible_=!1);if(h>=a)break;++g}c=this.scaleBar_?this.createScaleBar(h,p,l):p.toFixed(d<0?-d:0)+" "+l,this.renderedHTML_!=c&&(this.innerElement_.innerHTML=c,this.renderedHTML_=c),this.renderedWidth_!=h&&(this.innerElement_.style.width=h+"px",this.renderedWidth_=h),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,i){for(var o="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),n=[],r=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&n.push(this.createMarker("absolute",s)),n.push('<div><div class="ol-scale-singlebar" style="width: '+r+"px;background-color: "+a+';"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,i):"")+"</div>"),s===this.scaleBarSteps_-1&&n.push(this.createStepText(s+1,t,!0,e,i)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+o+"</div>":"")+n.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,i,o,n){var r=(0===t?0:Math.round(o/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+n);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(i?e+"px":"unset")+';">'+r+"</div>"},e.prototype.getScaleForResolution=function(){var t=tn(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||90.7142857142857,i=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*i*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(_e);function Qa(t){var e=t||{},i=new ui;return(void 0===e.zoom||e.zoom)&&i.push(new vi(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new fi(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new oi(e.attributionOptions)),i}var ts=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),es=function(t){function e(e,i,o){var n=t.call(this)||this;if(void 0!==o&&void 0===i)n.setFlatCoordinates(o,e);else{var r=i||0;n.setCenterAndRadius(e,r,o)}return n}return ts(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){var n=this.flatCoordinates,r=t-n[0],a=e-n[1],s=r*r+a*a;if(s<o){if(0===s)for(var l=0;l<this.stride;++l)i[l]=n[l];else{var u=this.getRadius()/Math.sqrt(s);i[0]=n[0]+u*r,i[1]=n[1]+u*a;for(l=2;l<this.stride;++l)i[l]=n[l]}return i.length=this.stride,s}return o},e.prototype.containsXY=function(t,e){var i=this.flatCoordinates,o=t-i[0],n=e-i[1];return o*o+n*n<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,i=e[this.stride]-e[0];return ao(e[0]-i,e[1]-i,e[0]+i,e[1]+i,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return Go},e.prototype.intersectsExtent=function(t){if(To(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||mo(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],o=t.slice();o[e]=o[0]+i;for(var n=1;n<e;++n)o[e+n]=t[n];this.setFlatCoordinates(this.layout,o),this.changed()},e.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var o=this.flatCoordinates,n=ia(o,0,t,this.stride);o[n++]=o[0]+e;for(var r=1,a=this.stride;r<a;++r)o[n++]=o[r];o.length=n,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var i=this.getCenter(),o=this.getStride();this.setCenter(qr(i,0,i.length,o,t,e,i)),this.changed()},e.prototype.translate=function(t,e){var i=this.getCenter(),o=this.getStride();this.setCenter(Wr(i,0,i.length,o,t,e,i)),this.changed()},e}(Hr);es.prototype.transform;var is=es,os=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ns(t){for(var e=[],i=0,o=t.length;i<o;++i)e.push(t[i].clone());return e}var rs=function(t){function e(e){var i=t.call(this)||this;return i.geometries_=e||null,i.changeEventsKeys_=[],i.listenGeometriesChange_(),i}return os(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(Yt),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(Xt(this.geometries_[t],jt,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,i,o){if(o<to(this.getExtent(),t,e))return o;for(var n=this.geometries_,r=0,a=n.length;r<a;++r)o=n[r].closestPointXY(t,e,i,o);return o},e.prototype.containsXY=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)if(i[o].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){so(t);for(var e=this.geometries_,i=0,o=e.length;i<o;++i)ho(t,e[i].getExtent());return t},e.prototype.getGeometries=function(){return ns(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,i=0,o=e.length;i<o;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);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 i=[],o=this.geometries_,n=!1,r=0,a=o.length;r<a;++r){var s=o[r],l=s.getSimplifiedGeometry(t);i.push(l),l!==s&&(n=!0)}if(n){var u=new e(null);return u.setGeometriesArray(i),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return Lo},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,i=0,o=e.length;i<o;++i)if(e[i].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)i[o].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,i){var o=i;o||(o=bo(this.getExtent()));for(var n=this.geometries_,r=0,a=n.length;r<a;++r)n[r].scale(t,e,o);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(ns(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_,i=0,o=e.length;i<o;++i)e[i].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)i[o].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Kr);function as(t,e,i,o,n,r,a){var s,l,u=(i-e)/o;if(1===u)s=e;else if(2===u)s=e,l=n;else if(0!==u){for(var p=t[e],h=t[e+1],d=0,c=[0],g=e+o;g<i;g+=o){var f=t[g],m=t[g+1];d+=Math.sqrt((f-p)*(f-p)+(m-h)*(m-h)),c.push(d),p=f,h=m}var v=n*d,y=function(t,e,i){for(var o,n,r=i||bt,a=0,s=t.length,l=!1;a<s;)(n=+r(t[o=a+(s-a>>1)],e))<0?a=o+1:(s=o,l=!n);return l?a:~a}(c,v);y<0?(l=(v-c[-y-2])/(c[-y-1]-c[-y-2]),s=e+(-y-2)*o):s=e+y*o}var _=a>1?a:2,b=r||new Array(_);for(g=0;g<_;++g)b[g]=void 0===s?NaN:void 0===l?t[s+g]:qe(t[s+g],t[s+o+g],l);return b}function ss(t,e,i,o,n,r){if(i==e)return null;var a;if(n<t[e+o-1])return r?((a=t.slice(e,e+o))[o-1]=n,a):null;if(t[i-1]<n)return r?((a=t.slice(i-o,i))[o-1]=n,a):null;if(n==t[e+o-1])return t.slice(e,e+o);for(var s=e/o,l=i/o;s<l;){var u=s+l>>1;n<t[(u+1)*o-1]?l=u:s=u+1}var p=t[s*o-1];if(n==p)return t.slice((s-1)*o,(s-1)*o+o);var h=(n-p)/(t[(s+1)*o-1]-p);a=[];for(var d=0;d<o-1;++d)a.push(qe(t[(s-1)*o+d],t[s*o+d],h));return a.push(n),a}function ls(t,e,i,o){for(var n=t[e],r=t[e+1],a=0,s=e+o;s<i;s+=o){var l=t[s],u=t[s+1];a+=Math.sqrt((l-n)*(l-n)+(u-r)*(u-r)),n=l,r=u}return a}var us=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ps=function(t){function e(e,i){var o=t.call(this)||this;return o.flatMidpoint_=null,o.flatMidpointRevision_=-1,o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return us(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?wt(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,i,o){return o<to(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Jr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.forEachSegment=function(t){return wa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=Nr&&this.layout!=Br)return null;var i=void 0!==e&&e;return ss(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return as(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return ls(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 i=[];return i.length=ra(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Lr)},e.prototype.getType=function(){return Ro},e.prototype.intersectsExtent=function(t){return Sa(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=oa(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Hr),hs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ds=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.ends_=[],n.maxDelta_=-1,n.maxDeltaRevision_=-1,Array.isArray(e[0]))n.setCoordinates(e,i);else if(void 0!==i&&o)n.setFlatCoordinates(i,e),n.ends_=o;else{for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var h=a[u];0===u&&(r=h.getLayout()),wt(s,h.getFlatCoordinates()),l.push(s.length)}n.setFlatCoordinates(r,s),n.ends_=l}return n}return hs(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?wt(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,i,o){return o<to(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Qr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ea(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.getCoordinateAtM=function(t,e,i){if(this.layout!=Nr&&this.layout!=Br||0===this.flatCoordinates.length)return null;var o=void 0!==e&&e,n=void 0!==i&&i;return function(t,e,i,o,n,r,a){if(a)return ss(t,e,i[i.length-1],o,n,r);var s;if(n<t[o-1])return r?((s=t.slice(0,o))[o-1]=n,s):null;if(t[t.length-1]<n)return r?((s=t.slice(t.length-o))[o-1]=n,s):null;for(var l=0,u=i.length;l<u;++l){var p=i[l];if(e!=p){if(n<t[e+o-1])return null;if(n<=t[p-1])return ss(t,e,p,o,n,!1);e=p}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,o,n)},e.prototype.getCoordinates=function(){return pa(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 ps(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_,i=this.layout,o=[],n=0,r=0,a=e.length;r<a;++r){var s=e[r],l=new ps(t.slice(n,s),i);o.push(l),n=s}return o},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,o=this.ends_,n=this.stride,r=0,a=o.length;r<a;++r){var s=o[r];wt(t,as(e,i,s,n,.5)),i=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=ra(t,e,p,o,n,r,a),s.push(a),e=p}return a}(this.flatCoordinates,0,this.ends_,this.stride,t,i,0,o),new e(i,Lr,o)},e.prototype.getType=function(){return Do},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){if(Sa(t,e,i[r],o,n))return!0;e=i[r]}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 i=na(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Hr),cs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),gs=function(t){function e(e,i){var o=t.call(this)||this;return i&&!Array.isArray(e[0])?o.setFlatCoordinates(i,e):o.setCoordinates(e,i),o}return cs(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?wt(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,i,o){if(o<to(this.getExtent(),t,e))return o;for(var n=this.flatCoordinates,r=this.stride,a=0,s=n.length;a<s;a+=r){var l=Ne(t,e,n[a],n[a+1]);if(l<o){o=l;for(var u=0;u<r;++u)i[u]=n[a+u];i.length=r}}return o},e.prototype.getCoordinates=function(){return ua(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 va(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,i=this.stride,o=[],n=0,r=t.length;n<r;n+=i){var a=new va(t.slice(n,n+i),e);o.push(a)}return o},e.prototype.getType=function(){return jo},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,i=this.stride,o=0,n=e.length;o<n;o+=i){if(oo(t,e[o],e[o+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=oa(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Hr);function fs(t,e,i,o){for(var n=[],r=[1/0,1/0,-1/0,-1/0],a=0,s=i.length;a<s;++a){var l=i[a];r=uo(t,e,l[0],o),n.push((r[0]+r[2])/2,(r[1]+r[3])/2),e=l[l.length-1]}return n}var ms=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),vs=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.endss_=[],n.flatInteriorPointsRevision_=-1,n.flatInteriorPoints_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,!o&&!Array.isArray(e[0])){for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var h=a[u];0===u&&(r=h.getLayout());for(var d=s.length,c=h.getEnds(),g=0,f=c.length;g<f;++g)c[g]+=d;wt(s,h.getFlatCoordinates()),l.push(c)}i=r,e=s,o=l}return void 0!==i&&o?(n.setFlatCoordinates(i,e),n.endss_=o):n.setCoordinates(e,i),n}return ms(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;wt(this.flatCoordinates,t.getFlatCoordinates());for(var o=0,n=(e=t.getEnds().slice()).length;o<n;++o)e[o]+=i}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,i=new Array(t),o=0;o<t;++o)i[o]=this.endss_[o].slice();var n=new e(this.flatCoordinates.slice(),this.layout,i);return n.applyProperties(this),n},e.prototype.closestPointXY=function(t,e,i,o){return o<to(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=Qr(t,e,s,o,n),e=s[s.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,o,n,r,a,s,l,u,p){for(var h=p||[NaN,NaN],d=0,c=i.length;d<c;++d){var g=i[d];u=ea(t,e,g,o,n,r,a,s,l,u,h),e=g[g.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return function(t,e,i,o,n,r){if(0===i.length)return!1;for(var a=0,s=i.length;a<s;++a){var l=i[a];if(ba(t,e,l,o,n,r))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,i,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=ca(t,e,s,o),e=s[s.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Oa(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,ha(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=fs(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=ka(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new gs(this.getFlatInteriorPoints().slice(),Nr)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(!Ta(t,e,s,o,n))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Oa(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l],h=[];a=la(t,e,p,o,n,r,a,h),s.push(h),e=p[p.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,o),new e(i,Lr,o)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var i=this.endss_[t-1];e=i[i.length-1]}var o=this.endss_[t].slice(),n=o[o.length-1];if(0!==e)for(var r=0,a=o.length;r<a;++r)o[r]-=e;return new Ia(this.flatCoordinates.slice(e,n),this.layout,o)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r].slice(),l=s[s.length-1];if(0!==n)for(var u=0,p=s.length;u<p;++u)s[u]-=n;var h=new Ia(e.slice(n,l),t,s);o.push(h),n=l}return o},e.prototype.getType=function(){return Ao},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(Ca(t,e,s,o,n))return!0;e=s[s.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 i=function(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=na(t,e,i[s],o,r[a]);r[a++]=u,e=u[u.length-1]}return r.length=a,r}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var o=i[i.length-1];this.flatCoordinates.length=0===o.length?0:o[o.length-1]}this.changed()},e}(Hr),ys=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var _s=function(t){function e(e){var i=t.call(this)||this;if(i.on,i.once,i.un,i.id_=void 0,i.geometryName_="geometry",i.style_=null,i.styleFunction_=void 0,i.geometryChangeKey_=null,i.addChangeListener(i.geometryName_,i.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var o=e;i.setGeometry(o)}else{var n=e;i.setProperties(n)}return i}return ys(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var o=this.getStyle();return o&&t.setStyle(o),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_&&(Yt(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=Xt(t,jt,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:(je("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}(oe),bs=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var i;if(e){var o=e.dataProjection?Qo(e.dataProjection):this.readProjection(t);e.extent&&o&&o.getUnits()===ki.TILE_PIXELS&&(o=Qo(o)).setWorldExtent(e.extent),i={dataProjection:o,featureProjection:e.featureProjection}}return this.adaptOptions(i)},t.prototype.adaptOptions=function(t){return Tt({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return Jt()},t.prototype.readFeature=function(t,e){return Jt()},t.prototype.readFeatures=function(t,e){return Jt()},t.prototype.readGeometry=function(t,e){return Jt()},t.prototype.readProjection=function(t){return Jt()},t.prototype.writeFeature=function(t,e){return Jt()},t.prototype.writeFeatures=function(t,e){return Jt()},t.prototype.writeGeometry=function(t,e){return Jt()},t}();function xs(t,e,i){var o,n=i?Qo(i.featureProjection):null,r=i?Qo(i.dataProjection):null;if(o=n&&r&&!rn(n,r)?(e?t.clone():t).transform(e?n:r,e?r:n):t,e&&i&&void 0!==i.decimals){var a=Math.pow(10,i.decimals);o===t&&(o=t.clone()),o.applyTransform((function(t){for(var e=0,i=t.length;e<i;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return o}var ks="arraybuffer",ws="json",Ss="text",Cs="xml",zs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Es(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var Ts=function(t){function e(){return t.call(this)||this}return zs(e,t),e.prototype.getType=function(){return ws},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(Es(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(Es(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return Jt()},e.prototype.readFeaturesFromObject=function(t,e){return Jt()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(Es(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return Jt()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(Es(t))},e.prototype.readProjectionFromObject=function(t){return Jt()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return Jt()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return Jt()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return Jt()},e}(bs),Ps=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Os(t,e){if(!t)return null;var i;switch(t.type){case Fo:i=function(t){return new va(t.coordinates)}(t);break;case Ro:i=function(t){return new ps(t.coordinates)}(t);break;case Mo:i=function(t){return new Ia(t.coordinates)}(t);break;case jo:i=function(t){return new gs(t.coordinates)}(t);break;case Do:i=function(t){return new ds(t.coordinates)}(t);break;case Ao:i=function(t){return new vs(t.coordinates)}(t);break;case Lo:i=function(t,e){var i=t.geometries.map((function(t){return Os(t,e)}));return new rs(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return xs(i,!1,e)}function Fs(t,e){var i,o=(t=xs(t,!0,e)).getType();switch(o){case Fo:i=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case Ro:i=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case Mo:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}(t,e);break;case jo:i=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case Do:i=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case Ao:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Lo:i=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var i=Tt({},e);return delete i.featureProjection,Fs(t,i)}))}}(t,e);break;case Go:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+o)}return i}var Rs=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this)||this).dataProjection=Qo(o.dataProjection?o.dataProjection:"EPSG:4326"),o.featureProjection&&(i.defaultFeatureProjection=Qo(o.featureProjection)),i.geometryName_=o.geometryName,i.extractGeometryName_=o.extractGeometryName,i.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],i}return Ps(e,t),e.prototype.readFeatureFromObject=function(t,e){var i=null,o=Os((i="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),n=new _s;return this.geometryName_?n.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&n.setGeometryName(i.geometry_name),n.setGeometry(o),"id"in i&&n.setId(i.id),i.properties&&n.setProperties(i.properties,!0),n},e.prototype.readFeaturesFromObject=function(t,e){var i=null;if("FeatureCollection"===t.type){i=[];for(var o=t.features,n=0,r=o.length;n<r;++n)i.push(this.readFeatureFromObject(o[n],e))}else i=[this.readFeatureFromObject(t,e)];return i},e.prototype.readGeometryFromObject=function(t,e){return Os(t,e)},e.prototype.readProjectionFromObject=function(t){var e,i=t.crs;return i?"name"==i.type?e=Qo(i.properties.name):"EPSG"===i.type?e=Qo("EPSG:"+i.properties.code):je(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={type:"Feature",geometry:null,properties:null},o=t.getId();if(void 0!==o&&(i.id=o),!t.hasProperties())return i;var n=t.getProperties(),r=t.getGeometry();return r&&(i.geometry=Fs(r,e),delete n[t.getGeometryName()]),Ft(n)||(i.properties=n),i},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],o=0,n=t.length;o<n;++o)i.push(this.writeFeatureObject(t[o],e));return{type:"FeatureCollection",features:i}},e.prototype.writeGeometryObject=function(t,e){return Fs(t,this.adaptOptions(e))},e}(Ts),Is=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}(),Ms="fraction",js="pixels",Ds="bottom-left",As="bottom-right",Ls="top-left",Gs="top-right",Ns=0,Bs=1,Vs=2,qs=3,Ws=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Va(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 Jt()},t.prototype.getImage=function(t){return Jt()},t.prototype.getHitDetectionImage=function(){return Jt()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return Jt()},t.prototype.getImageSize=function(){return Jt()},t.prototype.getOrigin=function(){return Jt()},t.prototype.getSize=function(){return Jt()},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_=Va(t)},t.prototype.listenImageChange=function(t){Jt()},t.prototype.load=function(){Jt()},t.prototype.unlistenImageChange=function(t){Jt()},t}(),Us=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Xs=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=o,r.resolution=i,r.state=n,r}return Us(e,t),e.prototype.changed=function(){this.dispatchEvent(jt)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return Jt()},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(){Jt()},e}(Mt),Ks=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Ys(t,e,i){var o=t;if(o.src&&ce){var n=o.decode(),r=!0;return n.then((function(){r&&e()})).catch((function(t){r&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){r=!1}}var a=[Kt(o,Vt,e),Kt(o,Dt,i)];return function(){a.forEach(Yt)}}!function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,o,Ns)||this;return s.src_=n,s.image_=new Image,null!==r&&(s.image_.crossOrigin=r),s.unlisten_=null,s.state=Ns,s.imageLoadFunction_=a,s}Ks(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=qs,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=wo(this.extent)/this.image_.height),this.state=Vs,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Ns&&this.state!=qs||(this.state=Bs,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Ys(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=wo(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Xs);var Zs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Hs=null,$s=function(t){function e(e,i,o,n,r,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==n&&(s.image_.crossOrigin=n),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=r,s.size_=o,s.src_=i,s.tainted_,s}return Zs(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Vs){Hs||(Hs=fe(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(jt)},e.prototype.handleImageError_=function(){this.imageState_=qs,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Vs,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],i=fe(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Ns){this.imageState_=Bs;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Ys(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===Vs){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply","multiply"===i.globalCompositeOperation||this.isTainted_())i.fillStyle=Tn(this.color_),i.fillRect(0,0,e.width/t,e.height/t),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var o=i.getImageData(0,0,e.width,e.height),n=o.data,r=this.color_[0]/255,a=this.color_[1]/255,s=this.color_[2]/255,l=this.color_[3],u=0,p=n.length;u<p;u+=4)n[u]*=r,n[u+1]*=a,n[u+2]*=s,n[u+3]*=l;i.putImageData(o,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Mt);var Js=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Qs=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.opacity?o.opacity:1,r=void 0!==o.rotation?o.rotation:0,a=void 0!==o.scale?o.scale:1,s=void 0!==o.rotateWithView&&o.rotateWithView;(i=t.call(this,{opacity:n,rotation:r,scale:a,displacement:void 0!==o.displacement?o.displacement:[0,0],rotateWithView:s})||this).anchor_=void 0!==o.anchor?o.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=void 0!==o.anchorOrigin?o.anchorOrigin:Ls,i.anchorXUnits_=void 0!==o.anchorXUnits?o.anchorXUnits:Ms,i.anchorYUnits_=void 0!==o.anchorYUnits?o.anchorYUnits:Ms,i.crossOrigin_=void 0!==o.crossOrigin?o.crossOrigin:null;var l=void 0!==o.img?o.img:null,u=void 0!==o.imgSize?o.imgSize:null,p=o.src;je(!(void 0!==p&&l),4),je(!l||l&&u,5),void 0!==p&&0!==p.length||!l||(p=l.src||te(l)),je(void 0!==p&&p.length>0,6);var h=void 0!==o.src?Ns:Vs;return i.color_=void 0!==o.color?Rn(o.color):null,i.iconImage_=function(t,e,i,o,n,r){var a=Dn.get(e,o,r);return a||(a=new $s(t,e,i,o,n,r),Dn.set(e,o,r,a)),a}(l,p,u,i.crossOrigin_,h,i.color_),i.offset_=void 0!==o.offset?o.offset:[0,0],i.offsetOrigin_=void 0!==o.offsetOrigin?o.offsetOrigin:Ls,i.origin_=null,i.size_=void 0!==o.size?o.size:null,i}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_==Ms||this.anchorYUnits_==Ms){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Ms&&(t[0]*=e[0]),this.anchorYUnits_==Ms&&(t[1]*=e[1])}if(this.anchorOrigin_!=Ls){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Gs&&this.anchorOrigin_!=As||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Ds&&this.anchorOrigin_!=As||(t[1]=-t[1]+e[1])}var i=this.getDisplacement();return t[0]-=i[0],t[1]+=i[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_!=Ls){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=Gs&&this.offsetOrigin_!=As||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=Ds&&this.offsetOrigin_!=As||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(jt,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(jt,t)},e}(Ws),tl=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}();function el(t){return Array.isArray(t)?Mn(t):t}var il=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ol=function(t){function e(e){var i=this,o=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:o,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_=void 0,i.hitDetectionCanvas_=null,i.fill_=void 0!==e.fill?e.fill:null,i.origin_=[0,0],i.points_=e.points,i.radius_=void 0!==e.radius?e.radius:e.radius1,i.radius2_=e.radius2,i.angle_=void 0!==e.angle?e.angle:0,i.stroke_=void 0!==e.stroke?e.stroke:null,i.anchor_=null,i.size_=null,i.renderOptions_=null,i.render(),i}return il(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.getAnchor=function(){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 i=this.renderOptions_,o=fe(i.size*t,i.size*t);this.draw_(i,o,t),e=o.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 Vs},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,i){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var o=this.radius_,n=void 0===this.radius2_?o:this.radius2_;if(o<n){var r=o;o=n,n=r}var a=void 0===this.radius2_?this.points_:2*this.points_,s=2*Math.PI/a,l=n*Math.sin(s),u=o-Math.sqrt(n*n-l*l),p=Math.sqrt(l*l+u*u),h=p/l;if("miter"===t&&h<=i)return h*e;var d=e/2/h,c=e/2*(u/p),g=Math.sqrt((o+d)*(o+d)+c*c)-o;if(void 0===this.radius2_||"bevel"===t)return 2*g;var f=o*Math.sin(s),m=n-Math.sqrt(o*o-f*f),v=Math.sqrt(f*f+m*m)/f;if(v<=i){var y=v*e/2-n-o;return 2*Math.max(g,y)}return 2*g},e.prototype.createRenderOptions=function(){var t,e="round",i=0,o=null,n=0,r=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t="#000"),t=el(t),void 0===(r=this.stroke_.getWidth())&&(r=1),o=this.stroke_.getLineDash(),n=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e="round"),void 0===(i=this.stroke_.getMiterLimit())&&(i=10));var a=this.calculateLineJoinSize_(e,r,i),s=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:r,size:Math.ceil(2*s+a),lineDash:o,lineDashOffset:n,lineJoin:e,miterLimit:i}},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,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var o=this.fill_.getColor();null===o&&(o="#000"),e.fillStyle=el(o),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),i=0;if("string"==typeof e&&(e=Rn(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var o=fe(t.size,t.size);this.hitDetectionCanvas_=o.canvas,this.drawHitDetectionCanvas_(t,o)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,i=this.radius_;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{var o=void 0===this.radius2_?i:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var n=this.angle_-Math.PI/2,r=2*Math.PI/e,a=0;a<e;a++){var s=n+a*r,l=a%2==0?i:o;t.lineTo(l*Math.cos(s),l*Math.sin(s))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle="#000",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}(Ws),nl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),rl=function(t){function e(e){var i=e||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,scale:void 0!==i.scale?i.scale:1,rotation:void 0!==i.rotation?i.rotation:0,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this}return nl(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(ol),al=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=pl,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=pl,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var sl=null;function ll(t,e){if(!sl){var i=new Is({color:"rgba(255,255,255,0.4)"}),o=new tl({color:"#3399CC",width:1.25});sl=[new al({image:new rl({fill:i,stroke:o,radius:5}),fill:i,stroke:o})]}return sl}function ul(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t[Mo]=[new al({fill:new Is({color:[255,255,255,.5]})})],t[Ao]=t[Mo],t[Ro]=[new al({stroke:new tl({color:e,width:5})}),new al({stroke:new tl({color:i,width:3})})],t[Do]=t[Ro],t[Go]=t[Mo].concat(t[Ro]),t[Fo]=[new al({image:new rl({radius:6,fill:new Is({color:i}),stroke:new tl({color:e,width:1.5})}),zIndex:1/0})],t[jo]=t[Fo],t[Lo]=t[Mo].concat(t[Ro],t[Fo]),t}function pl(t){return t.getGeometry()}var hl=al,dl="point",cl="line",gl=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=Va(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Is({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:dl,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Va(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}();function fl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ml={
34
34
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
35
- read:function(t,e,i,o,n){var r,a,s=8*n-o-1,l=(1<<s)-1,u=l>>1,p=-7,h=i?n-1:0,d=i?-1:1,c=t[e+h];for(h+=d,r=c&(1<<-p)-1,c>>=-p,p+=s;p>0;r=256*r+t[e+h],h+=d,p-=8);for(a=r&(1<<-p)-1,r>>=-p,p+=o;p>0;a=256*a+t[e+h],h+=d,p-=8);if(0===r)r=1-u;else{if(r===l)return a?NaN:1/0*(c?-1:1);a+=Math.pow(2,o),r-=u}return(c?-1:1)*a*Math.pow(2,r-o)},write:function(t,e,i,o,n,r){var a,s,l,u=8*r-n-1,p=(1<<u)-1,h=p>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,c=o?0:r-1,g=o?1:-1,f=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=p?(s=0,a=p):a+h>=1?(s=(e*l-1)*Math.pow(2,n),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[i+c]=255&s,c+=g,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;t[i+c]=255&a,c+=g,a/=256,u-=8);t[i+c-g]|=128*f}},gl=ml,fl=cl;function ml(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}ml.Varint=0,ml.Fixed64=1,ml.Bytes=2,ml.Fixed32=5;var vl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function yl(t){return t.type===ml.Bytes?t.readVarint()+t.pos:t.pos+1}function _l(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function bl(t,e,i){var o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(o);for(var n=i.pos-1;n>=t;n--)i.buf[n+o]=i.buf[n]}function xl(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function kl(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function wl(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Sl(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Cl(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function zl(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function El(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Tl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Pl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Ol(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Fl(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Rl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}ml.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var o=this.readVarint(),n=o>>3,r=this.pos;this.type=7&o,t(n,e,this),this.pos===r&&this.skip(o)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Ol(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Rl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Ol(this.buf,this.pos)+4294967296*Ol(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Ol(this.buf,this.pos)+4294967296*Rl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=fl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=fl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,o=this.buf;return e=127&(i=o[this.pos++]),i<128?e:(e|=(127&(i=o[this.pos++]))<<7,i<128?e:(e|=(127&(i=o[this.pos++]))<<14,i<128?e:(e|=(127&(i=o[this.pos++]))<<21,i<128?e:function(t,e,i){var o,n,r=i.buf;if(n=r[i.pos++],o=(112&n)>>4,n<128)return _l(t,o,e);if(n=r[i.pos++],o|=(127&n)<<3,n<128)return _l(t,o,e);if(n=r[i.pos++],o|=(127&n)<<10,n<128)return _l(t,o,e);if(n=r[i.pos++],o|=(127&n)<<17,n<128)return _l(t,o,e);if(n=r[i.pos++],o|=(127&n)<<24,n<128)return _l(t,o,e);if(n=r[i.pos++],o|=(1&n)<<31,n<128)return _l(t,o,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=o[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&vl?function(t,e,i){return vl.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var o="",n=e;for(;n<i;){var r,a,s,l=t[n],u=null,p=l>239?4:l>223?3:l>191?2:1;if(n+p>i)break;1===p?l<128&&(u=l):2===p?128==(192&(r=t[n+1]))&&(u=(31&l)<<6|63&r)<=127&&(u=null):3===p?(r=t[n+1],a=t[n+2],128==(192&r)&&128==(192&a)&&((u=(15&l)<<12|(63&r)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===p&&(r=t[n+1],a=t[n+2],s=t[n+3],128==(192&r)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&r)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,p=1):u>65535&&(u-=65536,o+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),o+=String.fromCharCode(u),n+=p}return o}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==ml.Bytes)return t.push(this.readVarint(e));var i=yl(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==ml.Bytes)return t.push(this.readSVarint());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==ml.Bytes)return t.push(this.readBoolean());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==ml.Bytes)return t.push(this.readFloat());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==ml.Bytes)return t.push(this.readDouble());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==ml.Bytes)return t.push(this.readFixed32());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==ml.Bytes)return t.push(this.readSFixed32());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==ml.Bytes)return t.push(this.readFixed64());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==ml.Bytes)return t.push(this.readSFixed64());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===ml.Varint)for(;this.buf[this.pos++]>127;);else if(e===ml.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ml.Fixed32)this.pos+=4;else{if(e!==ml.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Fl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Fl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Fl(this.buf,-1&t,this.pos),Fl(this.buf,Math.floor(2.3283064365386963e-10*t),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Fl(this.buf,-1&t,this.pos),Fl(this.buf,Math.floor(2.3283064365386963e-10*t),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,o;t>=0?(i=t%4294967296|0,o=t/4294967296|0):(o=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,o=o+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,e),function(t,e){var i=(7&t)<<4;if(e.buf[e.pos++]|=i|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(o,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var o,n,r=0;r<e.length;r++){if((o=e.charCodeAt(r))>55295&&o<57344){if(!n){o>56319||r+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=o;continue}if(o<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=o;continue}o=n-55296<<10|o-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);o<128?t[i++]=o:(o<2048?t[i++]=o>>6|192:(o<65536?t[i++]=o>>12|224:(t[i++]=o>>18|240,t[i++]=o>>12&63|128),t[i++]=o>>6&63|128),t[i++]=63&o|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&bl(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),fl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),fl.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var o=this.pos-i;o>=128&&bl(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o},writeMessage:function(t,e,i){this.writeTag(t,ml.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,xl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,kl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Cl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,wl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Sl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,zl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,El,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Tl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Pl,e)},writeBytesField:function(t,e){this.writeTag(t,ml.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ml.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ml.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ml.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ml.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ml.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ml.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ml.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ml.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ml.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Il=[1,0,0,1,0,0],Ml=function(){function t(t,e,i,o,n){this.extent_,this.id_=n,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=o}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Fo?lo(this.flatCoordinates_):uo(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=bo(this.getExtent());this.flatInteriorPoints_=xa(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=bs(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=ka(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=hs(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,i=this.ends_,o=0,n=i.length;o<n;++o){var r=i[o],a=hs(t,e,r,2,.5);wt(this.flatMidpoints_,a),e=r}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=Qo(t)).getExtent(),i=t.getWorldExtent();if(e&&i){var o=wo(i)/wo(e);wn(Il,i[0],i[3],o,-o,0,0,0),Vr(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Il,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();Ml.prototype.getEndss=Ml.prototype.getEnds,Ml.prototype.getFlatCoordinates=Ml.prototype.getOrientedFlatCoordinates;var jl=Ml,Dl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Al(t,e,i){if(3===t){var o={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(Ll,o,n),o.length=o.features.length,o.length&&(e[o.name]=o)}}function Ll(t,e,i){if(15===t)e.version=i.readVarint();else if(1===t)e.name=i.readString();else if(5===t)e.extent=i.readVarint();else if(2===t)e.features.push(i.pos);else if(3===t)e.keys.push(i.readString());else if(4===t){for(var o=null,n=i.readVarint()+i.pos;i.pos<n;)o=1===(t=i.readVarint()>>3)?i.readString():2===t?i.readFloat():3===t?i.readDouble():4===t?i.readVarint64():5===t?i.readVarint():6===t?i.readSVarint():7===t?i.readBoolean():null;e.values.push(o)}}function Gl(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var o=i.readVarint()+i.pos;i.pos<o;){var n=e.layer.keys[i.readVarint()],r=e.layer.values[i.readVarint()];e.properties[n]=r}else 3==t?e.type=i.readVarint():4==t&&(e.geometry=i.pos)}function Nl(t,e,i){t.pos=e.features[i];var o=t.readVarint()+t.pos,n={layer:e,type:0,properties:{}};return t.readFields(Gl,n,o),n}var Bl=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.dataProjection=new wi({code:"",units:ki.TILE_PIXELS}),i.featureClass_=o.featureClass?o.featureClass:jl,i.geometryName_=o.geometryName,i.layerName_=o.layerName?o.layerName:"layer",i.layers_=o.layers?o.layers:null,i.idProperty_=o.idProperty,i.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],i}return Dl(e,t),e.prototype.readRawGeometry_=function(t,e,i,o){t.pos=e.geometry;for(var n=t.readVarint()+t.pos,r=1,a=0,s=0,l=0,u=0,p=0;t.pos<n;){if(!a){var h=t.readVarint();r=7&h,a=h>>3}a--,1===r||2===r?(s+=t.readSVarint(),l+=t.readSVarint(),1===r&&u>p&&(o.push(u),p=u),i.push(s,l),u+=2):7===r?u>p&&(i.push(i[p],i[p+1]),u+=2):je(!1,59)}u>p&&(o.push(u),p=u)},e.prototype.createFeature_=function(t,e,i){var o,n=e.type;if(0===n)return null;var r,a=e.properties;this.idProperty_?(r=a[this.idProperty_],delete a[this.idProperty_]):r=e.id,a[this.layerName_]=e.layer.name;var s=[],l=[];this.readRawGeometry_(t,e,s,l);var u=function(t,e){var i;1===t?i=1===e?Fo:jo:2===t?i=1===e?Ro:Do:3===t&&(i=Mo);return i}(n,l.length);if(this.featureClass_===jl)(o=new this.featureClass_(u,s,l,a,r)).transform(i.dataProjection);else{var p=void 0;if(u==Mo){for(var h=[],d=0,c=0,g=0,f=l.length;g<f;++g){var m=l[g];if(Ea(s,d,m,2)){if(0===h.length)continue;h[h.length-1].push(l[c])}else h.push(l.slice(c,g+1));c=g+1,d=m}p=h.length>1?new ks(s,Lr,h):new Ia(s,Lr,l)}else p=u===Fo?new va(s,Lr):u===Ro?new fs(s,Lr):u===Mo?new Ia(s,Lr,l):u===jo?new _s(s,Lr):u===Do?new vs(s,Lr,l):null;o=new(0,this.featureClass_),this.geometryName_&&o.setGeometryName(this.geometryName_);var v=os(p,!1,i);o.setGeometry(v),o.setId(r),o.setProperties(a,!0)}return o},e.prototype.getType=function(){return ns},e.prototype.readFeatures=function(t,e){var i=this.layers_,o=this.adaptOptions(e),n=Qo(o.dataProjection);n.setWorldExtent(o.extent),o.dataProjection=n;var r=new gl(t),a=r.readFields(Al,{}),s=[];for(var l in a)if(!i||-1!=i.indexOf(l)){var u=a[l],p=u?[0,0,u.extent,u.extent]:null;n.setExtent(p);for(var h=0,d=u.length;h<d;++h){var c=Nl(r,u,h);s.push(this.createFeature_(r,c,o))}}return s},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(is),Vl="active",ql=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Wl(t,e,i,o){var n=t.getZoom();if(void 0!==n){var r=t.getConstrainedZoom(n+e),a=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:i,duration:void 0!==o?o:250,easing:hi})}}var Ul=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return ql(e,t),e.prototype.getActive=function(){return this.get(Vl)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Vl,t)},e.prototype.setMap=function(t){this.map_=t},e}(oe),Xl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Kl=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:250,i}return Xl(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==gr.DBLCLICK){var i=t.originalEvent,o=t.map,n=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;Wl(o.getView(),r,n,this.duration_),i.preventDefault(),e=!0}return!e},e}(Ul),Yl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Zl(t){for(var e=t.length,i=0,o=0,n=0;n<e;n++)i+=t[n].clientX,o+=t[n].clientY;return[i/e,o/e]}var Hl=function(t){function e(e){var i=this,o=e||{};return i=t.call(this,o)||this,o.handleDownEvent&&(i.handleDownEvent=o.handleDownEvent),o.handleDragEvent&&(i.handleDragEvent=o.handleDragEvent),o.handleMoveEvent&&(i.handleMoveEvent=o.handleMoveEvent),o.handleUpEvent&&(i.handleUpEvent=o.handleUpEvent),o.stopDown&&(i.stopDown=o.stopDown),i.handlingDownUpSequence=!1,i.trackedPointers_={},i.targetPointers=[],i}return Yl(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==gr.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==gr.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==gr.POINTERDOWN){var o=this.handleDownEvent(t);this.handlingDownUpSequence=o,e=this.stopDown(o)}else t.type==gr.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===gr.POINTERDOWN||e===gr.POINTERDRAG||e===gr.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==gr.POINTERUP?delete this.trackedPointers_[i]:(t.type==gr.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=Ot(this.trackedPointers_)}},e}(Ul);function $l(t){var e=arguments;return function(t){for(var i=!0,o=0,n=e.length;o<n&&(i=i&&e[o](t));++o);return i}}var Jl=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Ql=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},tu=Ct,eu=function(t){var e=t.originalEvent;return 0==e.button&&!(ue&&pe&&e.ctrlKey)},iu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},ou=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},nu=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},ru=function(t){var e=t.originalEvent;return je(void 0!==e,56),"mouse"==e.pointerType},au=function(t){var e=t.originalEvent;return je(void 0!==e,56),e.isPrimary&&0===e.button},su=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),lu=function(t){function e(e){var i=t.call(this,{stopDown:zt})||this,o=e||{};i.kinetic_=o.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var n=o.condition?o.condition:$l(iu,au);return i.condition_=o.onFocusOnly?$l(Ql,n):n,i.noKinetic_=!1,i}return su(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e,i,o=this.targetPointers,n=Zl(o);if(o.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var r=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],a=t.map.getView();e=r,i=a.getResolution(),e[0]*=i,e[1]*=i,Uo(r,a.getRotation()),a.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=o.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var o=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),r=i.getCenterInternal(),a=e.getPixelFromCoordinateInternal(r),s=e.getCoordinateFromPixelInternal([a[0]-o*Math.cos(n),a[1]-o*Math.sin(n)]);i.animateInternal({center:i.getConstrainedCenter(s),duration:500,easing:hi})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Hl),uu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),pu=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this,{stopDown:zt})||this).condition_=o.condition?o.condition:Jl,i.lastAngle_=void 0,i.duration_=void 0!==o.duration?o.duration:250,i}return uu(e,t),e.prototype.handleDragEvent=function(t){if(ru(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Dr){var o=e.getSize(),n=t.pixel,r=Math.atan2(o[1]/2-n[1],n[0]-o[0]/2);if(void 0!==this.lastAngle_){var a=r-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!ru(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!ru(t)&&(!(!eu(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(Hl),hu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),du=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return hu(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",o=this.element_.style;o.left=Math.min(t[0],e[0])+i,o.top=Math.min(t[1],e[1])+i,o.width=Math.abs(e[0]-t[0])+i,o.height=Math.abs(e[1]-t[1])+i},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new Ia([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(_t),cu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),gu="boxstart",fu="boxdrag",mu="boxend",vu="boxcancel",yu=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.coordinate=i,n.mapBrowserEvent=o,n}return cu(e,t),e}(vt),_u=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=e||{};return i.box_=new du(o.className||"ol-dragbox"),i.minArea_=void 0!==o.minArea?o.minArea:64,o.onBoxEnd&&(i.onBoxEnd=o.onBoxEnd),i.startPixel_=null,i.condition_=o.condition?o.condition:eu,i.boxEndCondition_=o.boxEndCondition?o.boxEndCondition:i.defaultBoxEndCondition,i}return cu(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var o=i[0]-e[0],n=i[1]-e[1];return o*o+n*n>=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 yu(fu,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 yu(e?mu:vu,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 yu(gu,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Hl),bu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xu=function(t){function e(e){var i=this,o=e||{},n=o.condition?o.condition:ou;return(i=t.call(this,{condition:n,className:o.className||"ol-dragzoom",minArea:o.minArea})||this).duration_=void 0!==o.duration?o.duration:200,i.out_=void 0!==o.out&&o.out,i}return bu(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),i=this.getGeometry();if(this.out_){var o=e.rotatedExtentForGeometry(i),n=e.getResolutionForExtentInternal(o),r=e.getResolution()/n;(i=i.clone()).scale(r*r)}e.fitInternal(i,{duration:this.duration_,easing:hi})},e}(_u),ku=37,wu=38,Su=39,Cu=40,zu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Eu=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.defaultCondition_=function(t){return iu(t)&&nu(t)},i.condition_=void 0!==o.condition?o.condition:i.defaultCondition_,i.duration_=void 0!==o.duration?o.duration:100,i.pixelDelta_=void 0!==o.pixelDelta?o.pixelDelta:128,i}return zu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Nt){var i=t.originalEvent,o=i.keyCode;if(this.condition_(t)&&(o==Cu||o==ku||o==Su||o==wu)){var n=t.map.getView(),r=n.getResolution()*this.pixelDelta_,a=0,s=0;o==Cu?s=-r:o==ku?a=-r:o==Su?a=r:s=r;var l=[a,s];Uo(l,n.getRotation()),function(t,e,i){var o=t.getCenterInternal();if(o){var n=[o[0]+e[0],o[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:ci,center:t.getConstrainedCenter(n)})}}(n,l,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Ul),Tu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Pu=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.condition_=o.condition?o.condition:nu,i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:100,i}return Tu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Nt||t.type==Bt){var i=t.originalEvent,o=i.charCode;if(this.condition_(t)&&(o=="+".charCodeAt(0)||o=="-".charCodeAt(0))){var n=t.map,r=o=="+".charCodeAt(0)?this.delta_:-this.delta_;Wl(n.getView(),r,void 0,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Ul),Ou=function(){function t(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var i=e-3;i>0&&this.points_[i+2]>t;)i-=3;var o=this.points_[e+2]-this.points_[i+2];if(o<1e3/60)return!1;var n=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,n),this.initialVelocity_=Math.sqrt(n*n+r*r)/o,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),Fu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ru="trackpad",Iu="wheel",Mu=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,o)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==o.maxDelta?o.maxDelta:1,i.duration_=void 0!==o.duration?o.duration:250,i.timeout_=void 0!==o.timeout?o.timeout:80,i.useAnchor_=void 0===o.useAnchor||o.useAnchor,i.constrainResolution_=void 0!==o.constrainResolution&&o.constrainResolution;var n=o.condition?o.condition:tu;return i.condition_=o.onFocusOnly?$l(Ql,n):n,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return Fu(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!==Ut)return!0;var e,i=t.map,o=t.originalEvent;if(o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==Ut&&(e=o.deltaY,le&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=he),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var n=Date.now();void 0===this.startTime_&&(this.startTime_=n),(!this.mode_||n-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Ru:Iu);var r=i.getView();if(this.mode_===Ru&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=n,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(n-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-De(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Wl(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Ul),ju=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Du=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=zt),(i=t.call(this,n)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==o.threshold?o.threshold:.3,i.duration_=void 0!==o.duration?o.duration:250,i}return ju(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],o=this.targetPointers[1],n=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(void 0!==this.lastAngle_){var r=n-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=n;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==Dr){var l=a.getViewport().getBoundingClientRect(),u=Zl(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(u),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Hl),Au=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Lu=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=zt),(i=t.call(this,n)||this).anchor_=null,i.duration_=void 0!==o.duration?o.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return Au(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],o=this.targetPointers[1],n=i.clientX-o.clientX,r=i.clientY-o.clientY,a=Math.sqrt(n*n+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,l=s.getView();1!=e&&(this.lastScaleDelta_=e);var u=s.getViewport().getBoundingClientRect(),p=Zl(this.targetPointers);p[0]-=u.left,p[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(p),s.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Hl),Gu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Nu=function(t){function e(e,i,o){var n=t.call(this)||this;if(void 0!==o&&void 0===i)n.setFlatCoordinates(o,e);else{var r=i||0;n.setCenterAndRadius(e,r,o)}return n}return Gu(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){var n=this.flatCoordinates,r=t-n[0],a=e-n[1],s=r*r+a*a;if(s<o){if(0===s)for(var l=0;l<this.stride;++l)i[l]=n[l];else{var u=this.getRadius()/Math.sqrt(s);i[0]=n[0]+u*r,i[1]=n[1]+u*a;for(l=2;l<this.stride;++l)i[l]=n[l]}return i.length=this.stride,s}return o},e.prototype.containsXY=function(t,e){var i=this.flatCoordinates,o=t-i[0],n=e-i[1];return o*o+n*n<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,i=e[this.stride]-e[0];return ao(e[0]-i,e[1]-i,e[0]+i,e[1]+i,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return Go},e.prototype.intersectsExtent=function(t){if(To(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||mo(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],o=t.slice();o[e]=o[0]+i;for(var n=1;n<e;++n)o[e+n]=t[n];this.setFlatCoordinates(this.layout,o),this.changed()},e.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var o=this.flatCoordinates,n=ia(o,0,t,this.stride);o[n++]=o[0]+e;for(var r=1,a=this.stride;r<a;++r)o[n++]=o[r];o.length=n,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var i=this.getCenter(),o=this.getStride();this.setCenter(qr(i,0,i.length,o,t,e,i)),this.changed()},e.prototype.translate=function(t,e){var i=this.getCenter(),o=this.getStride();this.setCenter(Wr(i,0,i.length,o,t,e,i)),this.changed()},e}(Hr);Nu.prototype.transform;var Bu=Nu;function Vu(t,e,i,o,n){qu(t,e,i||0,o||t.length-1,n||Uu)}function qu(t,e,i,o,n){for(;o>i;){if(o-i>600){var r=o-i+1,a=e-i+1,s=Math.log(r),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(r-l)/r)*(a-r/2<0?-1:1);qu(t,e,Math.max(i,Math.floor(e-a*l/r+u)),Math.min(o,Math.floor(e+(r-a)*l/r+u)),n)}var p=t[e],h=i,d=o;for(Wu(t,i,e),n(t[o],p)>0&&Wu(t,i,o);h<d;){for(Wu(t,h,d),h++,d--;n(t[h],p)<0;)h++;for(;n(t[d],p)>0;)d--}0===n(t[i],p)?Wu(t,i,d):Wu(t,++d,o),d<=e&&(i=d+1),e<=d&&(o=d-1)}}function Wu(t,e,i){var o=t[e];t[e]=t[i],t[i]=o}function Uu(t,e){return t<e?-1:t>e?1:0}class Xu{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!op(t,e))return i;const o=this.toBBox,n=[];for(;e;){for(let r=0;r<e.children.length;r++){const a=e.children[r],s=e.leaf?o(a):a;op(t,s)&&(e.leaf?i.push(a):ip(t,s)?this._all(a,i):n.push(a))}e=n.pop()}return i}collides(t){let e=this.data;if(!op(t,e))return!1;const i=[];for(;e;){for(let o=0;o<e.children.length;o++){const n=e.children[o],r=e.leaf?this.toBBox(n):n;if(op(t,r)){if(e.leaf||ip(t,r))return!0;i.push(n)}}e=i.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=np([]),this}remove(t,e){if(!t)return this;let i=this.data;const o=this.toBBox(t),n=[],r=[];let a,s,l;for(;i||n.length;){if(i||(i=n.pop(),s=n[n.length-1],a=r.pop(),l=!0),i.leaf){const o=Ku(t,i.children,e);if(-1!==o)return i.children.splice(o,1),n.push(i),this._condense(n),this}l||i.leaf||!ip(i,o)?s?(a++,i=s.children[a],l=!1):i=null:(n.push(i),r.push(a),a=0,s=i,i=i.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,o){const n=i-e+1;let r,a=this._maxEntries;if(n<=a)return r=np(t.slice(e,i+1)),Yu(r,this.toBBox),r;o||(o=Math.ceil(Math.log(n)/Math.log(a)),a=Math.ceil(n/Math.pow(a,o-1))),r=np([]),r.leaf=!1,r.height=o;const s=Math.ceil(n/a),l=s*Math.ceil(Math.sqrt(a));rp(t,e,i,l,this.compareMinX);for(let u=e;u<=i;u+=l){const e=Math.min(u+l-1,i);rp(t,u,e,s,this.compareMinY);for(let i=u;i<=e;i+=s){const n=Math.min(i+s-1,e);r.children.push(this._build(t,i,n,o-1))}}return Yu(r,this.toBBox),r}_chooseSubtree(t,e,i,o){for(;o.push(e),!e.leaf&&o.length-1!==i;){let i,o=1/0,a=1/0;for(let s=0;s<e.children.length;s++){const l=e.children[s],u=Qu(l),p=(n=t,r=l,(Math.max(r.maxX,n.maxX)-Math.min(r.minX,n.minX))*(Math.max(r.maxY,n.maxY)-Math.min(r.minY,n.minY))-u);p<a?(a=p,o=u<o?u:o,i=l):p===a&&u<o&&(o=u,i=l)}e=i||e.children[0]}var n,r;return e}_insert(t,e,i){const o=i?t:this.toBBox(t),n=[],r=this._chooseSubtree(o,this.data,e,n);for(r.children.push(t),Hu(r,o);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(o,n,e)}_split(t,e){const i=t[e],o=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,o);const r=this._chooseSplitIndex(i,n,o),a=np(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,Yu(i,this.toBBox),Yu(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=np([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Yu(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let o,n=1/0,r=1/0;for(let a=e;a<=i-e;a++){const e=Zu(t,0,a,this.toBBox),s=Zu(t,a,i,this.toBBox),l=ep(e,s),u=Qu(e)+Qu(s);l<n?(n=l,o=a,r=u<r?u:r):l===n&&u<r&&(r=u,o=a)}return o||i-e}_chooseSplitAxis(t,e,i){const o=t.leaf?this.compareMinX:$u,n=t.leaf?this.compareMinY:Ju;this._allDistMargin(t,e,i,o)<this._allDistMargin(t,e,i,n)&&t.children.sort(o)}_allDistMargin(t,e,i,o){t.children.sort(o);const n=this.toBBox,r=Zu(t,0,e,n),a=Zu(t,i-e,i,n);let s=tp(r)+tp(a);for(let l=e;l<i-e;l++){const e=t.children[l];Hu(r,t.leaf?n(e):e),s+=tp(r)}for(let l=i-e-1;l>=e;l--){const e=t.children[l];Hu(a,t.leaf?n(e):e),s+=tp(a)}return s}_adjustParentBBoxes(t,e,i){for(let o=i;o>=0;o--)Hu(e[o],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children,e.splice(e.indexOf(t[i]),1)):this.clear():Yu(t[i],this.toBBox)}}function Ku(t,e,i){if(!i)return e.indexOf(t);for(let o=0;o<e.length;o++)if(i(t,e[o]))return o;return-1}function Yu(t,e){Zu(t,0,t.children.length,e,t)}function Zu(t,e,i,o,n){n||(n=np(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r=e;r<i;r++){const e=t.children[r];Hu(n,t.leaf?o(e):e)}return n}function Hu(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 $u(t,e){return t.minX-e.minX}function Ju(t,e){return t.minY-e.minY}function Qu(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function tp(t){return t.maxX-t.minX+(t.maxY-t.minY)}function ep(t,e){const i=Math.max(t.minX,e.minX),o=Math.max(t.minY,e.minY),n=Math.min(t.maxX,e.maxX),r=Math.min(t.maxY,e.maxY);return Math.max(0,n-i)*Math.max(0,r-o)}function ip(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function op(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function np(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function rp(t,e,i,o,n){const r=[e,i];for(;r.length;){if((i=r.pop())-(e=r.pop())<=o)continue;const a=e+Math.ceil((i-e)/o/2)*o;Vu(t,a,e,i,n),r.push(e,a,a,i)}}var ap=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),sp="renderOrder",lp=function(t){function e(e){var i=this,o=e||{},n=Tt({},o);return delete n.style,delete n.renderBuffer,delete n.updateWhileAnimating,delete n.updateWhileInteracting,(i=t.call(this,n)||this).declutter_=void 0!==o.declutter&&o.declutter,i.renderBuffer_=void 0!==o.renderBuffer?o.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(o.style),i.updateWhileAnimating_=void 0!==o.updateWhileAnimating&&o.updateWhileAnimating,i.updateWhileInteracting_=void 0!==o.updateWhileInteracting&&o.updateWhileInteracting,i}return ap(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(sp)},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 Xu(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(sp,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:rl,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;Array.isArray(t)?i=t:(je("function"==typeof t.getZIndex,41),i=[t]),e=function(){return i}}return e}(this.style_),this.changed()},e}(ei),up={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},pp=[up.FILL],hp=[up.STROKE],dp=[up.BEGIN_PATH],cp=[up.CLOSE_PATH],gp=up,fp=function(){function t(){}return t.prototype.drawCustom=function(t,e,i,o){},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}(),mp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),vp=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.tolerance=e,r.maxExtent=i,r.pixelRatio=n,r.maxLineWidth=0,r.resolution=o,r.beginGeometryInstruction1_=null,r.beginGeometryInstruction2_=null,r.bufferedMaxExtent_=null,r.instructions=[],r.coordinates=[],r.tmpCoordinate_=[],r.hitDetectionInstructions=[],r.state={},r}return mp(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var i=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,n=this.coordinates,r=n.length,a=0,s=t.length;a<s;a+=e)o[0]=t[a],o[1]=t[a+1],eo(i,o)&&(n[r++]=o[0],n[r++]=o[1]);return r},e.prototype.appendFlatLineCoordinates=function(t,e,i,o,n,r){var a=this.coordinates,s=a.length,l=this.getBufferedMaxExtent();r&&(e+=o);var u,p,h,d=t[e],c=t[e+1],g=this.tmpCoordinate_,f=!0;for(u=e+o;u<i;u+=o)g[0]=t[u],g[1]=t[u+1],(h=no(l,g))!==p?(f&&(a[s++]=d,a[s++]=c,f=!1),a[s++]=g[0],a[s++]=g[1]):h===Xi?(a[s++]=g[0],a[s++]=g[1],f=!1):f=!0,d=g[0],c=g[1],p=h;return(n&&f||u===e+o)&&(a[s++]=d,a[s++]=c),s},e.prototype.drawCustomCoordinates_=function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r],l=this.appendFlatLineCoordinates(t,e,s,o,!1,!1);n.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,i,o){this.beginGeometry(t,e);var n,r,a,s,l,u=t.getType(),p=t.getStride(),h=this.coordinates.length;switch(u){case Ao:n=t.getOrientedFlatCoordinates(),s=[];var d=t.getEndss();l=0;for(var c=0,g=d.length;c<g;++c){var f=[];l=this.drawCustomCoordinates_(n,l,d[c],p,f),s.push(f)}this.instructions.push([gp.CUSTOM,h,s,t,i,ha]),this.hitDetectionInstructions.push([gp.CUSTOM,h,s,t,o||i,ha]);break;case Mo:case Do:a=[],n=u==Mo?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(n,0,t.getEnds(),p,a),this.instructions.push([gp.CUSTOM,h,a,t,i,pa]),this.hitDetectionInstructions.push([gp.CUSTOM,h,a,t,o||i,pa]);break;case Ro:case Go:n=t.getFlatCoordinates(),r=this.appendFlatLineCoordinates(n,0,n.length,p,!1,!1),this.instructions.push([gp.CUSTOM,h,r,t,i,ua]),this.hitDetectionInstructions.push([gp.CUSTOM,h,r,t,o||i,ua]);break;case jo:n=t.getFlatCoordinates(),(r=this.appendFlatPointCoordinates(n,p))>h&&(this.instructions.push([gp.CUSTOM,h,r,t,i,ua]),this.hitDetectionInstructions.push([gp.CUSTOM,h,r,t,o||i,ua]));break;case Fo:n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),r=this.coordinates.length,this.instructions.push([gp.CUSTOM,h,r,t,i]),this.hitDetectionInstructions.push([gp.CUSTOM,h,r,t,o||i])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[gp.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[gp.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,o,n=e.length,r=-1;for(t=0;t<n;++t)(o=(i=e[t])[0])==gp.END_GEOMETRY?r=t:o==gp.BEGIN_GEOMETRY&&(i[2]=t,kt(this.hitDetectionInstructions,r,t),r=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var o=t.getColor();i.fillStyle=Js(o||"#000")}else i.fillStyle=void 0;if(e){var n=e.getColor();i.strokeStyle=Js(n||"#000");var r=e.getLineCap();i.lineCap=void 0!==r?r:"round";var a=e.getLineDash();i.lineDash=a?a.slice():Vn;var s=e.getLineDashOffset();i.lineDashOffset=s||0;var l=e.getLineJoin();i.lineJoin=void 0!==l?l:"round";var u=e.getWidth();i.lineWidth=void 0!==u?u:1;var p=e.getMiterLimit();i.miterLimit=void 0!==p?p:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[gp.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[gp.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,o=t.lineCap,n=t.lineDash,r=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=o||n!=t.currentLineDash&&!St(t.currentLineDash,n)||t.currentLineDashOffset!=r||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=o,t.currentLineDash=n,t.currentLineDashOffset=r,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[gp.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Qi(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Ji(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(fp),yp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_p=function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterImageWithText_=void 0,r}return yp(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([gp.DRAW_IMAGE,n,r,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([gp.DRAW_IMAGE,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([gp.DRAW_IMAGE,n,r,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([gp.DRAW_IMAGE,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),o=t.getSize(),n=t.getHitDetectionImage(),r=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n,this.image_=r,this.height_=o[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=o[0],this.declutterImageWithText_=e},e}(vp),bp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xp=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return bp(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,o){var n=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,i,o,!1,!1),a=[gp.MOVE_TO_LINE_TO,n,r];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i},e.prototype.drawLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([gp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Vn,0],dp);var r=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(r,0,r.length,a),this.hitDetectionInstructions.push(hp),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([gp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],dp);for(var r=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinates_(a,l,r[u],s);this.hitDetectionInstructions.push(hp),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(hp),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(hp),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(dp)},e}(vp),kp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wp=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return kp(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,i,o){var n=this.state,r=void 0!==n.fillStyle,a=void 0!==n.strokeStyle,s=i.length;this.instructions.push(dp),this.hitDetectionInstructions.push(dp);for(var l=0;l<s;++l){var u=i[l],p=this.coordinates.length,h=this.appendFlatLineCoordinates(t,e,u,o,!0,!a),d=[gp.MOVE_TO_LINE_TO,p,h];this.instructions.push(d),this.hitDetectionInstructions.push(d),a&&(this.instructions.push(cp),this.hitDetectionInstructions.push(cp)),e=u}return r&&(this.instructions.push(pp),this.hitDetectionInstructions.push(pp)),a&&(this.instructions.push(hp),this.hitDetectionInstructions.push(hp)),e},e.prototype.drawCircle=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([gp.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([gp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatLineCoordinates(r,0,r.length,a,!1,!1);var l=[gp.CIRCLE,s];this.instructions.push(dp,l),this.hitDetectionInstructions.push(dp,l),void 0!==i.fillStyle&&(this.instructions.push(pp),this.hitDetectionInstructions.push(pp)),void 0!==i.strokeStyle&&(this.instructions.push(hp),this.hitDetectionInstructions.push(hp)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([gp.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([gp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,r,s),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([gp.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([gp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var r=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinatess_(a,l,r[u],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var i=this.coordinates,o=0,n=i.length;o<n;++o)i[o]=aa(i[o],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}(vp);function Sp(t,e,i,o,n){var r,a,s,l,u,p,h,d,c,g=i,f=i,m=0,v=0,y=i;for(r=i;r<o;r+=n){var _=e[r],b=e[r+1];void 0!==l&&(d=_-l,c=b-u,s=Math.sqrt(d*d+c*c),void 0!==p&&(v+=a,Math.acos((p*d+h*c)/(a*s))>t&&(v>m&&(m=v,g=y,f=r),v=0,y=r-n)),a=s,p=d,h=c),l=_,u=b}return(v+=s)>m?[y,r]:[g,f]}var Cp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),zp={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Ep={Circle:wp,Default:vp,Image:_p,LineString:xp,Polygon:wp,Text:function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return Cp(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,o=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||o)){var r=this.coordinates,a=r.length,s=t.getType(),l=null,u=t.getStride();if(n.placement!==pl||s!=Ro&&s!=Do&&s!=Mo&&s!=Ao){var p=n.overflow?null:[];switch(s){case Fo:case jo:l=t.getFlatCoordinates();break;case Ro:l=t.getFlatMidpoint();break;case Go:l=t.getCenter();break;case Do:l=t.getFlatMidpoints(),u=2;break;case Mo:l=t.getFlatInteriorPoint(),n.overflow||p.push(l[2]/this.resolution),u=3;break;case Ao:var h=t.getFlatInteriorPoints();l=[];for(k=0,w=h.length;k<w;k+=3)n.overflow||p.push(h[k+2]/this.resolution),l.push(h[k],h[k+1]);if(0===l.length)return;u=2}if((O=this.appendFlatPointCoordinates(l,u))===a)return;if(p&&(O-a)/2!=l.length/u){var d=a/2;p=p.filter((function(t,e){var i=r[2*(d+e)]===l[e*u]&&r[2*(d+e)+1]===l[e*u+1];return i||--d,i}))}this.saveTextStates_(),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var c=n.padding;if(c!=qn&&(n.scale[0]<0||n.scale[1]<0)){var g=n.padding[0],f=n.padding[1],m=n.padding[2],v=n.padding[3];n.scale[0]<0&&(f=-f,v=-v),n.scale[1]<0&&(g=-g,m=-m),c=[g,f,m,v]}var y=this.pixelRatio;this.instructions.push([gp.DRAW_IMAGE,a,O,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,c==qn?qn:c.map((function(t){return t*y})),!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]);var _=1/y;this.hitDetectionInstructions.push([gp.DRAW_IMAGE,a,O,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,this.declutterImageWithText_,c,!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]),this.endGeometry(e)}else{if(!To(this.getBufferedMaxExtent(),t.getExtent()))return;var b=void 0;if(l=t.getFlatCoordinates(),s==Ro)b=[l.length];else if(s==Do)b=t.getEnds();else if(s==Mo)b=t.getEnds().slice(0,1);else if(s==Ao){var x=t.getEndss();b=[];for(var k=0,w=x.length;k<w;++k)b.push(x[k][0])}this.beginGeometry(t,e);for(var S=n.textAlign,C=0,z=void 0,E=0,T=b.length;E<T;++E){if(null==S){var P=Sp(n.maxAngle,l,C,b[E],u);C=P[0],z=P[1]}else z=b[E];for(var k=C;k<z;k+=u)r.push(l[k],l[k+1]);var O=r.length;C=b[E],this.drawChars_(a,O),a=O}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,o=this.strokeKey_;t&&(o in this.strokeStates||(this.strokeStates[o]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var n=this.textKey_;n in this.textStates||(this.textStates[n]={font:e.font,textAlign:e.textAlign||"center",textBaseline:e.textBaseline||"middle",scale:e.scale});var r=this.fillKey_;i&&(r in this.fillStates||(this.fillStates[r]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e){var i=this.textStrokeState_,o=this.textState_,n=this.strokeKey_,r=this.textKey_,a=this.fillKey_;this.saveTextStates_();var s=this.pixelRatio,l=zp[o.textBaseline],u=this.textOffsetY_*s,p=this.text_,h=i?i.lineWidth*Math.abs(o.scale[0])/2:0;this.instructions.push([gp.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,s,u,n,h*s,p,r,1]),this.hitDetectionInstructions.push([gp.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,1,u,n,h,p,r,1/s])},e.prototype.setTextStyle=function(t,e){var i,o,n;if(t){var r=t.getFill();r?((o=this.textFillState_)||(o={},this.textFillState_=o),o.fillStyle=Js(r.getColor()||"#000")):(o=null,this.textFillState_=o);var a=t.getStroke();if(a){(n=this.textStrokeState_)||(n={},this.textStrokeState_=n);var s=a.getLineDash(),l=a.getLineDashOffset(),u=a.getWidth(),p=a.getMiterLimit();n.lineCap=a.getLineCap()||"round",n.lineDash=s?s.slice():Vn,n.lineDashOffset=void 0===l?0:l,n.lineJoin=a.getLineJoin()||"round",n.lineWidth=void 0===u?1:u,n.miterLimit=void 0===p?10:p,n.strokeStyle=Js(a.getColor()||"#000")}else n=null,this.textStrokeState_=n;i=this.textState_;var h=t.getFont()||"10px sans-serif";Zn(h);var d=t.getScaleArray();i.overflow=t.getOverflow(),i.font=h,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||"middle",i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||qn,i.scale=void 0===d?[1,1]:d;var c=t.getOffsetX(),g=t.getOffsetY(),f=t.getRotateWithView(),m=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===c?0:c,this.textOffsetY_=void 0===g?0:g,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0===m?0:m,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:te(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=o?"string"==typeof o.fillStyle?o.fillStyle:"|"+te(o.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(vp)},Tp=function(){function t(t,e,i,o){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=o,this.resolution_=i,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var i=this.buildersByZIndex_[e];for(var o in i){var n=i[o].finish();t[e][o]=n}}return t},t.prototype.getBuilder=function(t,e){var i=void 0!==t?t.toString():"0",o=this.buildersByZIndex_[i];void 0===o&&(o={},this.buildersByZIndex_[i]=o);var n=o[e];void 0===n&&(n=new(0,Ep[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),o[e]=n);return n},t}(),Pp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Op=function(t){function e(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return Pp(e,t),e.prototype.getFeatures=function(t){return Jt()},e.prototype.prepareFrame=function(t){return Jt()},e.prototype.renderFrame=function(t,e){return Jt()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(o,n){var r=this.loadedTileCallback.bind(this,i,o);return t.forEachLoadedTile(e,o,n,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){},e.prototype.getDataAtPixel=function(t,e,i){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===Gs&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Gs&&e!=Ns&&t.addEventListener(jt,this.boundHandleImageChange_),e==As&&(t.load(),e=t.getState()),e==Gs},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Je&&t.changed()},e}($t),Fp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Rp=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return Fp(e,t),e.prototype.useContainer=function(t,e,i){var o,n,r=this.getLayer().getClassName();t&&t.style.opacity===we(i)&&t.className===r&&((s=t.firstElementChild)instanceof HTMLCanvasElement&&(n=s.getContext("2d")));if(n&&n.canvas.style.transform===e?(this.container=t,this.context=n,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(o=document.createElement("div")).className=r;var a=o.style;a.position="absolute",a.width="100%",a.height="100%";var s=(n=fe()).canvas;o.appendChild(s),(a=s.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=o,this.context=n}},e.prototype.clipUnrotated=function(t,e,i){var o=Co(i),n=zo(i),r=_o(i),a=yo(i);xn(e.coordinateToPixelTransform,o),xn(e.coordinateToPixelTransform,n),xn(e.coordinateToPixelTransform,r),xn(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;xn(s,o),xn(s,n),xn(s,r),xn(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var o=this.getLayer();if(o.hasListener(t)){var n=new Bn(t,this.inversePixelTransform,i,e);o.dispatchEvent(n)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(Xe,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Ke,t,e)},e.prototype.getRenderTransform=function(t,e,i,o,n,r,a){var s=n/2,l=r/2,u=o/e,p=-u,h=-t[0]+a,d=-t[1];return wn(this.tempTransform,s,l,u,p,-i,h,d)},e.prototype.getDataAtPixel=function(t,e,i){var o,n=xn(this.inversePixelTransform,t.slice()),r=this.context,a=this.getLayer().getExtent();if(a&&!eo(a,xn(e.pixelToCoordinateTransform,t.slice())))return null;try{var s=Math.round(n[0]),l=Math.round(n[1]),u=document.createElement("canvas"),p=u.getContext("2d");u.width=1,u.height=1,p.clearRect(0,0,1,1),p.drawImage(r.canvas,s,l,1,1,0,0,1,1),o=p.getImageData(0,0,1,1).data}catch(h){return"SecurityError"===h.name?new Uint8Array:o}return 0===o[3]?null:o},e}(Op),Ip="Circle",Mp="Default",jp="Image",Dp="LineString",Ap="Polygon",Lp="Text";function Gp(t,e,i,o,n,r,a,s,l,u,p,h){var d=t[e],c=t[e+1],g=0,f=0,m=0,v=0;function y(){g=d,f=c,d=t[e+=o],c=t[e+1],v+=m,m=Math.sqrt((d-g)*(d-g)+(c-f)*(c-f))}do{y()}while(e<i-o&&v+m<r);for(var _=0===m?0:(r-v)/m,b=qe(g,d,_),x=qe(f,c,_),k=e-o,w=v,S=r+s*l(u,n,p);e<i-o&&v+m<S;)y();var C,z=qe(g,d,_=0===m?0:(S-v)/m),E=qe(f,c,_);if(h){var T=[b,x,z,E];qr(T,0,4,2,h,T,T),C=T[0]>T[2]}else C=b>z;var P,O=Math.PI,F=[],R=k+o===e;if(m=0,v=w,d=t[e=k],c=t[e+1],R){y(),P=Math.atan2(c-f,d-g),C&&(P+=P>0?-O:O);var I=(z+b)/2,M=(E+x)/2;return F[0]=[I,M,(S-r)/2,P,n],F}for(var j=0,D=n.length;j<D;){y();var A=Math.atan2(c-f,d-g);if(C&&(A+=A>0?-O:O),void 0!==P){var L=A-P;if(L+=L>O?-2*O:L<-O?2*O:0,Math.abs(L)>a)return null}P=A;for(var G=j,N=0;j<D;++j){var B=s*l(u,n[C?D-j-1:j],p);if(e+o<i&&v+m<r+N+B/2)break;N+=B}if(j!==G){var V=C?n.substring(D-G,D-j):n.substring(G,j);I=qe(g,d,_=0===m?0:(r+N/2-v)/m),M=qe(f,c,_);F.push([I,M,N/2,A,V]),r+=N}}return F}var Np=[1/0,1/0,-1/0,-1/0],Bp=[],Vp=[],qp=[],Wp=[];function Up(t){return t[3].declutterBox}var Xp=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 Kp(t,e){return"start"!==e&&"end"!==e||Xp.test(t)||(e="start"===e?"left":"right"),zp[e]}var Yp=function(){function t(t,e,i,o){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=o.instructions,this.coordinates=o.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=o.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=o.fillStates||{},this.strokeStates=o.strokeStates||{},this.textStates=o.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,i,o){var n=t+e+i+o;if(this.labels_[n])return this.labels_[n];var r=o?this.strokeStates[o]:null,a=i?this.fillStates[i]:null,s=this.textStates[e],l=this.pixelRatio,u=[s.scale[0]*l,s.scale[1]*l],p=Kp(t,s.textAlign||"center"),h=o&&r.lineWidth?r.lineWidth:0,d=t.split("\n"),c=d.length,g=[],f=function(t,e,i){for(var o=e.length,n=0,r=0;r<o;++r){var a=Jn(t,e[r]);n=Math.max(n,a),i.push(a)}return n}(s.font,d,g),m=Hn(s.font),v=f+h,y=[],_=(v+2)*u[0],b=(m*c+h)*u[1],x={width:_<0?Math.floor(_):Math.ceil(_),height:b<0?Math.floor(b):Math.ceil(b),contextInstructions:y};(1==u[0]&&1==u[1]||y.push("scale",u),y.push("font",s.font),o)&&(y.push("strokeStyle",r.strokeStyle),y.push("lineWidth",h),y.push("lineCap",r.lineCap),y.push("lineJoin",r.lineJoin),y.push("miterLimit",r.miterLimit),(de?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(y.push("setLineDash",[r.lineDash]),y.push("lineDashOffset",r.lineDashOffset)));i&&y.push("fillStyle",a.fillStyle),y.push("textBaseline","middle"),y.push("textAlign","center");var k,w=.5-p,S=p*v+w*h;if(o)for(k=0;k<c;++k)y.push("strokeText",[d[k],S+w*g[k],.5*(h+m)+k*m]);if(i)for(k=0;k<c;++k)y.push("fillText",[d[k],S+w*g[k],.5*(h+m)+k*m]);return this.labels_[n]=x,x},t.prototype.replayTextBackground_=function(t,e,i,o,n,r,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,o),t.lineTo.apply(t,n),t.lineTo.apply(t,e),r&&(this.alignFill_=r[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,i,o,n,r,a,s,l,u,p,h,d,c,g,f){var m,v=i-(a*=h[0]),y=o-(s*=h[1]),_=n+l>t?t-l:n,b=r+u>e?e-u:r,x=c[3]+_*h[0]+c[1],k=c[0]+b*h[1]+c[2],w=v-c[3],S=y-c[0];return(g||0!==p)&&(Bp[0]=w,Wp[0]=w,Bp[1]=S,Vp[1]=S,Vp[0]=w+x,qp[0]=Vp[0],qp[1]=S+k,Wp[1]=qp[1]),0!==p?(xn(m=wn([1,0,0,1,0,0],i,o,1,1,p,-i,-o),Bp),xn(m,Vp),xn(m,qp),xn(m,Wp),ao(Math.min(Bp[0],Vp[0],qp[0],Wp[0]),Math.min(Bp[1],Vp[1],qp[1],Wp[1]),Math.max(Bp[0],Vp[0],qp[0],Wp[0]),Math.max(Bp[1],Vp[1],qp[1],Wp[1]),Np)):ao(Math.min(w,w+x),Math.min(S,S+k),Math.max(w,w+x),Math.max(S,S+k),Np),d&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:_,drawImageH:b,originX:l,originY:u,declutterBox:{minX:Np[0],minY:Np[1],maxX:Np[2],maxY:Np[3],value:f},canvasTransform:m,scale:h}},t.prototype.replayImageOrLabel_=function(t,e,i,o,n,r,a){var s=!(!r&&!a),l=o.declutterBox,u=t.canvas,p=a?a[2]*o.scale[0]/2:0;return l.minX-p<=u.width/e&&l.maxX+p>=0&&l.minY-p<=u.height/e&&l.maxY+p>=0&&(s&&this.replayTextBackground_(t,Bp,Vp,qp,Wp,r,a),tr(t,o.canvasTransform,n,i,o.originX,o.originY,o.drawImageW,o.drawImageH,o.drawImageX,o.drawImageY,o.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=xn(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,i,o){var n=this.textStates[e],r=this.createLabel(t,e,o,i),a=this.strokeStates[i],s=this.pixelRatio,l=Kp(t,n.textAlign||"center"),u=zp[n.textBaseline||"middle"],p=a&&a.lineWidth?a.lineWidth:0;return{label:r,anchorX:l*(r.width/s-2*n.scale[0])+2*(.5-l)*p,anchorY:u*r.height/s+2*(.5-u)*p}},t.prototype.execute_=function(t,e,i,o,n,r,a,s){var l;this.pixelCoordinates_&&St(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Vr(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),function(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]}(this.renderedTransform_,i));for(var u,p,h,d,c,g,f,m,v,y,_,b,x,k,w,S,C=0,z=o.length,E=0,T=0,P=0,O=null,F=null,R=this.coordinateCache_,I=this.viewRotation_,M=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:I},D=this.instructions!=o||this.overlaps?0:200;C<z;){var A=o[C];switch(A[0]){case gp.BEGIN_GEOMETRY:x=A[1],S=A[3],x.getGeometry()?void 0===a||To(a,S.getExtent())?++C:C=A[2]+1:C=A[2];break;case gp.BEGIN_PATH:T>D&&(this.fill_(t),T=0),P>D&&(t.stroke(),P=0),T||P||(t.beginPath(),d=NaN,c=NaN),++C;break;case gp.CIRCLE:var L=l[E=A[1]],G=l[E+1],N=l[E+2]-L,B=l[E+3]-G,V=Math.sqrt(N*N+B*B);t.moveTo(L+V,G),t.arc(L,G,V,0,2*Math.PI,!0),++C;break;case gp.CLOSE_PATH:t.closePath(),++C;break;case gp.CUSTOM:E=A[1],u=A[2];var q=A[3],W=A[4],U=6==A.length?A[5]:void 0;j.geometry=q,j.feature=x,C in R||(R[C]=[]);var X=R[C];U?U(l,E,u,2,X):(X[0]=l[E],X[1]=l[E+1],X.length=2),W(X,j),++C;break;case gp.DRAW_IMAGE:E=A[1],u=A[2],m=A[3],p=A[4],h=A[5];var K=A[6],Y=A[7],Z=A[8],H=A[9],$=A[10],J=A[11],Q=A[12],tt=A[13],et=A[14];if(!m&&A.length>=19){v=A[18],y=A[19],_=A[20],b=A[21];var it=this.drawLabelWithPointPlacement_(v,y,_,b);m=it.label,A[3]=m;var ot=A[22];p=(it.anchorX-ot)*this.pixelRatio,A[4]=p;var nt=A[23];h=(it.anchorY-nt)*this.pixelRatio,A[5]=h,K=m.height,A[6]=K,tt=m.width,A[13]=tt}var rt=void 0;A.length>24&&(rt=A[24]);var at=void 0,st=void 0,lt=void 0;A.length>16?(at=A[15],st=A[16],lt=A[17]):(at=qn,st=!1,lt=!1),$&&M?J+=I:$||M||(J-=I);for(var ut=0;E<u;E+=2)if(!(rt&&rt[ut++]<tt/this.pixelRatio)){var pt=[t,e,m,Lt=this.calculateImageOrLabelDimensions_(m.width,m.height,l[E],l[E+1],tt,K,p,h,Z,H,J,Q,n,at,st||lt,x),Y,st?O:null,lt?F:null],ht=void 0,dt=void 0;if(s&&et){var ct=u-E;if(!et[ct]){et[ct]=pt;continue}if(ht=et[ct],delete et[ct],dt=Up(ht),s.collides(dt))continue}s&&s.collides(Lt.declutterBox)||(ht&&(s&&s.insert(dt),this.replayImageOrLabel_.apply(this,ht)),s&&s.insert(Lt.declutterBox),this.replayImageOrLabel_.apply(this,pt))}++C;break;case gp.DRAW_CHARS:var gt=A[1],ft=A[2],mt=A[3],vt=A[4];b=A[5];var yt=A[6],_t=A[7],bt=A[8];_=A[9];var xt=A[10];v=A[11],y=A[12];var kt=[A[13],A[13]],wt=this.textStates[y],Ct=wt.font,zt=[wt.scale[0]*_t,wt.scale[1]*_t],Et=void 0;Ct in this.widths_?Et=this.widths_[Ct]:(Et={},this.widths_[Ct]=Et);var Tt=cs(l,gt,ft,2),Pt=Math.abs(zt[0])*Qn(Ct,v,Et);if(vt||Pt<=Tt){var Ot=this.textStates[y].textAlign,Ft=Gp(l,gt,ft,2,v,(Tt-Pt)*zp[Ot],yt,Math.abs(zt[0]),Qn,Ct,Et,M?0:this.viewRotation_);t:if(Ft){var Rt=[],It=void 0,Mt=void 0,jt=void 0,Dt=void 0,At=void 0;if(_)for(It=0,Mt=Ft.length;It<Mt;++It){jt=(At=Ft[It])[4],Dt=this.createLabel(jt,y,"",_),p=At[2]+(zt[0]<0?-xt:xt),h=mt*Dt.height+2*(.5-mt)*xt*zt[1]/zt[0]-bt;var Lt=this.calculateImageOrLabelDimensions_(Dt.width,Dt.height,At[0],At[1],Dt.width,Dt.height,p,h,0,0,At[3],kt,!1,qn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,Dt,Lt,1,null,null])}if(b)for(It=0,Mt=Ft.length;It<Mt;++It){jt=(At=Ft[It])[4],Dt=this.createLabel(jt,y,b,""),p=At[2],h=mt*Dt.height-bt;Lt=this.calculateImageOrLabelDimensions_(Dt.width,Dt.height,At[0],At[1],Dt.width,Dt.height,p,h,0,0,At[3],kt,!1,qn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,Dt,Lt,1,null,null])}s&&s.load(Rt.map(Up));for(var Gt=0,Nt=Rt.length;Gt<Nt;++Gt)this.replayImageOrLabel_.apply(this,Rt[Gt])}}++C;break;case gp.END_GEOMETRY:if(void 0!==r){var Bt=r(x=A[1],S);if(Bt)return Bt}++C;break;case gp.FILL:D?T++:this.fill_(t),++C;break;case gp.MOVE_TO_LINE_TO:for(E=A[1],u=A[2],k=l[E],f=(w=l[E+1])+.5|0,(g=k+.5|0)===d&&f===c||(t.moveTo(k,w),d=g,c=f),E+=2;E<u;E+=2)g=(k=l[E])+.5|0,f=(w=l[E+1])+.5|0,E!=u-2&&g===d&&f===c||(t.lineTo(k,w),d=g,c=f);++C;break;case gp.SET_FILL_STYLE:O=A,this.alignFill_=A[2],T&&(this.fill_(t),T=0,P&&(t.stroke(),P=0)),t.fillStyle=A[1],++C;break;case gp.SET_STROKE_STYLE:F=A,P&&(t.stroke(),P=0),this.setStrokeStyle_(t,A),++C;break;case gp.STROKE:D?P++:t.stroke(),++C;break;default:++C}}T&&this.fill_(t),P&&t.stroke()},t.prototype.execute=function(t,e,i,o,n,r){this.viewRotation_=o,this.execute_(t,e,i,this.instructions,n,void 0,void 0,r)},t.prototype.executeHitDetection=function(t,e,i,o,n){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,o,n)},t}(),Zp=[Ap,Ip,Dp,jp,Lp,Mp],Hp=function(){function t(t,e,i,o,n,r){this.maxExtent_=t,this.overlaps_=o,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=r,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(n)}return t.prototype.clip=function(t,e){var i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var i=this.executorsByZIndex_[e];void 0===i&&(i={},this.executorsByZIndex_[e]=i);var o=t[e];for(var n in o){var r=o[n];i[n]=new Yp(this.resolution_,this.pixelRatio_,this.overlaps_,r)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var i=this.executorsByZIndex_[e],o=0,n=t.length;o<n;++o)if(t[o]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r){var a=2*(o=Math.round(o))+1,s=wn(this.hitDetectionTransform_,o+.5,o+.5,1/e,-1/e,-i,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=fe(a,a));var u,p=this.hitDetectionContext_;p.canvas.width!==a||p.canvas.height!==a?(p.canvas.width=a,p.canvas.height=a):l||p.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(co(u=[1/0,1/0,-1/0,-1/0],t),Ji(u,e*(this.renderBuffer_+o),u));var h,d=function(t){if(void 0!==$p[t])return $p[t];for(var e=2*t+1,i=t*t,o=new Array(i+1),n=0;n<=t;++n)for(var r=0;r<=t;++r){var a=n*n+r*r;if(a>i)break;var s=o[a];s||(s=[],o[a]=s),s.push(4*((t+n)*e+(t+r))+3),n>0&&s.push(4*((t-n)*e+(t+r))+3),r>0&&(s.push(4*((t+n)*e+(t-r))+3),n>0&&s.push(4*((t-n)*e+(t-r))+3))}for(var l=[],u=(n=0,o.length);n<u;++n)o[n]&&l.push.apply(l,o[n]);return $p[t]=l,l}(o);function c(t,e){for(var i=p.getImageData(0,0,a,a).data,s=0,l=d.length;s<l;s++)if(i[d[s]]>0){if(!r||h!==jp&&h!==Lp||-1!==r.indexOf(t)){var u=(d[s]-3)/4,c=o-u%a,g=o-(u/a|0),f=n(t,e,c*c+g*g);if(f)return f}p.clearRect(0,0,a,a);break}}var g,f,m,v,y,_=Object.keys(this.executorsByZIndex_).map(Number);for(_.sort(bt),g=_.length-1;g>=0;--g){var b=_[g].toString();for(m=this.executorsByZIndex_[b],f=Zp.length-1;f>=0;--f)if(void 0!==(v=m[h=Zp[f]])&&(y=v.executeHitDetection(p,s,i,c,u)))return y}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],o=e[1],n=e[2],r=e[3],a=[i,o,i,r,n,r,n,o];return Vr(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return Ft(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,o,n,r,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(bt),this.maxExtent_&&(t.save(),this.clip(t,i));var l,u,p,h,d,c,g=r||Zp;for(a&&s.reverse(),l=0,u=s.length;l<u;++l){var f=s[l].toString();for(d=this.executorsByZIndex_[f],p=0,h=g.length;p<h;++p){void 0!==(c=d[g[p]])&&c.execute(t,e,i,o,n,a)}}this.maxExtent_&&t.restore()},t}(),$p={};var Jp=Hp,Qp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),th=function(t){function e(e,i,o,n,r,a,s){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=o,l.transform_=n,l.viewRotation_=r,l.squaredTolerance_=a,l.userTransform_=s,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return Qp(e,t),e.prototype.drawImages_=function(t,e,i,o){if(this.image_){var n=Vr(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.tmpLocalTransform_,s=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=s*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,p=n.length;u<p;u+=2){var h=n[u]-this.imageAnchorX_,d=n[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var c=h+this.imageAnchorX_,g=d+this.imageAnchorY_;wn(a,c,g,1,1,l,-c,-g),r.setTransform.apply(r,a),r.translate(c,g),r.scale(this.imageScale_[0],this.imageScale_[1]),r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),r.setTransform(1,0,0,1,0,0)}else r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,h,d,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(r.globalAlpha=s)}},e.prototype.drawText_=function(t,e,i,o){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var n=Vr(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=o){var s=n[e]+this.textOffsetX_,l=n[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=wn(this.tmpLocalTransform_,s,l,1,1,a,-s,-l);r.setTransform.apply(r,u),r.translate(s,l),r.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&r.strokeText(this.text_,0,0),this.textFillState_&&r.fillText(this.text_,0,0),r.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&r.strokeText(this.text_,s,l),this.textFillState_&&r.fillText(this.text_,s,l)}}},e.prototype.moveToLineTo_=function(t,e,i,o,n){var r=this.context_,a=Vr(t,e,i,o,this.transform_,this.pixelCoordinates_);r.moveTo(a[0],a[1]);var s=a.length;n&&(s-=2);for(var l=2;l<s;l+=2)r.lineTo(a[l],a[l+1]);return n&&r.closePath(),i},e.prototype.drawRings_=function(t,e,i,o){for(var n=0,r=i.length;n<r;++n)e=this.moveToLineTo_(t,e,i[n],o,!0);return e},e.prototype.drawCircle=function(t){if(To(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,i){var o=t.getFlatCoordinates();if(o){var n=t.getStride();return Vr(o,0,o.length,n,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],o=e[3]-e[1],n=Math.sqrt(i*i+o*o),r=this.context_;r.beginPath(),r.arc(e[0],e[1],n,0,2*Math.PI),this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case Fo:this.drawPoint(t);break;case Ro:this.drawLineString(t);break;case Mo:this.drawPolygon(t);break;case jo:this.drawMultiPoint(t);break;case Do:this.drawMultiLineString(t);break;case Ao:this.drawMultiPolygon(t);break;case Lo:this.drawGeometryCollection(t);break;case Go:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&To(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,o=e.length;i<o;++i)this.drawGeometry(e[i])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),To(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var o=t.getFlatMidpoint();this.drawText_(o,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(To(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,o=t.getFlatCoordinates(),n=0,r=t.getEnds(),a=t.getStride();i.beginPath();for(var s=0,l=r.length;s<l;++s)n=this.moveToLineTo_(o,n,r[s],a,!1);i.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_)),To(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var i=t.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),To(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getOrientedFlatCoordinates(),o=0,n=t.getEndss(),r=t.getStride();e.beginPath();for(var a=0,s=n.length;a<s;++a){var l=n[a];o=this.drawRings_(i,o,l,r)}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_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(St(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,o=t.textAlign?t.textAlign:"center";i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=o&&(i.textAlign=o,e.textAlign=o),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=o,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:o,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var i=this;if(t){var o=t.getColor();this.fillState_={fillStyle:Js(o||"#000")}}else this.fillState_=null;if(e){var n=e.getColor(),r=e.getLineCap(),a=e.getLineDash(),s=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),p=e.getMiterLimit(),h=a||Vn;this.strokeState_={lineCap:void 0!==r?r:"round",lineDash:1===this.pixelRatio_?h:h.map((function(t){return t*i.pixelRatio_})),lineDashOffset:(s||0)*this.pixelRatio_,lineJoin:void 0!==l?l:"round",lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==p?p:10,strokeStyle:Js(n||"#000")}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var i=t.getAnchor(),o=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*this.pixelRatio_,this.imageAnchorY_=i[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=o[0],this.imageOriginY_=o[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var i=e.getColor();this.textFillState_={fillStyle:Js(i||"#000")}}else this.textFillState_=null;var o=t.getStroke();if(o){var n=o.getColor(),r=o.getLineCap(),a=o.getLineDash(),s=o.getLineDashOffset(),l=o.getLineJoin(),u=o.getWidth(),p=o.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:"round",lineDash:a||Vn,lineDashOffset:s||0,lineJoin:void 0!==l?l:"round",lineWidth:void 0!==u?u:1,miterLimit:void 0!==p?p:10,strokeStyle:Js(n||"#000")}}else this.textStrokeState_=null;var h=t.getFont(),d=t.getOffsetX(),c=t.getOffsetY(),g=t.getRotateWithView(),f=t.getRotation(),m=t.getScaleArray(),v=t.getText(),y=t.getTextAlign(),_=t.getTextBaseline();this.textState_={font:void 0!==h?h:"10px sans-serif",textAlign:void 0!==y?y:"center",textBaseline:void 0!==_?_:"middle"},this.text_=void 0!==v?v:"",this.textOffsetX_=void 0!==d?this.pixelRatio_*d:0,this.textOffsetY_=void 0!==c?this.pixelRatio_*c:0,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0!==f?f:0,this.textScale_=[this.pixelRatio_*m[0],this.pixelRatio_*m[1]]}else this.text_=""},e}(fp);function eh(t,e,i,o,n,r,a){var s=fe(.5*t[0],.5*t[1]);s.imageSmoothingEnabled=!1;for(var l=s.canvas,u=new th(s,.5,n,null,a),p=i.length,h=Math.floor(16777215/p),d={},c=1;c<=p;++c){var g=i[c-1],f=g.getStyleFunction()||o;if(o){var m=f(g,r);if(m){Array.isArray(m)||(m=[m]);for(var v="#"+("000000"+(c*h).toString(16)).slice(-6),y=0,_=m.length;y<_;++y){var b=m[y],x=b.getGeometryFunction()(g);if(x&&To(n,x.getExtent())){var k=b.clone(),w=k.getFill();w&&w.setColor(v);var S=k.getStroke();S&&(S.setColor(v),S.setLineDash(null)),k.setText(void 0);var C=b.getImage();if(C&&0!==C.getOpacity()){var z=C.getImageSize();if(!z)continue;var E=fe(z[0],z[1],void 0,{alpha:!1}),T=E.canvas;E.fillStyle=v,E.fillRect(0,0,T.width,T.height),k.setImage(new Hs({img:T,imgSize:z,anchor:C.getAnchor(),anchorXUnits:Rs,anchorYUnits:Rs,offset:C.getOrigin(),opacity:1,size:C.getSize(),scale:C.getScale(),rotation:C.getRotation(),rotateWithView:C.getRotateWithView()}))}var P=k.getZIndex()||0;(R=d[P])||(R={},d[P]=R,R[Mo]=[],R[Go]=[],R[Ro]=[],R[Fo]=[]),R[x.getType().replace("Multi","")].push(x,k)}}}}}for(var O=Object.keys(d).map(Number).sort(bt),F=(c=0,O.length);c<F;++c){var R=d[O[c]];for(var I in R){var M=R[I];for(y=0,_=M.length;y<_;y+=2){u.setStyle(M[y+1]);for(var j=0,D=e.length;j<D;++j)u.setTransform(e[j]),u.drawGeometry(M[y])}}}return s.getImageData(0,0,l.width,l.height)}function ih(t,e,i){var o=[];if(i){var n=Math.floor(.5*Math.round(t[0])),r=Math.floor(.5*Math.round(t[1])),a=4*(De(n,0,i.width-1)+De(r,0,i.height-1)*i.width),s=i.data[a],l=i.data[a+1],u=i.data[a+2]+256*(l+256*s),p=Math.floor(16777215/e.length);u&&u%p==0&&o.push(e[u/p-1])}return o}var oh={Point:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Gs)return;var l=t.getBuilder(i.getZIndex(),jp);l.setImageStyle(a,r),l.drawPoint(e,o)}if(s&&s.getText()){var u=t.getBuilder(i.getZIndex(),Lp);u.setTextStyle(s,r),u.drawText(e,o)}},LineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Dp);a.setFillStrokeStyle(null,r),a.drawLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),Lp);l.setTextStyle(s),l.drawText(e,o)}},Polygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Ap);s.setFillStrokeStyle(r,a),s.drawPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Lp);u.setTextStyle(l),u.drawText(e,o)}},MultiPoint:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Gs)return;var l=t.getBuilder(i.getZIndex(),jp);l.setImageStyle(a,r),l.drawMultiPoint(e,o)}if(s&&s.getText()){var u=(n||t).getBuilder(i.getZIndex(),Lp);u.setTextStyle(s,r),u.drawText(e,o)}},MultiLineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Dp);a.setFillStrokeStyle(null,r),a.drawMultiLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),Lp);l.setTextStyle(s),l.drawText(e,o)}},MultiPolygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(a||r){var s=t.getBuilder(i.getZIndex(),Ap);s.setFillStrokeStyle(r,a),s.drawMultiPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Lp);u.setTextStyle(l),u.drawText(e,o)}},GeometryCollection:function(t,e,i,o,n){var r,a,s=e.getGeometriesArray();for(r=0,a=s.length;r<a;++r){(0,oh[s[r].getType()])(t,s[r],i,o,n)}},Circle:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Ip);s.setFillStrokeStyle(r,a),s.drawCircle(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Lp);u.setTextStyle(l),u.drawText(e,o)}}};function nh(t,e){return parseInt(te(t),10)-parseInt(te(e),10)}function rh(t,e){var i=ah(t,e);return i*i}function ah(t,e){return.5*t/e}function sh(t,e,i,o,n,r,a){var s=!1,l=i.getImage();if(l){var u=l.getImageState();u==Gs||u==Ns?l.unlistenImageChange(n):(u==As&&l.load(),u=l.getImageState(),l.listenImageChange(n),s=!0)}return function(t,e,i,o,n,r){var a=i.getGeometryFunction()(e);if(!a)return;var s=a.simplifyTransformed(o,n);if(i.getRenderer())lh(t,s,i,e);else{(0,oh[s.getType()])(t,s,i,e,r)}}(t,e,i,o,r,a),s}function lh(t,e,i,o){if(e.getType()!=Lo)t.getBuilder(i.getZIndex(),Mp).drawCustom(e,o,i.getRenderer(),i.getHitDetectionRenderer());else for(var n=e.getGeometries(),r=0,a=n.length;r<a;++r)lh(t,n[r],i,o)}var uh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ph=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.animatingOrInteracting_,i.dirty_=!1,i.hitDetectionImageData_=null,i.renderedFeatures_=null,i.renderedRevision_=-1,i.renderedResolution_=NaN,i.renderedExtent_=[1/0,1/0,-1/0,-1/0],i.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],i.renderedRotation_,i.renderedCenter_=null,i.renderedProjection_=null,i.renderedRenderOrder_=null,i.replayGroup_=null,i.replayGroupChanged=!0,i.declutterExecutorGroup=null,i.clipping=!0,i}return uh(e,t),e.prototype.useContainer=function(e,i,o){o<1&&(e=null),t.prototype.useContainer.call(this,e,i,o)},e.prototype.renderWorlds=function(t,e,i){var o=e.extent,n=e.viewState,r=n.center,a=n.resolution,s=n.projection,l=n.rotation,u=s.getExtent(),p=this.getLayer().getSource(),h=e.pixelRatio,d=e.viewHints,c=!(d[zr]||d[Er]),g=this.context,f=Math.round(e.size[0]*h),m=Math.round(e.size[1]*h),v=p.getWrapX()&&s.canWrapX(),y=v?Eo(u):null,_=v?Math.ceil((o[2]-u[2])/y)+1:1,b=v?Math.floor((o[0]-u[0])/y):0;do{var x=this.getRenderTransform(r,a,l,h,f,m,b*y);t.execute(g,1,x,l,c,void 0,i)}while(++b<_)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var i=t.pixelRatio,o=t.layerStatesArray[t.layerIndex];!function(t,e,i){bn(t,e,0,0,i,0,0)}(this.pixelTransform,1/i,1/i),Sn(this.inversePixelTransform,this.pixelTransform);var n=Cn(this.pixelTransform);this.useContainer(e,n,o.opacity);var r=this.context,a=r.canvas,s=this.replayGroup_,l=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!l||l.isEmpty()))return null;var u=Math.round(t.size[0]*i),p=Math.round(t.size[1]*i);a.width!=u||a.height!=p?(a.width=u,a.height=p,a.style.transform!==n&&(a.style.transform=n)):this.containerReused||r.clearRect(0,0,u,p),this.preRender(r,t);var h=t.viewState;h.projection;var d=!1,c=!0;if(o.extent&&this.clipping){var g=fn(o.extent);(d=(c=To(g,t.extent))&&!io(g,t.extent))&&this.clipUnrotated(r,t,g)}c&&this.renderWorlds(s,t),d&&r.restore(),this.postRender(r,t);var f=we(o.opacity),m=this.container;return f!==m.style.opacity&&(m.style.opacity=f),this.renderedRotation_!==h.rotation&&(this.renderedRotation_=h.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];xn(this.pixelTransform,i);var o=this.renderedCenter_,n=this.renderedResolution_,r=this.renderedRotation_,a=this.renderedProjection_,s=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],p=.5*i[0],h=.5*i[1];u.push(this.getRenderTransform(o,n,r,.5,p,h,0).slice());var d=l.getSource(),c=a.getExtent();if(d.getWrapX()&&a.canWrapX()&&!io(c,s)){for(var g=s[0],f=Eo(c),m=0,v=void 0;g<c[0];)v=f*--m,u.push(this.getRenderTransform(o,n,r,.5,p,h,v).slice()),g+=f;for(m=0,g=s[2];g>c[2];)v=f*++m,u.push(this.getRenderTransform(o,n,r,.5,p,h,v).slice()),g-=f}this.hitDetectionImageData_=eh(i,u,this.renderedFeatures_,l.getStyleFunction(),s,n,r)}e(ih(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=this;if(this.replayGroup_){var a,s=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),p={},h=function(t,e,i){var r=te(t),a=p[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return p[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,u,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return p[r]=!0,o(t,u,e);n.push(p[r]={feature:t,layer:u,geometry:e,distanceSq:i,callback:o})}},d=[this.replayGroup_];return this.declutterExecutorGroup&&d.push(this.declutterExecutorGroup),d.some((function(o){return a=o.forEachFeatureAtCoordinate(t,s,l,i,h,o===r.declutterExecutorGroup?e.declutterTree.all().map((function(t){return t.value})):null)})),a}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),i=e.getSource();if(!i)return!1;var o=t.viewHints[zr],n=t.viewHints[Er],r=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!r&&o||!a&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,l=t.viewState,u=l.projection,p=l.resolution,h=t.pixelRatio,d=e.getRevision(),c=e.getRenderBuffer(),g=e.getRenderOrder();void 0===g&&(g=nh);var f=l.center.slice(),m=Ji(s,c*p),v=m.slice(),y=[m.slice()],_=u.getExtent();if(i.getWrapX()&&u.canWrapX()&&!io(_,t.extent)){var b=Eo(_),x=Math.max(Eo(m)/2,b);m[0]=_[0]-x,m[2]=_[2]+x,Zo(f,u);var k=function(t,e){var i=e.getExtent(),o=bo(t);if(e.canWrapX()&&(o[0]<i[0]||o[0]>=i[2])){var n=Eo(i),r=Math.floor((o[0]-i[0])/n)*n;t[0]-=r,t[2]-=r}return t}(y[0],u);k[0]<_[0]&&k[2]<_[2]?y.push([k[0]+b,k[1],k[2]+b,k[3]]):k[0]>_[0]&&k[2]>_[2]&&y.push([k[0]-b,k[1],k[2]-b,k[3]])}if(!this.dirty_&&this.renderedResolution_==p&&this.renderedRevision_==d&&this.renderedRenderOrder_==g&&io(this.wrappedRenderedExtent_,m))return St(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=f,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var w,S=new Tp(ah(p,h),m,p,h);this.getLayer().getDeclutter()&&(w=new Tp(ah(p,h),m,p,h));for(var C=0,z=y.length;C<z;++C)i.loadFeatures(y[C],p,u);var E=rh(p,h),T=function(t){var i,o=t.getStyleFunction()||e.getStyleFunction();if(o&&(i=o(t,p)),i){var n=this.renderFeature(t,E,i,S,undefined,w);this.dirty_=this.dirty_||n}}.bind(this),P=gn(m),O=i.getFeaturesInExtent(P);g&&O.sort(g);for(C=0,z=O.length;C<z;++C)T(O[C]);this.renderedFeatures_=O;var F=S.finish(),R=new Jp(m,p,h,i.getOverlaps(),F,e.getRenderBuffer());return w&&(this.declutterExecutorGroup=new Jp(m,p,h,i.getOverlaps(),w.finish(),e.getRenderBuffer())),this.renderedResolution_=p,this.renderedRevision_=d,this.renderedRenderOrder_=g,this.renderedExtent_=v,this.wrappedRenderedExtent_=m,this.renderedCenter_=f,this.renderedProjection_=u,this.replayGroup_=R,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,o,n,r){if(!i)return!1;var a=!1;if(Array.isArray(i))for(var s=0,l=i.length;s<l;++s)a=sh(o,t,i[s],e,this.boundHandleStyleImageChange_,n,r)||a;else a=sh(o,t,i,e,this.boundHandleStyleImageChange_,n,r);return a},e}(Rp),hh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),dh=function(t){function e(e){return t.call(this,e)||this}return hh(e,t),e.prototype.createRenderer=function(){return new ph(this)},e}(lp),ch=function(){function t(t){this.rbush_=new Xu(t),this.items_={}}return t.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[te(e)]=i},t.prototype.load=function(t,e){for(var i=new Array(e.length),o=0,n=e.length;o<n;o++){var r=t[o],a=e[o],s={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:a};i[o]=s,this.items_[te(a)]=s}this.rbush_.load(i)},t.prototype.remove=function(t){var e=te(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},t.prototype.update=function(t,e){var i=this.items_[te(e)];po([i.minX,i.minY,i.maxX,i.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 i,o=0,n=t.length;o<n;o++)if(i=e(t[o]))return i;return i},t.prototype.isEmpty=function(){return Ft(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return ao(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}(),gh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function fh(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var mh=function(t){function e(e){var i=t.call(this)||this;i.projection=Qo(e.projection),i.attributions_=fh(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Je,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i.viewResolver=null,i.viewRejector=null;var o=i;return i.viewPromise_=new Promise((function(t,e){o.viewResolver=t,o.viewRejector=e})),i}return gh(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 Jt()},e.prototype.getView=function(){return this.viewPromise_},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_=fh(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(oe),vh="addfeature",yh="changefeature",_h="clear",bh="removefeature",xh="featuresloadstart",kh="featuresloadend",wh="featuresloaderror";function Sh(t,e){return[[-1/0,-1/0,1/0,1/0]]}function Ch(t,e,i,o,n,r,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(i,o,n):t,!0),e.getType()==ns&&(s.responseType="arraybuffer"),s.withCredentials=false,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var o=e.getType(),l=void 0;o==rs||o==as?l=s.responseText:o==ss?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):o==ns&&(l=s.response),l?r(e.readFeatures(l,{extent:i,featureProjection:n}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}function zh(t,e){return function(i,o,n,r,a){var s=this;Ch(t,e,i,o,n,(function(t,e){s.addFeatures(t),void 0!==r&&r(t)}),a||Et)}}var Eh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Th=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.feature=i,n.features=o,n}return Eh(e,t),e}(vt),Ph=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{attributions:o.attributions,projection:void 0,state:Je,wrapX:void 0===o.wrapX||o.wrapX})||this).on,i.once,i.un,i.loader_=Et,i.format_=o.format,i.overlaps_=void 0===o.overlaps||o.overlaps,i.url_=o.url,void 0!==o.loader?i.loader_=o.loader:void 0!==i.url_&&(je(i.format_,7),i.loader_=zh(i.url_,i.format_)),i.strategy_=void 0!==o.strategy?o.strategy:Sh;var n,r,a=void 0===o.useSpatialIndex||o.useSpatialIndex;return i.featuresRtree_=a?new ch:null,i.loadedExtentsRtree_=new ch,i.loadingExtentsCount_=0,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(o.features)?r=o.features:o.features&&(r=(n=o.features).getArray()),a||void 0!==n||(n=new ui(r)),void 0!==r&&i.addFeaturesInternal(r),void 0!==n&&i.bindFeaturesCollection_(n),i}return Eh(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=te(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Th(vh,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[Xt(e,jt,this.handleFeatureChange_,this),Xt(e,yt,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,o=e.getId();return void 0!==o&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=e),i&&(je(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],o=[],n=0,r=t.length;n<r;n++){var a=te(l=t[n]);this.addToIndex_(a,l)&&i.push(l)}n=0;for(var s=i.length;n<s;n++){var l;a=te(l=i[n]);this.setupChangeEvents_(a,l);var u=l.getGeometry();if(u){var p=u.getExtent();e.push(p),o.push(l)}else this.nullGeometryFeatures_[a]=l}this.featuresRtree_&&this.featuresRtree_.load(e,o);n=0;for(var h=i.length;n<h;n++)this.dispatchEvent(new Th(vh,i[n]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(vh,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(bh,(function(i){e||(e=!0,t.remove(i.feature),e=!1)})),t.addEventListener(ni,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(ri,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(Yt)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var i in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var o=new Th(_h);this.dispatchEvent(o),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?e(i):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(i){if(i.getGeometry().intersectsExtent(t)){var o=e(i);if(o)return o}}))},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(),Ft(this.nullGeometryFeatures_)||wt(t,Ot(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var i=t[0],o=t[1],n=null,r=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||Ct;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(i,o,r,a))<u){n=t;var p=Math.sqrt(a);s[0]=i-p,s[1]=o-p,s[2]=i+p,s[3]=o+p}}})),n},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,i=te(e),o=e.getGeometry();if(o){var n=o.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(n,e)):this.featuresRtree_&&this.featuresRtree_.update(n,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var r=e.getId();if(void 0!==r){var a=r.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Th(yh,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:te(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&Ft(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,i){for(var o=this.loadedExtentsRtree_,n=this.strategy_(t,e,i),r=function(t,r){var s=n[t];o.forEachInExtent(s,(function(t){return io(t.extent,s)}))||(++a.loadingExtentsCount_,a.dispatchEvent(new Th(xh)),a.loader_.call(a,s,e,i,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Th(kh,void 0,t))}.bind(a),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Th(wh))}.bind(a)),o.insert(s,{extent:s.slice()}))},a=this,s=0,l=n.length;s<l;++s)r(s);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if(po(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=te(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=te(t);this.featureChangeKeys_[e].forEach(Yt),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Th(bh,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){je(this.format_,7),this.url_=t,this.setLoader(zh(t,this.format_))},e}(mh),Oh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fh="Point",Rh="LineString",Ih="Polygon",Mh="Circle",jh="drawstart",Dh="drawend",Ah="drawabort",Lh=function(t){function e(e,i){var o=t.call(this,e)||this;return o.feature=i,o}return Oh(e,t),e}(vt);var Gh=function(t){function e(e){var i=this,o=e;o.stopDown||(o.stopDown=zt),(i=t.call(this,o)||this).on,i.once,i.un,i.shouldHandle_=!1,i.downPx_=null,i.downTimeout_,i.lastDragTime_,i.pointerType_,i.freehand_=!1,i.source_=e.source?e.source:null,i.features_=e.features?e.features:null,i.snapTolerance_=e.snapTolerance?e.snapTolerance:12,i.type_=e.type,i.mode_=function(t){switch(t){case Fo:case jo:return Fh;case Ro:case Do:return Rh;case Mo:case Ao:return Ih;case Go:return Mh;default:throw new Error("Invalid type: "+t)}}(i.type_),i.stopClick_=!!e.stopClick,i.minPoints_=e.minPoints?e.minPoints:i.mode_===Ih?3:2,i.maxPoints_=i.mode_===Mh?2:e.maxPoints?e.maxPoints:1/0,i.finishCondition_=e.finishCondition?e.finishCondition:Ct;var n,r=e.geometryFunction;if(!r){var a,s=i.mode_;if(s===Mh)r=function(t,e,i){var o=e||new Bu([NaN,NaN]),n=cn(t[0]),r=Xo(n,cn(t[t.length-1]));return o.setCenterAndRadius(n,Math.sqrt(r)),o};else s===Fh?a=va:s===Rh?a=fs:s===Ih&&(a=Ia),r=function(t,e,i){return e?s===Ih?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new a(t),e}}return i.geometryFunction_=r,i.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,i.finishCoordinate_=null,i.sketchFeature_=null,i.sketchPoint_=null,i.sketchCoords_=null,i.sketchLine_=null,i.sketchLineCoords_=null,i.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,i.overlay_=new dh({source:new Ph({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(n=al(),function(t,e){return n[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.geometryName_=e.geometryName,i.condition_=e.condition?e.condition:iu,i.freehandCondition_,e.freehand?i.freehandCondition_=tu:i.freehandCondition_=e.freehandCondition?e.freehandCondition:ou,i.addChangeListener(Vl,i.updateState_),i}return Oh(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===At&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==Fh&&this.freehandCondition_(e);var i=e.type===gr.POINTERMOVE,o=!0;!this.freehand_&&this.lastDragTime_&&e.type===gr.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===gr.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),o=!1):this.freehand_&&e.type===gr.POINTERDOWN?o=!1:i&&this.getPointerCount()<2?(o=e.type===gr.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===gr.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===gr.DBLCLICK&&(o=!1),t.prototype.handleEvent.call(this,e)&&o},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new cr(gr.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(t.coordinate),!i&&this.freehand_?this.finishDrawing():this.freehand_||i&&this.mode_!==Fh||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,i=t.pixel,o=e[0]-i[0],n=e[1]-i[1],r=o*o+n*n;if(this.shouldHandle_=this.freehand_?r>this.squaredClickTolerance_:r<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,o=[this.finishCoordinate_],n=this.mode_;if(n===Fh)e=!0;else if(n===Mh)e=2===this.sketchCoords_.length;else if(n===Rh)i=this.sketchCoords_.length>this.minPoints_;else if(n===Ih){var r=this.sketchCoords_;i=r[0].length>this.minPoints_,o=[r[0][0],r[0][r[0].length-2]]}if(i)for(var a=this.getMap(),s=0,l=o.length;s<l;s++){var u=o[s],p=a.getPixelFromCoordinate(u),h=t[0]-p[0],d=t[1]-p[1],c=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(h*h+d*d)<=c){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new es(new va(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new es);var e=t.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new fs(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===Fh?this.sketchCoords_=t.slice():this.mode_===Ih?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new es(new fs(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new es,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Lh(jh,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,i,o=this.getMap(),n=this.sketchFeature_.getGeometry(),r=o.getView().getProjection();(this.mode_===Fh?i=this.sketchCoords_:this.mode_===Ih?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(o.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=t[0],i[1]=t[1],this.geometryFunction_(this.sketchCoords_,n,r),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(n.getType()===Mo&&this.mode_!==Ih)this.createOrUpdateCustomSketchLine_(n);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,i,o=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;r===Rh||r===Mh?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,o,n)):r===Ih&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,o,n)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;if(o===Rh||o===Mh){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var n=this.finishCoordinate_.slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}this.geometryFunction_(t,e,i),e.getType()===Mo&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(o===Ih){(t=this.sketchCoords_[0]).splice(-2,1);var r=this.sketchLine_.getGeometry();if(t.length>=2){n=t[t.length-2].slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}r.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===Rh?(e.pop(),this.geometryFunction_(e,i,o)):this.mode_===Ih&&(e[0].pop(),this.geometryFunction_(e,i,o),e=i.getCoordinates()),this.type_===jo?t.setGeometry(new _s([e])):this.type_===Do?t.setGeometry(new vs([e])):this.type_===Ao&&t.setGeometry(new ks([e])),this.dispatchEvent(new Lh(Dh,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new Lh(Ah,t))},e.prototype.appendCoordinates=function(t){var e,i=this.mode_,o=!this.sketchFeature_;if(o&&this.startDrawing_(t[0]),i===Rh||i===Mh)e=this.sketchCoords_;else{if(i!==Ih)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}o&&e.shift(),e.pop();for(var n=0;n<t.length;n++)this.addToDrawing_(t[n]);var r=t[t.length-1];this.addToDrawing_(r),this.modifyDrawing_(r)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new es(new va(i)),this.updateSketchFeatures_(),this.dispatchEvent(new Lh(jh,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(Hl),Nh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Bh=[0,0,0,0],Vh=[],qh="modifystart",Wh="modifyend",Uh=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.features=i,n.mapBrowserEvent=o,n}return Nh(e,t),e}(vt);function Xh(t,e){return t.index-e.index}function Kh(t,e,i){var o=e.geometry;if(o.getType()===Go){var n=o;if(1===e.index){null;var r=Xo(n.getCenter(),cn(t)),a=Math.sqrt(r)-n.getRadius();return a*a}}var s=cn(t);return Vh[0]=cn(e.segment[0]),Vh[1]=cn(e.segment[1]),Yo(s,Vh)}function Yh(t,e,i){var o=e.geometry;if(o.getType()===Go&&1===e.index){var n=o;return dn(n.getClosestPoint(cn(t)))}var r=cn(t);return Vh[0]=cn(e.segment[0]),Vh[1]=cn(e.segment[1]),dn(qo(r,Vh))}var Zh=function(t){function e(e){var i,o,n=t.call(this,e)||this;if(n.on,n.once,n.un,n.boundHandleFeatureChange_=n.handleFeatureChange_.bind(n),n.condition_=e.condition?e.condition:au,n.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&function(t){return t.type==gr.SINGLECLICK}(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:tu,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.featuresBeingModified_=null,n.rBush_=new ch,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new dh({source:new Ph({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(i=al(),function(t,e){return i[Fo]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.SEGMENT_WRITERS_={Point:n.writePointGeometry_.bind(n),LineString:n.writeLineStringGeometry_.bind(n),LinearRing:n.writeLineStringGeometry_.bind(n),Polygon:n.writePolygonGeometry_.bind(n),MultiPoint:n.writeMultiPointGeometry_.bind(n),MultiLineString:n.writeMultiLineStringGeometry_.bind(n),MultiPolygon:n.writeMultiPolygonGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n)},n.source_=null,n.hitDetection_=null,e.features?o=e.features:e.source&&(n.source_=e.source,o=new ui(n.source_.getFeatures()),n.source_.addEventListener(vh,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(bh,n.handleSourceRemove_.bind(n))),!o)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(n.hitDetection_=e.hitDetection),n.features_=o,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(ni,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(ri,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n.delta_=[0,0],n.snapToPointer_=void 0===e.snapToPointer?!n.hitDetection_:e.snapToPointer,n}return Nh(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}var o=this.getMap();o&&o.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,o),t.addEventListener(jt,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new ui;for(var i=this.featuresBeingModified_.getArray(),o=0,n=e.length;o<n;++o)for(var r=e[o],a=0,s=r.length;a<s;++a){var l=r[a].feature;l&&-1===i.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new Uh(qh,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(jt,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var o=i.length-1;o>=0;--o){for(var n=i[o],r=this.dragSegments_.length-1;r>=0;--r)this.dragSegments_[r][0]===n&&this.dragSegments_.splice(r,1);e.remove(n)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),o={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,geometry:e,depth:[o],index:o,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,geometry:e,index:o,segment:r};this.rBush_.insert($i(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert($i(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert($i(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var h=l.slice(u,u+2),d={feature:t,geometry:e,depth:[a,o],index:u,segment:h};this.rBush_.insert($i(h),d)}},e.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),o={feature:t,geometry:e,index:0,segment:[i,i]},n={feature:t,geometry:e,index:1,segment:[i,i]},r=[o,n];o.featureSegments=r,n.featureSegments=r,this.rBush_.insert(lo(i),o);var a=e;this.rBush_.insert(a.getExtent(),n)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=i[o];(0,this.SEGMENT_WRITERS_[n.getType()])(t,n)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,i){var o=this.vertexFeature_;o?o.getGeometry().setCoordinates(t):(o=new es(new va(t)),this.vertexFeature_=o,this.overlay_.getSource().addFeature(o));return o.set("features",e),o.set("geometries",i),o},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=gr.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(i=!(e.type!=gr.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==gr.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!i);var i},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],i=[],o=[],n=0,r=this.dragSegments_.length;n<r;++n){var a=this.dragSegments_[n],s=a[0],l=s.feature;-1===i.indexOf(l)&&i.push(l);var u=s.geometry;-1===o.indexOf(u)&&o.push(u);for(var p=s.depth,h=void 0,d=s.segment,c=a[1];e.length<u.getStride();)e.push(d[c][e.length]);switch(u.getType()){case Fo:h=e,d[0]=e,d[1]=e;break;case jo:(h=u.getCoordinates())[s.index]=e,d[0]=e,d[1]=e;break;case Ro:(h=u.getCoordinates())[s.index+c]=e,d[c]=e;break;case Do:case Mo:(h=u.getCoordinates())[p[0]][s.index+c]=e,d[c]=e;break;case Ao:(h=u.getCoordinates())[p[1]][p[0]][s.index+c]=e,d[c]=e;break;case Go:if(d[0]=e,d[1]=e,0===s.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var g=Ko(cn(u.getCenter()),cn(e));u.setRadius(g),this.changingFeature_=!1}}h&&this.setGeometryCoordinates_(u,h)}this.createOrUpdateVertexFeature_(e,i,o)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var i=this.vertexFeature_;if(i){var o=t.map.getView().getProjection(),n=[],r=i.getGeometry().getCoordinates(),a=$i([r]),s=this.rBush_.getInExtent(a),l={};s.sort(Xh);for(var u=0,p=s.length;u<p;++u){var h=s[u],d=h.segment,c=te(h.geometry),g=h.depth;if(g&&(c+="-"+g.join("-")),l[c]||(l[c]=new Array(2)),h.geometry.getType()!==Go||1!==h.index)if(!Wo(d[0],r)||l[c][0])if(!Wo(d[1],r)||l[c][1])te(d)in this.vertexSegments_&&!l[c][0]&&!l[c][1]&&this.insertVertexCondition_(t)&&n.push(h);else{if((h.geometry.getType()===Ro||h.geometry.getType()===Do)&&l[c][0]&&0===l[c][0].index)continue;this.dragSegments_.push([h,1]),l[c][1]=h}else this.dragSegments_.push([h,0]),l[c][0]=h;else Wo(Yh(e,h,o),r)&&!l[c][0]&&(this.dragSegments_.push([h,0]),l[c][0]=h)}n.length&&this.willModifyFeatures_(t,[n]);for(var f=n.length-1;f>=0;--f)this.insertVertex_(n[f],r)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],o=i.geometry;if(o.getType()===Go){var n=o.getCenter(),r=i.featureSegments[0],a=i.featureSegments[1];r.segment[0]=n,r.segment[1]=n,a.segment[0]=n,a.segment[1]=n,this.rBush_.update(lo(n),r);var s=o;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update($i(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new Uh(Wh,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,i){var o,n,r=this,a=i||e.getCoordinateFromPixel(t),s=e.getView().getProjection();if(this.hitDetection_){var l="object"==typeof this.hitDetection_?function(t){return t===r.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,i){if((i=i||t.getGeometry()).getType()===Fo&&(s=r.features_.getArray(),l=t,s.indexOf(l)>=0)){n=i;var a=i.getFlatCoordinates().slice(0,2);o=[{feature:t,geometry:i,segment:[a,a]}]}var s,l;return!0}),{layerFilter:l})}if(!o){var u=gn(Ji(fn(lo(a,Bh)),e.getView().getResolution()*this.pixelTolerance_,Bh));o=this.rBush_.getInExtent(u)}if(o&&o.length>0){var p=o.sort((function(t,e){return Kh(a,t,s)-Kh(a,e,s)}))[0],h=p.segment,d=Yh(a,p,s),c=e.getPixelFromCoordinate(d),g=Ko(t,c);if(n||g<=this.pixelTolerance_){var f={};if(f[te(h)]=!0,this.snapToPointer_||(this.delta_[0]=d[0]-a[0],this.delta_[1]=d[1]-a[1]),p.geometry.getType()===Go&&1===p.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(d,[p.feature],[p.geometry]);else{var m=e.getPixelFromCoordinate(h[0]),v=e.getPixelFromCoordinate(h[1]),y=Xo(c,m),_=Xo(c,v);g=Math.sqrt(Math.min(y,_)),this.snappedToVertex_=g<=this.pixelTolerance_,this.snappedToVertex_&&(d=y>_?h[1]:h[0]),this.createOrUpdateVertexFeature_(d,[p.feature],[p.geometry]);var b={};b[te(p.geometry)]=!0;for(var x=1,k=o.length;x<k;++x){var w=o[x].segment;if(!(Wo(h[0],w[0])&&Wo(h[1],w[1])||Wo(h[0],w[1])&&Wo(h[1],w[0])))break;var S=te(o[x].geometry);S in b||(b[S]=!0,f[te(w)]=!0)}}return void(this.vertexSegments_=f)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var i,o=t.segment,n=t.feature,r=t.geometry,a=t.depth,s=t.index;e.length<r.getStride();)e.push(0);switch(r.getType()){case Do:case Mo:(i=r.getCoordinates())[a[0]].splice(s+1,0,e);break;case Ao:(i=r.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case Ro:(i=r.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(r,i);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(r,s,a,1);var u={segment:[o[0],e],feature:n,geometry:r,depth:a,index:s};l.insert($i(u.segment),u),this.dragSegments_.push([u,1]);var p={segment:[e,o[1]],feature:n,geometry:r,depth:a,index:s+1};l.insert($i(p.segment),p),this.dragSegments_.push([p,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=gr.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.dispatchEvent(new Uh(Wh,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,i,o,n,r,a,s,l,u,p,h=this.dragSegments_,d={},c=!1;for(n=h.length-1;n>=0;--n)p=te((u=(i=h[n])[0]).feature),u.depth&&(p+="-"+u.depth.join("-")),p in d||(d[p]={}),0===i[1]?(d[p].right=u,d[p].index=u.index):1==i[1]&&(d[p].left=u,d[p].index=u.index+1);for(p in d){switch(l=d[p].right,a=d[p].left,(s=(r=d[p].index)-1)<0&&(s=0),t=e=(o=(u=void 0!==a?a:l).geometry).getCoordinates(),c=!1,o.getType()){case Do:e[u.depth[0]].length>2&&(e[u.depth[0]].splice(r,1),c=!0);break;case Ro:e.length>2&&(e.splice(r,1),c=!0);break;case Ao:t=t[u.depth[1]];case Mo:(t=t[u.depth[0]]).length>4&&(r==t.length-1&&(r=0),t.splice(r,1),c=!0,0===r&&(t.pop(),t.push(t[0]),s=t.length-1))}if(c){this.setGeometryCoordinates_(o,e);var g=[];if(void 0!==a&&(this.rBush_.remove(a),g.push(a.segment[0])),void 0!==l&&(this.rBush_.remove(l),g.push(l.segment[1])),void 0!==a&&void 0!==l){var f={depth:u.depth,feature:u.feature,geometry:u.geometry,index:s,segment:g};this.rBush_.insert($i(f.segment),f)}this.updateSegmentIndices_(o,r,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),h.length=0}}return c},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,i,o){this.rBush_.forEachInExtent(t.getExtent(),(function(n){n.geometry===t&&(void 0===i||void 0===n.depth||St(n.depth,i))&&n.index>e&&(n.index+=o)}))},e}(Hl),Hh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function $h(t){return t.feature?t.feature:t.element?t.element:void 0}var Jh=[],Qh=function(t){function e(e){var i=this,o=e||{},n=o;return n.handleDownEvent||(n.handleDownEvent=Ct),n.stopDown||(n.stopDown=zt),(i=t.call(this,n)||this).source_=o.source?o.source:null,i.vertex_=void 0===o.vertex||o.vertex,i.edge_=void 0===o.edge||o.edge,i.features_=o.features?o.features:null,i.featuresListenerKeys_=[],i.featureChangeListenerKeys_={},i.indexedFeaturesExtents_={},i.pendingFeatures_={},i.pixelTolerance_=void 0!==o.pixelTolerance?o.pixelTolerance:10,i.rBush_=new ch,i.SEGMENT_WRITERS_={Point:i.writePointGeometry_.bind(i),LineString:i.writeLineStringGeometry_.bind(i),LinearRing:i.writeLineStringGeometry_.bind(i),Polygon:i.writePolygonGeometry_.bind(i),MultiPoint:i.writeMultiPointGeometry_.bind(i),MultiLineString:i.writeMultiLineStringGeometry_.bind(i),MultiPolygon:i.writeMultiPolygonGeometry_.bind(i),GeometryCollection:i.writeGeometryCollectionGeometry_.bind(i),Circle:i.writeCircleGeometry_.bind(i)},i}return Hh(e,t),e.prototype.addFeature=function(t,e){var i=void 0===e||e,o=te(t),n=t.getGeometry();if(n){var r=this.SEGMENT_WRITERS_[n.getType()];r&&(this.indexedFeaturesExtents_[o]=n.getExtent([1/0,1/0,-1/0,-1/0]),r(t,n))}i&&(this.featureChangeListenerKeys_[o]=Xt(t,jt,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var i=this.snapTo(e.pixel,e.coordinate,e.map);return i.snapped&&(e.coordinate=i.vertex.slice(0,2),e.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=$h(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=$h(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=te(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=Ot(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var i=void 0===e||e,o=te(t),n=this.indexedFeaturesExtents_[o];if(n){var r=this.rBush_,a=[];r.forEachInExtent(n,(function(e){t===e.feature&&a.push(e)}));for(var s=a.length-1;s>=0;--s)r.remove(a[s])}i&&(Yt(this.featureChangeListenerKeys_[o]),delete this.featureChangeListenerKeys_[o])},e.prototype.setMap=function(e){var i=this.getMap(),o=this.featuresListenerKeys_,n=this.getFeatures_();i&&(o.forEach(Yt),o.length=0,n.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?o.push(Xt(this.features_,ni,this.handleFeatureAdd_,this),Xt(this.features_,ri,this.handleFeatureRemove_,this)):this.source_&&o.push(Xt(this.source_,vh,this.handleFeatureAdd_,this),Xt(this.source_,bh,this.handleFeatureRemove_,this)),n.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,i){var o=$i([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),n=this.rBush_.getInExtent(o);this.vertex_&&!this.edge_&&(n=n.filter((function(t){return t.feature.getGeometry().getType()!==Go})));var r=!1,a=null,s=null;if(0===n.length)return{snapped:r,vertex:a,vertexPixel:s};i.getView().getProjection();for(var l,u=cn(e),p=1/0,h=0;h<n.length;++h){var d=n[h];Jh[0]=cn(d.segment[0]),Jh[1]=cn(d.segment[1]);var c=Yo(u,Jh);c<p&&(l=d,p=c)}var g=l.segment;if(this.vertex_&&!this.edge_){var f=i.getPixelFromCoordinate(g[0]),m=i.getPixelFromCoordinate(g[1]),v=Xo(t,f),y=Xo(t,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(r=!0,a=v>y?g[1]:g[0],s=i.getPixelFromCoordinate(a))}else if(this.edge_){var _=l.feature.getGeometry().getType()===Go;if(_){var b=l.feature.getGeometry();null,a=dn(function(t,e){var i=e.getRadius(),o=e.getCenter(),n=o[0],r=o[1],a=t[0]-n,s=t[1]-r;0===a&&0===s&&(a=1);var l=Math.sqrt(a*a+s*s);return[n+i*a/l,r+i*s/l]}(u,b))}else Jh[0]=cn(g[0]),Jh[1]=cn(g[1]),a=dn(qo(u,Jh));if(Ko(t,s=i.getPixelFromCoordinate(a))<=this.pixelTolerance_&&(r=!0,this.vertex_&&!_)){f=i.getPixelFromCoordinate(g[0]),m=i.getPixelFromCoordinate(g[1]),v=Xo(s,f),y=Xo(s,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(a=v>y?g[1]:g[0],s=i.getPixelFromCoordinate(a))}}return r&&(s=[Math.round(s[0]),Math.round(s[1])]),{snapped:r,vertex:a,vertexPixel:s}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){this.getMap().getView().getProjection();for(var i=ja(e).getCoordinates()[0],o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert($i(r),a)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=this.SEGMENT_WRITERS_[i[o].getType()];n&&n(t,i[o])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert($i(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert($i(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var h=l.slice(u,u+2),d={feature:t,segment:h};this.rBush_.insert($i(h),d)}},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),o={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert($i(l),u)}},e}(Hl);function td(t){var e=t||{},i=new ui,o=new Ou(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new pu),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Kl({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new lu({onFocusOnly:e.onFocusOnly,kinetic:o})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new Du),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Lu({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new Eu),i.push(new Pu({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Mu({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new xu({duration:e.zoomDuration})),i}var ed=function(){function t(t,e,i,o){this.minX=t,this.maxX=e,this.minY=i,this.maxY=o}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 id(t,e,i,o,n){return void 0!==n?(n.minX=t,n.maxX=e,n.minY=i,n.maxY=o,n):new ed(t,e,i,o)}var od=ed,nd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),rd=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new od(0,0,0,0),i}return nd(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),o=e.getUseInterimTilesOnError();return i==xr||i==wr||i==kr&&!o},e.prototype.getTile=function(t,e,i,o){var n=o.pixelRatio,r=o.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,i,n,r);return s.getState()==kr&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(xr)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.loadedTileCallback=function(e,i,o){return!!this.isDrawableTile(o)&&t.prototype.loadedTileCallback.call(this,e,i,o)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],o=t.viewState,n=o.projection,r=o.resolution,a=o.center,s=o.rotation,l=t.pixelRatio,u=this.getLayer(),p=u.getSource(),h=p.getRevision(),d=p.getTileGridForProjection(n),c=d.getZForResolution(r,p.zDirection),g=d.getResolution(c),f=t.extent,m=i.extent&&fn(i.extent);m&&(f=So(f,fn(i.extent)));var v=p.getTilePixelRatio(l),y=Math.round(t.size[0]*v),_=Math.round(t.size[1]*v);if(s){var b=Math.round(Math.sqrt(y*y+_*_));y=b,_=b}var x=g*y/2/v,k=g*_/2/v,w=[a[0]-x,a[1]-k,a[0]+x,a[1]+k],S=d.getTileRangeForExtentAndZ(f,c),C={};C[c]={};var z=this.createLoadedTileFinder(p,n,C),E=this.tmpExtent,T=this.tmpTileRange_;this.newTiles_=!1;for(var P=S.minX;P<=S.maxX;++P)for(var O=S.minY;O<=S.maxY;++O){var F=this.getTile(c,P,O,t);if(this.isDrawableTile(F)){var R=te(this);if(F.getState()==xr){C[c][F.tileCoord.toString()]=F;var I=F.inTransition(R);this.newTiles_||!I&&-1!==this.renderedTiles.indexOf(F)||(this.newTiles_=!0)}if(1===F.getAlpha(R,t.time))continue}var M=d.getTileCoordChildTileRange(F.tileCoord,T,E),j=!1;M&&(j=z(c+1,M)),j||d.forEachTileCoordParentTileRange(F.tileCoord,z,T,E)}var D=g/r;wn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/v,1/v,s,-y/2,-_/2);var A=Cn(this.pixelTransform);this.useContainer(e,A,i.opacity);var L=this.context,G=L.canvas;Sn(this.inversePixelTransform,this.pixelTransform),wn(this.tempTransform,y/2,_/2,D,D,0,-y/2,-_/2),G.width!=y||G.height!=_?(G.width=y,G.height=_):this.containerReused||L.clearRect(0,0,y,_),m&&this.clipUnrotated(L,t,m),Tt(L,p.getContextOptions()),this.preRender(L,t),this.renderedTiles.length=0;var N,B,V,q=Object.keys(C).map(Number);q.sort(bt),1!==i.opacity||this.containerReused&&!p.getOpaque(t.viewState.projection)?(N=[],B=[]):q=q.reverse();for(var W=q.length-1;W>=0;--W){var U=q[W],X=p.getTilePixelSize(U,l,n),K=d.getResolution(U)/g,Y=X[0]*K*D,Z=X[1]*K*D,H=d.getTileCoordForCoordAndZ(Co(w),U),$=d.getTileCoordExtent(H),J=xn(this.tempTransform,[v*($[0]-w[0])/g,v*(w[3]-$[3])/g]),Q=v*p.getGutterForProjection(n),tt=C[U];for(var et in tt){var it=(F=tt[et]).tileCoord,ot=H[1]-it[1],nt=Math.round(J[0]-(ot-1)*Y),rt=H[2]-it[2],at=Math.round(J[1]-(rt-1)*Z),st=nt-(P=Math.round(J[0]-ot*Y)),lt=at-(O=Math.round(J[1]-rt*Z)),ut=c===U;if(!(I=ut&&1!==F.getAlpha(te(this),t.time)))if(N){L.save(),V=[P,O,P+st,O,P+st,O+lt,P,O+lt];for(var pt=0,ht=N.length;pt<ht;++pt)if(c!==U&&U<B[pt]){var dt=N[pt];L.beginPath(),L.moveTo(V[0],V[1]),L.lineTo(V[2],V[3]),L.lineTo(V[4],V[5]),L.lineTo(V[6],V[7]),L.moveTo(dt[6],dt[7]),L.lineTo(dt[4],dt[5]),L.lineTo(dt[2],dt[3]),L.lineTo(dt[0],dt[1]),L.clip()}N.push(V),B.push(U)}else L.clearRect(P,O,st,lt);this.drawTileImage(F,t,P,O,st,lt,Q,ut),N&&!I?(L.restore(),this.renderedTiles.unshift(F)):this.renderedTiles.push(F),this.updateUsedTiles(t.usedTiles,p,F)}}this.renderedRevision=h,this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!po(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.renderedProjection=n,this.manageTilePyramid(t,p,d,l,n,f,c,u.getPreload()),this.scheduleExpireCache(t,p),this.postRender(L,t),i.extent&&L.restore(),A!==G.style.transform&&(G.style.transform=A);var ct=we(i.opacity),gt=this.container;return ct!==gt.style.opacity&&(gt.style.opacity=ct),this.container},e.prototype.drawTileImage=function(t,e,i,o,n,r,a,s){var l=this.getTileImage(t);if(l){var u=te(this),p=s?t.getAlpha(u,e.time):1,h=p!==this.context.globalAlpha;h&&(this.context.save(),this.context.globalAlpha=p),this.context.drawImage(l,a,a,l.width-2*a,l.height-2*a,i,o,n,r),h&&this.context.restore(),1!==p?e.animate=!0:s&&t.endTransition(u)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var i=function(t,e,i){var o=te(t);o in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[o])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i){var o=te(e);o in t||(t[o]={}),t[o][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,i,o,n,r,a,s,l){var u=te(e);u in t.wantedTiles||(t.wantedTiles[u]={});var p,h,d,c,g,f,m=t.wantedTiles[u],v=t.tileQueue,y=0;for(f=i.getMinZoom();f<=a;++f)for(h=i.getTileRangeForExtentAndZ(r,f,h),d=i.getResolution(f),c=h.minX;c<=h.maxX;++c)for(g=h.minY;g<=h.maxY;++g)a-f<=s?(++y,(p=e.getTile(f,c,g,o,n)).getState()==_r&&(m[p.getKey()]=!0,v.isKeyQueued(p.getKey())||v.enqueue([p,u,i.getTileCoordCenter(p.tileCoord),d])),void 0!==l&&l(p)):e.useTile(f,c,g,n);e.updateCacheSize(y,n)},e}(Rp);rd.prototype.getLayer;var ad=rd,sd="image",ld="hybrid",ud="vector",pd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hd={image:[Ap,Ip,Dp,jp,Lp],hybrid:[Ap,Dp],vector:[]},dd={hybrid:[jp,Lp,Mp],vector:[Ap,Ip,Dp,jp,Lp,Mp]},cd=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.dirty_=!1,i.renderedLayerRevision_,i.renderedPixelToCoordinateTransform_=null,i.renderedRotation_,i.tmpTransform_=[1,0,0,1,0,0],i}return pd(e,t),e.prototype.prepareTile=function(t,e,i){var o,n=t.getState();return n!==xr&&n!==kr||(this.updateExecutorGroup_(t,e,i),this.tileImageNeedsRender_(t)&&(o=!0)),o},e.prototype.getTile=function(e,i,o,n){var r=n.pixelRatio,a=n.viewState,s=a.resolution,l=a.projection,u=this.getLayer(),p=u.getSource().getTile(e,i,o,r,l),h=n.viewHints,d=!(h[zr]||h[Er]);return!d&&p.wantedResolution||(p.wantedResolution=s),this.prepareTile(p,r,l)&&(d||Date.now()-n.time<8)&&u.getRenderMode()!==ud&&this.renderTileImage_(p,n),t.prototype.getTile.call(this,e,i,o,n)},e.prototype.isDrawableTile=function(e){var i=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(i.getRenderMode()===ud?te(i)in e.executorGroups:e.hasContext(i))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var i=this.getLayer().getRevision();return this.renderedLayerRevision_!=i&&(this.renderedTiles.length=0),this.renderedLayerRevision_=i,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,i){var o=this.getLayer(),n=o.getRevision(),r=o.getRenderOrder()||null,a=t.wantedResolution,s=t.getReplayState(o);if(s.dirty||s.renderedResolution!==a||s.renderedRevision!=n||s.renderedRenderOrder!=r){var l=o.getSource(),u=o.getDeclutter(),p=l.getTileGrid(),h=l.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),d=l.getSourceTiles(e,i,t),c=te(o);delete t.hitDetectionImageData[c],t.executorGroups[c]=[],u&&(t.declutterExecutorGroups[c]=[]);for(var g=function(i,n){var g=d[i];if(g.getState()!=xr)return"continue";var m=g.tileCoord,v=p.getTileCoordExtent(m),y=So(h,v),_=Ji(y,o.getRenderBuffer()*a,f.tmpExtent),b=po(v,y)?null:_;s.dirty=!1;var x=new Tp(0,_,a,e),k=u?new Tp(0,y,a,e):void 0,w=rh(a,e),S=function(t){var e,i=t.getStyleFunction()||o.getStyleFunction();if(i&&(e=i(t,a)),e){var n=this.renderFeature(t,w,e,x,k);this.dirty_=this.dirty_||n,s.dirty=s.dirty||n}},C=g.getFeatures();r&&r!==s.renderedRenderOrder&&C.sort(r);for(var z=0,E=C.length;z<E;++z){var T=C[z];b&&!To(b,T.getGeometry().getExtent())||S.call(f,T)}var P=x.finish(),O=o.getRenderMode()!==ud&&u&&1===d.length?null:y,F=new Jp(O,a,e,l.getOverlaps(),P,o.getRenderBuffer());if(t.executorGroups[c].push(F),k){var R=new Jp(null,a,e,l.getOverlaps(),k.finish(),o.getRenderBuffer());t.declutterExecutorGroups[c].push(R)}},f=this,m=0,v=d.length;m<v;++m)g(m);s.renderedRevision=n,s.renderedRenderOrder=r,s.renderedResolution=a}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=e.viewState.resolution,a=e.viewState.rotation;i=null==i?0:i;var s=this.getLayer(),l=s.getSource().getTileGridForProjection(e.viewState.projection),u=$i([t]);Ji(u,r*i,u);for(var p,h={},d=function(t,e,i){var r=t.getId();void 0===r&&(r=te(t));var a=h[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return h[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,s,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return h[r]=!0,o(t,s,e);n.push(h[r]={feature:t,layer:s,geometry:e,distanceSq:i,callback:o})}},c=this.renderedTiles,g=function(o,n){var h=c[o];if(!To(l.getTileCoordExtent(h.wrappedTileCoord),u))return"continue";var g=te(s),f=[h.executorGroups[g]],m=h.declutterExecutorGroups[g];m&&f.push(m),f.some((function(o){for(var n=o===m?e.declutterTree.all().map((function(t){return t.value})):null,s=0,l=o.length;s<l;++s){var u=o[s];if(p=u.forEachFeatureAtCoordinate(t,r,a,i,d,n))return!0}}))},f=0,m=c.length;!p&&f<m;++f)g(f);return p},e.prototype.getFeatures=function(t){return new Promise(function(e,i){for(var o,n=this.getLayer(),r=te(n),a=n.getSource(),s=this.renderedProjection,l=s.getExtent(),u=this.renderedResolution,p=a.getTileGridForProjection(s),h=xn(this.renderedPixelToCoordinateTransform_,t.slice()),d=p.getTileCoordForCoordAndResolution(h,u),c=0,g=this.renderedTiles.length;c<g;++c)if(d.toString()===this.renderedTiles[c].tileCoord.toString()){if((o=this.renderedTiles[c]).getState()===xr){var f=p.getTileCoordExtent(o.tileCoord);a.getWrapX()&&s.canWrapX()&&!io(l,f)&&Zo(h,s);break}o=void 0}if(!o||o.loadingSourceTiles>0)e([]);else{var m=Co(p.getTileCoordExtent(o.wrappedTileCoord)),v=[(h[0]-m[0])/u,(m[1]-h[1])/u],y=o.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),_=o.hitDetectionImageData[r];if(!_&&!this.animatingOrInteracting_){var b=Va(p.getTileSize(p.getZForResolution(u))),x=this.renderedRotation_;_=eh(b,[this.getRenderTransform(p.getTileCoordCenter(o.wrappedTileCoord),u,0,.5,.5*b[0],.5*b[1],0)],y,n.getStyleFunction(),p.getTileCoordExtent(o.wrappedTileCoord),o.getReplayState(n).renderedResolution,x),o.hitDetectionImageData[r]=_}e(ih(v,y,_))}}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var e=this.context,i=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var o=t.viewHints,n=!(o[zr]||o[Er]),r=this.renderedTiles,a=0,s=r.length;a<s;++a){var l=r[a],u=l.declutterExecutorGroups[te(this.getLayer())];if(u)for(var p=u.length-1;p>=0;--p)u[p].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,n,void 0,t.declutterTree)}e.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,e){var i=e.pixelRatio,o=e.viewState,n=o.center,r=o.resolution,a=o.rotation,s=e.size,l=Math.round(s[0]*i),u=Math.round(s[1]*i),p=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),h=t.tileCoord,d=p.getTileCoordExtent(t.wrappedTileCoord),c=p.getTileCoordExtent(h,this.tmpExtent)[0]-d[0];return _n(kn(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(n,r,a,i,l,u,c))},e.prototype.renderFrame=function(e,i){var o=e.viewHints,n=!(o[zr]||o[Er]);t.prototype.renderFrame.call(this,e,i),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var r=this.getLayer(),a=r.getRenderMode(),s=this.context,l=s.globalAlpha;s.globalAlpha=r.getOpacity();for(var u=dd[a],p=e.viewState.rotation,h=this.renderedTiles,d=[],c=[],g=h.length-1;g>=0;--g)for(var f=h[g],m=this.getTileRenderTransform(f,e),v=f.executorGroups[te(r)],y=!1,_=0,b=v.length;_<b;++_){var x=v[_];if(x.hasExecutors(u)){var k=f.tileCoord[0],w=void 0;if(!y&&(w=x.getClipCoords(m))){s.save();for(var S=0,C=d.length;S<C;++S){var z=d[S];k<c[S]&&(s.beginPath(),s.moveTo(w[0],w[1]),s.lineTo(w[2],w[3]),s.lineTo(w[4],w[5]),s.lineTo(w[6],w[7]),s.moveTo(z[6],z[7]),s.lineTo(z[4],z[5]),s.lineTo(z[2],z[3]),s.lineTo(z[0],z[1]),s.clip())}}x.execute(s,1,m,p,n,u),!y&&w&&(s.restore(),d.push(w),c.push(k),y=!0)}}return s.globalAlpha=l,this.container},e.prototype.renderFeature=function(t,e,i,o,n){if(!i)return!1;var r=!1;if(Array.isArray(i))for(var a=0,s=i.length;a<s;++a)r=sh(o,t,i[a],e,this.boundHandleStyleImageChange_,void 0,n)||r;else r=sh(o,t,i,e,this.boundHandleStyleImageChange_,void 0,n);return r},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===ud)return!1;var i=t.getReplayState(e),o=e.getRevision(),n=t.wantedResolution;return i.renderedTileResolution!==n||i.renderedTileRevision!==o},e.prototype.renderTileImage_=function(t,e){var i=this.getLayer(),o=t.getReplayState(i),n=i.getRevision(),r=t.executorGroups[te(i)];o.renderedTileRevision=n;var a=t.wrappedTileCoord,s=a[0],l=i.getSource(),u=e.pixelRatio,p=e.viewState.projection,h=l.getTileGridForProjection(p),d=h.getResolution(t.tileCoord[0]),c=e.pixelRatio/t.wantedResolution*d,g=h.getResolution(s),f=t.getContext(i);u=Math.round(Math.max(u,c/u));var m=l.getTilePixelSize(s,u,p);f.canvas.width=m[0],f.canvas.height=m[1];var v=u/c;if(1!==v){var y=yn(this.tmpTransform_);kn(y,v,v),f.setTransform.apply(f,y)}var _=h.getTileCoordExtent(a,this.tmpExtent),b=c/g,x=yn(this.tmpTransform_);kn(x,b,-b),function(t,e,i){_n(t,bn(vn,1,0,0,1,e,i))}(x,-_[0],-_[3]);for(var k=0,w=r.length;k<w;++k){r[k].execute(f,v,x,0,!0,hd[i.getRenderMode()])}o.renderedTileResolution=t.wantedResolution},e}(ad),gd="preload",fd="useInterimTilesOnError",md=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),vd=function(t){function e(e){var i=this,o=e||{},n=Tt({},o);delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,o.renderMode===sd&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),o.renderMode=void 0);var r=o.renderMode||ld;return je(r==ld||r==ud,28),i.renderMode_=r,i.setPreload(o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return md(e,t),e.prototype.createRenderer=function(){return new cd(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(gd)},e.prototype.getUseInterimTilesOnError=function(){return this.get(fd)},e.prototype.setPreload=function(t){this.set(gd,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(fd,t)},e}(lp),yd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_d=function(t){function e(e,i,o){var n=t.call(this)||this,r=o||{};return n.tileCoord=e,n.state=i,n.interimTile=null,n.key="",n.transition_=void 0===r.transition?250:r.transition,n.transitionStarts_={},n}return yd(e,t),e.prototype.changed=function(){this.dispatchEvent(jt)},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()==xr)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()==xr){t.interimTile=null;break}t.getState()==br?e=t:t.getState()==_r?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!==kr&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Jt()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var o=e-i+1e3/60;return o>=this.transition_?1:pi(o/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}(Mt),bd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xd=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.extent=null,s.format_=n,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=r,s.url_=o,s.key=o,s}return bd(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==_r&&(this.setState(br),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(kr)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(xr)},e.prototype.setLoader=function(t){this.loader_=t},e}(_d),kd=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 i=this.entries_[t];return je(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return je(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){je(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function wd(t,e,i,o){return void 0!==o?(o[0]=t,o[1]=e,o[2]=i,o):[t,e,i]}function Sd(t,e,i){return t+"/"+e+"/"+i}function Cd(t){return Sd(t[0],t[1],t[2])}function zd(t){return t.split("/").map(Number)}var Ed=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Td=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ed(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=zd(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Cd(e.tileCoord)),e.release())}.bind(this))}},e}(kd),Pd="tileloadstart",Od="tileloadend",Fd="tileloaderror",Rd=[0,0,0],Id=function(){function t(t){var e,i,o,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,je((e=this.resolutions_,i=!0,o=function(t,e){return e-t}||bt,e.every((function(t,n){if(0===n)return!0;var r=o(e[n-1],t);return!(r>0||i&&0===r)}))),17),!t.origins)for(var r=0,a=this.resolutions_.length-1;r<a;++r)if(n){if(this.resolutions_[r]/this.resolutions_[r+1]!==n){n=void 0;break}}else n=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=n,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,je(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=Co(s)),je(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,je(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,je(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==s?s:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var i=new od(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(s){var o=this.getTileRangeForExtentAndZ(s,e);i.minX=Math.max(o.minX,i.minX),i.maxX=Math.min(o.maxX,i.maxX),i.minY=Math.max(o.minY,i.minY),i.maxY=Math.min(o.maxY,i.maxY)}return i}),this):s&&this.calculateTileRanges_(s)}return t.prototype.forEachTileCoord=function(t,e,i){for(var o=this.getTileRangeForExtentAndZ(t,e),n=o.minX,r=o.maxX;n<=r;++n)for(var a=o.minY,s=o.maxY;a<=s;++a)i([e,n,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,i,o){var n,r,a=null,s=t[0]-1;for(2===this.zoomFactor_?(n=t[1],r=t[2]):a=this.getTileCoordExtent(t,o);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?id(n=Math.floor(n/2),n,r=Math.floor(r/2),r,i):this.getTileRangeForExtentAndZ(a,s,i)))return!0;--s}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var o=2*t[1],n=2*t[2];return id(o,o+1,n,n+1,e)}var r=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;var o=t[0],n=t[1],r=t[2];if(e===o)return id(n,r,n,r,i);if(this.zoomFactor_){var a=Math.pow(this.zoomFactor_,e-o),s=Math.floor(n*a),l=Math.floor(r*a);return e<o?id(s,s,l,l,i):id(s,Math.floor(a*(n+1))-1,l,Math.floor(a*(r+1))-1,i)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,i)},t.prototype.getTileRangeExtent=function(t,e,i){var o=this.getOrigin(t),n=this.getResolution(t),r=Va(this.getTileSize(t),this.tmpSize_),a=o[0]+e.minX*r[0]*n,s=o[0]+(e.maxX+1)*r[0]*n;return ao(a,o[1]+e.minY*r[1]*n,s,o[1]+(e.maxY+1)*r[1]*n,i)},t.prototype.getTileRangeForExtentAndZ=function(t,e,i){var o=Rd;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,o);var n=o[1],r=o[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,o),id(n,o[1],r,o[2],i)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),o=Va(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*o[0]*i,e[1]-(t[2]+.5)*o[1]*i]},t.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),o=this.getResolution(t[0]),n=Va(this.getTileSize(t[0]),this.tmpSize_),r=i[0]+t[1]*n[0]*o,a=i[1]-(t[2]+1)*n[1]*o;return ao(r,a,r+n[0]*o,a+n[1]*o,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,i,o,n){var r=this.getZForResolution(i),a=i/this.getResolution(r),s=this.getOrigin(r),l=Va(this.getTileSize(r),this.tmpSize_),u=o?.5:0,p=o?.5:0,h=Math.floor((t-s[0])/i+u),d=Math.floor((s[1]-e)/i+p),c=a*h/l[0],g=a*d/l[1];return o?(c=Math.ceil(c)-1,g=Math.ceil(g)-1):(c=Math.floor(c),g=Math.floor(g)),wd(r,c,g,n)},t.prototype.getTileCoordForXYAndZ_=function(t,e,i,o,n){var r=this.getOrigin(i),a=this.getResolution(i),s=Va(this.getTileSize(i),this.tmpSize_),l=o?.5:0,u=o?.5:0,p=Math.floor((t-r[0])/a+l),h=Math.floor((r[1]-e)/a+u),d=p/s[0],c=h/s[1];return o?(d=Math.ceil(d)-1,c=Math.ceil(c)-1):(d=Math.floor(d),c=Math.floor(c)),wd(i,d,c,n)},t.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return De(xt(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),o=this.minZoom;o<e;++o)i[o]=this.getTileRangeForExtentAndZ(t,o);this.fullTileRanges_=i},t}();function Md(t){var e=t.getDefaultTileGrid();return e||(e=Ad(t),t.setDefaultTileGrid(e)),e}function jd(t){var e=t||{},i=e.extent||Qo("EPSG:3857").getExtent(),o={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Dd(i,e.maxZoom,e.tileSize,e.maxResolution)};return new Id(o)}function Dd(t,e,i,o){for(var n=void 0!==e?e:42,r=wo(t),a=Eo(t),s=Va(void 0!==i?i:256),l=o>0?o:Math.max(a/s[0],r/s[1]),u=n+1,p=new Array(u),h=0;h<u;++h)p[h]=l/Math.pow(2,h);return p}function Ad(t,e,i,o){return function(t,e,i,o){var n=void 0!==o?o:qi,r=Dd(t,e,i);return new Id({extent:t,origin:xo(t,n),resolutions:r,tileSize:i})}(Ld(t),e,i,o)}function Ld(t){var e=(t=Qo(t)).getExtent();if(!e){var i=180*xi[ki.DEGREES]/t.getMetersPerUnit();e=ao(-i,-i,i,i)}return e}var Gd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Nd=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;i.on,i.once,i.un,i.opaque_=void 0!==e.opaque&&e.opaque,i.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,i.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var o=e.tileGrid;return o&&Va(o.getTileSize(o.getMinZoom()),[256,256]),i.tileCache=new Td(e.cacheSize||0),i.tmpSize=[0,0],i.key_=e.key||"",i.tileOptions={transition:e.transition},i.zDirection=e.zDirection?e.zDirection:0,i}return Gd(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,i,o){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var r,a,s,l=!0,u=i.minX;u<=i.maxX;++u)for(var p=i.minY;p<=i.maxY;++p)a=Sd(e,u,p),s=!1,n.containsKey(a)&&(s=(r=n.get(a)).getState()===xr)&&(s=!1!==o(r)),s||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,i,o,n){return Jt()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Md(t)},e.prototype.getTileCacheForProjection=function(t){return je(rn(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var o,n,r,a=this.getTileGridForProjection(i),s=this.getTilePixelRatio(e),l=Va(a.getTileSize(t),this.tmpSize);return 1==s?l:(o=l,n=s,void 0===(r=this.tmpSize)&&(r=[0,0]),r[0]=o[0]*n+.5|0,r[1]=o[1]*n+.5|0,r)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),o=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var o=e[0],n=t.getTileCoordCenter(e),r=Ld(i);if(eo(r,n))return e;var a=Eo(r),s=Math.ceil((r[0]-n[0])/a);return n[0]+=a*s,t.getTileCoordForCoordAndZ(n,o)}(o,t,i)),function(t,e){var i=t[0],o=t[1],n=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var r=e.getFullTileRange(i);return!r||r.containsXY(o,n)}(t,o)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,o){},e}(mh),Bd=function(t){function e(e,i){var o=t.call(this,e)||this;return o.tile=i,o}return Gd(e,t),e}(vt),Vd=Nd;function qd(t,e){var i=/\{z\}/g,o=/\{x\}/g,n=/\{y\}/g,r=/\{-y\}/g;return function(a,s,l){return a?t.replace(i,a[0].toString()).replace(o,a[1].toString()).replace(n,a[2].toString()).replace(r,(function(){var t=a[0],i=e.getFullTileRange(t);return je(i,55),(i.getHeight()-a[2]-1).toString()})):void 0}}function Wd(t,e){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=qd(t[n],e);return function(t){if(1===t.length)return t[0];return function(e,i,o){if(e){var n=Ve(function(t){return(t[1]<<t[0])+t[2]}(e),t.length);return t[n](e,i,o)}}}(o)}var Ud=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Xd=function(t){function e(i){var o=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return o.generateTileUrlFunction_=o.tileUrlFunction===e.prototype.tileUrlFunction,o.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(o.tileUrlFunction=i.tileUrlFunction),o.urls=null,i.urls?o.setUrls(i.urls):i.url&&o.setUrl(i.url),o.tileLoadingKeys_={},o}return Ud(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,o=te(i),n=i.getState();n==br?(this.tileLoadingKeys_[o]=!0,e=Pd):o in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[o],e=n==kr?Fd:n==xr?Od:void 0),null!=e&&this.dispatchEvent(new Bd(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var o=i[1].charCodeAt(0),n=i[2].charCodeAt(0),r=void 0;for(r=o;r<=n;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(i[2],10),s=parseInt(i[1],10);s<=a;s++)e.push(t.replace(i[0],s.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(Wd(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,i){},e.prototype.useTile=function(t,e,i){var o=Sd(t,e,i);this.tileCache.containsKey(o)&&this.tileCache.get(o)},e}(Vd),Kd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Yd=[],Zd=function(t){function e(e,i,o,n){var r=t.call(this,e,i,{transition:0})||this;return r.context_={},r.executorGroups={},r.declutterExecutorGroups={},r.loadingSourceTiles=0,r.hitDetectionImageData={},r.replayState_={},r.sourceTiles=[],r.errorTileKeys={},r.wantedResolution,r.getSourceTiles=n.bind(void 0,r),r.wrappedTileCoord=o,r}return Kd(e,t),e.prototype.getContext=function(t){var e=te(t);return e in this.context_||(this.context_[e]=fe(1,1,Yd)),this.context_[e]},e.prototype.hasContext=function(t){return te(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=te(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_)Yd.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(_d),Hd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),$d=function(t){function e(e){var i=this,o=e.projection||"EPSG:3857",n=e.extent||Ld(o),r=e.tileGrid||jd({extent:n,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:o,state:e.state,tileGrid:r,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Jd,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,i.sourceTileCache=new Td(i.tileCache.highWaterMark),i.overlaps_=null==e.overlaps||e.overlaps,i.tileClass=e.tileClass?e.tileClass:xd,i.tileGrids_={},i}return Hd(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],i=this.tileCache;if(0===i.getCount())return e;var o=zd(i.peekFirstKey())[0],n=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===o&&i.getState()===xr)for(var r=i.getSourceTiles(),a=0,s=r.length;a<s;++a){var l=r[a],u=l.tileCoord;if(To(t,n.getTileCoordExtent(u))){var p=l.getFeatures();if(p)for(var h=0,d=p.length;h<d;++h){var c=p[h],g=c.getGeometry();To(t,g.getExtent())&&e.push(c)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,i){var o=this.getTileCacheForProjection(e),n=Object.keys(i).reduce((function(t,e){var i,n,r=Sd((n=(i=e).substring(i.lastIndexOf("/")+1,i.length).split(",").map(Number))[0],n[1],n[2]);if(o.containsKey(r))for(var a=o.get(r).sourceTiles,s=0,l=a.length;s<l;++s)t[a[s].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,i),this.sourceTileCache.expireCache(n)},e.prototype.getSourceTiles=function(t,e,i){var o=this;if(i.getState()===_r){i.setState(br);var n=i.wrappedTileCoord,r=this.getTileGridForProjection(e),a=r.getTileCoordExtent(n),s=n[0],l=r.getResolution(s);Ji(a,-l,a);var u=this.tileGrid,p=u.getExtent();p&&So(a,p,a);var h=u.getZForResolution(l,1);u.forEachTileCoord(a,h,(function(n){var r=o.tileUrlFunction(n,t,e),a=o.sourceTileCache.containsKey(r)?o.sourceTileCache.get(r):new o.tileClass(n,r?_r:wr,r,o.format_,o.tileLoadFunction);i.sourceTiles.push(a);var s=a.getState();if(s<xr){var l=function(t){o.handleTileChange(t);var e=a.getState();if(e===xr||e===kr){var n=a.getKey();n in i.errorTileKeys?a.getState()===xr&&delete i.errorTileKeys[n]:i.loadingSourceTiles--,e===kr?i.errorTileKeys[n]=!0:a.removeEventListener(jt,l),0===i.loadingSourceTiles&&i.setState(Ft(i.errorTileKeys)?xr:kr)}};a.addEventListener(jt,l),i.loadingSourceTiles++}s===_r&&(a.extent=u.getTileCoordExtent(n),a.projection=e,a.resolution=u.getResolution(n[0]),o.sourceTileCache.set(r,a),a.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((function(t){return t.getState()===kr}))?kr:xr)}return i.sourceTiles},e.prototype.getTile=function(t,e,i,o,n){var r,a=Sd(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)&&(r=this.tileCache.get(a)).key===s)return r;var l=[t,e,i],u=this.getTileCoordForTileUrlFunction(l,n),p=this.getTileGrid().getExtent(),h=this.getTileGridForProjection(n);if(u&&p){var d=h.getTileCoordExtent(u);Ji(d,-h.getResolution(t),d),To(p,d)||(u=null)}var c=!0;if(null!==u){var g=this.tileGrid,f=h.getResolution(t),m=g.getZForResolution(f,1),v=h.getTileCoordExtent(u);Ji(v,-f,v),g.forEachTileCoord(v,m,function(t){c=c&&!this.tileUrlFunction(t,o,n)}.bind(this))}var y=new Zd(l,c?wr:_r,u,this.getSourceTiles.bind(this,o,n));return y.key=s,r?(y.interimTile=r,y.refreshInterimChain(),this.tileCache.replace(a,y)):this.tileCache.set(a,y),y},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),i=this.tileGrids_[e];if(!i){var o=this.tileGrid;i=Ad(t,void 0,o?o.getTileSize(o.getMinZoom()):void 0),this.tileGrids_[e]=i}return i},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,i){var o=Va(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(o[0]*e),Math.round(o[1]*e)]},e.prototype.updateCacheSize=function(e,i){t.prototype.updateCacheSize.call(this,2*e,i),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(i).highWaterMark},e}(Xd);function Jd(t,e){t.setLoader((function(i,o,n){Ch(e,t.getFormat(),i,o,n,t.onLoad.bind(t),t.onError.bind(t))}))}var Qd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),tc=function(t){function e(e){return(e=Tt({},e)).controls||(e.controls=Qa()),e.interactions||(e.interactions=td({onFocusOnly:!0})),t.call(this,e)||this}return Qd(e,t),e.prototype.createRenderer=function(){return new ir(this)},e}(Wa),ec=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var ic,oc=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.crossOrigin_=n,s.src_=o,s.key=o,s.image_=new Image,null!==n&&(s.image_.crossOrigin=n),s.unlisten_=null,s.tileLoadFunction_=r,s}return ec(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=xr,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=kr,this.unlistenImage_(),this.image_=((t=fe(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=xr:this.state=wr,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==kr&&(this.state=_r,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==_r&&(this.state=br,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Us(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(_d),nc=function(){function t(t,e,i,o,n,r){this.sourceProj_=t,this.targetProj_=e;var a={},s=sn(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return a[e]||(a[e]=s(t)),a[e]},this.maxSourceExtent_=o,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!o&&!!this.sourceProj_.getExtent()&&Eo(o)==Eo(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Eo(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Eo(this.targetProj_.getExtent()):null;var l=Co(i),u=zo(i),p=_o(i),h=yo(i),d=this.transformInv_(l),c=this.transformInv_(u),g=this.transformInv_(p),f=this.transformInv_(h),m=10+(r?Math.max(0,Math.ceil(Le(vo(i)/(r*r*256*256)))):0);if(this.addQuad_(l,u,p,h,d,c,g,f,m),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach((function(t,e,i){v=Math.min(v,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])-v>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]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,e,i,o,n,r){this.triangles_.push({source:[o,n,r],target:[t,e,i]})},t.prototype.addQuad_=function(t,e,i,o,n,r,a,s,l){var u=$i([n,r,a,s]),p=this.sourceWorldWidth_?Eo(u)/this.sourceWorldWidth_:null,h=this.sourceWorldWidth_,d=this.sourceProj_.canWrapX()&&p>.5&&p<1,c=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)c=Eo($i([t,e,i,o]))/this.targetWorldWidth_>.25||c;!d&&this.sourceProj_.isGlobal()&&p&&(c=p>.25||c)}if(!(!c&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||To(u,this.maxSourceExtent_)){var g=0;if(!(c||isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])))if(l>0)c=!0;else if(1!=(g=(isFinite(n[0])&&isFinite(n[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(a[0])&&isFinite(a[1])?0:2)+(isFinite(s[0])&&isFinite(s[1])?0:1))&&2!=g&&4!=g&&8!=g)return;if(l>0){if(!c){var f=[(t[0]+i[0])/2,(t[1]+i[1])/2],m=this.transformInv_(f),v=void 0;if(d)v=(Ve(n[0],h)+Ve(a[0],h))/2-Ve(m[0],h);else v=(n[0]+a[0])/2-m[0];var y=(n[1]+a[1])/2-m[1];c=v*v+y*y>this.errorThresholdSquared_}if(c){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var _=[(e[0]+i[0])/2,(e[1]+i[1])/2],b=this.transformInv_(_),x=[(o[0]+t[0])/2,(o[1]+t[1])/2],k=this.transformInv_(x);this.addQuad_(t,e,_,x,n,r,b,k,l-1),this.addQuad_(x,_,i,o,k,b,a,s,l-1)}else{var w=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(w),C=[(i[0]+o[0])/2,(i[1]+o[1])/2],z=this.transformInv_(C);this.addQuad_(t,w,C,o,n,S,z,s,l-1),this.addQuad_(w,e,i,C,S,r,a,z,l-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&g)&&this.addTriangle_(t,i,o,n,a,s),0==(14&g)&&this.addTriangle_(t,i,e,n,a,r),g&&(0==(13&g)&&this.addTriangle_(e,o,t,r,s,n),0==(7&g)&&this.addTriangle_(e,o,i,r,s,a))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,o){var n=e.source;co(t,n[0]),co(t,n[1]),co(t,n[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),rc={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function ac(t,e,i,o,n){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(o,n),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,o)+1,Math.max(i,n)),t.restore()}function sc(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function lc(t,e,i,o){var n=ln(i,e,t),r=tn(e,o,i),a=e.getMetersPerUnit();void 0!==a&&(r*=a);var s=t.getMetersPerUnit();void 0!==s&&(r/=s);var l=t.getExtent();if(!l||eo(l,n)){var u=tn(t,r,n)/r;isFinite(u)&&u>0&&(r/=u)}return r}function uc(t,e,i,o,n,r,a,s,l,u,p,h){var d=fe(Math.round(i*t),Math.round(i*e));if(Tt(d,h),0===l.length)return d.canvas;function c(t){return Math.round(t*i)/i}d.scale(i,i),d.globalCompositeOperation="lighter";var g=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){ho(g,t.extent)}));var f=Eo(g),m=wo(g),v=fe(Math.round(i*f/o),Math.round(i*m/o));Tt(v,h);var y=i/o;l.forEach((function(t,e,i){var o=t.extent[0]-g[0],n=-(t.extent[3]-g[3]),r=Eo(t.extent),a=wo(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,o*y,n*y,r*y,a*y)}));var _=Co(a);return s.getTriangles().forEach((function(t,e,n){var a=t.source,s=t.target,l=a[0][0],u=a[0][1],p=a[1][0],f=a[1][1],m=a[2][0],y=a[2][1],b=c((s[0][0]-_[0])/r),x=c(-(s[0][1]-_[1])/r),k=c((s[1][0]-_[0])/r),w=c(-(s[1][1]-_[1])/r),S=c((s[2][0]-_[0])/r),C=c(-(s[2][1]-_[1])/r),z=l,E=u;l=0,u=0;var T=function(t){for(var e=t.length,i=0;i<e;i++){for(var o=i,n=Math.abs(t[i][i]),r=i+1;r<e;r++){var a=Math.abs(t[r][i]);a>n&&(n=a,o=r)}if(0===n)return null;var s=t[o];t[o]=t[i],t[i]=s;for(var l=i+1;l<e;l++)for(var u=-t[l][i]/t[i][i],p=i;p<e+1;p++)i==p?t[l][p]=0:t[l][p]+=u*t[i][p]}for(var h=new Array(e),d=e-1;d>=0;d--){h[d]=t[d][e]/t[d][d];for(var c=d-1;c>=0;c--)t[c][e]-=t[c][d]*h[d]}return h}([[p-=z,f-=E,0,0,k-b],[m-=z,y-=E,0,0,S-b],[0,0,p,f,w-x],[0,0,m,y,C-x]]);if(T){if(d.save(),d.beginPath(),function(){if(void 0===ic){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",ac(t,4,5,4,0),ac(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;ic=sc(e,0)||sc(e,4)||sc(e,8)}return ic}()||h===rc){d.moveTo(k,w);for(var P=b-k,O=x-w,F=0;F<4;F++)d.lineTo(k+c((F+1)*P/4),w+c(F*O/3)),3!=F&&d.lineTo(k+c((F+1)*P/4),w+c((F+1)*O/3));d.lineTo(S,C)}else d.moveTo(k,w),d.lineTo(b,x),d.lineTo(S,C);d.clip(),d.transform(T[0],T[2],T[1],T[3],b,x),d.translate(g[0]-z,g[3]-E),d.scale(o/i,-o/i),d.drawImage(v.canvas,0,0),d.restore()}})),p&&(d.save(),d.globalCompositeOperation="source-over",d.strokeStyle="black",d.lineWidth=1,s.getTriangles().forEach((function(t,e,i){var o=t.target,n=(o[0][0]-_[0])/r,a=-(o[0][1]-_[1])/r,s=(o[1][0]-_[0])/r,l=-(o[1][1]-_[1])/r,u=(o[2][0]-_[0])/r,p=-(o[2][1]-_[1])/r;d.beginPath(),d.moveTo(s,l),d.lineTo(n,a),d.lineTo(u,p),d.closePath(),d.stroke()})),d.restore()),d.canvas}var pc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hc=function(t){function e(e,i,o,n,r,a,s,l,u,p,h,d){var c=t.call(this,r,_r)||this;c.renderEdges_=void 0!==h&&h,c.contextOptions_=d,c.pixelRatio_=s,c.gutter_=l,c.canvas_=null,c.sourceTileGrid_=i,c.targetTileGrid_=n,c.wrappedTileCoord_=a||r,c.sourceTiles_=[],c.sourcesListenerKeys_=null,c.sourceZ_=0;var g=n.getTileCoordExtent(c.wrappedTileCoord_),f=c.targetTileGrid_.getExtent(),m=c.sourceTileGrid_.getExtent(),v=f?So(g,f):g;if(0===vo(v))return c.state=wr,c;var y=e.getExtent();y&&(m=m?So(m,y):y);var _=n.getResolution(c.wrappedTileCoord_[0]),b=function(t,e,i,o){var n=bo(i),r=lc(t,e,n,o);return(!isFinite(r)||r<=0)&&mo(i,(function(i){return r=lc(t,e,i,o),isFinite(r)&&r>0})),r}(e,o,v,_);if(!isFinite(b)||b<=0)return c.state=wr,c;var x=void 0!==p?p:.5;if(c.triangulation_=new nc(e,o,v,m,b*x,_),0===c.triangulation_.getTriangles().length)return c.state=wr,c;c.sourceZ_=i.getZForResolution(b);var k=c.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(k[1]=De(k[1],m[1],m[3]),k[3]=De(k[3],m[1],m[3])):k=So(k,m)),vo(k)){for(var w=i.getTileRangeForExtentAndZ(k,c.sourceZ_),S=w.minX;S<=w.maxX;S++)for(var C=w.minY;C<=w.maxY;C++){var z=u(c.sourceZ_,S,C,s);z&&c.sourceTiles_.push(z)}0===c.sourceTiles_.length&&(c.state=wr)}else c.state=wr;return c}return pc(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,o){e&&e.getState()==xr&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=kr;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),o="number"==typeof i?i:i[0],n="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=uc(o,n,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),r,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=xr}this.changed()},e.prototype.load=function(){if(this.state==_r){this.state=br,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,o){var n=e.getState();if(n==_r||n==br){t++;var r=Xt(e,jt,(function(i){var o=e.getState();o!=xr&&o!=kr&&o!=wr||(Yt(r),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,i){t.getState()==_r&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Yt),this.sourcesListenerKeys_=null},e}(_d),dc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function cc(t,e){t.getImage().src=e}var gc=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:cc,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 i.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,i.tileClass=void 0!==e.tileClass?e.tileClass:oc,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?rc:void 0,i.renderReprojectionEdges_=!1,i}return dc(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var o in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[o];n.expireCache(n==i?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!rn(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&&!rn(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!rn(e,t)){var i=te(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Md(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||rn(e,t))return this.tileCache;var i=te(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Td(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,o,n,r){var a=[t,e,i],s=this.getTileCoordForTileUrlFunction(a,n),l=s?this.tileUrlFunction(s,o,n):void 0,u=new this.tileClass(a,void 0!==l?_r:wr,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=r,u.addEventListener(jt,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,i,o,n){var r=this.getProjection();if(r&&n&&!rn(r,n)){var a=this.getTileCacheForProjection(n),s=[t,e,i],l=void 0,u=Cd(s);a.containsKey(u)&&(l=a.get(u));var p=this.getKey();if(l&&l.key==p)return l;var h=this.getTileGridForProjection(r),d=this.getTileGridForProjection(n),c=this.getTileCoordForTileUrlFunction(s,n),g=new hc(r,h,n,d,s,c,this.getTilePixelRatio(o),this.getGutter(),function(t,e,i,o){return this.getTileInternal(t,e,i,o,r)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return g.key=p,l?(g.interimTile=l,g.refreshInterimChain(),a.replace(u,g)):a.set(u,g),g}return this.getTileInternal(t,e,i,o,r||n)},e.prototype.getTileInternal=function(t,e,i,o,n){var r=null,a=Sd(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)){if((r=this.tileCache.get(a)).key!=s){var l=r;r=this.createTile_(t,e,i,o,n,s),l.getState()==_r?r.interimTile=l.interimTile:r.interimTile=l,r.refreshInterimChain(),this.tileCache.replace(a,r)}}else r=this.createTile_(t,e,i,o,n,s),this.tileCache.set(a,r);return r},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=Qo(t);if(i){var o=te(i);o in this.tileGridForProjection||(this.tileGridForProjection[o]=e)}},e}(Xd),fc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),mc=function(t){function e(e){var i=this,o=e||{},n=Tt({},o);return delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,i.setPreload(void 0!==o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return fc(e,t),e.prototype.getPreload=function(){return this.get(gd)},e.prototype.setPreload=function(t){this.set(gd,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(fd)},e.prototype.setUseInterimTilesOnError=function(t){this.set(fd,t)},e}(ei),vc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yc=function(t){function e(e){return t.call(this,e)||this}return vc(e,t),e.prototype.createRenderer=function(){return new ad(this)},e}(mc),_c=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),bc=function(t){function e(e){var i=e||{},o=void 0!==i.projection?i.projection:"EPSG:3857",n=void 0!==i.tileGrid?i.tileGrid:jd({extent:Ld(o),maxResolution:i.maxResolution,maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});return t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,opaque:i.opaque,projection:o,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this}return _c(e,t),e}(gc),xc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),kc='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',wc=function(t){function e(e){var i,o=e||{};i=void 0!==o.attributions?o.attributions:[kc];var n=void 0!==o.crossOrigin?o.crossOrigin:"anonymous",r=void 0!==o.url?o.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:o.cacheSize,crossOrigin:n,imageSmoothing:o.imageSmoothing,maxZoom:void 0!==o.maxZoom?o.maxZoom:19,opaque:void 0===o.opaque||o.opaque,reprojectionErrorThreshold:o.reprojectionErrorThreshold,tileLoadFunction:o.tileLoadFunction,transition:o.transition,url:r,wrapX:o.wrapX,zDirection:o.zDirection})||this}return xc(e,t),e}(bc);const Sc=Array.isArray;function Cc(t,e){if(1===arguments.length)return e=>Cc(t,e);if(t<1)throw new Error("First argument to splitEvery must be a positive integer");const i=[];let o=0;for(;o<e.length;)i.push(e.slice(o,o+=t));return i}(function t(e,i=[]){return(...o)=>{return(n=[...i,...o]).length>=e.length?e(...n):t(e,n);var n}})((function(t,e,i){if(!Sc(i))throw new TypeError("reduce: list must be array or iterable");let o=0;const n=i.length;for(;o<n;)e=t(e,i[o],o,i),o++;return e}))((function t(e,i){return 1===arguments.length?i=>t(e,i):e*i}),1);const zc=new Ph({features:[],wrapX:!1}),Ec=new dh({source:zc,style:new ll({image:new il({radius:3,fill:new Os({color:"grey"})})})});function Tc(t,e){var i,o,n;const r=t&&(null==(n=null==(o=null==(i=t.getSource())?void 0:i.getFeaturesInExtent(e))?void 0:o.filter((t=>{var e;return"Point"!==(null==(e=t.getGeometry())?void 0:e.getType())})))?void 0:n.flatMap((t=>t.flatCoordinates_)));if(r)return Cc(2,r).forEach(((t,e)=>{zc.addFeature(new es({geometry:new va(t),i:e}))}))}const Pc={color:"#ff0000",width:3},Oc=new $s(Pc),Fc=new $s(l(s({},Pc),{lineDash:[2,8]})),Rc=new Os({color:"rgba(255, 0, 0, 0.1)"}),Ic=new tl({stroke:new $s({color:"red",width:2}),points:4,radius1:15,radius2:1}),Mc=new il({radius:6,fill:new Os({color:"#ff0000"})}),jc=new ll({image:new tl({fill:new Os({color:"#fff"}),stroke:new $s({color:"#ff0000",width:2}),points:4,radius:5,angle:Math.PI/4}),geometry:function(t){const e=t.getGeometry();if(e instanceof Ia){const t=e.getCoordinates()[0];return new _s(t)}}}),Dc=new Ph,Ac=new dh({source:Dc,style:[new ll({fill:Rc,stroke:Oc}),jc]});const Lc=new Qh({source:zc,pixelTolerance:15});
35
+ read:function(t,e,i,o,n){var r,a,s=8*n-o-1,l=(1<<s)-1,u=l>>1,p=-7,h=i?n-1:0,d=i?-1:1,c=t[e+h];for(h+=d,r=c&(1<<-p)-1,c>>=-p,p+=s;p>0;r=256*r+t[e+h],h+=d,p-=8);for(a=r&(1<<-p)-1,r>>=-p,p+=o;p>0;a=256*a+t[e+h],h+=d,p-=8);if(0===r)r=1-u;else{if(r===l)return a?NaN:1/0*(c?-1:1);a+=Math.pow(2,o),r-=u}return(c?-1:1)*a*Math.pow(2,r-o)},write:function(t,e,i,o,n,r){var a,s,l,u=8*r-n-1,p=(1<<u)-1,h=p>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,c=o?0:r-1,g=o?1:-1,f=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=p?(s=0,a=p):a+h>=1?(s=(e*l-1)*Math.pow(2,n),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[i+c]=255&s,c+=g,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;t[i+c]=255&a,c+=g,a/=256,u-=8);t[i+c-g]|=128*f}},vl=_l,yl=ml;function _l(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}_l.Varint=0,_l.Fixed64=1,_l.Bytes=2,_l.Fixed32=5;var bl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function xl(t){return t.type===_l.Bytes?t.readVarint()+t.pos:t.pos+1}function kl(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function wl(t,e,i){var o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(o);for(var n=i.pos-1;n>=t;n--)i.buf[n+o]=i.buf[n]}function Sl(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Cl(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function zl(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function El(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Tl(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Pl(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Ol(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Fl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Rl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Il(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Ml(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function jl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}_l.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var o=this.readVarint(),n=o>>3,r=this.pos;this.type=7&o,t(n,e,this),this.pos===r&&this.skip(o)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Il(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=jl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Il(this.buf,this.pos)+4294967296*Il(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Il(this.buf,this.pos)+4294967296*jl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=yl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=yl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,o=this.buf;return e=127&(i=o[this.pos++]),i<128?e:(e|=(127&(i=o[this.pos++]))<<7,i<128?e:(e|=(127&(i=o[this.pos++]))<<14,i<128?e:(e|=(127&(i=o[this.pos++]))<<21,i<128?e:function(t,e,i){var o,n,r=i.buf;if(n=r[i.pos++],o=(112&n)>>4,n<128)return kl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<3,n<128)return kl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<10,n<128)return kl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<17,n<128)return kl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<24,n<128)return kl(t,o,e);if(n=r[i.pos++],o|=(1&n)<<31,n<128)return kl(t,o,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=o[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&bl?function(t,e,i){return bl.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var o="",n=e;for(;n<i;){var r,a,s,l=t[n],u=null,p=l>239?4:l>223?3:l>191?2:1;if(n+p>i)break;1===p?l<128&&(u=l):2===p?128==(192&(r=t[n+1]))&&(u=(31&l)<<6|63&r)<=127&&(u=null):3===p?(r=t[n+1],a=t[n+2],128==(192&r)&&128==(192&a)&&((u=(15&l)<<12|(63&r)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===p&&(r=t[n+1],a=t[n+2],s=t[n+3],128==(192&r)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&r)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,p=1):u>65535&&(u-=65536,o+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),o+=String.fromCharCode(u),n+=p}return o}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==_l.Bytes)return t.push(this.readVarint(e));var i=xl(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==_l.Bytes)return t.push(this.readSVarint());var e=xl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==_l.Bytes)return t.push(this.readBoolean());var e=xl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==_l.Bytes)return t.push(this.readFloat());var e=xl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==_l.Bytes)return t.push(this.readDouble());var e=xl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==_l.Bytes)return t.push(this.readFixed32());var e=xl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==_l.Bytes)return t.push(this.readSFixed32());var e=xl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==_l.Bytes)return t.push(this.readFixed64());var e=xl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==_l.Bytes)return t.push(this.readSFixed64());var e=xl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===_l.Varint)for(;this.buf[this.pos++]>127;);else if(e===_l.Bytes)this.pos=this.readVarint()+this.pos;else if(e===_l.Fixed32)this.pos+=4;else{if(e!==_l.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Ml(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Ml(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Ml(this.buf,-1&t,this.pos),Ml(this.buf,Math.floor(2.3283064365386963e-10*t),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Ml(this.buf,-1&t,this.pos),Ml(this.buf,Math.floor(2.3283064365386963e-10*t),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,o;t>=0?(i=t%4294967296|0,o=t/4294967296|0):(o=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,o=o+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,e),function(t,e){var i=(7&t)<<4;if(e.buf[e.pos++]|=i|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(o,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var o,n,r=0;r<e.length;r++){if((o=e.charCodeAt(r))>55295&&o<57344){if(!n){o>56319||r+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=o;continue}if(o<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=o;continue}o=n-55296<<10|o-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);o<128?t[i++]=o:(o<2048?t[i++]=o>>6|192:(o<65536?t[i++]=o>>12|224:(t[i++]=o>>18|240,t[i++]=o>>12&63|128),t[i++]=o>>6&63|128),t[i++]=63&o|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&wl(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),yl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),yl.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var o=this.pos-i;o>=128&&wl(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o},writeMessage:function(t,e,i){this.writeTag(t,_l.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Sl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Cl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Tl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,zl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,El,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Pl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Ol,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Fl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Rl,e)},writeBytesField:function(t,e){this.writeTag(t,_l.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,_l.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,_l.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,_l.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,_l.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,_l.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,_l.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,_l.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,_l.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,_l.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Dl=[1,0,0,1,0,0],Al=function(){function t(t,e,i,o,n){this.extent_,this.id_=n,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=o}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Fo?lo(this.flatCoordinates_):uo(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=bo(this.getExtent());this.flatInteriorPoints_=xa(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=fs(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=ka(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=as(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,i=this.ends_,o=0,n=i.length;o<n;++o){var r=i[o],a=as(t,e,r,2,.5);wt(this.flatMidpoints_,a),e=r}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=Qo(t)).getExtent(),i=t.getWorldExtent();if(e&&i){var o=wo(i)/wo(e);wn(Dl,i[0],i[3],o,-o,0,0,0),Vr(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Dl,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();Al.prototype.getEndss=Al.prototype.getEnds,Al.prototype.getFlatCoordinates=Al.prototype.getOrientedFlatCoordinates;var Ll=Al,Gl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Nl(t,e,i){if(3===t){var o={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(Bl,o,n),o.length=o.features.length,o.length&&(e[o.name]=o)}}function Bl(t,e,i){if(15===t)e.version=i.readVarint();else if(1===t)e.name=i.readString();else if(5===t)e.extent=i.readVarint();else if(2===t)e.features.push(i.pos);else if(3===t)e.keys.push(i.readString());else if(4===t){for(var o=null,n=i.readVarint()+i.pos;i.pos<n;)o=1===(t=i.readVarint()>>3)?i.readString():2===t?i.readFloat():3===t?i.readDouble():4===t?i.readVarint64():5===t?i.readVarint():6===t?i.readSVarint():7===t?i.readBoolean():null;e.values.push(o)}}function Vl(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var o=i.readVarint()+i.pos;i.pos<o;){var n=e.layer.keys[i.readVarint()],r=e.layer.values[i.readVarint()];e.properties[n]=r}else 3==t?e.type=i.readVarint():4==t&&(e.geometry=i.pos)}function ql(t,e,i){t.pos=e.features[i];var o=t.readVarint()+t.pos,n={layer:e,type:0,properties:{}};return t.readFields(Vl,n,o),n}var Wl=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.dataProjection=new wi({code:"",units:ki.TILE_PIXELS}),i.featureClass_=o.featureClass?o.featureClass:Ll,i.geometryName_=o.geometryName,i.layerName_=o.layerName?o.layerName:"layer",i.layers_=o.layers?o.layers:null,i.idProperty_=o.idProperty,i.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],i}return Gl(e,t),e.prototype.readRawGeometry_=function(t,e,i,o){t.pos=e.geometry;for(var n=t.readVarint()+t.pos,r=1,a=0,s=0,l=0,u=0,p=0;t.pos<n;){if(!a){var h=t.readVarint();r=7&h,a=h>>3}a--,1===r||2===r?(s+=t.readSVarint(),l+=t.readSVarint(),1===r&&u>p&&(o.push(u),p=u),i.push(s,l),u+=2):7===r?u>p&&(i.push(i[p],i[p+1]),u+=2):je(!1,59)}u>p&&(o.push(u),p=u)},e.prototype.createFeature_=function(t,e,i){var o,n=e.type;if(0===n)return null;var r,a=e.properties;this.idProperty_?(r=a[this.idProperty_],delete a[this.idProperty_]):r=e.id,a[this.layerName_]=e.layer.name;var s=[],l=[];this.readRawGeometry_(t,e,s,l);var u=function(t,e){var i;1===t?i=1===e?Fo:jo:2===t?i=1===e?Ro:Do:3===t&&(i=Mo);return i}(n,l.length);if(this.featureClass_===Ll)(o=new this.featureClass_(u,s,l,a,r)).transform(i.dataProjection);else{var p=void 0;if(u==Mo){for(var h=[],d=0,c=0,g=0,f=l.length;g<f;++g){var m=l[g];if(Ea(s,d,m,2)){if(0===h.length)continue;h[h.length-1].push(l[c])}else h.push(l.slice(c,g+1));c=g+1,d=m}p=h.length>1?new vs(s,Lr,h):new Ia(s,Lr,l)}else p=u===Fo?new va(s,Lr):u===Ro?new ps(s,Lr):u===Mo?new Ia(s,Lr,l):u===jo?new gs(s,Lr):u===Do?new ds(s,Lr,l):null;o=new(0,this.featureClass_),this.geometryName_&&o.setGeometryName(this.geometryName_);var v=xs(p,!1,i);o.setGeometry(v),o.setId(r),o.setProperties(a,!0)}return o},e.prototype.getType=function(){return ks},e.prototype.readFeatures=function(t,e){var i=this.layers_,o=this.adaptOptions(e),n=Qo(o.dataProjection);n.setWorldExtent(o.extent),o.dataProjection=n;var r=new vl(t),a=r.readFields(Nl,{}),s=[];for(var l in a)if(!i||-1!=i.indexOf(l)){var u=a[l],p=u?[0,0,u.extent,u.extent]:null;n.setExtent(p);for(var h=0,d=u.length;h<d;++h){var c=ql(r,u,h);s.push(this.createFeature_(r,c,o))}}return s},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(bs);function Ul(t,e,i,o,n){Xl(t,e,i||0,o||t.length-1,n||Yl)}function Xl(t,e,i,o,n){for(;o>i;){if(o-i>600){var r=o-i+1,a=e-i+1,s=Math.log(r),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(r-l)/r)*(a-r/2<0?-1:1);Xl(t,e,Math.max(i,Math.floor(e-a*l/r+u)),Math.min(o,Math.floor(e+(r-a)*l/r+u)),n)}var p=t[e],h=i,d=o;for(Kl(t,i,e),n(t[o],p)>0&&Kl(t,i,o);h<d;){for(Kl(t,h,d),h++,d--;n(t[h],p)<0;)h++;for(;n(t[d],p)>0;)d--}0===n(t[i],p)?Kl(t,i,d):Kl(t,++d,o),d<=e&&(i=d+1),e<=d&&(o=d-1)}}function Kl(t,e,i){var o=t[e];t[e]=t[i],t[i]=o}function Yl(t,e){return t<e?-1:t>e?1:0}class Zl{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!au(t,e))return i;const o=this.toBBox,n=[];for(;e;){for(let r=0;r<e.children.length;r++){const a=e.children[r],s=e.leaf?o(a):a;au(t,s)&&(e.leaf?i.push(a):ru(t,s)?this._all(a,i):n.push(a))}e=n.pop()}return i}collides(t){let e=this.data;if(!au(t,e))return!1;const i=[];for(;e;){for(let o=0;o<e.children.length;o++){const n=e.children[o],r=e.leaf?this.toBBox(n):n;if(au(t,r)){if(e.leaf||ru(t,r))return!0;i.push(n)}}e=i.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=su([]),this}remove(t,e){if(!t)return this;let i=this.data;const o=this.toBBox(t),n=[],r=[];let a,s,l;for(;i||n.length;){if(i||(i=n.pop(),s=n[n.length-1],a=r.pop(),l=!0),i.leaf){const o=Hl(t,i.children,e);if(-1!==o)return i.children.splice(o,1),n.push(i),this._condense(n),this}l||i.leaf||!ru(i,o)?s?(a++,i=s.children[a],l=!1):i=null:(n.push(i),r.push(a),a=0,s=i,i=i.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,o){const n=i-e+1;let r,a=this._maxEntries;if(n<=a)return r=su(t.slice(e,i+1)),$l(r,this.toBBox),r;o||(o=Math.ceil(Math.log(n)/Math.log(a)),a=Math.ceil(n/Math.pow(a,o-1))),r=su([]),r.leaf=!1,r.height=o;const s=Math.ceil(n/a),l=s*Math.ceil(Math.sqrt(a));lu(t,e,i,l,this.compareMinX);for(let u=e;u<=i;u+=l){const e=Math.min(u+l-1,i);lu(t,u,e,s,this.compareMinY);for(let i=u;i<=e;i+=s){const n=Math.min(i+s-1,e);r.children.push(this._build(t,i,n,o-1))}}return $l(r,this.toBBox),r}_chooseSubtree(t,e,i,o){for(;o.push(e),!e.leaf&&o.length-1!==i;){let i,o=1/0,a=1/0;for(let s=0;s<e.children.length;s++){const l=e.children[s],u=iu(l),p=(n=t,r=l,(Math.max(r.maxX,n.maxX)-Math.min(r.minX,n.minX))*(Math.max(r.maxY,n.maxY)-Math.min(r.minY,n.minY))-u);p<a?(a=p,o=u<o?u:o,i=l):p===a&&u<o&&(o=u,i=l)}e=i||e.children[0]}var n,r;return e}_insert(t,e,i){const o=i?t:this.toBBox(t),n=[],r=this._chooseSubtree(o,this.data,e,n);for(r.children.push(t),Ql(r,o);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(o,n,e)}_split(t,e){const i=t[e],o=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,o);const r=this._chooseSplitIndex(i,n,o),a=su(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,$l(i,this.toBBox),$l(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=su([t,e]),this.data.height=t.height+1,this.data.leaf=!1,$l(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let o,n=1/0,r=1/0;for(let a=e;a<=i-e;a++){const e=Jl(t,0,a,this.toBBox),s=Jl(t,a,i,this.toBBox),l=nu(e,s),u=iu(e)+iu(s);l<n?(n=l,o=a,r=u<r?u:r):l===n&&u<r&&(r=u,o=a)}return o||i-e}_chooseSplitAxis(t,e,i){const o=t.leaf?this.compareMinX:tu,n=t.leaf?this.compareMinY:eu;this._allDistMargin(t,e,i,o)<this._allDistMargin(t,e,i,n)&&t.children.sort(o)}_allDistMargin(t,e,i,o){t.children.sort(o);const n=this.toBBox,r=Jl(t,0,e,n),a=Jl(t,i-e,i,n);let s=ou(r)+ou(a);for(let l=e;l<i-e;l++){const e=t.children[l];Ql(r,t.leaf?n(e):e),s+=ou(r)}for(let l=i-e-1;l>=e;l--){const e=t.children[l];Ql(a,t.leaf?n(e):e),s+=ou(a)}return s}_adjustParentBBoxes(t,e,i){for(let o=i;o>=0;o--)Ql(e[o],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children,e.splice(e.indexOf(t[i]),1)):this.clear():$l(t[i],this.toBBox)}}function Hl(t,e,i){if(!i)return e.indexOf(t);for(let o=0;o<e.length;o++)if(i(t,e[o]))return o;return-1}function $l(t,e){Jl(t,0,t.children.length,e,t)}function Jl(t,e,i,o,n){n||(n=su(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r=e;r<i;r++){const e=t.children[r];Ql(n,t.leaf?o(e):e)}return n}function Ql(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 tu(t,e){return t.minX-e.minX}function eu(t,e){return t.minY-e.minY}function iu(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ou(t){return t.maxX-t.minX+(t.maxY-t.minY)}function nu(t,e){const i=Math.max(t.minX,e.minX),o=Math.max(t.minY,e.minY),n=Math.min(t.maxX,e.maxX),r=Math.min(t.maxY,e.maxY);return Math.max(0,n-i)*Math.max(0,r-o)}function ru(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function au(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function su(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function lu(t,e,i,o,n){const r=[e,i];for(;r.length;){if((i=r.pop())-(e=r.pop())<=o)continue;const a=e+Math.ceil((i-e)/o/2)*o;Ul(t,a,e,i,n),r.push(e,a,a,i)}}var uu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),pu="renderOrder",hu=function(t){function e(e){var i=this,o=e||{},n=Tt({},o);return delete n.style,delete n.renderBuffer,delete n.updateWhileAnimating,delete n.updateWhileInteracting,(i=t.call(this,n)||this).declutter_=void 0!==o.declutter&&o.declutter,i.renderBuffer_=void 0!==o.renderBuffer?o.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(o.style),i.updateWhileAnimating_=void 0!==o.updateWhileAnimating&&o.updateWhileAnimating,i.updateWhileInteracting_=void 0!==o.updateWhileInteracting&&o.updateWhileInteracting,i}return uu(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(pu)},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 Zl(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(pu,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:ll,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;Array.isArray(t)?i=t:(je("function"==typeof t.getZIndex,41),i=[t]),e=function(){return i}}return e}(this.style_),this.changed()},e}(ei),du={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},cu=[du.FILL],gu=[du.STROKE],fu=[du.BEGIN_PATH],mu=[du.CLOSE_PATH],vu=du,yu=function(){function t(){}return t.prototype.drawCustom=function(t,e,i,o){},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}(),_u=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),bu=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.tolerance=e,r.maxExtent=i,r.pixelRatio=n,r.maxLineWidth=0,r.resolution=o,r.beginGeometryInstruction1_=null,r.beginGeometryInstruction2_=null,r.bufferedMaxExtent_=null,r.instructions=[],r.coordinates=[],r.tmpCoordinate_=[],r.hitDetectionInstructions=[],r.state={},r}return _u(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var i=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,n=this.coordinates,r=n.length,a=0,s=t.length;a<s;a+=e)o[0]=t[a],o[1]=t[a+1],eo(i,o)&&(n[r++]=o[0],n[r++]=o[1]);return r},e.prototype.appendFlatLineCoordinates=function(t,e,i,o,n,r){var a=this.coordinates,s=a.length,l=this.getBufferedMaxExtent();r&&(e+=o);var u,p,h,d=t[e],c=t[e+1],g=this.tmpCoordinate_,f=!0;for(u=e+o;u<i;u+=o)g[0]=t[u],g[1]=t[u+1],(h=no(l,g))!==p?(f&&(a[s++]=d,a[s++]=c,f=!1),a[s++]=g[0],a[s++]=g[1]):h===Xi?(a[s++]=g[0],a[s++]=g[1],f=!1):f=!0,d=g[0],c=g[1],p=h;return(n&&f||u===e+o)&&(a[s++]=d,a[s++]=c),s},e.prototype.drawCustomCoordinates_=function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r],l=this.appendFlatLineCoordinates(t,e,s,o,!1,!1);n.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,i,o){this.beginGeometry(t,e);var n,r,a,s,l,u=t.getType(),p=t.getStride(),h=this.coordinates.length;switch(u){case Ao:n=t.getOrientedFlatCoordinates(),s=[];var d=t.getEndss();l=0;for(var c=0,g=d.length;c<g;++c){var f=[];l=this.drawCustomCoordinates_(n,l,d[c],p,f),s.push(f)}this.instructions.push([vu.CUSTOM,h,s,t,i,ha]),this.hitDetectionInstructions.push([vu.CUSTOM,h,s,t,o||i,ha]);break;case Mo:case Do:a=[],n=u==Mo?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(n,0,t.getEnds(),p,a),this.instructions.push([vu.CUSTOM,h,a,t,i,pa]),this.hitDetectionInstructions.push([vu.CUSTOM,h,a,t,o||i,pa]);break;case Ro:case Go:n=t.getFlatCoordinates(),r=this.appendFlatLineCoordinates(n,0,n.length,p,!1,!1),this.instructions.push([vu.CUSTOM,h,r,t,i,ua]),this.hitDetectionInstructions.push([vu.CUSTOM,h,r,t,o||i,ua]);break;case jo:n=t.getFlatCoordinates(),(r=this.appendFlatPointCoordinates(n,p))>h&&(this.instructions.push([vu.CUSTOM,h,r,t,i,ua]),this.hitDetectionInstructions.push([vu.CUSTOM,h,r,t,o||i,ua]));break;case Fo:n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),r=this.coordinates.length,this.instructions.push([vu.CUSTOM,h,r,t,i]),this.hitDetectionInstructions.push([vu.CUSTOM,h,r,t,o||i])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[vu.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[vu.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,o,n=e.length,r=-1;for(t=0;t<n;++t)(o=(i=e[t])[0])==vu.END_GEOMETRY?r=t:o==vu.BEGIN_GEOMETRY&&(i[2]=t,kt(this.hitDetectionInstructions,r,t),r=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var o=t.getColor();i.fillStyle=el(o||"#000")}else i.fillStyle=void 0;if(e){var n=e.getColor();i.strokeStyle=el(n||"#000");var r=e.getLineCap();i.lineCap=void 0!==r?r:"round";var a=e.getLineDash();i.lineDash=a?a.slice():Vn;var s=e.getLineDashOffset();i.lineDashOffset=s||0;var l=e.getLineJoin();i.lineJoin=void 0!==l?l:"round";var u=e.getWidth();i.lineWidth=void 0!==u?u:1;var p=e.getMiterLimit();i.miterLimit=void 0!==p?p:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[vu.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[vu.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,o=t.lineCap,n=t.lineDash,r=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=o||n!=t.currentLineDash&&!St(t.currentLineDash,n)||t.currentLineDashOffset!=r||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=o,t.currentLineDash=n,t.currentLineDashOffset=r,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[vu.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Qi(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Ji(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(yu),xu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ku=function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterImageWithText_=void 0,r}return xu(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([vu.DRAW_IMAGE,n,r,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([vu.DRAW_IMAGE,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([vu.DRAW_IMAGE,n,r,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([vu.DRAW_IMAGE,n,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),o=t.getSize(),n=t.getHitDetectionImage(),r=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n,this.image_=r,this.height_=o[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=o[0],this.declutterImageWithText_=e},e}(bu),wu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Su=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return wu(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,o){var n=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,i,o,!1,!1),a=[vu.MOVE_TO_LINE_TO,n,r];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i},e.prototype.drawLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([vu.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Vn,0],fu);var r=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(r,0,r.length,a),this.hitDetectionInstructions.push(gu),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([vu.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],fu);for(var r=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinates_(a,l,r[u],s);this.hitDetectionInstructions.push(gu),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(gu),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(gu),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(fu)},e}(bu),Cu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),zu=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return Cu(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,i,o){var n=this.state,r=void 0!==n.fillStyle,a=void 0!==n.strokeStyle,s=i.length;this.instructions.push(fu),this.hitDetectionInstructions.push(fu);for(var l=0;l<s;++l){var u=i[l],p=this.coordinates.length,h=this.appendFlatLineCoordinates(t,e,u,o,!0,!a),d=[vu.MOVE_TO_LINE_TO,p,h];this.instructions.push(d),this.hitDetectionInstructions.push(d),a&&(this.instructions.push(mu),this.hitDetectionInstructions.push(mu)),e=u}return r&&(this.instructions.push(cu),this.hitDetectionInstructions.push(cu)),a&&(this.instructions.push(gu),this.hitDetectionInstructions.push(gu)),e},e.prototype.drawCircle=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([vu.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([vu.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatLineCoordinates(r,0,r.length,a,!1,!1);var l=[vu.CIRCLE,s];this.instructions.push(fu,l),this.hitDetectionInstructions.push(fu,l),void 0!==i.fillStyle&&(this.instructions.push(cu),this.hitDetectionInstructions.push(cu)),void 0!==i.strokeStyle&&(this.instructions.push(gu),this.hitDetectionInstructions.push(gu)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([vu.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([vu.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,r,s),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([vu.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([vu.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var r=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinatess_(a,l,r[u],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var i=this.coordinates,o=0,n=i.length;o<n;++o)i[o]=aa(i[o],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}(bu);function Eu(t,e,i,o,n){var r,a,s,l,u,p,h,d,c,g=i,f=i,m=0,v=0,y=i;for(r=i;r<o;r+=n){var _=e[r],b=e[r+1];void 0!==l&&(d=_-l,c=b-u,s=Math.sqrt(d*d+c*c),void 0!==p&&(v+=a,Math.acos((p*d+h*c)/(a*s))>t&&(v>m&&(m=v,g=y,f=r),v=0,y=r-n)),a=s,p=d,h=c),l=_,u=b}return(v+=s)>m?[y,r]:[g,f]}var Tu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Pu={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Ou={Circle:zu,Default:bu,Image:ku,LineString:Su,Polygon:zu,Text:function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return Tu(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,o=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||o)){var r=this.coordinates,a=r.length,s=t.getType(),l=null,u=t.getStride();if(n.placement!==cl||s!=Ro&&s!=Do&&s!=Mo&&s!=Ao){var p=n.overflow?null:[];switch(s){case Fo:case jo:l=t.getFlatCoordinates();break;case Ro:l=t.getFlatMidpoint();break;case Go:l=t.getCenter();break;case Do:l=t.getFlatMidpoints(),u=2;break;case Mo:l=t.getFlatInteriorPoint(),n.overflow||p.push(l[2]/this.resolution),u=3;break;case Ao:var h=t.getFlatInteriorPoints();l=[];for(k=0,w=h.length;k<w;k+=3)n.overflow||p.push(h[k+2]/this.resolution),l.push(h[k],h[k+1]);if(0===l.length)return;u=2}if((O=this.appendFlatPointCoordinates(l,u))===a)return;if(p&&(O-a)/2!=l.length/u){var d=a/2;p=p.filter((function(t,e){var i=r[2*(d+e)]===l[e*u]&&r[2*(d+e)+1]===l[e*u+1];return i||--d,i}))}this.saveTextStates_(),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var c=n.padding;if(c!=qn&&(n.scale[0]<0||n.scale[1]<0)){var g=n.padding[0],f=n.padding[1],m=n.padding[2],v=n.padding[3];n.scale[0]<0&&(f=-f,v=-v),n.scale[1]<0&&(g=-g,m=-m),c=[g,f,m,v]}var y=this.pixelRatio;this.instructions.push([vu.DRAW_IMAGE,a,O,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,c==qn?qn:c.map((function(t){return t*y})),!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]);var _=1/y;this.hitDetectionInstructions.push([vu.DRAW_IMAGE,a,O,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,this.declutterImageWithText_,c,!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]),this.endGeometry(e)}else{if(!To(this.getBufferedMaxExtent(),t.getExtent()))return;var b=void 0;if(l=t.getFlatCoordinates(),s==Ro)b=[l.length];else if(s==Do)b=t.getEnds();else if(s==Mo)b=t.getEnds().slice(0,1);else if(s==Ao){var x=t.getEndss();b=[];for(var k=0,w=x.length;k<w;++k)b.push(x[k][0])}this.beginGeometry(t,e);for(var S=n.textAlign,C=0,z=void 0,E=0,T=b.length;E<T;++E){if(null==S){var P=Eu(n.maxAngle,l,C,b[E],u);C=P[0],z=P[1]}else z=b[E];for(var k=C;k<z;k+=u)r.push(l[k],l[k+1]);var O=r.length;C=b[E],this.drawChars_(a,O),a=O}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,o=this.strokeKey_;t&&(o in this.strokeStates||(this.strokeStates[o]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var n=this.textKey_;n in this.textStates||(this.textStates[n]={font:e.font,textAlign:e.textAlign||"center",textBaseline:e.textBaseline||"middle",scale:e.scale});var r=this.fillKey_;i&&(r in this.fillStates||(this.fillStates[r]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e){var i=this.textStrokeState_,o=this.textState_,n=this.strokeKey_,r=this.textKey_,a=this.fillKey_;this.saveTextStates_();var s=this.pixelRatio,l=Pu[o.textBaseline],u=this.textOffsetY_*s,p=this.text_,h=i?i.lineWidth*Math.abs(o.scale[0])/2:0;this.instructions.push([vu.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,s,u,n,h*s,p,r,1]),this.hitDetectionInstructions.push([vu.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,1,u,n,h,p,r,1/s])},e.prototype.setTextStyle=function(t,e){var i,o,n;if(t){var r=t.getFill();r?((o=this.textFillState_)||(o={},this.textFillState_=o),o.fillStyle=el(r.getColor()||"#000")):(o=null,this.textFillState_=o);var a=t.getStroke();if(a){(n=this.textStrokeState_)||(n={},this.textStrokeState_=n);var s=a.getLineDash(),l=a.getLineDashOffset(),u=a.getWidth(),p=a.getMiterLimit();n.lineCap=a.getLineCap()||"round",n.lineDash=s?s.slice():Vn,n.lineDashOffset=void 0===l?0:l,n.lineJoin=a.getLineJoin()||"round",n.lineWidth=void 0===u?1:u,n.miterLimit=void 0===p?10:p,n.strokeStyle=el(a.getColor()||"#000")}else n=null,this.textStrokeState_=n;i=this.textState_;var h=t.getFont()||"10px sans-serif";Zn(h);var d=t.getScaleArray();i.overflow=t.getOverflow(),i.font=h,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||"middle",i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||qn,i.scale=void 0===d?[1,1]:d;var c=t.getOffsetX(),g=t.getOffsetY(),f=t.getRotateWithView(),m=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===c?0:c,this.textOffsetY_=void 0===g?0:g,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0===m?0:m,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:te(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=o?"string"==typeof o.fillStyle?o.fillStyle:"|"+te(o.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(bu)},Fu=function(){function t(t,e,i,o){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=o,this.resolution_=i,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var i=this.buildersByZIndex_[e];for(var o in i){var n=i[o].finish();t[e][o]=n}}return t},t.prototype.getBuilder=function(t,e){var i=void 0!==t?t.toString():"0",o=this.buildersByZIndex_[i];void 0===o&&(o={},this.buildersByZIndex_[i]=o);var n=o[e];void 0===n&&(n=new(0,Ou[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),o[e]=n);return n},t}(),Ru=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Iu=function(t){function e(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return Ru(e,t),e.prototype.getFeatures=function(t){return Jt()},e.prototype.prepareFrame=function(t){return Jt()},e.prototype.renderFrame=function(t,e){return Jt()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(o,n){var r=this.loadedTileCallback.bind(this,i,o);return t.forEachLoadedTile(e,o,n,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){},e.prototype.getDataAtPixel=function(t,e,i){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===Vs&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Vs&&e!=qs&&t.addEventListener(jt,this.boundHandleImageChange_),e==Ns&&(t.load(),e=t.getState()),e==Vs},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Je&&t.changed()},e}($t),Mu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ju=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return Mu(e,t),e.prototype.useContainer=function(t,e,i){var o,n,r=this.getLayer().getClassName();t&&t.style.opacity===we(i)&&t.className===r&&((s=t.firstElementChild)instanceof HTMLCanvasElement&&(n=s.getContext("2d")));if(n&&n.canvas.style.transform===e?(this.container=t,this.context=n,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(o=document.createElement("div")).className=r;var a=o.style;a.position="absolute",a.width="100%",a.height="100%";var s=(n=fe()).canvas;o.appendChild(s),(a=s.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=o,this.context=n}},e.prototype.clipUnrotated=function(t,e,i){var o=Co(i),n=zo(i),r=_o(i),a=yo(i);xn(e.coordinateToPixelTransform,o),xn(e.coordinateToPixelTransform,n),xn(e.coordinateToPixelTransform,r),xn(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;xn(s,o),xn(s,n),xn(s,r),xn(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var o=this.getLayer();if(o.hasListener(t)){var n=new Bn(t,this.inversePixelTransform,i,e);o.dispatchEvent(n)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(Xe,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Ke,t,e)},e.prototype.getRenderTransform=function(t,e,i,o,n,r,a){var s=n/2,l=r/2,u=o/e,p=-u,h=-t[0]+a,d=-t[1];return wn(this.tempTransform,s,l,u,p,-i,h,d)},e.prototype.getDataAtPixel=function(t,e,i){var o,n=xn(this.inversePixelTransform,t.slice()),r=this.context,a=this.getLayer().getExtent();if(a&&!eo(a,xn(e.pixelToCoordinateTransform,t.slice())))return null;try{var s=Math.round(n[0]),l=Math.round(n[1]),u=document.createElement("canvas"),p=u.getContext("2d");u.width=1,u.height=1,p.clearRect(0,0,1,1),p.drawImage(r.canvas,s,l,1,1,0,0,1,1),o=p.getImageData(0,0,1,1).data}catch(h){return"SecurityError"===h.name?new Uint8Array:o}return 0===o[3]?null:o},e}(Iu),Du="Circle",Au="Default",Lu="Image",Gu="LineString",Nu="Polygon",Bu="Text";function Vu(t,e,i,o,n,r,a,s,l,u,p,h){var d=t[e],c=t[e+1],g=0,f=0,m=0,v=0;function y(){g=d,f=c,d=t[e+=o],c=t[e+1],v+=m,m=Math.sqrt((d-g)*(d-g)+(c-f)*(c-f))}do{y()}while(e<i-o&&v+m<r);for(var _=0===m?0:(r-v)/m,b=qe(g,d,_),x=qe(f,c,_),k=e-o,w=v,S=r+s*l(u,n,p);e<i-o&&v+m<S;)y();var C,z=qe(g,d,_=0===m?0:(S-v)/m),E=qe(f,c,_);if(h){var T=[b,x,z,E];qr(T,0,4,2,h,T,T),C=T[0]>T[2]}else C=b>z;var P,O=Math.PI,F=[],R=k+o===e;if(m=0,v=w,d=t[e=k],c=t[e+1],R){y(),P=Math.atan2(c-f,d-g),C&&(P+=P>0?-O:O);var I=(z+b)/2,M=(E+x)/2;return F[0]=[I,M,(S-r)/2,P,n],F}for(var j=0,D=n.length;j<D;){y();var A=Math.atan2(c-f,d-g);if(C&&(A+=A>0?-O:O),void 0!==P){var L=A-P;if(L+=L>O?-2*O:L<-O?2*O:0,Math.abs(L)>a)return null}P=A;for(var G=j,N=0;j<D;++j){var B=s*l(u,n[C?D-j-1:j],p);if(e+o<i&&v+m<r+N+B/2)break;N+=B}if(j!==G){var V=C?n.substring(D-G,D-j):n.substring(G,j);I=qe(g,d,_=0===m?0:(r+N/2-v)/m),M=qe(f,c,_);F.push([I,M,N/2,A,V]),r+=N}}return F}var qu=[1/0,1/0,-1/0,-1/0],Wu=[],Uu=[],Xu=[],Ku=[];function Yu(t){return t[3].declutterBox}var Zu=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 Hu(t,e){return"start"!==e&&"end"!==e||Zu.test(t)||(e="start"===e?"left":"right"),Pu[e]}var $u=function(){function t(t,e,i,o){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=o.instructions,this.coordinates=o.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=o.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=o.fillStates||{},this.strokeStates=o.strokeStates||{},this.textStates=o.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,i,o){var n=t+e+i+o;if(this.labels_[n])return this.labels_[n];var r=o?this.strokeStates[o]:null,a=i?this.fillStates[i]:null,s=this.textStates[e],l=this.pixelRatio,u=[s.scale[0]*l,s.scale[1]*l],p=Hu(t,s.textAlign||"center"),h=o&&r.lineWidth?r.lineWidth:0,d=t.split("\n"),c=d.length,g=[],f=function(t,e,i){for(var o=e.length,n=0,r=0;r<o;++r){var a=Jn(t,e[r]);n=Math.max(n,a),i.push(a)}return n}(s.font,d,g),m=Hn(s.font),v=f+h,y=[],_=(v+2)*u[0],b=(m*c+h)*u[1],x={width:_<0?Math.floor(_):Math.ceil(_),height:b<0?Math.floor(b):Math.ceil(b),contextInstructions:y};(1==u[0]&&1==u[1]||y.push("scale",u),y.push("font",s.font),o)&&(y.push("strokeStyle",r.strokeStyle),y.push("lineWidth",h),y.push("lineCap",r.lineCap),y.push("lineJoin",r.lineJoin),y.push("miterLimit",r.miterLimit),(de?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(y.push("setLineDash",[r.lineDash]),y.push("lineDashOffset",r.lineDashOffset)));i&&y.push("fillStyle",a.fillStyle),y.push("textBaseline","middle"),y.push("textAlign","center");var k,w=.5-p,S=p*v+w*h;if(o)for(k=0;k<c;++k)y.push("strokeText",[d[k],S+w*g[k],.5*(h+m)+k*m]);if(i)for(k=0;k<c;++k)y.push("fillText",[d[k],S+w*g[k],.5*(h+m)+k*m]);return this.labels_[n]=x,x},t.prototype.replayTextBackground_=function(t,e,i,o,n,r,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,o),t.lineTo.apply(t,n),t.lineTo.apply(t,e),r&&(this.alignFill_=r[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,i,o,n,r,a,s,l,u,p,h,d,c,g,f){var m,v=i-(a*=h[0]),y=o-(s*=h[1]),_=n+l>t?t-l:n,b=r+u>e?e-u:r,x=c[3]+_*h[0]+c[1],k=c[0]+b*h[1]+c[2],w=v-c[3],S=y-c[0];return(g||0!==p)&&(Wu[0]=w,Ku[0]=w,Wu[1]=S,Uu[1]=S,Uu[0]=w+x,Xu[0]=Uu[0],Xu[1]=S+k,Ku[1]=Xu[1]),0!==p?(xn(m=wn([1,0,0,1,0,0],i,o,1,1,p,-i,-o),Wu),xn(m,Uu),xn(m,Xu),xn(m,Ku),ao(Math.min(Wu[0],Uu[0],Xu[0],Ku[0]),Math.min(Wu[1],Uu[1],Xu[1],Ku[1]),Math.max(Wu[0],Uu[0],Xu[0],Ku[0]),Math.max(Wu[1],Uu[1],Xu[1],Ku[1]),qu)):ao(Math.min(w,w+x),Math.min(S,S+k),Math.max(w,w+x),Math.max(S,S+k),qu),d&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:_,drawImageH:b,originX:l,originY:u,declutterBox:{minX:qu[0],minY:qu[1],maxX:qu[2],maxY:qu[3],value:f},canvasTransform:m,scale:h}},t.prototype.replayImageOrLabel_=function(t,e,i,o,n,r,a){var s=!(!r&&!a),l=o.declutterBox,u=t.canvas,p=a?a[2]*o.scale[0]/2:0;return l.minX-p<=u.width/e&&l.maxX+p>=0&&l.minY-p<=u.height/e&&l.maxY+p>=0&&(s&&this.replayTextBackground_(t,Wu,Uu,Xu,Ku,r,a),tr(t,o.canvasTransform,n,i,o.originX,o.originY,o.drawImageW,o.drawImageH,o.drawImageX,o.drawImageY,o.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=xn(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,i,o){var n=this.textStates[e],r=this.createLabel(t,e,o,i),a=this.strokeStates[i],s=this.pixelRatio,l=Hu(t,n.textAlign||"center"),u=Pu[n.textBaseline||"middle"],p=a&&a.lineWidth?a.lineWidth:0;return{label:r,anchorX:l*(r.width/s-2*n.scale[0])+2*(.5-l)*p,anchorY:u*r.height/s+2*(.5-u)*p}},t.prototype.execute_=function(t,e,i,o,n,r,a,s){var l;this.pixelCoordinates_&&St(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Vr(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),function(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]}(this.renderedTransform_,i));for(var u,p,h,d,c,g,f,m,v,y,_,b,x,k,w,S,C=0,z=o.length,E=0,T=0,P=0,O=null,F=null,R=this.coordinateCache_,I=this.viewRotation_,M=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:I},D=this.instructions!=o||this.overlaps?0:200;C<z;){var A=o[C];switch(A[0]){case vu.BEGIN_GEOMETRY:x=A[1],S=A[3],x.getGeometry()?void 0===a||To(a,S.getExtent())?++C:C=A[2]+1:C=A[2];break;case vu.BEGIN_PATH:T>D&&(this.fill_(t),T=0),P>D&&(t.stroke(),P=0),T||P||(t.beginPath(),d=NaN,c=NaN),++C;break;case vu.CIRCLE:var L=l[E=A[1]],G=l[E+1],N=l[E+2]-L,B=l[E+3]-G,V=Math.sqrt(N*N+B*B);t.moveTo(L+V,G),t.arc(L,G,V,0,2*Math.PI,!0),++C;break;case vu.CLOSE_PATH:t.closePath(),++C;break;case vu.CUSTOM:E=A[1],u=A[2];var q=A[3],W=A[4],U=6==A.length?A[5]:void 0;j.geometry=q,j.feature=x,C in R||(R[C]=[]);var X=R[C];U?U(l,E,u,2,X):(X[0]=l[E],X[1]=l[E+1],X.length=2),W(X,j),++C;break;case vu.DRAW_IMAGE:E=A[1],u=A[2],m=A[3],p=A[4],h=A[5];var K=A[6],Y=A[7],Z=A[8],H=A[9],$=A[10],J=A[11],Q=A[12],tt=A[13],et=A[14];if(!m&&A.length>=19){v=A[18],y=A[19],_=A[20],b=A[21];var it=this.drawLabelWithPointPlacement_(v,y,_,b);m=it.label,A[3]=m;var ot=A[22];p=(it.anchorX-ot)*this.pixelRatio,A[4]=p;var nt=A[23];h=(it.anchorY-nt)*this.pixelRatio,A[5]=h,K=m.height,A[6]=K,tt=m.width,A[13]=tt}var rt=void 0;A.length>24&&(rt=A[24]);var at=void 0,st=void 0,lt=void 0;A.length>16?(at=A[15],st=A[16],lt=A[17]):(at=qn,st=!1,lt=!1),$&&M?J+=I:$||M||(J-=I);for(var ut=0;E<u;E+=2)if(!(rt&&rt[ut++]<tt/this.pixelRatio)){var pt=[t,e,m,Lt=this.calculateImageOrLabelDimensions_(m.width,m.height,l[E],l[E+1],tt,K,p,h,Z,H,J,Q,n,at,st||lt,x),Y,st?O:null,lt?F:null],ht=void 0,dt=void 0;if(s&&et){var ct=u-E;if(!et[ct]){et[ct]=pt;continue}if(ht=et[ct],delete et[ct],dt=Yu(ht),s.collides(dt))continue}s&&s.collides(Lt.declutterBox)||(ht&&(s&&s.insert(dt),this.replayImageOrLabel_.apply(this,ht)),s&&s.insert(Lt.declutterBox),this.replayImageOrLabel_.apply(this,pt))}++C;break;case vu.DRAW_CHARS:var gt=A[1],ft=A[2],mt=A[3],vt=A[4];b=A[5];var yt=A[6],_t=A[7],bt=A[8];_=A[9];var xt=A[10];v=A[11],y=A[12];var kt=[A[13],A[13]],wt=this.textStates[y],Ct=wt.font,zt=[wt.scale[0]*_t,wt.scale[1]*_t],Et=void 0;Ct in this.widths_?Et=this.widths_[Ct]:(Et={},this.widths_[Ct]=Et);var Tt=ls(l,gt,ft,2),Pt=Math.abs(zt[0])*Qn(Ct,v,Et);if(vt||Pt<=Tt){var Ot=this.textStates[y].textAlign,Ft=Vu(l,gt,ft,2,v,(Tt-Pt)*Pu[Ot],yt,Math.abs(zt[0]),Qn,Ct,Et,M?0:this.viewRotation_);t:if(Ft){var Rt=[],It=void 0,Mt=void 0,jt=void 0,Dt=void 0,At=void 0;if(_)for(It=0,Mt=Ft.length;It<Mt;++It){jt=(At=Ft[It])[4],Dt=this.createLabel(jt,y,"",_),p=At[2]+(zt[0]<0?-xt:xt),h=mt*Dt.height+2*(.5-mt)*xt*zt[1]/zt[0]-bt;var Lt=this.calculateImageOrLabelDimensions_(Dt.width,Dt.height,At[0],At[1],Dt.width,Dt.height,p,h,0,0,At[3],kt,!1,qn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,Dt,Lt,1,null,null])}if(b)for(It=0,Mt=Ft.length;It<Mt;++It){jt=(At=Ft[It])[4],Dt=this.createLabel(jt,y,b,""),p=At[2],h=mt*Dt.height-bt;Lt=this.calculateImageOrLabelDimensions_(Dt.width,Dt.height,At[0],At[1],Dt.width,Dt.height,p,h,0,0,At[3],kt,!1,qn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,Dt,Lt,1,null,null])}s&&s.load(Rt.map(Yu));for(var Gt=0,Nt=Rt.length;Gt<Nt;++Gt)this.replayImageOrLabel_.apply(this,Rt[Gt])}}++C;break;case vu.END_GEOMETRY:if(void 0!==r){var Bt=r(x=A[1],S);if(Bt)return Bt}++C;break;case vu.FILL:D?T++:this.fill_(t),++C;break;case vu.MOVE_TO_LINE_TO:for(E=A[1],u=A[2],k=l[E],f=(w=l[E+1])+.5|0,(g=k+.5|0)===d&&f===c||(t.moveTo(k,w),d=g,c=f),E+=2;E<u;E+=2)g=(k=l[E])+.5|0,f=(w=l[E+1])+.5|0,E!=u-2&&g===d&&f===c||(t.lineTo(k,w),d=g,c=f);++C;break;case vu.SET_FILL_STYLE:O=A,this.alignFill_=A[2],T&&(this.fill_(t),T=0,P&&(t.stroke(),P=0)),t.fillStyle=A[1],++C;break;case vu.SET_STROKE_STYLE:F=A,P&&(t.stroke(),P=0),this.setStrokeStyle_(t,A),++C;break;case vu.STROKE:D?P++:t.stroke(),++C;break;default:++C}}T&&this.fill_(t),P&&t.stroke()},t.prototype.execute=function(t,e,i,o,n,r){this.viewRotation_=o,this.execute_(t,e,i,this.instructions,n,void 0,void 0,r)},t.prototype.executeHitDetection=function(t,e,i,o,n){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,o,n)},t}(),Ju=[Nu,Du,Gu,Lu,Bu,Au],Qu=function(){function t(t,e,i,o,n,r){this.maxExtent_=t,this.overlaps_=o,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=r,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(n)}return t.prototype.clip=function(t,e){var i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var i=this.executorsByZIndex_[e];void 0===i&&(i={},this.executorsByZIndex_[e]=i);var o=t[e];for(var n in o){var r=o[n];i[n]=new $u(this.resolution_,this.pixelRatio_,this.overlaps_,r)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var i=this.executorsByZIndex_[e],o=0,n=t.length;o<n;++o)if(t[o]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r){var a=2*(o=Math.round(o))+1,s=wn(this.hitDetectionTransform_,o+.5,o+.5,1/e,-1/e,-i,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=fe(a,a));var u,p=this.hitDetectionContext_;p.canvas.width!==a||p.canvas.height!==a?(p.canvas.width=a,p.canvas.height=a):l||p.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(co(u=[1/0,1/0,-1/0,-1/0],t),Ji(u,e*(this.renderBuffer_+o),u));var h,d=function(t){if(void 0!==tp[t])return tp[t];for(var e=2*t+1,i=t*t,o=new Array(i+1),n=0;n<=t;++n)for(var r=0;r<=t;++r){var a=n*n+r*r;if(a>i)break;var s=o[a];s||(s=[],o[a]=s),s.push(4*((t+n)*e+(t+r))+3),n>0&&s.push(4*((t-n)*e+(t+r))+3),r>0&&(s.push(4*((t+n)*e+(t-r))+3),n>0&&s.push(4*((t-n)*e+(t-r))+3))}for(var l=[],u=(n=0,o.length);n<u;++n)o[n]&&l.push.apply(l,o[n]);return tp[t]=l,l}(o);function c(t,e){for(var i=p.getImageData(0,0,a,a).data,s=0,l=d.length;s<l;s++)if(i[d[s]]>0){if(!r||h!==Lu&&h!==Bu||-1!==r.indexOf(t)){var u=(d[s]-3)/4,c=o-u%a,g=o-(u/a|0),f=n(t,e,c*c+g*g);if(f)return f}p.clearRect(0,0,a,a);break}}var g,f,m,v,y,_=Object.keys(this.executorsByZIndex_).map(Number);for(_.sort(bt),g=_.length-1;g>=0;--g){var b=_[g].toString();for(m=this.executorsByZIndex_[b],f=Ju.length-1;f>=0;--f)if(void 0!==(v=m[h=Ju[f]])&&(y=v.executeHitDetection(p,s,i,c,u)))return y}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],o=e[1],n=e[2],r=e[3],a=[i,o,i,r,n,r,n,o];return Vr(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return Ft(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,o,n,r,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(bt),this.maxExtent_&&(t.save(),this.clip(t,i));var l,u,p,h,d,c,g=r||Ju;for(a&&s.reverse(),l=0,u=s.length;l<u;++l){var f=s[l].toString();for(d=this.executorsByZIndex_[f],p=0,h=g.length;p<h;++p){void 0!==(c=d[g[p]])&&c.execute(t,e,i,o,n,a)}}this.maxExtent_&&t.restore()},t}(),tp={};var ep=Qu,ip=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),op=function(t){function e(e,i,o,n,r,a,s){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=o,l.transform_=n,l.viewRotation_=r,l.squaredTolerance_=a,l.userTransform_=s,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return ip(e,t),e.prototype.drawImages_=function(t,e,i,o){if(this.image_){var n=Vr(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.tmpLocalTransform_,s=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=s*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,p=n.length;u<p;u+=2){var h=n[u]-this.imageAnchorX_,d=n[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var c=h+this.imageAnchorX_,g=d+this.imageAnchorY_;wn(a,c,g,1,1,l,-c,-g),r.setTransform.apply(r,a),r.translate(c,g),r.scale(this.imageScale_[0],this.imageScale_[1]),r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),r.setTransform(1,0,0,1,0,0)}else r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,h,d,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(r.globalAlpha=s)}},e.prototype.drawText_=function(t,e,i,o){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var n=Vr(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=o){var s=n[e]+this.textOffsetX_,l=n[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=wn(this.tmpLocalTransform_,s,l,1,1,a,-s,-l);r.setTransform.apply(r,u),r.translate(s,l),r.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&r.strokeText(this.text_,0,0),this.textFillState_&&r.fillText(this.text_,0,0),r.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&r.strokeText(this.text_,s,l),this.textFillState_&&r.fillText(this.text_,s,l)}}},e.prototype.moveToLineTo_=function(t,e,i,o,n){var r=this.context_,a=Vr(t,e,i,o,this.transform_,this.pixelCoordinates_);r.moveTo(a[0],a[1]);var s=a.length;n&&(s-=2);for(var l=2;l<s;l+=2)r.lineTo(a[l],a[l+1]);return n&&r.closePath(),i},e.prototype.drawRings_=function(t,e,i,o){for(var n=0,r=i.length;n<r;++n)e=this.moveToLineTo_(t,e,i[n],o,!0);return e},e.prototype.drawCircle=function(t){if(To(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,i){var o=t.getFlatCoordinates();if(o){var n=t.getStride();return Vr(o,0,o.length,n,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],o=e[3]-e[1],n=Math.sqrt(i*i+o*o),r=this.context_;r.beginPath(),r.arc(e[0],e[1],n,0,2*Math.PI),this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case Fo:this.drawPoint(t);break;case Ro:this.drawLineString(t);break;case Mo:this.drawPolygon(t);break;case jo:this.drawMultiPoint(t);break;case Do:this.drawMultiLineString(t);break;case Ao:this.drawMultiPolygon(t);break;case Lo:this.drawGeometryCollection(t);break;case Go:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&To(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,o=e.length;i<o;++i)this.drawGeometry(e[i])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),To(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var o=t.getFlatMidpoint();this.drawText_(o,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(To(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,o=t.getFlatCoordinates(),n=0,r=t.getEnds(),a=t.getStride();i.beginPath();for(var s=0,l=r.length;s<l;++s)n=this.moveToLineTo_(o,n,r[s],a,!1);i.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_)),To(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var i=t.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),To(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getOrientedFlatCoordinates(),o=0,n=t.getEndss(),r=t.getStride();e.beginPath();for(var a=0,s=n.length;a<s;++a){var l=n[a];o=this.drawRings_(i,o,l,r)}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_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(St(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,o=t.textAlign?t.textAlign:"center";i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=o&&(i.textAlign=o,e.textAlign=o),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=o,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:o,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var i=this;if(t){var o=t.getColor();this.fillState_={fillStyle:el(o||"#000")}}else this.fillState_=null;if(e){var n=e.getColor(),r=e.getLineCap(),a=e.getLineDash(),s=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),p=e.getMiterLimit(),h=a||Vn;this.strokeState_={lineCap:void 0!==r?r:"round",lineDash:1===this.pixelRatio_?h:h.map((function(t){return t*i.pixelRatio_})),lineDashOffset:(s||0)*this.pixelRatio_,lineJoin:void 0!==l?l:"round",lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==p?p:10,strokeStyle:el(n||"#000")}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var i=t.getAnchor(),o=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*this.pixelRatio_,this.imageAnchorY_=i[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=o[0],this.imageOriginY_=o[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var i=e.getColor();this.textFillState_={fillStyle:el(i||"#000")}}else this.textFillState_=null;var o=t.getStroke();if(o){var n=o.getColor(),r=o.getLineCap(),a=o.getLineDash(),s=o.getLineDashOffset(),l=o.getLineJoin(),u=o.getWidth(),p=o.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:"round",lineDash:a||Vn,lineDashOffset:s||0,lineJoin:void 0!==l?l:"round",lineWidth:void 0!==u?u:1,miterLimit:void 0!==p?p:10,strokeStyle:el(n||"#000")}}else this.textStrokeState_=null;var h=t.getFont(),d=t.getOffsetX(),c=t.getOffsetY(),g=t.getRotateWithView(),f=t.getRotation(),m=t.getScaleArray(),v=t.getText(),y=t.getTextAlign(),_=t.getTextBaseline();this.textState_={font:void 0!==h?h:"10px sans-serif",textAlign:void 0!==y?y:"center",textBaseline:void 0!==_?_:"middle"},this.text_=void 0!==v?v:"",this.textOffsetX_=void 0!==d?this.pixelRatio_*d:0,this.textOffsetY_=void 0!==c?this.pixelRatio_*c:0,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0!==f?f:0,this.textScale_=[this.pixelRatio_*m[0],this.pixelRatio_*m[1]]}else this.text_=""},e}(yu);function np(t,e,i,o,n,r,a){var s=fe(.5*t[0],.5*t[1]);s.imageSmoothingEnabled=!1;for(var l=s.canvas,u=new op(s,.5,n,null,a),p=i.length,h=Math.floor(16777215/p),d={},c=1;c<=p;++c){var g=i[c-1],f=g.getStyleFunction()||o;if(o){var m=f(g,r);if(m){Array.isArray(m)||(m=[m]);for(var v="#"+("000000"+(c*h).toString(16)).slice(-6),y=0,_=m.length;y<_;++y){var b=m[y],x=b.getGeometryFunction()(g);if(x&&To(n,x.getExtent())){var k=b.clone(),w=k.getFill();w&&w.setColor(v);var S=k.getStroke();S&&(S.setColor(v),S.setLineDash(null)),k.setText(void 0);var C=b.getImage();if(C&&0!==C.getOpacity()){var z=C.getImageSize();if(!z)continue;var E=fe(z[0],z[1],void 0,{alpha:!1}),T=E.canvas;E.fillStyle=v,E.fillRect(0,0,T.width,T.height),k.setImage(new Qs({img:T,imgSize:z,anchor:C.getAnchor(),anchorXUnits:js,anchorYUnits:js,offset:C.getOrigin(),opacity:1,size:C.getSize(),scale:C.getScale(),rotation:C.getRotation(),rotateWithView:C.getRotateWithView()}))}var P=k.getZIndex()||0;(R=d[P])||(R={},d[P]=R,R[Mo]=[],R[Go]=[],R[Ro]=[],R[Fo]=[]),R[x.getType().replace("Multi","")].push(x,k)}}}}}for(var O=Object.keys(d).map(Number).sort(bt),F=(c=0,O.length);c<F;++c){var R=d[O[c]];for(var I in R){var M=R[I];for(y=0,_=M.length;y<_;y+=2){u.setStyle(M[y+1]);for(var j=0,D=e.length;j<D;++j)u.setTransform(e[j]),u.drawGeometry(M[y])}}}return s.getImageData(0,0,l.width,l.height)}function rp(t,e,i){var o=[];if(i){var n=Math.floor(.5*Math.round(t[0])),r=Math.floor(.5*Math.round(t[1])),a=4*(De(n,0,i.width-1)+De(r,0,i.height-1)*i.width),s=i.data[a],l=i.data[a+1],u=i.data[a+2]+256*(l+256*s),p=Math.floor(16777215/e.length);u&&u%p==0&&o.push(e[u/p-1])}return o}var ap={Point:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Vs)return;var l=t.getBuilder(i.getZIndex(),Lu);l.setImageStyle(a,r),l.drawPoint(e,o)}if(s&&s.getText()){var u=t.getBuilder(i.getZIndex(),Bu);u.setTextStyle(s,r),u.drawText(e,o)}},LineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Gu);a.setFillStrokeStyle(null,r),a.drawLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),Bu);l.setTextStyle(s),l.drawText(e,o)}},Polygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Nu);s.setFillStrokeStyle(r,a),s.drawPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Bu);u.setTextStyle(l),u.drawText(e,o)}},MultiPoint:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Vs)return;var l=t.getBuilder(i.getZIndex(),Lu);l.setImageStyle(a,r),l.drawMultiPoint(e,o)}if(s&&s.getText()){var u=(n||t).getBuilder(i.getZIndex(),Bu);u.setTextStyle(s,r),u.drawText(e,o)}},MultiLineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Gu);a.setFillStrokeStyle(null,r),a.drawMultiLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),Bu);l.setTextStyle(s),l.drawText(e,o)}},MultiPolygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(a||r){var s=t.getBuilder(i.getZIndex(),Nu);s.setFillStrokeStyle(r,a),s.drawMultiPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Bu);u.setTextStyle(l),u.drawText(e,o)}},GeometryCollection:function(t,e,i,o,n){var r,a,s=e.getGeometriesArray();for(r=0,a=s.length;r<a;++r){(0,ap[s[r].getType()])(t,s[r],i,o,n)}},Circle:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Du);s.setFillStrokeStyle(r,a),s.drawCircle(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Bu);u.setTextStyle(l),u.drawText(e,o)}}};function sp(t,e){return parseInt(te(t),10)-parseInt(te(e),10)}function lp(t,e){var i=up(t,e);return i*i}function up(t,e){return.5*t/e}function pp(t,e,i,o,n,r,a){var s=!1,l=i.getImage();if(l){var u=l.getImageState();u==Vs||u==qs?l.unlistenImageChange(n):(u==Ns&&l.load(),u=l.getImageState(),l.listenImageChange(n),s=!0)}return function(t,e,i,o,n,r){var a=i.getGeometryFunction()(e);if(!a)return;var s=a.simplifyTransformed(o,n);if(i.getRenderer())hp(t,s,i,e);else{(0,ap[s.getType()])(t,s,i,e,r)}}(t,e,i,o,r,a),s}function hp(t,e,i,o){if(e.getType()!=Lo)t.getBuilder(i.getZIndex(),Au).drawCustom(e,o,i.getRenderer(),i.getHitDetectionRenderer());else for(var n=e.getGeometries(),r=0,a=n.length;r<a;++r)hp(t,n[r],i,o)}var dp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),cp=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.animatingOrInteracting_,i.dirty_=!1,i.hitDetectionImageData_=null,i.renderedFeatures_=null,i.renderedRevision_=-1,i.renderedResolution_=NaN,i.renderedExtent_=[1/0,1/0,-1/0,-1/0],i.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],i.renderedRotation_,i.renderedCenter_=null,i.renderedProjection_=null,i.renderedRenderOrder_=null,i.replayGroup_=null,i.replayGroupChanged=!0,i.declutterExecutorGroup=null,i.clipping=!0,i}return dp(e,t),e.prototype.useContainer=function(e,i,o){o<1&&(e=null),t.prototype.useContainer.call(this,e,i,o)},e.prototype.renderWorlds=function(t,e,i){var o=e.extent,n=e.viewState,r=n.center,a=n.resolution,s=n.projection,l=n.rotation,u=s.getExtent(),p=this.getLayer().getSource(),h=e.pixelRatio,d=e.viewHints,c=!(d[zr]||d[Er]),g=this.context,f=Math.round(e.size[0]*h),m=Math.round(e.size[1]*h),v=p.getWrapX()&&s.canWrapX(),y=v?Eo(u):null,_=v?Math.ceil((o[2]-u[2])/y)+1:1,b=v?Math.floor((o[0]-u[0])/y):0;do{var x=this.getRenderTransform(r,a,l,h,f,m,b*y);t.execute(g,1,x,l,c,void 0,i)}while(++b<_)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var i=t.pixelRatio,o=t.layerStatesArray[t.layerIndex];!function(t,e,i){bn(t,e,0,0,i,0,0)}(this.pixelTransform,1/i,1/i),Sn(this.inversePixelTransform,this.pixelTransform);var n=Cn(this.pixelTransform);this.useContainer(e,n,o.opacity);var r=this.context,a=r.canvas,s=this.replayGroup_,l=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!l||l.isEmpty()))return null;var u=Math.round(t.size[0]*i),p=Math.round(t.size[1]*i);a.width!=u||a.height!=p?(a.width=u,a.height=p,a.style.transform!==n&&(a.style.transform=n)):this.containerReused||r.clearRect(0,0,u,p),this.preRender(r,t);var h=t.viewState;h.projection;var d=!1,c=!0;if(o.extent&&this.clipping){var g=fn(o.extent);(d=(c=To(g,t.extent))&&!io(g,t.extent))&&this.clipUnrotated(r,t,g)}c&&this.renderWorlds(s,t),d&&r.restore(),this.postRender(r,t);var f=we(o.opacity),m=this.container;return f!==m.style.opacity&&(m.style.opacity=f),this.renderedRotation_!==h.rotation&&(this.renderedRotation_=h.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];xn(this.pixelTransform,i);var o=this.renderedCenter_,n=this.renderedResolution_,r=this.renderedRotation_,a=this.renderedProjection_,s=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],p=.5*i[0],h=.5*i[1];u.push(this.getRenderTransform(o,n,r,.5,p,h,0).slice());var d=l.getSource(),c=a.getExtent();if(d.getWrapX()&&a.canWrapX()&&!io(c,s)){for(var g=s[0],f=Eo(c),m=0,v=void 0;g<c[0];)v=f*--m,u.push(this.getRenderTransform(o,n,r,.5,p,h,v).slice()),g+=f;for(m=0,g=s[2];g>c[2];)v=f*++m,u.push(this.getRenderTransform(o,n,r,.5,p,h,v).slice()),g-=f}this.hitDetectionImageData_=np(i,u,this.renderedFeatures_,l.getStyleFunction(),s,n,r)}e(rp(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=this;if(this.replayGroup_){var a,s=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),p={},h=function(t,e,i){var r=te(t),a=p[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return p[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,u,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return p[r]=!0,o(t,u,e);n.push(p[r]={feature:t,layer:u,geometry:e,distanceSq:i,callback:o})}},d=[this.replayGroup_];return this.declutterExecutorGroup&&d.push(this.declutterExecutorGroup),d.some((function(o){return a=o.forEachFeatureAtCoordinate(t,s,l,i,h,o===r.declutterExecutorGroup?e.declutterTree.all().map((function(t){return t.value})):null)})),a}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),i=e.getSource();if(!i)return!1;var o=t.viewHints[zr],n=t.viewHints[Er],r=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!r&&o||!a&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,l=t.viewState,u=l.projection,p=l.resolution,h=t.pixelRatio,d=e.getRevision(),c=e.getRenderBuffer(),g=e.getRenderOrder();void 0===g&&(g=sp);var f=l.center.slice(),m=Ji(s,c*p),v=m.slice(),y=[m.slice()],_=u.getExtent();if(i.getWrapX()&&u.canWrapX()&&!io(_,t.extent)){var b=Eo(_),x=Math.max(Eo(m)/2,b);m[0]=_[0]-x,m[2]=_[2]+x,Zo(f,u);var k=function(t,e){var i=e.getExtent(),o=bo(t);if(e.canWrapX()&&(o[0]<i[0]||o[0]>=i[2])){var n=Eo(i),r=Math.floor((o[0]-i[0])/n)*n;t[0]-=r,t[2]-=r}return t}(y[0],u);k[0]<_[0]&&k[2]<_[2]?y.push([k[0]+b,k[1],k[2]+b,k[3]]):k[0]>_[0]&&k[2]>_[2]&&y.push([k[0]-b,k[1],k[2]-b,k[3]])}if(!this.dirty_&&this.renderedResolution_==p&&this.renderedRevision_==d&&this.renderedRenderOrder_==g&&io(this.wrappedRenderedExtent_,m))return St(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=f,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var w,S=new Fu(up(p,h),m,p,h);this.getLayer().getDeclutter()&&(w=new Fu(up(p,h),m,p,h));for(var C=0,z=y.length;C<z;++C)i.loadFeatures(y[C],p,u);var E=lp(p,h),T=function(t){var i,o=t.getStyleFunction()||e.getStyleFunction();if(o&&(i=o(t,p)),i){var n=this.renderFeature(t,E,i,S,undefined,w);this.dirty_=this.dirty_||n}}.bind(this),P=gn(m),O=i.getFeaturesInExtent(P);g&&O.sort(g);for(C=0,z=O.length;C<z;++C)T(O[C]);this.renderedFeatures_=O;var F=S.finish(),R=new ep(m,p,h,i.getOverlaps(),F,e.getRenderBuffer());return w&&(this.declutterExecutorGroup=new ep(m,p,h,i.getOverlaps(),w.finish(),e.getRenderBuffer())),this.renderedResolution_=p,this.renderedRevision_=d,this.renderedRenderOrder_=g,this.renderedExtent_=v,this.wrappedRenderedExtent_=m,this.renderedCenter_=f,this.renderedProjection_=u,this.replayGroup_=R,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,o,n,r){if(!i)return!1;var a=!1;if(Array.isArray(i))for(var s=0,l=i.length;s<l;++s)a=pp(o,t,i[s],e,this.boundHandleStyleImageChange_,n,r)||a;else a=pp(o,t,i,e,this.boundHandleStyleImageChange_,n,r);return a},e}(ju),gp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),fp=function(t){function e(e){return t.call(this,e)||this}return gp(e,t),e.prototype.createRenderer=function(){return new cp(this)},e}(hu),mp=function(){function t(t){this.rbush_=new Zl(t),this.items_={}}return t.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[te(e)]=i},t.prototype.load=function(t,e){for(var i=new Array(e.length),o=0,n=e.length;o<n;o++){var r=t[o],a=e[o],s={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:a};i[o]=s,this.items_[te(a)]=s}this.rbush_.load(i)},t.prototype.remove=function(t){var e=te(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},t.prototype.update=function(t,e){var i=this.items_[te(e)];po([i.minX,i.minY,i.maxX,i.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 i,o=0,n=t.length;o<n;o++)if(i=e(t[o]))return i;return i},t.prototype.isEmpty=function(){return Ft(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return ao(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}(),vp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function yp(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var _p=function(t){function e(e){var i=t.call(this)||this;i.projection=Qo(e.projection),i.attributions_=yp(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Je,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i.viewResolver=null,i.viewRejector=null;var o=i;return i.viewPromise_=new Promise((function(t,e){o.viewResolver=t,o.viewRejector=e})),i}return vp(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 Jt()},e.prototype.getView=function(){return this.viewPromise_},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_=yp(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(oe),bp="addfeature",xp="changefeature",kp="clear",wp="removefeature",Sp="featuresloadstart",Cp="featuresloadend",zp="featuresloaderror";function Ep(t,e){return[[-1/0,-1/0,1/0,1/0]]}function Tp(t,e,i,o,n,r,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(i,o,n):t,!0),e.getType()==ks&&(s.responseType="arraybuffer"),s.withCredentials=false,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var o=e.getType(),l=void 0;o==ws||o==Ss?l=s.responseText:o==Cs?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):o==ks&&(l=s.response),l?r(e.readFeatures(l,{extent:i,featureProjection:n}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}function Pp(t,e){return function(i,o,n,r,a){var s=this;Tp(t,e,i,o,n,(function(t,e){s.addFeatures(t),void 0!==r&&r(t)}),a||Et)}}var Op=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fp=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.feature=i,n.features=o,n}return Op(e,t),e}(vt),Rp=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{attributions:o.attributions,projection:void 0,state:Je,wrapX:void 0===o.wrapX||o.wrapX})||this).on,i.once,i.un,i.loader_=Et,i.format_=o.format,i.overlaps_=void 0===o.overlaps||o.overlaps,i.url_=o.url,void 0!==o.loader?i.loader_=o.loader:void 0!==i.url_&&(je(i.format_,7),i.loader_=Pp(i.url_,i.format_)),i.strategy_=void 0!==o.strategy?o.strategy:Ep;var n,r,a=void 0===o.useSpatialIndex||o.useSpatialIndex;return i.featuresRtree_=a?new mp:null,i.loadedExtentsRtree_=new mp,i.loadingExtentsCount_=0,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(o.features)?r=o.features:o.features&&(r=(n=o.features).getArray()),a||void 0!==n||(n=new ui(r)),void 0!==r&&i.addFeaturesInternal(r),void 0!==n&&i.bindFeaturesCollection_(n),i}return Op(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=te(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Fp(bp,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[Xt(e,jt,this.handleFeatureChange_,this),Xt(e,yt,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,o=e.getId();return void 0!==o&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=e),i&&(je(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],o=[],n=0,r=t.length;n<r;n++){var a=te(l=t[n]);this.addToIndex_(a,l)&&i.push(l)}n=0;for(var s=i.length;n<s;n++){var l;a=te(l=i[n]);this.setupChangeEvents_(a,l);var u=l.getGeometry();if(u){var p=u.getExtent();e.push(p),o.push(l)}else this.nullGeometryFeatures_[a]=l}this.featuresRtree_&&this.featuresRtree_.load(e,o);n=0;for(var h=i.length;n<h;n++)this.dispatchEvent(new Fp(bp,i[n]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(bp,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(wp,(function(i){e||(e=!0,t.remove(i.feature),e=!1)})),t.addEventListener(ni,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(ri,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(Yt)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var i in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var o=new Fp(kp);this.dispatchEvent(o),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?e(i):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(i){if(i.getGeometry().intersectsExtent(t)){var o=e(i);if(o)return o}}))},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(),Ft(this.nullGeometryFeatures_)||wt(t,Ot(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var i=t[0],o=t[1],n=null,r=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||Ct;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(i,o,r,a))<u){n=t;var p=Math.sqrt(a);s[0]=i-p,s[1]=o-p,s[2]=i+p,s[3]=o+p}}})),n},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,i=te(e),o=e.getGeometry();if(o){var n=o.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(n,e)):this.featuresRtree_&&this.featuresRtree_.update(n,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var r=e.getId();if(void 0!==r){var a=r.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Fp(xp,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:te(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&Ft(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,i){for(var o=this.loadedExtentsRtree_,n=this.strategy_(t,e,i),r=function(t,r){var s=n[t];o.forEachInExtent(s,(function(t){return io(t.extent,s)}))||(++a.loadingExtentsCount_,a.dispatchEvent(new Fp(Sp)),a.loader_.call(a,s,e,i,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Fp(Cp,void 0,t))}.bind(a),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Fp(zp))}.bind(a)),o.insert(s,{extent:s.slice()}))},a=this,s=0,l=n.length;s<l;++s)r(s);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if(po(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=te(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=te(t);this.featureChangeKeys_[e].forEach(Yt),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Fp(wp,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){je(this.format_,7),this.url_=t,this.setLoader(Pp(t,this.format_))},e}(_p),Ip=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Mp=function(t){function e(e,i,o){var n=t.call(this)||this,r=o||{};return n.tileCoord=e,n.state=i,n.interimTile=null,n.key="",n.transition_=void 0===r.transition?250:r.transition,n.transitionStarts_={},n}return Ip(e,t),e.prototype.changed=function(){this.dispatchEvent(jt)},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()==xr)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()==xr){t.interimTile=null;break}t.getState()==br?e=t:t.getState()==_r?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!==kr&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Jt()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var o=e-i+1e3/60;return o>=this.transition_?1:pi(o/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}(Mt),jp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var Dp=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.crossOrigin_=n,s.src_=o,s.key=o,s.image_=new Image,null!==n&&(s.image_.crossOrigin=n),s.unlisten_=null,s.tileLoadFunction_=r,s}return jp(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=xr,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=kr,this.unlistenImage_(),this.image_=((t=fe(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=xr:this.state=wr,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==kr&&(this.state=_r,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==_r&&(this.state=br,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Ys(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Mp),Ap=function(){function t(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var i=e-3;i>0&&this.points_[i+2]>t;)i-=3;var o=this.points_[e+2]-this.points_[i+2];if(o<1e3/60)return!1;var n=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,n),this.initialVelocity_=Math.sqrt(n*n+r*r)/o,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),Lp="active",Gp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Np(t,e,i,o){var n=t.getZoom();if(void 0!==n){var r=t.getConstrainedZoom(n+e),a=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:i,duration:void 0!==o?o:250,easing:hi})}}var Bp=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return Gp(e,t),e.prototype.getActive=function(){return this.get(Lp)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Lp,t)},e.prototype.setMap=function(t){this.map_=t},e}(oe),Vp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),qp=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:250,i}return Vp(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==gr.DBLCLICK){var i=t.originalEvent,o=t.map,n=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;Np(o.getView(),r,n,this.duration_),i.preventDefault(),e=!0}return!e},e}(Bp),Wp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Up(t){for(var e=t.length,i=0,o=0,n=0;n<e;n++)i+=t[n].clientX,o+=t[n].clientY;return[i/e,o/e]}var Xp=function(t){function e(e){var i=this,o=e||{};return i=t.call(this,o)||this,o.handleDownEvent&&(i.handleDownEvent=o.handleDownEvent),o.handleDragEvent&&(i.handleDragEvent=o.handleDragEvent),o.handleMoveEvent&&(i.handleMoveEvent=o.handleMoveEvent),o.handleUpEvent&&(i.handleUpEvent=o.handleUpEvent),o.stopDown&&(i.stopDown=o.stopDown),i.handlingDownUpSequence=!1,i.trackedPointers_={},i.targetPointers=[],i}return Wp(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==gr.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==gr.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==gr.POINTERDOWN){var o=this.handleDownEvent(t);this.handlingDownUpSequence=o,e=this.stopDown(o)}else t.type==gr.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===gr.POINTERDOWN||e===gr.POINTERDRAG||e===gr.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==gr.POINTERUP?delete this.trackedPointers_[i]:(t.type==gr.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=Ot(this.trackedPointers_)}},e}(Bp);function Kp(t){var e=arguments;return function(t){for(var i=!0,o=0,n=e.length;o<n&&(i=i&&e[o](t));++o);return i}}var Yp=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Zp=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},Hp=Ct,$p=function(t){var e=t.originalEvent;return 0==e.button&&!(ue&&pe&&e.ctrlKey)},Jp=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Qp=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},th=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},eh=function(t){var e=t.originalEvent;return je(void 0!==e,56),"mouse"==e.pointerType},ih=function(t){var e=t.originalEvent;return je(void 0!==e,56),e.isPrimary&&0===e.button},oh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),nh=function(t){function e(e){var i=t.call(this,{stopDown:zt})||this,o=e||{};i.kinetic_=o.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var n=o.condition?o.condition:Kp(Jp,ih);return i.condition_=o.onFocusOnly?Kp(Zp,n):n,i.noKinetic_=!1,i}return oh(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e,i,o=this.targetPointers,n=Up(o);if(o.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var r=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],a=t.map.getView();e=r,i=a.getResolution(),e[0]*=i,e[1]*=i,Uo(r,a.getRotation()),a.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=o.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var o=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),r=i.getCenterInternal(),a=e.getPixelFromCoordinateInternal(r),s=e.getCoordinateFromPixelInternal([a[0]-o*Math.cos(n),a[1]-o*Math.sin(n)]);i.animateInternal({center:i.getConstrainedCenter(s),duration:500,easing:hi})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Xp),rh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ah=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this,{stopDown:zt})||this).condition_=o.condition?o.condition:Yp,i.lastAngle_=void 0,i.duration_=void 0!==o.duration?o.duration:250,i}return rh(e,t),e.prototype.handleDragEvent=function(t){if(eh(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Dr){var o=e.getSize(),n=t.pixel,r=Math.atan2(o[1]/2-n[1],n[0]-o[0]/2);if(void 0!==this.lastAngle_){var a=r-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!eh(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!eh(t)&&(!(!$p(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(Xp),sh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),lh=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return sh(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",o=this.element_.style;o.left=Math.min(t[0],e[0])+i,o.top=Math.min(t[1],e[1])+i,o.width=Math.abs(e[0]-t[0])+i,o.height=Math.abs(e[1]-t[1])+i},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new Ia([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(_t),uh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ph="boxstart",hh="boxdrag",dh="boxend",ch="boxcancel",gh=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.coordinate=i,n.mapBrowserEvent=o,n}return uh(e,t),e}(vt),fh=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=e||{};return i.box_=new lh(o.className||"ol-dragbox"),i.minArea_=void 0!==o.minArea?o.minArea:64,o.onBoxEnd&&(i.onBoxEnd=o.onBoxEnd),i.startPixel_=null,i.condition_=o.condition?o.condition:$p,i.boxEndCondition_=o.boxEndCondition?o.boxEndCondition:i.defaultBoxEndCondition,i}return uh(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var o=i[0]-e[0],n=i[1]-e[1];return o*o+n*n>=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 gh(hh,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 gh(e?dh:ch,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 gh(ph,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Xp),mh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),vh=function(t){function e(e){var i=this,o=e||{},n=o.condition?o.condition:Qp;return(i=t.call(this,{condition:n,className:o.className||"ol-dragzoom",minArea:o.minArea})||this).duration_=void 0!==o.duration?o.duration:200,i.out_=void 0!==o.out&&o.out,i}return mh(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),i=this.getGeometry();if(this.out_){var o=e.rotatedExtentForGeometry(i),n=e.getResolutionForExtentInternal(o),r=e.getResolution()/n;(i=i.clone()).scale(r*r)}e.fitInternal(i,{duration:this.duration_,easing:hi})},e}(fh),yh=37,_h=38,bh=39,xh=40,kh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wh=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.defaultCondition_=function(t){return Jp(t)&&th(t)},i.condition_=void 0!==o.condition?o.condition:i.defaultCondition_,i.duration_=void 0!==o.duration?o.duration:100,i.pixelDelta_=void 0!==o.pixelDelta?o.pixelDelta:128,i}return kh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Nt){var i=t.originalEvent,o=i.keyCode;if(this.condition_(t)&&(o==xh||o==yh||o==bh||o==_h)){var n=t.map.getView(),r=n.getResolution()*this.pixelDelta_,a=0,s=0;o==xh?s=-r:o==yh?a=-r:o==bh?a=r:s=r;var l=[a,s];Uo(l,n.getRotation()),function(t,e,i){var o=t.getCenterInternal();if(o){var n=[o[0]+e[0],o[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:ci,center:t.getConstrainedCenter(n)})}}(n,l,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Bp),Sh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ch=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.condition_=o.condition?o.condition:th,i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:100,i}return Sh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Nt||t.type==Bt){var i=t.originalEvent,o=i.charCode;if(this.condition_(t)&&(o=="+".charCodeAt(0)||o=="-".charCodeAt(0))){var n=t.map,r=o=="+".charCodeAt(0)?this.delta_:-this.delta_;Np(n.getView(),r,void 0,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Bp),zh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Eh="trackpad",Th="wheel",Ph=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,o)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==o.maxDelta?o.maxDelta:1,i.duration_=void 0!==o.duration?o.duration:250,i.timeout_=void 0!==o.timeout?o.timeout:80,i.useAnchor_=void 0===o.useAnchor||o.useAnchor,i.constrainResolution_=void 0!==o.constrainResolution&&o.constrainResolution;var n=o.condition?o.condition:Hp;return i.condition_=o.onFocusOnly?Kp(Zp,n):n,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return zh(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!==Ut)return!0;var e,i=t.map,o=t.originalEvent;if(o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==Ut&&(e=o.deltaY,le&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=he),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var n=Date.now();void 0===this.startTime_&&(this.startTime_=n),(!this.mode_||n-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Eh:Th);var r=i.getView();if(this.mode_===Eh&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=n,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(n-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-De(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Np(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Bp),Oh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fh=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=zt),(i=t.call(this,n)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==o.threshold?o.threshold:.3,i.duration_=void 0!==o.duration?o.duration:250,i}return Oh(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],o=this.targetPointers[1],n=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(void 0!==this.lastAngle_){var r=n-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=n;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==Dr){var l=a.getViewport().getBoundingClientRect(),u=Up(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(u),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Xp),Rh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ih=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=zt),(i=t.call(this,n)||this).anchor_=null,i.duration_=void 0!==o.duration?o.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return Rh(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],o=this.targetPointers[1],n=i.clientX-o.clientX,r=i.clientY-o.clientY,a=Math.sqrt(n*n+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,l=s.getView();1!=e&&(this.lastScaleDelta_=e);var u=s.getViewport().getBoundingClientRect(),p=Up(this.targetPointers);p[0]-=u.left,p[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(p),s.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Xp),Mh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),jh="Point",Dh="LineString",Ah="Polygon",Lh="Circle",Gh="drawstart",Nh="drawend",Bh="drawabort",Vh=function(t){function e(e,i){var o=t.call(this,e)||this;return o.feature=i,o}return Mh(e,t),e}(vt);var qh=function(t){function e(e){var i=this,o=e;o.stopDown||(o.stopDown=zt),(i=t.call(this,o)||this).on,i.once,i.un,i.shouldHandle_=!1,i.downPx_=null,i.downTimeout_,i.lastDragTime_,i.pointerType_,i.freehand_=!1,i.source_=e.source?e.source:null,i.features_=e.features?e.features:null,i.snapTolerance_=e.snapTolerance?e.snapTolerance:12,i.type_=e.type,i.mode_=function(t){switch(t){case Fo:case jo:return jh;case Ro:case Do:return Dh;case Mo:case Ao:return Ah;case Go:return Lh;default:throw new Error("Invalid type: "+t)}}(i.type_),i.stopClick_=!!e.stopClick,i.minPoints_=e.minPoints?e.minPoints:i.mode_===Ah?3:2,i.maxPoints_=i.mode_===Lh?2:e.maxPoints?e.maxPoints:1/0,i.finishCondition_=e.finishCondition?e.finishCondition:Ct;var n,r=e.geometryFunction;if(!r){var a,s=i.mode_;if(s===Lh)r=function(t,e,i){var o=e||new is([NaN,NaN]),n=cn(t[0]),r=Xo(n,cn(t[t.length-1]));return o.setCenterAndRadius(n,Math.sqrt(r)),o};else s===jh?a=va:s===Dh?a=ps:s===Ah&&(a=Ia),r=function(t,e,i){return e?s===Ah?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new a(t),e}}return i.geometryFunction_=r,i.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,i.finishCoordinate_=null,i.sketchFeature_=null,i.sketchPoint_=null,i.sketchCoords_=null,i.sketchLine_=null,i.sketchLineCoords_=null,i.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,i.overlay_=new fp({source:new Rp({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(n=ul(),function(t,e){return n[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.geometryName_=e.geometryName,i.condition_=e.condition?e.condition:Jp,i.freehandCondition_,e.freehand?i.freehandCondition_=Hp:i.freehandCondition_=e.freehandCondition?e.freehandCondition:Qp,i.addChangeListener(Lp,i.updateState_),i}return Mh(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===At&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==jh&&this.freehandCondition_(e);var i=e.type===gr.POINTERMOVE,o=!0;!this.freehand_&&this.lastDragTime_&&e.type===gr.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===gr.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),o=!1):this.freehand_&&e.type===gr.POINTERDOWN?o=!1:i&&this.getPointerCount()<2?(o=e.type===gr.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===gr.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===gr.DBLCLICK&&(o=!1),t.prototype.handleEvent.call(this,e)&&o},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new cr(gr.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(t.coordinate),!i&&this.freehand_?this.finishDrawing():this.freehand_||i&&this.mode_!==jh||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,i=t.pixel,o=e[0]-i[0],n=e[1]-i[1],r=o*o+n*n;if(this.shouldHandle_=this.freehand_?r>this.squaredClickTolerance_:r<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,o=[this.finishCoordinate_],n=this.mode_;if(n===jh)e=!0;else if(n===Lh)e=2===this.sketchCoords_.length;else if(n===Dh)i=this.sketchCoords_.length>this.minPoints_;else if(n===Ah){var r=this.sketchCoords_;i=r[0].length>this.minPoints_,o=[r[0][0],r[0][r[0].length-2]]}if(i)for(var a=this.getMap(),s=0,l=o.length;s<l;s++){var u=o[s],p=a.getPixelFromCoordinate(u),h=t[0]-p[0],d=t[1]-p[1],c=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(h*h+d*d)<=c){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new _s(new va(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new _s);var e=t.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new ps(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===jh?this.sketchCoords_=t.slice():this.mode_===Ah?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new _s(new ps(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new _s,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Vh(Gh,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,i,o=this.getMap(),n=this.sketchFeature_.getGeometry(),r=o.getView().getProjection();(this.mode_===jh?i=this.sketchCoords_:this.mode_===Ah?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(o.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=t[0],i[1]=t[1],this.geometryFunction_(this.sketchCoords_,n,r),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(n.getType()===Mo&&this.mode_!==Ah)this.createOrUpdateCustomSketchLine_(n);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,i,o=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;r===Dh||r===Lh?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,o,n)):r===Ah&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,o,n)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;if(o===Dh||o===Lh){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var n=this.finishCoordinate_.slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}this.geometryFunction_(t,e,i),e.getType()===Mo&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(o===Ah){(t=this.sketchCoords_[0]).splice(-2,1);var r=this.sketchLine_.getGeometry();if(t.length>=2){n=t[t.length-2].slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}r.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===Dh?(e.pop(),this.geometryFunction_(e,i,o)):this.mode_===Ah&&(e[0].pop(),this.geometryFunction_(e,i,o),e=i.getCoordinates()),this.type_===jo?t.setGeometry(new gs([e])):this.type_===Do?t.setGeometry(new ds([e])):this.type_===Ao&&t.setGeometry(new vs([e])),this.dispatchEvent(new Vh(Nh,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new Vh(Bh,t))},e.prototype.appendCoordinates=function(t){var e,i=this.mode_,o=!this.sketchFeature_;if(o&&this.startDrawing_(t[0]),i===Dh||i===Lh)e=this.sketchCoords_;else{if(i!==Ah)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}o&&e.shift(),e.pop();for(var n=0;n<t.length;n++)this.addToDrawing_(t[n]);var r=t[t.length-1];this.addToDrawing_(r),this.modifyDrawing_(r)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new _s(new va(i)),this.updateSketchFeatures_(),this.dispatchEvent(new Vh(Gh,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(Xp),Wh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Uh=[0,0,0,0],Xh=[],Kh="modifystart",Yh="modifyend",Zh=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.features=i,n.mapBrowserEvent=o,n}return Wh(e,t),e}(vt);function Hh(t,e){return t.index-e.index}function $h(t,e,i){var o=e.geometry;if(o.getType()===Go){var n=o;if(1===e.index){null;var r=Xo(n.getCenter(),cn(t)),a=Math.sqrt(r)-n.getRadius();return a*a}}var s=cn(t);return Xh[0]=cn(e.segment[0]),Xh[1]=cn(e.segment[1]),Yo(s,Xh)}function Jh(t,e,i){var o=e.geometry;if(o.getType()===Go&&1===e.index){var n=o;return dn(n.getClosestPoint(cn(t)))}var r=cn(t);return Xh[0]=cn(e.segment[0]),Xh[1]=cn(e.segment[1]),dn(qo(r,Xh))}var Qh=function(t){function e(e){var i,o,n=t.call(this,e)||this;if(n.on,n.once,n.un,n.boundHandleFeatureChange_=n.handleFeatureChange_.bind(n),n.condition_=e.condition?e.condition:ih,n.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&function(t){return t.type==gr.SINGLECLICK}(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Hp,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.featuresBeingModified_=null,n.rBush_=new mp,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new fp({source:new Rp({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(i=ul(),function(t,e){return i[Fo]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.SEGMENT_WRITERS_={Point:n.writePointGeometry_.bind(n),LineString:n.writeLineStringGeometry_.bind(n),LinearRing:n.writeLineStringGeometry_.bind(n),Polygon:n.writePolygonGeometry_.bind(n),MultiPoint:n.writeMultiPointGeometry_.bind(n),MultiLineString:n.writeMultiLineStringGeometry_.bind(n),MultiPolygon:n.writeMultiPolygonGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n)},n.source_=null,n.hitDetection_=null,e.features?o=e.features:e.source&&(n.source_=e.source,o=new ui(n.source_.getFeatures()),n.source_.addEventListener(bp,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(wp,n.handleSourceRemove_.bind(n))),!o)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(n.hitDetection_=e.hitDetection),n.features_=o,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(ni,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(ri,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n.delta_=[0,0],n.snapToPointer_=void 0===e.snapToPointer?!n.hitDetection_:e.snapToPointer,n}return Wh(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}var o=this.getMap();o&&o.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,o),t.addEventListener(jt,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new ui;for(var i=this.featuresBeingModified_.getArray(),o=0,n=e.length;o<n;++o)for(var r=e[o],a=0,s=r.length;a<s;++a){var l=r[a].feature;l&&-1===i.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new Zh(Kh,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(jt,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var o=i.length-1;o>=0;--o){for(var n=i[o],r=this.dragSegments_.length-1;r>=0;--r)this.dragSegments_[r][0]===n&&this.dragSegments_.splice(r,1);e.remove(n)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),o={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,geometry:e,depth:[o],index:o,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,geometry:e,index:o,segment:r};this.rBush_.insert($i(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert($i(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert($i(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var h=l.slice(u,u+2),d={feature:t,geometry:e,depth:[a,o],index:u,segment:h};this.rBush_.insert($i(h),d)}},e.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),o={feature:t,geometry:e,index:0,segment:[i,i]},n={feature:t,geometry:e,index:1,segment:[i,i]},r=[o,n];o.featureSegments=r,n.featureSegments=r,this.rBush_.insert(lo(i),o);var a=e;this.rBush_.insert(a.getExtent(),n)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=i[o];(0,this.SEGMENT_WRITERS_[n.getType()])(t,n)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,i){var o=this.vertexFeature_;o?o.getGeometry().setCoordinates(t):(o=new _s(new va(t)),this.vertexFeature_=o,this.overlay_.getSource().addFeature(o));return o.set("features",e),o.set("geometries",i),o},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=gr.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(i=!(e.type!=gr.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==gr.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!i);var i},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],i=[],o=[],n=0,r=this.dragSegments_.length;n<r;++n){var a=this.dragSegments_[n],s=a[0],l=s.feature;-1===i.indexOf(l)&&i.push(l);var u=s.geometry;-1===o.indexOf(u)&&o.push(u);for(var p=s.depth,h=void 0,d=s.segment,c=a[1];e.length<u.getStride();)e.push(d[c][e.length]);switch(u.getType()){case Fo:h=e,d[0]=e,d[1]=e;break;case jo:(h=u.getCoordinates())[s.index]=e,d[0]=e,d[1]=e;break;case Ro:(h=u.getCoordinates())[s.index+c]=e,d[c]=e;break;case Do:case Mo:(h=u.getCoordinates())[p[0]][s.index+c]=e,d[c]=e;break;case Ao:(h=u.getCoordinates())[p[1]][p[0]][s.index+c]=e,d[c]=e;break;case Go:if(d[0]=e,d[1]=e,0===s.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var g=Ko(cn(u.getCenter()),cn(e));u.setRadius(g),this.changingFeature_=!1}}h&&this.setGeometryCoordinates_(u,h)}this.createOrUpdateVertexFeature_(e,i,o)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var i=this.vertexFeature_;if(i){var o=t.map.getView().getProjection(),n=[],r=i.getGeometry().getCoordinates(),a=$i([r]),s=this.rBush_.getInExtent(a),l={};s.sort(Hh);for(var u=0,p=s.length;u<p;++u){var h=s[u],d=h.segment,c=te(h.geometry),g=h.depth;if(g&&(c+="-"+g.join("-")),l[c]||(l[c]=new Array(2)),h.geometry.getType()!==Go||1!==h.index)if(!Wo(d[0],r)||l[c][0])if(!Wo(d[1],r)||l[c][1])te(d)in this.vertexSegments_&&!l[c][0]&&!l[c][1]&&this.insertVertexCondition_(t)&&n.push(h);else{if((h.geometry.getType()===Ro||h.geometry.getType()===Do)&&l[c][0]&&0===l[c][0].index)continue;this.dragSegments_.push([h,1]),l[c][1]=h}else this.dragSegments_.push([h,0]),l[c][0]=h;else Wo(Jh(e,h,o),r)&&!l[c][0]&&(this.dragSegments_.push([h,0]),l[c][0]=h)}n.length&&this.willModifyFeatures_(t,[n]);for(var f=n.length-1;f>=0;--f)this.insertVertex_(n[f],r)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],o=i.geometry;if(o.getType()===Go){var n=o.getCenter(),r=i.featureSegments[0],a=i.featureSegments[1];r.segment[0]=n,r.segment[1]=n,a.segment[0]=n,a.segment[1]=n,this.rBush_.update(lo(n),r);var s=o;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update($i(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new Zh(Yh,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,i){var o,n,r=this,a=i||e.getCoordinateFromPixel(t),s=e.getView().getProjection();if(this.hitDetection_){var l="object"==typeof this.hitDetection_?function(t){return t===r.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,i){if((i=i||t.getGeometry()).getType()===Fo&&(s=r.features_.getArray(),l=t,s.indexOf(l)>=0)){n=i;var a=i.getFlatCoordinates().slice(0,2);o=[{feature:t,geometry:i,segment:[a,a]}]}var s,l;return!0}),{layerFilter:l})}if(!o){var u=gn(Ji(fn(lo(a,Uh)),e.getView().getResolution()*this.pixelTolerance_,Uh));o=this.rBush_.getInExtent(u)}if(o&&o.length>0){var p=o.sort((function(t,e){return $h(a,t,s)-$h(a,e,s)}))[0],h=p.segment,d=Jh(a,p,s),c=e.getPixelFromCoordinate(d),g=Ko(t,c);if(n||g<=this.pixelTolerance_){var f={};if(f[te(h)]=!0,this.snapToPointer_||(this.delta_[0]=d[0]-a[0],this.delta_[1]=d[1]-a[1]),p.geometry.getType()===Go&&1===p.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(d,[p.feature],[p.geometry]);else{var m=e.getPixelFromCoordinate(h[0]),v=e.getPixelFromCoordinate(h[1]),y=Xo(c,m),_=Xo(c,v);g=Math.sqrt(Math.min(y,_)),this.snappedToVertex_=g<=this.pixelTolerance_,this.snappedToVertex_&&(d=y>_?h[1]:h[0]),this.createOrUpdateVertexFeature_(d,[p.feature],[p.geometry]);var b={};b[te(p.geometry)]=!0;for(var x=1,k=o.length;x<k;++x){var w=o[x].segment;if(!(Wo(h[0],w[0])&&Wo(h[1],w[1])||Wo(h[0],w[1])&&Wo(h[1],w[0])))break;var S=te(o[x].geometry);S in b||(b[S]=!0,f[te(w)]=!0)}}return void(this.vertexSegments_=f)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var i,o=t.segment,n=t.feature,r=t.geometry,a=t.depth,s=t.index;e.length<r.getStride();)e.push(0);switch(r.getType()){case Do:case Mo:(i=r.getCoordinates())[a[0]].splice(s+1,0,e);break;case Ao:(i=r.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case Ro:(i=r.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(r,i);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(r,s,a,1);var u={segment:[o[0],e],feature:n,geometry:r,depth:a,index:s};l.insert($i(u.segment),u),this.dragSegments_.push([u,1]);var p={segment:[e,o[1]],feature:n,geometry:r,depth:a,index:s+1};l.insert($i(p.segment),p),this.dragSegments_.push([p,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=gr.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.dispatchEvent(new Zh(Yh,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,i,o,n,r,a,s,l,u,p,h=this.dragSegments_,d={},c=!1;for(n=h.length-1;n>=0;--n)p=te((u=(i=h[n])[0]).feature),u.depth&&(p+="-"+u.depth.join("-")),p in d||(d[p]={}),0===i[1]?(d[p].right=u,d[p].index=u.index):1==i[1]&&(d[p].left=u,d[p].index=u.index+1);for(p in d){switch(l=d[p].right,a=d[p].left,(s=(r=d[p].index)-1)<0&&(s=0),t=e=(o=(u=void 0!==a?a:l).geometry).getCoordinates(),c=!1,o.getType()){case Do:e[u.depth[0]].length>2&&(e[u.depth[0]].splice(r,1),c=!0);break;case Ro:e.length>2&&(e.splice(r,1),c=!0);break;case Ao:t=t[u.depth[1]];case Mo:(t=t[u.depth[0]]).length>4&&(r==t.length-1&&(r=0),t.splice(r,1),c=!0,0===r&&(t.pop(),t.push(t[0]),s=t.length-1))}if(c){this.setGeometryCoordinates_(o,e);var g=[];if(void 0!==a&&(this.rBush_.remove(a),g.push(a.segment[0])),void 0!==l&&(this.rBush_.remove(l),g.push(l.segment[1])),void 0!==a&&void 0!==l){var f={depth:u.depth,feature:u.feature,geometry:u.geometry,index:s,segment:g};this.rBush_.insert($i(f.segment),f)}this.updateSegmentIndices_(o,r,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),h.length=0}}return c},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,i,o){this.rBush_.forEachInExtent(t.getExtent(),(function(n){n.geometry===t&&(void 0===i||void 0===n.depth||St(n.depth,i))&&n.index>e&&(n.index+=o)}))},e}(Xp),td=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ed(t){return t.feature?t.feature:t.element?t.element:void 0}var id=[],od=function(t){function e(e){var i=this,o=e||{},n=o;return n.handleDownEvent||(n.handleDownEvent=Ct),n.stopDown||(n.stopDown=zt),(i=t.call(this,n)||this).source_=o.source?o.source:null,i.vertex_=void 0===o.vertex||o.vertex,i.edge_=void 0===o.edge||o.edge,i.features_=o.features?o.features:null,i.featuresListenerKeys_=[],i.featureChangeListenerKeys_={},i.indexedFeaturesExtents_={},i.pendingFeatures_={},i.pixelTolerance_=void 0!==o.pixelTolerance?o.pixelTolerance:10,i.rBush_=new mp,i.SEGMENT_WRITERS_={Point:i.writePointGeometry_.bind(i),LineString:i.writeLineStringGeometry_.bind(i),LinearRing:i.writeLineStringGeometry_.bind(i),Polygon:i.writePolygonGeometry_.bind(i),MultiPoint:i.writeMultiPointGeometry_.bind(i),MultiLineString:i.writeMultiLineStringGeometry_.bind(i),MultiPolygon:i.writeMultiPolygonGeometry_.bind(i),GeometryCollection:i.writeGeometryCollectionGeometry_.bind(i),Circle:i.writeCircleGeometry_.bind(i)},i}return td(e,t),e.prototype.addFeature=function(t,e){var i=void 0===e||e,o=te(t),n=t.getGeometry();if(n){var r=this.SEGMENT_WRITERS_[n.getType()];r&&(this.indexedFeaturesExtents_[o]=n.getExtent([1/0,1/0,-1/0,-1/0]),r(t,n))}i&&(this.featureChangeListenerKeys_[o]=Xt(t,jt,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var i=this.snapTo(e.pixel,e.coordinate,e.map);return i.snapped&&(e.coordinate=i.vertex.slice(0,2),e.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=ed(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=ed(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=te(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=Ot(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var i=void 0===e||e,o=te(t),n=this.indexedFeaturesExtents_[o];if(n){var r=this.rBush_,a=[];r.forEachInExtent(n,(function(e){t===e.feature&&a.push(e)}));for(var s=a.length-1;s>=0;--s)r.remove(a[s])}i&&(Yt(this.featureChangeListenerKeys_[o]),delete this.featureChangeListenerKeys_[o])},e.prototype.setMap=function(e){var i=this.getMap(),o=this.featuresListenerKeys_,n=this.getFeatures_();i&&(o.forEach(Yt),o.length=0,n.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?o.push(Xt(this.features_,ni,this.handleFeatureAdd_,this),Xt(this.features_,ri,this.handleFeatureRemove_,this)):this.source_&&o.push(Xt(this.source_,bp,this.handleFeatureAdd_,this),Xt(this.source_,wp,this.handleFeatureRemove_,this)),n.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,i){var o=$i([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),n=this.rBush_.getInExtent(o);this.vertex_&&!this.edge_&&(n=n.filter((function(t){return t.feature.getGeometry().getType()!==Go})));var r=!1,a=null,s=null;if(0===n.length)return{snapped:r,vertex:a,vertexPixel:s};i.getView().getProjection();for(var l,u=cn(e),p=1/0,h=0;h<n.length;++h){var d=n[h];id[0]=cn(d.segment[0]),id[1]=cn(d.segment[1]);var c=Yo(u,id);c<p&&(l=d,p=c)}var g=l.segment;if(this.vertex_&&!this.edge_){var f=i.getPixelFromCoordinate(g[0]),m=i.getPixelFromCoordinate(g[1]),v=Xo(t,f),y=Xo(t,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(r=!0,a=v>y?g[1]:g[0],s=i.getPixelFromCoordinate(a))}else if(this.edge_){var _=l.feature.getGeometry().getType()===Go;if(_){var b=l.feature.getGeometry();null,a=dn(function(t,e){var i=e.getRadius(),o=e.getCenter(),n=o[0],r=o[1],a=t[0]-n,s=t[1]-r;0===a&&0===s&&(a=1);var l=Math.sqrt(a*a+s*s);return[n+i*a/l,r+i*s/l]}(u,b))}else id[0]=cn(g[0]),id[1]=cn(g[1]),a=dn(qo(u,id));if(Ko(t,s=i.getPixelFromCoordinate(a))<=this.pixelTolerance_&&(r=!0,this.vertex_&&!_)){f=i.getPixelFromCoordinate(g[0]),m=i.getPixelFromCoordinate(g[1]),v=Xo(s,f),y=Xo(s,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(a=v>y?g[1]:g[0],s=i.getPixelFromCoordinate(a))}}return r&&(s=[Math.round(s[0]),Math.round(s[1])]),{snapped:r,vertex:a,vertexPixel:s}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){this.getMap().getView().getProjection();for(var i=ja(e).getCoordinates()[0],o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert($i(r),a)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=this.SEGMENT_WRITERS_[i[o].getType()];n&&n(t,i[o])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert($i(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert($i(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var h=l.slice(u,u+2),d={feature:t,segment:h};this.rBush_.insert($i(h),d)}},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),o={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert($i(l),u)}},e}(Xp);function nd(t){var e=t||{},i=new ui,o=new Ap(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new ah),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new qp({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new nh({onFocusOnly:e.onFocusOnly,kinetic:o})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new Fh),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Ih({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new wh),i.push(new Ch({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Ph({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new vh({duration:e.zoomDuration})),i}var rd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ad=function(t){function e(e){return(e=Tt({},e)).controls||(e.controls=Qa()),e.interactions||(e.interactions=nd({onFocusOnly:!0})),t.call(this,e)||this}return rd(e,t),e.prototype.createRenderer=function(){return new ir(this)},e}(Wa),sd=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 i=this.entries_[t];return je(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return je(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){je(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function ld(t,e,i,o){return void 0!==o?(o[0]=t,o[1]=e,o[2]=i,o):[t,e,i]}function ud(t,e,i){return t+"/"+e+"/"+i}function pd(t){return ud(t[0],t[1],t[2])}function hd(t){return t.split("/").map(Number)}var dd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),cd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return dd(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=hd(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(pd(e.tileCoord)),e.release())}.bind(this))}},e}(sd),gd=function(){function t(t,e,i,o){this.minX=t,this.maxX=e,this.minY=i,this.maxY=o}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 fd(t,e,i,o,n){return void 0!==n?(n.minX=t,n.maxX=e,n.minY=i,n.maxY=o,n):new gd(t,e,i,o)}var md=gd,vd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yd=[],_d=function(t){function e(e,i,o,n){var r=t.call(this,e,i,{transition:0})||this;return r.context_={},r.executorGroups={},r.declutterExecutorGroups={},r.loadingSourceTiles=0,r.hitDetectionImageData={},r.replayState_={},r.sourceTiles=[],r.errorTileKeys={},r.wantedResolution,r.getSourceTiles=n.bind(void 0,r),r.wrappedTileCoord=o,r}return vd(e,t),e.prototype.getContext=function(t){var e=te(t);return e in this.context_||(this.context_[e]=fe(1,1,yd)),this.context_[e]},e.prototype.hasContext=function(t){return te(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=te(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_)yd.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(Mp),bd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),xd=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.extent=null,s.format_=n,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=r,s.url_=o,s.key=o,s}return bd(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==_r&&(this.setState(br),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(kr)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(xr)},e.prototype.setLoader=function(t){this.loader_=t},e}(Mp),kd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wd=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new md(0,0,0,0),i}return kd(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),o=e.getUseInterimTilesOnError();return i==xr||i==wr||i==kr&&!o},e.prototype.getTile=function(t,e,i,o){var n=o.pixelRatio,r=o.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,i,n,r);return s.getState()==kr&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(xr)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.loadedTileCallback=function(e,i,o){return!!this.isDrawableTile(o)&&t.prototype.loadedTileCallback.call(this,e,i,o)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],o=t.viewState,n=o.projection,r=o.resolution,a=o.center,s=o.rotation,l=t.pixelRatio,u=this.getLayer(),p=u.getSource(),h=p.getRevision(),d=p.getTileGridForProjection(n),c=d.getZForResolution(r,p.zDirection),g=d.getResolution(c),f=t.extent,m=i.extent&&fn(i.extent);m&&(f=So(f,fn(i.extent)));var v=p.getTilePixelRatio(l),y=Math.round(t.size[0]*v),_=Math.round(t.size[1]*v);if(s){var b=Math.round(Math.sqrt(y*y+_*_));y=b,_=b}var x=g*y/2/v,k=g*_/2/v,w=[a[0]-x,a[1]-k,a[0]+x,a[1]+k],S=d.getTileRangeForExtentAndZ(f,c),C={};C[c]={};var z=this.createLoadedTileFinder(p,n,C),E=this.tmpExtent,T=this.tmpTileRange_;this.newTiles_=!1;for(var P=S.minX;P<=S.maxX;++P)for(var O=S.minY;O<=S.maxY;++O){var F=this.getTile(c,P,O,t);if(this.isDrawableTile(F)){var R=te(this);if(F.getState()==xr){C[c][F.tileCoord.toString()]=F;var I=F.inTransition(R);this.newTiles_||!I&&-1!==this.renderedTiles.indexOf(F)||(this.newTiles_=!0)}if(1===F.getAlpha(R,t.time))continue}var M=d.getTileCoordChildTileRange(F.tileCoord,T,E),j=!1;M&&(j=z(c+1,M)),j||d.forEachTileCoordParentTileRange(F.tileCoord,z,T,E)}var D=g/r;wn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/v,1/v,s,-y/2,-_/2);var A=Cn(this.pixelTransform);this.useContainer(e,A,i.opacity);var L=this.context,G=L.canvas;Sn(this.inversePixelTransform,this.pixelTransform),wn(this.tempTransform,y/2,_/2,D,D,0,-y/2,-_/2),G.width!=y||G.height!=_?(G.width=y,G.height=_):this.containerReused||L.clearRect(0,0,y,_),m&&this.clipUnrotated(L,t,m),Tt(L,p.getContextOptions()),this.preRender(L,t),this.renderedTiles.length=0;var N,B,V,q=Object.keys(C).map(Number);q.sort(bt),1!==i.opacity||this.containerReused&&!p.getOpaque(t.viewState.projection)?(N=[],B=[]):q=q.reverse();for(var W=q.length-1;W>=0;--W){var U=q[W],X=p.getTilePixelSize(U,l,n),K=d.getResolution(U)/g,Y=X[0]*K*D,Z=X[1]*K*D,H=d.getTileCoordForCoordAndZ(Co(w),U),$=d.getTileCoordExtent(H),J=xn(this.tempTransform,[v*($[0]-w[0])/g,v*(w[3]-$[3])/g]),Q=v*p.getGutterForProjection(n),tt=C[U];for(var et in tt){var it=(F=tt[et]).tileCoord,ot=H[1]-it[1],nt=Math.round(J[0]-(ot-1)*Y),rt=H[2]-it[2],at=Math.round(J[1]-(rt-1)*Z),st=nt-(P=Math.round(J[0]-ot*Y)),lt=at-(O=Math.round(J[1]-rt*Z)),ut=c===U;if(!(I=ut&&1!==F.getAlpha(te(this),t.time)))if(N){L.save(),V=[P,O,P+st,O,P+st,O+lt,P,O+lt];for(var pt=0,ht=N.length;pt<ht;++pt)if(c!==U&&U<B[pt]){var dt=N[pt];L.beginPath(),L.moveTo(V[0],V[1]),L.lineTo(V[2],V[3]),L.lineTo(V[4],V[5]),L.lineTo(V[6],V[7]),L.moveTo(dt[6],dt[7]),L.lineTo(dt[4],dt[5]),L.lineTo(dt[2],dt[3]),L.lineTo(dt[0],dt[1]),L.clip()}N.push(V),B.push(U)}else L.clearRect(P,O,st,lt);this.drawTileImage(F,t,P,O,st,lt,Q,ut),N&&!I?(L.restore(),this.renderedTiles.unshift(F)):this.renderedTiles.push(F),this.updateUsedTiles(t.usedTiles,p,F)}}this.renderedRevision=h,this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!po(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.renderedProjection=n,this.manageTilePyramid(t,p,d,l,n,f,c,u.getPreload()),this.scheduleExpireCache(t,p),this.postRender(L,t),i.extent&&L.restore(),A!==G.style.transform&&(G.style.transform=A);var ct=we(i.opacity),gt=this.container;return ct!==gt.style.opacity&&(gt.style.opacity=ct),this.container},e.prototype.drawTileImage=function(t,e,i,o,n,r,a,s){var l=this.getTileImage(t);if(l){var u=te(this),p=s?t.getAlpha(u,e.time):1,h=p!==this.context.globalAlpha;h&&(this.context.save(),this.context.globalAlpha=p),this.context.drawImage(l,a,a,l.width-2*a,l.height-2*a,i,o,n,r),h&&this.context.restore(),1!==p?e.animate=!0:s&&t.endTransition(u)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var i=function(t,e,i){var o=te(t);o in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[o])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i){var o=te(e);o in t||(t[o]={}),t[o][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,i,o,n,r,a,s,l){var u=te(e);u in t.wantedTiles||(t.wantedTiles[u]={});var p,h,d,c,g,f,m=t.wantedTiles[u],v=t.tileQueue,y=0;for(f=i.getMinZoom();f<=a;++f)for(h=i.getTileRangeForExtentAndZ(r,f,h),d=i.getResolution(f),c=h.minX;c<=h.maxX;++c)for(g=h.minY;g<=h.maxY;++g)a-f<=s?(++y,(p=e.getTile(f,c,g,o,n)).getState()==_r&&(m[p.getKey()]=!0,v.isKeyQueued(p.getKey())||v.enqueue([p,u,i.getTileCoordCenter(p.tileCoord),d])),void 0!==l&&l(p)):e.useTile(f,c,g,n);e.updateCacheSize(y,n)},e}(ju);wd.prototype.getLayer;var Sd=wd,Cd="image",zd="hybrid",Ed="vector",Td=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Pd={image:[Nu,Du,Gu,Lu,Bu],hybrid:[Nu,Gu],vector:[]},Od={hybrid:[Lu,Bu,Au],vector:[Nu,Du,Gu,Lu,Bu,Au]},Fd=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.dirty_=!1,i.renderedLayerRevision_,i.renderedPixelToCoordinateTransform_=null,i.renderedRotation_,i.tmpTransform_=[1,0,0,1,0,0],i}return Td(e,t),e.prototype.prepareTile=function(t,e,i){var o,n=t.getState();return n!==xr&&n!==kr||(this.updateExecutorGroup_(t,e,i),this.tileImageNeedsRender_(t)&&(o=!0)),o},e.prototype.getTile=function(e,i,o,n){var r=n.pixelRatio,a=n.viewState,s=a.resolution,l=a.projection,u=this.getLayer(),p=u.getSource().getTile(e,i,o,r,l),h=n.viewHints,d=!(h[zr]||h[Er]);return!d&&p.wantedResolution||(p.wantedResolution=s),this.prepareTile(p,r,l)&&(d||Date.now()-n.time<8)&&u.getRenderMode()!==Ed&&this.renderTileImage_(p,n),t.prototype.getTile.call(this,e,i,o,n)},e.prototype.isDrawableTile=function(e){var i=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(i.getRenderMode()===Ed?te(i)in e.executorGroups:e.hasContext(i))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var i=this.getLayer().getRevision();return this.renderedLayerRevision_!=i&&(this.renderedTiles.length=0),this.renderedLayerRevision_=i,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,i){var o=this.getLayer(),n=o.getRevision(),r=o.getRenderOrder()||null,a=t.wantedResolution,s=t.getReplayState(o);if(s.dirty||s.renderedResolution!==a||s.renderedRevision!=n||s.renderedRenderOrder!=r){var l=o.getSource(),u=o.getDeclutter(),p=l.getTileGrid(),h=l.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),d=l.getSourceTiles(e,i,t),c=te(o);delete t.hitDetectionImageData[c],t.executorGroups[c]=[],u&&(t.declutterExecutorGroups[c]=[]);for(var g=function(i,n){var g=d[i];if(g.getState()!=xr)return"continue";var m=g.tileCoord,v=p.getTileCoordExtent(m),y=So(h,v),_=Ji(y,o.getRenderBuffer()*a,f.tmpExtent),b=po(v,y)?null:_;s.dirty=!1;var x=new Fu(0,_,a,e),k=u?new Fu(0,y,a,e):void 0,w=lp(a,e),S=function(t){var e,i=t.getStyleFunction()||o.getStyleFunction();if(i&&(e=i(t,a)),e){var n=this.renderFeature(t,w,e,x,k);this.dirty_=this.dirty_||n,s.dirty=s.dirty||n}},C=g.getFeatures();r&&r!==s.renderedRenderOrder&&C.sort(r);for(var z=0,E=C.length;z<E;++z){var T=C[z];b&&!To(b,T.getGeometry().getExtent())||S.call(f,T)}var P=x.finish(),O=o.getRenderMode()!==Ed&&u&&1===d.length?null:y,F=new ep(O,a,e,l.getOverlaps(),P,o.getRenderBuffer());if(t.executorGroups[c].push(F),k){var R=new ep(null,a,e,l.getOverlaps(),k.finish(),o.getRenderBuffer());t.declutterExecutorGroups[c].push(R)}},f=this,m=0,v=d.length;m<v;++m)g(m);s.renderedRevision=n,s.renderedRenderOrder=r,s.renderedResolution=a}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=e.viewState.resolution,a=e.viewState.rotation;i=null==i?0:i;var s=this.getLayer(),l=s.getSource().getTileGridForProjection(e.viewState.projection),u=$i([t]);Ji(u,r*i,u);for(var p,h={},d=function(t,e,i){var r=t.getId();void 0===r&&(r=te(t));var a=h[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return h[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,s,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return h[r]=!0,o(t,s,e);n.push(h[r]={feature:t,layer:s,geometry:e,distanceSq:i,callback:o})}},c=this.renderedTiles,g=function(o,n){var h=c[o];if(!To(l.getTileCoordExtent(h.wrappedTileCoord),u))return"continue";var g=te(s),f=[h.executorGroups[g]],m=h.declutterExecutorGroups[g];m&&f.push(m),f.some((function(o){for(var n=o===m?e.declutterTree.all().map((function(t){return t.value})):null,s=0,l=o.length;s<l;++s){var u=o[s];if(p=u.forEachFeatureAtCoordinate(t,r,a,i,d,n))return!0}}))},f=0,m=c.length;!p&&f<m;++f)g(f);return p},e.prototype.getFeatures=function(t){return new Promise(function(e,i){for(var o,n=this.getLayer(),r=te(n),a=n.getSource(),s=this.renderedProjection,l=s.getExtent(),u=this.renderedResolution,p=a.getTileGridForProjection(s),h=xn(this.renderedPixelToCoordinateTransform_,t.slice()),d=p.getTileCoordForCoordAndResolution(h,u),c=0,g=this.renderedTiles.length;c<g;++c)if(d.toString()===this.renderedTiles[c].tileCoord.toString()){if((o=this.renderedTiles[c]).getState()===xr){var f=p.getTileCoordExtent(o.tileCoord);a.getWrapX()&&s.canWrapX()&&!io(l,f)&&Zo(h,s);break}o=void 0}if(!o||o.loadingSourceTiles>0)e([]);else{var m=Co(p.getTileCoordExtent(o.wrappedTileCoord)),v=[(h[0]-m[0])/u,(m[1]-h[1])/u],y=o.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),_=o.hitDetectionImageData[r];if(!_&&!this.animatingOrInteracting_){var b=Va(p.getTileSize(p.getZForResolution(u))),x=this.renderedRotation_;_=np(b,[this.getRenderTransform(p.getTileCoordCenter(o.wrappedTileCoord),u,0,.5,.5*b[0],.5*b[1],0)],y,n.getStyleFunction(),p.getTileCoordExtent(o.wrappedTileCoord),o.getReplayState(n).renderedResolution,x),o.hitDetectionImageData[r]=_}e(rp(v,y,_))}}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var e=this.context,i=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var o=t.viewHints,n=!(o[zr]||o[Er]),r=this.renderedTiles,a=0,s=r.length;a<s;++a){var l=r[a],u=l.declutterExecutorGroups[te(this.getLayer())];if(u)for(var p=u.length-1;p>=0;--p)u[p].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,n,void 0,t.declutterTree)}e.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,e){var i=e.pixelRatio,o=e.viewState,n=o.center,r=o.resolution,a=o.rotation,s=e.size,l=Math.round(s[0]*i),u=Math.round(s[1]*i),p=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),h=t.tileCoord,d=p.getTileCoordExtent(t.wrappedTileCoord),c=p.getTileCoordExtent(h,this.tmpExtent)[0]-d[0];return _n(kn(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(n,r,a,i,l,u,c))},e.prototype.renderFrame=function(e,i){var o=e.viewHints,n=!(o[zr]||o[Er]);t.prototype.renderFrame.call(this,e,i),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var r=this.getLayer(),a=r.getRenderMode(),s=this.context,l=s.globalAlpha;s.globalAlpha=r.getOpacity();for(var u=Od[a],p=e.viewState.rotation,h=this.renderedTiles,d=[],c=[],g=h.length-1;g>=0;--g)for(var f=h[g],m=this.getTileRenderTransform(f,e),v=f.executorGroups[te(r)],y=!1,_=0,b=v.length;_<b;++_){var x=v[_];if(x.hasExecutors(u)){var k=f.tileCoord[0],w=void 0;if(!y&&(w=x.getClipCoords(m))){s.save();for(var S=0,C=d.length;S<C;++S){var z=d[S];k<c[S]&&(s.beginPath(),s.moveTo(w[0],w[1]),s.lineTo(w[2],w[3]),s.lineTo(w[4],w[5]),s.lineTo(w[6],w[7]),s.moveTo(z[6],z[7]),s.lineTo(z[4],z[5]),s.lineTo(z[2],z[3]),s.lineTo(z[0],z[1]),s.clip())}}x.execute(s,1,m,p,n,u),!y&&w&&(s.restore(),d.push(w),c.push(k),y=!0)}}return s.globalAlpha=l,this.container},e.prototype.renderFeature=function(t,e,i,o,n){if(!i)return!1;var r=!1;if(Array.isArray(i))for(var a=0,s=i.length;a<s;++a)r=pp(o,t,i[a],e,this.boundHandleStyleImageChange_,void 0,n)||r;else r=pp(o,t,i,e,this.boundHandleStyleImageChange_,void 0,n);return r},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===Ed)return!1;var i=t.getReplayState(e),o=e.getRevision(),n=t.wantedResolution;return i.renderedTileResolution!==n||i.renderedTileRevision!==o},e.prototype.renderTileImage_=function(t,e){var i=this.getLayer(),o=t.getReplayState(i),n=i.getRevision(),r=t.executorGroups[te(i)];o.renderedTileRevision=n;var a=t.wrappedTileCoord,s=a[0],l=i.getSource(),u=e.pixelRatio,p=e.viewState.projection,h=l.getTileGridForProjection(p),d=h.getResolution(t.tileCoord[0]),c=e.pixelRatio/t.wantedResolution*d,g=h.getResolution(s),f=t.getContext(i);u=Math.round(Math.max(u,c/u));var m=l.getTilePixelSize(s,u,p);f.canvas.width=m[0],f.canvas.height=m[1];var v=u/c;if(1!==v){var y=yn(this.tmpTransform_);kn(y,v,v),f.setTransform.apply(f,y)}var _=h.getTileCoordExtent(a,this.tmpExtent),b=c/g,x=yn(this.tmpTransform_);kn(x,b,-b),function(t,e,i){_n(t,bn(vn,1,0,0,1,e,i))}(x,-_[0],-_[3]);for(var k=0,w=r.length;k<w;++k){r[k].execute(f,v,x,0,!0,Pd[i.getRenderMode()])}o.renderedTileResolution=t.wantedResolution},e}(Sd),Rd="preload",Id="useInterimTilesOnError",Md=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),jd=function(t){function e(e){var i=this,o=e||{},n=Tt({},o);delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,o.renderMode===Cd&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),o.renderMode=void 0);var r=o.renderMode||zd;return je(r==zd||r==Ed,28),i.renderMode_=r,i.setPreload(o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return Md(e,t),e.prototype.createRenderer=function(){return new Fd(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(Rd)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Id)},e.prototype.setPreload=function(t){this.set(Rd,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Id,t)},e}(hu),Dd="tileloadstart",Ad="tileloadend",Ld="tileloaderror",Gd=[0,0,0],Nd=function(){function t(t){var e,i,o,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,je((e=this.resolutions_,i=!0,o=function(t,e){return e-t}||bt,e.every((function(t,n){if(0===n)return!0;var r=o(e[n-1],t);return!(r>0||i&&0===r)}))),17),!t.origins)for(var r=0,a=this.resolutions_.length-1;r<a;++r)if(n){if(this.resolutions_[r]/this.resolutions_[r+1]!==n){n=void 0;break}}else n=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=n,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,je(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=Co(s)),je(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,je(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,je(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==s?s:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var i=new md(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(s){var o=this.getTileRangeForExtentAndZ(s,e);i.minX=Math.max(o.minX,i.minX),i.maxX=Math.min(o.maxX,i.maxX),i.minY=Math.max(o.minY,i.minY),i.maxY=Math.min(o.maxY,i.maxY)}return i}),this):s&&this.calculateTileRanges_(s)}return t.prototype.forEachTileCoord=function(t,e,i){for(var o=this.getTileRangeForExtentAndZ(t,e),n=o.minX,r=o.maxX;n<=r;++n)for(var a=o.minY,s=o.maxY;a<=s;++a)i([e,n,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,i,o){var n,r,a=null,s=t[0]-1;for(2===this.zoomFactor_?(n=t[1],r=t[2]):a=this.getTileCoordExtent(t,o);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?fd(n=Math.floor(n/2),n,r=Math.floor(r/2),r,i):this.getTileRangeForExtentAndZ(a,s,i)))return!0;--s}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var o=2*t[1],n=2*t[2];return fd(o,o+1,n,n+1,e)}var r=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;var o=t[0],n=t[1],r=t[2];if(e===o)return fd(n,r,n,r,i);if(this.zoomFactor_){var a=Math.pow(this.zoomFactor_,e-o),s=Math.floor(n*a),l=Math.floor(r*a);return e<o?fd(s,s,l,l,i):fd(s,Math.floor(a*(n+1))-1,l,Math.floor(a*(r+1))-1,i)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,i)},t.prototype.getTileRangeExtent=function(t,e,i){var o=this.getOrigin(t),n=this.getResolution(t),r=Va(this.getTileSize(t),this.tmpSize_),a=o[0]+e.minX*r[0]*n,s=o[0]+(e.maxX+1)*r[0]*n;return ao(a,o[1]+e.minY*r[1]*n,s,o[1]+(e.maxY+1)*r[1]*n,i)},t.prototype.getTileRangeForExtentAndZ=function(t,e,i){var o=Gd;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,o);var n=o[1],r=o[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,o),fd(n,o[1],r,o[2],i)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),o=Va(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*o[0]*i,e[1]-(t[2]+.5)*o[1]*i]},t.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),o=this.getResolution(t[0]),n=Va(this.getTileSize(t[0]),this.tmpSize_),r=i[0]+t[1]*n[0]*o,a=i[1]-(t[2]+1)*n[1]*o;return ao(r,a,r+n[0]*o,a+n[1]*o,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,i,o,n){var r=this.getZForResolution(i),a=i/this.getResolution(r),s=this.getOrigin(r),l=Va(this.getTileSize(r),this.tmpSize_),u=o?.5:0,p=o?.5:0,h=Math.floor((t-s[0])/i+u),d=Math.floor((s[1]-e)/i+p),c=a*h/l[0],g=a*d/l[1];return o?(c=Math.ceil(c)-1,g=Math.ceil(g)-1):(c=Math.floor(c),g=Math.floor(g)),ld(r,c,g,n)},t.prototype.getTileCoordForXYAndZ_=function(t,e,i,o,n){var r=this.getOrigin(i),a=this.getResolution(i),s=Va(this.getTileSize(i),this.tmpSize_),l=o?.5:0,u=o?.5:0,p=Math.floor((t-r[0])/a+l),h=Math.floor((r[1]-e)/a+u),d=p/s[0],c=h/s[1];return o?(d=Math.ceil(d)-1,c=Math.ceil(c)-1):(d=Math.floor(d),c=Math.floor(c)),ld(i,d,c,n)},t.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return De(xt(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),o=this.minZoom;o<e;++o)i[o]=this.getTileRangeForExtentAndZ(t,o);this.fullTileRanges_=i},t}();function Bd(t){var e=t.getDefaultTileGrid();return e||(e=Wd(t),t.setDefaultTileGrid(e)),e}function Vd(t){var e=t||{},i=e.extent||Qo("EPSG:3857").getExtent(),o={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:qd(i,e.maxZoom,e.tileSize,e.maxResolution)};return new Nd(o)}function qd(t,e,i,o){for(var n=void 0!==e?e:42,r=wo(t),a=Eo(t),s=Va(void 0!==i?i:256),l=o>0?o:Math.max(a/s[0],r/s[1]),u=n+1,p=new Array(u),h=0;h<u;++h)p[h]=l/Math.pow(2,h);return p}function Wd(t,e,i,o){return function(t,e,i,o){var n=void 0!==o?o:qi,r=qd(t,e,i);return new Nd({extent:t,origin:xo(t,n),resolutions:r,tileSize:i})}(Ud(t),e,i,o)}function Ud(t){var e=(t=Qo(t)).getExtent();if(!e){var i=180*xi[ki.DEGREES]/t.getMetersPerUnit();e=ao(-i,-i,i,i)}return e}var Xd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Kd=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;i.on,i.once,i.un,i.opaque_=void 0!==e.opaque&&e.opaque,i.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,i.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var o=e.tileGrid;return o&&Va(o.getTileSize(o.getMinZoom()),[256,256]),i.tileCache=new cd(e.cacheSize||0),i.tmpSize=[0,0],i.key_=e.key||"",i.tileOptions={transition:e.transition},i.zDirection=e.zDirection?e.zDirection:0,i}return Xd(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,i,o){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var r,a,s,l=!0,u=i.minX;u<=i.maxX;++u)for(var p=i.minY;p<=i.maxY;++p)a=ud(e,u,p),s=!1,n.containsKey(a)&&(s=(r=n.get(a)).getState()===xr)&&(s=!1!==o(r)),s||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,i,o,n){return Jt()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Bd(t)},e.prototype.getTileCacheForProjection=function(t){return je(rn(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var o,n,r,a=this.getTileGridForProjection(i),s=this.getTilePixelRatio(e),l=Va(a.getTileSize(t),this.tmpSize);return 1==s?l:(o=l,n=s,void 0===(r=this.tmpSize)&&(r=[0,0]),r[0]=o[0]*n+.5|0,r[1]=o[1]*n+.5|0,r)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),o=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var o=e[0],n=t.getTileCoordCenter(e),r=Ud(i);if(eo(r,n))return e;var a=Eo(r),s=Math.ceil((r[0]-n[0])/a);return n[0]+=a*s,t.getTileCoordForCoordAndZ(n,o)}(o,t,i)),function(t,e){var i=t[0],o=t[1],n=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var r=e.getFullTileRange(i);return!r||r.containsXY(o,n)}(t,o)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,o){},e}(_p),Yd=function(t){function e(e,i){var o=t.call(this,e)||this;return o.tile=i,o}return Xd(e,t),e}(vt),Zd=Kd;function Hd(t,e){var i=/\{z\}/g,o=/\{x\}/g,n=/\{y\}/g,r=/\{-y\}/g;return function(a,s,l){return a?t.replace(i,a[0].toString()).replace(o,a[1].toString()).replace(n,a[2].toString()).replace(r,(function(){var t=a[0],i=e.getFullTileRange(t);return je(i,55),(i.getHeight()-a[2]-1).toString()})):void 0}}function $d(t,e){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=Hd(t[n],e);return function(t){if(1===t.length)return t[0];return function(e,i,o){if(e){var n=Ve(function(t){return(t[1]<<t[0])+t[2]}(e),t.length);return t[n](e,i,o)}}}(o)}var Jd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Qd=function(t){function e(i){var o=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return o.generateTileUrlFunction_=o.tileUrlFunction===e.prototype.tileUrlFunction,o.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(o.tileUrlFunction=i.tileUrlFunction),o.urls=null,i.urls?o.setUrls(i.urls):i.url&&o.setUrl(i.url),o.tileLoadingKeys_={},o}return Jd(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,o=te(i),n=i.getState();n==br?(this.tileLoadingKeys_[o]=!0,e=Dd):o in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[o],e=n==kr?Ld:n==xr?Ad:void 0),null!=e&&this.dispatchEvent(new Yd(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var o=i[1].charCodeAt(0),n=i[2].charCodeAt(0),r=void 0;for(r=o;r<=n;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(i[2],10),s=parseInt(i[1],10);s<=a;s++)e.push(t.replace(i[0],s.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction($d(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,i){},e.prototype.useTile=function(t,e,i){var o=ud(t,e,i);this.tileCache.containsKey(o)&&this.tileCache.get(o)},e}(Zd),tc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ec=function(t){function e(e){var i=this,o=e.projection||"EPSG:3857",n=e.extent||Ud(o),r=e.tileGrid||Vd({extent:n,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:o,state:e.state,tileGrid:r,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:ic,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,i.sourceTileCache=new cd(i.tileCache.highWaterMark),i.overlaps_=null==e.overlaps||e.overlaps,i.tileClass=e.tileClass?e.tileClass:xd,i.tileGrids_={},i}return tc(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],i=this.tileCache;if(0===i.getCount())return e;var o=hd(i.peekFirstKey())[0],n=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===o&&i.getState()===xr)for(var r=i.getSourceTiles(),a=0,s=r.length;a<s;++a){var l=r[a],u=l.tileCoord;if(To(t,n.getTileCoordExtent(u))){var p=l.getFeatures();if(p)for(var h=0,d=p.length;h<d;++h){var c=p[h],g=c.getGeometry();To(t,g.getExtent())&&e.push(c)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,i){var o=this.getTileCacheForProjection(e),n=Object.keys(i).reduce((function(t,e){var i,n,r=ud((n=(i=e).substring(i.lastIndexOf("/")+1,i.length).split(",").map(Number))[0],n[1],n[2]);if(o.containsKey(r))for(var a=o.get(r).sourceTiles,s=0,l=a.length;s<l;++s)t[a[s].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,i),this.sourceTileCache.expireCache(n)},e.prototype.getSourceTiles=function(t,e,i){var o=this;if(i.getState()===_r){i.setState(br);var n=i.wrappedTileCoord,r=this.getTileGridForProjection(e),a=r.getTileCoordExtent(n),s=n[0],l=r.getResolution(s);Ji(a,-l,a);var u=this.tileGrid,p=u.getExtent();p&&So(a,p,a);var h=u.getZForResolution(l,1);u.forEachTileCoord(a,h,(function(n){var r=o.tileUrlFunction(n,t,e),a=o.sourceTileCache.containsKey(r)?o.sourceTileCache.get(r):new o.tileClass(n,r?_r:wr,r,o.format_,o.tileLoadFunction);i.sourceTiles.push(a);var s=a.getState();if(s<xr){var l=function(t){o.handleTileChange(t);var e=a.getState();if(e===xr||e===kr){var n=a.getKey();n in i.errorTileKeys?a.getState()===xr&&delete i.errorTileKeys[n]:i.loadingSourceTiles--,e===kr?i.errorTileKeys[n]=!0:a.removeEventListener(jt,l),0===i.loadingSourceTiles&&i.setState(Ft(i.errorTileKeys)?xr:kr)}};a.addEventListener(jt,l),i.loadingSourceTiles++}s===_r&&(a.extent=u.getTileCoordExtent(n),a.projection=e,a.resolution=u.getResolution(n[0]),o.sourceTileCache.set(r,a),a.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((function(t){return t.getState()===kr}))?kr:xr)}return i.sourceTiles},e.prototype.getTile=function(t,e,i,o,n){var r,a=ud(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)&&(r=this.tileCache.get(a)).key===s)return r;var l=[t,e,i],u=this.getTileCoordForTileUrlFunction(l,n),p=this.getTileGrid().getExtent(),h=this.getTileGridForProjection(n);if(u&&p){var d=h.getTileCoordExtent(u);Ji(d,-h.getResolution(t),d),To(p,d)||(u=null)}var c=!0;if(null!==u){var g=this.tileGrid,f=h.getResolution(t),m=g.getZForResolution(f,1),v=h.getTileCoordExtent(u);Ji(v,-f,v),g.forEachTileCoord(v,m,function(t){c=c&&!this.tileUrlFunction(t,o,n)}.bind(this))}var y=new _d(l,c?wr:_r,u,this.getSourceTiles.bind(this,o,n));return y.key=s,r?(y.interimTile=r,y.refreshInterimChain(),this.tileCache.replace(a,y)):this.tileCache.set(a,y),y},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),i=this.tileGrids_[e];if(!i){var o=this.tileGrid;i=Wd(t,void 0,o?o.getTileSize(o.getMinZoom()):void 0),this.tileGrids_[e]=i}return i},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,i){var o=Va(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(o[0]*e),Math.round(o[1]*e)]},e.prototype.updateCacheSize=function(e,i){t.prototype.updateCacheSize.call(this,2*e,i),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(i).highWaterMark},e}(Qd);function ic(t,e){t.setLoader((function(i,o,n){Tp(e,t.getFormat(),i,o,n,t.onLoad.bind(t),t.onError.bind(t))}))}var oc,nc=function(){function t(t,e,i,o,n,r){this.sourceProj_=t,this.targetProj_=e;var a={},s=sn(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return a[e]||(a[e]=s(t)),a[e]},this.maxSourceExtent_=o,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!o&&!!this.sourceProj_.getExtent()&&Eo(o)==Eo(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Eo(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Eo(this.targetProj_.getExtent()):null;var l=Co(i),u=zo(i),p=_o(i),h=yo(i),d=this.transformInv_(l),c=this.transformInv_(u),g=this.transformInv_(p),f=this.transformInv_(h),m=10+(r?Math.max(0,Math.ceil(Le(vo(i)/(r*r*256*256)))):0);if(this.addQuad_(l,u,p,h,d,c,g,f,m),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach((function(t,e,i){v=Math.min(v,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])-v>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]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,e,i,o,n,r){this.triangles_.push({source:[o,n,r],target:[t,e,i]})},t.prototype.addQuad_=function(t,e,i,o,n,r,a,s,l){var u=$i([n,r,a,s]),p=this.sourceWorldWidth_?Eo(u)/this.sourceWorldWidth_:null,h=this.sourceWorldWidth_,d=this.sourceProj_.canWrapX()&&p>.5&&p<1,c=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)c=Eo($i([t,e,i,o]))/this.targetWorldWidth_>.25||c;!d&&this.sourceProj_.isGlobal()&&p&&(c=p>.25||c)}if(!(!c&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||To(u,this.maxSourceExtent_)){var g=0;if(!(c||isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])))if(l>0)c=!0;else if(1!=(g=(isFinite(n[0])&&isFinite(n[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(a[0])&&isFinite(a[1])?0:2)+(isFinite(s[0])&&isFinite(s[1])?0:1))&&2!=g&&4!=g&&8!=g)return;if(l>0){if(!c){var f=[(t[0]+i[0])/2,(t[1]+i[1])/2],m=this.transformInv_(f),v=void 0;if(d)v=(Ve(n[0],h)+Ve(a[0],h))/2-Ve(m[0],h);else v=(n[0]+a[0])/2-m[0];var y=(n[1]+a[1])/2-m[1];c=v*v+y*y>this.errorThresholdSquared_}if(c){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var _=[(e[0]+i[0])/2,(e[1]+i[1])/2],b=this.transformInv_(_),x=[(o[0]+t[0])/2,(o[1]+t[1])/2],k=this.transformInv_(x);this.addQuad_(t,e,_,x,n,r,b,k,l-1),this.addQuad_(x,_,i,o,k,b,a,s,l-1)}else{var w=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(w),C=[(i[0]+o[0])/2,(i[1]+o[1])/2],z=this.transformInv_(C);this.addQuad_(t,w,C,o,n,S,z,s,l-1),this.addQuad_(w,e,i,C,S,r,a,z,l-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&g)&&this.addTriangle_(t,i,o,n,a,s),0==(14&g)&&this.addTriangle_(t,i,e,n,a,r),g&&(0==(13&g)&&this.addTriangle_(e,o,t,r,s,n),0==(7&g)&&this.addTriangle_(e,o,i,r,s,a))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,o){var n=e.source;co(t,n[0]),co(t,n[1]),co(t,n[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),rc={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function ac(t,e,i,o,n){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(o,n),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,o)+1,Math.max(i,n)),t.restore()}function sc(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function lc(t,e,i,o){var n=ln(i,e,t),r=tn(e,o,i),a=e.getMetersPerUnit();void 0!==a&&(r*=a);var s=t.getMetersPerUnit();void 0!==s&&(r/=s);var l=t.getExtent();if(!l||eo(l,n)){var u=tn(t,r,n)/r;isFinite(u)&&u>0&&(r/=u)}return r}function uc(t,e,i,o,n,r,a,s,l,u,p,h){var d=fe(Math.round(i*t),Math.round(i*e));if(Tt(d,h),0===l.length)return d.canvas;function c(t){return Math.round(t*i)/i}d.scale(i,i),d.globalCompositeOperation="lighter";var g=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){ho(g,t.extent)}));var f=Eo(g),m=wo(g),v=fe(Math.round(i*f/o),Math.round(i*m/o));Tt(v,h);var y=i/o;l.forEach((function(t,e,i){var o=t.extent[0]-g[0],n=-(t.extent[3]-g[3]),r=Eo(t.extent),a=wo(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,o*y,n*y,r*y,a*y)}));var _=Co(a);return s.getTriangles().forEach((function(t,e,n){var a=t.source,s=t.target,l=a[0][0],u=a[0][1],p=a[1][0],f=a[1][1],m=a[2][0],y=a[2][1],b=c((s[0][0]-_[0])/r),x=c(-(s[0][1]-_[1])/r),k=c((s[1][0]-_[0])/r),w=c(-(s[1][1]-_[1])/r),S=c((s[2][0]-_[0])/r),C=c(-(s[2][1]-_[1])/r),z=l,E=u;l=0,u=0;var T=function(t){for(var e=t.length,i=0;i<e;i++){for(var o=i,n=Math.abs(t[i][i]),r=i+1;r<e;r++){var a=Math.abs(t[r][i]);a>n&&(n=a,o=r)}if(0===n)return null;var s=t[o];t[o]=t[i],t[i]=s;for(var l=i+1;l<e;l++)for(var u=-t[l][i]/t[i][i],p=i;p<e+1;p++)i==p?t[l][p]=0:t[l][p]+=u*t[i][p]}for(var h=new Array(e),d=e-1;d>=0;d--){h[d]=t[d][e]/t[d][d];for(var c=d-1;c>=0;c--)t[c][e]-=t[c][d]*h[d]}return h}([[p-=z,f-=E,0,0,k-b],[m-=z,y-=E,0,0,S-b],[0,0,p,f,w-x],[0,0,m,y,C-x]]);if(T){if(d.save(),d.beginPath(),function(){if(void 0===oc){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",ac(t,4,5,4,0),ac(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;oc=sc(e,0)||sc(e,4)||sc(e,8)}return oc}()||h===rc){d.moveTo(k,w);for(var P=b-k,O=x-w,F=0;F<4;F++)d.lineTo(k+c((F+1)*P/4),w+c(F*O/3)),3!=F&&d.lineTo(k+c((F+1)*P/4),w+c((F+1)*O/3));d.lineTo(S,C)}else d.moveTo(k,w),d.lineTo(b,x),d.lineTo(S,C);d.clip(),d.transform(T[0],T[2],T[1],T[3],b,x),d.translate(g[0]-z,g[3]-E),d.scale(o/i,-o/i),d.drawImage(v.canvas,0,0),d.restore()}})),p&&(d.save(),d.globalCompositeOperation="source-over",d.strokeStyle="black",d.lineWidth=1,s.getTriangles().forEach((function(t,e,i){var o=t.target,n=(o[0][0]-_[0])/r,a=-(o[0][1]-_[1])/r,s=(o[1][0]-_[0])/r,l=-(o[1][1]-_[1])/r,u=(o[2][0]-_[0])/r,p=-(o[2][1]-_[1])/r;d.beginPath(),d.moveTo(s,l),d.lineTo(n,a),d.lineTo(u,p),d.closePath(),d.stroke()})),d.restore()),d.canvas}var pc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hc=function(t){function e(e,i,o,n,r,a,s,l,u,p,h,d){var c=t.call(this,r,_r)||this;c.renderEdges_=void 0!==h&&h,c.contextOptions_=d,c.pixelRatio_=s,c.gutter_=l,c.canvas_=null,c.sourceTileGrid_=i,c.targetTileGrid_=n,c.wrappedTileCoord_=a||r,c.sourceTiles_=[],c.sourcesListenerKeys_=null,c.sourceZ_=0;var g=n.getTileCoordExtent(c.wrappedTileCoord_),f=c.targetTileGrid_.getExtent(),m=c.sourceTileGrid_.getExtent(),v=f?So(g,f):g;if(0===vo(v))return c.state=wr,c;var y=e.getExtent();y&&(m=m?So(m,y):y);var _=n.getResolution(c.wrappedTileCoord_[0]),b=function(t,e,i,o){var n=bo(i),r=lc(t,e,n,o);return(!isFinite(r)||r<=0)&&mo(i,(function(i){return r=lc(t,e,i,o),isFinite(r)&&r>0})),r}(e,o,v,_);if(!isFinite(b)||b<=0)return c.state=wr,c;var x=void 0!==p?p:.5;if(c.triangulation_=new nc(e,o,v,m,b*x,_),0===c.triangulation_.getTriangles().length)return c.state=wr,c;c.sourceZ_=i.getZForResolution(b);var k=c.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(k[1]=De(k[1],m[1],m[3]),k[3]=De(k[3],m[1],m[3])):k=So(k,m)),vo(k)){for(var w=i.getTileRangeForExtentAndZ(k,c.sourceZ_),S=w.minX;S<=w.maxX;S++)for(var C=w.minY;C<=w.maxY;C++){var z=u(c.sourceZ_,S,C,s);z&&c.sourceTiles_.push(z)}0===c.sourceTiles_.length&&(c.state=wr)}else c.state=wr;return c}return pc(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,o){e&&e.getState()==xr&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=kr;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),o="number"==typeof i?i:i[0],n="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=uc(o,n,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),r,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=xr}this.changed()},e.prototype.load=function(){if(this.state==_r){this.state=br,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,o){var n=e.getState();if(n==_r||n==br){t++;var r=Xt(e,jt,(function(i){var o=e.getState();o!=xr&&o!=kr&&o!=wr||(Yt(r),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,i){t.getState()==_r&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Yt),this.sourcesListenerKeys_=null},e}(Mp),dc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function cc(t,e){t.getImage().src=e}var gc=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:cc,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 i.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,i.tileClass=void 0!==e.tileClass?e.tileClass:Dp,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?rc:void 0,i.renderReprojectionEdges_=!1,i}return dc(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var o in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[o];n.expireCache(n==i?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!rn(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&&!rn(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!rn(e,t)){var i=te(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Bd(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||rn(e,t))return this.tileCache;var i=te(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new cd(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,o,n,r){var a=[t,e,i],s=this.getTileCoordForTileUrlFunction(a,n),l=s?this.tileUrlFunction(s,o,n):void 0,u=new this.tileClass(a,void 0!==l?_r:wr,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=r,u.addEventListener(jt,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,i,o,n){var r=this.getProjection();if(r&&n&&!rn(r,n)){var a=this.getTileCacheForProjection(n),s=[t,e,i],l=void 0,u=pd(s);a.containsKey(u)&&(l=a.get(u));var p=this.getKey();if(l&&l.key==p)return l;var h=this.getTileGridForProjection(r),d=this.getTileGridForProjection(n),c=this.getTileCoordForTileUrlFunction(s,n),g=new hc(r,h,n,d,s,c,this.getTilePixelRatio(o),this.getGutter(),function(t,e,i,o){return this.getTileInternal(t,e,i,o,r)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return g.key=p,l?(g.interimTile=l,g.refreshInterimChain(),a.replace(u,g)):a.set(u,g),g}return this.getTileInternal(t,e,i,o,r||n)},e.prototype.getTileInternal=function(t,e,i,o,n){var r=null,a=ud(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)){if((r=this.tileCache.get(a)).key!=s){var l=r;r=this.createTile_(t,e,i,o,n,s),l.getState()==_r?r.interimTile=l.interimTile:r.interimTile=l,r.refreshInterimChain(),this.tileCache.replace(a,r)}}else r=this.createTile_(t,e,i,o,n,s),this.tileCache.set(a,r);return r},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=Qo(t);if(i){var o=te(i);o in this.tileGridForProjection||(this.tileGridForProjection[o]=e)}},e}(Qd),fc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),mc=function(t){function e(e){var i=this,o=e||{},n=Tt({},o);return delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,i.setPreload(void 0!==o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return fc(e,t),e.prototype.getPreload=function(){return this.get(Rd)},e.prototype.setPreload=function(t){this.set(Rd,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Id)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Id,t)},e}(ei),vc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yc=function(t){function e(e){return t.call(this,e)||this}return vc(e,t),e.prototype.createRenderer=function(){return new Sd(this)},e}(mc),_c=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),bc=function(t){function e(e){var i=e||{},o=void 0!==i.projection?i.projection:"EPSG:3857",n=void 0!==i.tileGrid?i.tileGrid:Vd({extent:Ud(o),maxResolution:i.maxResolution,maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});return t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,opaque:i.opaque,projection:o,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this}return _c(e,t),e}(gc),xc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),kc='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',wc=function(t){function e(e){var i,o=e||{};i=void 0!==o.attributions?o.attributions:[kc];var n=void 0!==o.crossOrigin?o.crossOrigin:"anonymous",r=void 0!==o.url?o.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:o.cacheSize,crossOrigin:n,imageSmoothing:o.imageSmoothing,maxZoom:void 0!==o.maxZoom?o.maxZoom:19,opaque:void 0===o.opaque||o.opaque,reprojectionErrorThreshold:o.reprojectionErrorThreshold,tileLoadFunction:o.tileLoadFunction,transition:o.transition,url:r,wrapX:o.wrapX,zDirection:o.zDirection})||this}return xc(e,t),e}(bc);const Sc=Array.isArray;function Cc(t,e){if(1===arguments.length)return e=>Cc(t,e);if(t<1)throw new Error("First argument to splitEvery must be a positive integer");const i=[];let o=0;for(;o<e.length;)i.push(e.slice(o,o+=t));return i}(function t(e,i=[]){return(...o)=>{return(n=[...i,...o]).length>=e.length?e(...n):t(e,n);var n}})((function(t,e,i){if(!Sc(i))throw new TypeError("reduce: list must be array or iterable");let o=0;const n=i.length;for(;o<n;)e=t(e,i[o],o,i),o++;return e}))((function t(e,i){return 1===arguments.length?i=>t(e,i):e*i}),1);const zc=new Rp({features:[],wrapX:!1}),Ec=new fp({source:zc,style:new hl({image:new rl({radius:3,fill:new Is({color:"grey"})})})});function Tc(t,e){var i,o,n;const r=t&&(null==(n=null==(o=null==(i=t.getSource())?void 0:i.getFeaturesInExtent(e))?void 0:o.filter((t=>{var e;return"Point"!==(null==(e=t.getGeometry())?void 0:e.getType())})))?void 0:n.flatMap((t=>t.flatCoordinates_)));if(r)return Cc(2,r).forEach(((t,e)=>{zc.addFeature(new _s({geometry:new va(t),i:e}))}))}const Pc={color:"#ff0000",width:3},Oc=new tl(Pc),Fc=new tl(l(s({},Pc),{lineDash:[2,8]})),Rc=new Is({color:"rgba(255, 0, 0, 0.1)"}),Ic=new ol({stroke:new tl({color:"red",width:2}),points:4,radius1:15,radius2:1}),Mc=new rl({radius:6,fill:new Is({color:"#ff0000"})}),jc=new hl({image:new ol({fill:new Is({color:"#fff"}),stroke:new tl({color:"#ff0000",width:2}),points:4,radius:5,angle:Math.PI/4}),geometry:function(t){const e=t.getGeometry();if(e instanceof Ia){const t=e.getCoordinates()[0];return new gs(t)}}}),Dc=new Rp,Ac=new fp({source:Dc,style:[new hl({fill:Rc,stroke:Oc}),jc]});const Lc=new od({source:zc,pixelTolerance:15});
36
36
  /**
37
37
  * splaytree v3.1.0
38
38
  * Fast Splay tree for Node and browser
@@ -41,7 +41,7 @@ read:function(t,e,i,o,n){var r,a,s=8*n-o-1,l=(1<<s)-1,u=l>>1,p=-7,h=i?n-1:0,d=i?
41
41
  * @license MIT
42
42
  * @preserve
43
43
  */
44
- var Gc=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function Nc(t,e){return t>e?1:t<e?-1:0}function Bc(t,e,i){for(var o=new Gc(null,null),n=o,r=o;;){var a=i(t,e.key);if(a<0){if(null===e.left)break;if(i(t,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,null===(e=s).left)break}r.left=e,r=e,e=e.left}else{if(!(a>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){s=e.right;if(e.right=s.left,s.left=e,null===(e=s).right)break}n.right=e,n=e,e=e.right}}return n.right=e.left,r.left=e.right,e.left=o.right,e.right=o.left,e}function Vc(t,e,i,o){var n=new Gc(t,e);if(null===i)return n.left=n.right=null,n;var r=o(t,(i=Bc(t,i,o)).key);return r<0?(n.left=i.left,n.right=i,i.left=null):r>=0&&(n.right=i.right,n.left=i,i.right=null),n}function qc(t,e,i){var o=null,n=null;if(e){var r=i((e=Bc(t,e,i)).key,t);0===r?(o=e.left,n=e.right):r<0?(n=e.right,e.right=null,o=e):(o=e.left,e.left=null,n=e)}return{left:o,right:n}}function Wc(t,e,i,o,n){if(t){o(e+(i?"└── ":"├── ")+n(t)+"\n");var r=e+(i?" ":"│ ");t.left&&Wc(t.left,r,!1,o,n),t.right&&Wc(t.right,r,!0,o,n)}}var Uc=function(){function t(t){void 0===t&&(t=Nc),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=Vc(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new Gc(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,n=Bc(t,this._root,o),r=o(t,n.key);return 0===r?this._root=n:(r<0?(i.left=n.left,i.right=n,n.left=null):r>0&&(i.right=n.right,i.left=n,n.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,i){var o;return null===e?null:0===i(t,(e=Bc(t,e,i)).key)?(null===e.left?o=e.right:(o=Bc(t,e.left,i)).right=e.right,this._size--,o):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Bc(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,i=this._comparator;e;){var o=i(t,e.key);if(0===o)return e;e=o<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=Bc(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,i=this._comparator;e;){var o=i(t,e.key);if(0===o)return!0;e=o<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,o=[],n=!1;!n;)null!==i?(o.push(i),i=i.left):0!==o.length?(i=o.pop(),t.call(e,i),i=i.right):n=!0;return this},t.prototype.range=function(t,e,i,o){for(var n=[],r=this._comparator,a=this._root;0!==n.length||a;)if(a)n.push(a),a=a.left;else{if(r((a=n.pop()).key,e)>0)break;if(r(a.key,t)>=0&&i.call(o,a))return this;a=a.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var i=e.key;return t.push(i)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var i=e.data;return t.push(i)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,i=!1,o=0,n=[];!i;)if(e)n.push(e),e=e.left;else if(n.length>0){if(e=n.pop(),o===t)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(t){var e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){var e=t,i=[],o=!1,n=new Gc(null,null),r=n;for(;!o;)e?(i.push(e),e=e.left):i.length>0?e=(e=r=r.next=i.pop()).right:o=!0;return r.next=null,n.next}(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var o=t.length,n=this._comparator;if(i&&Yc(t,e,0,o-1,n),null===this._root)this._root=Xc(t,e,0,o),this._size=o;else{var r=function(t,e,i){var o=new Gc(null,null),n=o,r=t,a=e;for(;null!==r&&null!==a;)i(r.key,a.key)<0?(n.next=r,r=r.next):(n.next=a,a=a.next),n=n.next;null!==r?n.next=r:null!==a&&(n.next=a);return o.next}(this.toList(),function(t,e){for(var i=new Gc(null,null),o=i,n=0;n<t.length;n++)o=o.next=new Gc(t[n],e[n]);return o.next=null,i.next}(t,e),n);o=this._size+o,this._root=Kc({head:r},0,o)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return Wc(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var o=this._comparator,n=qc(t,this._root,o),r=n.left,a=n.right;o(t,e)<0?a=Vc(e,i,a,o):r=Vc(e,i,r,o),this._root=function(t,e,i){return null===e?t:(null===t||((e=Bc(t.key,e,i)).left=t),e)}(r,a,o)},t.prototype.split=function(t){return qc(t,this._root,this._comparator)},t}();function Xc(t,e,i,o){var n=o-i;if(n>0){var r=i+Math.floor(n/2),a=t[r],s=e[r],l=new Gc(a,s);return l.left=Xc(t,e,i,r),l.right=Xc(t,e,r+1,o),l}return null}function Kc(t,e,i){var o=i-e;if(o>0){var n=e+Math.floor(o/2),r=Kc(t,e,n),a=t.head;return a.left=r,t.head=t.head.next,a.right=Kc(t,n+1,i),a}return null}function Yc(t,e,i,o,n){if(!(i>=o)){for(var r=t[i+o>>1],a=i-1,s=o+1;;){do{a++}while(n(t[a],r)<0);do{s--}while(n(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=e[a],e[a]=e[s],e[s]=l}Yc(t,e,i,s,n),Yc(t,e,s+1,o,n)}}function Zc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hc(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function $c(t,e,i){return e&&Hc(t.prototype,e),i&&Hc(t,i),t}var Jc=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},Qc=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var i=t.ll.x<e.ll.x?e.ll.x:t.ll.x,o=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:o,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},tg=Number.EPSILON;void 0===tg&&(tg=Math.pow(2,-52));var eg=tg*tg,ig=function(t,e){if(-tg<t&&t<tg&&-tg<e&&e<tg)return 0;var i=t-e;return i*i<eg*t*e?0:t<e?-1:1},og=function(){function t(){Zc(this,t),this.reset()}return $c(t,[{key:"reset",value:function(){this.xRounder=new ng,this.yRounder=new ng}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),t}(),ng=function(){function t(){Zc(this,t),this.tree=new Uc,this.round(0)}return $c(t,[{key:"round",value:function(t){var e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===ig(e.key,i.key))return this.tree.remove(t),i.key;var o=this.tree.next(e);return null!==o&&0===ig(e.key,o.key)?(this.tree.remove(t),o.key):t}}]),t}(),rg=new og,ag=function(t,e){return t.x*e.y-t.y*e.x},sg=function(t,e){return t.x*e.x+t.y*e.y},lg=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y},r=ag(o,n);return ig(r,0)},ug=function(t){return Math.sqrt(sg(t,t))},pg=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y};return sg(n,o)/ug(n)/ug(o)},hg=function(t,e,i){return 0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i}},dg=function(t,e,i){return 0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)}},cg=function(){function t(e,i){Zc(this,t),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=i}return $c(t,null,[{key:"compare",value:function(e,i){var o=t.comparePoints(e.point,i.point);return 0!==o?o:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:fg.compare(e.segment,i.segment))}},{key:"comparePoints",value:function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}}]),$c(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,i=0,o=e.length;i<o;i++){var n=e[i];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var i=this.point.events[e];if(void 0===i.segment.consumedBy)for(var o=e+1;o<t;o++){var n=this.point.events[o];void 0===n.consumedBy&&(i.otherSE.point.events===n.otherSE.point.events&&i.segment.consume(n.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,i=this.point.events.length;e<i;e++){var o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&t.push(o)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,i=new Map,o=function(o){var n,r,a,s,l,u=o.otherSE;i.set(o,{sine:(n=e.point,r=t.point,a=u.point,s={x:r.x-n.x,y:r.y-n.y},l={x:a.x-n.x,y:a.y-n.y},ag(l,s)/ug(l)/ug(s)),cosine:pg(e.point,t.point,u.point)})};return function(t,e){i.has(t)||o(t),i.has(e)||o(e);var n=i.get(t),r=n.sine,a=n.cosine,s=i.get(e),l=s.sine,u=s.cosine;return r>=0&&l>=0?a<u?1:a>u?-1:0:r<0&&l<0?a<u?-1:a>u?1:0:l<r?-1:l>r?1:0}}}]),t}(),gg=0,fg=function(){function t(e,i,o,n){Zc(this,t),this.id=++gg,this.leftSE=e,e.segment=this,e.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=e,this.rings=o,this.windings=n}return $c(t,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,o=e.leftSE.point.x,n=t.rightSE.point.x,r=e.rightSE.point.x;if(r<i)return 1;if(n<o)return-1;var a=t.leftSE.point.y,s=e.leftSE.point.y,l=t.rightSE.point.y,u=e.rightSE.point.y;if(i<o){if(s<a&&s<l)return 1;if(s>a&&s>l)return-1;var p=t.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(i>o){if(a<s&&a<u)return-1;if(a>s&&a>u)return 1;var d=e.comparePoint(t.leftSE.point);if(0!==d)return d;var c=t.comparePoint(e.rightSE.point);return c<0?1:c>0?-1:1}if(a<s)return-1;if(a>s)return 1;if(n<r){var g=e.comparePoint(t.rightSE.point);if(0!==g)return g}if(n>r){var f=t.comparePoint(e.rightSE.point);if(f<0)return 1;if(f>0)return-1}if(n!==r){var m=l-a,v=n-i,y=u-s,_=r-o;if(m>v&&y<_)return 1;if(m<v&&y>_)return-1}return n>r?1:n<r||l<u?-1:l>u?1:t.id<e.id?-1:t.id>e.id?1:0}}]),$c(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;var n=(t.y-e.y)/o.y,r=e.x+n*o.x;if(t.x===r)return 0;var a=(t.x-e.x)/o.x,s=e.y+a*o.y;return t.y===s?0:t.y<s?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),i=t.bbox(),o=Qc(e,i);if(null===o)return null;var n=this.leftSE.point,r=this.rightSE.point,a=t.leftSE.point,s=t.rightSE.point,l=Jc(e,a)&&0===this.comparePoint(a),u=Jc(i,n)&&0===t.comparePoint(n),p=Jc(e,s)&&0===this.comparePoint(s),h=Jc(i,r)&&0===t.comparePoint(r);if(u&&l)return h&&!p?r:!h&&p?s:null;if(u)return p&&n.x===s.x&&n.y===s.y?null:n;if(l)return h&&r.x===a.x&&r.y===a.y?null:a;if(h&&p)return null;if(h)return r;if(p)return s;var d=function(t,e,i,o){if(0===e.x)return dg(i,o,t.x);if(0===o.x)return dg(t,e,i.x);if(0===e.y)return hg(i,o,t.y);if(0===o.y)return hg(t,e,i.y);var n=ag(e,o);if(0==n)return null;var r={x:i.x-t.x,y:i.y-t.y},a=ag(r,e)/n,s=ag(r,o)/n;return{x:(t.x+s*e.x+(i.x+a*o.x))/2,y:(t.y+s*e.y+(i.y+a*o.y))/2}}(n,this.vector(),a,t.vector());return null===d?null:Jc(o,d)?rg.round(d.x,d.y):null}},{key:"split",value:function(e){var i=[],o=void 0!==e.events,n=new cg(e,!0),r=new cg(e,!1),a=this.rightSE;this.replaceRightSE(r),i.push(r),i.push(n);var s=new t(n,a,this.rings.slice(),this.windings.slice());return cg.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),cg.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),o&&(n.checkForConsuming(),r.checkForConsuming()),i}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}},{key:"consume",value:function(e){for(var i=this,o=e;i.consumedBy;)i=i.consumedBy;for(;o.consumedBy;)o=o.consumedBy;var n=t.compare(i,o);if(0!==n){if(n>0){var r=i;i=o,o=r}if(i.prev===o){var a=i;i=o,o=a}for(var s=0,l=o.rings.length;s<l;s++){var u=o.rings[s],p=o.windings[s],h=i.rings.indexOf(u);-1===h?(i.rings.push(u),i.windings.push(p)):i.windings[h]+=p}o.rings=null,o.windings=null,o.consumedBy=i,o.leftSE.consumedBy=i.leftSE,o.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys,n=0,r=this.rings.length;n<r;n++){var a=this.rings[n],s=this.windings[n],l=e.indexOf(a);-1===l?(e.push(a),i.push(s)):i[l]+=s}for(var u=[],p=[],h=0,d=e.length;h<d;h++)if(0!==i[h]){var c=e[h],g=c.poly;if(-1===p.indexOf(g))if(c.isExterior)u.push(g);else{-1===p.indexOf(g)&&p.push(g);var f=u.indexOf(c.poly);-1!==f&&u.splice(f,1)}}for(var m=0,v=u.length;m<v;m++){var y=u[m].multiPoly;-1===o.indexOf(y)&&o.push(y)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Cg.type){case"union":var i=0===t.length,o=0===e.length;this._isInResult=i!==o;break;case"intersection":var n,r;t.length<e.length?(n=t.length,r=e.length):(n=e.length,r=t.length),this._isInResult=r===Cg.numMultiPolys&&n<r;break;case"xor":var a=Math.abs(t.length-e.length);this._isInResult=a%2==1;break;case"difference":var s=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=s(t)!==s(e);break;default:throw new Error("Unrecognized operation type found ".concat(Cg.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,i,o){var n,r,a,s=cg.comparePoints(e,i);if(s<0)n=e,r=i,a=1;else{if(!(s>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));n=i,r=e,a=-1}return new t(new cg(n,!0),new cg(r,!1),[o],[a])}}]),t}(),mg=function(){function t(e,i,o){if(Zc(this,t),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=i,this.isExterior=o,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var n=rg.round(e[0][0],e[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};for(var r=n,a=1,s=e.length;a<s;a++){if("number"!=typeof e[a][0]||"number"!=typeof e[a][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=rg.round(e[a][0],e[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(fg.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}n.x===r.x&&n.y===r.y||this.segments.push(fg.fromRing(r,n,this))}return $c(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;e<i;e++){var o=this.segments[e];t.push(o.leftSE),t.push(o.rightSE)}return t}}]),t}(),vg=function(){function t(e,i){if(Zc(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new mg(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var o=1,n=e.length;o<n;o++){var r=new mg(e[o],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=i}return $c(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;e<i;e++)for(var o=this.interiorRings[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),yg=function(){function t(e,i){if(Zc(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(a){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var o=0,n=e.length;o<n;o++){var r=new vg(e[o],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=i}return $c(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++)for(var o=this.polys[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),_g=function(){function t(e){Zc(this,t),this.events=e;for(var i=0,o=e.length;i<o;i++)e[i].segment.ringOut=this;this.poly=null}return $c(t,null,[{key:"factory",value:function(e){for(var i=[],o=0,n=e.length;o<n;o++){var r=e[o];if(r.isInResult()&&!r.ringOut){for(var a=null,s=r.leftSE,l=r.rightSE,u=[s],p=s.point,h=[];a=s,s=l,u.push(s),s.point!==p;)for(;;){var d=s.getAvailableLinkedEvents();if(0===d.length){var c=u[0].point,g=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(c.x,",")+" ".concat(c.y,"]. Last matching segment found ends at")+" [".concat(g.x,", ").concat(g.y,"]."))}if(1===d.length){l=d[0].otherSE;break}for(var f=null,m=0,v=h.length;m<v;m++)if(h[m].point===s.point){f=m;break}if(null===f){h.push({index:u.length,point:s.point});var y=s.getLeftmostComparator(a);l=d.sort(y)[0].otherSE;break}var _=h.splice(f)[0],b=u.splice(_.index);b.unshift(b[0].otherSE),i.push(new t(b.reverse()))}i.push(new t(u))}}return i}}]),$c(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],i=1,o=this.events.length-1;i<o;i++){var n=this.events[i].point,r=this.events[i+1].point;0!==lg(n,t,r)&&(e.push(n),t=n)}if(1===e.length)return null;var a=e[0],s=e[1];0===lg(a,t,s)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,p=this.isExteriorRing()?e.length:-1,h=[],d=u;d!=p;d+=l)h.push([e[d].x,e[d].y]);return h}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,i=this.events.length;e<i;e++){var o=this.events[e];cg.compare(t,o)>0&&(t=o)}for(var n=t.segment.prevInResult(),r=n?n.prevInResult():null;;){if(!n)return null;if(!r)return n.ringOut;if(r.ringOut!==n.ringOut)return r.ringOut.enclosingRing()!==n.ringOut?n.ringOut:n.ringOut.enclosingRing();n=r.prevInResult(),r=n?n.prevInResult():null}}}]),t}(),bg=function(){function t(e){Zc(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return $c(t,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,i=this.interiorRings.length;e<i;e++){var o=this.interiorRings[e].getGeom();null!==o&&t.push(o)}return t}}]),t}(),xg=function(){function t(e){Zc(this,t),this.rings=e,this.polys=this._composePolys(e)}return $c(t,[{key:"getGeom",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++){var o=this.polys[e].getGeom();null!==o&&t.push(o)}return t}},{key:"_composePolys",value:function(t){for(var e=[],i=0,o=t.length;i<o;i++){var n=t[i];if(!n.poly)if(n.isExteriorRing())e.push(new bg(n));else{var r=n.enclosingRing();r.poly||e.push(new bg(r)),r.poly.addInterior(n)}}return e}}]),t}(),kg=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fg.compare;Zc(this,t),this.queue=e,this.tree=new Uc(i),this.segments=[]}return $c(t,[{key:"process",value:function(t){var e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;var o=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!o)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var n=o,r=o,a=void 0,s=void 0;void 0===a;)null===(n=this.tree.prev(n))?a=null:void 0===n.key.consumedBy&&(a=n.key);for(;void 0===s;)null===(r=this.tree.next(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);if(t.isLeft){var l=null;if(a){var u=a.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!a.isAnEndpoint(u)))for(var p=this._splitSafely(a,u),h=0,d=p.length;h<d;h++)i.push(p[h])}var c=null;if(s){var g=s.getIntersection(e);if(null!==g&&(e.isAnEndpoint(g)||(c=g),!s.isAnEndpoint(g)))for(var f=this._splitSafely(s,g),m=0,v=f.length;m<v;m++)i.push(f[m])}if(null!==l||null!==c){var y=null;if(null===l)y=c;else if(null===c)y=l;else{y=cg.comparePoints(l,c)<=0?l:c}this.queue.remove(e.rightSE),i.push(e.rightSE);for(var _=e.split(y),b=0,x=_.length;b<x;b++)i.push(_[b])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&s){var k=a.getIntersection(s);if(null!==k){if(!a.isAnEndpoint(k))for(var w=this._splitSafely(a,k),S=0,C=w.length;S<C;S++)i.push(w[S]);if(!s.isAnEndpoint(k))for(var z=this._splitSafely(s,k),E=0,T=z.length;E<T;E++)i.push(z[E])}}this.tree.remove(e)}return i}},{key:"_splitSafely",value:function(t,e){this.tree.remove(t);var i=t.rightSE;this.queue.remove(i);var o=t.split(e);return o.push(i),void 0===t.consumedBy&&this.tree.insert(t),o}}]),t}(),wg="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Sg="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Cg=new(function(){function t(){Zc(this,t)}return $c(t,[{key:"run",value:function(t,e,i){Cg.type=t,rg.reset();for(var o=[new yg(e,!0)],n=0,r=i.length;n<r;n++)o.push(new yg(i[n],!1));if(Cg.numMultiPolys=o.length,"difference"===Cg.type)for(var a=o[0],s=1;s<o.length;)null!==Qc(o[s].bbox,a.bbox)?s++:o.splice(s,1);if("intersection"===Cg.type)for(var l=0,u=o.length;l<u;l++)for(var p=o[l],h=l+1,d=o.length;h<d;h++)if(null===Qc(p.bbox,o[h].bbox))return[];for(var c=new Uc(cg.compare),g=0,f=o.length;g<f;g++)for(var m=o[g].getSweepEvents(),v=0,y=m.length;v<y;v++)if(c.insert(m[v]),c.size>wg)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var _=new kg(c),b=c.size,x=c.pop();x;){var k=x.key;if(c.size===b){var w=k.segment;throw new Error("Unable to pop() ".concat(k.isLeft?"left":"right"," SweepEvent ")+"[".concat(k.point.x,", ").concat(k.point.y,"] from segment #").concat(w.id," ")+"[".concat(w.leftSE.point.x,", ").concat(w.leftSE.point.y,"] -> ")+"[".concat(w.rightSE.point.x,", ").concat(w.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(c.size>wg)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>Sg)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var S=_.process(k),C=0,z=S.length;C<z;C++){var E=S[C];void 0===E.consumedBy&&c.insert(E)}b=c.size,x=c.pop()}rg.reset();var T=_g.factory(_.segments);return new xg(T).getGeom()}}]),t}()),zg=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return Cg.run("union",t,i)};function Eg(t,e,i){void 0===i&&(i={});var o={type:"Feature"};return(0===i.id||i.id)&&(o.id=i.id),i.bbox&&(o.bbox=i.bbox),o.properties=e||{},o.geometry=t,o}function Tg(t){return"Feature"===t.type?t.geometry:t}function Pg(t,e,i){void 0===i&&(i={});var o=Tg(t),n=Tg(e),r=zg(o.coordinates,n.coordinates);return 0===r.length?null:1===r.length?function(t,e,i){void 0===i&&(i={});for(var o=0,n=t;o<n.length;o++){var r=n[o];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<r[r.length-1].length;a++)if(r[r.length-1][a]!==r[0][a])throw new Error("First and last Position are not equivalent.")}return Eg({type:"Polygon",coordinates:t},e,i)}(r[0],i.properties):function(t,e,i){return void 0===i&&(i={}),Eg({type:"MultiPolygon",coordinates:t},e,i)}(r,i.properties)}function Og(t,e){const i=Vo(t),o=Math.round(100*i)/100;let n;return"m2"===e?n=o+" m²":"ha"===e&&(n=o/1e4+" ha"),n}function Fg(t,e,i){const o=e.getExtent();return t.getView().fit(Ji(o,i))}function Rg(t,e){const[i,o,n]=Array.from(Rn(t));return Tn([i,o,n,e])}const Ig=new Ph,Mg=new Ph;function jg(t,e,i){const o=`\n <ogc:Filter>\n <ogc:Contains>\n <ogc:PropertyName>SHAPE</ogc:PropertyName>\n <gml:Point srsName="urn:ogc:def:crs:EPSG::4326">\n <gml:coordinates>${(n=t,a=ln(n,void 0!==r?r:"EPSG:3857","EPSG:4326"),s=a[0],(s<-180||s>180)&&(a[0]=Ve(s+180,360)-180),a).reverse().join(",")}</gml:coordinates>\n </gml:Point>\n </ogc:Contains>\n </ogc:Filter>\n `;var n,r,a,s;fetch(function(t){const e=Object.keys(t).map((e=>e+"="+encodeURI(t[e]))).join("&");return`https://api.os.uk/features/v1/wfs?${e}`}({key:e,service:"WFS",request:"GetFeature",version:"2.0.0",typeNames:"Topography_TopographicArea",propertyName:"TOID,DescriptiveGroup,SHAPE",outputFormat:"GEOJSON",srsName:"urn:ogc:def:crs:EPSG::4326",filter:o,count:1})).then((t=>t.json())).then((t=>{if(!t.features.length)return;const e=t.features[0].properties,o=["TOID","DescriptiveGroup"];Object.keys(e).forEach((t=>o.includes(t)||delete e[t]));const n=new Ps,r=n.readFeatures(t,{featureProjection:"EPSG:3857"});i?r.forEach((t=>{const e=t.getProperties().TOID,i=Ig.getFeatureById(e);i?Ig.removeFeature(i):(t.setId(e),Ig.addFeature(t))})):(Ig.clear(),r.forEach((t=>{const e=t.getProperties().TOID;t.setId(e),Ig.addFeature(t)}))),Mg.clear(),Mg.addFeature(n.readFeature(Ig.getFeatures().reduce(((t,e)=>{const i=n.writeFeatureObject(e).geometry;return t?Pg(t,i):i}),null)))})).catch((t=>console.log(t)))}var Dg,Ag={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Lg(t){return(t=Math.round(t))<0?0:t>255?255:t}function Gg(t){return t<0?0:t>1?1:t}function Ng(t){return"%"===t[t.length-1]?Lg(parseFloat(t)/100*255):Lg(parseInt(t))}function Bg(t){return"%"===t[t.length-1]?Gg(parseFloat(t)/100):Gg(parseFloat(t))}function Vg(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{Dg={}.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in Ag)return Ag[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var o=i.indexOf("("),n=i.indexOf(")");if(-1!==o&&n+1===i.length){var r=i.substr(0,o),a=i.substr(o+1,n-(o+1)).split(","),s=1;switch(r){case"rgba":if(4!==a.length)return null;s=Bg(a.pop());case"rgb":return 3!==a.length?null:[Ng(a[0]),Ng(a[1]),Ng(a[2]),s];case"hsla":if(4!==a.length)return null;s=Bg(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=Bg(a[1]),p=Bg(a[2]),h=p<=.5?p*(u+1):p+u-p*u,d=2*p-h;return[Lg(255*Vg(d,h,l+1/3)),Lg(255*Vg(d,h,l)),Lg(255*Vg(d,h,l-1/3)),s];default:return null}}return null}}catch(f_){}var qg=function(t,e,i,o){void 0===o&&(o=1),this.r=t,this.g=e,this.b=i,this.a=o};qg.parse=function(t){if(t){if(t instanceof qg)return t;if("string"==typeof t){var e=Dg(t);if(e)return new qg(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},qg.prototype.toString=function(){var t=this.toArray(),e=t[0],i=t[1],o=t[2],n=t[3];return"rgba("+Math.round(e)+","+Math.round(i)+","+Math.round(o)+","+n+")"},qg.prototype.toArray=function(){var t=this,e=t.r,i=t.g,o=t.b,n=t.a;return 0===n?[0,0,0,0]:[255*e/n,255*i/n,255*o/n,n]},qg.black=new qg(0,0,0,1),qg.white=new qg(1,1,1,1),qg.transparent=new qg(0,0,0,0),qg.red=new qg(1,0,0,1),qg.blue=new qg(0,0,1,1);var Wg=qg;function Ug(t){return"object"==typeof t?["literal",t]:t}function Xg(t,e){var i=t.stops;if(!i)return function(t,e){var i=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",i]:i;if("enum"===e.type)return["match",i,Object.keys(e.values),i,t.default];var o=["color"===e.type?"to-color":e.type,i,Ug(t.default)];return"array"===e.type&&o.splice(1,0,e.value,e.length||null),o}(t,e);var o=i&&"object"==typeof i[0][0],n=o||void 0!==t.property,r=o||!n;return i=i.map((function(t){return!n&&e.tokens&&"string"==typeof t[1]?[t[0],Qg(t[1])]:[t[0],Ug(t[1])]})),o?function(t,e,i){for(var o={},n={},r=[],a=0;a<i.length;a++){var s=i[a],l=s[0].zoom;void 0===o[l]&&(o[l]={zoom:l,type:t.type,property:t.property,default:t.default},n[l]=[],r.push(l)),n[l].push([s[0].value,s[1]])}if("exponential"===Jg({},e)){for(var u=[Kg(t),["linear"],["zoom"]],p=0,h=r;p<h.length;p+=1){var d=h[p];$g(u,d,Zg(o[d],e,n[d]),!1)}return u}for(var c=["step",["zoom"]],g=0,f=r;g<f.length;g+=1){var m=f[g];$g(c,m,Zg(o[m],e,n[m]),!0)}return Hg(c),c}(t,e,i):r?function(t,e,i,o){void 0===o&&(o=["zoom"]);var n,r=Jg(t,e),a=!1;if("interval"===r)n=["step",o],a=!0;else{if("exponential"!==r)throw new Error('Unknown zoom function type "'+r+'"');var s=void 0!==t.base?t.base:1;n=[Kg(t),1===s?["linear"]:["exponential",s],o]}for(var l=0,u=i;l<u.length;l+=1){var p=u[l];$g(n,p[0],p[1],a)}return Hg(n),n}(t,e,i):Zg(t,e,i)}function Kg(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Yg(t,e){var i,o,n=Ug((i=t.default,o=e.default,void 0!==i?i:void 0!==o?o:void 0));return void 0===n&&"resolvedImage"===e.type?"":n}function Zg(t,e,i){var o=Jg(t,e),n=["get",t.property];if("categorical"===o&&"boolean"==typeof i[0][0]){for(var r=["case"],a=0,s=i;a<s.length;a+=1){var l=s[a];r.push(["==",n,l[0]],l[1])}return r.push(Yg(t,e)),r}if("categorical"===o){for(var u=["match",n],p=0,h=i;p<h.length;p+=1){var d=h[p];$g(u,d[0],d[1],!1)}return u.push(Yg(t,e)),u}if("interval"===o){for(var c=["step",["number",n]],g=0,f=i;g<f.length;g+=1){var m=f[g];$g(c,m[0],m[1],!0)}return Hg(c),void 0===t.default?c:["case",["==",["typeof",n],"number"],c,Ug(t.default)]}if("exponential"===o){for(var v=void 0!==t.base?t.base:1,y=[Kg(t),1===v?["linear"]:["exponential",v],["number",n]],_=0,b=i;_<b.length;_+=1){var x=b[_];$g(y,x[0],x[1],!1)}return void 0===t.default?y:["case",["==",["typeof",n],"number"],y,Ug(t.default)]}throw new Error("Unknown property function type "+o)}function Hg(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function $g(t,e,i,o){t.length>3&&e===t[t.length-2]||(o&&2===t.length||t.push(e),t.push(i))}function Jg(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function Qg(t){for(var e=["concat"],i=/{([^{}]+)}/g,o=0,n=i.exec(t);null!==n;n=i.exec(t)){var r=t.slice(o,i.lastIndex-n[0].length);o=i.lastIndex,r.length>0&&e.push(r),e.push(["get",n[1]])}if(1===e.length)return t;if(o<t.length)e.push(t.slice(o));else if(2===e.length)return["to-string",e[1]];return e}var tf=function(t){function e(e,i){t.call(this,i),this.message=i,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),ef=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var i=0,o=e;i<o.length;i+=1){var n=o[i],r=n[0],a=n[1];this.bindings[r]=a}};ef.prototype.concat=function(t){return new ef(this,t)},ef.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},ef.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var of=ef,nf={kind:"null"},rf={kind:"number"},af={kind:"string"},sf={kind:"boolean"},lf={kind:"color"},uf={kind:"object"},pf={kind:"value"},hf={kind:"collator"},df={kind:"formatted"},cf={kind:"resolvedImage"};function gf(t,e){return{kind:"array",itemType:t,N:e}}function ff(t){if("array"===t.kind){var e=ff(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var mf=[nf,rf,af,sf,lf,df,uf,gf(pf),cf];function vf(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!vf(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var i=0,o=mf;i<o.length;i+=1){if(!vf(o[i],e))return null}}return"Expected "+ff(t)+" but found "+ff(e)+" instead."}function yf(t,e){return e.some((function(e){return e.kind===t.kind}))}function _f(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var bf=function(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};bf.prototype.compare=function(t,e){return this.collator.compare(t,e)},bf.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var xf=bf,kf=function(t,e,i,o,n){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=i,this.fontStack=o,this.textColor=n},wf=function(t){this.sections=t};wf.fromString=function(t){return new wf([new kf(t,null,null,null,null)])},wf.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},wf.factory=function(t){return t instanceof wf?t:wf.fromString(t)},wf.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},wf.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var o=i[e];if(o.image)t.push(["image",o.image.name]);else{t.push(o.text);var n={};o.fontStack&&(n["text-font"]=["literal",o.fontStack.split(",")]),o.scale&&(n["font-scale"]=o.scale),o.textColor&&(n["text-color"]=["rgba"].concat(o.textColor.toArray())),t.push(n)}}return t};var Sf=wf,Cf=function(t){this.name=t.name,this.available=t.available};Cf.prototype.toString=function(){return this.name},Cf.fromString=function(t){return t?new Cf({name:t,available:!1}):null},Cf.prototype.serialize=function(){return["image",this.name]};var zf=Cf;function Ef(t,e,i,o){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===o||"number"==typeof o&&o>=0&&o<=1?null:"Invalid rgba value ["+[t,e,i,o].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof o?[t,e,i,o]:[t,e,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Tf(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof Wg)return!0;if(t instanceof xf)return!0;if(t instanceof Sf)return!0;if(t instanceof zf)return!0;if(Array.isArray(t)){for(var e=0,i=t;e<i.length;e+=1){if(!Tf(i[e]))return!1}return!0}if("object"==typeof t){for(var o in t)if(!Tf(t[o]))return!1;return!0}return!1}function Pf(t){if(null===t)return nf;if("string"==typeof t)return af;if("boolean"==typeof t)return sf;if("number"==typeof t)return rf;if(t instanceof Wg)return lf;if(t instanceof xf)return hf;if(t instanceof Sf)return df;if(t instanceof zf)return cf;if(Array.isArray(t)){for(var e,i=t.length,o=0,n=t;o<n.length;o+=1){var r=Pf(n[o]);if(e){if(e===r)continue;e=pf;break}e=r}return gf(e||pf,i)}return uf}function Of(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Wg||t instanceof Sf||t instanceof zf?t.toString():JSON.stringify(t)}var Ff=function(t,e){this.type=t,this.value=e};Ff.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!Tf(t[1]))return e.error("invalid value");var i=t[1],o=Pf(i),n=e.expectedType;return"array"!==o.kind||0!==o.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(o=n),new Ff(o,i)},Ff.prototype.evaluate=function(){return this.value},Ff.prototype.eachChild=function(){},Ff.prototype.outputDefined=function(){return!0},Ff.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Wg?["rgba"].concat(this.value.toArray()):this.value instanceof Sf?this.value.serialize():this.value};var Rf=Ff,If=function(t){this.name="ExpressionEvaluationError",this.message=t};If.prototype.toJSON=function(){return this.message};var Mf=If,jf={string:af,number:rf,boolean:sf,object:uf},Df=function(t,e){this.type=t,this.args=e};Df.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i,o=1,n=t[0];if("array"===n){var r,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in jf)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=jf[s],o++}else r=pf;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],o++}i=gf(r,a)}else i=jf[n];for(var l=[];o<t.length;o++){var u=e.parse(t[o],o,pf);if(!u)return null;l.push(u)}return new Df(i,l)},Df.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var i=this.args[e].evaluate(t);if(!vf(this.type,Pf(i)))return i;if(e===this.args.length-1)throw new Mf("Expected value to be of type "+ff(this.type)+", but found "+ff(Pf(i))+" instead.")}return null},Df.prototype.eachChild=function(t){this.args.forEach(t)},Df.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Df.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);var o=t.N;("number"==typeof o||this.args.length>1)&&e.push(o)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var Af=Df,Lf=function(t){this.type=df,this.sections=t};Lf.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");for(var o=[],n=!1,r=1;r<=t.length-1;++r){var a=t[r];if(n&&"object"==typeof a&&!Array.isArray(a)){n=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,rf)))return null;var l=null;if(a["text-font"]&&!(l=e.parse(a["text-font"],1,gf(af))))return null;var u=null;if(a["text-color"]&&!(u=e.parse(a["text-color"],1,lf)))return null;var p=o[o.length-1];p.scale=s,p.font=l,p.textColor=u}else{var h=e.parse(t[r],1,pf);if(!h)return null;var d=h.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,o.push({content:h,scale:null,font:null,textColor:null})}}return new Lf(o)},Lf.prototype.evaluate=function(t){return new Sf(this.sections.map((function(e){var i=e.content.evaluate(t);return Pf(i)===cf?new kf("",i,null,null,null):new kf(Of(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},Lf.prototype.eachChild=function(t){for(var e=0,i=this.sections;e<i.length;e+=1){var o=i[e];t(o.content),o.scale&&t(o.scale),o.font&&t(o.font),o.textColor&&t(o.textColor)}},Lf.prototype.outputDefined=function(){return!1},Lf.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var o=i[e];t.push(o.content.serialize());var n={};o.scale&&(n["font-scale"]=o.scale.serialize()),o.font&&(n["text-font"]=o.font.serialize()),o.textColor&&(n["text-color"]=o.textColor.serialize()),t.push(n)}return t};var Gf=Lf,Nf=function(t){this.type=cf,this.input=t};Nf.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,af);return i?new Nf(i):e.error("No image name provided.")},Nf.prototype.evaluate=function(t){var e=this.input.evaluate(t),i=zf.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i},Nf.prototype.eachChild=function(t){t(this.input)},Nf.prototype.outputDefined=function(){return!1},Nf.prototype.serialize=function(){return["image",this.input.serialize()]};var Bf=Nf,Vf={"to-boolean":sf,"to-color":lf,"to-number":rf,"to-string":af},qf=function(t,e){this.type=t,this.args=e};qf.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");for(var o=Vf[i],n=[],r=1;r<t.length;r++){var a=e.parse(t[r],r,pf);if(!a)return null;n.push(a)}return new qf(o,n)},qf.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,i,o=0,n=this.args;o<n.length;o+=1){if(i=null,(e=n[o].evaluate(t))instanceof Wg)return e;if("string"==typeof e){var r=t.parseColor(e);if(r)return r}else if(Array.isArray(e)&&!(i=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":Ef(e[0],e[1],e[2],e[3])))return new Wg(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Mf(i||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,l=this.args;s<l.length;s+=1){if(null===(a=l[s].evaluate(t)))return 0;var u=Number(a);if(!isNaN(u))return u}throw new Mf("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?Sf.fromString(Of(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?zf.fromString(Of(this.args[0].evaluate(t))):Of(this.args[0].evaluate(t))},qf.prototype.eachChild=function(t){this.args.forEach(t)},qf.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},qf.prototype.serialize=function(){if("formatted"===this.type.kind)return new Gf([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Bf(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var Wf=qf,Uf=["Unknown","Point","LineString","Polygon"],Xf=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null};Xf.prototype.id=function(){return this.feature&&"id"in this.feature&&this.feature.id?this.feature.id:null},Xf.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?Uf[this.feature.type]:this.feature.type:null},Xf.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Xf.prototype.canonicalID=function(){return this.canonical},Xf.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Xf.prototype.distanceFromCenter=function(){if(this.featureTileCoord&&this.featureDistanceData){var t=this.featureDistanceData.center,e=this.featureDistanceData.scale,i=this.featureTileCoord,o=i.x,n=i.y,r=o*e-t[0],a=n*e-t[1];return this.featureDistanceData.bearing[0]*r+this.featureDistanceData.bearing[1]*a}return 0},Xf.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Wg.parse(t)),e};var Kf=Xf,Yf=function(t,e,i,o){this.name=t,this.type=e,this._evaluate=i,this.args=o};Yf.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Yf.prototype.eachChild=function(t){this.args.forEach(t)},Yf.prototype.outputDefined=function(){return!1},Yf.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},Yf.parse=function(t,e){var i,o=t[0],n=Yf.definitions[o];if(!n)return e.error('Unknown expression "'+o+'". If you wanted a literal array, use ["literal", [...]].',0);for(var r=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=a.filter((function(e){var i=e[0];return!Array.isArray(i)||i.length===t.length-1})),l=null,u=0,p=s;u<p.length;u+=1){var h=p[u],d=h[0],c=h[1];l=new xm(e.registry,e.path,null,e.scope);for(var g=[],f=!1,m=1;m<t.length;m++){var v=t[m],y=Array.isArray(d)?d[m-1]:d.type,_=l.parse(v,1+g.length,y);if(!_){f=!0;break}g.push(_)}if(!f)if(Array.isArray(d)&&d.length!==g.length)l.error("Expected "+d.length+" arguments, but found "+g.length+" instead.");else{for(var b=0;b<g.length;b++){var x=Array.isArray(d)?d[b]:d.type,k=g[b];l.concat(b+1).checkSubtype(x,k.type)}if(0===l.errors.length)return new Yf(o,r,c,g)}}if(1===s.length)(i=e.errors).push.apply(i,l.errors);else{for(var w=(s.length?s:a).map((function(t){var e,i=t[0];return e=i,Array.isArray(e)?"("+e.map(ff).join(", ")+")":"("+ff(e.type)+"...)"})).join(" | "),S=[],C=1;C<t.length;C++){var z=e.parse(t[C],1+S.length);if(!z)return null;S.push(ff(z.type))}e.error("Expected arguments of type "+w+", but found ("+S.join(", ")+") instead.")}return null},Yf.register=function(t,e){for(var i in Yf.definitions=e,e)t[i]=Yf};var Zf=Yf,Hf=function(t,e,i){this.type=hf,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e};Hf.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");var o=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,sf);if(!o)return null;var n=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,sf);if(!n)return null;var r=null;return i.locale&&!(r=e.parse(i.locale,1,af))?null:new Hf(o,n,r)},Hf.prototype.evaluate=function(t){return new xf(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Hf.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Hf.prototype.outputDefined=function(){return!1},Hf.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var $f=Hf;function Jf(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Qf(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function tm(t,e){var i,o=(180+t[0])/360,n=(i=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360),r=Math.pow(2,e.z);return[Math.round(o*r*8192),Math.round(n*r*8192)]}function em(t,e,i){return e[1]>t[1]!=i[1]>t[1]&&t[0]<(i[0]-e[0])*(t[1]-e[1])/(i[1]-e[1])+e[0]}function im(t,e){for(var i,o,n,r,a,s,l,u=!1,p=0,h=e.length;p<h;p++)for(var d=e[p],c=0,g=d.length;c<g-1;c++){if(i=t,o=d[c],n=d[c+1],r=void 0,a=void 0,s=void 0,l=void 0,r=i[0]-o[0],a=i[1]-o[1],s=i[0]-n[0],l=i[1]-n[1],r*l-s*a==0&&r*s<=0&&a*l<=0)return!1;em(t,d[c],d[c+1])&&(u=!u)}return u}function om(t,e){for(var i=0;i<e.length;i++)if(im(t,e[i]))return!0;return!1}function nm(t,e,i,o){var n=t[0]-i[0],r=t[1]-i[1],a=e[0]-i[0],s=e[1]-i[1],l=o[0]-i[0],u=o[1]-i[1],p=n*u-l*r,h=a*u-l*s;return p>0&&h<0||p<0&&h>0}function rm(t,e,i){for(var o=0,n=i;o<n.length;o+=1)for(var r=n[o],a=0;a<r.length-1;++a)if(s=t,l=e,u=r[a],p=r[a+1],h=void 0,d=void 0,c=void 0,g=void 0,c=[l[0]-s[0],l[1]-s[1]],g=[p[0]-u[0],p[1]-u[1]],0!=(h=g)[0]*(d=c)[1]-h[1]*d[0]&&nm(s,l,u,p)&&nm(u,p,s,l))return!0;var s,l,u,p,h,d,c,g;return!1}function am(t,e){for(var i=0;i<t.length;++i)if(!im(t[i],e))return!1;for(var o=0;o<t.length-1;++o)if(rm(t[o],t[o+1],e))return!1;return!0}function sm(t,e){for(var i=0;i<e.length;i++)if(am(t,e[i]))return!0;return!1}function lm(t,e,i){for(var o=[],n=0;n<t.length;n++){for(var r=[],a=0;a<t[n].length;a++){var s=tm(t[n][a],i);Jf(e,s),r.push(s)}o.push(r)}return o}function um(t,e,i){for(var o=[],n=0;n<t.length;n++){var r=lm(t[n],e,i);o.push(r)}return o}function pm(t,e,i,o){if(t[0]<i[0]||t[0]>i[2]){var n=.5*o,r=t[0]-i[0]>n?-o:i[0]-t[0]>n?o:0;0===r&&(r=t[0]-i[2]>n?-o:i[2]-t[0]>n?o:0),t[0]+=r}Jf(e,t)}function hm(t,e,i,o){var n=8192*Math.pow(2,o.z),r=[8192*o.x,8192*o.y],a=[];if(!t)return a;for(var s=0,l=t;s<l.length;s+=1)for(var u=0,p=l[s];u<p.length;u+=1){var h=p[u],d=[h.x+r[0],h.y+r[1]];pm(d,e,i,n),a.push(d)}return a}function dm(t,e,i,o){var n,r=8192*Math.pow(2,o.z),a=[8192*o.x,8192*o.y],s=[];if(!t)return s;for(var l=0,u=t;l<u.length;l+=1){for(var p=[],h=0,d=u[l];h<d.length;h+=1){var c=d[h],g=[c.x+a[0],c.y+a[1]];Jf(e,g),p.push(g)}s.push(p)}if(e[2]-e[0]<=r/2){(n=e)[0]=n[1]=1/0,n[2]=n[3]=-1/0;for(var f=0,m=s;f<m.length;f+=1)for(var v=0,y=m[f];v<y.length;v+=1){pm(y[v],e,i,r)}}return s}var cm=function(t,e){this.type=sf,this.geojson=t,this.geometries=e};cm.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(Tf(t[1])){var i=t[1];if("FeatureCollection"===i.type)for(var o=0;o<i.features.length;++o){var n=i.features[o].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new cm(i,i.features[o].geometry)}else if("Feature"===i.type){var r=i.geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new cm(i,i.geometry)}else if("Polygon"===i.type||"MultiPolygon"===i.type)return new cm(i,i)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},cm.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var i=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(!n)return!1;if("Polygon"===e.type){var r=lm(e.coordinates,o,n),a=hm(t.geometry(),i,o,n);if(!Qf(i,o))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!im(l[s],r))return!1}if("MultiPolygon"===e.type){var u=um(e.coordinates,o,n),p=hm(t.geometry(),i,o,n);if(!Qf(i,o))return!1;for(var h=0,d=p;h<d.length;h+=1)if(!om(d[h],u))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var i=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(!n)return!1;if("Polygon"===e.type){var r=lm(e.coordinates,o,n),a=dm(t.geometry(),i,o,n);if(!Qf(i,o))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!am(l[s],r))return!1}if("MultiPolygon"===e.type){var u=um(e.coordinates,o,n),p=dm(t.geometry(),i,o,n);if(!Qf(i,o))return!1;for(var h=0,d=p;h<d.length;h+=1)if(!sm(d[h],u))return!1}return!0}(t,this.geometries)}return!1},cm.prototype.eachChild=function(){},cm.prototype.outputDefined=function(){return!0},cm.prototype.serialize=function(){return["within",this.geojson]};var gm=cm;function fm(t){if(t instanceof Zf){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof gm)return!1;var e=!0;return t.eachChild((function(t){e&&!fm(t)&&(e=!1)})),e}function mm(t){if(t instanceof Zf&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!mm(t)&&(e=!1)})),e}function vm(t,e){if(t instanceof Zf&&e.indexOf(t.name)>=0)return!1;var i=!0;return t.eachChild((function(t){i&&!vm(t,e)&&(i=!1)})),i}var ym=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};ym.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var i=t[1];return e.scope.has(i)?new ym(i,e.scope.get(i)):e.error('Unknown variable "'+i+'". Make sure "'+i+'" has been bound in an enclosing "let" expression before using it.',1)},ym.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},ym.prototype.eachChild=function(){},ym.prototype.outputDefined=function(){return!1},ym.prototype.serialize=function(){return["var",this.name]};var _m=ym,bm=function(t,e,i,o,n){void 0===e&&(e=[]),void 0===o&&(o=new of),void 0===n&&(n=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=o,this.errors=n,this.expectedType=i};bm.prototype.parse=function(t,e,i,o,n){return void 0===n&&(n={}),e?this.concat(e,i,o)._parse(t,n):this._parse(t,n)},bm.prototype._parse=function(t,e){function i(t,e,i){return"assert"===i?new Af(e,[t]):"coerce"===i?new Wf(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var o=t[0];if("string"!=typeof o)return this.error("Expression name must be a string, but found "+typeof o+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[o];if(n){var r=n.parse(t,this);if(!r)return null;if(this.expectedType){var a=this.expectedType,s=r.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else r=i(r,a,e.typeAnnotation||"coerce");else r=i(r,a,e.typeAnnotation||"assert")}if(!(r instanceof Rf)&&"resolvedImage"!==r.type.kind&&km(r)){var l=new Kf;try{r=new Rf(r.type,r.evaluate(l))}catch(f_){return this.error(f_.message),null}}return r}return this.error('Unknown expression "'+o+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},bm.prototype.concat=function(t,e,i){var o="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new bm(this.registry,o,e||null,n,this.errors)},bm.prototype.error=function(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];var o=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new tf(o,t))},bm.prototype.checkSubtype=function(t,e){var i=vf(t,e);return i&&this.error(i),i};var xm=bm;function km(t){if(t instanceof _m)return km(t.boundExpression);if(t instanceof Zf&&"error"===t.name)return!1;if(t instanceof $f)return!1;if(t instanceof gm)return!1;var e=t instanceof Wf||t instanceof Af,i=!0;return t.eachChild((function(t){i=e?i&&km(t):i&&t instanceof Rf})),!!i&&(fm(t)&&vm(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}function wm(t,e){for(var i,o,n=t.length-1,r=0,a=n,s=0;r<=a;)if(i=t[s=Math.floor((r+a)/2)],o=t[s+1],i<=e){if(s===n||e<o)return s;r=s+1}else{if(!(i>e))throw new Mf("Input is not a number.");a=s-1}return 0}var Sm=function(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var o=0,n=i;o<n.length;o+=1){var r=n[o],a=r[0],s=r[1];this.labels.push(a),this.outputs.push(s)}};Sm.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var i=e.parse(t[1],1,rf);if(!i)return null;var o=[],n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var r=1;r<t.length;r+=2){var a=1===r?-1/0:t[r],s=t[r+1],l=r,u=r+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(o.length&&o[o.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var p=e.parse(s,u,n);if(!p)return null;n=n||p.type,o.push([a,p])}return new Sm(n,i,o)},Sm.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);var n=e.length;return o>=e[n-1]?i[n-1].evaluate(t):i[wm(e,o)].evaluate(t)},Sm.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1){t(i[e])}},Sm.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Sm.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Cm=Sm,zm=Em;function Em(t,e,i,o){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(o-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=o,this.p2x=i,this.p2y=o}function Tm(t,e,i){return t*(1-i)+e*i}Em.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Em.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Em.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Em.prototype.solveCurveX=function(t,e){var i,o,n,r,a;for(void 0===e&&(e=1e-6),n=t,a=0;a<8;a++){if(r=this.sampleCurveX(n)-t,Math.abs(r)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=r/s}if((n=t)<(i=0))return i;if(n>(o=1))return o;for(;i<o;){if(r=this.sampleCurveX(n),Math.abs(r-t)<e)return n;t>r?i=n:o=n,n=.5*(o-i)+i}return n},Em.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Pm=Object.freeze({__proto__:null,number:Tm,color:function(t,e,i){return new Wg(Tm(t.r,e.r,i),Tm(t.g,e.g,i),Tm(t.b,e.b,i),Tm(t.a,e.a,i))},array:function(t,e,i){return t.map((function(t,o){return Tm(t,e[o],i)}))}}),Om=4/29,Fm=6/29,Rm=3*Fm*Fm,Im=Math.PI/180,Mm=180/Math.PI;function jm(t){return t>.008856451679035631?Math.pow(t,1/3):t/Rm+Om}function Dm(t){return t>Fm?t*t*t:Rm*(t-Om)}function Am(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Lm(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Gm(t){var e=Lm(t.r),i=Lm(t.g),o=Lm(t.b),n=jm((.4124564*e+.3575761*i+.1804375*o)/.95047),r=jm((.2126729*e+.7151522*i+.072175*o)/1);return{l:116*r-16,a:500*(n-r),b:200*(r-jm((.0193339*e+.119192*i+.9503041*o)/1.08883)),alpha:t.a}}function Nm(t){var e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,o=isNaN(t.b)?e:e-t.b/200;return e=1*Dm(e),i=.95047*Dm(i),o=1.08883*Dm(o),new Wg(Am(3.2404542*i-1.5371385*e-.4985314*o),Am(-.969266*i+1.8760108*e+.041556*o),Am(.0556434*i-.2040259*e+1.0572252*o),t.alpha)}function Bm(t,e,i){var o=e-t;return t+i*(o>180||o<-180?o-360*Math.round(o/360):o)}var Vm={forward:Gm,reverse:Nm,interpolate:function(t,e,i){return{l:Tm(t.l,e.l,i),a:Tm(t.a,e.a,i),b:Tm(t.b,e.b,i),alpha:Tm(t.alpha,e.alpha,i)}}},qm={forward:function(t){var e=Gm(t),i=e.l,o=e.a,n=e.b,r=Math.atan2(n,o)*Mm;return{h:r<0?r+360:r,c:Math.sqrt(o*o+n*n),l:i,alpha:t.a}},reverse:function(t){var e=t.h*Im,i=t.c;return Nm({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:Bm(t.h,e.h,i),c:Tm(t.c,e.c,i),l:Tm(t.l,e.l,i),alpha:Tm(t.alpha,e.alpha,i)}}},Wm=function(t,e,i,o,n){this.type=t,this.operator=e,this.interpolation=i,this.input=o,this.labels=[],this.outputs=[];for(var r=0,a=n;r<a.length;r+=1){var s=a[r],l=s[0],u=s[1];this.labels.push(l),this.outputs.push(u)}};function Um(t,e,i,o){var n=o-i,r=t-i;return 0===n?0:1===e?r/n:(Math.pow(e,r)-1)/(Math.pow(e,n)-1)}Wm.interpolationFactor=function(t,e,i,o){var n=0;if("exponential"===t.name)n=Um(e,t.base,i,o);else if("linear"===t.name)n=Um(e,1,i,o);else if("cubic-bezier"===t.name){var r=t.controlPoints;n=new zm(r[0],r[1],r[2],r[3]).solve(Um(e,1,i,o))}return n},Wm.parse=function(t,e){var i=t[0],o=t[1],n=t[2],r=t.slice(3);if(!Array.isArray(o)||0===o.length)return e.error("Expected an interpolation type expression.",1);if("linear"===o[0])o={name:"linear"};else if("exponential"===o[0]){var a=o[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:a}}else{if("cubic-bezier"!==o[0])return e.error("Unknown interpolation type "+String(o[0]),1,0);var s=o.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,2,rf)))return null;var l=[],u=null;"interpolate-hcl"===i||"interpolate-lab"===i?u=lf:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var p=0;p<r.length;p+=2){var h=r[p],d=r[p+1],c=p+3,g=p+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',c);if(l.length&&l[l.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',c);var f=e.parse(d,g,u);if(!f)return null;u=u||f.type,l.push([h,f])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new Wm(u,i,o,n,l):e.error("Type "+ff(u)+" is not interpolatable.")},Wm.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);var n=e.length;if(o>=e[n-1])return i[n-1].evaluate(t);var r=wm(e,o),a=e[r],s=e[r+1],l=Wm.interpolationFactor(this.interpolation,o,a,s),u=i[r].evaluate(t),p=i[r+1].evaluate(t);return"interpolate"===this.operator?Pm[this.type.kind.toLowerCase()](u,p,l):"interpolate-hcl"===this.operator?qm.reverse(qm.interpolate(qm.forward(u),qm.forward(p),l)):Vm.reverse(Vm.interpolate(Vm.forward(u),Vm.forward(p),l))},Wm.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1){t(i[e])}},Wm.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Wm.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e};var Xm=Wm,Km=function(t,e){this.type=t,this.args=e};Km.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var i=null,o=e.expectedType;o&&"value"!==o.kind&&(i=o);for(var n=[],r=0,a=t.slice(1);r<a.length;r+=1){var s=a[r],l=e.parse(s,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i=i||l.type,n.push(l)}var u=o&&n.some((function(t){return vf(o,t.type)}));return new Km(u?pf:i,n)},Km.prototype.evaluate=function(t){for(var e,i=null,o=0,n=0,r=this.args;n<r.length;n+=1){if(o++,(i=r[n].evaluate(t))&&i instanceof zf&&!i.available&&(e||(e=i),i=null,o===this.args.length))return e;if(null!==i)break}return i},Km.prototype.eachChild=function(t){this.args.forEach(t)},Km.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Km.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ym=Km,Zm=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Zm.prototype.evaluate=function(t){return this.result.evaluate(t)},Zm.prototype.eachChild=function(t){for(var e=0,i=this.bindings;e<i.length;e+=1){t(i[e][1])}t(this.result)},Zm.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var i=[],o=1;o<t.length-1;o+=2){var n=t[o];if("string"!=typeof n)return e.error("Expected string, but found "+typeof n+" instead.",o);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",o);var r=e.parse(t[o+1],o+1);if(!r)return null;i.push([n,r])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return a?new Zm(i,a):null},Zm.prototype.outputDefined=function(){return this.result.outputDefined()},Zm.prototype.serialize=function(){for(var t=["let"],e=0,i=this.bindings;e<i.length;e+=1){var o=i[e],n=o[0],r=o[1];t.push(n,r.serialize())}return t.push(this.result.serialize()),t};var Hm=Zm,$m=function(t,e,i){this.type=t,this.index=e,this.input=i};$m.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,rf),o=e.parse(t[2],2,gf(e.expectedType||pf));if(!i||!o)return null;var n=o.type;return new $m(n.itemType,i,o)},$m.prototype.evaluate=function(t){var e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new Mf("Array index out of bounds: "+e+" < 0.");if(e>=i.length)throw new Mf("Array index out of bounds: "+e+" > "+(i.length-1)+".");if(e!==Math.floor(e))throw new Mf("Array index must be an integer, but found "+e+" instead.");return i[e]},$m.prototype.eachChild=function(t){t(this.index),t(this.input)},$m.prototype.outputDefined=function(){return!1},$m.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Jm=$m,Qm=function(t,e){this.type=sf,this.needle=t,this.haystack=e};Qm.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,pf),o=e.parse(t[2],2,pf);return i&&o?yf(i.type,[sf,af,rf,nf,pf])?new Qm(i,o):e.error("Expected first argument to be of type boolean, string, number or null, but found "+ff(i.type)+" instead"):null},Qm.prototype.evaluate=function(t){var e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(null==i)return!1;if(!_f(e,["boolean","string","number","null"]))throw new Mf("Expected first argument to be of type boolean, string, number or null, but found "+ff(Pf(e))+" instead.");if(!_f(i,["string","array"]))throw new Mf("Expected second argument to be of type array or string, but found "+ff(Pf(i))+" instead.");return i.indexOf(e)>=0},Qm.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Qm.prototype.outputDefined=function(){return!0},Qm.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var tv=Qm,ev=function(t,e,i){this.type=rf,this.needle=t,this.haystack=e,this.fromIndex=i};ev.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,pf),o=e.parse(t[2],2,pf);if(!i||!o)return null;if(!yf(i.type,[sf,af,rf,nf,pf]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+ff(i.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,rf);return n?new ev(i,o,n):null}return new ev(i,o)},ev.prototype.evaluate=function(t){var e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!_f(e,["boolean","string","number","null"]))throw new Mf("Expected first argument to be of type boolean, string, number or null, but found "+ff(Pf(e))+" instead.");if(!_f(i,["string","array"]))throw new Mf("Expected second argument to be of type array or string, but found "+ff(Pf(i))+" instead.");if(this.fromIndex){var o=this.fromIndex.evaluate(t);return i.indexOf(e,o)}return i.indexOf(e)},ev.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},ev.prototype.outputDefined=function(){return!1},ev.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var iv=ev,ov=function(t,e,i,o,n,r){this.inputType=t,this.type=e,this.input=i,this.cases=o,this.outputs=n,this.otherwise=r};ov.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var i,o;e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType);for(var n={},r=[],a=2;a<t.length-1;a+=2){var s=t[a],l=t[a+1];Array.isArray(s)||(s=[s]);var u=e.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(var p=0,h=s;p<h.length;p+=1){var d=h[p];if("number"!=typeof d&&"string"!=typeof d)return u.error("Branch labels must be numbers or strings.");if("number"==typeof d&&Math.abs(d)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,Pf(d)))return null}else i=Pf(d);if(void 0!==n[String(d)])return u.error("Branch labels must be unique.");n[String(d)]=r.length}var c=e.parse(l,a,o);if(!c)return null;o=o||c.type,r.push(c)}var g=e.parse(t[1],1,pf);if(!g)return null;var f=e.parse(t[t.length-1],t.length-1,o);return f?"value"!==g.type.kind&&e.concat(1).checkSubtype(i,g.type)?null:new ov(i,o,g,n,r,f):null},ov.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(Pf(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},ov.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},ov.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},ov.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],i=[],o={},n=0,r=Object.keys(this.cases).sort();n<r.length;n+=1){var a=r[n];void 0===(h=o[this.cases[a]])?(o[this.cases[a]]=i.length,i.push([this.cases[a],[a]])):i[h][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,u=i;l<u.length;l+=1){var p=u[l],h=p[0],d=p[1];1===d.length?e.push(s(d[0])):e.push(d.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var nv=ov,rv=function(t,e,i){this.type=t,this.branches=e,this.otherwise=i};rv.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var o=[],n=1;n<t.length-1;n+=2){var r=e.parse(t[n],n,sf);if(!r)return null;var a=e.parse(t[n+1],n+1,i);if(!a)return null;o.push([r,a]),i=i||a.type}var s=e.parse(t[t.length-1],t.length-1,i);return s?new rv(i,o,s):null},rv.prototype.evaluate=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var o=i[e],n=o[0],r=o[1];if(n.evaluate(t))return r.evaluate(t)}return this.otherwise.evaluate(t)},rv.prototype.eachChild=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var o=i[e],n=o[0],r=o[1];t(n),t(r)}t(this.otherwise)},rv.prototype.outputDefined=function(){return this.branches.every((function(t){return t[0],t[1].outputDefined()}))&&this.otherwise.outputDefined()},rv.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var av=rv,sv=function(t,e,i,o){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=o};sv.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,pf),o=e.parse(t[2],2,rf);if(!i||!o)return null;if(!yf(i.type,[gf(pf),af,pf]))return e.error("Expected first argument to be of type array or string, but found "+ff(i.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,rf);return n?new sv(i.type,i,o,n):null}return new sv(i.type,i,o)},sv.prototype.evaluate=function(t){var e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!_f(e,["string","array"]))throw new Mf("Expected first argument to be of type array or string, but found "+ff(Pf(e))+" instead.");if(this.endIndex){var o=this.endIndex.evaluate(t);return e.slice(i,o)}return e.slice(i)},sv.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},sv.prototype.outputDefined=function(){return!1},sv.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var lv=sv;function uv(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function pv(t,e,i,o){return 0===o.compare(e,i)}function hv(t,e,i){var o="=="!==t&&"!="!==t;return function(){function n(t,e,i){this.type=sf,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return n.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var i=t[0],r=e.parse(t[1],1,pf);if(!r)return null;if(!uv(i,r.type))return e.concat(1).error('"'+i+"\" comparisons are not supported for type '"+ff(r.type)+"'.");var a=e.parse(t[2],2,pf);if(!a)return null;if(!uv(i,a.type))return e.concat(2).error('"'+i+"\" comparisons are not supported for type '"+ff(a.type)+"'.");if(r.type.kind!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+ff(r.type)+"' and '"+ff(a.type)+"'.");o&&("value"===r.type.kind&&"value"!==a.type.kind?r=new Af(a.type,[r]):"value"!==r.type.kind&&"value"===a.type.kind&&(a=new Af(r.type,[a])));var s=null;if(4===t.length){if("string"!==r.type.kind&&"string"!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,hf)))return null}return new n(r,a,s)},n.prototype.evaluate=function(n){var r=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(o&&this.hasUntypedArgument){var s=Pf(r),l=Pf(a);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new Mf('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!o&&this.hasUntypedArgument){var u=Pf(r),p=Pf(a);if("string"!==u.kind||"string"!==p.kind)return e(n,r,a)}return this.collator?i(n,r,a,this.collator.evaluate(n)):e(n,r,a)},n.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},n.prototype.outputDefined=function(){return!0},n.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},n}()}var dv=hv("==",(function(t,e,i){return e===i}),pv),cv=hv("!=",(function(t,e,i){return e!==i}),(function(t,e,i,o){return!pv(0,e,i,o)})),gv=hv("<",(function(t,e,i){return e<i}),(function(t,e,i,o){return o.compare(e,i)<0})),fv=hv(">",(function(t,e,i){return e>i}),(function(t,e,i,o){return o.compare(e,i)>0})),mv=hv("<=",(function(t,e,i){return e<=i}),(function(t,e,i,o){return o.compare(e,i)<=0})),vv=hv(">=",(function(t,e,i){return e>=i}),(function(t,e,i,o){return o.compare(e,i)>=0})),yv=function(t,e,i,o,n){this.type=af,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=o,this.maxFractionDigits=n};yv.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,rf);if(!i)return null;var o=t[2];if("object"!=typeof o||Array.isArray(o))return e.error("NumberFormat options argument must be an object.");var n=null;if(o.locale&&!(n=e.parse(o.locale,1,af)))return null;var r=null;if(o.currency&&!(r=e.parse(o.currency,1,af)))return null;var a=null;if(o["min-fraction-digits"]&&!(a=e.parse(o["min-fraction-digits"],1,rf)))return null;var s=null;return o["max-fraction-digits"]&&!(s=e.parse(o["max-fraction-digits"],1,rf))?null:new yv(i,n,r,a,s)},yv.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},yv.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},yv.prototype.outputDefined=function(){return!1},yv.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var _v=yv,bv=function(t){this.type=rf,this.input=t};bv.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error("Expected argument of type string or array, but found "+ff(i.type)+" instead."):new bv(i):null},bv.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new Mf("Expected value to be of type string or array, but found "+ff(Pf(e))+" instead.")},bv.prototype.eachChild=function(t){t(this.input)},bv.prototype.outputDefined=function(){return!1},bv.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var xv={"==":dv,"!=":cv,">":fv,"<":gv,">=":vv,"<=":mv,array:Af,at:Jm,boolean:Af,case:av,coalesce:Ym,collator:$f,format:Gf,image:Bf,in:tv,"index-of":iv,interpolate:Xm,"interpolate-hcl":Xm,"interpolate-lab":Xm,length:bv,let:Hm,literal:Rf,match:nv,number:Af,"number-format":_v,object:Af,slice:lv,step:Cm,string:Af,"to-boolean":Wf,"to-color":Wf,"to-number":Wf,"to-string":Wf,var:_m,within:gm};function kv(t,e){var i=e[0],o=e[1],n=e[2],r=e[3];i=i.evaluate(t),o=o.evaluate(t),n=n.evaluate(t);var a=r?r.evaluate(t):1,s=Ef(i,o,n,a);if(s)throw new Mf(s);return new Wg(i/255*a,o/255*a,n/255*a,a)}function wv(t,e){return t in e}function Sv(t,e){var i=e[t];return void 0===i?null:i}function Cv(t){return{type:t}}Zf.register(xv,{error:[{kind:"error"},[af],function(t,e){var i=e[0];throw new Mf(i.evaluate(t))}],typeof:[af,[pf],function(t,e){return ff(Pf(e[0].evaluate(t)))}],"to-rgba":[gf(rf,4),[lf],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[lf,[rf,rf,rf],kv],rgba:[lf,[rf,rf,rf,rf],kv],has:{type:sf,overloads:[[[af],function(t,e){return wv(e[0].evaluate(t),t.properties())}],[[af,uf],function(t,e){var i=e[0],o=e[1];return wv(i.evaluate(t),o.evaluate(t))}]]},get:{type:pf,overloads:[[[af],function(t,e){return Sv(e[0].evaluate(t),t.properties())}],[[af,uf],function(t,e){var i=e[0],o=e[1];return Sv(i.evaluate(t),o.evaluate(t))}]]},"feature-state":[pf,[af],function(t,e){return Sv(e[0].evaluate(t),t.featureState||{})}],properties:[uf,[],function(t){return t.properties()}],"geometry-type":[af,[],function(t){return t.geometryType()}],id:[pf,[],function(t){return t.id()}],zoom:[rf,[],function(t){return t.globals.zoom}],pitch:[rf,[],function(t){return t.globals.pitch||0}],"distance-from-center":[rf,[],function(t){return t.distanceFromCenter()}],"heatmap-density":[rf,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[rf,[],function(t){return t.globals.lineProgress||0}],"sky-radial-progress":[rf,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[pf,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[rf,Cv(rf),function(t,e){for(var i=0,o=0,n=e;o<n.length;o+=1){i+=n[o].evaluate(t)}return i}],"*":[rf,Cv(rf),function(t,e){for(var i=1,o=0,n=e;o<n.length;o+=1){i*=n[o].evaluate(t)}return i}],"-":{type:rf,overloads:[[[rf,rf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)-o.evaluate(t)}],[[rf],function(t,e){return-e[0].evaluate(t)}]]},"/":[rf,[rf,rf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)/o.evaluate(t)}],"%":[rf,[rf,rf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)%o.evaluate(t)}],ln2:[rf,[],function(){return Math.LN2}],pi:[rf,[],function(){return Math.PI}],e:[rf,[],function(){return Math.E}],"^":[rf,[rf,rf],function(t,e){var i=e[0],o=e[1];return Math.pow(i.evaluate(t),o.evaluate(t))}],sqrt:[rf,[rf],function(t,e){var i=e[0];return Math.sqrt(i.evaluate(t))}],log10:[rf,[rf],function(t,e){var i=e[0];return Math.log(i.evaluate(t))/Math.LN10}],ln:[rf,[rf],function(t,e){var i=e[0];return Math.log(i.evaluate(t))}],log2:[rf,[rf],function(t,e){var i=e[0];return Math.log(i.evaluate(t))/Math.LN2}],sin:[rf,[rf],function(t,e){var i=e[0];return Math.sin(i.evaluate(t))}],cos:[rf,[rf],function(t,e){var i=e[0];return Math.cos(i.evaluate(t))}],tan:[rf,[rf],function(t,e){var i=e[0];return Math.tan(i.evaluate(t))}],asin:[rf,[rf],function(t,e){var i=e[0];return Math.asin(i.evaluate(t))}],acos:[rf,[rf],function(t,e){var i=e[0];return Math.acos(i.evaluate(t))}],atan:[rf,[rf],function(t,e){var i=e[0];return Math.atan(i.evaluate(t))}],min:[rf,Cv(rf),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[rf,Cv(rf),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[rf,[rf],function(t,e){var i=e[0];return Math.abs(i.evaluate(t))}],round:[rf,[rf],function(t,e){var i=e[0].evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[rf,[rf],function(t,e){var i=e[0];return Math.floor(i.evaluate(t))}],ceil:[rf,[rf],function(t,e){var i=e[0];return Math.ceil(i.evaluate(t))}],"filter-==":[sf,[af,pf],function(t,e){var i=e[0],o=e[1];return t.properties()[i.value]===o.value}],"filter-id-==":[sf,[pf],function(t,e){var i=e[0];return t.id()===i.value}],"filter-type-==":[sf,[af],function(t,e){var i=e[0];return t.geometryType()===i.value}],"filter-<":[sf,[af,pf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n<r}],"filter-id-<":[sf,[pf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o<n}],"filter->":[sf,[af,pf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n>r}],"filter-id->":[sf,[pf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o>n}],"filter-<=":[sf,[af,pf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[sf,[pf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o<=n}],"filter->=":[sf,[af,pf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[sf,[pf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o>=n}],"filter-has":[sf,[pf],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[sf,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[sf,[gf(af)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[sf,[gf(pf)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[sf,[af,gf(pf)],function(t,e){var i=e[0];return e[1].value.indexOf(t.properties()[i.value])>=0}],"filter-in-large":[sf,[af,gf(pf)],function(t,e){var i=e[0],o=e[1];return function(t,e,i,o){for(;i<=o;){var n=i+o>>1;if(e[n]===t)return!0;e[n]>t?o=n-1:i=n+1}return!1}(t.properties()[i.value],o.value,0,o.value.length-1)}],all:{type:sf,overloads:[[[sf,sf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)&&o.evaluate(t)}],[Cv(sf),function(t,e){for(var i=0,o=e;i<o.length;i+=1){if(!o[i].evaluate(t))return!1}return!0}]]},any:{type:sf,overloads:[[[sf,sf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)||o.evaluate(t)}],[Cv(sf),function(t,e){for(var i=0,o=e;i<o.length;i+=1){if(o[i].evaluate(t))return!0}return!1}]]},"!":[sf,[sf],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[sf,[af],function(t,e){var i=e[0],o=t.globals&&t.globals.isSupportedScript;return!o||o(i.evaluate(t))}],upcase:[af,[af],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[af,[af],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[af,Cv(pf),function(t,e){return e.map((function(e){return Of(e.evaluate(t))})).join("")}],"resolved-locale":[af,[hf],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var zv=xv;function Ev(t){return{result:"success",value:t}}function Tv(t){return{result:"error",value:t}}function Pv(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}var Ov=function(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new Kf,this._defaultValue=e?"color"===(i=e).type&&Pv(i.default)?new Wg(0,0,0,0):"color"===i.type?Wg.parse(i.default)||null:void 0===i.default?null:i.default:null,this._enumValues=e&&"enum"===e.type?e.values:null};function Fv(t,e){var i=new xm(zv,[],e?function(t){var e={color:lf,string:af,number:rf,enum:af,boolean:sf,formatted:df,resolvedImage:cf};if("array"===t.type)return gf(e[t.value]||pf,t.length);return e[t.type]}(e):void 0),o=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return o?Ev(new Ov(o,e)):Tv(i.errors)}Ov.prototype.evaluateWithoutErrorHandling=function(t,e,i,o,n,r,a,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=o||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)},Ov.prototype.evaluate=function(t,e,i,o,n,r,a,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=o||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null;try{var l=this.expression.evaluate(this._evaluator);if(null==l||"number"==typeof l&&l!=l)return this._defaultValue;if(this._enumValues&&!(l in this._enumValues))throw new Mf("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(l)+" instead.");return l}catch(f_){return this._warningHistory[f_.message]||(this._warningHistory[f_.message]=!0,"undefined"!=typeof console&&console.warn(f_.message)),this._defaultValue}};var Rv=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!mm(e.expression)};Rv.prototype.evaluateWithoutErrorHandling=function(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)},Rv.prototype.evaluate=function(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)};var Iv=function(t,e,i,o){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!mm(e.expression),this.interpolationType=o};function Mv(t,e){if("error"===(t=Fv(t,e)).result)return t;var i,o=t.value.expression,n=fm(o);if(!n&&("data-driven"!==(i=e)["property-type"]&&"cross-faded-data-driven"!==i["property-type"]))return Tv([new tf("","data expressions not supported")]);var r=vm(o,["zoom","pitch","distance-from-center"]);if(!r&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return Tv([new tf("","zoom expressions not supported")]);var a=jv(o);if(!a&&!r)return Tv([new tf("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof tf)return Tv([a]);if(a instanceof Xm&&!function(t){return!!t.expression&&t.expression.interpolated}(e))return Tv([new tf("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Ev(new Rv(n?"constant":"source",t.value));var s=a instanceof Xm?a.interpolation:void 0;return Ev(new Iv(n?"camera":"composite",t.value,a.labels,s))}function jv(t){var e=null;if(t instanceof Hm)e=jv(t.result);else if(t instanceof Ym)for(var i=0,o=t.args;i<o.length;i+=1){var n=o[i];if(e=jv(n))break}else(t instanceof Cm||t instanceof Xm)&&t.input instanceof Zf&&"zoom"===t.input.name&&(e=t);return e instanceof tf||t.eachChild((function(t){var i=jv(t);i instanceof tf?e=i:!e&&i?e=new tf("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new tf("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Dv(t){if(Array.isArray(t))return t.map(Dv);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var i in t)e[i]=Dv(t[i]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}Iv.prototype.evaluateWithoutErrorHandling=function(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)},Iv.prototype.evaluate=function(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)},Iv.prototype.interpolationFactor=function(t,e,i){return this.interpolationType?Xm.interpolationFactor(this.interpolationType,t,e,i):0};var Av={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},fog:{type:"fog"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},projection:{type:"projection"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{},sky:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_symbol:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Camera"},pitch:{group:"Camera"},"distance-from-center":{group:"Camera"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"sky-radial-progress":{group:"sky"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},projection:{name:{type:"enum",values:{albers:{},equalEarth:{},equirectangular:{},lambertConformalConic:{},mercator:{},naturalEarth:{},winkelTripel:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};function Lv(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,i=t.slice(1);e<i.length;e+=1){var o=i[e];if(!Lv(o)&&"boolean"!=typeof o)return!1}return!0;default:return!0}}function Gv(t,e){if(void 0===e&&(e="fill"),null==t)return{filter:function(){return!0},needGeometry:!1,needFeature:!1};Lv(t)||(t=Xv(t));var i=t,o=!0;try{o=function(t){if(!Vv(t))return t;var e=Dv(t);return Bv(e),e=Nv(e)}(i)}catch(f_){console.warn("Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n"+JSON.stringify(i,null,2)+"\n ")}var n=Av["filter_"+e],r=Fv(o,n),a=null;if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));a=function(t,e,i){return r.value.evaluate(t,e,{},i)};var s=null,l=null;if(o!==i){var u=Fv(i,n);if("error"===u.result)throw new Error(u.value.map((function(t){return t.key+": "+t.message})).join(", "));s=function(t,e,i,o,n){return u.value.evaluate(t,e,{},i,void 0,void 0,o,n)},l=!fm(u.value.expression)}return{filter:a=a,dynamicFilter:s||void 0,needGeometry:Uv(o),needFeature:!!l}}function Nv(t){if(!Array.isArray(t))return t;var e=function(t){if(qv.has(t[0]))for(var e=1;e<t.length;e++){if(Vv(t[e]))return!0}return t}(t);return!0===e?e:e.map((function(t){return Nv(t)}))}function Bv(t){var e=!1,i=[];if("case"===t[0]){for(var o=1;o<t.length-1;o+=2)e=e||Vv(t[o]),i.push(t[o+1]);i.push(t[t.length-1])}else if("match"===t[0]){e=e||Vv(t[1]);for(var n=2;n<t.length-1;n+=2)i.push(t[n+1]);i.push(t[t.length-1])}else if("step"===t[0]){e=e||Vv(t[1]);for(var r=1;r<t.length-1;r+=2)i.push(t[r+1])}e&&(t.length=0,t.push.apply(t,["any"].concat(i)));for(var a=1;a<t.length;a++)Bv(t[a])}function Vv(t){if(!Array.isArray(t))return!1;if("pitch"===(e=t[0])||"distance-from-center"===e)return!0;for(var e,i=1;i<t.length;i++){if(Vv(t[i]))return!0}return!1}var qv=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function Wv(t,e){return t<e?-1:t>e?1:0}function Uv(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e<t.length;e++)if(Uv(t[e]))return!0;return!1}function Xv(t){if(!t)return!0;var e,i=t[0];return t.length<=1?"any"!==i:"=="===i?Kv(t[1],t[2],"=="):"!="===i?Hv(Kv(t[1],t[2],"==")):"<"===i||">"===i||"<="===i||">="===i?Kv(t[1],t[2],i):"any"===i?(e=t.slice(1),["any"].concat(e.map(Xv))):"all"===i?["all"].concat(t.slice(1).map(Xv)):"none"===i?["all"].concat(t.slice(1).map(Xv).map(Hv)):"in"===i?Yv(t[1],t.slice(2)):"!in"===i?Hv(Yv(t[1],t.slice(2))):"has"===i?Zv(t[1]):"!has"===i?Hv(Zv(t[1])):"within"!==i||t}function Kv(t,e,i){switch(t){case"$type":return["filter-type-"+i,e];case"$id":return["filter-id-"+i,e];default:return["filter-"+i,t,e]}}function Yv(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(Wv)]]:["filter-in-small",t,["literal",e]]}}function Zv(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Hv(t){return["!",t]}var $v=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Jv(t,e){var i={};for(var o in t)"ref"!==o&&(i[o]=t[o]);return $v.forEach((function(t){t in e&&(i[t]=e[t])})),i}var Qv={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},ty=/(italic|oblique)$/i,ey={},iy=function(t,e,i){var o=ey[t];if(!o){Array.isArray(t)||(t=[t]);for(var n=400,r="normal",a=[],s=0,l=t.length;s<l;++s){var u=t[s].split(" "),p=u[u.length-1].toLowerCase();for(var h in"normal"==p||"italic"==p||"oblique"==p?(r=p,u.pop(),p=u[u.length-1].toLowerCase()):ty.test(p)&&(p=p.replace(ty,""),r=u[u.length-1].replace(p,"")),Qv){var d=u.length>1?u[u.length-2].toLowerCase():"";if(p==h||p==h.replace("-","")||d+"-"+p==h){n=Qv[h],u.pop(),d&&h.startsWith(d)&&u.pop();break}}"number"==typeof p&&(n=p);var c=u.join(" ").replace("Klokantech Noto Sans","Noto Sans");-1!==c.indexOf(" ")&&(c='"'+c+'"'),a.push(c)}o=ey[t]=[r,n,a]}return o[0]+" "+o[1]+" "+e+"px"+(i?"/"+i:"")+" "+o[2]};function oy(t){return t*Math.PI/180}var ny=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function ry(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var i=document.createElement("canvas");return i.width=t,i.height=e,i}var ay,sy=Array(256).join(" ");function ly(t,e){if(e>=.05){for(var i="",o=t.split("\n"),n=sy.slice(0,Math.round(e/.1)),r=0,a=o.length;r<a;++r)r>0&&(i+="\n"),i+=o[r].split("").join(n);return i}return t}function uy(){return ay||(ay=ry(1,1).getContext("2d")),ay}function py(t,e){return uy().measureText(t).width+(t.length-1)*e}var hy={};function dy(t,e,i,o){if(-1!==t.indexOf("\n")){for(var n=t.split("\n"),r=[],a=0,s=n.length;a<s;++a)r.push(dy(n[a],e,i,o));return r.join("\n")}var l=i+","+e+","+t+","+o,u=hy[l];if(!u){var p=t.split(" ");if(p.length>1){var h=uy();h.font=e;for(var d=h.measureText("M").width*i,c="",g=[],f=0,m=p.length;f<m;++f){var v=p[f],y=c+(c?" ":"")+v;py(y,o)<=d?c=y:(c&&g.push(c),c=v)}c&&g.push(c);for(var _=0,b=g.length;_<b&&b>1;++_){var x=g[_];if(py(x,o)<.35*d){var k=_>0?py(g[_-1],o):1/0,w=_<b-1?py(g[_+1],o):1/0;g.splice(_,1),b-=1,k<w?(g[_-1]+=" "+x,_-=1):g[_]=x+" "+g[_]}}for(var S=0,C=g.length-1;S<C;++S){var z=g[S],E=g[S+1];if(py(z,o)>.7*d&&py(E,o)<.6*d){var T=z.split(" "),P=T.pop();py(P,o)<.2*d&&(g[S]=T.join(" "),g[S+1]=P+" "+E),C-=1}}u=g.join("\n")}else u=t;u=ly(u,o),hy[l]=u}return u}var cy,gy,fy={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},my={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},vy={},yy={zoom:0};function _y(t,e,i,o,n,r,a){var s=t.id;r||(r={},console.warn("No functionCache provided to getValue()")),r[s]||(r[s]={});var l,u=r[s];if(!u[i]){var p=(t[e]||vy)[i],h=Av[e+"_"+t.type][i];void 0===p&&(p=h.default);var d=(l=p,Array.isArray(l)&&l.length>0&&"string"==typeof l[0]&&l[0]in zv);if(!d&&Pv(p)&&(p=Xg(p,h),d=!0),d){var c=function(t,e){var i=Mv(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}(p,h);u[i]=c.evaluate.bind(c)}else"color"==h.type&&(p=Wg.parse(p)),u[i]=function(){return p}}return yy.zoom=o,u[i](yy,n,a)}function by(t,e,i,o,n){return n||console.warn("No filterCache provided to evaluateFilter()"),t in n||(n[t]=Gv(e).filter),yy.zoom=o,n[t](yy,i)}function xy(t,e){if(t){if(0===t.a||0===e)return;var i=t.a;return e=void 0===e?1:e,0===i?"transparent":"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*e+")"}return t}var ky=/^([^]*)\{(.*)\}([^]*)$/;function wy(t,e){var i;do{if(i=t.match(ky)){var o=e[i[2]]||"";t=i[1]+o+i[3]}}while(i);return t}function Sy(t,e,i,o,n,r,a){if(void 0===o&&(o=ny),void 0===n&&(n=void 0),void 0===r&&(r=void 0),void 0===a&&(a=void 0),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var s,l;if(r)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){s=u,l=[u.width,u.height],t.changed(),u.onload=null},u.src=r}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var p=self;p.postMessage({action:"loadImage",src:r}),p.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(s=t.data.image,l=[s.width,s.height])}))}for(var h,d=function(t){t=t.slice();for(var e=Object.create(null),i=0;i<t.length;i++)e[t[i].id]=t[i];for(var o=0;o<t.length;o++)"ref"in t[o]&&(t[o]=Jv(t[o],e[t[o].ref]));return t}(e.layers),c={},g=[],f={},m={},v={},y={},_=0,b=d.length;_<b;++_){var x=d[_],k=x.id;if("string"==typeof i&&x.source==i||-1!==i.indexOf(k)){var w=x["source-layer"];if(h){if(x.source!==h)throw new Error('Layer "'+k+'" does not use source "'+h)}else{h=x.source;var S=e.sources[h];if(!S)throw new Error('Source "'+h+'" is not defined');var C=S.type;if("vector"!==C&&"geojson"!==C)throw new Error('Source "'+h+'" is not of type "vector" or "geojson", but "'+C+'"')}var z=c[w];z||(z=[],c[w]=z),z.push({layer:x,index:_}),g.push(k)}}var E=new $s,T=new Os,P=[],O=function(e,i){var r=e.getProperties(),u=c[r.layer];if(u){var p=o.indexOf(i);-1==p&&(p=function(t,e){for(var i=0,o=e.length;i<o;++i)if(e[i]<t&&i+1<o){var n=e[i]/e[i+1];return i+Math.log(e[i]/t)/Math.log(n)}return o-1}(i,o));for(var h=fy[e.getGeometry().getType()],d={properties:r,type:h},g=t.get("mapbox-featurestate")[e.getId()],_=-1,b=0,x=u.length;b<x;++b){var k=u[b],w=k.layer,S=w.id,C=w.layout||vy,z=w.paint||vy;if(!("none"===C.visibility||"minzoom"in w&&p<w.minzoom||"maxzoom"in w&&p>=w.maxzoom)){var O=w.filter;if(!O||by(S,O,d,p,y)){var F=void 0,R=void 0,I=void 0,M=void 0,j=void 0,D=void 0,A=k.index;if(3==h&&("fill"==w.type||"fill-extrusion"==w.type))if(R=_y(w,"paint",w.type+"-opacity",p,d,v,g),w.type+"-pattern"in z){var L=_y(w,"paint",w.type+"-pattern",p,d,v,g);if(L){var G="string"==typeof L?wy(L,r):L.toString();if(s&&n&&n[G]){++_,(D=P[_])&&D.getFill()&&!D.getStroke()&&!D.getText()||(D=new ll({fill:new Os}),P[_]=D),I=D.getFill(),D.setZIndex(A);var N=G+"."+R,B=m[N];if(!B){var V=n[G],q=ry(V.width,V.height),W=q.getContext("2d");W.globalAlpha=R,W.drawImage(s,V.x,V.y,V.width,V.height,0,0,V.width,V.height),B=W.createPattern(q,"repeat"),m[N]=B}I.setColor(B)}}}else F=xy(_y(w,"paint",w.type+"-color",p,d,v,g),R),w.type+"-outline-color"in z&&(j=xy(_y(w,"paint",w.type+"-outline-color",p,d,v,g),R)),j||(j=F),(F||j)&&(++_,(!(D=P[_])||F&&!D.getFill()||!F&&D.getFill()||j&&!D.getStroke()||!j&&D.getStroke()||D.getText())&&(D=new ll({fill:F?new Os:void 0,stroke:j?new $s:void 0}),P[_]=D),F&&(I=D.getFill()).setColor(F),j&&((M=D.getStroke()).setColor(j),M.setWidth(.5)),D.setZIndex(A));if(1!=h&&"line"==w.type){F=!("line-pattern"in z)&&"line-color"in z?xy(_y(w,"paint","line-color",p,d,v,g),_y(w,"paint","line-opacity",p,d,v,g)):void 0;var U=_y(w,"paint","line-width",p,d,v,g);F&&U>0&&(++_,(D=P[_])&&D.getStroke()&&!D.getFill()&&!D.getText()||(D=new ll({stroke:new $s}),P[_]=D),(M=D.getStroke()).setLineCap(_y(w,"layout","line-cap",p,d,v,g)),M.setLineJoin(_y(w,"layout","line-join",p,d,v,g)),M.setMiterLimit(_y(w,"layout","line-miter-limit",p,d,v,g)),M.setColor(F),M.setWidth(U),M.setLineDash(z["line-dasharray"]?_y(w,"paint","line-dasharray",p,d,v,g).map((function(t){return t*U})):null),D.setZIndex(A))}var X=!1,K=null,Y=0,Z=void 0,H=void 0,$=void 0;if((1==h||2==h)&&"icon-image"in C){var J=_y(w,"layout","icon-image",p,d,v,g);if(J){Z="string"==typeof J?wy(J,r):J.toString();var Q=void 0;if(s&&n&&n[Z]){var tt=_y(w,"layout","icon-rotation-alignment",p,d,v,g);if(2==h){var et=e.getGeometry();if(et.getFlatMidpoint||et.getFlatMidpoints){var it=et.getExtent();if(Math.sqrt(Math.max(Math.pow((it[2]-it[0])/i,2),Math.pow((it[3]-it[1])/i,2)))>150){var ot="MultiLineString"===et.getType()?et.getFlatMidpoints():et.getFlatMidpoint();if(gy||(gy=new jl("Point",cy=[NaN,NaN],[],{},null)),Q=gy,cy[0]=ot[0],cy[1]=ot[1],"line"===_y(w,"layout","symbol-placement",p,d,v,g)&&"map"===tt)for(var nt=et.getStride(),rt=et.getFlatCoordinates(),at=0,st=rt.length-nt;at<st;at+=nt){var lt=rt[at],ut=rt[at+1],pt=rt[at+nt],ht=rt[at+nt+1],dt=Math.min(lt,pt),ct=Math.min(ut,ht),gt=Math.max(lt,pt),ft=Math.max(ut,ht);if(ot[0]>=dt&&ot[0]<=gt&&ot[1]>=ct&&ot[1]<=ft){Y=Math.atan2(ut-ht,pt-lt);break}}}}}if(2!==h||Q){var mt=_y(w,"layout","icon-size",p,d,v,g),vt=void 0!==z["icon-color"]?_y(w,"paint","icon-color",p,d,v,g):null;if(!vt||0!==vt.a){var yt=Z+"."+mt;if(null!==vt&&(yt+="."+vt),!(H=f[yt])){var _t=n[Z];H=new Hs({color:vt?[255*vt.r,255*vt.g,255*vt.b,vt.a]:void 0,img:s,imgSize:l,size:[_t.width,_t.height],offset:[_t.x,_t.y],rotateWithView:"map"===tt,scale:mt/_t.pixelRatio,displacement:"icon-offset"in C?_y(w,"layout","icon-offset",p,d,v,g).map((function(t){return-t*_t.pixelRatio})):void 0}),f[yt]=H}}H&&(++_,(D=P[_])&&D.getImage()&&!D.getFill()&&!D.getStroke()||(D=new ll,P[_]=D),D.setGeometry(Q),H.setRotation(Y+oy(_y(w,"layout","icon-rotate",p,d,v,g))),H.setOpacity(_y(w,"paint","icon-opacity",p,d,v,g)),H.setAnchor(my[_y(w,"layout","icon-anchor",p,d,v,g)]),D.setImage(H),K=D.getText(),D.setText(void 0),D.setZIndex(A),X=!0,$=!1)}else $=!0}}}if(1==h&&"circle"===w.type){++_,(D=P[_])&&D.getImage()&&!D.getFill()&&!D.getStroke()||(D=new ll,P[_]=D);var bt="circle-radius"in z?_y(w,"paint","circle-radius",p,d,v,g):5,xt=xy(_y(w,"paint","circle-stroke-color",p,d,v,g),_y(w,"paint","circle-stroke-opacity",p,d,v,g)),kt=xy(_y(w,"paint","circle-color",p,d,v,g),_y(w,"paint","circle-opacity",p,d,v,g)),wt=_y(w,"paint","circle-stroke-width",p,d,v,g),St=bt+"."+xt+"."+kt+"."+wt;(H=f[St])||(H=new il({radius:bt,stroke:xt&&wt>0?new $s({width:wt,color:xt}):void 0,fill:kt?new Os({color:kt}):void 0}),f[St]=H),D.setImage(H),K=D.getText(),D.setText(void 0),D.setGeometry(void 0),D.setZIndex(A),X=!0}var Ct=void 0,zt=void 0,Et=void 0,Tt=void 0,Pt=void 0,Ot=void 0;if("text-field"in C){Tt=Math.round(_y(w,"layout","text-size",p,d,v,g));var Ft=_y(w,"layout","text-font",p,d,v,g);Et=_y(w,"layout","text-line-height",p,d,v,g),(zt=iy(a?a(Ft):Ft,Tt,Et)).includes("sans-serif")||(zt+=",sans-serif"),Pt=_y(w,"layout","text-letter-spacing",p,d,v,g),Ot=_y(w,"layout","text-max-width",p,d,v,g);var Rt=_y(w,"layout","text-field",p,d,v,g);Ct="object"==typeof Rt&&Rt.sections?1===Rt.sections.length?Rt.toString():Rt.sections.reduce((function(t,e,i){var o=e.fontStack?e.fontStack.split(","):Ft,n=iy(a?a(o):o,Tt*(e.scale||1),Et),r=e.text;if("\n"===r)return t.push("\n",""),t;if(2!=h){for(var s=0,l=(r=dy(r,n,Ot,Pt).split("\n")).length;s<l;++s)s>0&&t.push("\n",""),t.push(r[s],n);return t}t.push(ly(r,Pt),n)}),[]):wy(Rt,r).trim(),R=_y(w,"paint","text-opacity",p,d,v,g)}if(Ct&&R&&!$){X||(++_,(D=P[_])&&D.getText()&&!D.getFill()&&!D.getStroke()||(D=new ll,P[_]=D),D.setImage(void 0),D.setGeometry(void 0)),D.getText()||D.setText(K||new hl({padding:[2,2,2,2]})),K=D.getText();var It=C["text-transform"];"uppercase"==It?Ct=Array.isArray(Ct)?Ct.map((function(t,e){return e%2?t:t.toUpperCase()})):Ct.toUpperCase():"lowercase"==It&&(Ct=Array.isArray(Ct)?Ct.map((function(t,e){return e%2?t:t.toLowerCase()})):Ct.toLowerCase());var Mt=Array.isArray(Ct)?Ct:2==h?ly(Ct,Pt):dy(Ct,zt,Ot,Pt);K.setText(Mt),K.setFont(zt),K.setRotation(oy(_y(w,"layout","text-rotate",p,d,v,g)));var jt=_y(w,"layout","text-anchor",p,d,v,g),Dt=X||1==h?"point":_y(w,"layout","symbol-placement",p,d,v,g);K.setPlacement(Dt),K.setOverflow("point"===Dt);var At=_y(w,"paint","text-halo-width",p,d,v,g),Lt=_y(w,"layout","text-offset",p,d,v,g),Gt=_y(w,"paint","text-translate",p,d,v,g),Nt=0,Bt=0;if("point"==Dt){var Vt="center";-1!==jt.indexOf("left")?(Vt="left",Bt=At):-1!==jt.indexOf("right")&&(Vt="right",Bt=-At),K.setTextAlign(Vt);var qt=_y(w,"layout","text-rotation-alignment",p,d,v,g);K.setRotateWithView("map"==qt)}else K.setMaxAngle(oy(_y(w,"layout","text-max-angle",p,d,v,g))*Ct.length/Mt.length),K.setTextAlign(),K.setRotateWithView(!1);var Wt="middle";0==jt.indexOf("bottom")?(Wt="bottom",Nt=-At-.5*(Et-1)*Tt):0==jt.indexOf("top")&&(Wt="top",Nt=At+.5*(Et-1)*Tt),K.setTextBaseline(Wt),K.setOffsetX(Lt[0]*Tt+Bt+Gt[0]),K.setOffsetY(Lt[1]*Tt+Nt+Gt[1]),T.setColor(xy(_y(w,"paint","text-color",p,d,v,g),R)),K.setFill(T);var Ut=xy(_y(w,"paint","text-halo-color",p,d,v,g),R);if(Ut){E.setColor(Ut),At*=2;var Xt=.5*Tt;E.setWidth(At<=Xt?At:Xt),K.setStroke(E)}else K.setStroke(void 0);var Kt=_y(w,"layout","text-padding",p,d,v,g),Yt=K.getPadding();Kt!==Yt[0]&&(Yt[0]=Kt,Yt[1]=Kt,Yt[2]=Kt,Yt[3]=Kt),D.setZIndex(A)}}}}return _>-1?(P.length=_+1,P):void 0}};return t.setStyle(O),t.set("mapbox-source",h),t.set("mapbox-layers",g),t.set("mapbox-featurestate",{}),O}new Ps;f`.ol-box {
44
+ var Gc=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function Nc(t,e){return t>e?1:t<e?-1:0}function Bc(t,e,i){for(var o=new Gc(null,null),n=o,r=o;;){var a=i(t,e.key);if(a<0){if(null===e.left)break;if(i(t,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,null===(e=s).left)break}r.left=e,r=e,e=e.left}else{if(!(a>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){s=e.right;if(e.right=s.left,s.left=e,null===(e=s).right)break}n.right=e,n=e,e=e.right}}return n.right=e.left,r.left=e.right,e.left=o.right,e.right=o.left,e}function Vc(t,e,i,o){var n=new Gc(t,e);if(null===i)return n.left=n.right=null,n;var r=o(t,(i=Bc(t,i,o)).key);return r<0?(n.left=i.left,n.right=i,i.left=null):r>=0&&(n.right=i.right,n.left=i,i.right=null),n}function qc(t,e,i){var o=null,n=null;if(e){var r=i((e=Bc(t,e,i)).key,t);0===r?(o=e.left,n=e.right):r<0?(n=e.right,e.right=null,o=e):(o=e.left,e.left=null,n=e)}return{left:o,right:n}}function Wc(t,e,i,o,n){if(t){o(e+(i?"└── ":"├── ")+n(t)+"\n");var r=e+(i?" ":"│ ");t.left&&Wc(t.left,r,!1,o,n),t.right&&Wc(t.right,r,!0,o,n)}}var Uc=function(){function t(t){void 0===t&&(t=Nc),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=Vc(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new Gc(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,n=Bc(t,this._root,o),r=o(t,n.key);return 0===r?this._root=n:(r<0?(i.left=n.left,i.right=n,n.left=null):r>0&&(i.right=n.right,i.left=n,n.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,i){var o;return null===e?null:0===i(t,(e=Bc(t,e,i)).key)?(null===e.left?o=e.right:(o=Bc(t,e.left,i)).right=e.right,this._size--,o):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Bc(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,i=this._comparator;e;){var o=i(t,e.key);if(0===o)return e;e=o<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=Bc(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,i=this._comparator;e;){var o=i(t,e.key);if(0===o)return!0;e=o<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,o=[],n=!1;!n;)null!==i?(o.push(i),i=i.left):0!==o.length?(i=o.pop(),t.call(e,i),i=i.right):n=!0;return this},t.prototype.range=function(t,e,i,o){for(var n=[],r=this._comparator,a=this._root;0!==n.length||a;)if(a)n.push(a),a=a.left;else{if(r((a=n.pop()).key,e)>0)break;if(r(a.key,t)>=0&&i.call(o,a))return this;a=a.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var i=e.key;return t.push(i)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var i=e.data;return t.push(i)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,i=!1,o=0,n=[];!i;)if(e)n.push(e),e=e.left;else if(n.length>0){if(e=n.pop(),o===t)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(t){var e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){var e=t,i=[],o=!1,n=new Gc(null,null),r=n;for(;!o;)e?(i.push(e),e=e.left):i.length>0?e=(e=r=r.next=i.pop()).right:o=!0;return r.next=null,n.next}(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var o=t.length,n=this._comparator;if(i&&Yc(t,e,0,o-1,n),null===this._root)this._root=Xc(t,e,0,o),this._size=o;else{var r=function(t,e,i){var o=new Gc(null,null),n=o,r=t,a=e;for(;null!==r&&null!==a;)i(r.key,a.key)<0?(n.next=r,r=r.next):(n.next=a,a=a.next),n=n.next;null!==r?n.next=r:null!==a&&(n.next=a);return o.next}(this.toList(),function(t,e){for(var i=new Gc(null,null),o=i,n=0;n<t.length;n++)o=o.next=new Gc(t[n],e[n]);return o.next=null,i.next}(t,e),n);o=this._size+o,this._root=Kc({head:r},0,o)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return Wc(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var o=this._comparator,n=qc(t,this._root,o),r=n.left,a=n.right;o(t,e)<0?a=Vc(e,i,a,o):r=Vc(e,i,r,o),this._root=function(t,e,i){return null===e?t:(null===t||((e=Bc(t.key,e,i)).left=t),e)}(r,a,o)},t.prototype.split=function(t){return qc(t,this._root,this._comparator)},t}();function Xc(t,e,i,o){var n=o-i;if(n>0){var r=i+Math.floor(n/2),a=t[r],s=e[r],l=new Gc(a,s);return l.left=Xc(t,e,i,r),l.right=Xc(t,e,r+1,o),l}return null}function Kc(t,e,i){var o=i-e;if(o>0){var n=e+Math.floor(o/2),r=Kc(t,e,n),a=t.head;return a.left=r,t.head=t.head.next,a.right=Kc(t,n+1,i),a}return null}function Yc(t,e,i,o,n){if(!(i>=o)){for(var r=t[i+o>>1],a=i-1,s=o+1;;){do{a++}while(n(t[a],r)<0);do{s--}while(n(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=e[a],e[a]=e[s],e[s]=l}Yc(t,e,i,s,n),Yc(t,e,s+1,o,n)}}function Zc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hc(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function $c(t,e,i){return e&&Hc(t.prototype,e),i&&Hc(t,i),t}var Jc=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},Qc=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var i=t.ll.x<e.ll.x?e.ll.x:t.ll.x,o=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:o,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},tg=Number.EPSILON;void 0===tg&&(tg=Math.pow(2,-52));var eg=tg*tg,ig=function(t,e){if(-tg<t&&t<tg&&-tg<e&&e<tg)return 0;var i=t-e;return i*i<eg*t*e?0:t<e?-1:1},og=function(){function t(){Zc(this,t),this.reset()}return $c(t,[{key:"reset",value:function(){this.xRounder=new ng,this.yRounder=new ng}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),t}(),ng=function(){function t(){Zc(this,t),this.tree=new Uc,this.round(0)}return $c(t,[{key:"round",value:function(t){var e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===ig(e.key,i.key))return this.tree.remove(t),i.key;var o=this.tree.next(e);return null!==o&&0===ig(e.key,o.key)?(this.tree.remove(t),o.key):t}}]),t}(),rg=new og,ag=function(t,e){return t.x*e.y-t.y*e.x},sg=function(t,e){return t.x*e.x+t.y*e.y},lg=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y},r=ag(o,n);return ig(r,0)},ug=function(t){return Math.sqrt(sg(t,t))},pg=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y};return sg(n,o)/ug(n)/ug(o)},hg=function(t,e,i){return 0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i}},dg=function(t,e,i){return 0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)}},cg=function(){function t(e,i){Zc(this,t),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=i}return $c(t,null,[{key:"compare",value:function(e,i){var o=t.comparePoints(e.point,i.point);return 0!==o?o:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:fg.compare(e.segment,i.segment))}},{key:"comparePoints",value:function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}}]),$c(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,i=0,o=e.length;i<o;i++){var n=e[i];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var i=this.point.events[e];if(void 0===i.segment.consumedBy)for(var o=e+1;o<t;o++){var n=this.point.events[o];void 0===n.consumedBy&&(i.otherSE.point.events===n.otherSE.point.events&&i.segment.consume(n.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,i=this.point.events.length;e<i;e++){var o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&t.push(o)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,i=new Map,o=function(o){var n,r,a,s,l,u=o.otherSE;i.set(o,{sine:(n=e.point,r=t.point,a=u.point,s={x:r.x-n.x,y:r.y-n.y},l={x:a.x-n.x,y:a.y-n.y},ag(l,s)/ug(l)/ug(s)),cosine:pg(e.point,t.point,u.point)})};return function(t,e){i.has(t)||o(t),i.has(e)||o(e);var n=i.get(t),r=n.sine,a=n.cosine,s=i.get(e),l=s.sine,u=s.cosine;return r>=0&&l>=0?a<u?1:a>u?-1:0:r<0&&l<0?a<u?-1:a>u?1:0:l<r?-1:l>r?1:0}}}]),t}(),gg=0,fg=function(){function t(e,i,o,n){Zc(this,t),this.id=++gg,this.leftSE=e,e.segment=this,e.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=e,this.rings=o,this.windings=n}return $c(t,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,o=e.leftSE.point.x,n=t.rightSE.point.x,r=e.rightSE.point.x;if(r<i)return 1;if(n<o)return-1;var a=t.leftSE.point.y,s=e.leftSE.point.y,l=t.rightSE.point.y,u=e.rightSE.point.y;if(i<o){if(s<a&&s<l)return 1;if(s>a&&s>l)return-1;var p=t.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(i>o){if(a<s&&a<u)return-1;if(a>s&&a>u)return 1;var d=e.comparePoint(t.leftSE.point);if(0!==d)return d;var c=t.comparePoint(e.rightSE.point);return c<0?1:c>0?-1:1}if(a<s)return-1;if(a>s)return 1;if(n<r){var g=e.comparePoint(t.rightSE.point);if(0!==g)return g}if(n>r){var f=t.comparePoint(e.rightSE.point);if(f<0)return 1;if(f>0)return-1}if(n!==r){var m=l-a,v=n-i,y=u-s,_=r-o;if(m>v&&y<_)return 1;if(m<v&&y>_)return-1}return n>r?1:n<r||l<u?-1:l>u?1:t.id<e.id?-1:t.id>e.id?1:0}}]),$c(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;var n=(t.y-e.y)/o.y,r=e.x+n*o.x;if(t.x===r)return 0;var a=(t.x-e.x)/o.x,s=e.y+a*o.y;return t.y===s?0:t.y<s?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),i=t.bbox(),o=Qc(e,i);if(null===o)return null;var n=this.leftSE.point,r=this.rightSE.point,a=t.leftSE.point,s=t.rightSE.point,l=Jc(e,a)&&0===this.comparePoint(a),u=Jc(i,n)&&0===t.comparePoint(n),p=Jc(e,s)&&0===this.comparePoint(s),h=Jc(i,r)&&0===t.comparePoint(r);if(u&&l)return h&&!p?r:!h&&p?s:null;if(u)return p&&n.x===s.x&&n.y===s.y?null:n;if(l)return h&&r.x===a.x&&r.y===a.y?null:a;if(h&&p)return null;if(h)return r;if(p)return s;var d=function(t,e,i,o){if(0===e.x)return dg(i,o,t.x);if(0===o.x)return dg(t,e,i.x);if(0===e.y)return hg(i,o,t.y);if(0===o.y)return hg(t,e,i.y);var n=ag(e,o);if(0==n)return null;var r={x:i.x-t.x,y:i.y-t.y},a=ag(r,e)/n,s=ag(r,o)/n;return{x:(t.x+s*e.x+(i.x+a*o.x))/2,y:(t.y+s*e.y+(i.y+a*o.y))/2}}(n,this.vector(),a,t.vector());return null===d?null:Jc(o,d)?rg.round(d.x,d.y):null}},{key:"split",value:function(e){var i=[],o=void 0!==e.events,n=new cg(e,!0),r=new cg(e,!1),a=this.rightSE;this.replaceRightSE(r),i.push(r),i.push(n);var s=new t(n,a,this.rings.slice(),this.windings.slice());return cg.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),cg.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),o&&(n.checkForConsuming(),r.checkForConsuming()),i}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}},{key:"consume",value:function(e){for(var i=this,o=e;i.consumedBy;)i=i.consumedBy;for(;o.consumedBy;)o=o.consumedBy;var n=t.compare(i,o);if(0!==n){if(n>0){var r=i;i=o,o=r}if(i.prev===o){var a=i;i=o,o=a}for(var s=0,l=o.rings.length;s<l;s++){var u=o.rings[s],p=o.windings[s],h=i.rings.indexOf(u);-1===h?(i.rings.push(u),i.windings.push(p)):i.windings[h]+=p}o.rings=null,o.windings=null,o.consumedBy=i,o.leftSE.consumedBy=i.leftSE,o.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys,n=0,r=this.rings.length;n<r;n++){var a=this.rings[n],s=this.windings[n],l=e.indexOf(a);-1===l?(e.push(a),i.push(s)):i[l]+=s}for(var u=[],p=[],h=0,d=e.length;h<d;h++)if(0!==i[h]){var c=e[h],g=c.poly;if(-1===p.indexOf(g))if(c.isExterior)u.push(g);else{-1===p.indexOf(g)&&p.push(g);var f=u.indexOf(c.poly);-1!==f&&u.splice(f,1)}}for(var m=0,v=u.length;m<v;m++){var y=u[m].multiPoly;-1===o.indexOf(y)&&o.push(y)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Cg.type){case"union":var i=0===t.length,o=0===e.length;this._isInResult=i!==o;break;case"intersection":var n,r;t.length<e.length?(n=t.length,r=e.length):(n=e.length,r=t.length),this._isInResult=r===Cg.numMultiPolys&&n<r;break;case"xor":var a=Math.abs(t.length-e.length);this._isInResult=a%2==1;break;case"difference":var s=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=s(t)!==s(e);break;default:throw new Error("Unrecognized operation type found ".concat(Cg.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,i,o){var n,r,a,s=cg.comparePoints(e,i);if(s<0)n=e,r=i,a=1;else{if(!(s>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));n=i,r=e,a=-1}return new t(new cg(n,!0),new cg(r,!1),[o],[a])}}]),t}(),mg=function(){function t(e,i,o){if(Zc(this,t),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=i,this.isExterior=o,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var n=rg.round(e[0][0],e[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};for(var r=n,a=1,s=e.length;a<s;a++){if("number"!=typeof e[a][0]||"number"!=typeof e[a][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=rg.round(e[a][0],e[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(fg.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}n.x===r.x&&n.y===r.y||this.segments.push(fg.fromRing(r,n,this))}return $c(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;e<i;e++){var o=this.segments[e];t.push(o.leftSE),t.push(o.rightSE)}return t}}]),t}(),vg=function(){function t(e,i){if(Zc(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new mg(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var o=1,n=e.length;o<n;o++){var r=new mg(e[o],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=i}return $c(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;e<i;e++)for(var o=this.interiorRings[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),yg=function(){function t(e,i){if(Zc(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(a){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var o=0,n=e.length;o<n;o++){var r=new vg(e[o],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=i}return $c(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++)for(var o=this.polys[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),_g=function(){function t(e){Zc(this,t),this.events=e;for(var i=0,o=e.length;i<o;i++)e[i].segment.ringOut=this;this.poly=null}return $c(t,null,[{key:"factory",value:function(e){for(var i=[],o=0,n=e.length;o<n;o++){var r=e[o];if(r.isInResult()&&!r.ringOut){for(var a=null,s=r.leftSE,l=r.rightSE,u=[s],p=s.point,h=[];a=s,s=l,u.push(s),s.point!==p;)for(;;){var d=s.getAvailableLinkedEvents();if(0===d.length){var c=u[0].point,g=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(c.x,",")+" ".concat(c.y,"]. Last matching segment found ends at")+" [".concat(g.x,", ").concat(g.y,"]."))}if(1===d.length){l=d[0].otherSE;break}for(var f=null,m=0,v=h.length;m<v;m++)if(h[m].point===s.point){f=m;break}if(null===f){h.push({index:u.length,point:s.point});var y=s.getLeftmostComparator(a);l=d.sort(y)[0].otherSE;break}var _=h.splice(f)[0],b=u.splice(_.index);b.unshift(b[0].otherSE),i.push(new t(b.reverse()))}i.push(new t(u))}}return i}}]),$c(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],i=1,o=this.events.length-1;i<o;i++){var n=this.events[i].point,r=this.events[i+1].point;0!==lg(n,t,r)&&(e.push(n),t=n)}if(1===e.length)return null;var a=e[0],s=e[1];0===lg(a,t,s)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,p=this.isExteriorRing()?e.length:-1,h=[],d=u;d!=p;d+=l)h.push([e[d].x,e[d].y]);return h}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,i=this.events.length;e<i;e++){var o=this.events[e];cg.compare(t,o)>0&&(t=o)}for(var n=t.segment.prevInResult(),r=n?n.prevInResult():null;;){if(!n)return null;if(!r)return n.ringOut;if(r.ringOut!==n.ringOut)return r.ringOut.enclosingRing()!==n.ringOut?n.ringOut:n.ringOut.enclosingRing();n=r.prevInResult(),r=n?n.prevInResult():null}}}]),t}(),bg=function(){function t(e){Zc(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return $c(t,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,i=this.interiorRings.length;e<i;e++){var o=this.interiorRings[e].getGeom();null!==o&&t.push(o)}return t}}]),t}(),xg=function(){function t(e){Zc(this,t),this.rings=e,this.polys=this._composePolys(e)}return $c(t,[{key:"getGeom",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++){var o=this.polys[e].getGeom();null!==o&&t.push(o)}return t}},{key:"_composePolys",value:function(t){for(var e=[],i=0,o=t.length;i<o;i++){var n=t[i];if(!n.poly)if(n.isExteriorRing())e.push(new bg(n));else{var r=n.enclosingRing();r.poly||e.push(new bg(r)),r.poly.addInterior(n)}}return e}}]),t}(),kg=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fg.compare;Zc(this,t),this.queue=e,this.tree=new Uc(i),this.segments=[]}return $c(t,[{key:"process",value:function(t){var e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;var o=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!o)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var n=o,r=o,a=void 0,s=void 0;void 0===a;)null===(n=this.tree.prev(n))?a=null:void 0===n.key.consumedBy&&(a=n.key);for(;void 0===s;)null===(r=this.tree.next(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);if(t.isLeft){var l=null;if(a){var u=a.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!a.isAnEndpoint(u)))for(var p=this._splitSafely(a,u),h=0,d=p.length;h<d;h++)i.push(p[h])}var c=null;if(s){var g=s.getIntersection(e);if(null!==g&&(e.isAnEndpoint(g)||(c=g),!s.isAnEndpoint(g)))for(var f=this._splitSafely(s,g),m=0,v=f.length;m<v;m++)i.push(f[m])}if(null!==l||null!==c){var y=null;if(null===l)y=c;else if(null===c)y=l;else{y=cg.comparePoints(l,c)<=0?l:c}this.queue.remove(e.rightSE),i.push(e.rightSE);for(var _=e.split(y),b=0,x=_.length;b<x;b++)i.push(_[b])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&s){var k=a.getIntersection(s);if(null!==k){if(!a.isAnEndpoint(k))for(var w=this._splitSafely(a,k),S=0,C=w.length;S<C;S++)i.push(w[S]);if(!s.isAnEndpoint(k))for(var z=this._splitSafely(s,k),E=0,T=z.length;E<T;E++)i.push(z[E])}}this.tree.remove(e)}return i}},{key:"_splitSafely",value:function(t,e){this.tree.remove(t);var i=t.rightSE;this.queue.remove(i);var o=t.split(e);return o.push(i),void 0===t.consumedBy&&this.tree.insert(t),o}}]),t}(),wg="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Sg="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Cg=new(function(){function t(){Zc(this,t)}return $c(t,[{key:"run",value:function(t,e,i){Cg.type=t,rg.reset();for(var o=[new yg(e,!0)],n=0,r=i.length;n<r;n++)o.push(new yg(i[n],!1));if(Cg.numMultiPolys=o.length,"difference"===Cg.type)for(var a=o[0],s=1;s<o.length;)null!==Qc(o[s].bbox,a.bbox)?s++:o.splice(s,1);if("intersection"===Cg.type)for(var l=0,u=o.length;l<u;l++)for(var p=o[l],h=l+1,d=o.length;h<d;h++)if(null===Qc(p.bbox,o[h].bbox))return[];for(var c=new Uc(cg.compare),g=0,f=o.length;g<f;g++)for(var m=o[g].getSweepEvents(),v=0,y=m.length;v<y;v++)if(c.insert(m[v]),c.size>wg)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var _=new kg(c),b=c.size,x=c.pop();x;){var k=x.key;if(c.size===b){var w=k.segment;throw new Error("Unable to pop() ".concat(k.isLeft?"left":"right"," SweepEvent ")+"[".concat(k.point.x,", ").concat(k.point.y,"] from segment #").concat(w.id," ")+"[".concat(w.leftSE.point.x,", ").concat(w.leftSE.point.y,"] -> ")+"[".concat(w.rightSE.point.x,", ").concat(w.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(c.size>wg)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>Sg)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var S=_.process(k),C=0,z=S.length;C<z;C++){var E=S[C];void 0===E.consumedBy&&c.insert(E)}b=c.size,x=c.pop()}rg.reset();var T=_g.factory(_.segments);return new xg(T).getGeom()}}]),t}()),zg=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return Cg.run("union",t,i)};function Eg(t,e,i){void 0===i&&(i={});var o={type:"Feature"};return(0===i.id||i.id)&&(o.id=i.id),i.bbox&&(o.bbox=i.bbox),o.properties=e||{},o.geometry=t,o}function Tg(t){return"Feature"===t.type?t.geometry:t}function Pg(t,e,i){void 0===i&&(i={});var o=Tg(t),n=Tg(e),r=zg(o.coordinates,n.coordinates);return 0===r.length?null:1===r.length?function(t,e,i){void 0===i&&(i={});for(var o=0,n=t;o<n.length;o++){var r=n[o];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<r[r.length-1].length;a++)if(r[r.length-1][a]!==r[0][a])throw new Error("First and last Position are not equivalent.")}return Eg({type:"Polygon",coordinates:t},e,i)}(r[0],i.properties):function(t,e,i){return void 0===i&&(i={}),Eg({type:"MultiPolygon",coordinates:t},e,i)}(r,i.properties)}function Og(t,e){const i=Vo(t),o=Math.round(100*i)/100;let n;return"m2"===e?n=o+" m²":"ha"===e&&(n=o/1e4+" ha"),n}function Fg(t,e,i){const o=e.getExtent();return t.getView().fit(Ji(o,i))}function Rg(t,e){const[i,o,n]=Array.from(Rn(t));return Tn([i,o,n,e])}const Ig=new Rp,Mg=new Rp;function jg(t,e,i){const o=`\n <ogc:Filter>\n <ogc:Contains>\n <ogc:PropertyName>SHAPE</ogc:PropertyName>\n <gml:Point srsName="urn:ogc:def:crs:EPSG::4326">\n <gml:coordinates>${(n=t,a=ln(n,void 0!==r?r:"EPSG:3857","EPSG:4326"),s=a[0],(s<-180||s>180)&&(a[0]=Ve(s+180,360)-180),a).reverse().join(",")}</gml:coordinates>\n </gml:Point>\n </ogc:Contains>\n </ogc:Filter>\n `;var n,r,a,s;fetch(function(t){const e=Object.keys(t).map((e=>e+"="+encodeURI(t[e]))).join("&");return`https://api.os.uk/features/v1/wfs?${e}`}({key:e,service:"WFS",request:"GetFeature",version:"2.0.0",typeNames:"Topography_TopographicArea",propertyName:"TOID,DescriptiveGroup,SHAPE",outputFormat:"GEOJSON",srsName:"urn:ogc:def:crs:EPSG::4326",filter:o,count:1})).then((t=>t.json())).then((t=>{if(!t.features.length)return;const e=t.features[0].properties,o=["TOID","DescriptiveGroup"];Object.keys(e).forEach((t=>o.includes(t)||delete e[t]));const n=new Rs,r=n.readFeatures(t,{featureProjection:"EPSG:3857"});i?r.forEach((t=>{const e=t.getProperties().TOID,i=Ig.getFeatureById(e);i?Ig.removeFeature(i):(t.setId(e),Ig.addFeature(t))})):(Ig.clear(),r.forEach((t=>{const e=t.getProperties().TOID;t.setId(e),Ig.addFeature(t)}))),Mg.clear(),Mg.addFeature(n.readFeature(Ig.getFeatures().reduce(((t,e)=>{const i=n.writeFeatureObject(e).geometry;return t?Pg(t,i):i}),null)))})).catch((t=>console.log(t)))}var Dg,Ag={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Lg(t){return(t=Math.round(t))<0?0:t>255?255:t}function Gg(t){return t<0?0:t>1?1:t}function Ng(t){return"%"===t[t.length-1]?Lg(parseFloat(t)/100*255):Lg(parseInt(t))}function Bg(t){return"%"===t[t.length-1]?Gg(parseFloat(t)/100):Gg(parseFloat(t))}function Vg(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{Dg={}.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in Ag)return Ag[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var o=i.indexOf("("),n=i.indexOf(")");if(-1!==o&&n+1===i.length){var r=i.substr(0,o),a=i.substr(o+1,n-(o+1)).split(","),s=1;switch(r){case"rgba":if(4!==a.length)return null;s=Bg(a.pop());case"rgb":return 3!==a.length?null:[Ng(a[0]),Ng(a[1]),Ng(a[2]),s];case"hsla":if(4!==a.length)return null;s=Bg(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=Bg(a[1]),p=Bg(a[2]),h=p<=.5?p*(u+1):p+u-p*u,d=2*p-h;return[Lg(255*Vg(d,h,l+1/3)),Lg(255*Vg(d,h,l)),Lg(255*Vg(d,h,l-1/3)),s];default:return null}}return null}}catch(f_){}var qg=function(t,e,i,o){void 0===o&&(o=1),this.r=t,this.g=e,this.b=i,this.a=o};qg.parse=function(t){if(t){if(t instanceof qg)return t;if("string"==typeof t){var e=Dg(t);if(e)return new qg(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},qg.prototype.toString=function(){var t=this.toArray(),e=t[0],i=t[1],o=t[2],n=t[3];return"rgba("+Math.round(e)+","+Math.round(i)+","+Math.round(o)+","+n+")"},qg.prototype.toArray=function(){var t=this,e=t.r,i=t.g,o=t.b,n=t.a;return 0===n?[0,0,0,0]:[255*e/n,255*i/n,255*o/n,n]},qg.black=new qg(0,0,0,1),qg.white=new qg(1,1,1,1),qg.transparent=new qg(0,0,0,0),qg.red=new qg(1,0,0,1),qg.blue=new qg(0,0,1,1);var Wg=qg;function Ug(t){return"object"==typeof t?["literal",t]:t}function Xg(t,e){var i=t.stops;if(!i)return function(t,e){var i=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",i]:i;if("enum"===e.type)return["match",i,Object.keys(e.values),i,t.default];var o=["color"===e.type?"to-color":e.type,i,Ug(t.default)];return"array"===e.type&&o.splice(1,0,e.value,e.length||null),o}(t,e);var o=i&&"object"==typeof i[0][0],n=o||void 0!==t.property,r=o||!n;return i=i.map((function(t){return!n&&e.tokens&&"string"==typeof t[1]?[t[0],Qg(t[1])]:[t[0],Ug(t[1])]})),o?function(t,e,i){for(var o={},n={},r=[],a=0;a<i.length;a++){var s=i[a],l=s[0].zoom;void 0===o[l]&&(o[l]={zoom:l,type:t.type,property:t.property,default:t.default},n[l]=[],r.push(l)),n[l].push([s[0].value,s[1]])}if("exponential"===Jg({},e)){for(var u=[Kg(t),["linear"],["zoom"]],p=0,h=r;p<h.length;p+=1){var d=h[p];$g(u,d,Zg(o[d],e,n[d]),!1)}return u}for(var c=["step",["zoom"]],g=0,f=r;g<f.length;g+=1){var m=f[g];$g(c,m,Zg(o[m],e,n[m]),!0)}return Hg(c),c}(t,e,i):r?function(t,e,i,o){void 0===o&&(o=["zoom"]);var n,r=Jg(t,e),a=!1;if("interval"===r)n=["step",o],a=!0;else{if("exponential"!==r)throw new Error('Unknown zoom function type "'+r+'"');var s=void 0!==t.base?t.base:1;n=[Kg(t),1===s?["linear"]:["exponential",s],o]}for(var l=0,u=i;l<u.length;l+=1){var p=u[l];$g(n,p[0],p[1],a)}return Hg(n),n}(t,e,i):Zg(t,e,i)}function Kg(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Yg(t,e){var i,o,n=Ug((i=t.default,o=e.default,void 0!==i?i:void 0!==o?o:void 0));return void 0===n&&"resolvedImage"===e.type?"":n}function Zg(t,e,i){var o=Jg(t,e),n=["get",t.property];if("categorical"===o&&"boolean"==typeof i[0][0]){for(var r=["case"],a=0,s=i;a<s.length;a+=1){var l=s[a];r.push(["==",n,l[0]],l[1])}return r.push(Yg(t,e)),r}if("categorical"===o){for(var u=["match",n],p=0,h=i;p<h.length;p+=1){var d=h[p];$g(u,d[0],d[1],!1)}return u.push(Yg(t,e)),u}if("interval"===o){for(var c=["step",["number",n]],g=0,f=i;g<f.length;g+=1){var m=f[g];$g(c,m[0],m[1],!0)}return Hg(c),void 0===t.default?c:["case",["==",["typeof",n],"number"],c,Ug(t.default)]}if("exponential"===o){for(var v=void 0!==t.base?t.base:1,y=[Kg(t),1===v?["linear"]:["exponential",v],["number",n]],_=0,b=i;_<b.length;_+=1){var x=b[_];$g(y,x[0],x[1],!1)}return void 0===t.default?y:["case",["==",["typeof",n],"number"],y,Ug(t.default)]}throw new Error("Unknown property function type "+o)}function Hg(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function $g(t,e,i,o){t.length>3&&e===t[t.length-2]||(o&&2===t.length||t.push(e),t.push(i))}function Jg(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function Qg(t){for(var e=["concat"],i=/{([^{}]+)}/g,o=0,n=i.exec(t);null!==n;n=i.exec(t)){var r=t.slice(o,i.lastIndex-n[0].length);o=i.lastIndex,r.length>0&&e.push(r),e.push(["get",n[1]])}if(1===e.length)return t;if(o<t.length)e.push(t.slice(o));else if(2===e.length)return["to-string",e[1]];return e}var tf=function(t){function e(e,i){t.call(this,i),this.message=i,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),ef=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var i=0,o=e;i<o.length;i+=1){var n=o[i],r=n[0],a=n[1];this.bindings[r]=a}};ef.prototype.concat=function(t){return new ef(this,t)},ef.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},ef.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var of=ef,nf={kind:"null"},rf={kind:"number"},af={kind:"string"},sf={kind:"boolean"},lf={kind:"color"},uf={kind:"object"},pf={kind:"value"},hf={kind:"collator"},df={kind:"formatted"},cf={kind:"resolvedImage"};function gf(t,e){return{kind:"array",itemType:t,N:e}}function ff(t){if("array"===t.kind){var e=ff(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var mf=[nf,rf,af,sf,lf,df,uf,gf(pf),cf];function vf(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!vf(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var i=0,o=mf;i<o.length;i+=1){if(!vf(o[i],e))return null}}return"Expected "+ff(t)+" but found "+ff(e)+" instead."}function yf(t,e){return e.some((function(e){return e.kind===t.kind}))}function _f(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var bf=function(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};bf.prototype.compare=function(t,e){return this.collator.compare(t,e)},bf.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var xf=bf,kf=function(t,e,i,o,n){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=i,this.fontStack=o,this.textColor=n},wf=function(t){this.sections=t};wf.fromString=function(t){return new wf([new kf(t,null,null,null,null)])},wf.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},wf.factory=function(t){return t instanceof wf?t:wf.fromString(t)},wf.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},wf.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var o=i[e];if(o.image)t.push(["image",o.image.name]);else{t.push(o.text);var n={};o.fontStack&&(n["text-font"]=["literal",o.fontStack.split(",")]),o.scale&&(n["font-scale"]=o.scale),o.textColor&&(n["text-color"]=["rgba"].concat(o.textColor.toArray())),t.push(n)}}return t};var Sf=wf,Cf=function(t){this.name=t.name,this.available=t.available};Cf.prototype.toString=function(){return this.name},Cf.fromString=function(t){return t?new Cf({name:t,available:!1}):null},Cf.prototype.serialize=function(){return["image",this.name]};var zf=Cf;function Ef(t,e,i,o){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===o||"number"==typeof o&&o>=0&&o<=1?null:"Invalid rgba value ["+[t,e,i,o].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof o?[t,e,i,o]:[t,e,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Tf(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof Wg)return!0;if(t instanceof xf)return!0;if(t instanceof Sf)return!0;if(t instanceof zf)return!0;if(Array.isArray(t)){for(var e=0,i=t;e<i.length;e+=1){if(!Tf(i[e]))return!1}return!0}if("object"==typeof t){for(var o in t)if(!Tf(t[o]))return!1;return!0}return!1}function Pf(t){if(null===t)return nf;if("string"==typeof t)return af;if("boolean"==typeof t)return sf;if("number"==typeof t)return rf;if(t instanceof Wg)return lf;if(t instanceof xf)return hf;if(t instanceof Sf)return df;if(t instanceof zf)return cf;if(Array.isArray(t)){for(var e,i=t.length,o=0,n=t;o<n.length;o+=1){var r=Pf(n[o]);if(e){if(e===r)continue;e=pf;break}e=r}return gf(e||pf,i)}return uf}function Of(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Wg||t instanceof Sf||t instanceof zf?t.toString():JSON.stringify(t)}var Ff=function(t,e){this.type=t,this.value=e};Ff.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!Tf(t[1]))return e.error("invalid value");var i=t[1],o=Pf(i),n=e.expectedType;return"array"!==o.kind||0!==o.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(o=n),new Ff(o,i)},Ff.prototype.evaluate=function(){return this.value},Ff.prototype.eachChild=function(){},Ff.prototype.outputDefined=function(){return!0},Ff.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Wg?["rgba"].concat(this.value.toArray()):this.value instanceof Sf?this.value.serialize():this.value};var Rf=Ff,If=function(t){this.name="ExpressionEvaluationError",this.message=t};If.prototype.toJSON=function(){return this.message};var Mf=If,jf={string:af,number:rf,boolean:sf,object:uf},Df=function(t,e){this.type=t,this.args=e};Df.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i,o=1,n=t[0];if("array"===n){var r,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in jf)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=jf[s],o++}else r=pf;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],o++}i=gf(r,a)}else i=jf[n];for(var l=[];o<t.length;o++){var u=e.parse(t[o],o,pf);if(!u)return null;l.push(u)}return new Df(i,l)},Df.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var i=this.args[e].evaluate(t);if(!vf(this.type,Pf(i)))return i;if(e===this.args.length-1)throw new Mf("Expected value to be of type "+ff(this.type)+", but found "+ff(Pf(i))+" instead.")}return null},Df.prototype.eachChild=function(t){this.args.forEach(t)},Df.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Df.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);var o=t.N;("number"==typeof o||this.args.length>1)&&e.push(o)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var Af=Df,Lf=function(t){this.type=df,this.sections=t};Lf.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");for(var o=[],n=!1,r=1;r<=t.length-1;++r){var a=t[r];if(n&&"object"==typeof a&&!Array.isArray(a)){n=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,rf)))return null;var l=null;if(a["text-font"]&&!(l=e.parse(a["text-font"],1,gf(af))))return null;var u=null;if(a["text-color"]&&!(u=e.parse(a["text-color"],1,lf)))return null;var p=o[o.length-1];p.scale=s,p.font=l,p.textColor=u}else{var h=e.parse(t[r],1,pf);if(!h)return null;var d=h.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,o.push({content:h,scale:null,font:null,textColor:null})}}return new Lf(o)},Lf.prototype.evaluate=function(t){return new Sf(this.sections.map((function(e){var i=e.content.evaluate(t);return Pf(i)===cf?new kf("",i,null,null,null):new kf(Of(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},Lf.prototype.eachChild=function(t){for(var e=0,i=this.sections;e<i.length;e+=1){var o=i[e];t(o.content),o.scale&&t(o.scale),o.font&&t(o.font),o.textColor&&t(o.textColor)}},Lf.prototype.outputDefined=function(){return!1},Lf.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var o=i[e];t.push(o.content.serialize());var n={};o.scale&&(n["font-scale"]=o.scale.serialize()),o.font&&(n["text-font"]=o.font.serialize()),o.textColor&&(n["text-color"]=o.textColor.serialize()),t.push(n)}return t};var Gf=Lf,Nf=function(t){this.type=cf,this.input=t};Nf.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,af);return i?new Nf(i):e.error("No image name provided.")},Nf.prototype.evaluate=function(t){var e=this.input.evaluate(t),i=zf.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i},Nf.prototype.eachChild=function(t){t(this.input)},Nf.prototype.outputDefined=function(){return!1},Nf.prototype.serialize=function(){return["image",this.input.serialize()]};var Bf=Nf,Vf={"to-boolean":sf,"to-color":lf,"to-number":rf,"to-string":af},qf=function(t,e){this.type=t,this.args=e};qf.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");for(var o=Vf[i],n=[],r=1;r<t.length;r++){var a=e.parse(t[r],r,pf);if(!a)return null;n.push(a)}return new qf(o,n)},qf.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,i,o=0,n=this.args;o<n.length;o+=1){if(i=null,(e=n[o].evaluate(t))instanceof Wg)return e;if("string"==typeof e){var r=t.parseColor(e);if(r)return r}else if(Array.isArray(e)&&!(i=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":Ef(e[0],e[1],e[2],e[3])))return new Wg(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Mf(i||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,l=this.args;s<l.length;s+=1){if(null===(a=l[s].evaluate(t)))return 0;var u=Number(a);if(!isNaN(u))return u}throw new Mf("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?Sf.fromString(Of(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?zf.fromString(Of(this.args[0].evaluate(t))):Of(this.args[0].evaluate(t))},qf.prototype.eachChild=function(t){this.args.forEach(t)},qf.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},qf.prototype.serialize=function(){if("formatted"===this.type.kind)return new Gf([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Bf(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var Wf=qf,Uf=["Unknown","Point","LineString","Polygon"],Xf=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null};Xf.prototype.id=function(){return this.feature&&"id"in this.feature&&this.feature.id?this.feature.id:null},Xf.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?Uf[this.feature.type]:this.feature.type:null},Xf.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Xf.prototype.canonicalID=function(){return this.canonical},Xf.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Xf.prototype.distanceFromCenter=function(){if(this.featureTileCoord&&this.featureDistanceData){var t=this.featureDistanceData.center,e=this.featureDistanceData.scale,i=this.featureTileCoord,o=i.x,n=i.y,r=o*e-t[0],a=n*e-t[1];return this.featureDistanceData.bearing[0]*r+this.featureDistanceData.bearing[1]*a}return 0},Xf.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Wg.parse(t)),e};var Kf=Xf,Yf=function(t,e,i,o){this.name=t,this.type=e,this._evaluate=i,this.args=o};Yf.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Yf.prototype.eachChild=function(t){this.args.forEach(t)},Yf.prototype.outputDefined=function(){return!1},Yf.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},Yf.parse=function(t,e){var i,o=t[0],n=Yf.definitions[o];if(!n)return e.error('Unknown expression "'+o+'". If you wanted a literal array, use ["literal", [...]].',0);for(var r=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=a.filter((function(e){var i=e[0];return!Array.isArray(i)||i.length===t.length-1})),l=null,u=0,p=s;u<p.length;u+=1){var h=p[u],d=h[0],c=h[1];l=new xm(e.registry,e.path,null,e.scope);for(var g=[],f=!1,m=1;m<t.length;m++){var v=t[m],y=Array.isArray(d)?d[m-1]:d.type,_=l.parse(v,1+g.length,y);if(!_){f=!0;break}g.push(_)}if(!f)if(Array.isArray(d)&&d.length!==g.length)l.error("Expected "+d.length+" arguments, but found "+g.length+" instead.");else{for(var b=0;b<g.length;b++){var x=Array.isArray(d)?d[b]:d.type,k=g[b];l.concat(b+1).checkSubtype(x,k.type)}if(0===l.errors.length)return new Yf(o,r,c,g)}}if(1===s.length)(i=e.errors).push.apply(i,l.errors);else{for(var w=(s.length?s:a).map((function(t){var e,i=t[0];return e=i,Array.isArray(e)?"("+e.map(ff).join(", ")+")":"("+ff(e.type)+"...)"})).join(" | "),S=[],C=1;C<t.length;C++){var z=e.parse(t[C],1+S.length);if(!z)return null;S.push(ff(z.type))}e.error("Expected arguments of type "+w+", but found ("+S.join(", ")+") instead.")}return null},Yf.register=function(t,e){for(var i in Yf.definitions=e,e)t[i]=Yf};var Zf=Yf,Hf=function(t,e,i){this.type=hf,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e};Hf.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");var o=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,sf);if(!o)return null;var n=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,sf);if(!n)return null;var r=null;return i.locale&&!(r=e.parse(i.locale,1,af))?null:new Hf(o,n,r)},Hf.prototype.evaluate=function(t){return new xf(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Hf.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Hf.prototype.outputDefined=function(){return!1},Hf.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var $f=Hf;function Jf(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Qf(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function tm(t,e){var i,o=(180+t[0])/360,n=(i=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360),r=Math.pow(2,e.z);return[Math.round(o*r*8192),Math.round(n*r*8192)]}function em(t,e,i){return e[1]>t[1]!=i[1]>t[1]&&t[0]<(i[0]-e[0])*(t[1]-e[1])/(i[1]-e[1])+e[0]}function im(t,e){for(var i,o,n,r,a,s,l,u=!1,p=0,h=e.length;p<h;p++)for(var d=e[p],c=0,g=d.length;c<g-1;c++){if(i=t,o=d[c],n=d[c+1],r=void 0,a=void 0,s=void 0,l=void 0,r=i[0]-o[0],a=i[1]-o[1],s=i[0]-n[0],l=i[1]-n[1],r*l-s*a==0&&r*s<=0&&a*l<=0)return!1;em(t,d[c],d[c+1])&&(u=!u)}return u}function om(t,e){for(var i=0;i<e.length;i++)if(im(t,e[i]))return!0;return!1}function nm(t,e,i,o){var n=t[0]-i[0],r=t[1]-i[1],a=e[0]-i[0],s=e[1]-i[1],l=o[0]-i[0],u=o[1]-i[1],p=n*u-l*r,h=a*u-l*s;return p>0&&h<0||p<0&&h>0}function rm(t,e,i){for(var o=0,n=i;o<n.length;o+=1)for(var r=n[o],a=0;a<r.length-1;++a)if(s=t,l=e,u=r[a],p=r[a+1],h=void 0,d=void 0,c=void 0,g=void 0,c=[l[0]-s[0],l[1]-s[1]],g=[p[0]-u[0],p[1]-u[1]],0!=(h=g)[0]*(d=c)[1]-h[1]*d[0]&&nm(s,l,u,p)&&nm(u,p,s,l))return!0;var s,l,u,p,h,d,c,g;return!1}function am(t,e){for(var i=0;i<t.length;++i)if(!im(t[i],e))return!1;for(var o=0;o<t.length-1;++o)if(rm(t[o],t[o+1],e))return!1;return!0}function sm(t,e){for(var i=0;i<e.length;i++)if(am(t,e[i]))return!0;return!1}function lm(t,e,i){for(var o=[],n=0;n<t.length;n++){for(var r=[],a=0;a<t[n].length;a++){var s=tm(t[n][a],i);Jf(e,s),r.push(s)}o.push(r)}return o}function um(t,e,i){for(var o=[],n=0;n<t.length;n++){var r=lm(t[n],e,i);o.push(r)}return o}function pm(t,e,i,o){if(t[0]<i[0]||t[0]>i[2]){var n=.5*o,r=t[0]-i[0]>n?-o:i[0]-t[0]>n?o:0;0===r&&(r=t[0]-i[2]>n?-o:i[2]-t[0]>n?o:0),t[0]+=r}Jf(e,t)}function hm(t,e,i,o){var n=8192*Math.pow(2,o.z),r=[8192*o.x,8192*o.y],a=[];if(!t)return a;for(var s=0,l=t;s<l.length;s+=1)for(var u=0,p=l[s];u<p.length;u+=1){var h=p[u],d=[h.x+r[0],h.y+r[1]];pm(d,e,i,n),a.push(d)}return a}function dm(t,e,i,o){var n,r=8192*Math.pow(2,o.z),a=[8192*o.x,8192*o.y],s=[];if(!t)return s;for(var l=0,u=t;l<u.length;l+=1){for(var p=[],h=0,d=u[l];h<d.length;h+=1){var c=d[h],g=[c.x+a[0],c.y+a[1]];Jf(e,g),p.push(g)}s.push(p)}if(e[2]-e[0]<=r/2){(n=e)[0]=n[1]=1/0,n[2]=n[3]=-1/0;for(var f=0,m=s;f<m.length;f+=1)for(var v=0,y=m[f];v<y.length;v+=1){pm(y[v],e,i,r)}}return s}var cm=function(t,e){this.type=sf,this.geojson=t,this.geometries=e};cm.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(Tf(t[1])){var i=t[1];if("FeatureCollection"===i.type)for(var o=0;o<i.features.length;++o){var n=i.features[o].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new cm(i,i.features[o].geometry)}else if("Feature"===i.type){var r=i.geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new cm(i,i.geometry)}else if("Polygon"===i.type||"MultiPolygon"===i.type)return new cm(i,i)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},cm.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var i=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(!n)return!1;if("Polygon"===e.type){var r=lm(e.coordinates,o,n),a=hm(t.geometry(),i,o,n);if(!Qf(i,o))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!im(l[s],r))return!1}if("MultiPolygon"===e.type){var u=um(e.coordinates,o,n),p=hm(t.geometry(),i,o,n);if(!Qf(i,o))return!1;for(var h=0,d=p;h<d.length;h+=1)if(!om(d[h],u))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var i=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(!n)return!1;if("Polygon"===e.type){var r=lm(e.coordinates,o,n),a=dm(t.geometry(),i,o,n);if(!Qf(i,o))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!am(l[s],r))return!1}if("MultiPolygon"===e.type){var u=um(e.coordinates,o,n),p=dm(t.geometry(),i,o,n);if(!Qf(i,o))return!1;for(var h=0,d=p;h<d.length;h+=1)if(!sm(d[h],u))return!1}return!0}(t,this.geometries)}return!1},cm.prototype.eachChild=function(){},cm.prototype.outputDefined=function(){return!0},cm.prototype.serialize=function(){return["within",this.geojson]};var gm=cm;function fm(t){if(t instanceof Zf){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof gm)return!1;var e=!0;return t.eachChild((function(t){e&&!fm(t)&&(e=!1)})),e}function mm(t){if(t instanceof Zf&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!mm(t)&&(e=!1)})),e}function vm(t,e){if(t instanceof Zf&&e.indexOf(t.name)>=0)return!1;var i=!0;return t.eachChild((function(t){i&&!vm(t,e)&&(i=!1)})),i}var ym=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};ym.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var i=t[1];return e.scope.has(i)?new ym(i,e.scope.get(i)):e.error('Unknown variable "'+i+'". Make sure "'+i+'" has been bound in an enclosing "let" expression before using it.',1)},ym.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},ym.prototype.eachChild=function(){},ym.prototype.outputDefined=function(){return!1},ym.prototype.serialize=function(){return["var",this.name]};var _m=ym,bm=function(t,e,i,o,n){void 0===e&&(e=[]),void 0===o&&(o=new of),void 0===n&&(n=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=o,this.errors=n,this.expectedType=i};bm.prototype.parse=function(t,e,i,o,n){return void 0===n&&(n={}),e?this.concat(e,i,o)._parse(t,n):this._parse(t,n)},bm.prototype._parse=function(t,e){function i(t,e,i){return"assert"===i?new Af(e,[t]):"coerce"===i?new Wf(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var o=t[0];if("string"!=typeof o)return this.error("Expression name must be a string, but found "+typeof o+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[o];if(n){var r=n.parse(t,this);if(!r)return null;if(this.expectedType){var a=this.expectedType,s=r.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else r=i(r,a,e.typeAnnotation||"coerce");else r=i(r,a,e.typeAnnotation||"assert")}if(!(r instanceof Rf)&&"resolvedImage"!==r.type.kind&&km(r)){var l=new Kf;try{r=new Rf(r.type,r.evaluate(l))}catch(f_){return this.error(f_.message),null}}return r}return this.error('Unknown expression "'+o+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},bm.prototype.concat=function(t,e,i){var o="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new bm(this.registry,o,e||null,n,this.errors)},bm.prototype.error=function(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];var o=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new tf(o,t))},bm.prototype.checkSubtype=function(t,e){var i=vf(t,e);return i&&this.error(i),i};var xm=bm;function km(t){if(t instanceof _m)return km(t.boundExpression);if(t instanceof Zf&&"error"===t.name)return!1;if(t instanceof $f)return!1;if(t instanceof gm)return!1;var e=t instanceof Wf||t instanceof Af,i=!0;return t.eachChild((function(t){i=e?i&&km(t):i&&t instanceof Rf})),!!i&&(fm(t)&&vm(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}function wm(t,e){for(var i,o,n=t.length-1,r=0,a=n,s=0;r<=a;)if(i=t[s=Math.floor((r+a)/2)],o=t[s+1],i<=e){if(s===n||e<o)return s;r=s+1}else{if(!(i>e))throw new Mf("Input is not a number.");a=s-1}return 0}var Sm=function(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var o=0,n=i;o<n.length;o+=1){var r=n[o],a=r[0],s=r[1];this.labels.push(a),this.outputs.push(s)}};Sm.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var i=e.parse(t[1],1,rf);if(!i)return null;var o=[],n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var r=1;r<t.length;r+=2){var a=1===r?-1/0:t[r],s=t[r+1],l=r,u=r+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(o.length&&o[o.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var p=e.parse(s,u,n);if(!p)return null;n=n||p.type,o.push([a,p])}return new Sm(n,i,o)},Sm.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);var n=e.length;return o>=e[n-1]?i[n-1].evaluate(t):i[wm(e,o)].evaluate(t)},Sm.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1){t(i[e])}},Sm.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Sm.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Cm=Sm,zm=Em;function Em(t,e,i,o){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(o-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=o,this.p2x=i,this.p2y=o}function Tm(t,e,i){return t*(1-i)+e*i}Em.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Em.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Em.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Em.prototype.solveCurveX=function(t,e){var i,o,n,r,a;for(void 0===e&&(e=1e-6),n=t,a=0;a<8;a++){if(r=this.sampleCurveX(n)-t,Math.abs(r)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=r/s}if((n=t)<(i=0))return i;if(n>(o=1))return o;for(;i<o;){if(r=this.sampleCurveX(n),Math.abs(r-t)<e)return n;t>r?i=n:o=n,n=.5*(o-i)+i}return n},Em.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Pm=Object.freeze({__proto__:null,number:Tm,color:function(t,e,i){return new Wg(Tm(t.r,e.r,i),Tm(t.g,e.g,i),Tm(t.b,e.b,i),Tm(t.a,e.a,i))},array:function(t,e,i){return t.map((function(t,o){return Tm(t,e[o],i)}))}}),Om=4/29,Fm=6/29,Rm=3*Fm*Fm,Im=Math.PI/180,Mm=180/Math.PI;function jm(t){return t>.008856451679035631?Math.pow(t,1/3):t/Rm+Om}function Dm(t){return t>Fm?t*t*t:Rm*(t-Om)}function Am(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Lm(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Gm(t){var e=Lm(t.r),i=Lm(t.g),o=Lm(t.b),n=jm((.4124564*e+.3575761*i+.1804375*o)/.95047),r=jm((.2126729*e+.7151522*i+.072175*o)/1);return{l:116*r-16,a:500*(n-r),b:200*(r-jm((.0193339*e+.119192*i+.9503041*o)/1.08883)),alpha:t.a}}function Nm(t){var e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,o=isNaN(t.b)?e:e-t.b/200;return e=1*Dm(e),i=.95047*Dm(i),o=1.08883*Dm(o),new Wg(Am(3.2404542*i-1.5371385*e-.4985314*o),Am(-.969266*i+1.8760108*e+.041556*o),Am(.0556434*i-.2040259*e+1.0572252*o),t.alpha)}function Bm(t,e,i){var o=e-t;return t+i*(o>180||o<-180?o-360*Math.round(o/360):o)}var Vm={forward:Gm,reverse:Nm,interpolate:function(t,e,i){return{l:Tm(t.l,e.l,i),a:Tm(t.a,e.a,i),b:Tm(t.b,e.b,i),alpha:Tm(t.alpha,e.alpha,i)}}},qm={forward:function(t){var e=Gm(t),i=e.l,o=e.a,n=e.b,r=Math.atan2(n,o)*Mm;return{h:r<0?r+360:r,c:Math.sqrt(o*o+n*n),l:i,alpha:t.a}},reverse:function(t){var e=t.h*Im,i=t.c;return Nm({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:Bm(t.h,e.h,i),c:Tm(t.c,e.c,i),l:Tm(t.l,e.l,i),alpha:Tm(t.alpha,e.alpha,i)}}},Wm=function(t,e,i,o,n){this.type=t,this.operator=e,this.interpolation=i,this.input=o,this.labels=[],this.outputs=[];for(var r=0,a=n;r<a.length;r+=1){var s=a[r],l=s[0],u=s[1];this.labels.push(l),this.outputs.push(u)}};function Um(t,e,i,o){var n=o-i,r=t-i;return 0===n?0:1===e?r/n:(Math.pow(e,r)-1)/(Math.pow(e,n)-1)}Wm.interpolationFactor=function(t,e,i,o){var n=0;if("exponential"===t.name)n=Um(e,t.base,i,o);else if("linear"===t.name)n=Um(e,1,i,o);else if("cubic-bezier"===t.name){var r=t.controlPoints;n=new zm(r[0],r[1],r[2],r[3]).solve(Um(e,1,i,o))}return n},Wm.parse=function(t,e){var i=t[0],o=t[1],n=t[2],r=t.slice(3);if(!Array.isArray(o)||0===o.length)return e.error("Expected an interpolation type expression.",1);if("linear"===o[0])o={name:"linear"};else if("exponential"===o[0]){var a=o[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:a}}else{if("cubic-bezier"!==o[0])return e.error("Unknown interpolation type "+String(o[0]),1,0);var s=o.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,2,rf)))return null;var l=[],u=null;"interpolate-hcl"===i||"interpolate-lab"===i?u=lf:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var p=0;p<r.length;p+=2){var h=r[p],d=r[p+1],c=p+3,g=p+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',c);if(l.length&&l[l.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',c);var f=e.parse(d,g,u);if(!f)return null;u=u||f.type,l.push([h,f])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new Wm(u,i,o,n,l):e.error("Type "+ff(u)+" is not interpolatable.")},Wm.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);var n=e.length;if(o>=e[n-1])return i[n-1].evaluate(t);var r=wm(e,o),a=e[r],s=e[r+1],l=Wm.interpolationFactor(this.interpolation,o,a,s),u=i[r].evaluate(t),p=i[r+1].evaluate(t);return"interpolate"===this.operator?Pm[this.type.kind.toLowerCase()](u,p,l):"interpolate-hcl"===this.operator?qm.reverse(qm.interpolate(qm.forward(u),qm.forward(p),l)):Vm.reverse(Vm.interpolate(Vm.forward(u),Vm.forward(p),l))},Wm.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1){t(i[e])}},Wm.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Wm.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e};var Xm=Wm,Km=function(t,e){this.type=t,this.args=e};Km.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var i=null,o=e.expectedType;o&&"value"!==o.kind&&(i=o);for(var n=[],r=0,a=t.slice(1);r<a.length;r+=1){var s=a[r],l=e.parse(s,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i=i||l.type,n.push(l)}var u=o&&n.some((function(t){return vf(o,t.type)}));return new Km(u?pf:i,n)},Km.prototype.evaluate=function(t){for(var e,i=null,o=0,n=0,r=this.args;n<r.length;n+=1){if(o++,(i=r[n].evaluate(t))&&i instanceof zf&&!i.available&&(e||(e=i),i=null,o===this.args.length))return e;if(null!==i)break}return i},Km.prototype.eachChild=function(t){this.args.forEach(t)},Km.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Km.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ym=Km,Zm=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Zm.prototype.evaluate=function(t){return this.result.evaluate(t)},Zm.prototype.eachChild=function(t){for(var e=0,i=this.bindings;e<i.length;e+=1){t(i[e][1])}t(this.result)},Zm.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var i=[],o=1;o<t.length-1;o+=2){var n=t[o];if("string"!=typeof n)return e.error("Expected string, but found "+typeof n+" instead.",o);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",o);var r=e.parse(t[o+1],o+1);if(!r)return null;i.push([n,r])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return a?new Zm(i,a):null},Zm.prototype.outputDefined=function(){return this.result.outputDefined()},Zm.prototype.serialize=function(){for(var t=["let"],e=0,i=this.bindings;e<i.length;e+=1){var o=i[e],n=o[0],r=o[1];t.push(n,r.serialize())}return t.push(this.result.serialize()),t};var Hm=Zm,$m=function(t,e,i){this.type=t,this.index=e,this.input=i};$m.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,rf),o=e.parse(t[2],2,gf(e.expectedType||pf));if(!i||!o)return null;var n=o.type;return new $m(n.itemType,i,o)},$m.prototype.evaluate=function(t){var e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new Mf("Array index out of bounds: "+e+" < 0.");if(e>=i.length)throw new Mf("Array index out of bounds: "+e+" > "+(i.length-1)+".");if(e!==Math.floor(e))throw new Mf("Array index must be an integer, but found "+e+" instead.");return i[e]},$m.prototype.eachChild=function(t){t(this.index),t(this.input)},$m.prototype.outputDefined=function(){return!1},$m.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Jm=$m,Qm=function(t,e){this.type=sf,this.needle=t,this.haystack=e};Qm.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,pf),o=e.parse(t[2],2,pf);return i&&o?yf(i.type,[sf,af,rf,nf,pf])?new Qm(i,o):e.error("Expected first argument to be of type boolean, string, number or null, but found "+ff(i.type)+" instead"):null},Qm.prototype.evaluate=function(t){var e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(null==i)return!1;if(!_f(e,["boolean","string","number","null"]))throw new Mf("Expected first argument to be of type boolean, string, number or null, but found "+ff(Pf(e))+" instead.");if(!_f(i,["string","array"]))throw new Mf("Expected second argument to be of type array or string, but found "+ff(Pf(i))+" instead.");return i.indexOf(e)>=0},Qm.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Qm.prototype.outputDefined=function(){return!0},Qm.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var tv=Qm,ev=function(t,e,i){this.type=rf,this.needle=t,this.haystack=e,this.fromIndex=i};ev.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,pf),o=e.parse(t[2],2,pf);if(!i||!o)return null;if(!yf(i.type,[sf,af,rf,nf,pf]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+ff(i.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,rf);return n?new ev(i,o,n):null}return new ev(i,o)},ev.prototype.evaluate=function(t){var e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!_f(e,["boolean","string","number","null"]))throw new Mf("Expected first argument to be of type boolean, string, number or null, but found "+ff(Pf(e))+" instead.");if(!_f(i,["string","array"]))throw new Mf("Expected second argument to be of type array or string, but found "+ff(Pf(i))+" instead.");if(this.fromIndex){var o=this.fromIndex.evaluate(t);return i.indexOf(e,o)}return i.indexOf(e)},ev.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},ev.prototype.outputDefined=function(){return!1},ev.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var iv=ev,ov=function(t,e,i,o,n,r){this.inputType=t,this.type=e,this.input=i,this.cases=o,this.outputs=n,this.otherwise=r};ov.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var i,o;e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType);for(var n={},r=[],a=2;a<t.length-1;a+=2){var s=t[a],l=t[a+1];Array.isArray(s)||(s=[s]);var u=e.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(var p=0,h=s;p<h.length;p+=1){var d=h[p];if("number"!=typeof d&&"string"!=typeof d)return u.error("Branch labels must be numbers or strings.");if("number"==typeof d&&Math.abs(d)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,Pf(d)))return null}else i=Pf(d);if(void 0!==n[String(d)])return u.error("Branch labels must be unique.");n[String(d)]=r.length}var c=e.parse(l,a,o);if(!c)return null;o=o||c.type,r.push(c)}var g=e.parse(t[1],1,pf);if(!g)return null;var f=e.parse(t[t.length-1],t.length-1,o);return f?"value"!==g.type.kind&&e.concat(1).checkSubtype(i,g.type)?null:new ov(i,o,g,n,r,f):null},ov.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(Pf(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},ov.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},ov.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},ov.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],i=[],o={},n=0,r=Object.keys(this.cases).sort();n<r.length;n+=1){var a=r[n];void 0===(h=o[this.cases[a]])?(o[this.cases[a]]=i.length,i.push([this.cases[a],[a]])):i[h][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,u=i;l<u.length;l+=1){var p=u[l],h=p[0],d=p[1];1===d.length?e.push(s(d[0])):e.push(d.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var nv=ov,rv=function(t,e,i){this.type=t,this.branches=e,this.otherwise=i};rv.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var o=[],n=1;n<t.length-1;n+=2){var r=e.parse(t[n],n,sf);if(!r)return null;var a=e.parse(t[n+1],n+1,i);if(!a)return null;o.push([r,a]),i=i||a.type}var s=e.parse(t[t.length-1],t.length-1,i);return s?new rv(i,o,s):null},rv.prototype.evaluate=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var o=i[e],n=o[0],r=o[1];if(n.evaluate(t))return r.evaluate(t)}return this.otherwise.evaluate(t)},rv.prototype.eachChild=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var o=i[e],n=o[0],r=o[1];t(n),t(r)}t(this.otherwise)},rv.prototype.outputDefined=function(){return this.branches.every((function(t){return t[0],t[1].outputDefined()}))&&this.otherwise.outputDefined()},rv.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var av=rv,sv=function(t,e,i,o){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=o};sv.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,pf),o=e.parse(t[2],2,rf);if(!i||!o)return null;if(!yf(i.type,[gf(pf),af,pf]))return e.error("Expected first argument to be of type array or string, but found "+ff(i.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,rf);return n?new sv(i.type,i,o,n):null}return new sv(i.type,i,o)},sv.prototype.evaluate=function(t){var e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!_f(e,["string","array"]))throw new Mf("Expected first argument to be of type array or string, but found "+ff(Pf(e))+" instead.");if(this.endIndex){var o=this.endIndex.evaluate(t);return e.slice(i,o)}return e.slice(i)},sv.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},sv.prototype.outputDefined=function(){return!1},sv.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var lv=sv;function uv(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function pv(t,e,i,o){return 0===o.compare(e,i)}function hv(t,e,i){var o="=="!==t&&"!="!==t;return function(){function n(t,e,i){this.type=sf,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return n.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var i=t[0],r=e.parse(t[1],1,pf);if(!r)return null;if(!uv(i,r.type))return e.concat(1).error('"'+i+"\" comparisons are not supported for type '"+ff(r.type)+"'.");var a=e.parse(t[2],2,pf);if(!a)return null;if(!uv(i,a.type))return e.concat(2).error('"'+i+"\" comparisons are not supported for type '"+ff(a.type)+"'.");if(r.type.kind!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+ff(r.type)+"' and '"+ff(a.type)+"'.");o&&("value"===r.type.kind&&"value"!==a.type.kind?r=new Af(a.type,[r]):"value"!==r.type.kind&&"value"===a.type.kind&&(a=new Af(r.type,[a])));var s=null;if(4===t.length){if("string"!==r.type.kind&&"string"!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,hf)))return null}return new n(r,a,s)},n.prototype.evaluate=function(n){var r=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(o&&this.hasUntypedArgument){var s=Pf(r),l=Pf(a);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new Mf('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!o&&this.hasUntypedArgument){var u=Pf(r),p=Pf(a);if("string"!==u.kind||"string"!==p.kind)return e(n,r,a)}return this.collator?i(n,r,a,this.collator.evaluate(n)):e(n,r,a)},n.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},n.prototype.outputDefined=function(){return!0},n.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},n}()}var dv=hv("==",(function(t,e,i){return e===i}),pv),cv=hv("!=",(function(t,e,i){return e!==i}),(function(t,e,i,o){return!pv(0,e,i,o)})),gv=hv("<",(function(t,e,i){return e<i}),(function(t,e,i,o){return o.compare(e,i)<0})),fv=hv(">",(function(t,e,i){return e>i}),(function(t,e,i,o){return o.compare(e,i)>0})),mv=hv("<=",(function(t,e,i){return e<=i}),(function(t,e,i,o){return o.compare(e,i)<=0})),vv=hv(">=",(function(t,e,i){return e>=i}),(function(t,e,i,o){return o.compare(e,i)>=0})),yv=function(t,e,i,o,n){this.type=af,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=o,this.maxFractionDigits=n};yv.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,rf);if(!i)return null;var o=t[2];if("object"!=typeof o||Array.isArray(o))return e.error("NumberFormat options argument must be an object.");var n=null;if(o.locale&&!(n=e.parse(o.locale,1,af)))return null;var r=null;if(o.currency&&!(r=e.parse(o.currency,1,af)))return null;var a=null;if(o["min-fraction-digits"]&&!(a=e.parse(o["min-fraction-digits"],1,rf)))return null;var s=null;return o["max-fraction-digits"]&&!(s=e.parse(o["max-fraction-digits"],1,rf))?null:new yv(i,n,r,a,s)},yv.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},yv.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},yv.prototype.outputDefined=function(){return!1},yv.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var _v=yv,bv=function(t){this.type=rf,this.input=t};bv.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error("Expected argument of type string or array, but found "+ff(i.type)+" instead."):new bv(i):null},bv.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new Mf("Expected value to be of type string or array, but found "+ff(Pf(e))+" instead.")},bv.prototype.eachChild=function(t){t(this.input)},bv.prototype.outputDefined=function(){return!1},bv.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var xv={"==":dv,"!=":cv,">":fv,"<":gv,">=":vv,"<=":mv,array:Af,at:Jm,boolean:Af,case:av,coalesce:Ym,collator:$f,format:Gf,image:Bf,in:tv,"index-of":iv,interpolate:Xm,"interpolate-hcl":Xm,"interpolate-lab":Xm,length:bv,let:Hm,literal:Rf,match:nv,number:Af,"number-format":_v,object:Af,slice:lv,step:Cm,string:Af,"to-boolean":Wf,"to-color":Wf,"to-number":Wf,"to-string":Wf,var:_m,within:gm};function kv(t,e){var i=e[0],o=e[1],n=e[2],r=e[3];i=i.evaluate(t),o=o.evaluate(t),n=n.evaluate(t);var a=r?r.evaluate(t):1,s=Ef(i,o,n,a);if(s)throw new Mf(s);return new Wg(i/255*a,o/255*a,n/255*a,a)}function wv(t,e){return t in e}function Sv(t,e){var i=e[t];return void 0===i?null:i}function Cv(t){return{type:t}}Zf.register(xv,{error:[{kind:"error"},[af],function(t,e){var i=e[0];throw new Mf(i.evaluate(t))}],typeof:[af,[pf],function(t,e){return ff(Pf(e[0].evaluate(t)))}],"to-rgba":[gf(rf,4),[lf],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[lf,[rf,rf,rf],kv],rgba:[lf,[rf,rf,rf,rf],kv],has:{type:sf,overloads:[[[af],function(t,e){return wv(e[0].evaluate(t),t.properties())}],[[af,uf],function(t,e){var i=e[0],o=e[1];return wv(i.evaluate(t),o.evaluate(t))}]]},get:{type:pf,overloads:[[[af],function(t,e){return Sv(e[0].evaluate(t),t.properties())}],[[af,uf],function(t,e){var i=e[0],o=e[1];return Sv(i.evaluate(t),o.evaluate(t))}]]},"feature-state":[pf,[af],function(t,e){return Sv(e[0].evaluate(t),t.featureState||{})}],properties:[uf,[],function(t){return t.properties()}],"geometry-type":[af,[],function(t){return t.geometryType()}],id:[pf,[],function(t){return t.id()}],zoom:[rf,[],function(t){return t.globals.zoom}],pitch:[rf,[],function(t){return t.globals.pitch||0}],"distance-from-center":[rf,[],function(t){return t.distanceFromCenter()}],"heatmap-density":[rf,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[rf,[],function(t){return t.globals.lineProgress||0}],"sky-radial-progress":[rf,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[pf,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[rf,Cv(rf),function(t,e){for(var i=0,o=0,n=e;o<n.length;o+=1){i+=n[o].evaluate(t)}return i}],"*":[rf,Cv(rf),function(t,e){for(var i=1,o=0,n=e;o<n.length;o+=1){i*=n[o].evaluate(t)}return i}],"-":{type:rf,overloads:[[[rf,rf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)-o.evaluate(t)}],[[rf],function(t,e){return-e[0].evaluate(t)}]]},"/":[rf,[rf,rf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)/o.evaluate(t)}],"%":[rf,[rf,rf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)%o.evaluate(t)}],ln2:[rf,[],function(){return Math.LN2}],pi:[rf,[],function(){return Math.PI}],e:[rf,[],function(){return Math.E}],"^":[rf,[rf,rf],function(t,e){var i=e[0],o=e[1];return Math.pow(i.evaluate(t),o.evaluate(t))}],sqrt:[rf,[rf],function(t,e){var i=e[0];return Math.sqrt(i.evaluate(t))}],log10:[rf,[rf],function(t,e){var i=e[0];return Math.log(i.evaluate(t))/Math.LN10}],ln:[rf,[rf],function(t,e){var i=e[0];return Math.log(i.evaluate(t))}],log2:[rf,[rf],function(t,e){var i=e[0];return Math.log(i.evaluate(t))/Math.LN2}],sin:[rf,[rf],function(t,e){var i=e[0];return Math.sin(i.evaluate(t))}],cos:[rf,[rf],function(t,e){var i=e[0];return Math.cos(i.evaluate(t))}],tan:[rf,[rf],function(t,e){var i=e[0];return Math.tan(i.evaluate(t))}],asin:[rf,[rf],function(t,e){var i=e[0];return Math.asin(i.evaluate(t))}],acos:[rf,[rf],function(t,e){var i=e[0];return Math.acos(i.evaluate(t))}],atan:[rf,[rf],function(t,e){var i=e[0];return Math.atan(i.evaluate(t))}],min:[rf,Cv(rf),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[rf,Cv(rf),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[rf,[rf],function(t,e){var i=e[0];return Math.abs(i.evaluate(t))}],round:[rf,[rf],function(t,e){var i=e[0].evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[rf,[rf],function(t,e){var i=e[0];return Math.floor(i.evaluate(t))}],ceil:[rf,[rf],function(t,e){var i=e[0];return Math.ceil(i.evaluate(t))}],"filter-==":[sf,[af,pf],function(t,e){var i=e[0],o=e[1];return t.properties()[i.value]===o.value}],"filter-id-==":[sf,[pf],function(t,e){var i=e[0];return t.id()===i.value}],"filter-type-==":[sf,[af],function(t,e){var i=e[0];return t.geometryType()===i.value}],"filter-<":[sf,[af,pf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n<r}],"filter-id-<":[sf,[pf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o<n}],"filter->":[sf,[af,pf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n>r}],"filter-id->":[sf,[pf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o>n}],"filter-<=":[sf,[af,pf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[sf,[pf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o<=n}],"filter->=":[sf,[af,pf],function(t,e){var i=e[0],o=e[1],n=t.properties()[i.value],r=o.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[sf,[pf],function(t,e){var i=e[0],o=t.id(),n=i.value;return typeof o==typeof n&&o>=n}],"filter-has":[sf,[pf],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[sf,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[sf,[gf(af)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[sf,[gf(pf)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[sf,[af,gf(pf)],function(t,e){var i=e[0];return e[1].value.indexOf(t.properties()[i.value])>=0}],"filter-in-large":[sf,[af,gf(pf)],function(t,e){var i=e[0],o=e[1];return function(t,e,i,o){for(;i<=o;){var n=i+o>>1;if(e[n]===t)return!0;e[n]>t?o=n-1:i=n+1}return!1}(t.properties()[i.value],o.value,0,o.value.length-1)}],all:{type:sf,overloads:[[[sf,sf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)&&o.evaluate(t)}],[Cv(sf),function(t,e){for(var i=0,o=e;i<o.length;i+=1){if(!o[i].evaluate(t))return!1}return!0}]]},any:{type:sf,overloads:[[[sf,sf],function(t,e){var i=e[0],o=e[1];return i.evaluate(t)||o.evaluate(t)}],[Cv(sf),function(t,e){for(var i=0,o=e;i<o.length;i+=1){if(o[i].evaluate(t))return!0}return!1}]]},"!":[sf,[sf],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[sf,[af],function(t,e){var i=e[0],o=t.globals&&t.globals.isSupportedScript;return!o||o(i.evaluate(t))}],upcase:[af,[af],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[af,[af],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[af,Cv(pf),function(t,e){return e.map((function(e){return Of(e.evaluate(t))})).join("")}],"resolved-locale":[af,[hf],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var zv=xv;function Ev(t){return{result:"success",value:t}}function Tv(t){return{result:"error",value:t}}function Pv(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}var Ov=function(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new Kf,this._defaultValue=e?"color"===(i=e).type&&Pv(i.default)?new Wg(0,0,0,0):"color"===i.type?Wg.parse(i.default)||null:void 0===i.default?null:i.default:null,this._enumValues=e&&"enum"===e.type?e.values:null};function Fv(t,e){var i=new xm(zv,[],e?function(t){var e={color:lf,string:af,number:rf,enum:af,boolean:sf,formatted:df,resolvedImage:cf};if("array"===t.type)return gf(e[t.value]||pf,t.length);return e[t.type]}(e):void 0),o=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return o?Ev(new Ov(o,e)):Tv(i.errors)}Ov.prototype.evaluateWithoutErrorHandling=function(t,e,i,o,n,r,a,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=o||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)},Ov.prototype.evaluate=function(t,e,i,o,n,r,a,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=o||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null;try{var l=this.expression.evaluate(this._evaluator);if(null==l||"number"==typeof l&&l!=l)return this._defaultValue;if(this._enumValues&&!(l in this._enumValues))throw new Mf("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(l)+" instead.");return l}catch(f_){return this._warningHistory[f_.message]||(this._warningHistory[f_.message]=!0,"undefined"!=typeof console&&console.warn(f_.message)),this._defaultValue}};var Rv=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!mm(e.expression)};Rv.prototype.evaluateWithoutErrorHandling=function(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)},Rv.prototype.evaluate=function(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)};var Iv=function(t,e,i,o){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!mm(e.expression),this.interpolationType=o};function Mv(t,e){if("error"===(t=Fv(t,e)).result)return t;var i,o=t.value.expression,n=fm(o);if(!n&&("data-driven"!==(i=e)["property-type"]&&"cross-faded-data-driven"!==i["property-type"]))return Tv([new tf("","data expressions not supported")]);var r=vm(o,["zoom","pitch","distance-from-center"]);if(!r&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return Tv([new tf("","zoom expressions not supported")]);var a=jv(o);if(!a&&!r)return Tv([new tf("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof tf)return Tv([a]);if(a instanceof Xm&&!function(t){return!!t.expression&&t.expression.interpolated}(e))return Tv([new tf("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Ev(new Rv(n?"constant":"source",t.value));var s=a instanceof Xm?a.interpolation:void 0;return Ev(new Iv(n?"camera":"composite",t.value,a.labels,s))}function jv(t){var e=null;if(t instanceof Hm)e=jv(t.result);else if(t instanceof Ym)for(var i=0,o=t.args;i<o.length;i+=1){var n=o[i];if(e=jv(n))break}else(t instanceof Cm||t instanceof Xm)&&t.input instanceof Zf&&"zoom"===t.input.name&&(e=t);return e instanceof tf||t.eachChild((function(t){var i=jv(t);i instanceof tf?e=i:!e&&i?e=new tf("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new tf("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Dv(t){if(Array.isArray(t))return t.map(Dv);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var i in t)e[i]=Dv(t[i]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}Iv.prototype.evaluateWithoutErrorHandling=function(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)},Iv.prototype.evaluate=function(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)},Iv.prototype.interpolationFactor=function(t,e,i){return this.interpolationType?Xm.interpolationFactor(this.interpolationType,t,e,i):0};var Av={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},fog:{type:"fog"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},projection:{type:"projection"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{},sky:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_symbol:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Camera"},pitch:{group:"Camera"},"distance-from-center":{group:"Camera"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"sky-radial-progress":{group:"sky"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},projection:{name:{type:"enum",values:{albers:{},equalEarth:{},equirectangular:{},lambertConformalConic:{},mercator:{},naturalEarth:{},winkelTripel:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};function Lv(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,i=t.slice(1);e<i.length;e+=1){var o=i[e];if(!Lv(o)&&"boolean"!=typeof o)return!1}return!0;default:return!0}}function Gv(t,e){if(void 0===e&&(e="fill"),null==t)return{filter:function(){return!0},needGeometry:!1,needFeature:!1};Lv(t)||(t=Xv(t));var i=t,o=!0;try{o=function(t){if(!Vv(t))return t;var e=Dv(t);return Bv(e),e=Nv(e)}(i)}catch(f_){console.warn("Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n"+JSON.stringify(i,null,2)+"\n ")}var n=Av["filter_"+e],r=Fv(o,n),a=null;if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));a=function(t,e,i){return r.value.evaluate(t,e,{},i)};var s=null,l=null;if(o!==i){var u=Fv(i,n);if("error"===u.result)throw new Error(u.value.map((function(t){return t.key+": "+t.message})).join(", "));s=function(t,e,i,o,n){return u.value.evaluate(t,e,{},i,void 0,void 0,o,n)},l=!fm(u.value.expression)}return{filter:a=a,dynamicFilter:s||void 0,needGeometry:Uv(o),needFeature:!!l}}function Nv(t){if(!Array.isArray(t))return t;var e=function(t){if(qv.has(t[0]))for(var e=1;e<t.length;e++){if(Vv(t[e]))return!0}return t}(t);return!0===e?e:e.map((function(t){return Nv(t)}))}function Bv(t){var e=!1,i=[];if("case"===t[0]){for(var o=1;o<t.length-1;o+=2)e=e||Vv(t[o]),i.push(t[o+1]);i.push(t[t.length-1])}else if("match"===t[0]){e=e||Vv(t[1]);for(var n=2;n<t.length-1;n+=2)i.push(t[n+1]);i.push(t[t.length-1])}else if("step"===t[0]){e=e||Vv(t[1]);for(var r=1;r<t.length-1;r+=2)i.push(t[r+1])}e&&(t.length=0,t.push.apply(t,["any"].concat(i)));for(var a=1;a<t.length;a++)Bv(t[a])}function Vv(t){if(!Array.isArray(t))return!1;if("pitch"===(e=t[0])||"distance-from-center"===e)return!0;for(var e,i=1;i<t.length;i++){if(Vv(t[i]))return!0}return!1}var qv=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function Wv(t,e){return t<e?-1:t>e?1:0}function Uv(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e<t.length;e++)if(Uv(t[e]))return!0;return!1}function Xv(t){if(!t)return!0;var e,i=t[0];return t.length<=1?"any"!==i:"=="===i?Kv(t[1],t[2],"=="):"!="===i?Hv(Kv(t[1],t[2],"==")):"<"===i||">"===i||"<="===i||">="===i?Kv(t[1],t[2],i):"any"===i?(e=t.slice(1),["any"].concat(e.map(Xv))):"all"===i?["all"].concat(t.slice(1).map(Xv)):"none"===i?["all"].concat(t.slice(1).map(Xv).map(Hv)):"in"===i?Yv(t[1],t.slice(2)):"!in"===i?Hv(Yv(t[1],t.slice(2))):"has"===i?Zv(t[1]):"!has"===i?Hv(Zv(t[1])):"within"!==i||t}function Kv(t,e,i){switch(t){case"$type":return["filter-type-"+i,e];case"$id":return["filter-id-"+i,e];default:return["filter-"+i,t,e]}}function Yv(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(Wv)]]:["filter-in-small",t,["literal",e]]}}function Zv(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Hv(t){return["!",t]}var $v=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Jv(t,e){var i={};for(var o in t)"ref"!==o&&(i[o]=t[o]);return $v.forEach((function(t){t in e&&(i[t]=e[t])})),i}var Qv={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},ty=/(italic|oblique)$/i,ey={},iy=function(t,e,i){var o=ey[t];if(!o){Array.isArray(t)||(t=[t]);for(var n=400,r="normal",a=[],s=0,l=t.length;s<l;++s){var u=t[s].split(" "),p=u[u.length-1].toLowerCase();for(var h in"normal"==p||"italic"==p||"oblique"==p?(r=p,u.pop(),p=u[u.length-1].toLowerCase()):ty.test(p)&&(p=p.replace(ty,""),r=u[u.length-1].replace(p,"")),Qv){var d=u.length>1?u[u.length-2].toLowerCase():"";if(p==h||p==h.replace("-","")||d+"-"+p==h){n=Qv[h],u.pop(),d&&h.startsWith(d)&&u.pop();break}}"number"==typeof p&&(n=p);var c=u.join(" ").replace("Klokantech Noto Sans","Noto Sans");-1!==c.indexOf(" ")&&(c='"'+c+'"'),a.push(c)}o=ey[t]=[r,n,a]}return o[0]+" "+o[1]+" "+e+"px"+(i?"/"+i:"")+" "+o[2]};function oy(t){return t*Math.PI/180}var ny=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function ry(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var i=document.createElement("canvas");return i.width=t,i.height=e,i}var ay,sy=Array(256).join(" ");function ly(t,e){if(e>=.05){for(var i="",o=t.split("\n"),n=sy.slice(0,Math.round(e/.1)),r=0,a=o.length;r<a;++r)r>0&&(i+="\n"),i+=o[r].split("").join(n);return i}return t}function uy(){return ay||(ay=ry(1,1).getContext("2d")),ay}function py(t,e){return uy().measureText(t).width+(t.length-1)*e}var hy={};function dy(t,e,i,o){if(-1!==t.indexOf("\n")){for(var n=t.split("\n"),r=[],a=0,s=n.length;a<s;++a)r.push(dy(n[a],e,i,o));return r.join("\n")}var l=i+","+e+","+t+","+o,u=hy[l];if(!u){var p=t.split(" ");if(p.length>1){var h=uy();h.font=e;for(var d=h.measureText("M").width*i,c="",g=[],f=0,m=p.length;f<m;++f){var v=p[f],y=c+(c?" ":"")+v;py(y,o)<=d?c=y:(c&&g.push(c),c=v)}c&&g.push(c);for(var _=0,b=g.length;_<b&&b>1;++_){var x=g[_];if(py(x,o)<.35*d){var k=_>0?py(g[_-1],o):1/0,w=_<b-1?py(g[_+1],o):1/0;g.splice(_,1),b-=1,k<w?(g[_-1]+=" "+x,_-=1):g[_]=x+" "+g[_]}}for(var S=0,C=g.length-1;S<C;++S){var z=g[S],E=g[S+1];if(py(z,o)>.7*d&&py(E,o)<.6*d){var T=z.split(" "),P=T.pop();py(P,o)<.2*d&&(g[S]=T.join(" "),g[S+1]=P+" "+E),C-=1}}u=g.join("\n")}else u=t;u=ly(u,o),hy[l]=u}return u}var cy,gy,fy={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},my={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},vy={},yy={zoom:0};function _y(t,e,i,o,n,r,a){var s=t.id;r||(r={},console.warn("No functionCache provided to getValue()")),r[s]||(r[s]={});var l,u=r[s];if(!u[i]){var p=(t[e]||vy)[i],h=Av[e+"_"+t.type][i];void 0===p&&(p=h.default);var d=(l=p,Array.isArray(l)&&l.length>0&&"string"==typeof l[0]&&l[0]in zv);if(!d&&Pv(p)&&(p=Xg(p,h),d=!0),d){var c=function(t,e){var i=Mv(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}(p,h);u[i]=c.evaluate.bind(c)}else"color"==h.type&&(p=Wg.parse(p)),u[i]=function(){return p}}return yy.zoom=o,u[i](yy,n,a)}function by(t,e,i,o,n){return n||console.warn("No filterCache provided to evaluateFilter()"),t in n||(n[t]=Gv(e).filter),yy.zoom=o,n[t](yy,i)}function xy(t,e){if(t){if(0===t.a||0===e)return;var i=t.a;return e=void 0===e?1:e,0===i?"transparent":"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*e+")"}return t}var ky=/^([^]*)\{(.*)\}([^]*)$/;function wy(t,e){var i;do{if(i=t.match(ky)){var o=e[i[2]]||"";t=i[1]+o+i[3]}}while(i);return t}function Sy(t,e,i,o,n,r,a){if(void 0===o&&(o=ny),void 0===n&&(n=void 0),void 0===r&&(r=void 0),void 0===a&&(a=void 0),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var s,l;if(r)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){s=u,l=[u.width,u.height],t.changed(),u.onload=null},u.src=r}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var p=self;p.postMessage({action:"loadImage",src:r}),p.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(s=t.data.image,l=[s.width,s.height])}))}for(var h,d=function(t){t=t.slice();for(var e=Object.create(null),i=0;i<t.length;i++)e[t[i].id]=t[i];for(var o=0;o<t.length;o++)"ref"in t[o]&&(t[o]=Jv(t[o],e[t[o].ref]));return t}(e.layers),c={},g=[],f={},m={},v={},y={},_=0,b=d.length;_<b;++_){var x=d[_],k=x.id;if("string"==typeof i&&x.source==i||-1!==i.indexOf(k)){var w=x["source-layer"];if(h){if(x.source!==h)throw new Error('Layer "'+k+'" does not use source "'+h)}else{h=x.source;var S=e.sources[h];if(!S)throw new Error('Source "'+h+'" is not defined');var C=S.type;if("vector"!==C&&"geojson"!==C)throw new Error('Source "'+h+'" is not of type "vector" or "geojson", but "'+C+'"')}var z=c[w];z||(z=[],c[w]=z),z.push({layer:x,index:_}),g.push(k)}}var E=new tl,T=new Is,P=[],O=function(e,i){var r=e.getProperties(),u=c[r.layer];if(u){var p=o.indexOf(i);-1==p&&(p=function(t,e){for(var i=0,o=e.length;i<o;++i)if(e[i]<t&&i+1<o){var n=e[i]/e[i+1];return i+Math.log(e[i]/t)/Math.log(n)}return o-1}(i,o));for(var h=fy[e.getGeometry().getType()],d={properties:r,type:h},g=t.get("mapbox-featurestate")[e.getId()],_=-1,b=0,x=u.length;b<x;++b){var k=u[b],w=k.layer,S=w.id,C=w.layout||vy,z=w.paint||vy;if(!("none"===C.visibility||"minzoom"in w&&p<w.minzoom||"maxzoom"in w&&p>=w.maxzoom)){var O=w.filter;if(!O||by(S,O,d,p,y)){var F=void 0,R=void 0,I=void 0,M=void 0,j=void 0,D=void 0,A=k.index;if(3==h&&("fill"==w.type||"fill-extrusion"==w.type))if(R=_y(w,"paint",w.type+"-opacity",p,d,v,g),w.type+"-pattern"in z){var L=_y(w,"paint",w.type+"-pattern",p,d,v,g);if(L){var G="string"==typeof L?wy(L,r):L.toString();if(s&&n&&n[G]){++_,(D=P[_])&&D.getFill()&&!D.getStroke()&&!D.getText()||(D=new hl({fill:new Is}),P[_]=D),I=D.getFill(),D.setZIndex(A);var N=G+"."+R,B=m[N];if(!B){var V=n[G],q=ry(V.width,V.height),W=q.getContext("2d");W.globalAlpha=R,W.drawImage(s,V.x,V.y,V.width,V.height,0,0,V.width,V.height),B=W.createPattern(q,"repeat"),m[N]=B}I.setColor(B)}}}else F=xy(_y(w,"paint",w.type+"-color",p,d,v,g),R),w.type+"-outline-color"in z&&(j=xy(_y(w,"paint",w.type+"-outline-color",p,d,v,g),R)),j||(j=F),(F||j)&&(++_,(!(D=P[_])||F&&!D.getFill()||!F&&D.getFill()||j&&!D.getStroke()||!j&&D.getStroke()||D.getText())&&(D=new hl({fill:F?new Is:void 0,stroke:j?new tl:void 0}),P[_]=D),F&&(I=D.getFill()).setColor(F),j&&((M=D.getStroke()).setColor(j),M.setWidth(.5)),D.setZIndex(A));if(1!=h&&"line"==w.type){F=!("line-pattern"in z)&&"line-color"in z?xy(_y(w,"paint","line-color",p,d,v,g),_y(w,"paint","line-opacity",p,d,v,g)):void 0;var U=_y(w,"paint","line-width",p,d,v,g);F&&U>0&&(++_,(D=P[_])&&D.getStroke()&&!D.getFill()&&!D.getText()||(D=new hl({stroke:new tl}),P[_]=D),(M=D.getStroke()).setLineCap(_y(w,"layout","line-cap",p,d,v,g)),M.setLineJoin(_y(w,"layout","line-join",p,d,v,g)),M.setMiterLimit(_y(w,"layout","line-miter-limit",p,d,v,g)),M.setColor(F),M.setWidth(U),M.setLineDash(z["line-dasharray"]?_y(w,"paint","line-dasharray",p,d,v,g).map((function(t){return t*U})):null),D.setZIndex(A))}var X=!1,K=null,Y=0,Z=void 0,H=void 0,$=void 0;if((1==h||2==h)&&"icon-image"in C){var J=_y(w,"layout","icon-image",p,d,v,g);if(J){Z="string"==typeof J?wy(J,r):J.toString();var Q=void 0;if(s&&n&&n[Z]){var tt=_y(w,"layout","icon-rotation-alignment",p,d,v,g);if(2==h){var et=e.getGeometry();if(et.getFlatMidpoint||et.getFlatMidpoints){var it=et.getExtent();if(Math.sqrt(Math.max(Math.pow((it[2]-it[0])/i,2),Math.pow((it[3]-it[1])/i,2)))>150){var ot="MultiLineString"===et.getType()?et.getFlatMidpoints():et.getFlatMidpoint();if(gy||(gy=new Ll("Point",cy=[NaN,NaN],[],{},null)),Q=gy,cy[0]=ot[0],cy[1]=ot[1],"line"===_y(w,"layout","symbol-placement",p,d,v,g)&&"map"===tt)for(var nt=et.getStride(),rt=et.getFlatCoordinates(),at=0,st=rt.length-nt;at<st;at+=nt){var lt=rt[at],ut=rt[at+1],pt=rt[at+nt],ht=rt[at+nt+1],dt=Math.min(lt,pt),ct=Math.min(ut,ht),gt=Math.max(lt,pt),ft=Math.max(ut,ht);if(ot[0]>=dt&&ot[0]<=gt&&ot[1]>=ct&&ot[1]<=ft){Y=Math.atan2(ut-ht,pt-lt);break}}}}}if(2!==h||Q){var mt=_y(w,"layout","icon-size",p,d,v,g),vt=void 0!==z["icon-color"]?_y(w,"paint","icon-color",p,d,v,g):null;if(!vt||0!==vt.a){var yt=Z+"."+mt;if(null!==vt&&(yt+="."+vt),!(H=f[yt])){var _t=n[Z];H=new Qs({color:vt?[255*vt.r,255*vt.g,255*vt.b,vt.a]:void 0,img:s,imgSize:l,size:[_t.width,_t.height],offset:[_t.x,_t.y],rotateWithView:"map"===tt,scale:mt/_t.pixelRatio,displacement:"icon-offset"in C?_y(w,"layout","icon-offset",p,d,v,g).map((function(t){return-t*_t.pixelRatio})):void 0}),f[yt]=H}}H&&(++_,(D=P[_])&&D.getImage()&&!D.getFill()&&!D.getStroke()||(D=new hl,P[_]=D),D.setGeometry(Q),H.setRotation(Y+oy(_y(w,"layout","icon-rotate",p,d,v,g))),H.setOpacity(_y(w,"paint","icon-opacity",p,d,v,g)),H.setAnchor(my[_y(w,"layout","icon-anchor",p,d,v,g)]),D.setImage(H),K=D.getText(),D.setText(void 0),D.setZIndex(A),X=!0,$=!1)}else $=!0}}}if(1==h&&"circle"===w.type){++_,(D=P[_])&&D.getImage()&&!D.getFill()&&!D.getStroke()||(D=new hl,P[_]=D);var bt="circle-radius"in z?_y(w,"paint","circle-radius",p,d,v,g):5,xt=xy(_y(w,"paint","circle-stroke-color",p,d,v,g),_y(w,"paint","circle-stroke-opacity",p,d,v,g)),kt=xy(_y(w,"paint","circle-color",p,d,v,g),_y(w,"paint","circle-opacity",p,d,v,g)),wt=_y(w,"paint","circle-stroke-width",p,d,v,g),St=bt+"."+xt+"."+kt+"."+wt;(H=f[St])||(H=new rl({radius:bt,stroke:xt&&wt>0?new tl({width:wt,color:xt}):void 0,fill:kt?new Is({color:kt}):void 0}),f[St]=H),D.setImage(H),K=D.getText(),D.setText(void 0),D.setGeometry(void 0),D.setZIndex(A),X=!0}var Ct=void 0,zt=void 0,Et=void 0,Tt=void 0,Pt=void 0,Ot=void 0;if("text-field"in C){Tt=Math.round(_y(w,"layout","text-size",p,d,v,g));var Ft=_y(w,"layout","text-font",p,d,v,g);Et=_y(w,"layout","text-line-height",p,d,v,g),(zt=iy(a?a(Ft):Ft,Tt,Et)).includes("sans-serif")||(zt+=",sans-serif"),Pt=_y(w,"layout","text-letter-spacing",p,d,v,g),Ot=_y(w,"layout","text-max-width",p,d,v,g);var Rt=_y(w,"layout","text-field",p,d,v,g);Ct="object"==typeof Rt&&Rt.sections?1===Rt.sections.length?Rt.toString():Rt.sections.reduce((function(t,e,i){var o=e.fontStack?e.fontStack.split(","):Ft,n=iy(a?a(o):o,Tt*(e.scale||1),Et),r=e.text;if("\n"===r)return t.push("\n",""),t;if(2!=h){for(var s=0,l=(r=dy(r,n,Ot,Pt).split("\n")).length;s<l;++s)s>0&&t.push("\n",""),t.push(r[s],n);return t}t.push(ly(r,Pt),n)}),[]):wy(Rt,r).trim(),R=_y(w,"paint","text-opacity",p,d,v,g)}if(Ct&&R&&!$){X||(++_,(D=P[_])&&D.getText()&&!D.getFill()&&!D.getStroke()||(D=new hl,P[_]=D),D.setImage(void 0),D.setGeometry(void 0)),D.getText()||D.setText(K||new gl({padding:[2,2,2,2]})),K=D.getText();var It=C["text-transform"];"uppercase"==It?Ct=Array.isArray(Ct)?Ct.map((function(t,e){return e%2?t:t.toUpperCase()})):Ct.toUpperCase():"lowercase"==It&&(Ct=Array.isArray(Ct)?Ct.map((function(t,e){return e%2?t:t.toLowerCase()})):Ct.toLowerCase());var Mt=Array.isArray(Ct)?Ct:2==h?ly(Ct,Pt):dy(Ct,zt,Ot,Pt);K.setText(Mt),K.setFont(zt),K.setRotation(oy(_y(w,"layout","text-rotate",p,d,v,g)));var jt=_y(w,"layout","text-anchor",p,d,v,g),Dt=X||1==h?"point":_y(w,"layout","symbol-placement",p,d,v,g);K.setPlacement(Dt),K.setOverflow("point"===Dt);var At=_y(w,"paint","text-halo-width",p,d,v,g),Lt=_y(w,"layout","text-offset",p,d,v,g),Gt=_y(w,"paint","text-translate",p,d,v,g),Nt=0,Bt=0;if("point"==Dt){var Vt="center";-1!==jt.indexOf("left")?(Vt="left",Bt=At):-1!==jt.indexOf("right")&&(Vt="right",Bt=-At),K.setTextAlign(Vt);var qt=_y(w,"layout","text-rotation-alignment",p,d,v,g);K.setRotateWithView("map"==qt)}else K.setMaxAngle(oy(_y(w,"layout","text-max-angle",p,d,v,g))*Ct.length/Mt.length),K.setTextAlign(),K.setRotateWithView(!1);var Wt="middle";0==jt.indexOf("bottom")?(Wt="bottom",Nt=-At-.5*(Et-1)*Tt):0==jt.indexOf("top")&&(Wt="top",Nt=At+.5*(Et-1)*Tt),K.setTextBaseline(Wt),K.setOffsetX(Lt[0]*Tt+Bt+Gt[0]),K.setOffsetY(Lt[1]*Tt+Nt+Gt[1]),T.setColor(xy(_y(w,"paint","text-color",p,d,v,g),R)),K.setFill(T);var Ut=xy(_y(w,"paint","text-halo-color",p,d,v,g),R);if(Ut){E.setColor(Ut),At*=2;var Xt=.5*Tt;E.setWidth(At<=Xt?At:Xt),K.setStroke(E)}else K.setStroke(void 0);var Kt=_y(w,"layout","text-padding",p,d,v,g),Yt=K.getPadding();Kt!==Yt[0]&&(Yt[0]=Kt,Yt[1]=Kt,Yt[2]=Kt,Yt[3]=Kt),D.setZIndex(A)}}}}return _>-1?(P.length=_+1,P):void 0}};return t.setStyle(O),t.set("mapbox-source",h),t.set("mapbox-layers",g),t.set("mapbox-featurestate",{}),O}new Rs;f`.ol-box {
45
45
  box-sizing: border-box;
46
46
  border-radius: 2px;
47
47
  border: 1.5px solid rgb(179,197,219);
@@ -366,7 +366,7 @@ var Gc=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.r
366
366
  left: 0;
367
367
  z-index: 100;
368
368
  background: white;
369
- }`,Ey=Object.freeze,Ty=Object.defineProperty,Py=Object.getOwnPropertyDescriptor,Oy=(t,e,i,o)=>{for(var n,r=o>1?void 0:o?Py(e,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o?n(e,i,r):n(r))||r);return o&&r&&Ty(e,i,r),r};let Fy=class extends dt{constructor(){super(),this.id="map",this.latitude=51.507351,this.longitude=-.127758,this.zoom=10,this.minZoom=7,this.maxZoom=22,this.drawMode=!1,this.drawGeojsonData={type:"Feature",geometry:{}},this.drawGeojsonDataBuffer=100,this.drawPointer="crosshair",this.showFeaturesAtPoint=!1,this.clickFeatures=!1,this.featureColor="#0000ff",this.featureFill=!1,this.featureBuffer=40,this.geojsonData={type:"FeatureCollection",features:[]},this.geojsonColor="#ff0000",this.geojsonFill=!1,this.geojsonBuffer=12,this.disableVectorTiles=!1,this.osVectorTilesApiKey="a69TM3Yjy4YUiAXFAyI6KyadBPrwYqex",this.osFeaturesApiKey="a69TM3Yjy4YUiAXFAyI6KyadBPrwYqex",this.osCopyright=`© Crown copyright and database rights ${(new Date).getFullYear()} OS (0)100024857`,this.hideResetControl=!1,this.staticMode=!1,this.areaUnit="m2",this.showScale=!1,this.useScaleBarStyle=!1,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}firstUpdated(){var t;const e=this.renderRoot.querySelector(`#${this.id}`),i=!this.disableVectorTiles&&Boolean(this.osVectorTilesApiKey),o=(n=this.osCopyright,r=this.osVectorTilesApiKey,new yc({source:r?new bc({url:"https://api.os.uk/maps/raster/v1/zxy/Light_3857/{z}/{x}/{y}.png?key="+r,attributions:[n],attributionsCollapsible:!1,maxZoom:20}):new wc({attributions:[kc]})}));var n,r;const a=function(t,e){let i=new vd({declutter:!0,source:new $d({format:new Bl,url:"https://api.os.uk/maps/vector/v1/vts/tile/{z}/{y}/{x}.pbf?srs=3857&key="+e,attributions:[t],attributionsCollapsible:!1})});return e&&fetch("https://api.os.uk/maps/vector/v1/vts/resources/styles?srs=3857&key="+e).then((t=>t.json())).then((t=>Sy(i,t,"esri"))).catch((t=>console.log(t))),i}(this.osCopyright,this.osVectorTilesApiKey),s=new tc({target:e,layers:[i?a:o],view:new Na({projection:"EPSG:3857",extent:(u=[-10.76418,49.528423,1.9134116,61.331151],p="EPSG:4326",h="EPSG:3857",Oo(u,sn(p,h),void 0,d)),minZoom:this.minZoom,maxZoom:this.maxZoom,center:nn([this.longitude,this.latitude]),zoom:this.zoom,enableRotation:!1}),controls:Qa({attribution:!0,zoom:!this.staticMode}).extend(this.showScale?[(l=this.useScaleBarStyle,new Ja({units:"metric",bar:l,steps:4,text:!0,minWidth:140}))]:[]),interactions:td({doubleClickZoom:!this.staticMode,dragPan:!this.staticMode,mouseWheelZoom:!this.staticMode})});var l,u,p,h,d;this.map=s;const c=(g=this.drawPointer,new Gh({source:Dc,type:"Polygon",style:new ll({stroke:Fc,fill:Rc,image:"crosshair"===g?Ic:Mc})}));var g;const f=function(t){return new Zh({source:Dc,style:new ll({image:"crosshair"===t?Ic:Mc})})}(this.drawPointer),m=document.createElement("button");m.innerHTML="↻",m.title="Reset map view";m.addEventListener("click",(()=>{this.showFeaturesAtPoint?Fg(s,Mg,this.featureBuffer):b.getFeatures().length>0?Fg(s,b,this.geojsonBuffer):(s.getView().setCenter(nn([this.longitude,this.latitude])),s.getView().setZoom(this.zoom)),this.drawMode&&(Dc.clear(),this.dispatch("geojsonChange",{}),this.dispatch("areaChange",`0 ${"m2"===this.areaUnit?"m²":this.areaUnit}`),s.addInteraction(c),s.addInteraction(Lc))}),!1);const v=document.createElement("div");v.className="reset-control ol-unselectable ol-control",v.appendChild(m);var y=new _e({element:v});this.hideResetControl||s.addControl(y);const _=null==(t=this.renderRoot)?void 0:t.querySelectorAll(".ol-control button");null==_||_.forEach((t=>t.setAttribute("aria-label",t.getAttribute("title")||""))),s.on("pointerdrag",(()=>{s.getViewport().style.cursor="grabbing"})),s.on("pointermove",(()=>{s.getViewport().style.cursor="grab"}));const b=new Ph;if("FeatureCollection"===this.geojsonData.type){let t=(new Ps).readFeatures(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeatures(t)}else if("Feature"===this.geojsonData.type){let t=(new Ps).readFeature(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeature(t)}const x=new dh({source:b,style:new ll({stroke:new $s({color:this.geojsonColor,width:3}),fill:new Os({color:this.geojsonFill?Rg(this.geojsonColor,.2):Rg(this.geojsonColor,0)})})});if(s.addLayer(x),b.getFeatures().length>0){Fg(s,b,this.geojsonBuffer);const t=b.getFeatures()[0].getGeometry();t&&this.dispatch("geojsonDataArea",Og(t,this.areaUnit))}if(this.drawMode){Dc.clear();const t=Object.keys(this.drawGeojsonData.geometry).length>0;if(t){let t=(new Ps).readFeature(this.drawGeojsonData,{featureProjection:"EPSG:3857"});Dc.addFeature(t),Fg(s,Dc,this.drawGeojsonDataBuffer)}s.addLayer(Ac),t||s.addInteraction(c),s.addInteraction(f),s.addInteraction(Lc),Dc.on("change",(()=>{var t;const e=Dc.getFeatures();if(e.length>0){const o=null==(t="string"==typeof(i=e)?i[i.length-1]||"":i[i.length-1])?void 0:t.getGeometry();this.dispatch("geojsonChange",(new Ps).writeFeaturesObject(e,{featureProjection:"EPSG:3857"})),o&&this.dispatch("areaChange",Og(o,this.areaUnit)),s.removeInteraction(c)}var i}))}if(this.drawMode&&Boolean(this.osVectorTilesApiKey)&&!this.disableVectorTiles){const t=20;if(s.addLayer(Ec),Ac.setZIndex(1001),this.zoom<t){zc.clear();const t=s.getView().calculateExtent(s.getSize());Tc(a,t)}s.on("moveend",(()=>{const e=s.getView().getZoom();e&&e<t?zc.clear():setTimeout((()=>{zc.clear();const t=s.getView().calculateExtent(s.getSize());Tc(a,t)}),200)}))}if(this.showFeaturesAtPoint&&Boolean(this.osFeaturesApiKey)){jg(nn([this.longitude,this.latitude]),this.osFeaturesApiKey,!1),this.clickFeatures&&s.on("singleclick",(t=>{jg(t.coordinate,this.osFeaturesApiKey,!0)}));const t=(k=this.featureColor,w=this.featureFill,new dh({source:Mg,style:new ll({stroke:new $s({width:3,color:k}),fill:new Os({color:Rg(k,w?.2:0)})})}));s.addLayer(t),Mg.on("change",(()=>{if("ready"===Mg.getState()&&Mg.getFeatures().length>0){Fg(s,Mg,this.featureBuffer),this.dispatch("featuresGeojsonChange",(new Ps).writeFeaturesObject(Mg.getFeatures(),{featureProjection:"EPSG:3857"}));const t=Mg.getFeatures()[0].getGeometry();t&&this.dispatch("featuresAreaChange",Og(t,this.areaUnit))}}))}var k,w;setTimeout((()=>{window.dispatchEvent(new Event("resize")),e.style.opacity="1",this.dispatch("ready")}),500)}render(){return U(Cy||(Cy=Ey(Ty(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <link rel="stylesheet" href="https://cdn.skypack.dev/ol@^6.6.1/ol.css" />\n <div id="','" class="map" tabindex="0" />'],"raw",{value:Ey(e||t.slice())}))),this.id);var t,e}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.map)||t.dispose()}};Fy.styles=g(zy),Oy([ft({type:String})],Fy.prototype,"id",2),Oy([ft({type:Number})],Fy.prototype,"latitude",2),Oy([ft({type:Number})],Fy.prototype,"longitude",2),Oy([ft({type:Number})],Fy.prototype,"zoom",2),Oy([ft({type:Number})],Fy.prototype,"minZoom",2),Oy([ft({type:Number})],Fy.prototype,"maxZoom",2),Oy([ft({type:Boolean})],Fy.prototype,"drawMode",2),Oy([ft({type:Object})],Fy.prototype,"drawGeojsonData",2),Oy([ft({type:Number})],Fy.prototype,"drawGeojsonDataBuffer",2),Oy([ft({type:String})],Fy.prototype,"drawPointer",2),Oy([ft({type:Boolean})],Fy.prototype,"showFeaturesAtPoint",2),Oy([ft({type:Boolean})],Fy.prototype,"clickFeatures",2),Oy([ft({type:String})],Fy.prototype,"featureColor",2),Oy([ft({type:Boolean})],Fy.prototype,"featureFill",2),Oy([ft({type:Number})],Fy.prototype,"featureBuffer",2),Oy([ft({type:Object})],Fy.prototype,"geojsonData",2),Oy([ft({type:String})],Fy.prototype,"geojsonColor",2),Oy([ft({type:Boolean})],Fy.prototype,"geojsonFill",2),Oy([ft({type:Number})],Fy.prototype,"geojsonBuffer",2),Oy([ft({type:Boolean})],Fy.prototype,"disableVectorTiles",2),Oy([ft({type:String})],Fy.prototype,"osVectorTilesApiKey",2),Oy([ft({type:String})],Fy.prototype,"osFeaturesApiKey",2),Oy([ft({type:String})],Fy.prototype,"osCopyright",2),Oy([ft({type:Boolean})],Fy.prototype,"hideResetControl",2),Oy([ft({type:Boolean})],Fy.prototype,"staticMode",2),Oy([ft({type:String})],Fy.prototype,"areaUnit",2),Oy([ft({type:Boolean})],Fy.prototype,"showScale",2),Oy([ft({type:Boolean})],Fy.prototype,"useScaleBarStyle",2),Fy=Oy([ct("my-map")],Fy);var Ry,Iy={exports:{}};Ry=Iy,function(t,e){Ry.exports=e()}(window,(function(){return function(t){var e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(o,n,function(e){return t[e]}.bind(null,n));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/",i(i.s=37)}([function(t,e,i){var o=i(1),n=i(6),r=i(7),a=i(16),s=i(18),l="prototype",u=function(t,e,i){var p,h,d,c,g=t&u.F,f=t&u.G,m=t&u.S,v=t&u.P,y=t&u.B,_=f?o:m?o[e]||(o[e]={}):(o[e]||{})[l],b=f?n:n[e]||(n[e]={}),x=b[l]||(b[l]={});for(p in f&&(i=e),i)d=((h=!g&&_&&void 0!==_[p])?_:i)[p],c=y&&h?s(d,o):v&&"function"==typeof d?s(Function.call,d):d,_&&a(_,p,d,t&u.U),b[p]!=d&&r(b,p,c),v&&x[p]!=d&&(x[p]=d)};o.core=n,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){t.exports=!i(4)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,i){i.r(e),i.d(e,"h",(function(){return s})),i.d(e,"createElement",(function(){return s})),i.d(e,"cloneElement",(function(){return p})),i.d(e,"Component",(function(){return M})),i.d(e,"render",(function(){return j})),i.d(e,"rerender",(function(){return g})),i.d(e,"options",(function(){return n}));var o=function(){},n={},r=[],a=[];function s(t,e){var i,s,l,u,p=a;for(u=arguments.length;2<u--;)r.push(arguments[u]);for(e&&null!=e.children&&(r.length||r.push(e.children),delete e.children);r.length;)if((s=r.pop())&&void 0!==s.pop)for(u=s.length;u--;)r.push(s[u]);else"boolean"==typeof s&&(s=null),(l="function"!=typeof t)&&(null==s?s="":"number"==typeof s?s=String(s):"string"!=typeof s&&(l=!1)),l&&i?p[p.length-1]+=s:p===a?p=[s]:p.push(s),i=l;var h=new o;return h.nodeName=t,h.children=p,h.attributes=null==e?void 0:e,h.key=null==e?void 0:e.key,void 0!==n.vnode&&n.vnode(h),h}function l(t,e){for(var i in e)t[i]=e[i];return t}var u="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function p(t,e){return s(t.nodeName,l(l({},t.attributes),e),2<arguments.length?[].slice.call(arguments,2):t.children)}var h=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,d=[];function c(t){!t._dirty&&(t._dirty=!0)&&1==d.push(t)&&(n.debounceRendering||u)(g)}function g(){var t,e=d;for(d=[];t=e.pop();)t._dirty&&R(t)}function f(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function m(t){var e=l({},t.attributes);e.children=t.children;var i=t.nodeName.defaultProps;if(void 0!==i)for(var o in i)void 0===e[o]&&(e[o]=i[o]);return e}function v(t){var e=t.parentNode;e&&e.removeChild(t)}function y(t,e,i,o,n){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)i&&i(null),o&&o(t);else if("class"!==e||n)if("style"===e){if(o&&"string"!=typeof o&&"string"!=typeof i||(t.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof i)for(var r in i)r in o||(t.style[r]="");for(var r in o)t.style[r]="number"==typeof o[r]&&!1===h.test(r)?o[r]+"px":o[r]}}else if("dangerouslySetInnerHTML"===e)o&&(t.innerHTML=o.__html||"");else if("o"==e[0]&&"n"==e[1]){var a=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),o?i||t.addEventListener(e,_,a):t.removeEventListener(e,_,a),(t._listeners||(t._listeners={}))[e]=o}else if("list"!==e&&"type"!==e&&!n&&e in t){try{t[e]=null==o?"":o}catch(l){}null!=o&&!1!==o||"spellcheck"==e||t.removeAttribute(e)}else{var s=n&&e!==(e=e.replace(/^xlink:?/,""));null==o||!1===o?s?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof o&&(s?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),o):t.setAttribute(e,o))}else t.className=o||""}function _(t){return this._listeners[t.type](n.event&&n.event(t)||t)}var b=[],x=0,k=!1,w=!1;function S(){for(var t;t=b.pop();)n.afterMount&&n.afterMount(t),t.componentDidMount&&t.componentDidMount()}function C(t,e,i,o,n){var r=t,a=k;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||n)?t.nodeValue!=e&&(t.nodeValue=e):(r=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0))),r.__preactattr_=!0,r;var s,l,u=e.nodeName;if("function"==typeof u)return function(t,e,i,o){for(var n=t&&t._component,r=n,a=t,s=n&&t._componentConstructor===e.nodeName,l=s,u=m(e);n&&!l&&(n=n._parentComponent);)l=n.constructor===e.nodeName;return n&&l&&(!o||n._component)?(F(n,u,3,i,o),t=n.base):(r&&!s&&(I(r),t=a=null),n=P(e.nodeName,u,i),t&&!n.nextBase&&(n.nextBase=t,a=null),F(n,u,1,i,o),t=n.base,a&&t!==a&&(a._component=null,z(a,!1))),t}(t,e,i,o);if(k="svg"===u||"foreignObject"!==u&&k,u=String(u),(!t||!f(t,u))&&(s=u,(l=k?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s)).normalizedNodeName=s,r=l,t)){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0)}var p=r.firstChild,h=r.__preactattr_,d=e.children;if(null==h){h=r.__preactattr_={};for(var c=r.attributes,g=c.length;g--;)h[c[g].name]=c[g].value}return!w&&d&&1===d.length&&"string"==typeof d[0]&&null!=p&&void 0!==p.splitText&&null==p.nextSibling?p.nodeValue!=d[0]&&(p.nodeValue=d[0]):(d&&d.length||null!=p)&&function(t,e,i,o,n){var r,a,s,l,u,p,h,d,c=t.childNodes,g=[],m={},y=0,_=0,b=c.length,x=0,k=e?e.length:0;if(0!==b)for(var w=0;w<b;w++){var S=c[w],E=S.__preactattr_;null!=(T=k&&E?S._component?S._component.__key:E.key:null)?(y++,m[T]=S):(E||(void 0!==S.splitText?!n||S.nodeValue.trim():n))&&(g[x++]=S)}if(0!==k)for(w=0;w<k;w++){var T;if(u=null,null!=(T=(l=e[w]).key))y&&void 0!==m[T]&&(u=m[T],m[T]=void 0,y--);else if(_<x)for(r=_;r<x;r++)if(void 0!==g[r]&&(p=a=g[r],d=n,"string"==typeof(h=l)||"number"==typeof h?void 0!==p.splitText:"string"==typeof h.nodeName?!p._componentConstructor&&f(p,h.nodeName):d||p._componentConstructor===h.nodeName)){u=a,g[r]=void 0,r===x-1&&x--,r===_&&_++;break}u=C(u,l,i,o),s=c[w],u&&u!==t&&u!==s&&(null==s?t.appendChild(u):u===s.nextSibling?v(s):t.insertBefore(u,s))}if(y)for(var w in m)void 0!==m[w]&&z(m[w],!1);for(;_<=x;)void 0!==(u=g[x--])&&z(u,!1)}(r,d,i,o,w||null!=h.dangerouslySetInnerHTML),function(t,e,i){var o;for(o in i)e&&null!=e[o]||null==i[o]||y(t,o,i[o],i[o]=void 0,k);for(o in e)"children"===o||"innerHTML"===o||o in i&&e[o]===("value"===o||"checked"===o?t[o]:i[o])||y(t,o,i[o],i[o]=e[o],k)}(r,e.attributes,h),k=a,r}function z(t,e){var i=t._component;i?I(i):(null!=t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),!1!==e&&null!=t.__preactattr_||v(t),E(t))}function E(t){for(t=t.lastChild;t;){var e=t.previousSibling;z(t,!0),t=e}}var T=[];function P(t,e,i){var o,n=T.length;for(t.prototype&&t.prototype.render?(o=new t(e,i),M.call(o,e,i)):((o=new M(e,i)).constructor=t,o.render=O);n--;)if(T[n].constructor===t)return o.nextBase=T[n].nextBase,T.splice(n,1),o;return o}function O(t,e,i){return this.constructor(t,i)}function F(t,e,i,o,r){t._disable||(t._disable=!0,t.__ref=e.ref,t.__key=e.key,delete e.ref,delete e.key,void 0===t.constructor.getDerivedStateFromProps&&(!t.base||r?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(e,o)),o&&o!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=o),t.prevProps||(t.prevProps=t.props),t.props=e,t._disable=!1,0!==i&&(1!==i&&!1===n.syncComponentUpdates&&t.base?c(t):R(t,1,r)),t.__ref&&t.__ref(t))}function R(t,e,i,o){if(!t._disable){var r,a,s,u=t.props,p=t.state,h=t.context,d=t.prevProps||u,c=t.prevState||p,g=t.prevContext||h,f=t.base,v=t.nextBase,y=f||v,_=t._component,E=!1,T=g;if(t.constructor.getDerivedStateFromProps&&(p=l(l({},p),t.constructor.getDerivedStateFromProps(u,p)),t.state=p),f&&(t.props=d,t.state=c,t.context=g,2!==e&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(u,p,h)?E=!0:t.componentWillUpdate&&t.componentWillUpdate(u,p,h),t.props=u,t.state=p,t.context=h),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!E){r=t.render(u,p,h),t.getChildContext&&(h=l(l({},h),t.getChildContext())),f&&t.getSnapshotBeforeUpdate&&(T=t.getSnapshotBeforeUpdate(d,c));var O,M,j=r&&r.nodeName;if("function"==typeof j){var D=m(r);(a=_)&&a.constructor===j&&D.key==a.__key?F(a,D,1,h,!1):(O=a,t._component=a=P(j,D,h),a.nextBase=a.nextBase||v,a._parentComponent=t,F(a,D,0,h,!1),R(a,1,i,!0)),M=a.base}else s=y,(O=_)&&(s=t._component=null),(y||1===e)&&(s&&(s._component=null),M=function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(s,r,h,i||!f,y&&y.parentNode,!0));if(y&&M!==y&&a!==_){var A=y.parentNode;A&&M!==A&&(A.replaceChild(M,y),O||(y._component=null,z(y,!1)))}if(O&&I(O),(t.base=M)&&!o){for(var L=t,G=t;G=G._parentComponent;)(L=G).base=M;M._component=L,M._componentConstructor=L.constructor}}for(!f||i?b.unshift(t):E||(t.componentDidUpdate&&t.componentDidUpdate(d,c,T),n.afterUpdate&&n.afterUpdate(t));t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);x||o||S()}}function I(t){n.beforeUnmount&&n.beforeUnmount(t);var e=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var i=t._component;i?I(i):e&&(e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),v(t.nextBase=e),T.push(t),E(e)),t.__ref&&t.__ref(null)}function M(t,e){this._dirty=!0,this.context=e,this.props=t,this.state=this.state||{},this._renderCallbacks=[]}function j(t,e,i){return function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(i,t,{},!1,e,!1)}l(M.prototype,{setState:function(t,e){this.prevState||(this.prevState=this.state),this.state=l(l({},this.state),"function"==typeof t?t(this.state,this.props):t),e&&this._renderCallbacks.push(e),c(this)},forceUpdate:function(t){t&&this._renderCallbacks.push(t),R(this,2)},render:function(){}});var D={h:s,createElement:s,cloneElement:p,Component:M,render:j,rerender:g,options:n};e.default=D},function(t,e){var i=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=i)},function(t,e,i){var o=i(8),n=i(40);t.exports=i(3)?function(t,e,i){return o.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var o=i(9),n=i(38),r=i(39),a=Object.defineProperty;e.f=i(3)?Object.defineProperty:function(t,e,i){if(o(t),e=r(e,!0),o(i),n)try{return a(t,e,i)}catch(s){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var o=i(2);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var i=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+o).toString(36))}},function(t,e,i){var o=i(22);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var o=i(4);t.exports=function(t,e){return!!t&&o((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,i){var o=i(0);o(o.S+o.F,"Object",{assign:i(41)})},function(t,e,i){var o=i(2),n=i(1).document,r=o(n)&&o(n.createElement);t.exports=function(t){return r?n.createElement(t):{}}},function(t,e,i){var o=i(1),n=i(7),r=i(17),a=i(10)("src"),s="toString",l=Function[s],u=(""+l).split(s);i(6).inspectSource=function(t){return l.call(t)},(t.exports=function(t,e,i,s){var l="function"==typeof i;l&&(r(i,"name")||n(i,"name",e)),t[e]!==i&&(l&&(r(i,a)||n(i,a,t[e]?""+t[e]:u.join(String(e)))),t===o?t[e]=i:s?t[e]?t[e]=i:n(t,e,i):(delete t[e],n(t,e,i)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||l.call(this)}))},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var o=i(19);t.exports=function(t,e,i){if(o(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,o){return t.call(e,i,o)};case 3:return function(i,o,n){return t.call(e,i,o,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var o=i(42),n=i(28);t.exports=Object.keys||function(t){return o(t,n)}},function(t,e,i){var o=i(11),n=i(12);t.exports=function(t){return o(n(t))}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e,i){var o=i(21),n=i(24),r=i(43);t.exports=function(t){return function(e,i,a){var s,l=o(e),u=n(l.length),p=r(a,u);if(t&&i!=i){for(;p<u;)if((s=l[p++])!=s)return!0}else for(;p<u;p++)if((t||p in l)&&l[p]===i)return t||p||0;return!t&&-1}}},function(t,e,i){var o=i(25),n=Math.min;t.exports=function(t){return 0<t?n(o(t),9007199254740991):0}},function(t,e){var i=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(0<t?o:i)(t)}},function(t,e,i){var o=i(27)("keys"),n=i(10);t.exports=function(t){return o[t]||(o[t]=n(t))}},function(t,e,i){var o=i(6),n=i(1),r="__core-js_shared__",a=n[r]||(n[r]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:o.version,mode:i(44)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){var o=i(12);t.exports=function(t){return Object(o(t))}},function(t,e,i){var o=i(8).f,n=Function.prototype,r=/^\s*function ([^ (]*)/;"name"in n||i(3)&&o(n,"name",{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(t){return""}}})},function(t,e,i){var o=i(0),n=i(32)(1);o(o.P+o.F*!i(13)([].map,!0),"Array",{map:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(18),n=i(11),r=i(29),a=i(24),s=i(47);t.exports=function(t,e){var i=1==t,l=2==t,u=3==t,p=4==t,h=6==t,d=5==t||h,c=e||s;return function(e,s,g){for(var f,m,v=r(e),y=n(v),_=o(s,g,3),b=a(y.length),x=0,k=i?c(e,b):l?c(e,0):void 0;x<b;x++)if((d||x in y)&&(m=_(f=y[x],x,v),t))if(i)k[x]=m;else if(m)switch(t){case 3:return!0;case 5:return f;case 6:return x;case 2:k.push(f)}else if(p)return!1;return h?-1:u||p?p:k}}},function(t,e,i){var o=i(22);t.exports=Array.isArray||function(t){return"Array"==o(t)}},function(t,e,i){var o=i(27)("wks"),n=i(10),r=i(1).Symbol,a="function"==typeof r;(t.exports=function(t){return o[t]||(o[t]=a&&r[t]||(a?r:n)("Symbol."+t))}).store=o},function(t,e,i){var o=i(0),n=i(23)(!1),r=[].indexOf,a=!!r&&1/[1].indexOf(1,-0)<0;o(o.P+o.F*(a||!i(13)(r)),"Array",{indexOf:function(t){return a?r.apply(this,arguments)||0:n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Object",{create:i(52)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(30),i(31),i(35),i(49),i(50);var o,n=i(5),r=(o=i(51))&&o.__esModule?o:{default:o};function a(t){if(!t.element)throw new Error("element is not defined");if(!t.id)throw new Error("id is not defined");if(!t.source)throw new Error("source is not defined");Array.isArray(t.source)&&(t.source=s(t.source)),(0,n.render)((0,n.createElement)(r.default,t),t.element)}var s=function(t){return function(e,i){i(t.filter((function(t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())})))}};a.enhanceSelectElement=function(t){if(!t.selectElement)throw new Error("selectElement is not defined");if(!t.source){var e=[].filter.call(t.selectElement.options,(function(e){return e.value||t.preserveNullOptions}));t.source=e.map((function(t){return t.textContent||t.innerText}))}if(t.onConfirm=t.onConfirm||function(e){var i=[].filter.call(t.selectElement.options,(function(t){return(t.textContent||t.innerText)===e}))[0];i&&(i.selected=!0)},t.selectElement.value||void 0===t.defaultValue){var i=t.selectElement.options[t.selectElement.options.selectedIndex];t.defaultValue=i.textContent||i.innerText}void 0===t.name&&(t.name=""),void 0===t.id&&(void 0===t.selectElement.id?t.id="":t.id=t.selectElement.id),void 0===t.autoselect&&(t.autoselect=!0);var o=document.createElement("div");t.selectElement.parentNode.insertBefore(o,t.selectElement),a(Object.assign({},t,{element:o})),t.selectElement.style.display="none",t.selectElement.id=t.selectElement.id+"-select"};var l=a;e.default=l},function(t,e,i){t.exports=!i(3)&&!i(4)((function(){return 7!=Object.defineProperty(i(15)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,i){var o=i(2);t.exports=function(t,e){if(!o(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!o(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){var o=i(20),n=i(45),r=i(46),a=i(29),s=i(11),l=Object.assign;t.exports=!l||i(4)((function(){var t={},e={},i=Symbol(),o="abcdefghijklmnopqrst";return t[i]=7,o.split("").forEach((function(t){e[t]=t})),7!=l({},t)[i]||Object.keys(l({},e)).join("")!=o}))?function(t,e){for(var i=a(t),l=arguments.length,u=1,p=n.f,h=r.f;u<l;)for(var d,c=s(arguments[u++]),g=p?o(c).concat(p(c)):o(c),f=g.length,m=0;m<f;)h.call(c,d=g[m++])&&(i[d]=c[d]);return i}:l},function(t,e,i){var o=i(17),n=i(21),r=i(23)(!1),a=i(26)("IE_PROTO");t.exports=function(t,e){var i,s=n(t),l=0,u=[];for(i in s)i!=a&&o(s,i)&&u.push(i);for(;e.length>l;)o(s,i=e[l++])&&(~r(u,i)||u.push(i));return u}},function(t,e,i){var o=i(25),n=Math.max,r=Math.min;t.exports=function(t,e){return(t=o(t))<0?n(t+e,0):r(t,e)}},function(t,e){t.exports=!1},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){var o=i(48);t.exports=function(t,e){return new(o(t))(e)}},function(t,e,i){var o=i(2),n=i(33),r=i(34)("species");t.exports=function(t){var e;return n(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!n(e.prototype)||(e=void 0),o(e)&&null===(e=e[r])&&(e=void 0)),void 0===e?Array:e}},function(t,e,i){var o=i(0),n=i(32)(2);o(o.P+o.F*!i(13)([].filter,!0),"Array",{filter:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Array",{isArray:i(33)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(36),i(30),i(31),i(35),i(55),i(58);var o=i(5),n=a(i(60)),r=a(i(61));function a(t){return t&&t.__esModule?t:{default:t}}function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t}).apply(this,arguments)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var u={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function p(){return"undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var h=function(t){function e(e){var i;return(i=t.call(this,e)||this).elementReferences={},i.state={focused:null,hovered:null,menuOpen:!1,options:e.defaultValue?[e.defaultValue]:[],query:e.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},i.handleComponentBlur=i.handleComponentBlur.bind(l(l(i))),i.handleKeyDown=i.handleKeyDown.bind(l(l(i))),i.handleUpArrow=i.handleUpArrow.bind(l(l(i))),i.handleDownArrow=i.handleDownArrow.bind(l(l(i))),i.handleEnter=i.handleEnter.bind(l(l(i))),i.handlePrintableKey=i.handlePrintableKey.bind(l(l(i))),i.handleListMouseLeave=i.handleListMouseLeave.bind(l(l(i))),i.handleOptionBlur=i.handleOptionBlur.bind(l(l(i))),i.handleOptionClick=i.handleOptionClick.bind(l(l(i))),i.handleOptionFocus=i.handleOptionFocus.bind(l(l(i))),i.handleOptionMouseDown=i.handleOptionMouseDown.bind(l(l(i))),i.handleOptionMouseEnter=i.handleOptionMouseEnter.bind(l(l(i))),i.handleInputBlur=i.handleInputBlur.bind(l(l(i))),i.handleInputChange=i.handleInputChange.bind(l(l(i))),i.handleInputFocus=i.handleInputFocus.bind(l(l(i))),i.pollInputElement=i.pollInputElement.bind(l(l(i))),i.getDirectInputChanges=i.getDirectInputChanges.bind(l(l(i))),i}var i,r;r=t,(i=e).prototype=Object.create(r.prototype),(i.prototype.constructor=i).__proto__=r;var a=e.prototype;return a.isQueryAnOption=function(t,e){var i=this;return-1!==e.map((function(t){return i.templateInputValue(t).toLowerCase()})).indexOf(t.toLowerCase())},a.componentDidMount=function(){this.pollInputElement()},a.componentWillUnmount=function(){clearTimeout(this.$pollInput)},a.pollInputElement=function(){var t=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){t.pollInputElement()}),100)},a.getDirectInputChanges=function(){var t=this.elementReferences[-1];t&&t.value!==this.state.query&&this.handleInputChange({target:{value:t.value}})},a.componentDidUpdate=function(t,e){var i=this.state.focused,o=null===i,n=e.focused!==i;n&&!o&&this.elementReferences[i].focus();var r=-1===i,a=n&&null===e.focused;if(r&&a){var s=this.elementReferences[i];s.setSelectionRange(0,s.value.length)}},a.hasAutoselect=function(){return!p()&&this.props.autoselect},a.templateInputValue=function(t){var e=this.props.templates&&this.props.templates.inputValue;return e?e(t):t},a.templateSuggestion=function(t){var e=this.props.templates&&this.props.templates.suggestion;return e?e(t):t},a.handleComponentBlur=function(t){var e,i=this.state,o=i.options,n=i.query,r=i.selected;this.props.confirmOnBlur?(e=t.query||n,this.props.onConfirm(o[r])):e=n,this.setState({focused:null,menuOpen:t.menuOpen||!1,query:e,selected:null,validChoiceMade:this.isQueryAnOption(e,o)})},a.handleListMouseLeave=function(t){this.setState({hovered:null})},a.handleOptionBlur=function(t,e){var i=this.state,o=i.focused,n=i.menuOpen,r=i.options,a=i.selected,s=null===t.relatedTarget,l=t.relatedTarget===this.elementReferences[-1],u=o!==e&&-1!==o;if(!u&&s||!u&&!l){var h=n&&p();this.handleComponentBlur({menuOpen:h,query:this.templateInputValue(r[a])})}},a.handleInputBlur=function(t){var e=this.state,i=e.focused,o=e.menuOpen,n=e.options,r=e.query,a=e.selected;if(-1===i){var s=o&&p(),l=p()?r:this.templateInputValue(n[a]);this.handleComponentBlur({menuOpen:s,query:l})}},a.handleInputChange=function(t){var e=this,i=this.props,o=i.minLength,n=i.source,r=i.showAllValues,a=this.hasAutoselect(),s=t.target.value,l=0===s.length,u=this.state.query.length!==s.length,p=s.length>=o;this.setState({query:s,ariaHint:l}),r||!l&&u&&p?n(s,(function(t){var i=0<t.length;e.setState({menuOpen:i,options:t,selected:a&&i?0:-1,validChoiceMade:!1})})):!l&&p||this.setState({menuOpen:!1,options:[]})},a.handleInputClick=function(t){this.handleInputChange(t)},a.handleInputFocus=function(t){var e=this.state,i=e.query,o=e.validChoiceMade,n=e.options,r=this.props.minLength,a=!o&&i.length>=r&&0<n.length;a?this.setState((function(t){var e=t.menuOpen;return{focused:-1,menuOpen:a||e,selected:-1}})):this.setState({focused:-1})},a.handleOptionFocus=function(t){this.setState({focused:t,hovered:null,selected:t})},a.handleOptionMouseEnter=function(t,e){p()||this.setState({hovered:e})},a.handleOptionClick=function(t,e){var i=this.state.options[e],o=this.templateInputValue(i);this.props.onConfirm(i),this.setState({focused:-1,hovered:null,menuOpen:!1,query:o,selected:-1,validChoiceMade:!0}),this.forceUpdate()},a.handleOptionMouseDown=function(t){t.preventDefault()},a.handleUpArrow=function(t){t.preventDefault();var e=this.state,i=e.menuOpen,o=e.selected;-1!==o&&i&&this.handleOptionFocus(o-1)},a.handleDownArrow=function(t){var e=this;if(t.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t,selected:0,focused:0,hovered:null})}));else if(!0===this.state.menuOpen){var i=this.state,o=i.menuOpen,n=i.options,r=i.selected;r!==n.length-1&&o&&this.handleOptionFocus(r+1)}},a.handleSpace=function(t){var e=this;this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t})}))),-1!==this.state.focused&&(t.preventDefault(),this.handleOptionClick(t,this.state.focused))},a.handleEnter=function(t){this.state.menuOpen&&(t.preventDefault(),0<=this.state.selected&&this.handleOptionClick(t,this.state.selected))},a.handlePrintableKey=function(t){var e=this.elementReferences[-1];t.target===e||e.focus()},a.handleKeyDown=function(t){switch(u[t.keyCode]){case"up":this.handleUpArrow(t);break;case"down":this.handleDownArrow(t);break;case"space":this.handleSpace(t);break;case"enter":this.handleEnter(t);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:(47<(e=t.keyCode)&&e<58||32===e||8===e||64<e&&e<91||95<e&&e<112||185<e&&e<193||218<e&&e<223)&&this.handlePrintableKey(t)}var e},a.render=function(){var t,e=this,i=this.props,r=i.cssNamespace,a=i.displayMenu,l=i.id,u=i.minLength,h=i.name,d=i.placeholder,c=i.required,g=i.showAllValues,f=i.tNoResults,m=i.tStatusQueryTooShort,v=i.tStatusNoResults,y=i.tStatusSelectedOption,_=i.tStatusResults,b=i.tAssistiveHint,x=i.dropdownArrow,k=this.state,w=k.focused,S=k.hovered,C=k.menuOpen,z=k.options,E=k.query,T=k.selected,P=k.ariaHint,O=k.validChoiceMade,F=this.hasAutoselect(),R=-1===w,I=0===z.length,M=0!==E.length,j=E.length>=u,D=this.props.showNoOptionsFound&&R&&I&&M&&j,A=r+"__wrapper",L=r+"__input",G=null!==w?" "+L+"--focused":"",N=this.props.showAllValues?" "+L+"--show-all-values":" "+L+"--default",B=r+"__dropdown-arrow-down",V=-1!==w&&null!==w,q=r+"__menu",W=q+"--"+a,U=q+"--"+(C||D?"visible":"hidden"),X=r+"__option",K=r+"__hint",Y=this.templateInputValue(z[T]),Z=Y&&0===Y.toLowerCase().indexOf(E.toLowerCase())&&F?E+Y.substr(E.length):"",H=l+"__assistiveHint",$=P?{"aria-describedby":H}:null;return g&&"string"==typeof(t=x({className:B}))&&(t=(0,o.createElement)("div",{className:r+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:t}})),(0,o.createElement)("div",{className:A,onKeyDown:this.handleKeyDown},(0,o.createElement)(n.default,{id:l,length:z.length,queryLength:E.length,minQueryLength:u,selectedOption:this.templateInputValue(z[T]),selectedOptionIndex:T,validChoiceMade:O,isInFocus:null!==this.state.focused,tQueryTooShort:m,tNoResults:v,tSelectedOption:y,tResults:_}),Z&&(0,o.createElement)("span",null,(0,o.createElement)("input",{className:K,readonly:!0,tabIndex:"-1",value:Z})),(0,o.createElement)("input",s({"aria-expanded":C?"true":"false","aria-activedescendant":!!V&&l+"__option--"+w,"aria-owns":l+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"},$,{autoComplete:"off",className:""+L+G+N,id:l,onClick:function(t){return e.handleInputClick(t)},onBlur:this.handleInputBlur},{onInput:this.handleInputChange},{onFocus:this.handleInputFocus,name:h,placeholder:d,ref:function(t){e.elementReferences[-1]=t},type:"text",role:"combobox",required:c,value:E})),t,(0,o.createElement)("ul",{className:q+" "+W+" "+U,onMouseLeave:function(t){return e.handleListMouseLeave(t)},id:l+"__listbox",role:"listbox"},z.map((function(t,i){var n=(-1===w?T===i:w===i)&&null===S?" "+X+"--focused":"",r=i%2?" "+X+"--odd":"",a=p()?"<span id="+l+"__option-suffix--"+i+' style="border:0;clip:rect(0 0 0 0);height:1px;marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;whiteSpace:nowrap;width:1px"> '+(i+1)+" of "+z.length+"</span>":"";return(0,o.createElement)("li",{"aria-selected":w===i?"true":"false",className:""+X+n+r,dangerouslySetInnerHTML:{__html:e.templateSuggestion(t)+a},id:l+"__option--"+i,key:i,onBlur:function(t){return e.handleOptionBlur(t,i)},onClick:function(t){return e.handleOptionClick(t,i)},onMouseDown:e.handleOptionMouseDown,onMouseEnter:function(t){return e.handleOptionMouseEnter(t,i)},ref:function(t){e.elementReferences[i]=t},role:"option",tabIndex:"-1","aria-posinset":i+1,"aria-setsize":z.length})})),D&&(0,o.createElement)("li",{className:X+" "+X+"--no-results"},f())),(0,o.createElement)("span",{id:H,style:{display:"none"}},b()))},e}(o.Component);(e.default=h).defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."},dropdownArrow:r.default}},function(t,e,i){var o=i(9),n=i(53),r=i(28),a=i(26)("IE_PROTO"),s=function(){},l="prototype",u=function(){var t,e=i(15)("iframe"),o=r.length;for(e.style.display="none",i(54).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;o--;)delete u[l][r[o]];return u()};t.exports=Object.create||function(t,e){var i;return null!==t?(s[l]=o(t),i=new s,s[l]=null,i[a]=t):i=u(),void 0===e?i:n(i,e)}},function(t,e,i){var o=i(8),n=i(9),r=i(20);t.exports=i(3)?Object.defineProperties:function(t,e){n(t);for(var i,a=r(e),s=a.length,l=0;l<s;)o.f(t,i=a[l++],e[i]);return t}},function(t,e,i){var o=i(1).document;t.exports=o&&o.documentElement},function(t,e,i){var o=i(0);o(o.P,"Function",{bind:i(56)})},function(t,e,i){var o=i(19),n=i(2),r=i(57),a=[].slice,s={};t.exports=Function.bind||function(t){var e=o(this),i=a.call(arguments,1),l=function(){var o=i.concat(a.call(arguments));return this instanceof l?function(t,e,i){if(!(e in s)){for(var o=[],n=0;n<e;n++)o[n]="a["+n+"]";s[e]=Function("F,a","return new F("+o.join(",")+")")}return s[e](t,i)}(e,o.length,o):r(e,o,t)};return n(e.prototype)&&(l.prototype=e.prototype),l}},function(t,e){t.exports=function(t,e,i){var o=void 0===i;switch(e.length){case 0:return o?t():t.call(i);case 1:return o?t(e[0]):t.call(i,e[0]);case 2:return o?t(e[0],e[1]):t.call(i,e[0],e[1]);case 3:return o?t(e[0],e[1],e[2]):t.call(i,e[0],e[1],e[2]);case 4:return o?t(e[0],e[1],e[2],e[3]):t.call(i,e[0],e[1],e[2],e[3])}return t.apply(i,e)}},function(t,e,i){i(59)("match",1,(function(t,e,i){return[function(i){var o=t(this),n=null==i?void 0:i[e];return void 0!==n?n.call(i,o):new RegExp(i)[e](String(o))},i]}))},function(t,e,i){var o=i(7),n=i(16),r=i(4),a=i(12),s=i(34);t.exports=function(t,e,i){var l=s(t),u=i(a,l,""[t]),p=u[0],h=u[1];r((function(){var e={};return e[l]=function(){return 7},7!=""[t](e)}))&&(n(String.prototype,t,p),o(RegExp.prototype,l,2==e?function(t,e){return h.call(t,this,e)}:function(t){return h.call(t,this)}))}},function(t,e,i){e.__esModule=!0,e.default=void 0,i(36);var o=i(5),n=function(t){function e(){for(var e,i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];return(e=t.call.apply(t,[this].concat(o))||this).state={bump:!1,debounced:!1},e}var i,n;n=t,(i=e).prototype=Object.create(n.prototype),(i.prototype.constructor=i).__proto__=n;var r=e.prototype;return r.componentWillMount=function(){var t=this;this.debounceStatusUpdate=function(t,e,i){var o;return function(){var n=this,r=arguments,a=function(){o=null,i||t.apply(n,r)},s=i&&!o;clearTimeout(o),o=setTimeout(a,e),s&&t.apply(n,r)}}((function(){if(!t.state.debounced){var e=!t.props.isInFocus||t.props.validChoiceMade;t.setState((function(t){return{bump:!t.bump,debounced:!0,silenced:e}}))}}),1400)},r.componentWillReceiveProps=function(t){t.queryLength,this.setState({debounced:!1})},r.render=function(){var t,e=this.props,i=e.id,n=e.length,r=e.queryLength,a=e.minQueryLength,s=e.selectedOption,l=e.selectedOptionIndex,u=e.tQueryTooShort,p=e.tNoResults,h=e.tSelectedOption,d=e.tResults,c=this.state,g=c.bump,f=c.debounced,m=c.silenced,v=r<a,y=0===n,_=s?h(s,n,l):"";return t=v?u(a):y?p():d(n,_),this.debounceStatusUpdate(),(0,o.createElement)("div",{style:{border:"0",clip:"rect(0 0 0 0)",height:"1px",marginBottom:"-1px",marginRight:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},(0,o.createElement)("div",{id:i+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!m&&f&&g?t:""),(0,o.createElement)("div",{id:i+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},m||!f||g?"":t))},e}(o.Component);(e.default=n).defaultProps={tQueryTooShort:function(t){return"Type in "+t+" or more characters for results"},tNoResults:function(){return"No search results"},tSelectedOption:function(t,e,i){return t+" "+(i+1)+" of "+e+" is highlighted"},tResults:function(t,e){return t+" "+(1===t?"result":"results")+" "+(1===t?"is":"are")+" available. "+e}}},function(t,e,i){e.__esModule=!0,e.default=void 0;var o=i(5);e.default=function(t){var e=t.className;return(0,o.createElement)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e,focusable:"false"},(0,o.createElement)("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},(0,o.createElement)("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))}}]).default}));var My,jy=dl(Iy.exports),Dy=f`@charset "UTF-8";
369
+ }`,Ey=Object.freeze,Ty=Object.defineProperty,Py=Object.getOwnPropertyDescriptor,Oy=(t,e,i,o)=>{for(var n,r=o>1?void 0:o?Py(e,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o?n(e,i,r):n(r))||r);return o&&r&&Ty(e,i,r),r};let Fy=class extends dt{constructor(){super(),this.id="map",this.latitude=51.507351,this.longitude=-.127758,this.zoom=10,this.minZoom=7,this.maxZoom=22,this.drawMode=!1,this.drawGeojsonData={type:"Feature",geometry:{}},this.drawGeojsonDataBuffer=100,this.drawPointer="crosshair",this.showFeaturesAtPoint=!1,this.clickFeatures=!1,this.featureColor="#0000ff",this.featureFill=!1,this.featureBorderNone=!1,this.featureBuffer=40,this.showMarker=!1,this.markerLatitude=this.latitude,this.markerLongitude=this.longitude,this.markerColor="#000000",this.geojsonData={type:"FeatureCollection",features:[]},this.geojsonColor="#ff0000",this.geojsonFill=!1,this.geojsonBuffer=12,this.disableVectorTiles=!1,this.osVectorTilesApiKey="a69TM3Yjy4YUiAXFAyI6KyadBPrwYqex",this.osFeaturesApiKey="a69TM3Yjy4YUiAXFAyI6KyadBPrwYqex",this.osCopyright=`© Crown copyright and database rights ${(new Date).getFullYear()} OS (0)100024857`,this.hideResetControl=!1,this.staticMode=!1,this.areaUnit="m2",this.showScale=!1,this.useScaleBarStyle=!1,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}firstUpdated(){var t;const e=this.renderRoot.querySelector(`#${this.id}`),i=!this.disableVectorTiles&&Boolean(this.osVectorTilesApiKey),o=(n=this.osCopyright,r=this.osVectorTilesApiKey,new yc({source:r?new bc({url:"https://api.os.uk/maps/raster/v1/zxy/Light_3857/{z}/{x}/{y}.png?key="+r,attributions:[n],attributionsCollapsible:!1,maxZoom:20}):new wc({attributions:[kc]})}));var n,r;const a=function(t,e){let i=new jd({declutter:!0,source:new ec({format:new Wl,url:"https://api.os.uk/maps/vector/v1/vts/tile/{z}/{y}/{x}.pbf?srs=3857&key="+e,attributions:[t],attributionsCollapsible:!1})});return e&&fetch("https://api.os.uk/maps/vector/v1/vts/resources/styles?srs=3857&key="+e).then((t=>t.json())).then((t=>Sy(i,t,"esri"))).catch((t=>console.log(t))),i}(this.osCopyright,this.osVectorTilesApiKey),s=new ad({target:e,layers:[i?a:o],view:new Na({projection:"EPSG:3857",extent:(u=[-10.76418,49.528423,1.9134116,61.331151],p="EPSG:4326",h="EPSG:3857",Oo(u,sn(p,h),void 0,d)),minZoom:this.minZoom,maxZoom:this.maxZoom,center:nn([this.longitude,this.latitude]),zoom:this.zoom,enableRotation:!1}),controls:Qa({attribution:!0,zoom:!this.staticMode}).extend(this.showScale?[(l=this.useScaleBarStyle,new Ja({units:"metric",bar:l,steps:4,text:!0,minWidth:140}))]:[]),interactions:nd({doubleClickZoom:!this.staticMode,dragPan:!this.staticMode,mouseWheelZoom:!this.staticMode})});var l,u,p,h,d;this.map=s;const c=(g=this.drawPointer,new qh({source:Dc,type:"Polygon",style:new hl({stroke:Fc,fill:Rc,image:"crosshair"===g?Ic:Mc})}));var g;const f=function(t){return new Qh({source:Dc,style:new hl({image:"crosshair"===t?Ic:Mc})})}(this.drawPointer),m=document.createElement("button");m.innerHTML="↻",m.title="Reset map view";m.addEventListener("click",(()=>{this.showFeaturesAtPoint?Fg(s,Mg,this.featureBuffer):b.getFeatures().length>0?Fg(s,b,this.geojsonBuffer):(s.getView().setCenter(nn([this.longitude,this.latitude])),s.getView().setZoom(this.zoom)),this.drawMode&&(Dc.clear(),this.dispatch("geojsonChange",{}),this.dispatch("areaChange",`0 ${"m2"===this.areaUnit?"m²":this.areaUnit}`),s.addInteraction(c),s.addInteraction(Lc))}),!1);const v=document.createElement("div");v.className="reset-control ol-unselectable ol-control",v.appendChild(m);var y=new _e({element:v});this.hideResetControl||s.addControl(y);const _=null==(t=this.renderRoot)?void 0:t.querySelectorAll(".ol-control button");null==_||_.forEach((t=>t.setAttribute("aria-label",t.getAttribute("title")||""))),s.on("pointerdrag",(()=>{s.getViewport().style.cursor="grabbing"})),s.on("pointermove",(()=>{s.getViewport().style.cursor="grab"}));const b=new Rp;if("FeatureCollection"===this.geojsonData.type){let t=(new Rs).readFeatures(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeatures(t)}else if("Feature"===this.geojsonData.type){let t=(new Rs).readFeature(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeature(t)}const x=new fp({source:b,style:new hl({stroke:new tl({color:this.geojsonColor,width:3}),fill:new Is({color:this.geojsonFill?Rg(this.geojsonColor,.2):Rg(this.geojsonColor,0)})})});if(s.addLayer(x),b.getFeatures().length>0){Fg(s,b,this.geojsonBuffer);const t=b.getFeatures()[0].getGeometry();t&&this.dispatch("geojsonDataArea",Og(t,this.areaUnit))}if(this.drawMode){Dc.clear();const t=Object.keys(this.drawGeojsonData.geometry).length>0;if(t){let t=(new Rs).readFeature(this.drawGeojsonData,{featureProjection:"EPSG:3857"});Dc.addFeature(t),Fg(s,Dc,this.drawGeojsonDataBuffer)}s.addLayer(Ac),t||s.addInteraction(c),s.addInteraction(f),s.addInteraction(Lc),Dc.on("change",(()=>{var t;const e=Dc.getFeatures();if(e.length>0){const o=null==(t="string"==typeof(i=e)?i[i.length-1]||"":i[i.length-1])?void 0:t.getGeometry();this.dispatch("geojsonChange",(new Rs).writeFeaturesObject(e,{featureProjection:"EPSG:3857"})),o&&this.dispatch("areaChange",Og(o,this.areaUnit)),s.removeInteraction(c)}var i}))}if(this.drawMode&&Boolean(this.osVectorTilesApiKey)&&!this.disableVectorTiles){const t=20;if(s.addLayer(Ec),Ac.setZIndex(1001),this.zoom<t){zc.clear();const t=s.getView().calculateExtent(s.getSize());Tc(a,t)}s.on("moveend",(()=>{const e=s.getView().getZoom();e&&e<t?zc.clear():setTimeout((()=>{zc.clear();const t=s.getView().calculateExtent(s.getSize());Tc(a,t)}),200)}))}if(this.showFeaturesAtPoint&&Boolean(this.osFeaturesApiKey)){jg(nn([this.longitude,this.latitude]),this.osFeaturesApiKey,!1),this.clickFeatures&&s.on("singleclick",(t=>{jg(t.coordinate,this.osFeaturesApiKey,!0)}));const t=(k=this.featureColor,w=this.featureFill,S=this.featureBorderNone,new fp({source:Mg,style:new hl({stroke:S?void 0:new tl({width:3,color:k}),fill:new Is({color:Rg(k,w?.2:0)})})}));s.addLayer(t),Mg.on("change",(()=>{if("ready"===Mg.getState()&&Mg.getFeatures().length>0){Fg(s,Mg,this.featureBuffer),this.dispatch("featuresGeojsonChange",(new Rs).writeFeaturesObject(Mg.getFeatures(),{featureProjection:"EPSG:3857"}));const t=Mg.getFeatures()[0].getGeometry();t&&this.dispatch("featuresAreaChange",Og(t,this.areaUnit))}}))}var k,w,S;if(this.showMarker){const t=new va(nn([this.markerLongitude,this.markerLatitude])),e=new fp({source:new Rp({features:[new _s(t)]}),style:new hl({image:new rl({radius:9,fill:new Is({color:this.markerColor})})})});s.addLayer(e)}setTimeout((()=>{window.dispatchEvent(new Event("resize")),e.style.opacity="1",this.dispatch("ready")}),500)}render(){return U(Cy||(Cy=Ey(Ty(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <link rel="stylesheet" href="https://cdn.skypack.dev/ol@^6.6.1/ol.css" />\n <div id="','" class="map" tabindex="0" />'],"raw",{value:Ey(e||t.slice())}))),this.id);var t,e}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.map)||t.dispose()}};Fy.styles=g(zy),Oy([ft({type:String})],Fy.prototype,"id",2),Oy([ft({type:Number})],Fy.prototype,"latitude",2),Oy([ft({type:Number})],Fy.prototype,"longitude",2),Oy([ft({type:Number})],Fy.prototype,"zoom",2),Oy([ft({type:Number})],Fy.prototype,"minZoom",2),Oy([ft({type:Number})],Fy.prototype,"maxZoom",2),Oy([ft({type:Boolean})],Fy.prototype,"drawMode",2),Oy([ft({type:Object})],Fy.prototype,"drawGeojsonData",2),Oy([ft({type:Number})],Fy.prototype,"drawGeojsonDataBuffer",2),Oy([ft({type:String})],Fy.prototype,"drawPointer",2),Oy([ft({type:Boolean})],Fy.prototype,"showFeaturesAtPoint",2),Oy([ft({type:Boolean})],Fy.prototype,"clickFeatures",2),Oy([ft({type:String})],Fy.prototype,"featureColor",2),Oy([ft({type:Boolean})],Fy.prototype,"featureFill",2),Oy([ft({type:Boolean})],Fy.prototype,"featureBorderNone",2),Oy([ft({type:Number})],Fy.prototype,"featureBuffer",2),Oy([ft({type:Boolean})],Fy.prototype,"showMarker",2),Oy([ft({type:Number})],Fy.prototype,"markerLatitude",2),Oy([ft({type:Number})],Fy.prototype,"markerLongitude",2),Oy([ft({type:String})],Fy.prototype,"markerColor",2),Oy([ft({type:Object})],Fy.prototype,"geojsonData",2),Oy([ft({type:String})],Fy.prototype,"geojsonColor",2),Oy([ft({type:Boolean})],Fy.prototype,"geojsonFill",2),Oy([ft({type:Number})],Fy.prototype,"geojsonBuffer",2),Oy([ft({type:Boolean})],Fy.prototype,"disableVectorTiles",2),Oy([ft({type:String})],Fy.prototype,"osVectorTilesApiKey",2),Oy([ft({type:String})],Fy.prototype,"osFeaturesApiKey",2),Oy([ft({type:String})],Fy.prototype,"osCopyright",2),Oy([ft({type:Boolean})],Fy.prototype,"hideResetControl",2),Oy([ft({type:Boolean})],Fy.prototype,"staticMode",2),Oy([ft({type:String})],Fy.prototype,"areaUnit",2),Oy([ft({type:Boolean})],Fy.prototype,"showScale",2),Oy([ft({type:Boolean})],Fy.prototype,"useScaleBarStyle",2),Fy=Oy([ct("my-map")],Fy);var Ry,Iy={exports:{}};Ry=Iy,function(t,e){Ry.exports=e()}(window,(function(){return function(t){var e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(o,n,function(e){return t[e]}.bind(null,n));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/",i(i.s=37)}([function(t,e,i){var o=i(1),n=i(6),r=i(7),a=i(16),s=i(18),l="prototype",u=function(t,e,i){var p,h,d,c,g=t&u.F,f=t&u.G,m=t&u.S,v=t&u.P,y=t&u.B,_=f?o:m?o[e]||(o[e]={}):(o[e]||{})[l],b=f?n:n[e]||(n[e]={}),x=b[l]||(b[l]={});for(p in f&&(i=e),i)d=((h=!g&&_&&void 0!==_[p])?_:i)[p],c=y&&h?s(d,o):v&&"function"==typeof d?s(Function.call,d):d,_&&a(_,p,d,t&u.U),b[p]!=d&&r(b,p,c),v&&x[p]!=d&&(x[p]=d)};o.core=n,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){t.exports=!i(4)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,i){i.r(e),i.d(e,"h",(function(){return s})),i.d(e,"createElement",(function(){return s})),i.d(e,"cloneElement",(function(){return p})),i.d(e,"Component",(function(){return M})),i.d(e,"render",(function(){return j})),i.d(e,"rerender",(function(){return g})),i.d(e,"options",(function(){return n}));var o=function(){},n={},r=[],a=[];function s(t,e){var i,s,l,u,p=a;for(u=arguments.length;2<u--;)r.push(arguments[u]);for(e&&null!=e.children&&(r.length||r.push(e.children),delete e.children);r.length;)if((s=r.pop())&&void 0!==s.pop)for(u=s.length;u--;)r.push(s[u]);else"boolean"==typeof s&&(s=null),(l="function"!=typeof t)&&(null==s?s="":"number"==typeof s?s=String(s):"string"!=typeof s&&(l=!1)),l&&i?p[p.length-1]+=s:p===a?p=[s]:p.push(s),i=l;var h=new o;return h.nodeName=t,h.children=p,h.attributes=null==e?void 0:e,h.key=null==e?void 0:e.key,void 0!==n.vnode&&n.vnode(h),h}function l(t,e){for(var i in e)t[i]=e[i];return t}var u="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function p(t,e){return s(t.nodeName,l(l({},t.attributes),e),2<arguments.length?[].slice.call(arguments,2):t.children)}var h=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,d=[];function c(t){!t._dirty&&(t._dirty=!0)&&1==d.push(t)&&(n.debounceRendering||u)(g)}function g(){var t,e=d;for(d=[];t=e.pop();)t._dirty&&R(t)}function f(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function m(t){var e=l({},t.attributes);e.children=t.children;var i=t.nodeName.defaultProps;if(void 0!==i)for(var o in i)void 0===e[o]&&(e[o]=i[o]);return e}function v(t){var e=t.parentNode;e&&e.removeChild(t)}function y(t,e,i,o,n){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)i&&i(null),o&&o(t);else if("class"!==e||n)if("style"===e){if(o&&"string"!=typeof o&&"string"!=typeof i||(t.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof i)for(var r in i)r in o||(t.style[r]="");for(var r in o)t.style[r]="number"==typeof o[r]&&!1===h.test(r)?o[r]+"px":o[r]}}else if("dangerouslySetInnerHTML"===e)o&&(t.innerHTML=o.__html||"");else if("o"==e[0]&&"n"==e[1]){var a=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),o?i||t.addEventListener(e,_,a):t.removeEventListener(e,_,a),(t._listeners||(t._listeners={}))[e]=o}else if("list"!==e&&"type"!==e&&!n&&e in t){try{t[e]=null==o?"":o}catch(l){}null!=o&&!1!==o||"spellcheck"==e||t.removeAttribute(e)}else{var s=n&&e!==(e=e.replace(/^xlink:?/,""));null==o||!1===o?s?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof o&&(s?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),o):t.setAttribute(e,o))}else t.className=o||""}function _(t){return this._listeners[t.type](n.event&&n.event(t)||t)}var b=[],x=0,k=!1,w=!1;function S(){for(var t;t=b.pop();)n.afterMount&&n.afterMount(t),t.componentDidMount&&t.componentDidMount()}function C(t,e,i,o,n){var r=t,a=k;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||n)?t.nodeValue!=e&&(t.nodeValue=e):(r=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0))),r.__preactattr_=!0,r;var s,l,u=e.nodeName;if("function"==typeof u)return function(t,e,i,o){for(var n=t&&t._component,r=n,a=t,s=n&&t._componentConstructor===e.nodeName,l=s,u=m(e);n&&!l&&(n=n._parentComponent);)l=n.constructor===e.nodeName;return n&&l&&(!o||n._component)?(F(n,u,3,i,o),t=n.base):(r&&!s&&(I(r),t=a=null),n=P(e.nodeName,u,i),t&&!n.nextBase&&(n.nextBase=t,a=null),F(n,u,1,i,o),t=n.base,a&&t!==a&&(a._component=null,z(a,!1))),t}(t,e,i,o);if(k="svg"===u||"foreignObject"!==u&&k,u=String(u),(!t||!f(t,u))&&(s=u,(l=k?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s)).normalizedNodeName=s,r=l,t)){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0)}var p=r.firstChild,h=r.__preactattr_,d=e.children;if(null==h){h=r.__preactattr_={};for(var c=r.attributes,g=c.length;g--;)h[c[g].name]=c[g].value}return!w&&d&&1===d.length&&"string"==typeof d[0]&&null!=p&&void 0!==p.splitText&&null==p.nextSibling?p.nodeValue!=d[0]&&(p.nodeValue=d[0]):(d&&d.length||null!=p)&&function(t,e,i,o,n){var r,a,s,l,u,p,h,d,c=t.childNodes,g=[],m={},y=0,_=0,b=c.length,x=0,k=e?e.length:0;if(0!==b)for(var w=0;w<b;w++){var S=c[w],E=S.__preactattr_;null!=(T=k&&E?S._component?S._component.__key:E.key:null)?(y++,m[T]=S):(E||(void 0!==S.splitText?!n||S.nodeValue.trim():n))&&(g[x++]=S)}if(0!==k)for(w=0;w<k;w++){var T;if(u=null,null!=(T=(l=e[w]).key))y&&void 0!==m[T]&&(u=m[T],m[T]=void 0,y--);else if(_<x)for(r=_;r<x;r++)if(void 0!==g[r]&&(p=a=g[r],d=n,"string"==typeof(h=l)||"number"==typeof h?void 0!==p.splitText:"string"==typeof h.nodeName?!p._componentConstructor&&f(p,h.nodeName):d||p._componentConstructor===h.nodeName)){u=a,g[r]=void 0,r===x-1&&x--,r===_&&_++;break}u=C(u,l,i,o),s=c[w],u&&u!==t&&u!==s&&(null==s?t.appendChild(u):u===s.nextSibling?v(s):t.insertBefore(u,s))}if(y)for(var w in m)void 0!==m[w]&&z(m[w],!1);for(;_<=x;)void 0!==(u=g[x--])&&z(u,!1)}(r,d,i,o,w||null!=h.dangerouslySetInnerHTML),function(t,e,i){var o;for(o in i)e&&null!=e[o]||null==i[o]||y(t,o,i[o],i[o]=void 0,k);for(o in e)"children"===o||"innerHTML"===o||o in i&&e[o]===("value"===o||"checked"===o?t[o]:i[o])||y(t,o,i[o],i[o]=e[o],k)}(r,e.attributes,h),k=a,r}function z(t,e){var i=t._component;i?I(i):(null!=t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),!1!==e&&null!=t.__preactattr_||v(t),E(t))}function E(t){for(t=t.lastChild;t;){var e=t.previousSibling;z(t,!0),t=e}}var T=[];function P(t,e,i){var o,n=T.length;for(t.prototype&&t.prototype.render?(o=new t(e,i),M.call(o,e,i)):((o=new M(e,i)).constructor=t,o.render=O);n--;)if(T[n].constructor===t)return o.nextBase=T[n].nextBase,T.splice(n,1),o;return o}function O(t,e,i){return this.constructor(t,i)}function F(t,e,i,o,r){t._disable||(t._disable=!0,t.__ref=e.ref,t.__key=e.key,delete e.ref,delete e.key,void 0===t.constructor.getDerivedStateFromProps&&(!t.base||r?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(e,o)),o&&o!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=o),t.prevProps||(t.prevProps=t.props),t.props=e,t._disable=!1,0!==i&&(1!==i&&!1===n.syncComponentUpdates&&t.base?c(t):R(t,1,r)),t.__ref&&t.__ref(t))}function R(t,e,i,o){if(!t._disable){var r,a,s,u=t.props,p=t.state,h=t.context,d=t.prevProps||u,c=t.prevState||p,g=t.prevContext||h,f=t.base,v=t.nextBase,y=f||v,_=t._component,E=!1,T=g;if(t.constructor.getDerivedStateFromProps&&(p=l(l({},p),t.constructor.getDerivedStateFromProps(u,p)),t.state=p),f&&(t.props=d,t.state=c,t.context=g,2!==e&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(u,p,h)?E=!0:t.componentWillUpdate&&t.componentWillUpdate(u,p,h),t.props=u,t.state=p,t.context=h),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!E){r=t.render(u,p,h),t.getChildContext&&(h=l(l({},h),t.getChildContext())),f&&t.getSnapshotBeforeUpdate&&(T=t.getSnapshotBeforeUpdate(d,c));var O,M,j=r&&r.nodeName;if("function"==typeof j){var D=m(r);(a=_)&&a.constructor===j&&D.key==a.__key?F(a,D,1,h,!1):(O=a,t._component=a=P(j,D,h),a.nextBase=a.nextBase||v,a._parentComponent=t,F(a,D,0,h,!1),R(a,1,i,!0)),M=a.base}else s=y,(O=_)&&(s=t._component=null),(y||1===e)&&(s&&(s._component=null),M=function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(s,r,h,i||!f,y&&y.parentNode,!0));if(y&&M!==y&&a!==_){var A=y.parentNode;A&&M!==A&&(A.replaceChild(M,y),O||(y._component=null,z(y,!1)))}if(O&&I(O),(t.base=M)&&!o){for(var L=t,G=t;G=G._parentComponent;)(L=G).base=M;M._component=L,M._componentConstructor=L.constructor}}for(!f||i?b.unshift(t):E||(t.componentDidUpdate&&t.componentDidUpdate(d,c,T),n.afterUpdate&&n.afterUpdate(t));t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);x||o||S()}}function I(t){n.beforeUnmount&&n.beforeUnmount(t);var e=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var i=t._component;i?I(i):e&&(e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),v(t.nextBase=e),T.push(t),E(e)),t.__ref&&t.__ref(null)}function M(t,e){this._dirty=!0,this.context=e,this.props=t,this.state=this.state||{},this._renderCallbacks=[]}function j(t,e,i){return function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(i,t,{},!1,e,!1)}l(M.prototype,{setState:function(t,e){this.prevState||(this.prevState=this.state),this.state=l(l({},this.state),"function"==typeof t?t(this.state,this.props):t),e&&this._renderCallbacks.push(e),c(this)},forceUpdate:function(t){t&&this._renderCallbacks.push(t),R(this,2)},render:function(){}});var D={h:s,createElement:s,cloneElement:p,Component:M,render:j,rerender:g,options:n};e.default=D},function(t,e){var i=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=i)},function(t,e,i){var o=i(8),n=i(40);t.exports=i(3)?function(t,e,i){return o.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var o=i(9),n=i(38),r=i(39),a=Object.defineProperty;e.f=i(3)?Object.defineProperty:function(t,e,i){if(o(t),e=r(e,!0),o(i),n)try{return a(t,e,i)}catch(s){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var o=i(2);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var i=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+o).toString(36))}},function(t,e,i){var o=i(22);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var o=i(4);t.exports=function(t,e){return!!t&&o((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,i){var o=i(0);o(o.S+o.F,"Object",{assign:i(41)})},function(t,e,i){var o=i(2),n=i(1).document,r=o(n)&&o(n.createElement);t.exports=function(t){return r?n.createElement(t):{}}},function(t,e,i){var o=i(1),n=i(7),r=i(17),a=i(10)("src"),s="toString",l=Function[s],u=(""+l).split(s);i(6).inspectSource=function(t){return l.call(t)},(t.exports=function(t,e,i,s){var l="function"==typeof i;l&&(r(i,"name")||n(i,"name",e)),t[e]!==i&&(l&&(r(i,a)||n(i,a,t[e]?""+t[e]:u.join(String(e)))),t===o?t[e]=i:s?t[e]?t[e]=i:n(t,e,i):(delete t[e],n(t,e,i)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||l.call(this)}))},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var o=i(19);t.exports=function(t,e,i){if(o(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,o){return t.call(e,i,o)};case 3:return function(i,o,n){return t.call(e,i,o,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var o=i(42),n=i(28);t.exports=Object.keys||function(t){return o(t,n)}},function(t,e,i){var o=i(11),n=i(12);t.exports=function(t){return o(n(t))}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e,i){var o=i(21),n=i(24),r=i(43);t.exports=function(t){return function(e,i,a){var s,l=o(e),u=n(l.length),p=r(a,u);if(t&&i!=i){for(;p<u;)if((s=l[p++])!=s)return!0}else for(;p<u;p++)if((t||p in l)&&l[p]===i)return t||p||0;return!t&&-1}}},function(t,e,i){var o=i(25),n=Math.min;t.exports=function(t){return 0<t?n(o(t),9007199254740991):0}},function(t,e){var i=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(0<t?o:i)(t)}},function(t,e,i){var o=i(27)("keys"),n=i(10);t.exports=function(t){return o[t]||(o[t]=n(t))}},function(t,e,i){var o=i(6),n=i(1),r="__core-js_shared__",a=n[r]||(n[r]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:o.version,mode:i(44)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){var o=i(12);t.exports=function(t){return Object(o(t))}},function(t,e,i){var o=i(8).f,n=Function.prototype,r=/^\s*function ([^ (]*)/;"name"in n||i(3)&&o(n,"name",{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(t){return""}}})},function(t,e,i){var o=i(0),n=i(32)(1);o(o.P+o.F*!i(13)([].map,!0),"Array",{map:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(18),n=i(11),r=i(29),a=i(24),s=i(47);t.exports=function(t,e){var i=1==t,l=2==t,u=3==t,p=4==t,h=6==t,d=5==t||h,c=e||s;return function(e,s,g){for(var f,m,v=r(e),y=n(v),_=o(s,g,3),b=a(y.length),x=0,k=i?c(e,b):l?c(e,0):void 0;x<b;x++)if((d||x in y)&&(m=_(f=y[x],x,v),t))if(i)k[x]=m;else if(m)switch(t){case 3:return!0;case 5:return f;case 6:return x;case 2:k.push(f)}else if(p)return!1;return h?-1:u||p?p:k}}},function(t,e,i){var o=i(22);t.exports=Array.isArray||function(t){return"Array"==o(t)}},function(t,e,i){var o=i(27)("wks"),n=i(10),r=i(1).Symbol,a="function"==typeof r;(t.exports=function(t){return o[t]||(o[t]=a&&r[t]||(a?r:n)("Symbol."+t))}).store=o},function(t,e,i){var o=i(0),n=i(23)(!1),r=[].indexOf,a=!!r&&1/[1].indexOf(1,-0)<0;o(o.P+o.F*(a||!i(13)(r)),"Array",{indexOf:function(t){return a?r.apply(this,arguments)||0:n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Object",{create:i(52)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(30),i(31),i(35),i(49),i(50);var o,n=i(5),r=(o=i(51))&&o.__esModule?o:{default:o};function a(t){if(!t.element)throw new Error("element is not defined");if(!t.id)throw new Error("id is not defined");if(!t.source)throw new Error("source is not defined");Array.isArray(t.source)&&(t.source=s(t.source)),(0,n.render)((0,n.createElement)(r.default,t),t.element)}var s=function(t){return function(e,i){i(t.filter((function(t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())})))}};a.enhanceSelectElement=function(t){if(!t.selectElement)throw new Error("selectElement is not defined");if(!t.source){var e=[].filter.call(t.selectElement.options,(function(e){return e.value||t.preserveNullOptions}));t.source=e.map((function(t){return t.textContent||t.innerText}))}if(t.onConfirm=t.onConfirm||function(e){var i=[].filter.call(t.selectElement.options,(function(t){return(t.textContent||t.innerText)===e}))[0];i&&(i.selected=!0)},t.selectElement.value||void 0===t.defaultValue){var i=t.selectElement.options[t.selectElement.options.selectedIndex];t.defaultValue=i.textContent||i.innerText}void 0===t.name&&(t.name=""),void 0===t.id&&(void 0===t.selectElement.id?t.id="":t.id=t.selectElement.id),void 0===t.autoselect&&(t.autoselect=!0);var o=document.createElement("div");t.selectElement.parentNode.insertBefore(o,t.selectElement),a(Object.assign({},t,{element:o})),t.selectElement.style.display="none",t.selectElement.id=t.selectElement.id+"-select"};var l=a;e.default=l},function(t,e,i){t.exports=!i(3)&&!i(4)((function(){return 7!=Object.defineProperty(i(15)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,i){var o=i(2);t.exports=function(t,e){if(!o(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!o(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){var o=i(20),n=i(45),r=i(46),a=i(29),s=i(11),l=Object.assign;t.exports=!l||i(4)((function(){var t={},e={},i=Symbol(),o="abcdefghijklmnopqrst";return t[i]=7,o.split("").forEach((function(t){e[t]=t})),7!=l({},t)[i]||Object.keys(l({},e)).join("")!=o}))?function(t,e){for(var i=a(t),l=arguments.length,u=1,p=n.f,h=r.f;u<l;)for(var d,c=s(arguments[u++]),g=p?o(c).concat(p(c)):o(c),f=g.length,m=0;m<f;)h.call(c,d=g[m++])&&(i[d]=c[d]);return i}:l},function(t,e,i){var o=i(17),n=i(21),r=i(23)(!1),a=i(26)("IE_PROTO");t.exports=function(t,e){var i,s=n(t),l=0,u=[];for(i in s)i!=a&&o(s,i)&&u.push(i);for(;e.length>l;)o(s,i=e[l++])&&(~r(u,i)||u.push(i));return u}},function(t,e,i){var o=i(25),n=Math.max,r=Math.min;t.exports=function(t,e){return(t=o(t))<0?n(t+e,0):r(t,e)}},function(t,e){t.exports=!1},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){var o=i(48);t.exports=function(t,e){return new(o(t))(e)}},function(t,e,i){var o=i(2),n=i(33),r=i(34)("species");t.exports=function(t){var e;return n(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!n(e.prototype)||(e=void 0),o(e)&&null===(e=e[r])&&(e=void 0)),void 0===e?Array:e}},function(t,e,i){var o=i(0),n=i(32)(2);o(o.P+o.F*!i(13)([].filter,!0),"Array",{filter:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Array",{isArray:i(33)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(36),i(30),i(31),i(35),i(55),i(58);var o=i(5),n=a(i(60)),r=a(i(61));function a(t){return t&&t.__esModule?t:{default:t}}function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t}).apply(this,arguments)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var u={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function p(){return"undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var h=function(t){function e(e){var i;return(i=t.call(this,e)||this).elementReferences={},i.state={focused:null,hovered:null,menuOpen:!1,options:e.defaultValue?[e.defaultValue]:[],query:e.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},i.handleComponentBlur=i.handleComponentBlur.bind(l(l(i))),i.handleKeyDown=i.handleKeyDown.bind(l(l(i))),i.handleUpArrow=i.handleUpArrow.bind(l(l(i))),i.handleDownArrow=i.handleDownArrow.bind(l(l(i))),i.handleEnter=i.handleEnter.bind(l(l(i))),i.handlePrintableKey=i.handlePrintableKey.bind(l(l(i))),i.handleListMouseLeave=i.handleListMouseLeave.bind(l(l(i))),i.handleOptionBlur=i.handleOptionBlur.bind(l(l(i))),i.handleOptionClick=i.handleOptionClick.bind(l(l(i))),i.handleOptionFocus=i.handleOptionFocus.bind(l(l(i))),i.handleOptionMouseDown=i.handleOptionMouseDown.bind(l(l(i))),i.handleOptionMouseEnter=i.handleOptionMouseEnter.bind(l(l(i))),i.handleInputBlur=i.handleInputBlur.bind(l(l(i))),i.handleInputChange=i.handleInputChange.bind(l(l(i))),i.handleInputFocus=i.handleInputFocus.bind(l(l(i))),i.pollInputElement=i.pollInputElement.bind(l(l(i))),i.getDirectInputChanges=i.getDirectInputChanges.bind(l(l(i))),i}var i,r;r=t,(i=e).prototype=Object.create(r.prototype),(i.prototype.constructor=i).__proto__=r;var a=e.prototype;return a.isQueryAnOption=function(t,e){var i=this;return-1!==e.map((function(t){return i.templateInputValue(t).toLowerCase()})).indexOf(t.toLowerCase())},a.componentDidMount=function(){this.pollInputElement()},a.componentWillUnmount=function(){clearTimeout(this.$pollInput)},a.pollInputElement=function(){var t=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){t.pollInputElement()}),100)},a.getDirectInputChanges=function(){var t=this.elementReferences[-1];t&&t.value!==this.state.query&&this.handleInputChange({target:{value:t.value}})},a.componentDidUpdate=function(t,e){var i=this.state.focused,o=null===i,n=e.focused!==i;n&&!o&&this.elementReferences[i].focus();var r=-1===i,a=n&&null===e.focused;if(r&&a){var s=this.elementReferences[i];s.setSelectionRange(0,s.value.length)}},a.hasAutoselect=function(){return!p()&&this.props.autoselect},a.templateInputValue=function(t){var e=this.props.templates&&this.props.templates.inputValue;return e?e(t):t},a.templateSuggestion=function(t){var e=this.props.templates&&this.props.templates.suggestion;return e?e(t):t},a.handleComponentBlur=function(t){var e,i=this.state,o=i.options,n=i.query,r=i.selected;this.props.confirmOnBlur?(e=t.query||n,this.props.onConfirm(o[r])):e=n,this.setState({focused:null,menuOpen:t.menuOpen||!1,query:e,selected:null,validChoiceMade:this.isQueryAnOption(e,o)})},a.handleListMouseLeave=function(t){this.setState({hovered:null})},a.handleOptionBlur=function(t,e){var i=this.state,o=i.focused,n=i.menuOpen,r=i.options,a=i.selected,s=null===t.relatedTarget,l=t.relatedTarget===this.elementReferences[-1],u=o!==e&&-1!==o;if(!u&&s||!u&&!l){var h=n&&p();this.handleComponentBlur({menuOpen:h,query:this.templateInputValue(r[a])})}},a.handleInputBlur=function(t){var e=this.state,i=e.focused,o=e.menuOpen,n=e.options,r=e.query,a=e.selected;if(-1===i){var s=o&&p(),l=p()?r:this.templateInputValue(n[a]);this.handleComponentBlur({menuOpen:s,query:l})}},a.handleInputChange=function(t){var e=this,i=this.props,o=i.minLength,n=i.source,r=i.showAllValues,a=this.hasAutoselect(),s=t.target.value,l=0===s.length,u=this.state.query.length!==s.length,p=s.length>=o;this.setState({query:s,ariaHint:l}),r||!l&&u&&p?n(s,(function(t){var i=0<t.length;e.setState({menuOpen:i,options:t,selected:a&&i?0:-1,validChoiceMade:!1})})):!l&&p||this.setState({menuOpen:!1,options:[]})},a.handleInputClick=function(t){this.handleInputChange(t)},a.handleInputFocus=function(t){var e=this.state,i=e.query,o=e.validChoiceMade,n=e.options,r=this.props.minLength,a=!o&&i.length>=r&&0<n.length;a?this.setState((function(t){var e=t.menuOpen;return{focused:-1,menuOpen:a||e,selected:-1}})):this.setState({focused:-1})},a.handleOptionFocus=function(t){this.setState({focused:t,hovered:null,selected:t})},a.handleOptionMouseEnter=function(t,e){p()||this.setState({hovered:e})},a.handleOptionClick=function(t,e){var i=this.state.options[e],o=this.templateInputValue(i);this.props.onConfirm(i),this.setState({focused:-1,hovered:null,menuOpen:!1,query:o,selected:-1,validChoiceMade:!0}),this.forceUpdate()},a.handleOptionMouseDown=function(t){t.preventDefault()},a.handleUpArrow=function(t){t.preventDefault();var e=this.state,i=e.menuOpen,o=e.selected;-1!==o&&i&&this.handleOptionFocus(o-1)},a.handleDownArrow=function(t){var e=this;if(t.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t,selected:0,focused:0,hovered:null})}));else if(!0===this.state.menuOpen){var i=this.state,o=i.menuOpen,n=i.options,r=i.selected;r!==n.length-1&&o&&this.handleOptionFocus(r+1)}},a.handleSpace=function(t){var e=this;this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t})}))),-1!==this.state.focused&&(t.preventDefault(),this.handleOptionClick(t,this.state.focused))},a.handleEnter=function(t){this.state.menuOpen&&(t.preventDefault(),0<=this.state.selected&&this.handleOptionClick(t,this.state.selected))},a.handlePrintableKey=function(t){var e=this.elementReferences[-1];t.target===e||e.focus()},a.handleKeyDown=function(t){switch(u[t.keyCode]){case"up":this.handleUpArrow(t);break;case"down":this.handleDownArrow(t);break;case"space":this.handleSpace(t);break;case"enter":this.handleEnter(t);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:(47<(e=t.keyCode)&&e<58||32===e||8===e||64<e&&e<91||95<e&&e<112||185<e&&e<193||218<e&&e<223)&&this.handlePrintableKey(t)}var e},a.render=function(){var t,e=this,i=this.props,r=i.cssNamespace,a=i.displayMenu,l=i.id,u=i.minLength,h=i.name,d=i.placeholder,c=i.required,g=i.showAllValues,f=i.tNoResults,m=i.tStatusQueryTooShort,v=i.tStatusNoResults,y=i.tStatusSelectedOption,_=i.tStatusResults,b=i.tAssistiveHint,x=i.dropdownArrow,k=this.state,w=k.focused,S=k.hovered,C=k.menuOpen,z=k.options,E=k.query,T=k.selected,P=k.ariaHint,O=k.validChoiceMade,F=this.hasAutoselect(),R=-1===w,I=0===z.length,M=0!==E.length,j=E.length>=u,D=this.props.showNoOptionsFound&&R&&I&&M&&j,A=r+"__wrapper",L=r+"__input",G=null!==w?" "+L+"--focused":"",N=this.props.showAllValues?" "+L+"--show-all-values":" "+L+"--default",B=r+"__dropdown-arrow-down",V=-1!==w&&null!==w,q=r+"__menu",W=q+"--"+a,U=q+"--"+(C||D?"visible":"hidden"),X=r+"__option",K=r+"__hint",Y=this.templateInputValue(z[T]),Z=Y&&0===Y.toLowerCase().indexOf(E.toLowerCase())&&F?E+Y.substr(E.length):"",H=l+"__assistiveHint",$=P?{"aria-describedby":H}:null;return g&&"string"==typeof(t=x({className:B}))&&(t=(0,o.createElement)("div",{className:r+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:t}})),(0,o.createElement)("div",{className:A,onKeyDown:this.handleKeyDown},(0,o.createElement)(n.default,{id:l,length:z.length,queryLength:E.length,minQueryLength:u,selectedOption:this.templateInputValue(z[T]),selectedOptionIndex:T,validChoiceMade:O,isInFocus:null!==this.state.focused,tQueryTooShort:m,tNoResults:v,tSelectedOption:y,tResults:_}),Z&&(0,o.createElement)("span",null,(0,o.createElement)("input",{className:K,readonly:!0,tabIndex:"-1",value:Z})),(0,o.createElement)("input",s({"aria-expanded":C?"true":"false","aria-activedescendant":!!V&&l+"__option--"+w,"aria-owns":l+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"},$,{autoComplete:"off",className:""+L+G+N,id:l,onClick:function(t){return e.handleInputClick(t)},onBlur:this.handleInputBlur},{onInput:this.handleInputChange},{onFocus:this.handleInputFocus,name:h,placeholder:d,ref:function(t){e.elementReferences[-1]=t},type:"text",role:"combobox",required:c,value:E})),t,(0,o.createElement)("ul",{className:q+" "+W+" "+U,onMouseLeave:function(t){return e.handleListMouseLeave(t)},id:l+"__listbox",role:"listbox"},z.map((function(t,i){var n=(-1===w?T===i:w===i)&&null===S?" "+X+"--focused":"",r=i%2?" "+X+"--odd":"",a=p()?"<span id="+l+"__option-suffix--"+i+' style="border:0;clip:rect(0 0 0 0);height:1px;marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;whiteSpace:nowrap;width:1px"> '+(i+1)+" of "+z.length+"</span>":"";return(0,o.createElement)("li",{"aria-selected":w===i?"true":"false",className:""+X+n+r,dangerouslySetInnerHTML:{__html:e.templateSuggestion(t)+a},id:l+"__option--"+i,key:i,onBlur:function(t){return e.handleOptionBlur(t,i)},onClick:function(t){return e.handleOptionClick(t,i)},onMouseDown:e.handleOptionMouseDown,onMouseEnter:function(t){return e.handleOptionMouseEnter(t,i)},ref:function(t){e.elementReferences[i]=t},role:"option",tabIndex:"-1","aria-posinset":i+1,"aria-setsize":z.length})})),D&&(0,o.createElement)("li",{className:X+" "+X+"--no-results"},f())),(0,o.createElement)("span",{id:H,style:{display:"none"}},b()))},e}(o.Component);(e.default=h).defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."},dropdownArrow:r.default}},function(t,e,i){var o=i(9),n=i(53),r=i(28),a=i(26)("IE_PROTO"),s=function(){},l="prototype",u=function(){var t,e=i(15)("iframe"),o=r.length;for(e.style.display="none",i(54).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;o--;)delete u[l][r[o]];return u()};t.exports=Object.create||function(t,e){var i;return null!==t?(s[l]=o(t),i=new s,s[l]=null,i[a]=t):i=u(),void 0===e?i:n(i,e)}},function(t,e,i){var o=i(8),n=i(9),r=i(20);t.exports=i(3)?Object.defineProperties:function(t,e){n(t);for(var i,a=r(e),s=a.length,l=0;l<s;)o.f(t,i=a[l++],e[i]);return t}},function(t,e,i){var o=i(1).document;t.exports=o&&o.documentElement},function(t,e,i){var o=i(0);o(o.P,"Function",{bind:i(56)})},function(t,e,i){var o=i(19),n=i(2),r=i(57),a=[].slice,s={};t.exports=Function.bind||function(t){var e=o(this),i=a.call(arguments,1),l=function(){var o=i.concat(a.call(arguments));return this instanceof l?function(t,e,i){if(!(e in s)){for(var o=[],n=0;n<e;n++)o[n]="a["+n+"]";s[e]=Function("F,a","return new F("+o.join(",")+")")}return s[e](t,i)}(e,o.length,o):r(e,o,t)};return n(e.prototype)&&(l.prototype=e.prototype),l}},function(t,e){t.exports=function(t,e,i){var o=void 0===i;switch(e.length){case 0:return o?t():t.call(i);case 1:return o?t(e[0]):t.call(i,e[0]);case 2:return o?t(e[0],e[1]):t.call(i,e[0],e[1]);case 3:return o?t(e[0],e[1],e[2]):t.call(i,e[0],e[1],e[2]);case 4:return o?t(e[0],e[1],e[2],e[3]):t.call(i,e[0],e[1],e[2],e[3])}return t.apply(i,e)}},function(t,e,i){i(59)("match",1,(function(t,e,i){return[function(i){var o=t(this),n=null==i?void 0:i[e];return void 0!==n?n.call(i,o):new RegExp(i)[e](String(o))},i]}))},function(t,e,i){var o=i(7),n=i(16),r=i(4),a=i(12),s=i(34);t.exports=function(t,e,i){var l=s(t),u=i(a,l,""[t]),p=u[0],h=u[1];r((function(){var e={};return e[l]=function(){return 7},7!=""[t](e)}))&&(n(String.prototype,t,p),o(RegExp.prototype,l,2==e?function(t,e){return h.call(t,this,e)}:function(t){return h.call(t,this)}))}},function(t,e,i){e.__esModule=!0,e.default=void 0,i(36);var o=i(5),n=function(t){function e(){for(var e,i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];return(e=t.call.apply(t,[this].concat(o))||this).state={bump:!1,debounced:!1},e}var i,n;n=t,(i=e).prototype=Object.create(n.prototype),(i.prototype.constructor=i).__proto__=n;var r=e.prototype;return r.componentWillMount=function(){var t=this;this.debounceStatusUpdate=function(t,e,i){var o;return function(){var n=this,r=arguments,a=function(){o=null,i||t.apply(n,r)},s=i&&!o;clearTimeout(o),o=setTimeout(a,e),s&&t.apply(n,r)}}((function(){if(!t.state.debounced){var e=!t.props.isInFocus||t.props.validChoiceMade;t.setState((function(t){return{bump:!t.bump,debounced:!0,silenced:e}}))}}),1400)},r.componentWillReceiveProps=function(t){t.queryLength,this.setState({debounced:!1})},r.render=function(){var t,e=this.props,i=e.id,n=e.length,r=e.queryLength,a=e.minQueryLength,s=e.selectedOption,l=e.selectedOptionIndex,u=e.tQueryTooShort,p=e.tNoResults,h=e.tSelectedOption,d=e.tResults,c=this.state,g=c.bump,f=c.debounced,m=c.silenced,v=r<a,y=0===n,_=s?h(s,n,l):"";return t=v?u(a):y?p():d(n,_),this.debounceStatusUpdate(),(0,o.createElement)("div",{style:{border:"0",clip:"rect(0 0 0 0)",height:"1px",marginBottom:"-1px",marginRight:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},(0,o.createElement)("div",{id:i+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!m&&f&&g?t:""),(0,o.createElement)("div",{id:i+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},m||!f||g?"":t))},e}(o.Component);(e.default=n).defaultProps={tQueryTooShort:function(t){return"Type in "+t+" or more characters for results"},tNoResults:function(){return"No search results"},tSelectedOption:function(t,e,i){return t+" "+(i+1)+" of "+e+" is highlighted"},tResults:function(t,e){return t+" "+(1===t?"result":"results")+" "+(1===t?"is":"are")+" available. "+e}}},function(t,e,i){e.__esModule=!0,e.default=void 0;var o=i(5);e.default=function(t){var e=t.className;return(0,o.createElement)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e,focusable:"false"},(0,o.createElement)("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},(0,o.createElement)("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))}}]).default}));var My,jy=fl(Iy.exports),Dy=f`@charset "UTF-8";
370
370
  .govuk-link {
371
371
  font-family: "GDS Transport", arial, sans-serif;
372
372
  -webkit-font-smoothing: antialiased;