5 lines
666 KiB
JavaScript
5 lines
666 KiB
JavaScript
!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";function e(){return function(){throw new Error("Unimplemented abstract method.")}()}var r=0;function n(t){return t.ol_uid||(t.ol_uid=String(++r))}var i,o=(i=function(t,e){return i=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])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),a=function(t){function e(e){var r=this,n="Assertion failed. See https://openlayers.org/en/"+("v"+"6.14.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 o(e,t),e}(Error),s=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}(),l="propertychange",u=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function h(t,e){return t>e?1:t<e?-1:0}function c(t,e){return t.indexOf(e)>=0}function p(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;i<n;++i)if(t[i]<e)return i-1}else if(r<0){for(i=1;i<n;++i)if(t[i]<=e)return i}else for(i=1;i<n;++i){if(t[i]==e)return i;if(t[i]<e)return"function"==typeof r?r(e,t[i-1],t[i])>0?i-1:i:t[i-1]-e<e-t[i]?i-1:i}return n-1}function f(t,e,r){for(;e<r;){var n=t[e];t[e]=t[r],t[r]=n,++e,--r}}function d(t,e){for(var r=Array.isArray(e)?e:[e],n=r.length,i=0;i<n;i++)t[t.length]=r[i]}function g(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function y(){return!0}function v(){return!1}function _(){}var m="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),n=1,i=arguments.length;n<i;++n){var o=arguments[n];if(null!=o)for(var a in o)o.hasOwnProperty(a)&&(r[a]=o[a])}return r};function x(t){for(var e in t)delete t[e]}var b="function"==typeof Object.values?Object.values:function(t){var e=[];for(var r in t)e.push(t[r]);return e};function w(t){var e;for(e in t)return!1;return!e}var S=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=function(t){function e(e){var r=t.call(this)||this;return r.eventTarget_=e,r.pendingRemovals_=null,r.dispatching_=null,r.listeners_=null,r}return S(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var r=this.listeners_||(this.listeners_={}),n=r[t]||(r[t]=[]);-1===n.indexOf(e)&&n.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t,r=e?t:t.type,n=this.listeners_&&this.listeners_[r];if(n){var i=e?new s(t):t;i.target||(i.target=this.eventTarget_||this);var o,a=this.dispatching_||(this.dispatching_={}),l=this.pendingRemovals_||(this.pendingRemovals_={});r in a||(a[r]=0,l[r]=0),++a[r];for(var u=0,h=n.length;u<h;++u)if(!1===(o="handleEvent"in n[u]?n[u].handleEvent(i):n[u].call(this,i))||i.propagationStopped){o=!1;break}if(0==--a[r]){var c=l[r];for(delete l[r];c--;)this.removeEventListener(r,_);delete a[r]}return o}},e.prototype.disposeInternal=function(){this.listeners_&&x(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var r=this.listeners_&&this.listeners_[t];if(r){var n=r.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(r[n]=_,++this.pendingRemovals_[t]):(r.splice(n,1),0===r.length&&delete this.listeners_[t]))}},e}(u),E="change",T="error",R="contextmenu",P="click",O="dblclick",F="dragenter",I="dragover",M="drop",A="keydown",L="keypress",k="load",D="resize",j="touchmove",z="wheel";function G(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 N(t,e,r,n){return G(t,e,r,n,!0)}function U(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),x(t))}var B=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)}}(),V=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 B(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(E)},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;i<r;++i)n[i]=G(this,t[i],e);return n}return G(this,t,e)},e.prototype.onceInternal=function(t,e){var r;if(Array.isArray(t)){var n=t.length;r=new Array(n);for(var i=0;i<n;++i)r[i]=N(this,t[i],e)}else r=N(this,t,e);return e.ol_key=r,r},e.prototype.unInternal=function(t,e){var r=e.ol_key;if(r)X(r);else if(Array.isArray(t))for(var n=0,i=t.length;n<i;++n)this.removeEventListener(t[n],e);else this.removeEventListener(t,e)},e}(C);function X(t){if(Array.isArray(t))for(var e=0,r=t.length;e<r;++e)U(t[e]);else U(t)}V.prototype.on,V.prototype.once,V.prototype.un;var W=V,q=Object.freeze({__proto__:null,unByKey:X,default:W}),Y=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)}}(),K=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.key=r,i.oldValue=n,i}return Y(e,t),e}(s),Z=function(t){function e(e){var r=t.call(this)||this;return r.on,r.once,r.un,n(r),r.values_=null,void 0!==e&&r.setProperties(e),r}return Y(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&m({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var r;r="change:".concat(t),this.hasListener(r)&&this.dispatchEvent(new K(r,t,e)),r=l,this.hasListener(r)&&this.dispatchEvent(new K(r,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:".concat(t),e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:".concat(t),e)},e.prototype.set=function(t,e,r){var n=this.values_||(this.values_={});if(r)n[t]=e;else{var i=n[t];n[t]=e,i!==e&&this.notify(t,i)}},e.prototype.setProperties=function(t,e){for(var r in t)this.set(r,t[r],e)},e.prototype.applyProperties=function(t){t.values_&&m(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var r=this.values_[t];delete this.values_[t],w(this.values_)&&(this.values_=null),e||this.notify(t,r)}},e}(W),H=Z,J="add",Q="remove",$=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)}}(),tt="length",et=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.element=r,i.index=n,i}return $(e,t),e}(s),rt=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;o<a;++o)n.assertUnique_(n.array_[o],o);return n.updateLength_(),n}return $(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,r=t.length;e<r;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)t(e[r],r,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(tt)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new et(J,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)if(e[r]===t)return this.removeAt(r)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new et(Q,e,t)),e},e.prototype.setAt=function(t,e){var r=this.getLength();if(t<r){this.unique_&&this.assertUnique_(e,t);var n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new et(Q,n,t)),this.dispatchEvent(new et(J,e,t))}else{for(var i=r;i<t;++i)this.insertAt(i,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(tt,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var r=0,n=this.array_.length;r<n;++r)if(this.array_[r]===t&&r!==e)throw new a(58)},e}(H),nt=rt;function it(t,e){if(!t)throw new a(e)}var ot=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)}}(),at=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 ot(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_&&(U(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=G(t,E,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:(it("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}(H);var st=at,lt="XY",ut="XYZ",ht="XYM",ct="XYZM",pt="Point",ft="LineString",dt="LinearRing",gt="Polygon",yt="MultiPoint",vt="MultiLineString",_t="MultiPolygon",mt="GeometryCollection",xt="Circle",bt={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},wt={};wt[bt.RADIANS]=6370997/(2*Math.PI),wt[bt.DEGREES]=2*Math.PI*6370997/360,wt[bt.FEET]=.3048,wt[bt.METERS]=1,wt[bt.USFEET]=1200/3937;var St,Ct=bt,Et="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Tt=-1!==Et.indexOf("firefox"),Rt=-1!==Et.indexOf("safari")&&-1==Et.indexOf("chrom")&&!!(Et.indexOf("version/15.4")>=0||Et.match(/cpu (os|iphone os) 15_4 like mac os x/)),Pt=-1!==Et.indexOf("webkit")&&-1==Et.indexOf("edge"),Ot=-1!==Et.indexOf("macintosh"),Ft="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,It="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,Mt="undefined"!=typeof Image&&Image.prototype.decode,At=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}(),Lt=new Array(6);function kt(t){return jt(t,1,0,0,1,0,0)}function Dt(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 jt(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 zt(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 Gt(t,e,r){return Dt(t,jt(Lt,e,0,0,r,0,0))}function Nt(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 Ut(t,e){var r,n=(r=e)[0]*r[3]-r[1]*r[2];it(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 Bt(t){var e="matrix("+t.join(", ")+")";if(It)return e;var r=St||(St=document.createElement("div"));return r.style.transform=e,r.style.transform}var Vt="bottom-left",Xt="bottom-right",Wt="top-left",qt="top-right",Yt=0,Kt=1,Zt=2,Ht=4,Jt=8,Qt=16;function $t(t){for(var e=se(),r=0,n=t.length;r<n;++r)de(e,t[r]);return e}function te(t,e,r){return r?(r[0]=t[0]-e,r[1]=t[1]-e,r[2]=t[2]+e,r[3]=t[3]+e,r):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function ee(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function re(t,e,r){var n,i;return(n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*n+(i=r<t[1]?t[1]-r:t[3]<r?r-t[3]:0)*i}function ne(t,e){return oe(t,e[0],e[1])}function ie(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function oe(t,e,r){return t[0]<=e&&e<=t[2]&&t[1]<=r&&r<=t[3]}function ae(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],l=Yt;return a<r?l|=Qt:a>i&&(l|=Ht),s<n?l|=Jt:s>o&&(l|=Zt),l===Yt&&(l=Kt),l}function se(){return[1/0,1/0,-1/0,-1/0]}function le(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 ue(t){return le(1/0,1/0,-1/0,-1/0,t)}function he(t,e){var r=t[0],n=t[1];return le(r,n,r,n,e)}function ce(t,e,r,n,i){return ge(ue(i),t,e,r,n)}function pe(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function fe(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function de(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function ge(t,e,r,n,i){for(;r<n;r+=i)ye(t,e[r],e[r+1]);return t}function ye(t,e,r){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],r),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],r)}function ve(t,e){var r;return(r=e(me(t)))||(r=e(xe(t)))||(r=e(Re(t)))?r:(r=e(Te(t)))||!1}function _e(t){var e=0;return Fe(t)||(e=Pe(t)*Ce(t)),e}function me(t){return[t[0],t[1]]}function xe(t){return[t[2],t[1]]}function be(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function we(t,e){var r;return e===Vt?r=me(t):e===Xt?r=xe(t):e===Wt?r=Te(t):e===qt?r=Re(t):it(!1,13),r}function Se(t,e,r,n,i){var o=e*n[0]/2,a=e*n[1]/2,s=Math.cos(r),l=Math.sin(r),u=o*s,h=o*l,c=a*s,p=a*l,f=t[0],d=t[1],g=f-u+p,y=f-u-p,v=f+u-p,_=f+u+p,m=d-h-c,x=d-h+c,b=d+h+c,w=d+h-c;return le(Math.min(g,y,v,_),Math.min(m,x,b,w),Math.max(g,y,v,_),Math.max(m,x,b,w),i)}function Ce(t){return t[3]-t[1]}function Ee(t,e,r){var n=r||[1/0,1/0,-1/0,-1/0];return Oe(t,e)?(t[0]>e[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]<e[2]?n[2]=t[2]:n[2]=e[2],t[3]<e[3]?n[3]=t[3]:n[3]=e[3]):ue(n),n}function Te(t){return[t[0],t[3]]}function Re(t){return[t[2],t[3]]}function Pe(t){return t[2]-t[0]}function Oe(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Fe(t){return t[2]<t[0]||t[3]<t[1]}function Ie(t,e,r,n){var i=[];if(n>1)for(var o=t[2]-t[0],a=t[3]-t[1],s=0;s<n;++s)i.push(t[0]+o*s/n,t[1],t[2],t[1]+a*s/n,t[2]-o*s/n,t[3],t[0],t[3]-a*s/n);else i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(i,i,2);for(var l=[],u=[],h=(s=0,i.length);s<h;s+=2)l.push(i[s]),u.push(i[s+1]);return function(t,e,r){return le(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}(l,u,r)}var Me=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_||wt[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function Ae(t,e,r){return Math.min(Math.max(t,e),r)}var Le="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},ke="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function De(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 je(t,e,r,n)}function je(t,e,r,n){var i=r-t,o=n-e;return i*i+o*o}function ze(t){return 180*t/Math.PI}function Ge(t){return t*Math.PI/180}function Ne(t,e){var r=t%e;return r*e<0?r+e:r}function Ue(t,e,r){return t+r*(e-t)}function Be(t,e){var r=Math.pow(10,e);return Math.round(t*r)/r}function Ve(t,e){return Math.round(Be(t,e))}function Xe(t,e){return Math.floor(Be(t,e))}function We(t,e){return Math.ceil(Be(t,e))}var qe=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)}}(),Ye=6378137,Ke=Math.PI*Ye,Ze=[-Ke,-Ke,Ke,Ke],He=[-180,-85,180,85],Je=Ye*Math.log(Math.tan(Math.PI/2)),Qe=function(t){function e(e){return t.call(this,{code:e,units:Ct.METERS,extent:Ze,global:!0,worldExtent:He,getPointResolution:function(t,e){return t/Le(e[1]/Ye)}})||this}return qe(e,t),e}(Me),$e=[new Qe("EPSG:3857"),new Qe("EPSG:102100"),new Qe("EPSG:102113"),new Qe("EPSG:900913"),new Qe("http://www.opengis.net/def/crs/EPSG/0/3857"),new Qe("http://www.opengis.net/gml/srs/epsg.xml#3857")];function tr(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;a<n;a+=i){o[a]=Ke*t[a]/180;var s=Ye*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));s>Je?s=Je:s<-Je&&(s=-Je),o[a+1]=s}return o}function er(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;a<n;a+=i)o[a]=180*t[a]/Ke,o[a+1]=360*Math.atan(Math.exp(t[a+1]/Ye))/Math.PI-90;return o}var rr=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)}}(),nr=[-180,-90,180,90],ir=6378137*Math.PI/180,or=function(t){function e(e,r){return t.call(this,{code:e,units:Ct.DEGREES,extent:nr,axisOrientation:r,global:!0,metersPerUnit:ir,worldExtent:nr})||this}return rr(e,t),e}(Me),ar=[new or("CRS:84"),new or("EPSG:4326","neu"),new or("urn:ogc:def:crs:OGC:1.3:CRS84"),new or("urn:ogc:def:crs:OGC:2:84"),new or("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new or("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new or("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],sr={};var lr={};function ur(t,e,r){var n=t.getCode(),i=e.getCode();n in lr||(lr[n]={}),lr[n][i]=r}function hr(t,e){for(var r=(""+t).split("."),n=(""+e).split("."),i=0;i<Math.max(r.length,n.length);i++){var o=parseInt(r[i]||"0",10),a=parseInt(n[i]||"0",10);if(o>a)return 1;if(a>o)return-1}return 0}function cr(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 pr(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 fr(t,e){for(var r=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){r=!1;break}return r}function dr(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 gr(t,e){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function yr(t,e){return Math.sqrt(gr(t,e))}function vr(t,e){return gr(t,pr(t,e))}function _r(t,e){if(e.canWrapX()){var r=Pe(e.getExtent()),n=function(t,e,r){var n=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]<n[0]||t[0]>n[2])){var o=r||Pe(n);i=Math.floor((t[0]-n[0])/o)}return i}(t,e,r);n&&(t[0]-=n*r)}return t}var mr=6371008.8;function xr(t,e,r){var n=r||mr,i=Ge(t[1]),o=Ge(e[1]),a=(o-i)/2,s=Ge(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 br(t,e){for(var r=0,n=0,i=t.length;n<i-1;++n)r+=xr(t[n],t[n+1],e);return r}function wr(t,e){for(var r=0,n=t.length,i=t[n-1][0],o=t[n-1][1],a=0;a<n;a++){var s=t[a][0],l=t[a][1];r+=Ge(s-i)*(2+Math.sin(Ge(o))+Math.sin(Ge(l))),i=s,o=l}return r*e*e/2}var Sr=Object.freeze({__proto__:null,DEFAULT_RADIUS:mr,getDistance:xr,getLength:function t(e,r){var n=r||{},i=n.radius||mr,o=n.projection||"EPSG:3857",a=e.getType();a!==mt&&(e=e.clone().transform(o,"EPSG:4326"));var s,l,u,h,c,p,f=0;switch(a){case pt:case yt:break;case ft:case dt:f=br(s=e.getCoordinates(),i);break;case vt:case gt:for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)f+=br(s[u],i);break;case _t:for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)for(c=0,p=(l=s[u]).length;c<p;++c)f+=br(l[c],i);break;case mt:var d=e.getGeometries();for(u=0,h=d.length;u<h;++u)f+=t(d[u],r);break;default:throw new Error("Unsupported geometry type: "+a)}return f},getArea:function t(e,r){var n=r||{},i=n.radius||mr,o=n.projection||"EPSG:3857",a=e.getType();a!==mt&&(e=e.clone().transform(o,"EPSG:4326"));var s,l,u,h,c,p,f=0;switch(a){case pt:case yt:case ft:case vt:case dt:break;case gt:for(s=e.getCoordinates(),f=Math.abs(wr(s[0],i)),u=1,h=s.length;u<h;++u)f-=Math.abs(wr(s[u],i));break;case _t:for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)for(l=s[u],f+=Math.abs(wr(l[0],i)),c=1,p=l.length;c<p;++c)f-=Math.abs(wr(l[c],i));break;case mt:var d=e.getGeometries();for(u=0,h=d.length;u<h;++u)f+=t(d[u],r);break;default:throw new Error("Unsupported geometry type: "+a)}return f},offset:function(t,e,r,n){var i=n||mr,o=Ge(t[1]),a=Ge(t[0]),s=e/i,l=Math.asin(Math.sin(o)*Math.cos(s)+Math.cos(o)*Math.sin(s)*Math.cos(r));return[ze(a+Math.atan2(Math.sin(r)*Math.sin(s)*Math.cos(o),Math.cos(s)-Math.sin(o)*Math.sin(l))),ze(l)]}}),Cr=!0;function Er(t){Cr=!(void 0===t||t)}function Tr(t,e,r){var n;if(void 0!==e){for(var i=0,o=t.length;i<o;++i)e[i]=t[i];n=e}else n=t.slice();return n}function Rr(t,e,r){if(void 0!==e&&t!==e){for(var n=0,i=t.length;n<i;++n)e[n]=t[n];t=e}return t}function Pr(t){!function(t,e){sr[t]=e}(t.getCode(),t),ur(t,t,Tr)}function Or(t){return"string"==typeof t?sr[e=t]||sr[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function Fr(t,e,r,n){var i,o=(t=Or(t)).getPointResolutionFunc();if(o){if(i=o(e,r),n&&n!==t.getUnits())(s=t.getMetersPerUnit())&&(i=i*s/wt[n])}else{var a=t.getUnits();if(a==Ct.DEGREES&&!n||n==Ct.DEGREES)i=e;else{var s,l=kr(t,Or("EPSG:4326"));if(l===Rr&&a!==Ct.DEGREES)i=e*t.getMetersPerUnit();else{var u=[r[0]-e/2,r[1],r[0]+e/2,r[1],r[0],r[1]-e/2,r[0],r[1]+e/2];i=(xr((u=l(u,u,2)).slice(0,2),u.slice(2,4))+xr(u.slice(4,6),u.slice(6,8)))/2}void 0!==(s=n?wt[n]:t.getMetersPerUnit())&&(i/=s)}}return i}function Ir(t){!function(t){t.forEach(Pr)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&ur(e,t,Tr)}))}))}function Mr(t,e){return t?"string"==typeof t?Or(t):t:Or(e)}function Ar(t,e){return Er(),jr(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function Lr(t,e){if(t===e)return!0;var r=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||kr(t,e)===Tr)&&r}function kr(t,e){var r=function(t,e){var r;return t in lr&&e in lr[t]&&(r=lr[t][e]),r}(t.getCode(),e.getCode());return r||(r=Rr),r}function Dr(t,e){return kr(Or(t),Or(e))}function jr(t,e,r){return Dr(e,r)(t,void 0,t.length)}var zr,Gr,Nr;function Ur(t,e){return t}function Br(t,e){return Cr&&!fr(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(Cr=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function Vr(t,e){return t}function Xr(t,e){return t}function Wr(t,e,r,n,i,o){for(var a=o||[],s=0,l=e;l<r;l+=n){var u=t[l],h=t[l+1];a[s++]=i[0]*u+i[2]*h+i[4],a[s++]=i[1]*u+i[3]*h+i[5]}return o&&a.length!=s&&(a.length=s),a}function qr(t,e,r,n,i,o,a){for(var s=a||[],l=Math.cos(i),u=Math.sin(i),h=o[0],c=o[1],p=0,f=e;f<r;f+=n){var d=t[f]-h,g=t[f+1]-c;s[p++]=h+d*l-g*u,s[p++]=c+d*u+g*l;for(var y=f+2;y<f+n;++y)s[p++]=t[y]}return a&&s.length!=p&&(s.length=p),s}function Yr(t,e,r,n,i,o,a){for(var s=a||[],l=0,u=e;u<r;u+=n){s[l++]=t[u]+i,s[l++]=t[u+1]+o;for(var h=u+2;h<u+n;++h)s[l++]=t[h]}return a&&s.length!=l&&(s.length=l),s}Ir($e),Ir(ar),zr=$e,Gr=tr,Nr=er,ar.forEach((function(t){zr.forEach((function(e){ur(t,e,Gr),ur(e,t,Nr)}))}));var 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)}}(),Zr=[1,0,0,1,0,0],Hr=function(t){function r(){var e,r,n,i,o,a=t.call(this)||this;return a.extent_=[1/0,1/0,-1/0,-1/0],a.extentRevision_=-1,a.simplifiedGeometryMaxMinSquaredTolerance=0,a.simplifiedGeometryRevision=0,a.simplifyTransformedInternal=(e=function(t,e,r){if(!r)return this.getSimplifiedGeometry(e);var n=this.clone();return n.applyTransform(r),n.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===i&&g(t,n)||(o=!0,i=this,n=t,r=e.apply(this,arguments)),r}),a}return Kr(r,t),r.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},r.prototype.clone=function(){return e()},r.prototype.closestPointXY=function(t,r,n,i){return e()},r.prototype.containsXY=function(t,e){var r=this.getClosestPoint([t,e]);return r[0]===t&&r[1]===e},r.prototype.getClosestPoint=function(t,e){var r=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],r,1/0),r},r.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},r.prototype.computeExtent=function(t){return e()},r.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&ue(e),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},r.prototype.rotate=function(t,r){e()},r.prototype.scale=function(t,r,n){e()},r.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},r.prototype.getSimplifiedGeometry=function(t){return e()},r.prototype.getType=function(){return e()},r.prototype.applyTransform=function(t){e()},r.prototype.intersectsExtent=function(t){return e()},r.prototype.translate=function(t,r){e()},r.prototype.transform=function(t,e){var r=Or(t),n=r.getUnits()==Ct.TILE_PIXELS?function(t,n,i){var o=r.getExtent(),a=r.getWorldExtent(),s=Ce(a)/Ce(o);return Nt(Zr,a[0],a[3],s,-s,0,0,0),Wr(t,0,t.length,i,Zr,n),Dr(r,e)(t,n,i)}:Dr(r,e);return this.applyTransform(n),this},r}(H),Jr=Hr,Qr=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)}}(),$r=function(t){function r(){var e=t.call(this)||this;return e.layout=lt,e.stride=2,e.flatCoordinates=null,e}return Qr(r,t),r.prototype.computeExtent=function(t){return ce(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},r.prototype.getCoordinates=function(){return e()},r.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},r.prototype.getFlatCoordinates=function(){return this.flatCoordinates},r.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},r.prototype.getLayout=function(){return this.layout},r.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},r.prototype.getSimplifiedGeometryInternal=function(t){return this},r.prototype.getStride=function(){return this.stride},r.prototype.setFlatCoordinates=function(t,e){this.stride=tn(t),this.layout=t,this.flatCoordinates=e},r.prototype.setCoordinates=function(t,r){e()},r.prototype.setLayout=function(t,e,r){var n;if(t)n=tn(t);else{for(var i=0;i<r;++i){if(0===e.length)return this.layout=lt,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=lt:3==t?e=ut:4==t&&(e=ct);return e}(n=e.length)}this.layout=t,this.stride=n},r.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},r.prototype.rotate=function(t,e){var r=this.getFlatCoordinates();if(r){var n=this.getStride();qr(r,0,r.length,n,t,e,r),this.changed()}},r.prototype.scale=function(t,e,r){var n=e;void 0===n&&(n=t);var i=r;i||(i=be(this.getExtent()));var o=this.getFlatCoordinates();if(o){var a=this.getStride();!function(t,e,r,n,i,o,a,s){for(var l=s||[],u=a[0],h=a[1],c=0,p=e;p<r;p+=n){var f=t[p]-u,d=t[p+1]-h;l[c++]=u+i*f,l[c++]=h+o*d;for(var g=p+2;g<p+n;++g)l[c++]=t[g]}s&&l.length!=c&&(l.length=c)}(o,0,o.length,a,t,n,i,o),this.changed()}},r.prototype.translate=function(t,e){var r=this.getFlatCoordinates();if(r){var n=this.getStride();Yr(r,0,r.length,n,t,e,r),this.changed()}},r}(Jr);function tn(t){var e;return t==lt?e=2:t==ut||t==ht?e=3:t==ct&&(e=4),e}var en=$r;function rn(t,e,r,n,i,o,a){var s,l=t[e],u=t[e+1],h=t[r]-l,c=t[r+1]-u;if(0===h&&0===c)s=e;else{var p=((i-l)*h+(o-u)*c)/(h*h+c*c);if(p>1)s=r;else{if(p>0){for(var f=0;f<n;++f)a[f]=Ue(t[e+f],t[r+f],p);return void(a.length=n)}s=e}}for(f=0;f<n;++f)a[f]=t[s+f];a.length=n}function nn(t,e,r,n,i){var o=t[e],a=t[e+1];for(e+=n;e<r;e+=n){var s=t[e],l=t[e+1],u=je(o,a,s,l);u>i&&(i=u),o=s,a=l}return i}function on(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];i=nn(t,e,s,n,i),e=s}return i}function an(t,e,r,n,i,o,a,s,l,u,h){if(e==r)return u;var c,p;if(0===i){if((p=je(a,s,t[e],t[e+1]))<u){for(c=0;c<n;++c)l[c]=t[e+c];return l.length=n,p}return u}for(var f=h||[NaN,NaN],d=e+n;d<r;)if(rn(t,d-n,d,n,a,s,f),(p=je(a,s,f[0],f[1]))<u){for(u=p,c=0;c<n;++c)l[c]=f[c];l.length=n,d+=n}else d+=n*Math.max((Math.sqrt(p)-Math.sqrt(u))/i|0,1);if(o&&(rn(t,r-n,e,n,a,s,f),(p=je(a,s,f[0],f[1]))<u)){for(u=p,c=0;c<n;++c)l[c]=f[c];l.length=n}return u}function sn(t,e,r,n,i,o,a,s,l,u,h){for(var c=h||[NaN,NaN],p=0,f=r.length;p<f;++p){var d=r[p];u=an(t,e,d,n,i,o,a,s,l,u,c),e=d}return u}function ln(t,e,r,n){for(var i=0,o=r.length;i<o;++i)t[e++]=r[i];return e}function un(t,e,r,n){for(var i=0,o=r.length;i<o;++i)for(var a=r[i],s=0;s<n;++s)t[e++]=a[s];return e}function hn(t,e,r,n,i){for(var o=i||[],a=0,s=0,l=r.length;s<l;++s){var u=un(t,e,r[s],n);o[a++]=u,e=u}return o.length=a,o}function cn(t,e,r,n,i,o,a){var s=(r-e)/n;if(s<3){for(;e<r;e+=n)o[a++]=t[e],o[a++]=t[e+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[e,r-n],h=0;u.length>0;){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;_<c;_+=n){var m=De(t[_],t[_+1],d,g,y,v);m>f&&(h=_,f=m)}f>i&&(l[(h-e)/n]=1,p+n<h&&u.push(p,h),h+n<c&&u.push(h,c))}for(_=0;_<s;++_)l[_]&&(o[a++]=t[e+_*n],o[a++]=t[e+_*n+1]);return a}function pn(t,e){return e*Math.round(t/e)}function fn(t,e,r,n,i,o,a){if(e==r)return a;var s,l,u=pn(t[e],i),h=pn(t[e+1],i);e+=n,o[a++]=u,o[a++]=h;do{if(s=pn(t[e],i),l=pn(t[e+1],i),(e+=n)==r)return o[a++]=s,o[a++]=l,a}while(s==u&&l==h);for(;e<r;){var c=pn(t[e],i),p=pn(t[e+1],i);if(e+=n,c!=s||p!=l){var f=s-u,d=l-h,g=c-u,y=p-h;f*y==d*g&&(f<0&&g<f||f==g||f>0&&g>f)&&(d<0&&y<d||d==y||d>0&&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 dn(t,e,r,n,i,o,a,s){for(var l=0,u=r.length;l<u;++l){var h=r[l];a=fn(t,e,h,n,i,o,a),s.push(a),e=h}return a}function gn(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=e;s<r;s+=n)o[a++]=t.slice(s,s+n);return o.length=a,o}function yn(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=0,l=r.length;s<l;++s){var u=r[s];o[a++]=gn(t,e,u,n,o[a]),e=u}return o.length=a,o}function vn(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=0,l=r.length;s<l;++s){var u=r[s];o[a++]=yn(t,e,u,n,o[a]),e=u[u.length-1]}return o.length=a,o}function _n(t,e,r,n){for(var i=0,o=t[r-n],a=t[r-n+1];e<r;e+=n){var s=t[e],l=t[e+1];i+=a*s-o*l,o=s,a=l}return i/2}function mn(t,e,r,n){for(var i=0,o=0,a=r.length;o<a;++o){var s=r[o];i+=_n(t,e,s,n),e=s}return i}var xn=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)}}(),bn=function(t){function e(e,r){var n=t.call(this)||this;return n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?n.setCoordinates(e,r):n.setFlatCoordinates(r,e),n}return xn(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,n){return n<re(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(nn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),an(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.getArea=function(){return _n(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return gn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=cn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,lt)},e.prototype.getType=function(){return dt},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=un(this.flatCoordinates,0,t,this.stride),this.changed()},e}(en),wn=bn,Sn=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)}}(),Cn=function(t){function e(e,r){var n=t.call(this)||this;return n.setCoordinates(e,r),n}return Sn(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=je(t,e,i[0],i[1]);if(o<n){for(var a=this.stride,s=0;s<a;++s)r[s]=i[s];return r.length=a,o}return n},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return he(this.flatCoordinates,t)},e.prototype.getType=function(){return pt},e.prototype.intersectsExtent=function(t){return oe(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ln(this.flatCoordinates,0,t,this.stride),this.changed()},e}(en),En=Cn;function Tn(t,e,r,n,i){return!ve(i,(function(i){return!Rn(t,e,r,n,i[0],i[1])}))}function Rn(t,e,r,n,i,o){for(var a=0,s=t[r-n],l=t[r-n+1];e<r;e+=n){var u=t[e],h=t[e+1];l<=o?h>o&&(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 Pn(t,e,r,n,i,o){if(0===r.length)return!1;if(!Rn(t,e,r[0],n,i,o))return!1;for(var a=1,s=r.length;a<s;++a)if(Rn(t,r[a-1],r[a],n,i,o))return!1;return!0}function On(t,e,r,n,i,o,a){for(var s,l,u,c,p,f,d,g=i[o+1],y=[],v=0,_=r.length;v<_;++v){var m=r[v];for(c=t[m-n],f=t[m-n+1],s=e;s<m;s+=n)p=t[s],d=t[s+1],(g<=f&&d<=g||f<=g&&g<=d)&&(u=(g-f)/(d-f)*(p-c)+c,y.push(u)),c=p,f=d}var x=NaN,b=-1/0;for(y.sort(h),c=y[0],s=1,l=y.length;s<l;++s){p=y[s];var w=Math.abs(p-c);w>b&&Pn(t,e,r,n,u=(c+p)/2,g)&&(x=u,b=w),c=p}return isNaN(x)&&(x=i[o]),a?(a.push(x,g,b),a):[x,g,b]}function Fn(t,e,r,n,i){for(var o=[],a=0,s=r.length;a<s;++a){var l=r[a];o=On(t,e,l,n,i,2*a,o),e=l[l.length-1]}return o}function In(t,e,r,n,i){var o;for(e+=n;e<r;e+=n)if(o=i(t.slice(e-n,e),t.slice(e,e+n)))return o;return!1}function Mn(t,e,r,n,i){var o=ge([1/0,1/0,-1/0,-1/0],t,e,r,n);return!!Oe(i,o)&&(!!ie(i,o)||(o[0]>=i[0]&&o[2]<=i[2]||(o[1]>=i[1]&&o[3]<=i[3]||In(t,e,r,n,(function(t,e){return function(t,e,r){var n=!1,i=ae(t,e),o=ae(t,r);if(i===Kt||o===Kt)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&Zt&&!(i&Zt)&&(n=(g=p-(f-u)/d)>=a&&g<=l),n||!(o&Ht)||i&Ht||(n=(y=f-(p-l)*d)>=s&&y<=u),n||!(o&Jt)||i&Jt||(n=(g=p-(f-s)/d)>=a&&g<=l),n||!(o&Qt)||i&Qt||(n=(y=f-(p-a)*d)>=s&&y<=u)}return n}(i,t,e)})))))}function An(t,e,r,n,i){if(!function(t,e,r,n,i){return!!(Mn(t,e,r,n,i)||Rn(t,e,r,n,i[0],i[1])||Rn(t,e,r,n,i[0],i[3])||Rn(t,e,r,n,i[2],i[1])||Rn(t,e,r,n,i[2],i[3]))}(t,e,r[0],n,i))return!1;if(1===r.length)return!0;for(var o=1,a=r.length;o<a;++o)if(Tn(t,r[o-1],r[o],n,i)&&!Mn(t,r[o-1],r[o],n,i))return!1;return!0}function Ln(t,e,r,n){for(;e<r-n;){for(var i=0;i<n;++i){var o=t[e+i];t[e+i]=t[r-n+i],t[r-n+i]=o}e+=n,r-=n}}function kn(t,e,r,n){for(var i=0,o=t[r-n],a=t[r-n+1];e<r;e+=n){var s=t[e],l=t[e+1];i+=(s-o)*(l+a),o=s,a=l}return 0===i?void 0:i>0}function Dn(t,e,r,n,i){for(var o=void 0!==i&&i,a=0,s=r.length;a<s;++a){var l=r[a],u=kn(t,e,l,n);if(0===a){if(o&&u||!o&&!u)return!1}else if(o&&!u||!o&&u)return!1;e=l}return!0}function jn(t,e,r,n,i){for(var o=void 0!==i&&i,a=0,s=r.length;a<s;++a){var l=r[a],u=kn(t,e,l,n);(0===a?o&&u||!o&&!u:o&&!u||!o&&u)&&Ln(t,e,l,n),e=l}return e}function zn(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o)e=jn(t,e,r[o],n,i);return e}var Gn=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)}}(),Nn=function(t){function e(e,r,n){var i=t.call(this)||this;return i.ends_=[],i.flatInteriorPointRevision_=-1,i.flatInteriorPoint_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,void 0!==r&&n?(i.setFlatCoordinates(r,e),i.ends_=n):i.setCoordinates(e,r),i}return Gn(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?d(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){return n<re(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(on(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),sn(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.containsXY=function(t,e){return Pn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return mn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?jn(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,yn(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=be(this.getExtent());this.flatInteriorPoint_=On(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new En(this.getFlatInteriorPoint(),ht)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new wn(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.ends_,n=[],i=0,o=0,a=r.length;o<a;++o){var s=r[o],l=new wn(e.slice(i,s),t);n.push(l),i=s}return n},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Dn(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=jn(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=dn(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),r,0,n),new e(r,lt,n)},e.prototype.getType=function(){return gt},e.prototype.intersectsExtent=function(t){return An(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=hn(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(en),Un=Nn;function Bn(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=[e,r,e,i,n,i,n,r,e,r];return new Nn(o,lt,[o.length])}function Vn(t,e,r){for(var n=e||32,i=t.getStride(),o=t.getLayout(),a=t.getCenter(),s=i*(n+1),l=new Array(s),u=0;u<s;u+=i){l[u]=0,l[u+1]=0;for(var h=2;h<i;h++)l[u+h]=a[h]}var c=[l.length],p=new Nn(l,o,c);return function(t,e,r,n){for(var i=t.getFlatCoordinates(),o=t.getStride(),a=i.length/o-1,s=n||0,l=0;l<=a;++l){var u=l*o,h=s+2*Ne(l,a)*Math.PI/a;i[u]=e[0]+r*Math.cos(h),i[u+1]=e[1]+r*Math.sin(h)}t.changed()}(p,a,t.getRadius(),r),p}var Xn="prerender",Wn="postrender",qn="precompose",Yn="postcompose",Kn="rendercomplete",Zn=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),Hn=Zn;function Jn(t,e,r,n,i,o,a){var s,l,u=(r-e)/n;if(1===u)s=e;else if(2===u)s=e,l=i;else if(0!==u){for(var c=t[e],p=t[e+1],f=0,d=[0],g=e+n;g<r;g+=n){var y=t[g],v=t[g+1];f+=Math.sqrt((y-c)*(y-c)+(v-p)*(v-p)),d.push(f),c=y,p=v}var _=i*f,m=function(t,e,r){for(var n,i,o=r||h,a=0,s=t.length,l=!1;a<s;)(i=+o(t[n=a+(s-a>>1)],e))<0?a=n+1:(s=n,l=!i);return l?a:~a}(d,_);m<0?(l=(_-d[-m-2])/(d[-m-1]-d[-m-2]),s=e+(-m-2)*n):s=e+m*n}var x=a>1?a:2,b=o||new Array(x);for(g=0;g<x;++g)b[g]=void 0===s?NaN:void 0===l?t[s+g]:Ue(t[s+g],t[s+n+g],l);return b}function Qn(t,e,r,n,i,o){if(r==e)return null;var a;if(i<t[e+n-1])return o?((a=t.slice(e,e+n))[n-1]=i,a):null;if(t[r-1]<i)return o?((a=t.slice(r-n,r))[n-1]=i,a):null;if(i==t[e+n-1])return t.slice(e,e+n);for(var s=e/n,l=r/n;s<l;){var u=s+l>>1;i<t[(u+1)*n-1]?l=u:s=u+1}var h=t[s*n-1];if(i==h)return t.slice((s-1)*n,(s-1)*n+n);var c=(i-h)/(t[(s+1)*n-1]-h);a=[];for(var p=0;p<n-1;++p)a.push(Ue(t[(s-1)*n+p],t[s*n+p],c));return a.push(i),a}function $n(t,e,r,n){for(var i=t[e],o=t[e+1],a=0,s=e+n;s<r;s+=n){var l=t[s],u=t[s+1];a+=Math.sqrt((l-i)*(l-i)+(u-o)*(u-o)),i=l,o=u}return a}var ti=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)}}(),ei=function(t){function e(e,r){var n=t.call(this)||this;return n.flatMidpoint_=null,n.flatMidpointRevision_=-1,n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?n.setCoordinates(e,r):n.setFlatCoordinates(r,e),n}return ti(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?d(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){return n<re(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(nn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),an(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,r,n))},e.prototype.forEachSegment=function(t){return In(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=ht&&this.layout!=ct)return null;var r=void 0!==e&&e;return Qn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r)},e.prototype.getCoordinates=function(){return gn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return Jn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return $n(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=cn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,lt)},e.prototype.getType=function(){return ft},e.prototype.intersectsExtent=function(t){return Mn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=un(this.flatCoordinates,0,t,this.stride),this.changed()},e}(en),ri=ei,ni=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}(),ii=ni,oi=0,ai=1,si=2,li=3,ui=4;function hi(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]+2*e,r[1]=t[1]+2*e,r}function ci(t){return t[0]>0&&t[1]>0}function pi(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 fi(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var di=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=fi(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return e()},t.prototype.getImage=function(t){return e()},t.prototype.getHitDetectionImage=function(){return e()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return e()},t.prototype.getImageSize=function(){return e()},t.prototype.getOrigin=function(){return e()},t.prototype.getSize=function(){return e()},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_=fi(t)},t.prototype.listenImageChange=function(t){e()},t.prototype.load=function(){e()},t.prototype.unlistenImageChange=function(t){e()},t}(),gi=di,yi=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,vi=/^([a-z]*)$|^hsla?\(.*\)$/i;function _i(t){return"string"==typeof t?t:Si(t)}function mi(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 xi=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;vi.exec(t)&&(t=mi(t));if(yi.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(")?wi(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),wi(o)):it(!1,14);return o}(r),t[r]=n,++e}return n}}();function bi(t){return Array.isArray(t)?t:xi(t)}function wi(t){return t[0]=Ae(t[0]+.5|0,0,255),t[1]=Ae(t[1]+.5|0,0,255),t[2]=Ae(t[2]+.5|0,0,255),t[3]=Ae(t[3],0,1),t}function Si(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 Ci(t){return Array.isArray(t)?Si(t):t}function Ei(t,e,r,n){var i;return i=r&&r.length?r.shift():It?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",n)}function Ti(t,e){var r=e.parentNode;r&&r.replaceChild(t,e)}function Ri(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var Pi="ol-hidden",Oi="ol-unselectable",Fi="ol-control",Ii="ol-collapsed",Mi=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),Ai=["style","variant","weight","size","lineHeight","family"],Li=function(t){var e=t.match(Mi);if(!e)return null;for(var r={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,i=Ai.length;n<i;++n){var o=e[n+1];void 0!==o&&(r[Ai[n]]=o)}return r.families=r.family.split(/,\s?/),r};function ki(t){return 1===t?"":String(Math.round(100*t)/100)}var Di="10px sans-serif",ji="#000",zi="round",Gi=[],Ni="round",Ui="#000",Bi="center",Vi="middle",Xi=[0,0,0,0],Wi=new H;(new C).setSize=function(){console.warn("labelCache is deprecated.")};var qi,Yi,Ki=null,Zi={},Hi=function(){var t,e,r="32px ",n=["monospace","serif"],i=n.length,o="wmytzilWMYTZIL@#/&?$%10";function a(t,a,s){for(var l=!0,u=0;u<i;++u){var h=n[u];if(e=$i(t+" "+a+" "+r+h,o),s!=h){var c=$i(t+" "+a+" "+r+s+","+h,o);l=l&&c!=e}}return!!l}function s(){for(var e=!0,r=Wi.getKeys(),n=0,i=r.length;n<i;++n){var o=r[n];Wi.get(o)<100&&(a.apply(this,o.split("\n"))?(x(Zi),Ki=null,qi=void 0,Wi.set(o,100)):(Wi.set(o,Wi.get(o)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var r=Li(e);if(r)for(var n=r.families,i=0,o=n.length;i<o;++i){var l=n[i],u=r.style+"\n"+r.weight+"\n"+l;void 0===Wi.get(u)&&(Wi.set(u,100,!0),a(r.style,r.weight,l)||(Wi.set(u,0,!0),void 0===t&&(t=setInterval(s,32))))}}}(),Ji=function(t){var e=Zi[t];if(null==e){if(It){var r=Li(t),n=Qi(t,"Žg");e=(isNaN(Number(r.lineHeight))?1.2:Number(r.lineHeight))*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else Yi||((Yi=document.createElement("div")).innerHTML="M",Yi.style.minHeight="0",Yi.style.maxHeight="none",Yi.style.height="auto",Yi.style.padding="0",Yi.style.border="none",Yi.style.position="absolute",Yi.style.display="block",Yi.style.left="-99999px"),Yi.style.font=t,document.body.appendChild(Yi),e=Yi.offsetHeight,document.body.removeChild(Yi);Zi[t]=e}return e};function Qi(t,e){return Ki||(Ki=Ei(1,1)),t!=qi&&(Ki.font=t,qi=Ki.font),Ki.measureText(e)}function $i(t,e){return Qi(t,e).width}function to(t,e,r){if(e in r)return r[e];var n=$i(t,e);return r[e]=n,n}function eo(t,e,r,n,i,o,a,s,l,u,h){t.save(),1!==r&&(t.globalAlpha*=r),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,u),t.scale(h[0],h[1]),function(t,e){for(var r=t.contextInstructions,n=0,i=r.length;n<i;n+=2)Array.isArray(r[n+1])?e[r[n]].apply(e,r[n+1]):e[r[n]]=r[n+1]}(n,t)):h[0]<0||h[1]<0?(t.translate(l,u),t.scale(h[0],h[1]),t.drawImage(n,i,o,a,s,0,0,a,s)):t.drawImage(n,i,o,a,s,l,u,a*h[0],s*h[1]),t.restore()}var ro=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)}}(),no=function(t){function e(e){var r=this,n=void 0!==e.rotateWithView&&e.rotateWithView;return(r=t.call(this,{opacity:1,rotateWithView:n,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_=void 0,r.hitDetectionCanvas_=null,r.fill_=void 0!==e.fill?e.fill:null,r.origin_=[0,0],r.points_=e.points,r.radius_=void 0!==e.radius?e.radius:e.radius1,r.radius2_=e.radius2,r.angle_=void 0!==e.angle?e.angle:0,r.stroke_=void 0!==e.stroke?e.stroke:null,r.size_=null,r.renderOptions_=null,r.render(),r}return ro(e,t),e.prototype.clone=function(){var t=this.getScale(),r=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return r.setOpacity(this.getOpacity()),r},e.prototype.getAnchor=function(){var t=this.size_;if(!t)return null;var e=this.getDisplacement();return[t[0]/2-e[0],t[1]/2+e[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var r=this.renderOptions_,n=Ei(r.size*t,r.size*t);this.draw_(r,n,t),e=n.canvas,this.canvas_[t]=e}return e},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return si},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,r){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var n=this.radius_,i=void 0===this.radius2_?n:this.radius2_;if(n<i){var o=n;n=i,i=o}var a=void 0===this.radius2_?this.points_:2*this.points_,s=2*Math.PI/a,l=i*Math.sin(s),u=n-Math.sqrt(i*i-l*l),h=Math.sqrt(l*l+u*u),c=h/l;if("miter"===t&&c<=r)return c*e;var p=e/2/c,f=e/2*(u/h),d=Math.sqrt((n+p)*(n+p)+f*f)-n;if(void 0===this.radius2_||"bevel"===t)return 2*d;var g=n*Math.sin(s),y=i-Math.sqrt(n*n-g*g),v=Math.sqrt(g*g+y*y)/g;if(v<=r){var _=v*e/2-i-n;return 2*Math.max(d,_)}return 2*d},e.prototype.createRenderOptions=function(){var t,e=Ni,r=0,n=null,i=0,o=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Ui),t=Ci(t),void 0===(o=this.stroke_.getWidth())&&(o=1),n=this.stroke_.getLineDash(),i=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=Ni),void 0===(r=this.stroke_.getMiterLimit())&&(r=10));var a=this.calculateLineJoinSize_(e,o,r),s=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*s+a),lineDash:n,lineDashOffset:i,lineJoin:e,miterLimit:r}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},e.prototype.draw_=function(t,e,r){if(e.scale(r,r),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var n=this.fill_.getColor();null===n&&(n=ji),e.fillStyle=Ci(n),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),r=0;if("string"==typeof e&&(e=bi(e)),null===e?r=1:Array.isArray(e)&&(r=4===e.length?e[3]:1),0===r){var n=Ei(t.size,t.size);this.hitDetectionCanvas_=n.canvas,this.drawHitDetectionCanvas_(t,n)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,r=this.radius_;if(e===1/0)t.arc(0,0,r,0,2*Math.PI);else{var n=void 0===this.radius2_?r:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var i=this.angle_-Math.PI/2,o=2*Math.PI/e,a=0;a<e;a++){var s=i+a*o,l=a%2==0?r:n;t.lineTo(l*Math.cos(s),l*Math.sin(s))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=ji,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e}(gi),io=no,oo=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)}}(),ao=function(t){function e(e){var r=e||{};return t.call(this,{points:1/0,fill:r.fill,radius:r.radius,stroke:r.stroke,scale:void 0!==r.scale?r.scale:1,rotation:void 0!==r.rotation?r.rotation:0,rotateWithView:void 0!==r.rotateWithView&&r.rotateWithView,displacement:void 0!==r.displacement?r.displacement:[0,0]})||this}return oo(e,t),e.prototype.clone=function(){var t=this.getScale(),r=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return r.setOpacity(this.getOpacity()),r},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(io),so=ao,lo=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=po,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=po,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var uo=null;function ho(t,e){if(!uo){var r=new Hn({color:"rgba(255,255,255,0.4)"}),n=new ii({color:"#3399CC",width:1.25});uo=[new lo({image:new so({fill:r,stroke:n,radius:5}),fill:r,stroke:n})]}return uo}function co(){var t={},e=[255,255,255,1],r=[0,153,255,1];return t[gt]=[new lo({fill:new Hn({color:[255,255,255,.5]})})],t[_t]=t[gt],t[ft]=[new lo({stroke:new ii({color:e,width:5})}),new lo({stroke:new ii({color:r,width:3})})],t[vt]=t[ft],t[xt]=t[gt].concat(t[ft]),t[pt]=[new lo({image:new so({radius:6,fill:new Hn({color:r}),stroke:new ii({color:e,width:1.5})}),zIndex:1/0})],t[yt]=t[pt],t[mt]=t[gt].concat(t[ft],t[pt]),t}function po(t){return t.getGeometry()}var fo=lo,go="point",yo="line",vo=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=fi(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Hn({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:go,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=fi(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),_o=vo,mo="opacity",xo="visible",bo="extent",wo="zIndex",So="maxResolution",Co="minResolution",Eo="maxZoom",To="minZoom",Ro="source",Po="map",Oo=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)}}(),Fo=function(t){function r(e){var r=t.call(this)||this;r.on,r.once,r.un,r.background_=e.background;var n=m({},e);return"object"==typeof e.properties&&(delete n.properties,m(n,e.properties)),n[mo]=void 0!==e.opacity?e.opacity:1,it("number"==typeof n[mo],64),n[xo]=void 0===e.visible||e.visible,n[wo]=e.zIndex,n[So]=void 0!==e.maxResolution?e.maxResolution:1/0,n[Co]=void 0!==e.minResolution?e.minResolution:0,n[To]=void 0!==e.minZoom?e.minZoom:-1/0,n[Eo]=void 0!==e.maxZoom?e.maxZoom:1/0,r.className_=void 0!==n.className?n.className:"ol-layer",delete n.className,r.setProperties(n),r.state_=null,r}return Oo(r,t),r.prototype.getBackground=function(){return this.background_},r.prototype.getClassName=function(){return this.className_},r.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},r=this.getZIndex();return e.opacity=Ae(Math.round(100*this.getOpacity())/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==r||e.managed?r:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},r.prototype.getLayersArray=function(t){return e()},r.prototype.getLayerStatesArray=function(t){return e()},r.prototype.getExtent=function(){return this.get(bo)},r.prototype.getMaxResolution=function(){return this.get(So)},r.prototype.getMinResolution=function(){return this.get(Co)},r.prototype.getMinZoom=function(){return this.get(To)},r.prototype.getMaxZoom=function(){return this.get(Eo)},r.prototype.getOpacity=function(){return this.get(mo)},r.prototype.getSourceState=function(){return e()},r.prototype.getVisible=function(){return this.get(xo)},r.prototype.getZIndex=function(){return this.get(wo)},r.prototype.setBackground=function(t){this.background_=t,this.changed()},r.prototype.setExtent=function(t){this.set(bo,t)},r.prototype.setMaxResolution=function(t){this.set(So,t)},r.prototype.setMinResolution=function(t){this.set(Co,t)},r.prototype.setMaxZoom=function(t){this.set(Eo,t)},r.prototype.setMinZoom=function(t){this.set(To,t)},r.prototype.setOpacity=function(t){it("number"==typeof t,64),this.set(mo,t)},r.prototype.setVisible=function(t){this.set(xo,t)},r.prototype.setZIndex=function(t){this.set(wo,t)},r.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},r}(H),Io="undefined",Mo="loading",Ao="ready",Lo="error",ko=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)}}(),Do=function(t){function e(e){var r=this,n=m({},e);delete n.source,(r=t.call(this,n)||this).on,r.once,r.un,r.mapPrecomposeKey_=null,r.mapRenderKey_=null,r.sourceChangeKey_=null,r.renderer_=null,r.rendered=!1,e.render&&(r.render=e.render),e.map&&r.setMap(e.map),r.addChangeListener(Ro,r.handleSourcePropertyChange_);var i=e.source?e.source:null;return r.setSource(i),r}return ko(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Ro)||null},e.prototype.getRenderSource=function(){return this.getSource()},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Io},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(U(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=G(t,E,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise((function(t){return t([])}))},e.prototype.getData=function(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null},e.prototype.render=function(t,e){var r=this.getRenderer();if(r.prepareFrame(t))return this.rendered=!0,r.renderFrame(t,e)},e.prototype.unrender=function(){this.rendered=!1},e.prototype.setMapInternal=function(t){t||this.unrender(),this.set(Po,t)},e.prototype.getMapInternal=function(){return this.get(Po)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(U(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(U(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=G(t,qn,(function(t){var e=t.frameState.layerStatesArray,r=this.getLayerState(!1);it(!e.some((function(t){return t.layer===r.layer})),67),e.push(r)}),this),this.mapRenderKey_=G(this,E,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Ro,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Fo);function jo(t,e){if(!t.visible)return!1;var r=e.resolution;if(r<t.minResolution||r>=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}var zo=Do;function Go(t,e,r,n,i){No(t,e,r||0,n||t.length-1,i||Bo)}function No(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);No(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(Uo(t,r,e),i(t[n],h)>0&&Uo(t,r,n);c<p;){for(Uo(t,c,p),c++,p--;i(t[c],h)<0;)c++;for(;i(t[p],h)>0;)p--}0===i(t[r],h)?Uo(t,r,p):Uo(t,++p,n),p<=e&&(r=p+1),e<=p&&(n=p-1)}}function Uo(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Bo(t,e){return t<e?-1:t>e?1:0}class Vo{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(!ta(t,e))return r;const n=this.toBBox,i=[];for(;e;){for(let o=0;o<e.children.length;o++){const a=e.children[o],s=e.leaf?n(a):a;ta(t,s)&&(e.leaf?r.push(a):$o(t,s)?this._all(a,r):i.push(a))}e=i.pop()}return r}collides(t){let e=this.data;if(!ta(t,e))return!1;const r=[];for(;e;){for(let n=0;n<e.children.length;n++){const i=e.children[n],o=e.leaf?this.toBBox(i):i;if(ta(t,o)){if(e.leaf||$o(t,o))return!0;r.push(i)}}e=r.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=ea([]),this}remove(t,e){if(!t)return this;let r=this.data;const n=this.toBBox(t),i=[],o=[];let a,s,l;for(;r||i.length;){if(r||(r=i.pop(),s=i[i.length-1],a=o.pop(),l=!0),r.leaf){const n=Xo(t,r.children,e);if(-1!==n)return r.children.splice(n,1),i.push(r),this._condense(i),this}l||r.leaf||!$o(r,n)?s?(a++,r=s.children[a],l=!1):r=null:(i.push(r),o.push(a),a=0,s=r,r=r.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const r=[];for(;t;)t.leaf?e.push(...t.children):r.push(...t.children),t=r.pop();return e}_build(t,e,r,n){const i=r-e+1;let o,a=this._maxEntries;if(i<=a)return o=ea(t.slice(e,r+1)),Wo(o,this.toBBox),o;n||(n=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,n-1))),o=ea([]),o.leaf=!1,o.height=n;const s=Math.ceil(i/a),l=s*Math.ceil(Math.sqrt(a));ra(t,e,r,l,this.compareMinX);for(let i=e;i<=r;i+=l){const e=Math.min(i+l-1,r);ra(t,i,e,s,this.compareMinY);for(let r=i;r<=e;r+=s){const i=Math.min(r+s-1,e);o.children.push(this._build(t,r,i,n-1))}}return Wo(o,this.toBBox),o}_chooseSubtree(t,e,r,n){for(;n.push(e),!e.leaf&&n.length-1!==r;){let r,n=1/0,a=1/0;for(let s=0;s<e.children.length;s++){const l=e.children[s],u=Ho(l),h=(i=t,o=l,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-u);h<a?(a=h,n=u<n?u:n,r=l):h===a&&u<n&&(n=u,r=l)}e=r||e.children[0]}var i,o;return e}_insert(t,e,r){const n=r?t:this.toBBox(t),i=[],o=this._chooseSubtree(n,this.data,e,i);for(o.children.push(t),Yo(o,n);e>=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=ea(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,Wo(r,this.toBBox),Wo(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,e){this.data=ea([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Wo(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=qo(t,0,a,this.toBBox),s=qo(t,a,r,this.toBBox),l=Qo(e,s),u=Ho(e)+Ho(s);l<i?(i=l,n=a,o=u<o?u:o):l===i&&u<o&&(o=u,n=a)}return n||r-e}_chooseSplitAxis(t,e,r){const n=t.leaf?this.compareMinX:Ko,i=t.leaf?this.compareMinY:Zo;this._allDistMargin(t,e,r,n)<this._allDistMargin(t,e,r,i)&&t.children.sort(n)}_allDistMargin(t,e,r,n){t.children.sort(n);const i=this.toBBox,o=qo(t,0,e,i),a=qo(t,r-e,r,i);let s=Jo(o)+Jo(a);for(let n=e;n<r-e;n++){const e=t.children[n];Yo(o,t.leaf?i(e):e),s+=Jo(o)}for(let n=r-e-1;n>=e;n--){const e=t.children[n];Yo(a,t.leaf?i(e):e),s+=Jo(a)}return s}_adjustParentBBoxes(t,e,r){for(let n=r;n>=0;n--)Yo(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():Wo(t[r],this.toBBox)}}function Xo(t,e,r){if(!r)return e.indexOf(t);for(let n=0;n<e.length;n++)if(r(t,e[n]))return n;return-1}function Wo(t,e){qo(t,0,t.children.length,e,t)}function qo(t,e,r,n,i){i||(i=ea(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;o<r;o++){const e=t.children[o];Yo(i,t.leaf?n(e):e)}return i}function Yo(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function Ko(t,e){return t.minX-e.minX}function Zo(t,e){return t.minY-e.minY}function Ho(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Jo(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Qo(t,e){const r=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-r)*Math.max(0,o-n)}function $o(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function ta(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function ea(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ra(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;Go(t,a,e,r,i),o.push(e,a,a,r)}}var na=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)}}(),ia="renderOrder",oa=function(t){function e(e){var r=this,n=e||{},i=m({},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 na(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(ia)},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 Vo(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(ia,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:ho,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var r;Array.isArray(t)?r=t:(it("function"==typeof t.getZIndex,41),r=[t]),e=function(){return r}}return e}(this.style_),this.changed()},e}(zo),aa={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},sa=[aa.FILL],la=[aa.STROKE],ua=[aa.BEGIN_PATH],ha=[aa.CLOSE_PATH],ca=aa,pa=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}(),fa=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)}}(),da=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 fa(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;a<s;a+=e)n[0]=t[a],n[1]=t[a+1],ne(r,n)&&(i[o++]=n[0],i[o++]=n[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,r,n,i,o){var a=this.coordinates,s=a.length,l=this.getBufferedMaxExtent();o&&(e+=n);var u,h,c,p=t[e],f=t[e+1],d=this.tmpCoordinate_,g=!0;for(u=e+n;u<r;u+=n)d[0]=t[u],d[1]=t[u+1],(c=ae(l,d))!==h?(g&&(a[s++]=p,a[s++]=f,g=!1),a[s++]=d[0],a[s++]=d[1]):c===Kt?(a[s++]=d[0],a[s++]=d[1],g=!1):g=!0,p=d[0],f=d[1],h=c;return(i&&g||u===e+n)&&(a[s++]=p,a[s++]=f),s},e.prototype.drawCustomCoordinates_=function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o],l=this.appendFlatLineCoordinates(t,e,s,n,!1,!1);i.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,r,n){this.beginGeometry(t,e);var i,o,a,s,l,u=t.getType(),h=t.getStride(),c=this.coordinates.length;switch(u){case _t:i=t.getOrientedFlatCoordinates(),s=[];var p=t.getEndss();l=0;for(var f=0,d=p.length;f<d;++f){var g=[];l=this.drawCustomCoordinates_(i,l,p[f],h,g),s.push(g)}this.instructions.push([ca.CUSTOM,c,s,t,r,vn]),this.hitDetectionInstructions.push([ca.CUSTOM,c,s,t,n||r,vn]);break;case gt:case vt:a=[],i=u==gt?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(i,0,t.getEnds(),h,a),this.instructions.push([ca.CUSTOM,c,a,t,r,yn]),this.hitDetectionInstructions.push([ca.CUSTOM,c,a,t,n||r,yn]);break;case ft:case xt:i=t.getFlatCoordinates(),o=this.appendFlatLineCoordinates(i,0,i.length,h,!1,!1),this.instructions.push([ca.CUSTOM,c,o,t,r,gn]),this.hitDetectionInstructions.push([ca.CUSTOM,c,o,t,n||r,gn]);break;case yt:i=t.getFlatCoordinates(),(o=this.appendFlatPointCoordinates(i,h))>c&&(this.instructions.push([ca.CUSTOM,c,o,t,r,gn]),this.hitDetectionInstructions.push([ca.CUSTOM,c,o,t,n||r,gn]));break;case pt:i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([ca.CUSTOM,c,o,t,r]),this.hitDetectionInstructions.push([ca.CUSTOM,c,o,t,n||r])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[ca.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ca.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;t<i;++t)(n=(r=e[t])[0])==ca.END_GEOMETRY?o=t:n==ca.BEGIN_GEOMETRY&&(r[2]=t,f(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var r=this.state;if(t){var n=t.getColor();r.fillStyle=Ci(n||ji)}else r.fillStyle=void 0;if(e){var i=e.getColor();r.strokeStyle=Ci(i||Ui);var o=e.getLineCap();r.lineCap=void 0!==o?o:zi;var a=e.getLineDash();r.lineDash=a?a.slice():Gi;var s=e.getLineDashOffset();r.lineDashOffset=s||0;var l=e.getLineJoin();r.lineJoin=void 0!==l?l:Ni;var u=e.getWidth();r.lineWidth=void 0!==u?u:1;var h=e.getMiterLimit();r.miterLimit=void 0!==h?h:10,r.lineWidth>this.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=[ca.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[ca.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&&!g(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=[ca.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=ee(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;te(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(pa),ga=da,ya=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)}}(),va=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.declutterImageWithText_=void 0,o}return ya(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([ca.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.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([ca.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.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([ca.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.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([ca.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.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.getHitDetectionImage(),o=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=r[0],this.anchorY_=r[1],this.hitDetectionImage_=i,this.image_=o,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterImageWithText_=e},e}(ga),_a=va,ma=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)}}(),xa=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return ma(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=[ca.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([ca.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Gi,0],ua);var o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(la),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([ca.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],ua);for(var o=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinates_(a,l,o[u],s);this.hitDetectionInstructions.push(la),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(la),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(la),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(ua)},e}(ga),ba=xa,wa=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)}}(),Sa=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return wa(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,r,n){var i=this.state,o=void 0!==i.fillStyle,a=void 0!==i.strokeStyle,s=r.length;this.instructions.push(ua),this.hitDetectionInstructions.push(ua);for(var l=0;l<s;++l){var u=r[l],h=this.coordinates.length,c=this.appendFlatLineCoordinates(t,e,u,n,!0,!a),p=[ca.MOVE_TO_LINE_TO,h,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),a&&(this.instructions.push(ha),this.hitDetectionInstructions.push(ha)),e=u}return o&&(this.instructions.push(sa),this.hitDetectionInstructions.push(sa)),a&&(this.instructions.push(la),this.hitDetectionInstructions.push(la)),e},e.prototype.drawCircle=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([ca.SET_FILL_STYLE,ji]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([ca.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var o=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,a,!1,!1);var l=[ca.CIRCLE,s];this.instructions.push(ua,l),this.hitDetectionInstructions.push(ua,l),void 0!==r.fillStyle&&(this.instructions.push(sa),this.hitDetectionInstructions.push(sa)),void 0!==r.strokeStyle&&(this.instructions.push(la),this.hitDetectionInstructions.push(la)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([ca.SET_FILL_STYLE,ji]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([ca.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var o=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,o,s),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([ca.SET_FILL_STYLE,ji]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([ca.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);for(var o=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinatess_(a,l,o[u],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var r=this.coordinates,n=0,i=r.length;n<i;++n)r[n]=pn(r[n],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(ga),Ca=Sa;function Ea(t,e,r,n,i){var o,a,s,l,u,h,c,p,f,d=r,g=r,y=0,v=0,_=r;for(o=r;o<n;o+=i){var m=e[o],x=e[o+1];void 0!==l&&(p=m-l,f=x-u,s=Math.sqrt(p*p+f*f),void 0!==h&&(v+=a,Math.acos((h*p+c*f)/(a*s))>t&&(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 Ta=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)}}(),Ra={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Pa=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 Ta(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!==yo||s!=ft&&s!=vt&&s!=gt&&s!=_t){var h=i.overflow?null:[];switch(s){case pt:case yt:l=t.getFlatCoordinates();break;case ft:l=t.getFlatMidpoint();break;case xt:l=t.getCenter();break;case vt:l=t.getFlatMidpoints(),u=2;break;case gt:l=t.getFlatInteriorPoint(),i.overflow||h.push(l[2]/this.resolution),u=3;break;case _t:var c=t.getFlatInteriorPoints();l=[];for(w=0,S=c.length;w<S;w+=3)i.overflow||h.push(c[w+2]/this.resolution),l.push(c[w],c[w+1]);if(0===l.length)return;u=2}if((F=this.appendFlatPointCoordinates(l,u))===a)return;if(h&&(F-a)/2!=l.length/u){var p=a/2;h=h.filter((function(t,e){var r=o[2*(p+e)]===l[e*u]&&o[2*(p+e)+1]===l[e*u+1];return r||--p,r}))}this.saveTextStates_(),(i.backgroundFill||i.backgroundStroke)&&(this.setFillStrokeStyle(i.backgroundFill,i.backgroundStroke),i.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),i.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var f=i.padding;if(f!=Xi&&(i.scale[0]<0||i.scale[1]<0)){var d=i.padding[0],g=i.padding[1],y=i.padding[2],v=i.padding[3];i.scale[0]<0&&(g=-g,v=-v),i.scale[1]<0&&(d=-d,y=-y),f=[d,g,y,v]}var _=this.pixelRatio;this.instructions.push([ca.DRAW_IMAGE,a,F,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,f==Xi?Xi:f.map((function(t){return t*_})),!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);var m=1/_;this.hitDetectionInstructions.push([ca.DRAW_IMAGE,a,F,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,this.declutterImageWithText_,f,!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),this.endGeometry(e)}else{if(!Oe(this.getBufferedMaxExtent(),t.getExtent()))return;var x=void 0;if(l=t.getFlatCoordinates(),s==ft)x=[l.length];else if(s==vt)x=t.getEnds();else if(s==gt)x=t.getEnds().slice(0,1);else if(s==_t){var b=t.getEndss();x=[];for(var w=0,S=b.length;w<S;++w)x.push(b[w][0])}this.beginGeometry(t,e);for(var C=i.textAlign,E=0,T=void 0,R=0,P=x.length;R<P;++R){if(null==C){var O=Ea(i.maxAngle,l,E,x[R],u);E=O[0],T=O[1]}else T=x[R];for(var w=E;w<T;w+=u)o.push(l[w],l[w+1]);var F=o.length;E=x[R],this.drawChars_(a,F),a=F}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,r=this.textFillState_,n=this.strokeKey_;t&&(n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var i=this.textKey_;i in this.textStates||(this.textStates[i]={font:e.font,textAlign:e.textAlign||Bi,textBaseline:e.textBaseline||Vi,scale:e.scale});var o=this.fillKey_;r&&(o in this.fillStates||(this.fillStates[o]={fillStyle:r.fillStyle}))},e.prototype.drawChars_=function(t,e){var r=this.textStrokeState_,n=this.textState_,i=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();var s=this.pixelRatio,l=Ra[n.textBaseline],u=this.textOffsetY_*s,h=this.text_,c=r?r.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([ca.DRAW_CHARS,t,e,l,n.overflow,a,n.maxAngle,s,u,i,c*s,h,o,1]),this.hitDetectionInstructions.push([ca.DRAW_CHARS,t,e,l,n.overflow,a,n.maxAngle,1,u,i,c,h,o,1/s])},e.prototype.setTextStyle=function(t,e){var r,i,o;if(t){var a=t.getFill();a?((i=this.textFillState_)||(i={},this.textFillState_=i),i.fillStyle=Ci(a.getColor()||ji)):(i=null,this.textFillState_=i);var s=t.getStroke();if(s){(o=this.textStrokeState_)||(o={},this.textStrokeState_=o);var l=s.getLineDash(),u=s.getLineDashOffset(),h=s.getWidth(),c=s.getMiterLimit();o.lineCap=s.getLineCap()||zi,o.lineDash=l?l.slice():Gi,o.lineDashOffset=void 0===u?0:u,o.lineJoin=s.getLineJoin()||Ni,o.lineWidth=void 0===h?1:h,o.miterLimit=void 0===c?10:c,o.strokeStyle=Ci(s.getColor()||Ui)}else o=null,this.textStrokeState_=o;r=this.textState_;var p=t.getFont()||Di;Hi(p);var f=t.getScaleArray();r.overflow=t.getOverflow(),r.font=p,r.maxAngle=t.getMaxAngle(),r.placement=t.getPlacement(),r.textAlign=t.getTextAlign(),r.textBaseline=t.getTextBaseline()||Vi,r.backgroundFill=t.getBackgroundFill(),r.backgroundStroke=t.getBackgroundStroke(),r.padding=t.getPadding()||Xi,r.scale=void 0===f?[1,1]:f;var d=t.getOffsetX(),g=t.getOffsetY(),y=t.getRotateWithView(),v=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===g?0:g,this.textRotateWithView_=void 0!==y&&y,this.textRotation_=void 0===v?0:v,this.strokeKey_=o?("string"==typeof o.strokeStyle?o.strokeStyle:n(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=r.font+r.scale+(r.textAlign||"?")+(r.textBaseline||"?"),this.fillKey_=i?"string"==typeof i.fillStyle?i.fillStyle:"|"+n(i.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(ga),Oa={Circle:Ca,Default:ga,Image:_a,LineString:ba,Polygon:Ca,Text:Pa},Fa=function(){function t(t,e,r,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=r,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var r=this.buildersByZIndex_[e];for(var n in r){var i=r[n].finish();t[e][n]=i}}return t},t.prototype.getBuilder=function(t,e){var r=void 0!==t?t.toString():"0",n=this.buildersByZIndex_[r];void 0===n&&(n={},this.buildersByZIndex_[r]=n);var i=n[e];void 0===i&&(i=new(0,Oa[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=i);return i},t}(),Ia=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)}}(),Ma=function(t){function r(e){var r=t.call(this)||this;return r.ready=!0,r.boundHandleImageChange_=r.handleImageChange_.bind(r),r.layer_=e,r.declutterExecutorGroup=null,r}return Ia(r,t),r.prototype.getFeatures=function(t){return e()},r.prototype.getData=function(t){return null},r.prototype.prepareFrame=function(t){return e()},r.prototype.renderFrame=function(t,r){return e()},r.prototype.loadedTileCallback=function(t,e,r){t[e]||(t[e]={}),t[e][r.tileCoord.toString()]=r},r.prototype.createLoadedTileFinder=function(t,e,r){return function(n,i){var o=this.loadedTileCallback.bind(this,r,n);return t.forEachLoadedTile(e,n,i,o)}.bind(this)},r.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){},r.prototype.getDataAtPixel=function(t,e,r){return null},r.prototype.getLayer=function(){return this.layer_},r.prototype.handleFontsChanged=function(){},r.prototype.handleImageChange_=function(t){t.target.getState()===si&&this.renderIfReadyAndVisible()},r.prototype.loadImage=function(t){var e=t.getState();return e!=si&&e!=li&&t.addEventListener(E,this.boundHandleImageChange_),e==oi&&(t.load(),e=t.getState()),e==si},r.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Ao&&t.changed()},r.prototype.disposeInternal=function(){delete this.layer_,t.prototype.disposeInternal.call(this)},r}(W),Aa=Ma,La=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)}}(),ka=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 La(e,t),e}(s),Da=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)}}(),ja=null;var za=function(t){function e(e){var r=t.call(this,e)||this;return r.container=null,r.renderedResolution,r.tempTransform=[1,0,0,1,0,0],r.pixelTransform=[1,0,0,1,0,0],r.inversePixelTransform=[1,0,0,1,0,0],r.context=null,r.containerReused=!1,r.pixelContext_=null,r.frameState=null,r}return Da(e,t),e.prototype.getImageData=function(t,e,r){var n,i;ja||((n=document.createElement("canvas")).width=1,n.height=1,ja=n.getContext("2d")),ja.clearRect(0,0,1,1);try{ja.drawImage(t,e,r,1,1,0,0,1,1),i=ja.getImageData(0,0,1,1).data}catch(t){return null}return i},e.prototype.getBackground=function(t){var e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0},e.prototype.useContainer=function(t,e,r,n){var i,o,a=this.getLayer().getClassName();t&&t.className===a&&""===t.style.opacity&&1===r&&(!n||t.style.backgroundColor&&g(bi(t.style.backgroundColor),bi(n)))&&((l=t.firstElementChild)instanceof HTMLCanvasElement&&(o=l.getContext("2d")));if(o&&o.canvas.style.transform===e?(this.container=t,this.context=o,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(i=document.createElement("div")).className=a;var s=i.style;s.position="absolute",s.width="100%",s.height="100%",n&&(s.backgroundColor=n);var l=(o=Ei()).canvas;i.appendChild(l),(s=l.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=i,this.context=o}},e.prototype.clipUnrotated=function(t,e,r){var n=Te(r),i=Re(r),o=xe(r),a=me(r);zt(e.coordinateToPixelTransform,n),zt(e.coordinateToPixelTransform,i),zt(e.coordinateToPixelTransform,o),zt(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;zt(s,n),zt(s,i),zt(s,o),zt(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,r){var n=this.getLayer();if(n.hasListener(t)){var i=new ka(t,this.inversePixelTransform,r,e);n.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.frameState=e,this.dispatchRenderEvent_(Xn,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Wn,t,e)},e.prototype.getRenderTransform=function(t,e,r,n,i,o,a){var s=i/2,l=o/2,u=n/e,h=-u,c=-t[0]+a,p=-t[1];return Nt(this.tempTransform,s,l,u,h,-r,c,p)},e.prototype.getDataAtPixel=function(t,e,r){var n=zt(this.inversePixelTransform,t.slice()),i=this.context,o=this.getLayer().getExtent();if(o&&!ne(o,zt(e.pixelToCoordinateTransform,t.slice())))return null;var a,s=Math.round(n[0]),l=Math.round(n[1]),u=this.pixelContext_;if(!u){var h=document.createElement("canvas");h.width=1,h.height=1,u=h.getContext("2d"),this.pixelContext_=u}u.clearRect(0,0,1,1);try{u.drawImage(i.canvas,s,l,1,1,0,0,1,1),a=u.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?(this.pixelContext_=null,new Uint8Array):a}return 0===a[3]?null:a},e.prototype.disposeInternal=function(){delete this.frameState,t.prototype.disposeInternal.call(this)},e}(Aa),Ga=za,Na="Circle",Ua="Default",Ba="Image",Va="LineString",Xa="Polygon",Wa="Text";function qa(t,e,r,n,i,o,a,s,l,u,h,c){var p=t[e],f=t[e+1],d=0,g=0,y=0,v=0;function _(){d=p,g=f,p=t[e+=n],f=t[e+1],v+=y,y=Math.sqrt((p-d)*(p-d)+(f-g)*(f-g))}do{_()}while(e<r-n&&v+y<o);for(var m=0===y?0:(o-v)/y,x=Ue(d,p,m),b=Ue(g,f,m),w=e-n,S=v,C=o+s*l(u,i,h);e<r-n&&v+y<C;)_();var E,T=Ue(d,p,m=0===y?0:(C-v)/y),R=Ue(g,f,m);if(c){var P=[x,b,T,R];qr(P,0,4,2,c,P,P),E=P[0]>P[2]}else E=x>T;var O,F=Math.PI,I=[],M=w+n===e;if(y=0,v=S,p=t[e=w],f=t[e+1],M){_(),O=Math.atan2(f-g,p-d),E&&(O+=O>0?-F:F);var A=(T+x)/2,L=(R+b)/2;return I[0]=[A,L,(C-o)/2,O,i],I}for(var k=0,D=i.length;k<D;){_();var j=Math.atan2(f-g,p-d);if(E&&(j+=j>0?-F:F),void 0!==O){var z=j-O;if(z+=z>F?-2*F:z<-F?2*F:0,Math.abs(z)>a)return null}O=j;for(var G=k,N=0;k<D;++k){var U=s*l(u,i[E?D-k-1:k],h);if(e+n<r&&v+y<o+N+U/2)break;N+=U}if(k!==G){var B=E?i.substring(D-G,D-k):i.substring(G,k);A=Ue(d,p,m=0===y?0:(o+N/2-v)/y),L=Ue(g,f,m);I.push([A,L,N/2,j,B]),o+=N}}return I}var Ya=[1/0,1/0,-1/0,-1/0],Ka=[],Za=[],Ha=[],Ja=[];function Qa(t){return t[3].declutterBox}var $a=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function ts(t,e){return"start"!==e&&"end"!==e||$a.test(t)||(e="start"===e?"left":"right"),Ra[e]}function es(t,e,r){return r>0&&t.push("\n",""),t.push(e,""),t}var rs=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=ts(h?t[0]:t,s.textAlign||Bi),p=n&&o.lineWidth?o.lineWidth:0,f=h?t:t.split("\n").reduce(es,[]),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=$i(p,c);r.push(f),a+=f;var d=Ji(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,b=[],w=(x+2)*u[0],S=(y+p)*u[1],C={width:w<0?Math.floor(w):Math.ceil(w),height:S<0?Math.floor(S):Math.ceil(S),contextInstructions:b};(1==u[0]&&1==u[1]||b.push("scale",u),n)&&(b.push("strokeStyle",o.strokeStyle),b.push("lineWidth",p),b.push("lineCap",o.lineCap),b.push("lineJoin",o.lineJoin),b.push("miterLimit",o.miterLimit),(It?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(b.push("setLineDash",[o.lineDash]),b.push("lineDashOffset",o.lineDashOffset)));r&&b.push("fillStyle",a.fillStyle),b.push("textBaseline","middle"),b.push("textAlign","center");for(var E,T=.5-c,R=c*x+T*p,P=[],O=[],F=0,I=0,M=0,A=0,L=0,k=f.length;L<k;L+=2){var D=f[L];if("\n"!==D){var j=f[L+1]||s.font;j!==E&&(n&&P.push("font",j),r&&O.push("font",j),E=j),F=Math.max(F,_[M]);var z=[D,R+T*v[M]+c*(v[M]-m[A]),.5*(p+F)+I];R+=v[M],n&&P.push("strokeText",z),r&&O.push("fillText",z),++M}else I+=F,F=0,R=c*x+T*p,++A}return Array.prototype.push.apply(b,P),Array.prototype.push.apply(b,O),this.labels_[i]=C,C},t.prototype.replayTextBackground_=function(t,e,r,n,i,o,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,r),t.lineTo.apply(t,n),t.lineTo.apply(t,i),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,r,n,i,o,a,s,l,u,h,c,p,f,d,g){var y,v=r-(a*=c[0]),_=n-(s*=c[1]),m=i+l>t?t-l:i,x=o+u>e?e-u:o,b=f[3]+m*c[0]+f[1],w=f[0]+x*c[1]+f[2],S=v-f[3],C=_-f[0];return(d||0!==h)&&(Ka[0]=S,Ja[0]=S,Ka[1]=C,Za[1]=C,Za[0]=S+b,Ha[0]=Za[0],Ha[1]=C+w,Ja[1]=Ha[1]),0!==h?(zt(y=Nt([1,0,0,1,0,0],r,n,1,1,h,-r,-n),Ka),zt(y,Za),zt(y,Ha),zt(y,Ja),le(Math.min(Ka[0],Za[0],Ha[0],Ja[0]),Math.min(Ka[1],Za[1],Ha[1],Ja[1]),Math.max(Ka[0],Za[0],Ha[0],Ja[0]),Math.max(Ka[1],Za[1],Ha[1],Ja[1]),Ya)):le(Math.min(S,S+b),Math.min(C,C+w),Math.max(S,S+b),Math.max(C,C+w),Ya),p&&(v=Math.round(v),_=Math.round(_)),{drawImageX:v,drawImageY:_,drawImageW:m,drawImageH:x,originX:l,originY:u,declutterBox:{minX:Ya[0],minY:Ya[1],maxX:Ya[2],maxY:Ya[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,Ka,Za,Ha,Ja,o,a),eo(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=zt(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=ts(Array.isArray(t)?t[0]:t,i.textAlign||Bi),u=Ra[i.textBaseline||Vi],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_&&g(r,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Wr(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,y,v,_,m,x,b,w,S,C,E,T,R,P=0,O=n.length,F=0,I=0,M=0,A=null,L=null,k=this.coordinateCache_,D=this.viewRotation_,j=Math.round(1e12*Math.atan2(-r[1],r[0]))/1e12,z={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:D},G=this.instructions!=n||this.overlaps?0:200;P<O;){var N=n[P];switch(N[0]){case ca.BEGIN_GEOMETRY:C=N[1],R=N[3],C.getGeometry()?void 0===a||Oe(a,R.getExtent())?++P:P=N[2]+1:P=N[2];break;case ca.BEGIN_PATH:I>G&&(this.fill_(t),I=0),M>G&&(t.stroke(),M=0),I||M||(t.beginPath(),d=NaN,y=NaN),++P;break;case ca.CIRCLE:var U=l[F=N[1]],B=l[F+1],V=l[F+2]-U,X=l[F+3]-B,W=Math.sqrt(V*V+X*X);t.moveTo(U+W,B),t.arc(U,B,W,0,2*Math.PI,!0),++P;break;case ca.CLOSE_PATH:t.closePath(),++P;break;case ca.CUSTOM:F=N[1],c=N[2];var q=N[3],Y=N[4],K=6==N.length?N[5]:void 0;z.geometry=q,z.feature=C,P in k||(k[P]=[]);var Z=k[P];K?K(l,F,c,2,Z):(Z[0]=l[F],Z[1]=l[F+1],Z.length=2),Y(Z,z),++P;break;case ca.DRAW_IMAGE:F=N[1],c=N[2],m=N[3],p=N[4],f=N[5];var H=N[6],J=N[7],Q=N[8],$=N[9],tt=N[10],et=N[11],rt=N[12],nt=N[13],it=N[14];if(!m&&N.length>=19){x=N[18],b=N[19],w=N[20],S=N[21];var ot=this.drawLabelWithPointPlacement_(x,b,w,S);m=ot.label,N[3]=m;var at=N[22];p=(ot.anchorX-at)*this.pixelRatio,N[4]=p;var st=N[23];f=(ot.anchorY-st)*this.pixelRatio,N[5]=f,H=m.height,N[6]=H,nt=m.width,N[13]=nt}var lt=void 0;N.length>24&&(lt=N[24]);var ut=void 0,ht=void 0,ct=void 0;N.length>16?(ut=N[15],ht=N[16],ct=N[17]):(ut=Xi,ht=!1,ct=!1),tt&&j?et+=D:tt||j||(et-=D);for(var pt=0;F<c;F+=2)if(!(lt&<[pt++]<nt/this.pixelRatio)){var ft=[t,e,m,Nt=this.calculateImageOrLabelDimensions_(m.width,m.height,l[F],l[F+1],nt,H,p,f,Q,$,et,rt,i,ut,ht||ct,C),J,ht?A:null,ct?L:null],dt=void 0,gt=void 0;if(s&&it){var yt=c-F;if(!it[yt]){it[yt]=ft;continue}if(dt=it[yt],delete it[yt],gt=Qa(dt),s.collides(gt))continue}s&&s.collides(Nt.declutterBox)||(dt&&(s&&s.insert(gt),this.replayImageOrLabel_.apply(this,dt)),s&&s.insert(Nt.declutterBox),this.replayImageOrLabel_.apply(this,ft))}++P;break;case ca.DRAW_CHARS:var vt=N[1],_t=N[2],mt=N[3],xt=N[4];S=N[5];var bt=N[6],wt=N[7],St=N[8];w=N[9];var Ct=N[10];x=N[11],b=N[12];var Et=[N[13],N[13]],Tt=this.textStates[b],Rt=Tt.font,Pt=[Tt.scale[0]*wt,Tt.scale[1]*wt],Ot=void 0;Rt in this.widths_?Ot=this.widths_[Rt]:(Ot={},this.widths_[Rt]=Ot);var Ft=$n(l,vt,_t,2),It=Math.abs(Pt[0])*to(Rt,x,Ot);if(xt||It<=Ft){var Mt=this.textStates[b].textAlign,At=qa(l,vt,_t,2,x,(Ft-It)*Ra[Mt],bt,Math.abs(Pt[0]),to,Rt,Ot,j?0:this.viewRotation_);t:if(At){var Lt=[],kt=void 0,Dt=void 0,jt=void 0,zt=void 0,Gt=void 0;if(w)for(kt=0,Dt=At.length;kt<Dt;++kt){jt=(Gt=At[kt])[4],zt=this.createLabel(jt,b,"",w),p=Gt[2]+(Pt[0]<0?-Ct:Ct),f=mt*zt.height+2*(.5-mt)*Ct*Pt[1]/Pt[0]-St;var Nt=this.calculateImageOrLabelDimensions_(zt.width,zt.height,Gt[0],Gt[1],zt.width,zt.height,p,f,0,0,Gt[3],Et,!1,Xi,!1,C);if(s&&s.collides(Nt.declutterBox))break t;Lt.push([t,e,zt,Nt,1,null,null])}if(S)for(kt=0,Dt=At.length;kt<Dt;++kt){jt=(Gt=At[kt])[4],zt=this.createLabel(jt,b,S,""),p=Gt[2],f=mt*zt.height-St;Nt=this.calculateImageOrLabelDimensions_(zt.width,zt.height,Gt[0],Gt[1],zt.width,zt.height,p,f,0,0,Gt[3],Et,!1,Xi,!1,C);if(s&&s.collides(Nt.declutterBox))break t;Lt.push([t,e,zt,Nt,1,null,null])}s&&s.load(Lt.map(Qa));for(var Ut=0,Bt=Lt.length;Ut<Bt;++Ut)this.replayImageOrLabel_.apply(this,Lt[Ut])}}++P;break;case ca.END_GEOMETRY:if(void 0!==o){var Vt=o(C=N[1],R);if(Vt)return Vt}++P;break;case ca.FILL:G?I++:this.fill_(t),++P;break;case ca.MOVE_TO_LINE_TO:for(F=N[1],c=N[2],E=l[F],_=(T=l[F+1])+.5|0,(v=E+.5|0)===d&&_===y||(t.moveTo(E,T),d=v,y=_),F+=2;F<c;F+=2)v=(E=l[F])+.5|0,_=(T=l[F+1])+.5|0,F!=c-2&&v===d&&_===y||(t.lineTo(E,T),d=v,y=_);++P;break;case ca.SET_FILL_STYLE:A=N,this.alignFill_=N[2],I&&(this.fill_(t),I=0,M&&(t.stroke(),M=0)),t.fillStyle=N[1],++P;break;case ca.SET_STROKE_STYLE:L=N,M&&(t.stroke(),M=0),this.setStrokeStyle_(t,N),++P;break;case ca.STROKE:G?M++:t.stroke(),++P;break;default:++P}}I&&this.fill_(t),M&&t.stroke()},t.prototype.execute=function(t,e,r,n,i,o){this.viewRotation_=n,this.execute_(t,e,r,this.instructions,i,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,r,n,i){return this.viewRotation_=r,this.execute_(t,1,e,this.hitDetectionInstructions,!0,n,i)},t}(),ns=rs,is=[Xa,Na,Va,Ba,Wa,Ua],os=function(){function t(t,e,r,n,i,o){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=r,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(i)}return t.prototype.clip=function(t,e){var r=this.getClipCoords(e);t.beginPath(),t.moveTo(r[0],r[1]),t.lineTo(r[2],r[3]),t.lineTo(r[4],r[5]),t.lineTo(r[6],r[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var r=this.executorsByZIndex_[e];void 0===r&&(r={},this.executorsByZIndex_[e]=r);var n=t[e];for(var i in n){var o=n[i];r[i]=new ns(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var r=this.executorsByZIndex_[e],n=0,i=t.length;n<i;++n)if(t[n]in r)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o){var a=2*(n=Math.round(n))+1,s=Nt(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-r,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=Ei(a,a));var u,c=this.hitDetectionContext_;c.canvas.width!==a||c.canvas.height!==a?(c.canvas.width=a,c.canvas.height=a):l||c.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(de(u=[1/0,1/0,-1/0,-1/0],t),te(u,e*(this.renderBuffer_+n),u));var p,f=function(t){if(void 0!==as[t])return as[t];for(var e=2*t+1,r=t*t,n=new Array(r+1),i=0;i<=t;++i)for(var o=0;o<=t;++o){var a=i*i+o*o;if(a>r)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);i<u;++i)n[i]&&l.push.apply(l,n[i]);return as[t]=l,l}(n);function d(t,e){for(var r=c.getImageData(0,0,a,a).data,s=0,l=f.length;s<l;s++)if(r[f[s]]>0){if(!o||p!==Ba&&p!==Wa||-1!==o.indexOf(t)){var u=(f[s]-3)/4,h=n-u%a,d=n-(u/a|0),g=i(t,e,h*h+d*d);if(g)return g}c.clearRect(0,0,a,a);break}}var g,y,v,_,m,x=Object.keys(this.executorsByZIndex_).map(Number);for(x.sort(h),g=x.length-1;g>=0;--g){var b=x[g].toString();for(v=this.executorsByZIndex_[b],y=is.length-1;y>=0;--y)if(void 0!==(_=v[p=is[y]])&&(m=_.executeHitDetection(c,s,r,d,u)))return m}},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 Wr(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return w(this.executorsByZIndex_)},t.prototype.execute=function(t,e,r,n,i,o,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(h),this.maxExtent_&&(t.save(),this.clip(t,r));var l,u,c,p,f,d,g=o||is;for(a&&s.reverse(),l=0,u=s.length;l<u;++l){var y=s[l].toString();for(f=this.executorsByZIndex_[y],c=0,p=g.length;c<p;++c){void 0!==(d=f[g[c]])&&d.execute(t,e,r,n,i,a)}}this.maxExtent_&&t.restore()},t}(),as={};var ss=os,ls=0,us=1,hs=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,r,n,i,o,a,s){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=r,l.extent_=n,l.transform_=i,l.viewRotation_=o,l.squaredTolerance_=a,l.userTransform_=s,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return hs(e,t),e.prototype.drawImages_=function(t,e,r,n){if(this.image_){var i=Wr(t,e,r,n,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,s=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=s*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,h=i.length;u<h;u+=2){var c=i[u]-this.imageAnchorX_,p=i[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var f=c+this.imageAnchorX_,d=p+this.imageAnchorY_;Nt(a,f,d,1,1,l,-f,-d),o.setTransform.apply(o,a),o.translate(f,d),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=s)}},e.prototype.drawText_=function(t,e,r,n){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var i=Wr(t,e,r,n,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<r;e+=n){var s=i[e]+this.textOffsetX_,l=i[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=Nt(this.tmpLocalTransform_,s,l,1,1,a,-s,-l);o.setTransform.apply(o,u),o.translate(s,l),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,s,l),this.textFillState_&&o.fillText(this.text_,s,l)}}},e.prototype.moveToLineTo_=function(t,e,r,n,i){var o=this.context_,a=Wr(t,e,r,n,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);var s=a.length;i&&(s-=2);for(var l=2;l<s;l+=2)o.lineTo(a[l],a[l+1]);return i&&o.closePath(),r},e.prototype.drawRings_=function(t,e,r,n){for(var i=0,o=r.length;i<o;++i)e=this.moveToLineTo_(t,e,r[i],n,!0);return e},e.prototype.drawCircle=function(t){if(Oe(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,r){var n=t.getFlatCoordinates();if(n){var i=t.getStride();return Wr(n,0,n.length,i,e,r)}return null}(t,this.transform_,this.pixelCoordinates_),r=e[2]-e[0],n=e[3]-e[1],i=Math.sqrt(r*r+n*n),o=this.context_;o.beginPath(),o.arc(e[0],e[1],i,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case pt:this.drawPoint(t);break;case ft:this.drawLineString(t);break;case gt:this.drawPolygon(t);break;case yt:this.drawMultiPoint(t);break;case vt:this.drawMultiLineString(t);break;case _t:this.drawMultiPolygon(t);break;case mt:this.drawGeometryCollection(t);break;case xt:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var r=e.getGeometryFunction()(t);r&&Oe(this.extent_,r.getExtent())&&(this.setStyle(e),this.drawGeometry(r))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),r=0,n=e.length;r<n;++r)this.drawGeometry(e[r])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Oe(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,r=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(r,0,r.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var n=t.getFlatMidpoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(Oe(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var r=this.context_,n=t.getFlatCoordinates(),i=0,o=t.getEnds(),a=t.getStride();r.beginPath();for(var s=0,l=o.length;s<l;++s)i=this.moveToLineTo_(n,i,o[s],a,!1);r.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Oe(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var r=t.getFlatInteriorPoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Oe(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,r=t.getOrientedFlatCoordinates(),n=0,i=t.getEndss(),o=t.getStride();e.beginPath();for(var a=0,s=i.length;a<s;++a){var l=i[a];n=this.drawRings_(r,n,l,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var u=t.getFlatInteriorPoints();this.drawText_(u,0,u.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,r=this.contextFillState_;r?r.fillStyle!=t.fillStyle&&(r.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,r=this.contextStrokeState_;r?(r.lineCap!=t.lineCap&&(r.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(g(r.lineDash,t.lineDash)||e.setLineDash(r.lineDash=t.lineDash),r.lineDashOffset!=t.lineDashOffset&&(r.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),r.lineJoin!=t.lineJoin&&(r.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),r.lineWidth!=t.lineWidth&&(r.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),r.miterLimit!=t.miterLimit&&(r.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),r.strokeStyle!=t.strokeStyle&&(r.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,r=this.contextTextState_,n=t.textAlign?t.textAlign:Bi;r?(r.font!=t.font&&(r.font=t.font,e.font=t.font),r.textAlign!=n&&(r.textAlign=n,e.textAlign=n),r.textBaseline!=t.textBaseline&&(r.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var r=this;if(t){var n=t.getColor();this.fillState_={fillStyle:Ci(n||ji)}}else this.fillState_=null;if(e){var i=e.getColor(),o=e.getLineCap(),a=e.getLineDash(),s=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),h=e.getMiterLimit(),c=a||Gi;this.strokeState_={lineCap:void 0!==o?o:zi,lineDash:1===this.pixelRatio_?c:c.map((function(t){return t*r.pixelRatio_})),lineDashOffset:(s||0)*this.pixelRatio_,lineJoin:void 0!==l?l:Ni,lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==h?h:10,strokeStyle:Ci(i||Ui)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var r=t.getAnchor(),n=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*this.pixelRatio_,this.imageAnchorY_=r[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=n[0],this.imageOriginY_=n[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var r=e.getColor();this.textFillState_={fillStyle:Ci(r||ji)}}else this.textFillState_=null;var n=t.getStroke();if(n){var i=n.getColor(),o=n.getLineCap(),a=n.getLineDash(),s=n.getLineDashOffset(),l=n.getLineJoin(),u=n.getWidth(),h=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:zi,lineDash:a||Gi,lineDashOffset:s||0,lineJoin:void 0!==l?l:Ni,lineWidth:void 0!==u?u:1,miterLimit:void 0!==h?h:10,strokeStyle:Ci(i||Ui)}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),f=t.getOffsetY(),d=t.getRotateWithView(),g=t.getRotation(),y=t.getScaleArray(),v=t.getText(),_=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==c?c:Di,textAlign:void 0!==_?_:Bi,textBaseline:void 0!==m?m:Vi},this.text_=void 0!==v?Array.isArray(v)?v.reduce((function(t,e,r){return t+(r%2?" ":e)}),""):v:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==f?this.pixelRatio_*f:0,this.textRotateWithView_=void 0!==d&&d,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*y[0],this.pixelRatio_*y[1]]}else this.text_=""},e}(pa),ps=cs,fs="fraction",ds="pixels",gs="bottom-left",ys="bottom-right",vs="top-left",_s="top-right",ms=function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var r=this.cache_[e];0!=(3&t++)||r.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,r){var n=xs(t,e,r);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,r,n){var i=xs(t,e,r);this.cache_[i]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function xs(t,e,r){return e+":"+t+":"+(r?_i(r):"null")}var bs=new ms,ws=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)}}(),Ss=function(t){function r(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 ws(r,t),r.prototype.changed=function(){this.dispatchEvent(E)},r.prototype.getExtent=function(){return this.extent},r.prototype.getImage=function(){return e()},r.prototype.getPixelRatio=function(){return this.pixelRatio_},r.prototype.getResolution=function(){return this.resolution},r.prototype.getState=function(){return this.state},r.prototype.load=function(){e()},r}(C),Cs=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 Es(t,e,r){var n=t,i=!0,o=!1,a=!1,s=[N(n,k,(function(){a=!0,o||e()}))];return n.src&&Mt?(o=!0,n.decode().then((function(){i&&e()})).catch((function(t){i&&(a?e():r())}))):s.push(N(n,T,r)),function(){i=!1,s.forEach(U)}}var Ts=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,n,oi)||this;return s.src_=i,s.image_=new Image,null!==o&&(s.image_.crossOrigin=o),s.unlisten_=null,s.state=oi,s.imageLoadFunction_=a,s}return Cs(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=li,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Ce(this.extent)/this.image_.height),this.state=si,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=oi&&this.state!=li||(this.state=ai,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Es(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=Ce(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Ss),Rs=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)}}(),Ps=null,Os=function(t){function e(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 Rs(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===si){Ps||(Ps=Ei(1,1)),Ps.drawImage(this.image_,0,0);try{Ps.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Ps=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(E)},e.prototype.handleImageError_=function(){this.imageState_=li,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=si,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],r=Ei(t,e);r.fillRect(0,0,t,e),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==oi){this.imageState_=ai;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Es(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===si){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=_i(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 n=r.getImageData(0,0,e.width,e.height),i=n.data,o=this.color_[0]/255,a=this.color_[1]/255,s=this.color_[2]/255,l=this.color_[3],u=0,h=i.length;u<h;u+=4)i[u]*=o,i[u+1]*=a,i[u+2]*=s,i[u+3]*=l;r.putImageData(n,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(C);var Fs=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=function(t){function e(e){var r=this,i=e||{},o=void 0!==i.opacity?i.opacity:1,a=void 0!==i.rotation?i.rotation:0,s=void 0!==i.scale?i.scale:1,l=void 0!==i.rotateWithView&&i.rotateWithView;(r=t.call(this,{opacity:o,rotation:a,scale:s,displacement:void 0!==i.displacement?i.displacement:[0,0],rotateWithView:l})||this).anchor_=void 0!==i.anchor?i.anchor:[.5,.5],r.normalizedAnchor_=null,r.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:vs,r.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:fs,r.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:fs,r.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var u=void 0!==i.img?i.img:null;r.imgSize_=i.imgSize;var h=i.src;it(!(void 0!==h&&u),4),it(!u||u&&r.imgSize_,5),void 0!==h&&0!==h.length||!u||(h=u.src||n(u)),it(void 0!==h&&h.length>0,6);var c=void 0!==i.src?oi:si;return r.color_=void 0!==i.color?bi(i.color):null,r.iconImage_=function(t,e,r,n,i,o){var a=bs.get(e,n,o);return a||(a=new Os(t,e,r,n,i,o),bs.set(e,n,o,a)),a}(u,h,void 0!==r.imgSize_?r.imgSize_:null,r.crossOrigin_,c,r.color_),r.offset_=void 0!==i.offset?i.offset:[0,0],r.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:vs,r.origin_=null,r.size_=void 0!==i.size?i.size:null,r}return Fs(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==fs||this.anchorYUnits_==fs){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==fs&&(t[0]*=e[0]),this.anchorYUnits_==fs&&(t[1]*=e[1])}if(this.anchorOrigin_!=vs){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=_s&&this.anchorOrigin_!=ys||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=gs&&this.anchorOrigin_!=ys||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var r=this.getDisplacement();return[t[0]-r[0],t[1]+r[1]]},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=vs){var e=this.getSize(),r=this.iconImage_.getSize();if(!e||!r)return null;t=t.slice(),this.offsetOrigin_!=_s&&this.offsetOrigin_!=ys||(t[0]=r[0]-e[0]-t[0]),this.offsetOrigin_!=gs&&this.offsetOrigin_!=ys||(t[1]=r[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(E,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(E,t)},e}(gi),Ms=Is,As=.5;function Ls(t,e,r,n,i,o,a){var s=Ei(t[0]*As,t[1]*As);s.imageSmoothingEnabled=!1;for(var l=s.canvas,u=new ps(s,As,i,null,a),c=r.length,p=Math.floor(16777215/c),f={},d=1;d<=c;++d){var g=r[d-1],y=g.getStyleFunction()||n;if(n){var v=y(g,o);if(v){Array.isArray(v)||(v=[v]);for(var _="#"+("000000"+(d*p).toString(16)).slice(-6),m=0,x=v.length;m<x;++m){var b=v[m],w=b.getGeometryFunction()(g);if(w&&Oe(i,w.getExtent())){var S=b.clone(),C=S.getFill();C&&C.setColor(_);var E=S.getStroke();E&&(E.setColor(_),E.setLineDash(null)),S.setText(void 0);var T=b.getImage();if(T&&0!==T.getOpacity()){var R=T.getImageSize();if(!R)continue;var P=Ei(R[0],R[1],void 0,{alpha:!1}),O=P.canvas;P.fillStyle=_,P.fillRect(0,0,O.width,O.height),S.setImage(new Ms({img:O,imgSize:R,anchor:T.getAnchor(),anchorXUnits:ds,anchorYUnits:ds,offset:T.getOrigin(),opacity:1,size:T.getSize(),scale:T.getScale(),rotation:T.getRotation(),rotateWithView:T.getRotateWithView()}))}var F=S.getZIndex()||0;(A=f[F])||(A={},f[F]=A,A[gt]=[],A[xt]=[],A[ft]=[],A[pt]=[]),A[w.getType().replace("Multi","")].push(w,S)}}}}}for(var I=Object.keys(f).map(Number).sort(h),M=(d=0,I.length);d<M;++d){var A=f[I[d]];for(var L in A){var k=A[L];for(m=0,x=k.length;m<x;m+=2){u.setStyle(k[m+1]);for(var D=0,j=e.length;D<j;++D)u.setTransform(e[D]),u.drawGeometry(k[m])}}}return s.getImageData(0,0,l.width,l.height)}function ks(t,e,r){var n=[];if(r){var i=Math.floor(Math.round(t[0])*As),o=Math.floor(Math.round(t[1])*As),a=4*(Ae(i,0,r.width-1)+Ae(o,0,r.height-1)*r.width),s=r.data[a],l=r.data[a+1],u=r.data[a+2]+256*(l+256*s),h=Math.floor(16777215/e.length);u&&u%h==0&&n.push(e[u/h-1])}return n}var Ds={Point:function(t,e,r,n,i){var o,a=r.getImage(),s=r.getText();i&&(t=i,o=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=si)return;var l=t.getBuilder(r.getZIndex(),Ba);l.setImageStyle(a,o),l.drawPoint(e,n)}if(s&&s.getText()){var u=t.getBuilder(r.getZIndex(),Wa);u.setTextStyle(s,o),u.drawText(e,n)}},LineString:function(t,e,r,n,i){var o=r.getStroke();if(o){var a=t.getBuilder(r.getZIndex(),Va);a.setFillStrokeStyle(null,o),a.drawLineString(e,n)}var s=r.getText();if(s&&s.getText()){var l=(i||t).getBuilder(r.getZIndex(),Wa);l.setTextStyle(s),l.drawText(e,n)}},Polygon:function(t,e,r,n,i){var o=r.getFill(),a=r.getStroke();if(o||a){var s=t.getBuilder(r.getZIndex(),Xa);s.setFillStrokeStyle(o,a),s.drawPolygon(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),Wa);u.setTextStyle(l),u.drawText(e,n)}},MultiPoint:function(t,e,r,n,i){var o,a=r.getImage(),s=r.getText();i&&(t=i,o=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=si)return;var l=t.getBuilder(r.getZIndex(),Ba);l.setImageStyle(a,o),l.drawMultiPoint(e,n)}if(s&&s.getText()){var u=(i||t).getBuilder(r.getZIndex(),Wa);u.setTextStyle(s,o),u.drawText(e,n)}},MultiLineString:function(t,e,r,n,i){var o=r.getStroke();if(o){var a=t.getBuilder(r.getZIndex(),Va);a.setFillStrokeStyle(null,o),a.drawMultiLineString(e,n)}var s=r.getText();if(s&&s.getText()){var l=(i||t).getBuilder(r.getZIndex(),Wa);l.setTextStyle(s),l.drawText(e,n)}},MultiPolygon:function(t,e,r,n,i){var o=r.getFill(),a=r.getStroke();if(a||o){var s=t.getBuilder(r.getZIndex(),Xa);s.setFillStrokeStyle(o,a),s.drawMultiPolygon(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),Wa);u.setTextStyle(l),u.drawText(e,n)}},GeometryCollection:function(t,e,r,n,i){var o,a,s=e.getGeometriesArray();for(o=0,a=s.length;o<a;++o){(0,Ds[s[o].getType()])(t,s[o],r,n,i)}},Circle:function(t,e,r,n,i){var o=r.getFill(),a=r.getStroke();if(o||a){var s=t.getBuilder(r.getZIndex(),Na);s.setFillStrokeStyle(o,a),s.drawCircle(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),Wa);u.setTextStyle(l),u.drawText(e,n)}}};function js(t,e){return parseInt(n(t),10)-parseInt(n(e),10)}function zs(t,e){var r=Gs(t,e);return r*r}function Gs(t,e){return.5*t/e}function Ns(t,e,r,n,i,o,a){var s=!1,l=r.getImage();if(l){var u=l.getImageState();u==si||u==li?l.unlistenImageChange(i):(u==oi&&l.load(),u=l.getImageState(),l.listenImageChange(i),s=!0)}return function(t,e,r,n,i,o){var a=r.getGeometryFunction()(e);if(!a)return;var s=a.simplifyTransformed(n,i);if(r.getRenderer())Us(t,s,r,e);else{(0,Ds[s.getType()])(t,s,r,e,o)}}(t,e,r,n,o,a),s}function Us(t,e,r,n){if(e.getType()!=mt)t.getBuilder(r.getZIndex(),Ua).drawCustom(e,n,r.getRenderer(),r.getHitDetectionRenderer());else for(var i=e.getGeometries(),o=0,a=i.length;o<a;++o)Us(t,i[o],r,n)}var Bs=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=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.animatingOrInteracting_,r.dirty_=!1,r.hitDetectionImageData_=null,r.renderedFeatures_=null,r.renderedRevision_=-1,r.renderedResolution_=NaN,r.renderedExtent_=[1/0,1/0,-1/0,-1/0],r.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],r.renderedRotation_,r.renderedCenter_=null,r.renderedProjection_=null,r.renderedRenderOrder_=null,r.replayGroup_=null,r.replayGroupChanged=!0,r.declutterExecutorGroup=null,r.clipping=!0,r}return Bs(e,t),e.prototype.renderWorlds=function(t,e,r){var n=e.extent,i=e.viewState,o=i.center,a=i.resolution,s=i.projection,l=i.rotation,u=s.getExtent(),h=this.getLayer().getSource(),c=e.pixelRatio,p=e.viewHints,f=!(p[ls]||p[us]),d=this.context,g=Math.round(e.size[0]*c),y=Math.round(e.size[1]*c),v=h.getWrapX()&&s.canWrapX(),_=v?Pe(u):null,m=v?Math.ceil((n[2]-u[2])/_)+1:1,x=v?Math.floor((n[0]-u[0])/_):0;do{var b=this.getRenderTransform(o,a,l,c,g,y,x*_);t.execute(d,1,b,l,f,void 0,r)}while(++x<m)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var r=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];!function(t,e,r){jt(t,e,0,0,r,0,0)}(this.pixelTransform,1/r,1/r),Ut(this.inversePixelTransform,this.pixelTransform);var i=Bt(this.pixelTransform);this.useContainer(e,i,n.opacity,this.getBackground(t));var o=this.context,a=o.canvas,s=this.replayGroup_,l=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!l||l.isEmpty()))return null;var u=Math.round(t.size[0]*r),h=Math.round(t.size[1]*r);a.width!=u||a.height!=h?(a.width=u,a.height=h,a.style.transform!==i&&(a.style.transform=i)):this.containerReused||o.clearRect(0,0,u,h),this.preRender(o,t);var c=t.viewState;c.projection;var p=!1,f=!0;if(n.extent&&this.clipping){var d=Xr(n.extent);(p=(f=Oe(d,t.extent))&&!ie(d,t.extent))&&this.clipUnrotated(o,t,d)}f&&this.renderWorlds(s,t),p&&o.restore(),this.postRender(o,t);var g=ki(n.opacity),y=this.container;return g!==y.style.opacity&&(y.style.opacity=g),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var r=[this.context.canvas.width,this.context.canvas.height];zt(this.pixelTransform,r);var n=this.renderedCenter_,i=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,s=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],h=r[0]*As,c=r[1]*As;u.push(this.getRenderTransform(n,i,o,As,h,c,0).slice());var p=l.getSource(),f=a.getExtent();if(p.getWrapX()&&a.canWrapX()&&!ie(f,s)){for(var d=s[0],g=Pe(f),y=0,v=void 0;d<f[0];)v=g*--y,u.push(this.getRenderTransform(n,i,o,As,h,c,v).slice()),d+=g;for(y=0,d=s[2];d>f[2];)v=g*++y,u.push(this.getRenderTransform(n,i,o,As,h,c,v).slice()),d-=g}this.hitDetectionImageData_=Ls(r,u,this.renderedFeatures_,l.getStyleFunction(),s,i,o)}e(ks(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,i,o){var a=this;if(this.replayGroup_){var s,l=e.viewState.resolution,u=e.viewState.rotation,h=this.getLayer(),c={},p=function(t,e,r){var a=n(t),s=c[a];if(s){if(!0!==s&&r<s.distanceSq){if(0===r)return c[a]=!0,o.splice(o.lastIndexOf(s),1),i(t,h,e);s.geometry=e,s.distanceSq=r}}else{if(0===r)return c[a]=!0,i(t,h,e);o.push(c[a]={feature:t,layer:h,geometry:e,distanceSq:r,callback:i})}},f=[this.replayGroup_];return this.declutterExecutorGroup&&f.push(this.declutterExecutorGroup),f.some((function(n){return s=n.forEachFeatureAtCoordinate(t,l,u,r,p,n===a.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map((function(t){return t.value})):null)})),s}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),r=e.getSource();if(!r)return!1;var n=t.viewHints[ls],i=t.viewHints[us],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&n||!a&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,l=t.viewState,u=l.projection,h=l.resolution,c=t.pixelRatio,p=e.getRevision(),f=e.getRenderBuffer(),d=e.getRenderOrder();void 0===d&&(d=js);var y=l.center.slice(),v=te(s,f*h),_=v.slice(),m=[v.slice()],x=u.getExtent();if(r.getWrapX()&&u.canWrapX()&&!ie(x,t.extent)){var b=Pe(x),w=Math.max(Pe(v)/2,b);v[0]=x[0]-w,v[2]=x[2]+w,_r(y,u);var S=function(t,e){var r=e.getExtent(),n=be(t);if(e.canWrapX()&&(n[0]<r[0]||n[0]>=r[2])){var i=Pe(r),o=Math.floor((n[0]-r[0])/i)*i;t[0]-=o,t[2]-=o}return t}(m[0],u);S[0]<x[0]&&S[2]<x[2]?m.push([S[0]+b,S[1],S[2]+b,S[3]]):S[0]>x[0]&&S[2]>x[2]&&m.push([S[0]-b,S[1],S[2]-b,S[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&ie(this.wrappedRenderedExtent_,v))return g(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=y,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var C,E=new Fa(Gs(h,c),v,h,c);this.getLayer().getDeclutter()&&(C=new Fa(Gs(h,c),v,h,c));for(var T=0,R=m.length;T<R;++T)r.loadFeatures(m[T],h,u);var P=zs(h,c),O=function(t){var r,n=t.getStyleFunction()||e.getStyleFunction();if(n&&(r=n(t,h)),r){var i=this.renderFeature(t,P,r,E,undefined,C);this.dirty_=this.dirty_||i}}.bind(this),F=Vr(v),I=r.getFeaturesInExtent(F);d&&I.sort(d);for(T=0,R=I.length;T<R;++T)O(I[T]);this.renderedFeatures_=I;var M=E.finish(),A=new ss(v,h,c,r.getOverlaps(),M,e.getRenderBuffer());return C&&(this.declutterExecutorGroup=new ss(v,h,c,r.getOverlaps(),C.finish(),e.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=d,this.renderedExtent_=_,this.wrappedRenderedExtent_=v,this.renderedCenter_=y,this.renderedProjection_=u,this.replayGroup_=A,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,r,n,i,o){if(!r)return!1;var a=!1;if(Array.isArray(r))for(var s=0,l=r.length;s<l;++s)a=Ns(n,t,r[s],e,this.boundHandleStyleImageChange_,i,o)||a;else a=Ns(n,t,r,e,this.boundHandleStyleImageChange_,i,o);return a},e}(Ga),Xs=Vs,Ws=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)}}(),qs=function(t){function e(e){return t.call(this,e)||this}return Ws(e,t),e.prototype.createRenderer=function(){return new Xs(this)},e}(oa),Ys=function(){function t(t){this.rbush_=new Vo(t),this.items_={}}return t.prototype.insert=function(t,e){var r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(r),this.items_[n(e)]=r},t.prototype.load=function(t,e){for(var r=new Array(e.length),i=0,o=e.length;i<o;i++){var a=t[i],s=e[i],l={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:s};r[i]=l,this.items_[n(s)]=l}this.rbush_.load(r)},t.prototype.remove=function(t){var e=n(t),r=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(r)},t.prototype.update=function(t,e){var r=this.items_[n(e)];pe([r.minX,r.minY,r.maxX,r.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var r,n=0,i=t.length;n<i;n++)if(r=e(t[n]))return r;return r},t.prototype.isEmpty=function(){return w(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return le(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),Ks=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 Zs(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Hs=function(t){function r(e){var r=t.call(this)||this;r.projection=Or(e.projection),r.attributions_=Zs(e.attributions),r.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,r.loading=!1,r.state_=void 0!==e.state?e.state:Ao,r.wrapX_=void 0!==e.wrapX&&e.wrapX,r.interpolate_=!!e.interpolate,r.viewResolver=null,r.viewRejector=null;var n=r;return r.viewPromise_=new Promise((function(t,e){n.viewResolver=t,n.viewRejector=e})),r}return Ks(r,t),r.prototype.getAttributions=function(){return this.attributions_},r.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},r.prototype.getProjection=function(){return this.projection},r.prototype.getResolutions=function(){return e()},r.prototype.getView=function(){return this.viewPromise_},r.prototype.getState=function(){return this.state_},r.prototype.getWrapX=function(){return this.wrapX_},r.prototype.getInterpolate=function(){return this.interpolate_},r.prototype.refresh=function(){this.changed()},r.prototype.setAttributions=function(t){this.attributions_=Zs(t),this.changed()},r.prototype.setState=function(t){this.state_=t,this.changed()},r}(H),Js="addfeature",Qs="changefeature",$s="clear",tl="removefeature",el="featuresloadstart",rl="featuresloadend",nl="featuresloaderror";function il(t,e){return[[-1/0,-1/0,1/0,1/0]]}var ol="arraybuffer",al="json",sl="text",ll="xml";function ul(t,e,r,n,i,o,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(r,n,i):t,!0),e.getType()==ol&&(s.responseType="arraybuffer"),s.withCredentials=false,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var n=e.getType(),l=void 0;n==al||n==sl?l=s.responseText:n==ll?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):n==ol&&(l=s.response),l?o(e.readFeatures(l,{extent:r,featureProjection:i}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}function hl(t,e){return function(r,n,i,o,a){var s=this;ul(t,e,r,n,i,(function(t,e){s.addFeatures(t),void 0!==o&&o(t)}),a||_)}}var cl=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)}}(),pl=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.feature=r,i.features=n,i}return cl(e,t),e}(s),fl=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{attributions:n.attributions,interpolate:!0,projection:void 0,state:Ao,wrapX:void 0===n.wrapX||n.wrapX})||this).on,r.once,r.un,r.loader_=_,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_&&(it(r.format_,7),r.loader_=hl(r.url_,r.format_)),r.strategy_=void 0!==n.strategy?n.strategy:il;var i,o,a=void 0===n.useSpatialIndex||n.useSpatialIndex;return r.featuresRtree_=a?new Ys:null,r.loadedExtentsRtree_=new Ys,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 nt(o)),void 0!==o&&r.addFeaturesInternal(o),void 0!==i&&r.bindFeaturesCollection_(i),r}return cl(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=n(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var r=t.getGeometry();if(r){var i=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(i,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new pl(Js,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[G(e,E,this.handleFeatureChange_,this),G(e,l,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&&(it(!(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=[],i=[],o=0,a=t.length;o<a;o++){var s=n(u=t[o]);this.addToIndex_(s,u)&&r.push(u)}o=0;for(var l=r.length;o<l;o++){var u;s=n(u=r[o]);this.setupChangeEvents_(s,u);var h=u.getGeometry();if(h){var c=h.getExtent();e.push(c),i.push(u)}else this.nullGeometryFeatures_[s]=u}if(this.featuresRtree_&&this.featuresRtree_.load(e,i),this.hasListener(Js)){o=0;for(var p=r.length;o<p;o++)this.dispatchEvent(new pl(Js,r[o]))}},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(Js,(function(r){e||(e=!0,t.push(r.feature),e=!1)})),this.addEventListener(tl,(function(r){e||(e=!0,t.remove(r.feature),e=!1)})),t.addEventListener(J,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(Q,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(U)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var r=function(t){this.removeFeatureInternal(t)}.bind(this);for(var n in this.featuresRtree_.forEach(r),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var i=new pl($s);this.dispatchEvent(i),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var r=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(r,(function(r){return r.getGeometry().intersectsCoordinate(t)?e(r):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(r){if(r.getGeometry().intersectsExtent(t)){var n=e(r);if(n)return n}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),w(this.nullGeometryFeatures_)||d(t,b(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var 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||y;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(r,n,o,a))<u){i=t;var h=Math.sqrt(a);s[0]=r-h,s[1]=n-h,s[2]=r+h,s[3]=n+h}}})),i},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,r=n(e),i=e.getGeometry();if(i){var o=i.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}else r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[r]=e);var a=e.getId();if(void 0!==a){var s=a.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[r]=e;this.changed(),this.dispatchEvent(new pl(Qs,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:n(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&w(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()},e.prototype.loadFeatures=function(t,e,r){for(var n=this.loadedExtentsRtree_,i=this.strategy_(t,e,r),o=function(t,o){var s=i[t];n.forEachInExtent(s,(function(t){return ie(t.extent,s)}))||(++a.loadingExtentsCount_,a.dispatchEvent(new pl(el)),a.loader_.call(a,s,e,r,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new pl(rl,void 0,t))}.bind(a),function(){--this.loadingExtentsCount_,this.dispatchEvent(new pl(nl))}.bind(a)),n.insert(s,{extent:s.slice()}))},a=this,s=0,l=i.length;s<l;++s)o(s);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,r=this.loadedExtentsRtree_;r.forEachInExtent(t,(function(r){if(pe(r.extent,t))return e=r,!0})),e&&r.remove(e)},e.prototype.removeFeature=function(t){if(t){var e=n(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=n(t),r=this.featureChangeKeys_[e];if(r){r.forEach(U),delete this.featureChangeKeys_[e];var i=t.getId();return void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new pl(tl,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){it(this.format_,7),this.url_=t,this.setLoader(hl(t,this.format_))},e}(Hs),dl=0,gl=1,yl=2,vl=3,_l=4;function ml(t){return Math.pow(t,3)}function xl(t){return 1-ml(1-t)}function bl(t){return 3*t*t-2*t*t*t}function wl(t){return t}var 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 r(e,r,n){var i=t.call(this)||this,o=n||{};return i.tileCoord=e,i.state=r,i.interimTile=null,i.key="",i.transition_=void 0===o.transition?250:o.transition,i.transitionStarts_={},i.interpolate=!!o.interpolate,i}return Sl(r,t),r.prototype.changed=function(){this.dispatchEvent(E)},r.prototype.release=function(){},r.prototype.getKey=function(){return this.key+"/"+this.tileCoord},r.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==yl)return this.transition_=0,t;t=t.interimTile}while(t);return this},r.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==yl){t.interimTile=null;break}t.getState()==gl?e=t:t.getState()==dl?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},r.prototype.getTileCoord=function(){return this.tileCoord},r.prototype.getState=function(){return this.state},r.prototype.setState=function(t){if(this.state!==vl&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},r.prototype.load=function(){e()},r.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:ml(n/this.transition_)},r.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},r.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},r}(C),El=Cl,Tl=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 Rl=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 Tl(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=yl,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=vl,this.unlistenImage_(),this.image_=((t=Ei(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=yl:this.state=_l,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==vl&&(this.state=dl,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==dl&&(this.state=gl,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Es(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(El),Pl=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]<t)return!1;for(var r=e-3;r>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}(),Ol=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)}}(),Fl=function(t){function r(e){var r=t.call(this)||this;return r.map_=e,r}return Ol(r,t),r.prototype.dispatchRenderEvent=function(t,r){e()},r.prototype.calculateMatrices2D=function(t){var e=t.viewState,r=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;Nt(r,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Ut(n,r)},r.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=_r(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&n){var d=Pe(c.getExtent());f.push([-d,0],[d,0])}for(var g=e.layerStatesArray,y=g.length,v=[],_=[],m=0;m<f.length;m++)for(var x=y-1;x>=0;--x){var b=g[x],w=b.layer;if(w.hasRenderer()&&jo(b,u)&&a.call(s,w)){var S=w.getRenderer(),C=w.getSource();if(S&&C){var E=C.getWrapX()?p:t,T=h.bind(null,b.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 R=1/v.length;return v.forEach((function(t,e){return t.distanceSq+=e*R})),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}},r.prototype.forEachLayerAtPixel=function(t,r,n,i,o){return e()},r.prototype.hasFeatureAtCoordinate=function(t,e,r,n,i,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,r,n,y,this,i,o)},r.prototype.getMap=function(){return this.map_},r.prototype.renderFrame=function(t){e()},r.prototype.scheduleExpireIconCache=function(t){bs.canExpireCache()&&t.postRenderFunctions.push(Il)},r}(u);function Il(t,e){bs.expire()}var Ml=Fl,Al=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)}}(),Ll=function(t){function e(e){var r=t.call(this,e)||this;r.fontChangeListenerKey_=G(Wi,l,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 Al(e,t),e.prototype.dispatchRenderEvent=function(t,e){var r=this.getMap();if(r.hasListener(t)){var n=new ka(t,void 0,e);r.dispatchEvent(n)}},e.prototype.disposeInternal=function(){U(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(qn,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<a;++o){var s=e[o];t.layerIndex=o;var l=s.layer,u=l.getSourceState();if(!jo(s,r)||u!=Ao&&u!=Io)l.unrender();else{var h=l.render(t,i);h&&(h!==i&&(this.children_.push(h),i=h),"getDeclutter"in l&&n.push(l))}}for(o=n.length-1;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(Yn,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()&&jo(l,o)&&i(u)){var h=u.getRenderer().getDataAtPixel(t,e,r);if(h){var c=n(u,h);if(c)return c}}}},e}(Ml),kl=Ll,Dl=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)}}(),jl=function(t){function e(e,r){var n=t.call(this,e)||this;return n.layer=r,n}return Dl(e,t),e}(s),zl="layers",Gl=function(t){function e(e){var r=this,n=e||{},i=m({},n);delete i.layers;var o=n.layers;return(r=t.call(this,i)||this).on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(zl,r.handleLayersChanged_),o?Array.isArray(o)?o=new nt(o.slice(),{unique:!0}):it("function"==typeof o.getArray,43):o=new nt(void 0,{unique:!0}),r.setLayers(o),r}return Dl(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(U),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(G(t,J,this.handleLayersAdd_,this),G(t,Q,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(U);x(this.listenerKeys_);for(var r=t.getArray(),n=0,i=r.length;n<i;n++){var o=r[n];this.registerLayerListeners_(o),this.dispatchEvent(new jl("addlayer",o))}this.changed()},e.prototype.registerLayerListeners_=function(t){var r=[G(t,l,this.handleLayerChange_,this),G(t,E,this.handleLayerChange_,this)];t instanceof e&&r.push(G(t,"addlayer",this.handleLayerGroupAdd_,this),G(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[n(t)]=r},e.prototype.handleLayerGroupAdd_=function(t){this.dispatchEvent(new jl("addlayer",t.layer))},e.prototype.handleLayerGroupRemove_=function(t){this.dispatchEvent(new jl("removelayer",t.layer))},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new jl("addlayer",e)),this.changed()},e.prototype.handleLayersRemove_=function(t){var e=t.element,r=n(e);this.listenerKeys_[r].forEach(U),delete this.listenerKeys_[r],this.dispatchEvent(new jl("removelayer",e)),this.changed()},e.prototype.getLayers=function(){return this.get(zl)},e.prototype.setLayers=function(t){var e=this.getLayers();if(e)for(var r=e.getArray(),n=0,i=r.length;n<i;++n)this.dispatchEvent(new jl("removelayer",r[n]));this.set(zl,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],r=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var n=this.getLayerState(),i=n.zIndex;t||void 0!==n.zIndex||(i=0);for(var o=r,a=e.length;o<a;o++){var s=e[o];s.opacity*=n.opacity,s.visible=s.visible&&n.visible,s.maxResolution=Math.min(s.maxResolution,n.maxResolution),s.minResolution=Math.max(s.minResolution,n.minResolution),s.minZoom=Math.max(s.minZoom,n.minZoom),s.maxZoom=Math.min(s.maxZoom,n.maxZoom),void 0!==n.extent&&(void 0!==s.extent?s.extent=Ee(s.extent,n.extent):s.extent=n.extent),void 0===s.zIndex&&(s.zIndex=i)}return e},e.prototype.getSourceState=function(){return Ao},e}(Fo),Nl=Object.freeze({__proto__:null,GroupEvent:jl,default:Gl}),Ul=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)}}(),Bl=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.map=r,i.frameState=void 0!==n?n:null,i}return Ul(e,t),e}(s),Vl=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)}}(),Xl=function(t){function e(e,r,n,i,o){var a=t.call(this,e,r,o)||this;return a.originalEvent=n,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==i&&i,a}return Vl(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(Bl),Wl={SINGLECLICK:"singleclick",CLICK:P,DBLCLICK:O,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},ql="pointermove",Yl="pointerdown",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,r){var n=t.call(this,e)||this;n.map_=e,n.clickTimeoutId_,n.emulateClicks_=!1,n.dragging_=!1,n.dragListenerKeys_=[],n.moveTolerance_=void 0===r?1:r,n.down_=null;var i=n.map_.getViewport();return n.activePointers_=0,n.trackedTouches_={},n.element_=i,n.pointerdownListenerKey_=G(i,Yl,n.handlePointerDown_,n),n.originalPointerMoveEvent_,n.relayedListenerKey_=G(i,ql,n.relayEvent_,n),n.boundHandleTouchMove_=n.handleTouchMove_.bind(n),n.element_.addEventListener(j,n.boundHandleTouchMove_,!!At&&{passive:!1}),n}return Kl(e,t),e.prototype.emulateClick_=function(t){var e=new Xl(Wl.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Xl(Wl.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new Xl(Wl.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==Wl.POINTERUP||e.type==Wl.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==Wl.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new Xl(Wl.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(U),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_,this.updateActivePointers_(t);var e=new Xl(Wl.POINTERDOWN,this.map_,t);for(var r in this.dispatchEvent(e),this.down_={},t){var n=t[r];this.down_[r]="function"==typeof n?_:n}if(0===this.dragListenerKeys_.length){var i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(G(i,Wl.POINTERMOVE,this.handlePointerMove_,this),G(i,Wl.POINTERUP,this.handlePointerUp_,this),G(this.element_,Wl.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(G(this.element_.getRootNode(),Wl.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new Xl(Wl.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new Xl(t.type,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(U(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(j,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(U(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(U),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(C),Hl="postrender",Jl="movestart",Ql="moveend",$l="loadstart",tu="loadend",eu="layergroup",ru="size",nu="target",iu="view",ou=1/0,au=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,x(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){it(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=ou&&(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<n>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<n&&r[l]<r[s]?l:s;e[t]=e[u],r[t]=r[u],t=u}e[t]=i,r[t]=o,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var r=this.elements_,n=this.priorities_,i=r[e],o=n[e];e>t;){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;e<s;++e)(r=n(t=i[e]))==ou?delete this.queuedElements_[this.keyFunction_(t)]:(o[a]=r,i[a++]=t);i.length=a,o.length=a,this.heapify_()},t}(),su=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)}}(),lu=function(t){function e(e,r){var n=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return n.boundHandleTileChange_=n.handleTileChange.bind(n),n.tileChangeCallback_=r,n.tilesLoading_=0,n.tilesLoadingKeys_={},n}return su(e,t),e.prototype.enqueue=function(e){var r=t.prototype.enqueue.call(this,e);r&&e[0].addEventListener(E,this.boundHandleTileChange_);return r},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,r=e.getState();if(r===yl||r===vl||r===_l){e.removeEventListener(E,this.boundHandleTileChange_);var n=e.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var r,n,i=0;this.tilesLoading_<t&&i<e&&this.getCount()>0;)n=(r=this.dequeue()[0]).getKey(),r.getState()!==dl||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++i,r.load())},e}(au);var uu={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},hu=256;function cu(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=Ae(n[0],p,f),v=Ae(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 pu(t){return t}function fu(t,e,r,n){var i=Pe(e)/r[0],o=Ce(e)/r[1];return n?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function du(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),Ae(n,r/2,2*e)}function gu(t,e,r,n,i){return function(o,a,s,l){if(void 0!==o){var u=n?fu(t,n,s,i):t;return(void 0===r||r)&&l?du(o,u,e):Ae(o,e,u)}}}function yu(t){return void 0!==t?0:void 0}function vu(t){return void 0!==t?t:void 0}var _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;r.on,r.once,r.un;var n=m({},e);return r.hints_=[0,0],r.animations_=[],r.updateAnimationKey_,r.projection_=Mr(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&&Er(),n.center&&(n.center=Br(n.center,r.projection_)),n.extent&&(n.extent=Xr(n.extent,r.projection_)),r.applyOptions_(n),r}return _u(e,t),e.prototype.applyOptions_=function(t){var e=m({},t);for(var r in uu)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,f=Mr(t.projection,"EPSG:3857"),d=f.getExtent(),g=t.constrainOnlyCenter,y=t.extent;u||y||!f.isGlobal()||(g=!1,y=d);if(void 0!==t.resolutions){var v=t.resolutions;r=v[a],n=void 0!==v[s]?v[s]:v[v.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?fu(l,r,a,n):l;if(s)return void 0===e||e?du(i,h,u):Ae(i,u,h);var c=Math.min(h,i),f=Math.floor(p(t,c,o));return t[f]>h&&f<t.length-1?t[f+1]:t[f]}}}(v,h,!g&&y,c):gu(r,n,h,!g&&y,c)}else{var _=(d?Math.max(Pe(d),Ce(d)):360*wt[Ct.DEGREES]/f.getMetersPerUnit())/hu/Math.pow(o,0),m=_/Math.pow(o,i-0);void 0!==(r=t.maxResolution)?a=0:r=_/Math.pow(l,a),void 0===(n=t.minResolution)&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?r/Math.pow(l,s):_/Math.pow(l,s):m),s=a+Math.floor(Math.log(r/n)/Math.log(l)),n=r/Math.pow(l,s-a),e=t.constrainResolution?function(t,e,r,n,i,o){return function(a,s,l,u){if(void 0!==a){var h=i?fu(e,i,l,o):e,c=void 0!==r?r:0;if(u)return void 0===n||n?du(a,h,c):Ae(a,c,h);var p=Math.ceil(Math.log(e/h)/Math.log(t)-1e-9),f=-s*(.5-1e-9)+.5,d=Math.min(h,a),g=Math.floor(Math.log(e/d)/Math.log(t)+f),y=Math.max(p,g);return Ae(e/Math.pow(t,y),c,h)}}}(l,r,n,h,!g&&y,c):gu(r,n,h,!g&&y,c)}return{constraint:e,maxResolution:r,minResolution:n,minZoom:a,zoomFactor:l}}(t);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=n.minZoom;var i=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return cu(t.extent,t.constrainOnlyCenter,e)}var r=Mr(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&r.isGlobal()){var n=r.getExtent().slice();return n[0]=-1/0,n[2]=1/0,cu(n,!1,!1)}return pu}(t),o=n.constraint,a=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(o=i||Ge(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=o?0:t:void 0}):!1===e?vu:"number"==typeof e?(r=e,n=2*Math.PI/r,function(t,e){return e?t:void 0!==t?t=Math.floor(t/n+.5)*n:void 0}):vu}return yu;var r,n;var i,o}(t);this.constraints_={center:i,resolution:o,rotation:a},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var r=this.getCenter();if(r){var n=t||[0,0,0,0];e=e||[0,0,0,0];var i=this.getResolution(),o=i/2*(n[3]-e[3]+e[1]-n[1]),a=i/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([r[0]+o,r[1]-a])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=this.getProperties();return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),m({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),r=0;r<e.length;++r){var n=arguments[r];n.center&&((n=m({},n)).center=Br(n.center,this.getProjection())),n.anchor&&((n=m({},n)).anchor=Br(n.anchor,this.getProjection())),e[r]=n}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,r=arguments.length;r>1&&"function"==typeof arguments[r-1]&&(e=arguments[r-1],--r);for(var n=0;n<r&&!this.isDef();++n){var i=arguments[n];i.center&&this.setCenterInternal(i.center),void 0!==i.zoom?this.setZoom(i.zoom):i.resolution&&this.setResolution(i.resolution),void 0!==i.rotation&&this.setRotation(i.rotation)}if(n!==r){for(var o=Date.now(),a=this.targetCenter_.slice(),s=this.targetResolution_,l=this.targetRotation_,u=[];n<r;++n){var h=arguments[n],c={start:o,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||bl,callback:e};if(h.center&&(c.sourceCenter=a,c.targetCenter=h.center.slice(),a=c.targetCenter),void 0!==h.zoom?(c.sourceResolution=s,c.targetResolution=this.getResolutionForZoom(h.zoom),s=c.targetResolution):h.resolution&&(c.sourceResolution=s,c.targetResolution=h.resolution,s=c.targetResolution),void 0!==h.rotation){c.sourceRotation=l;var p=Ne(h.rotation-l+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=l+p,l=c.targetRotation}bu(c)?c.complete=!0:o+=c.duration,u.push(c)}this.animations_.push(u),this.setHint(ls,1),this.updateAnimations_()}else e&&xu(e,!0)},e.prototype.getAnimating=function(){return this.hints_[ls]>0},e.prototype.getInteracting=function(){return this.hints_[us]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(ls,-this.hints_[ls]);for(var e=0,r=this.animations_.length;e<r;++e){var n=this.animations_[e];if(n[0].callback&&xu(n[0].callback,!1),!t)for(var i=0,o=n.length;i<o;++i){var a=n[i];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,r=this.animations_.length-1;r>=0;--r){for(var n=this.animations_[r],i=!0,o=0,a=n.length;o<a;++o){var s=n[o];if(!s.complete){var l=t-s.start,u=s.duration>0?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?Ne(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+h*(s.targetRotation-s.sourceRotation);if(s.anchor){var b=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(b,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(ls,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var w=n[0].callback;w&&xu(w,!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&&(dr(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?Ur(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(uu.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 Vr(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),r=this.getCenterInternal();it(r,1);var n=this.getResolution();it(void 0!==n,2);var i=this.getRotation();return it(void 0!==i,3),Se(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(uu.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Xr(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var r=e||this.getViewportSizeMinusPadding_(),n=Pe(t)/r[0],i=Ce(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(uu.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=wu(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=p(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=Ae(Math.floor(t),0,this.resolutions_.length-2),r=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(r,Ae(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var r;if(it(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))it(!Fe(t),25),r=Bn(n=Xr(t,this.getProjection()));else if(t.getType()===xt){var n;(r=Bn(n=Xr(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),be(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<c;h+=o){var p=i[h]*r-i[h+1]*n,f=i[h]*n+i[h+1]*r;a=Math.min(a,p),s=Math.min(s,f),l=Math.max(l,p),u=Math.max(u,f)}return[a,s,l,u]},e.prototype.fitInternal=function(t,e){var r=e||{},n=r.size;n||(n=this.getViewportSizeMinusPadding_());var i,o=void 0!==r.padding?r.padding:[0,0,0,0],a=void 0!==r.nearest&&r.nearest;i=void 0!==r.minResolution?r.minResolution:void 0!==r.maxZoom?this.getResolutionForZoom(r.maxZoom):0;var s=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(s,[n[0]-o[1]-o[3],n[1]-o[0]-o[2]]);l=isNaN(l)?i:Math.max(l,i),l=this.getConstrainedResolution(l,a?0:1);var u=this.getRotation(),h=Math.sin(u),c=Math.cos(u),p=be(s);p[0]+=(o[1]-o[3])/2*l,p[1]+=(o[0]-o[2])/2*l;var f=p[0]*c-p[1]*h,d=p[1]*c+p[0]*h,g=this.getConstrainedCenter([f,d],l),y=r.callback?r.callback:_;void 0!==r.duration?this.animateInternal({resolution:l,center:g,duration:r.duration,easing:r.easing},y):(this.targetResolution_=l,this.targetCenter_=g,this.applyTargetState_(!1,!0),xu(y,!0))},e.prototype.centerOn=function(t,e,r){this.centerOnInternal(Br(t,this.getProjection()),e,r)},e.prototype.centerOnInternal=function(t,e,r){this.setCenterInternal(wu(t,e,r,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,r,n){var i,o=this.padding_;if(o&&t){var a=this.getViewportSizeMinusPadding_(-r),s=wu(t,n,[a[0]/2+o[3],a[1]/2+o[0]],e,r);i=[t[0]-s[0],t[1]-s[1]]}return i},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=Ur(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var r=e&&Br(e,this.getProjection());this.adjustResolutionInternal(t,r)},e.prototype.adjustResolutionInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*t,0,n,r);e&&(this.targetCenter_=this.calculateCenterZoom(i,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=Br(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,r);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(t?Br(t,this.getProjection()):t)},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var r=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,r),i=this.getViewportSize_(n),o=this.constraints_.resolution(this.targetResolution_,0,i,r),a=this.constraints_.center(this.targetCenter_,o,i,r,this.calculateCenterShift(this.targetCenter_,o,n,i));this.get(uu.ROTATION)!==n&&this.set(uu.ROTATION,n),this.get(uu.RESOLUTION)!==o&&(this.set(uu.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),a&&this.get(uu.CENTER)&&fr(this.get(uu.CENTER),a)||this.set(uu.CENTER,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,r){var n=void 0!==t?t:200,i=e||0,o=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(o),s=this.constraints_.resolution(this.targetResolution_,i,a),l=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,o,a));if(0===n&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=o,this.targetCenter_=l,void this.applyTargetState_();var u=r||(0===n?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===o&&this.getCenterInternal()&&fr(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:l,resolution:s,duration:n,easing:xl,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(us,1)},e.prototype.endInteraction=function(t,e,r){var n=r&&Br(r,this.getProjection());this.endInteractionInternal(t,e,n)},e.prototype.endInteractionInternal=function(t,e,r){this.setHint(us,-1),this.resolveConstraints(t,e,r)},e.prototype.getConstrainedCenter=function(t,e){var r=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),r)},e.prototype.getConstrainedZoom=function(t,e){var r=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(r,e))},e.prototype.getConstrainedResolution=function(t,e){var r=e||0,n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,r,n)},e}(H);function xu(t,e){setTimeout((function(){t(e)}),0)}function bu(t){return!(t.sourceCenter&&t.targetCenter&&!fr(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function wu(t,e,r,n,i){var o=Math.cos(-i),a=Math.sin(-i),s=t[0]*o-t[1]*a,l=t[1]*o+t[0]*a;return[(s+=(e[0]/2-r[0])*n)*o-(l+=(r[1]-e[1]/2)*n)*(a=-a),l*o+s*a]}var Su=mu,Cu=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 Eu(t){t instanceof zo?t.setMapInternal(null):t instanceof Gl&&t.getLayers().forEach(Eu)}function Tu(t,e){if(t instanceof zo)t.setMapInternal(e);else if(t instanceof Gl)for(var r=t.getLayers().getArray(),n=0,i=r.length;n<i;++n)Tu(r[n],e)}var Ru=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var r,n,i,o={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new Gl({layers:t.layers});o[eu]=a,o[nu]=t.target,o[iu]=t.view instanceof Su?t.view:new Su,void 0!==t.controls&&(Array.isArray(t.controls)?r=new nt(t.controls.slice()):(it("function"==typeof t.controls.getArray,47),r=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?n=new nt(t.interactions.slice()):(it("function"==typeof t.interactions.getArray,48),n=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?i=new nt(t.overlays.slice()):(it("function"==typeof t.overlays.getArray,49),i=t.overlays):i=new nt;return{controls:r,interactions:n,keyboardEventTarget:e,overlays:i,values:o}}(e);r.renderComplete_,r.loaded_=!0,r.boundHandleBrowserEvent_=r.handleBrowserEvent.bind(r),r.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,r.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:Ft,r.postRenderTimeoutHandle_,r.animationDelayKey_,r.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(r),r.coordinateToPixelTransform_=[1,0,0,1,0,0],r.pixelToCoordinateTransform_=[1,0,0,1,0,0],r.frameIndex_=0,r.frameState_=null,r.previousExtent_=null,r.viewPropertyListenerKey_=null,r.viewChangeListenerKey_=null,r.layerGroupPropertyListenerKeys_=null,r.viewport_=document.createElement("div"),r.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),r.viewport_.style.position="relative",r.viewport_.style.overflow="hidden",r.viewport_.style.width="100%",r.viewport_.style.height="100%",r.overlayContainer_=document.createElement("div"),r.overlayContainer_.style.position="absolute",r.overlayContainer_.style.zIndex="0",r.overlayContainer_.style.width="100%",r.overlayContainer_.style.height="100%",r.overlayContainer_.style.pointerEvents="none",r.overlayContainer_.className="ol-overlaycontainer",r.viewport_.appendChild(r.overlayContainer_),r.overlayContainerStopEvent_=document.createElement("div"),r.overlayContainerStopEvent_.style.position="absolute",r.overlayContainerStopEvent_.style.zIndex="0",r.overlayContainerStopEvent_.style.width="100%",r.overlayContainerStopEvent_.style.height="100%",r.overlayContainerStopEvent_.style.pointerEvents="none",r.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",r.viewport_.appendChild(r.overlayContainerStopEvent_),r.mapBrowserEventHandler_=null,r.moveTolerance_=e.moveTolerance,r.keyboardEventTarget_=n.keyboardEventTarget,r.targetChangeHandlerKeys_=null,r.controls=n.controls||new nt,r.interactions=n.interactions||new nt,r.overlays_=n.overlays,r.overlayIdIndex_={},r.renderer_=null,r.postRenderFunctions_=[],r.tileQueue_=new lu(r.getTilePriority.bind(r),r.handleTileChange_.bind(r)),r.addChangeListener(eu,r.handleLayerGroupChanged_),r.addChangeListener(iu,r.handleViewChanged_),r.addChangeListener(ru,r.handleSizeChanged_),r.addChangeListener(nu,r.handleTargetChanged_),r.setProperties(n.values);var i=r;return!e.view||e.view instanceof Su||e.view.then((function(t){i.setView(new Su(t))})),r.controls.addEventListener(J,function(t){t.element.setMap(this)}.bind(r)),r.controls.addEventListener(Q,function(t){t.element.setMap(null)}.bind(r)),r.interactions.addEventListener(J,function(t){t.element.setMap(this)}.bind(r)),r.interactions.addEventListener(Q,function(t){t.element.setMap(null)}.bind(r)),r.overlays_.addEventListener(J,function(t){this.addOverlayInternal_(t.element)}.bind(r)),r.overlays_.addEventListener(Q,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(r)),r.controls.forEach(function(t){t.setMap(this)}.bind(r)),r.interactions.forEach(function(t){t.setMap(this)}.bind(r)),r.overlays_.forEach(r.addOverlayInternal_.bind(r)),r}return Cu(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.handleLayerAdd_=function(t){Tu(t.layer,this)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,r){if(this.frameState_&&this.renderer_){var n=this.getCoordinateFromPixelInternal(t),i=void 0!==(r=void 0!==r?r:{}).hitTolerance?r.hitTolerance:0,o=void 0!==r.layerFilter?r.layerFilter:y,a=!1!==r.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,i,a,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var r=[];return this.forEachFeatureAtPixel(t,(function(t){r.push(t)}),e),r},e.prototype.getAllLayers=function(){var t=[];return function e(r){r.forEach((function(r){r instanceof Gl?e(r.getLayers()):t.push(r)}))}(this.getLayers()),t},e.prototype.forEachLayerAtPixel=function(t,e,r){if(this.frameState_&&this.renderer_){var n=r||{},i=void 0!==n.hitTolerance?n.hitTolerance:0,o=n.layerFilter||y;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_||!this.renderer_)return!1;var r=this.getCoordinateFromPixelInternal(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:y,i=void 0!==e.hitTolerance?e.hitTolerance:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(r,this.frameState_,i,o,n,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),r="changedTouches"in t?t.changedTouches[0]:t;return[r.clientX-e.left,r.clientY-e.top]},e.prototype.getTarget=function(){return this.get(nu)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return Ur(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?zt(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(eu)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof nt)e.setLayers(t);else{var r=e.getLayers();r.clear(),r.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoadingOrNotReady=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var n=t[e];if(n.visible){var i=n.layer.getRenderer();if(i&&!i.ready)return!0;var o=n.layer.getSource();if(o&&o.loading)return!0}}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=Br(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?zt(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(ru)},e.prototype.getView=function(){return this.get(iu)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,e,r,n){return function(t,e,r,n,i){if(!t||!(r in t.wantedTiles))return ou;if(!t.wantedTiles[r][e.getKey()])return ou;var o=t.viewState.center,a=n[0]-o[0],s=n[1]-o[1];return 65536*Math.log(i)+Math.sqrt(a*a+s*s)/i}(this.frameState_,t,e,r,n)},e.prototype.handleBrowserEvent=function(t,e){var r=e||t.type,n=new Xl(r,this,t);this.handleMapBrowserEvent(n)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,r=e.type;if(r===Yl||r===z||r===A){var n=this.getOwnerDocument(),i=this.viewport_.getRootNode?this.viewport_.getRootNode():n,o=e.target;if(this.overlayContainerStopEvent_.contains(o)||!(i===n?n.documentElement:i).contains(o))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var a=this.getInteractions().getArray().slice(),s=a.length-1;s>=0;s--){var l=a[s];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var r=this.maxTilesLoading_,n=r;if(t){var i=t.viewHints;if(i[ls]||i[us]){var o=Date.now()-t.time>8;r=o?0:8,n=o?0:2}}e.getTilesLoading()<r&&(e.reprioritize(),e.loadMoreTiles(r,n))}t&&this.renderer_&&!t.animate&&(!0===this.renderComplete_?(this.hasListener(Kn)&&this.renderer_.dispatchRenderEvent(Kn,t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new Bl(tu,this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new Bl($l,this,t))));for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){if(this.mapBrowserEventHandler_){for(var t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)U(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(R,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(z,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,Ri(this.viewport_)}var r=this.getTargetElement();if(r){for(var n in r.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new Zl(this,this.moveTolerance_),Wl)this.mapBrowserEventHandler_.addEventListener(Wl[n],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(R,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(z,this.boundHandleBrowserEvent_,!!At&&{passive:!1});var i=this.getOwnerDocument().defaultView,o=this.keyboardEventTarget_?this.keyboardEventTarget_:r;this.targetChangeHandlerKeys_=[G(o,A,this.handleBrowserEvent,this),G(o,L,this.handleBrowserEvent,this),G(i,D,this.updateSize,this)]}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(U(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(U(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=G(t,l,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=G(t,E,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(U),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.handleLayerAdd_(new jl("addlayer",t)),this.layerGroupPropertyListenerKeys_=[G(t,l,this.render,this),G(t,E,this.render,this),G(t,"addlayer",this.handleLayerAdd_,this),G(t,"removelayer",this.handleLayerRemove_,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var n=t[e].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.handleLayerRemove_=function(t){Eu(t.layer)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,r=this.getSize(),i=this.getView(),o=this.frameState_,a=null;if(void 0!==r&&ci(r)&&i&&i.isDef()){var s=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),l=i.getState();if(a={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:Se(l.center,l.resolution,l.rotation,r),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:r,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:l,viewHints:s,wantedTiles:{},mapId:n(this),renderTargets:{}},l.nextCenter&&l.nextResolution){var u=isNaN(l.nextRotation)?l.rotation:l.nextRotation;a.nextExtent=Se(l.nextCenter,l.nextResolution,u,r)}}if(this.frameState_=a,this.renderer_.renderFrame(a),a){if(a.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,a.postRenderFunctions),o)(!this.previousExtent_||!Fe(this.previousExtent_)&&!pe(a.extent,this.previousExtent_))&&(this.dispatchEvent(new Bl(Jl,this,o)),this.previousExtent_=ue(this.previousExtent_));this.previousExtent_&&!a.viewHints[ls]&&!a.viewHints[us]&&!pe(a.extent,this.previousExtent_)&&(this.dispatchEvent(new Bl(Ql,this,a)),ee(a.extent,this.previousExtent_))}this.dispatchEvent(new Bl(Hl,this,a)),this.renderComplete_=this.hasListener($l)||this.hasListener(tu)||this.hasListener(Kn)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){var e=this.getLayerGroup();e&&this.handleLayerRemove_(new jl("removelayer",e)),this.set(eu,t)},e.prototype.setSize=function(t){this.set(ru,t)},e.prototype.setTarget=function(t){this.set(nu,t)},e.prototype.setView=function(t){if(!t||t instanceof Su)this.set(iu,t);else{this.set(iu,new Su);var e=this;t.then((function(t){e.setView(new Su(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var r=getComputedStyle(t),n=t.offsetWidth-parseFloat(r.borderLeftWidth)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)-parseFloat(r.borderRightWidth),i=t.offsetHeight-parseFloat(r.borderTopWidth)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)-parseFloat(r.borderBottomWidth);isNaN(n)||isNaN(i)||!ci(e=[n,i])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0.")}this.setSize(e),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,r=getComputedStyle(this.viewport_);r.width&&r.height&&(e=[parseInt(r.width,10),parseInt(r.height,10)]),t.setViewportSize(e)}},e}(H);var Pu=Ru,Ou=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)}}(),Fu=function(t){function e(e){var r=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),r.element=n||null,r.target_=null,r.map_=null,r.listenerKeys=[],e.render&&(r.render=e.render),e.target&&r.setTarget(e.target),r}return Ou(e,t),e.prototype.disposeInternal=function(){Ri(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&Ri(this.element);for(var e=0,r=this.listenerKeys.length;e<r;++e)U(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,t)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==_&&this.listenerKeys.push(G(t,Hl,this.render,this)),t.render())},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(H),Iu=Object.freeze({__proto__:null,default:Fu}),Mu=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)}}(),Au=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).ulElement_=document.createElement("ul"),r.collapsed_=void 0===n.collapsed||n.collapsed,r.userCollapsed_=r.collapsed_,r.overrideCollapsible_=void 0!==n.collapsible,r.collapsible_=void 0===n.collapsible||n.collapsible,r.collapsible_||(r.collapsed_=!1);var i=void 0!==n.className?n.className:"ol-attribution",o=void 0!==n.tipLabel?n.tipLabel:"Attributions",a=void 0!==n.expandClassName?n.expandClassName:i+"-expand",s=void 0!==n.collapseLabel?n.collapseLabel:"›",l=void 0!==n.collapseClassName?n.collapseClassName:i+"-collapse";"string"==typeof s?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=s,r.collapseLabel_.className=l):r.collapseLabel_=s;var u=void 0!==n.label?n.label:"i";"string"==typeof u?(r.label_=document.createElement("span"),r.label_.textContent=u,r.label_.className=a):r.label_=u;var h=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_;r.toggleButton_=document.createElement("button"),r.toggleButton_.setAttribute("type","button"),r.toggleButton_.setAttribute("aria-expanded",String(!r.collapsed_)),r.toggleButton_.title=o,r.toggleButton_.appendChild(h),r.toggleButton_.addEventListener(P,r.handleClick_.bind(r),!1);var c=i+" "+"ol-unselectable "+Fi+(r.collapsed_&&r.collapsible_?" ol-collapsed":"")+(r.collapsible_?"":" ol-uncollapsible"),p=r.element;return p.className=c,p.appendChild(r.toggleButton_),p.appendChild(r.ulElement_),r.renderedAttributions_=[],r.renderedVisible_=!0,r}return Mu(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},r=[],n=!0,i=t.layerStatesArray,o=0,a=i.length;o<a;++o){var s=i[o];if(jo(s,t.viewState)){var l=s.layer.getSource();if(l){var u=l.getAttributions();if(u){var h=u(t);if(h)if(n=n&&!1!==l.getAttributionsCollapsible(),Array.isArray(h))for(var c=0,p=h.length;c<p;++c)h[c]in e||(r.push(h[c]),e[h[c]]=!0);else h in e||(r.push(h),e[h]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(n),r},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),r=e.length>0;if(this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),!g(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var n=0,i=e.length;n<i;++n){var o=document.createElement("li");o.innerHTML=e[n],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(Ii),this.collapsed_?Ti(this.collapseLabel_,this.label_):Ti(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(Fu),Lu=Au,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)}}(),Du=function(t){function e(e){var r=this,n=e||{};r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this;var i=void 0!==n.className?n.className:"ol-rotate",o=void 0!==n.label?n.label:"⇧",a=void 0!==n.compassClassName?n.compassClassName:"ol-compass";r.label_=null,"string"==typeof o?(r.label_=document.createElement("span"),r.label_.className=a,r.label_.textContent=o):(r.label_=o,r.label_.classList.add(a));var s=n.tipLabel?n.tipLabel:"Reset rotation",l=document.createElement("button");l.className=i+"-reset",l.setAttribute("type","button"),l.title=s,l.appendChild(r.label_),l.addEventListener(P,r.handleClick_.bind(r),!1);var u=i+" "+"ol-unselectable "+Fi,h=r.element;return h.className=u,h.appendChild(l),r.callResetNorth_=n.resetNorth?n.resetNorth:void 0,r.duration_=void 0!==n.duration?n.duration:250,r.autoHide_=void 0===n.autoHide||n.autoHide,r.rotation_=void 0,r.autoHide_&&r.element.classList.add(Pi),r}return ku(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:xl}):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(Pi);i||0!==r?i&&0!==r&&this.element.classList.remove(Pi):this.element.classList.add(Pi)}this.label_.style.transform=n}this.rotation_=r}},e}(Fu),ju=Du,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)}}(),Gu=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(P,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(P,r.handleClick_.bind(r,-o),!1);var d=i+" "+"ol-unselectable "+Fi,g=r.element;return g.className=d,g.appendChild(p),g.appendChild(f),r.duration_=void 0!==n.duration?n.duration:250,r}return zu(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:xl})):e.setZoom(n)}}},e}(Fu),Nu=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)}}(),Uu="units",Bu="degrees",Vu="imperial",Xu="nautical",Wu="metric",qu="us",Yu=[1,2,5],Ku=25.4/.28,Zu=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+" "+Oi,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=void 0!==n.minWidth?n.minWidth:64,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addChangeListener(Uu,r.handleUnitsChanged_),r.setUnits(n.units||Wu),r.scaleBar_=n.bar||!1,r.scaleBarSteps_=n.steps||4,r.scaleBarText_=n.text||!1,r.dpi_=n.dpi||void 0,r}return Nu(e,t),e.prototype.getUnits=function(){return this.get(Uu)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(Uu,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==Bu?Ct.DEGREES:Ct.METERS,o=Fr(r,t.resolution,e,i),a=this.minWidth_*(this.dpi_||Ku)/Ku,s=a*o,l="";if(n==Bu){var u=wt[Ct.DEGREES];(s*=u)<u/60?(l="″",o*=3600):s<u?(l="′",o*=60):l="°"}else n==Vu?s<.9144?(l="in",o/=.0254):s<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):n==Xu?(o/=1852,l="nm"):n==Wu?s<.001?(l="μm",o*=1e6):s<1?(l="mm",o*=1e3):s<1e3?l="m":(l="km",o/=1e3):n==qu?s<.9144?(l="in",o*=39.37):s<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):it(!1,33);for(var h,c,p,f,d=3*Math.floor(Math.log(a*o)/Math.log(10));;){p=Math.floor(d/3);var g=Math.pow(10,p);if(h=Yu[(d%3+3)%3]*g,c=Math.round(h/o),isNaN(c))return this.element.style.display="none",void(this.renderedVisible_=!1);if(c>=a)break;++d}f=this.scaleBar_?this.createScaleBar(c,h,l):h.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=f&&(this.innerElement_.innerHTML=f,this.renderedHTML_=f),this.renderedWidth_!=c&&(this.innerElement_.style.width=c+"px",this.renderedWidth_=c),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,r){for(var n="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&i.push(this.createMarker("absolute",s)),i.push('<div><div class="ol-scale-singlebar" style="width: '+o+"px;background-color: "+a+';"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,r):"")+"</div>"),s===this.scaleBarSteps_-1&&i.push(this.createStepText(s+1,t,!0,e,r)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+n+"</div>":"")+i.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,r,n,i){var o=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(r?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=Fr(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,Ct.METERS),e=this.dpi_||Ku;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}(Fu),Hu=Zu;var Ju="active",Qu=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 $u(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:xl})}}var th=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 Qu(e,t),e.prototype.getActive=function(){return this.get(Ju)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Ju,t)},e.prototype.setMap=function(t){this.map_=t},e}(H),eh=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)}}(),rh=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 eh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Wl.DBLCLICK){var r=t.originalEvent,n=t.map,i=t.coordinate,o=r.shiftKey?-this.delta_:this.delta_;$u(n.getView(),o,i,this.duration_),r.preventDefault(),e=!0}return!e},e}(th),nh=rh,ih=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 oh(t){for(var e=t.length,r=0,n=0,i=0;i<e;i++)r+=t[i].clientX,n+=t[i].clientY;return[r/e,n/e]}var ah=function(t){function e(e){var r=this,n=e||{};return r=t.call(this,n)||this,n.handleDownEvent&&(r.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(r.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(r.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(r.handleUpEvent=n.handleUpEvent),n.stopDown&&(r.stopDown=n.stopDown),r.handlingDownUpSequence=!1,r.trackedPointers_={},r.targetPointers=[],r}return ih(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Wl.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Wl.POINTERUP){var r=this.handleUpEvent(t);this.handlingDownUpSequence=r&&this.targetPointers.length>0}}else if(t.type==Wl.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==Wl.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===Wl.POINTERDOWN||e===Wl.POINTERDRAG||e===Wl.POINTERUP}(t)){var e=t.originalEvent,r=e.pointerId.toString();t.type==Wl.POINTERUP?delete this.trackedPointers_[r]:(t.type==Wl.POINTERDOWN||r in this.trackedPointers_)&&(this.trackedPointers_[r]=e),this.targetPointers=b(this.trackedPointers_)}},e}(th);function sh(t){var e=arguments;return function(t){for(var r=!0,n=0,i=e.length;n<i&&(r=r&&e[n](t));++n);return r}}var lh=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},uh=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){var e=t.map.getTargetElement(),r=t.map.getOwnerDocument().activeElement;return e.contains(r)}(t)},hh=y,ch=function(t){var e=t.originalEvent;return 0==e.button&&!(Pt&&Ot&&e.ctrlKey)},ph=v,fh=function(t){return t.type==Wl.SINGLECLICK},dh=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},gh=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},yh=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},vh=function(t){var e=t.originalEvent;return it(void 0!==e,56),"mouse"==e.pointerType},_h=function(t){var e=t.originalEvent;return it(void 0!==e,56),e.isPrimary&&0===e.button},mh=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=function(t){function e(e){var r=t.call(this,{stopDown:v})||this,n=e||{};r.kinetic_=n.kinetic,r.lastCentroid=null,r.lastPointersCount_,r.panning_=!1;var i=n.condition?n.condition:sh(dh,_h);return r.condition_=n.onFocusOnly?sh(uh,i):i,r.noKinetic_=!1,r}return mh(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,r=oh(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){var n=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],i=t.map.getView();!function(t,e){t[0]*=e,t[1]*=e}(n,i.getResolution()),dr(n,i.getRotation()),i.adjustCenterInternal(n)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,r=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),i=this.kinetic_.getAngle(),o=r.getCenterInternal(),a=e.getPixelFromCoordinateInternal(o),s=e.getCoordinateFromPixelInternal([a[0]-n*Math.cos(i),a[1]-n*Math.sin(i)]);r.animateInternal({center:r.getConstrainedCenter(s),duration:500,easing:xl})}return this.panning_&&(this.panning_=!1,r.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(ah),bh=xh,wh=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)}}(),Sh=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{stopDown:v})||this).condition_=n.condition?n.condition:lh,r.lastAngle_=void 0,r.duration_=void 0!==n.duration?n.duration:250,r}return wh(e,t),e.prototype.handleDragEvent=function(t){if(vh(t)){var e=t.map,r=e.getView();if(r.getConstraints().rotation!==yu){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!vh(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!vh(t)&&(!(!ch(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(ah),Ch=Sh,Eh=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)}}(),Th=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 Eh(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 Un([r])},e.prototype.getGeometry=function(){return this.geometry_},e}(u),Rh=Th,Ph=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)}}(),Oh="boxstart",Fh="boxdrag",Ih="boxend",Mh="boxcancel",Ah=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.coordinate=r,i.mapBrowserEvent=n,i}return Ph(e,t),e}(s),Lh=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=e||{};return r.box_=new Rh(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:ch,r.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:r.defaultBoxEndCondition,r}return Ph(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 Ah(Fh,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 Ah(e?Ih:Mh,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 Ah(Oh,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(ah),kh=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)}}(),Dh=function(t){function e(e){var r=this,n=e||{},i=n.condition?n.condition:gh;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 kh(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:xl})},e}(Lh),jh=37,zh=38,Gh=39,Nh=40,Uh=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)}}(),Bh=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.defaultCondition_=function(t){return dh(t)&&yh(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 Uh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==A){var r=t.originalEvent,n=r.keyCode;if(this.condition_(t)&&(n==Nh||n==jh||n==Gh||n==zh)){var i=t.map.getView(),o=i.getResolution()*this.pixelDelta_,a=0,s=0;n==Nh?s=-o:n==jh?a=-o:n==Gh?a=o:s=o;var l=[a,s];dr(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:wl,center:t.getConstrainedCenter(i)})}}(i,l,this.duration_),r.preventDefault(),e=!0}}return!e},e}(th),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=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.condition_=n.condition?n.condition:yh,r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:100,r}return Vh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==A||t.type==L){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_;$u(i.getView(),o,void 0,this.duration_),r.preventDefault(),e=!0}}return!e},e}(th),Wh=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)}}(),qh="trackpad",Yh="wheel",Kh=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:hh;return r.condition_=n.onFocusOnly?sh(uh,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 Wh(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==z)return!0;var e,r=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==z&&(e=n.deltaY,Tt&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=Ft),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?qh:Yh);var o=r.getView();if(this.mode_===qh&&!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=-Ae(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(r=r?r>0?1:-1:0),$u(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}(th),Zh=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)}}(),Hh=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=v),(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 Zh(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!==yu){var l=a.getViewport().getBoundingClientRect(),u=oh(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}(ah),Jh=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)}}(),Qh=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=v),(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 Jh(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=oh(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}(ah),$h=Qh,tc=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)}}(),ec="addfeatures",rc=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 tc(e,t),e}(s),nc=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{handleEvent:y})||this).on,r.once,r.un,r.readAsBuffer_=!1,r.formats_=[];for(var i=n.formatConstructors?n.formatConstructors:[],o=0,a=i.length;o<a;++o){var s=i[o];"function"==typeof s&&(s=new s),r.formats_.push(s),r.readAsBuffer_=r.readAsBuffer_||s.getType()===ol}return r.projection_=n.projection?Or(n.projection):null,r.dropListenKeys_=null,r.source_=n.source||null,r.target=n.target?n.target:null,r}return tc(e,t),e.prototype.handleResult_=function(t,e){var r,n=e.target.result,i=this.getMap(),o=this.projection_;o||(o=i.getView().getProjection());for(var a=this.formats_,s=0,l=a.length;s<l;++s){var u=a[s],h=n;this.readAsBuffer_&&u.getType()!==ol&&(void 0===r&&(r=(new TextDecoder).decode(n)),h=r);var c=this.tryReadFeatures_(u,h,{featureProjection:o});if(c&&c.length>0){this.source_&&(this.source_.clear(),this.source_.addFeatures(c)),this.dispatchEvent(new rc(ec,t,c,o));break}}},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[G(e,M,this.handleDrop,this),G(e,F,this.handleStop,this),G(e,I,this.handleStop,this),G(e,M,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(U),this.dropListenKeys_=null)},e.prototype.handleDrop=function(t){for(var e=t.dataTransfer.files,r=0,n=e.length;r<n;++r){var i=e.item(r),o=new FileReader;o.addEventListener(k,this.handleResult_.bind(this,i)),this.readAsBuffer_?o.readAsArrayBuffer(i):o.readAsText(i)}},e.prototype.handleStop=function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},e}(th),ic=nc,oc=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)}}(),ac=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).condition_=n.condition?n.condition:gh,r.lastAngle_=void 0,r.lastMagnitude_=void 0,r.lastScaleDelta_=0,r.duration_=void 0!==n.duration?n.duration:400,r}return oc(e,t),e.prototype.handleDragEvent=function(t){if(vh(t)){var e=t.map,r=e.getSize(),n=t.pixel,i=n[0]-r[0]/2,o=r[1]/2-n[1],a=Math.atan2(o,i),s=Math.sqrt(i*i+o*o),l=e.getView();if(void 0!==this.lastAngle_){var u=this.lastAngle_-a;l.adjustRotationInternal(u)}this.lastAngle_=a,void 0!==this.lastMagnitude_&&l.adjustResolutionInternal(this.lastMagnitude_/s),void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/s),this.lastMagnitude_=s}},e.prototype.handleUpEvent=function(t){if(!vh(t))return!0;var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!vh(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},e}(ah),sc=ac,lc=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)}}(),uc=function(t){function e(e,r,n){var i=t.call(this)||this;if(void 0!==n&&void 0===r)i.setFlatCoordinates(n,e);else{var o=r||0;i.setCenterAndRadius(e,o,n)}return i}return lc(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=t-i[0],a=e-i[1],s=o*o+a*a;if(s<n){if(0===s)for(var l=0;l<this.stride;++l)r[l]=i[l];else{var u=this.getRadius()/Math.sqrt(s);r[0]=i[0]+u*o,r[1]=i[1]+u*a;for(l=2;l<this.stride;++l)r[l]=i[l]}return r.length=this.stride,s}return n},e.prototype.containsXY=function(t,e){var r=this.flatCoordinates,n=t-r[0],i=e-r[1];return n*n+i*i<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,r=e[this.stride]-e[0];return le(e[0]-r,e[1]-r,e[0]+r,e[1]+r,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return xt},e.prototype.intersectsExtent=function(t){if(Oe(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||ve(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;i<e;++i)n[e+i]=t[i];this.setFlatCoordinates(this.layout,n),this.changed()},e.prototype.setCenterAndRadius=function(t,e,r){this.setLayout(r,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var n=this.flatCoordinates,i=ln(n,0,t,this.stride);n[i++]=n[0]+e;for(var o=1,a=this.stride;o<a;++o)n[i++]=n[o];n.length=i,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var r=this.getCenter(),n=this.getStride();this.setCenter(qr(r,0,r.length,n,t,e,r)),this.changed()},e.prototype.translate=function(t,e){var r=this.getCenter(),n=this.getStride();this.setCenter(Yr(r,0,r.length,n,t,e,r)),this.changed()},e}(en);uc.prototype.transform;var hc=uc,cc=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)}}(),pc=function(t){function e(e,r,n){var i=t.call(this)||this;if(i.ends_=[],i.maxDelta_=-1,i.maxDeltaRevision_=-1,Array.isArray(e[0]))i.setCoordinates(e,r);else if(void 0!==r&&n)i.setFlatCoordinates(r,e),i.ends_=n;else{for(var o=i.getLayout(),a=e,s=[],l=[],u=0,h=a.length;u<h;++u){var c=a[u];0===u&&(o=c.getLayout()),d(s,c.getFlatCoordinates()),l.push(s.length)}i.setFlatCoordinates(o,s),i.ends_=l}return i}return cc(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?d(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){return n<re(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(on(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),sn(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,r,n))},e.prototype.getCoordinateAtM=function(t,e,r){if(this.layout!=ht&&this.layout!=ct||0===this.flatCoordinates.length)return null;var n=void 0!==e&&e,i=void 0!==r&&r;return function(t,e,r,n,i,o,a){if(a)return Qn(t,e,r[r.length-1],n,i,o);var s;if(i<t[n-1])return o?((s=t.slice(0,n))[n-1]=i,s):null;if(t[t.length-1]<i)return o?((s=t.slice(t.length-n))[n-1]=i,s):null;for(var l=0,u=r.length;l<u;++l){var h=r[l];if(e!=h){if(i<t[e+n-1])return null;if(i<=t[h-1])return Qn(t,e,h,n,i,!1);e=h}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,n,i)},e.prototype.getCoordinates=function(){return yn(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new ri(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,r=this.layout,n=[],i=0,o=0,a=e.length;o<a;++o){var s=e[o],l=new ri(t.slice(i,s),r);n.push(l),i=s}return n},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,r=0,n=this.ends_,i=this.stride,o=0,a=n.length;o<a;++o){var s=n[o];d(t,Jn(e,r,s,i,.5)),r=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=function(t,e,r,n,i,o,a,s){for(var l=0,u=r.length;l<u;++l){var h=r[l];a=cn(t,e,h,n,i,o,a),s.push(a),e=h}return a}(this.flatCoordinates,0,this.ends_,this.stride,t,r,0,n),new e(r,lt,n)},e.prototype.getType=function(){return vt},e.prototype.intersectsExtent=function(t){return function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){if(Mn(t,e,r[o],n,i))return!0;e=r[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=hn(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(en),fc=pc,dc=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)}}(),gc=function(t){function e(e,r){var n=t.call(this)||this;return r&&!Array.isArray(e[0])?n.setFlatCoordinates(r,e):n.setCoordinates(e,r),n}return dc(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?d(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){if(n<re(this.getExtent(),t,e))return n;for(var i=this.flatCoordinates,o=this.stride,a=0,s=i.length;a<s;a+=o){var l=je(t,e,i[a],i[a+1]);if(l<n){n=l;for(var u=0;u<o;++u)r[u]=i[a+u];r.length=o}}return n},e.prototype.getCoordinates=function(){return gn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new En(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,r=this.stride,n=[],i=0,o=t.length;i<o;i+=r){var a=new En(t.slice(i,i+r),e);n.push(a)}return n},e.prototype.getType=function(){return yt},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,r=this.stride,n=0,i=e.length;n<i;n+=r){if(oe(t,e[n],e[n+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=un(this.flatCoordinates,0,t,this.stride),this.changed()},e}(en),yc=gc;function vc(t,e,r,n){for(var i=[],o=[1/0,1/0,-1/0,-1/0],a=0,s=r.length;a<s;++a){var l=r[a];o=ce(t,e,l[0],n),i.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=l[l.length-1]}return i}var _c=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)}}(),mc=function(t){function e(e,r,n){var i=t.call(this)||this;if(i.endss_=[],i.flatInteriorPointsRevision_=-1,i.flatInteriorPoints_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,!n&&!Array.isArray(e[0])){for(var o=i.getLayout(),a=e,s=[],l=[],u=0,h=a.length;u<h;++u){var c=a[u];0===u&&(o=c.getLayout());for(var p=s.length,f=c.getEnds(),g=0,y=f.length;g<y;++g)f[g]+=p;d(s,c.getFlatCoordinates()),l.push(f)}r=o,e=s,n=l}return void 0!==r&&n?(i.setFlatCoordinates(r,e),i.endss_=n):i.setCoordinates(e,r),i}return _c(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var r=this.flatCoordinates.length;d(this.flatCoordinates,t.getFlatCoordinates());for(var n=0,i=(e=t.getEnds().slice()).length;n<i;++n)e[n]+=r}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,r=new Array(t),n=0;n<t;++n)r[n]=this.endss_[n].slice();var i=new e(this.flatCoordinates.slice(),this.layout,r);return i.applyProperties(this),i},e.prototype.closestPointXY=function(t,e,r,n){return n<re(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];i=on(t,e,s,n,i),e=s[s.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,r,n,i,o,a,s,l,u,h){for(var c=h||[NaN,NaN],p=0,f=r.length;p<f;++p){var d=r[p];u=sn(t,e,d,n,i,o,a,s,l,u,c),e=d[d.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.containsXY=function(t,e){return function(t,e,r,n,i,o){if(0===r.length)return!1;for(var a=0,s=r.length;a<s;++a){var l=r[a];if(Pn(t,e,l,n,i,o))return!0;e=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,r,n){for(var i=0,o=0,a=r.length;o<a;++o){var s=r[o];i+=mn(t,e,s,n),e=s[s.length-1]}return i}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?zn(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,vn(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=vc(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Fn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new yc(this.getFlatInteriorPoints().slice(),ht)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];if(!Dn(t,e,s,n,i))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=zn(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=function(t,e,r,n,i,o,a,s){for(var l=0,u=r.length;l<u;++l){var h=r[l],c=[];a=dn(t,e,h,n,i,o,a,c),s.push(c),e=h[h.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),r,0,n),new e(r,lt,n)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var r=this.endss_[t-1];e=r[r.length-1]}var n=this.endss_[t].slice(),i=n[n.length-1];if(0!==e)for(var o=0,a=n.length;o<a;++o)n[o]-=e;return new Un(this.flatCoordinates.slice(e,i),this.layout,n)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.endss_,n=[],i=0,o=0,a=r.length;o<a;++o){var s=r[o].slice(),l=s[s.length-1];if(0!==i)for(var u=0,h=s.length;u<h;++u)s[u]-=i;var c=new Un(e.slice(i,l),t,s);n.push(c),i=l}return n},e.prototype.getType=function(){return _t},e.prototype.intersectsExtent=function(t){return function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];if(An(t,e,s,n,i))return!0;e=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var r=function(t,e,r,n,i){for(var o=i||[],a=0,s=0,l=r.length;s<l;++s){var u=hn(t,e,r[s],n,o[a]);o[a++]=u,e=u[u.length-1]}return o.length=a,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===r.length)this.flatCoordinates.length=0;else{var n=r[r.length-1];this.flatCoordinates.length=0===n.length?0:n[n.length-1]}this.changed()},e}(en),xc=mc,bc=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)}}(),wc="Point",Sc="LineString",Cc="Polygon",Ec="Circle",Tc="drawstart",Rc="drawend",Pc="drawabort",Oc=function(t){function e(e,r){var n=t.call(this,e)||this;return n.feature=r,n}return bc(e,t),e}(s),Fc=function(t){function e(e){var r=this,n=e;n.stopDown||(n.stopDown=v),(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 pt:case yt:return wc;case ft:case vt:return Sc;case gt:case _t:return Cc;case xt:return Ec;default:throw new Error("Invalid type: "+t)}}(r.type_),r.stopClick_=!!e.stopClick,r.minPoints_=e.minPoints?e.minPoints:r.mode_===Cc?3:2,r.maxPoints_=r.mode_===Ec?2:e.maxPoints?e.maxPoints:1/0,r.finishCondition_=e.finishCondition?e.finishCondition:y;var i,o=e.geometryFunction;if(!o){var a,s=r.mode_;if(s===Ec)o=function(t,e,r){var n=e||new hc([NaN,NaN]),i=Br(t[0]),o=gr(i,Br(t[t.length-1]));return n.setCenterAndRadius(i,Math.sqrt(o)),n};else s===wc?a=En:s===Sc?a=ri:s===Cc&&(a=Un),o=function(t,e,r){return e?s===Cc?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new a(t),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 qs({source:new fl({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(i=co(),function(t,e){return i[t.getGeometry().getType()]}),updateWhileInteracting:!0}),r.geometryName_=e.geometryName,r.condition_=e.condition?e.condition:dh,r.freehandCondition_,e.freehand?r.freehandCondition_=hh:r.freehandCondition_=e.freehandCondition?e.freehandCondition:gh,r.addChangeListener(Ju,r.updateState_),r}return bc(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===R&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==wc&&this.freehandCondition_(e);var r=e.type===Wl.POINTERMOVE,n=!0;!this.freehand_&&this.lastDragTime_&&e.type===Wl.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===Wl.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===Wl.POINTERDOWN?n=!1:r&&this.getPointerCount()<2?(n=e.type===Wl.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===Wl.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===Wl.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 Xl(Wl.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_!==wc||(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===wc)e=!0;else if(i===Ec)e=2===this.sketchCoords_.length;else if(i===Sc)r=this.sketchCoords_.length>this.minPoints_;else if(i===Cc){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<l;s++){var u=n[s],h=a.getPixelFromCoordinate(u),c=t[0]-h[0],p=t[1]-h[1],f=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(c*c+p*p)<=f){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new st(new En(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new st);var e=t.getLinearRing(0),r=this.sketchLine_.getGeometry();r?(r.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),r.changed()):(r=new ri(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(r))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===wc?this.sketchCoords_=t.slice():this.mode_===Cc?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new st(new ri(this.sketchLineCoords_)));var r=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new st,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new Oc(Tc,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,r,n=this.getMap(),i=this.sketchFeature_.getGeometry(),o=n.getView().getProjection();(this.mode_===wc?r=this.sketchCoords_:this.mode_===Cc?(r=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(n.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):r=(e=this.sketchCoords_)[e.length-1],r[0]=t[0],r[1]=t[1],this.geometryFunction_(this.sketchCoords_,i,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(i.getType()===gt&&this.mode_!==Cc)this.createOrUpdateCustomSketchLine_(i);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,r,n=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;o===Sc||o===Ec?(this.finishCoordinate_=t.slice(),(r=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),this.geometryFunction_(r,n,i)):o===Cc&&((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===Sc||n===Ec){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),e.getType()===gt&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(n===Cc){(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_===Sc?(e.pop(),this.geometryFunction_(e,r,n)):this.mode_===Cc&&(e[0].pop(),this.geometryFunction_(e,r,n),e=r.getCoordinates()),this.type_===yt?t.setGeometry(new yc([e])):this.type_===vt?t.setGeometry(new fc([e])):this.type_===_t&&t.setGeometry(new xc([e])),this.dispatchEvent(new Oc(Rc,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 Oc(Pc,t))},e.prototype.appendCoordinates=function(t){var e,r=this.mode_,n=!this.sketchFeature_;if(n&&this.startDrawing_(t[0]),r===Sc||r===Ec)e=this.sketchCoords_;else{if(r!==Cc)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}n&&e.shift(),e.pop();for(var i=0;i<t.length;i++)this.addToDrawing_(t[i]);var o=t[t.length-1];this.addToDrawing_(o),this.modifyDrawing_(o)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var r=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=r.slice(),this.sketchCoords_.push(r.slice()),this.sketchPoint_=new st(new En(r)),this.updateSketchFeatures_(),this.dispatchEvent(new Oc(Tc,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(ah);var Ic=Fc,Mc=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)}}(),Ac="extentchanged",Lc=function(t){function e(e){var r=t.call(this,Ac)||this;return r.extent=e,r}return Mc(e,t),e}(s);function kc(){var t=co();return function(e,r){return t[gt]}}function Dc(){var t=co();return function(e,r){return t[pt]}}function jc(t){return function(e){return $t([t,e])}}function zc(t,e){return t[0]==e[0]?function(r){return $t([t,[r[0],e[1]]])}:t[1]==e[1]?function(r){return $t([t,[e[0],r[1]]])}:null}var Gc=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).on,r.once,r.un,r.condition_=n.condition?n.condition:hh,r.extent_=null,r.pointerHandler_=null,r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.snappedToVertex_=!1,r.extentFeature_=null,r.vertexFeature_=null,e||(e={}),r.extentOverlay_=new qs({source:new fl({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.boxStyle?e.boxStyle:kc(),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.vertexOverlay_=new qs({source:new fl({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.pointerStyle?e.pointerStyle:Dc(),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.extent&&r.setExtent(e.extent),r}return Mc(e,t),e.prototype.snapToVertex_=function(t,e){var r=e.getCoordinateFromPixelInternal(t),n=this.getExtentInternal();if(n){var i=function(t){return[[[t[0],t[1]],[t[0],t[3]]],[[t[0],t[3]],[t[2],t[3]]],[[t[2],t[3]],[t[2],t[1]]],[[t[2],t[1]],[t[0],t[1]]]]}(n);i.sort((function(t,e){return vr(r,t)-vr(r,e)}));var o=i[0],a=pr(r,o),s=e.getPixelFromCoordinateInternal(a);if(yr(t,s)<=this.pixelTolerance_){var l=e.getPixelFromCoordinateInternal(o[0]),u=e.getPixelFromCoordinateInternal(o[1]),h=gr(s,l),c=gr(s,u),p=Math.sqrt(Math.min(h,c));return this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(a=h>c?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(Bn(t)):e.setGeometry(void 0):(e=new st(t?Bn(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 st(new En(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.originalEvent||!this.condition_(e)||(e.type!=Wl.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_=jc(o(i)):null!==a?this.pointerHandler_=zc(o([a,n[1]]),o([a,n[3]])):null!==s&&(this.pointerHandler_=zc(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_=jc(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!==_e(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 Vr(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 Lc(this.extent_))},e}(ah),Nc=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)}}(),Uc=[0,0,0,0],Bc=[],Vc="modifystart",Xc="modifyend",Wc=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.features=r,i.mapBrowserEvent=n,i}return Nc(e,t),e}(s),qc=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:_h,n.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&fh(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:hh,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.featuresBeingModified_=null,n.rBush_=new Ys,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new qs({source:new fl({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:Hc(),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 nt(n.source_.getFeatures()),n.source_.addEventListener(Js,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(tl,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(J,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(Q,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n.delta_=[0,0],n.snapToPointer_=void 0===e.snapToPointer?!n.hitDetection_:e.snapToPointer,n}return Nc(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(E,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new nt;for(var r=this.featuresBeingModified_.getArray(),n=0,i=e.length;n<i;++n)for(var o=e[n],a=0,s=o.length;a<s;++a){var l=o[a].feature;l&&-1===r.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new Wc(Vc,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(E,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,r=[];e.forEach((function(e){t===e.feature&&r.push(e)}));for(var n=r.length-1;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<i;++n){var o=r[n],a={feature:t,geometry:e,depth:[n],index:n,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length-1;n<i;++n){var o=r.slice(n,n+2),a={feature:t,geometry:e,index:n,segment:o};this.rBush_.insert($t(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,geometry:e,depth:[n],index:a,segment:l};this.rBush_.insert($t(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,geometry:e,depth:[n],index:a,segment:l};this.rBush_.insert($t(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length;a<s;++a)for(var l=o[a],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,geometry:e,depth:[a,n],index:u,segment:c};this.rBush_.insert($t(c),p)}},e.prototype.writeCircleGeometry_=function(t,e){var r=e.getCenter(),n={feature:t,geometry:e,index:0,segment:[r,r]},i={feature:t,geometry:e,index:1,segment:[r,r]},o=[n,i];n.featureSegments=o,i.featureSegments=o,this.rBush_.insert(he(r),n);var a=e;this.rBush_.insert(a.getExtent(),i)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var r=e.getGeometriesArray(),n=0;n<r.length;++n){var i=r[n];(0,this.SEGMENT_WRITERS_[i.getType()])(t,i)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,r){var n=this.vertexFeature_;n?n.getGeometry().setCoordinates(t):(n=new st(new En(t)),this.vertexFeature_=n,this.overlay_.getSource().addFeature(n));return n.set("features",e),n.set("geometries",r),n},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=Wl.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(r=!(e.type!=Wl.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==Wl.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!r);var r},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],r=[],n=[],i=0,o=this.dragSegments_.length;i<o;++i){var a=this.dragSegments_[i],s=a[0],l=s.feature;-1===r.indexOf(l)&&r.push(l);var u=s.geometry;-1===n.indexOf(u)&&n.push(u);for(var h=s.depth,c=void 0,p=s.segment,f=a[1];e.length<u.getStride();)e.push(p[f][e.length]);switch(u.getType()){case pt:c=e,p[0]=e,p[1]=e;break;case yt:(c=u.getCoordinates())[s.index]=e,p[0]=e,p[1]=e;break;case ft:(c=u.getCoordinates())[s.index+f]=e,p[f]=e;break;case vt:case gt:(c=u.getCoordinates())[h[0]][s.index+f]=e,p[f]=e;break;case _t:(c=u.getCoordinates())[h[1]][h[0]][s.index+f]=e,p[f]=e;break;case xt:if(p[0]=e,p[1]=e,0===s.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var d=yr(Br(u.getCenter()),Br(e));u.setRadius(d),this.changingFeature_=!1}}c&&this.setGeometryCoordinates_(u,c)}this.createOrUpdateVertexFeature_(e,r,n)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var r=this.vertexFeature_;if(r){var i=t.map.getView().getProjection(),o=[],a=r.getGeometry().getCoordinates(),s=$t([a]),l=this.rBush_.getInExtent(s),u={};l.sort(Yc);for(var h=0,c=l.length;h<c;++h){var p=l[h],f=p.segment,d=n(p.geometry),g=p.depth;if(g&&(d+="-"+g.join("-")),u[d]||(u[d]=new Array(2)),p.geometry.getType()!==xt||1!==p.index)if(!fr(f[0],a)||u[d][0])if(!fr(f[1],a)||u[d][1])n(f)in this.vertexSegments_&&!u[d][0]&&!u[d][1]&&this.insertVertexCondition_(t)&&o.push(p);else{if((p.geometry.getType()===ft||p.geometry.getType()===vt)&&u[d][0]&&0===u[d][0].index)continue;this.dragSegments_.push([p,1]),u[d][1]=p}else this.dragSegments_.push([p,0]),u[d][0]=p;else fr(Zc(e,p,i),a)&&!u[d][0]&&(this.dragSegments_.push([p,0]),u[d][0]=p)}o.length&&this.willModifyFeatures_(t,[o]);for(var y=o.length-1;y>=0;--y)this.insertVertex_(o[y],a)}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(n.getType()===xt){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(he(i),o);var s=n;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update($t(r.segment),r)}return this.featuresBeingModified_&&(this.dispatchEvent(new Wc(Xc,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 i,o,a=this,s=r||e.getCoordinateFromPixel(t),l=e.getView().getProjection();if(this.hitDetection_){var u="object"==typeof this.hitDetection_?function(t){return t===a.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,r){if((r=r||t.getGeometry()).getType()===pt&&c(a.features_.getArray(),t)){o=r;var n=r.getFlatCoordinates().slice(0,2);i=[{feature:t,geometry:r,segment:[n,n]}]}return!0}),{layerFilter:u})}if(!i){var h=Vr(te(Xr(he(s,Uc)),e.getView().getResolution()*this.pixelTolerance_,Uc));i=this.rBush_.getInExtent(h)}if(i&&i.length>0){var p=i.sort((function(t,e){return Kc(s,t,l)-Kc(s,e,l)}))[0],f=p.segment,d=Zc(s,p,l),g=e.getPixelFromCoordinate(d),y=yr(t,g);if(o||y<=this.pixelTolerance_){var v={};if(v[n(f)]=!0,this.snapToPointer_||(this.delta_[0]=d[0]-s[0],this.delta_[1]=d[1]-s[1]),p.geometry.getType()===xt&&1===p.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(d,[p.feature],[p.geometry]);else{var _=e.getPixelFromCoordinate(f[0]),m=e.getPixelFromCoordinate(f[1]),x=gr(g,_),b=gr(g,m);y=Math.sqrt(Math.min(x,b)),this.snappedToVertex_=y<=this.pixelTolerance_,this.snappedToVertex_&&(d=x>b?f[1]:f[0]),this.createOrUpdateVertexFeature_(d,[p.feature],[p.geometry]);var w={};w[n(p.geometry)]=!0;for(var S=1,C=i.length;S<C;++S){var E=i[S].segment;if(!(fr(f[0],E[0])&&fr(f[1],E[1])||fr(f[0],E[1])&&fr(f[1],E[0])))break;var T=n(i[S].geometry);T in w||(w[T]=!0,v[n(E)]=!0)}}return void(this.vertexSegments_=v)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var r,n=t.segment,i=t.feature,o=t.geometry,a=t.depth,s=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case vt:case gt:(r=o.getCoordinates())[a[0]].splice(s+1,0,e);break;case _t:(r=o.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case ft:(r=o.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(o,r);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(o,s,a,1);var u={segment:[n[0],e],feature:i,geometry:o,depth:a,index:s};l.insert($t(u.segment),u),this.dragSegments_.push([u,1]);var h={segment:[e,n[1]],feature:i,geometry:o,depth:a,index:s+1};l.insert($t(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=Wl.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new Wc(Xc,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,r,i,o,a,s,l,u,h,c,p=this.dragSegments_,f={},d=!1;for(o=p.length-1;o>=0;--o)c=n((h=(r=p[o])[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,s=f[c].left,(l=(a=f[c].index)-1)<0&&(l=0),t=e=(i=(h=void 0!==s?s:u).geometry).getCoordinates(),d=!1,i.getType()){case vt:e[h.depth[0]].length>2&&(e[h.depth[0]].splice(a,1),d=!0);break;case ft:e.length>2&&(e.splice(a,1),d=!0);break;case _t:t=t[h.depth[1]];case gt:(t=t[h.depth[0]]).length>4&&(a==t.length-1&&(a=0),t.splice(a,1),d=!0,0===a&&(t.pop(),t.push(t[0]),l=t.length-1))}if(d){this.setGeometryCoordinates_(i,e);var g=[];if(void 0!==s&&(this.rBush_.remove(s),g.push(s.segment[0])),void 0!==u&&(this.rBush_.remove(u),g.push(u.segment[1])),void 0!==s&&void 0!==u){var y={depth:h.depth,feature:h.feature,geometry:h.geometry,index:l,segment:g};this.rBush_.insert($t(y.segment),y)}this.updateSegmentIndices_(i,a,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||g(i.depth,r))&&i.index>e&&(i.index+=n)}))},e}(ah);function Yc(t,e){return t.index-e.index}function Kc(t,e,r){var n=e.geometry;if(n.getType()===xt){var i=n;if(1===e.index){null;var o=gr(i.getCenter(),Br(t)),a=Math.sqrt(o)-i.getRadius();return a*a}}var s=Br(t);return Bc[0]=Br(e.segment[0]),Bc[1]=Br(e.segment[1]),vr(s,Bc)}function Zc(t,e,r){var n=e.geometry;if(n.getType()===xt&&1===e.index){var i=n;return Ur(i.getClosestPoint(Br(t)))}var o=Br(t);return Bc[0]=Br(e.segment[0]),Bc[1]=Br(e.segment[1]),Ur(pr(o,Bc))}function Hc(){var t=co();return function(e,r){return t[pt]}}var Jc=qc,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="select",tp=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 Qc(e,t),e}(s),ep={},rp=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:fh,r.addCondition_=o.addCondition?o.addCondition:ph,r.removeCondition_=o.removeCondition?o.removeCondition:ph,r.toggleCondition_=o.toggleCondition?o.toggleCondition:gh,r.multi_=!!o.multi&&o.multi,r.filter_=o.filter?o.filter:y,r.hitTolerance_=o.hitTolerance?o.hitTolerance:0,r.style_=void 0!==o.style?o.style:(d((n=co())[gt],n[ft]),d(n[mt],n[ft]),function(t){return t.getGeometry()?n[t.getGeometry().getType()]:null}),r.features_=o.features||new nt,o.layers)if("function"==typeof o.layers)i=o.layers;else{var a=o.layers;i=function(t){return c(a,t)}}else i=y;return r.layerFilter_=i,r.featureLayerAssociation_={},r}return Qc(e,t),e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[n(t)]=e},e.prototype.getFeatures=function(){return this.features_},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[n(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(J,this.boundAddFeature_),this.features_.addEventListener(Q,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(J,this.boundAddFeature_),this.features_.removeEventListener(Q,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 qs&&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=n(t);e in ep||(ep[e]=t.getStyle()),t.setStyle(this.style_)},e.prototype.restorePreviousStyle_=function(t){for(var r=this.getMap().getInteractions().getArray(),i=r.length-1;i>=0;--i){var o=r[i];if(o!==this&&o instanceof e&&o.getStyle()&&-1!==o.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(o.getStyle())}var a=n(t);t.setStyle(ep[a]),delete ep[a]},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[n(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){x(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),p=l.indexOf(h);p>-1?l.splice(p,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||c(a.getArray(),t)?(r||n)&&c(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 f=s.length-1;f>=0;--f)a.remove(s[f]);a.extend(l)}return(l.length>0||s.length>0)&&this.dispatchEvent(new tp($c,l,s,t)),!0},e}(th);var np=rp,ip=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 op(t){return t.feature?t.feature:t.element?t.element:void 0}var ap=[],sp=function(t){function e(e){var r=this,n=e||{},i=n;return i.handleDownEvent||(i.handleDownEvent=y),i.stopDown||(i.stopDown=v),(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 Ys,r.GEOMETRY_SEGMENTERS_={Point:r.segmentPointGemetry_.bind(r),LineString:r.segmentLineStringGemetry_.bind(r),LinearRing:r.segmentLineStringGemetry_.bind(r),Polygon:r.segmentPolygonGemetry_.bind(r),MultiPoint:r.segmentMultiPointGemetry_.bind(r),MultiLineString:r.segmentMultiLineStringGemetry_.bind(r),MultiPolygon:r.segmentMultiPolygonGemetry_.bind(r),GeometryCollection:r.segmentGeometryCollectionGemetry_.bind(r),Circle:r.segmentCircleGemetry_.bind(r)},r}return ip(e,t),e.prototype.addFeature=function(t,e){var r=void 0===e||e,i=n(t),o=t.getGeometry();if(o){var a=this.GEOMETRY_SEGMENTERS_[o.getType()];if(a){this.indexedFeaturesExtents_[i]=o.getExtent([1/0,1/0,-1/0,-1/0]);var s=[];if(a(s,o),1===s.length)this.rBush_.insert($t(s[0]),{feature:t,segment:s[0]});else if(s.length>1){var l=s.map((function(t){return $t(t)})),u=s.map((function(e){return{feature:t,segment:e}}));this.rBush_.load(l,u)}}}r&&(this.featureChangeListenerKeys_[i]=G(t,E,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=op(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=op(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var r=n(e);r in this.pendingFeatures_||(this.pendingFeatures_[r]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=b(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,i=n(t),o=this.indexedFeaturesExtents_[i];if(o){var a=this.rBush_,s=[];a.forEachInExtent(o,(function(e){t===e.feature&&s.push(e)}));for(var l=s.length-1;l>=0;--l)a.remove(s[l])}r&&(U(this.featureChangeListenerKeys_[i]),delete this.featureChangeListenerKeys_[i])},e.prototype.setMap=function(e){var r=this.getMap(),n=this.featuresListenerKeys_,i=this.getFeatures_();r&&(n.forEach(U),n.length=0,i.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?n.push(G(this.features_,J,this.handleFeatureAdd_,this),G(this.features_,Q,this.handleFeatureRemove_,this)):this.source_&&n.push(G(this.source_,Js,this.handleFeatureAdd_,this),G(this.source_,tl,this.handleFeatureRemove_,this)),i.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,r){var n=$t([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=Br(e),l=1/0,u=this.pixelTolerance_*this.pixelTolerance_,h=function(){if(a){var e=r.getPixelFromCoordinate(a);if(gr(t,e)<=u)return{vertex:a,vertexPixel:[Math.round(e[0]),Math.round(e[1])]}}return null};if(this.vertex_){for(var c=0;c<o;++c){(p=i[c]).feature.getGeometry().getType()!==xt&&p.segment.forEach((function(t){var e=Br(t),r=gr(s,e);r<l&&(a=t,l=r)}))}if(m=h())return m}if(this.edge_){for(c=0;c<o;++c){var p,f=null;if((p=i[c]).feature.getGeometry().getType()===xt){var d=p.feature.getGeometry();null,f=Ur(cr(s,d))}else{var g=p.segment,y=g[0],v=g[1];v&&(ap[0]=Br(y),ap[1]=Br(v),f=pr(s,ap))}if(f){var _=gr(s,f);_<l&&(a=f,l=_)}}var m;if(m=h())return m}return null},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.segmentCircleGemetry_=function(t,e){this.getMap().getView().getProjection();for(var r=Vn(e).getCoordinates()[0],n=0,i=r.length-1;n<i;++n)t.push(r.slice(n,n+2))},e.prototype.segmentGeometryCollectionGemetry_=function(t,e){for(var r=e.getGeometriesArray(),n=0;n<r.length;++n){var i=this.GEOMETRY_SEGMENTERS_[r[n].getType()];i&&i(t,r[n])}},e.prototype.segmentLineStringGemetry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length-1;n<i;++n)t.push(r.slice(n,n+2))},e.prototype.segmentMultiLineStringGemetry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a)t.push(o.slice(a,a+2))},e.prototype.segmentMultiPointGemetry_=function(t,e){e.getCoordinates().forEach((function(e){t.push([e])}))},e.prototype.segmentMultiPolygonGemetry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length;a<s;++a)for(var l=o[a],u=0,h=l.length-1;u<h;++u)t.push(l.slice(u,u+2))},e.prototype.segmentPointGemetry_=function(t,e){t.push([e.getCoordinates()])},e.prototype.segmentPolygonGemetry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a)t.push(o.slice(a,a+2))},e}(ah),lp=sp,up=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)}}(),hp="translatestart",cp="translating",pp="translateend",fp=function(t){function e(e,r,n,i,o){var a=t.call(this,e)||this;return a.features=r,a.coordinate=n,a.startCoordinate=i,a.mapBrowserEvent=o,a}return up(e,t),e}(s),dp=function(t){function e(e){var r,n=this,i=e||{};if((n=t.call(this,i)||this).on,n.once,n.un,n.lastCoordinate_=null,n.startCoordinate_=null,n.features_=void 0!==i.features?i.features:null,i.layers&&!n.features_)if("function"==typeof i.layers)r=i.layers;else{var o=i.layers;r=function(t){return c(o,t)}}else r=y;return n.layerFilter_=r,n.filter_=i.filter&&!n.features_?i.filter:y,n.hitTolerance_=i.hitTolerance?i.hitTolerance:0,n.condition_=i.condition?i.condition:hh,n.lastFeature_=null,n.addChangeListener(Ju,n.handleActiveChanged_),n}return up(e,t),e.prototype.handleDownEvent=function(t){if(!t.originalEvent||!this.condition_(t))return!1;if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new nt([this.lastFeature_]);return this.dispatchEvent(new fp(hp,e,t.coordinate,this.startCoordinate_,t)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new nt([this.lastFeature_]);return this.dispatchEvent(new fp(pp,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,r=e[0]-this.lastCoordinate_[0],n=e[1]-this.lastCoordinate_[1],i=this.features_||new nt([this.lastFeature_]);i.forEach((function(t){var e=t.getGeometry();e.translate(r,n),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new fp(cp,i,e,this.startCoordinate_,t))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||c(this.features_.getArray(),t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var r=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(r)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),r=this.getActive();e&&r||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(ah),gp=dp;function yp(t){var e=t||{},r=new nt,n=new Pl(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&r.push(new Ch),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&r.push(new nh({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&r.push(new bh({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&r.push(new Hh),(void 0===e.pinchZoom||e.pinchZoom)&&r.push(new $h({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(r.push(new Bh),r.push(new Xh({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&r.push(new Kh({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&r.push(new Dh({duration:e.zoomDuration})),r}var vp=Object.freeze({__proto__:null,defaults:yp,DoubleClickZoom:nh,DragAndDrop:ic,DragBox:Lh,DragPan:bh,DragRotate:Ch,DragRotateAndZoom:sc,DragZoom:Dh,Draw:Ic,Extent:Gc,Interaction:th,KeyboardPan:Bh,KeyboardZoom:Xh,Modify:Jc,MouseWheelZoom:Kh,PinchRotate:Hh,PinchZoom:$h,Pointer:ah,Select:np,Snap:lp,Translate:gp}),_p=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)}}(),mp=function(t){function e(e){return(e=m({},e)).controls||(e.controls=function(t){var e=t||{},r=new nt;return(void 0===e.zoom||e.zoom)&&r.push(new Gu(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&r.push(new ju(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&r.push(new Lu(e.attributionOptions)),r}()),e.interactions||(e.interactions=yp({onFocusOnly:!0})),t.call(this,e)||this}return _p(e,t),e.prototype.createRenderer=function(){return new kl(this)},e}(Pu),xp=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 it(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 it(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.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){it(!(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}();function bp(t,e,r,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=r,n):[t,e,r]}function wp(t,e,r){return t+"/"+e+"/"+r}function Sp(t){return wp(t[0],t[1],t[2])}function Cp(t){return t.split("/").map(Number)}function Ep(t){return(t[1]<<t[0])+t[2]}var Tp=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)}}(),Rp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Tp(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=Cp(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Sp(e.tileCoord)),e.release())}.bind(this))}},e}(xp),Pp=Rp,Op=function(){function t(t,e,r,n){this.minX=t,this.maxX=e,this.minY=r,this.maxY=n}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Fp(t,e,r,n,i){return void 0!==i?(i.minX=t,i.maxX=e,i.minY=r,i.maxY=n,i):new Op(t,e,r,n)}var Ip=Op,Mp=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)}}(),Ap=[],Lp=function(t){function e(e,r,n,i){var o=t.call(this,e,r,{transition:0})||this;return o.context_={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.hitDetectionImageData={},o.replayState_={},o.sourceTiles=[],o.errorTileKeys={},o.wantedResolution,o.getSourceTiles=i.bind(void 0,o),o.wrappedTileCoord=n,o}return Mp(e,t),e.prototype.getContext=function(t){var e=n(t);return e in this.context_||(this.context_[e]=Ei(1,1,Ap)),this.context_[e]},e.prototype.hasContext=function(t){return n(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=n(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_)Ap.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(El),kp=Lp,Dp=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)}}(),jp=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,a)||this;return s.extent=null,s.format_=i,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=o,s.url_=n,s.key=n,s}return Dp(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==dl&&(this.setState(gl),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(vl)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(yl)},e.prototype.setLoader=function(t){this.loader_=t},e}(El),zp=jp,Gp=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)}}(),Np=function(t){function e(e){var r=t.call(this)||this;return r.geometries_=e||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return Gp(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(U),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(G(this.geometries_[t],E,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){if(n<re(this.getExtent(),t,e))return n;for(var i=this.geometries_,o=0,a=i.length;o<a;++o)n=i[o].closestPointXY(t,e,r,n);return n},e.prototype.containsXY=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)if(r[n].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){ue(t);for(var e=this.geometries_,r=0,n=e.length;r<n;++r)fe(t,e[r].getExtent());return t},e.prototype.getGeometries=function(){return Up(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,r=0,n=e.length;r<n;++r)e[r].getType()===this.getType()?t=t.concat(e[r].getGeometriesArrayRecursive()):t.push(e[r]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var r=[],n=this.geometries_,i=!1,o=0,a=n.length;o<a;++o){var s=n[o],l=s.getSimplifiedGeometry(t);r.push(l),l!==s&&(i=!0)}if(i){var u=new e(null);return u.setGeometriesArray(r),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return mt},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,r=0,n=e.length;r<n;++r)if(e[r].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,r){var n=r;n||(n=be(this.getExtent()));for(var i=this.geometries_,o=0,a=i.length;o<a;++o)i[o].scale(t,e,n);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(Up(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,r=0,n=e.length;r<n;++r)e[r].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Jr);function Up(t){for(var e=[],r=0,n=t.length;r<n;++r)e.push(t[r].clone());return e}var Bp=Np,Vp=[1,0,0,1,0,0],Xp=function(){function t(t,e,r,n,i){this.styleFunction,this.extent_,this.id_=i,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r,this.properties_=n}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===pt?he(this.flatCoordinates_):ce(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=be(this.getExtent());this.flatInteriorPoints_=On(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=vc(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=Fn(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Jn(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,r=this.ends_,n=0,i=r.length;n<i;++n){var o=r[n],a=Jn(t,e,o,2,.5);d(this.flatMidpoints_,a),e=o}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){return this.styleFunction},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=Or(t)).getExtent(),r=t.getWorldExtent();if(e&&r){var n=Ce(r)/Ce(e);Nt(Vp,r[0],r[3],n,-n,0,0,0),Wr(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Vp,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();Xp.prototype.getEndss=Xp.prototype.getEnds,Xp.prototype.getFlatCoordinates=Xp.prototype.getOrientedFlatCoordinates;var Wp=Xp,qp=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var r;if(e){var n=e.dataProjection?Or(e.dataProjection):this.readProjection(t);e.extent&&n&&n.getUnits()===Ct.TILE_PIXELS&&(n=Or(n)).setWorldExtent(e.extent),r={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(r)},t.prototype.adaptOptions=function(t){return m({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return e()},t.prototype.readFeature=function(t,r){return e()},t.prototype.readFeatures=function(t,r){return e()},t.prototype.readGeometry=function(t,r){return e()},t.prototype.readProjection=function(t){return e()},t.prototype.writeFeature=function(t,r){return e()},t.prototype.writeFeatures=function(t,r){return e()},t.prototype.writeGeometry=function(t,r){return e()},t}();function Yp(t,e,r){var n,i=r?Or(r.featureProjection):null,o=r?Or(r.dataProjection):null;if(n=i&&o&&!Lr(i,o)?(e?t.clone():t).transform(e?i:o,e?o:i):t,e&&r&&void 0!==r.decimals){var a=Math.pow(10,r.decimals);n===t&&(n=t.clone()),n.applyTransform((function(t){for(var e=0,r=t.length;e<r;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return n}var 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)}}(),Zp=function(t){function r(){return t.call(this)||this}return Kp(r,t),r.prototype.getType=function(){return al},r.prototype.readFeature=function(t,e){return this.readFeatureFromObject(Hp(t),this.getReadOptions(t,e))},r.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(Hp(t),this.getReadOptions(t,e))},r.prototype.readFeatureFromObject=function(t,r){return e()},r.prototype.readFeaturesFromObject=function(t,r){return e()},r.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(Hp(t),this.getReadOptions(t,e))},r.prototype.readGeometryFromObject=function(t,r){return e()},r.prototype.readProjection=function(t){return this.readProjectionFromObject(Hp(t))},r.prototype.readProjectionFromObject=function(t){return e()},r.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},r.prototype.writeFeatureObject=function(t,r){return e()},r.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},r.prototype.writeFeaturesObject=function(t,r){return e()},r.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},r.prototype.writeGeometryObject=function(t,r){return e()},r}(qp);function Hp(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var Jp=Zp,Qp=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 $p(t,e){if(!t)return null;var r;switch(t.type){case pt:r=function(t){return new En(t.coordinates)}(t);break;case ft:r=function(t){return new ri(t.coordinates)}(t);break;case gt:r=function(t){return new Un(t.coordinates)}(t);break;case yt:r=function(t){return new yc(t.coordinates)}(t);break;case vt:r=function(t){return new fc(t.coordinates)}(t);break;case _t:r=function(t){return new xc(t.coordinates)}(t);break;case mt:r=function(t,e){var r=t.geometries.map((function(t){return $p(t,e)}));return new Bp(r)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return Yp(r,!1,e)}function tf(t,e){var r,n=(t=Yp(t,!0,e)).getType();switch(n){case pt:r=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case ft:r=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case gt:r=function(t,e){var r;e&&(r=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(r)}}(t,e);break;case yt:r=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case vt:r=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case _t:r=function(t,e){var r;e&&(r=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(r)}}(t,e);break;case mt:r=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var r=m({},e);return delete r.featureProjection,tf(t,r)}))}}(t,e);break;case xt:r={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+n)}return r}var ef=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this)||this).dataProjection=Or(n.dataProjection?n.dataProjection:"EPSG:4326"),n.featureProjection&&(r.defaultFeatureProjection=Or(n.featureProjection)),r.geometryName_=n.geometryName,r.extractGeometryName_=n.extractGeometryName,r.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],r}return Qp(e,t),e.prototype.readFeatureFromObject=function(t,e){var r=null,n=$p((r="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),i=new st;return this.geometryName_?i.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in r!==void 0&&i.setGeometryName(r.geometry_name),i.setGeometry(n),"id"in r&&i.setId(r.id),r.properties&&i.setProperties(r.properties,!0),i},e.prototype.readFeaturesFromObject=function(t,e){var r=null;if("FeatureCollection"===t.type){r=[];for(var n=t.features,i=0,o=n.length;i<o;++i)r.push(this.readFeatureFromObject(n[i],e))}else r=[this.readFeatureFromObject(t,e)];return r},e.prototype.readGeometryFromObject=function(t,e){return $p(t,e)},e.prototype.readProjectionFromObject=function(t){var e,r=t.crs;return r?"name"==r.type?e=Or(r.properties.name):"EPSG"===r.type?e=Or("EPSG:"+r.properties.code):it(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={type:"Feature",geometry:null,properties:null},n=t.getId();if(void 0!==n&&(r.id=n),!t.hasProperties())return r;var i=t.getProperties(),o=t.getGeometry();return o&&(r.geometry=tf(o,e),delete i[t.getGeometryName()]),w(i)||(r.properties=i),r},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var r=[],n=0,i=t.length;n<i;++n)r.push(this.writeFeatureObject(t[n],e));return{type:"FeatureCollection",features:r}},e.prototype.writeGeometryObject=function(t,e){return tf(t,this.adaptOptions(e))},e}(Jp);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function rf(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})})),e}var nf={
|
||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||
read:function(t,e,r,n,i){var o,a,s=8*i-n-1,l=(1<<s)-1,u=l>>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<<u)-1,c=h>>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<<i|s,u+=i;u>0;t[r+f]=255&a,f+=d,a/=256,u-=8);t[r+f-d]|=128*g}},of=sf,af=nf;function sf(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}sf.Varint=0,sf.Fixed64=1,sf.Bytes=2,sf.Fixed32=5;var lf=4294967296,uf=1/lf,hf="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function cf(t){return t.type===sf.Bytes?t.readVarint()+t.pos:t.pos+1}function pf(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function ff(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 df(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function gf(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function yf(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function vf(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function _f(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function mf(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function xf(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function bf(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function wf(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function Sf(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Cf(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Ef(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}sf.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>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=Sf(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ef(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Sf(this.buf,this.pos)+Sf(this.buf,this.pos+4)*lf;return this.pos+=8,t},readSFixed64:function(){var t=Sf(this.buf,this.pos)+Ef(this.buf,this.pos+4)*lf;return this.pos+=8,t},readFloat:function(){var t=af.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=af.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 pf(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return pf(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return pf(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return pf(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return pf(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return pf(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&&hf?function(t,e,r){return hf.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",i=e;for(;i<r;){var o,a,s,l=t[i],u=null,h=l>239?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!==sf.Bytes)return t.push(this.readVarint(e));var r=cf(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==sf.Bytes)return t.push(this.readSVarint());var e=cf(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==sf.Bytes)return t.push(this.readBoolean());var e=cf(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==sf.Bytes)return t.push(this.readFloat());var e=cf(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==sf.Bytes)return t.push(this.readDouble());var e=cf(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==sf.Bytes)return t.push(this.readFixed32());var e=cf(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==sf.Bytes)return t.push(this.readSFixed32());var e=cf(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==sf.Bytes)return t.push(this.readFixed64());var e=cf(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==sf.Bytes)return t.push(this.readSFixed64());var e=cf(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===sf.Varint)for(;this.buf[this.pos++]>127;);else if(e===sf.Bytes)this.pos=this.readVarint()+this.pos;else if(e===sf.Fixed32)this.pos+=4;else{if(e!==sf.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Cf(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Cf(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Cf(this.buf,-1&t,this.pos),Cf(this.buf,Math.floor(t*uf),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Cf(this.buf,-1&t,this.pos),Cf(this.buf,Math.floor(t*uf),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||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;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&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&&ff(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),af.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),af.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<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&ff(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,sf.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,df,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,gf,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,_f,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,yf,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,vf,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,mf,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,xf,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,bf,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,wf,e)},writeBytesField:function(t,e){this.writeTag(t,sf.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,sf.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,sf.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,sf.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,sf.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,sf.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,sf.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,sf.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,sf.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,sf.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var 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)}}(),Rf=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=new Me({code:"",units:Ct.TILE_PIXELS}),r.featureClass_=n.featureClass?n.featureClass:Wp,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 Tf(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<i;){if(!a){var c=t.readVarint();o=7&c,a=c>>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):it(!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?pt:yt:2===t?r=1===e?ft:vt:3===t&&(r=gt);return r}(i,l.length);if(this.featureClass_===Wp)(n=new this.featureClass_(u,s,l,a,o)).transform(r.dataProjection);else{var h=void 0;if(u==gt){var c=function(t,e){for(var r=[],n=0,i=0,o=0,a=e.length;o<a;++o){var s=e[o];if(kn(t,n,s,2)){if(0===r.length)continue;r[r.length-1].push(e[i])}else r.push(e.slice(i,o+1));i=o+1,n=s}return r}(s,l);h=c.length>1?new xc(s,lt,c):new Un(s,lt,l)}else h=u===pt?new En(s,lt):u===ft?new ri(s,lt):u===gt?new Un(s,lt,l):u===yt?new yc(s,lt):u===vt?new fc(s,lt,l):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var p=Yp(h,!1,r);n.setGeometry(p),void 0!==o&&n.setId(o),n.setProperties(a,!0)}return n},e.prototype.getType=function(){return ol},e.prototype.readFeatures=function(t,e){var r=this.layers_,n=this.adaptOptions(e),i=Or(n.dataProjection);i.setWorldExtent(n.extent),n.dataProjection=i;var o=new of(t),a=o.readFields(Pf,{}),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<p;++c){var f=If(o,u,c),d=this.createFeature_(o,f,n);null!==d&&s.push(d)}}return s},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(qp);function Pf(t,e,r){if(3===t){var n={keys:[],values:[],features:[]},i=r.readVarint()+r.pos;r.readFields(Of,n,i),n.length=n.features.length,n.length&&(e[n.name]=n)}}function Of(t,e,r){if(15===t)e.version=r.readVarint();else if(1===t)e.name=r.readString();else if(5===t)e.extent=r.readVarint();else if(2===t)e.features.push(r.pos);else if(3===t)e.keys.push(r.readString());else if(4===t){for(var n=null,i=r.readVarint()+r.pos;r.pos<i;)n=1===(t=r.readVarint()>>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 Ff(t,e,r){if(1==t)e.id=r.readVarint();else if(2==t)for(var n=r.readVarint()+r.pos;r.pos<n;){var i=e.layer.keys[r.readVarint()],o=e.layer.values[r.readVarint()];e.properties[i]=o}else 3==t?e.type=r.readVarint():4==t&&(e.geometry=r.pos)}function If(t,e,r){t.pos=e.features[r];var n=t.readVarint()+t.pos,i={layer:e,type:0,properties:{}};return t.readFields(Ff,i,n),i}var Mf,Af=Rf,Lf=[0,0,0],kf=function(){function t(t){var e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,it(function(t,e,r){var n=e||h;return t.every((function(e,i){if(0===i)return!0;var o=n(t[i-1],e);return!(o>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<n;++r)if(e){if(this.resolutions_[r]/this.resolutions_[r+1]!==e){e=void 0;break}}else e=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,it(this.origins_.length==this.resolutions_.length,20));var i=t.extent;void 0===i||this.origin_||this.origins_||(this.origin_=Te(i)),it(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,it(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:hu,it(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==i?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var r=new Ip(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(i){var n=this.getTileRangeForExtentAndZ(i,e);r.minX=Math.max(n.minX,r.minX),r.maxX=Math.min(n.maxX,r.maxX),r.minY=Math.max(n.minY,r.minY),r.maxY=Math.min(n.maxY,r.maxY)}return r}),this):i&&this.calculateTileRanges_(i)}return t.prototype.forEachTileCoord=function(t,e,r){for(var n=this.getTileRangeForExtentAndZ(t,e),i=n.minX,o=n.maxX;i<=o;++i)for(var a=n.minY,s=n.maxY;a<=s;++a)r([e,i,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,r,n){var i,o,a=null,s=t[0]-1;for(2===this.zoomFactor_?(i=t[1],o=t[2]):a=this.getTileCoordExtent(t,n);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?Fp(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){if(2===this.zoomFactor_){var n=2*t[1],i=2*t[2];return Fp(n,n+1,i,i+1,e)}var o=this.getTileCoordExtent(t,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,r){if(e>this.maxZoom||e<this.minZoom)return null;var n=t[0],i=t[1],o=t[2];if(e===n)return Fp(i,o,i,o,r);if(this.zoomFactor_){var a=Math.pow(this.zoomFactor_,e-n),s=Math.floor(i*a),l=Math.floor(o*a);return e<n?Fp(s,s,l,l,r):Fp(s,Math.floor(a*(i+1))-1,l,Math.floor(a*(o+1))-1,r)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,r)},t.prototype.getTileRangeExtent=function(t,e,r){var n=this.getOrigin(t),i=this.getResolution(t),o=fi(this.getTileSize(t),this.tmpSize_),a=n[0]+e.minX*o[0]*i,s=n[0]+(e.maxX+1)*o[0]*i;return le(a,n[1]+e.minY*o[1]*i,s,n[1]+(e.maxY+1)*o[1]*i,r)},t.prototype.getTileRangeForExtentAndZ=function(t,e,r){var n=Lf;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,n);var i=n[1],o=n[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,n),Fp(i,n[1],o,n[2],r)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),r=this.getResolution(t[0]),n=fi(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*r,e[1]-(t[2]+.5)*n[1]*r]},t.prototype.getTileCoordExtent=function(t,e){var r=this.getOrigin(t[0]),n=this.getResolution(t[0]),i=fi(this.getTileSize(t[0]),this.tmpSize_),o=r[0]+t[1]*i[0]*n,a=r[1]-(t[2]+1)*i[1]*n;return le(o,a,o+i[0]*n,a+i[1]*n,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,r){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,r,n,i){var o=this.getZForResolution(r),a=r/this.getResolution(o),s=this.getOrigin(o),l=fi(this.getTileSize(o),this.tmpSize_),u=a*(t-s[0])/r/l[0],h=a*(s[1]-e)/r/l[1];return n?(u=We(u,5)-1,h=We(h,5)-1):(u=Xe(u,5),h=Xe(h,5)),bp(o,u,h,i)},t.prototype.getTileCoordForXYAndZ_=function(t,e,r,n,i){var o=this.getOrigin(r),a=this.getResolution(r),s=fi(this.getTileSize(r),this.tmpSize_),l=(t-o[0])/a/s[0],u=(o[1]-e)/a/s[1];return n?(l=We(l,5)-1,u=We(u,5)-1):(l=Xe(l,5),u=Xe(u,5)),bp(r,l,u,i)},t.prototype.getTileCoordForCoordAndZ=function(t,e,r){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return Ae(p(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,r=new Array(e),n=this.minZoom;n<e;++n)r[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=r},t}(),Df=kf,jf=function(){function t(t,e,r,n,i,o){this.sourceProj_=t,this.targetProj_=e;var a={},s=Dr(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()&&Pe(n)==Pe(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Pe(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Pe(this.targetProj_.getExtent()):null;var l=Te(r),u=Re(r),h=xe(r),c=me(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(ke(_e(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<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,e,r,n,i,o){this.triangles_.push({source:[n,i,o],target:[t,e,r]})},t.prototype.addQuad_=function(t,e,r,n,i,o,a,s,l){var u=$t([i,o,a,s]),h=this.sourceWorldWidth_?Pe(u)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&h>.5&&h<1,f=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)f=Pe($t([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]))||Oe(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=(Ne(i[0],c)+Ne(a[0],c))/2-Ne(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),b=[(n[0]+t[0])/2,(n[1]+t[1])/2],w=this.transformInv_(b);this.addQuad_(t,e,m,b,i,o,x,w,l-1),this.addQuad_(b,m,r,n,w,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],T=this.transformInv_(E);this.addQuad_(t,S,E,n,i,C,T,s,l-1),this.addQuad_(S,e,r,E,C,o,a,T,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;de(t,i[0]),de(t,i[1]),de(t,i[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),zf={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Gf={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0};function Nf(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 Uf(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Bf(t,e,r,n){var i=jr(r,e,t),o=Fr(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||ne(l,i)){var u=Fr(t,o,i)/o;isFinite(u)&&u>0&&(o/=u)}return o}function Vf(t,e,r,n,i,o,a,s,l,u,h,c){var p=Ei(Math.round(r*t),Math.round(r*e));if(c||m(p,zf),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){fe(d,t.extent)}));var g=Pe(d),y=Ce(d),v=Ei(Math.round(r*g/n),Math.round(r*y/n));c||m(v,zf);var _=r/n;l.forEach((function(t,e,r){var n=t.extent[0]-d[0],i=-(t.extent[3]-d[3]),o=Pe(t.extent),a=Ce(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 x=Te(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],m=f((s[0][0]-x[0])/o),b=f(-(s[0][1]-x[1])/o),w=f((s[1][0]-x[0])/o),S=f(-(s[1][1]-x[1])/o),C=f((s[2][0]-x[0])/o),E=f(-(s[2][1]-x[1])/o),T=l,R=u;l=0,u=0;var P=function(t){for(var e=t.length,r=0;r<e;r++){for(var n=r,i=Math.abs(t[r][r]),o=r+1;o<e;o++){var a=Math.abs(t[o][r]);a>i&&(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<e;l++)for(var u=-t[l][r]/t[r][r],h=r;h<e+1;h++)r==h?t[l][h]=0:t[l][h]+=u*t[r][h]}for(var c=new Array(e),p=e-1;p>=0;p--){c[p]=t[p][e]/t[p][p];for(var f=p-1;f>=0;f--)t[f][e]-=t[f][p]*c[p]}return c}([[h-=T,g-=R,0,0,w-m],[y-=T,_-=R,0,0,C-m],[0,0,h,g,S-b],[0,0,y,_,E-b]]);if(P){if(p.save(),p.beginPath(),function(){if(void 0===Mf){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Nf(t,4,5,4,0),Nf(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;Mf=Uf(e,0)||Uf(e,4)||Uf(e,8)}return Mf}()||!c){p.moveTo(w,S);for(var O=m-w,F=b-S,I=0;I<4;I++)p.lineTo(w+f((I+1)*O/4),S+f(I*F/3)),3!=I&&p.lineTo(w+f((I+1)*O/4),S+f((I+1)*F/3));p.lineTo(C,E)}else p.moveTo(w,S),p.lineTo(m,b),p.lineTo(C,E);p.clip(),p.transform(P[0],P[2],P[1],P[3],m,b),p.translate(d[0]-T,d[3]-R),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]-x[0])/o,a=-(n[0][1]-x[1])/o,s=(n[1][0]-x[0])/o,l=-(n[1][1]-x[1])/o,u=(n[2][0]-x[0])/o,h=-(n[2][1]-x[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 Xf=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)}}(),Wf=function(t){function e(e,r,n,i,o,a,s,l,u,h,c,p){var f=t.call(this,o,dl,{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?Ee(d,g):d;if(0===_e(v))return f.state=_l,f;var _=e.getExtent();_&&(y=y?Ee(y,_):_);var m=i.getResolution(f.wrappedTileCoord_[0]),x=function(t,e,r,n){var i=be(r),o=Bf(t,e,i,n);return(!isFinite(o)||o<=0)&&ve(r,(function(r){return o=Bf(t,e,r,n),isFinite(o)&&o>0})),o}(e,n,v,m);if(!isFinite(x)||x<=0)return f.state=_l,f;var b=void 0!==h?h:.5;if(f.triangulation_=new jf(e,n,v,y,x*b,m),0===f.triangulation_.getTriangles().length)return f.state=_l,f;f.sourceZ_=r.getZForResolution(x);var w=f.triangulation_.calculateSourceExtent();if(y&&(e.canWrapX()?(w[1]=Ae(w[1],y[1],y[3]),w[3]=Ae(w[3],y[1],y[3])):w=Ee(w,y)),_e(w)){for(var S=r.getTileRangeForExtentAndZ(w,f.sourceZ_),C=S.minX;C<=S.maxX;C++)for(var E=S.minY;E<=S.maxY;E++){var T=u(f.sourceZ_,C,E,s);T&&f.sourceTiles_.push(T)}0===f.sourceTiles_.length&&(f.state=_l)}else f.state=_l;return f}return Xf(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()==yl&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=vl;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_=Vf(n,i,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=yl}this.changed()},e.prototype.load=function(){if(this.state==dl){this.state=gl,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,r,n){var i=e.getState();if(i==dl||i==gl){t++;var o=G(e,E,(function(r){var n=e.getState();n!=yl&&n!=vl&&n!=_l||(U(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()==dl&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(U),this.sourcesListenerKeys_=null},e}(El),qf="tileloadstart",Yf="tileloadend",Kf="tileloaderror";function Zf(t){var e=t.getDefaultTileGrid();return e||(e=Qf(t),t.setDefaultTileGrid(e)),e}function Hf(t){var e=t||{},r=e.extent||Or("EPSG:3857").getExtent(),n={extent:r,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Jf(r,e.maxZoom,e.tileSize,e.maxResolution)};return new Df(n)}function Jf(t,e,r,n){for(var i=void 0!==e?e:42,o=Ce(t),a=Pe(t),s=fi(void 0!==r?r:hu),l=n>0?n:Math.max(a/s[0],o/s[1]),u=i+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function Qf(t,e,r,n){return function(t,e,r,n){var i=void 0!==n?n:Wt,o=Jf(t,e,r);return new Df({extent:t,origin:we(t,i),resolutions:o,tileSize:r})}($f(t),e,r,n)}function $f(t){var e=(t=Or(t)).getExtent();if(!e){var r=180*wt[Ct.DEGREES]/t.getMetersPerUnit();e=le(-r,-r,r,r)}return e}var td=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)}}(),ed=function(t){function r(e){var r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate})||this;r.on,r.once,r.un,r.opaque_=void 0!==e.opaque&&e.opaque,r.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,r.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;return r.tileGrid&&fi(r.tileGrid.getTileSize(r.tileGrid.getMinZoom()),[256,256]),r.tileCache=new Pp(e.cacheSize||0),r.tmpSize=[0,0],r.key_=e.key||"",r.tileOptions={transition:e.transition,interpolate:e.interpolate},r.zDirection=e.zDirection?e.zDirection:0,r}return td(r,t),r.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},r.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);r&&r.expireCache(e)},r.prototype.forEachLoadedTile=function(t,e,r,n){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,a,s,l=!0,u=r.minX;u<=r.maxX;++u)for(var h=r.minY;h<=r.maxY;++h)a=wp(e,u,h),s=!1,i.containsKey(a)&&(s=(o=i.get(a)).getState()===yl)&&(s=!1!==n(o)),s||(l=!1);return l},r.prototype.getGutterForProjection=function(t){return 0},r.prototype.getKey=function(){return this.key_},r.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},r.prototype.getOpaque=function(t){return this.opaque_},r.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},r.prototype.getTile=function(t,r,n,i,o){return e()},r.prototype.getTileGrid=function(){return this.tileGrid},r.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Zf(t)},r.prototype.getTileCacheForProjection=function(t){return it(Lr(this.getProjection(),t),68),this.tileCache},r.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},r.prototype.getTilePixelSize=function(t,e,r){var n=this.getTileGridForProjection(r),i=this.getTilePixelRatio(e),o=fi(n.getTileSize(t),this.tmpSize);return 1==i?o:pi(o,i,this.tmpSize)},r.prototype.getTileCoordForTileUrlFunction=function(t,e){var r=void 0!==e?e:this.getProjection(),n=this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(t=function(t,e,r){var n=e[0],i=t.getTileCoordCenter(e),o=$f(r);if(ne(o,i))return e;var a=Pe(o),s=Math.ceil((o[0]-i[0])/a);return i[0]+=a*s,t.getTileCoordForCoordAndZ(i,n)}(n,t,r)),function(t,e){var r=t[0],n=t[1],i=t[2];if(e.getMinZoom()>r||r>e.getMaxZoom())return!1;var o=e.getFullTileRange(r);return!o||o.containsXY(n,i)}(t,n)?t:null},r.prototype.clear=function(){this.tileCache.clear()},r.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},r.prototype.updateCacheSize=function(t,e){var r=this.getTileCacheForProjection(e);t>r.highWaterMark&&(r.highWaterMark=t)},r.prototype.useTile=function(t,e,r,n){},r}(Hs),rd=function(t){function e(e,r){var n=t.call(this,e)||this;return n.tile=r,n}return td(e,t),e}(s),nd=ed;function id(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 it(r,55),(r.getHeight()-a[2]-1).toString()})):void 0}}function od(t,e){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=id(t[i],e);return ad(n)}function ad(t){return 1===t.length?t[0]:function(e,r,n){if(e){var i=Ne(Ep(e),t.length);return t[i](e,r,n)}}}var sd=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)}}(),ld=function(t){function e(r){var n=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,opaque:r.opaque,projection:r.projection,state:r.state,tileGrid:r.tileGrid,tilePixelRatio:r.tilePixelRatio,wrapX:r.wrapX,transition:r.transition,interpolate:r.interpolate,key:r.key,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=r.tileLoadFunction,r.tileUrlFunction&&(n.tileUrlFunction=r.tileUrlFunction),n.urls=null,r.urls?n.setUrls(r.urls):r.url&&n.setUrl(r.url),n.tileLoadingKeys_={},n}return sd(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,r=t.target,i=n(r),o=r.getState();o==gl?(this.tileLoadingKeys_[i]=!0,e=qf):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],e=o==vl?Kf:o==yl?Yf:void 0),null!=e&&this.dispatchEvent(new rd(e,r))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],r=/\{([a-z])-([a-z])\}/.exec(t);if(r){var n=r[1].charCodeAt(0),i=r[2].charCodeAt(0),o=void 0;for(o=n;o<=i;++o)e.push(t.replace(r[0],String.fromCharCode(o)));return e}if(r=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(r[2],10),s=parseInt(r[1],10);s<=a;s++)e.push(t.replace(r[0],s.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(od(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,r){},e.prototype.useTile=function(t,e,r){var n=wp(t,e,r);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(nd),ud=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)}}(),hd=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,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:cd,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:n,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this).crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,r.tileClass=void 0!==e.tileClass?e.tileClass:Rl,r.tileCacheForProjection={},r.tileGridForProjection={},r.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,r.renderReprojectionEdges_=!1,r}return ud(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==r?e:{}),this.tileCacheForProjection){var i=this.tileCacheForProjection[n];i.expireCache(i==r?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Lr(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var e=t.prototype.getKey.call(this);return this.getInterpolate()||(e+=":disable-interpolation"),e},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Lr(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Lr(e,t)){var r=n(t);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=Zf(t)),this.tileGridForProjection[r]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Lr(e,t))return this.tileCache;var r=n(t);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new Pp(this.tileCache.highWaterMark)),this.tileCacheForProjection[r]},e.prototype.createTile_=function(t,e,r,n,i,o){var a=[t,e,r],s=this.getTileCoordForTileUrlFunction(a,i),l=s?this.tileUrlFunction(s,n,i):void 0,u=new this.tileClass(a,void 0!==l?dl:_l,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(E,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,r,n,i){var o=this.getProjection();if(o&&i&&!Lr(o,i)){var a=this.getTileCacheForProjection(i),s=[t,e,r],l=void 0,u=Sp(s);a.containsKey(u)&&(l=a.get(u));var h=this.getKey();if(l&&l.key==h)return l;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(i),f=this.getTileCoordForTileUrlFunction(s,i),d=new Wf(o,c,i,p,s,f,this.getTilePixelRatio(n),this.getGutter(),function(t,e,r,n){return this.getTileInternal(t,e,r,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return d.key=h,l?(d.interimTile=l,d.refreshInterimChain(),a.replace(u,d)):a.set(u,d),d}return this.getTileInternal(t,e,r,n,o||i)},e.prototype.getTileInternal=function(t,e,r,n,i){var o=null,a=wp(t,e,r),s=this.getKey();if(this.tileCache.containsKey(a)){if((o=this.tileCache.get(a)).key!=s){var l=o;o=this.createTile_(t,e,r,n,i,s),l.getState()==dl?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(a,o)}}else o=this.createTile_(t,e,r,n,i,s),this.tileCache.set(a,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var r=Or(t);if(r){var i=n(r);i in this.tileGridForProjection||(this.tileGridForProjection[i]=e)}},e}(ld);function cd(t,e){t.getImage().src=e}var pd=hd,fd=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 dd(t,e,r,i){var o=document.createElement("script"),a="olc_"+n(e);function s(){delete window[a],o.parentNode.removeChild(o)}o.async=!0,o.src=t+(-1==t.indexOf("?")?"?":"&")+(i||"callback")+"="+a;var l=setTimeout((function(){s(),r&&r()}),1e4);window[a]=function(t){clearTimeout(l),s(),e(t)},document.getElementsByTagName("head")[0].appendChild(o)}!function(t){function e(e){var r=this,n="Unexpected response status: "+e.status;return(r=t.call(this,n)||this).name="ResponseError",r.response=e,r}fd(e,t)}(Error),function(t){function e(e){var r=t.call(this,"Failed to issue request")||this;return r.name="ClientError",r.client=e,r}fd(e,t)}(Error);var gd=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)}}(),yd=function(t){function e(e){var r=this,n=void 0===e.imageSmoothing||e.imageSmoothing;if(void 0!==e.interpolate&&(n=e.interpolate),(r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:n,projection:Or("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Mo,tileLoadFunction:e.tileLoadFunction,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:e.zDirection})||this).tileJSON_=null,r.tileSize_=e.tileSize,e.url)if(e.jsonp)dd(e.url,r.handleTileJSONResponse.bind(r),r.handleTileJSONError.bind(r));else{var i=new XMLHttpRequest;i.addEventListener("load",r.onXHRLoad_.bind(r)),i.addEventListener("error",r.onXHRError_.bind(r)),i.open("GET",e.url),i.send()}else e.tileJSON?r.handleTileJSONResponse(e.tileJSON):it(!1,51);return r}return gd(e,t),e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=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=Or("EPSG:4326"),n=this.getProjection();if(void 0!==t.bounds){var i=kr(r,n);e=Ie(t.bounds,i)}var o=$f(n),a=t.minzoom||0,s=Hf({extent:o,maxZoom:t.maxzoom||22,minZoom:a,tileSize:this.tileSize_});if(this.tileGrid=s,this.tileUrlFunction=od(t.tiles,s),void 0!==t.attribution&&!this.getAttributions()){var l=void 0!==e?e:o;this.setAttributions((function(e){return Oe(l,e.extent)?[t.attribution]:null}))}this.tileJSON_=t,this.setState(Ao)},e.prototype.handleTileJSONError=function(){this.setState(Lo)},e}(pd),vd=yd,_d="preload",md="useInterimTilesOnError",xd=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)}}(),bd=function(t){function e(e){var r=this,n=e||{},i=m({},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 xd(e,t),e.prototype.getPreload=function(){return this.get(_d)},e.prototype.setPreload=function(t){this.set(_d,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(md)},e.prototype.setUseInterimTilesOnError=function(t){this.set(md,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(zo),wd=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)}}(),Sd=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 Ip(0,0,0,0),r}return wd(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==yl||r==_l||r==vl&&!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()==vl&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(yl)),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=zt(e.pixelToCoordinateTransform,t.slice()),i=r.getExtent();if(i&&!ne(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 p=u.getTileCoordForCoordAndZ(n,c),f=l.getTile(c,p[1],p[2],o,a);if(!(f instanceof Rl||f instanceof Wf))return null;if(f.getState()===yl){var d=u.getOrigin(c),g=fi(u.getTileSize(c)),y=u.getResolution(c),v=Math.floor(h*((n[0]-d[0])/y-p[1]*g[0])),_=Math.floor(h*((d[1]-n[1])/y-p[2]*g[1]));return this.getImageData(f.getImage(),v,_)}}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],i=t.viewState,o=i.projection,a=i.resolution,s=i.center,l=i.rotation,u=t.pixelRatio,c=this.getLayer(),p=c.getSource(),f=p.getRevision(),d=p.getTileGridForProjection(o),g=d.getZForResolution(a,p.zDirection),y=d.getResolution(g),v=t.extent,_=r.extent&&Xr(r.extent);_&&(v=Ee(v,Xr(r.extent)));var x=p.getTilePixelRatio(u),b=Math.round(t.size[0]*x),w=Math.round(t.size[1]*x);if(l){var S=Math.round(Math.sqrt(b*b+w*w));b=S,w=S}var C=y*b/2/x,E=y*w/2/x,T=[s[0]-C,s[1]-E,s[0]+C,s[1]+E],R=d.getTileRangeForExtentAndZ(v,g),P={};P[g]={};var O=this.createLoadedTileFinder(p,o,P),F=this.tmpExtent,I=this.tmpTileRange_;this.newTiles_=!1;for(var M=R.minX;M<=R.maxX;++M)for(var A=R.minY;A<=R.maxY;++A){var L=this.getTile(g,M,A,t);if(this.isDrawableTile(L)){var k=n(this);if(L.getState()==yl){P[g][L.tileCoord.toString()]=L;var D=L.inTransition(k);this.newTiles_||!D&&-1!==this.renderedTiles.indexOf(L)||(this.newTiles_=!0)}if(1===L.getAlpha(k,t.time))continue}var j=d.getTileCoordChildTileRange(L.tileCoord,I,F),z=!1;j&&(z=O(g+1,j)),z||d.forEachTileCoordParentTileRange(L.tileCoord,O,I,F)}var G=y/a;Nt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/x,1/x,l,-b/2,-w/2);var N=Bt(this.pixelTransform);this.useContainer(e,N,r.opacity,this.getBackground(t));var U=this.context,B=U.canvas;Ut(this.inversePixelTransform,this.pixelTransform),Nt(this.tempTransform,b/2,w/2,G,G,0,-b/2,-w/2),B.width!=b||B.height!=w?(B.width=b,B.height=w):this.containerReused||U.clearRect(0,0,b,w),_&&this.clipUnrotated(U,t,_),p.getInterpolate()||m(U,zf),this.preRender(U,t),this.renderedTiles.length=0;var V,X,W,q=Object.keys(P).map(Number);q.sort(h),1!==r.opacity||this.containerReused&&!p.getOpaque(t.viewState.projection)?(V=[],X=[]):q=q.reverse();for(var Y=q.length-1;Y>=0;--Y){var K=q[Y],Z=p.getTilePixelSize(K,u,o),H=d.getResolution(K)/y,J=Z[0]*H*G,Q=Z[1]*H*G,$=d.getTileCoordForCoordAndZ(Te(T),K),tt=d.getTileCoordExtent($),et=zt(this.tempTransform,[x*(tt[0]-T[0])/y,x*(T[3]-tt[3])/y]),rt=x*p.getGutterForProjection(o),nt=P[K];for(var it in nt){var ot=(L=nt[it]).tileCoord,at=$[1]-ot[1],st=Math.round(et[0]-(at-1)*J),lt=$[2]-ot[2],ut=Math.round(et[1]-(lt-1)*Q),ht=st-(M=Math.round(et[0]-at*J)),ct=ut-(A=Math.round(et[1]-lt*Q)),pt=g===K,ft=!1;if(!(D=pt&&1!==L.getAlpha(n(this),t.time)))if(V){W=[M,A,M+ht,A,M+ht,A+ct,M,A+ct];for(var dt=0,gt=V.length;dt<gt;++dt)if(g!==K&&K<X[dt]){var yt=V[dt];Oe([M,A,M+ht,A+ct],[yt[0],yt[3],yt[4],yt[7]])&&(ft||(U.save(),ft=!0),U.beginPath(),U.moveTo(W[0],W[1]),U.lineTo(W[2],W[3]),U.lineTo(W[4],W[5]),U.lineTo(W[6],W[7]),U.moveTo(yt[6],yt[7]),U.lineTo(yt[4],yt[5]),U.lineTo(yt[2],yt[3]),U.lineTo(yt[0],yt[1]),U.clip())}V.push(W),X.push(K)}else U.clearRect(M,A,ht,ct);this.drawTileImage(L,t,M,A,ht,ct,rt,pt),V&&!D?(ft&&U.restore(),this.renderedTiles.unshift(L)):this.renderedTiles.push(L),this.updateUsedTiles(t.usedTiles,p,L)}}this.renderedRevision=f,this.renderedResolution=y,this.extentChanged=!this.renderedExtent_||!pe(this.renderedExtent_,T),this.renderedExtent_=T,this.renderedPixelRatio=u,this.renderedProjection=o,this.manageTilePyramid(t,p,d,u,o,v,g,c.getPreload()),this.scheduleExpireCache(t,p),this.postRender(U,t),r.extent&&U.restore(),m(U,Gf),N!==B.style.transform&&(B.style.transform=N);var vt=ki(r.opacity),_t=this.container;return vt!==_t.style.opacity&&(_t.style.opacity=vt),this.container},e.prototype.drawTileImage=function(t,e,r,i,o,a,s,l){var u=this.getTileImage(t);if(u){var h=n(this),c=l?t.getAlpha(h,e.time):1,p=c!==this.context.globalAlpha;p&&(this.context.save(),this.context.globalAlpha=c),this.context.drawImage(u,s,s,u.width-2*s,u.height-2*s,r,i,o,a),p&&this.context.restore(),1!==c?e.animate=!0:l&&t.endTransition(h)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var r=function(t,e,r){var i=n(t);i in r.usedTiles&&t.expireCache(r.viewState.projection,r.usedTiles[i])}.bind(null,e);t.postRenderFunctions.push(r)}},e.prototype.updateUsedTiles=function(t,e,r){var i=n(e);i in t||(t[i]={}),t[i][r.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,r,i,o,a,s,l,u){var h=n(e);h in t.wantedTiles||(t.wantedTiles[h]={});var c,p,f,d,g,y,v=t.wantedTiles[h],_=t.tileQueue,m=0;for(y=r.getMinZoom();y<=s;++y)for(p=r.getTileRangeForExtentAndZ(a,y,p),f=r.getResolution(y),d=p.minX;d<=p.maxX;++d)for(g=p.minY;g<=p.maxY;++g)s-y<=l?(++m,(c=e.getTile(y,d,g,i,o)).getState()==dl&&(v[c.getKey()]=!0,_.isKeyQueued(c.getKey())||_.enqueue([c,h,r.getTileCoordCenter(c.tileCoord),f])),void 0!==u&&u(c)):e.useTile(y,d,g,o);e.updateCacheSize(m,o)},e}(Ga),Cd=Sd,Ed=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)}}(),Td=function(t){function e(e){return t.call(this,e)||this}return Ed(e,t),e.prototype.createRenderer=function(){return new Cd(this)},e}(bd),Rd="image",Pd="hybrid",Od="vector",Fd=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)}}(),Id={image:[Xa,Na,Va,Ba,Wa],hybrid:[Xa,Va],vector:[]},Md={hybrid:[Ba,Wa,Ua],vector:[Xa,Na,Va,Ba,Wa,Ua]},Ad=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.dirty_=!1,r.renderedLayerRevision_,r.renderedPixelToCoordinateTransform_=null,r.renderedRotation_,r.tmpTransform_=[1,0,0,1,0,0],r}return Fd(e,t),e.prototype.prepareTile=function(t,e,r){var n,i=t.getState();return i!==yl&&i!==vl||(this.updateExecutorGroup_(t,e,r),this.tileImageNeedsRender_(t)&&(n=!0)),n},e.prototype.getTile=function(e,r,n,i){var o=i.pixelRatio,a=i.viewState,s=a.resolution,l=a.projection,u=this.getLayer(),h=u.getSource().getTile(e,r,n,o,l),c=i.viewHints,p=!(c[ls]||c[us]);return!p&&h.wantedResolution||(h.wantedResolution=s),this.prepareTile(h,o,l)&&(p||Date.now()-i.time<8)&&u.getRenderMode()!==Od&&this.renderTileImage_(h,i),t.prototype.getTile.call(this,e,r,n,i)},e.prototype.isDrawableTile=function(e){var r=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(r.getRenderMode()===Od?n(r)in e.executorGroups:e.hasContext(r))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var r=this.getLayer().getRevision();return this.renderedLayerRevision_!=r&&(this.renderedTiles.length=0),this.renderedLayerRevision_=r,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,r){var i=this.getLayer(),o=i.getRevision(),a=i.getRenderOrder()||null,s=t.wantedResolution,l=t.getReplayState(i);if(l.dirty||l.renderedResolution!==s||l.renderedRevision!=o||l.renderedRenderOrder!=a){var u=i.getSource(),h=i.getDeclutter(),c=u.getTileGrid(),p=u.getTileGridForProjection(r).getTileCoordExtent(t.wrappedTileCoord),f=u.getSourceTiles(e,r,t),d=n(i);delete t.hitDetectionImageData[d],t.executorGroups[d]=[],h&&(t.declutterExecutorGroups[d]=[]);for(var g=function(r,n){var o=f[r];if(o.getState()!=yl)return"continue";var g=o.tileCoord,v=c.getTileCoordExtent(g),_=Ee(p,v),m=te(_,i.getRenderBuffer()*s,y.tmpExtent),x=pe(v,_)?null:m;l.dirty=!1;var b=new Fa(0,m,s,e),w=h?new Fa(0,_,s,e):void 0,S=zs(s,e),C=function(t){var e,r=t.getStyleFunction()||i.getStyleFunction();if(r&&(e=r(t,s)),e){var n=this.renderFeature(t,S,e,b,w);this.dirty_=this.dirty_||n,l.dirty=l.dirty||n}},E=o.getFeatures();a&&a!==l.renderedRenderOrder&&E.sort(a);for(var T=0,R=E.length;T<R;++T){var P=E[T];x&&!Oe(x,P.getGeometry().getExtent())||C.call(y,P)}var O=b.finish(),F=i.getRenderMode()!==Od&&h&&1===f.length?null:_,I=new ss(F,s,e,u.getOverlaps(),O,i.getRenderBuffer());if(t.executorGroups[d].push(I),w){var M=new ss(null,s,e,u.getOverlaps(),w.finish(),i.getRenderBuffer());t.declutterExecutorGroups[d].push(M)}},y=this,v=0,_=f.length;v<_;++v)g(v);l.renderedRevision=o,l.renderedRenderOrder=a,l.renderedResolution=s}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,i,o){var a=e.viewState.resolution,s=e.viewState.rotation;r=null==r?0:r;var l=this.getLayer(),u=l.getSource().getTileGridForProjection(e.viewState.projection),h=$t([t]);te(h,a*r,h);for(var c,p={},f=function(t,e,r){var a=t.getId();void 0===a&&(a=n(t));var s=p[a];if(s){if(!0!==s&&r<s.distanceSq){if(0===r)return p[a]=!0,o.splice(o.lastIndexOf(s),1),i(t,l,e);s.geometry=e,s.distanceSq=r}}else{if(0===r)return p[a]=!0,i(t,l,e);o.push(p[a]={feature:t,layer:l,geometry:e,distanceSq:r,callback:i})}},d=this.renderedTiles,g=function(i,o){var p=d[i];if(!Oe(u.getTileCoordExtent(p.wrappedTileCoord),h))return"continue";var g=n(l),y=[p.executorGroups[g]],v=p.declutterExecutorGroups[g];v&&y.push(v),y.some((function(n){for(var i=n===v?e.declutterTree.all().map((function(t){return t.value})):null,o=0,l=n.length;o<l;++o){var u=n[o];if(c=u.forEachFeatureAtCoordinate(t,a,s,r,f,i))return!0}}))},y=0,v=d.length;!c&&y<v;++y)g(y);return c},e.prototype.getFeatures=function(t){return new Promise(function(e,r){for(var i,o=this.getLayer(),a=n(o),s=o.getSource(),l=this.renderedProjection,u=l.getExtent(),h=this.renderedResolution,c=s.getTileGridForProjection(l),p=zt(this.renderedPixelToCoordinateTransform_,t.slice()),f=c.getTileCoordForCoordAndResolution(p,h),d=0,g=this.renderedTiles.length;d<g;++d)if(f.toString()===this.renderedTiles[d].tileCoord.toString()){if((i=this.renderedTiles[d]).getState()===yl){var y=c.getTileCoordExtent(i.tileCoord);s.getWrapX()&&l.canWrapX()&&!ie(u,y)&&_r(p,l);break}i=void 0}if(!i||i.loadingSourceTiles>0)e([]);else{var v=Te(c.getTileCoordExtent(i.wrappedTileCoord)),_=[(p[0]-v[0])/h,(v[1]-p[1])/h],m=i.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),x=i.hitDetectionImageData[a];if(!x&&!this.animatingOrInteracting_){var b=fi(c.getTileSize(c.getZForResolution(h))),w=this.renderedRotation_;x=Ls(b,[this.getRenderTransform(c.getTileCoordCenter(i.wrappedTileCoord),h,0,As,b[0]*As,b[1]*As,0)],m,o.getStyleFunction(),c.getTileCoordExtent(i.wrappedTileCoord),i.getReplayState(o).renderedResolution,w),i.hitDetectionImageData[a]=x}e(ks(_,m,x))}}.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 i=t.viewHints,o=!(i[ls]||i[us]),a=this.renderedTiles,s=0,l=a.length;s<l;++s){var u=a[s],h=u.declutterExecutorGroups[n(this.getLayer())];if(h)for(var c=h.length-1;c>=0;--c)h[c].execute(this.context,1,this.getTileRenderTransform(u,t),t.viewState.rotation,o,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 Dt(Gt(this.inversePixelTransform.slice(),1/r,1/r),this.getRenderTransform(i,o,a,r,l,u,f))},e.prototype.renderFrame=function(e,r){var i=e.viewHints,o=!(i[ls]||i[us]);t.prototype.renderFrame.call(this,e,r),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var a=this.getLayer(),s=a.getRenderMode(),l=this.context,u=l.globalAlpha;l.globalAlpha=a.getOpacity();for(var h=Md[s],c=e.viewState,p=c.rotation,f=a.getSource(),d=f.getTileGridForProjection(c.projection).getZForResolution(c.resolution,f.zDirection),g=this.renderedTiles,y=[],v=[],_=g.length-1;_>=0;--_){var m=g[_],x=m.executorGroups[n(a)].filter((function(t){return t.hasExecutors(h)}));if(0!==x.length){for(var b=this.getTileRenderTransform(m,e),w=m.tileCoord[0],S=!1,C=x[0].getClipCoords(b),E=0,T=y.length;E<T;++E)if(d!==w&&w<v[E]){var R=y[E];Oe([C[0],C[3],C[4],C[7]],[R[0],R[3],R[4],R[7]])&&(S||(l.save(),S=!0),l.beginPath(),l.moveTo(C[0],C[1]),l.lineTo(C[2],C[3]),l.lineTo(C[4],C[5]),l.lineTo(C[6],C[7]),l.moveTo(R[6],R[7]),l.lineTo(R[4],R[5]),l.lineTo(R[2],R[3]),l.lineTo(R[0],R[1]),l.clip())}y.push(C),v.push(w);for(var P=0,O=x.length;P<O;++P){x[P].execute(l,1,b,p,o,h)}S&&l.restore()}}return l.globalAlpha=u,this.container},e.prototype.renderFeature=function(t,e,r,n,i){if(!r)return!1;var o=!1;if(Array.isArray(r))for(var a=0,s=r.length;a<s;++a)o=Ns(n,t,r[a],e,this.boundHandleStyleImageChange_,void 0,i)||o;else o=Ns(n,t,r,e,this.boundHandleStyleImageChange_,void 0,i);return o},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===Od)return!1;var r=t.getReplayState(e),n=e.getRevision(),i=t.wantedResolution;return r.renderedTileResolution!==i||r.renderedTileRevision!==n},e.prototype.renderTileImage_=function(t,e){var r=this.getLayer(),i=t.getReplayState(r),o=r.getRevision(),a=t.executorGroups[n(r)];i.renderedTileRevision=o;var s=t.wrappedTileCoord,l=s[0],u=r.getSource(),h=e.pixelRatio,c=e.viewState.projection,p=u.getTileGridForProjection(c),f=p.getResolution(t.tileCoord[0]),d=e.pixelRatio/t.wantedResolution*f,g=p.getResolution(l),y=t.getContext(r);h=Math.round(Math.max(h,d/h));var v=u.getTilePixelSize(l,h,c);y.canvas.width=v[0],y.canvas.height=v[1];var _=h/d;if(1!==_){var m=kt(this.tmpTransform_);Gt(m,_,_),y.setTransform.apply(y,m)}var x=p.getTileCoordExtent(s,this.tmpExtent),b=d/g,w=kt(this.tmpTransform_);Gt(w,b,-b),function(t,e,r){Dt(t,jt(Lt,1,0,0,1,e,r))}(w,-x[0],-x[3]);for(var S=0,C=a.length;S<C;++S){a[S].execute(y,_,w,0,!0,Id[r.getRenderMode()])}i.renderedTileResolution=t.wantedResolution},e}(Cd),Ld=Ad,kd=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)}}(),Dd=function(t){function e(e){var r=this,n=e||{},i=m({},n);delete i.preload,delete i.useInterimTilesOnError,(r=t.call(this,i)||this).on,r.once,r.un,n.renderMode===Rd&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),n.renderMode=void 0);var o=n.renderMode||Pd;return it(o==Pd||o==Od,28),r.renderMode_=o,r.setPreload(n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r.getBackground,r.setBackground,r}return kd(e,t),e.prototype.createRenderer=function(){return new Ld(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(_d)},e.prototype.getUseInterimTilesOnError=function(){return this.get(md)},e.prototype.setPreload=function(t){this.set(_d,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(md,t)},e}(oa),jd=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)}}(),zd=function(t){function e(e){var r=this,n=e.projection||"EPSG:3857",i=e.extent||$f(n),o=e.tileGrid||Hf({extent:i,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,interpolate:!0,opaque:!1,projection:n,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Nd,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,r.sourceTileCache=new Pp(r.tileCache.highWaterMark),r.overlaps_=null==e.overlaps||e.overlaps,r.tileClass=e.tileClass?e.tileClass:zp,r.tileGrids_={},r}return jd(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],r=this.tileCache;if(0===r.getCount())return e;var n=Cp(r.peekFirstKey())[0],i=this.tileGrid;return r.forEach((function(r){if(r.tileCoord[0]===n&&r.getState()===yl)for(var o=r.getSourceTiles(),a=0,s=o.length;a<s;++a){var l=o[a],u=l.tileCoord;if(Oe(t,i.getTileCoordExtent(u))){var h=l.getFeatures();if(h)for(var c=0,p=h.length;c<p;++c){var f=h[c],d=f.getGeometry();Oe(t,d.getExtent())&&e.push(f)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,r){var n=this.getTileCacheForProjection(e),i=Object.keys(r).reduce((function(t,e){var r,i,o=wp((i=(r=e).substring(r.lastIndexOf("/")+1,r.length).split(",").map(Number))[0],i[1],i[2]);if(n.containsKey(o))for(var a=n.get(o).sourceTiles,s=0,l=a.length;s<l;++s)t[a[s].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,r),this.sourceTileCache.expireCache(i)},e.prototype.getSourceTiles=function(t,e,r){var n=this;if(r.getState()===dl){r.setState(gl);var i=r.wrappedTileCoord,o=this.getTileGridForProjection(e),a=o.getTileCoordExtent(i),s=i[0],l=o.getResolution(s);te(a,-l,a);var u=this.tileGrid,h=u.getExtent();h&&Ee(a,h,a);var c=u.getZForResolution(l,1);u.forEachTileCoord(a,c,(function(i){var o=n.tileUrlFunction(i,t,e),a=n.sourceTileCache.containsKey(o)?n.sourceTileCache.get(o):new n.tileClass(i,o?dl:_l,o,n.format_,n.tileLoadFunction);r.sourceTiles.push(a);var s=a.getState();if(s<yl){var l=function(t){n.handleTileChange(t);var e=a.getState();if(e===yl||e===vl){var i=a.getKey();i in r.errorTileKeys?a.getState()===yl&&delete r.errorTileKeys[i]:r.loadingSourceTiles--,e===vl?r.errorTileKeys[i]=!0:a.removeEventListener(E,l),0===r.loadingSourceTiles&&r.setState(w(r.errorTileKeys)?yl:vl)}};a.addEventListener(E,l),r.loadingSourceTiles++}s===dl&&(a.extent=u.getTileCoordExtent(i),a.projection=e,a.resolution=u.getResolution(i[0]),n.sourceTileCache.set(o,a),a.load())})),r.loadingSourceTiles||r.setState(r.sourceTiles.some((function(t){return t.getState()===vl}))?vl:yl)}return r.sourceTiles},e.prototype.getTile=function(t,e,r,n,i){var o,a=wp(t,e,r),s=this.getKey();if(this.tileCache.containsKey(a)&&(o=this.tileCache.get(a)).key===s)return o;var l=[t,e,r],u=this.getTileCoordForTileUrlFunction(l,i),h=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(i);if(u&&h){var p=c.getTileCoordExtent(u);te(p,-c.getResolution(t),p),Oe(h,p)||(u=null)}var f=!0;if(null!==u){var d=this.tileGrid,g=c.getResolution(t),y=d.getZForResolution(g,1),v=c.getTileCoordExtent(u);te(v,-g,v),d.forEachTileCoord(v,y,function(t){f=f&&!this.tileUrlFunction(t,n,i)}.bind(this))}var _=new kp(l,f?_l:dl,u,this.getSourceTiles.bind(this,n,i));return _.key=s,o?(_.interimTile=o,_.refreshInterimChain(),this.tileCache.replace(a,_)):this.tileCache.set(a,_),_},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),r=this.tileGrids_[e];if(!r){var n=this.tileGrid;r=Qf(t,void 0,n?n.getTileSize(n.getMinZoom()):void 0),this.tileGrids_[e]=r}return r},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,r){var n=fi(this.getTileGridForProjection(r).getTileSize(t),this.tmpSize);return[Math.round(n[0]*e),Math.round(n[1]*e)]},e.prototype.updateCacheSize=function(e,r){t.prototype.updateCacheSize.call(this,2*e,r),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(r).highWaterMark},e}(ld),Gd=zd;function Nd(t,e){t.setLoader((function(r,n,i){ul(e,t.getFormat(),r,n,i,t.onLoad.bind(t),t.onError.bind(t))}))}var Ud,Bd={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Vd(t){return(t=Math.round(t))<0?0:t>255?255:t}function Xd(t){return t<0?0:t>1?1:t}function Wd(t){return"%"===t[t.length-1]?Vd(parseFloat(t)/100*255):Vd(parseInt(t))}function qd(t){return"%"===t[t.length-1]?Xd(parseFloat(t)/100):Xd(parseFloat(t))}function Yd(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{Ud={}.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in Bd)return Bd[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=qd(a.pop());case"rgb":return 3!==a.length?null:[Wd(a[0]),Wd(a[1]),Wd(a[2]),s];case"hsla":if(4!==a.length)return null;s=qd(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=qd(a[1]),h=qd(a[2]),c=h<=.5?h*(u+1):h+u-h*u,p=2*h-c;return[Vd(255*Yd(p,c,l+1/3)),Vd(255*Yd(p,c,l)),Vd(255*Yd(p,c,l-1/3)),s];default:return null}}return null}}catch(t){}var Kd=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};function Zd(t){return"object"==typeof t?["literal",t]:t}function Hd(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,Zd(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],ng(t[1])]:[t[0],Zd(t[1])]})),n?function(t,e,r){for(var n={},i={},o=[],a=0;a<r.length;a++){var s=r[a],l=s[0].zoom;void 0===n[l]&&(n[l]={zoom:l,type:t.type,property:t.property,default:t.default},i[l]=[],o.push(l)),i[l].push([s[0].value,s[1]])}if("exponential"===rg({},e)){for(var u=[Jd(t),["linear"],["zoom"]],h=0,c=o;h<c.length;h+=1){var p=c[h];eg(u,p,$d(n[p],e,i[p]),!1)}return u}for(var f=["step",["zoom"]],d=0,g=o;d<g.length;d+=1){var y=g[d];eg(f,y,$d(n[y],e,i[y]),!0)}return tg(f),f}(t,e,r):o?function(t,e,r,n){void 0===n&&(n=["zoom"]);var i,o=rg(t,e),a=!1;if("interval"===o)i=["step",n],a=!0;else{if("exponential"!==o)throw new Error('Unknown zoom function type "'+o+'"');var s=void 0!==t.base?t.base:1;i=[Jd(t),1===s?["linear"]:["exponential",s],n]}for(var l=0,u=r;l<u.length;l+=1){var h=u[l];eg(i,h[0],h[1],a)}return tg(i),i}(t,e,r):$d(t,e,r)}function Jd(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Qd(t,e){var r,n,i=Zd((r=t.default,n=e.default,void 0!==r?r:void 0!==n?n:void 0));return void 0===i&&"resolvedImage"===e.type?"":i}function $d(t,e,r){var n=rg(t,e),i=["get",t.property];if("categorical"===n&&"boolean"==typeof r[0][0]){for(var o=["case"],a=0,s=r;a<s.length;a+=1){var l=s[a];o.push(["==",i,l[0]],l[1])}return o.push(Qd(t,e)),o}if("categorical"===n){for(var u=["match",i],h=0,c=r;h<c.length;h+=1){var p=c[h];eg(u,p[0],p[1],!1)}return u.push(Qd(t,e)),u}if("interval"===n){for(var f=["step",["number",i]],d=0,g=r;d<g.length;d+=1){var y=g[d];eg(f,y[0],y[1],!0)}return tg(f),void 0===t.default?f:["case",["==",["typeof",i],"number"],f,Zd(t.default)]}if("exponential"===n){for(var v=void 0!==t.base?t.base:1,_=[Jd(t),1===v?["linear"]:["exponential",v],["number",i]],m=0,x=r;m<x.length;m+=1){var b=x[m];eg(_,b[0],b[1],!1)}return void 0===t.default?_:["case",["==",["typeof",i],"number"],_,Zd(t.default)]}throw new Error("Unknown property function type "+n)}function tg(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function eg(t,e,r,n){t.length>3&&e===t[t.length-2]||(n&&2===t.length||t.push(e),t.push(r))}function rg(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function ng(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<t.length)e.push(t.slice(n));else if(2===e.length)return["to-string",e[1]];return e}Kd.parse=function(t){if(t){if(t instanceof Kd)return t;if("string"==typeof t){var e=Ud(t);if(e)return new Kd(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},Kd.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},Kd.prototype.toArray=function(){var t=this,e=t.r,r=t.g,n=t.b,i=t.a;return 0===i?[0,0,0,0]:[255*e/i,255*r/i,255*n/i,i]},Kd.black=new Kd(0,0,0,1),Kd.white=new Kd(1,1,1,1),Kd.transparent=new Kd(0,0,0,0),Kd.red=new Kd(1,0,0,1),Kd.blue=new Kd(0,0,1,1);var ig=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),og=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var i=n[r],o=i[0],a=i[1];this.bindings[o]=a}};og.prototype.concat=function(t){return new og(this,t)},og.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},og.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var ag={kind:"null"},sg={kind:"number"},lg={kind:"string"},ug={kind:"boolean"},hg={kind:"color"},cg={kind:"object"},pg={kind:"value"},fg={kind:"collator"},dg={kind:"formatted"},gg={kind:"resolvedImage"};function yg(t,e){return{kind:"array",itemType:t,N:e}}function vg(t){if("array"===t.kind){var e=vg(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var _g=[ag,sg,lg,ug,hg,dg,cg,yg(pg),gg];function mg(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!mg(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=_g;r<n.length;r+=1){if(!mg(n[r],e))return null}}return"Expected "+vg(t)+" but found "+vg(e)+" instead."}function xg(t,e){return e.some((function(e){return e.kind===t.kind}))}function bg(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var wg=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};wg.prototype.compare=function(t,e){return this.collator.compare(t,e)},wg.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Sg=function(t,e,r,n,i){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},Cg=function(t){this.sections=t};Cg.fromString=function(t){return new Cg([new Sg(t,null,null,null,null)])},Cg.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},Cg.factory=function(t){return t instanceof Cg?t:Cg.fromString(t)},Cg.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},Cg.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];if(n.image)t.push(["image",n.image.name]);else{t.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i)}}return t};var Eg=function(t){this.name=t.name,this.available=t.available};function Tg(t,e,r,n){return"number"==typeof t&&t>=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 Rg(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 Kd)return!0;if(t instanceof wg)return!0;if(t instanceof Cg)return!0;if(t instanceof Eg)return!0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1){if(!Rg(r[e]))return!1}return!0}if("object"==typeof t){for(var n in t)if(!Rg(t[n]))return!1;return!0}return!1}function Pg(t){if(null===t)return ag;if("string"==typeof t)return lg;if("boolean"==typeof t)return ug;if("number"==typeof t)return sg;if(t instanceof Kd)return hg;if(t instanceof wg)return fg;if(t instanceof Cg)return dg;if(t instanceof Eg)return gg;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var o=Pg(i[n]);if(e){if(e===o)continue;e=pg;break}e=o}return yg(e||pg,r)}return cg}function Og(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Kd||t instanceof Cg||t instanceof Eg?t.toString():JSON.stringify(t)}Eg.prototype.toString=function(){return this.name},Eg.fromString=function(t){return t?new Eg({name:t,available:!1}):null},Eg.prototype.serialize=function(){return["image",this.name]};var Fg=function(t,e){this.type=t,this.value=e};Fg.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!Rg(t[1]))return e.error("invalid value");var r=t[1],n=Pg(r),i=e.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new Fg(n,r)},Fg.prototype.evaluate=function(){return this.value},Fg.prototype.eachChild=function(){},Fg.prototype.outputDefined=function(){return!0},Fg.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Kd?["rgba"].concat(this.value.toArray()):this.value instanceof Cg?this.value.serialize():this.value};var Ig=function(t){this.name="ExpressionEvaluationError",this.message=t};Ig.prototype.toJSON=function(){return this.message};var Mg={string:lg,number:sg,boolean:ug,object:cg},Ag=function(t,e){this.type=t,this.args=e};Ag.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,i=t[0];if("array"===i){var o,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in Mg)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=Mg[s],n++}else o=pg;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=yg(o,a)}else r=Mg[i];for(var l=[];n<t.length;n++){var u=e.parse(t[n],n,pg);if(!u)return null;l.push(u)}return new Ag(r,l)},Ag.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!mg(this.type,Pg(r)))return r;if(e===this.args.length-1)throw new Ig("Expected value to be of type "+vg(this.type)+", but found "+vg(Pg(r))+" instead.")}return null},Ag.prototype.eachChild=function(t){this.args.forEach(t)},Ag.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Ag.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var Lg=function(t){this.type=dg,this.sections=t};Lg.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,sg)))return null;var l=null;if(a["text-font"]&&!(l=e.parse(a["text-font"],1,yg(lg))))return null;var u=null;if(a["text-color"]&&!(u=e.parse(a["text-color"],1,hg)))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,pg);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 Lg(n)},Lg.prototype.evaluate=function(t){return new Cg(this.sections.map((function(e){var r=e.content.evaluate(t);return Pg(r)===gg?new Sg("",r,null,null,null):new Sg(Og(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},Lg.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor)}},Lg.prototype.outputDefined=function(){return!1},Lg.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.content.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),t.push(i)}return t};var kg=function(t){this.type=gg,this.input=t};kg.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,lg);return r?new kg(r):e.error("No image name provided.")},kg.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=Eg.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},kg.prototype.eachChild=function(t){t(this.input)},kg.prototype.outputDefined=function(){return!1},kg.prototype.serialize=function(){return["image",this.input.serialize()]};var Dg={"to-boolean":ug,"to-color":hg,"to-number":sg,"to-string":lg},jg=function(t,e){this.type=t,this.args=e};jg.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=Dg[r],i=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,pg);if(!a)return null;i.push(a)}return new jg(n,i)},jg.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(e=i[n].evaluate(t))instanceof Kd)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":Tg(e[0],e[1],e[2],e[3])))return new Kd(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Ig(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<l.length;s+=1){if(null===(a=l[s].evaluate(t)))return 0;var u=Number(a);if(!isNaN(u))return u}throw new Ig("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?Cg.fromString(Og(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?Eg.fromString(Og(this.args[0].evaluate(t))):Og(this.args[0].evaluate(t))},jg.prototype.eachChild=function(t){this.args.forEach(t)},jg.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},jg.prototype.serialize=function(){if("formatted"===this.type.kind)return new Lg([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new kg(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var zg=["Unknown","Point","LineString","Polygon"],Gg=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null};Gg.prototype.id=function(){return this.feature&&"id"in this.feature&&this.feature.id?this.feature.id:null},Gg.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?zg[this.feature.type]:this.feature.type:null},Gg.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Gg.prototype.canonicalID=function(){return this.canonical},Gg.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Gg.prototype.distanceFromCenter=function(){if(this.featureTileCoord&&this.featureDistanceData){var t=this.featureDistanceData.center,e=this.featureDistanceData.scale,r=this.featureTileCoord,n=r.x,i=r.y,o=n*e-t[0],a=i*e-t[1];return this.featureDistanceData.bearing[0]*o+this.featureDistanceData.bearing[1]*a}return 0},Gg.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Kd.parse(t)),e};var Ng=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};Ng.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Ng.prototype.eachChild=function(t){this.args.forEach(t)},Ng.prototype.outputDefined=function(){return!1},Ng.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},Ng.parse=function(t,e){var r,n=t[0],i=Ng.definitions[n];if(!i)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),l=null,u=0,h=s;u<h.length;u+=1){var c=h[u],p=c[0],f=c[1];l=new hy(e.registry,e.path,null,e.scope);for(var d=[],g=!1,y=1;y<t.length;y++){var v=t[y],_=Array.isArray(p)?p[y-1]:p.type,m=l.parse(v,1+d.length,_);if(!m){g=!0;break}d.push(m)}if(!g)if(Array.isArray(p)&&p.length!==d.length)l.error("Expected "+p.length+" arguments, but found "+d.length+" instead.");else{for(var x=0;x<d.length;x++){var b=Array.isArray(p)?p[x]:p.type,w=d[x];l.concat(x+1).checkSubtype(b,w.type)}if(0===l.errors.length)return new Ng(n,o,f,d)}}if(1===s.length)(r=e.errors).push.apply(r,l.errors);else{for(var S=(s.length?s:a).map((function(t){var e,r=t[0];return e=r,Array.isArray(e)?"("+e.map(vg).join(", ")+")":"("+vg(e.type)+"...)"})).join(" | "),C=[],E=1;E<t.length;E++){var T=e.parse(t[E],1+C.length);if(!T)return null;C.push(vg(T.type))}e.error("Expected arguments of type "+S+", but found ("+C.join(", ")+") instead.")}return null},Ng.register=function(t,e){for(var r in Ng.definitions=e,e)t[r]=Ng};var Ug=function(t,e,r){this.type=fg,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};Ug.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,ug);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,ug);if(!i)return null;var o=null;return r.locale&&!(o=e.parse(r.locale,1,lg))?null:new Ug(n,i,o)},Ug.prototype.evaluate=function(t){return new wg(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Ug.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Ug.prototype.outputDefined=function(){return!1},Ug.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var Bg=8192;function Vg(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Xg(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Wg(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*Bg),Math.round(i*o*Bg)]}function qg(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 Yg(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 Kg(t,e){for(var r=!1,n=0,i=e.length;n<i;n++)for(var o=e[n],a=0,s=o.length;a<s-1;a++){if(qg(t,o[a],o[a+1]))return!1;Yg(t,o[a],o[a+1])&&(r=!r)}return r}function Zg(t,e){for(var r=0;r<e.length;r++)if(Kg(t,e[r]))return!0;return!1}function Hg(t,e,r,n){var i=t[0]-r[0],o=t[1]-r[1],a=e[0]-r[0],s=e[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],h=i*u-l*o,c=a*u-l*s;return h>0&&c<0||h<0&&c>0}function Jg(t,e,r){for(var n=0,i=r;n<i.length;n+=1)for(var o=i[n],a=0;a<o.length-1;++a)if(s=t,l=e,u=o[a],h=o[a+1],c=void 0,p=void 0,f=void 0,d=void 0,f=[l[0]-s[0],l[1]-s[1]],d=[h[0]-u[0],h[1]-u[1]],0!=(c=d)[0]*(p=f)[1]-c[1]*p[0]&&Hg(s,l,u,h)&&Hg(u,h,s,l))return!0;var s,l,u,h,c,p,f,d;return!1}function Qg(t,e){for(var r=0;r<t.length;++r)if(!Kg(t[r],e))return!1;for(var n=0;n<t.length-1;++n)if(Jg(t[n],t[n+1],e))return!1;return!0}function $g(t,e){for(var r=0;r<e.length;r++)if(Qg(t,e[r]))return!0;return!1}function ty(t,e,r){for(var n=[],i=0;i<t.length;i++){for(var o=[],a=0;a<t[i].length;a++){var s=Wg(t[i][a],r);Vg(e,s),o.push(s)}n.push(o)}return n}function ey(t,e,r){for(var n=[],i=0;i<t.length;i++){var o=ty(t[i],e,r);n.push(o)}return n}function ry(t,e,r,n){if(t[0]<r[0]||t[0]>r[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}Vg(e,t)}function ny(t,e,r,n){var i=Math.pow(2,n.z)*Bg,o=[n.x*Bg,n.y*Bg],a=[];if(!t)return a;for(var s=0,l=t;s<l.length;s+=1)for(var u=0,h=l[s];u<h.length;u+=1){var c=h[u],p=[c.x+o[0],c.y+o[1]];ry(p,e,r,i),a.push(p)}return a}function iy(t,e,r,n){var i,o=Math.pow(2,n.z)*Bg,a=[n.x*Bg,n.y*Bg],s=[];if(!t)return s;for(var l=0,u=t;l<u.length;l+=1){for(var h=[],c=0,p=u[l];c<p.length;c+=1){var f=p[c],d=[f.x+a[0],f.y+a[1]];Vg(e,d),h.push(d)}s.push(h)}if(e[2]-e[0]<=o/2){(i=e)[0]=i[1]=1/0,i[2]=i[3]=-1/0;for(var g=0,y=s;g<y.length;g+=1)for(var v=0,_=y[g];v<_.length;v+=1){ry(_[v],e,r,o)}}return s}var oy=function(t,e){this.type=ug,this.geojson=t,this.geometries=e};function ay(t){if(t instanceof Ng){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof oy)return!1;var e=!0;return t.eachChild((function(t){e&&!ay(t)&&(e=!1)})),e}function sy(t){if(t instanceof Ng&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!sy(t)&&(e=!1)})),e}function ly(t,e){if(t instanceof Ng&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!ly(t,e)&&(r=!1)})),r}oy.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(Rg(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;n<r.features.length;++n){var i=r.features[n].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new oy(r,r.features[n].geometry)}else if("Feature"===r.type){var o=r.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new oy(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new oy(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},oy.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===e.type){var o=ty(e.coordinates,n,i),a=ny(t.geometry(),r,n,i);if(!Xg(r,n))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!Kg(l[s],o))return!1}if("MultiPolygon"===e.type){var u=ey(e.coordinates,n,i),h=ny(t.geometry(),r,n,i);if(!Xg(r,n))return!1;for(var c=0,p=h;c<p.length;c+=1)if(!Zg(p[c],u))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===e.type){var o=ty(e.coordinates,n,i),a=iy(t.geometry(),r,n,i);if(!Xg(r,n))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!Qg(l[s],o))return!1}if("MultiPolygon"===e.type){var u=ey(e.coordinates,n,i),h=iy(t.geometry(),r,n,i);if(!Xg(r,n))return!1;for(var c=0,p=h;c<p.length;c+=1)if(!$g(p[c],u))return!1}return!0}(t,this.geometries)}return!1},oy.prototype.eachChild=function(){},oy.prototype.outputDefined=function(){return!0},oy.prototype.serialize=function(){return["within",this.geojson]};var uy=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};uy.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new uy(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},uy.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},uy.prototype.eachChild=function(){},uy.prototype.outputDefined=function(){return!1},uy.prototype.serialize=function(){return["var",this.name]};var hy=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new og),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r};function cy(t){if(t instanceof uy)return cy(t.boundExpression);if(t instanceof Ng&&"error"===t.name)return!1;if(t instanceof Ug)return!1;if(t instanceof oy)return!1;var e=t instanceof jg||t instanceof Ag,r=!0;return t.eachChild((function(t){r=e?r&&cy(t):r&&t instanceof Fg})),!!r&&(ay(t)&&ly(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}function py(t,e){for(var r,n,i=t.length-1,o=0,a=i,s=0;o<=a;)if(r=t[s=Math.floor((o+a)/2)],n=t[s+1],r<=e){if(s===i||e<n)return s;o=s+1}else{if(!(r>e))throw new Ig("Input is not a number.");a=s-1}return 0}hy.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)},hy.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new Ag(e,[t]):"coerce"===r?new jg(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 Fg)&&"resolvedImage"!==o.type.kind&&cy(o)){var l=new Gg;try{o=new Fg(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.")},hy.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 hy(this.registry,n,e||null,i,this.errors)},hy.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 ig(n,t))},hy.prototype.checkSubtype=function(t,e){var r=mg(t,e);return r&&this.error(r),r};var fy=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var o=i[n],a=o[0],s=o[1];this.labels.push(a),this.outputs.push(s)}};fy.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,sg);if(!r)return null;var n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var o=1;o<t.length;o+=2){var a=1===o?-1/0:t[o],s=t[o+1],l=o,u=o+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var h=e.parse(s,u,i);if(!h)return null;i=i||h.type,n.push([a,h])}return new fy(i,r,n)},fy.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[py(e,n)].evaluate(t)},fy.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1){t(r[e])}},fy.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},fy.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var dy=gy;function gy(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 yy(t,e,r){return t*(1-r)+e*r}gy.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},gy.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},gy.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},gy.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)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if((i=t)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(o=this.sampleCurveX(i),Math.abs(o-t)<e)return i;t>o?r=i:n=i,i=.5*(n-r)+r}return i},gy.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var vy=Object.freeze({__proto__:null,number:yy,color:function(t,e,r){return new Kd(yy(t.r,e.r,r),yy(t.g,e.g,r),yy(t.b,e.b,r),yy(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return yy(t,e[n],r)}))}}),_y=.95047,my=1.08883,xy=4/29,by=6/29,wy=3*by*by,Sy=Math.PI/180,Cy=180/Math.PI;function Ey(t){return t>.008856451679035631?Math.pow(t,1/3):t/wy+xy}function Ty(t){return t>by?t*t*t:wy*(t-xy)}function Ry(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Py(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Oy(t){var e=Py(t.r),r=Py(t.g),n=Py(t.b),i=Ey((.4124564*e+.3575761*r+.1804375*n)/_y),o=Ey((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Ey((.0193339*e+.119192*r+.9503041*n)/my)),alpha:t.a}}function Fy(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*Ty(e),r=_y*Ty(r),n=my*Ty(n),new Kd(Ry(3.2404542*r-1.5371385*e-.4985314*n),Ry(-.969266*r+1.8760108*e+.041556*n),Ry(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function Iy(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var My={forward:Oy,reverse:Fy,interpolate:function(t,e,r){return{l:yy(t.l,e.l,r),a:yy(t.a,e.a,r),b:yy(t.b,e.b,r),alpha:yy(t.alpha,e.alpha,r)}}},Ay={forward:function(t){var e=Oy(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*Cy;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*Sy,r=t.c;return Fy({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:Iy(t.h,e.h,r),c:yy(t.c,e.c,r),l:yy(t.l,e.l,r),alpha:yy(t.alpha,e.alpha,r)}}},Ly=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;o<a.length;o+=1){var s=a[o],l=s[0],u=s[1];this.labels.push(l),this.outputs.push(u)}};function ky(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}Ly.interpolationFactor=function(t,e,r,n){var i=0;if("exponential"===t.name)i=ky(e,t.base,r,n);else if("linear"===t.name)i=ky(e,1,r,n);else if("cubic-bezier"===t.name){var o=t.controlPoints;i=new dy(o[0],o[1],o[2],o[3]).solve(ky(e,1,r,n))}return i},Ly.parse=function(t,e){var r=t[0],n=t[1],i=t[2],o=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var a=n[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:a}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);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,sg)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=hg:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var h=0;h<o.length;h+=2){var c=o[h],p=o[h+1],f=h+3,d=h+4;if("number"!=typeof c)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(l.length&&l[l.length-1][0]>=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 Ly(u,r,n,i,l):e.error("Type "+vg(u)+" is not interpolatable.")},Ly.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=py(e,n),a=e[o],s=e[o+1],l=Ly.interpolationFactor(this.interpolation,n,a,s),u=r[o].evaluate(t),h=r[o+1].evaluate(t);return"interpolate"===this.operator?vy[this.type.kind.toLowerCase()](u,h,l):"interpolate-hcl"===this.operator?Ay.reverse(Ay.interpolate(Ay.forward(u),Ay.forward(h),l)):My.reverse(My.interpolate(My.forward(u),My.forward(h),l))},Ly.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1){t(r[e])}},Ly.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Ly.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var Dy=function(t,e){this.type=t,this.args=e};Dy.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=a[o],l=e.parse(s,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!l)return null;r=r||l.type,i.push(l)}var u=n&&i.some((function(t){return mg(n,t.type)}));return new Dy(u?pg:r,i)},Dy.prototype.evaluate=function(t){for(var e,r=null,n=0,i=0,o=this.args;i<o.length;i+=1){if(n++,(r=o[i].evaluate(t))&&r instanceof Eg&&!r.available&&(e||(e=r),r=null,n===this.args.length))return e;if(null!==r)break}return r},Dy.prototype.eachChild=function(t){this.args.forEach(t)},Dy.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Dy.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var jy=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};jy.prototype.evaluate=function(t){return this.result.evaluate(t)},jy.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1){t(r[e][1])}t(this.result)},jy.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var o=e.parse(t[n+1],n+1);if(!o)return null;r.push([i,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return a?new jy(r,a):null},jy.prototype.outputDefined=function(){return this.result.outputDefined()},jy.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e],i=n[0],o=n[1];t.push(i,o.serialize())}return t.push(this.result.serialize()),t};var zy=function(t,e,r){this.type=t,this.index=e,this.input=r};zy.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,sg),n=e.parse(t[2],2,yg(e.expectedType||pg));if(!r||!n)return null;var i=n.type;return new zy(i.itemType,r,n)},zy.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new Ig("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new Ig("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new Ig("Array index must be an integer, but found "+e+" instead.");return r[e]},zy.prototype.eachChild=function(t){t(this.index),t(this.input)},zy.prototype.outputDefined=function(){return!1},zy.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Gy=function(t,e){this.type=ug,this.needle=t,this.haystack=e};Gy.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,pg),n=e.parse(t[2],2,pg);return r&&n?xg(r.type,[ug,lg,sg,ag,pg])?new Gy(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+vg(r.type)+" instead"):null},Gy.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==r)return!1;if(!bg(e,["boolean","string","number","null"]))throw new Ig("Expected first argument to be of type boolean, string, number or null, but found "+vg(Pg(e))+" instead.");if(!bg(r,["string","array"]))throw new Ig("Expected second argument to be of type array or string, but found "+vg(Pg(r))+" instead.");return r.indexOf(e)>=0},Gy.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Gy.prototype.outputDefined=function(){return!0},Gy.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Ny=function(t,e,r){this.type=sg,this.needle=t,this.haystack=e,this.fromIndex=r};Ny.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,pg),n=e.parse(t[2],2,pg);if(!r||!n)return null;if(!xg(r.type,[ug,lg,sg,ag,pg]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+vg(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,sg);return i?new Ny(r,n,i):null}return new Ny(r,n)},Ny.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!bg(e,["boolean","string","number","null"]))throw new Ig("Expected first argument to be of type boolean, string, number or null, but found "+vg(Pg(e))+" instead.");if(!bg(r,["string","array"]))throw new Ig("Expected second argument to be of type array or string, but found "+vg(Pg(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},Ny.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},Ny.prototype.outputDefined=function(){return!1},Ny.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 Uy=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};Uy.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;a<t.length-1;a+=2){var s=t[a],l=t[a+1];Array.isArray(s)||(s=[s]);var u=e.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(var h=0,c=s;h<c.length;h+=1){var p=c[h];if("number"!=typeof p&&"string"!=typeof p)return u.error("Branch labels must be numbers or strings.");if("number"==typeof p&&Math.abs(p)>Number.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,Pg(p)))return null}else r=Pg(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,pg);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 Uy(r,n,d,i,o,g):null},Uy.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(Pg(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Uy.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Uy.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},Uy.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i<o.length;i+=1){var a=o[i];void 0===(c=n[this.cases[a]])?(n[this.cases[a]]=r.length,r.push([this.cases[a],[a]])):r[c][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,u=r;l<u.length;l+=1){var h=u[l],c=h[0],p=h[1];1===p.length?e.push(s(p[0])):e.push(p.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var By=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};By.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],i=1;i<t.length-1;i+=2){var o=e.parse(t[i],i,ug);if(!o)return null;var a=e.parse(t[i+1],i+1,r);if(!a)return null;n.push([o,a]),r=r||a.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new By(r,n,s):null},By.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],o=n[1];if(i.evaluate(t))return o.evaluate(t)}return this.otherwise.evaluate(t)},By.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],o=n[1];t(i),t(o)}t(this.otherwise)},By.prototype.outputDefined=function(){return this.branches.every((function(t){return t[0],t[1].outputDefined()}))&&this.otherwise.outputDefined()},By.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Vy=function(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n};function Xy(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Wy(t,e,r,n){return 0===n.compare(e,r)}function qy(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=ug,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],o=e.parse(t[1],1,pg);if(!o)return null;if(!Xy(r,o.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+vg(o.type)+"'.");var a=e.parse(t[2],2,pg);if(!a)return null;if(!Xy(r,a.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+vg(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+vg(o.type)+"' and '"+vg(a.type)+"'.");n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new Ag(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new Ag(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,fg)))return null}return new i(o,a,s)},i.prototype.evaluate=function(i){var o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=Pg(o),l=Pg(a);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new Ig('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var u=Pg(o),h=Pg(a);if("string"!==u.kind||"string"!==h.kind)return e(i,o,a)}return this.collator?r(i,o,a,this.collator.evaluate(i)):e(i,o,a)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},i.prototype.outputDefined=function(){return!0},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},i}()}Vy.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,pg),n=e.parse(t[2],2,sg);if(!r||!n)return null;if(!xg(r.type,[yg(pg),lg,pg]))return e.error("Expected first argument to be of type array or string, but found "+vg(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,sg);return i?new Vy(r.type,r,n,i):null}return new Vy(r.type,r,n)},Vy.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!bg(e,["string","array"]))throw new Ig("Expected first argument to be of type array or string, but found "+vg(Pg(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},Vy.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Vy.prototype.outputDefined=function(){return!1},Vy.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 Yy=qy("==",(function(t,e,r){return e===r}),Wy),Ky=qy("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Wy(0,e,r,n)})),Zy=qy("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),Hy=qy(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Jy=qy("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Qy=qy(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),$y=function(t,e,r,n,i){this.type=lg,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};$y.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,sg);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,lg)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,lg)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,sg)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,sg))?null:new $y(r,i,o,a,s)},$y.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))},$y.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)},$y.prototype.outputDefined=function(){return!1},$y.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 tv=function(t){this.type=sg,this.input=t};tv.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 "+vg(r.type)+" instead."):new tv(r):null},tv.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 Ig("Expected value to be of type string or array, but found "+vg(Pg(e))+" instead.")},tv.prototype.eachChild=function(t){t(this.input)},tv.prototype.outputDefined=function(){return!1},tv.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ev={"==":Yy,"!=":Ky,">":Hy,"<":Zy,">=":Qy,"<=":Jy,array:Ag,at:zy,boolean:Ag,case:By,coalesce:Dy,collator:Ug,format:Lg,image:kg,in:Gy,"index-of":Ny,interpolate:Ly,"interpolate-hcl":Ly,"interpolate-lab":Ly,length:tv,let:jy,literal:Fg,match:Uy,number:Ag,"number-format":$y,object:Ag,slice:Vy,step:fy,string:Ag,"to-boolean":jg,"to-color":jg,"to-number":jg,"to-string":jg,var:uy,within:oy};function rv(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=Tg(r,n,i,a);if(s)throw new Ig(s);return new Kd(r/255*a,n/255*a,i/255*a,a)}function nv(t,e){return t in e}function iv(t,e){var r=e[t];return void 0===r?null:r}function ov(t){return{type:t}}function av(t){return{result:"success",value:t}}function sv(t){return{result:"error",value:t}}function lv(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}Ng.register(ev,{error:[{kind:"error"},[lg],function(t,e){var r=e[0];throw new Ig(r.evaluate(t))}],typeof:[lg,[pg],function(t,e){return vg(Pg(e[0].evaluate(t)))}],"to-rgba":[yg(sg,4),[hg],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[hg,[sg,sg,sg],rv],rgba:[hg,[sg,sg,sg,sg],rv],has:{type:ug,overloads:[[[lg],function(t,e){return nv(e[0].evaluate(t),t.properties())}],[[lg,cg],function(t,e){var r=e[0],n=e[1];return nv(r.evaluate(t),n.evaluate(t))}]]},get:{type:pg,overloads:[[[lg],function(t,e){return iv(e[0].evaluate(t),t.properties())}],[[lg,cg],function(t,e){var r=e[0],n=e[1];return iv(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[pg,[lg],function(t,e){return iv(e[0].evaluate(t),t.featureState||{})}],properties:[cg,[],function(t){return t.properties()}],"geometry-type":[lg,[],function(t){return t.geometryType()}],id:[pg,[],function(t){return t.id()}],zoom:[sg,[],function(t){return t.globals.zoom}],pitch:[sg,[],function(t){return t.globals.pitch||0}],"distance-from-center":[sg,[],function(t){return t.distanceFromCenter()}],"heatmap-density":[sg,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[sg,[],function(t){return t.globals.lineProgress||0}],"sky-radial-progress":[sg,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[pg,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[sg,ov(sg),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1){r+=i[n].evaluate(t)}return r}],"*":[sg,ov(sg),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1){r*=i[n].evaluate(t)}return r}],"-":{type:sg,overloads:[[[sg,sg],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)-n.evaluate(t)}],[[sg],function(t,e){return-e[0].evaluate(t)}]]},"/":[sg,[sg,sg],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)/n.evaluate(t)}],"%":[sg,[sg,sg],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)%n.evaluate(t)}],ln2:[sg,[],function(){return Math.LN2}],pi:[sg,[],function(){return Math.PI}],e:[sg,[],function(){return Math.E}],"^":[sg,[sg,sg],function(t,e){var r=e[0],n=e[1];return Math.pow(r.evaluate(t),n.evaluate(t))}],sqrt:[sg,[sg],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[sg,[sg],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN10}],ln:[sg,[sg],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[sg,[sg],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN2}],sin:[sg,[sg],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[sg,[sg],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[sg,[sg],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[sg,[sg],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[sg,[sg],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[sg,[sg],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[sg,ov(sg),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[sg,ov(sg),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[sg,[sg],function(t,e){var r=e[0];return Math.abs(r.evaluate(t))}],round:[sg,[sg],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[sg,[sg],function(t,e){var r=e[0];return Math.floor(r.evaluate(t))}],ceil:[sg,[sg],function(t,e){var r=e[0];return Math.ceil(r.evaluate(t))}],"filter-==":[ug,[lg,pg],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[ug,[pg],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[ug,[lg],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[ug,[lg,pg],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-<":[ug,[pg],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[ug,[lg,pg],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->":[ug,[pg],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[ug,[lg,pg],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-<=":[ug,[pg],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[ug,[lg,pg],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->=":[ug,[pg],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[ug,[pg],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[ug,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[ug,[yg(lg)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[ug,[yg(pg)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[ug,[lg,yg(pg)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[ug,[lg,yg(pg)],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:ug,overloads:[[[ug,ug],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[ov(ug),function(t,e){for(var r=0,n=e;r<n.length;r+=1){if(!n[r].evaluate(t))return!1}return!0}]]},any:{type:ug,overloads:[[[ug,ug],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)||n.evaluate(t)}],[ov(ug),function(t,e){for(var r=0,n=e;r<n.length;r+=1){if(n[r].evaluate(t))return!0}return!1}]]},"!":[ug,[ug],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[ug,[lg],function(t,e){var r=e[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(r.evaluate(t))}],upcase:[lg,[lg],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[lg,[lg],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[lg,ov(pg),function(t,e){return e.map((function(e){return Og(e.evaluate(t))})).join("")}],"resolved-locale":[lg,[fg],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var uv=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new Gg,this._defaultValue=e?function(t){return"color"===t.type&&lv(t.default)?new Kd(0,0,0,0):"color"===t.type?Kd.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function hv(t,e){var r=new hy(ev,[],e?function(t){var e={color:hg,string:lg,number:sg,enum:lg,boolean:ug,formatted:dg,resolvedImage:gg};if("array"===t.type)return yg(e[t.value]||pg,t.length);return e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?av(new uv(n,e)):sv(r.errors)}uv.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o,a,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)},uv.prototype.evaluate=function(t,e,r,n,i,o,a,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null;try{var l=this.expression.evaluate(this._evaluator);if(null==l||"number"==typeof l&&l!=l)return this._defaultValue;if(this._enumValues&&!(l in this._enumValues))throw new Ig("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(l)+" instead.");return l}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var cv=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!sy(e.expression)};cv.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},cv.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var pv=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!sy(e.expression),this.interpolationType=n};function fv(t,e){if("error"===(t=hv(t,e)).result)return t;var r=t.value.expression,n=ay(r);if(!n&&!function(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}(e))return sv([new ig("","data expressions not supported")]);var i=ly(r,["zoom","pitch","distance-from-center"]);if(!i&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return sv([new ig("","zoom expressions not supported")]);var o=dv(r);if(!o&&!i)return sv([new ig("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof ig)return sv([o]);if(o instanceof Ly&&!function(t){return!!t.expression&&t.expression.interpolated}(e))return sv([new ig("",'"interpolate" expressions cannot be used with this property')]);if(!o)return av(new cv(n?"constant":"source",t.value));var a=o instanceof Ly?o.interpolation:void 0;return av(new pv(n?"camera":"composite",t.value,o.labels,a))}function dv(t){var e=null;if(t instanceof jy)e=dv(t.result);else if(t instanceof Dy)for(var r=0,n=t.args;r<n.length;r+=1){var i=n[r];if(e=dv(i))break}else(t instanceof fy||t instanceof Ly)&&t.input instanceof Ng&&"zoom"===t.input.name&&(e=t);return e instanceof ig||t.eachChild((function(t){var r=dv(t);r instanceof ig?e=r:!e&&r?e=new ig("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new ig("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function gv(t){if(Array.isArray(t))return t.map(gv);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=gv(t[r]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}pv.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},pv.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)},pv.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?Ly.interpolationFactor(this.interpolationType,t,e,r):0};var yv={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},fog:{type:"fog"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},projection:{type:"projection"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{},sky:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_symbol:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Camera"},pitch:{group:"Camera"},"distance-from-center":{group:"Camera"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"sky-radial-progress":{group:"sky"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},projection:{name:{type:"enum",values:{albers:{},equalEarth:{},equirectangular:{},lambertConformalConic:{},mercator:{},naturalEarth:{},winkelTripel:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};function vv(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<r.length;e+=1){var n=r[e];if(!vv(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}function _v(t,e){if(void 0===e&&(e="fill"),null==t)return{filter:function(){return!0},needGeometry:!1,needFeature:!1};vv(t)||(t=Ev(t));var r=t,n=!0;try{n=function(t){if(!bv(t))return t;var e=gv(t);return xv(e),e=mv(e)}(r)}catch(t){console.warn("Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n"+JSON.stringify(r,null,2)+"\n ")}var i=yv["filter_"+e],o=hv(n,i),a=null;if("error"===o.result)throw new Error(o.value.map((function(t){return t.key+": "+t.message})).join(", "));a=function(t,e,r){return o.value.evaluate(t,e,{},r)};var s=null,l=null;if(n!==r){var u=hv(r,i);if("error"===u.result)throw new Error(u.value.map((function(t){return t.key+": "+t.message})).join(", "));s=function(t,e,r,n,i){return u.value.evaluate(t,e,{},r,void 0,void 0,n,i)},l=!ay(u.value.expression)}return{filter:a,dynamicFilter:s||void 0,needGeometry:Cv(n),needFeature:!!l}}function mv(t){if(!Array.isArray(t))return t;var e=function(t){if(wv.has(t[0]))for(var e=1;e<t.length;e++){if(bv(t[e]))return!0}return t}(t);return!0===e?e:e.map((function(t){return mv(t)}))}function xv(t){var e=!1,r=[];if("case"===t[0]){for(var n=1;n<t.length-1;n+=2)e=e||bv(t[n]),r.push(t[n+1]);r.push(t[t.length-1])}else if("match"===t[0]){e=e||bv(t[1]);for(var i=2;i<t.length-1;i+=2)r.push(t[i+1]);r.push(t[t.length-1])}else if("step"===t[0]){e=e||bv(t[1]);for(var o=1;o<t.length-1;o+=2)r.push(t[o+1])}e&&(t.length=0,t.push.apply(t,["any"].concat(r)));for(var a=1;a<t.length;a++)xv(t[a])}function bv(t){if(!Array.isArray(t))return!1;if("pitch"===(e=t[0])||"distance-from-center"===e)return!0;for(var e,r=1;r<t.length;r++){if(bv(t[r]))return!0}return!1}var wv=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function Sv(t,e){return t<e?-1:t>e?1:0}function Cv(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e<t.length;e++)if(Cv(t[e]))return!0;return!1}function Ev(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Tv(t[1],t[2],"=="):"!="===r?Ov(Tv(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Tv(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Ev))):"all"===r?["all"].concat(t.slice(1).map(Ev)):"none"===r?["all"].concat(t.slice(1).map(Ev).map(Ov)):"in"===r?Rv(t[1],t.slice(2)):"!in"===r?Ov(Rv(t[1],t.slice(2))):"has"===r?Pv(t[1]):"!has"===r?Ov(Pv(t[1])):"within"!==r||t}function Tv(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 Rv(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(Sv)]]:["filter-in-small",t,["literal",e]]}}function Pv(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ov(t){return["!",t]}var Fv=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Iv(t,e){var r={};for(var n in t)"ref"!==n&&(r[n]=t[n]);return Fv.forEach((function(t){t in e&&(r[t]=e[t])})),r}var Mv={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},Av=" ",Lv=/(italic|oblique)$/i,kv={},Dv=function(t,e,r){var n=kv[t];if(!n){Array.isArray(t)||(t=[t]);for(var i=400,o="normal",a=[],s=0,l=t.length;s<l;++s){var u=t[s].split(" "),h=u[u.length-1].toLowerCase();for(var c in"normal"==h||"italic"==h||"oblique"==h?(o=h,u.pop(),h=u[u.length-1].toLowerCase()):Lv.test(h)&&(h=h.replace(Lv,""),o=u[u.length-1].replace(h,"")),Mv){var p=u.length>1?u[u.length-2].toLowerCase():"";if(h==c||h==c.replace("-","")||p+"-"+h==c){i=Mv[c],u.pop(),p&&c.startsWith(p)&&u.pop();break}}"number"==typeof h&&(i=h);var f=u.join(Av).replace("Klokantech Noto Sans","Noto Sans");-1!==f.indexOf(Av)&&(f='"'+f+'"'),a.push(f)}n=kv[t]=[o,i,a]}return n[0]+Av+n[1]+Av+e+"px"+(r?"/"+r:"")+Av+n[2]},jv="https://api.mapbox.com";function zv(t){var e="mapbox://";return 0!==t.indexOf(e)?"":t.slice(e.length)}function Gv(t,e){var r=zv(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 jv+"/styles/v1/"+i+"?&access_token="+e}function Nv(t,e,r,n){var i=new URL(t,n),o=zv(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 Uv(t){return t*Math.PI/180}var Bv=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function Vv(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 Xv={};function Wv(t,e,r){if(void 0===r&&(r={}),e in Xv)return Xv[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 Xv[e],t.ok?t.json():Promise.reject(new Error("Error fetching source "+e))})).catch((function(t){return delete Xv[e],Promise.reject(new Error("Error fetching source "+e))}));return Xv[e]=i,i}var qv={};var Yv,Kv=Array(256).join(" ");function Zv(t,e){if(e>=.05){for(var r="",n=t.split("\n"),i=Kv.slice(0,Math.round(e/.1)),o=0,a=n.length;o<a;++o)o>0&&(r+="\n"),r+=n[o].split("").join(i);return r}return t}function Hv(){return Yv||(Yv=Vv(1,1).getContext("2d")),Yv}function Jv(t,e){return Hv().measureText(t).width+(t.length-1)*e}var Qv={};function $v(t,e,r,n){if(-1!==t.indexOf("\n")){for(var i=t.split("\n"),o=[],a=0,s=i.length;a<s;++a)o.push($v(i[a],e,r,n));return o.join("\n")}var l=r+","+e+","+t+","+n,u=Qv[l];if(!u){var h=t.split(" ");if(h.length>1){var c=Hv();c.font=e;for(var p=c.measureText("M").width*r,f="",d=[],g=0,y=h.length;g<y;++g){var v=h[g],_=f+(f?" ":"")+v;Jv(_,n)<=p?f=_:(f&&d.push(f),f=v)}f&&d.push(f);for(var m=0,x=d.length;m<x&&x>1;++m){var b=d[m];if(Jv(b,n)<.35*p){var w=m>0?Jv(d[m-1],n):1/0,S=m<x-1?Jv(d[m+1],n):1/0;d.splice(m,1),x-=1,w<S?(d[m-1]+=" "+b,m-=1):d[m]=b+" "+d[m]}}for(var C=0,E=d.length-1;C<E;++C){var T=d[C],R=d[C+1];if(Jv(T,n)>.7*p&&Jv(R,n)<.6*p){var P=T.split(" "),O=P.pop();Jv(O,n)<.2*p&&(d[C]=P.join(" "),d[C+1]=O+" "+R),E-=1}}u=d.join("\n")}else u=t;u=Zv(u,n),Qv[l]=u}return u}var t_,e_=/font-family: ?([^;]*);/,r_=/("|')/g;function n_(t){if(!t_){t_={};for(var e=document.styleSheets,r=0,n=e.length;r<n;++r){var i=e[r];try{var o=i.rules||i.cssRules;if(o)for(var a=0,s=o.length;a<s;++a){var l=o[a];if(5==l.type){var u=l.cssText.match(e_);t_[u[1].replace(r_,"")]=!0}}}catch(t){}}}return t in t_}var i_={};function o_(t){var e=t.toString();if(e in i_)return i_[e];for(var r=[],n=0,i=t.length;n<i;++n){t[n]=t[n].replace("Arial Unicode MS","Arial");var o=t[n],a=Dv(o,1);Hi(a);var s=a.split(" ");r.push([s.slice(3).join(" ").replace(/"/g,""),s[1],s[0]])}for(var l=0,u=r.length;l<u;++l){var h=r[l],c=h[0];if(!n_(c)&&100!==Wi.get(h[2]+"\n"+h[1]+" \n"+c)){var p="https://fonts.googleapis.com/css?family="+c.replace(/ /g,"+")+":"+h[1]+h[2];if(!document.querySelector('link[href="'+p+'"]')){var f=document.createElement("link");f.href=p,f.rel="stylesheet",document.head.appendChild(f)}}}return i_[e]=t,t}var a_,s_,l_={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},u_={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},h_={},c_={zoom:0};function p_(t,e,r,n,i,o,a){var s=t.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[s]||(o[s]={});var l,u=o[s];if(!u[r]){var h=(t[e]||h_)[r],c=yv[e+"_"+t.type][r];void 0===h&&(h=c.default);var p=(l=h,Array.isArray(l)&&l.length>0&&"string"==typeof l[0]&&l[0]in ev);if(!p&&lv(h)&&(h=Hd(h,c),p=!0),p){var f=function(t,e){var r=fv(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=Kd.parse(h)),u[r]=function(){return h}}return c_.zoom=n,u[r](c_,i,a)}function f_(t,e,r,n){return p_(t,"layout","icon-allow-overlap",e,r,n)?p_(t,"layout","icon-ignore-placement",e,r,n)?"none":"obstacle":"declutter"}function d_(t,e,r,n,i){return i||console.warn("No filterCache provided to evaluateFilter()"),t in i||(i[t]=_v(e).filter),c_.zoom=n,i[t](c_,r)}function g_(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 y_=/^([^]*)\{(.*)\}([^]*)$/;function v_(t,e){var r;do{if(r=t.match(y_)){var n=e[r[2]]||"";t=r[1]+n+r[3]}}while(r);return t}function __(t,e,r,n,i,o,a){if(void 0===n&&(n=Bv),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<t.length;r++)e[t[r].id]=t[r];for(var n=0;n<t.length;n++)"ref"in t[n]&&(t[n]=Iv(t[n],e[t[n].ref]));return t}(e.layers),f={},d=[],g={},y={},v={},_={},m=0,x=p.length;m<x;++m){var b=p[m],w=b.id;if("string"==typeof r&&b.source==r||-1!==r.indexOf(w)){var S=b["source-layer"];if(c){if(b.source!==c)throw new Error('Layer "'+w+'" does not use source "'+c)}else{c=b.source;var C=e.sources[c];if(!C)throw new Error('Source "'+c+'" is not defined');var E=C.type;if("vector"!==E&&"geojson"!==E)throw new Error('Source "'+c+'" is not of type "vector" or "geojson", but "'+E+'"')}var T=f[S];T||(T=[],f[S]=T),T.push({layer:b,index:m}),d.push(w)}}var R=new ii,P=new Hn,O=[],F=function(e,r){var o=e.getProperties(),u=f[o.layer];if(u){var h=n.indexOf(r);-1==h&&(h=function(t,e){for(var r=0,n=e.length;r<n;++r)if(e[r]<t&&r+1<n){var i=e[r]/e[r+1];return r+Math.log(e[r]/t)/Math.log(i)}return n-1}(r,n));for(var c=l_[e.getGeometry().getType()],p={properties:o,type:c},d=t.get("mapbox-featurestate")[e.getId()],m=-1,x=0,b=u.length;x<b;++x){var w=u[x],S=w.layer,C=S.id,E=S.layout||h_,T=S.paint||h_;if(!("none"===E.visibility||"minzoom"in S&&h<S.minzoom||"maxzoom"in S&&h>=S.maxzoom)){var F=S.filter;if(!F||d_(C,F,p,h,_)){var I=void 0,M=void 0,A=void 0,L=void 0,k=void 0,D=void 0,j=w.index;if(3==c&&("fill"==S.type||"fill-extrusion"==S.type))if(M=p_(S,"paint",S.type+"-opacity",h,p,v,d),S.type+"-pattern"in T){var z=p_(S,"paint",S.type+"-pattern",h,p,v,d);if(z){var G="string"==typeof z?v_(z,o):z.toString();if(s&&i&&i[G]){++m,(D=O[m])&&D.getFill()&&!D.getStroke()&&!D.getText()||(D=new fo({fill:new Hn}),O[m]=D),A=D.getFill(),D.setZIndex(j);var N=G+"."+M,U=y[N];if(!U){var B=i[G],V=Vv(B.width,B.height),X=V.getContext("2d");X.globalAlpha=M,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}A.setColor(U)}}}else I=g_(p_(S,"paint",S.type+"-color",h,p,v,d),M),S.type+"-outline-color"in T&&(k=g_(p_(S,"paint",S.type+"-outline-color",h,p,v,d),M)),k||(k=I),(I||k)&&(++m,(!(D=O[m])||I&&!D.getFill()||!I&&D.getFill()||k&&!D.getStroke()||!k&&D.getStroke()||D.getText())&&(D=new fo({fill:I?new Hn:void 0,stroke:k?new ii:void 0}),O[m]=D),I&&(A=D.getFill()).setColor(I),k&&((L=D.getStroke()).setColor(k),L.setWidth(.5)),D.setZIndex(j));if(1!=c&&"line"==S.type){I=!("line-pattern"in T)&&"line-color"in T?g_(p_(S,"paint","line-color",h,p,v,d),p_(S,"paint","line-opacity",h,p,v,d)):void 0;var W=p_(S,"paint","line-width",h,p,v,d);I&&W>0&&(++m,(D=O[m])&&D.getStroke()&&!D.getFill()&&!D.getText()||(D=new fo({stroke:new ii}),O[m]=D),(L=D.getStroke()).setLineCap(p_(S,"layout","line-cap",h,p,v,d)),L.setLineJoin(p_(S,"layout","line-join",h,p,v,d)),L.setMiterLimit(p_(S,"layout","line-miter-limit",h,p,v,d)),L.setColor(I),L.setWidth(W),L.setLineDash(T["line-dasharray"]?p_(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=p_(S,"layout","icon-image",h,p,v,d);if(Q){Z="string"==typeof Q?v_(Q,o):Q.toString();var $=void 0;if(s&&i&&i[Z]){var tt=p_(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(s_||(s_=new Wp("Point",a_=[NaN,NaN],[],{},null)),$=s_,a_[0]=nt[0],a_[1]=nt[1],"line"===p_(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<st;at+=it){var lt=ot[at],ut=ot[at+1],ht=ot[at+it],ct=ot[at+it+1],pt=Math.min(lt,ht),ft=Math.min(ut,ct),dt=Math.max(lt,ht),gt=Math.max(ut,ct);if(nt[0]>=pt&&nt[0]<=dt&&nt[1]>=ft&&nt[1]<=gt){K=Math.atan2(ut-ct,ht-lt);break}}}}}if(2!==c||$){var yt=p_(S,"layout","icon-size",h,p,v,d),vt=void 0!==T["icon-color"]?p_(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=f_(S,h,p,v);H=new Ms({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?p_(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 fo,O[m]=D),D.setGeometry($),H.setRotation(K+Uv(p_(S,"layout","icon-rotate",h,p,v,d))),H.setOpacity(p_(S,"paint","icon-opacity",h,p,v,d)),H.setAnchor(u_[p_(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 fo,O[m]=D);var bt="circle-radius"in T?p_(S,"paint","circle-radius",h,p,v,d):5,wt=g_(p_(S,"paint","circle-stroke-color",h,p,v,d),p_(S,"paint","circle-stroke-opacity",h,p,v,d)),St=g_(p_(S,"paint","circle-color",h,p,v,d),p_(S,"paint","circle-opacity",h,p,v,d)),Ct=p_(S,"paint","circle-stroke-width",h,p,v,d),Et=bt+"."+wt+"."+St+"."+Ct;(H=g[Et])||(H=new so({radius:bt,stroke:wt&&Ct>0?new ii({width:Ct,color:wt}):void 0,fill:St?new Hn({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,Rt=void 0,Pt=void 0,Ot=void 0,Ft=void 0,It=void 0;if("text-field"in E){Ot=Math.round(p_(S,"layout","text-size",h,p,v,d));var Mt=p_(S,"layout","text-font",h,p,v,d);Pt=p_(S,"layout","text-line-height",h,p,v,d),(Rt=Dv(a?a(Mt):Mt,Ot,Pt)).includes("sans-serif")||(Rt+=",sans-serif"),Ft=p_(S,"layout","text-letter-spacing",h,p,v,d),It=p_(S,"layout","text-max-width",h,p,v,d);var At=p_(S,"layout","text-field",h,p,v,d);Tt="object"==typeof At&&At.sections?1===At.sections.length?At.toString():At.sections.reduce((function(t,e,r){var n=e.fontStack?e.fontStack.split(","):Mt,i=Dv(a?a(n):n,Ot*(e.scale||1),Pt),o=e.text;if("\n"===o)return t.push("\n",""),t;if(2!=c){for(var s=0,l=(o=$v(o,i,It,Ft).split("\n")).length;s<l;++s)s>0&&t.push("\n",""),t.push(o[s],i);return t}t.push(Zv(o,Ft),i)}),[]):v_(At,o).trim(),M=p_(S,"paint","text-opacity",h,p,v,d)}if(Tt&&M&&!J){q||(++m,(D=O[m])&&D.getText()&&!D.getFill()&&!D.getStroke()||(D=new fo,O[m]=D),D.setImage(void 0),D.setGeometry(void 0)),D.getText()||D.setText(Y||new _o({padding:[2,2,2,2]})),Y=D.getText();var Lt=E["text-transform"];"uppercase"==Lt?Tt=Array.isArray(Tt)?Tt.map((function(t,e){return e%2?t:t.toUpperCase()})):Tt.toUpperCase():"lowercase"==Lt&&(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?Zv(Tt,Ft):$v(Tt,Rt,It,Ft);Y.setText(kt),Y.setFont(Rt),Y.setRotation(Uv(p_(S,"layout","text-rotate",h,p,v,d)));var Dt=p_(S,"layout","text-anchor",h,p,v,d),jt=q||1==c?"point":p_(S,"layout","symbol-placement",h,p,v,d);Y.setPlacement(jt),Y.setOverflow("point"===jt);var zt=p_(S,"paint","text-halo-width",h,p,v,d),Gt=p_(S,"layout","text-offset",h,p,v,d),Nt=p_(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=zt):-1!==Dt.indexOf("right")&&(Vt="right",Bt=-zt),Y.setTextAlign(Vt);var Xt=p_(S,"layout","text-rotation-alignment",h,p,v,d);Y.setRotateWithView("map"==Xt)}else Y.setMaxAngle(Uv(p_(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=-zt-.5*(Pt-1)*Ot):0==Dt.indexOf("top")&&(Wt="top",Ut=zt+.5*(Pt-1)*Ot),Y.setTextBaseline(Wt),Y.setOffsetX(Gt[0]*Ot+Bt+Nt[0]),Y.setOffsetY(Gt[1]*Ot+Ut+Nt[1]),P.setColor(g_(p_(S,"paint","text-color",h,p,v,d),M)),Y.setFill(P);var qt=g_(p_(S,"paint","text-halo-color",h,p,v,d),M);if(qt){R.setColor(qt),zt*=2;var Yt=.5*Ot;R.setWidth(zt<=Yt?zt:Yt),Y.setStroke(R)}else Y.setStroke(void 0);var Kt=p_(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 m_=new ef;var x_={exports:{}},b_=rf(Iu),w_=rf(q),S_=rf(Nl);!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;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=function t(e,r,n){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,r);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,r,n)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(n):void 0},a=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},l="layer-switcher-",u=function(t){function u(t){n(this,u);var e=Object.assign({},t),r=e.tipLabel?e.tipLabel:"Legend",i=e.collapseTipLabel?e.collapseTipLabel:"Collapse legend",o=document.createElement("div"),a=s(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,{element:o,target:e.target}));a.activationMode=e.activationMode||"mouseover",a.startActive=!0===e.startActive;var h=void 0!==e.label?e.label:"",c=void 0!==e.collapseLabel?e.collapseLabel:"»";a.groupSelectStyle=u.getGroupSelectStyle(e.groupSelectStyle),a.reverse=!1!==e.reverse,a.mapListeners=[],a.hiddenClassName="ol-unselectable ol-control layer-switcher",u.isTouchDevice_()&&(a.hiddenClassName+=" touch"),a.shownClassName="shown",o.className=a.hiddenClassName;var p=document.createElement("button");return p.setAttribute("title",r),p.setAttribute("aria-label",r),o.appendChild(p),a.panel=document.createElement("div"),a.panel.className="panel",o.appendChild(a.panel),u.enableTouchScroll_(a.panel),p.textContent=h,o.classList.add(l+"group-select-style-"+a.groupSelectStyle),o.classList.add(l+"activation-mode-"+a.activationMode),"click"===a.activationMode?(o.classList.add("activationModeClick"),a.startActive&&(p.textContent=c,p.setAttribute("title",i),p.setAttribute("aria-label",i)),p.onclick=function(t){var e=t||window.event;a.element.classList.contains(a.shownClassName)?(a.hidePanel(),p.textContent=h,p.setAttribute("title",r),p.setAttribute("aria-label",r)):(a.showPanel(),p.textContent=c,p.setAttribute("title",i),p.setAttribute("aria-label",i)),e.preventDefault()}):(p.onmouseover=function(){a.showPanel()},p.onclick=function(t){var e=t||window.event;a.showPanel(),e.preventDefault()},a.panel.onmouseout=function(t){a.panel.contains(t.relatedTarget)||a.hidePanel()}),a}return a(u,t),i(u,[{key:"setMap",value:function(t){for(var r=this,n=0;n<this.mapListeners.length;n++)e.unByKey(this.mapListeners[n]);this.mapListeners.length=0,o(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"setMap",this).call(this,t),t&&(this.startActive?this.showPanel():this.renderPanel(),"click"!==this.activationMode&&this.mapListeners.push(t.on("pointerdown",(function(){r.hidePanel()}))))}},{key:"showPanel",value:function(){this.element.classList.contains(this.shownClassName)||(this.element.classList.add(this.shownClassName),this.renderPanel())}},{key:"hidePanel",value:function(){this.element.classList.contains(this.shownClassName)&&this.element.classList.remove(this.shownClassName)}},{key:"renderPanel",value:function(){this.dispatchEvent("render"),u.renderPanel(this.getMap(),this.panel,{groupSelectStyle:this.groupSelectStyle,reverse:this.reverse}),this.dispatchEvent("rendercomplete")}}],[{key:"renderPanel",value:function(t,e,r){var n=new Event("render");for(e.dispatchEvent(n),(r=r||{}).groupSelectStyle=u.getGroupSelectStyle(r.groupSelectStyle),u.ensureTopVisibleBaseLayerShown(t,r.groupSelectStyle);e.firstChild;)e.removeChild(e.firstChild);u.forEachRecursive(t,(function(t,e,r){t.set("indeterminate",!1)})),"children"===r.groupSelectStyle||"none"===r.groupSelectStyle?u.setGroupVisibility(t):"group"===r.groupSelectStyle&&u.setChildVisibility(t);var i=document.createElement("ul");e.appendChild(i),u.renderLayers_(t,t,i,r,(function(n){u.renderPanel(t,e,r)}));var o=new Event("rendercomplete");e.dispatchEvent(o)}},{key:"isBaseGroup",value:function(t){if(t instanceof r){var e=t.getLayers().getArray();return e.length&&"base"===e[0].get("type")}return!1}},{key:"setGroupVisibility",value:function(t){u.getGroupsAndLayers(t,(function(t){return t instanceof r&&!t.get("combine")&&!u.isBaseGroup(t)})).reverse().forEach((function(t){var e=t.getLayersArray().map((function(t){return t.getVisible()}));e.every((function(t){return!0===t}))?(t.setVisible(!0),t.set("indeterminate",!1)):e.every((function(t){return!1===t}))?(t.setVisible(!1),t.set("indeterminate",!1)):(t.setVisible(!0),t.set("indeterminate",!0))}))}},{key:"setChildVisibility",value:function(t){u.getGroupsAndLayers(t,(function(t){return t instanceof r&&!t.get("combine")&&!u.isBaseGroup(t)})).forEach((function(t){var e=t,r=e.getVisible(),n=e.get("indeterminate");e.getLayers().getArray().forEach((function(t){t.set("indeterminate",!1),r&&!n||!t.getVisible()||t.set("indeterminate",!0)}))}))}},{key:"ensureTopVisibleBaseLayerShown",value:function(t,e){var r=void 0;u.forEachRecursive(t,(function(t,e,n){"base"===t.get("type")&&t.getVisible()&&(r=t)})),r&&u.setVisible_(t,r,!0,e)}},{key:"getGroupsAndLayers",value:function(t,e){var r=[];return e=e||function(t,e,r){return!0},u.forEachRecursive(t,(function(t,n,i){t.get("title")&&e(t,n,i)&&r.push(t)})),r}},{key:"setVisible_",value:function(t,e,n,i){e.setVisible(n),n&&"base"===e.get("type")&&u.forEachRecursive(t,(function(t,r,n){t!=e&&"base"===t.get("type")&&t.setVisible(!1)})),e instanceof r&&!e.get("combine")&&"children"===i&&e.getLayers().forEach((function(r){u.setVisible_(t,r,e.getVisible(),i)}))}},{key:"renderLayer_",value:function(t,e,n,i,o){var a=document.createElement("li"),s=e.get("title"),h=u.uuid(),c=document.createElement("label");if(e instanceof r&&!e.get("combine")){var p=u.isBaseGroup(e);if(a.classList.add("group"),p&&a.classList.add(l+"base-group"),e.get("fold")){a.classList.add(l+"fold"),a.classList.add(l+e.get("fold"));var f=document.createElement("button");f.onclick=function(t){var r=t||window.event;u.toggleFold_(e,a),r.preventDefault()},a.appendChild(f)}if(!p&&"none"!=i.groupSelectStyle){var d=document.createElement("input");d.type="checkbox",d.id=h,d.checked=e.getVisible(),d.indeterminate=e.get("indeterminate"),d.onchange=function(r){var n=r.target;u.setVisible_(t,e,n.checked,i.groupSelectStyle),o(e)},a.appendChild(d),c.htmlFor=h}c.innerHTML=s,a.appendChild(c);var g=document.createElement("ul");a.appendChild(g),u.renderLayers_(t,e,g,i,o)}else{a.className="layer";var y=document.createElement("input");"base"===e.get("type")?(y.type="radio",y.name="base"):y.type="checkbox",y.id=h,y.checked=e.get("visible"),y.indeterminate=e.get("indeterminate"),y.onchange=function(r){var n=r.target;u.setVisible_(t,e,n.checked,i.groupSelectStyle),o(e)},a.appendChild(y),c.htmlFor=h,c.innerHTML=s;var v=t.getView().getResolution();(v>e.getMaxResolution()||v<e.getMinResolution())&&(c.className+=" disabled"),a.appendChild(c)}return a}},{key:"renderLayers_",value:function(t,e,r,n,i){var o=e.getLayers().getArray().slice();n.reverse&&(o=o.reverse());for(var a,s=0;s<o.length;s++)(a=o[s]).get("title")&&r.appendChild(u.renderLayer_(t,a,s,n,i))}},{key:"forEachRecursive",value:function(t,e){t.getLayers().forEach((function(t,n,i){e(t,n,i),t instanceof r&&u.forEachRecursive(t,e)}))}},{key:"uuid",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}},{key:"enableTouchScroll_",value:function(t){if(u.isTouchDevice_()){var e=0;t.addEventListener("touchstart",(function(t){e=this.scrollTop+t.touches[0].pageY}),!1),t.addEventListener("touchmove",(function(t){this.scrollTop=e-t.touches[0].pageY}),!1)}}},{key:"isTouchDevice_",value:function(){try{return document.createEvent("TouchEvent"),!0}catch(t){return!1}}},{key:"toggleFold_",value:function(t,e){e.classList.remove(l+t.get("fold")),t.set("fold","open"===t.get("fold")?"close":"open"),e.classList.add(l+t.get("fold"))}},{key:"getGroupSelectStyle",value:function(t){return["none","children","group"].indexOf(t)>=0?t:"children"}}]),u}(t);return window.ol&&window.ol.control&&(window.ol.control.LayerSwitcher=u),u}(b_,w_,S_)}(x_);var C_=x_.exports,E_="http://www.w3.org/2001/XMLSchema-instance";function T_(t,e){return W_().createElementNS(t,e)}function R_(t,e){return P_(t,e,[]).join("")}function P_(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)P_(n,e,r)}return r}function O_(t){return"documentElement"in t}function F_(t){return(new DOMParser).parseFromString(t,"application/xml")}function I_(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&d(n[n.length-1],i)}}function M_(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 A_(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 L_(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 k_(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 D_(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),T_(void 0!==e?e:o.namespaceURI,a)}}var j_=D_();function z_(t,e){for(var r=e.length,n=new Array(r),i=0;i<r;++i)n[i]=t[e[i]];return n}function G_(t,e,r){var n,i,o=void 0!==r?r:{};for(n=0,i=t.length;n<i;++n)o[t[n]]=e;return o}function N_(t,e,r,n){var i;for(i=e.firstElementChild;i;i=i.nextElementSibling){var o=t[i.namespaceURI];if(void 0!==o){var a=o[i.localName];void 0!==a&&a.call(n,i,r)}}}function U_(t,e,r,n,i){return n.push(t),N_(e,r,n,i),n.pop()}function B_(t,e,r,n,i,o,a){return i.push(t),function(t,e,r,n,i,o){for(var a,s,l=(void 0!==i?i:r).length,u=0;u<l;++u)void 0!==(a=r[u])&&void 0!==(s=e.call(void 0!==o?o:this,a,n,void 0!==i?i[u]:void 0))&&t[s.namespaceURI][s.localName].call(o,s,a,n)}(e,r,n,i,o,a),i.pop()}var V_=void 0;var X_=void 0;function W_(){return void 0===X_&&"undefined"!=typeof document&&(X_=document.implementation.createDocument("","",null)),X_}var 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)}}(),Y_=function(t){function r(){var e=t.call(this)||this;return e.xmlSerializer_=(void 0===V_&&"undefined"!=typeof XMLSerializer&&(V_=new XMLSerializer),V_),e}return q_(r,t),r.prototype.getType=function(){return ll},r.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var r=F_(t);return this.readFeatureFromDocument(r,e)}return O_(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},r.prototype.readFeatureFromDocument=function(t,e){var r=this.readFeaturesFromDocument(t,e);return r.length>0?r[0]:null},r.prototype.readFeatureFromNode=function(t,e){return null},r.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var r=F_(t);return this.readFeaturesFromDocument(r,e)}return O_(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},r.prototype.readFeaturesFromDocument=function(t,e){for(var r=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&d(r,this.readFeaturesFromNode(n,e));return r},r.prototype.readFeaturesFromNode=function(t,r){return e()},r.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var r=F_(t);return this.readGeometryFromDocument(r,e)}return O_(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},r.prototype.readGeometryFromDocument=function(t,e){return null},r.prototype.readGeometryFromNode=function(t,e){return null},r.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=F_(t);return this.readProjectionFromDocument(e)}return O_(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},r.prototype.readProjectionFromDocument=function(t){return this.dataProjection},r.prototype.readProjectionFromNode=function(t){return this.dataProjection},r.prototype.writeFeature=function(t,e){var r=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(r)},r.prototype.writeFeatureNode=function(t,e){return null},r.prototype.writeFeatures=function(t,e){var r=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(r)},r.prototype.writeFeaturesNode=function(t,e){return null},r.prototype.writeGeometry=function(t,e){var r=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(r)},r.prototype.writeGeometryNode=function(t,e){return null},r}(qp),K_=Y_;function Z_(t){var e,r=R_(t,!1);return(e=/^\s*(true|1)|(false|0)\s*$/.exec(r))?void 0!==e[1]||!1:void 0}function H_(t){var e,r=R_(t,!1);return(e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(r))?parseFloat(e[1]):void 0}function J_(t){return R_(t,!1).trim()}function Q_(t,e){tm(t,e?"1":"0")}function $_(t,e){var r=e.toPrecision();t.appendChild(W_().createTextNode(r))}function tm(t,e){t.appendChild(W_().createTextNode(e))}var em,rm,nm,im,om,am,sm,lm,um,hm=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)}}(),cm=["http://www.google.com/kml/ext/2.2"],pm=[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"],fm={fraction:fs,pixels:ds,insetPixels:ds},dm=G_(pm,{ExtendedData:lx,Region:ux,MultiGeometry:L_($m,"geometry"),LineString:L_(Hm,"geometry"),LinearRing:L_(Jm,"geometry"),Point:L_(tx,"geometry"),Polygon:L_(rx,"geometry"),Style:L_(ix),StyleMap:function(t,e){var r=Dm.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:it(!1,38)},address:L_(J_),description:L_(J_),name:L_(J_),open:L_(Z_),phoneNumber:L_(J_),styleUrl:L_(Am),visibility:L_(Z_)},G_(cm,{MultiTrack:L_((function(t,e){var r=U_([],Vm,t,e);if(!r)return;return new fc(r)}),"geometry"),Track:L_(Wm,"geometry")})),gm=G_(pm,{ExtendedData:lx,Region:ux,Link:function(t,e){N_(ym,t,e)},address:L_(J_),description:L_(J_),name:L_(J_),open:L_(Z_),phoneNumber:L_(J_),visibility:L_(Z_)}),ym=G_(pm,{href:L_(Mm)}),vm=G_(pm,{LatLonAltBox:function(t,e){var r=U_({},px,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=U_({},fx,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)}}),_m=G_(pm,["Document","Placemark"]),mm=G_(pm,{Document:k_((function(t,e,r){B_({node:t},_x,mx,e,r,void 0,this)})),Placemark:k_(Vx)}),xm=null,bm=null,wm=null,Sm=null,Cm=null,Em=null;function Tm(t){return 32/Math.min(t[0],t[1])}function Rm(t){return t}var Pm=function(t){function e(e){var r=t.call(this)||this,n=e||{};return Em||(xm=new Hn({color:em=[255,255,255,1]}),am="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",bm=new Ms({anchor:rm=[20,2],anchorOrigin:gs,anchorXUnits:nm=ds,anchorYUnits:im=ds,crossOrigin:"anonymous",rotation:0,scale:Tm(om=[64,64]),size:om,src:am}),sm="NO_IMAGE",wm=new ii({color:em,width:1}),lm=new ii({color:[51,51,51,1],width:2}),Sm=new _o({font:"bold 16px Helvetica",fill:xm,stroke:lm,scale:.8}),Cm=new fo({fill:xm,image:bm,text:Sm,stroke:wm,zIndex:0}),Em=[Cm]),r.dataProjection=Or("EPSG:4326"),r.defaultStyle_=n.defaultStyle?n.defaultStyle:Em,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:Rm,r.supportedMediaTypes=["application/vnd.google-earth.kml+xml"],r}return hm(e,t),e.prototype.readDocumentOrFolder_=function(t,e){var r=U_([],G_(pm,{Document:I_(this.readDocumentOrFolder_,this),Folder:I_(this.readDocumentOrFolder_,this),Placemark:M_(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=U_({geometry:null},dm,t,e,this);if(r){var n=new st,i=t.getAttribute("id");null!==i&&n.setId(i);var o=e[0],a=r.geometry;if(a&&Yp(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 Bp)u=h.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===pt||e===yt})),s=u.length>0;else{var c=h.getType();s=c===pt||c===yt}}s&&(l=o.get("name"),(s=s&&!!l)&&l.search(/&[^&]+;/)>-1&&(um||(um=document.createElement("textarea")),um.innerHTML=l,l=um.value));var p=r;if(t?p=t:e&&(p=Om(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()||Sm.getFont()),l.setScale(l.getScale()||Sm.getScale()),l.setFill(l.getFill()||Sm.getFill()),l.setStroke(l.getStroke()||lm)):l=Sm.clone();return l.setText(e),l.setOffsetX(r[0]),l.setOffsetY(r[1]),l.setTextAlign(n),new fo({image:i,text:l})}(p[0],l);return u.length>0?(f.setGeometry(new Bp(u)),[f,new fo({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=ix.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=Dm.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(!c(pm,t.namespaceURI))return null;var r=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return r||null},e.prototype.readFeaturesFromNode=function(t,e){if(!c(pm,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&&d(r,a)}return r}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=F_(t);return this.readNameFromDocument(e)}return O_(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(c(pm,e.namespaceURI)&&"name"==e.localName)return J_(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var r=e.localName;if(c(pm,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=F_(t);d(e,this.readNetworkLinksFromDocument(r))}else O_(t)?d(e,this.readNetworkLinksFromDocument(t)):d(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&&d(e,this.readNetworkLinksFromNode(r));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(c(pm,r.namespaceURI)&&"NetworkLink"==r.localName){var n=U_({},gm,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!c(pm,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||d(e,this.readNetworkLinksFromNode(r))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var r=F_(t);d(e,this.readRegionFromDocument(r))}else O_(t)?d(e,this.readRegionFromDocument(t)):d(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&&d(e,this.readRegionFromNode(r));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(c(pm,r.namespaceURI)&&"Region"==r.localName){var n=U_({},vm,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!c(pm,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||d(e,this.readRegionFromNode(r))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=T_(pm[4],"kml"),n="http://www.w3.org/2000/xmlns/";r.setAttributeNS(n,"xmlns:gx",cm[0]),r.setAttributeNS(n,"xmlns:xsi",E_),r.setAttributeNS(E_,"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=_m[r.namespaceURI],s=z_(o,a);return B_(i,mm,j_,s,[e],a,this),r},e}(K_);function Om(t,e,r){return Array.isArray(t)?t:"string"==typeof t?Om(r[t],e,r):e}function Fm(t){var e=R_(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 Im(t){var e=R_(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 Mm(t){var e=R_(t,!1).trim(),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function Am(t){var e=R_(t,!1).trim().replace(/^(?!.*#)/,"#"),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function Lm(t){return H_(t)}var km=G_(pm,{Pair:function(t,e){var r=U_({},hx,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 Dm(t,e){return U_(void 0,km,t,e,this)}var jm=G_(pm,{Icon:L_((function(t,e){var r=U_({},qm,t,e);return r||null})),color:L_(Fm),heading:L_(H_),hotSpot:L_((function(t){var e,r=t.getAttribute("xunits"),n=t.getAttribute("yunits");return e="insetPixels"!==r?"insetPixels"!==n?gs:vs:"insetPixels"!==n?ys:_s,{x:parseFloat(t.getAttribute("x")),xunits:fm[r],y:parseFloat(t.getAttribute("y")),yunits:fm[n],origin:e}})),scale:L_(Lm)});var zm=G_(pm,{color:L_(Fm),scale:L_(Lm)});var Gm=G_(pm,{color:L_(Fm),width:L_(H_)});var Nm=G_(pm,{color:L_(Fm),fill:L_(Z_),outline:L_(Z_)});var Um=G_(pm,{coordinates:A_(Im)});function Bm(t,e){return U_(null,Um,t,e)}var Vm=G_(cm,{Track:M_(Wm)});var Xm=G_(pm,{when:function(t,e){var r=e[e.length-1].whens,n=R_(t,!1),i=Date.parse(n);r.push(isNaN(i)?0:i)}},G_(cm,{coord:function(t,e){var r=e[e.length-1].coordinates,n=R_(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 Wm(t,e){var r=U_({coordinates:[],whens:[]},Xm,t,e);if(r){for(var n=[],i=r.coordinates,o=r.whens,a=0,s=Math.min(i.length,o.length);a<s;++a)3==i[a].length&&n.push(i[a][0],i[a][1],i[a][2],o[a]);return new ri(n,ct)}}var qm=G_(pm,{href:L_(Mm)},G_(cm,{x:L_(H_),y:L_(H_),w:L_(H_),h:L_(H_)}));var Ym=G_(pm,{coordinates:A_(Im)});function Km(t,e){return U_(null,Ym,t,e)}var Zm=G_(pm,{extrude:L_(Z_),tessellate:L_(Z_),altitudeMode:L_(J_)});function Hm(t,e){var r=U_({},Zm,t,e),n=Km(t,e);if(n){var i=new ri(n,ut);return i.setProperties(r,!0),i}}function Jm(t,e){var r=U_({},Zm,t,e),n=Km(t,e);if(n){var i=new Un(n,ut,[n.length]);return i.setProperties(r,!0),i}}var Qm=G_(pm,{LineString:M_(Hm),LinearRing:M_(Jm),MultiGeometry:M_($m),Point:M_(tx),Polygon:M_(rx)});function $m(t,e){var r,n=U_([],Qm,t,e);if(!n)return null;if(0===n.length)return new Bp(n);for(var i=!0,o=n[0].getType(),a=1,s=n.length;a<s;++a)if(n[a].getType()!=o){i=!1;break}if(i){var l=void 0,u=void 0;if(o==pt){var h=n[0];l=h.getLayout(),u=h.getFlatCoordinates();for(a=1,s=n.length;a<s;++a)d(u,n[a].getFlatCoordinates());ox(r=new yc(u,l),n)}else o==ft?ox(r=new fc(n),n):o==gt?ox(r=new xc(n),n):o==mt?r=new Bp(n):it(!1,37)}else r=new Bp(n);return r}function tx(t,e){var r=U_({},Zm,t,e),n=Km(t,e);if(n){var i=new En(n,ut);return i.setProperties(r,!0),i}}var ex=G_(pm,{innerBoundaryIs:function(t,e){var r=U_([],dx,t,e);if(r.length>0){var n=e[e.length-1];n.push.apply(n,r)}},outerBoundaryIs:function(t,e){var r=U_(void 0,gx,t,e);if(r){e[e.length-1][0]=r}}});function rx(t,e){var r=U_({},Zm,t,e),n=U_([null],ex,t,e);if(n&&n[0]){for(var i=n[0],o=[i.length],a=1,s=n.length;a<s;++a)d(i,n[a]),o.push(i.length);var l=new Un(i,ut,o);return l.setProperties(r,!0),l}}var nx=G_(pm,{IconStyle:function(t,e){var r=U_({},jm,t,e);if(r){var n,i,o,a,s=e[e.length-1],l="Icon"in r?r.Icon:{},u=!("Icon"in r)||Object.keys(l).length>0,h=l.href;h?n=h:u&&(n=am);var c,p=gs,f=r.hotSpot;f?(i=[f.x,f.y],o=f.xunits,a=f.yunits,p=f.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(n)&&(/pushpin/.test(n)?(i=rm,o=nm,a=im):/arrow-reverse/.test(n)?(i=[54,42],o=nm,a=im):/paddle/.test(n)&&(i=[32,1],o=nm,a=im));var d,g=l.x,y=l.y;void 0!==g&&void 0!==y&&(c=[g,y]);var v,_=l.w,m=l.h;void 0!==_&&void 0!==m&&(d=[_,m]);var x=r.heading;void 0!==x&&(v=Ge(x));var b=r.scale,w=r.color;if(u){n==am&&(d=om);var S=new Ms({anchor:i,anchorOrigin:p,anchorXUnits:o,anchorYUnits:a,crossOrigin:this.crossOrigin_,offset:c,offsetOrigin:gs,rotation:v,scale:b,size:d,src:this.iconUrlFunction_(n),color:w}),C=S.getScaleArray()[0],E=S.getSize();if(null===E){var T=S.getImageState();if(T===oi||T===ai){var R=function(){var t=S.getImageState();if(t!==oi&&t!==ai){var e=S.getSize();if(e&&2==e.length){var r=Tm(e);S.setScale(C*r)}S.unlistenImageChange(R)}};S.listenImageChange(R),T===oi&&S.load()}}else if(2==E.length){var P=Tm(E);S.setScale(C*P)}s.imageStyle=S}else s.imageStyle=sm}},LabelStyle:function(t,e){var r=U_({},zm,t,e);if(r){var n=e[e.length-1],i=new _o({fill:new Hn({color:"color"in r?r.color:em}),scale:r.scale});n.textStyle=i}},LineStyle:function(t,e){var r=U_({},Gm,t,e);if(r){var n=e[e.length-1],i=new ii({color:"color"in r?r.color:em,width:"width"in r?r.width:1});n.strokeStyle=i}},PolyStyle:function(t,e){var r=U_({},Nm,t,e);if(r){var n=e[e.length-1],i=new Hn({color:"color"in r?r.color:em});n.fillStyle=i;var o=r.fill;void 0!==o&&(n.fill=o);var a=r.outline;void 0!==a&&(n.outline=a)}}});function ix(t,e){var r=U_({},nx,t,e,this);if(!r)return null;var n,i="fillStyle"in r?r.fillStyle:xm,o=r.fill;void 0===o||o||(i=null),"imageStyle"in r?r.imageStyle!=sm&&(n=r.imageStyle):n=bm;var a="textStyle"in r?r.textStyle:Sm,s="strokeStyle"in r?r.strokeStyle:wm,l=r.outline;return void 0===l||l?[new fo({fill:i,image:n,stroke:s,text:a,zIndex:void 0})]:[new fo({geometry:function(t){var e=t.getGeometry(),r=e.getType();return r===mt?new Bp(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e!==gt&&e!==_t}))):r!==gt&&r!==_t?e:void 0},fill:i,image:n,stroke:s,text:a,zIndex:void 0}),new fo({geometry:function(t){var e=t.getGeometry(),r=e.getType();return r===mt?new Bp(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===gt||e===_t}))):r===gt||r===_t?e:void 0},fill:i,stroke:null,zIndex:void 0})]}function ox(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;u<o;++u){var h=e[u];a[u]=h.get("extrude"),s[u]=h.get("tessellate"),l[u]=h.get("altitudeMode"),r=r||void 0!==a[u],n=n||void 0!==s[u],i=i||l[u]}r&&t.set("extrude",a),n&&t.set("tessellate",s),i&&t.set("altitudeMode",l)}var ax=G_(pm,{displayName:L_(J_),value:L_(J_)});var sx=G_(pm,{Data:function(t,e){var r=t.getAttribute("name");N_(ax,t,e);var n=e[e.length-1];r&&n.displayName?n[r]={value:n.value,displayName:n.displayName,toString:function(){return n.value}}:null!==r?n[r]=n.value:null!==n.displayName&&(n[n.displayName]=n.value),delete n.value},SchemaData:function(t,e){N_(cx,t,e)}});function lx(t,e){N_(sx,t,e)}function ux(t,e){N_(vm,t,e)}var hx=G_(pm,{Style:L_(ix),key:L_(J_),styleUrl:L_(Am)});var cx=G_(pm,{SimpleData:function(t,e){var r=t.getAttribute("name");if(null!==r){var n=J_(t);e[e.length-1][r]=n}}});var px=G_(pm,{altitudeMode:L_(J_),minAltitude:L_(H_),maxAltitude:L_(H_),north:L_(H_),south:L_(H_),east:L_(H_),west:L_(H_)});var fx=G_(pm,{minLodPixels:L_(H_),maxLodPixels:L_(H_),minFadeExtent:L_(H_),maxFadeExtent:L_(H_)});var dx=G_(pm,{LinearRing:M_(Bm)});var gx=G_(pm,{LinearRing:A_(Bm)});function yx(t,e){for(var r=bi(e),n=[255*(4==r.length?r[3]:1),r[2],r[1],r[0]],i=0;i<4;++i){var o=Math.floor(n[i]).toString(16);n[i]=1==o.length?"0"+o:o}tm(t,n.join(""))}var vx=G_(pm,{Data:k_((function(t,e,r){t.setAttribute("name",e.name);var n={node:t},i=e.value;"object"==typeof i?(null!==i&&i.displayName&&B_(n,vx,j_,[i.displayName],r,["displayName"]),null!==i&&i.value&&B_(n,vx,j_,[i.value],r,["value"])):B_(n,vx,j_,[i],r,["value"])})),value:k_((function(t,e){tm(t,e)})),displayName:k_((function(t,e){!function(t,e){t.appendChild(W_().createCDATASection(e))}(t,e)}))});var _x=G_(pm,{Placemark:k_(Vx)}),mx=function(t,e,r){return T_(e[e.length-1].node.namespaceURI,"Placemark")};var xx=D_("Data");var bx=G_(pm,["href"],G_(cm,["x","y","w","h"])),wx=G_(pm,{href:k_(tm)},G_(cm,{x:k_($_),y:k_($_),w:k_($_),h:k_($_)})),Sx=function(t,e,r){return T_(cm[0],"gx:"+r)};var Cx=G_(pm,["scale","heading","Icon","color","hotSpot"]),Ex=G_(pm,{Icon:k_((function(t,e,r){var n={node:t},i=r[r.length-1].node,o=bx[i.namespaceURI],a=z_(e,o);B_(n,wx,j_,a,r,o),a=z_(e,o=bx[cm[0]]),B_(n,wx,Sx,a,r,o)})),color:k_(yx),heading:k_($_),hotSpot:k_((function(t,e){t.setAttribute("x",String(e.x)),t.setAttribute("y",String(e.y)),t.setAttribute("xunits",e.xunits),t.setAttribute("yunits",e.yunits)})),scale:k_($x)});var Tx=G_(pm,["color","scale"]),Rx=G_(pm,{color:k_(yx),scale:k_($x)});var Px=G_(pm,["color","width"]),Ox=G_(pm,{color:k_(yx),width:k_($_)});var Fx={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},Ix=function(t,e,r){if(t)return T_(e[e.length-1].node.namespaceURI,Fx[t.getType()])},Mx=D_("Point"),Ax=D_("LineString"),Lx=D_("LinearRing"),kx=D_("Polygon"),Dx=G_(pm,{LineString:k_(qx),Point:k_(qx),Polygon:k_(Jx),GeometryCollection:k_(jx)});function jx(t,e,r){var n,i={node:t},o=e.getType(),a=[];o===mt?(e.getGeometriesArrayRecursive().forEach((function(t){var e=t.getType();e===yt?a=a.concat(t.getPoints()):e===vt?a=a.concat(t.getLineStrings()):e===_t?a=a.concat(t.getPolygons()):e===pt||e===ft||e===gt?a.push(t):it(!1,39)})),n=Ix):o===yt?(a=e.getPoints(),n=Mx):o===vt?(a=e.getLineStrings(),n=Ax):o===_t?(a=e.getPolygons(),n=kx):it(!1,39),B_(i,Dx,n,a,r)}var zx=G_(pm,{LinearRing:k_(qx)});function Gx(t,e,r){B_({node:t},zx,Lx,[e],r)}var Nx=G_(pm,{ExtendedData:k_((function(t,e,r){for(var n={node:t},i=e.names,o=e.values,a=i.length,s=0;s<a;s++)B_(n,vx,xx,[{name:i[s],value:o[s]}],r)})),MultiGeometry:k_(jx),LineString:k_(qx),LinearRing:k_(qx),Point:k_(qx),Polygon:k_(Jx),Style:k_((function(t,e,r){var n={node:t},i={};if(e.pointStyles.length){var o=e.pointStyles[0].getText();o&&(i.LabelStyle=o);var a=e.pointStyles[0].getImage();a&&"function"==typeof a.getSrc&&(i.IconStyle=a)}if(e.lineStyles.length){(s=e.lineStyles[0].getStroke())&&(i.LineStyle=s)}if(e.polyStyles.length){var s;(s=e.polyStyles[0].getStroke())&&!i.LineStyle&&(i.LineStyle=s),i.PolyStyle=e.polyStyles[0]}var l=r[r.length-1].node,u=tb[l.namespaceURI],h=z_(i,u);B_(n,eb,j_,h,r,u)})),address:k_(tm),description:k_(tm),name:k_(tm),open:k_(Q_),phoneNumber:k_(tm),styleUrl:k_(tm),visibility:k_(Q_)}),Ux=G_(pm,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),Bx=D_("ExtendedData");function Vx(t,e,r){var n={node:t};e.getId()&&t.setAttribute("id",e.getId());var i=e.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[e.getGeometryName()]=1;var a=Object.keys(i||{}).sort().filter((function(t){return!o[t]})),s=e.getStyleFunction();if(s){var l=s(e,0);if(l){var u=Array.isArray(l)?l:[l],h=u;if(e.getGeometry()&&(h=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return n===mt?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===pt||e===yt})).length:n===pt||n===yt}}))),this.writeStyles_){var c=u,p=u;e.getGeometry()&&(c=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return n===mt?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ft||e===vt})).length:n===ft||n===vt}})),p=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return n===mt?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===gt||e===_t})).length:n===gt||n===_t}}))),i.Style={pointStyles:h,lineStyles:c,polyStyles:p}}if(h.length&&void 0===i.name){var f=h[0].getText();f&&(i.name=f.getText())}}}var d=r[r.length-1].node,g=Ux[d.namespaceURI],y=z_(i,g);if(B_(n,Nx,j_,y,r,g),a.length>0){var v=z_(i,a);B_(n,Nx,Bx,[{names:a,values:v}],r)}var _=r[0],m=e.getGeometry();m&&(m=Yp(m,!0,_)),B_(n,Nx,Ix,[m],r)}var Xx=G_(pm,["extrude","tessellate","altitudeMode","coordinates"]),Wx=G_(pm,{extrude:k_(Q_),tessellate:k_(Q_),altitudeMode:k_(tm),coordinates:k_((function(t,e,r){var n,i=r[r.length-1],o=i.layout,a=i.stride;o==lt||o==ht?n=2:o==ut||o==ct?n=3:it(!1,34);var s=e.length,l="";if(s>0){l+=e[0];for(var u=1;u<n;++u)l+=","+e[u];for(var h=a;h<s;h+=a){l+=" "+e[h];for(u=1;u<n;++u)l+=","+e[h+u]}}tm(t,l)}))});function qx(t,e,r){var n=e.getFlatCoordinates(),i={node:t};i.layout=e.getLayout(),i.stride=e.getStride();var o=e.getProperties();o.coordinates=n;var a=r[r.length-1].node,s=Xx[a.namespaceURI],l=z_(o,s);B_(i,Wx,j_,l,r,s)}var Yx=G_(pm,["color","fill","outline"]),Kx=G_(pm,{outerBoundaryIs:k_(Gx),innerBoundaryIs:k_(Gx)}),Zx=D_("innerBoundaryIs"),Hx=D_("outerBoundaryIs");function Jx(t,e,r){var n=e.getLinearRings(),i=n.shift(),o={node:t};B_(o,Kx,Zx,n,r),B_(o,Kx,Hx,[i],r)}var Qx=G_(pm,{color:k_(yx),fill:k_(Q_),outline:k_(Q_)});function $x(t,e){$_(t,Math.round(1e6*e)/1e6)}var tb=G_(pm,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),eb=G_(pm,{IconStyle:k_((function(t,e,r){var n={node:t},i={},o=e.getSrc(),a=e.getSize(),s=e.getImageSize(),l={href:o};if(a){l.w=a[0],l.h=a[1];var u=e.getAnchor(),h=e.getOrigin();if(h&&s&&0!==h[0]&&h[1]!==a[1]&&(l.x=h[0],l.y=s[1]-(h[1]+a[1])),u&&(u[0]!==a[0]/2||u[1]!==a[1]/2)){var c={x:u[0],xunits:ds,y:a[1]-u[1],yunits:ds};i.hotSpot=c}}i.Icon=l;var p=e.getScaleArray()[0],f=a;null===f&&(f=om),2==f.length&&(p/=Tm(f)),1!==p&&(i.scale=p);var d=e.getRotation();0!==d&&(i.heading=d);var g=e.getColor();g&&(i.color=g);var y=r[r.length-1].node,v=Cx[y.namespaceURI],_=z_(i,v);B_(n,Ex,j_,_,r,v)})),LabelStyle:k_((function(t,e,r){var n={node:t},i={},o=e.getFill();o&&(i.color=o.getColor());var a=e.getScale();a&&1!==a&&(i.scale=a);var s=r[r.length-1].node,l=Tx[s.namespaceURI],u=z_(i,l);B_(n,Rx,j_,u,r,l)})),LineStyle:k_((function(t,e,r){var n={node:t},i={color:e.getColor(),width:Number(e.getWidth())||1},o=r[r.length-1].node,a=Px[o.namespaceURI],s=z_(i,a);B_(n,Ox,j_,s,r,a)})),PolyStyle:k_((function(t,e,r){var n={node:t},i=e.getFill(),o=e.getStroke(),a={color:i?i.getColor():void 0,fill:!!i&&void 0,outline:!!o&&void 0},s=r[r.length-1].node,l=Yx[s.namespaceURI],u=z_(a,l);B_(n,Qx,j_,u,r,l)}))});var rb=Pm,nb=34962,ib=34963,ob=35044,ab=35048,sb=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function lb(t,e){for(var r=m({preserveDrawingBuffer:!0,antialias:!Rt},e),n=sb.length,i=0;i<n;++i)try{var o=t.getContext(sb[i],r);if(o)return o}catch(t){}return null}var ub=ob,hb=function(){function t(t,e){this.array=null,this.type=t,it(t===nb||t===ib,62),this.usage=void 0!==e?e:ub}return t.prototype.ofSize=function(t){this.array=new(cb(this.type))(t)},t.prototype.fromArray=function(t){var e=cb(this.type);this.array=e.from?e.from(t):new e(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(cb(this.type))(t)},t.prototype.getType=function(){return this.type},t.prototype.getArray=function(){return this.array},t.prototype.getUsage=function(){return this.usage},t.prototype.getSize=function(){return this.array?this.array.length:0},t}();function cb(t){switch(t){case nb:return Float32Array;case ib:return Uint32Array;default:return Float32Array}}var pb=hb,fb="webglcontextlost",db="webglcontextrestored",gb=function(){function t(t){this.gl_=t.webGlContext;var e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer();var r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,t.vertexShader||"\n precision mediump float;\n \n attribute vec2 a_position;\n varying vec2 v_texCoord;\n varying vec2 v_screenCoord;\n \n uniform vec2 u_screenSize;\n \n void main() {\n v_texCoord = a_position * 0.5 + 0.5;\n v_screenCoord = v_texCoord * u_screenSize;\n gl_Position = vec4(a_position, 0.0, 1.0);\n }\n"),e.compileShader(r);var n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,t.fragmentShader||"\n precision mediump float;\n \n uniform sampler2D u_image;\n uniform float u_opacity;\n \n varying vec2 v_texCoord;\n \n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;\n }\n"),e.compileShader(n),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,r),e.attachShader(this.renderTargetProgram_,n),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(r){this.uniforms_.push({value:t.uniforms[r],location:e.getUniformLocation(this.renderTargetProgram_,r)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(t){var e=this.getGL(),r=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,r[0],r[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==r[0]||this.renderTargetTextureSize_[1]!==r[1]){this.renderTargetTextureSize_=r;var n=e.RGBA,i=e.RGBA,o=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,0,n,r[0],r[1],0,i,o,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0)}},t.prototype.apply=function(t,e,r,i){var o=this.getGL(),a=t.size;if(o.bindFramebuffer(o.FRAMEBUFFER,e?e.getFrameBuffer():null),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,this.renderTargetTexture_),!e){var s=n(o.canvas);if(!t.renderTargets[s]){var l=o.getContextAttributes();l&&l.preserveDrawingBuffer&&(o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT)),t.renderTargets[s]=!0}}o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),o.viewport(0,0,o.drawingBufferWidth,o.drawingBufferHeight),o.bindBuffer(o.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),o.useProgram(this.renderTargetProgram_),o.enableVertexAttribArray(this.renderTargetAttribLocation_),o.vertexAttribPointer(this.renderTargetAttribLocation_,2,o.FLOAT,!1,0,0),o.uniform2f(this.renderTargetUniformLocation_,a[0],a[1]),o.uniform1i(this.renderTargetTextureLocation_,0);var u=t.layerStatesArray[t.layerIndex].opacity;o.uniform1f(this.renderTargetOpacityLocation_,u),this.applyUniforms(t),r&&r(o,t),o.drawArrays(o.TRIANGLES,0,6),i&&i(o,t)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(t){var e,r=this.getGL(),n=1;this.uniforms_.forEach((function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof ImageData)i.texture||(i.texture=r.createTexture()),r.activeTexture(r["TEXTURE".concat(n)]),r.bindTexture(r.TEXTURE_2D,i.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),e instanceof ImageData?r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,e.width,e.height,0,r.UNSIGNED_BYTE,new Uint8Array(e.data)):r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),r.uniform1i(i.location,n++);else if(Array.isArray(e))switch(e.length){case 2:return void r.uniform2f(i.location,e[0],e[1]);case 3:return void r.uniform3f(i.location,e[0],e[1],e[2]);case 4:return void r.uniform4f(i.location,e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(i.location,e)}))},t}(),yb=gb;function vb(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}var _b=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)}}(),mb="u_projectionMatrix",xb="u_offsetScaleMatrix",bb="u_offsetRotateMatrix",wb="u_time",Sb="u_zoom",Cb="u_resolution",Eb={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126},Tb={};function Rb(t){return"shared/"+t}var Pb=0;var Ob=function(t){function e(e){var r,n=t.call(this)||this,i=e||{};n.boundHandleWebGLContextLost_=n.handleWebGLContextLost.bind(n),n.boundHandleWebGLContextRestored_=n.handleWebGLContextRestored.bind(n),n.canvasCacheKey_=i.canvasCacheKey?Rb(i.canvasCacheKey):(r="unique/"+Pb,Pb+=1,r),n.canvas_=function(t){var e=Tb[t];if(!e){var r=document.createElement("canvas");r.style.position="absolute",r.style.left="0",e={users:0,canvas:r},Tb[t]=e}return e.users+=1,e.canvas}(n.canvasCacheKey_),n.gl_=lb(n.canvas_),n.bufferCache_={},n.extensionCache_={},n.currentProgram_=null,n.canvas_.addEventListener(fb,n.boundHandleWebGLContextLost_),n.canvas_.addEventListener(db,n.boundHandleWebGLContextRestored_),n.offsetRotateMatrix_=[1,0,0,1,0,0],n.offsetScaleMatrix_=[1,0,0,1,0,0],n.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n.uniformLocations_={},n.attribLocations_={},n.uniforms_=[],i.uniforms&&n.setUniforms(i.uniforms);var o=n.getGL();return n.postProcessPasses_=i.postProcesses?i.postProcesses.map((function(t){return new yb({webGlContext:o,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new yb({webGlContext:o})],n.shaderCompileErrors_=null,n.startTime_=Date.now(),n}return _b(e,t),e.prototype.setUniforms=function(t){for(var e in this.uniforms_=[],t)this.uniforms_.push({name:e,value:t[e]});this.uniformLocations_={}},e.prototype.canvasCacheKeyMatches=function(t){return this.canvasCacheKey_===Rb(t)},e.prototype.getExtension=function(t){if(t in this.extensionCache_)return this.extensionCache_[t];var e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e},e.prototype.bindBuffer=function(t){var e=this.getGL(),r=n(t),i=this.bufferCache_[r];i||(i={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[r]=i);e.bindBuffer(t.getType(),i.webGlBuffer)},e.prototype.flushBufferData=function(t){var e=this.getGL();this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())},e.prototype.deleteBuffer=function(t){var e=this.getGL(),r=n(t),i=this.bufferCache_[r];i&&!e.isContextLost()&&e.deleteBuffer(i.webGlBuffer),delete this.bufferCache_[r]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(fb,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(db,this.boundHandleWebGLContextRestored_),function(t){var e=Tb[t];if(e&&(e.users-=1,!(e.users>0))){var r=lb(e.canvas).getExtension("WEBGL_lose_context");r&&r.loseContext(),delete Tb[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;n<i;n++)n===i-1?this.postProcessPasses_[n].apply(t,null,e,r):this.postProcessPasses_[n].apply(t,this.postProcessPasses_[n+1])},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.applyFrameState=function(t){var e=t.size,r=t.viewState.rotation,n=kt(this.offsetScaleMatrix_);Gt(n,2/e[0],2/e[1]);var i=kt(this.offsetRotateMatrix_);0!==r&&function(t,e){var r=Math.cos(e),n=Math.sin(e);Dt(t,jt(Lt,r,n,-n,r,0,0))}(i,-r),this.setUniformMatrixValue(xb,vb(this.tmpMat4_,n)),this.setUniformMatrixValue(bb,vb(this.tmpMat4_,i)),this.setUniformFloatValue(wb,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(Sb,t.viewState.zoom),this.setUniformFloatValue(Cb,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var e,r=this.getGL(),n=0;this.uniforms_.forEach(function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageData)i.texture||(i.prevValue=void 0,i.texture=r.createTexture()),r.activeTexture(r["TEXTURE".concat(n)]),r.bindTexture(r.TEXTURE_2D,i.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(!(e instanceof HTMLImageElement)||e.complete)&&i.prevValue!==e&&(i.prevValue=e,r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)),r.uniform1i(this.getUniformLocation(i.name),n++);else if(Array.isArray(e)&&6===e.length)this.setUniformMatrixValue(i.name,vb(this.tmpMat4_,e));else if(Array.isArray(e)&&e.length<=4)switch(e.length){case 2:return void r.uniform2f(this.getUniformLocation(i.name),e[0],e[1]);case 3:return void r.uniform3f(this.getUniformLocation(i.name),e[0],e[1],e[2]);case 4:return void r.uniform4f(this.getUniformLocation(i.name),e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(this.getUniformLocation(i.name),e)}.bind(this))},e.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,this.uniformLocations_={},this.attribLocations_={},!0)},e.prototype.compileShader=function(t,e){var r=this.getGL(),n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n},e.prototype.getProgram=function(t,e){var r=this.getGL(),n=this.compileShader(t,r.FRAGMENT_SHADER),i=this.compileShader(e,r.VERTEX_SHADER),o=r.createProgram();if(r.attachShader(o,n),r.attachShader(o,i),r.linkProgram(o),!r.getShaderParameter(n,r.COMPILE_STATUS)){var a="Fragment shader compliation failed: ".concat(r.getShaderInfoLog(n));throw new Error(a)}if(r.deleteShader(n),!r.getShaderParameter(i,r.COMPILE_STATUS)){a="Vertex shader compilation failed: ".concat(r.getShaderInfoLog(i));throw new Error(a)}if(r.deleteShader(i),!r.getProgramParameter(o,r.LINK_STATUS)){a="GL program linking failed: ".concat(r.getShaderInfoLog(i));throw new Error(a)}return o},e.prototype.getUniformLocation=function(t){return void 0===this.uniformLocations_[t]&&(this.uniformLocations_[t]=this.getGL().getUniformLocation(this.currentProgram_,t)),this.uniformLocations_[t]},e.prototype.getAttributeLocation=function(t){return void 0===this.attribLocations_[t]&&(this.attribLocations_[t]=this.getGL().getAttribLocation(this.currentProgram_,t)),this.attribLocations_[t]},e.prototype.makeProjectionTransform=function(t,e){var r=t.size,n=t.viewState.rotation,i=t.viewState.resolution,o=t.viewState.center;return kt(e),Nt(e,0,0,2/(i*r[0]),2/(i*r[1]),-n,-o[0],-o[1]),e},e.prototype.setUniformFloatValue=function(t,e){this.getGL().uniform1f(this.getUniformLocation(t),e)},e.prototype.setUniformFloatVec4=function(t,e){this.getGL().uniform4fv(this.getUniformLocation(t),e)},e.prototype.setUniformMatrixValue=function(t,e){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,e)},e.prototype.enableAttributeArray_=function(t,e,r,n,i){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,e,r,!1,n,i))},e.prototype.enableAttributes=function(t){for(var e=function(t){for(var e=0,r=0;r<t.length;r++){var n=t[r];e+=n.size*Fb(n.type)}return e}(t),r=0,n=0;n<t.length;n++){var i=t[n];this.enableAttributeArray_(i.name,i.size,i.type||5126,e,r),r+=i.size*Fb(i.type)}},e.prototype.handleWebGLContextLost=function(){x(this.bufferCache_),this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,e,r){var n=this.getGL(),i=r||n.createTexture(),o=n.RGBA,a=n.RGBA,s=n.UNSIGNED_BYTE;return n.bindTexture(n.TEXTURE_2D,i),e?n.texImage2D(n.TEXTURE_2D,0,o,a,s,e):n.texImage2D(n.TEXTURE_2D,0,o,t[0],t[1],0,a,s,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),i},e}(u);function Fb(t){switch(t){case Eb.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Eb.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Eb.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Eb.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var Ib=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)}}(),Mb="GENERATE_BUFFERS",Ab=function(t){function e(e,r){var n=t.call(this,e)||this,i=r||{};return n.inversePixelTransform_=[1,0,0,1,0,0],n.pixelContext_=null,n.postProcesses_=i.postProcesses,n.uniforms_=i.uniforms,n.helper,e.addChangeListener(Po,n.removeHelper.bind(n)),n.dispatchPreComposeEvent=n.dispatchPreComposeEvent.bind(n),n.dispatchPostComposeEvent=n.dispatchPostComposeEvent.bind(n),n}return Ib(e,t),e.prototype.dispatchPreComposeEvent=function(t,e){var r=this.getLayer();if(r.hasListener(qn)){var n=new ka(qn,void 0,e,t);r.dispatchEvent(n)}},e.prototype.dispatchPostComposeEvent=function(t,e){var r=this.getLayer();if(r.hasListener(Yn)){var n=new ka(Yn,void 0,e,t);r.dispatchEvent(n)}},e.prototype.reset=function(t){this.uniforms_=t.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)},e.prototype.removeHelper=function(){this.helper&&(this.helper.dispose(),delete this.helper)},e.prototype.prepareFrame=function(t){if(this.getLayer().getRenderSource()){for(var r=!0,n=-1,i=void 0,o=0,a=t.layerStatesArray.length;o<a;o++){var s=t.layerStatesArray[o].layer,l=s.getRenderer();if(l instanceof e){var u=s.getClassName();if((r||u!==i)&&(n+=1,r=!1),i=u,l===this)break}else r=!0}var h="map/"+t.mapId+"/group/"+n;this.helper&&this.helper.canvasCacheKeyMatches(h)||(this.removeHelper(),this.helper=new Ob({postProcesses:this.postProcesses_,uniforms:this.uniforms_,canvasCacheKey:h}),i&&(this.helper.getCanvas().className=i),this.afterHelperCreated())}return this.prepareFrameInternal(t)},e.prototype.afterHelperCreated=function(){},e.prototype.prepareFrameInternal=function(t){return!0},e.prototype.disposeInternal=function(){this.removeHelper(),t.prototype.disposeInternal.call(this)},e.prototype.dispatchRenderEvent_=function(t,e,r){var n=this.getLayer();if(n.hasListener(t)){Nt(this.inversePixelTransform_,0,0,r.pixelRatio,-r.pixelRatio,0,0,-r.size[1]);var i=new ka(t,this.inversePixelTransform_,r,e);n.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(Xn,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Wn,t,e)},e.prototype.getDataAtPixel=function(t,e,r){var n=zt([e.pixelRatio,0,0,e.pixelRatio,0,0],t.slice()),i=this.helper.getGL();if(!i)return null;var o=this.getLayer().getExtent();if(o&&!ne(o,zt(e.pixelToCoordinateTransform,t.slice())))return null;var a=i.getContextAttributes();if(!a||!a.preserveDrawingBuffer)return new Uint8Array;var s,l=Math.round(n[0]),u=Math.round(n[1]),h=this.pixelContext_;if(!h){var c=document.createElement("canvas");c.width=1,c.height=1,h=c.getContext("2d"),this.pixelContext_=h}h.clearRect(0,0,1,1);try{h.drawImage(i.canvas,l,u,1,1,0,0,1,1),s=h.getImageData(0,0,1,1).data}catch(t){return s}return 0===s[3]?null:s},e}(Aa);function Lb(t,e){var r=e||[],n=256,i=255;return r[0]=Math.floor(t/n/n/n)/i,r[1]=Math.floor(t/n/n)%n/i,r[2]=Math.floor(t/n)%n/i,r[3]=t%n/i,r}var kb=Ab,Db=new Uint8Array(4),jb=function(){function t(t,e){this.helper_=t;var r=t.getGL();this.texture_=r.createTexture(),this.framebuffer_=r.createFramebuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}return t.prototype.setSize=function(t){g(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())},t.prototype.getSize=function(){return this.size_},t.prototype.clearCachedData=function(){this.dataCacheDirty_=!0},t.prototype.readAll=function(){if(this.dataCacheDirty_){var t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_},t.prototype.readPixel=function(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return Db[0]=0,Db[1]=0,Db[2]=0,Db[3]=0,Db;this.readAll();var r=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return Db[0]=this.data_[4*r],Db[1]=this.data_[4*r+1],Db[2]=this.data_[4*r+2],Db[3]=this.data_[4*r+3],Db},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 zb=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)}}(),Gb=function(t){function e(e,r){var i=this,o=r.uniforms||{},a=[1,0,0,1,0,0];o[mb]=a,(i=t.call(this,e,{uniforms:o,postProcesses:r.postProcesses})||this).ready=!1,i.sourceRevision_=-1,i.verticesBuffer_=new pb(nb,ab),i.hitVerticesBuffer_=new pb(nb,ab),i.indicesBuffer_=new pb(ib,ab),i.vertexShader_=r.vertexShader,i.fragmentShader_=r.fragmentShader,i.program_,i.hitDetectionEnabled_=!(!r.hitFragmentShader||!r.hitVertexShader),i.hitVertexShader_=r.hitVertexShader,i.hitFragmentShader_=r.hitFragmentShader,i.hitProgram_;var s=r.attributes?r.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:Eb.FLOAT}})):[];i.attributes=[{name:"a_position",size:2,type:Eb.FLOAT},{name:"a_index",size:1,type:Eb.FLOAT}].concat(s),i.hitDetectionAttributes=[{name:"a_position",size:2,type:Eb.FLOAT},{name:"a_index",size:1,type:Eb.FLOAT},{name:"a_hitColor",size:4,type:Eb.FLOAT},{name:"a_featureUid",size:1,type:Eb.FLOAT}].concat(s),i.customAttributes=r.attributes?r.attributes:[],i.previousExtent_=[1/0,1/0,-1/0,-1/0],i.currentTransform_=a,i.renderTransform_=[1,0,0,1,0,0],i.invertRenderTransform_=[1,0,0,1,0,0],i.renderInstructions_=new Float32Array(0),i.hitRenderInstructions_=new Float32Array(0),i.hitRenderTarget_,i.generateBuffersRun_=0,i.worker_=function(){var t='var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,a){var u=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=a?a.vertexPosition:0,h=a?a.indexPosition:0,d=b/u;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=u,l,v,1),c.length&&i.set(c,b+3),o(i,b+=u,l,v,2),c.length&&i.set(c,b+3),o(i,b+=u,l,v,3),c.length&&i.set(c,b+3),b+=u,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o,s=r.customAttributesCount,a=2+s,u=new Float32Array(r.renderInstructions),l=u.length/a,v=4*l*(s+3),c=new Uint32Array(6*l),g=new Float32Array(v),b=0;b<u.length;b+=a)o=i(u,b,g,c,s,o);var h=e({vertexBuffer:g.buffer,indexBuffer:c.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[g.buffer,c.buffer,u.buffer])}};';return new Worker("undefined"==typeof Blob?"data:application/javascript;base64,"+Buffer.from(t,"binary").toString("base64"):URL.createObjectURL(new Blob([t],{type:"application/javascript"})))}(),i.worker_.addEventListener("message",function(t){var e=t.data;if(e.type===Mb){var r=e.projectionTransform;e.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(e.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=r,Ut(this.invertRenderTransform_,this.renderTransform_),e.hitDetection?this.hitRenderInstructions_=new Float32Array(t.data.renderInstructions):(this.renderInstructions_=new Float32Array(t.data.renderInstructions),e.generateBuffersRun===this.generateBuffersRun_&&(this.ready=!0)),this.getLayer().changed()}}.bind(i)),i.featureCache_={},i.featureCount_=0;var l=i.getLayer().getSource();return i.sourceListenKeys_=[G(l,Js,i.handleSourceFeatureAdded_,i),G(l,Qs,i.handleSourceFeatureChanged_,i),G(l,tl,i.handleSourceFeatureDelete_,i),G(l,$s,i.handleSourceFeatureClear_,i)],l.forEachFeature(function(t){this.featureCache_[n(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(i)),i}return zb(e,t),e.prototype.afterHelperCreated=function(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitProgram_=this.helper.getProgram(this.hitFragmentShader_,this.hitVertexShader_),this.hitRenderTarget_=new jb(this.helper))},e.prototype.handleSourceFeatureAdded_=function(t){var e=t.feature;this.featureCache_[n(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var e=t.feature;this.featureCache_[n(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var e=t.feature;delete this.featureCache_[n(e)],this.featureCount_--},e.prototype.handleSourceFeatureClear_=function(){this.featureCache_={},this.featureCount_=0},e.prototype.renderFrame=function(t){var e=this.helper.getGL();this.preRender(e,t);var r=this.indicesBuffer_.getSize();this.helper.drawElements(0,r),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);var n=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderHitDetection(t),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),n},e.prototype.prepareFrameInternal=function(t){var e=this.getLayer(),r=e.getSource(),n=t.viewState,i=!t.viewHints[ls]&&!t.viewHints[us],o=!pe(this.previousExtent_,t.extent),a=this.sourceRevision_<r.getRevision();if(a&&(this.sourceRevision_=r.getRevision()),i&&(o||a)){var s=n.projection,l=n.resolution,u=e instanceof oa?e.getRenderBuffer():0,h=te(t.extent,u*l);r.loadFeatures(h,l,s),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.makeProjectionTransform(t,this.currentTransform_),Dt(this.currentTransform_,this.invertRenderTransform_),this.helper.useProgram(this.program_),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0},e.prototype.rebuildBuffers_=function(t){var e=[1,0,0,1,0,0];this.helper.makeProjectionTransform(t,e);var r,n,i=(2+this.customAttributes.length)*this.featureCount_;if(this.renderInstructions_&&this.renderInstructions_.length===i||(this.renderInstructions_=new Float32Array(i)),this.hitDetectionEnabled_){var o=(7+this.customAttributes.length)*this.featureCount_;this.hitRenderInstructions_&&this.hitRenderInstructions_.length===o||(this.hitRenderInstructions_=new Float32Array(o))}var a,s=[],l=[],u=0,h=0;for(var c in this.featureCache_)if((n=(r=this.featureCache_[c]).geometry)&&n.getType()===pt){s[0]=n.getFlatCoordinates()[0],s[1]=n.getFlatCoordinates()[1],zt(e,s),a=Lb(h+6,l),this.renderInstructions_[u++]=s[0],this.renderInstructions_[u++]=s[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[h++]=s[0],this.hitRenderInstructions_[h++]=s[1],this.hitRenderInstructions_[h++]=a[0],this.hitRenderInstructions_[h++]=a[1],this.hitRenderInstructions_[h++]=a[2],this.hitRenderInstructions_[h++]=a[3],this.hitRenderInstructions_[h++]=Number(c));for(var p=void 0,f=0;f<this.customAttributes.length;f++)p=this.customAttributes[f].callback(r.feature,r.properties),this.renderInstructions_[u++]=p,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[h++]=p)}var d={type:Mb,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(d.projectionTransform=e,d.generateBuffersRun=++this.generateBuffersRun_,this.ready=!1,this.worker_.postMessage(d,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var g={type:Mb,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};g.projectionTransform=e,g.hitDetection=!0,this.worker_.postMessage(g,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){if(it(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var o=zt(e.coordinateToPixelTransform,t.slice()),a=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),s=function(t){var e=0,r=256,n=255;return e+=Math.round(t[0]*r*r*r*n),e+=Math.round(t[1]*r*r*n),e+=Math.round(t[2]*r*n),e+Math.round(t[3]*n)}([a[0]/255,a[1]/255,a[2]/255,a[3]/255]),l=this.hitRenderInstructions_[s],u=Math.floor(l).toString(),h=this.getLayer().getSource().getFeatureByUid(u);return h?n(h,this.getLayer(),null):void 0}},e.prototype.renderHitDetection=function(t){if(this.hitVerticesBuffer_.getSize()){this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.useProgram(this.hitProgram_),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0),this.helper.bindBuffer(this.hitVerticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.hitDetectionAttributes);var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e)}},e.prototype.disposeInternal=function(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach((function(t){U(t)})),this.sourceListenKeys_=null,t.prototype.disposeInternal.call(this)},e}(kb),Nb=Gb,Ub=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)}}(),Bb="blur",Vb="gradient",Xb="radius",Wb=["#00f","#0ff","#0f0","#ff0","#f00"];var qb=function(t){function e(e){var r=this,n=e||{},i=m({},n);delete i.gradient,delete i.radius,delete i.blur,delete i.weight,(r=t.call(this,i)||this).gradient_=null,r.addChangeListener(Vb,r.handleGradientChanged_),r.setGradient(n.gradient?n.gradient:Wb),r.setBlur(void 0!==n.blur?n.blur:15),r.setRadius(void 0!==n.radius?n.radius:8);var o=n.weight?n.weight:"weight";return r.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,r.setRenderOrder(null),r}return Ub(e,t),e.prototype.getBlur=function(){return this.get(Bb)},e.prototype.getGradient=function(){return this.get(Vb)},e.prototype.getRadius=function(){return this.get(Xb)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=1,r=256,n=Ei(e,r),i=n.createLinearGradient(0,0,e,r),o=1/(t.length-1),a=0,s=t.length;a<s;++a)i.addColorStop(a*o,t[a]);return n.fillStyle=i,n.fillRect(0,0,e,r),n.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(Bb,t)},e.prototype.setGradient=function(t){this.set(Vb,t)},e.prototype.setRadius=function(t){this.set(Xb,t)},e.prototype.createRenderer=function(){return new Nb(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?Ae(e,0,1):1}.bind(this)}],vertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_weight = a_weight;\n }",fragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n }",hitVertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n attribute vec4 a_hitColor;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_hitColor = a_hitColor;\n v_weight = a_weight;\n }",hitFragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n if (alpha < 0.05) {\n discard;\n }\n\n gl_FragColor = v_hitColor;\n }",uniforms:{u_size:function(){return 2*(this.get(Xb)+this.get(Bb))}.bind(this),u_blurSlope:function(){return this.get(Xb)/Math.max(1,this.get(Bb))}.bind(this)},postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n uniform float u_opacity;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a * u_opacity;\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n gl_FragColor.rgb *= gl_FragColor.a;\n }",uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this),u_opacity:function(){return this.getOpacity()}.bind(this)}}]})},e.prototype.renderDeclutter=function(){},e}(oa),Yb=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)}}(),Kb=function(t){function e(e){var r=e||{};return t.call(this,r)||this}return Yb(e,t),e}(zo),Zb=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)}}(),Hb=function(t){function e(e){var r=t.call(this,e)||this;return r.image_=null,r}return Zb(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],r=t.pixelRatio,n=t.viewState,i=n.resolution,o=this.getLayer().getSource(),a=t.viewHints,s=t.extent;if(void 0!==e.extent&&(s=Ee(s,Xr(e.extent,n.projection))),!a[ls]&&!a[us]&&!Fe(s))if(o){var l=n.projection,u=o.getImage(s,i,r,l);u&&(this.loadImage(u)?this.image_=u:u.getState()===ui&&(this.image_=null))}else this.image_=null;return!!this.image_},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var r=this.getLayer(),n=zt(e.pixelToCoordinateTransform,t.slice()),i=r.getExtent();if(i&&!ne(i,n))return null;var o=this.image_.getExtent(),a=this.image_.getImage(),s=Pe(o),l=Math.floor(a.width*((n[0]-o[0])/s));if(l<0||l>=a.width)return null;var u=Ce(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=l.resolution,c=t.size,p=s*i/(h*o),f=Math.round(c[0]*s),d=Math.round(c[1]*s),g=l.rotation;if(g){var y=Math.round(Math.sqrt(f*f+d*d));f=y,d=y}Nt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/s,1/s,g,-f/2,-d/2),Ut(this.inversePixelTransform,this.pixelTransform);var v=Bt(this.pixelTransform);this.useContainer(e,v,a.opacity,this.getBackground(t));var _=this.context,x=_.canvas;x.width!=f||x.height!=d?(x.width=f,x.height=d):this.containerReused||_.clearRect(0,0,f,d);var b=!1,w=!0;if(a.extent){var S=Xr(a.extent,l.projection);(b=(w=Oe(S,t.extent))&&!ie(S,t.extent))&&this.clipUnrotated(_,t,S)}var C=r.getImage(),E=Nt(this.tempTransform,f/2,d/2,p,p,0,o*(n[0]-u[0])/i,o*(u[1]-n[3])/i);this.renderedResolution=i*s/o;var T=C.width*E[0],R=C.height*E[3];if(this.getLayer().getSource().getInterpolate()||m(_,zf),this.preRender(_,t),w&&T>=.5&&R>=.5){var P=E[4],O=E[5],F=a.opacity,I=void 0;1!==F&&(I=_.globalAlpha,_.globalAlpha=F),_.drawImage(C,0,0,+C.width,+C.height,Math.round(P),Math.round(O),Math.round(T),Math.round(R)),1!==F&&(_.globalAlpha=I)}return this.postRender(_,t),b&&_.restore(),m(_,Gf),v!==x.style.transform&&(x.style.transform=v),this.container},e}(Ga),Jb=Hb,Qb=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)}}(),$b=function(t){function e(e){return t.call(this,e)||this}return Qb(e,t),e.prototype.createRenderer=function(){return new Jb(this)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(Kb),tw=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}(),ew=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){var r=this,n=dl;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}return ew(e,t),e.prototype.getData=function(){return this.data_},e.prototype.getError=function(){return this.error_},e.prototype.load=function(){this.state=gl,this.changed();var t=this;this.loader_().then((function(e){t.data_=e,t.state=yl,t.changed()})).catch((function(e){t.error_=e,t.state=vl,t.changed()}))},e}(El),nw=rw,iw=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 ow(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 aw(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);ow(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 sw=null;var lw=function(t){function e(e){var r=t.call(this)||this;r.tile,r.textures=[],r.handleTileChange_=r.handleTileChange_.bind(r),r.size=fi(e.grid.getTileSize(e.tile.tileCoord[0])),r.tilePixelRatio_=e.tilePixelRatio||1,r.gutter_=e.gutter||0,r.bandCount=NaN,r.helper_=e.helper;var n=new pb(nb,ob);return n.fromArray([0,1,1,1,1,0,0,0]),r.helper_.flushBufferData(n),r.coords=n,r.setTile(e.tile),r}return iw(e,t),e.prototype.setTile=function(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(E,this.handleTileChange_),this.tile=t,this.textures.length=0,this.loaded=t.getState()===yl,this.loaded)this.uploadTile_();else{if(t instanceof Rl){var e=t.getImage();e instanceof Image&&!e.crossOrigin&&(e.crossOrigin="anonymous")}t.addEventListener(E,this.handleTileChange_)}},e.prototype.uploadTile_=function(){var t=this.helper_,e=t.getGL(),r=this.tile;if(r instanceof Rl||r instanceof Wf){var n=r.getImage();if(0!==this.gutter_){var i=this.tilePixelRatio_*this.gutter_,o=Math.round(n.width-2*i),a=Math.round(n.height-2*i),s=Ei(o,a);r.interpolate||m(s,zf),s.drawImage(n,i,i,o,a,0,0,o,a),n=s.canvas}var l=e.createTexture();return this.textures.push(l),this.bandCount=4,void function(t,e,r,n){ow(t,e,n),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r)}(e,l,n,r.interpolate)}var u=[this.size[0]*this.tilePixelRatio_,this.size[1]*this.tilePixelRatio_],h=r.getData(),c=h instanceof Float32Array,p=u[0]*u[1],f=c?Float32Array:Uint8Array,d=f.BYTES_PER_ELEMENT,g=h.byteLength/u[1];this.bandCount=Math.floor(g/d/u[0]);var y=Math.ceil(this.bandCount/4);if(1===y){l=e.createTexture();return this.textures.push(l),void aw(t,l,h,u,this.bandCount,r.interpolate)}for(var v=new Array(y),_=0;_<y;++_){l=e.createTexture();this.textures.push(l);var x=_<y-1?4:this.bandCount%4;v[_]=new f(p*x)}for(var b=0,w=0,S=u[0]*this.bandCount,C=0;C<u[1];++C){for(var E=0;E<S;++E){var T=h[w+E],R=Math.floor(b/this.bandCount),P=E%this.bandCount;(O=v[_=Math.floor(P/4)])[R*(x=O.length/p)+P%4]=T,++b}w+=g/d}for(_=0;_<y;++_){var O;aw(t,l=this.textures[_],O=v[_],u,x=O.length/p,r.interpolate)}},e.prototype.handleTileChange_=function(){this.tile.getState()===yl&&(this.loaded=!0,this.uploadTile_(),this.dispatchEvent(E))},e.prototype.disposeInternal=function(){var t=this.helper_.getGL();this.helper_.deleteBuffer(this.coords);for(var e=0;e<this.textures.length;++e)t.deleteTexture(this.textures[e]);this.tile.removeEventListener(E,this.handleTileChange_)},e.prototype.getPixelData=function(t,e){if(!this.loaded)return null;if(t=Math.floor(this.tilePixelRatio_*t),e=Math.floor(this.tilePixelRatio_*e),this.tile instanceof nw){var r=this.tile.getData(),n=Math.floor(this.tilePixelRatio_*this.size[0]);if(r instanceof DataView){var i=r.byteLength/(this.size[0]*this.size[1]),o=e*n*i+t*i,a=r.buffer.slice(o,o+i);return new DataView(a)}var s=e*n*this.bandCount+t*this.bandCount;return r.slice(s,s+this.bandCount)}var l,u;sw||((l=document.createElement("canvas")).width=1,l.height=1,sw=l.getContext("2d")),sw.clearRect(0,0,1,1);var h=this.tile.getImage();try{sw.drawImage(h,t,e,1,1,0,0,1,1),u=sw.getImageData(0,0,1,1).data}catch(t){return null}return u},e}(C),uw=lw,hw=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)}}(),cw="u_tileTextures",pw="u_tileTransform",fw="u_transitionAlpha",dw="u_depth",gw="u_texturePixelWidth",yw="u_texturePixelHeight",vw="u_textureResolution",_w="u_textureOriginX",mw="u_textureOriginY",xw="u_renderExtent",bw="u_resolution",ww="u_zoom",Sw=[{name:"a_textureCoord",size:2,type:Eb.FLOAT}],Cw={};function Ew(t){return 2*(1-1/(t+1))-1}function Tw(t,e,r){r in t||(t[r]=[]),t[r].push(e)}function Rw(t,e){var r=t.layerStatesArray[t.layerIndex];r.extent&&(e=Ee(e,Xr(r.extent,t.viewState.projection)));var n=r.layer.getRenderSource();if(!n.getWrapX()){var i=n.getTileGridForProjection(t.viewState.projection).getExtent();i&&(e=Ee(e,i))}return e}function Pw(t,e){return"".concat(t.getKey(),",").concat(Sp(e))}!function(t){function e(e,r){var n=t.call(this,e,{uniforms:r.uniforms})||this;n.renderComplete=!1,n.tileTransform_=[1,0,0,1,0,0],n.tempMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n.tempTileRange_=new Ip(0,0,0,0),n.tempTileCoord_=bp(0,0,0),n.tempSize_=[0,0],n.program_,n.vertexShader_=r.vertexShader,n.fragmentShader_=r.fragmentShader,n.indices_=new pb(ib,ob),n.indices_.fromArray([0,1,3,1,2,3]);var i=void 0!==r.cacheSize?r.cacheSize:512;return n.tileTextureCache_=new xp(i),n.paletteTextures_=r.paletteTextures||[],n.frameState_=null,n}hw(e,t),e.prototype.reset=function(e){t.prototype.reset.call(this,{uniforms:e.uniforms}),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.paletteTextures_=e.paletteTextures||[],this.helper&&(this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_))},e.prototype.afterHelperCreated=function(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.helper.flushBufferData(this.indices_)},e.prototype.isDrawableTile_=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==yl||r==_l||r==vl&&!n},e.prototype.prepareFrameInternal=function(t){var e=this.getLayer().getRenderSource();return!!e&&(!Fe(Rw(t,t.extent))&&e.getState()===Ao)},e.prototype.enqueueTiles=function(t,e,r,i){var o=t.viewState,a=this.getLayer(),s=a.getRenderSource(),l=s.getTileGridForProjection(o.projection),u=s.getTilePixelRatio(t.pixelRatio),h=s.getGutterForProjection(o.projection),c=n(s);c in t.wantedTiles||(t.wantedTiles[c]={});for(var p=t.wantedTiles[c],f=this.tileTextureCache_,d=Math.max(r-a.getPreload(),l.getMinZoom(),a.getMinZoom()),g=r;g>=d;--g)for(var y=l.getTileRangeForExtentAndZ(e,g,this.tempTileRange_),v=l.getResolution(g),_=y.minX;_<=y.maxX;++_)for(var m=y.minY;m<=y.maxY;++m){var x=bp(g,_,m,this.tempTileCoord_),b=Pw(s,x),w=void 0,S=void 0;if(f.containsKey(b)&&(S=(w=f.get(b)).tile),!w||w.tile.key!==s.getKey())if(S=s.getTile(g,_,m,t.pixelRatio,o.projection),w)if(this.isDrawableTile_(S))w.setTile(S);else{var C=S.getInterimTile();w.setTile(C)}else w=new uw({tile:S,grid:l,helper:this.helper,tilePixelRatio:u,gutter:h}),f.set(b,w);Tw(i,w,g);var E=S.getKey();p[E]=!0,S.getState()===dl&&(t.tileQueue.isKeyQueued(E)||t.tileQueue.enqueue([S,c,l.getTileCoordCenter(x),v]))}},e.prototype.renderFrame=function(t){this.frameState_=t,this.renderComplete=!0;var e=this.helper.getGL();this.preRender(e,t);var r=t.viewState,i=this.getLayer().getRenderSource(),o=i.getTileGridForProjection(r.projection),a=Rw(t,t.extent),s=o.getZForResolution(r.resolution,i.zDirection),l={};if(t.nextExtent){var u=o.getZForResolution(r.nextResolution,i.zDirection),c=Rw(t,t.nextExtent);this.enqueueTiles(t,c,u,l)}this.enqueueTiles(t,a,s,l);for(var p={},f=n(this),d=t.time,g=!1,y=l[s],v=0,_=y.length;v<_;++v){var m=(D=(Z=y[v]).tile).tileCoord;if(Z.loaded){if(1===(j=D.getAlpha(f,d))){D.endTransition(f);continue}g=!0,p[z=Sp(m)]=j}if(this.renderComplete=!1,!this.findAltTiles_(o,m,s+1,l))for(var x=o.getMinZoom(),b=s-1;b>=x;--b){if(this.findAltTiles_(o,m,b,l))break}}this.helper.useProgram(this.program_),this.helper.prepareDraw(t,!g);for(var w=Object.keys(l).map(Number).sort(h),S=r.center[0],C=r.center[1],E=0,T=w.length;E<T;++E){var R=w[E],P=o.getResolution(R),O=fi(o.getTileSize(R),this.tempSize_),F=o.getOrigin(R),I=(S-F[0])/(O[0]*P),M=(F[1]-C)/(O[1]*P),A=r.resolution/P,L=Ew(R),k=l[R];for(v=0,_=k.length;v<_;++v){if((Z=k[v]).loaded){var D,j,z=Sp(m=(D=Z.tile).tileCoord),G=m[1],N=m[2];Nt(this.tileTransform_,0,0,2/(t.size[0]*A/O[0]),-2/(t.size[1]*A/O[1]),r.rotation,-(I-G),-(M-N)),this.helper.setUniformMatrixValue(pw,vb(this.tempMat4_,this.tileTransform_)),this.helper.bindBuffer(Z.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(Sw);for(var U=0;U<Z.textures.length;){var B="TEXTURE"+U,V="".concat(cw,"[").concat(U,"]");e.activeTexture(e[B]),e.bindTexture(e.TEXTURE_2D,Z.textures[U]),e.uniform1i(this.helper.getUniformLocation(V),U),++U}for(var X=0;X<this.paletteTextures_.length;++X){var W=this.paletteTextures_[X];e.activeTexture(e["TEXTURE"+U]);var q=W.getTexture(e);e.bindTexture(e.TEXTURE_2D,q),e.uniform1i(this.helper.getUniformLocation(W.name),U),++U}(j=z in p?p[z]:1)<1&&(t.animate=!0),this.helper.setUniformFloatValue(fw,j),this.helper.setUniformFloatValue(dw,L),this.helper.setUniformFloatValue(gw,O[0]),this.helper.setUniformFloatValue(yw,O[1]),this.helper.setUniformFloatValue(vw,P),this.helper.setUniformFloatValue(_w,F[0]+G*O[0]*P),this.helper.setUniformFloatValue(mw,F[1]-N*O[1]*P),this.helper.setUniformFloatVec4(xw,a),this.helper.setUniformFloatValue(bw,r.resolution),this.helper.setUniformFloatValue(ww,r.zoom),this.helper.drawElements(0,this.indices_.getSize())}}}this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);for(var Y=this.helper.getCanvas(),K=this.tileTextureCache_;K.canExpireCache();){var Z;(Z=K.pop()).dispose()}return t.postRenderFunctions.push((function(t,e){i.expireCache(e.viewState.projection,Cw)})),this.postRender(e,t),Y},e.prototype.getData=function(t){if(!this.helper.getGL())return null;var e=this.frameState_;if(!e)return null;var r=this.getLayer(),n=zt(e.pixelToCoordinateTransform,t.slice()),i=e.viewState,o=r.getExtent();if(o&&!ne(Xr(o,i.projection),n))return null;var a=r.getRenderSource(),s=a.getTileGridForProjection(i.projection);if(!a.getWrapX()){var l=s.getExtent();if(l&&!ne(l,n))return null}for(var u=this.tileTextureCache_,h=s.getZForResolution(i.resolution);h>=s.getMinZoom();--h){var c=s.getTileCoordForCoordAndZ(n,h),p=Pw(a,c);if(u.containsKey(p)){var f=u.get(p);if(f.loaded){var d=s.getOrigin(h),g=fi(s.getTileSize(h)),y=s.getResolution(h),v=(n[0]-d[0])/y-c[1]*g[0],_=(d[1]-n[1])/y-c[2]*g[1];return f.getPixelData(v,_)}}}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=Pw(s,[r,l,u]),c=!1;if(a.containsKey(h)){var p=a.get(h);p.loaded&&(Tw(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_}}(kb);var Ow=1,Fw=2,Iw=4,Mw=8,Aw=16,Lw=31,kw=0,Dw={};function jw(t){if("number"==typeof t)return Ow;if("boolean"==typeof t)return Mw;if("string"==typeof t)return e=t,vi.test(e)&&(e=mi(e)),yi.test(e)||0===e.indexOf("rgba(")||0===e.indexOf("rgb(")?Iw|Fw:Fw;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?Iw|Aw:Aw;if("string"!=typeof r[0])throw new Error("Expected an expression operator but received: ".concat(JSON.stringify(r)));var n=Dw[r[0]];if(void 0===n)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(r)));return n.getReturnType(r.slice(1))}function zw(t){var e=t.toString();return-1===e.indexOf(".")?e+".0":e}function Gw(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(zw).join(", "),")")}function Nw(t,e){return void 0===t.stringLiteralsMap[e]&&(t.stringLiteralsMap[e]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[e]}function Uw(t,e,r){if(Array.isArray(e)&&"string"==typeof e[0]){var n=Dw[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=jw(e);if((i&Ow)>0)return zw(e);if((i&Mw)>0)return e.toString();if((i&Fw)>0&&(void 0===r||r==Fw))return function(t,e){return zw(Nw(t,e))}(t,e.toString());if((i&Iw)>0&&(void 0===r||r==Iw))return function(t){var e=bi(t).slice();return e.length<4&&e.push(1),Gw(e.map((function(t,e){return e<3?t/255:t})))}(e);if((i&Aw)>0)return Gw(e);throw new Error("Unexpected expression ".concat(e," (expected type ").concat(r,")"))}function Bw(t){if(!(jw(t)&Ow))throw new Error("A numeric value was expected, got ".concat(JSON.stringify(t)," instead"))}function Vw(t){for(var e=0;e<t.length;e++)Bw(t[e])}function Xw(t){if(!(jw(t)&Fw))throw new Error("A string value was expected, got ".concat(JSON.stringify(t)," instead"))}function Ww(t){if(!(jw(t)&Mw))throw new Error("A boolean value was expected, got ".concat(JSON.stringify(t)," instead"))}function qw(t,e){if(t.length!==e)throw new Error("Exactly ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function Yw(t,e){if(t.length<e)throw new Error("At least ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function Kw(t,e){if(t.length>e)throw new Error("At most ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function Zw(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got ".concat(t," instead"))}function Hw(t,e){if(ke(e)%1!=0)throw new Error("Could not infer only one type from the following expression: ".concat(JSON.stringify(t)))}function Jw(t){return"u_var_"+t}Dw.get={getReturnType:function(t){return Lw},toGlsl:function(t,e){qw(e,1),Xw(e[0]);var r=e[0].toString();return-1===t.attributes.indexOf(r)&&t.attributes.push(r),(t.inFragmentShader?"v_":"a_")+r}},Dw.var={getReturnType:function(t){return Lw},toGlsl:function(t,e){qw(e,1),Xw(e[0]);var r=e[0].toString();return-1===t.variables.indexOf(r)&&t.variables.push(r),Jw(r)}};Dw.palette={getReturnType:function(t){return Iw},toGlsl:function(t,e){qw(e,2),Bw(e[0]);var r=Uw(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<i;a++){var s=n[a],l=void 0;if("string"==typeof s)l=xi(s);else{if(!Array.isArray(s))throw new Error("The second argument of palette must be an array of strings or colors");var u=s.length;if(4===u)l=s;else{if(3!==u)throw new Error("Expected palette color to have 3 or 4 values, got ".concat(u));l=[s[0],s[1],s[2],1]}}var h=4*a;o[h]=l[0],o[h+1]=l[1],o[h+2]=l[2],o[h+3]=255*l[3]}t.paletteTextures||(t.paletteTextures=[]);var c="".concat("u_paletteTextures","[").concat(t.paletteTextures.length,"]"),p=new tw(c,o);return t.paletteTextures.push(p),"texture2D(".concat(c,", vec2((").concat(r," + 0.5) / ").concat(i,".0, 0.5))")}};var Qw="getBandValue";function $w(t){return{getReturnType:function(t){return Mw},toGlsl:function(e,r){qw(r,2);for(var n=Lw,i=0;i<r.length;i++)n&=jw(r[i]);if(n===kw)throw new Error("All arguments should be of compatible type, got ".concat(JSON.stringify(r)," instead"));return n&=~Iw,"(".concat(Uw(e,r[0],n)," ").concat(t," ").concat(Uw(e,r[1],n),")")}}}function tS(t){return{getReturnType:function(t){return Mw},toGlsl:function(e,r){Yw(r,2);for(var n=0;n<r.length;n++)Ww(r[n]);var i="";return i=r.map((function(t){return Uw(e,t)})).join(" ".concat(t," ")),i="(".concat(i,")")}}}Dw.band={getReturnType:function(t){return Ow},toGlsl:function(t,e){Yw(e,1),Kw(e,3);var r=e[0];if(!(Qw in t.functions)){for(var n="",i=t.bandCount||1,o=0;o<i;o++){var a=Math.floor(o/4),s=o%4;s===i-1&&1===s&&(s=3);var l="".concat(cw,"[").concat(a,"]");n+="\n if (band == ".concat(o+1,".0) {\n return texture2D(").concat(l,", v_textureCoord + vec2(dx, dy))[").concat(s,"];\n }\n ")}t.functions.getBandValue="\n float getBandValue(float band, float xOffset, float yOffset) {\n float dx = xOffset / ".concat(gw,";\n float dy = yOffset / ").concat(yw,";\n ").concat(n,"\n }\n ")}var u=Uw(t,r),h=Uw(t,e[1]||0),c=Uw(t,e[2]||0);return"".concat(Qw,"(").concat(u,", ").concat(h,", ").concat(c,")")}},Dw.time={getReturnType:function(t){return Ow},toGlsl:function(t,e){return qw(e,0),"u_time"}},Dw.zoom={getReturnType:function(t){return Ow},toGlsl:function(t,e){return qw(e,0),"u_zoom"}},Dw.resolution={getReturnType:function(t){return Ow},toGlsl:function(t,e){return qw(e,0),"u_resolution"}},Dw["*"]={getReturnType:function(t){return Ow},toGlsl:function(t,e){return qw(e,2),Vw(e),"(".concat(Uw(t,e[0])," * ").concat(Uw(t,e[1]),")")}},Dw["/"]={getReturnType:function(t){return Ow},toGlsl:function(t,e){return qw(e,2),Vw(e),"(".concat(Uw(t,e[0])," / ").concat(Uw(t,e[1]),")")}},Dw["+"]={getReturnType:function(t){return Ow},toGlsl:function(t,e){return qw(e,2),Vw(e),"(".concat(Uw(t,e[0])," + ").concat(Uw(t,e[1]),")")}},Dw["-"]={getReturnType:function(t){return Ow},toGlsl:function(t,e){return qw(e,2),Vw(e),"(".concat(Uw(t,e[0])," - ").concat(Uw(t,e[1]),")")}},Dw.clamp={getReturnType:function(t){return Ow},toGlsl:function(t,e){qw(e,3),Vw(e);var r=Uw(t,e[1]),n=Uw(t,e[2]);return"clamp(".concat(Uw(t,e[0]),", ").concat(r,", ").concat(n,")")}},Dw["%"]={getReturnType:function(t){return Ow},toGlsl:function(t,e){return qw(e,2),Vw(e),"mod(".concat(Uw(t,e[0]),", ").concat(Uw(t,e[1]),")")}},Dw["^"]={getReturnType:function(t){return Ow},toGlsl:function(t,e){return qw(e,2),Vw(e),"pow(".concat(Uw(t,e[0]),", ").concat(Uw(t,e[1]),")")}},Dw.abs={getReturnType:function(t){return Ow},toGlsl:function(t,e){return qw(e,1),Vw(e),"abs(".concat(Uw(t,e[0]),")")}},Dw.floor={getReturnType:function(t){return Ow},toGlsl:function(t,e){return qw(e,1),Vw(e),"floor(".concat(Uw(t,e[0]),")")}},Dw.round={getReturnType:function(t){return Ow},toGlsl:function(t,e){return qw(e,1),Vw(e),"floor(".concat(Uw(t,e[0])," + 0.5)")}},Dw.ceil={getReturnType:function(t){return Ow},toGlsl:function(t,e){return qw(e,1),Vw(e),"ceil(".concat(Uw(t,e[0]),")")}},Dw.sin={getReturnType:function(t){return Ow},toGlsl:function(t,e){return qw(e,1),Vw(e),"sin(".concat(Uw(t,e[0]),")")}},Dw.cos={getReturnType:function(t){return Ow},toGlsl:function(t,e){return qw(e,1),Vw(e),"cos(".concat(Uw(t,e[0]),")")}},Dw.atan={getReturnType:function(t){return Ow},toGlsl:function(t,e){return Yw(e,1),Kw(e,2),Vw(e),2===e.length?"atan(".concat(Uw(t,e[0]),", ").concat(Uw(t,e[1]),")"):"atan(".concat(Uw(t,e[0]),")")}},Dw[">"]={getReturnType:function(t){return Mw},toGlsl:function(t,e){return qw(e,2),Vw(e),"(".concat(Uw(t,e[0])," > ").concat(Uw(t,e[1]),")")}},Dw[">="]={getReturnType:function(t){return Mw},toGlsl:function(t,e){return qw(e,2),Vw(e),"(".concat(Uw(t,e[0])," >= ").concat(Uw(t,e[1]),")")}},Dw["<"]={getReturnType:function(t){return Mw},toGlsl:function(t,e){return qw(e,2),Vw(e),"(".concat(Uw(t,e[0])," < ").concat(Uw(t,e[1]),")")}},Dw["<="]={getReturnType:function(t){return Mw},toGlsl:function(t,e){return qw(e,2),Vw(e),"(".concat(Uw(t,e[0])," <= ").concat(Uw(t,e[1]),")")}},Dw["=="]=$w("=="),Dw["!="]=$w("!="),Dw["!"]={getReturnType:function(t){return Mw},toGlsl:function(t,e){return qw(e,1),Ww(e[0]),"(!".concat(Uw(t,e[0]),")")}},Dw.all=tS("&&"),Dw.any=tS("||"),Dw.between={getReturnType:function(t){return Mw},toGlsl:function(t,e){qw(e,3),Vw(e);var r=Uw(t,e[1]),n=Uw(t,e[2]),i=Uw(t,e[0]);return"(".concat(i," >= ").concat(r," && ").concat(i," <= ").concat(n,")")}},Dw.array={getReturnType:function(t){return Aw},toGlsl:function(t,e){Yw(e,2),Kw(e,4),Vw(e);var r=e.map((function(e){return Uw(t,e,Ow)}));return"vec".concat(e.length,"(").concat(r.join(", "),")")}},Dw.color={getReturnType:function(t){return Iw},toGlsl:function(t,e){Yw(e,3),Kw(e,4),Vw(e);var r=e;3===e.length&&r.push(1);var n=e.map((function(e,r){return Uw(t,e,Ow)+(r<3?" / 255.0":"")}));return"vec".concat(e.length,"(").concat(n.join(", "),")")}},Dw.interpolate={getReturnType:function(t){for(var e=Iw|Ow,r=3;r<t.length;r+=2)e&=jw(t[r]);return e},toGlsl:function(t,e,r){Zw(e),Yw(e,6);var n,i=e[0];switch(i[0]){case"linear":n=1;break;case"exponential":n=i[1];break;default:n=null}if(!n)throw new Error('Invalid interpolation type for "interpolate" operator, received: '.concat(JSON.stringify(i)));var o=void 0!==r?r:Lw,a=Dw.interpolate.getReturnType(e)&o;Hw(e,a);for(var s=Uw(t,e[1]),l=zw(n),u="",h=2;h<e.length-2;h+=2){var c=Uw(t,e[h]),p=u||Uw(t,e[h+1],a),f=Uw(t,e[h+2]),d=Uw(t,e[h+3],a);u="mix(".concat(p,", ").concat(d,", pow(clamp((").concat(s," - ").concat(c,") / (").concat(f," - ").concat(c,"), 0.0, 1.0), ").concat(l,"))")}return u}},Dw.match={getReturnType:function(t){for(var e=Lw,r=2;r<t.length;r+=2)e&=jw(t[r]);return e&=jw(t[t.length-1])},toGlsl:function(t,e,r){Zw(e),Yw(e,4);var n=void 0!==r?r:Lw,i=Dw.match.getReturnType(e)&n;Hw(e,i);for(var o=Uw(t,e[0]),a=Uw(t,e[e.length-1],i),s=null,l=e.length-3;l>=1;l-=2){var u=Uw(t,e[l]),h=Uw(t,e[l+1],i);s="(".concat(o," == ").concat(u," ? ").concat(h," : ").concat(s||a,")")}return s}},Dw.case={getReturnType:function(t){for(var e=Lw,r=1;r<t.length;r+=2)e&=jw(t[r]);return e&=jw(t[t.length-1])},toGlsl:function(t,e,r){!function(t){if(t.length%2==0)throw new Error("An odd amount of arguments was expected, got ".concat(t," instead"))}(e),Yw(e,3);var n=void 0!==r?r:Lw,i=Dw.case.getReturnType(e)&n;Hw(e,i);for(var o=0;o<e.length-1;o+=2)Ww(e[o]);var a=Uw(t,e[e.length-1],i),s=null;for(o=e.length-3;o>=0;o-=2){var l=Uw(t,e[o]),u=Uw(t,e[o+1],i);s="(".concat(l," ? ").concat(u," : ").concat(s||a,")")}return s}};var eS=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 rS=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)}}(),nS=function(t){function e(e){var r=this,n=m({},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=Uw(l,r,Aw|Ow),h=Uw(l,o,Aw),c=Uw(l,i,Aw),p=Uw(l,s,Ow),f={inFragmentShader:!0,variables:l.variables,attributes:[],stringLiteralsMap:l.stringLiteralsMap,functions:{}},d=Uw(f,n,Iw),g=Uw(f,a,Ow),y="1.0",v="vec2(".concat(Uw(f,r,Aw|Ow),").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 eS).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 b=Uw(f,t.filter,Mw);x.setFragmentDiscardExpression("!".concat(b))}var w={};if(f.variables.forEach((function(e){var r=Jw(e);x.addUniform("float ".concat(r)),w[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=Nw(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)"),w.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=Nw(l,n)),void 0!==n?n:-9999999}}})),uniforms:w}}(e.style),r.styleVariables_=e.style.variables||{},r.hitDetectionDisabled_=!!e.disableHitDetection,r}return rS(e,t),e.prototype.createRenderer=function(){return new Nb(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){m(this.styleVariables_,t),this.changed()},e}(zo),iS=nS,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)}}();var aS=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:Or("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Mo,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,dd("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 oS(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=$f(this.getProjection()),i=this.hidpi_?2:1,o=e.imageWidth==e.imageHeight?e.imageWidth/i:[e.imageWidth/i,e.imageHeight/i],a=Hf({extent:n,minZoom:e.zoomMin,maxZoom:r,tileSize:o});this.tileGrid=a;var s=this.culture_,l=this.hidpi_;if(this.tileUrlFunction=ad(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){bp(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<<n-1;for(e=0;e<n;++e)r=48,t[1]&o&&(r+=1),t[2]&o&&(r+=2),i[e]=String.fromCharCode(r),o>>=1;return i.join("")}(r))}}}))),e.imageryProviders){var u=kr(Or("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<s;++o){var l=i[o];if(a>=l.zoomMin&&a<=l.zoomMax){var h=l.bbox;if(Oe(Ie([h[1],h[0],h[3],h[2]],u),t.extent)){n=!0;break}}}n&&r.push(e.attribution)})),r.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>'),r}.bind(this))}this.setState(Ao)}else this.setState(Lo)},e}(pd),sS=aS,lS=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)}}(),uS=function(t){function e(e){var r=e||{},n=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(n=r.interpolate);var i=void 0!==r.projection?r.projection:"EPSG:3857",o=void 0!==r.tileGrid?r.tileGrid:Hf({extent:$f(i),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:n,opaque:r.opaque,projection:i,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:o,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this}return lS(e,t),e}(pd),hS=uS,cS=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)}}(),pS=function(t){function e(e,r,n,i,o,a,s){var l=this,u=e.getExtent(),h=r.getExtent(),c=h?Ee(n,h):n,p=Bf(e,r,be(c),i),f=new jf(e,r,c,u,.5*p,i),d=a(f.calculateSourceExtent(),p,o),g=d?oi:ui,y=d?d.getPixelRatio():1;return(l=t.call(this,n,i,y,g)||this).targetProj_=r,l.maxSourceExtent_=u,l.triangulation_=f,l.targetResolution_=i,l.targetExtent_=n,l.sourceImage_=d,l.sourcePixelRatio_=y,l.interpolate_=s,l.canvas_=null,l.sourceListenerKey_=null,l}return cS(e,t),e.prototype.disposeInternal=function(){this.state==ai&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==si){var e=Pe(this.targetExtent_)/this.targetResolution_,r=Ce(this.targetExtent_)/this.targetResolution_;this.canvas_=Vf(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()},e.prototype.load=function(){if(this.state==oi){this.state=ai,this.changed();var t=this.sourceImage_.getState();t==si||t==li?this.reproject_():(this.sourceListenerKey_=G(this.sourceImage_,E,(function(t){var e=this.sourceImage_.getState();e!=si&&e!=li||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){U(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(Ss),fS=pS,dS=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)}}(),gS="imageloadstart",yS="imageloadend",vS="imageloaderror",_S=function(t){function e(e,r){var n=t.call(this,e)||this;return n.image=r,n}return dS(e,t),e}(s),mS=function(t){function r(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 dS(r,t),r.prototype.getResolutions=function(){return this.resolutions_},r.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=p(this.resolutions_,t,0);t=this.resolutions_[e]}return t},r.prototype.getImage=function(t,e,r,n){var i=this.getProjection();if(i&&n&&!Lr(i,n)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Lr(this.reprojectedImage_.getProjection(),n)&&this.reprojectedImage_.getResolution()==e&&pe(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new fS(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)},r.prototype.getImageInternal=function(t,r,n,i){return e()},r.prototype.handleImageChange=function(t){var e,r=t.target;switch(r.getState()){case ai:this.loading=!0,e=gS;break;case si:this.loading=!1,e=yS;break;case li:this.loading=!1,e=vS;break;default:return}this.hasListener(e)&&this.dispatchEvent(new _S(e,r))},r}(Hs);function xS(t,e){t.getImage().src=e}var bS=mS;function wS(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 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=void 0!==e.crossOrigin?e.crossOrigin:null,i=void 0!==e.imageLoadFunction?e.imageLoadFunction:xS,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:Or(e.projection)})||this).url_=e.url,r.imageExtent_=e.imageExtent,r.image_=new Ts(r.imageExtent_,void 0,1,r.url_,n,i),r.imageSize_=e.imageSize?e.imageSize:null,r.image_.addEventListener(E,r.handleImageChange.bind(r)),r}return SS(e,t),e.prototype.getImageExtent=function(){return this.imageExtent_},e.prototype.getImageInternal=function(t,e,r,n){return Oe(t,this.image_.getExtent())?this.image_:null},e.prototype.getUrl=function(){return this.url_},e.prototype.handleImageChange=function(e){if(this.image_.getState()==si){var r=this.image_.getExtent(),n=this.image_.getImage(),i=void 0,o=void 0;this.imageSize_?(i=this.imageSize_[0],o=this.imageSize_[1]):(i=n.width,o=n.height);var a=Pe(r),s=Ce(r),l=a/i,u=s/o,h=i,c=o;if(l>u?h=Math.round(a/u):c=Math.round(s/l),h!==i||c!==o){var p=Ei(h,c);this.getInterpolate()||m(p,zf);var f=p.canvas;p.drawImage(n,0,0,i,o,0,0,f.width,f.height),this.image_.setImage(f)}}t.prototype.handleImageChange.call(this,e)},e}(bS),ES=CS,TS="1.3.0",RS="carmentaserver",PS="geoserver",OS="mapserver",FS="qgis",IS=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)}}(),MS=[101,101],AS=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:xS,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 IS(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,n){if(void 0!==this.url_){var i=Or(r),o=this.getProjection();o&&o!==i&&(e=Bf(o,i,t,e),t=jr(t,i,o));var a=Se(t,e,0,MS),s={SERVICE:"WMS",VERSION:TS,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};m(s,this.params_,n);var l=Xe((t[0]-a[0])/e,4),u=Xe((a[3]-t[1])/e,4);return s[this.v13_?"I":"X"]=l,s[this.v13_?"J":"Y"]=u,this.getRequestUrl_(a,MS,1,o||i,s)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.url_){var r={SERVICE:"WMS",VERSION:TS,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 m(r,e),wS(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=be(t),a=Se(o,i,0,[We(Pe(t)/i,4),We(Ce(t)/i,4)]),s=Se(o,i,0,[We(this.ratio_*Pe(t)/i,4),We(this.ratio_*Ce(t)/i,4)]),l=this.image_;if(l&&this.renderedRevision_==this.getRevision()&&l.getResolution()==e&&l.getPixelRatio()==r&&ie(l.getExtent(),a))return l;var u={SERVICE:"WMS",VERSION:TS,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};m(u,this.params_),this.imageSize_[0]=Ve(Pe(s)/i,4),this.imageSize_[1]=Ve(Ce(s)/i,4);var h=this.getRequestUrl_(s,this.imageSize_,r,n,u);return this.image_=new Ts(s,e,r,h,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(E,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,r,n,i){if(it(void 0!==this.url_,9),i[this.v13_?"CRS":"SRS"]=n.getCode(),"STYLES"in this.params_||(i.STYLES=""),1!=r)switch(this.serverType_){case PS:var o=90*r+.5|0;"FORMAT_OPTIONS"in i?i.FORMAT_OPTIONS+=";dpi:"+o:i.FORMAT_OPTIONS="dpi:"+o;break;case OS:i.MAP_RESOLUTION=90*r;break;case RS:case FS:i.DPI=90*r;break;default:it(!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(","),wS(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){m(this.params_,t),this.updateV13_(),this.image_=null,this.changed()},e.prototype.updateV13_=function(){var t=this.params_.VERSION||TS;this.v13_=hr(t,"1.3")>=0},e}(bS),LS=AS,kS=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)}}(),DS=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:['© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> 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 kS(e,t),e}(hS),jS=DS,zS=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)}}(),GS=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 zS(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,n){var i=Or(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 u=a.getResolution(l[0]),h=a.getTileCoordExtent(l,this.tmpExtent_),c=fi(a.getTileSize(l[0]),this.tmpSize),p=this.gutter_;0!==p&&(c=hi(c,p,this.tmpSize),h=te(h,u*p,h)),o&&o!==i&&(u=Bf(o,i,t,u),h=function(t,e,r,n){return Ie(t,Dr(e,r),void 0,n)}(h,i,o),t=jr(t,i,o));var f={SERVICE:"WMS",VERSION:TS,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};m(f,this.params_,n);var d=Math.floor((t[0]-h[0])/u),g=Math.floor((h[3]-t[1])/u);return f[this.v13_?"I":"X"]=d,f[this.v13_?"J":"Y"]=g,this.getRequestUrl_(l,c,h,1,o||i,f)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.urls[0]){var r={SERVICE:"WMS",VERSION:TS,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 m(r,e),wS(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 PS:var s=90*n+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+s:o.FORMAT_OPTIONS="dpi:"+s;break;case OS:o.MAP_RESOLUTION=90*n;break;case RS:case FS:o.DPI=90*n;break;default:it(!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[Ne(Ep(t),a.length)];return wS(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){m(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){var t=this.params_.VERSION||TS;this.v13_=hr(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=fi(n.getTileSize(t[0]),this.tmpSize),s=this.gutter_;0!==s&&(a=hi(a,s,this.tmpSize),o=te(o,i*s,o)),1!=e&&(a=pi(a,e,this.tmpSize));var l={SERVICE:"WMS",VERSION:TS,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return m(l,this.params_),this.getRequestUrl_(t,a,o,e,r,l)}},e}(pd),NS=GS;W.unByKey=X;let US={Control:Fu,Zoom:Gu,Attribution:Lu,ScaleLine:Hu,LayerSwitcher:C_},BS={GeoJSON:ef,KML:rb,MVT:Af},VS={Group:Gl,Tile:Td,Vector:qs,VectorTile:Dd,WebGLPoints:iS,Heatmap:qb,Image:$b},XS={toLonLat:function(t,e){var r=jr(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),n=r[0];return(n<-180||n>180)&&(r[0]=Ne(n+180,360)-180),r},fromLonLat:Ar},WS={LineString:ri,Point:En,MultiPoint:yc},qS={Icon:Ms,Style:fo,Text:_o,Stroke:ii,Fill:Hn,Circle:so},YS={OSM:jS,XYZ:hS,TileWMS:NS,BingMaps:sS,Vector:fl,VectorTile:Gd,ImageWMS:LS,ImageStatic:ES};t.Collection=nt,t.Feature=st,t.Map=mp,t.Observable=W,t.View=Su,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:Gv(o,s.accessToken),s=function(t,e){return e.accessToken||(e=m({},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 Wv("Style",t=Gv(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 qs||t instanceof Dd))return l(new Error("Can only apply to VectorLayer or VectorTileLayer"));var u,h,c,p=t instanceof Dd?"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 Dd)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=qv[n];if(!i||r.transformRequest){var o=t.url;if(o){var a=Nv(o,r.accessToken,r.accessTokenParam||"access_token",e||location.href);i=o.startsWith("mapbox://")?Promise.resolve(m({},t,{url:void 0,tiles:a})):Wv("Source",a,r).then((function(t){for(var e=0,n=t.tiles.length;e<n;++e){var i=t.tiles[e];if(r.transformRequest){var o=r.transformRequest(a,"Source");o&&(a=o.url)}var s=Nv(i,r.accessToken,r.accessTokenParam||"access_token",a);if(r.transformRequest){var l=r.transformRequest(s,"Tiles");l instanceof Request&&(s=decodeURI(l.url))}t.tiles[e]=s}return Promise.resolve(t)}))}else t=m({},t,{tiles:t.tiles.map((function(t){return Nv(t,r.accessToken,r.accessTokenParam||"access_token",e||location.href)}))}),i=Promise.resolve(m({},t));qv[n]=i}return i})(t,e,r).then((function(t){var e=new vd({tileJSON:t}),r=e.getTileJSON(),i=e.getTileGrid(),o=function(t){var e=t.bounds;if(e){var r=Ar([e[0],e[1]]),n=Ar([e[2],e[3]]);return[r[0],r[1],n[0],n[1]]}}(r),a=r.minzoom||0,s=r.maxzoom||22,l={attributions:e.getAttributions(),format:new Af,tileGrid:new Df({origin:i.getOrigin(0),extent:o||i.getExtent(),minZoom:a,resolutions:Bv.slice(0,s+1),tileSize:512})};Array.isArray(r.tiles)?l.urls=r.tiles:l.url=r.tiles,t.olSourceOptions&&Object.assign(l,t.olSourceOptions),n(new Gd(l))})).catch(i)}))}(e.sources[a],o,s).then((function(e){var r=t.getSource();if(r?e!==r&&(r.setTileUrlFunction(e.getTileUrlFunction()),r.format_||(r.format_=e.format_),r.getAttributions()||r.setAttributions(e.getAttributions()),r.getTileLoadFunction()===Nd&&r.setTileLoadFunction(e.getTileLoadFunction()),Lr(r.getProjection(),e.getProjection())&&(r.tileGrid=e.getTileGrid())):t.setSource(e),!isFinite(t.getMaxResolution())&&!isFinite(t.getMinZoom())){var n=t.getSource().getTileGrid();t.setMaxResolution(n.getResolution(n.getMinZoom()))}}));var r=e.sources[a],n=t.getSource();n&&n.get("mapbox-source")===r||(n=function(t,e,r){var n=t.data,i={};if("string"==typeof n){var o=Nv(n,r.accessToken,r.accessTokenParam||"access_token",e||location.href);if(r.transformRequest){var a=r.transformRequest(o,"GeoJSON");a instanceof Request&&(o=encodeURI(a.url))}i.url=o}else i.features=m_.readFeatures(n,{featureProjection:"EPSG:3857"});var s=new fl(m({attributions:t.attribution,format:m_},i));return s.set("mapbox-source",t),s}(r,o,s));var i=t.getSource();return i?n!==i&&(i.getAttributions()||i.setAttributions(n.getAttributions()),i.format_||(i.format_=n.getFormat()),i.url_=n.getUrl()):t.setSource(n),Promise.resolve()}function d(){c||e.sprite&&!u?c?(t.setStyle(c),f().then(n).catch(l)):l(new Error("Something went wrong trying to apply style.")):(c=__(t,e,r,i,u,h,o_),t.getStyle()?f().then(n).catch(l):l(new Error("Nothing to show for source ["+a+"]")))}if(e.sprite){var g=new URL(function(t,e,r){var n=zv(t);if(!n)return decodeURI(new URL(t,r).href);var i="sprites/";if(0!==n.indexOf(i))throw new Error("unexpected sprites url: "+t);var o=n.slice(i.length);return jv+"/styles/v1/"+o+"/sprite?access_token="+e}(e.sprite,s.accessToken,o||location.href)),y=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",v=g.origin+g.pathname+y+".json"+g.search;new Promise((function(t,e){Wv("Sprite",v,s).then(t).catch((function(r){Wv("Sprite",v=g.origin+g.pathname+".json"+g.search,s).then(t).catch(e)}))})).then((function(t){void 0===t&&l(new Error("No sprites found.")),u=t,h=g.origin+g.pathname+y+".png"+g.search,d()})).catch((function(t){l(new Error("Sprites cannot be loaded: "+v+": "+t.message))}))}else d()})).catch(l)}))},t.control=US,t.format=BS,t.geom=WS,t.interaction=vp,t.layer=VS,t.proj=XS,t.source=YS,t.sphere=Sr,t.style=qS,Object.defineProperty(t,"__esModule",{value:!0})}));
|
||
//# sourceMappingURL=ol-custom.js.map
|