>3}a--,1===o||2===o?(s+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>c&&(n.push(u),c=u),r.push(s,l),u+=2):7===o?u>c&&(r.push(r[c],r[c+1]),u+=2):ut(!1,59)}u>c&&(n.push(u),c=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?gt.POINT:gt.MULTI_POINT:2===t?r=1===e?gt.LINE_STRING:gt.MULTI_LINE_STRING:3===t&&(r=gt.POLYGON);return r}(i,l.length);if(this.featureClass_===ey)(n=new this.featureClass_(u,s,l,a,o)).transform(r.dataProjection,r.featureProjection);else{var c=void 0;if(u==gt.POLYGON){for(var h=[],p=0,f=0,d=0,y=l.length;d1?new Hd(s,pt,h):new Mn(s,pt,l)}else c=u===gt.POINT?new yn(s,pt):u===gt.LINE_STRING?new Od(s,pt):u===gt.POLYGON?new Mn(s,pt,l):u===gt.MULTI_POINT?new Xd(s,pt):u===gt.MULTI_LINE_STRING?new qd(s,pt,l):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var m=Bd(c,!1,r);n.setGeometry(m),n.setId(o),n.setProperties(a,!0)}return n},e.prototype.getType=function(){return ml},e.prototype.readFeatures=function(t,e){var r=this.layers_,n=this.adaptOptions(e),i=gr(n.dataProjection);i.setWorldExtent(n.extent),n.dataProjection=i;var o=new $d.a(t),a=o.readFields(ny,{}),s=[];for(var l in a)if(!r||-1!=r.indexOf(l)){var u=a[l],c=u?[0,0,u.extent,u.extent]:null;i.setExtent(c);for(var h=0,p=u.length;h=.05){for(var r="",n=t.split("\n"),i=my.slice(0,Math.round(e/.1)),o=0,a=n.length;o0&&(r+="\n"),r+=n[o].split("").join(i);return r}return t}function _y(){return gy||(gy=yy(1,1).getContext("2d")),gy}function by(t,e){return _y().measureText(t).width+(t.length-1)*e}var xy={};eo&&q(eo,M,(function(){xy={}}));var wy,Sy,Ty=py.e.isFunction,Ey=py.e.convertFunction,Cy=py.c.isExpression,Oy=py.c.createPropertyExpression,Py={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Ry={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]},Iy={},Ly={zoom:0},My={};function Fy(t,e,r,n,i){var o=t.id;My[o]||(My[o]={});var a=My[o];if(!a[r]){var s=(t[e]||Iy)[r],l=py.f[e+"_"+t.type][r];void 0===s&&(s=l.default);var u=Cy(s);if(!u&&Ty(s)&&(s=Ey(s,l),u=!0),u){var c=function(t,e){var r=Oy(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}(s,l);a[r]=c.evaluate.bind(c)}else"color"==l.type&&(s=py.a.parse(s)),a[r]=function(){return s}}return Ly.zoom=n,a[r](Ly,i)}var Ay={};function ky(t,e){if(t){if(0===t.a||0===e)return;var r=t.a;return e=void 0===e?1:e,"rgba("+Math.round(255*t.r/r)+","+Math.round(255*t.g/r)+","+Math.round(255*t.b/r)+","+r*e+")"}return t}var jy=/^([^]*)\{(.*)\}([^]*)$/;function Ny(t,e){var r;do{if(r=t.match(jy)){var n=e[r[2]]||"";t=r[1]+n+r[3]}}while(r);return t}var Gy=function(t,e,r,n,i,o,a){if(void 0===n&&(n=dy),"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 c=self;c.postMessage({action:"loadImage",src:o}),c.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===o&&(s=t.data.image,l=[s.width,s.height])}))}for(var h,p=Object(py.b)(e.layers),f={},d=[],y=0,g=p.length;y=y.maxzoom)return"continue";var _=y.filter;if(!_||function(t,e,r,n){return t in Ay||(Ay[t]=Object(py.d)(e).filter),Ly.zoom=n,Ay[t](Ly,r)}(g,_,h,u)){var b=void 0,x=void 0,w=void 0,P=void 0,R=void 0,I=void 0,L=d.index;if(3==c&&"fill"==y.type)if(x=Fy(y,"paint","fill-opacity",u,h),"fill-pattern"in v){var M=Fy(y,"paint","fill-pattern",u,h);if(M){var F="string"==typeof M?Ny(M,r):M.toString();if(s&&i&&i[F]){++p,(I=O[p])&&I.getFill()&&!I.getStroke()&&!I.getText()||(I=O[p]=new cc({fill:new Uu})),w=I.getFill(),I.setZIndex(L);var A=C[lt=F+"."+x];if(!A)(ht=(ct=yy((ut=i[F]).width,ut.height)).getContext("2d")).globalAlpha=x,ht.drawImage(s,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height),A=ht.createPattern(ct,"repeat"),C[lt]=A;w.setColor(A)}}}else(b=ky(Fy(y,"paint","fill-color",u,h),x))&&("fill-outline-color"in v&&(R=ky(Fy(y,"paint","fill-outline-color",u,h),x)),R||(R=b),++p,(I=O[p])&&I.getFill()&&I.getStroke()&&!I.getText()||(I=O[p]=new cc({fill:new Uu,stroke:new ic})),(w=I.getFill()).setColor(b),(P=I.getStroke()).setColor(R),P.setWidth(1),I.setZIndex(L));if(1!=c&&"line"==y.type){b=!("line-pattern"in v)&&"line-color"in v?ky(Fy(y,"paint","line-color",u,h),Fy(y,"paint","line-opacity",u,h)):void 0;var k=Fy(y,"paint","line-width",u,h);b&&k>0&&(++p,(I=O[p])&&I.getStroke()&&!I.getFill()&&!I.getText()||(I=O[p]=new cc({stroke:new ic})),(P=I.getStroke()).setLineCap(Fy(y,"layout","line-cap",u,h)),P.setLineJoin(Fy(y,"layout","line-join",u,h)),P.setMiterLimit(Fy(y,"layout","line-miter-limit",u,h)),P.setColor(b),P.setWidth(k),P.setLineDash(v["line-dasharray"]?Fy(y,"paint","line-dasharray",u,h).map((function(t){return t*k})):null),I.setZIndex(L))}var j=!1,N=null,G=0,D=void 0,z=void 0,U=void 0;if((1==c||2==c)&&"icon-image"in m){var B=Fy(y,"layout","icon-image",u,h);if(B){D="string"==typeof B?Ny(B,r):B.toString();var Y=void 0;if(s&&i&&i[D]){var V=Fy(y,"layout","icon-rotation-alignment",u,h);if(2==c){var q=t.getGeometry();if(q.getFlatMidpoint||q.getFlatMidpoints){var W=q.getExtent();if(Math.sqrt(Math.max(Math.pow((W[2]-W[0])/e,2),Math.pow((W[3]-W[1])/e,2)))>150){var X="MultiLineString"===q.getType()?q.getFlatMidpoints():q.getFlatMidpoint();if(Sy||(Sy=new ey("Point",wy=[NaN,NaN],[],{},null)),Y=Sy,wy[0]=X[0],wy[1]=X[1],"line"===(Lt=Fy(y,"layout","symbol-placement",u,h))&&"map"===V)for(var Z=q.getStride(),K=q.getFlatCoordinates(),H=0,J=K.length-Z;H=rt&&X[0]<=it&&X[1]>=nt&&X[1]<=ot){G=Math.atan2(Q-et,tt-$);break}}}}}if(2!==c||Y){++p,(I=O[p])&&I.getImage()&&!I.getFill()&&!I.getStroke()||(I=O[p]=new cc),I.setGeometry(Y);var at=Fy(y,"layout","icon-size",u,h),st=void 0!==v["icon-color"]?Fy(y,"paint","icon-color",u,h):null,lt=D+"."+at;if(null!==st&&(lt+="."+st),!(z=E[lt])){var ut=i[D];if(null!==st){var ct,ht;(ht=(ct=yy(ut.width,ut.height)).getContext("2d")).drawImage(s,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height);for(var pt=ht.getImageData(0,0,ct.width,ct.height),ft=0,dt=pt.data.length;ft0?new ic({width:_t,color:mt}):void 0,fill:vt?new Uu({color:vt}):void 0})),I.setImage(z),N=I.getText(),I.setText(void 0),I.setGeometry(void 0),I.setZIndex(L),j=!0}var xt=void 0;if("text-field"in m)xt=Ny(Fy(y,"layout","text-field",u,h).toString(),r).trim(),x=Fy(y,"paint","text-opacity",u,h);if(xt&&x&&!U){j||(++p,(I=O[p])&&I.getText()&&!I.getFill()&&!I.getStroke()||(I=O[p]=new cc),I.setImage(void 0),I.setGeometry(void 0)),I.getText()||I.setText(N||new fc({padding:[2,2,2,2]})),N=I.getText();var wt=Math.round(Fy(y,"layout","text-size",u,h)),St=Fy(y,"layout","text-font",u,h),Tt=Fy(y,"layout","text-line-height",u,h),Et=hy()(a?a(St):St,wt,Tt),Ct=m["text-transform"];"uppercase"==Ct?xt=xt.toUpperCase():"lowercase"==Ct&&(xt=xt.toLowerCase());var Ot=Fy(y,"layout","text-max-width",u,h),Pt=Fy(y,"layout","text-letter-spacing",u,h),Rt=2==c?vy(xt,Pt):function t(e,r,n,i){if(-1!==e.indexOf("\n")){for(var o=e.split("\n"),a=[],s=0,l=o.length;s1){var p=_y();p.font=r;var f=p.measureText("M").width*n,d="";for(a=[],s=0,l=h.length;s1;++s){var m=a[s];if(by(m,i)<.35*f){var v=s>0?by(a[s-1],i):1/0,_=s.7*f&&by(x,i)<.6*f){var w=b.split(" "),S=w.pop();by(S,i)<.2*f&&(a[s]=w.join(" "),a[s+1]=S+" "+x),l-=1}}c=a.join("\n")}else c=e;c=vy(c,i),xy[u]=c}return c}(xt,Et,Ot,Pt);N.setText(Rt),N.setFont(Et),N.setRotation(fy(Fy(y,"layout","text-rotate",u,h)));var It=Fy(y,"layout","text-anchor",u,h),Lt=j||1==c?"point":Fy(y,"layout","symbol-placement",u,h);N.setPlacement(Lt);var Mt=Fy(y,"paint","text-halo-width",u,h),Ft=Fy(y,"layout","text-offset",u,h),At=Fy(y,"paint","text-translate",u,h),kt=0,jt=0;if("point"==Lt){var Nt="center";-1!==It.indexOf("left")?(Nt="left",jt=Mt):-1!==It.indexOf("right")&&(Nt="right",jt=-Mt),N.setTextAlign(Nt);var Gt=Fy(y,"layout","text-rotation-alignment",u,h);N.setRotateWithView("map"==Gt)}else N.setMaxAngle(fy(Fy(y,"layout","text-max-angle",u,h))*xt.length/Rt.length),N.setTextAlign(),N.setRotateWithView(!1);var Dt="middle";0==It.indexOf("bottom")?(Dt="bottom",kt=-Mt-.5*(Tt-1)*wt):0==It.indexOf("top")&&(Dt="top",kt=Mt+.5*(Tt-1)*wt),N.setTextBaseline(Dt),N.setOffsetX(Ft[0]*wt+jt+At[0]),N.setOffsetY(Ft[1]*wt+kt+At[1]),T.setColor(ky(Fy(y,"paint","text-color",u,h),x)),N.setFill(T);var zt=ky(Fy(y,"paint","text-halo-color",u,h),x);if(zt){S.setColor(zt),Mt*=2;var Ut=.5*wt;S.setWidth(Mt<=Ut?Mt:Ut),N.setStroke(S)}else N.setStroke(void 0);var Bt=Fy(y,"layout","text-padding",u,h),Yt=N.getPadding();Bt!==Yt[0]&&(Yt[0]=Yt[1]=Yt[2]=Yt[3]=Bt),I.setZIndex(L)}}},y=0,g=o.length;y-1?(O.length=p+1,O):void 0}};return t.setStyle(P),t.set("mapbox-source",h),t.set("mapbox-layers",d),P},Dy=r(6),zy=r.n(Dy),Uy=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function By(t){for(var e=[],r=0,n=t.length;r2?n[2]:""):t+r}function sg(t,e,r,n,i){return new Promise((function(o,a){if("object"!=typeof e&&(e=JSON.parse(e)),8!=e.version)return a(new Error("glStyle version 8 required."));if(!(t instanceof Rd||t instanceof uy))return a(new Error("Can only apply to VectorLayer or VectorTileLayer"));var s,l,u;function c(){u||e.sprite&&!s?u?(t.setStyle(u),o()):a(new Error("Something went wrong trying to apply style.")):(u=Gy(t,e,r,i,s,l,ng),t.getStyle()?o():a(new Error("Nothing to show for source ["+r+"]")))}if(e.sprite){var h=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",p=ag(e.sprite,n,h+".json");fetch(p,{credentials:"same-origin"}).then((function(t){return t.ok||""===h?t:(p=ag(e.sprite,n,".json"),fetch(p,{credentials:"same-origin"}))})).then((function(t){if(t.ok)return t.json();a(new Error("Problem fetching sprite from "+p+": "+t.statusText))})).then((function(t){if(void 0===t||0===Object.keys(t).length)return a(new Error("No sprites found."));s=t,l=ag(e.sprite,n,h+".png"),c()})).catch((function(t){a(new Error("Sprites cannot be loaded: "+p+": "+t.message))}))}else c()}))}new Jy;var lg=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function ug(t){return 0!==t.indexOf("mapbox://")?"":t.slice("mapbox://".length)}var cg=function(t){function e(e){var r=t.call(this,L)||this;return r.error=e,r}return lg(e,t),e}(c),hg="vector",pg=function(t){function e(e){var r=this,n=!("declutter"in e)||e.declutter,i=new df({state:Oi,format:new sy});return(r=t.call(this,{source:i,declutter:n,className:e.className,opacity:e.opacity,visible:e.visible,zIndex:e.zIndex,minResolution:e.minResolution,maxResolution:e.maxResolution,minZoom:e.minZoom,maxZoom:e.maxZoom,renderOrder:e.renderOrder,renderBuffer:e.renderBuffer,renderMode:e.renderMode,map:e.map,updateWhileAnimating:e.updateWhileAnimating,updateWhileInteracting:e.updateWhileInteracting,preload:e.preload,useInterimTilesOnError:e.useInterimTilesOnError})||this).sourceId=e.source,r.layers=e.layers,r.accessToken=e.accessToken,r.fetchStyle(e.styleUrl),r}return lg(e,t),e.prototype.fetchStyle=function(t){var e=this,r=function(t,e){var r=ug(t);if(!r)return t;if(0!==r.indexOf("styles/"))throw new Error("unexpected style url: "+t);return"https://api.mapbox.com/styles/v1/"+r.slice("styles/".length)+"?&access_token="+e}(t,this.accessToken);fetch(r).then((function(t){if(!t.ok)throw new Error("unexpected response when fetching style: "+t.status);return t.json()})).then((function(t){e.onStyleLoad(t)})).catch((function(t){e.handleError(t)}))},e.prototype.onStyleLoad=function(t){var e,r,n=this;if(this.layers){for(var i={},o=0;o0){this.source_&&(this.source_.clear(),this.source_.addFeatures(u)),this.dispatchEvent(new mg(gg,t,u,i));break}}},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[q(e,G,this.handleDrop,this),q(e,j,this.handleStop,this),q(e,N,this.handleStop,this),q(e,G,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(X),this.dropListenKeys_=null)},e.prototype.handleDrop=function(t){for(var e=t.dataTransfer.files,r=0,n=e.length;r1?1:-1;return e.endInteraction(this.duration_,r),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!bs(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},e}(ss),xg=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wg=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 xg(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=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||ie(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=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===Jo.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===Jo.POINTERDOWN?n=!1:r?(n=e.type===Jo.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.preventDefault()):("mouse"==e.originalEvent.pointerType||e.type===Jo.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===Jo.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),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new Ho(Jo.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;this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t);var r=this.mode_===Pg;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||r?this.finishDrawing():this.atFinish_(t)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate):(this.startDrawing_(t),this.mode_===Eg&&this.finishDrawing()),e=!1):this.freehand_&&this.abortDrawing(),!e&&this.stopClick_&&t.stopPropagation(),e},e.prototype.handlePointerMove_=function(t){if(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):this.createOrUpdateSketchPoint_(t)},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var r=!1,n=[this.finishCoordinate_];if(this.mode_===Cg)r=this.sketchCoords_.length>this.minPoints_;else if(this.mode_===Og){var i=this.sketchCoords_;r=i[0].length>this.minPoints_,n=[i[0][0],i[0][i[0].length-2]]}if(r)for(var o=t.map,a=0,s=n.length;a=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),this.geometryFunction_(r,n,i)):this.mode_===Og&&((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.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===Cg?((t=this.sketchCoords_).splice(-2,1),this.geometryFunction_(t,e,r),t.length>=2&&(this.finishCoordinate_=t[t.length-2].slice())):this.mode_===Og&&((t=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,r)),0===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_===Cg?(e.pop(),this.geometryFunction_(e,r,n)):this.mode_===Og&&(e[0].pop(),this.geometryFunction_(e,r,n),e=r.getCoordinates()),this.type_===gt.MULTI_POINT?t.setGeometry(new Xd([e])):this.type_===gt.MULTI_LINE_STRING?t.setGeometry(new qd([e])):this.type_===gt.MULTI_POLYGON&&t.setGeometry(new Hd([e])),this.dispatchEvent(new Mg(Ig,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 Mg(Lg,t))},e.prototype.appendCoordinates=function(t){var e=this.mode_,r=[];e===Cg?r=this.sketchCoords_:e===Og&&(r=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]);for(var n=r.pop(),i=0;ih?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(An(t)):e.setGeometry(void 0):(e=new ht(t?An(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 ht(new yn(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.originalEvent||!this.condition_(e)||(e.type!=Jo.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_=Gg(o(i)):null!==a?this.pointerHandler_=Dg(o([a,n[1]]),o([a,n[3]])):null!==s&&(this.pointerHandler_=Dg(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_=Gg(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!==oe(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 kr(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 jg(this.extent_))},e}(ss),Ug=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Bg=[0,0,0,0],Yg=[],Vg="modifystart",qg="modifyend",Wg=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.features=r,i.mapBrowserEvent=n,i}return Ug(e,t),e}(c);function Xg(t,e){return t.index-e.index}function Zg(t,e,r){var n=e.geometry;if(n.getType()===gt.CIRCLE){var i=n;if(1===e.index){var o=Mr();o&&(i=i.clone().transform(o,r));var a=sr(i.getCenter(),Ar(t,r)),s=Math.sqrt(a)-i.getRadius();return s*s}}var l=Ar(t,r);return Yg[0]=Ar(e.segment[0],r),Yg[1]=Ar(e.segment[1],r),ur(l,Yg)}function Kg(t,e,r){var n=e.geometry;if(n.getType()===gt.CIRCLE&&1===e.index){var i=n,o=Mr();return o&&(i=i.clone().transform(o,r)),Fr(i.getClosestPoint(Ar(t,r)),r)}var a=Ar(t,r);return Yg[0]=Ar(e.segment[0],r),Yg[1]=Ar(e.segment[1],r),Fr(er(a,Yg),r)}var Hg=function(t){function e(e){var r,n,i=t.call(this,e)||this;if(i.boundHandleFeatureChange_=i.handleFeatureChange_.bind(i),i.condition_=e.condition?e.condition:xs,i.defaultDeleteCondition_=function(t){return us(t)&&gs(t)},i.deleteCondition_=e.deleteCondition?e.deleteCondition:i.defaultDeleteCondition_,i.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:fs,i.vertexFeature_=null,i.vertexSegments_=null,i.lastPixel_=[0,0],i.ignoreNextSingleClick_=!1,i.modified_=!1,i.rBush_=new oh,i.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,i.snappedToVertex_=!1,i.changingFeature_=!1,i.dragSegments_=[],i.overlay_=new Rd({source:new ph({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(r=lc(),function(t,e){return r[gt.POINT]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),i.SEGMENT_WRITERS_={Point:i.writePointGeometry_.bind(i),LineString:i.writeLineStringGeometry_.bind(i),LinearRing:i.writeLineStringGeometry_.bind(i),Polygon:i.writePolygonGeometry_.bind(i),MultiPoint:i.writeMultiPointGeometry_.bind(i),MultiLineString:i.writeMultiLineStringGeometry_.bind(i),MultiPolygon:i.writeMultiPolygonGeometry_.bind(i),Circle:i.writeCircleGeometry_.bind(i),GeometryCollection:i.writeGeometryCollectionGeometry_.bind(i)},i.source_=null,e.source?(i.source_=e.source,n=new lt(i.source_.getFeatures()),i.source_.addEventListener(ah,i.handleSourceAdd_.bind(i)),i.source_.addEventListener(uh,i.handleSourceRemove_.bind(i))):n=e.features,!n)throw new Error("The modify interaction requires features or a source");return i.features_=n,i.features_.forEach(i.addFeature_.bind(i)),i.features_.addEventListener(nt,i.handleFeatureAdd_.bind(i)),i.features_.addEventListener(it,i.handleFeatureRemove_.bind(i)),i.lastPointerEvent_=null,i}return Ug(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(I,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t){this.modified_||(this.modified_=!0,this.dispatchEvent(new Wg(Vg,this.features_,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(I,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=0;--g)this.insertVertex_.apply(this,i[g])}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()===gt.CIRCLE){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(Ht(i),o);var s=n,l=Mr();if(l){var u=t.map.getView().getProjection();s=kn(s=s.clone().transform(l,u)).transform(u,l)}this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(Dt(r.segment),r)}return this.modified_&&(this.dispatchEvent(new Wg(qg,this.features_,t)),this.modified_=!1),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,r){var n=r||e.getCoordinateFromPixel(t),i=e.getView().getProjection(),a=kr(zt(jr(Ht(n,Bg),i),e.getView().getResolution()*this.pixelTolerance_,Bg),i),s=this.rBush_.getInExtent(a);if(s.length>0){s.sort((function(t,e){return Zg(n,t,i)-Zg(n,e,i)}));var l=s[0],u=l.segment,c=Kg(n,l,i),h=e.getPixelFromCoordinate(c),p=lr(t,h);if(p<=this.pixelTolerance_){var f={};if(l.geometry.getType()===gt.CIRCLE&&1===l.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(c);else{var d=e.getPixelFromCoordinate(u[0]),y=e.getPixelFromCoordinate(u[1]),g=sr(h,d),m=sr(h,y);p=Math.sqrt(Math.min(g,m)),this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(c=g>m?u[1]:u[0]),this.createOrUpdateVertexFeature_(c);for(var v=1,_=s.length;v<_;++v){var b=s[v].segment;if(!(ir(u[0],b[0])&&ir(u[1],b[1])||ir(u[0],b[1])&&ir(u[1],b[0])))break;f[o(b)]=!0}}return f[o(u)]=!0,void(this.vertexSegments_=f)}}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=0;--i)h=o((c=(r=p[i])[0]).feature),c.depth&&(h+="-"+c.depth.join("-")),h in f||(f[h]={}),0===r[1]?(f[h].right=c,f[h].index=c.index):1==r[1]&&(f[h].left=c,f[h].index=c.index+1);for(h in f){switch(u=f[h].right,s=f[h].left,(l=(a=f[h].index)-1)<0&&(l=0),t=e=(n=(c=void 0!==s?s:u).geometry).getCoordinates(),d=!1,n.getType()){case gt.MULTI_LINE_STRING:e[c.depth[0]].length>2&&(e[c.depth[0]].splice(a,1),d=!0);break;case gt.LINE_STRING:e.length>2&&(e.splice(a,1),d=!0);break;case gt.MULTI_POLYGON:t=t[c.depth[1]];case gt.POLYGON:(t=t[c.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_(n,e);var y=[];if(void 0!==s&&(this.rBush_.remove(s),y.push(s.segment[0])),void 0!==u&&(this.rBush_.remove(u),y.push(u.segment[1])),void 0!==s&&void 0!==u){var g={depth:c.depth,feature:c.feature,geometry:c.geometry,index:l,segment:y};this.rBush_.insert(Dt(g.segment),g)}this.updateSegmentIndices_(n,a,c.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||_(i.depth,r))&&i.index>e&&(i.index+=n)}))},e}(ss),Jg=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$g="select",Qg=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 Jg(e,t),e}(c),tm={};var em=function(t){function e(e){var r,n,i=t.call(this)||this,o=e||{};if(i.boundAddFeature_=i.addFeature_.bind(i),i.boundRemoveFeature_=i.removeFeature_.bind(i),i.condition_=o.condition?o.condition:gs,i.addCondition_=o.addCondition?o.addCondition:ys,i.removeCondition_=o.removeCondition?o.removeCondition:ys,i.toggleCondition_=o.toggleCondition?o.toggleCondition:vs,i.multi_=!!o.multi&&o.multi,i.filter_=o.filter?o.filter:x,i.hitTolerance_=o.hitTolerance?o.hitTolerance:0,i.style_=void 0!==o.style?o.style:(m((r=lc())[gt.POLYGON],r[gt.LINE_STRING]),m(r[gt.GEOMETRY_COLLECTION],r[gt.LINE_STRING]),function(t){return t.getGeometry()?r[t.getGeometry().getType()]:null}),i.features_=o.features||new lt,o.layers)if("function"==typeof o.layers)n=o.layers;else{var a=o.layers;n=function(t){return d(a,t)}}else n=x;return i.layerFilter_=n,i.featureLayerAssociation_={},i}return Jg(e,t),e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[o(t)]=e},e.prototype.getFeatures=function(){return this.features_},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[o(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(nt,this.boundAddFeature_),this.features_.addEventListener(it,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(nt,this.boundAddFeature_),this.features_.removeEventListener(it,this.boundRemoveFeature_))},e.prototype.addFeature_=function(t){var e=t.element;this.style_&&this.applySelectedStyle_(e)},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=o(t);e in tm||(tm[e]=t.getStyle()),t.setStyle(this.style_)},e.prototype.restorePreviousStyle_=function(t){var r=o(t),n=this.getMap().getInteractions().getArray().filter((function(r){return r instanceof e&&r.getStyle()&&-1!==r.getFeatures().getArray().indexOf(t)}));n.length>0?t.setStyle(n[n.length-1].getStyle()):(t.setStyle(tm[r]),delete tm[r])},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[o(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){E(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return l.push(t),this.addFeatureLayerAssociation_(t,e),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var u=a.getLength()-1;u>=0;--u){var c=a.item(u),h=l.indexOf(c);h>-1?l.splice(h,1):(a.remove(c),s.push(c))}0!==l.length&&a.extend(l)}else{o.forEachFeatureAtPixel(t.pixel,function(t,i){if(this.filter_(t,i))return!e&&!n||d(a.getArray(),t)?(r||n)&&d(a.getArray(),t)&&(s.push(t),this.removeFeatureLayerAssociation_(t)):(l.push(t),this.addFeatureLayerAssociation_(t,i)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var p=s.length-1;p>=0;--p)a.remove(s[p]);a.extend(l)}return(l.length>0||s.length>0)&&this.dispatchEvent(new Qg($g,l,s,t)),!0},e}(rs),rm=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function nm(t){return t.feature?t.feature:t.element?t.element:void 0}var im=[],om=function(t){function e(e){var r=this,n=e||{},i=n;return i.handleDownEvent||(i.handleDownEvent=x),i.stopDown||(i.stopDown=w),(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 oh,r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r)},r}return rm(e,t),e.prototype.addFeature=function(t,e){var r=void 0===e||e,n=o(t),i=t.getGeometry();if(i){var a=this.SEGMENT_WRITERS_[i.getType()];a&&(this.indexedFeaturesExtents_[n]=i.getExtent([1/0,1/0,-1/0,-1/0]),a(t,i))}r&&(this.featureChangeListenerKeys_[n]=q(t,I,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.snapped&&(e.coordinate=r.vertex.slice(0,2),e.pixel=r.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=nm(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=nm(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var r=o(e);r in this.pendingFeatures_||(this.pendingFeatures_[r]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=C(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var r=void 0===e||e,n=o(t),i=this.indexedFeaturesExtents_[n];if(i){var a=this.rBush_,s=[];a.forEachInExtent(i,(function(e){t===e.feature&&s.push(e)}));for(var l=s.length-1;l>=0;--l)a.remove(s[l])}r&&(X(this.featureChangeListenerKeys_[n]),delete this.featureChangeListenerKeys_[n])},e.prototype.setMap=function(e){var r=this.getMap(),n=this.featuresListenerKeys_,i=this.getFeatures_();r&&(n.forEach(X),n.length=0,i.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?n.push(q(this.features_,nt,this.handleFeatureAdd_,this),q(this.features_,it,this.handleFeatureRemove_,this)):this.source_&&n.push(q(this.source_,ah,this.handleFeatureAdd_,this),q(this.source_,uh,this.handleFeatureRemove_,this)),i.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,r){var n=Dt([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);this.vertex_&&!this.edge_&&(i=i.filter((function(t){return t.feature.getGeometry().getType()!==gt.CIRCLE})));var o=!1,a=null,s=null;if(0===i.length)return{snapped:o,vertex:a,vertexPixel:s};for(var l,u=r.getView().getProjection(),c=Ar(e,u),h=1/0,p=0;p_?y[1]:y[0],s=r.getPixelFromCoordinate(a))}else if(this.edge_){var b=l.feature.getGeometry().getType()===gt.CIRCLE;if(b){var x=l.feature.getGeometry(),w=Mr();w&&(x=x.clone().transform(w,u)),a=Fr(function(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]}(c,x),u)}else im[0]=Ar(y[0],u),im[1]=Ar(y[1],u),a=Fr(er(c,im),u);if(lr(t,s=r.getPixelFromCoordinate(a))<=this.pixelTolerance_&&(o=!0,this.vertex_&&!b)){g=r.getPixelFromCoordinate(y[0]),m=r.getPixelFromCoordinate(y[1]),v=sr(s,g),_=sr(s,m);Math.sqrt(Math.min(v,_))<=this.pixelTolerance_&&(a=v>_?y[1]:y[0],s=r.getPixelFromCoordinate(a))}}return o&&(s=[Math.round(s[0]),Math.round(s[1])]),{snapped:o,vertex:a,vertexPixel:s}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){var r=this.getMap().getView().getProjection(),n=e,i=Mr();i&&(n=n.clone().transform(i,r));var o=kn(n);i&&o.transform(r,i);for(var a=o.getCoordinates()[0],s=0,l=a.length-1;s=0;r--){var u=o[r][0];if(Vt(new fn(u).getExtent(),new fn(s).getExtent())){o[r].push(s),l=!0;break}}l||o.push([s.reverse()])}return o}(o.rings,a);1===s.length?(i=gt.POLYGON,t=T({},t,((r={}).rings=s[0],r))):(i=gt.MULTI_POLYGON,t=T({},t,((n={}).rings=s,n)))}return Bd((0,fm[i])(t),!1,e)}function gm(t){var e=pt;return!0===t.hasZ&&!0===t.hasM?e=yt:!0===t.hasZ?e=ft:!0===t.hasM&&(e=dt),e}function mm(t){var e=t.getLayout();return{hasZ:e===ft||e===yt,hasM:e===dt||e===yt}}function vm(t,e){return(0,dm[t.getType()])(Bd(t,!0,e),e)}dm[gt.POINT]=function(t,e){var r,n=t.getCoordinates(),i=t.getLayout();i===ft?r={x:n[0],y:n[1],z:n[2]}:i===dt?r={x:n[0],y:n[1],m:n[2]}:i===yt?r={x:n[0],y:n[1],z:n[2],m:n[3]}:i===pt?r={x:n[0],y:n[1]}:ut(!1,34);return r},dm[gt.LINE_STRING]=function(t,e){var r=mm(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:[t.getCoordinates()]}},dm[gt.POLYGON]=function(t,e){var r=mm(t);return{hasZ:r.hasZ,hasM:r.hasM,rings:t.getCoordinates(!1)}},dm[gt.MULTI_POINT]=function(t,e){var r=mm(t);return{hasZ:r.hasZ,hasM:r.hasM,points:t.getCoordinates()}},dm[gt.MULTI_LINE_STRING]=function(t,e){var r=mm(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:t.getCoordinates()}},dm[gt.MULTI_POLYGON]=function(t,e){for(var r=mm(t),n=t.getCoordinates(!1),i=[],o=0;o=0;a--)i.push(n[o][a]);return{hasZ:r.hasZ,hasM:r.hasM,rings:i}};var _m=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this)||this).geometryName_=n.geometryName,r}return pm(e,t),e.prototype.readFeatureFromObject=function(t,e,r){var n=t,i=ym(n.geometry,e),o=new ht;if(this.geometryName_&&o.setGeometryName(this.geometryName_),o.setGeometry(i),n.attributes){o.setProperties(n.attributes,!0);var a=n.attributes[r];void 0!==a&&o.setId(a)}return o},e.prototype.readFeaturesFromObject=function(t,e){var r=e||{};if(t.features){for(var n=[],i=t.features,o=0,a=i.length;o0?r[0]:null},e.prototype.readFeatureFromNode=function(t,e){return null},e.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var r=Xl(t);return this.readFeaturesFromDocument(r,e)}return Wl(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var r=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&m(r,this.readFeaturesFromNode(n,e));return r},e.prototype.readFeaturesFromNode=function(t,e){return n()},e.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var r=Xl(t);return this.readGeometryFromDocument(r,e)}return Wl(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},e.prototype.readGeometryFromDocument=function(t,e){return null},e.prototype.readGeometryFromNode=function(t,e){return null},e.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=Xl(t);return this.readProjectionFromDocument(e)}return Wl(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},e.prototype.readProjectionFromDocument=function(t){return this.dataProjection},e.prototype.readProjectionFromNode=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){var r=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeatureNode=function(t,e){return null},e.prototype.writeFeatures=function(t,e){var r=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeaturesNode=function(t,e){return null},e.prototype.writeGeometry=function(t,e){var r=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeGeometryNode=function(t,e){return null},e}(Ud),wm=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Sm="http://www.opengis.net/gml",Tm=/^[\s\xa0]*$/,Em=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.featureType=n.featureType,r.featureNS=n.featureNS,r.srsName=n.srsName,r.schemaLocation="",r.FEATURE_COLLECTION_PARSERS={},r.FEATURE_COLLECTION_PARSERS[r.namespace]={featureMember:Kl(r.readFeaturesInternal),featureMembers:Hl(r.readFeaturesInternal)},r}return wm(e,t),e.prototype.readFeaturesInternal=function(t,e){var r=t.localName,n=null;if("FeatureCollection"==r)n=au([],this.FEATURE_COLLECTION_PARSERS,t,e,this);else if("featureMembers"==r||"featureMember"==r||"member"==r){var i=e[0],o=i.featureType,a=i.featureNS;if(!o&&t.childNodes){o=[],a={};for(var s=0,l=t.childNodes.length;s0){i[s]={_content_:i[s]};for(var u=0;u0:h===gt.POINT||h===gt.MULTI_POINT}}s&&(l=o.get("name"),(s=s&&!!l)&&l.search(/&[^&]+;/)>-1&&(g_||(g_=document.createElement("textarea")),g_.innerHTML=l,l=g_.value));var p=r;if(t?p=t:e&&(p=function t(e,r,n){return Array.isArray(e)?e:"string"==typeof e?(!(e in n)&&"#"+e in n&&(e="#"+e),t(n[e],r,n)):r}(e,r,n)),s){var f=function(t,e){var r=[0,0],n="start",i=t.getImage();if(i){var o=i.getImageSize();if(null===o&&(o=zv),2==o.length){var a=i.getScaleArray();r[0]=a[0]*o[0]/2,r[1]=-a[1]*o[1]/2,n="left"}}var s=t.getText();s?((s=s.clone()).setFont(s.getFont()||d_.getFont()),s.setScale(s.getScale()||d_.getScale()),s.setFill(s.getFill()||d_.getFill()),s.setStroke(s.getStroke()||p_)):s=d_.clone();return s.setText(e),s.setOffsetX(r[0]),s.setOffsetY(r[1]),s.setTextAlign(n),new cc({image:i,text:s})}(p[0],l);return u.length>0?(f.setGeometry(new Yy(u)),[f,new cc({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=W_.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=T_.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(!d(e_,t.namespaceURI))return null;var r=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return r||null},e.prototype.readFeaturesFromNode=function(t,e){if(!d(e_,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&&m(r,a)}return r}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=Xl(t);return this.readNameFromDocument(e)}return Wl(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(d(e_,e.namespaceURI)&&"name"==e.localName)return Am(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var r=e.localName;if(d(e_,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=Xl(t);m(e,this.readNetworkLinksFromDocument(r))}else Wl(t)?m(e,this.readNetworkLinksFromDocument(t)):m(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&&m(e,this.readNetworkLinksFromNode(r));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(d(e_,r.namespaceURI)&&"NetworkLink"==r.localName){var n=au({},i_,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!d(e_,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||m(e,this.readNetworkLinksFromNode(r))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var r=Xl(t);m(e,this.readRegionFromDocument(r))}else Wl(t)?m(e,this.readRegionFromDocument(t)):m(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&&m(e,this.readRegionFromNode(r));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(d(e_,r.namespaceURI)&&"Region"==r.localName){var n=au({},a_,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!d(e_,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||m(e,this.readRegionFromNode(r))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=Vl(e_[4],"kml"),n="http://www.w3.org/2000/xmlns/";r.setAttributeNS(n,"xmlns:gx",t_[0]),r.setAttributeNS(n,"xmlns:xsi",Yl),r.setAttributeNS(Yl,"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=s_[r.namespaceURI],s=nu(o,a);return lu(i,l_,ru,s,[e],a,this),r},e}(xm);function __(t){var e=ql(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 b_(t){for(var e,r=ql(t,!1),n=[],i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i;e=i.exec(r);){var o=parseFloat(e[1]),a=parseFloat(e[2]),s=e[3]?parseFloat(e[3]):0;n.push(o,a,s),r=r.substr(e[0].length)}if(""===r)return n}function x_(t){var e=ql(t,!1).trim(),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function w_(t){return Im(t)}var S_=iu(e_,{Pair:function(t,e){var r=au({},$_,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 T_(t,e){return au(void 0,S_,t,e,this)}var E_=iu(e_,{Icon:$l((function(t,e){var r=au({},A_,t,e);return r||null})),color:$l(__),heading:$l(Im),hotSpot:$l((function(t){var e,r=t.getAttribute("xunits"),n=t.getAttribute("yunits");return e="insetPixels"!==r?"insetPixels"!==n?Vu:Wu:"insetPixels"!==n?qu:Xu,{x:parseFloat(t.getAttribute("x")),xunits:r_[r],y:parseFloat(t.getAttribute("y")),yunits:r_[n],origin:e}})),scale:$l(w_)});var C_=iu(e_,{color:$l(__),scale:$l(w_)});var O_=iu(e_,{color:$l(__),width:$l(Im)});var P_=iu(e_,{color:$l(__),fill:$l(Om),outline:$l(Om)});var R_=iu(e_,{coordinates:Hl(b_)});function I_(t,e){return au(null,R_,t,e)}var L_=iu(t_,{Track:Kl(F_)});var M_=iu(e_,{when:function(t,e){var r=e[e.length-1].whens,n=ql(t,!1),i=Date.parse(n);r.push(isNaN(i)?0:i)}},iu(t_,{coord:function(t,e){var r=e[e.length-1].flatCoordinates,n=ql(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,0)}else r.push(0,0,0,0)}}));function F_(t,e){var r=au({flatCoordinates:[],whens:[]},M_,t,e);if(r){for(var n=r.flatCoordinates,i=r.whens,o=0,a=Math.min(n.length,i.length);o0,c=l.href;c?n=c:u&&(n=Uv);var h,p=Vu,f=r.hotSpot;f?(i=[f.x,f.y],o=f.xunits,a=f.yunits,p=f.origin):n===Uv?(i=Nv,o=Gv,a=Dv):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(n)&&(i=[.5,0],o=Bu,a=Bu);var d,y=l.x,g=l.y;void 0!==y&&void 0!==g&&(h=[y,g]);var m,v=l.w,_=l.h;void 0!==v&&void 0!==_&&(d=[v,_]);var b=r.heading;void 0!==b&&(m=Pe(b));var x=r.scale,w=r.color;if(u){n==Uv&&(d=zv,void 0===x&&(x=Bv));var S=new nc({anchor:i,anchorOrigin:p,anchorXUnits:o,anchorYUnits:a,crossOrigin:this.crossOrigin_,offset:h,offsetOrigin:Vu,rotation:m,scale:x,size:d,src:n,color:w});s.imageStyle=S}else s.imageStyle=c_}},LabelStyle:function(t,e){var r=au({},C_,t,e);if(r){var n=e[e.length-1],i=new fc({fill:new Uu({color:"color"in r?r.color:jv}),scale:r.scale});n.textStyle=i}},LineStyle:function(t,e){var r=au({},O_,t,e);if(r){var n=e[e.length-1],i=new ic({color:"color"in r?r.color:jv,width:"width"in r?r.width:1});n.strokeStyle=i}},PolyStyle:function(t,e){var r=au({},P_,t,e);if(r){var n=e[e.length-1],i=new Uu({color:"color"in r?r.color:jv});n.fillStyle=i;var o=r.fill;void 0!==o&&(n.fill=o);var a=r.outline;void 0!==a&&(n.outline=a)}}});function W_(t,e){var r=au({},q_,t,e,this);if(!r)return null;var n,i="fillStyle"in r?r.fillStyle:u_,o=r.fill;void 0===o||o||(i=null),"imageStyle"in r?r.imageStyle!=c_&&(n=r.imageStyle):n=h_;var a="textStyle"in r?r.textStyle:d_,s="strokeStyle"in r?r.strokeStyle:f_,l=r.outline;return void 0===l||l?[new cc({fill:i,image:n,stroke:s,text:a,zIndex:void 0})]:[new cc({geometry:function(t){var e=t.getGeometry(),r=e.getType();return r===gt.GEOMETRY_COLLECTION?new Yy(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e!==gt.POLYGON&&e!==gt.MULTI_POLYGON}))):r!==gt.POLYGON&&r!==gt.MULTI_POLYGON?e:void 0},fill:i,image:n,stroke:s,text:a,zIndex:void 0}),new cc({geometry:function(t){var e=t.getGeometry(),r=e.getType();return r===gt.GEOMETRY_COLLECTION?new Yy(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===gt.POLYGON||e===gt.MULTI_POLYGON}))):r===gt.POLYGON||r===gt.MULTI_POLYGON?e:void 0},fill:i,stroke:null,zIndex:void 0})]}function X_(t,e){var r,n,i,o=e.length,a=new Array(e.length),s=new Array(e.length),l=new Array(e.length);r=!1,n=!1,i=!1;for(var u=0;u0){var m=nu(i,a);lu(n,Pb,Ib,[{names:a,values:m}],r)}var v=r[0],_=e.getGeometry();_&&(_=Bd(_,!0,v)),lu(n,Pb,_b,[_],r)}var Mb=iu(e_,["extrude","tessellate","altitudeMode","coordinates"]),Fb=iu(e_,{extrude:Ql(km),tessellate:Ql(km),altitudeMode:Ql(Gm),coordinates:Ql((function(t,e,r){var n,i=r[r.length-1],o=i.layout,a=i.stride;o==pt||o==dt?n=2:o==ft||o==yt?n=3:ut(!1,34);var s=e.length,l="";if(s>0){l+=e[0];for(var u=1;u>1):i>>1}return e}(t),i=0,o=n.length;i=32;)e=63+(32|31&t),r+=String.fromCharCode(e),t>>=5;return e=t+63,r+=String.fromCharCode(e)}var ax=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=gr("EPSG:4326"),r.factor_=n.factor?n.factor:1e5,r.geometryLayout_=n.geometryLayout?n.geometryLayout:pt,r}return tx(e,t),e.prototype.readFeatureFromText=function(t,e){var r=this.readGeometryFromText(t,e);return new ht(r)},e.prototype.readFeaturesFromText=function(t,e){return[this.readFeatureFromText(t,e)]},e.prototype.readGeometryFromText=function(t,e){var r=qr(this.geometryLayout_),n=rx(t,r,this.factor_);Qb(n,0,n.length,r,n);var i=sn(n,0,n.length,r);return Bd(new Od(i,this.geometryLayout_),!1,this.adaptOptions(e))},e.prototype.writeFeatureText=function(t,e){var r=t.getGeometry();return r?this.writeGeometryText(r,e):(ut(!1,40),"")},e.prototype.writeFeaturesText=function(t,e){return this.writeFeatureText(t[0],e)},e.prototype.writeGeometryText=function(t,e){var r=(t=Bd(t,!0,this.adaptOptions(e))).getFlatCoordinates(),n=t.getStride();return Qb(r,0,r.length,n,r),ex(r,n,this.factor_)},e}(Yv),sx=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),lx=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.layerName_=n.layerName,r.layers_=n.layers?n.layers:null,r.dataProjection=gr(n.dataProjection?n.dataProjection:"EPSG:4326"),r}return sx(e,t),e.prototype.readFeaturesFromObject=function(t,e){if("Topology"==t.type){var r=t,n=void 0,i=null,o=null;r.transform&&(i=(n=r.transform).scale,o=n.translate);var a=r.arcs;n&&function(t,e,r){for(var n=0,i=t.length;n0&&i.pop(),n=r>=0?e[r]:e[~r].slice().reverse(),i.push.apply(i,n);for(var s=0,l=i.length;s=2,57),n}return mx(e,t),e}(gx),_x=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bx=function(t){function e(e){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return _x(e,t),e}(vx),xx=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wx=function(t){function e(e,r,n){var i=t.call(this,"BBOX")||this;if(i.geometryName=e,i.extent=r,4!==r.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return i.srsName=n,i}return xx(e,t),e}(gx),Sx=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tx=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.geometryName=r||"the_geom",o.geometry=n,o.srsName=i,o}return Sx(e,t),e}(gx),Ex=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cx=function(t){function e(e,r,n){return t.call(this,"Contains",e,r,n)||this}return Ex(e,t),e}(Tx),Ox=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Px=function(t){function e(e,r,n){return t.call(this,"Disjoint",e,r,n)||this}return Ox(e,t),e}(Tx),Rx=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ix=function(t){function e(e,r){var n=t.call(this,e)||this;return n.propertyName=r,n}return Rx(e,t),e}(gx),Lx=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mx=function(t){function e(e,r,n){var i=t.call(this,"During",e)||this;return i.begin=r,i.end=n,i}return Lx(e,t),e}(Ix),Fx=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ax=function(t){function e(e,r,n,i){var o=t.call(this,e,r)||this;return o.expression=n,o.matchCase=i,o}return Fx(e,t),e}(Ix),kx=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),jx=function(t){function e(e,r,n){return t.call(this,"PropertyIsEqualTo",e,r,n)||this}return kx(e,t),e}(Ax),Nx=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gx=function(t){function e(e,r){return t.call(this,"PropertyIsGreaterThan",e,r)||this}return Nx(e,t),e}(Ax),Dx=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zx=function(t){function e(e,r){return t.call(this,"PropertyIsGreaterThanOrEqualTo",e,r)||this}return Dx(e,t),e}(Ax),Ux=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Bx=function(t){function e(e,r,n){return t.call(this,"Intersects",e,r,n)||this}return Ux(e,t),e}(Tx),Yx=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vx=function(t){function e(e,r,n){var i=t.call(this,"PropertyIsBetween",e)||this;return i.lowerBoundary=r,i.upperBoundary=n,i}return Yx(e,t),e}(Ix),qx=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wx=function(t){function e(e,r,n,i,o,a){var s=t.call(this,"PropertyIsLike",e)||this;return s.pattern=r,s.wildCard=void 0!==n?n:"*",s.singleChar=void 0!==i?i:".",s.escapeChar=void 0!==o?o:"!",s.matchCase=a,s}return qx(e,t),e}(Ix),Xx=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zx=function(t){function e(e){return t.call(this,"PropertyIsNull",e)||this}return Xx(e,t),e}(Ix),Kx=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hx=function(t){function e(e,r){return t.call(this,"PropertyIsLessThan",e,r)||this}return Kx(e,t),e}(Ax),Jx=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$x=function(t){function e(e,r){return t.call(this,"PropertyIsLessThanOrEqualTo",e,r)||this}return Jx(e,t),e}(Ax),Qx=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tw=function(t){function e(e){var r=t.call(this,"Not")||this;return r.condition=e,r}return Qx(e,t),e}(gx),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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rw=function(t){function e(e,r,n){return t.call(this,"PropertyIsNotEqualTo",e,r,n)||this}return ew(e,t),e}(Ax),nw=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),iw=function(t){function e(e){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}return nw(e,t),e}(vx),ow=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),aw=(function(t){function e(e){var r=t.call(this,"ResourceId")||this;return r.rid=e,r}ow(e,t)}(gx),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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}()),sw=function(t){function e(e,r,n){return t.call(this,"Within",e,r,n)||this}return aw(e,t),e}(Tx);function lw(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(bx,e))}function uw(t,e,r){return new wx(t,e,r)}var cw=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hw={"http://www.opengis.net/gml":{boundedBy:$l(Cm.prototype.readGeometryElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:Kl(Cm.prototype.readFeaturesInternal)}},pw={"http://www.opengis.net/wfs":{totalInserted:$l(Mm),totalUpdated:$l(Mm),totalDeleted:$l(Mm)},"http://www.opengis.net/wfs/2.0":{totalInserted:$l(Mm),totalUpdated:$l(Mm),totalDeleted:$l(Mm)}},fw={"http://www.opengis.net/wfs":{TransactionSummary:$l(Tw,"transactionSummary"),InsertResults:$l(Pw,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:$l(Tw,"transactionSummary"),InsertResults:$l(Pw,"insertIds")}},dw={"http://www.opengis.net/wfs":{PropertyName:Ql(Gm)},"http://www.opengis.net/wfs/2.0":{PropertyName:Ql(Gm)}},yw={"http://www.opengis.net/wfs":{Insert:Ql(Rw),Update:Ql(Fw),Delete:Ql(Mw),Property:Ql(Aw),Native:Ql(kw)},"http://www.opengis.net/wfs/2.0":{Insert:Ql(Rw),Update:Ql(Fw),Delete:Ql(Mw),Property:Ql(Aw),Native:Ql(kw)}},gw="http://www.w3.org/2000/xmlns/",mw={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},vw={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},_w={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},bw={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},xw={"2.0.0":Jm,"1.1.0":Wm,"1.0.0":Bm},ww=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.version_=n.version?n.version:"1.1.0",r.featureType_=n.featureType,r.featureNS_=n.featureNS,r.gmlFormat_=n.gmlFormat?n.gmlFormat:new xw[r.version_],r.schemaLocation_=n.schemaLocation?n.schemaLocation:bw[r.version_],r}return cw(e,t),e.prototype.getFeatureType=function(){return this.featureType_},e.prototype.setFeatureType=function(t){this.featureType_=t},e.prototype.readFeaturesFromNode=function(t,e){var r={node:t};T(r,{featureType:this.featureType_,featureNS:this.featureNS_}),T(r,this.getReadOptions(t,e||{}));var n=[r],i=au([],"2.0.0"===this.version_?hw:this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,n,this.gmlFormat_);return i||(i=[]),i},e.prototype.readTransactionResponse=function(t){if(t){if("string"==typeof t){var e=Xl(t);return this.readTransactionResponseFromDocument(e)}return Wl(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}},e.prototype.readFeatureCollectionMetadata=function(t){if(t){if("string"==typeof t){var e=Xl(t);return this.readFeatureCollectionMetadataFromDocument(e)}return Wl(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}},e.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(e)},e.prototype.readFeatureCollectionMetadataFromNode=function(t){var e={},r=Fm(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=r,au(e,hw,t,[],this.gmlFormat_)},e.prototype.readTransactionResponseFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(e)},e.prototype.readTransactionResponseFromNode=function(t){return au({},fw,t,[])},e.prototype.writeGetFeature=function(t){var e,r=Vl(vw[this.version_],"GetFeature");if(r.setAttribute("service","WFS"),r.setAttribute("version",this.version_),t&&(t.handle&&r.setAttribute("handle",t.handle),t.outputFormat&&r.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&r.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&r.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&r.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&r.setAttribute("count",String(t.count)),void 0!==t.viewParams&&r.setAttribute("viewParams",t.viewParams),e=t.filter,t.bbox)){ut(t.geometryName,12);var n=uw(t.geometryName,t.bbox,t.srsName);e=e?lw(e,n):n}r.setAttributeNS(Yl,"xsi:schemaLocation",this.schemaLocation_);var i={node:r};return T(i,{version:this.version_,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.featureNS_,featurePrefix:t.featurePrefix,geometryName:t.geometryName,filter:e,propertyNames:t.propertyNames?t.propertyNames:[]}),ut(Array.isArray(t.featureTypes),11),function(t,e,r){var n=r[r.length-1],i=T({},n);i.node=t,lu(i,jw,eu("Query"),e,r)}(r,t.featureTypes,[i]),r},e.prototype.writeTransaction=function(t,e,r,n){var i,o=[],a=n.version?n.version:this.version_,s=Vl(vw[a],"Transaction");s.setAttribute("service","WFS"),s.setAttribute("version",a),n&&(i=n.gmlOptions?n.gmlOptions:{},n.handle&&s.setAttribute("handle",n.handle)),s.setAttributeNS(Yl,"xsi:schemaLocation",bw[a]);var l=function(t,e,r,n){var i,o=n.featurePrefix?n.featurePrefix:"feature";"1.0.0"===r?i=2:"1.1.0"===r?i=3:"2.0.0"===r&&(i=3.2);return T({node:t},{version:r,featureNS:n.featureNS,featureType:n.featureType,featurePrefix:o,gmlVersion:i,hasZ:n.hasZ,srsName:n.srsName},e)}(s,i,a,n);return t&&Sw("Insert",t,o,l),e&&Sw("Update",e,o,l),r&&Sw("Delete",r,o,l),n.nativeElements&&Sw("Native",n.nativeElements,o,l),s},e.prototype.readProjectionFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(e);return null},e.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var e=(t=t.firstElementChild.firstElementChild).firstElementChild;e;e=e.nextElementSibling)if(0!==e.childNodes.length&&(1!==e.childNodes.length||3!==e.firstChild.nodeType)){var r=[{}];return this.gmlFormat_.readGeometryElement(e,r),gr(r.pop().srsName)}return null},e}(xm);function Sw(t,e,r,n){lu(n,yw,eu(t),e,r)}function Tw(t,e){return au({},pw,t,e)}var Ew={"http://www.opengis.net/ogc":{FeatureId:Kl((function(t,e){return t.getAttribute("fid")}))},"http://www.opengis.net/ogc/1.1":{FeatureId:Kl((function(t,e){return t.getAttribute("fid")}))}};function Cw(t,e){ou(Ew,t,e)}var Ow={"http://www.opengis.net/wfs":{Feature:Cw},"http://www.opengis.net/wfs/2.0":{Feature:Cw}};function Pw(t,e){return au([],Ow,t,e)}function Rw(t,e,r){var n=r[r.length-1],i=n.featureType,o=n.featureNS,a=n.gmlVersion,s=Vl(o,i);t.appendChild(s),2===a?Bm.prototype.writeFeatureElement(s,e,r):3===a?Wm.prototype.writeFeatureElement(s,e,r):Jm.prototype.writeFeatureElement(s,e,r)}function Iw(t,e,r){var n=r[r.length-1].version,i=mw[n],o=Vl(i,"Filter"),a=Vl(i,"FeatureId");o.appendChild(a),a.setAttribute("fid",e),t.appendChild(o)}function Lw(t,e){var r=(t=t||"feature")+":";return 0===e.indexOf(r)?e:r+e}function Mw(t,e,r){var n=r[r.length-1];ut(void 0!==e.getId(),26);var i=n.featureType,o=n.featurePrefix,a=n.featureNS,s=Lw(o,i);t.setAttribute("typeName",s),t.setAttributeNS(gw,"xmlns:"+o,a);var l=e.getId();void 0!==l&&Iw(t,l,r)}function Fw(t,e,r){var n=r[r.length-1];ut(void 0!==e.getId(),27);var i=n.version,o=n.featureType,a=n.featurePrefix,s=n.featureNS,l=Lw(a,o),u=e.getGeometryName();t.setAttribute("typeName",l),t.setAttributeNS(gw,"xmlns:"+a,s);var c=e.getId();if(void 0!==c){for(var h=e.getKeys(),p=[],f=0,d=h.length;f="a"&&t<="z"||t>="A"&&t<="Z"},t.prototype.isNumeric_=function(t,e){return t>="0"&&t<="9"||"."==t&&!(void 0!==e&&e)},t.prototype.isWhiteSpace_=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},t.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},t.prototype.nextToken=function(){var t,e=this.nextChar_(),r=this.index_,n=e;if("("==e)t=iS;else if(","==e)t=sS;else if(")"==e)t=oS;else if(this.isNumeric_(e)||"-"==e)t=aS,n=this.readNumber_();else if(this.isAlpha_(e))t=nS,n=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(""!==e)throw new Error("Unexpected character: "+e);t=lS}return{position:r,value:n,type:t}},t.prototype.readNumber_=function(){var t,e=this.index_,r=!1,n=!1;do{"."==t?r=!0:"e"!=t&&"E"!=t||(n=!0),t=this.nextChar_()}while(this.isNumeric_(t,r)||!n&&("e"==t||"E"==t)||n&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(e,this.index_--))},t.prototype.readText_=function(){var t,e=this.index_;do{t=this.nextChar_()}while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()},t}(),pS=function(){function t(t){this.lexer_=t,this.token_,this.layout_=pt}return t.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},t.prototype.isTokenType=function(t){return this.token_.type==t},t.prototype.match=function(t){var e=this.isTokenType(t);return e&&this.consume_(),e},t.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},t.prototype.parseGeometryLayout_=function(){var t=pt,e=this.token_;if(this.isTokenType(nS)){var r=e.value;"Z"===r?t=ft:"M"===r?t=dt:"ZM"===r&&(t=yt),t!==pt&&this.consume_()}return t},t.prototype.parseGeometryCollectionText_=function(){if(this.match(iS)){var t=[];do{t.push(this.parseGeometry_())}while(this.match(sS));if(this.match(oS))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parsePointText_=function(){if(this.match(iS)){var t=this.parsePoint_();if(this.match(oS))return t}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())},t.prototype.parseLineStringText_=function(){if(this.match(iS)){var t=this.parsePointList_();if(this.match(oS))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parsePolygonText_=function(){if(this.match(iS)){var t=this.parseLineStringTextList_();if(this.match(oS))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPointText_=function(){if(this.match(iS)){var t=void 0;if(t=this.token_.type==iS?this.parsePointTextList_():this.parsePointList_(),this.match(oS))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiLineStringText_=function(){if(this.match(iS)){var t=this.parseLineStringTextList_();if(this.match(oS))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPolygonText_=function(){if(this.match(iS)){var t=this.parsePolygonTextList_();if(this.match(oS))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parsePoint_=function(){for(var t=[],e=this.layout_.length,r=0;r0&&(e+=" "+n)}return 0===r.length?e+" EMPTY":e+"("+r+")"}var _S=fS,bS=function(){function t(){}return t.prototype.read=function(t){if(t){if("string"==typeof t){var e=Xl(t);return this.readFromDocument(e)}return Wl(t)?this.readFromDocument(t):this.readFromNode(t)}return null},t.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},t.prototype.readFromNode=function(t){},t}();function xS(t){return t.getAttributeNS("http://www.w3.org/1999/xlink","href")}var 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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),SS=[null,"http://www.opengis.net/wms"],TS=iu(SS,{Service:$l((function(t,e){return au({},OS,t,e)})),Capability:$l((function(t,e){return au({},ES,t,e)}))}),ES=iu(SS,{Request:$l((function(t,e){return au({},kS,t,e)})),Exception:$l((function(t,e){return au([],LS,t,e)})),Layer:$l((function(t,e){return au({},MS,t,e)}))}),CS=function(t){function e(){var e=t.call(this)||this;return e.version=void 0,e}return wS(e,t),e.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var e=au({version:this.version},TS,t,[]);return e||null},e}(bS),OS=iu(SS,{Name:$l(Am),Title:$l(Am),Abstract:$l(Am),KeywordList:$l(qS),OnlineResource:$l(xS),ContactInformation:$l((function(t,e){return au({},PS,t,e)})),Fees:$l(Am),AccessConstraints:$l(Am),LayerLimit:$l(Mm),MaxWidth:$l(Mm),MaxHeight:$l(Mm)}),PS=iu(SS,{ContactPersonPrimary:$l((function(t,e){return au({},RS,t,e)})),ContactPosition:$l(Am),ContactAddress:$l((function(t,e){return au({},IS,t,e)})),ContactVoiceTelephone:$l(Am),ContactFacsimileTelephone:$l(Am),ContactElectronicMailAddress:$l(Am)}),RS=iu(SS,{ContactPerson:$l(Am),ContactOrganization:$l(Am)}),IS=iu(SS,{AddressType:$l(Am),Address:$l(Am),City:$l(Am),StateOrProvince:$l(Am),PostCode:$l(Am),Country:$l(Am)}),LS=iu(SS,{Format:Kl(Am)}),MS=iu(SS,{Name:$l(Am),Title:$l(Am),Abstract:$l(Am),KeywordList:$l(qS),CRS:Jl(Am),EX_GeographicBoundingBox:$l((function(t,e){var r=au({},AS,t,e);if(!r)return;var n=r.westBoundLongitude,i=r.southBoundLatitude,o=r.eastBoundLongitude,a=r.northBoundLatitude;if(void 0===n||void 0===i||void 0===o||void 0===a)return;return[n,i,o,a]})),BoundingBox:Jl((function(t,e){var r=[Lm(t.getAttribute("minx")),Lm(t.getAttribute("miny")),Lm(t.getAttribute("maxx")),Lm(t.getAttribute("maxy"))],n=[Lm(t.getAttribute("resx")),Lm(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:r,res:n}})),Dimension:Jl((function(t,e){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:Pm(t.getAttribute("multipleValues")),nearestValue:Pm(t.getAttribute("nearestValue")),current:Pm(t.getAttribute("current")),values:Am(t)}})),Attribution:$l((function(t,e){return au({},FS,t,e)})),AuthorityURL:Jl((function(t,e){var r=BS(t,e);if(r)return r.name=t.getAttribute("name"),r;return})),Identifier:Jl(Am),MetadataURL:Jl((function(t,e){var r=BS(t,e);if(r)return r.type=t.getAttribute("type"),r;return})),DataURL:Jl(BS),FeatureListURL:Jl(BS),Style:Jl((function(t,e){return au({},DS,t,e)})),MinScaleDenominator:$l(Im),MaxScaleDenominator:$l(Im),Layer:Jl((function(t,e){var r=e[e.length-1],n=au({},MS,t,e);if(!n)return;var i=Pm(t.getAttribute("queryable"));void 0===i&&(i=r.queryable);n.queryable=void 0!==i&&i;var o=Fm(t.getAttribute("cascaded"));void 0===o&&(o=r.cascaded);n.cascaded=o;var a=Pm(t.getAttribute("opaque"));void 0===a&&(a=r.opaque);n.opaque=void 0!==a&&a;var s=Pm(t.getAttribute("noSubsets"));void 0===s&&(s=r.noSubsets);n.noSubsets=void 0!==s&&s;var l=Lm(t.getAttribute("fixedWidth"));l||(l=r.fixedWidth);n.fixedWidth=l;var u=Lm(t.getAttribute("fixedHeight"));u||(u=r.fixedHeight);n.fixedHeight=u,["Style","CRS","AuthorityURL"].forEach((function(t){if(t in r){var e=n[t]||[];n[t]=e.concat(r[t])}}));return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach((function(t){if(!(t in n)){var e=r[t];n[t]=e}})),n}))}),FS=iu(SS,{Title:$l(Am),OnlineResource:$l(xS),LogoURL:$l(VS)}),AS=iu(SS,{westBoundLongitude:$l(Im),eastBoundLongitude:$l(Im),southBoundLatitude:$l(Im),northBoundLatitude:$l(Im)}),kS=iu(SS,{GetCapabilities:$l(YS),GetMap:$l(YS),GetFeatureInfo:$l(YS)}),jS=iu(SS,{Format:Jl(Am),DCPType:Jl((function(t,e){return au({},NS,t,e)}))}),NS=iu(SS,{HTTP:$l((function(t,e){return au({},GS,t,e)}))}),GS=iu(SS,{Get:$l(BS),Post:$l(BS)}),DS=iu(SS,{Name:$l(Am),Title:$l(Am),Abstract:$l(Am),LegendURL:Jl(VS),StyleSheetURL:$l(BS),StyleURL:$l(BS)}),zS=iu(SS,{Format:$l(Am),OnlineResource:$l(xS)}),US=iu(SS,{Keyword:Kl(Am)});function BS(t,e){return au({},zS,t,e)}function YS(t,e){return au({},jS,t,e)}function VS(t,e){var r=BS(t,e);if(r){var n=[Fm(t.getAttribute("width")),Fm(t.getAttribute("height"))];return r.size=n,r}}function qS(t,e){return au([],US,t,e)}var WS=CS,XS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ZS=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.featureNS_="http://mapserver.gis.umn.edu/mapserver",r.gmlFormat_=new Bm,r.layers_=n.layers?n.layers:null,r}return XS(e,t),e.prototype.getLayers=function(){return this.layers_},e.prototype.setLayers=function(t){this.layers_=t},e.prototype.readFeatures_=function(t,e){t.setAttribute("namespaceURI",this.featureNS_);var r=t.localName,n=[];if(0===t.childNodes.length)return n;if("msGMLOutput"==r)for(var i=0,o=t.childNodes.length;i.75*c||u>.75*h?this.resetExtent_():Vt(o,n)||this.recenter_()}}},e.prototype.resetExtent_=function(){var t=this.getMap(),e=this.ovmap_,r=t.getSize(),n=t.getView().calculateExtentInternal(r),i=e.getView(),o=Math.log(7.5)/Math.LN2;ve(n,1/(.1*Math.pow(2,o/2))),i.fitInternal(An(n))},e.prototype.recenter_=function(){var t=this.getMap(),e=this.ovmap_,r=t.getView();e.getView().setCenterInternal(r.getCenterInternal())},e.prototype.updateBox_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var r=t.getSize(),n=t.getView(),i=e.getView(),o=this.rotateWithView_?0:-n.getRotation(),a=this.boxOverlay_,s=this.boxOverlay_.getElement(),l=n.getCenterInternal(),u=n.getResolution(),c=i.getResolution(),h=r[0]*u/c,p=r[1]*u/c;if(a.setPosition(l),s){s.style.width=h+"px",s.style.height=p+"px";var f="rotate("+o+"rad)";s.style.transform=f}}},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?Wi(this.collapseLabel_,this.label_):Wi(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var t=this.ovmap_;if(!this.collapsed_){if(t.isRendered())return this.viewExtent_=void 0,void t.render();t.updateSize(),this.resetExtent_(),W(t,ia,(function(t){this.updateBox_()}),this)}},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.getRotateWithView=function(){return this.rotateWithView_},e.prototype.setRotateWithView=function(t){this.rotateWithView_!==t&&(this.rotateWithView_=t,0!==this.getMap().getView().getRotation()&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))},e.prototype.getOverviewMap=function(){return this.ovmap_},e.prototype.render=function(t){this.validateExtent_(),this.updateBox_()},e}(qa),YT=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),VT="degrees",qT="imperial",WT="nautical",XT="metric",ZT="us",KT=[1,2,5],HT=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).innerElement_=document.createElement("div"),r.innerElement_.className=i+"-inner",r.element.className=i+" ol-unselectable",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.addEventListener(et("units"),r.handleUnitsChanged_),r.setUnits(n.units||XT),r.scaleBar_=n.bar||!1,r.scaleBarSteps_=n.steps||4,r.scaleBarText_=n.text||!1,r.dpi_=n.dpi||void 0,r}return YT(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,r=t.projection,n=this.getUnits(),i=n==VT?_t.DEGREES:_t.METERS,o=mr(r,t.resolution,e,i),a=this.minWidth_*(this.dpi_||25.4/.28)/(25.4/.28),s=a*o,l="";if(n==VT){var u=vt[_t.DEGREES];(s*=u)=a)break;++d}f=this.scaleBar_?this.createScaleBar(h,c,l):c.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=f&&(this.innerElement_.innerHTML=f,this.renderedHTML_=f),this.renderedWidth_!=h&&(this.innerElement_.style.width=h+"px",this.renderedWidth_=h),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,r){for(var n="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,a="#ffffff",s=0;s'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,r):"")+""),s===this.scaleBarSteps_-1&&i.push(this.createStepText(s+1,t,!0,e,r)),a="#ffffff"===a?"#000000":"#ffffff";return''+(this.scaleBarText_?'
'+n+"
":"")+i.join("")+"
"},e.prototype.createMarker=function(t,e){return''},e.prototype.createStepText=function(t,e,r,n,i){var o=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);return''+o+"
"},e.prototype.getScaleForResolution=function(){var t=mr(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||25.4/.28,r=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*r*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(qa),JT=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$T=0,QT=1,tE=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),render:n.render})||this).dragListenerKeys_=[],r.currentResolution_=void 0,r.direction_=$T,r.dragging_,r.heightLimit_=0,r.widthLimit_=0,r.startX_,r.startY_,r.thumbSize_=null,r.sliderInitialized_=!1,r.duration_=void 0!==n.duration?n.duration:200;var i=void 0!==n.className?n.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=i+"-thumb ol-unselectable";var a=r.element;return a.className=i+" ol-unselectable ol-control",a.appendChild(o),a.addEventListener(Qo,r.handleDraggerStart_.bind(r),!1),a.addEventListener($o,r.handleDraggerDrag_.bind(r),!1),a.addEventListener(ta,r.handleDraggerEnd_.bind(r),!1),a.addEventListener(A,r.handleContainerClick_.bind(r),!1),o.addEventListener(A,u,!1),r}return JT(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e&&e.render()},e.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,r=t.offsetHeight;if(0===e&&0===r)return this.sliderInitialized_=!1;var n=t.firstElementChild,i=getComputedStyle(n),o=n.offsetWidth+parseFloat(i.marginRight)+parseFloat(i.marginLeft),a=n.offsetHeight+parseFloat(i.marginTop)+parseFloat(i.marginBottom);return this.thumbSize_=[o,a],e>r?(this.direction_=QT,this.widthLimit_=e-o):(this.direction_=$T,this.heightLimit_=r-a),this.sliderInitialized_=!0},e.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),r=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),n=this.getResolutionForPosition_(r),i=e.getConstrainedZoom(e.getZoomForResolution(n));e.animateInternal({zoom:i,duration:this.duration_,easing:Ma})},e.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.target===this.element.firstElementChild){var e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,0===this.dragListenerKeys_.length){var r=this.handleDraggerDrag_,n=this.handleDraggerEnd_;this.dragListenerKeys_.push(q(document,$o,r,this),q(document,ta,n,this))}}},e.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,r=t.clientY-this.startY_,n=this.getRelativePosition_(e,r);this.currentResolution_=this.getResolutionForPosition_(n),this.getMap().getView().setResolution(this.currentResolution_)}},e.prototype.handleDraggerEnd_=function(t){this.dragging_&&(this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(X),this.dragListenerKeys_.length=0)},e.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),r=this.element.firstElementChild;this.direction_==QT?r.style.left=this.widthLimit_*e+"px":r.style.top=this.heightLimit_*e+"px"},e.prototype.getRelativePosition_=function(t,e){return we(this.direction_===QT?t/this.widthLimit_:e/this.heightLimit_,0,1)},e.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},e.prototype.getPositionForResolution_=function(t){return we(1-this.getMap().getView().getValueForResolutionFunction()(t),0,1)},e.prototype.render=function(t){if(t.frameState&&(this.sliderInitialized_||this.initSlider_())){var e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}},e}(qa),eE=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])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rE=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),target:n.target})||this).extent=n.extent?n.extent:null;var i=void 0!==n.className?n.className:"ol-zoom-extent",o=void 0!==n.label?n.label:"E",a=void 0!==n.tipLabel?n.tipLabel:"Fit to extent",s=document.createElement("button");s.setAttribute("type","button"),s.title=a,s.appendChild("string"==typeof o?document.createTextNode(o):o),s.addEventListener(A,r.handleClick_.bind(r),!1);var l=i+" ol-unselectable ol-control",u=r.element;return u.className=l,u.appendChild(s),r}return eE(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),this.handleZoomToExtent()},e.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),e=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal(An(e))},e}(qa),nE={array:{},color:{},colorlike:{},control:{},coordinate:{},easing:{},events:{}};nE.events.condition={},nE.extent={},nE.featureloader={},nE.format={},nE.format.filter={},nE.geom={},nE.has={},nE.interaction={},nE.layer={},nE.loadingstrategy={},nE.proj={},nE.proj.Units={},nE.proj.proj4={},nE.render={},nE.render.canvas={},nE.renderer={},nE.renderer.canvas={},nE.renderer.webgl={},nE.size={},nE.source={},nE.sphere={},nE.style={},nE.style.IconImageCache={},nE.tilegrid={},nE.transform={},nE.util={},nE.webgl={},nE.xml={},nE.Collection=lt,nE.Feature=ht,nE.Geolocation=Kn,nE.Kinetic=Hn,nE.Map=tl,nE.Object=rt,nE.Observable=H,nE.Observable.unByKey=K,nE.Overlay=gl,nE.PluggableMap=Ya,nE.View=Ga,nE.array.stableSort=function(t,e){var r,n=t.length,i=Array(t.length);for(r=0;r180)&&(r[0]=Re(n+180,360)-180),r},nE.proj.transform=Cr,nE.proj.transformExtent=Or,nE.render.VectorContext=Fi,nE.render.canvas.labelCache=eo,nE.render.getRenderPixel=function(t,e){var r=e.slice(0);return Tt(t.inversePixelTransform.slice(),r),r},nE.render.getVectorContext=ko,nE.render.toContext=function(t,e){var r=t.canvas,n=e||{},i=n.pixelRatio||Di,o=n.size;o&&(r.width=o[0]*i,r.height=o[1]*i,r.style.width=o[0]+"px",r.style.height=o[1]+"px");var a=[0,0,r.width,r.height],s=Et([1,0,0,1,0,0],i,i);return new vo(t,i,a,s,0)},nE.renderer.Composite=Yo,nE.renderer.canvas.ImageLayer=gp,nE.renderer.canvas.TileLayer=Ep,nE.renderer.canvas.VectorImageLayer=gd,nE.renderer.canvas.VectorLayer=dd,nE.renderer.canvas.VectorTileLayer=Sd,nE.renderer.webgl.PointsLayer=If,nE.size.toSize=Ua,nE.source.BingMaps=$c,nE.source.CartoDB=rh,nE.source.Cluster=dh,nE.source.IIIF=Mh,nE.source.Image=Uh,nE.source.ImageArcGISRest=Vh,nE.source.ImageCanvas=Zh,nE.source.ImageMapGuide=Hh,nE.source.ImageStatic=$h,nE.source.ImageWMS=op,nE.source.OSM=lp,nE.source.OSM.ATTRIBUTION=sp,nE.source.Raster=Yp,nE.source.Source=kc,nE.source.Stamen=Zp,nE.source.Tile=Dc,nE.source.TileArcGISRest=Hp,nE.source.TileDebug=Qp,nE.source.TileImage=Kc,nE.source.TileJSON=ef,nE.source.TileWMS=nf,nE.source.UTFGrid=sf,nE.source.Vector=ph,nE.source.VectorTile=df,nE.source.WMTS=_f,nE.source.WMTS.optionsFromCapabilities=function(t,e){var r=v(t.Contents.Layer,(function(t,r,n){return t.Identifier==e.layer}));if(null===r)return null;var n,i=t.Contents.TileMatrixSet;(n=r.TileMatrixSetLink.length>1?b(r.TileMatrixSetLink,"projection"in e?function(t,r,n){var o=v(i,(function(e){return e.Identifier==t.TileMatrixSet})).SupportedCRS,a=gr(o),s=gr(e.projection);return a&&s?Sr(a,s):o==e.projection}:function(t,r,n){return t.TileMatrixSet==e.matrixSet}):0)<0&&(n=0);var o=r.TileMatrixSetLink[n].TileMatrixSet,a=r.TileMatrixSetLink[n].TileMatrixSetLimits,s=r.Format[0];"format"in e&&(s=e.format),(n=b(r.Style,(function(t,r,n){return"style"in e?t.Title==e.style:t.isDefault})))<0&&(n=0);var l=r.Style[n].Identifier,u={};"Dimension"in r&&r.Dimension.forEach((function(t,e,r){var n=t.Identifier,i=t.Default;void 0===i&&(i=t.Value[0]),u[n]=i}));var c,h=v(t.Contents.TileMatrixSet,(function(t,e,r){return t.Identifier==o})),p=h.SupportedCRS;if(p&&(c=gr(p)),"projection"in e){var f=gr(e.projection);f&&(c&&!Sr(f,c)||(c=f))}var y="ne"==c.getAxisOrientation().substr(0,2),g=h.TileMatrix[0],m={MinTileCol:0,MinTileRow:0,MaxTileCol:g.MatrixWidth-1,MaxTileRow:g.MatrixHeight-1};a&&(m=a[a.length-1],g=v(h.TileMatrix,(function(t){return t.Identifier===m.TileMatrix})));var _=28e-5*g.ScaleDenominator/c.getMetersPerUnit(),x=y?[g.TopLeftCorner[1],g.TopLeftCorner[0]]:g.TopLeftCorner,w=g.TileWidth*_,S=g.TileHeight*_,T=[x[0]+w*m.MinTileCol,x[1]-S*(1+m.MaxTileRow),x[0]+w*(1+m.MaxTileCol),x[1]-S*m.MinTileRow];null===c.getExtent()&&c.setExtent(T);var E=ku(h,T,a),C=[],O=e.requestEncoding;if(O=void 0!==O?O:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var P=t.OperationsMetadata.GetTile.DCP.HTTP.Get,R=0,I=P.length;R>1,h=-7,f=i?e-1:0,l=i?-1:1,v=t[n+f];for(f+=l,o=v&(1<<-h)-1,v>>=-h,h+=a;h>0;o=256*o+t[n+f],f+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=256*s+t[n+f],f+=l,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(v?-1:1);s+=Math.pow(2,r),o-=c}return(v?-1:1)*s*Math.pow(2,o-r)},n.write=function(t,n,i,r,e,o){var s,a,u,c=8*o-e-1,h=(1<>1,l=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,v=r?0:o-1,d=r?1:-1,p=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(a=isNaN(n)?1:0,s=h):(s=Math.floor(Math.log(n)/Math.LN2),n*(u=Math.pow(2,-s))<1&&(s--,u*=2),(n+=s+f>=1?l/u:l*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=h?(a=0,s=h):s+f>=1?(a=(n*u-1)*Math.pow(2,e),s+=f):(a=n*Math.pow(2,f-1)*Math.pow(2,e),s=0));e>=8;t[i+v]=255&a,v+=d,a/=256,e-=8);for(s=s<0;t[i+v]=255&s,v+=d,s/=256,c-=8);t[i+v-d]|=128*p}},875:function(t,n,i){"use strict";function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function e(t,n){for(var i=0;ithis[a])return j(this,this[p].get(t)),!1;var o=this[p].get(t).value;return this[l]&&(this[v]||this[l](t,o.value)),o.now=r,o.maxAge=i,o.value=n,this[u]+=e-o.length,o.length=e,this.get(t),x(this),!0}var s=new S(t,n,e,r,i);return s.length>this[a]?(this[l]&&this[l](t,n),!1):(this[u]+=s.length,this[d].unshift(s),this[p].set(t,this[d].head),x(this),!0)}},{key:"has",value:function(t){if(!this[p].has(t))return!1;var n=this[p].get(t).value;return!g(this,n)}},{key:"get",value:function(t){return b(this,t,!0)}},{key:"peek",value:function(t){return b(this,t,!1)}},{key:"pop",value:function(){var t=this[d].tail;return t?(j(this,t),t.value):null}},{key:"del",value:function(t){j(this,this[p].get(t))}},{key:"load",value:function(t){this.reset();for(var n=Date.now(),i=t.length-1;i>=0;i--){var r=t[i],e=r.e||0;if(0===e)this.set(r.k,r.v);else{var o=e-n;o>0&&this.set(r.k,r.v,o)}}}},{key:"prune",value:function(){var t=this;this[p].forEach((function(n,i){return b(t,i,!1)}))}}]),t}(),b=function(t,n,i){var r=t[p].get(n);if(r){var e=r.value;if(g(t,e)){if(j(t,r),!t[h])return}else i&&(t[y]&&(r.value.now=Date.now()),t[d].unshiftNode(r));return e.value}},g=function(t,n){if(!n||!n.maxAge&&!t[f])return!1;var i=Date.now()-n.now;return n.maxAge?i>n.maxAge:t[f]&&i>t[f]},x=function(t){if(t[u]>t[a])for(var n=t[d].tail;t[u]>t[a]&&null!==n;){var i=n.prev;j(t,n),n=i}},j=function(t,n){if(n){var i=n.value;t[l]&&t[l](i.key,i.value),t[u]-=i.length,t[p].delete(i.key),t[d].removeNode(n)}},S=o((function t(n,i,e,o,s){r(this,t),this.key=n,this.value=i,this.length=e,this.now=o,this.maxAge=s||0})),k=function(t,n,i,r){var e=i.value;g(t,e)&&(j(t,i),t[h]||(e=void 0)),e&&n.call(r,e.value,e.key,t)};t.exports=w},63:function(t){var n={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},i=" ",r=/(italic|oblique)$/i,e={};t.exports=function(t,o,s){var a=e[t];if(!a){Array.isArray(t)||(t=[t]);for(var u=400,c="normal",h=[],f=0,l=t.length;f1?v[v.length-2].toLowerCase():"";if(d==p||d==p.replace("-","")||y+"-"+d==p){u=n[p],v.pop(),y&&p.startsWith(y)&&v.pop();break}}"number"==typeof d&&(u=d);var m=v.join(i).replace("Klokantech Noto Sans","Noto Sans");-1!==m.indexOf(i)&&(m='"'+m+'"'),h.push(m)}a=e[t]=[c,u,h]}return a[0]+i+a[1]+i+o+"px"+(s?"/"+s:"")+i+a[2]}},98:function(t,n,i){"use strict";t.exports=e;var r=i(226);function e(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}e.Varint=0,e.Fixed64=1,e.Bytes=2,e.Fixed32=5;var o=4294967296,s=1/o,a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function u(t){return t.type===e.Bytes?t.readVarint()+t.pos:t.pos+1}function c(t,n,i){return i?4294967296*n+(t>>>0):4294967296*(n>>>0)+(t>>>0)}function h(t,n,i){var r=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(7*Math.LN2));i.realloc(r);for(var e=i.pos-1;e>=t;e--)i.buf[e+r]=i.buf[e]}function f(t,n){for(var i=0;i>>8,t[i+2]=n>>>16,t[i+3]=n>>>24}function j(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+(t[n+3]<<24)}e.prototype={destroy:function(){this.buf=null},readFields:function(t,n,i){for(i=i||this.length;this.pos>3,o=this.pos;this.type=7&r,t(e,n,this),this.pos===o&&this.skip(r)}return n},readMessage:function(t,n){return this.readFields(t,n,this.readVarint()+this.pos)},readFixed32:function(){var t=g(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=j(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=g(this.buf,this.pos)+g(this.buf,this.pos+4)*o;return this.pos+=8,t},readSFixed64:function(){var t=g(this.buf,this.pos)+j(this.buf,this.pos+4)*o;return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var n,i,r=this.buf;return n=127&(i=r[this.pos++]),i<128?n:(n|=(127&(i=r[this.pos++]))<<7,i<128?n:(n|=(127&(i=r[this.pos++]))<<14,i<128?n:(n|=(127&(i=r[this.pos++]))<<21,i<128?n:function(t,n,i){var r,e,o=i.buf;if(e=o[i.pos++],r=(112&e)>>4,e<128)return c(t,r,n);if(e=o[i.pos++],r|=(127&e)<<3,e<128)return c(t,r,n);if(e=o[i.pos++],r|=(127&e)<<10,e<128)return c(t,r,n);if(e=o[i.pos++],r|=(127&e)<<17,e<128)return c(t,r,n);if(e=o[i.pos++],r|=(127&e)<<24,e<128)return c(t,r,n);if(e=o[i.pos++],r|=(1&e)<<31,e<128)return c(t,r,n);throw new Error("Expected varint not more than 10 bytes")}(n|=(15&(i=r[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,n=this.pos;return this.pos=t,t-n>=12&&a?function(t,n,i){return a.decode(t.subarray(n,i))}(this.buf,n,t):function(t,n,i){var r="",e=n;for(;e239?4:u>223?3:u>191?2:1;if(e+h>i)break;1===h?u<128&&(c=u):2===h?128==(192&(o=t[e+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===h?(o=t[e+1],s=t[e+2],128==(192&o)&&128==(192&s)&&((c=(15&u)<<12|(63&o)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===h&&(o=t[e+1],s=t[e+2],a=t[e+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,h=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),e+=h}return r}(this.buf,n,t)},readBytes:function(){var t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n},readPackedVarint:function(t,n){if(this.type!==e.Bytes)return t.push(this.readVarint(n));var i=u(this);for(t=t||[];this.pos127;);else if(n===e.Bytes)this.pos=this.readVarint()+this.pos;else if(n===e.Fixed32)this.pos+=4;else{if(n!==e.Fixed64)throw new Error("Unimplemented type: "+n);this.pos+=8}},writeTag:function(t,n){this.writeVarint(t<<3|n)},realloc:function(t){for(var n=this.length||16;n268435455||t<0?function(t,n){var i,r;t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),function(t,n,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,n),function(t,n){var i=(7&t)<<4;if(n.buf[n.pos++]|=i|((t>>>=3)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;n.buf[n.pos++]=127&t}(r,n)}(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 n=this.pos;this.pos=function(t,n,i){for(var r,e,o=0;o55295&&r<57344){if(!e){r>56319||o+1===n.length?(t[i++]=239,t[i++]=191,t[i++]=189):e=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,e=r;continue}r=e-55296<<10|r-56320|65536,e=null}else e&&(t[i++]=239,t[i++]=191,t[i++]=189,e=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-n;i>=128&&h(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var n=t.length;this.writeVarint(n),this.realloc(n);for(var i=0;i=128&&h(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,n,i){this.writeTag(t,e.Bytes),this.writeRawMessage(n,i)},writePackedVarint:function(t,n){n.length&&this.writeMessage(t,f,n)},writePackedSVarint:function(t,n){n.length&&this.writeMessage(t,l,n)},writePackedBoolean:function(t,n){n.length&&this.writeMessage(t,p,n)},writePackedFloat:function(t,n){n.length&&this.writeMessage(t,v,n)},writePackedDouble:function(t,n){n.length&&this.writeMessage(t,d,n)},writePackedFixed32:function(t,n){n.length&&this.writeMessage(t,y,n)},writePackedSFixed32:function(t,n){n.length&&this.writeMessage(t,m,n)},writePackedFixed64:function(t,n){n.length&&this.writeMessage(t,w,n)},writePackedSFixed64:function(t,n){n.length&&this.writeMessage(t,b,n)},writeBytesField:function(t,n){this.writeTag(t,e.Bytes),this.writeBytes(n)},writeFixed32Field:function(t,n){this.writeTag(t,e.Fixed32),this.writeFixed32(n)},writeSFixed32Field:function(t,n){this.writeTag(t,e.Fixed32),this.writeSFixed32(n)},writeFixed64Field:function(t,n){this.writeTag(t,e.Fixed64),this.writeFixed64(n)},writeSFixed64Field:function(t,n){this.writeTag(t,e.Fixed64),this.writeSFixed64(n)},writeVarintField:function(t,n){this.writeTag(t,e.Varint),this.writeVarint(n)},writeSVarintField:function(t,n){this.writeTag(t,e.Varint),this.writeSVarint(n)},writeStringField:function(t,n){this.writeTag(t,e.Bytes),this.writeString(n)},writeFloatField:function(t,n){this.writeTag(t,e.Fixed32),this.writeFloat(n)},writeDoubleField:function(t,n){this.writeTag(t,e.Fixed64),this.writeDouble(n)},writeBooleanField:function(t,n){this.writeVarintField(t,Boolean(n))}}},72:function(t,n,i){var r,e,o;function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}o=function(){"use strict";function t(t,r,e,o,s){!function t(i,r,e,o,s){for(;o>e;){if(o-e>600){var a=o-e+1,u=r-e+1,c=Math.log(a),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(a-h)/a)*(u-a/2<0?-1:1);t(i,r,Math.max(e,Math.floor(r-u*h/a+f)),Math.min(o,Math.floor(r+(a-u)*h/a+f)),s)}var l=i[r],v=e,d=o;for(n(i,e,r),s(i[o],l)>0&&n(i,e,o);v0;)d--}0===s(i[e],l)?n(i,e,d):n(i,++d,o),d<=r&&(e=d+1),r<=d&&(o=d-1)}}(t,r,e||0,o||t.length-1,s||i)}function n(t,n,i){var r=t[n];t[n]=t[i],t[i]=r}function i(t,n){return tn?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function e(t,n,i){if(!i)return n.indexOf(t);for(var r=0;r=t.minX&&n.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function p(n,i,r,e,o){for(var s=[i,r];s.length;)if(!((r=s.pop())-(i=s.pop())<=e)){var a=i+Math.ceil((r-i)/e/2)*e;t(n,a,i,r,o),s.push(i,a,a,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var n=this.data,i=[];if(!v(t,n))return i;for(var r=this.toBBox,e=[];n;){for(var o=0;o=0&&e[n].children.length>this._maxEntries;)this._split(e,n),n--;this._adjustParentBBoxes(r,e,n)},r.prototype._split=function(t,n){var i=t[n],r=i.children.length,e=this._minEntries;this._chooseSplitAxis(i,e,r);var s=this._chooseSplitIndex(i,e,r),a=d(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)},r.prototype._splitRoot=function(t,n){this.data=d([t,n]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,i){for(var r,e,o,a,u,c,f,l=1/0,v=1/0,d=n;d<=i-n;d++){var p=s(t,0,d,this.toBBox),y=s(t,d,i,this.toBBox),m=(e=p,o=y,a=Math.max(e.minX,o.minX),u=Math.max(e.minY,o.minY),c=Math.min(e.maxX,o.maxX),f=Math.min(e.maxY,o.maxY),Math.max(0,c-a)*Math.max(0,f-u)),w=h(p)+h(y);m=n;v--){var d=t.children[v];a(u,t.leaf?e(d):d),c+=f(u)}return c},r.prototype._adjustParentBBoxes=function(t,n,i){for(var r=i;r>=0;r--)a(n[r],t)},r.prototype._condense=function(t){for(var n=t.length-1,i=void 0;n>=0;n--)0===t[n].children.length?n>0?(i=t[n-1].children).splice(i.indexOf(t[n]),1):this.clear():o(t[n],this.toBBox)},r},"object"==s(n)?t.exports=o():void 0===(e="function"==typeof(r=o)?r.call(n,i,n,t):r)||(t.exports=e)},760:function(t,n,i){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var e=function(t){"use strict";var n,i=Object.prototype,e=i.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,n,i){return Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{c({},"")}catch(t){c=function(t,n,i){return t[n]=i}}function h(t,n,i,r){var e=n&&n.prototype instanceof m?n:m,o=Object.create(e.prototype),s=new E(r||[]);return o._invoke=function(t,n,i){var r=l;return function(e,o){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===e)throw o;return C()}for(i.method=e,i.arg=o;;){var s=i.delegate;if(s){var a=_(s,i);if(a){if(a===y)continue;return a}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===l)throw r=p,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=d;var u=f(t,n,i);if("normal"===u.type){if(r=i.done?p:v,u.arg===y)continue;return{value:u.arg,done:i.done}}"throw"===u.type&&(r=p,i.method="throw",i.arg=u.arg)}}}(t,i,s),o}function f(t,n,i){try{return{type:"normal",arg:t.call(n,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var l="suspendedStart",v="suspendedYield",d="executing",p="completed",y={};function m(){}function w(){}function b(){}var g={};c(g,s,(function(){return this}));var x=Object.getPrototypeOf,j=x&&x(x(A([])));j&&j!==i&&e.call(j,s)&&(g=j);var S=b.prototype=m.prototype=Object.create(g);function k(t){["next","throw","return"].forEach((function(n){c(t,n,(function(t){return this._invoke(n,t)}))}))}function M(t,n){function i(o,s,a,u){var c=f(t[o],t,s);if("throw"!==c.type){var h=c.arg,l=h.value;return l&&"object"===r(l)&&e.call(l,"__await")?n.resolve(l.__await).then((function(t){i("next",t,a,u)}),(function(t){i("throw",t,a,u)})):n.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return i("throw",t,a,u)}))}u(c.arg)}var o;this._invoke=function(t,r){function e(){return new n((function(n,e){i(t,r,n,e)}))}return o=o?o.then(e,e):e()}}function _(t,i){var r=t.iterator[i.method];if(r===n){if(i.delegate=null,"throw"===i.method){if(t.iterator.return&&(i.method="return",i.arg=n,_(t,i),"throw"===i.method))return y;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var e=f(r,t.iterator,i.arg);if("throw"===e.type)return i.method="throw",i.arg=e.arg,i.delegate=null,y;var o=e.arg;return o?o.done?(i[t.resultName]=o.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=n),i.delegate=null,y):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function O(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function T(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function A(t){if(t){var i=t[s];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function i(){for(;++r=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var u=e.call(s,"catchLoc"),c=e.call(s,"finallyLoc");if(u&&c){if(this.prev=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&e.call(r,"finallyLoc")&&this.prev=0;--n){var i=this.tryEntries[n];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),T(i),y}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var e=r.arg;T(i)}return e}}throw new Error("illegal catch attempt")},delegateYield:function(t,i,r){return this.delegate={iterator:A(t),resultName:i,nextLoc:r},"next"===this.method&&(this.arg=n),y}},t}("object"===r(t=i.nmd(t))?t.exports:{});try{regeneratorRuntime=e}catch(t){"object"===("undefined"==typeof globalThis?"undefined":r(globalThis))?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},338:function(t){(function(){var n;t.exports={icon:"icons/google.svg",name:"google",title:"Google Fonts",link:"google.com/fonts",getNames:function(){return n},getLink:function(t){return"https://fonts.google.com/specimen/"+t.replace(/( )/g,"+")},normalizeName:function(t){return t}},n=["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alegreya Sans","Alegreya Sans SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Amiri","Amita","Anaheim","Andada","Andika","Angkor","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Arya","Asap","Asar","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Battambang","Baumans","Bayon","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Biryani","Bitter","Black Ops One","Bokor","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambay","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Catamaran","Caudex","Caveat","Caveat Brush","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Chenla","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Chonburi","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Content","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dangrek","Dawning of a New Day","Days One","Dekko","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Dhurjati","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Eczar","Ek Mukta","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Exo 2","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Fasthand","Fauna One","Federant","Federo","Felipa","Fenix","Finger Paint","Fira Mono","Fira Sans","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Freehand","Fresca","Frijole","Fruktur","Fugaz One","GFS Didot","GFS Neohellenic","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gidugu","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Gurajada","Habibi","Halant","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Hanuman","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Hind","Hind Siliguri","Hind Vadodara","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Inknut Antiqua","Irish Grover","Istok Web","Italiana","Italianno","Itim","Jacques Francois","Jacques Francois Shadow","Jaldi","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kadwa","Kalam","Kameron","Kantumruy","Karla","Karma","Kaushan Script","Kavoon","Kdam Thmor","Keania One","Kelly Slab","Kenia","Khand","Khmer","Khula","Kite One","Knewave","Kotta One","Koulen","Kranky","Kreon","Kristi","Krona One","Kurale","La Belle Aurore","Laila","Lakki Reddy","Lancelot","Lateef","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Lily Script One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Mallanna","Mandali","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Martel","Martel Sans","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modak","Modern Antiqua","Molengo","Molle","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Moul","Moulpali","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","NTR","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Nokora","Norican","Nosifer","Nothing You Could Do","Noticia Text","Noto Sans","Noto Serif","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Odor Mean Chey","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Palanquin","Palanquin Dark","Paprika","Parisienne","Passero One","Passion One","Pathway Gothic One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peddana","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Poppins","Port Lligat Sans","Port Lligat Slab","Pragati Narrow","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Rajdhani","Raleway","Raleway Dots","Ramabhadra","Ramaraja","Rambla","Rammetto One","Ranchers","Rancho","Ranga","Rationale","Ravi Prakash","Redressed","Reenie Beanie","Revalia","Rhodium Libre","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Rozha One","Rubik","Rubik Mono One","Rubik One","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sahitya","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarala","Sarina","Sarpanch","Satisfy","Scada","Scheherazade","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Siemreap","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slabo 13px","Slabo 27px","Slackey","Smokum","Smythe","Sniglet","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Source Serif Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Sree Krushnadevaraya","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sumana","Sunshiney","Supermercado One","Sura","Suranna","Suravaram","Suwannaphum","Swanky and Moo Moo","Syncopate","Tangerine","Taprom","Tauri","Teko","Telex","Tenali Ramakrishna","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tillana","Timmana","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vesper Libre","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Work Sans","Yanone Kaffeesatz","Yantramanav","Yellowtail","Yeseva One","Yesteryear","Zeyada"]}).call(this)},617:function(t,n,i){var r=i(279);t.exports=function(t,n,i){var e=i&&i.debug||!1,o=i&&i.startIndex||0;e&&console.log("starting findTagByName with",n," and ",i);var s=r(t,"<".concat(n,"[ >]"),o);if(e&&console.log("start:",s),-1!==s){var a=t.slice(s+n.length),u=r(a,"[ /]"+n+">",0),c=-1===u;c&&(u=r(a,"[ /]>",0));var h=s+n.length+u+1+(c?0:n.length)+1;if(e&&console.log("end:",h),-1!==h){var f=t.slice(s,h);return{inner:c?null:f.slice(f.indexOf(">")+1,f.lastIndexOf("<")),outer:f,start:s,end:h}}}}},51:function(t,n,i){var r=i(617);t.exports=function(t,n,i){for(var e,o=[],s=i&&i.debug||!1,a=i&&i.startIndex||0;e=r(t,n,{debug:s,startIndex:a});)a=e.end,o.push(e);return s&&console.log("findTagsByName found",o.length,"tags"),o}},802:function(t){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t,i,r){var e=r&&r.debug||!1;e&&console.log("getting "+i+" in "+t);var o="object"===n(t)?t.outer:t,s="".concat(i,'\\="([^"]*)"');e&&console.log("pattern:",s);var a=new RegExp(s).exec(o);if(e&&console.log("match:",a),a)return a[1]}},279:function(t){t.exports=function(t,n,i){var r=new RegExp(n).exec(t.slice(i));return r?i+r.index:-1}},518:function(t){"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this.head;case 1:if(!n){t.next=7;break}return t.next=4,n.value;case 4:n=n.next,t.next=1;break;case 7:case"end":return t.stop()}}),t,this)}))}},692:function(t,n,i){"use strict";function r(t){var n=this;if(n instanceof r||(n=new r),n.tail=null,n.head=null,n.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){n.push(t)}));else if(arguments.length>0)for(var i=0,e=arguments.length;i1)i=n;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,i=this.head.value}for(var e=0;null!==r;e++)i=t(i,r.value,e),r=r.next;return i},r.prototype.reduceReverse=function(t,n){var i,r=this.tail;if(arguments.length>1)i=n;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,i=this.tail.value}for(var e=this.length-1;null!==r;e--)i=t(i,r.value,e),r=r.prev;return i},r.prototype.toArray=function(){for(var t=new Array(this.length),n=0,i=this.head;null!==i;n++)t[n]=i.value,i=i.next;return t},r.prototype.toArrayReverse=function(){for(var t=new Array(this.length),n=0,i=this.tail;null!==i;n++)t[n]=i.value,i=i.prev;return t},r.prototype.slice=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var i=new r;if(nthis.length&&(n=this.length);for(var e=0,o=this.head;null!==o&ðis.length&&(n=this.length);for(var e=this.length,o=this.tail;null!==o&&e>n;e--)o=o.prev;for(;null!==o&&e>t;e--,o=o.prev)i.push(o.value);return i},r.prototype.splice=function(t,n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,r=this.head;null!==r&&i>1)],n))<0?s=r+1:(a=r,u=!e);return u?s:~s}function p(t,n){return t>n?1:t=0}function m(t,n,i){var r=t.length;if(t[0]<=n)return 0;if(n<=t[r-1])return r-1;var e=void 0;if(i>0){for(e=1;e0?e-1:e:t[e-1]-n>>0,e=0;e0||i&&0===o)}))}function k(){return!0}function M(){return!1}function _(){}function O(t){var n,i,r,e=!1;return function(){var o=Array.prototype.slice.call(arguments);return e&&this===r&&x(o,i)||(e=!0,r=this,i=o,n=t.apply(this,arguments)),n}}function T(t){return function(){var n;try{n=t()}catch(t){return Promise.reject(t)}return n instanceof Promise?n:Promise.resolve(n)}()}var E="function"==typeof Object.assign?Object.assign:function(t,n){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),r=1,e=arguments.length;r0)},n.prototype.removeEventListener=function(t,n){var i=this.O&&this.O[t];if(i){var r=i.indexOf(n);-1!==r&&(this.S&&t in this.S?(i[r]=_,++this.S[t]):(i.splice(r,1),0===i.length&&delete this.O[t]))}},n}(v),N="change",z="error",F="clear",L="contextmenu",G="click",D="dblclick",U="dragenter",q="dragover",B="drop",W="keydown",V="keypress",X="load",H="resize",J="touchmove",K="wheel";function Y(t,n,i,r,e){if(r&&r!==t&&(i=i.bind(r)),e){var o=i;i=function(){t.removeEventListener(n,i),o.apply(this,arguments)}}var s={target:t,type:n,listener:i};return t.addEventListener(n,i),s}function Z(t,n,i,r){return Y(t,n,i,r,!0)}function $(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),A(t))}var Q=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),tt=function(t){function n(){var n=t.call(this)||this;return n.on=n.onInternal,n.once=n.onceInternal,n.un=n.unInternal,n.T=0,n}return Q(n,t),n.prototype.changed=function(){++this.T,this.dispatchEvent(N)},n.prototype.getRevision=function(){return this.T},n.prototype.onInternal=function(t,n){if(Array.isArray(t)){for(var i=t.length,r=new Array(i),e=0;e0;)this.pop()},n.prototype.extend=function(t){for(var n=0,i=t.length;nt)throw new Error("Tile load sequence violation");this.state=t,this.changed()},n.prototype.load=function(){r()},n.prototype.getAlpha=function(t,n){if(!this.D)return 1;var i=this.U[t];if(i){if(-1===i)return 1}else i=n,this.U[t]=i;var r=n-i+1e3/60;return r>=this.D?1:mt(r/this.D)},n.prototype.inTransition=function(t){return!!this.D&&-1!==this.U[t]},n.prototype.endTransition=function(t){this.D&&(this.U[t]=-1)},n}(I),St=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),kt=function(t){function n(n){var i=this,r=lt;return(i=t.call(this,n.tileCoord,r,{transition:n.transition,interpolate:n.interpolate})||this).q=n.loader,i.B=null,i.W=null,i}return St(n,t),n.prototype.getData=function(){return this.B},n.prototype.getError=function(){return this.W},n.prototype.load=function(){this.state=vt,this.changed();var t=this;this.q().then((function(n){t.B=n,t.state=dt,t.changed()})).catch((function(n){t.W=n,t.state=pt,t.changed()}))},n}(jt);function Mt(t,n){if(!t)throw new c(n)}var _t=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Ot(t){return"function"==typeof t?t:(Array.isArray(t)?n=t:(Mt("function"==typeof t.getZIndex,41),n=[t]),function(){return n});var n}var Tt=function(t){function n(n){var i=t.call(this)||this;if(i.on,i.once,i.un,i.V=void 0,i.H="geometry",i.K=null,i.tt=void 0,i.nt=null,i.addChangeListener(i.H,i.it),n)if("function"==typeof n.getSimplifiedGeometry){var r=n;i.setGeometry(r)}else{var e=n;i.setProperties(e)}return i}return _t(n,t),n.prototype.clone=function(){var t=new n(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var r=this.getStyle();return r&&t.setStyle(r),t},n.prototype.getGeometry=function(){return this.get(this.H)},n.prototype.getId=function(){return this.V},n.prototype.getGeometryName=function(){return this.H},n.prototype.getStyle=function(){return this.K},n.prototype.getStyleFunction=function(){return this.tt},n.prototype.rt=function(){this.changed()},n.prototype.it=function(){this.nt&&($(this.nt),this.nt=null);var t=this.getGeometry();t&&(this.nt=Y(t,N,this.rt,this)),this.changed()},n.prototype.setGeometry=function(t){this.set(this.H,t)},n.prototype.setStyle=function(t){this.K=t,this.tt=t?Ot(t):void 0,this.changed()},n.prototype.setId=function(t){this.V=t,this.changed()},n.prototype.setGeometryName=function(t){this.removeChangeListener(this.H,this.it),this.H=t,this.addChangeListener(this.H,this.it),this.it()},n}(ot),Et="XY",At="XYZ",Ct="XYM",Rt="XYZM",Pt={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},It={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Nt={9001:It.METERS,9002:It.FEET,9003:It.USFEET,9101:It.RADIANS,9102:It.DEGREES};function zt(t){return Nt[t]}var Ft={};Ft[It.RADIANS]=6370997/(2*Math.PI),Ft[It.DEGREES]=2*Math.PI*6370997/360,Ft[It.FEET]=.3048,Ft[It.METERS]=1,Ft[It.USFEET]=1200/3937;var Lt,Gt=It,Dt="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Ut=-1!==Dt.indexOf("firefox"),qt=-1!==Dt.indexOf("safari")&&-1==Dt.indexOf("chrom"),Bt=-1!==Dt.indexOf("webkit")&&-1==Dt.indexOf("edge"),Wt=-1!==Dt.indexOf("macintosh"),Vt="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,Xt="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,Ht="undefined"!=typeof Image&&Image.prototype.decode,Jt=function(){var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,n),window.removeEventListener("_",null,n)}catch(t){}return t}(),Kt=new Array(6);function Yt(){return[1,0,0,1,0,0]}function Zt(t){return Qt(t,1,0,0,1,0,0)}function $t(t,n){var i=t[0],r=t[1],e=t[2],o=t[3],s=t[4],a=t[5],u=n[0],c=n[1],h=n[2],f=n[3],l=n[4],v=n[5];return t[0]=i*u+e*c,t[1]=r*u+o*c,t[2]=i*h+e*f,t[3]=r*h+o*f,t[4]=i*l+e*v+s,t[5]=r*l+o*v+a,t}function Qt(t,n,i,r,e,o,s){return t[0]=n,t[1]=i,t[2]=r,t[3]=e,t[4]=o,t[5]=s,t}function tn(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t}function nn(t,n){var i=n[0],r=n[1];return n[0]=t[0]*i+t[2]*r+t[4],n[1]=t[1]*i+t[3]*r+t[5],n}function rn(t,n){var i=Math.cos(n),r=Math.sin(n);return $t(t,Qt(Kt,i,r,-r,i,0,0))}function en(t,n,i){return $t(t,Qt(Kt,n,0,0,i,0,0))}function on(t,n,i){return Qt(t,n,0,0,i,0,0)}function sn(t,n,i){return $t(t,Qt(Kt,1,0,0,1,n,i))}function an(t,n,i,r,e,o,s,a){var u=Math.sin(o),c=Math.cos(o);return t[0]=r*c,t[1]=e*u,t[2]=-r*u,t[3]=e*c,t[4]=s*r*c-a*r*u+n,t[5]=s*e*u+a*e*c+i,t}function un(t,n){var i=cn(n);Mt(0!==i,32);var r=n[0],e=n[1],o=n[2],s=n[3],a=n[4],u=n[5];return t[0]=s/i,t[1]=-e/i,t[2]=-o/i,t[3]=r/i,t[4]=(o*u-s*a)/i,t[5]=-(r*u-e*a)/i,t}function cn(t){return t[0]*t[3]-t[1]*t[2]}function hn(t){var n="matrix("+t.join(", ")+")";if(Xt)return n;var i=Lt||(Lt=document.createElement("div"));return i.style.transform=n,i.style.transform}var fn="bottom-left",ln="bottom-right",vn="top-left",dn="top-right",pn=0,yn=1,mn=2,wn=4,bn=8,gn=16;function xn(t){for(var n=En(),i=0,r=t.length;ie&&(u|=wn),ao&&(u|=mn),u===pn&&(u=yn),u}function En(){return[1/0,1/0,-1/0,-1/0]}function An(t,n,i,r,e){return e?(e[0]=t,e[1]=n,e[2]=i,e[3]=r,e):[t,n,i,r]}function Cn(t){return An(1/0,1/0,-1/0,-1/0,t)}function Rn(t,n){var i=t[0],r=t[1];return An(i,r,i,r,n)}function Pn(t,n,i,r,e){return Gn(Cn(e),t,n,i,r)}function In(t,n){return t[0]==n[0]&&t[2]==n[2]&&t[1]==n[1]&&t[3]==n[3]}function Nn(t,n,i){return Math.abs(t[0]-n[0])t[2]&&(t[2]=n[2]),n[1]t[3]&&(t[3]=n[3]),t}function Fn(t,n){n[0]t[2]&&(t[2]=n[0]),n[1]t[3]&&(t[3]=n[1])}function Ln(t,n){for(var i=0,r=n.length;in[0]?r[0]=t[0]:r[0]=n[0],t[1]>n[1]?r[1]=t[1]:r[1]=n[1],t[2]=n[0]&&t[1]<=n[3]&&t[3]>=n[1]}function ni(t){return t[2]=s&&p<=u),r||!(o&wn)||e&wn||(r=(y=v-(l-u)*d)>=a&&y<=c),r||!(o&bn)||e&bn||(r=(p=l-(v-a)/d)>=s&&p<=u),r||!(o&gn)||e&gn||(r=(y=v-(l-s)*d)>=a&&y<=c)}return r}function oi(t,n,i,r){var e=[];if(r>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a=i[2])){var e=Qn(i),o=Math.floor((r[0]-i[0])/e)*e;t[0]-=o,t[2]-=o}return t}var ai=function(){function t(t){this.et=t.code,this.ot=t.units,this.st=void 0!==t.extent?t.extent:null,this.ut=void 0!==t.worldExtent?t.worldExtent:null,this.ct=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.ht=void 0!==t.global&&t.global,this.ft=!(!this.ht||!this.st),this.lt=t.getPointResolution,this.vt=null,this.dt=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.ft},t.prototype.getCode=function(){return this.et},t.prototype.getExtent=function(){return this.st},t.prototype.getUnits=function(){return this.ot},t.prototype.getMetersPerUnit=function(){return this.dt||Ft[this.ot]},t.prototype.getWorldExtent=function(){return this.ut},t.prototype.getAxisOrientation=function(){return this.ct},t.prototype.isGlobal=function(){return this.ht},t.prototype.setGlobal=function(t){this.ht=t,this.ft=!(!t||!this.st)},t.prototype.getDefaultTileGrid=function(){return this.vt},t.prototype.setDefaultTileGrid=function(t){this.vt=t},t.prototype.setExtent=function(t){this.st=t,this.ft=!(!this.ht||!t)},t.prototype.setWorldExtent=function(t){this.ut=t},t.prototype.setGetPointResolution=function(t){this.lt=t},t.prototype.getPointResolutionFunc=function(){return this.lt},t}();function ui(t,n,i){return Math.min(Math.max(t,n),i)}var ci="cosh"in Math?Math.cosh:function(t){var n=Math.exp(t);return(n+1/n)/2},hi="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function fi(t,n,i,r,e,o){var s=e-i,a=o-r;if(0!==s||0!==a){var u=((t-i)*s+(n-r)*a)/(s*s+a*a);u>1?(i=e,r=o):u>0&&(i+=s*u,r+=a*u)}return li(t,n,i,r)}function li(t,n,i,r){var e=i-t,o=r-n;return e*e+o*o}function vi(t){for(var n=t.length,i=0;ie&&(e=s,r=o)}if(0===e)return null;var a=t[r];t[r]=t[i],t[i]=a;for(var u=i+1;u=0;l--){f[l]=t[l][n]/t[l][l];for(var v=l-1;v>=0;v--)t[v][n]-=t[v][l]*f[l]}return f}function di(t){return 180*t/Math.PI}function pi(t){return t*Math.PI/180}function yi(t,n){var i=t%n;return i*n<0?i+n:i}function mi(t,n,i){return t+i*(n-t)}function wi(t,n){var i=Math.pow(10,n);return Math.round(t*i)/i}function bi(t,n){return Math.round(wi(t,n))}function gi(t,n){return Math.floor(wi(t,n))}function xi(t,n){return Math.ceil(wi(t,n))}var ji=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Si=6378137,ki=Math.PI*Si,Mi=[-ki,-ki,ki,ki],_i=[-180,-85,180,85],Oi=Si*Math.log(Math.tan(Math.PI/2)),Ti=function(t){function n(n){return t.call(this,{code:n,units:Gt.METERS,extent:Mi,global:!0,worldExtent:_i,getPointResolution:function(t,n){return t/ci(n[1]/Si)}})||this}return ji(n,t),n}(ai),Ei=[new Ti("EPSG:3857"),new Ti("EPSG:102100"),new Ti("EPSG:102113"),new Ti("EPSG:900913"),new Ti("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ti("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ai(t,n,i){var r=t.length,e=i>1?i:2,o=n;void 0===o&&(o=e>2?t.slice():new Array(r));for(var s=0;sOi?a=Oi:a<-Oi&&(a=-Oi),o[s+1]=a}return o}function Ci(t,n,i){var r=t.length,e=i>1?i:2,o=n;void 0===o&&(o=e>2?t.slice():new Array(r));for(var s=0;s