h&&(this.instructions.push([Ku.CUSTOM,h,o,t,r,Xi]),this.hitDetectionInstructions.push([Ku.CUSTOM,h,o,t,n||r,Xi]));break;case an:i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([Ku.CUSTOM,h,o,t,r]),this.hitDetectionInstructions.push([Ku.CUSTOM,h,o,t,n||r])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[Ku.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Ku.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var r,n,i=e.length,o=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=r.lineWidth,this.bufferedMaxExtent_=null)}else r.strokeStyle=void 0,r.lineCap=void 0,r.lineDash=null,r.lineDashOffset=void 0,r.lineJoin=void 0,r.lineWidth=void 0,r.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,r=[Ku.SET_FILL_STYLE,e];return"string"!=typeof e&&r.push(!0),r},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[Ku.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var r=t.fillStyle;"string"==typeof r&&t.currentFillStyle==r||(void 0!==r&&this.instructions.push(e.call(this,t)),t.currentFillStyle=r)},e.prototype.updateStrokeStyle=function(t,e){var r=t.strokeStyle,n=t.lineCap,i=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=r||t.currentLineCap!=n||i!=t.currentLineDash&&!x(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==r&&e.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=n,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[Ku.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=$(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;J(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Uu);const $u=Ju;var Qu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const tp=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return Qu(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(r,n);this.instructions.push([Ku.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([Ku.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(r,n);this.instructions.push([Ku.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([Ku.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var r=t.getAnchor(),n=t.getSize(),i=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=r[0],this.anchorY_=r[1],this.hitDetectionImage_=i,this.image_=o,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterImageWithText_=e},e}($u);var ep=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rp=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return ep(e,t),e.prototype.drawFlatCoordinates_=function(t,e,r,n){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,r,n,!1,!1),a=[Ku.MOVE_TO_LINE_TO,i,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),r},e.prototype.drawLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Ku.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,ur,0],Yu);var o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(Vu),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Ku.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Yu);for(var o=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,p=o.length;ut&&(v>g&&(g=v,d=m,y=o),v=0,m=o-i)),a=s,p=c,h=f),l=_,u=x}return(v+=s)>g?[m,o]:[d,y]}var lp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),up={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},pp=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return lp(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var r=this.textFillState_,n=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(r||n)){var o=this.coordinates,a=o.length,s=t.getType(),l=null,u=t.getStride();if("line"!==i.placement||s!=sn&&s!=pn&&s!=ln&&s!=hn){var p=i.overflow?null:[];switch(s){case an:case un:l=t.getFlatCoordinates();break;case sn:l=t.getFlatMidpoint();break;case fn:l=t.getCenter();break;case pn:l=t.getFlatMidpoints(),u=2;break;case ln:l=t.getFlatInteriorPoint(),i.overflow||p.push(l[2]/this.resolution),u=3;break;case hn:var h=t.getFlatInteriorPoints();for(l=[],w=0,C=h.length;wR[2]}else T=x>E;var P,I=Math.PI,F=[],k=w+n===e;if(g=0,v=C,c=t[e=w],f=t[e+1],k){m(),P=Math.atan2(f-y,c-d),T&&(P+=P>0?-I:I);var M=(E+x)/2,A=(O+b)/2;return F[0]=[M,A,(S-o)/2,P,i],F}for(var L=0,j=i.length;L0?-I:I),void 0!==P){var D=z-P;if(D+=D>I?-2*I:D<-I?2*I:0,Math.abs(D)>a)return null}P=z;for(var G=L,N=0;L0&&t.push("\n",""),t.push(e,""),t}var Pp=function(){function t(t,e,r,n){this.overlaps=r,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,r,n){var i=t+e+r+n;if(this.labels_[i])return this.labels_[i];var o=n?this.strokeStates[n]:null,a=r?this.fillStates[r]:null,s=this.textStates[e],l=this.pixelRatio,u=[s.scale[0]*l,s.scale[1]*l],p=Array.isArray(t),h=Op(p?t[0]:t,s.textAlign||cr),c=n&&o.lineWidth?o.lineWidth:0,f=p?t:t.split("\n").reduce(Rp,[]),d=function(t,e){for(var r=[],n=[],i=[],o=0,a=0,s=0,l=0,u=0,p=e.length;u<=p;u+=2){var h=e[u];if("\n"!==h&&u!==p){var c=e[u+1]||t.font,f=Cr(c,h);r.push(f),a+=f;var d=br(c);n.push(d),l=Math.max(l,d)}else o=Math.max(o,a),i.push(a),a=0,s+=l}return{width:o,height:s,widths:r,heights:n,lineWidths:i}}(s,f),y=d.width,g=d.height,v=d.widths,m=d.heights,_=d.lineWidths,x=y+c,b=[],w=(x+2)*u[0],C=(g+c)*u[1],S={width:w<0?Math.floor(w):Math.ceil(w),height:C<0?Math.floor(C):Math.ceil(C),contextInstructions:b};1==u[0]&&1==u[1]||b.push("scale",u),n&&(b.push("strokeStyle",o.strokeStyle),b.push("lineWidth",c),b.push("lineCap",o.lineCap),b.push("lineJoin",o.lineJoin),b.push("miterLimit",o.miterLimit),(M?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(b.push("setLineDash",[o.lineDash]),b.push("lineDashOffset",o.lineDashOffset))),r&&b.push("fillStyle",a.fillStyle),b.push("textBaseline","middle"),b.push("textAlign","center");for(var T,E=.5-h,O=h*x+E*c,R=[],P=[],I=0,F=0,k=0,A=0,L=0,j=f.length;Lt?t-l:i,x=o+u>e?e-u:o,b=f[3]+_*h[0]+f[1],w=f[0]+x*h[1]+f[2],C=v-f[3],S=m-f[0];return(d||0!==p)&&(bp[0]=C,Sp[0]=C,bp[1]=S,wp[1]=S,wp[0]=C+b,Cp[0]=wp[0],Cp[1]=S+w,Sp[1]=Cp[1]),0!==p?(B(g=Y([1,0,0,1,0,0],r,n,1,1,p,-r,-n),bp),B(g,wp),B(g,Cp),B(g,Sp),it(Math.min(bp[0],wp[0],Cp[0],Sp[0]),Math.min(bp[1],wp[1],Cp[1],Sp[1]),Math.max(bp[0],wp[0],Cp[0],Sp[0]),Math.max(bp[1],wp[1],Cp[1],Sp[1]),xp)):it(Math.min(C,C+b),Math.min(S,S+w),Math.max(C,C+b),Math.max(S,S+w),xp),c&&(v=Math.round(v),m=Math.round(m)),{drawImageX:v,drawImageY:m,drawImageW:_,drawImageH:x,originX:l,originY:u,declutterBox:{minX:xp[0],minY:xp[1],maxX:xp[2],maxY:xp[3],value:y},canvasTransform:g,scale:h}},t.prototype.replayImageOrLabel_=function(t,e,r,n,i,o,a){var s=!(!o&&!a),l=n.declutterBox,u=t.canvas,p=a?a[2]*n.scale[0]/2:0;return l.minX-p<=u.width/e&&l.maxX+p>=0&&l.minY-p<=u.height/e&&l.maxY+p>=0&&(s&&this.replayTextBackground_(t,bp,wp,Cp,Sp,o,a),function(t,e,r,n,i,o,a,s,l,u,p){t.save(),1!==r&&(t.globalAlpha*=r),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,u),t.scale(p[0],p[1]),function(t,e){for(var r=t.contextInstructions,n=0,i=r.length;nG&&(this.fill_(t),F=0),k>G&&(t.stroke(),k=0),F||k||(t.beginPath(),d=NaN,y=NaN),++R;break;case Ku.CIRCLE:var W=l[I=N[1]],X=l[I+1],q=l[I+2]-W,B=l[I+3]-X,V=Math.sqrt(q*q+B*B);t.moveTo(W+V,X),t.arc(W,X,V,0,2*Math.PI,!0),++R;break;case Ku.CLOSE_PATH:t.closePath(),++R;break;case Ku.CUSTOM:I=N[1],h=N[2];var Y=N[3],Z=N[4],K=6==N.length?N[5]:void 0;D.geometry=Y,D.feature=S,R in L||(L[R]=[]);var U=L[R];K?K(l,I,h,2,U):(U[0]=l[I],U[1]=l[I+1],U.length=2),Z(U,D),++R;break;case Ku.DRAW_IMAGE:I=N[1],h=N[2],m=N[3],c=N[4],f=N[5];var H=N[6],J=N[7],$=N[8],Q=N[9],tt=N[10],et=N[11],rt=N[12],nt=N[13],it=N[14];if(!m&&N.length>=19){_=N[18],b=N[19],w=N[20],C=N[21];var ot=this.drawLabelWithPointPlacement_(_,b,w,C);m=ot.label,N[3]=m;var at=N[22];c=(ot.anchorX-at)*this.pixelRatio,N[4]=c;var st=N[23];f=(ot.anchorY-st)*this.pixelRatio,N[5]=f,H=m.height,N[6]=H,nt=m.width,N[13]=nt}var lt=void 0;N.length>24&&(lt=N[24]);var ut=void 0,pt=void 0,ht=void 0;N.length>16?(ut=N[15],pt=N[16],ht=N[17]):(ut=dr,pt=!1,ht=!1),tt&&z?et+=j:tt||z||(et-=j);for(var ct=0;Ir)break;var s=n[a];s||(s=[],n[a]=s),s.push(4*((t+i)*e+(t+o))+3),i>0&&s.push(4*((t-i)*e+(t+o))+3),o>0&&(s.push(4*((t+i)*e+(t-o))+3),i>0&&s.push(4*((t-i)*e+(t-o))+3))}for(var l=[],u=(i=0,n.length);i0){if(!o||h!==yp&&h!==mp||-1!==o.indexOf(t)){var u=(c[s]-3)/4,f=n-u%a,d=n-(u/a|0),y=i(t,e,f*f+d*d);if(y)return y}p.clearRect(0,0,a,a);break}}var d,y,v,m,_,x=Object.keys(this.executorsByZIndex_).map(Number);for(x.sort(g),d=x.length-1;d>=0;--d){var b=x[d].toString();for(v=this.executorsByZIndex_[b],y=Fp.length-1;y>=0;--y)if(void 0!==(m=v[h=Fp[y]])&&(_=m.executeHitDetection(p,s,r,f,u)))return _}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var r=e[0],n=e[1],i=e[2],o=e[3],a=[r,n,r,o,i,o,i,n];return bi(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return Qt(this.executorsByZIndex_)},t.prototype.execute=function(t,e,r,n,i,o,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(g),this.maxExtent_&&(t.save(),this.clip(t,r));var l,u,p,h,c,f,d=o||Fp;for(a&&s.reverse(),l=0,u=s.length;lf[2];)v=y*++g,u.push(this.getRenderTransform(n,i,o,Dp,p,h,v).slice()),d-=y}this.hitDetectionImageData_=Gp(r,u,this.renderedFeatures_,l.getStyleFunction(),s,i,o)}e(Np(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){var o=this;if(this.replayGroup_){var a,s=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),p={},h=function(t,e,r){var o=E(t),a=p[o];if(a){if(!0!==a&&r=r[2])){var i=St(r),o=Math.floor((n[0]-r[0])/i)*i;t[0]-=o,t[2]-=o}return t}(m[0],u);C[0]<_[0]&&C[2]<_[2]?m.push([C[0]+b,C[1],C[2]+b,C[3]]):C[0]>_[0]&&C[2]>_[2]&&m.push([C[0]-b,C[1],C[2]-b,C[3]])}if(!this.dirty_&&this.renderedResolution_==p&&this.renderedRevision_==c&&this.renderedRenderOrder_==d&&et(this.wrappedRenderedExtent_,g))return x(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=y,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var S,T=new cp(Bp(p,h),g,p,h);this.getLayer().getDeclutter()&&(S=new cp(Bp(p,h),g,p,h));var E,O=ei();if(O){for(var R=0,P=m.length;R=200&&s.status<300){var n=e.getType(),l=void 0;n==qs||"text"==n?l=s.responseText:"xml"==n?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):n==Xs&&(l=s.response),l?o(e.readFeatures(l,{extent:r,featureProjection:i}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}function nh(t,e){return function(r,n,i,o,a){var s=this;rh(t,e,r,n,i,(function(t,e){s.addFeatures(t),void 0!==o&&o(t)}),a||C)}}var ih=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),oh=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.feature=r,i.features=n,i}return ih(e,t),e}(Kt),ah=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{attributions:n.attributions,interpolate:!0,projection:void 0,state:Me,wrapX:void 0===n.wrapX||n.wrapX})||this).on,r.once,r.un,r.loader_=C,r.format_=n.format,r.overlaps_=void 0===n.overlaps||n.overlaps,r.url_=n.url,void 0!==n.loader?r.loader_=n.loader:void 0!==r.url_&&(D(r.format_,7),r.loader_=nh(r.url_,r.format_)),r.strategy_=void 0!==n.strategy?n.strategy:eh;var i,o,a=void 0===n.useSpatialIndex||n.useSpatialIndex;return r.featuresRtree_=a?new $p:null,r.loadedExtentsRtree_=new $p,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null,Array.isArray(n.features)?o=n.features:n.features&&(o=(i=n.features).getArray()),a||void 0!==i||(i=new Mr(o)),void 0!==o&&r.addFeaturesInternal(o),void 0!==i&&r.bindFeaturesCollection_(i),r}return ih(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=E(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var r=t.getGeometry();if(r){var n=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new oh(Qp,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[ue(e,re,this.handleFeatureChange_,this),ue(e,Ut,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var r=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?r=!1:this.idIndex_[n.toString()]=e),r&&(D(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),r},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],r=[],n=[],i=0,o=t.length;i0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,r=this.loadedExtentsRtree_;r.forEachInExtent(t,(function(r){if(lt(r.extent,t))return e=r,!0})),e&&r.remove(e)},e.prototype.removeFeature=function(t){if(t){var e=E(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}},e.prototype.removeFeatureInternal=function(t){var e=E(t),r=this.featureChangeKeys_[e];if(r){r.forEach(he),delete this.featureChangeKeys_[e];var n=t.getId();return void 0!==n&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new oh(th,t)),t}},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var r in this.idIndex_)if(this.idIndex_[r]===t){delete this.idIndex_[r],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){D(this.format_,7),this.url_=t,this.setLoader(nh(t,this.format_))},e}(Jl);const sh=ah,lh="hybrid",uh="vector";var ph=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hh={image:[vp,fp,gp,yp,mp],hybrid:[vp,gp],vector:[]},ch={hybrid:[yp,mp,dp],vector:[vp,fp,gp,yp,mp,dp]},fh=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.dirty_=!1,r.renderedLayerRevision_,r.renderedPixelToCoordinateTransform_=null,r.renderedRotation_,r.tmpTransform_=[1,0,0,1,0,0],r}return ph(e,t),e.prototype.prepareTile=function(t,e,r){var n,i=t.getState();return 2!==i&&3!==i||(this.updateExecutorGroup_(t,e,r),this.tileImageNeedsRender_(t)&&(n=!0)),n},e.prototype.getTile=function(e,r,n,i){var o=i.pixelRatio,a=i.viewState,s=a.resolution,l=a.projection,u=this.getLayer(),p=u.getSource().getTile(e,r,n,o,l),h=i.viewHints,c=!(h[0]||h[1]);return!c&&p.wantedResolution||(p.wantedResolution=s),this.prepareTile(p,o,l)&&(c||Date.now()-i.time<8)&&u.getRenderMode()!==uh&&this.renderTileImage_(p,i),t.prototype.getTile.call(this,e,r,n,i)},e.prototype.isDrawableTile=function(e){var r=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(r.getRenderMode()===uh?E(r)in e.executorGroups:e.hasContext(r))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var r=this.getLayer().getRevision();return this.renderedLayerRevision_!=r&&(this.renderedTiles.length=0),this.renderedLayerRevision_=r,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,r){var n=this.getLayer(),i=n.getRevision(),o=n.getRenderOrder()||null,a=t.wantedResolution,s=t.getReplayState(n);if(s.dirty||s.renderedResolution!==a||s.renderedRevision!=i||s.renderedRenderOrder!=o){var l=n.getSource(),u=n.getDeclutter(),p=l.getTileGrid(),h=l.getTileGridForProjection(r).getTileCoordExtent(t.wrappedTileCoord),c=l.getSourceTiles(e,r,t),f=E(n);delete t.hitDetectionImageData[f],t.executorGroups[f]=[],u&&(t.declutterExecutorGroups[f]=[]);for(var d=function(r,i){var d=c[r];if(2!=d.getState())return"continue";var g=d.tileCoord,v=p.getTileCoordExtent(g),m=bt(h,v),_=J(m,n.getRenderBuffer()*a,y.tmpExtent),x=lt(v,m)?null:_;s.dirty=!1;var b=new cp(0,_,a,e),w=u?new cp(0,m,a,e):void 0,C=qp(a,e),S=function(t){var e,r=t.getStyleFunction()||n.getStyleFunction();if(r&&(e=r(t,a)),e){var i=this.renderFeature(t,C,e,b,w);this.dirty_=this.dirty_||i,s.dirty=s.dirty||i}},T=d.getFeatures();o&&o!==s.renderedRenderOrder&&T.sort(o);for(var E=0,O=T.length;E0)e([]);else{var g=wt(p.getTileCoordExtent(n.wrappedTileCoord)),v=[(h[0]-g[0])/u,(g[1]-h[1])/u],m=n.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),_=n.hitDetectionImageData[o];if(!_&&!this.animatingOrInteracting_){var x=So(p.getTileSize(p.getZForResolution(u))),b=this.renderedRotation_;_=Gp(x,[this.getRenderTransform(p.getTileCoordCenter(n.wrappedTileCoord),u,0,Dp,x[0]*Dp,x[1]*Dp,0)],m,i.getStyleFunction(),p.getTileCoordExtent(n.wrappedTileCoord),n.getReplayState(i).renderedResolution,b),n.hitDetectionImageData[o]=_}e(Np(v,m,_))}}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var e=this.context,r=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var n=t.viewHints,i=!(n[0]||n[1]),o=this.renderedTiles,a=0,s=o.length;a=0;--p)u[p].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,i,void 0,t.declutterTree)}e.globalAlpha=r},e.prototype.getTileRenderTransform=function(t,e){var r=e.pixelRatio,n=e.viewState,i=n.center,o=n.resolution,a=n.rotation,s=e.size,l=Math.round(s[0]*r),u=Math.round(s[1]*r),p=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),h=t.tileCoord,c=p.getTileCoordExtent(t.wrappedTileCoord),f=p.getTileCoordExtent(h,this.tmpExtent)[0]-c[0];return X(V(this.inversePixelTransform.slice(),1/r,1/r),this.getRenderTransform(i,o,a,r,l,u,f))},e.prototype.renderFrame=function(e,r){var n=e.viewHints,i=!(n[0]||n[1]);t.prototype.renderFrame.call(this,e,r),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var o=this.getLayer(),a=o.getRenderMode(),s=this.context,l=s.globalAlpha;s.globalAlpha=o.getOpacity();for(var u=ch[a],p=e.viewState,h=p.rotation,c=o.getSource(),f=c.getTileGridForProjection(p.projection).getZForResolution(p.resolution,c.zDirection),d=this.renderedTiles,y=[],g=[],v=d.length-1;v>=0;--v){var m=d[v],_=m.executorGroups[E(o)].filter((function(t){return t.hasExecutors(u)}));if(0!==_.length){for(var x=this.getTileRenderTransform(m,e),b=m.tileCoord[0],w=!1,C=_[0].getClipCoords(x),S=0,T=y.length;S255?255:t}function Fh(t){return t<0?0:t>1?1:t}function kh(t){return"%"===t[t.length-1]?Ih(parseFloat(t)/100*255):Ih(parseInt(t))}function Mh(t){return"%"===t[t.length-1]?Fh(parseFloat(t)/100):Fh(parseFloat(t))}function Ah(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{Rh={}.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in Ph)return Ph[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var n=r.indexOf("("),i=r.indexOf(")");if(-1!==n&&i+1===r.length){var o=r.substr(0,n),a=r.substr(n+1,i-(n+1)).split(","),s=1;switch(o){case"rgba":if(4!==a.length)return null;s=Mh(a.pop());case"rgb":return 3!==a.length?null:[kh(a[0]),kh(a[1]),kh(a[2]),s];case"hsla":if(4!==a.length)return null;s=Mh(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=Mh(a[1]),p=Mh(a[2]),h=p<=.5?p*(u+1):p+u-p*u,c=2*p-h;return[Ih(255*Ah(c,h,l+1/3)),Ih(255*Ah(c,h,l)),Ih(255*Ah(c,h,l-1/3)),s];default:return null}}return null}}catch(t){}var Lh=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};function jh(t){return"object"==typeof t?["literal",t]:t}function zh(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Dh(t,e){var r,n,i=jh((r=t.default,n=e.default,void 0!==r?r:void 0!==n?n:void 0));return void 0===i&&"resolvedImage"===e.type?"":i}function Gh(t,e,r){var n=Xh(t,e),i=["get",t.property];if("categorical"===n&&"boolean"==typeof r[0][0]){for(var o=["case"],a=0,s=r;a3&&e===t[t.length-2]||(n&&2===t.length||t.push(e),t.push(r))}function Xh(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function qh(t){for(var e=["concat"],r=/{([^{}]+)}/g,n=0,i=r.exec(t);null!==i;i=r.exec(t)){var o=t.slice(n,r.lastIndex-i[0].length);n=r.lastIndex,o.length>0&&e.push(o),e.push(["get",i[1]])}if(1===e.length)return t;if(n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var ic=[Yh,Zh,Kh,Uh,Hh,tc,Jh,rc($h),ec];function oc(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!oc(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=ic;r=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function fc(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof Lh)return!0;if(t instanceof lc)return!0;if(t instanceof pc)return!0;if(t instanceof hc)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in mc)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=mc[s],n++}else o=$h;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=rc(o,a)}else r=mc[i];for(var l=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var xc=function(t){this.type=tc,this.sections=t};xc.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Zh)))return null;var l=null;if(a["text-font"]&&!(l=e.parse(a["text-font"],1,rc(Kh))))return null;var u=null;if(a["text-color"]&&!(u=e.parse(a["text-color"],1,Hh)))return null;var p=n[n.length-1];p.scale=s,p.font=l,p.textColor=u}else{var h=e.parse(t[o],1,$h);if(!h)return null;var c=h.type.kind;if("string"!==c&&"value"!==c&&"null"!==c&&"resolvedImage"!==c)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new xc(n)},xc.prototype.evaluate=function(t){return new pc(this.sections.map((function(e){var r=e.content.evaluate(t);return dc(r)===ec?new uc("",r,null,null,null):new uc(yc(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},xc.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},bc.prototype.eachChild=function(t){t(this.input)},bc.prototype.outputDefined=function(){return!1},bc.prototype.serialize=function(){return["image",this.input.serialize()]};var wc={"to-boolean":Uh,"to-color":Hh,"to-number":Zh,"to-string":Kh},Cc=function(t,e){this.type=t,this.args=e};Cc.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=wc[r],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":cc(e[0],e[1],e[2],e[3])))return new Lh(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new vc(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,l=this.args;s=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Fc(t,e){var r,n=(180+t[0])/360,i=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),o=Math.pow(2,e.z);return[Math.round(n*o*Rc),Math.round(i*o*Rc)]}function kc(t,e,r){var n=t[0]-e[0],i=t[1]-e[1],o=t[0]-r[0],a=t[1]-r[1];return n*a-o*i==0&&n*o<=0&&i*a<=0}function Mc(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Ac(t,e){for(var r=!1,n=0,i=e.length;n0&&h<0||p<0&&h>0}function zc(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}Pc(e,t)}function qc(t,e,r,n){var i=Math.pow(2,n.z)*Rc,o=[n.x*Rc,n.y*Rc],a=[];if(!t)return a;for(var s=0,l=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Kc(t,e)&&(r=!1)})),r}Vc.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(fc(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new vc("Input is not a number.");a=s-1}return 0}Hc.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Hc.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new _c(e,[t]):"coerce"===r?new Cc(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof gc)&&"resolvedImage"!==o.type.kind&&Jc(o)){var l=new Tc;try{o=new gc(o.type,o.evaluate(l))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Hc.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Hc(this.registry,n,e||null,i,this.errors)},Hc.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Bh(n,t))},Hc.prototype.checkSubtype=function(t,e){var r=oc(t,e);return r&&this.error(r),r};var Qc=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var p=e.parse(s,u,i);if(!p)return null;i=i||p.type,n.push([a,p])}return new Qc(i,r,n)},Qc.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[$c(e,n)].evaluate(t)},Qc.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var tf=ef;function ef(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}function rf(t,e,r){return t*(1-r)+e*r}ef.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},ef.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},ef.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},ef.prototype.solveCurveX=function(t,e){var r,n,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)(n=1))return n;for(;ro?r=i:n=i,i=.5*(n-r)+r}return i},ef.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var nf=Object.freeze({__proto__:null,number:rf,color:function(t,e,r){return new Lh(rf(t.r,e.r,r),rf(t.g,e.g,r),rf(t.b,e.b,r),rf(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return rf(t,e[n],r)}))}}),of=.95047,af=1.08883,sf=4/29,lf=6/29,uf=3*lf*lf,pf=lf*lf*lf,hf=Math.PI/180,cf=180/Math.PI;function ff(t){return t>pf?Math.pow(t,1/3):t/uf+sf}function df(t){return t>lf?t*t*t:uf*(t-sf)}function yf(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function gf(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function vf(t){var e=gf(t.r),r=gf(t.g),n=gf(t.b),i=ff((.4124564*e+.3575761*r+.1804375*n)/of),o=ff((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-ff((.0193339*e+.119192*r+.9503041*n)/af)),alpha:t.a}}function mf(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*df(e),r=of*df(r),n=af*df(n),new Lh(yf(3.2404542*r-1.5371385*e-.4985314*n),yf(-.969266*r+1.8760108*e+.041556*n),yf(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function _f(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var xf={forward:vf,reverse:mf,interpolate:function(t,e,r){return{l:rf(t.l,e.l,r),a:rf(t.a,e.a,r),b:rf(t.b,e.b,r),alpha:rf(t.alpha,e.alpha,r)}}},bf=function(t){var e=vf(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*cf;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},wf=function(t){var e=t.h*hf,r=t.c;return mf({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},Cf=function(t,e,r){return{h:_f(t.h,e.h,r),c:rf(t.c,e.c,r),l:rf(t.l,e.l,r),alpha:rf(t.alpha,e.alpha,r)}},Sf=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Zh)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=Hh:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var p=0;p=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var y=e.parse(c,d,u);if(!y)return null;u=u||y.type,l.push([h,y])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new Sf(u,r,n,i,l):e.error("Type "+nc(u)+" is not interpolatable.")},Sf.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var o=$c(e,n),a=e[o],s=e[o+1],l=Sf.interpolationFactor(this.interpolation,n,a,s),u=r[o].evaluate(t),p=r[o+1].evaluate(t);return"interpolate"===this.operator?nf[this.type.kind.toLowerCase()](u,p,l):"interpolate-hcl"===this.operator?wf(Cf(bf(u),bf(p),l)):xf.reverse(xf.interpolate(xf.forward(u),xf.forward(p),l))},Sf.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new vc("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new vc("Array index must be an integer, but found "+e+" instead.");return r[e]},Rf.prototype.eachChild=function(t){t(this.index),t(this.input)},Rf.prototype.outputDefined=function(){return!1},Rf.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Pf=function(t,e){this.type=Uh,this.needle=t,this.haystack=e};Pf.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,$h),n=e.parse(t[2],2,$h);return r&&n?ac(r.type,[Uh,Kh,Zh,Yh,$h])?new Pf(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+nc(r.type)+" instead"):null},Pf.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==r)return!1;if(!sc(e,["boolean","string","number","null"]))throw new vc("Expected first argument to be of type boolean, string, number or null, but found "+nc(dc(e))+" instead.");if(!sc(r,["string","array"]))throw new vc("Expected second argument to be of type array or string, but found "+nc(dc(r))+" instead.");return r.indexOf(e)>=0},Pf.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Pf.prototype.outputDefined=function(){return!0},Pf.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var If=function(t,e,r){this.type=Zh,this.needle=t,this.haystack=e,this.fromIndex=r};If.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,$h),n=e.parse(t[2],2,$h);if(!r||!n)return null;if(!ac(r.type,[Uh,Kh,Zh,Yh,$h]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+nc(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Zh);return i?new If(r,n,i):null}return new If(r,n)},If.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!sc(e,["boolean","string","number","null"]))throw new vc("Expected first argument to be of type boolean, string, number or null, but found "+nc(dc(e))+" instead.");if(!sc(r,["string","array"]))throw new vc("Expected second argument to be of type array or string, but found "+nc(dc(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},If.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},If.prototype.outputDefined=function(){return!1},If.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Ff=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};Ff.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof c&&Math.floor(c)!==c)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,dc(c)))return null}else r=dc(c);if(void 0!==i[String(c)])return u.error("Branch labels must be unique.");i[String(c)]=o.length}var f=e.parse(l,a,n);if(!f)return null;n=n||f.type,o.push(f)}var d=e.parse(t[1],1,$h);if(!d)return null;var y=e.parse(t[t.length-1],t.length-1,n);return y?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new Ff(r,n,d,i,o,y):null},Ff.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(dc(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Ff.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Ff.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},Ff.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,$h),n=e.parse(t[2],2,Zh);if(!r||!n)return null;if(!ac(r.type,[rc($h),Kh,$h]))return e.error("Expected first argument to be of type array or string, but found "+nc(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Zh);return i?new Mf(r.type,r,n,i):null}return new Mf(r.type,r,n)},Mf.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!sc(e,["string","array"]))throw new vc("Expected first argument to be of type array or string, but found "+nc(dc(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},Mf.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Mf.prototype.outputDefined=function(){return!1},Mf.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var zf=jf("==",(function(t,e,r){return e===r}),Lf),Df=jf("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Lf(0,e,r,n)})),Gf=jf("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Wf=jf("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Xf=jf(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),qf=function(t,e,r,n,i){this.type=Kh,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};qf.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Zh);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Kh)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,Kh)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,Zh)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Zh))?null:new qf(r,i,o,a,s)},qf.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},qf.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},qf.prototype.outputDefined=function(){return!1},qf.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Bf=function(t){this.type=Zh,this.input=t};Bf.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+nc(r.type)+" instead."):new Bf(r):null},Bf.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new vc("Expected value to be of type string or array, but found "+nc(dc(e))+" instead.")},Bf.prototype.eachChild=function(t){t(this.input)},Bf.prototype.outputDefined=function(){return!1},Bf.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Vf={"==":zf,"!=":Df,">":Nf,"<":Gf,">=":Xf,"<=":Wf,array:_c,at:Rf,boolean:_c,case:kf,coalesce:Ef,collator:Oc,format:xc,image:bc,in:Pf,"index-of":If,interpolate:Sf,"interpolate-hcl":Sf,"interpolate-lab":Sf,length:Bf,let:Of,literal:gc,match:Ff,number:_c,"number-format":qf,object:_c,slice:Mf,step:Qc,string:_c,"to-boolean":Cc,"to-color":Cc,"to-number":Cc,"to-string":Cc,var:Uc,within:Vc};function Yf(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=cc(r,n,i,a);if(s)throw new vc(s);return new Lh(r/255*a,n/255*a,i/255*a,a)}function Zf(t,e){return t in e}function Kf(t,e){var r=e[t];return void 0===r?null:r}function Uf(t){return{type:t}}function Hf(t){return{result:"success",value:t}}function Jf(t){return{result:"error",value:t}}function $f(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}Ec.register(Vf,{error:[{kind:"error"},[Kh],function(t,e){var r=e[0];throw new vc(r.evaluate(t))}],typeof:[Kh,[$h],function(t,e){return nc(dc(e[0].evaluate(t)))}],"to-rgba":[rc(Zh,4),[Hh],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Hh,[Zh,Zh,Zh],Yf],rgba:[Hh,[Zh,Zh,Zh,Zh],Yf],has:{type:Uh,overloads:[[[Kh],function(t,e){return Zf(e[0].evaluate(t),t.properties())}],[[Kh,Jh],function(t,e){var r=e[0],n=e[1];return Zf(r.evaluate(t),n.evaluate(t))}]]},get:{type:$h,overloads:[[[Kh],function(t,e){return Kf(e[0].evaluate(t),t.properties())}],[[Kh,Jh],function(t,e){var r=e[0],n=e[1];return Kf(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[$h,[Kh],function(t,e){return Kf(e[0].evaluate(t),t.featureState||{})}],properties:[Jh,[],function(t){return t.properties()}],"geometry-type":[Kh,[],function(t){return t.geometryType()}],id:[$h,[],function(t){return t.id()}],zoom:[Zh,[],function(t){return t.globals.zoom}],pitch:[Zh,[],function(t){return t.globals.pitch||0}],"distance-from-center":[Zh,[],function(t){return t.distanceFromCenter()}],"heatmap-density":[Zh,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Zh,[],function(t){return t.globals.lineProgress||0}],"sky-radial-progress":[Zh,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[$h,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Zh,Uf(Zh),function(t,e){for(var r=0,n=0,i=e;n":[Uh,[Kh,$h],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[Uh,[$h],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Uh,[Kh,$h],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[Uh,[$h],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Uh,[Kh,$h],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[Uh,[$h],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Uh,[$h],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Uh,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Uh,[rc(Kh)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Uh,[rc($h)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Uh,[Kh,rc($h)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Uh,[Kh,rc($h)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Uh,overloads:[[[Uh,Uh],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Uf(Uh),function(t,e){for(var r=0,n=e;r-1}(e))return Jf([new Bh("","zoom expressions not supported")]);var o=id(r);if(!o&&!i)return Jf([new Bh("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof Bh)return Jf([o]);if(o instanceof Sf&&!function(t){return!!t.expression&&t.expression.interpolated}(e))return Jf([new Bh("",'"interpolate" expressions cannot be used with this property')]);if(!o)return Hf(new ed(n?"constant":"source",t.value));var a=o instanceof Sf?o.interpolation:void 0;return Hf(new rd(n?"camera":"composite",t.value,o.labels,a))}function id(t){var e=null;if(t instanceof Of)e=id(t.result);else if(t instanceof Ef)for(var r=0,n=t.args;r":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Camera"},pitch:{group:"Camera"},"distance-from-center":{group:"Camera"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"sky-radial-progress":{group:"sky"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},projection:{name:{type:"enum",values:{albers:{},equalEarth:{},equirectangular:{},lambertConformalConic:{},mercator:{},naturalEarth:{},winkelTripel:{},globe:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],transition:!1,requires:[{name:["albers","lambertConformalConic"]}]}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,requires:["source"]}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{type:"array",value:"number",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"property-type":"constant"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};function sd(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e",">=","<","<=","to-boolean"]);function fd(t,e){return te?1:0}function dd(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e"===r||"<="===r||">="===r?gd(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(yd))):"all"===r?["all"].concat(t.slice(1).map(yd)):"none"===r?["all"].concat(t.slice(1).map(yd).map(_d)):"in"===r?vd(t[1],t.slice(2)):"!in"===r?_d(vd(t[1],t.slice(2))):"has"===r?md(t[1]):"!has"===r?_d(md(t[1])):"within"!==r||t}function gd(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function vd(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(fd)]]:["filter-in-small",t,["literal",e]]}}function md(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function _d(t){return["!",t]}var xd=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function bd(t,e){var r={};for(var n in t)"ref"!==n&&(r[n]=t[n]);return xd.forEach((function(t){t in e&&(r[t]=e[t])})),r}var wd={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},Cd=" ",Sd=/(italic|oblique)$/i,Td={},Ed=function(t,e,r){var n=Td[t];if(!n){Array.isArray(t)||(t=[t]);for(var i=400,o="normal",a=[],s=0,l=t.length;s1?u[u.length-2].toLowerCase():"";if(p==h||p==h.replace("-","")||c+"-"+p==h){i=wd[h],u.pop(),c&&h.startsWith(c)&&u.pop();break}}"number"==typeof p&&(i=p);var f=u.join(Cd).replace("Klokantech Noto Sans","Noto Sans");-1!==f.indexOf(Cd)&&(f='"'+f+'"'),a.push(f)}n=Td[t]=[o,i,a]}return n[0]+Cd+n[1]+Cd+e+"px"+(r?"/"+r:"")+Cd+n[2]},Od="https://api.mapbox.com";function Rd(t){return 0!==t.indexOf("mapbox://")?"":t.slice(9)}function Pd(t,e){var r=Rd(t);if(!r)return decodeURI(new URL(t,location.href).href);if(0!==r.indexOf("styles/"))throw new Error("unexpected style url: "+t);var n=r.slice(7);return Od+"/styles/v1/"+n+"?&access_token="+e}function Id(t,e,r,n){var i=new URL(t,n),o=Rd(t);return o?"https://{a-d}.tiles.mapbox.com/v4/"+o+"/{z}/{x}/{y}.vector.pbf?access_token="+e:e?(i.searchParams.set(r,e),decodeURI(i.href)):decodeURI(i.href)}function Fd(t){return t*Math.PI/180}var kd=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function Md(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var r=document.createElement("canvas");return r.width=t,r.height=e,r}var Ad={};function Ld(t,e,r){if(void 0===r&&(r={}),e in Ad)return Ad[e];var n=r.transformRequest&&r.transformRequest(e,t)||new Request(e);n.headers.get("Accept")||n.headers.set("Accept","application/json");var i=fetch(n).then((function(t){return delete Ad[e],t.ok?t.json():Promise.reject(new Error("Error fetching source "+e))})).catch((function(t){return delete Ad[e],Promise.reject(new Error("Error fetching source "+e))}));return Ad[e]=i,i}function jd(t,e){if("string"!=typeof t)return Promise.resolve(t);if(!t.trim().startsWith("{"))return Ld("Style",t=Pd(t,e.accessToken),e);try{var r=JSON.parse(t);return Promise.resolve(r)}catch(t){return Promise.reject(t)}}var zd={};function Dd(t,e,r){void 0===r&&(r={});var n=[e,JSON.stringify(t)].toString(),i=zd[n];if(!i||r.transformRequest){var o=t.url;if(o&&!t.tiles){var a=Id(o,r.accessToken,r.accessTokenParam||"access_token",e||location.href);i=o.startsWith("mapbox://")?Promise.resolve(Object.assign({},t,{url:void 0,tiles:a})):Ld("Source",a,r).then((function(t){for(var e=0,n=t.tiles.length;e=.05){for(var r="",n=t.split("\n"),i=Nd.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 Xd(){return Gd||(Gd=Md(1,1).getContext("2d")),Gd}function qd(t,e){return Xd().measureText(t).width+(t.length-1)*e}var Bd={};function Vd(t,e,r,n){if(-1!==t.indexOf("\n")){for(var i=t.split("\n"),o=[],a=0,s=i.length;a1){var h=Xd();h.font=e;for(var c=h.measureText("M").width*r,f="",d=[],y=0,g=p.length;y1;++_){var b=d[_];if(qd(b,n)<.35*c){var w=_>0?qd(d[_-1],n):1/0,C=_.7*c&&qd(O,n)<.6*c){var R=E.split(" "),P=R.pop();qd(P,n)<.2*c&&(d[S]=R.join(" "),d[S+1]=P+" "+O),T-=1}}u=d.join("\n")}else u=t;u=Wd(u,n),Bd[l]=u}return u}var Yd,Zd=/font-family: ?([^;]*);/,Kd=/("|')/g;function Ud(t){if(!Yd){Yd={};for(var e=document.styleSheets,r=0,n=e.length;r0&&"string"==typeof l[0]&&l[0]in Vf);if(!c&&$f(p)&&(p=function(t,e){var r=t.stops;if(!r)return function(t,e){var r=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",r]:r;if("enum"===e.type)return["match",r,Object.keys(e.values),r,t.default];var n=["color"===e.type?"to-color":e.type,r,jh(t.default)];return"array"===e.type&&n.splice(1,0,e.value,e.length||null),n}(t,e);var n=r&&"object"==typeof r[0][0],i=n||void 0!==t.property,o=n||!i;return r=r.map((function(t){return!i&&e.tokens&&"string"==typeof t[1]?[t[0],qh(t[1])]:[t[0],jh(t[1])]})),n?function(t,e,r){for(var n={},i={},o=[],a=0;a=C.maxzoom)){var I=C.filter;if(!I||ay(S,I,c,p,m)){var F=void 0,k=void 0,M=void 0,A=void 0,L=void 0,j=void 0,z=w.index;if(3==h&&("fill"==C.type||"fill-extrusion"==C.type))if(k=iy(C,"paint",C.type+"-opacity",p,c,v,d),C.type+"-pattern"in E){var D=iy(C,"paint",C.type+"-pattern",p,c,v,d);if(D){var G="string"==typeof D?uy(D,o):D.toString();if(s&&i&&i[G]){++_,(j=P[_])&&j.getFill()&&!j.getStroke()&&!j.getText()||(j=new Is({fill:new es}),P[_]=j),M=j.getFill(),j.setZIndex(z);var N=G+"."+k,W=g[N];if(!W){var X=i[G],q=Md(X.width,X.height),B=q.getContext("2d");B.globalAlpha=k,B.drawImage(s,X.x,X.y,X.width,X.height,0,0,X.width,X.height),W=B.createPattern(q,"repeat"),g[N]=W}M.setColor(W)}}}else F=sy(iy(C,"paint",C.type+"-color",p,c,v,d),k),C.type+"-outline-color"in E&&(L=sy(iy(C,"paint",C.type+"-outline-color",p,c,v,d),k)),L||(L=F),(F||L)&&(++_,(!(j=P[_])||F&&!j.getFill()||!F&&j.getFill()||L&&!j.getStroke()||!L&&j.getStroke()||j.getText())&&(j=new Is({fill:F?new es:void 0,stroke:L?new Ts:void 0}),P[_]=j),F&&(M=j.getFill()).setColor(F),L&&((A=j.getStroke()).setColor(L),A.setWidth(.5)),j.setZIndex(z));if(1!=h&&"line"==C.type){F=!("line-pattern"in E)&&"line-color"in E?sy(iy(C,"paint","line-color",p,c,v,d),iy(C,"paint","line-opacity",p,c,v,d)):void 0;var V=iy(C,"paint","line-width",p,c,v,d);F&&V>0&&(++_,(j=P[_])&&j.getStroke()&&!j.getFill()&&!j.getText()||(j=new Is({stroke:new Ts}),P[_]=j),(A=j.getStroke()).setLineCap(iy(C,"layout","line-cap",p,c,v,d)),A.setLineJoin(iy(C,"layout","line-join",p,c,v,d)),A.setMiterLimit(iy(C,"layout","line-miter-limit",p,c,v,d)),A.setColor(F),A.setWidth(V),A.setLineDash(E["line-dasharray"]?iy(C,"paint","line-dasharray",p,c,v,d).map((function(t){return t*V})):null),j.setZIndex(z))}var Y=!1,Z=null,K=0,U=void 0,H=void 0,J=void 0;if((1==h||2==h)&&"icon-image"in T){var $=iy(C,"layout","icon-image",p,c,v,d);if($){U="string"==typeof $?uy($,o):$.toString();var Q=void 0;if(s&&i&&i[U]){var tt=iy(C,"layout","icon-rotation-alignment",p,c,v,d);if(2==h){var et=e.getGeometry();if(et.getFlatMidpoint||et.getFlatMidpoints){var rt=et.getExtent();if(Math.sqrt(Math.max(Math.pow((rt[2]-rt[0])/r,2),Math.pow((rt[3]-rt[1])/r,2)))>150){var nt="MultiLineString"===et.getType()?et.getFlatMidpoints():et.getFlatMidpoint();if(Qd||(Qd=new Cs("Point",$d=[NaN,NaN],[],{},null)),Q=Qd,$d[0]=nt[0],$d[1]=nt[1],"line"===iy(C,"layout","symbol-placement",p,c,v,d)&&"map"===tt)for(var it=et.getStride(),ot=et.getFlatCoordinates(),at=0,st=ot.length-it;at=ct&&nt[0]<=dt&&nt[1]>=ft&&nt[1]<=yt){K=Math.atan2(ut-ht,pt-lt);break}}}}}if(2!==h||Q){var gt=iy(C,"layout","icon-size",p,c,v,d),vt=void 0!==E["icon-color"]?iy(C,"paint","icon-color",p,c,v,d):null;if(!vt||0!==vt.a){var mt=U+"."+gt;if(null!==vt&&(mt+="."+vt),!(H=y[mt])){var _t=i[U],xt=oy(C,p,c,v);H=new vs({color:vt?[255*vt.r,255*vt.g,255*vt.b,vt.a]:void 0,img:s,imgSize:l,size:[_t.width,_t.height],offset:[_t.x,_t.y],rotateWithView:"map"===tt,scale:gt/_t.pixelRatio,displacement:"icon-offset"in T?iy(C,"layout","icon-offset",p,c,v,d).map((function(t){return-t*_t.pixelRatio})):void 0,declutterMode:xt}),y[mt]=H}}H&&(++_,(j=P[_])&&j.getImage()&&!j.getFill()&&!j.getStroke()||(j=new Is,P[_]=j),j.setGeometry(Q),H.setRotation(K+Fd(iy(C,"layout","icon-rotate",p,c,v,d))),H.setOpacity(iy(C,"paint","icon-opacity",p,c,v,d)),H.setAnchor(ey[iy(C,"layout","icon-anchor",p,c,v,d)]),j.setImage(H),Z=j.getText(),j.setText(void 0),j.setZIndex(z),Y=!0,J=!1)}else J=!0}}}if(1==h&&"circle"===C.type){++_,(j=P[_])&&j.getImage()&&!j.getFill()&&!j.getStroke()||(j=new Is,P[_]=j);var bt="circle-radius"in E?iy(C,"paint","circle-radius",p,c,v,d):5,wt=sy(iy(C,"paint","circle-stroke-color",p,c,v,d),iy(C,"paint","circle-stroke-opacity",p,c,v,d)),Ct=sy(iy(C,"paint","circle-color",p,c,v,d),iy(C,"paint","circle-opacity",p,c,v,d)),St=iy(C,"paint","circle-stroke-width",p,c,v,d),Tt=bt+"."+wt+"."+Ct+"."+St;(H=y[Tt])||(H=new Qa({radius:bt,stroke:wt&&St>0?new Ts({width:St,color:wt}):void 0,fill:Ct?new es({color:Ct}):void 0,declutterMode:"none"}),y[Tt]=H),j.setImage(H),Z=j.getText(),j.setText(void 0),j.setGeometry(void 0),j.setZIndex(z),Y=!0}var Et=void 0,Ot=void 0,Rt=void 0,Pt=void 0,It=void 0,Ft=void 0;if("text-field"in T){Pt=Math.round(iy(C,"layout","text-size",p,c,v,d));var kt=iy(C,"layout","text-font",p,c,v,d);Rt=iy(C,"layout","text-line-height",p,c,v,d),(Ot=Ed(a?a(kt):kt,Pt,Rt)).includes("sans-serif")||(Ot+=",sans-serif"),It=iy(C,"layout","text-letter-spacing",p,c,v,d),Ft=iy(C,"layout","text-max-width",p,c,v,d);var Mt=iy(C,"layout","text-field",p,c,v,d);Et="object"==typeof Mt&&Mt.sections?1===Mt.sections.length?Mt.toString():Mt.sections.reduce((function(t,e,r){var n=e.fontStack?e.fontStack.split(","):kt,i=Ed(a?a(n):n,Pt*(e.scale||1),Rt),o=e.text;if("\n"===o)return t.push("\n",""),t;if(2!=h){for(var s=0,l=(o=Vd(o,i,Ft,It).split("\n")).length;s0&&t.push("\n",""),t.push(o[s],i);return t}t.push(Wd(o,It),i)}),[]):uy(Mt,o).trim(),k=iy(C,"paint","text-opacity",p,c,v,d)}if(Et&&k&&!J){Y||(++_,(j=P[_])&&j.getText()&&!j.getFill()&&!j.getStroke()||(j=new Is,P[_]=j),j.setImage(void 0),j.setGeometry(void 0)),j.getText()||j.setText(Z||new ks({padding:[2,2,2,2]})),Z=j.getText();var At=T["text-transform"];"uppercase"==At?Et=Array.isArray(Et)?Et.map((function(t,e){return e%2?t:t.toUpperCase()})):Et.toUpperCase():"lowercase"==At&&(Et=Array.isArray(Et)?Et.map((function(t,e){return e%2?t:t.toLowerCase()})):Et.toLowerCase());var Lt=Array.isArray(Et)?Et:2==h?Wd(Et,It):Vd(Et,Ot,Ft,It);Z.setText(Lt),Z.setFont(Ot),Z.setRotation(Fd(iy(C,"layout","text-rotate",p,c,v,d)));var jt=iy(C,"layout","text-anchor",p,c,v,d),zt=Y||1==h?"point":iy(C,"layout","symbol-placement",p,c,v,d);Z.setPlacement(zt),Z.setOverflow("point"===zt);var Dt=iy(C,"paint","text-halo-width",p,c,v,d),Gt=iy(C,"layout","text-offset",p,c,v,d),Nt=iy(C,"paint","text-translate",p,c,v,d),Wt=0,Xt=0;if("point"==zt){var qt="center";-1!==jt.indexOf("left")?(qt="left",Xt=Dt):-1!==jt.indexOf("right")&&(qt="right",Xt=-Dt),Z.setTextAlign(qt);var Bt=iy(C,"layout","text-rotation-alignment",p,c,v,d);Z.setRotateWithView("map"==Bt)}else Z.setMaxAngle(Fd(iy(C,"layout","text-max-angle",p,c,v,d))*Et.length/Lt.length),Z.setTextAlign(),Z.setRotateWithView(!1);var Vt="middle";0==jt.indexOf("bottom")?(Vt="bottom",Wt=-Dt-.5*(Rt-1)*Pt):0==jt.indexOf("top")&&(Vt="top",Wt=Dt+.5*(Rt-1)*Pt),Z.setTextBaseline(Vt),Z.setOffsetX(Gt[0]*Pt+Xt+Nt[0]),Z.setOffsetY(Gt[1]*Pt+Wt+Nt[1]),R.setColor(sy(iy(C,"paint","text-color",p,c,v,d),k)),Z.setFill(R);var Yt=sy(iy(C,"paint","text-halo-color",p,c,v,d),k);if(Yt){O.setColor(Yt),Dt*=2;var Zt=.5*Pt;O.setWidth(Dt<=Zt?Dt:Zt),Z.setStroke(O)}else Z.setStroke(void 0);var Kt=iy(C,"layout","text-padding",p,c,v,d),Ut=Z.getPadding();Kt!==Ut[0]&&(Ut[0]=Kt,Ut[1]=Kt,Ut[2]=Kt,Ut[3]=Kt),j.setZIndex(z)}}}}return _>-1?(P.length=_+1,P):void 0}};return t.setStyle(I),t.set("mapbox-source",h),t.set("mapbox-layers",d),t.set("mapbox-featurestate",{}),I}(t,e,r,i,u,p,Jd),t.getStyle()?f().then(n).catch(l):l(new Error("Nothing to show for source ["+a+"]")))}if(e.sprite){var y=new URL(function(t,e,r){var n=Rd(t);if(!n)return decodeURI(new URL(t,r).href);if(0!==n.indexOf("sprites/"))throw new Error("unexpected sprites url: "+t);var i=n.slice(8);return Od+"/styles/v1/"+i+"/sprite?access_token="+e}(e.sprite,s.accessToken,o||location.href)),g=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",v=y.origin+y.pathname+g+".json"+y.search;new Promise((function(t,e){Ld("Sprite",v,s).then(t).catch((function(r){Ld("Sprite",v=y.origin+y.pathname+".json"+y.search,s).then(t).catch(e)}))})).then((function(t){if(void 0===t&&l(new Error("No sprites found.")),u=t,p=y.origin+y.pathname+g+".png"+y.search,s.transformRequest){var e=s.transformRequest(p,"SpriteImage");e instanceof Request&&(p=encodeURI(e.url))}d()})).catch((function(t){l(new Error("Sprites cannot be loaded: "+v+": "+t.message))}))}else d()})).catch(l)}))}var cy={};function fy(t,e){var r={id:e.id,type:e.type},n={};function i(i){var o=e.layout||{},a=e.paint||{};r.paint=a;var s,l,u="function"==typeof t.getSource?t.getSource().getTileGrid().getZForResolution(i):t.getView().getZoom(),p="function"==typeof t.getTargetElement?t.getTargetElement():void 0;if(void 0!==a["background-color"]&&(s=iy(r,"paint","background-color",u,cy,n),p&&(p.style.background=Lh.parse(s).toString())),void 0!==a["background-opacity"]&&(l=iy(r,"paint","background-opacity",u,cy,n),p&&(p.style.opacity=l)),"none"!=o.visibility)return sy(s,l);p&&(p.style.backgroundColor="",p.style.opacity="")}if("function"==typeof t.getTargetElement)t.getTargetElement()&&i(),t.on(["change:resolution","change:target"],i);else{if("function"!=typeof t.setBackground)throw new Error("Unable to apply background.");t.setBackground(i)}}function dy(t,e){var r;return t.some((function(t){if(t.id==e)return r=t.source,!0})),r}function yy(t){var e=t.bounds;if(e){var r=Yn([e[0],e[1]]),n=Yn([e[2],e[3]]);return[r[0],r[1],n[0],n[1]]}}function gy(t,e,r){return new Promise((function(n,i){Dd(t,e,r).then((function(t){var e=new xu({tileJSON:t}),r=e.getTileJSON(),i=e.getTileGrid(),o=yy(r),a=r.minzoom||0,s=r.maxzoom||22,l={attributions:e.getAttributions(),format:new ml,tileGrid:new Rl({origin:i.getOrigin(0),extent:o||i.getExtent(),minZoom:a,resolutions:kd.slice(0,s+1),tileSize:512})};Array.isArray(r.tiles)?l.urls=r.tiles:l.url=r.tiles,t.olSourceOptions&&Object.assign(l,t.olSourceOptions),n(new Eh(l))})).catch(i)}))}function vy(t,e,r){var n=new vh({declutter:!0,visible:!1});return gy(t,e,r).then((function(e){e.set("mapbox-source",t),n.setSource(e)})).catch((function(t){n.setSource(void 0)})),n}function my(t,e,r){var n=new zu;return Dd(t,e,r).then((function(e){var r=new xu({transition:0,crossOrigin:"anonymous",tileJSON:e}),i=yy(e),o=r.getTileGrid(),a=t.tileSize||e.tileSize||512,s=e.minzoom||0,l=e.maxzoom||22;r.tileGrid=new Rl({origin:o.getOrigin(0),extent:i||o.getExtent(),minZoom:s,resolutions:Ql({maxZoom:l,tileSize:a}).getResolutions(),tileSize:a});var u=r.getTileUrlFunction();r.setTileUrlFunction((function(t,e,n){var i=u(t,e,n);if(-1!=i.indexOf("{bbox-epsg-3857}")){var o=r.getTileGrid().getTileCoordExtent(t);i=i.replace("{bbox-epsg-3857}",o.toString())}return i})),r.set("mapbox-source",t),n.setSource(r)})).catch((function(t){n.setSource(void 0)})),n}var _y=new pl;function xy(t,e,r){var n=t.data,i={};if("string"==typeof n){var o=Id(n,r.accessToken,r.accessTokenParam||"access_token",e||location.href);if(r.transformRequest){var a=r.transformRequest(o,"GeoJSON");a instanceof Request&&(o=encodeURI(a.url))}i.url=o}else i.features=_y.readFeatures(n,{featureProjection:ei()||"EPSG:3857"});var s=new sh(Object.assign({attributions:t.attribution,format:_y},i));return s.set("mapbox-source",t),s}function by(t,e,r){return new Jp({declutter:!0,source:xy(t,e,r),visible:!1})}function wy(t,e,r,n){var i=iy(t,"paint","raster-opacity",r.getZoom(),cy,n);e.setOpacity(i)}function Cy(t,e,r,n){var i=[],o=e.getView();o.isDef()||o.getRotation()||o.getResolutions()||(o=new wo(Object.assign(o.getProperties(),{maxResolution:kd[0]})),e.setView(o)),"center"in t&&!o.getCenter()&&o.setCenter(Yn(t.center)),"zoom"in t&&void 0===o.getZoom()&&o.setResolution(kd[0]/Math.pow(2,t.zoom)),o.getCenter()&&void 0!==o.getZoom()||o.fit(o.getProjection().getExtent(),{nearest:!0,size:e.getSize()});for(var a,s,l,u,p,h=t.layers,c=[],f=0,d=h.length;f0||h>0)&&t.setMaxResolution(Math.min(kd[a],p.getResolution(h))+1e-9),s<24&&t.setMinResolution(kd[s]+1e-9)}}i instanceof sh||i instanceof Eh?hy(t,r,e,Object.assign({styleUrl:n},o)).then((function(){t.setVisible(!0),l()})).catch(u):l()}else u(new Error("Error accessing data for source "+t.get("mapbox-source")))};t.set("mapbox-layers",e),-1===i.getLayers().getArray().indexOf(t)&&i.addLayer(t),t.getSource()?p():t.once("change:source",p)}))}var Ty=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ey=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,wrapX:e.wrapX})||this;return r.resolution=void 0,r.distance=void 0!==e.distance?e.distance:20,r.minDistance=e.minDistance||0,r.interpolationRatio=0,r.features=[],r.geometryFunction=e.geometryFunction||function(t){var e=t.getGeometry();return D(e.getType()==an,10),e},r.createCustomCluster_=e.createCluster,r.source=null,r.boundRefresh_=r.refresh.bind(r),r.updateDistance(r.distance,r.minDistance),r.setSource(e.source||null),r}return Ty(e,t),e.prototype.clear=function(e){this.features.length=0,t.prototype.clear.call(this,e)},e.prototype.getDistance=function(){return this.distance},e.prototype.getSource=function(){return this.source},e.prototype.loadFeatures=function(t,e,r){this.source.loadFeatures(t,e,r),e!==this.resolution&&(this.resolution=e,this.refresh())},e.prototype.setDistance=function(t){this.updateDistance(t,this.minDistance)},e.prototype.setMinDistance=function(t){this.updateDistance(this.distance,t)},e.prototype.getMinDistance=function(){return this.minDistance},e.prototype.setSource=function(t){this.source&&this.source.removeEventListener(re,this.boundRefresh_),this.source=t,t&&t.addEventListener(re,this.boundRefresh_),this.refresh()},e.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features)},e.prototype.updateDistance=function(t,e){var r=0===t?0:Math.min(e,t)/t,n=t!==this.distance||this.interpolationRatio!==r;this.distance=t,this.minDistance=e,this.interpolationRatio=r,n&&this.refresh()},e.prototype.cluster=function(){if(void 0!==this.resolution&&this.source)for(var t=[1/0,1/0,-1/0,-1/0],e=this.distance*this.resolution,r=this.source.getFeatures(),n={},i=0,o=r.length;i=0;--n){var i=this.geometryFunction(t[n]);i?De(r,i.getCoordinates()):t.splice(n,1)}We(r,1/t.length);var o=vt(e),a=this.interpolationRatio,s=new $i([r[0]*(1-a)+o[0]*a,r[1]*(1-a)+o[1]*a]);return this.createCustomCluster_?this.createCustomCluster_(s,t):new Ls({geometry:s,features:t})},e}(sh);const Oy=Ey;(()=>{const{application:t,Stimulus:e}=window;if(!t)return null;t.register("map-instance",class extends e.Controller{static get values(){return{instance:String,nodes:Array,token:String}}connect(){this.nodesValue=window.mapInstances?window.mapInstances[this.instanceValue]:[]}nodesValueChanged(){this.element.innerHTML="";const t=this.nodesValue;if(!t||t.length<1)return null;(function(t,e,r){void 0===r&&(r={}),("string"==typeof t||t instanceof HTMLElement)&&(t=new Ba({target:t}));var n=e.startsWith("data:")?location.href:Pd(e,r.accessToken);return r=py(n,r),new Promise((function(i,o){jd(e,r).then((function(e){Cy(e,t,n,r).then((function(){i(t)})).catch(o)})).catch((function(t){o(new Error("Could not load "+e+": "+t.message))}))}))})(new Ba({target:this.element.id}),"https://api.maptiler.com/maps/908dbadb-b4a9-47c6-a3a6-583ade513792/style.json?key=Ouis01B3GajK3e6iqCI4").then((e=>{e.setView(new wo({center:Yn([0,22]),zoom:1}));const r=new Jp({source:new Oy({distance:20,minDistance:20,source:new sh({features:t.map((t=>new Ls({geometry:new $i(Yn([t.lng,t.lat])),name:t.name})))})}),style:t=>{const e=t.get("features"),r=e.length;if(1==e.length){const t=e[0].get("name");return new Is({image:new Qa({radius:6,stroke:new Ts({color:"rgba(23,92,255, 0.2)",width:12}),fill:new es({color:"#175CFF"})}),text:new ks({text:[t,'bold 12px "Neurial Grotesk", Roboto, system, -apple-system, BlinkMacSystemFont, ".SFNSDisplay-Regular", "Helvetica Neue", Helvetica, Arial, sans-serif'],fill:new es({color:"#0a083b"}),offsetY:-30,stroke:new Ts({color:"#fff",width:3})})})}return new Is({image:new Qa({radius:12,stroke:new Ts({color:"rgba(23,92,255, 0.2)",width:4}),fill:new es({color:"#175CFF"})}),text:new ks({text:r.toString(),scale:1.25,fill:new es({color:"#fff"})})})}});e.addLayer(r)}))}})})()})()})();;