!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ol={})}(this,(function(t){"use strict";var e=0,r=1,n=2,i=3,o=4;function a(){return function(){throw new Error("Unimplemented abstract method.")}()}var s=0;function l(t){return t.ol_uid||(t.ol_uid=String(++s))}function u(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]+2*e,r[1]=t[1]+2*e,r}function h(t){return t[0]>0&&t[1]>0}function c(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]*e+.5|0,r[1]=t[1]*e+.5|0,r}function p(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var f,d=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=p(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getDeclutterMode=function(){return this.declutterMode_},t.prototype.getAnchor=function(){return a()},t.prototype.getImage=function(t){return a()},t.prototype.getHitDetectionImage=function(){return a()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return a()},t.prototype.getImageSize=function(){return a()},t.prototype.getOrigin=function(){return a()},t.prototype.getSize=function(){return a()},t.prototype.setDisplacement=function(t){this.displacement_=t},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=p(t)},t.prototype.listenImageChange=function(t){a()},t.prototype.load=function(){a()},t.prototype.unlistenImageChange=function(t){a()},t}(),g=d,y=(f=function(t,e){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},f(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 r(){this.constructor=t}f(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),v=function(t){function e(e){var r=this,n="Assertion failed. See https://openlayers.org/en/"+("v"+"6.15.1".split("-")[0])+"/doc/errors/#"+e+" for details.";return(r=t.call(this,n)||this).code=e,r.name="AssertionError",r.message=n,r}return y(e,t),e}(Error);function _(t,e){if(!t)throw new v(e)}function m(t,e,r){return Math.min(Math.max(t,e),r)}var x="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},w="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function b(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var l=((t-r)*a+(e-n)*s)/(a*a+s*s);l>1?(r=i,n=o):l>0&&(r+=a*l,n+=s*l)}return S(t,e,r,n)}function S(t,e,r,n){var i=r-t,o=n-e;return i*i+o*o}function C(t){return 180*t/Math.PI}function E(t){return t*Math.PI/180}function T(t,e){var r=t%e;return r*e<0?r+e:r}function P(t,e,r){return t+r*(e-t)}function R(t,e){var r=Math.pow(10,e);return Math.round(t*r)/r}function O(t,e){return Math.round(R(t,e))}function F(t,e){return Math.floor(R(t,e))}function M(t,e){return Math.ceil(R(t,e))}var I=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,L=/^([a-z]*)$|^hsla?\(.*\)$/i;function A(t){return"string"==typeof t?t:z(t)}function k(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var r=getComputedStyle(e).color;return document.body.removeChild(e),r}return""}var D=function(){var t={},e=0;return function(r){var n;if(t.hasOwnProperty(r))n=t[r];else{if(e>=1024){var i=0;for(var o in t)0==(3&i++)&&(delete t[o],--e)}n=function(t){var e,r,n,i,o;L.exec(t)&&(t=k(t));if(I.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),r=parseInt(t.substr(1+1*s,s),16),n=parseInt(t.substr(1+2*s,s),16),i=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,r=(r<<4)+r,n=(n<<4)+n,l&&(i=(i<<4)+i)),o=[e,r,n,i/255]}else 0==t.indexOf("rgba(")?G(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),G(o)):_(!1,14);return o}(r),t[r]=n,++e}return n}}();function j(t){return Array.isArray(t)?t:D(t)}function G(t){return t[0]=m(t[0]+.5|0,0,255),t[1]=m(t[1]+.5|0,0,255),t[2]=m(t[2]+.5|0,0,255),t[3]=m(t[3],0,1),t}function z(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var r=t[1];r!=(0|r)&&(r=r+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+r+","+n+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}function N(t){return Array.isArray(t)?z(t):t}var U="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",B=-1!==U.indexOf("firefox"),V=-1!==U.indexOf("safari")&&-1==U.indexOf("chrom")&&!!(U.indexOf("version/15.4")>=0||U.match(/cpu (os|iphone os) 15_4 like mac os x/)),X=-1!==U.indexOf("webkit")&&-1==U.indexOf("edge"),W=-1!==U.indexOf("macintosh"),q="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,Y="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,K="undefined"!=typeof Image&&Image.prototype.decode,Z=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}();function H(t,e,r,n){var i;return i=r&&r.length?r.shift():Y?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",n)}function J(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function Q(t){var e=t.offsetWidth,r=getComputedStyle(t);return e+=parseInt(r.marginLeft,10)+parseInt(r.marginRight,10)}function $(t){var e=t.offsetHeight,r=getComputedStyle(t);return e+=parseInt(r.marginTop,10)+parseInt(r.marginBottom,10)}function tt(t,e){var r=e.parentNode;r&&r.replaceChild(t,e)}function et(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function rt(t){for(;t.lastChild;)t.removeChild(t.lastChild)}var nt=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}(),it="propertychange",ot=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function at(t,e){return t>e?1:t=0}function lt(t,e,r){var n=t.length;if(t[0]<=e)return 0;if(e<=t[n-1])return n-1;var i=void 0;if(r>0){for(i=1;i0?i-1:i:t[i-1]-e0)},e.prototype.removeEventListener=function(t,e){var r=this.listeners_&&this.listeners_[t];if(r){var n=r.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(r[n]=dt,++this.pendingRemovals_[t]):(r.splice(n,1),0===r.length&&delete this.listeners_[t]))}},e}(ot),wt="change",bt="error",St="contextmenu",Ct="click",Et="dblclick",Tt="dragenter",Pt="dragover",Rt="drop",Ot="keydown",Ft="keypress",Mt="load",It="resize",Lt="touchmove",At="wheel";function kt(t,e,r,n,i){if(n&&n!==t&&(r=r.bind(n)),i){var o=r;r=function(){t.removeEventListener(e,r),o.apply(this,arguments)}}var a={target:t,type:e,listener:r};return t.addEventListener(e,r),a}function Dt(t,e,r,n){return kt(t,e,r,n,!0)}function jt(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),yt(t))}var Gt=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zt=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 Gt(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(wt)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var r=t.length,n=new Array(r),i=0;ithis.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var r=this.cache_[e];0!=(3&t++)||r.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,r){var n=ke(t,e,r);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,r,n){var i=ke(t,e,r);this.cache_[i]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function ke(t,e,r){return e+":"+t+":"+(r?A(r):"null")}var De=new Ae,je=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ge=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=n,o.resolution=r,o.state=i,o}return je(e,t),e.prototype.changed=function(){this.dispatchEvent(wt)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return a()},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(){a()},e}(xt),ze=0,Ne=1,Ue=2,Be=4,Ve=8,Xe=16;function We(t){for(var e=$e(),r=0,n=t.length;ri&&(l|=Be),so&&(l|=Ue),l===ze&&(l=Ne),l}function $e(){return[1/0,1/0,-1/0,-1/0]}function tr(t,e,r,n,i){return i?(i[0]=t,i[1]=e,i[2]=r,i[3]=n,i):[t,e,r,n]}function er(t){return tr(1/0,1/0,-1/0,-1/0,t)}function rr(t,e){var r=t[0],n=t[1];return tr(r,n,r,n,e)}function nr(t,e,r,n,i){return sr(er(i),t,e,r,n)}function ir(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function or(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function ar(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function sr(t,e,r,n,i){for(;re[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Sr(t){return t[2]1)for(var o=t[2]-t[0],a=t[3]-t[1],s=0;s=r[2])){var i=wr(r),o=Math.floor((n[0]-r[0])/i)*i;t[0]-=o,t[2]-=o}return t}var Tr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Pr(t,e,r){var n=t,i=!0,o=!1,a=!1,s=[Dt(n,Mt,(function(){a=!0,o||e()}))];return n.src&&K?(o=!0,n.decode().then((function(){i&&e()})).catch((function(t){i&&(a?e():r())}))):s.push(Dt(n,bt,r)),function(){i=!1,s.forEach(jt)}}var Rr=function(t){function o(r,n,i,o,a,s){var l=t.call(this,r,n,i,e)||this;return l.src_=o,l.image_=new Image,null!==a&&(l.image_.crossOrigin=a),l.unlisten_=null,l.state=e,l.imageLoadFunction_=s,l}return Tr(o,t),o.prototype.getImage=function(){return this.image_},o.prototype.handleImageError_=function(){this.state=i,this.unlistenImage_(),this.changed()},o.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=vr(this.extent)/this.image_.height),this.state=n,this.unlistenImage_(),this.changed()},o.prototype.load=function(){this.state!=e&&this.state!=i||(this.state=r,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Pr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},o.prototype.setImage=function(t){this.image_=t,this.resolution=vr(this.extent)/this.image_.height},o.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},o}(Ge),Or=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fr=null,Mr=function(t){function o(e,r,n,i,o,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==i&&(s.image_.crossOrigin=i),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=o,s.size_=n,s.src_=r,s.tainted_,s}return Or(o,t),o.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===n){Fr||(Fr=H(1,1)),Fr.drawImage(this.image_,0,0);try{Fr.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Fr=null,this.tainted_=!0}}return!0===this.tainted_},o.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(wt)},o.prototype.handleImageError_=function(){this.imageState_=i,this.unlistenImage_(),this.dispatchChangeEvent_()},o.prototype.handleImageLoad_=function(){this.imageState_=n,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_()},o.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},o.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},o.prototype.getImageState=function(){return this.imageState_},o.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],r=H(t,e);r.fillRect(0,0,t,e),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},o.prototype.getSize=function(){return this.size_},o.prototype.getSrc=function(){return this.src_},o.prototype.load=function(){if(this.imageState_==e){this.imageState_=r;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Pr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},o.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===n){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 r=e.getContext("2d");if(r.scale(t,t),r.drawImage(this.image_,0,0),r.globalCompositeOperation="multiply","multiply"===r.globalCompositeOperation||this.isTainted_())r.fillStyle=A(this.color_),r.fillRect(0,0,e.width/t,e.height/t),r.globalCompositeOperation="destination-in",r.drawImage(this.image_,0,0);else{for(var i=r.getImageData(0,0,e.width,e.height),o=i.data,a=this.color_[0]/255,s=this.color_[1]/255,l=this.color_[2]/255,u=this.color_[3],h=0,c=o.length;h0,6);var f=void 0!==o.src?e:n;return i.color_=void 0!==o.color?j(o.color):null,i.iconImage_=function(t,e,r,n,i,o){var a=De.get(e,n,o);return a||(a=new Mr(t,e,r,n,i,o),De.set(e,n,o,a)),a}(c,p,void 0!==i.imgSize_?i.imgSize_:null,i.crossOrigin_,f,i.color_),i.offset_=void 0!==o.offset?o.offset:[0,0],i.offsetOrigin_=void 0!==o.offsetOrigin?o.offsetOrigin:Ie,i.origin_=null,i.size_=void 0!==o.size?o.size:null,i}return Ir(r,t),r.prototype.clone=function(){var t=this.getScale();return new r({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},r.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==Re||this.anchorYUnits_==Re){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Re&&(t[0]*=e[0]),this.anchorYUnits_==Re&&(t[1]*=e[1])}if(this.anchorOrigin_!=Ie){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Le&&this.anchorOrigin_!=Me||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Fe&&this.anchorOrigin_!=Me||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var r=this.getDisplacement();return[t[0]-r[0],t[1]+r[1]]},r.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},r.prototype.getColor=function(){return this.color_},r.prototype.getImage=function(t){return this.iconImage_.getImage(t)},r.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},r.prototype.getImageSize=function(){return this.iconImage_.getSize()},r.prototype.getImageState=function(){return this.iconImage_.getImageState()},r.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},r.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Ie){var e=this.getSize(),r=this.iconImage_.getSize();if(!e||!r)return null;t=t.slice(),this.offsetOrigin_!=Le&&this.offsetOrigin_!=Me||(t[0]=r[0]-e[0]-t[0]),this.offsetOrigin_!=Fe&&this.offsetOrigin_!=Me||(t[1]=r[1]-e[1]-t[1])}return this.origin_=t,this.origin_},r.prototype.getSrc=function(){return this.iconImage_.getSrc()},r.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},r.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(wt,t)},r.prototype.load=function(){this.iconImage_.load()},r.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(wt,t)},r}(g),Ar=Lr,kr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Dr=function(t){function e(e){var r=t.call(this)||this;if(r.on,r.once,r.un,r.id_=void 0,r.geometryName_="geometry",r.style_=null,r.styleFunction_=void 0,r.geometryChangeKey_=null,r.addChangeListener(r.geometryName_,r.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var n=e;r.setGeometry(n)}else{var i=e;r.setProperties(i)}return r}return kr(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var r=this.getGeometry();r&&t.setGeometry(r.clone());var n=this.getStyle();return n&&t.setStyle(n),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_&&(jt(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=kt(t,wt,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:(_("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}(qt);var jr=Dr,Gr="XY",zr="XYZ",Nr="XYM",Ur="XYZM",Br={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Vr={};Vr[Br.RADIANS]=6370997/(2*Math.PI),Vr[Br.DEGREES]=2*Math.PI*6370997/360,Vr[Br.FEET]=.3048,Vr[Br.METERS]=1,Vr[Br.USFEET]=1200/3937;var Xr,Wr=Br,qr=new Array(6);function Yr(t){return Zr(t,1,0,0,1,0,0)}function Kr(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=e[0],u=e[1],h=e[2],c=e[3],p=e[4],f=e[5];return t[0]=r*l+i*u,t[1]=n*l+o*u,t[2]=r*h+i*c,t[3]=n*h+o*c,t[4]=r*p+i*f+a,t[5]=n*p+o*f+s,t}function Zr(t,e,r,n,i,o,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t}function Hr(t,e){var r=e[0],n=e[1];return e[0]=t[0]*r+t[2]*n+t[4],e[1]=t[1]*r+t[3]*n+t[5],e}function Jr(t,e){var r=Math.cos(e),n=Math.sin(e);return Kr(t,Zr(qr,r,n,-n,r,0,0))}function Qr(t,e,r){return Kr(t,Zr(qr,e,0,0,r,0,0))}function $r(t,e,r){return Kr(t,Zr(qr,1,0,0,1,e,r))}function tn(t,e,r,n,i,o,a,s){var l=Math.sin(o),u=Math.cos(o);return t[0]=n*u,t[1]=i*l,t[2]=-n*l,t[3]=i*u,t[4]=a*n*u-s*n*l+e,t[5]=a*i*l+s*i*u+r,t}function en(t,e){var r,n=(r=e)[0]*r[3]-r[1]*r[2];_(0!==n,32);var i=e[0],o=e[1],a=e[2],s=e[3],l=e[4],u=e[5];return t[0]=s/n,t[1]=-o/n,t[2]=-a/n,t[3]=i/n,t[4]=(a*u-s*l)/n,t[5]=-(i*u-o*l)/n,t}function rn(t){var e="matrix("+t.join(", ")+")";if(Y)return e;var r=Xr||(Xr=document.createElement("div"));return r.style.transform=e,r.style.transform}var nn=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_||Vr[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}(),on=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),an=6378137,sn=Math.PI*an,ln=[-sn,-sn,sn,sn],un=[-180,-85,180,85],hn=an*Math.log(Math.tan(Math.PI/2)),cn=function(t){function e(e){return t.call(this,{code:e,units:Wr.METERS,extent:ln,global:!0,worldExtent:un,getPointResolution:function(t,e){return t/x(e[1]/an)}})||this}return on(e,t),e}(nn),pn=[new cn("EPSG:3857"),new cn("EPSG:102100"),new cn("EPSG:102113"),new cn("EPSG:900913"),new cn("http://www.opengis.net/def/crs/EPSG/0/3857"),new cn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function fn(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=0;ahn?s=hn:s<-hn&&(s=-hn),o[a+1]=s}return o}function dn(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=0;aa)return 1;if(a>o)return-1}return 0}function Cn(t,e){var r=e.getRadius(),n=e.getCenter(),i=n[0],o=n[1],a=t[0]-i,s=t[1]-o;0===a&&0===s&&(a=1);var l=Math.sqrt(a*a+s*s);return[i+r*a/l,o+r*s/l]}function En(t,e){var r,n,i=t[0],o=t[1],a=e[0],s=e[1],l=a[0],u=a[1],h=s[0],c=s[1],p=h-l,f=c-u,d=0===p&&0===f?0:(p*(i-l)+f*(o-u))/(p*p+f*f||0);return d<=0?(r=l,n=u):d>=1?(r=h,n=c):(r=l+d*p,n=u+d*f),[r,n]}function Tn(t,e){for(var r=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){r=!1;break}return r}function Pn(t,e){var r=Math.cos(e),n=Math.sin(e),i=t[0]*r-t[1]*n,o=t[1]*r+t[0]*n;return t[0]=i,t[1]=o,t}function Rn(t,e){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function On(t,e){return Math.sqrt(Rn(t,e))}function Fn(t,e){return Rn(t,En(t,e))}function Mn(t,e){if(e.canWrapX()){var r=wr(e.getExtent()),n=function(t,e,r){var n=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]n[2])){var o=r||wr(n);i=Math.floor((t[0]-n[0])/o)}return i}(t,e,r);n&&(t[0]-=n*r)}return t}var In=6371008.8;function Ln(t,e,r){var n=r||In,i=E(t[1]),o=E(e[1]),a=(o-i)/2,s=E(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(i)*Math.cos(o);return 2*n*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function An(t,e){for(var r=0,n=0,i=t.length;n=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(jn=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function ri(t,e){return t}function ni(t,e){return t}function ii(t,e,r,n,i,o){for(var a=o||[],s=0,l=e;l=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||ur(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,r=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+r;for(var i=1;i1)s=r;else{if(p>0){for(var f=0;fi&&(i=u),o=s,a=l}return i}function Ti(t,e,r,n,i){for(var o=0,a=r.length;o0;){for(var c=u.pop(),p=u.pop(),f=0,d=t[p],g=t[p+1],y=t[c],v=t[c+1],_=p+n;_f&&(h=_,f=m)}f>i&&(l[(h-e)/n]=1,p+n0&&g>f)&&(d<0&&y0&&y>d)?(s=c,l=p):(o[a++]=s,o[a++]=l,u=s,h=l,s=c,l=p)}}return o[a++]=s,o[a++]=l,a}function Ii(t,e,r,n,i,o,a,s){for(var l=0,u=r.length;l>1)],e))<0?a=n+1:(s=n,l=!i);return l?a:~a}(f,v);_<0?(l=(v-f[-_-2])/(f[-_-1]-f[-_-2]),s=e+(-_-2)*n):s=e+_*n}var m=a>1?a:2,x=o||new Array(m);for(d=0;d>1;io&&(u-s)*(o-l)-(i-s)*(h-l)>0&&a++:h<=o&&(u-s)*(o-l)-(i-s)*(h-l)<0&&a--,s=u,l=h}return 0!==a}function qi(t,e,r,n,i,o){if(0===r.length)return!1;if(!Wi(t,e,r[0],n,i,o))return!1;for(var a=1,s=r.length;a=i[0]&&o[2]<=i[2]||(o[1]>=i[1]&&o[3]<=i[3]||Ui(t,e,r,n,(function(t,e){return function(t,e,r){var n=!1,i=Qe(t,e),o=Qe(t,r);if(i===Ne||o===Ne)n=!0;else{var a=t[0],s=t[1],l=t[2],u=t[3],h=e[0],c=e[1],p=r[0],f=r[1],d=(f-c)/(p-h),g=void 0,y=void 0;o&Ue&&!(i&Ue)&&(n=(g=p-(f-u)/d)>=a&&g<=l),n||!(o&Be)||i&Be||(n=(y=f-(p-l)*d)>=s&&y<=u),n||!(o&Ve)||i&Ve||(n=(g=p-(f-s)/d)>=a&&g<=l),n||!(o&Xe)||i&Xe||(n=(y=f-(p-a)*d)>=s&&y<=u)}return n}(i,t,e)})))))}function Ki(t,e,r,n,i){return!!Yi(t,e,r,n,i)||(!!Wi(t,e,r,n,i[0],i[1])||(!!Wi(t,e,r,n,i[0],i[3])||(!!Wi(t,e,r,n,i[2],i[1])||!!Wi(t,e,r,n,i[2],i[3]))))}function Zi(t,e,r,n,i){if(!Ki(t,e,r[0],n,i))return!1;if(1===r.length)return!0;for(var o=1,a=r.length;ox&&qi(t,e,r,n,u=(h+c)/2,d)&&(m=u,x=w),h=c}return isNaN(m)&&(m=i[o]),a?(a.push(m,d,x),a):[m,d,x]}function ho(t,e,r,n,i){for(var o=[],a=0,s=r.length;a0}function fo(t,e,r,n,i){for(var o=void 0!==i&&i,a=0,s=r.length;a */ read:function(t,e,r,n,i){var o,a,s=8*i-n-1,l=(1<>1,h=-7,c=r?i-1:0,p=r?-1:1,f=t[e+c];for(c+=p,o=f&(1<<-h)-1,f>>=-h,h+=s;h>0;o=256*o+t[e+c],c+=p,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[e+c],c+=p,h-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=u}return(f?-1:1)*a*Math.pow(2,o-n)},write:function(t,e,r,n,i,o){var a,s,l,u=8*o-i-1,h=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,g=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=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+c>=1?p/l:p*Math.pow(2,1-c))*l>=2&&(a++,l/=2),a+c>=h?(s=0,a=h):a+c>=1?(s=(e*l-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=d,a/=256,u-=8);t[r+f-d]|=128*g}},$o=ea,ta=Qo;function ea(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}ea.Varint=0,ea.Fixed64=1,ea.Bytes=2,ea.Fixed32=5;var ra=4294967296,na=1/ra,ia="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function oa(t){return t.type===ea.Bytes?t.readVarint()+t.pos:t.pos+1}function aa(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function sa(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function la(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function ma(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}ea.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=va(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=ma(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=va(this.buf,this.pos)+va(this.buf,this.pos+4)*ra;return this.pos+=8,t},readSFixed64:function(){var t=va(this.buf,this.pos)+ma(this.buf,this.pos+4)*ra;return this.pos+=8,t},readFloat:function(){var t=ta.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ta.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,i<128)return aa(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return aa(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return aa(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return aa(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return aa(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return aa(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[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&&ia?function(t,e,r){return ia.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",i=e;for(;i239?4:l>223?3:l>191?2:1;if(i+h>r)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((u=(15&l)<<12|(63&o)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=h}return n}(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!==ea.Bytes)return t.push(this.readVarint(e));var r=oa(this);for(t=t||[];this.pos127;);else if(e===ea.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ea.Fixed32)this.pos+=4;else{if(e!==ea.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;e268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((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}(n,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,r){for(var n,i,o=0;o55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&sa(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),ta.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ta.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 r=0;r=128&&sa(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,ea.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,la,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,ua,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,pa,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,ha,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ca,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,fa,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,da,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,ga,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,ya,e)},writeBytesField:function(t,e){this.writeTag(t,ea.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ea.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ea.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ea.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ea.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ea.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ea.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ea.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ea.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ea.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var xa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wa=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=new nn({code:"",units:Wr.TILE_PIXELS}),r.featureClass_=n.featureClass?n.featureClass:Ro,r.geometryName_=n.geometryName,r.layerName_=n.layerName?n.layerName:"layer",r.layers_=n.layers?n.layers:null,r.idProperty_=n.idProperty,r.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],r}return xa(e,t),e.prototype.readRawGeometry_=function(t,e,r,n){t.pos=e.geometry;for(var i=t.readVarint()+t.pos,o=1,a=0,s=0,l=0,u=0,h=0;t.pos>3}a--,1===o||2===o?(s+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>h&&(n.push(u),h=u),r.push(s,l),u+=2):7===o?u>h&&(r.push(r[h],r[h+1]),u+=2):_(!1,59)}u>h&&(n.push(u),h=u)},e.prototype.createFeature_=function(t,e,r){var n,i=e.type;if(0===i)return null;var o,a=e.properties;this.idProperty_?(o=a[this.idProperty_],delete a[this.idProperty_]):o=e.id,a[this.layerName_]=e.layer.name;var s=[],l=[];this.readRawGeometry_(t,e,s,l);var u=function(t,e){var r;1===t?r=1===e?"Point":"MultiPoint":2===t?r=1===e?"LineString":"MultiLineString":3===t&&(r="Polygon");return r}(i,l.length);if(this.featureClass_===Ro)(n=new this.featureClass_(u,s,l,a,o)).transform(r.dataProjection);else{var h=void 0;if("Polygon"==u){var c=function(t,e){for(var r=[],n=0,i=0,o=0,a=e.length;o1?new Eo(s,Gr,c):new mo(s,Gr,l)}else h="Point"===u?new oo(s,Gr):"LineString"===u?new $i(s,Gr):"MultiPoint"===u?new lo(s,Gr):"MultiLineString"===u?new ro(s,Gr,l):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var p=Bo(h,!1,r);n.setGeometry(p),void 0!==o&&n.setId(o),n.setProperties(a,!0)}return n},e.prototype.getType=function(){return"arraybuffer"},e.prototype.readFeatures=function(t,e){var r=this.layers_,n=this.adaptOptions(e),i=Bn(n.dataProjection);i.setWorldExtent(n.extent),n.dataProjection=i;var o=new $o(t),a=o.readFields(ba,{}),s=[];for(var l in a)if(!r||-1!=r.indexOf(l)){var u=a[l],h=u?[0,0,u.extent,u.extent]:null;i.setExtent(h);for(var c=0,p=u.length;c>3)?r.readString():2===t?r.readFloat():3===t?r.readDouble():4===t?r.readVarint64():5===t?r.readVarint():6===t?r.readSVarint():7===t?r.readBoolean():null;e.values.push(n)}}function Ca(t,e,r){if(1==t)e.id=r.readVarint();else if(2==t)for(var n=r.readVarint()+r.pos;r.pos=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}var Ya=Wa,Ka=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Za=function(t){function e(e){var r=t.call(this)||this;return r.map_=e,r}return Ka(e,t),e.prototype.dispatchRenderEvent=function(t,e){a()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,r=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;tn(r,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),en(n,r)},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o,a,s){var l,u=e.viewState;function h(t,e,r,n){return i.call(o,e,t?r:null,n)}var c=u.projection,p=Mn(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&n){var d=wr(c.getExtent());f.push([-d,0],[d,0])}for(var g=e.layerStatesArray,y=g.length,v=[],_=[],m=0;m=0;--x){var w=g[x],b=w.layer;if(b.hasRenderer()&&qa(w,u)&&a.call(s,b)){var S=b.getRenderer(),C=b.getSource();if(S&&C){var E=C.getWrapX()?p:t,T=h.bind(null,w.managed);_[0]=E[0]+f[m][0],_[1]=E[1]+f[m][1],l=S.forEachFeatureAtCoordinate(_,e,r,T,v)}if(l)return l}}if(0!==v.length){var P=1/v.length;return v.forEach((function(t,e){return t.distanceSq+=e*P})),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,r,n,i){return a()},e.prototype.hasFeatureAtCoordinate=function(t,e,r,n,i,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,r,n,pt,this,i,o)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){a()},e.prototype.scheduleExpireIconCache=function(t){De.canExpireCache()&&t.postRenderFunctions.push(Ha)},e}(ot);function Ha(t,e){De.expire()}var Ja=Za,Qa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$a=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.inversePixelTransform=r,o.frameState=n,o.context=i,o}return Qa(e,t),e}(nt),ts=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),es=function(t){function e(e){var r=t.call(this,e)||this;r.fontChangeListenerKey_=kt(ue,it,e.redrawText.bind(e)),r.element_=document.createElement("div");var n=r.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",r.element_.className="ol-unselectable ol-layers";var i=e.getViewport();return i.insertBefore(r.element_,i.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return ts(e,t),e.prototype.dispatchRenderEvent=function(t,e){var r=this.getMap();if(r.hasListener(t)){var n=new $a(t,void 0,e);r.dispatchEvent(n)}},e.prototype.disposeInternal=function(){jt(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(Ua,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),r=t.viewState;this.children_.length=0;for(var n=[],i=null,o=0,a=e.length;o=0;--o)n[o].renderDeclutter(t);!function(t,e){for(var r=t.childNodes,n=0;;++n){var i=r[n],o=e[n];if(!i&&!o)break;i!==o&&(i?o?t.insertBefore(o,i):(t.removeChild(i),--n):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(Ba,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,r,n,i){for(var o=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],u=l.layer;if(u.hasRenderer()&&qa(l,o)&&i(u)){var h=u.getRenderer().getDataAtPixel(t,e,r);if(h){var c=n(u,h);if(c)return c}}}},e}(Ja),rs=es,ns="add",is="remove",os=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),as="length",ss=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.element=r,i.index=n,i}return os(e,t),e}(nt),ls=function(t){function e(e,r){var n=t.call(this)||this;n.on,n.once,n.un;var i=r||{};if(n.unique_=!!i.unique,n.array_=e||[],n.unique_)for(var o=0,a=n.array_.length;o0;)this.pop()},e.prototype.extend=function(t){for(var e=0,r=t.length;ethis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(jt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Lt,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(jt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(jt),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(xt),Cs="postrender",Es="movestart",Ts="moveend",Ps="loadstart",Rs="loadend",Os="layergroup",Fs="size",Ms="target",Is="view",Ls=1/0,As=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,yt(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,r=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(r);return delete this.queuedElements_[n],r},t.prototype.enqueue=function(t){_(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=Ls&&(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_,r=this.priorities_,n=e.length,i=e[t],o=r[t],a=t;t>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=lt;){var a=this.getParentIndex_(e);if(!(n[a]>o))break;r[e]=r[a],n[e]=n[a],e=a}r[e]=i,n[e]=o},t.prototype.reprioritize=function(){var t,e,r,n=this.priorityFunction_,i=this.elements_,o=this.priorities_,a=0,s=i.length;for(e=0;e0;)n=(r=this.dequeue()[0]).getKey(),r.getState()!==ks||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++i,r.load())},e}(As);var Bs=0,Vs=1,Xs={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},Ws=256;function qs(t,e,r){return function(n,i,o,a,s){if(n){if(!i&&!e)return n;var l=e?0:o[0]*i,u=e?0:o[1]*i,h=s?s[0]:0,c=s?s[1]:0,p=t[0]+l/2+h,f=t[2]-l/2+h,d=t[1]+u/2+c,g=t[3]-u/2+c;p>f&&(f=p=(f+p)/2),d>g&&(g=d=(g+d)/2);var y=m(n[0],p,f),v=m(n[1],d,g);if(a&&r&&i){var _=30*i;y+=-_*Math.log(1+Math.max(0,p-n[0])/_)+_*Math.log(1+Math.max(0,n[0]-f)/_),v+=-_*Math.log(1+Math.max(0,d-n[1])/_)+_*Math.log(1+Math.max(0,n[1]-g)/_)}return[y,v]}}}function Ys(t){return t}function Ks(t,e,r,n){var i=wr(e)/r[0],o=vr(e)/r[1];return n?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function Zs(t,e,r){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,r&&(n=Math.max(n,r),n/=Math.log(1+50*Math.max(0,r/t-1))/50+1),m(n,r/2,2*e)}function Hs(t,e,r,n,i){return function(o,a,s,l){if(void 0!==o){var u=n?Ks(t,n,s,i):t;return(void 0===r||r)&&l?Zs(o,u,e):m(o,e,u)}}}function Js(t){return void 0!==t?0:void 0}function Qs(t){return void 0!==t?t:void 0}function $s(t){return Math.pow(t,3)}function tl(t){return 1-$s(1-t)}function el(t){return 3*t*t-2*t*t*t}function rl(t){return t}var nl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),il=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=gt({},e);return r.hints_=[0,0],r.animations_=[],r.updateAnimationKey_,r.projection_=Wn(n.projection,"EPSG:3857"),r.viewportSize_=[100,100],r.targetCenter_=null,r.targetResolution_,r.targetRotation_,r.nextCenter_=null,r.nextResolution_,r.nextRotation_,r.cancelAnchor_=void 0,n.projection&&Gn(),n.center&&(n.center=ei(n.center,r.projection_)),n.extent&&(n.extent=ni(n.extent,r.projection_)),r.applyOptions_(n),r}return nl(e,t),e.prototype.applyOptions_=function(t){var e=gt({},t);for(var r in Xs)delete e[r];this.setProperties(e,!0);var n=function(t){var e,r,n,i=28,o=2,a=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:i,l=void 0!==t.zoomFactor?t.zoomFactor:o,u=void 0!==t.multiWorld&&t.multiWorld,h=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,c=void 0!==t.showFullExtent&&t.showFullExtent,p=Wn(t.projection,"EPSG:3857"),f=p.getExtent(),d=t.constrainOnlyCenter,g=t.extent;u||g||!p.isGlobal()||(d=!1,g=f);if(void 0!==t.resolutions){var y=t.resolutions;r=y[a],n=void 0!==y[s]?y[s]:y[y.length-1],e=t.constrainResolution?function(t,e,r,n){return function(i,o,a,s){if(void 0!==i){var l=t[0],u=t[t.length-1],h=r?Ks(l,r,a,n):l;if(s)return void 0===e||e?Zs(i,h,u):m(i,u,h);var c=Math.min(h,i),p=Math.floor(lt(t,c,o));return t[p]>h&&p1&&"function"==typeof arguments[r-1]&&(e=arguments[r-1],--r);for(var n=0;n0},e.prototype.getInteracting=function(){return this.hints_[Vs]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Bs,-this.hints_[Bs]);for(var e=0,r=this.animations_.length;e=0;--r){for(var n=this.animations_[r],i=!0,o=0,a=n.length;o0?l/s.duration:1;u>=1?(s.complete=!0,u=1):i=!1;var h=s.easing(u);if(s.sourceCenter){var c=s.sourceCenter[0],p=s.sourceCenter[1],f=s.targetCenter[0],d=s.targetCenter[1];this.nextCenter_=s.targetCenter;var g=c+h*(f-c),y=p+h*(d-p);this.targetCenter_=[g,y]}if(s.sourceResolution&&s.targetResolution){var v=1===h?s.targetResolution:s.sourceResolution+h*(s.targetResolution-s.sourceResolution);if(s.anchor){var _=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(v,0,_,!0);this.targetCenter_=this.calculateCenterZoom(m,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=v,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var x=1===h?T(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+h*(s.targetRotation-s.sourceRotation);if(s.anchor){var w=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(w,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(i){this.animations_[r]=null,this.setHint(Bs,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var b=n[0].callback;b&&ol(b,!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 r,n,i,o=this.getCenterInternal();return void 0!==o&&(Pn(r=[o[0]-e[0],o[1]-e[1]],t-this.getRotation()),i=e,(n=r)[0]+=+i[0],n[1]+=+i[1]),r},e.prototype.calculateCenterZoom=function(t,e){var r,n=this.getCenterInternal(),i=this.getResolution();void 0!==n&&void 0!==i&&(r=[e[0]-t*(e[0]-n[0])/i,e[1]-t*(e[1]-n[1])/i]);return r},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var r=e[0],n=e[1];return[Math.abs(r*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(r*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?ti(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Xs.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return ri(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),r=this.getCenterInternal();_(r,1);var n=this.getResolution();_(void 0!==n,2);var i=this.getRotation();return _(void 0!==i,3),gr(r,n,i,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(Xs.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(ni(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var r=e||this.getViewportSizeMinusPadding_(),n=wr(t)/r[0],i=vr(t)/r[1];return Math.max(n,i)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,r=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(r/n)/Math.log(e);return function(t){return r/Math.pow(e,t*i)}},e.prototype.getRotation=function(){return this.get(Xs.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),r=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(r/n)/e;return function(t){return Math.log(r/t)/e/i}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),r=this.padding_;return r&&(e=[e[0]-r[1]-r[3],e[1]-r[0]-r[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),r=this.getRotation(),n=this.getCenterInternal(),i=this.padding_;if(i){var o=this.getViewportSizeMinusPadding_();n=sl(n,this.getViewportSize_(),[o[0]/2+i[3],o[1]/2+i[0]],e,r)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:r,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,r,n=this.minZoom_||0;if(this.resolutions_){var i=lt(this.resolutions_,t,1);n=i,e=this.resolutions_[i],r=i==this.resolutions_.length-1?2:e/this.resolutions_[i+1]}else e=this.maxResolution_,r=this.zoomFactor_;return n+Math.log(e/t)/Math.log(r)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=m(Math.floor(t),0,this.resolutions_.length-2),r=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(r,m(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var r;if(_(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))_(!Sr(t),25),r=xo(n=ni(t,this.getProjection()));else if("Circle"===t.getType()){var n;(r=xo(n=ni(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),fr(n))}else{r=t}this.fitInternal(r,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),r=Math.cos(e),n=Math.sin(-e),i=t.getFlatCoordinates(),o=t.getStride(),a=1/0,s=1/0,l=-1/0,u=-1/0,h=0,c=i.length;h=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 r=this.maxTilesLoading_,n=r;if(t){var i=t.viewHints;if(i[Bs]||i[Vs]){var o=Date.now()-t.time>8;r=o?0:8,n=o?0:2}}e.getTilesLoading()0;if(this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),!ct(e,this.renderedAttributions_)){rt(this.ulElement_);for(var n=0,i=e.length;n0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:tl}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var r=e.viewState.rotation;if(r!=this.rotation_){var n="rotate("+r+"rad)";if(this.autoHide_){var i=this.element.classList.contains(Yt);i||0!==r?i&&0!==r&&this.element.classList.remove(Yt):this.element.classList.add(Yt)}this.label_.style.transform=n}this.rotation_=r}},e}(gl),bl=wl,Sl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cl=function(t){function e(e){var r=this,n=e||{};r=t.call(this,{element:document.createElement("div"),target:n.target})||this;var i=void 0!==n.className?n.className:"ol-zoom",o=void 0!==n.delta?n.delta:1,a=void 0!==n.zoomInClassName?n.zoomInClassName:i+"-in",s=void 0!==n.zoomOutClassName?n.zoomOutClassName:i+"-out",l=void 0!==n.zoomInLabel?n.zoomInLabel:"+",u=void 0!==n.zoomOutLabel?n.zoomOutLabel:"–",h=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",c=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=a,p.setAttribute("type","button"),p.title=h,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(Ct,r.handleClick_.bind(r,o),!1);var f=document.createElement("button");f.className=s,f.setAttribute("type","button"),f.title=c,f.appendChild("string"==typeof u?document.createTextNode(u):u),f.addEventListener(Ct,r.handleClick_.bind(r,-o),!1);var d=i+" "+"ol-unselectable "+Zt,g=r.element;return g.className=d,g.appendChild(p),g.appendChild(f),r.duration_=void 0!==n.duration?n.duration:250,r}return Sl(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 r=e.getZoom();if(void 0!==r){var n=e.getConstrainedZoom(r+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:tl})):e.setZoom(n)}}},e}(gl),El=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tl="element",Pl="map",Rl="offset",Ol="position",Fl="positioning",Ml=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un,r.options=e,r.id=e.id,r.insertFirst=void 0===e.insertFirst||e.insertFirst,r.stopEvent=void 0===e.stopEvent||e.stopEvent,r.element=document.createElement("div"),r.element.className=void 0!==e.className?e.className:"ol-overlay-container ol-selectable",r.element.style.position="absolute",r.element.style.pointerEvents="auto";var n=e.autoPan;return n&&"object"!=typeof n&&(n={animation:e.autoPanAnimation,margin:e.autoPanMargin}),r.autoPan=n||!1,r.rendered={transform_:"",visible:!0},r.mapPostrenderListenerKey=null,r.addChangeListener(Tl,r.handleElementChanged),r.addChangeListener(Pl,r.handleMapChanged),r.addChangeListener(Rl,r.handleOffsetChanged),r.addChangeListener(Ol,r.handlePositionChanged),r.addChangeListener(Fl,r.handlePositioningChanged),void 0!==e.element&&r.setElement(e.element),r.setOffset(void 0!==e.offset?e.offset:[0,0]),r.setPositioning(e.positioning||"top-left"),void 0!==e.position&&r.setPosition(e.position),r}return El(e,t),e.prototype.getElement=function(){return this.get(Tl)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(Pl)||null},e.prototype.getOffset=function(){return this.get(Rl)},e.prototype.getPosition=function(){return this.get(Ol)},e.prototype.getPositioning=function(){return this.get(Fl)},e.prototype.handleElementChanged=function(){rt(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(et(this.element),jt(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=kt(t,Cs,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(Tl,t)},e.prototype.setMap=function(t){this.set(Pl,t)},e.prototype.setOffset=function(t){this.set(Rl,t)},e.prototype.setPosition=function(t){this.set(Ol,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(Ol)){var r=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),i=this.getRect(n,[Q(n),$(n)]),o=t||{},a=void 0===o.margin?20:o.margin;if(!He(r,i)){var s=i[0]-r[0],l=r[2]-i[2],u=i[1]-r[1],h=r[3]-i[3],c=[0,0];if(s<0?c[0]=s-a:l<0&&(c[0]=Math.abs(l)+a),u<0?c[1]=u-a:h<0&&(c[1]=Math.abs(h)+a),0!==c[0]||0!==c[1]){var p=e.getView().getCenterInternal(),f=e.getPixelFromCoordinateInternal(p);if(!f)return;var d=[f[0]+c[0],f[1]+c[1]],g=o.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(d),duration:g.duration,easing:g.easing})}}}},e.prototype.getRect=function(t,e){var r=t.getBoundingClientRect(),n=r.left+window.pageXOffset,i=r.top+window.pageYOffset;return[n,i,n+e[0],i+e[1]]},e.prototype.setPositioning=function(t){this.set(Fl,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var r=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(r,n)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var r=this.element.style,n=this.getOffset(),i=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+n[0])+"px",a=Math.round(t[1]+n[1])+"px",s="0%",l="0%";"bottom-right"==i||"center-right"==i||"top-right"==i?s="-100%":"bottom-center"!=i&&"center-center"!=i&&"top-center"!=i||(s="-50%"),"bottom-left"==i||"bottom-center"==i||"bottom-right"==i?l="-100%":"center-left"!=i&&"center-center"!=i&&"center-right"!=i||(l="-50%");var u="translate(".concat(s,", ").concat(l,") translate(").concat(o,", ").concat(a,")");this.rendered.transform_!=u&&(this.rendered.transform_=u,r.transform=u,r.msTransform=u)},e.prototype.getOptions=function(){return this.options},e}(qt),Il=Ml,Ll=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Al="units",kl="degrees",Dl="imperial",jl="nautical",Gl="metric",zl="us",Nl=[1,2,5],Ul=25.4/.28,Bl=function(t){function e(e){var r=this,n=e||{},i=void 0!==n.className?n.className:n.bar?"ol-scale-bar":"ol-scale-line";return(r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).on,r.once,r.un,r.innerElement_=document.createElement("div"),r.innerElement_.className=i+"-inner",r.element.className=i+" "+Kt,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=void 0!==n.minWidth?n.minWidth:64,r.maxWidth_=n.maxWidth,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addChangeListener(Al,r.handleUnitsChanged_),r.setUnits(n.units||Gl),r.scaleBar_=n.bar||!1,r.scaleBarSteps_=n.steps||4,r.scaleBarText_=n.text||!1,r.dpi_=n.dpi||void 0,r}return Ll(e,t),e.prototype.getUnits=function(){return this.get(Al)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(Al,t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,r=t.projection,n=this.getUnits(),i=n==kl?Wr.DEGREES:Wr.METERS,o=Vn(r,t.resolution,e,i),a=this.minWidth_*(this.dpi_||Ul)/Ul,s=void 0!==this.maxWidth_?this.maxWidth_*(this.dpi_||Ul)/Ul:void 0,l=a*o,u="";if(n==kl){var h=Vr[Wr.DEGREES];(l*=h)=s){c=d,p=g,f=y;break}if(p>=a)break;d=c,g=p,y=f,++m}v=this.scaleBar_?this.createScaleBar(p,c,u):c.toFixed(f<0?-f:0)+" "+u,this.renderedHTML_!=v&&(this.innerElement_.innerHTML=v,this.renderedHTML_=v),this.renderedWidth_!=p&&(this.innerElement_.style.width=p+"px",this.renderedWidth_=p),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,r){for(var n="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,a="ol-scale-singlebar-odd",s=0;s
'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,r):"")+""),s===this.scaleBarSteps_-1&&i.push(this.createStepText(s+1,t,!0,e,r)),a="ol-scale-singlebar-odd"===a?"ol-scale-singlebar-even":"ol-scale-singlebar-odd";return'
'+(this.scaleBarText_?'
'+n+"
":"")+i.join("")+"
"},e.prototype.createMarker=function(t,e){return'
'},e.prototype.createStepText=function(t,e,r,n,i){var o=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);return'
'+o+"
"},e.prototype.getScaleForResolution=function(){var t=Vn(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,Wr.METERS),e=this.dpi_||Ul;return parseFloat(t.toString())*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(gl),Vl=Bl;var Xl="active",Wl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function ql(t,e,r,n){var i=t.getZoom();if(void 0!==i){var o=t.getConstrainedZoom(i+e),a=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:r,duration:void 0!==n?n:250,easing:tl})}}var Yl=function(t){function e(e){var r=t.call(this)||this;return r.on,r.once,r.un,e&&e.handleEvent&&(r.handleEvent=e.handleEvent),r.map_=null,r.setActive(!0),r}return Wl(e,t),e.prototype.getActive=function(){return this.get(Xl)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Xl,t)},e.prototype.setMap=function(t){this.map_=t},e}(qt),Kl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zl=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:250,r}return Kl(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==ms.DBLCLICK){var r=t.originalEvent,n=t.map,i=t.coordinate,o=r.shiftKey?-this.delta_:this.delta_;ql(n.getView(),o,i,this.duration_),r.preventDefault(),e=!0}return!e},e}(Yl),Hl=Zl,Jl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Ql(t){for(var e=t.length,r=0,n=0,i=0;i0}}else if(t.type==ms.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==ms.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){t.activePointers&&(this.targetPointers=t.activePointers)},e}(Yl);function tu(t){var e=arguments;return function(t){for(var r=!0,n=0,i=e.length;n0&&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}($l),du=fu,gu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yu=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{stopDown:ft})||this).condition_=n.condition?n.condition:eu,r.lastAngle_=void 0,r.duration_=void 0!==n.duration?n.duration:250,r}return gu(e,t),e.prototype.handleDragEvent=function(t){if(hu(t)){var e=t.map,r=e.getView();if(r.getConstraints().rotation!==Js){var n=e.getSize(),i=t.pixel,o=Math.atan2(n[1]/2-i[1],i[0]-n[0]/2);if(void 0!==this.lastAngle_){var a=o-this.lastAngle_;r.adjustRotationInternal(-a)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!hu(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!hu(t)&&(!(!iu(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}($l),vu=yu,_u=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mu=function(t){function e(e){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+e,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return _u(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,r="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+r,n.top=Math.min(t[1],e[1])+r,n.width=Math.abs(e[0]-t[0])+r,n.height=Math.abs(e[1]-t[1])+r},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_,r=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new mo([r])},e.prototype.getGeometry=function(){return this.geometry_},e}(ot),xu=mu,wu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bu="boxstart",Su="boxdrag",Cu="boxend",Eu="boxcancel",Tu=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.coordinate=r,i.mapBrowserEvent=n,i}return wu(e,t),e}(nt),Pu=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=e||{};return r.box_=new xu(n.className||"ol-dragbox"),r.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(r.onBoxEnd=n.onBoxEnd),r.startPixel_=null,r.condition_=n.condition?n.condition:iu,r.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:r.defaultBoxEndCondition,r}return wu(e,t),e.prototype.defaultBoxEndCondition=function(t,e,r){var n=r[0]-e[0],i=r[1]-e[1];return n*n+i*i>=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 Tu(Su,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 Tu(e?Cu:Eu,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 Tu(bu,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}($l),Ru=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ou=function(t){function e(e){var r=this,n=e||{},i=n.condition?n.condition:lu;return(r=t.call(this,{condition:i,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,r.out_=void 0!==n.out&&n.out,r}return Ru(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),r=this.getGeometry();if(this.out_){var n=e.rotatedExtentForGeometry(r),i=e.getResolutionForExtentInternal(n),o=e.getResolution()/i;(r=r.clone()).scale(o*o)}e.fitInternal(r,{duration:this.duration_,easing:tl})},e}(Pu),Fu=37,Mu=38,Iu=39,Lu=40,Au=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ku=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.defaultCondition_=function(t){return su(t)&&uu(t)},r.condition_=void 0!==n.condition?n.condition:r.defaultCondition_,r.duration_=void 0!==n.duration?n.duration:100,r.pixelDelta_=void 0!==n.pixelDelta?n.pixelDelta:128,r}return Au(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Ot){var r=t.originalEvent,n=r.keyCode;if(this.condition_(t)&&(n==Lu||n==Fu||n==Iu||n==Mu)){var i=t.map.getView(),o=i.getResolution()*this.pixelDelta_,a=0,s=0;n==Lu?s=-o:n==Fu?a=-o:n==Iu?a=o:s=o;var l=[a,s];Pn(l,i.getRotation()),function(t,e,r){var n=t.getCenterInternal();if(n){var i=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==r?r:250,easing:rl,center:t.getConstrainedCenter(i)})}}(i,l,this.duration_),r.preventDefault(),e=!0}}return!e},e}(Yl),Du=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ju=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.condition_=n.condition?n.condition:uu,r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:100,r}return Du(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Ot||t.type==Ft){var r=t.originalEvent,n=r.charCode;if(this.condition_(t)&&(n=="+".charCodeAt(0)||n=="-".charCodeAt(0))){var i=t.map,o=n=="+".charCodeAt(0)?this.delta_:-this.delta_;ql(i.getView(),o,void 0,this.duration_),r.preventDefault(),e=!0}}return!e},e}(Yl),Gu=function(){function t(t,e,r){this.decay_=t,this.minVelocity_=e,this.delay_=r,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]0&&this.points_[r+2]>t;)r-=3;var n=this.points_[e+2]-this.points_[r+2];if(n<1e3/60)return!1;var i=this.points_[e]-this.points_[r],o=this.points_[e+1]-this.points_[r+1];return this.angle_=Math.atan2(o,i),this.initialVelocity_=Math.sqrt(i*i+o*o)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),zu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Nu="trackpad",Uu="wheel",Bu=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,n)||this).totalDelta_=0,r.lastDelta_=0,r.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,r.duration_=void 0!==n.duration?n.duration:250,r.timeout_=void 0!==n.timeout?n.timeout:80,r.useAnchor_=void 0===n.useAnchor||n.useAnchor,r.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var i=n.condition?n.condition:nu;return r.condition_=n.onFocusOnly?tu(ru,i):i,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return zu(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var t=this.getMap();t&&t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==At)return!0;var e,r=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==At&&(e=n.deltaY,B&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=q),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var i=Date.now();void 0===this.startTime_&&(this.startTime_=i),(!this.mode_||i-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Nu:Uu);var o=r.getView();if(this.mode_===Nu&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=i,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,r),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var r=-m(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(r=r?r>0?1:-1:0),ql(e,r,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}(Yl),Vu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xu=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=ft),(r=t.call(this,i)||this).anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=void 0!==n.threshold?n.threshold:.3,r.duration_=void 0!==n.duration?n.duration:250,r}return Vu(e,t),e.prototype.handleDragEvent=function(t){var e=0,r=this.targetPointers[0],n=this.targetPointers[1],i=Math.atan2(n.clientY-r.clientY,n.clientX-r.clientX);if(void 0!==this.lastAngle_){var o=i-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=i;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==Js){var l=a.getViewport().getBoundingClientRect(),u=Ql(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}($l),Wu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qu=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=ft),(r=t.call(this,i)||this).anchor_=null,r.duration_=void 0!==n.duration?n.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return Wu(e,t),e.prototype.handleDragEvent=function(t){var e=1,r=this.targetPointers[0],n=this.targetPointers[1],i=r.clientX-n.clientX,o=r.clientY-n.clientY,a=Math.sqrt(i*i+o*o);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(),h=Ql(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(h),s.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),!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}($l),Yu=qu,Ku=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zu="addfeatures",Hu=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.features=n,o.file=r,o.projection=i,o}return Ku(e,t),e}(nt),Ju=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{handleEvent:pt})||this).on,r.once,r.un,r.readAsBuffer_=!1,r.formats_=[];for(var i=n.formatConstructors?n.formatConstructors:[],o=0,a=i.length;o0){this.source_&&(this.source_.clear(),this.source_.addFeatures(c)),this.dispatchEvent(new Hu(Zu,t,c,o));break}}},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[kt(e,Rt,this.handleDrop,this),kt(e,Tt,this.handleStop,this),kt(e,Pt,this.handleStop,this),kt(e,Rt,this.handleStop,this)]}},e.prototype.setActive=function(e){!this.getActive()&&e&&this.registerListeners_(),this.getActive()&&!e&&this.unregisterListeners_(),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.unregisterListeners_(),t.prototype.setMap.call(this,e),this.getActive()&&this.registerListeners_()},e.prototype.tryReadFeatures_=function(t,e,r){try{return t.readFeatures(e,r)}catch(t){return null}},e.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(jt),this.dropListenKeys_=null)},e.prototype.handleDrop=function(t){for(var e=t.dataTransfer.files,r=0,n=e.length;r1?1:-1;return e.endInteraction(this.duration_,r),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!hu(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},e}($l),eh=th;function rh(t,e,r,n,i){nh(t,e,r||0,n||t.length-1,i||oh)}function nh(t,e,r,n,i){for(;n>r;){if(n-r>600){var o=n-r+1,a=e-r+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);nh(t,e,Math.max(r,Math.floor(e-a*l/o+u)),Math.min(n,Math.floor(e+(o-a)*l/o+u)),i)}var h=t[e],c=r,p=n;for(ih(t,r,e),i(t[n],h)>0&&ih(t,r,n);c0;)p--}0===i(t[r],h)?ih(t,r,p):ih(t,++p,n),p<=e&&(r=p+1),e<=p&&(n=p-1)}}function ih(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function oh(t,e){return te?1:0}class ah{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 r=[];if(!vh(t,e))return r;const n=this.toBBox,i=[];for(;e;){for(let o=0;o=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(n,i,e)}_split(t,e){const r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);const o=this._chooseSplitIndex(r,i,n),a=_h(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,lh(r,this.toBBox),lh(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,e){this.data=_h([t,e]),this.data.height=t.height+1,this.data.leaf=!1,lh(this.data,this.toBBox)}_chooseSplitIndex(t,e,r){let n,i=1/0,o=1/0;for(let a=e;a<=r-e;a++){const e=uh(t,0,a,this.toBBox),s=uh(t,a,r,this.toBBox),l=gh(e,s),u=fh(e)+fh(s);l=e;n--){const e=t.children[n];hh(a,t.leaf?i(e):e),s+=dh(a)}return s}_adjustParentBBoxes(t,e,r){for(let n=r;n>=0;n--)hh(e[n],t)}_condense(t){for(let e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children,e.splice(e.indexOf(t[r]),1)):this.clear():lh(t[r],this.toBBox)}}function sh(t,e,r){if(!r)return e.indexOf(t);for(let n=0;n=t.minX&&e.maxY>=t.minY}function _h(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function mh(t,e,r,n,i){const o=[e,r];for(;o.length;){if((r=o.pop())-(e=o.pop())<=n)continue;const a=e+Math.ceil((r-e)/n/2)*n;rh(t,a,e,r,i),o.push(e,a,a,r)}}var xh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wh="renderOrder",bh=function(t){function e(e){var r=this,n=e||{},i=gt({},n);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(r=t.call(this,i)||this).declutter_=void 0!==n.declutter&&n.declutter,r.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(n.style),r.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,r.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,r}return xh(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(wh)},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 ah(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(wh,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:Lo,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var r;Array.isArray(t)?r=t:(_("function"==typeof t.getZIndex,41),r=[t]),e=function(){return r}}return e}(this.style_),this.changed()},e}(Ya),Sh={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},Ch=[Sh.FILL],Eh=[Sh.STROKE],Th=[Sh.BEGIN_PATH],Ph=[Sh.CLOSE_PATH],Rh=Sh,Oh=function(){function t(){}return t.prototype.drawCustom=function(t,e,r,n){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),Fh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mh=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=r,o.pixelRatio=i,o.maxLineWidth=0,o.resolution=n,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return Fh(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 r=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,i=this.coordinates,o=i.length,a=0,s=t.length;ac&&(this.instructions.push([Rh.CUSTOM,c,o,t,r,Li]),this.hitDetectionInstructions.push([Rh.CUSTOM,c,o,t,n||r,Li]));break;case"Point":i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([Rh.CUSTOM,c,o,t,r]),this.hitDetectionInstructions.push([Rh.CUSTOM,c,o,t,n||r])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[Rh.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Rh.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 r,n,i=e.length,o=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=r.lineWidth,this.bufferedMaxExtent_=null)}else r.strokeStyle=void 0,r.lineCap=void 0,r.lineDash=null,r.lineDashOffset=void 0,r.lineJoin=void 0,r.lineWidth=void 0,r.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,r=[Rh.SET_FILL_STYLE,e];return"string"!=typeof e&&r.push(!0),r},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[Rh.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 r=t.fillStyle;"string"==typeof r&&t.currentFillStyle==r||(void 0!==r&&this.instructions.push(e.call(this,t)),t.currentFillStyle=r)},e.prototype.updateStrokeStyle=function(t,e){var r=t.strokeStyle,n=t.lineCap,i=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=r||t.currentLineCap!=n||i!=t.currentLineDash&&!ct(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==r&&e.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=n,t.currentLineDash=i,t.currentLineDashOffset=o,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=[Rh.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Ye(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;qe(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Oh),Ih=Mh,Lh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ah=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterMode_=void 0,o.declutterImageWithText_=void 0,o}return Lh(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(r,n);this.instructions.push([Rh.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Rh.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(r,n);this.instructions.push([Rh.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Rh.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var r=t.getAnchor(),n=t.getSize(),i=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=r[0],this.anchorY_=r[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=i[0],this.originY_=i[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e},e}(Ih),kh=Ah,Dh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),jh=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return Dh(e,t),e.prototype.drawFlatCoordinates_=function(t,e,r,n){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,r,n,!1,!1),a=[Rh.MOVE_TO_LINE_TO,i,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),r},e.prototype.drawLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Rh.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,ne,0],Th);var o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(Eh),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Rh.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Th);for(var o=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,h=o.length;ut&&(v>y&&(y=v,d=_,g=o),v=0,_=o-i)),a=s,h=p,c=f),l=m,u=x}return(v+=s)>y?[_,o]:[d,g]}var Vh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xh={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Wh=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return Vh(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 r=this.textFillState_,n=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(r||n)){var o=this.coordinates,a=o.length,s=t.getType(),l=null,u=t.getStride();if(i.placement!==Go||"LineString"!=s&&"MultiLineString"!=s&&"Polygon"!=s&&"MultiPolygon"!=s){var h=i.overflow?null:[];switch(s){case"Point":case"MultiPoint":l=t.getFlatCoordinates();break;case"LineString":l=t.getFlatMidpoint();break;case"Circle":l=t.getCenter();break;case"MultiLineString":l=t.getFlatMidpoints(),u=2;break;case"Polygon":l=t.getFlatInteriorPoint(),i.overflow||h.push(l[2]/this.resolution),u=3;break;case"MultiPolygon":var c=t.getFlatInteriorPoints();l=[];for(b=0,S=c.length;bO[2]}else E=x>T;var F,M=Math.PI,I=[],L=b+n===e;if(y=0,v=S,p=t[e=b],f=t[e+1],L){_(),F=Math.atan2(f-g,p-d),E&&(F+=F>0?-M:M);var A=(T+x)/2,k=(R+w)/2;return I[0]=[A,k,(C-o)/2,F,i],I}for(var D=0,j=(i=i.replace(/\n/g," ")).length;D0?-M:M),void 0!==F){var z=G-F;if(z+=z>M?-2*M:z<-M?2*M:0,Math.abs(z)>a)return null}F=G;for(var N=D,U=0;D0&&t.push("\n",""),t.push(e,""),t}var pc=function(){function t(t,e,r,n){this.overlaps=r,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,r,n){var i=t+e+r+n;if(this.labels_[i])return this.labels_[i];var o=n?this.strokeStates[n]:null,a=r?this.fillStates[r]:null,s=this.textStates[e],l=this.pixelRatio,u=[s.scale[0]*l,s.scale[1]*l],h=Array.isArray(t),c=s.justify?Xh[s.justify]:hc(Array.isArray(t)?t[0]:t,s.textAlign||ae),p=n&&o.lineWidth?o.lineWidth:0,f=h?t:t.split("\n").reduce(cc,[]),d=function(t,e){for(var r=[],n=[],i=[],o=0,a=0,s=0,l=0,u=0,h=e.length;u<=h;u+=2){var c=e[u];if("\n"!==c&&u!==h){var p=e[u+1]||t.font,f=ve(p,c);r.push(f),a+=f;var d=ge(p);n.push(d),l=Math.max(l,d)}else o=Math.max(o,a),i.push(a),a=0,s+=l}return{width:o,height:s,widths:r,heights:n,lineWidths:i}}(s,f),g=d.width,y=d.height,v=d.widths,_=d.heights,m=d.lineWidths,x=g+p,w=[],b=(x+2)*u[0],S=(y+p)*u[1],C={width:b<0?Math.floor(b):Math.ceil(b),height:S<0?Math.floor(S):Math.ceil(S),contextInstructions:w};(1==u[0]&&1==u[1]||w.push("scale",u),n)&&(w.push("strokeStyle",o.strokeStyle),w.push("lineWidth",p),w.push("lineCap",o.lineCap),w.push("lineJoin",o.lineJoin),w.push("miterLimit",o.miterLimit),(Y?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(w.push("setLineDash",[o.lineDash]),w.push("lineDashOffset",o.lineDashOffset)));r&&w.push("fillStyle",a.fillStyle),w.push("textBaseline","middle"),w.push("textAlign","center");for(var E,T=.5-c,P=c*x+T*p,R=[],O=[],F=0,M=0,I=0,L=0,A=0,k=f.length;At?t-l:i,x=o+u>e?e-u:o,w=f[3]+m*c[0]+f[1],b=f[0]+x*c[1]+f[2],S=v-f[3],C=_-f[0];return(d||0!==h)&&(ic[0]=S,sc[0]=S,ic[1]=C,oc[1]=C,oc[0]=S+w,ac[0]=oc[0],ac[1]=C+b,sc[1]=ac[1]),0!==h?(Hr(y=tn([1,0,0,1,0,0],r,n,1,1,h,-r,-n),ic),Hr(y,oc),Hr(y,ac),Hr(y,sc),tr(Math.min(ic[0],oc[0],ac[0],sc[0]),Math.min(ic[1],oc[1],ac[1],sc[1]),Math.max(ic[0],oc[0],ac[0],sc[0]),Math.max(ic[1],oc[1],ac[1],sc[1]),nc)):tr(Math.min(S,S+w),Math.min(C,C+b),Math.max(S,S+w),Math.max(C,C+b),nc),p&&(v=Math.round(v),_=Math.round(_)),{drawImageX:v,drawImageY:_,drawImageW:m,drawImageH:x,originX:l,originY:u,declutterBox:{minX:nc[0],minY:nc[1],maxX:nc[2],maxY:nc[3],value:g},canvasTransform:y,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,r,n,i,o,a){var s=!(!o&&!a),l=n.declutterBox,u=t.canvas,h=a?a[2]*n.scale[0]/2:0;return l.minX-h<=u.width/e&&l.maxX+h>=0&&l.minY-h<=u.height/e&&l.maxY+h>=0&&(s&&this.replayTextBackground_(t,ic,oc,ac,sc,o,a),me(t,n.canvasTransform,i,r,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=Hr(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;t.save(),t.translate(e[0]%r,e[1]%r),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,r,n){var i=this.textStates[e],o=this.createLabel(t,e,n,r),a=this.strokeStates[r],s=this.pixelRatio,l=hc(Array.isArray(t)?t[0]:t,i.textAlign||ae),u=Xh[i.textBaseline||se],h=a&&a.lineWidth?a.lineWidth:0;return{label:o,anchorX:l*(o.width/s-2*i.scale[0])+2*(.5-l)*h,anchorY:u*o.height/s+2*(.5-u)*h}},t.prototype.execute_=function(t,e,r,n,i,o,a,s){var l,u,h;this.pixelCoordinates_&&ct(r,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=ii(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),u=this.renderedTransform_,h=r,u[0]=h[0],u[1]=h[1],u[2]=h[2],u[3]=h[3],u[4]=h[4],u[5]=h[5]);for(var c,p,f,d,g,y,v,_,m,x,w,b,S,C,E,T,P=0,R=n.length,O=0,F=0,M=0,I=null,L=null,A=this.coordinateCache_,k=this.viewRotation_,D=Math.round(1e12*Math.atan2(-r[1],r[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k},G=this.instructions!=n||this.overlaps?0:200;PG&&(this.fill_(t),F=0),M>G&&(t.stroke(),M=0),F||M||(t.beginPath(),d=NaN,g=NaN),++P;break;case Rh.CIRCLE:var N=l[O=z[1]],U=l[O+1],B=l[O+2]-N,V=l[O+3]-U,X=Math.sqrt(B*B+V*V);t.moveTo(N+X,U),t.arc(N,U,X,0,2*Math.PI,!0),++P;break;case Rh.CLOSE_PATH:t.closePath(),++P;break;case Rh.CUSTOM:O=z[1],c=z[2];var W=z[3],q=z[4],Y=6==z.length?z[5]:void 0;j.geometry=W,j.feature=S,P in A||(A[P]=[]);var K=A[P];Y?Y(l,O,c,2,K):(K[0]=l[O],K[1]=l[O+1],K.length=2),q(K,j),++P;break;case Rh.DRAW_IMAGE:O=z[1],c=z[2],_=z[3],p=z[4],f=z[5];var Z=z[6],H=z[7],J=z[8],Q=z[9],$=z[10],tt=z[11],et=z[12],rt=z[13],nt=z[14],it=z[15];if(!_&&z.length>=20){m=z[19],x=z[20],w=z[21],b=z[22];var ot=this.drawLabelWithPointPlacement_(m,x,w,b);_=ot.label,z[3]=_;var at=z[23];p=(ot.anchorX-at)*this.pixelRatio,z[4]=p;var st=z[24];f=(ot.anchorY-st)*this.pixelRatio,z[5]=f,Z=_.height,z[6]=Z,rt=_.width,z[13]=rt}var lt=void 0;z.length>25&&(lt=z[25]);var ut=void 0,ht=void 0,pt=void 0;z.length>17?(ut=z[16],ht=z[17],pt=z[18]):(ut=le,ht=!1,pt=!1),$&&D?tt+=k:$||D||(tt-=k);for(var ft=0;Or)break;var s=n[a];s||(s=[],n[a]=s),s.push(4*((t+i)*e+(t+o))+3),i>0&&s.push(4*((t-i)*e+(t+o))+3),o>0&&(s.push(4*((t+i)*e+(t-o))+3),i>0&&s.push(4*((t-i)*e+(t-o))+3))}for(var l=[],u=(i=0,n.length);i0){if(!o||"Image"!==c&&"Text"!==c||-1!==o.indexOf(t)){var u=(p[s]-3)/4,f=n-u%a,d=n-(u/a|0),g=i(t,e,f*f+d*d);if(g)return g}h.clearRect(0,0,a,a);break}}var d,g,y,v,_,m=Object.keys(this.executorsByZIndex_).map(Number);for(m.sort(at),d=m.length-1;d>=0;--d){var x=m[d].toString();for(y=this.executorsByZIndex_[x],g=dc.length-1;g>=0;--g)if(void 0!==(v=y[c=dc[g]])&&(_=v.executeHitDetection(h,s,r,f,u)))return _}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var r=e[0],n=e[1],i=e[2],o=e[3],a=[r,n,r,o,i,o,i,n];return ii(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return _t(this.executorsByZIndex_)},t.prototype.execute=function(t,e,r,n,i,o,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(at),this.maxExtent_&&(t.save(),this.clip(t,r));var l,u,h,c,p,f,d=o||dc;for(a&&s.reverse(),l=0,u=s.length;lf[2];)v=g*++y,u.push(this.getRenderTransform(n,i,o,wc,h,c,v).slice()),d-=g}this.hitDetectionImageData_=bc(r,u,this.renderedFeatures_,l.getStyleFunction(),s,i,o)}e(Sc(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){var o=this;if(this.replayGroup_){var a,s=e.viewState.resolution,u=e.viewState.rotation,h=this.getLayer(),c={},p=function(t,e,r){var o=l(t),a=c[o];if(a){if(!0!==a&&rm[0]&&b[2]>m[2]&&_.push([b[0]-x,b[1],b[2]-x,b[3]])}if(this.ready&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&He(this.wrappedRenderedExtent_,y))return ct(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=g,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var S,C=new Yh(Pc(h,c),y,h,c);this.getLayer().getDeclutter()&&(S=new Yh(Pc(h,c),y,h,c));for(var E=0,T=_.length;E=200&&s.status<300){var n=e.getType(),l=void 0;"json"==n||"text"==n?l=s.responseText:"xml"==n?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):"arraybuffer"==n&&(l=s.response),l?o(e.readFeatures(l,{extent:r,featureProjection:i}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}function Kc(t,e){return function(r,n,i,o,a){var s=this;Yc(t,e,r,n,i,(function(t,e){s.addFeatures(t),void 0!==o&&o(t)}),a||dt)}}var Zc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hc=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.feature=r,i.features=n,i}return Zc(e,t),e}(nt),Jc=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{attributions:n.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===n.wrapX||n.wrapX})||this).on,r.once,r.un,r.loader_=dt,r.format_=n.format,r.overlaps_=void 0===n.overlaps||n.overlaps,r.url_=n.url,void 0!==n.loader?r.loader_=n.loader:void 0!==r.url_&&(_(r.format_,7),r.loader_=Kc(r.url_,r.format_)),r.strategy_=void 0!==n.strategy?n.strategy:qc;var i,o,a=void 0===n.useSpatialIndex||n.useSpatialIndex;return r.featuresRtree_=a?new kc:null,r.loadedExtentsRtree_=new kc,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null,Array.isArray(n.features)?o=n.features:n.features&&(o=(i=n.features).getArray()),a||void 0!==i||(i=new us(o)),void 0!==o&&r.addFeaturesInternal(o),void 0!==i&&r.bindFeaturesCollection_(i),r}return Zc(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=l(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var r=t.getGeometry();if(r){var n=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Hc(zc,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[kt(e,wt,this.handleFeatureChange_,this),kt(e,it,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var r=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?r=!1:this.idIndex_[n.toString()]=e),r&&(_(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),r},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],r=[],n=[],i=0,o=t.length;in)return[[r[0],t[1],r[2],t[3]]];if(t[0]r[2])return[[t[0],t[1],r[2],t[3]],[r[0],t[1],t[2]-n,t[3]]]}return[t]}(t,e);return[].concat.apply([],n.map((function(t){return r.featuresRtree_.getInExtent(t)})))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var r=t[0],n=t[1],i=null,o=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||pt;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(r,n,o,a))0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,r=this.loadedExtentsRtree_;r.forEachInExtent(t,(function(r){if(ir(r.extent,t))return e=r,!0})),e&&r.remove(e)},e.prototype.removeFeature=function(t){if(t){var e=l(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=l(t),r=this.featureChangeKeys_[e];if(r){r.forEach(jt),delete this.featureChangeKeys_[e];var n=t.getId();return void 0!==n&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Hc(Bc,t)),t}},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var r in this.idIndex_)if(this.idIndex_[r]===t){delete this.idIndex_[r],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){_(this.format_,7),this.url_=t,this.setLoader(Kc(t,this.format_))},e}(Gc),Qc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$c="Point",tp="LineString",ep="Polygon",rp="Circle",np="drawstart",ip="drawend",op="drawabort",ap=function(t){function e(e,r){var n=t.call(this,e)||this;return n.feature=r,n}return Qc(e,t),e}(nt),sp=function(t){function e(e){var r=this,n=e;n.stopDown||(n.stopDown=ft),(r=t.call(this,n)||this).on,r.once,r.un,r.shouldHandle_=!1,r.downPx_=null,r.downTimeout_,r.lastDragTime_,r.pointerType_,r.freehand_=!1,r.source_=e.source?e.source:null,r.features_=e.features?e.features:null,r.snapTolerance_=e.snapTolerance?e.snapTolerance:12,r.type_=e.type,r.mode_=function(t){switch(t){case"Point":case"MultiPoint":return $c;case"LineString":case"MultiLineString":return tp;case"Polygon":case"MultiPolygon":return ep;case"Circle":return rp;default:throw new Error("Invalid type: "+t)}}(r.type_),r.stopClick_=!!e.stopClick,r.minPoints_=e.minPoints?e.minPoints:r.mode_===ep?3:2,r.maxPoints_=r.mode_===rp?2:e.maxPoints?e.maxPoints:1/0,r.finishCondition_=e.finishCondition?e.finishCondition:pt,r.geometryLayout_=e.geometryLayout?e.geometryLayout:Gr;var i,o=e.geometryFunction;if(!o){var a,s=r.mode_;if(s===rp)o=function(t,e,r){var n=e||new mi([NaN,NaN]),i=ei(t[0]),o=Rn(i,ei(t[t.length-1]));return n.setCenterAndRadius(i,Math.sqrt(o),this.geometryLayout_),n};else s===$c?a=oo:s===tp?a=$i:s===ep&&(a=mo),o=function(t,e,r){return e?s===ep?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])],this.geometryLayout_):e.setCoordinates([],this.geometryLayout_):e.setCoordinates(t,this.geometryLayout_):e=new a(t,this.geometryLayout_),e}}return r.geometryFunction_=o,r.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,r.finishCoordinate_=null,r.sketchFeature_=null,r.sketchPoint_=null,r.sketchCoords_=null,r.sketchLine_=null,r.sketchLineCoords_=null,r.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,r.overlay_=new Ac({source:new Jc({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(i=Ao(),function(t,e){return i[t.getGeometry().getType()]}),updateWhileInteracting:!0}),r.geometryName_=e.geometryName,r.condition_=e.condition?e.condition:su,r.freehandCondition_,e.freehand?r.freehandCondition_=nu:r.freehandCondition_=e.freehandCondition?e.freehandCondition:lu,r.addChangeListener(Xl,r.updateState_),r}return Qc(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===St&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==$c&&this.freehandCondition_(e);var r=e.type===ms.POINTERMOVE,n=!0;!this.freehand_&&this.lastDragTime_&&e.type===ms.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===ms.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===ms.POINTERDOWN?n=!1:r&&this.getPointerCount()<2?(n=e.type===ms.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===ms.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===ms.DBLCLICK&&(n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new _s(ms.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 r=!this.finishCoordinate_;r&&this.startDrawing_(t.coordinate),!r&&this.freehand_?this.finishDrawing():this.freehand_||r&&this.mode_!==$c||(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_,r=t.pixel,n=e[0]-r[0],i=e[1]-r[1],o=n*n+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=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 r=!1,n=[this.finishCoordinate_],i=this.mode_;if(i===$c)e=!0;else if(i===rp)e=2===this.sketchCoords_.length;else if(i===tp)r=this.sketchCoords_.length>this.minPoints_;else if(i===ep){var o=this.sketchCoords_;r=o[0].length>this.minPoints_,n=[o[0][0],o[0][o[0].length-2]]}if(r)for(var a=this.getMap(),s=0,l=n.length;s=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),this.geometryFunction_(r,n,i)):o===ep&&((r=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),e&&(this.finishCoordinate_=r[0]),this.geometryFunction_(this.sketchCoords_,n,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),n=this.mode_;if(n===tp||n===rp){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var i=this.finishCoordinate_.slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}this.geometryFunction_(t,e,r),"Polygon"===e.getType()&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(n===ep){(t=this.sketchCoords_[0]).splice(-2,1);var o=this.sketchLine_.getGeometry();if(t.length>=2){i=t[t.length-2].slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}o.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,r)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,r=t.getGeometry(),n=this.getMap().getView().getProjection();this.mode_===tp?(e.pop(),this.geometryFunction_(e,r,n)):this.mode_===ep&&(e[0].pop(),this.geometryFunction_(e,r,n),e=r.getCoordinates()),"MultiPoint"===this.type_?t.setGeometry(new lo([e])):"MultiLineString"===this.type_?t.setGeometry(new ro([e])):"MultiPolygon"===this.type_&&t.setGeometry(new Eo([e])),this.dispatchEvent(new ap(ip,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 ap(op,t))},e.prototype.appendCoordinates=function(t){var e,r=this.mode_,n=!this.sketchFeature_;if(n&&this.startDrawing_(t[0]),r===tp||r===rp)e=this.sketchCoords_;else{if(r!==ep)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}n&&e.shift(),e.pop();for(var i=0;ic?o[1]:o[0]),a}}return null},e.prototype.handlePointerMove_=function(t){var e=t.pixel,r=t.map,n=this.snapToVertex_(e,r);n||(n=r.getCoordinateFromPixelInternal(e)),this.createOrUpdatePointerFeature_(n)},e.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(xo(t)):e.setGeometry(void 0):(e=new jr(t?xo(t):{}),this.extentFeature_=e,this.extentOverlay_.getSource().addFeature(e)),e},e.prototype.createOrUpdatePointerFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new jr(new oo(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.originalEvent||!this.condition_(e)||(e.type!=ms.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),t.prototype.handleEvent.call(this,e),!1)},e.prototype.handleDownEvent=function(t){var e=t.pixel,r=t.map,n=this.getExtentInternal(),i=this.snapToVertex_(e,r),o=function(t){var e=null,r=null;return t[0]==n[0]?e=n[2]:t[0]==n[2]&&(e=n[0]),t[1]==n[1]?r=n[3]:t[1]==n[3]&&(r=n[1]),null!==e&&null!==r?[e,r]:null};if(i&&n){var a=i[0]==n[0]||i[0]==n[2]?i[0]:null,s=i[1]==n[1]||i[1]==n[3]?i[1]:null;null!==a&&null!==s?this.pointerHandler_=dp(o(i)):null!==a?this.pointerHandler_=gp(o([a,n[1]]),o([a,n[3]])):null!==s&&(this.pointerHandler_=gp(o([n[0],s]),o([n[2],s])))}else i=r.getCoordinateFromPixelInternal(e),this.setExtent([i[0],i[1],i[0],i[1]]),this.pointerHandler_=dp(i);return!0},e.prototype.handleDragEvent=function(t){if(this.pointerHandler_){var e=t.coordinate;this.setExtent(this.pointerHandler_(e)),this.createOrUpdatePointerFeature_(e)}},e.prototype.handleUpEvent=function(t){this.pointerHandler_=null;var e=this.getExtentInternal();return e&&0!==hr(e)||this.setExtent(null),!1},e.prototype.setMap=function(e){this.extentOverlay_.setMap(e),this.vertexOverlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getExtent=function(){return ri(this.getExtentInternal(),this.getMap().getView().getProjection())},e.prototype.getExtentInternal=function(){return this.extent_},e.prototype.setExtent=function(t){this.extent_=t||null,this.createOrUpdateExtentFeature_(t),this.dispatchEvent(new cp(this.extent_))},e}($l),vp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_p=[0,0,0,0],mp=[],xp="modifystart",wp="modifyend",bp=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.features=r,i.mapBrowserEvent=n,i}return vp(e,t),e}(nt),Sp=function(t){function e(e){var r,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:cu,n.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&au(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:nu,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.featuresBeingModified_=null,n.rBush_=new kc,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new Ac({source:new Jc({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:Pp(),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?r=e.features:e.source&&(n.source_=e.source,r=new us(n.source_.getFeatures()),n.source_.addEventListener(zc,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(Bc,n.handleSourceRemove_.bind(n))),!r)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(n.hitDetection_=e.hitDetection),n.features_=r,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(ns,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(is,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n.delta_=[0,0],n.snapToPointer_=void 0===e.snapToPointer?!n.hitDetection_:e.snapToPointer,n}return vp(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var r=this.SEGMENT_WRITERS_[e.getType()];r&&r(t,e)}var n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,n),t.addEventListener(wt,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new us;for(var r=this.featuresBeingModified_.getArray(),n=0,i=e.length;n=0;--n){for(var i=r[n],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===i&&this.dragSegments_.splice(o,1);e.remove(i)}},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 r=e.getCoordinates(),n={feature:t,geometry:e,segment:[r,r]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n=0;--v)this.insertVertex_(i[v],o)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var r=this.dragSegments_[e][0],n=r.geometry;if("Circle"===n.getType()){var i=n.getCenter(),o=r.featureSegments[0],a=r.featureSegments[1];o.segment[0]=i,o.segment[1]=i,a.segment[0]=i,a.segment[1]=i,this.rBush_.update(rr(i),o);var s=n;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(We(r.segment),r)}return this.featuresBeingModified_&&(this.dispatchEvent(new bp(wp,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,r){var n,i,o=this,a=r||e.getCoordinateFromPixel(t),s=e.getView().getProjection();if(this.hitDetection_){var u="object"==typeof this.hitDetection_?function(t){return t===o.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,r){if("Point"===(r=r||t.getGeometry()).getType()&&st(o.features_.getArray(),t)){i=r;var a=r.getFlatCoordinates().slice(0,2);n=[{feature:t,geometry:r,segment:[a,a]}]}return!0}),{layerFilter:u})}if(!n){var h=ri(qe(ni(rr(a,_p)),e.getView().getResolution()*this.pixelTolerance_,_p));n=this.rBush_.getInExtent(h)}if(n&&n.length>0){var c=n.sort((function(t,e){return Ep(a,t,s)-Ep(a,e,s)}))[0],p=c.segment,f=Tp(a,c,s),d=e.getPixelFromCoordinate(f),g=On(t,d);if(i||g<=this.pixelTolerance_){var y={};if(y[l(p)]=!0,this.snapToPointer_||(this.delta_[0]=f[0]-a[0],this.delta_[1]=f[1]-a[1]),"Circle"===c.geometry.getType()&&1===c.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(f,[c.feature],[c.geometry]);else{var v=e.getPixelFromCoordinate(p[0]),_=e.getPixelFromCoordinate(p[1]),m=Rn(d,v),x=Rn(d,_);g=Math.sqrt(Math.min(m,x)),this.snappedToVertex_=g<=this.pixelTolerance_,this.snappedToVertex_&&(f=m>x?p[1]:p[0]),this.createOrUpdateVertexFeature_(f,[c.feature],[c.geometry]);var w={};w[l(c.geometry)]=!0;for(var b=1,S=n.length;b=0;--i)c=l((h=(r=p[i])[0]).feature),h.depth&&(c+="-"+h.depth.join("-")),c in f||(f[c]={}),0===r[1]?(f[c].right=h,f[c].index=h.index):1==r[1]&&(f[c].left=h,f[c].index=h.index+1);for(c in f){switch(u=f[c].right,a=f[c].left,(s=(o=f[c].index)-1)<0&&(s=0),t=e=(n=(h=void 0!==a?a:u).geometry).getCoordinates(),d=!1,n.getType()){case"MultiLineString":e[h.depth[0]].length>2&&(e[h.depth[0]].splice(o,1),d=!0);break;case"LineString":e.length>2&&(e.splice(o,1),d=!0);break;case"MultiPolygon":t=t[h.depth[1]];case"Polygon":(t=t[h.depth[0]]).length>4&&(o==t.length-1&&(o=0),t.splice(o,1),d=!0,0===o&&(t.pop(),t.push(t[0]),s=t.length-1))}if(d){this.setGeometryCoordinates_(n,e);var g=[];if(void 0!==a&&(this.rBush_.remove(a),g.push(a.segment[0])),void 0!==u&&(this.rBush_.remove(u),g.push(u.segment[1])),void 0!==a&&void 0!==u){var y={depth:h.depth,feature:h.feature,geometry:h.geometry,index:s,segment:g};this.rBush_.insert(We(y.segment),y)}this.updateSegmentIndices_(n,o,h.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),p.length=0}}return d},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,r,n){this.rBush_.forEachInExtent(t.getExtent(),(function(i){i.geometry===t&&(void 0===r||void 0===i.depth||ct(i.depth,r))&&i.index>e&&(i.index+=n)}))},e}($l);function Cp(t,e){return t.index-e.index}function Ep(t,e,r){var n=e.geometry;if("Circle"===n.getType()){var i=n;if(1===e.index){null;var o=Rn(i.getCenter(),ei(t)),a=Math.sqrt(o)-i.getRadius();return a*a}}var s=ei(t);return mp[0]=ei(e.segment[0]),mp[1]=ei(e.segment[1]),Fn(s,mp)}function Tp(t,e,r){var n=e.geometry;if("Circle"===n.getType()&&1===e.index){var i=n;return ti(i.getClosestPoint(ei(t)))}var o=ei(t);return mp[0]=ei(e.segment[0]),mp[1]=ei(e.segment[1]),ti(En(o,mp))}function Pp(){var t=Ao();return function(e,r){return t.Point}}var Rp=Sp,Op=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fp="select",Mp=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.selected=r,o.deselected=n,o.mapBrowserEvent=i,o}return Op(e,t),e}(nt),Ip={},Lp=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n,i,o=e||{};if(r.boundAddFeature_=r.addFeature_.bind(r),r.boundRemoveFeature_=r.removeFeature_.bind(r),r.condition_=o.condition?o.condition:au,r.addCondition_=o.addCondition?o.addCondition:ou,r.removeCondition_=o.removeCondition?o.removeCondition:ou,r.toggleCondition_=o.toggleCondition?o.toggleCondition:lu,r.multi_=!!o.multi&&o.multi,r.filter_=o.filter?o.filter:pt,r.hitTolerance_=o.hitTolerance?o.hitTolerance:0,r.style_=void 0!==o.style?o.style:(ht((n=Ao()).Polygon,n.LineString),ht(n.GeometryCollection,n.LineString),function(t){return t.getGeometry()?n[t.getGeometry().getType()]:null}),r.features_=o.features||new us,o.layers)if("function"==typeof o.layers)i=o.layers;else{var a=o.layers;i=function(t){return st(a,t)}}else i=pt;return r.layerFilter_=i,r.featureLayerAssociation_={},r}return Op(e,t),e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[l(t)]=e},e.prototype.getFeatures=function(){return this.features_},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[l(t)]},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),t.prototype.setMap.call(this,e),e?(this.features_.addEventListener(ns,this.boundAddFeature_),this.features_.addEventListener(is,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(ns,this.boundAddFeature_),this.features_.removeEventListener(is,this.boundRemoveFeature_))},e.prototype.addFeature_=function(t){var e=t.element;if(this.style_&&this.applySelectedStyle_(e),!this.getLayer(e)){var r=this.getMap().getAllLayers().find((function(t){if(t instanceof Ac&&t.getSource()&&t.getSource().hasFeature(e))return t}));r&&this.addFeatureLayerAssociation_(e,r)}},e.prototype.removeFeature_=function(t){var e=t.element;this.style_&&this.restorePreviousStyle_(e)},e.prototype.getStyle=function(){return this.style_},e.prototype.applySelectedStyle_=function(t){var e=l(t);e in Ip||(Ip[e]=t.getStyle()),t.setStyle(this.style_)},e.prototype.restorePreviousStyle_=function(t){for(var r=this.getMap().getInteractions().getArray(),n=r.length-1;n>=0;--n){var i=r[n];if(i!==this&&i instanceof e&&i.getStyle()&&-1!==i.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(i.getStyle())}var o=l(t);t.setStyle(Ip[o]),delete Ip[o]},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[l(t)]},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),r=this.removeCondition_(t),n=this.toggleCondition_(t),i=!e&&!r&&!n,o=t.map,a=this.getFeatures(),s=[],l=[];if(i){yt(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return this.addFeatureLayerAssociation_(t,e),l.push(t),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var u=a.getLength()-1;u>=0;--u){var h=a.item(u),c=l.indexOf(h);c>-1?l.splice(c,1):(a.remove(h),s.push(h))}0!==l.length&&a.extend(l)}else{o.forEachFeatureAtPixel(t.pixel,function(t,i){if(this.filter_(t,i))return!e&&!n||st(a.getArray(),t)?(r||n)&&st(a.getArray(),t)&&(s.push(t),this.removeFeatureLayerAssociation_(t)):(this.addFeatureLayerAssociation_(t,i),l.push(t)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var p=s.length-1;p>=0;--p)a.remove(s[p]);a.extend(l)}return(l.length>0||s.length>0)&&this.dispatchEvent(new Mp(Fp,l,s,t)),!0},e}(Yl);var Ap=Lp,kp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Dp(t){return t.feature?t.feature:t.element?t.element:void 0}var jp=[],Gp=function(t){function e(e){var r=this,n=e||{},i=n;return i.handleDownEvent||(i.handleDownEvent=pt),i.stopDown||(i.stopDown=ft),(r=t.call(this,i)||this).source_=n.source?n.source:null,r.vertex_=void 0===n.vertex||n.vertex,r.edge_=void 0===n.edge||n.edge,r.features_=n.features?n.features:null,r.featuresListenerKeys_=[],r.featureChangeListenerKeys_={},r.indexedFeaturesExtents_={},r.pendingFeatures_={},r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.rBush_=new kc,r.GEOMETRY_SEGMENTERS_={Point:r.segmentPointGeometry_.bind(r),LineString:r.segmentLineStringGeometry_.bind(r),LinearRing:r.segmentLineStringGeometry_.bind(r),Polygon:r.segmentPolygonGeometry_.bind(r),MultiPoint:r.segmentMultiPointGeometry_.bind(r),MultiLineString:r.segmentMultiLineStringGeometry_.bind(r),MultiPolygon:r.segmentMultiPolygonGeometry_.bind(r),GeometryCollection:r.segmentGeometryCollectionGeometry_.bind(r),Circle:r.segmentCircleGeometry_.bind(r)},r}return kp(e,t),e.prototype.addFeature=function(t,e){var r=void 0===e||e,n=l(t),i=t.getGeometry();if(i){var o=this.GEOMETRY_SEGMENTERS_[i.getType()];if(o){this.indexedFeaturesExtents_[n]=i.getExtent([1/0,1/0,-1/0,-1/0]);var a=[];if(o(a,i),1===a.length)this.rBush_.insert(We(a[0]),{feature:t,segment:a[0]});else if(a.length>1){var s=a.map((function(t){return We(t)})),u=a.map((function(e){return{feature:t,segment:e}}));this.rBush_.load(s,u)}}}r&&(this.featureChangeListenerKeys_[n]=kt(t,wt,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 r=this.snapTo(e.pixel,e.coordinate,e.map);return r&&(e.coordinate=r.vertex.slice(0,2),e.pixel=r.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=Dp(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=Dp(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var r=l(e);r in this.pendingFeatures_||(this.pendingFeatures_[r]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=vt(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var r=void 0===e||e,n=l(t),i=this.indexedFeaturesExtents_[n];if(i){var o=this.rBush_,a=[];o.forEachInExtent(i,(function(e){t===e.feature&&a.push(e)}));for(var s=a.length-1;s>=0;--s)o.remove(a[s])}r&&(jt(this.featureChangeListenerKeys_[n]),delete this.featureChangeListenerKeys_[n])},e.prototype.setMap=function(e){var r=this.getMap(),n=this.featuresListenerKeys_,i=this.getFeatures_();r&&(n.forEach(jt),n.length=0,i.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?n.push(kt(this.features_,ns,this.handleFeatureAdd_,this),kt(this.features_,is,this.handleFeatureRemove_,this)):this.source_&&n.push(kt(this.source_,zc,this.handleFeatureAdd_,this),kt(this.source_,Bc,this.handleFeatureRemove_,this)),i.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,r){var n=We([r.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),r.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),i=this.rBush_.getInExtent(n),o=i.length;if(0===o)return null;r.getView().getProjection();var a,s=ei(e),l=1/0,u=this.pixelTolerance_*this.pixelTolerance_,h=function(){if(a){var e=r.getPixelFromCoordinate(a);if(Rn(t,e)<=u)return{vertex:a,vertexPixel:[Math.round(e[0]),Math.round(e[1])]}}return null};if(this.vertex_){for(var c=0;cthis.maxX&&(this.maxX=t.maxX),t.minYthis.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 Qp(t,e,r,n,i){return void 0!==i?(i.minX=t,i.maxX=e,i.minY=r,i.maxY=n,i):new Jp(t,e,r,n)}var $p=Jp;function tf(t,e,r,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=r,n):[t,e,r]}function ef(t,e,r){return t+"/"+e+"/"+r}function rf(t){return ef(t[0],t[1],t[2])}function nf(t){return t.split("/").map(Number)}function of(t){return(t[1]<0||r&&0===o)}))}(this.resolutions_,(function(t,e){return e-t}),!0),17),!t.origins)for(var r=0,n=this.resolutions_.length-1;r=this.minZoom;){if(e(s,2===this.zoomFactor_?Qp(i=Math.floor(i/2),i,o=Math.floor(o/2),o,r):this.getTileRangeForExtentAndZ(a,s,r)))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,r){if(t[0]this.maxZoom||et)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){a()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var r=this.transitionStarts_[t];if(r){if(-1===r)return 1}else r=e,this.transitionStarts_[t]=r;var n=e-r+1e3/60;return n>=this.transition_?1:$s(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(xt),cf=hf,pf=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();var ff,df=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,a)||this;return s.crossOrigin_=i,s.src_=n,s.key=n,s.image_=new Image,null!==i&&(s.image_.crossOrigin=i),s.unlisten_=null,s.tileLoadFunction_=o,s}return pf(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=js,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=Gs,this.unlistenImage_(),this.image_=((t=H(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=js:this.state=zs,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Gs&&(this.state=ks,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==ks&&(this.state=Ds,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Pr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(cf),gf=function(){function t(t,e,r,n,i,o){this.sourceProj_=t,this.targetProj_=e;var a={},s=Zn(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return a[e]||(a[e]=s(t)),a[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&wr(n)==wr(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?wr(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?wr(this.targetProj_.getExtent()):null;var l=mr(r),u=xr(r),h=pr(r),c=cr(r),p=this.transformInv_(l),f=this.transformInv_(u),d=this.transformInv_(h),g=this.transformInv_(c),y=10+(o?Math.max(0,Math.ceil(w(hr(r)/(o*o*256*256)))):0);if(this.addQuad_(l,u,h,c,p,f,d,g,y),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach((function(t,e,r){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 r=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-r.5&&h<1,f=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)f=wr(We([t,e,r,n]))/this.targetWorldWidth_>.25||f;!p&&this.sourceProj_.isGlobal()&&h&&(f=h>.25||f)}if(!(!f&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||br(u,this.maxSourceExtent_)){var d=0;if(!(f||isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])))if(l>0)f=!0;else if(1!=(d=(isFinite(i[0])&&isFinite(i[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(a[0])&&isFinite(a[1])?0:2)+(isFinite(s[0])&&isFinite(s[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(l>0){if(!f){var g=[(t[0]+r[0])/2,(t[1]+r[1])/2],y=this.transformInv_(g),v=void 0;if(p)v=(T(i[0],c)+T(a[0],c))/2-T(y[0],c);else v=(i[0]+a[0])/2-y[0];var _=(i[1]+a[1])/2-y[1];f=v*v+_*_>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var m=[(e[0]+r[0])/2,(e[1]+r[1])/2],x=this.transformInv_(m),w=[(n[0]+t[0])/2,(n[1]+t[1])/2],b=this.transformInv_(w);this.addQuad_(t,e,m,w,i,o,x,b,l-1),this.addQuad_(w,m,r,n,b,x,a,s,l-1)}else{var S=[(t[0]+e[0])/2,(t[1]+e[1])/2],C=this.transformInv_(S),E=[(r[0]+n[0])/2,(r[1]+n[1])/2],P=this.transformInv_(E);this.addQuad_(t,S,E,n,i,C,P,s,l-1),this.addQuad_(S,e,r,E,C,o,a,P,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,r,n,i,a,s),0==(14&d)&&this.addTriangle_(t,r,e,i,a,o),d&&(0==(13&d)&&this.addTriangle_(e,n,t,o,s,i),0==(7&d)&&this.addTriangle_(e,n,r,o,s,a))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,r,n){var i=e.source;ar(t,i[0]),ar(t,i[1]),ar(t,i[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),yf={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},vf={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},_f=[];function mf(t,e,r,n,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,r),t.lineTo(n,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(r,i)),t.restore()}function xf(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function wf(t,e,r,n){var i=Hn(r,e,t),o=Vn(e,n,r),a=e.getMetersPerUnit();void 0!==a&&(o*=a);var s=t.getMetersPerUnit();void 0!==s&&(o/=s);var l=t.getExtent();if(!l||Ze(l,i)){var u=Vn(t,o,i)/o;isFinite(u)&&u>0&&(o/=u)}return o}function bf(t,e,r,n,i,o,a,s,l,u,h,c){var p=H(Math.round(r*t),Math.round(r*e),_f);if(c||gt(p,yf),0===l.length)return p.canvas;function f(t){return Math.round(t*r)/r}p.scale(r,r),p.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,r){or(d,t.extent)}));var g=wr(d),y=vr(d),v=H(Math.round(r*g/n),Math.round(r*y/n));c||gt(v,yf);var _=r/n;l.forEach((function(t,e,r){var n=t.extent[0]-d[0],i=-(t.extent[3]-d[3]),o=wr(t.extent),a=vr(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,n*_,i*_,o*_,a*_)}));var m=mr(a);return s.getTriangles().forEach((function(t,e,i){var a=t.source,s=t.target,l=a[0][0],u=a[0][1],h=a[1][0],g=a[1][1],y=a[2][0],_=a[2][1],x=f((s[0][0]-m[0])/o),w=f(-(s[0][1]-m[1])/o),b=f((s[1][0]-m[0])/o),S=f(-(s[1][1]-m[1])/o),C=f((s[2][0]-m[0])/o),E=f(-(s[2][1]-m[1])/o),T=l,P=u;l=0,u=0;var R=function(t){for(var e=t.length,r=0;ri&&(i=a,n=o)}if(0===i)return null;var s=t[n];t[n]=t[r],t[r]=s;for(var l=r+1;l=0;p--){c[p]=t[p][e]/t[p][p];for(var f=p-1;f>=0;f--)t[f][e]-=t[f][p]*c[p]}return c}([[h-=T,g-=P,0,0,b-x],[y-=T,_-=P,0,0,C-x],[0,0,h,g,S-w],[0,0,y,_,E-w]]);if(R){if(p.save(),p.beginPath(),function(){if(void 0===ff){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",mf(t,4,5,4,0),mf(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;ff=xf(e,0)||xf(e,4)||xf(e,8)}return ff}()||!c){p.moveTo(b,S);for(var O=x-b,F=w-S,M=0;M<4;M++)p.lineTo(b+f((M+1)*O/4),S+f(M*F/3)),3!=M&&p.lineTo(b+f((M+1)*O/4),S+f((M+1)*F/3));p.lineTo(C,E)}else p.moveTo(b,S),p.lineTo(x,w),p.lineTo(C,E);p.clip(),p.transform(R[0],R[2],R[1],R[3],x,w),p.translate(d[0]-T,d[3]-P),p.scale(n/r,-n/r),p.drawImage(v.canvas,0,0),p.restore()}})),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,s.getTriangles().forEach((function(t,e,r){var n=t.target,i=(n[0][0]-m[0])/o,a=-(n[0][1]-m[1])/o,s=(n[1][0]-m[0])/o,l=-(n[1][1]-m[1])/o,u=(n[2][0]-m[0])/o,h=-(n[2][1]-m[1])/o;p.beginPath(),p.moveTo(s,l),p.lineTo(i,a),p.lineTo(u,h),p.closePath(),p.stroke()})),p.restore()),p.canvas}var Sf=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cf=function(t){function e(e,r,n,i,o,a,s,l,u,h,c,p){var f=t.call(this,o,ks,{interpolate:!!p})||this;f.renderEdges_=void 0!==c&&c,f.pixelRatio_=s,f.gutter_=l,f.canvas_=null,f.sourceTileGrid_=r,f.targetTileGrid_=i,f.wrappedTileCoord_=a||o,f.sourceTiles_=[],f.sourcesListenerKeys_=null,f.sourceZ_=0;var d=i.getTileCoordExtent(f.wrappedTileCoord_),g=f.targetTileGrid_.getExtent(),y=f.sourceTileGrid_.getExtent(),v=g?_r(d,g):d;if(0===hr(v))return f.state=zs,f;var _=e.getExtent();_&&(y=y?_r(y,_):_);var x=i.getResolution(f.wrappedTileCoord_[0]),w=function(t,e,r,n){var i=fr(r),o=wf(t,e,i,n);return(!isFinite(o)||o<=0)&&ur(r,(function(r){return o=wf(t,e,r,n),isFinite(o)&&o>0})),o}(e,n,v,x);if(!isFinite(w)||w<=0)return f.state=zs,f;var b=void 0!==h?h:.5;if(f.triangulation_=new gf(e,n,v,y,w*b,x),0===f.triangulation_.getTriangles().length)return f.state=zs,f;f.sourceZ_=r.getZForResolution(w);var S=f.triangulation_.calculateSourceExtent();if(y&&(e.canWrapX()?(S[1]=m(S[1],y[1],y[3]),S[3]=m(S[3],y[1],y[3])):S=_r(S,y)),hr(S)){for(var C=r.getTileRangeForExtentAndZ(S,f.sourceZ_),E=C.minX;E<=C.maxX;E++)for(var T=C.minY;T<=C.maxY;T++){var P=u(f.sourceZ_,E,T,s);P&&f.sourceTiles_.push(P)}0===f.sourceTiles_.length&&(f.state=zs)}else f.state=zs;return f}return Sf(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,r,n){e&&e.getState()==js&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Gs;else{var e=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(e),n="number"==typeof r?r:r[0],i="number"==typeof r?r:r[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=bf(n,i,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=js}this.changed()},e.prototype.load=function(){if(this.state==ks){this.state=Ds,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,r,n){var i=e.getState();if(i==ks||i==Ds){t++;var o=kt(e,wt,(function(r){var n=e.getState();n!=js&&n!=Gs&&n!=zs||(jt(o),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,r){t.getState()==ks&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(jt),this.sourcesListenerKeys_=null},e.prototype.release=function(){this.canvas_&&(J(this.canvas_.getContext("2d")),_f.push(this.canvas_),this.canvas_=null),t.prototype.release.call(this)},e}(cf),Ef=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var r=this.entries_[t];return _(void 0!==r,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},t.prototype.remove=function(t){var e=this.entries_[t];return _(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_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.peek=function(t){if(this.containsKey(t))return this.entries_[t].value_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){_(!(t in this.entries_),16);var r={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[t]=r,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}(),Tf=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Pf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Tf(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=nf(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(rf(e.tileCoord)),e.release())}.bind(this))}},e}(Ef),Rf=Pf,Of="tileloadstart",Ff="tileloadend",Mf="tileloaderror";function If(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,r,n){return function(t,e,r,n){var i=void 0!==n?n:"top-left",o=Af(t,e,r);return new lf({extent:t,origin:dr(t,i),resolutions:o,tileSize:r})}(kf(t),e,r,n)}(t),t.setDefaultTileGrid(e)),e}function Lf(t){var e=t||{},r=e.extent||Bn("EPSG:3857").getExtent(),n={extent:r,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Af(r,e.maxZoom,e.tileSize,e.maxResolution)};return new lf(n)}function Af(t,e,r,n){for(var i=void 0!==e?e:42,o=vr(t),a=wr(t),s=p(void 0!==r?r:Ws),l=n>0?n:Math.max(a/s[0],o/s[1]),u=i+1,h=new Array(u),c=0;cr||r>e.getMaxZoom())return!1;var o=e.getFullTileRange(r);return!o||o.containsXY(n,i)}(t,n)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var r=this.getTileCacheForProjection(e);t>r.highWaterMark&&(r.highWaterMark=t)},e.prototype.useTile=function(t,e,r,n){},e}(Gc),Gf=function(t){function e(e,r){var n=t.call(this,e)||this;return n.tile=r,n}return Df(e,t),e}(nt),zf=jf;function Nf(t,e){var r=/\{z\}/g,n=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(a,s,l){return a?t.replace(r,a[0].toString()).replace(n,a[1].toString()).replace(i,a[2].toString()).replace(o,(function(){var t=a[0],r=e.getFullTileRange(t);return _(r,55),(r.getHeight()-a[2]-1).toString()})):void 0}}function Uf(t,e){for(var r=t.length,n=new Array(r),i=0;i=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(r)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(t){this.handleTileJSONError()},e.prototype.getTileJSON=function(){return this.tileJSON_},e.prototype.handleTileJSONResponse=function(t){var e,r=Bn("EPSG:4326"),n=this.getProjection();if(void 0!==t.bounds){var i=Kn(r,n);e=Cr(t.bounds,i)}var o=kf(n),a=t.minzoom||0,s=Lf({extent:o,maxZoom:t.maxzoom||22,minZoom:a,tileSize:this.tileSize_});if(this.tileGrid=s,this.tileUrlFunction=Uf(t.tiles,s),void 0!==t.attribution&&!this.getAttributions()){var l=void 0!==e?e:o;this.setAttributions((function(e){return br(l,e.extent)?[t.attribution]:null}))}this.tileJSON_=t,this.setState("ready")},e.prototype.handleTileJSONError=function(){this.setState("error")},e}(Kf),$f=Qf,td="preload",ed="useInterimTilesOnError",rd=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nd=function(t){function e(e){var r=this,n=e||{},i=gt({},n);return delete i.preload,delete i.useInterimTilesOnError,(r=t.call(this,i)||this).on,r.once,r.un,r.setPreload(void 0!==n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r}return rd(e,t),e.prototype.getPreload=function(){return this.get(td)},e.prototype.setPreload=function(t){this.set(td,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(ed)},e.prototype.setUseInterimTilesOnError=function(t){this.set(ed,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(Ya),id=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),od=function(t){function e(e){var r=t.call(this,e)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=[1/0,1/0,-1/0,-1/0],r.tmpTileRange_=new $p(0,0,0,0),r}return id(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==js||r==zs||r==Gs&&!n},e.prototype.getTile=function(t,e,r,n){var i=n.pixelRatio,o=n.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,r,i,o);return s.getState()==Gs&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(js)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var r=this.getLayer(),n=Hr(e.pixelToCoordinateTransform,t.slice()),i=r.getExtent();if(i&&!Ze(i,n))return null;for(var o=e.pixelRatio,a=e.viewState.projection,s=e.viewState,l=r.getRenderSource(),u=l.getTileGridForProjection(s.projection),h=l.getTilePixelRatio(e.pixelRatio),c=u.getZForResolution(s.resolution);c>=u.getMinZoom();--c){var f=u.getTileCoordForCoordAndZ(n,c),d=l.getTile(c,f[1],f[2],o,a);if(!(d instanceof df||d instanceof Cf))return null;if(d.getState()===js){var g=u.getOrigin(c),y=p(u.getTileSize(c)),v=u.getResolution(c),_=Math.floor(h*((n[0]-g[0])/v-f[1]*y[0])),m=Math.floor(h*((g[1]-n[1])/v-f[2]*y[1])),x=Math.round(h*l.getGutterForProjection(s.projection));return this.getImageData(d.getImage(),_+x,m+x)}}return null},e.prototype.loadedTileCallback=function(e,r,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,r,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var r=t.layerStatesArray[t.layerIndex],n=t.viewState,i=n.projection,o=n.resolution,a=n.center,s=n.rotation,u=t.pixelRatio,h=this.getLayer(),c=h.getSource(),p=c.getRevision(),f=c.getTileGridForProjection(i),d=f.getZForResolution(o,c.zDirection),g=f.getResolution(d),y=t.extent,v=t.viewState.resolution,_=c.getTilePixelRatio(u),m=Math.round(wr(y)/v*u),x=Math.round(vr(y)/v*u),w=r.extent&&ni(r.extent);w&&(y=_r(y,ni(r.extent)));var b=g*m/2/_,S=g*x/2/_,C=[a[0]-b,a[1]-S,a[0]+b,a[1]+S],E=f.getTileRangeForExtentAndZ(y,d),T={};T[d]={};var P=this.createLoadedTileFinder(c,i,T),R=this.tmpExtent,O=this.tmpTileRange_;this.newTiles_=!1;for(var F=s?yr(n.center,v,s,t.size):void 0,M=E.minX;M<=E.maxX;++M)for(var I=E.minY;I<=E.maxY;++I)if(!s||f.tileCoordIntersectsViewport([d,M,I],F)){var L=this.getTile(d,M,I,t);if(this.isDrawableTile(L)){var A=l(this);if(L.getState()==js)T[d][L.tileCoord.toString()]=L,(nt=L.inTransition(A))&&1!==r.opacity&&(L.endTransition(A),nt=!1),this.newTiles_||!nt&&-1!==this.renderedTiles.indexOf(L)||(this.newTiles_=!0);if(1===L.getAlpha(A,t.time))continue}var k=f.getTileCoordChildTileRange(L.tileCoord,O,R),D=!1;k&&(D=P(d+1,k)),D||f.forEachTileCoordParentTileRange(L.tileCoord,P,O,R)}var j=g/o*u/_;tn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/u,1/u,s,-m/2,-x/2);var G=rn(this.pixelTransform);this.useContainer(e,G,this.getBackground(t));var z=this.context,N=z.canvas;en(this.inversePixelTransform,this.pixelTransform),tn(this.tempTransform,m/2,x/2,j,j,0,-m/2,-x/2),N.width!=m||N.height!=x?(N.width=m,N.height=x):this.containerReused||z.clearRect(0,0,m,x),w&&this.clipUnrotated(z,t,w),c.getInterpolate()||gt(z,yf),this.preRender(z,t),this.renderedTiles.length=0;var U,B,V,X=Object.keys(T).map(Number);X.sort(at),1!==r.opacity||this.containerReused&&!c.getOpaque(t.viewState.projection)?(U=[],B=[]):X=X.reverse();for(var W=X.length-1;W>=0;--W){var q=X[W],Y=c.getTilePixelSize(q,u,i),K=f.getResolution(q)/g,Z=Y[0]*K*j,H=Y[1]*K*j,J=f.getTileCoordForCoordAndZ(mr(C),q),Q=f.getTileCoordExtent(J),$=Hr(this.tempTransform,[_*(Q[0]-C[0])/g,_*(C[3]-Q[3])/g]),tt=_*c.getGutterForProjection(i),et=T[q];for(var rt in et){var nt,it=(L=et[rt]).tileCoord,ot=J[1]-it[1],st=Math.round($[0]-(ot-1)*Z),lt=J[2]-it[2],ut=Math.round($[1]-(lt-1)*H),ht=st-(M=Math.round($[0]-ot*Z)),ct=ut-(I=Math.round($[1]-lt*H)),pt=d===q,ft=!1;if(!(nt=pt&&1!==L.getAlpha(l(this),t.time)))if(U){V=[M,I,M+ht,I,M+ht,I+ct,M,I+ct];for(var dt=0,yt=U.length;dt0)e([]);else{var _=mr(c.getTileCoordExtent(n.wrappedTileCoord)),m=[(f[0]-_[0])/h,(_[1]-f[1])/h],x=n.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),w=n.hitDetectionImageData[o];if(!w&&!this.animatingOrInteracting_){var b=p(c.getTileSize(c.getZForResolution(h,a.zDirection))),S=this.renderedRotation_;w=bc(b,[this.getRenderTransform(c.getTileCoordCenter(n.wrappedTileCoord),h,0,wc,b[0]*wc,b[1]*wc,0)],x,i.getStyleFunction(),c.getTileCoordExtent(n.wrappedTileCoord),n.getReplayState(i).renderedResolution,S),n.hitDetectionImageData[o]=w}e(Sc(m,x,w))}}.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,r=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var n=t.viewHints,i=!(n[Bs]||n[Vs]),o=this.renderedTiles,a=0,s=o.length;a=0;--c)h[c].execute(this.context,1,this.getTileRenderTransform(u,t),t.viewState.rotation,i,void 0,t.declutterTree)}e.globalAlpha=r},e.prototype.getTileRenderTransform=function(t,e){var r=e.pixelRatio,n=e.viewState,i=n.center,o=n.resolution,a=n.rotation,s=e.size,l=Math.round(s[0]*r),u=Math.round(s[1]*r),h=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),c=t.tileCoord,p=h.getTileCoordExtent(t.wrappedTileCoord),f=h.getTileCoordExtent(c,this.tmpExtent)[0]-p[0];return Kr(Qr(this.inversePixelTransform.slice(),1/r,1/r),this.getRenderTransform(i,o,a,r,l,u,f))},e.prototype.renderFrame=function(e,r){var n=e.viewHints,i=!(n[Bs]||n[Vs]);t.prototype.renderFrame.call(this,e,r),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var o=this.getLayer(),a=o.getRenderMode(),s=this.context,u=s.globalAlpha;s.globalAlpha=o.getOpacity();for(var h=dd[a],c=e.viewState,p=c.rotation,f=o.getSource(),d=f.getTileGridForProjection(c.projection).getZForResolution(c.resolution,f.zDirection),g=this.renderedTiles,y=[],v=[],_=!0,m=g.length-1;m>=0;--m){var x=g[m];_=_&&!x.getReplayState(o).dirty;var w=x.executorGroups[l(o)].filter((function(t){return t.hasExecutors(h)}));if(0!==w.length){var b=this.getTileRenderTransform(x,e),S=x.tileCoord[0],C=!1,E=w[0].getClipCoords(b);if(E){for(var T=0,P=y.length;T255?255:t}function Ld(t){return t<0?0:t>1?1:t}function Ad(t){return"%"===t[t.length-1]?Id(parseFloat(t)/100*255):Id(parseInt(t))}function kd(t){return"%"===t[t.length-1]?Ld(parseFloat(t)/100):Ld(parseFloat(t))}function Dd(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{Fd={}.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in Md)return Md[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.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===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var n=r.indexOf("("),i=r.indexOf(")");if(-1!==n&&i+1===r.length){var o=r.substr(0,n),a=r.substr(n+1,i-(n+1)).split(","),s=1;switch(o){case"rgba":if(4!==a.length)return null;s=kd(a.pop());case"rgb":return 3!==a.length?null:[Ad(a[0]),Ad(a[1]),Ad(a[2]),s];case"hsla":if(4!==a.length)return null;s=kd(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=kd(a[1]),h=kd(a[2]),c=h<=.5?h*(u+1):h+u-h*u,p=2*h-c;return[Id(255*Dd(p,c,l+1/3)),Id(255*Dd(p,c,l)),Id(255*Dd(p,c,l-1/3)),s];default:return null}}return null}}catch(t){}var jd=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};function Gd(t){return"object"==typeof t?["literal",t]:t}function zd(t,e){var r=t.stops;if(!r)return function(t,e){var r=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",r]:r;if("enum"===e.type)return["match",r,Object.keys(e.values),r,t.default];var n=["color"===e.type?"to-color":e.type,r,Gd(t.default)];return"array"===e.type&&n.splice(1,0,e.value,e.length||null),n}(t,e);var n=r&&"object"==typeof r[0][0],i=n||void 0!==t.property,o=n||!i;return r=r.map((function(t){return!i&&e.tokens&&"string"==typeof t[1]?[t[0],qd(t[1])]:[t[0],Gd(t[1])]})),n?function(t,e,r){for(var n={},i={},o=[],a=0;a3&&e===t[t.length-2]||(n&&2===t.length||t.push(e),t.push(r))}function Wd(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function qd(t){for(var e=["concat"],r=/{([^{}]+)}/g,n=0,i=r.exec(t);null!==i;i=r.exec(t)){var o=t.slice(n,r.lastIndex-i[0].length);n=r.lastIndex,o.length>0&&e.push(o),e.push(["get",i[1]])}if(1===e.length)return t;if(n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var sg=[Zd,Hd,Jd,Qd,$d,ng,tg,og(eg),ig];function lg(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!lg(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 r=0,n=sg;r=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function yg(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 jd)return!0;if(t instanceof cg)return!0;if(t instanceof fg)return!0;if(t instanceof dg)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in wg)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=wg[s],n++}else o=eg;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],n++}r=og(o,a)}else r=wg[i];for(var l=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var Sg=function(t){this.type=ng,this.sections=t};Sg.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Hd)))return null;var l=null;if(a["text-font"]&&!(l=e.parse(a["text-font"],1,og(Jd))))return null;var u=null;if(a["text-color"]&&!(u=e.parse(a["text-color"],1,$d)))return null;var h=n[n.length-1];h.scale=s,h.font=l,h.textColor=u}else{var c=e.parse(t[o],1,eg);if(!c)return null;var p=c.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:c,scale:null,font:null,textColor:null})}}return new Sg(n)},Sg.prototype.evaluate=function(t){return new fg(this.sections.map((function(e){var r=e.content.evaluate(t);return vg(r)===ig?new pg("",r,null,null,null):new pg(_g(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},Sg.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},Cg.prototype.eachChild=function(t){t(this.input)},Cg.prototype.outputDefined=function(){return!1},Cg.prototype.serialize=function(){return["image",this.input.serialize()]};var Eg={"to-boolean":Qd,"to-color":$d,"to-number":Hd,"to-string":Jd},Tg=function(t,e){this.type=t,this.args=e};Tg.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=Eg[r],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":gg(e[0],e[1],e[2],e[3])))return new jd(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new xg(r||"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=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Ag(t,e){var r,n=(180+t[0])/360,i=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),o=Math.pow(2,e.z);return[Math.round(n*o*Mg),Math.round(i*o*Mg)]}function kg(t,e,r){var n=t[0]-e[0],i=t[1]-e[1],o=t[0]-r[0],a=t[1]-r[1];return n*a-o*i==0&&n*o<=0&&i*a<=0}function Dg(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function jg(t,e){for(var r=!1,n=0,i=e.length;n0&&c<0||h<0&&c>0}function Ng(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}Ig(e,t)}function qg(t,e,r,n){var i=Math.pow(2,n.z)*Mg,o=[n.x*Mg,n.y*Mg],a=[];if(!t)return a;for(var s=0,l=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Jg(t,e)&&(r=!1)})),r}Kg.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(yg(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new xg("Input is not a number.");a=s-1}return 0}$g.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},$g.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new bg(e,[t]):"coerce"===r?new Tg(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 n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.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 o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof mg)&&"resolvedImage"!==o.type.kind&&ty(o)){var l=new Rg;try{o=new mg(o.type,o.evaluate(l))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+n+'". 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.")},$g.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new $g(this.registry,n,e||null,i,this.errors)},$g.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Yd(n,t))},$g.prototype.checkSubtype=function(t,e){var r=lg(t,e);return r&&this.error(r),r};var ry=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var h=e.parse(s,u,i);if(!h)return null;i=i||h.type,n.push([a,h])}return new ry(i,r,n)},ry.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[ey(e,n)].evaluate(t)},ry.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var ny=iy;function iy(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}function oy(t,e,r){return t*(1-r)+e*r}iy.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},iy.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},iy.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},iy.prototype.solveCurveX=function(t,e){var r,n,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)(n=1))return n;for(;ro?r=i:n=i,i=.5*(n-r)+r}return i},iy.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var ay=Object.freeze({__proto__:null,number:oy,color:function(t,e,r){return new jd(oy(t.r,e.r,r),oy(t.g,e.g,r),oy(t.b,e.b,r),oy(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return oy(t,e[n],r)}))}}),sy=.95047,ly=1.08883,uy=4/29,hy=6/29,cy=3*hy*hy,py=Math.PI/180,fy=180/Math.PI;function dy(t){return t>.008856451679035631?Math.pow(t,1/3):t/cy+uy}function gy(t){return t>hy?t*t*t:cy*(t-uy)}function yy(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function vy(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _y(t){var e=vy(t.r),r=vy(t.g),n=vy(t.b),i=dy((.4124564*e+.3575761*r+.1804375*n)/sy),o=dy((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-dy((.0193339*e+.119192*r+.9503041*n)/ly)),alpha:t.a}}function my(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*gy(e),r=sy*gy(r),n=ly*gy(n),new jd(yy(3.2404542*r-1.5371385*e-.4985314*n),yy(-.969266*r+1.8760108*e+.041556*n),yy(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function xy(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var wy={forward:_y,reverse:my,interpolate:function(t,e,r){return{l:oy(t.l,e.l,r),a:oy(t.a,e.a,r),b:oy(t.b,e.b,r),alpha:oy(t.alpha,e.alpha,r)}}},by={forward:function(t){var e=_y(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*fy;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*py,r=t.c;return my({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:xy(t.h,e.h,r),c:oy(t.c,e.c,r),l:oy(t.l,e.l,r),alpha:oy(t.alpha,e.alpha,r)}}},Sy=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={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(!(i=e.parse(i,2,Hd)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=$d:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var h=0;h=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var g=e.parse(p,d,u);if(!g)return null;u=u||g.type,l.push([c,g])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new Sy(u,r,n,i,l):e.error("Type "+ag(u)+" is not interpolatable.")},Sy.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var o=ey(e,n),a=e[o],s=e[o+1],l=Sy.interpolationFactor(this.interpolation,n,a,s),u=r[o].evaluate(t),h=r[o+1].evaluate(t);return"interpolate"===this.operator?ay[this.type.kind.toLowerCase()](u,h,l):"interpolate-hcl"===this.operator?by.reverse(by.interpolate(by.forward(u),by.forward(h),l)):wy.reverse(wy.interpolate(wy.forward(u),wy.forward(h),l))},Sy.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new xg("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new xg("Array index must be an integer, but found "+e+" instead.");return r[e]},Py.prototype.eachChild=function(t){t(this.index),t(this.input)},Py.prototype.outputDefined=function(){return!1},Py.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Ry=function(t,e){this.type=Qd,this.needle=t,this.haystack=e};Ry.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,eg),n=e.parse(t[2],2,eg);return r&&n?ug(r.type,[Qd,Jd,Hd,Zd,eg])?new Ry(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+ag(r.type)+" instead"):null},Ry.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==r)return!1;if(!hg(e,["boolean","string","number","null"]))throw new xg("Expected first argument to be of type boolean, string, number or null, but found "+ag(vg(e))+" instead.");if(!hg(r,["string","array"]))throw new xg("Expected second argument to be of type array or string, but found "+ag(vg(r))+" instead.");return r.indexOf(e)>=0},Ry.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Ry.prototype.outputDefined=function(){return!0},Ry.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Oy=function(t,e,r){this.type=Hd,this.needle=t,this.haystack=e,this.fromIndex=r};Oy.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 r=e.parse(t[1],1,eg),n=e.parse(t[2],2,eg);if(!r||!n)return null;if(!ug(r.type,[Qd,Jd,Hd,Zd,eg]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+ag(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Hd);return i?new Oy(r,n,i):null}return new Oy(r,n)},Oy.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!hg(e,["boolean","string","number","null"]))throw new xg("Expected first argument to be of type boolean, string, number or null, but found "+ag(vg(e))+" instead.");if(!hg(r,["string","array"]))throw new xg("Expected second argument to be of type array or string, but found "+ag(vg(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},Oy.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},Oy.prototype.outputDefined=function(){return!1},Oy.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 Fy=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};Fy.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 r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,vg(p)))return null}else r=vg(p);if(void 0!==i[String(p)])return u.error("Branch labels must be unique.");i[String(p)]=o.length}var f=e.parse(l,a,n);if(!f)return null;n=n||f.type,o.push(f)}var d=e.parse(t[1],1,eg);if(!d)return null;var g=e.parse(t[t.length-1],t.length-1,n);return g?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new Fy(r,n,d,i,o,g):null},Fy.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(vg(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Fy.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Fy.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},Fy.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,eg),n=e.parse(t[2],2,Hd);if(!r||!n)return null;if(!ug(r.type,[og(eg),Jd,eg]))return e.error("Expected first argument to be of type array or string, but found "+ag(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Hd);return i?new Iy(r.type,r,n,i):null}return new Iy(r.type,r,n)},Iy.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!hg(e,["string","array"]))throw new xg("Expected first argument to be of type array or string, but found "+ag(vg(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},Iy.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Iy.prototype.outputDefined=function(){return!1},Iy.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 Dy=ky("==",(function(t,e,r){return e===r}),Ay),jy=ky("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Ay(0,e,r,n)})),Gy=ky("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Ny=ky("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Uy=ky(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),By=function(t,e,r,n,i){this.type=Jd,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};By.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Hd);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Jd)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,Jd)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,Hd)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Hd))?null:new By(r,i,o,a,s)},By.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))},By.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)},By.prototype.outputDefined=function(){return!1},By.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 Vy=function(t){this.type=Hd,this.input=t};Vy.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+ag(r.type)+" instead."):new Vy(r):null},Vy.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 xg("Expected value to be of type string or array, but found "+ag(vg(e))+" instead.")},Vy.prototype.eachChild=function(t){t(this.input)},Vy.prototype.outputDefined=function(){return!1},Vy.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Xy={"==":Dy,"!=":jy,">":zy,"<":Gy,">=":Uy,"<=":Ny,array:bg,at:Py,boolean:bg,case:My,coalesce:Ey,collator:Fg,format:Sg,image:Cg,in:Ry,"index-of":Oy,interpolate:Sy,"interpolate-hcl":Sy,"interpolate-lab":Sy,length:Vy,let:Ty,literal:mg,match:Fy,number:bg,"number-format":By,object:bg,slice:Iy,step:ry,string:bg,"to-boolean":Tg,"to-color":Tg,"to-number":Tg,"to-string":Tg,var:Qg,within:Kg};function Wy(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=gg(r,n,i,a);if(s)throw new xg(s);return new jd(r/255*a,n/255*a,i/255*a,a)}function qy(t,e){return t in e}function Yy(t,e){var r=e[t];return void 0===r?null:r}function Ky(t){return{type:t}}function Zy(t){return{result:"success",value:t}}function Hy(t){return{result:"error",value:t}}function Jy(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}Og.register(Xy,{error:[{kind:"error"},[Jd],function(t,e){var r=e[0];throw new xg(r.evaluate(t))}],typeof:[Jd,[eg],function(t,e){return ag(vg(e[0].evaluate(t)))}],"to-rgba":[og(Hd,4),[$d],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[$d,[Hd,Hd,Hd],Wy],rgba:[$d,[Hd,Hd,Hd,Hd],Wy],has:{type:Qd,overloads:[[[Jd],function(t,e){return qy(e[0].evaluate(t),t.properties())}],[[Jd,tg],function(t,e){var r=e[0],n=e[1];return qy(r.evaluate(t),n.evaluate(t))}]]},get:{type:eg,overloads:[[[Jd],function(t,e){return Yy(e[0].evaluate(t),t.properties())}],[[Jd,tg],function(t,e){var r=e[0],n=e[1];return Yy(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[eg,[Jd],function(t,e){return Yy(e[0].evaluate(t),t.featureState||{})}],properties:[tg,[],function(t){return t.properties()}],"geometry-type":[Jd,[],function(t){return t.geometryType()}],id:[eg,[],function(t){return t.id()}],zoom:[Hd,[],function(t){return t.globals.zoom}],pitch:[Hd,[],function(t){return t.globals.pitch||0}],"distance-from-center":[Hd,[],function(t){return t.distanceFromCenter()}],"heatmap-density":[Hd,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Hd,[],function(t){return t.globals.lineProgress||0}],"sky-radial-progress":[Hd,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[eg,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Hd,Ky(Hd),function(t,e){for(var r=0,n=0,i=e;n":[Qd,[Jd,eg],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[Qd,[eg],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Qd,[Jd,eg],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[Qd,[eg],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Qd,[Jd,eg],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[Qd,[eg],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Qd,[eg],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Qd,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Qd,[og(Jd)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Qd,[og(eg)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Qd,[Jd,og(eg)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Qd,[Jd,og(eg)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Qd,overloads:[[[Qd,Qd],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Ky(Qd),function(t,e){for(var r=0,n=e;r-1}(e))return Hy([new Yd("","zoom expressions not supported")]);var o=nv(r);if(!o&&!i)return Hy([new Yd("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof Yd)return Hy([o]);if(o instanceof Sy&&!function(t){return!!t.expression&&t.expression.interpolated}(e))return Hy([new Yd("",'"interpolate" expressions cannot be used with this property')]);if(!o)return Zy(new tv(n?"constant":"source",t.value));var a=o instanceof Sy?o.interpolation:void 0;return Zy(new ev(n?"camera":"composite",t.value,o.labels,a))}function nv(t){var e=null;if(t instanceof Ty)e=nv(t.result);else if(t instanceof Ey)for(var r=0,n=t.args;r":{},">=":{},"<":{},"<=":{},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},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],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:{},globe:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],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,requires:["source"]}},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"},"line-trim-offset":{type:"array",value:"number",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"property-type":"constant"}},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 av(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,r=t.slice(1);e",">=","<","<=","to-boolean"]);function pv(t,e){return te?1:0}function fv(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e"===r||"<="===r||">="===r?gv(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(dv))):"all"===r?["all"].concat(t.slice(1).map(dv)):"none"===r?["all"].concat(t.slice(1).map(dv).map(_v)):"in"===r?yv(t[1],t.slice(2)):"!in"===r?_v(yv(t[1],t.slice(2))):"has"===r?vv(t[1]):"!has"===r?_v(vv(t[1])):"within"!==r||t}function gv(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,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(pv)]]:["filter-in-small",t,["literal",e]]}}function vv(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function _v(t){return["!",t]}var mv=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function xv(t,e){var r={};for(var n in t)"ref"!==n&&(r[n]=t[n]);return mv.forEach((function(t){t in e&&(r[t]=e[t])})),r}var wv={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},bv=" ",Sv=/(italic|oblique)$/i,Cv={},Ev=function(t,e,r){var n=Cv[t];if(!n){Array.isArray(t)||(t=[t]);for(var i=400,o="normal",a=[],s=0,l=t.length;s1?u[u.length-2].toLowerCase():"";if(h==c||h==c.replace("-","")||p+"-"+h==c){i=wv[c],u.pop(),p&&c.startsWith(p)&&u.pop();break}}"number"==typeof h&&(i=h);var f=u.join(bv).replace("Klokantech Noto Sans","Noto Sans");-1!==f.indexOf(bv)&&(f='"'+f+'"'),a.push(f)}n=Cv[t]=[o,i,a]}return n[0]+bv+n[1]+bv+e+"px"+(r?"/"+r:"")+bv+n[2]},Tv="https://api.mapbox.com";function Pv(t){var e="mapbox://";return 0!==t.indexOf(e)?"":t.slice(e.length)}function Rv(t,e){var r=Pv(t);if(!r)return decodeURI(new URL(t,location.href).href);var n="styles/";if(0!==r.indexOf(n))throw new Error("unexpected style url: "+t);var i=r.slice(n.length);return Tv+"/styles/v1/"+i+"?&access_token="+e}function Ov(t,e,r,n){var i=new URL(t,n),o=Pv(t);return o?"https://{a-d}.tiles.mapbox.com/v4/"+o+"/{z}/{x}/{y}.vector.pbf?access_token="+e:e?(i.searchParams.set(r,e),decodeURI(i.href)):decodeURI(i.href)}function Fv(t){return t*Math.PI/180}var Mv=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function Iv(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var r=document.createElement("canvas");return r.width=t,r.height=e,r}var Lv={};function Av(t,e,r){if(void 0===r&&(r={}),e in Lv)return Lv[e];var n=r.transformRequest&&r.transformRequest(e,t)||new Request(e);n.headers.get("Accept")||n.headers.set("Accept","application/json");var i=fetch(n).then((function(t){return delete Lv[e],t.ok?t.json():Promise.reject(new Error("Error fetching source "+e))})).catch((function(t){return delete Lv[e],Promise.reject(new Error("Error fetching source "+e))}));return Lv[e]=i,i}var kv={};var Dv,jv=Array(256).join(" ");function Gv(t,e){if(e>=.05){for(var r="",n=t.split("\n"),i=jv.slice(0,Math.round(e/.1)),o=0,a=n.length;o0&&(r+="\n"),r+=n[o].split("").join(i);return r}return t}function zv(){return Dv||(Dv=Iv(1,1).getContext("2d")),Dv}function Nv(t,e){return zv().measureText(t).width+(t.length-1)*e}var Uv={};function Bv(t,e,r,n){if(-1!==t.indexOf("\n")){for(var i=t.split("\n"),o=[],a=0,s=i.length;a1){var c=zv();c.font=e;for(var p=c.measureText("M").width*r,f="",d=[],g=0,y=h.length;g1;++m){var w=d[m];if(Nv(w,n)<.35*p){var b=m>0?Nv(d[m-1],n):1/0,S=m.7*p&&Nv(P,n)<.6*p){var R=T.split(" "),O=R.pop();Nv(O,n)<.2*p&&(d[C]=R.join(" "),d[C+1]=O+" "+P),E-=1}}u=d.join("\n")}else u=t;u=Gv(u,n),Uv[l]=u}return u}var Vv,Xv=/font-family: ?([^;]*);/,Wv=/("|')/g;function qv(t){if(!Vv){Vv={};for(var e=document.styleSheets,r=0,n=e.length;r0&&"string"==typeof l[0]&&l[0]in Xy);if(!p&&Jy(h)&&(h=zd(h,c),p=!0),p){var f=function(t,e){var r=rv(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}(h,c);u[r]=f.evaluate.bind(f)}else"color"==c.type&&(h=jd.parse(h)),u[r]=function(){return h}}return t_.zoom=n,u[r](t_,i,a)}function r_(t,e,r,n){return e_(t,"layout","icon-allow-overlap",e,r,n)?e_(t,"layout","icon-ignore-placement",e,r,n)?"none":"obstacle":"declutter"}function n_(t,e,r,n,i){return i||console.warn("No filterCache provided to evaluateFilter()"),t in i||(i[t]=sv(e).filter),t_.zoom=n,i[t](t_,r)}function i_(t,e){if(t){if(0===t.a||0===e)return;var r=t.a;return e=void 0===e?1:e,0===r?"transparent":"rgba("+Math.round(255*t.r/r)+","+Math.round(255*t.g/r)+","+Math.round(255*t.b/r)+","+r*e+")"}return t}var o_=/\{[^{}}]*\}/g;function a_(t,e){return t.replace(o_,(function(t){return e[t.slice(1,-1)]||""}))}function s_(t,e,r,n,i,o,a){if(void 0===n&&(n=Mv),void 0===i&&(i=void 0),void 0===o&&(o=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(o)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=o}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var h=self;h.postMessage({action:"loadImage",src:o}),h.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===o&&(s=t.data.image,l=[s.width,s.height])}))}for(var c,p=function(t){t=t.slice();for(var e=Object.create(null),r=0;r=S.maxzoom)){var F=S.filter;if(!F||n_(C,F,p,h,_)){var M=void 0,I=void 0,L=void 0,A=void 0,k=void 0,D=void 0,j=b.index;if(3==c&&("fill"==S.type||"fill-extrusion"==S.type))if(I=e_(S,"paint",S.type+"-opacity",h,p,v,d),S.type+"-pattern"in T){var G=e_(S,"paint",S.type+"-pattern",h,p,v,d);if(G){var z="string"==typeof G?a_(G,o):G.toString();if(s&&i&&i[z]){++m,(D=O[m])&&D.getFill()&&!D.getStroke()&&!D.getText()||(D=new Do({fill:new Pe}),O[m]=D),L=D.getFill(),D.setZIndex(j);var N=z+"."+I,U=y[N];if(!U){var B=i[z],V=Iv(B.width,B.height),X=V.getContext("2d");X.globalAlpha=I,X.drawImage(s,B.x,B.y,B.width,B.height,0,0,B.width,B.height),U=X.createPattern(V,"repeat"),y[N]=U}L.setColor(U)}}}else M=i_(e_(S,"paint",S.type+"-color",h,p,v,d),I),S.type+"-outline-color"in T&&(k=i_(e_(S,"paint",S.type+"-outline-color",h,p,v,d),I)),k||(k=M),(M||k)&&(++m,(!(D=O[m])||M&&!D.getFill()||!M&&D.getFill()||k&&!D.getStroke()||!k&&D.getStroke()||D.getText())&&(D=new Do({fill:M?new Pe:void 0,stroke:k?new Fo:void 0}),O[m]=D),M&&(L=D.getFill()).setColor(M),k&&((A=D.getStroke()).setColor(k),A.setWidth(.5)),D.setZIndex(j));if(1!=c&&"line"==S.type){M=!("line-pattern"in T)&&"line-color"in T?i_(e_(S,"paint","line-color",h,p,v,d),e_(S,"paint","line-opacity",h,p,v,d)):void 0;var W=e_(S,"paint","line-width",h,p,v,d);M&&W>0&&(++m,(D=O[m])&&D.getStroke()&&!D.getFill()&&!D.getText()||(D=new Do({stroke:new Fo}),O[m]=D),(A=D.getStroke()).setLineCap(e_(S,"layout","line-cap",h,p,v,d)),A.setLineJoin(e_(S,"layout","line-join",h,p,v,d)),A.setMiterLimit(e_(S,"layout","line-miter-limit",h,p,v,d)),A.setColor(M),A.setWidth(W),A.setLineDash(T["line-dasharray"]?e_(S,"paint","line-dasharray",h,p,v,d).map((function(t){return t*W})):null),D.setZIndex(j))}var q=!1,Y=null,K=0,Z=void 0,H=void 0,J=void 0;if((1==c||2==c)&&"icon-image"in E){var Q=e_(S,"layout","icon-image",h,p,v,d);if(Q){Z="string"==typeof Q?a_(Q,o):Q.toString();var $=void 0;if(s&&i&&i[Z]){var tt=e_(S,"layout","icon-rotation-alignment",h,p,v,d);if(2==c){var et=e.getGeometry();if(et.getFlatMidpoint||et.getFlatMidpoints){var rt=et.getExtent();if(Math.sqrt(Math.max(Math.pow((rt[2]-rt[0])/r,2),Math.pow((rt[3]-rt[1])/r,2)))>150){var nt="MultiLineString"===et.getType()?et.getFlatMidpoints():et.getFlatMidpoint();if(Hv||(Hv=new Ro("Point",Zv=[NaN,NaN],[],{},null)),$=Hv,Zv[0]=nt[0],Zv[1]=nt[1],"line"===e_(S,"layout","symbol-placement",h,p,v,d)&&"map"===tt)for(var it=et.getStride(),ot=et.getFlatCoordinates(),at=0,st=ot.length-it;at=pt&&nt[0]<=dt&&nt[1]>=ft&&nt[1]<=gt){K=Math.atan2(ut-ct,ht-lt);break}}}}}if(2!==c||$){var yt=e_(S,"layout","icon-size",h,p,v,d),vt=void 0!==T["icon-color"]?e_(S,"paint","icon-color",h,p,v,d):null;if(!vt||0!==vt.a){var _t=Z+"."+yt;if(null!==vt&&(_t+="."+vt),!(H=g[_t])){var mt=i[Z],xt=r_(S,h,p,v);H=new Ar({color:vt?[255*vt.r,255*vt.g,255*vt.b,vt.a]:void 0,img:s,imgSize:l,size:[mt.width,mt.height],offset:[mt.x,mt.y],rotateWithView:"map"===tt,scale:yt/mt.pixelRatio,displacement:"icon-offset"in E?e_(S,"layout","icon-offset",h,p,v,d).map((function(t){return-t*mt.pixelRatio})):void 0,declutterMode:xt}),g[_t]=H}}H&&(++m,(D=O[m])&&D.getImage()&&!D.getFill()&&!D.getStroke()||(D=new Do,O[m]=D),D.setGeometry($),H.setRotation(K+Fv(e_(S,"layout","icon-rotate",h,p,v,d))),H.setOpacity(e_(S,"paint","icon-opacity",h,p,v,d)),H.setAnchor(Qv[e_(S,"layout","icon-anchor",h,p,v,d)]),D.setImage(H),Y=D.getText(),D.setText(void 0),D.setZIndex(j),q=!0,J=!1)}else J=!0}}}if(1==c&&"circle"===S.type){++m,(D=O[m])&&D.getImage()&&!D.getFill()&&!D.getStroke()||(D=new Do,O[m]=D);var wt="circle-radius"in T?e_(S,"paint","circle-radius",h,p,v,d):5,bt=i_(e_(S,"paint","circle-stroke-color",h,p,v,d),e_(S,"paint","circle-stroke-opacity",h,p,v,d)),St=i_(e_(S,"paint","circle-color",h,p,v,d),e_(S,"paint","circle-opacity",h,p,v,d)),Ct=e_(S,"paint","circle-stroke-width",h,p,v,d),Et=wt+"."+bt+"."+St+"."+Ct;(H=g[Et])||(H=new Ee({radius:wt,stroke:bt&&Ct>0?new Fo({width:Ct,color:bt}):void 0,fill:St?new Pe({color:St}):void 0,declutterMode:"none"}),g[Et]=H),D.setImage(H),Y=D.getText(),D.setText(void 0),D.setGeometry(void 0),D.setZIndex(j),q=!0}var Tt=void 0,Pt=void 0,Rt=void 0,Ot=void 0,Ft=void 0,Mt=void 0;if("text-field"in E){Ot=Math.round(e_(S,"layout","text-size",h,p,v,d));var It=e_(S,"layout","text-font",h,p,v,d);Rt=e_(S,"layout","text-line-height",h,p,v,d),(Pt=Ev(a?a(It):It,Ot,Rt)).includes("sans-serif")||(Pt+=",sans-serif"),Ft=e_(S,"layout","text-letter-spacing",h,p,v,d),Mt=e_(S,"layout","text-max-width",h,p,v,d);var Lt=e_(S,"layout","text-field",h,p,v,d);Tt="object"==typeof Lt&&Lt.sections?1===Lt.sections.length?Lt.toString():Lt.sections.reduce((function(t,e,r){var n=e.fontStack?e.fontStack.split(","):It,i=Ev(a?a(n):n,Ot*(e.scale||1),Rt),o=e.text;if("\n"===o)return t.push("\n",""),t;if(2!=c){for(var s=0,l=(o=Bv(o,i,Mt,Ft).split("\n")).length;s0&&t.push("\n",""),t.push(o[s],i);return t}t.push(Gv(o,Ft),i)}),[]):a_(Lt,o).trim(),I=e_(S,"paint","text-opacity",h,p,v,d)}if(Tt&&I&&!J){q||(++m,(D=O[m])&&D.getText()&&!D.getFill()&&!D.getStroke()||(D=new Do,O[m]=D),D.setImage(void 0),D.setGeometry(void 0)),D.getText()||D.setText(Y||new No({padding:[2,2,2,2]})),Y=D.getText();var At=E["text-transform"];"uppercase"==At?Tt=Array.isArray(Tt)?Tt.map((function(t,e){return e%2?t:t.toUpperCase()})):Tt.toUpperCase():"lowercase"==At&&(Tt=Array.isArray(Tt)?Tt.map((function(t,e){return e%2?t:t.toLowerCase()})):Tt.toLowerCase());var kt=Array.isArray(Tt)?Tt:2==c?Gv(Tt,Ft):Bv(Tt,Pt,Mt,Ft);Y.setText(kt),Y.setFont(Pt),Y.setRotation(Fv(e_(S,"layout","text-rotate",h,p,v,d)));var Dt=e_(S,"layout","text-anchor",h,p,v,d),jt=q||1==c?"point":e_(S,"layout","symbol-placement",h,p,v,d);Y.setPlacement(jt),Y.setOverflow("point"===jt);var Gt=e_(S,"paint","text-halo-width",h,p,v,d),zt=e_(S,"layout","text-offset",h,p,v,d),Nt=e_(S,"paint","text-translate",h,p,v,d),Ut=0,Bt=0;if("point"==jt){var Vt="center";-1!==Dt.indexOf("left")?(Vt="left",Bt=Gt):-1!==Dt.indexOf("right")&&(Vt="right",Bt=-Gt),Y.setTextAlign(Vt);var Xt=e_(S,"layout","text-rotation-alignment",h,p,v,d);Y.setRotateWithView("map"==Xt)}else Y.setMaxAngle(Fv(e_(S,"layout","text-max-angle",h,p,v,d))*Tt.length/kt.length),Y.setTextAlign(),Y.setRotateWithView(!1);var Wt="middle";0==Dt.indexOf("bottom")?(Wt="bottom",Ut=-Gt-.5*(Rt-1)*Ot):0==Dt.indexOf("top")&&(Wt="top",Ut=Gt+.5*(Rt-1)*Ot),Y.setTextBaseline(Wt),Y.setOffsetX(zt[0]*Ot+Bt+Nt[0]),Y.setOffsetY(zt[1]*Ot+Ut+Nt[1]),R.setColor(i_(e_(S,"paint","text-color",h,p,v,d),I)),Y.setFill(R);var qt=i_(e_(S,"paint","text-halo-color",h,p,v,d),I);if(qt){P.setColor(qt),Gt*=2;var Yt=.5*Ot;P.setWidth(Gt<=Yt?Gt:Yt),Y.setStroke(P)}else Y.setStroke(void 0);var Kt=e_(S,"layout","text-padding",h,p,v,d),Zt=Y.getPadding();Kt!==Zt[0]&&(Zt[0]=Kt,Zt[1]=Kt,Zt[2]=Kt,Zt[3]=Kt),D.setZIndex(j)}}}}return m>-1?(O.length=m+1,O):void 0}};return t.setStyle(F),t.set("mapbox-source",c),t.set("mapbox-layers",d),t.set("mapbox-featurestate",{}),F}var l_=new Ho;var u_={exports:{}},h_=Jo(yl),c_=Jo(Bt),p_=Jo(ds);!function(t,e){t.exports=function(t,e,r){t="default"in t?t.default:t,r="default"in r?r.default:r;var n=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,e){for(var r=0;re.getMaxResolution()||v=0?t:"children"}}]),u}(t);return window.ol&&window.ol.control&&(window.ol.control.LayerSwitcher=u),u}(h_,c_,p_)}(u_);var f_=u_.exports,d_="http://www.w3.org/2001/XMLSchema-instance";function g_(t,e){return A_().createElementNS(t,e)}function y_(t,e){return v_(t,e,[]).join("")}function v_(t,e,r){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?r.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(t.nodeValue);else{var n=void 0;for(n=t.firstChild;n;n=n.nextSibling)v_(n,e,r)}return r}function __(t){return"documentElement"in t}function m_(t){return(new DOMParser).parseFromString(t,"application/xml")}function x_(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&ht(n[n.length-1],i)}}function w_(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&n[n.length-1].push(i)}}function b_(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&(n[n.length-1]=i)}}function S_(t,e,r){return function(n,i){var o=t.call(void 0!==r?r:this,n,i);void 0!==o&&(i[i.length-1][void 0!==e?e:n.localName]=o)}}function C_(t,e){return function(r,n,i){t.call(void 0!==e?e:this,r,n,i),i[i.length-1].node.appendChild(r)}}function E_(t,e){var r=t;return function(t,n,i){var o=n[n.length-1].node,a=r;return void 0===a&&(a=i),g_(void 0!==e?e:o.namespaceURI,a)}}var T_=E_();function P_(t,e){for(var r=e.length,n=new Array(r),i=0;i0?r[0]:null},e.prototype.readFeatureFromNode=function(t,e){return null},e.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var r=m_(t);return this.readFeaturesFromDocument(r,e)}return __(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var r=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&ht(r,this.readFeaturesFromNode(n,e));return r},e.prototype.readFeaturesFromNode=function(t,e){return a()},e.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var r=m_(t);return this.readGeometryFromDocument(r,e)}return __(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},e.prototype.readGeometryFromDocument=function(t,e){return null},e.prototype.readGeometryFromNode=function(t,e){return null},e.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=m_(t);return this.readProjectionFromDocument(e)}return __(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},e.prototype.readProjectionFromDocument=function(t){return this.dataProjection},e.prototype.readProjectionFromNode=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){var r=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeatureNode=function(t,e){return null},e.prototype.writeFeatures=function(t,e){var r=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeaturesNode=function(t,e){return null},e.prototype.writeGeometry=function(t,e){var r=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeGeometryNode=function(t,e){return null},e}(Uo),j_=D_;function G_(t){var e,r=y_(t,!1);return(e=/^\s*(true|1)|(false|0)\s*$/.exec(r))?void 0!==e[1]||!1:void 0}function z_(t){var e,r=y_(t,!1);return(e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(r))?parseFloat(e[1]):void 0}function N_(t){return y_(t,!1).trim()}function U_(t,e){V_(t,e?"1":"0")}function B_(t,e){var r=e.toPrecision();t.appendChild(A_().createTextNode(r))}function V_(t,e){t.appendChild(A_().createTextNode(e))}var X_,W_,q_,Y_,K_,Z_,H_,J_,Q_,$_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tm=["http://www.google.com/kml/ext/2.2"],em=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],rm={fraction:Re,pixels:Oe,insetPixels:Oe},nm=R_(em,{ExtendedData:Jm,Region:Qm,MultiGeometry:S_(Bm,"geometry"),LineString:S_(zm,"geometry"),LinearRing:S_(Nm,"geometry"),Point:S_(Vm,"geometry"),Polygon:S_(Wm,"geometry"),Style:S_(Ym),StyleMap:function(t,e){var r=Em.call(this,t,e);if(!r)return;var n=e[e.length-1];Array.isArray(r)?n.Style=r:"string"==typeof r?n.styleUrl=r:_(!1,38)},address:S_(N_),description:S_(N_),name:S_(N_),open:S_(G_),phoneNumber:S_(N_),styleUrl:S_(bm),visibility:S_(G_)},R_(tm,{MultiTrack:S_((function(t,e){var r=F_([],Im,t,e);if(!r)return;return new ro(r)}),"geometry"),Track:S_(Am,"geometry")})),im=R_(em,{ExtendedData:Jm,Region:Qm,Link:function(t,e){O_(om,t,e)},address:S_(N_),description:S_(N_),name:S_(N_),open:S_(G_),phoneNumber:S_(N_),visibility:S_(G_)}),om=R_(em,{href:S_(wm)}),am=R_(em,{LatLonAltBox:function(t,e){var r=F_({},ex,t,e);if(!r)return;var n=e[e.length-1],i=[parseFloat(r.west),parseFloat(r.south),parseFloat(r.east),parseFloat(r.north)];n.extent=i,n.altitudeMode=r.altitudeMode,n.minAltitude=parseFloat(r.minAltitude),n.maxAltitude=parseFloat(r.maxAltitude)},Lod:function(t,e){var r=F_({},rx,t,e);if(!r)return;var n=e[e.length-1];n.minLodPixels=parseFloat(r.minLodPixels),n.maxLodPixels=parseFloat(r.maxLodPixels),n.minFadeExtent=parseFloat(r.minFadeExtent),n.maxFadeExtent=parseFloat(r.maxFadeExtent)}}),sm=R_(em,["Document","Placemark"]),lm=R_(em,{Document:C_((function(t,e,r){M_({node:t},sx,lx,e,r,void 0,this)})),Placemark:C_(Ix)}),um=null,hm=null,cm=null,pm=null,fm=null,dm=null;function gm(t){return 32/Math.min(t[0],t[1])}function ym(t){return t}var vm=function(t){function e(e){var r=t.call(this)||this,n=e||{};return dm||(um=new Pe({color:X_=[255,255,255,1]}),Z_="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",hm=new Ar({anchor:W_=[20,2],anchorOrigin:Fe,anchorXUnits:q_=Oe,anchorYUnits:Y_=Oe,crossOrigin:"anonymous",rotation:0,scale:gm(K_=[64,64]),size:K_,src:Z_}),H_="NO_IMAGE",cm=new Fo({color:X_,width:1}),J_=new Fo({color:[51,51,51,1],width:2}),pm=new No({font:"bold 16px Helvetica",fill:um,stroke:J_,scale:.8}),fm=new Do({fill:um,image:hm,text:pm,stroke:cm,zIndex:0}),dm=[fm]),r.dataProjection=Bn("EPSG:4326"),r.defaultStyle_=n.defaultStyle?n.defaultStyle:dm,r.extractStyles_=void 0===n.extractStyles||n.extractStyles,r.writeStyles_=void 0===n.writeStyles||n.writeStyles,r.sharedStyles_={},r.showPointNames_=void 0===n.showPointNames||n.showPointNames,r.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",r.iconUrlFunction_=n.iconUrlFunction?n.iconUrlFunction:ym,r.supportedMediaTypes=["application/vnd.google-earth.kml+xml"],r}return $_(e,t),e.prototype.readDocumentOrFolder_=function(t,e){var r=F_([],R_(em,{Document:x_(this.readDocumentOrFolder_,this),Folder:x_(this.readDocumentOrFolder_,this),Placemark:w_(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return r||void 0},e.prototype.readPlacemark_=function(t,e){var r=F_({geometry:null},nm,t,e,this);if(r){var n=new jr,i=t.getAttribute("id");null!==i&&n.setId(i);var o=e[0],a=r.geometry;if(a&&Bo(a,!1,o),n.setGeometry(a),delete r.geometry,this.extractStyles_){var s=function(t,e,r,n,i){return function(o,a){var s=i,l="",u=[];if(s){var h=o.getGeometry();if(h)if(h instanceof Si)u=h.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Point"===e||"MultiPoint"===e})),s=u.length>0;else{var c=h.getType();s="Point"===c||"MultiPoint"===c}}s&&(l=o.get("name"),(s=s&&!!l)&&l.search(/&[^&]+;/)>-1&&(Q_||(Q_=document.createElement("textarea")),Q_.innerHTML=l,l=Q_.value));var p=r;if(t?p=t:e&&(p=_m(e,r,n)),s){var f=function(t,e){var r=[0,0],n="start",i=t.getImage();if(i){var o=i.getSize();if(o&&2==o.length){var a=i.getScaleArray(),s=i.getAnchor();r[0]=a[0]*(o[0]-s[0]),r[1]=a[1]*(o[1]/2-s[1]),n="left"}}var l=t.getText();l?((l=l.clone()).setFont(l.getFont()||pm.getFont()),l.setScale(l.getScale()||pm.getScale()),l.setFill(l.getFill()||pm.getFill()),l.setStroke(l.getStroke()||J_)):l=pm.clone();return l.setText(e),l.setOffsetX(r[0]),l.setOffsetY(r[1]),l.setTextAlign(n),new Do({image:i,text:l})}(p[0],l);return u.length>0?(f.setGeometry(new Si(u)),[f,new Do({geometry:p[0].getGeometry(),image:null,fill:p[0].getFill(),stroke:p[0].getStroke(),text:null})].concat(p.slice(1))):f}return p}}(r.Style,r.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);n.setStyle(s)}return delete r.Style,n.setProperties(r,!0),n}},e.prototype.readSharedStyle_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=Ym.call(this,t,e);if(n){var i=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+r,o).href;else i="#"+r;this.sharedStyles_[i]=n}}},e.prototype.readSharedStyleMap_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=Em.call(this,t,e);if(n){var i,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+r,o).href;else i="#"+r;this.sharedStyles_[i]=n}}},e.prototype.readFeatureFromNode=function(t,e){if(!st(em,t.namespaceURI))return null;var r=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return r||null},e.prototype.readFeaturesFromNode=function(t,e){if(!st(em,t.namespaceURI))return[];var r,n=t.localName;if("Document"==n||"Folder"==n)return(r=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==n){var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i?[i]:[]}if("kml"==n){r=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var a=this.readFeaturesFromNode(o,e);a&&ht(r,a)}return r}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=m_(t);return this.readNameFromDocument(e)}return __(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},e.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var r=this.readNameFromNode(e);if(r)return r}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(st(em,e.namespaceURI)&&"name"==e.localName)return N_(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var r=e.localName;if(st(em,e.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)){var n=this.readNameFromNode(e);if(n)return n}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var r=m_(t);ht(e,this.readNetworkLinksFromDocument(r))}else __(t)?ht(e,this.readNetworkLinksFromDocument(t)):ht(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&ht(e,this.readNetworkLinksFromNode(r));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(st(em,r.namespaceURI)&&"NetworkLink"==r.localName){var n=F_({},im,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!st(em,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||ht(e,this.readNetworkLinksFromNode(r))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var r=m_(t);ht(e,this.readRegionFromDocument(r))}else __(t)?ht(e,this.readRegionFromDocument(t)):ht(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&ht(e,this.readRegionFromNode(r));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(st(em,r.namespaceURI)&&"Region"==r.localName){var n=F_({},am,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!st(em,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||ht(e,this.readRegionFromNode(r))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=g_(em[4],"kml"),n="http://www.w3.org/2000/xmlns/";r.setAttributeNS(n,"xmlns:gx",tm[0]),r.setAttributeNS(n,"xmlns:xsi",d_),r.setAttributeNS(d_,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var i={node:r},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var a=sm[r.namespaceURI],s=P_(o,a);return M_(i,lm,T_,s,[e],a,this),r},e}(j_);function _m(t,e,r){return Array.isArray(t)?t:"string"==typeof t?_m(r[t],e,r):e}function mm(t){var e=y_(t,!1),r=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(r){var n=r[1];return[parseInt(n.substr(6,2),16),parseInt(n.substr(4,2),16),parseInt(n.substr(2,2),16),parseInt(n.substr(0,2),16)/255]}}function xm(t){var e=y_(t,!1),r=[];e=e.replace(/\s*,\s*/g,",");for(var n,i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;n=i.exec(e);){var o=parseFloat(n[1]),a=parseFloat(n[2]),s=n[3]?parseFloat(n[3]):0;r.push(o,a,s),e=e.substr(n[0].length)}if(""===e)return r}function wm(t){var e=y_(t,!1).trim(),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function bm(t){var e=y_(t,!1).trim().replace(/^(?!.*#)/,"#"),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function Sm(t){return z_(t)}var Cm=R_(em,{Pair:function(t,e){var r=F_({},$m,t,e,this);if(!r)return;var n=r.key;if(n&&"normal"==n){var i=r.styleUrl;i&&(e[e.length-1]=i);var o=r.Style;o&&(e[e.length-1]=o)}}});function Em(t,e){return F_(void 0,Cm,t,e,this)}var Tm=R_(em,{Icon:S_((function(t,e){var r=F_({},km,t,e);return r||null})),color:S_(mm),heading:S_(z_),hotSpot:S_((function(t){var e,r=t.getAttribute("xunits"),n=t.getAttribute("yunits");return e="insetPixels"!==r?"insetPixels"!==n?Fe:Ie:"insetPixels"!==n?Me:Le,{x:parseFloat(t.getAttribute("x")),xunits:rm[r],y:parseFloat(t.getAttribute("y")),yunits:rm[n],origin:e}})),scale:S_(Sm)});var Pm=R_(em,{color:S_(mm),scale:S_(Sm)});var Rm=R_(em,{color:S_(mm),width:S_(z_)});var Om=R_(em,{color:S_(mm),fill:S_(G_),outline:S_(G_)});var Fm=R_(em,{coordinates:b_(xm)});function Mm(t,e){return F_(null,Fm,t,e)}var Im=R_(tm,{Track:w_(Am)});var Lm=R_(em,{when:function(t,e){var r=e[e.length-1].whens,n=y_(t,!1),i=Date.parse(n);r.push(isNaN(i)?0:i)}},R_(tm,{coord:function(t,e){var r=e[e.length-1].coordinates,n=y_(t,!1),i=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(n);if(i){var o=parseFloat(i[1]),a=parseFloat(i[2]),s=parseFloat(i[3]);r.push([o,a,s])}else r.push([])}}));function Am(t,e){var r=F_({coordinates:[],whens:[]},Lm,t,e);if(r){for(var n=[],i=r.coordinates,o=r.whens,a=0,s=Math.min(i.length,o.length);a0){var n=e[e.length-1];n.push.apply(n,r)}},outerBoundaryIs:function(t,e){var r=F_(void 0,ix,t,e);if(r){e[e.length-1][0]=r}}});function Wm(t,e){var r=F_({},Gm,t,e),n=F_([null],Xm,t,e);if(n&&n[0]){for(var i=n[0],o=[i.length],a=1,s=n.length;a0,p=h.href;p?o=p:c&&(o=Z_);var f,d=Fe,g=i.hotSpot;g?(a=[g.x,g.y],s=g.xunits,l=g.yunits,d=g.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(o)&&(/pushpin/.test(o)?(a=W_,s=q_,l=Y_):/arrow-reverse/.test(o)?(a=[54,42],s=q_,l=Y_):/paddle/.test(o)&&(a=[32,1],s=q_,l=Y_));var y,v=h.x,_=h.y;void 0!==v&&void 0!==_&&(f=[v,_]);var m,x=h.w,w=h.h;void 0!==x&&void 0!==w&&(y=[x,w]);var b=i.heading;void 0!==b&&(m=E(b));var S=i.scale,C=i.color;if(c){o==Z_&&(y=K_);var T=new Ar({anchor:a,anchorOrigin:d,anchorXUnits:s,anchorYUnits:l,crossOrigin:this.crossOrigin_,offset:f,offsetOrigin:Fe,rotation:m,scale:S,size:y,src:this.iconUrlFunction_(o),color:C}),P=T.getScaleArray()[0],R=T.getSize();if(null===R){var O=T.getImageState();if(O===e||O===r){var F=function(){var t=T.getImageState();if(t!==e&&t!==r){var n=T.getSize();if(n&&2==n.length){var i=gm(n);T.setScale(P*i)}T.unlistenImageChange(F)}};T.listenImageChange(F),O===e&&T.load()}}else if(2==R.length){var M=gm(R);T.setScale(P*M)}u.imageStyle=T}else u.imageStyle=H_}},LabelStyle:function(t,e){var r=F_({},Pm,t,e);if(r){var n=e[e.length-1],i=new No({fill:new Pe({color:"color"in r?r.color:X_}),scale:r.scale});n.textStyle=i}},LineStyle:function(t,e){var r=F_({},Rm,t,e);if(r){var n=e[e.length-1],i=new Fo({color:"color"in r?r.color:X_,width:"width"in r?r.width:1});n.strokeStyle=i}},PolyStyle:function(t,e){var r=F_({},Om,t,e);if(r){var n=e[e.length-1],i=new Pe({color:"color"in r?r.color:X_});n.fillStyle=i;var o=r.fill;void 0!==o&&(n.fill=o);var a=r.outline;void 0!==a&&(n.outline=a)}}});function Ym(t,e){var r=F_({},qm,t,e,this);if(!r)return null;var n,i="fillStyle"in r?r.fillStyle:um,o=r.fill;void 0===o||o||(i=null),"imageStyle"in r?r.imageStyle!=H_&&(n=r.imageStyle):n=hm;var a="textStyle"in r?r.textStyle:pm,s="strokeStyle"in r?r.strokeStyle:cm,l=r.outline;return void 0===l||l?[new Do({fill:i,image:n,stroke:s,text:a,zIndex:void 0})]:[new Do({geometry:function(t){var e=t.getGeometry(),r=e.getType();return"GeometryCollection"===r?new Si(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"!==e&&"MultiPolygon"!==e}))):"Polygon"!==r&&"MultiPolygon"!==r?e:void 0},fill:i,image:n,stroke:s,text:a,zIndex:void 0}),new Do({geometry:function(t){var e=t.getGeometry(),r=e.getType();return"GeometryCollection"===r?new Si(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"===e||"MultiPolygon"===e}))):"Polygon"===r||"MultiPolygon"===r?e:void 0},fill:i,stroke:null,zIndex:void 0})]}function Km(t,e){var r,n,i,o=e.length,a=new Array(e.length),s=new Array(e.length),l=new Array(e.length);r=!1,n=!1,i=!1;for(var u=0;u0){var v=P_(i,a);M_(n,Ox,Mx,[{names:a,values:v}],r)}var _=r[0],m=e.getGeometry();m&&(m=Bo(m,!0,_)),M_(n,Ox,xx,[m],r)}var Lx=R_(em,["extrude","tessellate","altitudeMode","coordinates"]),Ax=R_(em,{extrude:C_(U_),tessellate:C_(U_),altitudeMode:C_(V_),coordinates:C_((function(t,e,r){var n,i=r[r.length-1],o=i.layout,a=i.stride;o==Gr||o==Nr?n=2:o==zr||o==Ur?n=3:_(!1,34);var s=e.length,l="";if(s>0){l+=e[0];for(var u=1;u0))){var r=Jx(e.canvas).getExtension("WEBGL_lose_context");r&&r.loseContext(),delete gw[t]}}(this.canvasCacheKey_),delete this.gl_,delete this.canvas_},e.prototype.prepareDraw=function(t,e){var r=this.getGL(),n=this.getCanvas(),i=t.size,o=t.pixelRatio;n.width=i[0]*o,n.height=i[1]*o,n.style.width=i[0]+"px",n.style.height=i[1]+"px",r.useProgram(this.currentProgram_);for(var a=this.postProcessPasses_.length-1;a>=0;a--)this.postProcessPasses_[a].init(t);r.bindTexture(r.TEXTURE_2D,null),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,e?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,r){var n=this.getGL(),i=e.getSize();n.bindFramebuffer(n.FRAMEBUFFER,e.getFramebuffer()),n.viewport(0,0,i[0],i[1]),n.bindTexture(n.TEXTURE_2D,e.getTexture()),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,r?n.ZERO:n.ONE_MINUS_SRC_ALPHA),n.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var r=this.getGL();this.getExtension("OES_element_index_uint");var n=r.UNSIGNED_INT,i=e-t,o=4*t;r.drawElements(r.TRIANGLES,i,n,o)},e.prototype.finalizeDraw=function(t,e,r){for(var n=0,i=this.postProcessPasses_.length;nthis.size_[0]||e>=this.size_[1])return Ew[0]=0,Ew[1]=0,Ew[2]=0,Ew[3]=0,Ew;this.readAll();var r=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return Ew[0]=this.data_[4*r],Ew[1]=this.data_[4*r+1],Ew[2]=this.data_[4*r+2],Ew[3]=this.data_[4*r+3],Ew},t.prototype.getTexture=function(){return this.texture_},t.prototype.getFramebuffer=function(){return this.framebuffer_},t.prototype.updateSize_=function(){var t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(t[0]*t[1]*4)},t}();var Pw=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Rw=function(t){function e(e,r){var n=this,i=r.uniforms||{},o=[1,0,0,1,0,0];i[lw]=o,(n=t.call(this,e,{uniforms:i,postProcesses:r.postProcesses})||this).ready=!1,n.sourceRevision_=-1,n.verticesBuffer_=new ew(qx,Zx),n.hitVerticesBuffer_=new ew(qx,Zx),n.indicesBuffer_=new ew(Yx,Zx),n.vertexShader_=r.vertexShader,n.fragmentShader_=r.fragmentShader,n.program_,n.hitDetectionEnabled_=!(!r.hitFragmentShader||!r.hitVertexShader),n.hitVertexShader_=r.hitVertexShader,n.hitFragmentShader_=r.hitFragmentShader,n.hitProgram_;var a=r.attributes?r.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:dw.FLOAT}})):[];n.attributes=[{name:"a_position",size:2,type:dw.FLOAT},{name:"a_index",size:1,type:dw.FLOAT}].concat(a),n.hitDetectionAttributes=[{name:"a_position",size:2,type:dw.FLOAT},{name:"a_index",size:1,type:dw.FLOAT},{name:"a_hitColor",size:4,type:dw.FLOAT},{name:"a_featureUid",size:1,type:dw.FLOAT}].concat(a),n.customAttributes=r.attributes?r.attributes:[],n.previousExtent_=[1/0,1/0,-1/0,-1/0],n.currentTransform_=o,n.renderTransform_=[1,0,0,1,0,0],n.invertRenderTransform_=[1,0,0,1,0,0],n.renderInstructions_=new Float32Array(0),n.hitRenderInstructions_=new Float32Array(0),n.hitRenderTarget_,n.generateBuffersRun_=0,n.worker_=function(){var t='const e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const t=Object(e);for(let e=1,n=arguments.length;e=0||n.match(/cpu (os|iphone os) 15_4 like mac os x/)),-1!==n.indexOf("webkit")&&n.indexOf("edge"),n.indexOf("macintosh"),"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&(self,WorkerGlobalScope),function(){let e=!1;try{const n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,n),window.removeEventListener("_",null,n)}catch(e){}}(),new Array(6);const t="GENERATE_BUFFERS",o=[],r={vertexPosition:0,indexPosition:0};function i(e,n,t,o,r){e[n+0]=t,e[n+1]=o,e[n+2]=r}function s(e,n,t,s,f,c){const l=3+f,a=e[n+0],u=e[n+1],d=o;d.length=f;for(let t=0;t{const o=n.data;if(o.type===t){const n=3,t=2,r=o.customAttributesCount,i=t+r,c=new Float32Array(o.renderInstructions),l=c.length/i,a=4*l*(r+n),u=new Uint32Array(6*l),d=new Float32Array(a);let g;for(let e=0;e=a.width)return null;var u=vr(o),h=Math.floor(a.height*((o[3]-n[1])/u));return h<0||h>=a.height?null:this.getImageData(a,l,h)},e.prototype.renderFrame=function(t,e){var r=this.image_,n=r.getExtent(),i=r.getResolution(),o=r.getPixelRatio(),a=t.layerStatesArray[t.layerIndex],s=t.pixelRatio,l=t.viewState,u=l.center,h=s*i/(l.resolution*o),c=t.extent,p=l.resolution,f=l.rotation,d=Math.round(wr(c)/p*s),g=Math.round(vr(c)/p*s);tn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/s,1/s,f,-d/2,-g/2),en(this.inversePixelTransform,this.pixelTransform);var y=rn(this.pixelTransform);this.useContainer(e,y,this.getBackground(t));var v=this.context,_=v.canvas;_.width!=d||_.height!=g?(_.width=d,_.height=g):this.containerReused||v.clearRect(0,0,d,g);var m=!1,x=!0;if(a.extent){var w=ni(a.extent,l.projection);(m=(x=br(w,t.extent))&&!He(w,t.extent))&&this.clipUnrotated(v,t,w)}var b=r.getImage(),S=tn(this.tempTransform,d/2,g/2,h,h,0,o*(n[0]-u[0])/i,o*(u[1]-n[3])/i);this.renderedResolution=i*s/o;var C=b.width*S[0],E=b.height*S[3];if(this.getLayer().getSource().getInterpolate()||gt(v,yf),this.preRender(v,t),x&&C>=.5&&E>=.5){var T=S[4],P=S[5],R=a.opacity,O=void 0;1!==R&&(O=v.globalAlpha,v.globalAlpha=R),v.drawImage(b,0,0,+b.width,+b.height,T,P,C,E),1!==R&&(v.globalAlpha=O)}return this.postRender(v,t),m&&v.restore(),gt(v,vf),y!==_.style.transform&&(_.style.transform=y),this.container},e}(ec),Nw=zw,Uw=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Bw=function(t){function e(e){return t.call(this,e)||this}return Uw(e,t),e.prototype.createRenderer=function(){return new Nw(this)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(jw),Vw=function(){function t(t,e){this.name=t,this.data=e,this.texture_=null}return t.prototype.getTexture=function(t){if(!this.texture_){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.data.length/4,1,0,t.RGBA,t.UNSIGNED_BYTE,this.data),this.texture_=e}return this.texture_},t}(),Xw=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ww=function(t){function e(e){var r=this,n=ks;return(r=t.call(this,e.tileCoord,n,{transition:e.transition,interpolate:e.interpolate})||this).loader_=e.loader,r.data_=null,r.error_=null,r.size_=e.size||[256,256],r}return Xw(e,t),e.prototype.getSize=function(){return this.size_},e.prototype.getData=function(){return this.data_},e.prototype.getError=function(){return this.error_},e.prototype.load=function(){if(this.state===ks||this.state===Gs){this.state=Ds,this.changed();var t=this;this.loader_().then((function(e){t.data_=e,t.state=js,t.changed()})).catch((function(e){t.error_=e,t.state=Gs,t.changed()}))}},e}(cf),qw=Ww,Yw=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Kw(t,e,r){var n=r?t.LINEAR:t.NEAREST;t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n)}function Zw(t,e,r,n,i,o){var a,s,l=t.getGL();r instanceof Float32Array?(a=l.FLOAT,t.getExtension("OES_texture_float"),s=null!==t.getExtension("OES_texture_float_linear")):(a=l.UNSIGNED_BYTE,s=!0);Kw(l,e,o&&s);var u,h=r.byteLength/n[1],c=1;switch(h%8==0?c=8:h%4==0?c=4:h%2==0&&(c=2),i){case 1:u=l.LUMINANCE;break;case 2:u=l.LUMINANCE_ALPHA;break;case 3:u=l.RGB;break;case 4:u=l.RGBA;break;default:throw new Error("Unsupported number of bands: ".concat(i))}var p=l.getParameter(l.UNPACK_ALIGNMENT);l.pixelStorei(l.UNPACK_ALIGNMENT,c),l.texImage2D(l.TEXTURE_2D,0,u,n[0],n[1],0,u,a,r),l.pixelStorei(l.UNPACK_ALIGNMENT,p)}var Hw=null;var Jw=function(t){function e(e){var r=t.call(this)||this;r.tile,r.textures=[],r.handleTileChange_=r.handleTileChange_.bind(r),r.renderSize_=p(e.grid.getTileSize(e.tile.tileCoord[0])),r.gutter_=e.gutter||0,r.bandCount=NaN,r.helper_=e.helper;var n=new ew(qx,Kx);return n.fromArray([0,1,1,1,1,0,0,0]),r.helper_.flushBufferData(n),r.coords=n,r.setTile(e.tile),r}return Yw(e,t),e.prototype.setTile=function(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(wt,this.handleTileChange_),this.tile=t,this.textures.length=0,this.loaded=t.getState()===js,this.loaded)this.uploadTile_();else{if(t instanceof df){var e=t.getImage();e instanceof Image&&!e.crossOrigin&&(e.crossOrigin="anonymous")}t.addEventListener(wt,this.handleTileChange_)}},e.prototype.uploadTile_=function(){var t=this.helper_,e=t.getGL(),r=this.tile;if(r instanceof df||r instanceof Cf){var n=e.createTexture();return this.textures.push(n),this.bandCount=4,void function(t,e,r,n){Kw(t,e,n),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r)}(e,n,r.getImage(),r.interpolate)}var i=r.getSize(),o=[i[0]+2*this.gutter_,i[1]+2*this.gutter_],a=r.getData(),s=a instanceof Float32Array,l=o[0]*o[1],u=s?Float32Array:Uint8Array,h=u.BYTES_PER_ELEMENT,c=a.byteLength/o[1];this.bandCount=Math.floor(c/h/o[0]);var p=Math.ceil(this.bandCount/4);if(1===p){n=e.createTexture();return this.textures.push(n),void Zw(t,n,a,o,this.bandCount,r.interpolate)}for(var f=new Array(p),d=0;d=f;--d)for(var g=s.getTileRangeForExtentAndZ(e,d,this.tempTileRange_),y=s.getResolution(d),v=g.minX;v<=g.maxX;++v)for(var _=g.minY;_<=g.maxY;++_){var m=tf(d,v,_,this.tempTileCoord_),x=vb(a,m),w=void 0,b=void 0;if(p.containsKey(x)&&(b=(w=p.get(x)).tile),!w||w.tile.key!==a.getKey())if(b=a.getTile(d,v,_,t.pixelRatio,i.projection),w)if(this.isDrawableTile_(b))w.setTile(b);else{var S=b.getInterimTile();w.setTile(S)}else w=new Qw({tile:b,grid:s,helper:this.helper,gutter:u}),p.set(x,w);gb(n,w,d);var C=b.getKey();c[C]=!0,b.getState()===ks&&(t.tileQueue.isKeyQueued(C)||t.tileQueue.enqueue([b,h,s.getTileCoordCenter(m),y]))}},e.prototype.renderFrame=function(t){this.frameState_=t,this.renderComplete=!0;var e=this.helper.getGL();this.preRender(e,t);var r=t.viewState,n=this.getLayer().getRenderSource(),i=n.getTileGridForProjection(r.projection),o=n.getGutterForProjection(r.projection),a=yb(t,t.extent),s=i.getZForResolution(r.resolution,n.zDirection),u={};if(t.nextExtent){var h=i.getZForResolution(r.nextResolution,n.zDirection),c=yb(t,t.nextExtent);this.enqueueTiles(t,c,h,u)}this.enqueueTiles(t,a,s,u);for(var f={},d=l(this),g=t.time,y=!1,v=u[s],_=0,m=v.length;_=w;--b){if(this.findAltTiles_(i,x,b,u))break}}this.helper.useProgram(this.program_),this.helper.prepareDraw(t,!y);for(var S=Object.keys(u).map(Number).sort(at),C=r.center[0],E=r.center[1],T=0,P=S.length;T0&&_r(J=i.getTileCoordExtent(x),a,J),this.helper.setUniformFloatVec4(ub,J),this.helper.setUniformFloatValue(hb,r.resolution),this.helper.setUniformFloatValue(cb,r.zoom),this.helper.drawElements(0,this.indices_.getSize())}}}this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);for(var Q=this.helper.getCanvas(),$=this.tileTextureCache_;$.canExpireCache();){var tt;(tt=$.pop()).dispose()}return t.postRenderFunctions.push((function(t,e){n.expireCache(e.viewState.projection,fb)})),this.postRender(e,t),Q},e.prototype.getData=function(t){if(!this.helper.getGL())return null;var e=this.frameState_;if(!e)return null;var r=this.getLayer(),n=Hr(e.pixelToCoordinateTransform,t.slice()),i=e.viewState,o=r.getExtent();if(o&&!Ze(ni(o,i.projection),n))return null;var a,s,l,u=r.getSources(We([n]),i.resolution);for(a=u.length-1;a>=0;--a)if("ready"===(s=u[a]).getState()){if(l=s.getTileGridForProjection(i.projection),s.getWrapX())break;var h=l.getExtent();if(!h||Ze(h,n))break}if(a<0)return null;for(var c=this.tileTextureCache_,f=l.getZForResolution(i.resolution);f>=l.getMinZoom();--f){var d=l.getTileCoordForCoordAndZ(n,f),g=vb(s,d);if(c.containsKey(g)){var y=c.get(g);if(y.loaded){var v=l.getOrigin(f),_=p(l.getTileSize(f)),m=l.getResolution(f),x=(n[0]-v[0])/m-d[1]*_[0],w=(v[1]-n[1])/m-d[2]*_[1];return y.getPixelData(x,w)}}}return null},e.prototype.findAltTiles_=function(t,e,r,n){var i=t.getTileRangeForTileCoordAndZ(e,r,this.tempTileRange_);if(!i)return!1;for(var o=!0,a=this.tileTextureCache_,s=this.getLayer().getRenderSource(),l=i.minX;l<=i.maxX;++l)for(var u=i.minY;u<=i.maxY;++u){var h=vb(s,[r,l,u]),c=!1;if(a.containsKey(h)){var p=a.get(h);p.loaded&&(gb(n,p,r),c=!0)}c||(o=!1)}return o},e.prototype.removeHelper=function(){if(this.helper){var e=this.tileTextureCache_;e.forEach((function(t){return t.dispose()})),e.clear()}t.prototype.removeHelper.call(this)},e.prototype.disposeInternal=function(){var e=this.helper;e&&(e.getGL().deleteProgram(this.program_),delete this.program_,e.deleteBuffer(this.indices_));t.prototype.disposeInternal.call(this),delete this.indices_,delete this.tileTextureCache_,delete this.frameState_}}(Cw);var _b=1,mb=2,xb=4,wb=8,bb=16,Sb=31,Cb=0,Eb={};function Tb(t){if("number"==typeof t)return _b;if("boolean"==typeof t)return wb;if("string"==typeof t)return e=t,L.test(e)&&(e=k(e)),I.test(e)||0===e.indexOf("rgba(")||0===e.indexOf("rgb(")?xb|mb:mb;var e;if(!Array.isArray(t))throw new Error("Unhandled value type: ".concat(JSON.stringify(t)));var r=t;if(r.every((function(t){return"number"==typeof t})))return 3===r.length||4===r.length?xb|bb:bb;if("string"!=typeof r[0])throw new Error("Expected an expression operator but received: ".concat(JSON.stringify(r)));var n=Eb[r[0]];if(void 0===n)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(r)));return n.getReturnType(r.slice(1))}function Pb(t){var e=t.toString();return-1===e.indexOf(".")?e+".0":e}function Rb(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec".concat(t.length,"(").concat(t.map(Pb).join(", "),")")}function Ob(t,e){return void 0===t.stringLiteralsMap[e]&&(t.stringLiteralsMap[e]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[e]}function Fb(t,e,r){if(Array.isArray(e)&&"string"==typeof e[0]){var n=Eb[e[0]];if(void 0===n)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(e)));return n.toGlsl(t,e.slice(1),r)}var i=Tb(e);if((i&_b)>0)return Pb(e);if((i&wb)>0)return e.toString();if((i&mb)>0&&(void 0===r||r==mb))return function(t,e){return Pb(Ob(t,e))}(t,e.toString());if((i&xb)>0&&(void 0===r||r==xb))return function(t){var e=j(t).slice();return e.length<4&&e.push(1),Rb(e.map((function(t,e){return e<3?t/255:t})))}(e);if((i&bb)>0)return Rb(e);throw new Error("Unexpected expression ".concat(e," (expected type ").concat(r,")"))}function Mb(t){if(!(Tb(t)&_b))throw new Error("A numeric value was expected, got ".concat(JSON.stringify(t)," instead"))}function Ib(t){for(var e=0;ee)throw new Error("At most ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function Gb(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got ".concat(t," instead"))}function zb(t,e){if(w(e)%1!=0)throw new Error("Could not infer only one type from the following expression: ".concat(JSON.stringify(t)))}function Nb(t){return"u_var_"+t}Eb.get={getReturnType:function(t){return Sb},toGlsl:function(t,e){kb(e,1),Lb(e[0]);var r=e[0].toString();return-1===t.attributes.indexOf(r)&&t.attributes.push(r),(t.inFragmentShader?"v_":"a_")+r}},Eb.var={getReturnType:function(t){return Sb},toGlsl:function(t,e){kb(e,1),Lb(e[0]);var r=e[0].toString();return-1===t.variables.indexOf(r)&&t.variables.push(r),Nb(r)}};Eb.palette={getReturnType:function(t){return xb},toGlsl:function(t,e){kb(e,2),Mb(e[0]);var r=Fb(t,e[0]),n=e[1];if(!Array.isArray(n))throw new Error("The second argument of palette must be an array");for(var i=n.length,o=new Uint8Array(4*i),a=0;a"]={getReturnType:function(t){return wb},toGlsl:function(t,e){return kb(e,2),Ib(e),"(".concat(Fb(t,e[0])," > ").concat(Fb(t,e[1]),")")}},Eb[">="]={getReturnType:function(t){return wb},toGlsl:function(t,e){return kb(e,2),Ib(e),"(".concat(Fb(t,e[0])," >= ").concat(Fb(t,e[1]),")")}},Eb["<"]={getReturnType:function(t){return wb},toGlsl:function(t,e){return kb(e,2),Ib(e),"(".concat(Fb(t,e[0])," < ").concat(Fb(t,e[1]),")")}},Eb["<="]={getReturnType:function(t){return wb},toGlsl:function(t,e){return kb(e,2),Ib(e),"(".concat(Fb(t,e[0])," <= ").concat(Fb(t,e[1]),")")}},Eb["=="]=Bb("=="),Eb["!="]=Bb("!="),Eb["!"]={getReturnType:function(t){return wb},toGlsl:function(t,e){return kb(e,1),Ab(e[0]),"(!".concat(Fb(t,e[0]),")")}},Eb.all=Vb("&&"),Eb.any=Vb("||"),Eb.between={getReturnType:function(t){return wb},toGlsl:function(t,e){kb(e,3),Ib(e);var r=Fb(t,e[1]),n=Fb(t,e[2]),i=Fb(t,e[0]);return"(".concat(i," >= ").concat(r," && ").concat(i," <= ").concat(n,")")}},Eb.array={getReturnType:function(t){return bb},toGlsl:function(t,e){Db(e,2),jb(e,4),Ib(e);var r=e.map((function(e){return Fb(t,e,_b)}));return"vec".concat(e.length,"(").concat(r.join(", "),")")}},Eb.color={getReturnType:function(t){return xb},toGlsl:function(t,e){Db(e,3),jb(e,4),Ib(e);var r=e;3===e.length&&r.push(1);var n=e.map((function(e,r){return Fb(t,e,_b)+(r<3?" / 255.0":"")}));return"vec".concat(e.length,"(").concat(n.join(", "),")")}},Eb.interpolate={getReturnType:function(t){for(var e=xb|_b,r=3;r=1;l-=2){var u=Fb(t,e[l]),h=Fb(t,e[l+1],i);s="(".concat(o," == ").concat(u," ? ").concat(h," : ").concat(s||a,")")}return s}},Eb.case={getReturnType:function(t){for(var e=Sb,r=1;r=0;o-=2){var l=Fb(t,e[o]),u=Fb(t,e[o+1],i);s="(".concat(l," ? ").concat(u," : ").concat(s||a,")")}return s}};var Xb=function(){function t(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}return t.prototype.addUniform=function(t){return this.uniforms.push(t),this},t.prototype.addAttribute=function(t){return this.attributes.push(t),this},t.prototype.addVarying=function(t,e,r){return this.varyings.push({name:t,type:e,expression:r}),this},t.prototype.setSizeExpression=function(t){return this.sizeExpression=t,this},t.prototype.setRotationExpression=function(t){return this.rotationExpression=t,this},t.prototype.setSymbolOffsetExpression=function(t){return this.offsetExpression=t,this},t.prototype.setColorExpression=function(t){return this.colorExpression=t,this},t.prototype.setTextureCoordinateExpression=function(t){return this.texCoordExpression=t,this},t.prototype.setFragmentDiscardExpression=function(t){return this.discardExpression=t,this},t.prototype.setSymbolRotateWithView=function(t){return this.rotateWithView=t,this},t.prototype.getSizeExpression=function(){return this.sizeExpression},t.prototype.getOffsetExpression=function(){return this.offsetExpression},t.prototype.getColorExpression=function(){return this.colorExpression},t.prototype.getTextureCoordinateExpression=function(){return this.texCoordExpression},t.prototype.getFragmentDiscardExpression=function(){return this.discardExpression},t.prototype.getSymbolVertexShader=function(t){var e=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix",r=this.attributes,n=this.varyings;return t&&(r=r.concat("vec4 a_hitColor"),n=n.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nattribute vec2 a_position;\nattribute float a_index;\n").concat(r.map((function(t){return"attribute "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(n.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n mat4 offsetMatrix = ").concat(e,";\n vec2 halfSize = ").concat(this.sizeExpression," * 0.5;\n vec2 offset = ").concat(this.offsetExpression,";\n float angle = ").concat(this.rotationExpression,";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = ").concat(this.texCoordExpression,";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n").concat(n.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n"),"\n}")},t.prototype.getSymbolFragmentShader=function(t){var e=t?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"",r=this.varyings;return t&&(r=r.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(r.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n if (").concat(this.discardExpression,") { discard; }\n gl_FragColor = ").concat(this.colorExpression,";\n gl_FragColor.rgb *= gl_FragColor.a;\n").concat(e,"\n}")},t}();var Wb=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qb=function(t){function e(e){var r=this,n=gt({},e);return(r=t.call(this,n)||this).parseResult_=function(t){var e=t.symbol,r=void 0!==e.size?e.size:1,n=e.color||"white",i=e.textureCoord||[0,0,1,1],o=e.offset||[0,0],a=void 0!==e.opacity?e.opacity:1,s=void 0!==e.rotation?e.rotation:0,l={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{},functions:{}},u=Fb(l,r,bb|_b),h=Fb(l,o,bb),c=Fb(l,i,bb),p=Fb(l,s,_b),f={inFragmentShader:!0,variables:l.variables,attributes:[],stringLiteralsMap:l.stringLiteralsMap,functions:{}},d=Fb(f,n,xb),g=Fb(f,a,_b),y="1.0",v="vec2(".concat(Fb(f,r,bb|_b),").x");switch(e.symbolType){case"square":case"image":break;case"circle":y="(1.0-smoothstep(1.-4./".concat(v,",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))");break;case"triangle":var _="(v_quadCoord*2.-1.)",m="(atan(".concat(_,".x,").concat(_,".y))");y="(1.0-smoothstep(.5-3./".concat(v,",.5,cos(floor(.5+").concat(m,"/2.094395102)*2.094395102-").concat(m,")*length(").concat(_,")))");break;default:throw new Error("Unexpected symbol type: "+e.symbolType)}var x=(new Xb).setSizeExpression("vec2(".concat(u,")")).setRotationExpression(p).setSymbolOffsetExpression(h).setTextureCoordinateExpression(c).setSymbolRotateWithView(!!e.rotateWithView).setColorExpression("vec4(".concat(d,".rgb, ").concat(d,".a * ").concat(g," * ").concat(y,")"));if(t.filter){var w=Fb(f,t.filter,wb);x.setFragmentDiscardExpression("!".concat(w))}var b={};if(f.variables.forEach((function(e){var r=Nb(e);x.addUniform("float ".concat(r)),b[r]=function(){if(!t.variables||void 0===t.variables[e])throw new Error("The following variable is missing from the style: ".concat(e));var r=t.variables[e];return"string"==typeof r&&(r=Ob(l,r)),void 0!==r?r:-9999999}})),"image"===e.symbolType&&e.src){var S=new Image;S.crossOrigin=void 0===e.crossOrigin?"anonymous":e.crossOrigin,S.src=e.src,x.addUniform("sampler2D u_texture").setColorExpression(x.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),b.u_texture=S}return f.attributes.forEach((function(t){-1===l.attributes.indexOf(t)&&l.attributes.push(t),x.addVarying("v_".concat(t),"float","a_".concat(t))})),l.attributes.forEach((function(t){x.addAttribute("float a_".concat(t))})),{builder:x,attributes:l.attributes.map((function(t){return{name:t,callback:function(e,r){var n=r[t];return"string"==typeof n&&(n=Ob(l,n)),void 0!==n?n:-9999999}}})),uniforms:b}}(e.style),r.styleVariables_=e.style.variables||{},r.hitDetectionDisabled_=!!e.disableHitDetection,r}return Wb(e,t),e.prototype.createRenderer=function(){return new Ow(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitVertexShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolVertexShader(!0),hitFragmentShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolFragmentShader(!0),uniforms:this.parseResult_.uniforms,attributes:this.parseResult_.attributes})},e.prototype.updateStyleVariables=function(t){gt(this.styleVariables_,t),this.changed()},e}(Ya),Yb=qb,Kb=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();var Zb=function(t){function e(e){var r=this,n=void 0!==e.hidpi&&e.hidpi,i=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(i=e.interpolate),(r=t.call(this,{cacheSize:e.cacheSize,crossOrigin:"anonymous",interpolate:i,opaque:!0,projection:Bn("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:"loading",tileLoadFunction:e.tileLoadFunction,tilePixelRatio:n?2:1,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:e.zDirection})||this).hidpi_=n,r.culture_=void 0!==e.culture?e.culture:"en-us",r.maxZoom_=void 0!==e.maxZoom?e.maxZoom:-1,r.apiKey_=e.key,r.imagerySet_=e.imagerySet,Hf("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+r.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+r.apiKey_+"&c="+r.culture_,r.handleImageryMetadataResponse.bind(r),void 0,"jsonp"),r}return Kb(e,t),e.prototype.getApiKey=function(){return this.apiKey_},e.prototype.getImagerySet=function(){return this.imagerySet_},e.prototype.handleImageryMetadataResponse=function(t){if(200==t.statusCode&&"OK"==t.statusDescription&&"ValidCredentials"==t.authenticationResultCode&&1==t.resourceSets.length&&1==t.resourceSets[0].resources.length){var e=t.resourceSets[0].resources[0],r=-1==this.maxZoom_?e.zoomMax:this.maxZoom_,n=kf(this.getProjection()),i=this.hidpi_?2:1,o=e.imageWidth==e.imageHeight?e.imageWidth/i:[e.imageWidth/i,e.imageHeight/i],a=Lf({extent:n,minZoom:e.zoomMin,maxZoom:r,tileSize:o});this.tileGrid=a;var s=this.culture_,l=this.hidpi_;if(this.tileUrlFunction=Bf(e.imageUrlSubdomains.map((function(t){var r=[0,0,0],n=e.imageUrl.replace("{subdomain}",t).replace("{culture}",s);return function(t,e,i){if(t){tf(t[0],t[1],t[2],r);var o=n;return l&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",function(t){var e,r,n=t[0],i=new Array(n),o=1<>=1;return i.join("")}(r))}}}))),e.imageryProviders){var u=Kn(Bn("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var r=[],n=t.viewState,i=this.getTileGrid(),o=i.getZForResolution(n.resolution,this.zDirection),a=i.getTileCoordForCoordAndZ(n.center,o)[0];return e.imageryProviders.map((function(e){for(var n=!1,i=e.coverageAreas,o=0,s=i.length;o=l.zoomMin&&a<=l.zoomMax){var h=l.bbox;if(br(Cr([h[1],h[0],h[3],h[2]],u),t.extent)){n=!0;break}}}n&&r.push(e.attribution)})),r.push('Terms of Use'),r}.bind(this))}this.setState("ready")}else this.setState("error")},e}(Kf),Hb=Zb,Jb=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qb=function(t){function e(e){var r=this,n=e||{},i=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(i=n.interpolate);var o=void 0!==n.projection?n.projection:"EPSG:3857",a=void 0!==n.tileGrid?n.tileGrid:Lf({extent:kf(o),maxResolution:n.maxResolution,maxZoom:n.maxZoom,minZoom:n.minZoom,tileSize:n.tileSize});return(r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:i,opaque:n.opaque,projection:o,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileGrid:a,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this).gutter_=void 0!==n.gutter?n.gutter:0,r}return Jb(e,t),e.prototype.getGutter=function(){return this.gutter_},e}(Kf),$b=Qb,tS=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),eS=function(t){function a(r,n,i,a,s,l,u){var h=this,c=r.getExtent(),p=n.getExtent(),f=p?_r(i,p):i,d=wf(r,n,fr(f),a),g=new gf(r,n,f,c,.5*d,a),y=l(g.calculateSourceExtent(),d,s),v=y?e:o,_=y?y.getPixelRatio():1;return(h=t.call(this,i,a,_,v)||this).targetProj_=n,h.maxSourceExtent_=c,h.triangulation_=g,h.targetResolution_=a,h.targetExtent_=i,h.sourceImage_=y,h.sourcePixelRatio_=_,h.interpolate_=u,h.canvas_=null,h.sourceListenerKey_=null,h}return tS(a,t),a.prototype.disposeInternal=function(){this.state==r&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},a.prototype.getImage=function(){return this.canvas_},a.prototype.getProjection=function(){return this.targetProj_},a.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==n){var e=wr(this.targetExtent_)/this.targetResolution_,r=vr(this.targetExtent_)/this.targetResolution_;this.canvas_=bf(e,r,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_)}this.state=t,this.changed()},a.prototype.load=function(){if(this.state==e){this.state=r,this.changed();var t=this.sourceImage_.getState();t==n||t==i?this.reproject_():(this.sourceListenerKey_=kt(this.sourceImage_,wt,(function(t){var e=this.sourceImage_.getState();e!=n&&e!=i||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},a.prototype.unlistenSource_=function(){jt(this.sourceListenerKey_),this.sourceListenerKey_=null},a}(Ge),rS=eS,nS=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),iS="imageloadstart",oS="imageloadend",aS="imageloaderror",sS=function(t){function e(e,r){var n=t.call(this,e)||this;return n.image=r,n}return nS(e,t),e}(nt),lS=function(t){function e(e){var r=this,n=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(n=e.interpolate),(r=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state,interpolate:n})||this).on,r.once,r.un,r.resolutions_=void 0!==e.resolutions?e.resolutions:null,r.reprojectedImage_=null,r.reprojectedRevision_=0,r}return nS(e,t),e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=lt(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,r,n){var i=this.getProjection();if(i&&n&&!Yn(i,n)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Yn(this.reprojectedImage_.getProjection(),n)&&this.reprojectedImage_.getResolution()==e&&ir(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new rS(i,n,t,e,r,function(t,e,r){return this.getImageInternal(t,e,r,i)}.bind(this),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return i&&(n=i),this.getImageInternal(t,e,r,n)},e.prototype.getImageInternal=function(t,e,r,n){return a()},e.prototype.handleImageChange=function(t){var e,o=t.target;switch(o.getState()){case r:this.loading=!0,e=iS;break;case n:this.loading=!1,e=oS;break;case i:this.loading=!1,e=aS;break;default:return}this.hasListener(e)&&this.dispatchEvent(new sS(e,o))},e}(Gc);function uS(t,e){t.getImage().src=e}var hS=lS;function cS(t,e){var r=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&r.push(t+"="+encodeURIComponent(e[t]))}));var n=r.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+n}var pS=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fS=function(t){function e(e){var r=this,n=void 0!==e.crossOrigin?e.crossOrigin:null,i=void 0!==e.imageLoadFunction?e.imageLoadFunction:uS,o=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(o=e.interpolate),(r=t.call(this,{attributions:e.attributions,interpolate:o,projection:Bn(e.projection)})||this).url_=e.url,r.imageExtent_=e.imageExtent,r.image_=new Rr(r.imageExtent_,void 0,1,r.url_,n,i),r.imageSize_=e.imageSize?e.imageSize:null,r.image_.addEventListener(wt,r.handleImageChange.bind(r)),r}return pS(e,t),e.prototype.getImageExtent=function(){return this.imageExtent_},e.prototype.getImageInternal=function(t,e,r,n){return br(t,this.image_.getExtent())?this.image_:null},e.prototype.getUrl=function(){return this.url_},e.prototype.handleImageChange=function(e){if(this.image_.getState()==n){var r=this.image_.getExtent(),i=this.image_.getImage(),o=void 0,a=void 0;this.imageSize_?(o=this.imageSize_[0],a=this.imageSize_[1]):(o=i.width,a=i.height);var s=wr(r),l=vr(r),u=s/o,h=l/a,c=o,p=a;if(u>h?c=Math.round(s/h):p=Math.round(l/u),c!==o||p!==a){var f=H(c,p);this.getInterpolate()||gt(f,yf);var d=f.canvas;f.drawImage(i,0,0,o,a,0,0,d.width,d.height),this.image_.setImage(d)}}t.prototype.handleImageChange.call(this,e)},e}(hS),dS=fS,gS="1.3.0",yS=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vS=[101,101],_S=function(t){function e(e){var r=this,n=e||{},i=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(i=n.interpolate),(r=t.call(this,{attributions:n.attributions,interpolate:i,projection:n.projection,resolutions:n.resolutions})||this).crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null,r.url_=n.url,r.imageLoadFunction_=void 0!==n.imageLoadFunction?n.imageLoadFunction:uS,r.params_=n.params||{},r.v13_=!0,r.updateV13_(),r.serverType_=n.serverType,r.hidpi_=void 0===n.hidpi||n.hidpi,r.image_=null,r.imageSize_=[0,0],r.renderedRevision_=0,r.ratio_=void 0!==n.ratio?n.ratio:1.5,r}return yS(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,n){if(void 0!==this.url_){var i=Bn(r),o=this.getProjection();o&&o!==i&&(e=wf(o,i,t,e),t=Hn(t,i,o));var a=gr(t,e,0,vS),s={SERVICE:"WMS",VERSION:gS,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};gt(s,this.params_,n);var l=F((t[0]-a[0])/e,4),u=F((a[3]-t[1])/e,4);return s[this.v13_?"I":"X"]=l,s[this.v13_?"J":"Y"]=u,this.getRequestUrl_(a,vS,1,o||i,s)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.url_){var r={SERVICE:"WMS",VERSION:gS,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var n=this.params_.LAYERS;if(!(!Array.isArray(n)||1===n.length))return;r.LAYER=n}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*i/28e-5}return gt(r,e),cS(this.url_,r)}},e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,n){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==r||this.hidpi_&&void 0!==this.serverType_||(r=1);var i=e/r,o=fr(t),a=gr(o,i,0,[M(wr(t)/i,4),M(vr(t)/i,4)]),s=gr(o,i,0,[M(this.ratio_*wr(t)/i,4),M(this.ratio_*vr(t)/i,4)]),l=this.image_;if(l&&this.renderedRevision_==this.getRevision()&&l.getResolution()==e&&l.getPixelRatio()==r&&He(l.getExtent(),a))return l;var u={SERVICE:"WMS",VERSION:gS,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};gt(u,this.params_),this.imageSize_[0]=O(wr(s)/i,4),this.imageSize_[1]=O(vr(s)/i,4);var h=this.getRequestUrl_(s,this.imageSize_,r,n,u);return this.image_=new Rr(s,e,r,h,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(wt,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,r,n,i){if(_(void 0!==this.url_,9),i[this.v13_?"CRS":"SRS"]=n.getCode(),"STYLES"in this.params_||(i.STYLES=""),1!=r)switch(this.serverType_){case"geoserver":var o=90*r+.5|0;"FORMAT_OPTIONS"in i?i.FORMAT_OPTIONS+=";dpi:"+o:i.FORMAT_OPTIONS="dpi:"+o;break;case"mapserver":i.MAP_RESOLUTION=90*r;break;case"carmentaserver":case"qgis":i.DPI=90*r;break;default:_(!1,8)}i.WIDTH=e[0],i.HEIGHT=e[1];var a,s=n.getAxisOrientation();return a=this.v13_&&"ne"==s.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,i.BBOX=a.join(","),cS(this.url_,i)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){gt(this.params_,t),this.updateV13_(),this.image_=null,this.changed()},e.prototype.updateV13_=function(){var t=this.params_.VERSION||gS;this.v13_=Sn(t,"1.3")>=0},e}(hS),mS=_S,xS=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wS=function(t){function e(e){var r,n=e||{},i=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(i=n.interpolate),r=void 0!==n.attributions?n.attributions:['© OpenStreetMap contributors.'];var o=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",a=void 0!==n.url?n.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:r,attributionsCollapsible:!1,cacheSize:n.cacheSize,crossOrigin:o,interpolate:i,maxZoom:void 0!==n.maxZoom?n.maxZoom:19,opaque:void 0===n.opaque||n.opaque,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:a,wrapX:n.wrapX,zDirection:n.zDirection})||this}return xS(e,t),e}($b),bS=wS,SS=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),CS=function(t){function e(e){var r=this,n=e||{},i=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(i=n.interpolate);var o=n.params||{},a=!("TRANSPARENT"in o)||o.TRANSPARENT;return(r=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:i,opaque:!a,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileClass:n.tileClass,tileGrid:n.tileGrid,tileLoadFunction:n.tileLoadFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).gutter_=void 0!==n.gutter?n.gutter:0,r.params_=o,r.v13_=!0,r.serverType_=n.serverType,r.hidpi_=void 0===n.hidpi||n.hidpi,r.tmpExtent_=[1/0,1/0,-1/0,-1/0],r.updateV13_(),r.setKey(r.getKeyForParams_()),r}return SS(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,n){var i=Bn(r),o=this.getProjection(),a=this.getTileGrid();a||(a=this.getTileGridForProjection(i));var s=a.getZForResolution(e,this.zDirection),l=a.getTileCoordForCoordAndZ(t,s);if(!(a.getResolutions().length<=l[0])){var h=a.getResolution(l[0]),c=a.getTileCoordExtent(l,this.tmpExtent_),f=p(a.getTileSize(l[0]),this.tmpSize),d=this.gutter_;0!==d&&(f=u(f,d,this.tmpSize),c=qe(c,h*d,c)),o&&o!==i&&(h=wf(o,i,t,h),c=function(t,e,r,n){return Cr(t,Zn(e,r),void 0,n)}(c,i,o),t=Hn(t,i,o));var g={SERVICE:"WMS",VERSION:gS,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};gt(g,this.params_,n);var y=Math.floor((t[0]-c[0])/h),v=Math.floor((c[3]-t[1])/h);return g[this.v13_?"I":"X"]=y,g[this.v13_?"J":"Y"]=v,this.getRequestUrl_(l,f,c,1,o||i,g)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.urls[0]){var r={SERVICE:"WMS",VERSION:gS,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var n=this.params_.LAYERS;if(!(!Array.isArray(n)||1===n.length))return;r.LAYER=n}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*i/28e-5}return gt(r,e),cS(this.urls[0],r)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,r,n,i,o){var a=this.urls;if(a){if(o.WIDTH=e[0],o.HEIGHT=e[1],o[this.v13_?"CRS":"SRS"]=i.getCode(),"STYLES"in this.params_||(o.STYLES=""),1!=n)switch(this.serverType_){case"geoserver":var s=90*n+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+s:o.FORMAT_OPTIONS="dpi:"+s;break;case"mapserver":o.MAP_RESOLUTION=90*n;break;case"carmentaserver":case"qgis":o.DPI=90*n;break;default:_(!1,52)}var l,u=i.getAxisOrientation(),h=r;if(this.v13_&&"ne"==u.substr(0,2)){var c=void 0;c=r[0],h[0]=r[1],h[1]=c,c=r[2],h[2]=r[3],h[3]=c}if(o.BBOX=h.join(","),1==a.length)l=a[0];else l=a[T(of(t),a.length)];return cS(l,o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var r in this.params_)e[t++]=r+"-"+this.params_[r];return e.join("/")},e.prototype.updateParams=function(t){gt(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){var t=this.params_.VERSION||gS;this.v13_=Sn(t,"1.3")>=0},e.prototype.tileUrlFunction=function(t,e,r){var n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(r)),!(n.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var i=n.getResolution(t[0]),o=n.getTileCoordExtent(t,this.tmpExtent_),a=p(n.getTileSize(t[0]),this.tmpSize),s=this.gutter_;0!==s&&(a=u(a,s,this.tmpSize),o=qe(o,i*s,o)),1!=e&&(a=c(a,e,this.tmpSize));var l={SERVICE:"WMS",VERSION:gS,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return gt(l,this.params_),this.getRequestUrl_(t,a,o,e,r,l)}},e}(Kf),ES=CS;Ut.unByKey=Nt;let TS={Control:gl,Zoom:Cl,Attribution:ml,ScaleLine:Vl,LayerSwitcher:f_},PS={GeoJSON:Ho,KML:Wx,MVT:Ta},RS={Group:fs,Tile:ld,Vector:Ac,VectorTile:_d,WebGLPoints:Yb,Heatmap:kw,Image:Bw},OS={toLonLat:function(t,e){var r=Hn(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),n=r[0];return(n<-180||n>180)&&(r[0]=T(n+180,360)-180),r},fromLonLat:qn},FS={LineString:$i,Point:oo,MultiPoint:lo},MS={Icon:Ar,Style:Do,Text:No,Stroke:Fo,Fill:Pe,Circle:Ee},IS={OSM:bS,XYZ:$b,TileWMS:ES,BingMaps:Hb,Vector:Jc,VectorTile:Rd,ImageWMS:mS,ImageStatic:dS};t.Collection=us,t.Feature=jr,t.Map=Hp,t.Observable=Ut,t.Overlay=Il,t.View=ll,t.applyStyle=function(t,e,r,n,i){var o,a,s;return void 0===r&&(r=""),void 0===n&&(n={}),void 0===i&&(i=void 0),"string"==typeof n?(o=n,s={}):(o=n.styleUrl,s=n),i||(i=s.resolutions),o||"string"!=typeof e||e.trim().startsWith("{")||(o=e),o&&(o=o.startsWith("data:")?location.href:Rv(o,s.accessToken),s=function(t,e){return e.accessToken||(e=gt({},e),new URL(t).searchParams.forEach((function(t,r){e.accessToken=t,e.accessTokenParam=r}))),e}(o,s)),new Promise((function(n,l){(function(t,e){if("string"!=typeof t)return Promise.resolve(t);if(!t.trim().startsWith("{"))return Av("Style",t=Rv(t,e.accessToken),e);try{var r=JSON.parse(t);return Promise.resolve(r)}catch(t){return Promise.reject(t)}})(e,s).then((function(e){if(8!=e.version)return l(new Error("glStyle version 8 required."));if(!(t instanceof Ac||t instanceof _d))return l(new Error("Can only apply to VectorLayer or VectorTileLayer"));var u,h,c,p=t instanceof _d?"vector":"geojson";if(r?a=Array.isArray(r)?e.layers.find((function(t){return t.id===r[0]})).source:r:(a=Object.keys(e.sources).find((function(t){return e.sources[t].type===p})),r=a),!a)return l(new Error("No "+p+" source found in the glStyle."));function f(){if(t instanceof _d)return function(t,e,r){return new Promise((function(n,i){(function(t,e,r){void 0===r&&(r={});var n=[e,JSON.stringify(t)].toString(),i=kv[n];if(!i||r.transformRequest){var o=t.url;if(o&&!t.tiles){var a=Ov(o,r.accessToken,r.accessTokenParam||"access_token",e||location.href);i=o.startsWith("mapbox://")?Promise.resolve(gt({},t,{url:void 0,tiles:a})):Av("Source",a,r).then((function(t){for(var e=0,n=t.tiles.length;e