@zvonimirsun/map-sdk 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2d/full/umd/{index.full.cjs → map-sdk.cjs} +1 -1
- package/dist/2d/full/umd/map-sdk.cjs.map +1 -0
- package/dist/3d/full/umd/{index.full.cjs → map-sdk.cjs} +1 -1
- package/dist/3d/full/umd/map-sdk.cjs.map +1 -0
- package/lib/index.full.cjs +2 -2
- package/package.json +4 -4
- package/dist/2d/full/umd/index.full.cjs.map +0 -1
- package/dist/3d/full/umd/index.full.cjs.map +0 -1
|
@@ -641,4 +641,4 @@ uniform `+St+" "+kt+" u_"+It+`;
|
|
|
641
641
|
`}),staticAttributes:E,staticUniforms:V}}var pc=Object.freeze({__proto__:null,prelude:zo,background:Sh,backgroundPattern:ga,circle:Ch,clippingMask:Ul,heatmap:Lh,heatmapTexture:kh,collisionBox:hc,collisionCircle:Ph,debug:Ia,fill:yo,fillOutline:cc,fillOutlinePattern:Ta,fillPattern:fi,fillExtrusion:Ru,fillExtrusionPattern:Qs,hillshadePrepare:Ih,hillshade:zs,line:fc,lineGradient:ns,linePattern:ma,lineSDF:vo,raster:Go,symbolIcon:Bu,symbolSDF:Du,symbolTextAndIcon:qo}),na=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function Mn(f){for(var b=[],p=0;p<f.length;p++)if(f[p]!==null){var E=f[p].split(" ");b.push(E.pop())}return b}na.prototype.bind=function(f,b,p,E,B,q,V,Y){this.context=f;for(var ot=this.boundPaintVertexBuffers.length!==E.length,gt=0;!ot&><E.length;gt++)this.boundPaintVertexBuffers[gt]!==E[gt]&&(ot=!0);f.extVertexArrayObject&&this.vao&&this.boundProgram===b&&this.boundLayoutVertexBuffer===p&&!ot&&this.boundIndexBuffer===B&&this.boundVertexOffset===q&&this.boundDynamicVertexBuffer===V&&this.boundDynamicVertexBuffer2===Y?(f.bindVertexArrayOES.set(this.vao),V&&V.bind(),B&&B.dynamicDraw&&B.bind(),Y&&Y.bind()):this.freshBind(b,p,E,B,q,V,Y)},na.prototype.freshBind=function(f,b,p,E,B,q,V){var Y,ot=f.numAttributes,gt=this.context,St=gt.gl;if(gt.extVertexArrayObject)this.vao&&this.destroy(),this.vao=gt.extVertexArrayObject.createVertexArrayOES(),gt.bindVertexArrayOES.set(this.vao),Y=0,this.boundProgram=f,this.boundLayoutVertexBuffer=b,this.boundPaintVertexBuffers=p,this.boundIndexBuffer=E,this.boundVertexOffset=B,this.boundDynamicVertexBuffer=q,this.boundDynamicVertexBuffer2=V;else{Y=gt.currentNumAttributes||0;for(var kt=ot;kt<Y;kt++)St.disableVertexAttribArray(kt)}b.enableAttributes(St,f);for(var It=0,Xt=p;It<Xt.length;It+=1)Xt[It].enableAttributes(St,f);q&&q.enableAttributes(St,f),V&&V.enableAttributes(St,f),b.bind(),b.setVertexAttribPointers(St,f,B);for(var Bt=0,ae=p;Bt<ae.length;Bt+=1){var Jt=ae[Bt];Jt.bind(),Jt.setVertexAttribPointers(St,f,B)}q&&(q.bind(),q.setVertexAttribPointers(St,f,B)),E&&E.bind(),V&&(V.bind(),V.setVertexAttribPointers(St,f,B)),gt.currentNumAttributes=ot},na.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var cl=function(f,b,p,E,B,q){var V=f.gl;this.program=V.createProgram();for(var Y=Mn(p.staticAttributes),ot=E?E.getBinderAttributes():[],gt=Y.concat(ot),St=p.staticUniforms?Mn(p.staticUniforms):[],kt=E?E.getBinderUniforms():[],It=[],Xt=0,Bt=St.concat(kt);Xt<Bt.length;Xt+=1){var ae=Bt[Xt];It.indexOf(ae)<0&&It.push(ae)}var Jt=E?E.defines():[];q&&Jt.push("#define OVERDRAW_INSPECTOR;");var he=Jt.concat(zo.fragmentSource,p.fragmentSource).join(`
|
|
642
642
|
`),Me=Jt.concat(zo.vertexSource,p.vertexSource).join(`
|
|
643
643
|
`),Ie=V.createShader(V.FRAGMENT_SHADER);if(V.isContextLost())this.failedToCreate=!0;else{V.shaderSource(Ie,he),V.compileShader(Ie),V.attachShader(this.program,Ie);var De=V.createShader(V.VERTEX_SHADER);if(V.isContextLost())this.failedToCreate=!0;else{V.shaderSource(De,Me),V.compileShader(De),V.attachShader(this.program,De),this.attributes={};var Ne={};this.numAttributes=gt.length;for(var Ge=0;Ge<this.numAttributes;Ge++)gt[Ge]&&(V.bindAttribLocation(this.program,Ge,gt[Ge]),this.attributes[gt[Ge]]=Ge);V.linkProgram(this.program),V.deleteShader(De),V.deleteShader(Ie);for(var je=0;je<It.length;je++){var Ye=It[je];if(Ye&&!Ne[Ye]){var ar=V.getUniformLocation(this.program,Ye);ar&&(Ne[Ye]=ar)}}this.fixedUniforms=B(f,Ne),this.binderUniforms=E?E.getUniforms(f,Ne):[]}}};function Th(f,b,p){var E=1/Tn(p,1,b.transform.tileZoom),B=Math.pow(2,p.tileID.overscaledZ),q=p.tileSize*Math.pow(2,b.transform.tileZoom)/B,V=q*(p.tileID.canonical.x+p.tileID.wrap*B),Y=q*p.tileID.canonical.y;return{u_image:0,u_texsize:p.imageAtlasTexture.size,u_scale:[E,f.fromScale,f.toScale],u_fade:f.t,u_pixel_coord_upper:[V>>16,Y>>16],u_pixel_coord_lower:[65535&V,65535&Y]}}cl.prototype.draw=function(f,b,p,E,B,q,V,Y,ot,gt,St,kt,It,Xt,Bt,ae){var Jt,he=f.gl;if(!this.failedToCreate){for(var Me in f.program.set(this.program),f.setDepthMode(p),f.setStencilMode(E),f.setColorMode(B),f.setCullFace(q),this.fixedUniforms)this.fixedUniforms[Me].set(V[Me]);Xt&&Xt.setUniforms(f,this.binderUniforms,kt,{zoom:It});for(var Ie=(Jt={},Jt[he.LINES]=2,Jt[he.TRIANGLES]=3,Jt[he.LINE_STRIP]=1,Jt)[b],De=0,Ne=St.get();De<Ne.length;De+=1){var Ge=Ne[De],je=Ge.vaos||(Ge.vaos={});(je[Y]||(je[Y]=new na)).bind(f,this,ot,Xt?Xt.getPaintVertexBuffers():[],gt,Ge.vertexOffset,Bt,ae),he.drawElements(b,Ge.primitiveLength*Ie,he.UNSIGNED_SHORT,Ge.primitiveOffset*Ie*2)}}};var Ah=function(f,b,p,E){var B=b.style.light,q=B.properties.get("position"),V=[q.x,q.y,q.z],Y=t.create$1();B.properties.get("anchor")==="viewport"&&t.fromRotation(Y,-b.transform.angle),t.transformMat3(V,V,Y);var ot=B.properties.get("color");return{u_matrix:f,u_lightpos:V,u_lightintensity:B.properties.get("intensity"),u_lightcolor:[ot.r,ot.g,ot.b],u_vertical_gradient:+p,u_opacity:E}},Vl=function(f,b,p,E,B,q,V){return t.extend(Ah(f,b,p,E),Th(q,b,V),{u_height_factor:-Math.pow(2,B.overscaledZ)/V.tileSize/8})},jl=function(f){return{u_matrix:f}},An=function(f,b,p,E){return t.extend(jl(f),Th(p,b,E))},ya=function(f,b){return{u_matrix:f,u_world:b}},as=function(f,b,p,E,B){return t.extend(An(f,b,p,E),{u_world:B})},$s=function(f,b,p,E){var B,q,V=f.transform;if(E.paint.get("circle-pitch-alignment")==="map"){var Y=Tn(p,1,V.zoom);B=!0,q=[Y,Y]}else B=!1,q=V.pixelsToGLUnits;return{u_camera_to_center_distance:V.cameraToCenterDistance,u_scale_with_map:+(E.paint.get("circle-pitch-scale")==="map"),u_matrix:f.translatePosMatrix(b.posMatrix,p,E.paint.get("circle-translate"),E.paint.get("circle-translate-anchor")),u_pitch_with_map:+B,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:q}},Gn=function(f,b,p){var E=Tn(p,1,b.zoom),B=Math.pow(2,b.zoom-p.tileID.overscaledZ),q=p.tileID.overscaleFactor();return{u_matrix:f,u_camera_to_center_distance:b.cameraToCenterDistance,u_pixels_to_tile_units:E,u_extrude_scale:[b.pixelsToGLUnits[0]/(E*B),b.pixelsToGLUnits[1]/(E*B)],u_overscale_factor:q}},Gs=function(f,b,p){return{u_matrix:f,u_inv_matrix:b,u_camera_to_center_distance:p.cameraToCenterDistance,u_viewport_size:[p.width,p.height]}},to=function(f,b,p){return p===void 0&&(p=1),{u_matrix:f,u_color:b,u_overlay:0,u_overlay_scale:p}},Zl=function(f){return{u_matrix:f}},Oh=function(f,b,p,E){return{u_matrix:f,u_extrude_scale:Tn(b,1,p),u_intensity:E}},lu=function(f,b,p){var E=f.transform;return{u_matrix:ss(f,b,p),u_ratio:1/Tn(b,1,E.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/E.pixelsToGLUnits[0],1/E.pixelsToGLUnits[1]]}},Aa=function(f,b,p,E){return t.extend(lu(f,b,p),{u_image:0,u_image_height:E})},fl=function(f,b,p,E){var B=f.transform,q=pl(b,B);return{u_matrix:ss(f,b,p),u_texsize:b.imageAtlasTexture.size,u_ratio:1/Tn(b,1,B.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[q,E.fromScale,E.toScale],u_fade:E.t,u_units_to_pixels:[1/B.pixelsToGLUnits[0],1/B.pixelsToGLUnits[1]]}},_o=function(f,b,p,E,B){var q=f.lineAtlas,V=pl(b,f.transform),Y=p.layout.get("line-cap")==="round",ot=q.getDash(E.from,Y),gt=q.getDash(E.to,Y),St=ot.width*B.fromScale,kt=gt.width*B.toScale;return t.extend(lu(f,b,p),{u_patternscale_a:[V/St,-ot.height/2],u_patternscale_b:[V/kt,-gt.height/2],u_sdfgamma:q.width/(256*Math.min(St,kt)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:ot.y,u_tex_y_b:gt.y,u_mix:B.t})};function pl(f,b){return 1/Tn(f,1,b.tileZoom)}function ss(f,b,p){return f.translatePosMatrix(b.tileID.posMatrix,b,p.paint.get("line-translate"),p.paint.get("line-translate-anchor"))}var eo=function(f,b,p,E,B){return{u_matrix:f,u_tl_parent:b,u_scale_parent:p,u_buffer_scale:1,u_fade_t:E.mix,u_opacity:E.opacity*B.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:B.paint.get("raster-brightness-min"),u_brightness_high:B.paint.get("raster-brightness-max"),u_saturation_factor:(V=B.paint.get("raster-saturation"),V>0?1-1/(1.001-V):-V),u_contrast_factor:(q=B.paint.get("raster-contrast"),q>0?1/(1-q):1+q),u_spin_weights:dl(B.paint.get("raster-hue-rotate"))};var q,V};function dl(f){f*=Math.PI/180;var b=Math.sin(f),p=Math.cos(f);return[(2*p+1)/3,(-Math.sqrt(3)*b-p+1)/3,(Math.sqrt(3)*b-p+1)/3]}var ro,os=function(f,b,p,E,B,q,V,Y,ot,gt){var St=B.transform;return{u_is_size_zoom_constant:+(f==="constant"||f==="source"),u_is_size_feature_constant:+(f==="constant"||f==="camera"),u_size_t:b?b.uSizeT:0,u_size:b?b.uSize:0,u_camera_to_center_distance:St.cameraToCenterDistance,u_pitch:St.pitch/360*2*Math.PI,u_rotate_symbol:+p,u_aspect_ratio:St.width/St.height,u_fade_change:B.options.fadeDuration?B.symbolFadeChange:1,u_matrix:q,u_label_plane_matrix:V,u_coord_matrix:Y,u_is_text:+ot,u_pitch_with_map:+E,u_texsize:gt,u_texture:0}},Uo=function(f,b,p,E,B,q,V,Y,ot,gt,St){var kt=B.transform;return t.extend(os(f,b,p,E,B,q,V,Y,ot,gt),{u_gamma_scale:E?Math.cos(kt._pitch)*kt.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:1})},Fi=function(f,b,p,E,B,q,V,Y,ot,gt){return t.extend(Uo(f,b,p,E,B,q,V,Y,!0,ot),{u_texsize_icon:gt,u_texture_icon:1})},hu=function(f,b,p){return{u_matrix:f,u_opacity:b,u_color:p}},Ms=function(f,b,p,E,B,q){return t.extend(function(V,Y,ot,gt){var St=ot.imageManagerFactory.getPattern(V.from.toString()),kt=ot.imageManagerFactory.getPattern(V.to.toString()),It=ot.imageManagerFactory.getPixelSize(),Xt=It.width,Bt=It.height,ae=Math.pow(2,gt.tileID.overscaledZ),Jt=gt.tileSize*Math.pow(2,ot.transform.tileZoom)/ae,he=Jt*(gt.tileID.canonical.x+gt.tileID.wrap*ae),Me=Jt*gt.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:St.tl,u_pattern_br_a:St.br,u_pattern_tl_b:kt.tl,u_pattern_br_b:kt.br,u_texsize:[Xt,Bt],u_mix:Y.t,u_pattern_size_a:St.displaySize,u_pattern_size_b:kt.displaySize,u_scale_a:Y.fromScale,u_scale_b:Y.toScale,u_tile_units_to_pixels:1/Tn(gt,1,ot.transform.tileZoom),u_pixel_coord_upper:[he>>16,Me>>16],u_pixel_coord_lower:[65535&he,65535&Me]}}(E,q,p,B),{u_matrix:f,u_opacity:b})},gl={fillExtrusion:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_lightpos:new t.Uniform3f(f,b.u_lightpos),u_lightintensity:new t.Uniform1f(f,b.u_lightintensity),u_lightcolor:new t.Uniform3f(f,b.u_lightcolor),u_vertical_gradient:new t.Uniform1f(f,b.u_vertical_gradient),u_opacity:new t.Uniform1f(f,b.u_opacity)}},fillExtrusionPattern:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_lightpos:new t.Uniform3f(f,b.u_lightpos),u_lightintensity:new t.Uniform1f(f,b.u_lightintensity),u_lightcolor:new t.Uniform3f(f,b.u_lightcolor),u_vertical_gradient:new t.Uniform1f(f,b.u_vertical_gradient),u_height_factor:new t.Uniform1f(f,b.u_height_factor),u_image:new t.Uniform1i(f,b.u_image),u_texsize:new t.Uniform2f(f,b.u_texsize),u_pixel_coord_upper:new t.Uniform2f(f,b.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(f,b.u_pixel_coord_lower),u_scale:new t.Uniform3f(f,b.u_scale),u_fade:new t.Uniform1f(f,b.u_fade),u_opacity:new t.Uniform1f(f,b.u_opacity)}},fill:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix)}},fillPattern:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_image:new t.Uniform1i(f,b.u_image),u_texsize:new t.Uniform2f(f,b.u_texsize),u_pixel_coord_upper:new t.Uniform2f(f,b.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(f,b.u_pixel_coord_lower),u_scale:new t.Uniform3f(f,b.u_scale),u_fade:new t.Uniform1f(f,b.u_fade)}},fillOutline:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_world:new t.Uniform2f(f,b.u_world)}},fillOutlinePattern:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_world:new t.Uniform2f(f,b.u_world),u_image:new t.Uniform1i(f,b.u_image),u_texsize:new t.Uniform2f(f,b.u_texsize),u_pixel_coord_upper:new t.Uniform2f(f,b.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(f,b.u_pixel_coord_lower),u_scale:new t.Uniform3f(f,b.u_scale),u_fade:new t.Uniform1f(f,b.u_fade)}},circle:function(f,b){return{u_camera_to_center_distance:new t.Uniform1f(f,b.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(f,b.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(f,b.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(f,b.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(f,b.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(f,b.u_matrix)}},collisionBox:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_camera_to_center_distance:new t.Uniform1f(f,b.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(f,b.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(f,b.u_extrude_scale),u_overscale_factor:new t.Uniform1f(f,b.u_overscale_factor)}},collisionCircle:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_inv_matrix:new t.UniformMatrix4f(f,b.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(f,b.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(f,b.u_viewport_size)}},debug:function(f,b){return{u_color:new t.UniformColor(f,b.u_color),u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_overlay:new t.Uniform1i(f,b.u_overlay),u_overlay_scale:new t.Uniform1f(f,b.u_overlay_scale)}},clippingMask:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix)}},heatmap:function(f,b){return{u_extrude_scale:new t.Uniform1f(f,b.u_extrude_scale),u_intensity:new t.Uniform1f(f,b.u_intensity),u_matrix:new t.UniformMatrix4f(f,b.u_matrix)}},heatmapTexture:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_world:new t.Uniform2f(f,b.u_world),u_image:new t.Uniform1i(f,b.u_image),u_color_ramp:new t.Uniform1i(f,b.u_color_ramp),u_opacity:new t.Uniform1f(f,b.u_opacity)}},hillshade:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_image:new t.Uniform1i(f,b.u_image),u_latrange:new t.Uniform2f(f,b.u_latrange),u_light:new t.Uniform2f(f,b.u_light),u_shadow:new t.UniformColor(f,b.u_shadow),u_highlight:new t.UniformColor(f,b.u_highlight),u_accent:new t.UniformColor(f,b.u_accent)}},hillshadePrepare:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_image:new t.Uniform1i(f,b.u_image),u_dimension:new t.Uniform2f(f,b.u_dimension),u_zoom:new t.Uniform1f(f,b.u_zoom),u_unpack:new t.Uniform4f(f,b.u_unpack)}},line:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_ratio:new t.Uniform1f(f,b.u_ratio),u_device_pixel_ratio:new t.Uniform1f(f,b.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(f,b.u_units_to_pixels)}},lineGradient:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_ratio:new t.Uniform1f(f,b.u_ratio),u_device_pixel_ratio:new t.Uniform1f(f,b.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(f,b.u_units_to_pixels),u_image:new t.Uniform1i(f,b.u_image),u_image_height:new t.Uniform1f(f,b.u_image_height)}},linePattern:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_texsize:new t.Uniform2f(f,b.u_texsize),u_ratio:new t.Uniform1f(f,b.u_ratio),u_device_pixel_ratio:new t.Uniform1f(f,b.u_device_pixel_ratio),u_image:new t.Uniform1i(f,b.u_image),u_units_to_pixels:new t.Uniform2f(f,b.u_units_to_pixels),u_scale:new t.Uniform3f(f,b.u_scale),u_fade:new t.Uniform1f(f,b.u_fade)}},lineSDF:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_ratio:new t.Uniform1f(f,b.u_ratio),u_device_pixel_ratio:new t.Uniform1f(f,b.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(f,b.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(f,b.u_patternscale_a),u_patternscale_b:new t.Uniform2f(f,b.u_patternscale_b),u_sdfgamma:new t.Uniform1f(f,b.u_sdfgamma),u_image:new t.Uniform1i(f,b.u_image),u_tex_y_a:new t.Uniform1f(f,b.u_tex_y_a),u_tex_y_b:new t.Uniform1f(f,b.u_tex_y_b),u_mix:new t.Uniform1f(f,b.u_mix)}},raster:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_tl_parent:new t.Uniform2f(f,b.u_tl_parent),u_scale_parent:new t.Uniform1f(f,b.u_scale_parent),u_buffer_scale:new t.Uniform1f(f,b.u_buffer_scale),u_fade_t:new t.Uniform1f(f,b.u_fade_t),u_opacity:new t.Uniform1f(f,b.u_opacity),u_image0:new t.Uniform1i(f,b.u_image0),u_image1:new t.Uniform1i(f,b.u_image1),u_brightness_low:new t.Uniform1f(f,b.u_brightness_low),u_brightness_high:new t.Uniform1f(f,b.u_brightness_high),u_saturation_factor:new t.Uniform1f(f,b.u_saturation_factor),u_contrast_factor:new t.Uniform1f(f,b.u_contrast_factor),u_spin_weights:new t.Uniform3f(f,b.u_spin_weights)}},symbolIcon:function(f,b){return{u_is_size_zoom_constant:new t.Uniform1i(f,b.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(f,b.u_is_size_feature_constant),u_size_t:new t.Uniform1f(f,b.u_size_t),u_size:new t.Uniform1f(f,b.u_size),u_camera_to_center_distance:new t.Uniform1f(f,b.u_camera_to_center_distance),u_pitch:new t.Uniform1f(f,b.u_pitch),u_rotate_symbol:new t.Uniform1i(f,b.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(f,b.u_aspect_ratio),u_fade_change:new t.Uniform1f(f,b.u_fade_change),u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(f,b.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(f,b.u_coord_matrix),u_is_text:new t.Uniform1i(f,b.u_is_text),u_pitch_with_map:new t.Uniform1i(f,b.u_pitch_with_map),u_texsize:new t.Uniform2f(f,b.u_texsize),u_texture:new t.Uniform1i(f,b.u_texture)}},symbolSDF:function(f,b){return{u_is_size_zoom_constant:new t.Uniform1i(f,b.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(f,b.u_is_size_feature_constant),u_size_t:new t.Uniform1f(f,b.u_size_t),u_size:new t.Uniform1f(f,b.u_size),u_camera_to_center_distance:new t.Uniform1f(f,b.u_camera_to_center_distance),u_pitch:new t.Uniform1f(f,b.u_pitch),u_rotate_symbol:new t.Uniform1i(f,b.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(f,b.u_aspect_ratio),u_fade_change:new t.Uniform1f(f,b.u_fade_change),u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(f,b.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(f,b.u_coord_matrix),u_is_text:new t.Uniform1i(f,b.u_is_text),u_pitch_with_map:new t.Uniform1i(f,b.u_pitch_with_map),u_texsize:new t.Uniform2f(f,b.u_texsize),u_texture:new t.Uniform1i(f,b.u_texture),u_gamma_scale:new t.Uniform1f(f,b.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(f,b.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(f,b.u_is_halo)}},symbolTextAndIcon:function(f,b){return{u_is_size_zoom_constant:new t.Uniform1i(f,b.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(f,b.u_is_size_feature_constant),u_size_t:new t.Uniform1f(f,b.u_size_t),u_size:new t.Uniform1f(f,b.u_size),u_camera_to_center_distance:new t.Uniform1f(f,b.u_camera_to_center_distance),u_pitch:new t.Uniform1f(f,b.u_pitch),u_rotate_symbol:new t.Uniform1i(f,b.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(f,b.u_aspect_ratio),u_fade_change:new t.Uniform1f(f,b.u_fade_change),u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(f,b.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(f,b.u_coord_matrix),u_is_text:new t.Uniform1i(f,b.u_is_text),u_pitch_with_map:new t.Uniform1i(f,b.u_pitch_with_map),u_texsize:new t.Uniform2f(f,b.u_texsize),u_texsize_icon:new t.Uniform2f(f,b.u_texsize_icon),u_texture:new t.Uniform1i(f,b.u_texture),u_texture_icon:new t.Uniform1i(f,b.u_texture_icon),u_gamma_scale:new t.Uniform1f(f,b.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(f,b.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(f,b.u_is_halo)}},background:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_opacity:new t.Uniform1f(f,b.u_opacity),u_color:new t.UniformColor(f,b.u_color)}},backgroundPattern:function(f,b){return{u_matrix:new t.UniformMatrix4f(f,b.u_matrix),u_opacity:new t.Uniform1f(f,b.u_opacity),u_image:new t.Uniform1i(f,b.u_image),u_pattern_tl_a:new t.Uniform2f(f,b.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(f,b.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(f,b.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(f,b.u_pattern_br_b),u_texsize:new t.Uniform2f(f,b.u_texsize),u_mix:new t.Uniform1f(f,b.u_mix),u_pattern_size_a:new t.Uniform2f(f,b.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(f,b.u_pattern_size_b),u_scale_a:new t.Uniform1f(f,b.u_scale_a),u_scale_b:new t.Uniform1f(f,b.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(f,b.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(f,b.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(f,b.u_tile_units_to_pixels)}}};function Nu(f,b,p,E,B,q,V){for(var Y=f.context,ot=Y.gl,gt=f.useProgram("collisionBox"),St=[],kt=0,It=0,Xt=0;Xt<E.length;Xt++){var Bt=E[Xt],ae=b.getTile(Bt),Jt=ae.getBucket(p);if(Jt){var he=Bt.posMatrix;B[0]===0&&B[1]===0||(he=f.translatePosMatrix(Bt.posMatrix,ae,B,q));var Me=V?Jt.textCollisionBox:Jt.iconCollisionBox,Ie=Jt.collisionCircleArray;if(Ie.length>0){var De=t.create(),Ne=he;t.mul(De,Jt.placementInvProjMatrix,f.transform.glCoordMatrix),t.mul(De,De,Jt.placementViewportMatrix),St.push({circleArray:Ie,circleOffset:It,transform:Ne,invTransform:De}),It=kt+=Ie.length/4}Me&>.draw(Y,ot.LINES,Tt.disabled,Pt.disabled,f.colorModeForRenderPass(),ye.disabled,Gn(he,f.transform,ae),p.id,Me.layoutVertexBuffer,Me.indexBuffer,Me.segments,null,f.transform.zoom,null,null,Me.collisionVertexBuffer)}}if(V&&St.length){var Ge=f.useProgram("collisionCircle"),je=new t.StructArrayLayout2f1f2i16;je.resize(4*kt),je._trim();for(var Ye=0,ar=0,cr=St;ar<cr.length;ar+=1)for(var kr=cr[ar],qr=0;qr<kr.circleArray.length/4;qr++){var Pr=4*qr,m=kr.circleArray[Pr+0],S=kr.circleArray[Pr+1],T=kr.circleArray[Pr+2],D=kr.circleArray[Pr+3];je.emplace(Ye++,m,S,T,D,0),je.emplace(Ye++,m,S,T,D,1),je.emplace(Ye++,m,S,T,D,2),je.emplace(Ye++,m,S,T,D,3)}(!ro||ro.length<2*kt)&&(ro=function($t){var Kt=2*$t,Te=new t.StructArrayLayout3ui6;Te.resize(Kt),Te._trim();for(var Be=0;Be<Kt;Be++){var Xe=6*Be;Te.uint16[Xe+0]=4*Be+0,Te.uint16[Xe+1]=4*Be+1,Te.uint16[Xe+2]=4*Be+2,Te.uint16[Xe+3]=4*Be+2,Te.uint16[Xe+4]=4*Be+3,Te.uint16[Xe+5]=4*Be+0}return Te}(kt));for(var G=Y.createIndexBuffer(ro,!0),W=Y.createVertexBuffer(je,t.collisionCircleLayout.members,!0),rt=0,it=St;rt<it.length;rt+=1){var dt=it[rt],Et=Gs(dt.transform,dt.invTransform,f.transform);Ge.draw(Y,ot.TRIANGLES,Tt.disabled,Pt.disabled,f.colorModeForRenderPass(),ye.disabled,Et,p.id,W,G,t.SegmentVector.simpleSegment(0,2*dt.circleOffset,dt.circleArray.length,dt.circleArray.length/2),null,f.transform.zoom,null,null,null)}W.destroy(),G.destroy()}}var yr=t.identity(new Float32Array(16));function xi(f,b,p,E,B,q){var V=t.getAnchorAlignment(f),Y=-(V.horizontalAlign-.5)*b,ot=-(V.verticalAlign-.5)*p,gt=t.evaluateVariableOffset(f,E);return new t.Point((Y/B+gt[0])*q,(ot/B+gt[1])*q)}function hi(f,b,p,E,B,q,V,Y,ot,gt,St){var kt=f.text.placedSymbolArray,It=f.text.dynamicLayoutVertexArray,Xt=f.icon.dynamicLayoutVertexArray,Bt={};It.clear();for(var ae=0;ae<kt.length;ae++){var Jt=kt.get(ae),he=Jt.hidden||!Jt.crossTileID||f.allowVerticalPlacement&&!Jt.placedOrientation?null:E[Jt.crossTileID];if(he){var Me=new t.Point(Jt.anchorX,Jt.anchorY),Ie=Wr(Me,p?Y:V),De=is(q.cameraToCenterDistance,Ie.signedDistanceFromCamera),Ne=B.evaluateSizeForFeature(f.textSizeData,gt,Jt)*De/t.ONE_EM;p&&(Ne*=f.tilePixelRatio/ot);for(var Ge=xi(he.anchor,he.width,he.height,he.textOffset,he.textBoxScale,Ne),je=p?Wr(Me.add(Ge),V).point:Ie.point.add(b?Ge.rotate(-q.angle):Ge),Ye=f.allowVerticalPlacement&&Jt.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,ar=0;ar<Jt.numGlyphs;ar++)t.addDynamicAttributes(It,je,Ye);St&&Jt.associatedIconIndex>=0&&(Bt[Jt.associatedIconIndex]={shiftedAnchor:je,angle:Ye})}else Ns(Jt.numGlyphs,It)}if(St){Xt.clear();for(var cr=f.icon.placedSymbolArray,kr=0;kr<cr.length;kr++){var qr=cr.get(kr);if(qr.hidden)Ns(qr.numGlyphs,Xt);else{var Pr=Bt[kr];if(Pr)for(var m=0;m<qr.numGlyphs;m++)t.addDynamicAttributes(Xt,Pr.shiftedAnchor,Pr.angle);else Ns(qr.numGlyphs,Xt)}}f.icon.dynamicLayoutVertexBuffer.updateData(Xt)}f.text.dynamicLayoutVertexBuffer.updateData(It)}function io(f,b,p){return p.iconsInText&&b?"symbolTextAndIcon":f?"symbolSDF":"symbolIcon"}function Vo(f,b,p,E,B,q,V,Y,ot,gt,St,kt){for(var It=f.context,Xt=It.gl,Bt=f.transform,ae=Y==="map",Jt=ot==="map",he=ae&&p.layout.get("symbol-placement")!=="point",Me=ae&&!Jt&&!he,Ie=p.layout.get("symbol-sort-key").constantOr(1)!==void 0,De=f.depthModeForSublayer(0,Tt.ReadOnly),Ne=p.layout.get("text-variable-anchor"),Ge=[],je=0,Ye=E;je<Ye.length;je+=1){var ar=Ye[je],cr=b.getTile(ar),kr=cr.getBucket(p);if(kr){var qr=B?kr.text:kr.icon;if(qr&&qr.segments.get().length){var Pr=qr.programConfigurations.get(p.id),m=B||kr.sdfIcons,S=B?kr.textSizeData:kr.iconSizeData,T=Jt||Bt.pitch!==0,D=f.useProgram(io(m,B,kr),Pr),G=t.evaluateSizeForZoom(S,Bt.zoom),W=void 0,rt=[0,0],it=void 0,dt=void 0,Et=null,$t=void 0;if(B)it=cr.glyphAtlasTexture,dt=Xt.LINEAR,W=cr.glyphAtlasTexture.size,kr.iconsInText&&(rt=cr.imageAtlasTexture.size,Et=cr.imageAtlasTexture,$t=T||f.options.rotating||f.options.zooming||S.kind==="composite"||S.kind==="camera"?Xt.LINEAR:Xt.NEAREST);else{var Kt=p.layout.get("icon-size").constantOr(0)!==1||kr.iconsNeedLinear;it=cr.imageAtlasTexture,dt=m||f.options.rotating||f.options.zooming||Kt||T?Xt.LINEAR:Xt.NEAREST,W=cr.imageAtlasTexture.size}var Te=Tn(cr,1,f.transform.zoom),Be=Ji(ar.posMatrix,Jt,ae,f.transform,Te),Xe=si(ar.posMatrix,Jt,ae,f.transform,Te),lr=Ne&&kr.hasTextData(),wr=p.layout.get("icon-text-fit")!=="none"&&lr&&kr.hasIconData();he&&Va(kr,ar.posMatrix,f,B,Be,Xe,Jt,gt);var ai=f.translatePosMatrix(ar.posMatrix,cr,q,V),ee=he||B&&Ne||wr?yr:Be,Wt=f.translatePosMatrix(Xe,cr,q,V,!0),re=m&&p.paint.get(B?"text-halo-width":"icon-halo-width").constantOr(1)!==0,xe={program:D,buffers:qr,uniformValues:m?kr.iconsInText?Fi(S.kind,G,Me,Jt,f,ai,ee,Wt,W,rt):Uo(S.kind,G,Me,Jt,f,ai,ee,Wt,B,W):os(S.kind,G,Me,Jt,f,ai,ee,Wt,B,W),atlasTexture:it,atlasTextureIcon:Et,atlasInterpolation:dt,atlasInterpolationIcon:$t,isSDF:m,hasHalo:re};if(Ie)for(var Qt=0,ge=qr.segments.get();Qt<ge.length;Qt+=1){var ct=ge[Qt];Ge.push({segments:new t.SegmentVector([ct]),sortKey:ct.sortKey,state:xe})}else Ge.push({segments:qr.segments,sortKey:0,state:xe})}}}Ie&&Ge.sort(function(ue,Zt){return ue.sortKey-Zt.sortKey});for(var Mt=0,At=Ge;Mt<At.length;Mt+=1){var Lt=At[Mt],Ft=Lt.state;if(It.activeTexture.set(Xt.TEXTURE0),Ft.atlasTexture.bind(Ft.atlasInterpolation,Xt.CLAMP_TO_EDGE),Ft.atlasTextureIcon&&(It.activeTexture.set(Xt.TEXTURE1),Ft.atlasTextureIcon&&Ft.atlasTextureIcon.bind(Ft.atlasInterpolationIcon,Xt.CLAMP_TO_EDGE)),Ft.isSDF){var Ut=Ft.uniformValues;Ft.hasHalo&&(Ut.u_is_halo=1,oi(Ft.buffers,Lt.segments,p,f,Ft.program,De,St,kt,Ut)),Ut.u_is_halo=0}oi(Ft.buffers,Lt.segments,p,f,Ft.program,De,St,kt,Ft.uniformValues)}}function oi(f,b,p,E,B,q,V,Y,ot){var gt=E.context;B.draw(gt,gt.gl.TRIANGLES,q,V,Y,ye.disabled,ot,p.id,f.layoutVertexBuffer,f.indexBuffer,b,p.paint,E.transform.zoom,f.programConfigurations.get(p.id),f.dynamicLayoutVertexBuffer,f.opacityVertexBuffer)}function Es(f,b,p,E,B,q,V){var Y,ot,gt,St,kt,It=f.context.gl,Xt=p.paint.get("fill-pattern"),Bt=Xt&&Xt.constantOr(1),ae=p.getCrossfadeParameters();V?(ot=Bt&&!p.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Y=It.LINES):(ot=Bt?"fillPattern":"fill",Y=It.TRIANGLES);for(var Jt=0,he=E;Jt<he.length;Jt+=1){var Me=he[Jt],Ie=b.getTile(Me);if(!Bt||Ie.patternsLoaded()){var De=Ie.getBucket(p);if(De){var Ne=De.programConfigurations.get(p.id),Ge=f.useProgram(ot,Ne);Bt&&(f.context.activeTexture.set(It.TEXTURE0),Ie.imageAtlasTexture.bind(It.LINEAR,It.CLAMP_TO_EDGE),Ne.updatePaintBuffers(ae));var je=Xt.constantOr(null);if(je&&Ie.imageAtlas){var Ye=Ie.imageAtlas,ar=Ye.patternPositions[je.to.toString()],cr=Ye.patternPositions[je.from.toString()];ar&&cr&&Ne.setConstantPatternPositions(ar,cr)}var kr=f.translatePosMatrix(Me.posMatrix,Ie,p.paint.get("fill-translate"),p.paint.get("fill-translate-anchor"));if(V){St=De.indexBuffer2,kt=De.segments2;var qr=[It.drawingBufferWidth,It.drawingBufferHeight];gt=ot==="fillOutlinePattern"&&Bt?as(kr,f,ae,Ie,qr):ya(kr,qr)}else St=De.indexBuffer,kt=De.segments,gt=Bt?An(kr,f,ae,Ie):jl(kr);Ge.draw(f.context,Y,B,f.stencilModeForClipping(Me),q,ye.disabled,gt,p.id,De.layoutVertexBuffer,St,kt,p.paint,f.transform.zoom,Ne)}}}}function jo(f,b,p,E,B,q,V){for(var Y=f.context,ot=Y.gl,gt=p.paint.get("fill-extrusion-pattern"),St=gt.constantOr(1),kt=p.getCrossfadeParameters(),It=p.paint.get("fill-extrusion-opacity"),Xt=0,Bt=E;Xt<Bt.length;Xt+=1){var ae=Bt[Xt],Jt=b.getTile(ae),he=Jt.getBucket(p);if(he){var Me=he.programConfigurations.get(p.id),Ie=f.useProgram(St?"fillExtrusionPattern":"fillExtrusion",Me);St&&(f.context.activeTexture.set(ot.TEXTURE0),Jt.imageAtlasTexture.bind(ot.LINEAR,ot.CLAMP_TO_EDGE),Me.updatePaintBuffers(kt));var De=gt.constantOr(null);if(De&&Jt.imageAtlas){var Ne=Jt.imageAtlas,Ge=Ne.patternPositions[De.to.toString()],je=Ne.patternPositions[De.from.toString()];Ge&&je&&Me.setConstantPatternPositions(Ge,je)}var Ye=f.translatePosMatrix(ae.posMatrix,Jt,p.paint.get("fill-extrusion-translate"),p.paint.get("fill-extrusion-translate-anchor")),ar=p.paint.get("fill-extrusion-vertical-gradient"),cr=St?Vl(Ye,f,ar,It,ae,kt,Jt):Ah(Ye,f,ar,It);Ie.draw(Y,Y.gl.TRIANGLES,B,q,V,ye.backCCW,cr,p.id,he.layoutVertexBuffer,he.indexBuffer,he.segments,p.paint,f.transform.zoom,Me)}}}function Fu(f,b,p,E,B,q){var V=f.context,Y=V.gl,ot=b.fbo;if(ot){var gt=f.useProgram("hillshade");V.activeTexture.set(Y.TEXTURE0),Y.bindTexture(Y.TEXTURE_2D,ot.colorAttachment.get());var St=function(kt,It,Xt){var Bt=Xt.paint.get("hillshade-shadow-color"),ae=Xt.paint.get("hillshade-highlight-color"),Jt=Xt.paint.get("hillshade-accent-color"),he=Xt.paint.get("hillshade-illumination-direction")*(Math.PI/180);Xt.paint.get("hillshade-illumination-anchor")==="viewport"&&(he-=kt.transform.angle);var Me,Ie,De,Ne=!kt.options.moving;return{u_matrix:kt.transform.calculatePosMatrix(It.tileID.toUnwrapped(),Ne),u_image:0,u_latrange:(Me=It.tileID,Ie=Math.pow(2,Me.canonical.z),De=Me.canonical.y,[new t.MercatorCoordinate(0,De/Ie).toLngLat().lat,new t.MercatorCoordinate(0,(De+1)/Ie).toLngLat().lat]),u_light:[Xt.paint.get("hillshade-exaggeration"),he],u_shadow:Bt,u_highlight:ae,u_accent:Jt}}(f,b,p);gt.draw(V,Y.TRIANGLES,E,B,q,ye.disabled,St,p.id,f.rasterBoundsBuffer,f.quadTriangleIndexBuffer,f.rasterBoundsSegments)}}function On(f,b,p,E,B,q){var V=f.context,Y=V.gl,ot=b.dem;if(ot&&ot.data){var gt=ot.dim,St=ot.stride,kt=ot.getPixels();if(V.activeTexture.set(Y.TEXTURE1),V.pixelStoreUnpackPremultiplyAlpha.set(!1),b.demTexture=b.demTexture||f.getTileTexture(St),b.demTexture){var It=b.demTexture;It.update(kt,{premultiply:!1}),It.bind(Y.NEAREST,Y.CLAMP_TO_EDGE)}else b.demTexture=new t.Texture(V,kt,Y.RGBA,{premultiply:!1}),b.demTexture.bind(Y.NEAREST,Y.CLAMP_TO_EDGE);V.activeTexture.set(Y.TEXTURE0);var Xt=b.fbo;if(!Xt){var Bt=new t.Texture(V,{width:gt,height:gt,data:null},Y.RGBA);Bt.bind(Y.LINEAR,Y.CLAMP_TO_EDGE),(Xt=b.fbo=V.createFramebuffer(gt,gt,!0)).colorAttachment.set(Bt.texture)}V.bindFramebuffer.set(Xt.framebuffer),V.viewport.set([0,0,gt,gt]),f.useProgram("hillshadePrepare").draw(V,Y.TRIANGLES,E,B,q,ye.disabled,function(ae,Jt){var he=Jt.stride,Me=t.create();return t.ortho(Me,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(Me,Me,[0,-t.EXTENT,0]),{u_matrix:Me,u_image:1,u_dimension:[he,he],u_zoom:ae.overscaledZ,u_unpack:Jt.getUnpackVector()}}(b.tileID,ot),p.id,f.rasterBoundsBuffer,f.quadTriangleIndexBuffer,f.rasterBoundsSegments),b.needsHillshadePrepare=!1}}function fn(f,b,p,E,B){var q=E.paint.get("raster-fade-duration");if(q>0){var V=t.browser.now(),Y=(V-f.timeAdded)/q,ot=b?(V-b.timeAdded)/q:-1,gt=p.getSource(),St=B.coveringZoomLevel({tileSize:gt.tileSize,roundZoom:gt.roundZoom}),kt=!b||Math.abs(b.tileID.overscaledZ-St)>Math.abs(f.tileID.overscaledZ-St),It=kt&&f.refreshedUponExpiration?1:t.clamp(kt?Y:1-ot,0,1);return f.refreshedUponExpiration&&Y>=1&&(f.refreshedUponExpiration=!1),b?{opacity:1,mix:1-It}:{opacity:It,mix:0}}return{opacity:1,mix:0}}var dc=new t.Color(1,0,0,1),Zo=new t.Color(0,1,0,1),cu=new t.Color(0,0,1,1),ml=new t.Color(1,0,1,1),no=new t.Color(0,1,1,1);function Xl(f,b,p,E){Wi(f,0,b+p/2,f.transform.width,p,E)}function Ln(f,b,p,E){Wi(f,b-p/2,0,p,f.transform.height,E)}function Wi(f,b,p,E,B,q){var V=f.context,Y=V.gl;Y.enable(Y.SCISSOR_TEST),Y.scissor(b*t.browser.devicePixelRatio,p*t.browser.devicePixelRatio,E*t.browser.devicePixelRatio,B*t.browser.devicePixelRatio),V.clear({color:q}),Y.disable(Y.SCISSOR_TEST)}function Ss(f,b,p){var E=f.context,B=E.gl,q=p.posMatrix,V=f.useProgram("debug"),Y=Tt.disabled,ot=Pt.disabled,gt=f.colorModeForRenderPass();E.activeTexture.set(B.TEXTURE0),f.emptyTexture.bind(B.LINEAR,B.CLAMP_TO_EDGE),V.draw(E,B.LINE_STRIP,Y,ot,gt,ye.disabled,to(q,t.Color.red),"$debug",f.debugBuffer,f.tileBorderIndexBuffer,f.debugSegments);var St=b.getTileByID(p.key).latestRawTileData,kt=Math.floor((St&&St.byteLength||0)/1024),It=b.getTile(p).tileSize,Xt=512/Math.min(It,512)*(p.overscaledZ/f.transform.zoom)*.5,Bt=p.canonical.toString();p.overscaledZ!==p.canonical.z&&(Bt+=" => "+p.overscaledZ),function(ae,Jt){ae.initDebugOverlayCanvas();var he=ae.debugOverlayCanvas,Me=ae.context.gl,Ie=ae.debugOverlayCanvas.getContext("2d");Ie.clearRect(0,0,he.width,he.height),Ie.shadowColor="white",Ie.shadowBlur=2,Ie.lineWidth=1.5,Ie.strokeStyle="white",Ie.textBaseline="top",Ie.font="bold 36px Open Sans, sans-serif",Ie.fillText(Jt,5,5),Ie.strokeText(Jt,5,5),ae.debugOverlayTexture.update(he),ae.debugOverlayTexture.bind(Me.LINEAR,Me.CLAMP_TO_EDGE)}(f,Bt+" "+kt+"kb"),V.draw(E,B.TRIANGLES,Y,ot,ne.alphaBlended,ye.disabled,to(q,t.Color.transparent,Xt),"$debug",f.debugBuffer,f.quadTriangleIndexBuffer,f.debugSegments)}var O={symbol:function(f,b,p,E,B){if(f.renderPass==="translucent"){var q=Pt.disabled,V=f.colorModeForRenderPass();p.layout.get("text-variable-anchor")&&function(Y,ot,gt,St,kt,It,Xt){for(var Bt=ot.transform,ae=kt==="map",Jt=It==="map",he=0,Me=Y;he<Me.length;he+=1){var Ie=Me[he],De=St.getTile(Ie),Ne=De.getBucket(gt);if(Ne&&Ne.text&&Ne.text.segments.get().length){var Ge=t.evaluateSizeForZoom(Ne.textSizeData,Bt.zoom),je=Tn(De,1,ot.transform.zoom),Ye=Ji(Ie.posMatrix,Jt,ae,ot.transform,je),ar=gt.layout.get("icon-text-fit")!=="none"&&Ne.hasIconData();if(Ge){var cr=Math.pow(2,Bt.zoom-De.tileID.overscaledZ);hi(Ne,ae,Jt,Xt,t.symbolSize,Bt,Ye,Ie.posMatrix,cr,Ge,ar)}}}}(E,f,p,b,p.layout.get("text-rotation-alignment"),p.layout.get("text-pitch-alignment"),B),p.paint.get("icon-opacity").constantOr(1)!==0&&Vo(f,b,p,E,!1,p.paint.get("icon-translate"),p.paint.get("icon-translate-anchor"),p.layout.get("icon-rotation-alignment"),p.layout.get("icon-pitch-alignment"),p.layout.get("icon-keep-upright"),q,V),p.paint.get("text-opacity").constantOr(1)!==0&&Vo(f,b,p,E,!0,p.paint.get("text-translate"),p.paint.get("text-translate-anchor"),p.layout.get("text-rotation-alignment"),p.layout.get("text-pitch-alignment"),p.layout.get("text-keep-upright"),q,V),b.map.showCollisionBoxes&&(Nu(f,b,p,E,p.paint.get("text-translate"),p.paint.get("text-translate-anchor"),!0),Nu(f,b,p,E,p.paint.get("icon-translate"),p.paint.get("icon-translate-anchor"),!1))}},circle:function(f,b,p,E){if(f.renderPass==="translucent"){var B=p.paint.get("circle-opacity"),q=p.paint.get("circle-stroke-width"),V=p.paint.get("circle-stroke-opacity"),Y=p.layout.get("circle-sort-key").constantOr(1)!==void 0;if(B.constantOr(1)!==0||q.constantOr(1)!==0&&V.constantOr(1)!==0){for(var ot=f.context,gt=ot.gl,St=f.depthModeForSublayer(0,Tt.ReadOnly),kt=Pt.disabled,It=f.colorModeForRenderPass(),Xt=[],Bt=0;Bt<E.length;Bt++){var ae=E[Bt],Jt=b.getTile(ae),he=Jt.getBucket(p);if(he){var Me=he.programConfigurations.get(p.id),Ie={programConfiguration:Me,program:f.useProgram("circle",Me),layoutVertexBuffer:he.layoutVertexBuffer,indexBuffer:he.indexBuffer,uniformValues:$s(f,ae,Jt,p)};if(Y)for(var De=0,Ne=he.segments.get();De<Ne.length;De+=1){var Ge=Ne[De];Xt.push({segments:new t.SegmentVector([Ge]),sortKey:Ge.sortKey,state:Ie})}else Xt.push({segments:he.segments,sortKey:0,state:Ie})}}Y&&Xt.sort(function(kr,qr){return kr.sortKey-qr.sortKey});for(var je=0,Ye=Xt;je<Ye.length;je+=1){var ar=Ye[je],cr=ar.state;cr.program.draw(ot,gt.TRIANGLES,St,kt,It,ye.disabled,cr.uniformValues,p.id,cr.layoutVertexBuffer,cr.indexBuffer,ar.segments,p.paint,f.transform.zoom,cr.programConfiguration)}}}},heatmap:function(f,b,p,E){if(p.paint.get("heatmap-opacity")!==0)if(f.renderPass==="offscreen"){var B=f.context,q=B.gl,V=Pt.disabled,Y=new ne([q.ONE,q.ONE],t.Color.transparent,[!0,!0,!0,!0]);(function(Xt,Bt,ae){var Jt=Xt.gl;Xt.activeTexture.set(Jt.TEXTURE1),Xt.viewport.set([0,0,Bt.width/4,Bt.height/4]);var he=ae.heatmapFbo;if(he)Jt.bindTexture(Jt.TEXTURE_2D,he.colorAttachment.get()),Xt.bindFramebuffer.set(he.framebuffer);else{var Me=Jt.createTexture();Jt.bindTexture(Jt.TEXTURE_2D,Me),Jt.texParameteri(Jt.TEXTURE_2D,Jt.TEXTURE_WRAP_S,Jt.CLAMP_TO_EDGE),Jt.texParameteri(Jt.TEXTURE_2D,Jt.TEXTURE_WRAP_T,Jt.CLAMP_TO_EDGE),Jt.texParameteri(Jt.TEXTURE_2D,Jt.TEXTURE_MIN_FILTER,Jt.LINEAR),Jt.texParameteri(Jt.TEXTURE_2D,Jt.TEXTURE_MAG_FILTER,Jt.LINEAR),he=ae.heatmapFbo=Xt.createFramebuffer(Bt.width/4,Bt.height/4,!1),function(Ie,De,Ne,Ge){var je=Ie.gl;je.texImage2D(je.TEXTURE_2D,0,je.RGBA,De.width/4,De.height/4,0,je.RGBA,Ie.extRenderToTextureHalfFloat?Ie.extTextureHalfFloat.HALF_FLOAT_OES:je.UNSIGNED_BYTE,null),Ge.colorAttachment.set(Ne)}(Xt,Bt,Me,he)}})(B,f,p),B.clear({color:t.Color.transparent});for(var ot=0;ot<E.length;ot++){var gt=E[ot];if(!b.hasRenderableParent(gt)){var St=b.getTile(gt),kt=St.getBucket(p);if(kt){var It=kt.programConfigurations.get(p.id);f.useProgram("heatmap",It).draw(B,q.TRIANGLES,Tt.disabled,V,Y,ye.disabled,Oh(gt.posMatrix,St,f.transform.zoom,p.paint.get("heatmap-intensity")),p.id,kt.layoutVertexBuffer,kt.indexBuffer,kt.segments,p.paint,f.transform.zoom,It)}}}B.viewport.set([0,0,f.width,f.height])}else f.renderPass==="translucent"&&(f.context.setColorMode(f.colorModeForRenderPass()),function(Xt,Bt){var ae=Xt.context,Jt=ae.gl,he=Bt.heatmapFbo;if(he){ae.activeTexture.set(Jt.TEXTURE0),Jt.bindTexture(Jt.TEXTURE_2D,he.colorAttachment.get()),ae.activeTexture.set(Jt.TEXTURE1);var Me=Bt.colorRampTexture;Me||(Me=Bt.colorRampTexture=new t.Texture(ae,Bt.colorRamp,Jt.RGBA)),Me.bind(Jt.LINEAR,Jt.CLAMP_TO_EDGE),Xt.useProgram("heatmapTexture").draw(ae,Jt.TRIANGLES,Tt.disabled,Pt.disabled,Xt.colorModeForRenderPass(),ye.disabled,function(Ie,De,Ne,Ge){var je=t.create();t.ortho(je,0,Ie.width,Ie.height,0,0,1);var Ye=Ie.context.gl;return{u_matrix:je,u_world:[Ye.drawingBufferWidth,Ye.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:De.paint.get("heatmap-opacity")}}(Xt,Bt),Bt.id,Xt.viewportBuffer,Xt.quadTriangleIndexBuffer,Xt.viewportSegments,Bt.paint,Xt.transform.zoom)}}(f,p))},line:function(f,b,p,E){if(f.renderPass==="translucent"){var B=p.paint.get("line-opacity"),q=p.paint.get("line-width");if(B.constantOr(1)!==0&&q.constantOr(1)!==0)for(var V=f.depthModeForSublayer(0,Tt.ReadOnly),Y=f.colorModeForRenderPass(),ot=p.paint.get("line-dasharray"),gt=p.paint.get("line-pattern"),St=gt.constantOr(1),kt=p.paint.get("line-gradient"),It=p.getCrossfadeParameters(),Xt=St?"linePattern":ot?"lineSDF":kt?"lineGradient":"line",Bt=f.context,ae=Bt.gl,Jt=!0,he=0,Me=E;he<Me.length;he+=1){var Ie=Me[he],De=b.getTile(Ie);if(!St||De.patternsLoaded()){var Ne=De.getBucket(p);if(Ne){var Ge=Ne.programConfigurations.get(p.id),je=f.context.program.get(),Ye=f.useProgram(Xt,Ge),ar=Jt||Ye.program!==je,cr=gt.constantOr(null);if(cr&&De.imageAtlas){var kr=De.imageAtlas,qr=kr.patternPositions[cr.to.toString()],Pr=kr.patternPositions[cr.from.toString()];qr&&Pr&&Ge.setConstantPatternPositions(qr,Pr)}var m=St?fl(f,De,p,It):ot?_o(f,De,p,ot,It):kt?Aa(f,De,p,Ne.lineClipsArray.length):lu(f,De,p);if(St)Bt.activeTexture.set(ae.TEXTURE0),De.imageAtlasTexture.bind(ae.LINEAR,ae.CLAMP_TO_EDGE),Ge.updatePaintBuffers(It);else if(ot&&(ar||f.lineAtlas.dirty))Bt.activeTexture.set(ae.TEXTURE0),f.lineAtlas.bind(Bt);else if(kt){var S=Ne.gradients[p.id],T=S.texture;if(p.gradientVersion!==S.version){var D=256;if(p.stepInterpolant){var G=b.getSource().maxzoom,W=Ie.canonical.z===G?Math.ceil(1<<f.transform.maxZoom-Ie.canonical.z):1;D=t.clamp(t.nextPowerOfTwo(Ne.maxLineLength/t.EXTENT*1024*W),256,Bt.maxTextureSize)}S.gradient=t.renderColorRamp({expression:p.gradientExpression(),evaluationKey:"lineProgress",resolution:D,image:S.gradient||void 0,clips:Ne.lineClipsArray}),S.texture?S.texture.update(S.gradient):S.texture=new t.Texture(Bt,S.gradient,ae.RGBA),S.version=p.gradientVersion,T=S.texture}Bt.activeTexture.set(ae.TEXTURE0),T.bind(p.stepInterpolant?ae.NEAREST:ae.LINEAR,ae.CLAMP_TO_EDGE)}Ye.draw(Bt,ae.TRIANGLES,V,f.stencilModeForClipping(Ie),Y,ye.disabled,m,p.id,Ne.layoutVertexBuffer,Ne.indexBuffer,Ne.segments,p.paint,f.transform.zoom,Ge,Ne.layoutVertexBuffer2),Jt=!1}}}}},fill:function(f,b,p,E){var B=p.paint.get("fill-color"),q=p.paint.get("fill-opacity");if(q.constantOr(1)!==0){var V=f.colorModeForRenderPass(),Y=p.paint.get("fill-pattern"),ot=f.opaquePassEnabledForLayer()&&!Y.constantOr(1)&&B.constantOr(t.Color.transparent).a===1&&q.constantOr(0)===1?"opaque":"translucent";if(f.renderPass===ot){var gt=f.depthModeForSublayer(1,f.renderPass==="opaque"?Tt.ReadWrite:Tt.ReadOnly);Es(f,b,p,E,gt,V,!1)}if(f.renderPass==="translucent"&&p.paint.get("fill-antialias")){var St=f.depthModeForSublayer(p.getPaintProperty("fill-outline-color")?2:0,Tt.ReadOnly);Es(f,b,p,E,St,V,!0)}}},"fill-extrusion":function(f,b,p,E){var B=p.paint.get("fill-extrusion-opacity");if(B!==0&&f.renderPass==="translucent"){var q=new Tt(f.context.gl.LEQUAL,Tt.ReadWrite,f.depthRangeFor3D);if(B!==1||p.paint.get("fill-extrusion-pattern").constantOr(1))jo(f,b,p,E,q,Pt.disabled,ne.disabled),jo(f,b,p,E,q,f.stencilModeFor3D(),f.colorModeForRenderPass());else{var V=f.colorModeForRenderPass();jo(f,b,p,E,q,Pt.disabled,V)}}},hillshade:function(f,b,p,E){if(f.renderPass==="offscreen"||f.renderPass==="translucent"){for(var B=f.context,q=f.depthModeForSublayer(0,Tt.ReadOnly),V=f.colorModeForRenderPass(),Y=f.renderPass==="translucent"?f.stencilConfigForOverlap(E):[{},E],ot=Y[0],gt=0,St=Y[1];gt<St.length;gt+=1){var kt=St[gt],It=b.getTile(kt);It.needsHillshadePrepare&&f.renderPass==="offscreen"?On(f,It,p,q,Pt.disabled,V):f.renderPass==="translucent"&&Fu(f,It,p,q,ot[kt.overscaledZ],V)}B.viewport.set([0,0,f.width,f.height])}},raster:function(f,b,p,E){if(f.renderPass==="translucent"&&p.paint.get("raster-opacity")!==0&&E.length)for(var B=f.context,q=B.gl,V=b.getSource(),Y=f.useProgram("raster"),ot=f.colorModeForRenderPass(),gt=V instanceof Yt?[{},E]:f.stencilConfigForOverlap(E),St=gt[0],kt=gt[1],It=kt[kt.length-1].overscaledZ,Xt=!f.options.moving,Bt=0,ae=kt;Bt<ae.length;Bt+=1){var Jt=ae[Bt],he=f.depthModeForSublayer(Jt.overscaledZ-It,p.paint.get("raster-opacity")===1?Tt.ReadWrite:Tt.ReadOnly,q.LESS),Me=b.getTile(Jt),Ie=f.transform.calculatePosMatrix(Jt.toUnwrapped(),Xt);Me.registerFadeDuration(p.paint.get("raster-fade-duration"));var De=b.findLoadedParent(Jt,0),Ne=fn(Me,De,b,p,f.transform),Ge=void 0,je=void 0,Ye=p.paint.get("raster-resampling")==="nearest"?q.NEAREST:q.LINEAR;B.activeTexture.set(q.TEXTURE0),Me.texture.bind(Ye,q.CLAMP_TO_EDGE,q.LINEAR_MIPMAP_NEAREST),B.activeTexture.set(q.TEXTURE1),De?(De.texture.bind(Ye,q.CLAMP_TO_EDGE,q.LINEAR_MIPMAP_NEAREST),Ge=Math.pow(2,De.tileID.overscaledZ-Me.tileID.overscaledZ),je=[Me.tileID.canonical.x*Ge%1,Me.tileID.canonical.y*Ge%1]):Me.texture.bind(Ye,q.CLAMP_TO_EDGE,q.LINEAR_MIPMAP_NEAREST);var ar=eo(Ie,je||[0,0],Ge||1,Ne,p);V instanceof Yt?Y.draw(B,q.TRIANGLES,he,Pt.disabled,ot,ye.disabled,ar,p.id,V.boundsBuffer,f.quadTriangleIndexBuffer,V.boundsSegments):Y.draw(B,q.TRIANGLES,he,St[Jt.overscaledZ],ot,ye.disabled,ar,p.id,f.rasterBoundsBuffer,f.quadTriangleIndexBuffer,f.rasterBoundsSegments)}},background:function(f,b,p){var E=p.paint.get("background-color"),B=p.paint.get("background-opacity");if(B!==0){var q=f.context,V=q.gl,Y=f.transform,ot=Y.tileSize,gt=p.paint.get("background-pattern");if(!f.isPatternMissing(gt)){var St=!gt&&E.a===1&&B===1&&f.opaquePassEnabledForLayer()?"opaque":"translucent";if(f.renderPass===St){var kt=Pt.disabled,It=f.depthModeForSublayer(0,St==="opaque"?Tt.ReadWrite:Tt.ReadOnly),Xt=f.colorModeForRenderPass(),Bt=f.useProgram(gt?"backgroundPattern":"background"),ae=Y.coveringTiles({tileSize:ot});gt&&(q.activeTexture.set(V.TEXTURE0),f.imageManagerFactory.bind(f.context));for(var Jt=p.getCrossfadeParameters(),he=0,Me=ae;he<Me.length;he+=1){var Ie=Me[he],De=f.transform.calculatePosMatrix(Ie.toUnwrapped()),Ne=gt?Ms(De,B,f,gt,{tileID:Ie,tileSize:ot},Jt):hu(De,B,E);Bt.draw(q,V.TRIANGLES,It,kt,Xt,ye.disabled,Ne,p.id,f.tileExtentBuffer,f.quadTriangleIndexBuffer,f.tileExtentSegments)}}}}},debug:function(f,b,p){for(var E=0;E<p.length;E++)Ss(f,b,p[E])},custom:function(f,b,p){var E=f.context,B=p.implementation;if(f.renderPass==="offscreen"){var q=B.prerender;q&&(f.setCustomLayerDefaults(),E.setColorMode(f.colorModeForRenderPass()),q.call(B,E.gl,f.transform.customLayerMatrix()),E.setDirty(),f.setBaseState())}else if(f.renderPass==="translucent"){f.setCustomLayerDefaults(),E.setColorMode(f.colorModeForRenderPass()),E.setStencilMode(Pt.disabled);var V=B.renderingMode==="3d"?new Tt(f.context.gl.LEQUAL,Tt.ReadWrite,f.depthRangeFor3D):f.depthModeForSublayer(0,Tt.ReadOnly);E.setDepthMode(V),B.render(E.gl,f.transform.customLayerMatrix()),E.setDirty(),f.setBaseState(),E.bindFramebuffer.set(null)}}},c=function(f,b){this.context=new le(f),this.transform=b,this._tileTextures={},this.setup(),this.numSublayers=be.maxUnderzooming+be.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ja,this.gpuTimers={}};c.prototype.resize=function(f,b){if(this.width=f*t.browser.devicePixelRatio,this.height=b*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var p=0,E=this.style._order;p<E.length;p+=1)this.style._layers[E[p]].resize()},c.prototype.setup=function(){var f=this.context,b=new t.StructArrayLayout2i4;b.emplaceBack(0,0),b.emplaceBack(t.EXTENT,0),b.emplaceBack(0,t.EXTENT),b.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=f.createVertexBuffer(b,hl.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var p=new t.StructArrayLayout2i4;p.emplaceBack(0,0),p.emplaceBack(t.EXTENT,0),p.emplaceBack(0,t.EXTENT),p.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=f.createVertexBuffer(p,hl.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var E=new t.StructArrayLayout4i8;E.emplaceBack(0,0,0,0),E.emplaceBack(t.EXTENT,0,t.EXTENT,0),E.emplaceBack(0,t.EXTENT,0,t.EXTENT),E.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=f.createVertexBuffer(E,Rt.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var B=new t.StructArrayLayout2i4;B.emplaceBack(0,0),B.emplaceBack(1,0),B.emplaceBack(0,1),B.emplaceBack(1,1),this.viewportBuffer=f.createVertexBuffer(B,hl.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var q=new t.StructArrayLayout1ui2;q.emplaceBack(0),q.emplaceBack(1),q.emplaceBack(3),q.emplaceBack(2),q.emplaceBack(0),this.tileBorderIndexBuffer=f.createIndexBuffer(q);var V=new t.StructArrayLayout3ui6;V.emplaceBack(0,1,2),V.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=f.createIndexBuffer(V),this.emptyTexture=new t.Texture(f,{width:1,height:1,data:new Uint8Array([0,0,0,0])},f.gl.RGBA);var Y=this.context.gl;this.stencilClearMode=new Pt({func:Y.ALWAYS,mask:0},0,255,Y.ZERO,Y.ZERO,Y.ZERO)},c.prototype.clearStencil=function(){var f=this.context,b=f.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var p=t.create();t.ortho(p,0,this.width,this.height,0,0,1),t.scale(p,p,[b.drawingBufferWidth,b.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(f,b.TRIANGLES,Tt.disabled,this.stencilClearMode,ne.disabled,ye.disabled,Zl(p),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},c.prototype._renderTileClippingMasks=function(f,b){if(this.currentStencilSource!==f.source&&f.isTileClipped()&&b&&b.length){this.currentStencilSource=f.source;var p=this.context,E=p.gl;this.nextStencilID+b.length>256&&this.clearStencil(),p.setColorMode(ne.disabled),p.setDepthMode(Tt.disabled);var B=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var q=0,V=b;q<V.length;q+=1){var Y=V[q],ot=this._tileClippingMaskIDs[Y.key]=this.nextStencilID++;B.draw(p,E.TRIANGLES,Tt.disabled,new Pt({func:E.ALWAYS,mask:0},ot,255,E.KEEP,E.KEEP,E.REPLACE),ne.disabled,ye.disabled,Zl(Y.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},c.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var f=this.nextStencilID++,b=this.context.gl;return new Pt({func:b.NOTEQUAL,mask:255},f,255,b.KEEP,b.KEEP,b.REPLACE)},c.prototype.stencilModeForClipping=function(f){var b=this.context.gl;return new Pt({func:b.EQUAL,mask:255},this._tileClippingMaskIDs[f.key],0,b.KEEP,b.KEEP,b.REPLACE)},c.prototype.stencilConfigForOverlap=function(f){var b,p=this.context.gl,E=f.sort(function(ot,gt){return gt.overscaledZ-ot.overscaledZ}),B=E[E.length-1].overscaledZ,q=E[0].overscaledZ-B+1;if(q>1){this.currentStencilSource=void 0,this.nextStencilID+q>256&&this.clearStencil();for(var V={},Y=0;Y<q;Y++)V[Y+B]=new Pt({func:p.GEQUAL,mask:255},Y+this.nextStencilID,255,p.KEEP,p.KEEP,p.REPLACE);return this.nextStencilID+=q,[V,E]}return[(b={},b[B]=Pt.disabled,b),E]},c.prototype.colorModeForRenderPass=function(){var f=this.context.gl;return this._showOverdrawInspector?new ne([f.CONSTANT_COLOR,f.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?ne.unblended:ne.alphaBlended},c.prototype.depthModeForSublayer=function(f,b,p){if(!this.opaquePassEnabledForLayer())return Tt.disabled;var E=1-((1+this.currentLayer)*this.numSublayers+f)*this.depthEpsilon;return new Tt(p||this.context.gl.LEQUAL,b,[E,E])},c.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},c.prototype.render=function(f,b){var p=this;this.style=f,this.options=b,this.lineAtlas=f.lineAtlas,this.imageManagerFactory=f.imageManagerFactory,this.glyphManager=f.glyphManager,this.symbolFadeChange=f.placement.symbolFadeChange(t.browser.now()),this.imageManagerFactory.beginFrame();var E=this.style._order,B=this.style.sourceCaches;for(var q in B){var V=B[q];V.used&&V.prepare(this.context)}var Y,ot,gt={},St={},kt={};for(var It in B){var Xt=B[It];gt[It]=Xt.getVisibleCoordinates(),St[It]=gt[It].slice().reverse(),kt[It]=Xt.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var Bt=0;Bt<E.length;Bt++)if(this.style._layers[E[Bt]].is3D()){this.opaquePassCutoff=Bt;break}this.renderPass="offscreen";for(var ae=0,Jt=E;ae<Jt.length;ae+=1){var he=this.style._layers[Jt[ae]];if(he.hasOffscreenPass()&&!he.isHidden(this.transform.zoom)){var Me=St[he.source];(he.type==="custom"||Me.length)&&this.renderLayer(this,B[he.source],he,Me)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:b.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=b.showOverdrawInspector,this.depthRangeFor3D=[0,1-(f._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=E.length-1;this.currentLayer>=0;this.currentLayer--){var Ie=this.style._layers[E[this.currentLayer]],De=B[Ie.source],Ne=gt[Ie.source];this._renderTileClippingMasks(Ie,Ne),this.renderLayer(this,De,Ie,Ne)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<E.length;this.currentLayer++){var Ge=this.style._layers[E[this.currentLayer]],je=B[Ge.source],Ye=(Ge.type==="symbol"?kt:St)[Ge.source];this._renderTileClippingMasks(Ge,gt[Ge.source]),this.renderLayer(this,je,Ge,Ye)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach(function(ar){ar.source&&!ar.isHidden(p.transform.zoom)&&(ar.source!==(ot&&ot.id)&&(ot=p.style.sourceCaches[ar.source]),(!Y||Y.getSource().maxzoom<ot.getSource().maxzoom)&&(Y=ot))}),Y&&O.debug(this,Y,Y.getVisibleCoordinates())),this.options.showPadding&&function(ar){var cr=ar.transform.padding;Xl(ar,ar.transform.height-(cr.top||0),3,dc),Xl(ar,cr.bottom||0,3,Zo),Ln(ar,cr.left||0,3,cu),Ln(ar,ar.transform.width-(cr.right||0),3,ml);var kr=ar.transform.centerPoint;(function(qr,Pr,m,S){Wi(qr,Pr-1,m-10,2,20,S),Wi(qr,Pr-10,m-1,20,2,S)})(ar,kr.x,ar.transform.height-kr.y,no)}(this),this.context.setDefault()},c.prototype.renderLayer=function(f,b,p,E){p.isHidden(this.transform.zoom)||(p.type==="background"||p.type==="custom"||E.length)&&(this.id=p.id,this.gpuTimingStart(p),O[p.type](f,b,p,E,this.style.placement.variableOffsets),this.gpuTimingEnd())},c.prototype.gpuTimingStart=function(f){if(this.options.gpuTiming){var b=this.context.extTimerQuery,p=this.gpuTimers[f.id];p||(p=this.gpuTimers[f.id]={calls:0,cpuTime:0,query:b.createQueryEXT()}),p.calls++,b.beginQueryEXT(b.TIME_ELAPSED_EXT,p.query)}},c.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var f=this.context.extTimerQuery;f.endQueryEXT(f.TIME_ELAPSED_EXT)}},c.prototype.collectGpuTimers=function(){var f=this.gpuTimers;return this.gpuTimers={},f},c.prototype.queryGpuTimers=function(f){var b={};for(var p in f){var E=f[p],B=this.context.extTimerQuery,q=B.getQueryObjectEXT(E.query,B.QUERY_RESULT_EXT)/1e6;B.deleteQueryEXT(E.query),b[p]=q}return b},c.prototype.translatePosMatrix=function(f,b,p,E,B){if(!p[0]&&!p[1])return f;var q=B?E==="map"?this.transform.angle:0:E==="viewport"?-this.transform.angle:0;if(q){var V=Math.sin(q),Y=Math.cos(q);p=[p[0]*Y-p[1]*V,p[0]*V+p[1]*Y]}var ot=[B?p[0]:Tn(b,p[0],this.transform.zoom),B?p[1]:Tn(b,p[1],this.transform.zoom),0],gt=new Float32Array(16);return t.translate(gt,f,ot),gt},c.prototype.saveTileTexture=function(f){var b=this._tileTextures[f.size[0]];b?b.push(f):this._tileTextures[f.size[0]]=[f]},c.prototype.getTileTexture=function(f){var b=this._tileTextures[f];return b&&b.length>0?b.pop():null},c.prototype.isPatternMissing=function(f){if(!f)return!1;if(!f.from||!f.to)return!0;var b=this.imageManagerFactory.getPattern(f.from.toString()),p=this.imageManagerFactory.getPattern(f.to.toString());return!b||!p},c.prototype.useProgram=function(f,b){this.cache=this.cache||{};var p=""+f+(b?b.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[p]||(this.cache[p]=new cl(this.context,f,pc[f],b,gl[f],this._showOverdrawInspector)),this.cache[p]},c.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},c.prototype.setBaseState=function(){var f=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(f.FUNC_ADD)},c.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},c.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var g=function(f,b){this.points=f,this.planes=b};g.fromInvProjectionMatrix=function(f,b,p){var E=Math.pow(2,p),B=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(function(V){return t.transformMat4([],V,f)}).map(function(V){return t.scale$1([],V,1/V[3]/b*E)}),q=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(V){var Y=t.sub([],B[V[0]],B[V[1]]),ot=t.sub([],B[V[2]],B[V[1]]),gt=t.normalize([],t.cross([],Y,ot)),St=-t.dot(gt,B[V[1]]);return gt.concat(St)});return new g(B,q)};var _=function(f,b){this.min=f,this.max=b,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};_.prototype.quadrant=function(f){for(var b=[f%2==0,f<2],p=t.clone$2(this.min),E=t.clone$2(this.max),B=0;B<b.length;B++)p[B]=b[B]?this.min[B]:this.center[B],E[B]=b[B]?this.center[B]:this.max[B];return E[2]=this.max[2],new _(p,E)},_.prototype.distanceX=function(f){return Math.max(Math.min(this.max[0],f[0]),this.min[0])-f[0]},_.prototype.distanceY=function(f){return Math.max(Math.min(this.max[1],f[1]),this.min[1])-f[1]},_.prototype.intersects=function(f){for(var b=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],p=!0,E=0;E<f.planes.length;E++){for(var B=f.planes[E],q=0,V=0;V<b.length;V++)q+=t.dot$1(B,b[V])>=0;if(q===0)return 0;q!==b.length&&(p=!1)}if(p)return 2;for(var Y=0;Y<3;Y++){for(var ot=Number.MAX_VALUE,gt=-Number.MAX_VALUE,St=0;St<f.points.length;St++){var kt=f.points[St][Y]-this.min[Y];ot=Math.min(ot,kt),gt=Math.max(gt,kt)}if(gt<0||ot>this.max[Y]-this.min[Y])return 0}return 1};var P=function(f,b,p,E){if(f===void 0&&(f=0),b===void 0&&(b=0),p===void 0&&(p=0),E===void 0&&(E=0),isNaN(f)||f<0||isNaN(b)||b<0||isNaN(p)||p<0||isNaN(E)||E<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=f,this.bottom=b,this.left=p,this.right=E};P.prototype.interpolate=function(f,b,p){return b.top!=null&&f.top!=null&&(this.top=t.number(f.top,b.top,p)),b.bottom!=null&&f.bottom!=null&&(this.bottom=t.number(f.bottom,b.bottom,p)),b.left!=null&&f.left!=null&&(this.left=t.number(f.left,b.left,p)),b.right!=null&&f.right!=null&&(this.right=t.number(f.right,b.right,p)),this},P.prototype.getCenter=function(f,b){var p=t.clamp((this.left+f-this.right)/2,0,f),E=t.clamp((this.top+b-this.bottom)/2,0,b);return new t.Point(p,E)},P.prototype.equals=function(f){return this.top===f.top&&this.bottom===f.bottom&&this.left===f.left&&this.right===f.right},P.prototype.clone=function(){return new P(this.top,this.bottom,this.left,this.right)},P.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var F=function(f,b,p,E,B,q,V){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=B===void 0||B,this._minZoom=f||0,this._maxZoom=b||22,this._minPitch=p==null?0:p,this._maxPitch=E==null?60:E,this.setMaxBounds(),V&&this.setCRS(V),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new P,this._posMatrixCache={},this._alignedPosMatrixCache={}},H={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};F.prototype.clone=function(){var f=new F(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,null,this.crs);return f.tileSize=this.tileSize,f.latRange=this.latRange,f.width=this.width,f.height=this.height,f._center=this._center,f.zoom=this.zoom,f.angle=this.angle,f._fov=this._fov,f._pitch=this._pitch,f._unmodified=this._unmodified,f._edgeInsets=this._edgeInsets.clone(),f._calcMatrices(),f},F.prototype.getCRS=function(){return this.crs},F.prototype.setCRS=function(f){this.crs=f,this.indexExtent=f.getExtent(),this.worldWidth=this.indexExtent[2]-this.indexExtent[0],this.worldHeight=this.indexExtent[3]-this.indexExtent[1],this.centerX=(this.indexExtent[2]+this.indexExtent[0])/2,this.centerY=(this.indexExtent[3]+this.indexExtent[1])/2,this.originX=this.indexExtent[0],this.originY=this.indexExtent[3],this.crs.renderWorldCopies=this.renderWorldCopies},H.minZoom.get=function(){return this._minZoom},H.minZoom.set=function(f){this._minZoom!==f&&(this._minZoom=f,this.zoom=Math.max(this.zoom,f))},H.maxZoom.get=function(){return this._maxZoom},H.maxZoom.set=function(f){this._maxZoom!==f&&(this._maxZoom=f,this.zoom=Math.min(this.zoom,f))},H.minPitch.get=function(){return this._minPitch},H.minPitch.set=function(f){this._minPitch!==f&&(this._minPitch=f,this.pitch=Math.max(this.pitch,f))},H.maxPitch.get=function(){return this._maxPitch},H.maxPitch.set=function(f){this._maxPitch!==f&&(this._maxPitch=f,this.pitch=Math.min(this.pitch,f))},H.renderWorldCopies.get=function(){return this._renderWorldCopies},H.renderWorldCopies.set=function(f){f===void 0?f=!0:f===null&&(f=!1),this._renderWorldCopies=f},H.worldSize.get=function(){return this.tileSize*this.scale},H.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},H.size.get=function(){return new t.Point(this.width,this.height)},H.bearing.get=function(){return-this.angle/Math.PI*180},H.bearing.set=function(f){var b=-t.wrap(f,-180,180)*Math.PI/180;this.angle!==b&&(this._unmodified=!1,this.angle=b,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},H.pitch.get=function(){return this._pitch/Math.PI*180},H.pitch.set=function(f){var b=t.clamp(f,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==b&&(this._unmodified=!1,this._pitch=b,this._calcMatrices())},H.fov.get=function(){return this._fov/Math.PI*180},H.fov.set=function(f){f=Math.max(.01,Math.min(60,f)),this._fov!==f&&(this._unmodified=!1,this._fov=f/180*Math.PI,this._calcMatrices())},H.zoom.get=function(){return this._zoom},H.zoom.set=function(f){var b=Math.min(Math.max(f,this.minZoom),this.maxZoom);this._zoom!==b&&(this._unmodified=!1,this._zoom=b,this.scale=this.zoomScale(b),this.tileZoom=Math.floor(b),this.zoomFraction=b-this.tileZoom,this._constrain(),this._calcMatrices())},H.center.get=function(){return this._center},H.center.set=function(f){f.lat===this._center.lat&&f.lng===this._center.lng||(this._unmodified=!1,this._center=f,this._constrain(),this._calcMatrices())},H.padding.get=function(){return this._edgeInsets.toJSON()},H.padding.set=function(f){this._edgeInsets.equals(f)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,f,1),this._calcMatrices())},H.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},F.prototype.isPaddingEqual=function(f){return this._edgeInsets.equals(f)},F.prototype.interpolatePadding=function(f,b,p){this._unmodified=!1,this._edgeInsets.interpolate(f,b,p),this._constrain(),this._calcMatrices()},F.prototype.coveringZoomLevel=function(f){var b=(f.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/f.tileSize));return Math.max(0,b)},F.prototype.getVisibleUnwrappedCoordinates=function(f){var b=[new t.UnwrappedTileID(0,f)];if(this._renderWorldCopies)for(var p=this.pointCoordinate(new t.Point(0,0)),E=this.pointCoordinate(new t.Point(this.width,0)),B=this.pointCoordinate(new t.Point(this.width,this.height)),q=this.pointCoordinate(new t.Point(0,this.height)),V=Math.floor(Math.min(p.x,E.x,B.x,q.x)),Y=Math.floor(Math.max(p.x,E.x,B.x,q.x)),ot=V-1;ot<=Y+1;ot++)ot!==0&&b.push(new t.UnwrappedTileID(ot,f));return b},F.prototype.coveringTiles=function(f){var b=this.coveringZoomLevel(f),p=b;if(f.minzoom!==void 0&&b<f.minzoom)return[];f.maxzoom!==void 0&&b>f.maxzoom&&(b=f.maxzoom);var E=this.crs.fromLngLat(this.center),B=Math.pow(2,b),q=[B*E.x,B*E.y,0],V=g.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,b),Y=f.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(Y=b);var ot=function(ar){return{aabb:new _([ar*B,0,0],[(ar+1)*B,B,0]),zoom:0,x:0,y:0,wrap:ar,fullyVisible:!1}},gt=[],St=[],kt=b,It=f.reparseOverscaled?p:b;if(this._renderWorldCopies)for(var Xt=1;Xt<=3;Xt++)gt.push(ot(-Xt)),gt.push(ot(Xt));for(gt.push(ot(0));gt.length>0;){var Bt=gt.pop(),ae=Bt.x,Jt=Bt.y,he=Bt.fullyVisible;if(!he){var Me=Bt.aabb.intersects(V);if(Me===0)continue;he=Me===2}var Ie=Bt.aabb.distanceX(q),De=Bt.aabb.distanceY(q),Ne=Math.max(Math.abs(Ie),Math.abs(De));if(Bt.zoom===kt||Ne>3+(1<<kt-Bt.zoom)-2&&Bt.zoom>=Y)St.push({tileID:new t.OverscaledTileID(Bt.zoom===kt?It:Bt.zoom,Bt.wrap,Bt.zoom,ae,Jt,this.indexExtent),distanceSq:t.sqrLen([q[0]-.5-ae,q[1]-.5-Jt])});else for(var Ge=0;Ge<4;Ge++){var je=(ae<<1)+Ge%2,Ye=(Jt<<1)+(Ge>>1);gt.push({aabb:Bt.aabb.quadrant(Ge),zoom:Bt.zoom+1,x:je,y:Ye,wrap:Bt.wrap,fullyVisible:he})}}return St.sort(function(ar,cr){return ar.distanceSq-cr.distanceSq}).map(function(ar){return ar.tileID})},F.prototype.resize=function(f,b){this.width=f,this.height=b,this.pixelsToGLUnits=[2/f,-2/b],this._constrain(),this._calcMatrices()},H.unmodified.get=function(){return this._unmodified},F.prototype.zoomScale=function(f){return Math.pow(2,f)},F.prototype.scaleZoom=function(f){return Math.log(f)/Math.LN2},F.prototype.project=function(f){var b=this.latRange?t.clamp(f.lat,-this.maxValidLatitude,this.maxValidLatitude):f.lat,p=this.lngLatXY(f.lng,b);return new t.Point(p[0],p[1])},F.prototype.unproject=function(f){var b=this.xYLngLat(f.x,f.y);return new t.LngLat(b[0],b[1])},H.point.get=function(){return this.project(this.center)},F.prototype.lngLatXY=function(f,b){var p=this.crs.fromWGS84([f,b]);return[(p[0]-this.originX)*this.worldSize/this.worldWidth,(this.originY-p[1])*this.worldSize/this.worldHeight]},F.prototype.lngX=function(f){return this.lngLatXY(f,this.center.lat)[0]},F.prototype.latY=function(f){return this.lngLatXY(this.center.lng,f)[1]},F.prototype.xYLngLat=function(f,b){return this.crs.toWGS84([f*this.worldWidth/this.worldSize+this.originX,this.originY-b*this.worldHeight/this.worldSize])},F.prototype.xLng=function(f){var b=this.center,p=this.lngLatXY(b.lng,b.lat);return this.xYLngLat(f,p[1])[0]},F.prototype.yLat=function(f){var b=this.center,p=this.lngLatXY(b.lng,b.lat);return this.xYLngLat(p[0],f)[1]},F.prototype.setLocationAtPoint=function(f,b){var p=this.pointCoordinate(b),E=this.pointCoordinate(this.centerPoint),B=this.locationCoordinate(f),q=new t.MercatorCoordinate(B.x-(p.x-E.x),B.y-(p.y-E.y));this.center=this.coordinateLocation(q),this._renderWorldCopies&&(this.center=this.center.wrap())},F.prototype.locationPoint=function(f){return this.coordinatePoint(this.locationCoordinate(f))},F.prototype.pointLocation=function(f){return this.coordinateLocation(this.pointCoordinate(f))},F.prototype.locationCoordinate=function(f){return this.crs.fromLngLat(f)},F.prototype.coordinateLocation=function(f){return this.crs.toLngLat(f.x,f.y)},F.prototype.pointCoordinate=function(f){var b=[f.x,f.y,0,1],p=[f.x,f.y,1,1];t.transformMat4(b,b,this.pixelMatrixInverse),t.transformMat4(p,p,this.pixelMatrixInverse);var E=b[3],B=p[3],q=b[1]/E,V=p[1]/B,Y=b[2]/E,ot=p[2]/B,gt=Y===ot?0:(0-Y)/(ot-Y);return new t.MercatorCoordinate(t.number(b[0]/E,p[0]/B,gt)/this.worldSize,t.number(q,V,gt)/this.worldSize)},F.prototype.coordinatePoint=function(f){var b=[f.x*this.worldSize,f.y*this.worldSize,0,1];return t.transformMat4(b,b,this.pixelMatrix),new t.Point(b[0]/b[3],b[1]/b[3])},F.prototype.getBounds=function(){return new t.LngLatBounds().extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},F.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},F.prototype.setMaxBounds=function(f){f?(this.lngRange=[f.getWest(),f.getEast()],this.latRange=[f.getSouth(),f.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},F.prototype.calculatePosMatrix=function(f,b){b===void 0&&(b=!1);var p=f.key,E=b?this._alignedPosMatrixCache:this._posMatrixCache;if(E[p])return E[p];var B=f.canonical,q=this.worldSize/this.zoomScale(B.z),V=B.x+Math.pow(2,B.z)*f.wrap,Y=t.identity(new Float64Array(16));return t.translate(Y,Y,[V*q,B.y*q,0]),t.scale(Y,Y,[q/t.EXTENT,q/t.EXTENT,1]),t.multiply(Y,b?this.alignedProjMatrix:this.projMatrix,Y),E[p]=new Float32Array(Y),E[p]},F.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},F.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var f,b,p,E,B=-90,q=90,V=-180,Y=180,ot=this.size,gt=this._unmodified;if(this.latRange){var St=this.latRange;B=this.latY(St[1]),f=(q=this.latY(St[0]))-B<ot.y?ot.y/(q-B):0}if(this.lngRange){var kt=this.lngRange;V=this.lngX(kt[0]),b=(Y=this.lngX(kt[1]))-V<ot.x?ot.x/(Y-V):0}var It=this.point,Xt=Math.max(b||0,f||0);if(Xt)return this.center=this.unproject(new t.Point(b?(Y+V)/2:It.x,f?(q+B)/2:It.y)),this.zoom+=this.scaleZoom(Xt),this._unmodified=gt,void(this._constraining=!1);if(this.latRange){var Bt=It.y,ae=ot.y/2;Bt-ae<B&&(E=B+ae),Bt+ae>q&&(E=q-ae)}if(this.lngRange){var Jt=It.x,he=ot.x/2;Jt-he<V&&(p=V+he),Jt+he>Y&&(p=Y-he)}p===void 0&&E===void 0||(this.center=this.unproject(new t.Point(p!==void 0?p:It.x,E!==void 0?E:It.y))),this._unmodified=gt,this._constraining=!1}},F.prototype._calcMatrices=function(){if(this.height){var f=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var b=Math.PI/2+this._pitch,p=this._fov*(.5+f.y/this.height),E=Math.sin(p)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-b-p,.01,Math.PI-.01)),B=this.point,q=B.x,V=B.y,Y=1.01*(Math.cos(Math.PI/2-this._pitch)*E+this.cameraToCenterDistance),ot=this.height/50,gt=new Float64Array(16);t.perspective(gt,this._fov,this.width/this.height,ot,Y),gt[8]=2*-f.x/this.width,gt[9]=2*f.y/this.height,t.scale(gt,gt,[1,-1,1]),t.translate(gt,gt,[0,0,-this.cameraToCenterDistance]),t.rotateX(gt,gt,this._pitch),t.rotateZ(gt,gt,this.angle),t.translate(gt,gt,[-q,-V,0]),this.mercatorMatrix=t.scale([],gt,[this.worldSize,this.worldSize,this.worldSize]);var St=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));this.units!=="m"&&this.units!=="meter"||(St=this.crs?this.worldSize/(this.crs.extent[3]-this.crs.extent[1]):this.worldSize/(this.latRange[1]-this.latRange[0])),t.scale(gt,gt,[1,1,St,1]),this.projMatrix=gt,this.invProjMatrix=t.invert([],this.projMatrix);var kt=this.width%2/2,It=this.height%2/2,Xt=Math.cos(this.angle),Bt=Math.sin(this.angle),ae=q-Math.round(q)+Xt*kt+Bt*It,Jt=V-Math.round(V)+Xt*It+Bt*kt,he=new Float64Array(gt);if(t.translate(he,he,[ae>.5?ae-1:ae,Jt>.5?Jt-1:Jt,0]),this.alignedProjMatrix=he,gt=t.create(),t.scale(gt,gt,[this.width/2,-this.height/2,1]),t.translate(gt,gt,[1,-1,0]),this.labelPlaneMatrix=gt,gt=t.create(),t.scale(gt,gt,[1,-1,1]),t.translate(gt,gt,[-1,-1,0]),t.scale(gt,gt,[2/this.width,2/this.height,1]),this.glCoordMatrix=gt,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(gt=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=gt,this._posMatrixCache={},this._alignedPosMatrixCache={}}},F.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var f=this.pointCoordinate(new t.Point(0,0)),b=[f.x*this.worldSize,f.y*this.worldSize,0,1];return t.transformMat4(b,b,this.pixelMatrix)[3]/this.cameraToCenterDistance},F.prototype.getCameraPoint=function(){var f=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,f))},F.prototype.getCameraQueryGeometry=function(f){var b=this.getCameraPoint();if(f.length===1)return[f[0],b];for(var p=b.x,E=b.y,B=b.x,q=b.y,V=0,Y=f;V<Y.length;V+=1){var ot=Y[V];p=Math.min(p,ot.x),E=Math.min(E,ot.y),B=Math.max(B,ot.x),q=Math.max(q,ot.y)}return[new t.Point(p,E),new t.Point(B,E),new t.Point(B,q),new t.Point(p,q),new t.Point(p,E)]},Object.defineProperties(F.prototype,H);var at=function(f){var b,p,E,B;this._hashName=f&&encodeURIComponent(f),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(b=this._updateHashUnthrottled.bind(this),p=!1,E=null,B=function(){E=null,p&&(b(),E=setTimeout(B,300),p=!1)},function(){return p=!0,E||B(),E})};at.prototype.addTo=function(f){return this._map=f,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},at.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},at.prototype.getHashString=function(f){var b=this._map.getCenter(),p=Math.round(100*this._map.getZoom())/100,E=Math.ceil((p*Math.LN2+Math.log(512/360/.5))/Math.LN10),B=Math.pow(10,E),q=Math.round(b.lng*B)/B,V=Math.round(b.lat*B)/B,Y=this._map.getBearing(),ot=this._map.getPitch(),gt="";if(gt+=f?"/"+q+"/"+V+"/"+p:p+"/"+V+"/"+q,(Y||ot)&&(gt+="/"+Math.round(10*Y)/10),ot&&(gt+="/"+Math.round(ot)),this._hashName){var St=this._hashName,kt=!1,It=t.window.location.hash.slice(1).split("&").map(function(Xt){var Bt=Xt.split("=")[0];return Bt===St?(kt=!0,Bt+"="+gt):Xt}).filter(function(Xt){return Xt});return kt||It.push(St+"="+gt),"#"+It.join("&")}return"#"+gt},at.prototype._getCurrentHash=function(){var f,b=this,p=t.window.location.hash.replace("#","");return this._hashName?(p.split("&").map(function(E){return E.split("=")}).forEach(function(E){E[0]===b._hashName&&(f=E)}),(f&&f[1]||"").split("/")):p.split("/")},at.prototype._onHashChange=function(){var f=this._getCurrentHash();if(f.length>=3&&!f.some(function(p){return isNaN(p)})){var b=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(f[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+f[2],+f[1]],zoom:+f[0],bearing:b,pitch:+(f[4]||0)}),!0}return!1},at.prototype._updateHashUnthrottled=function(){var f=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",f)}catch(b){}};var vt={linearity:.3,easing:t.bezier(0,0,.3,1)},qt=t.extend({deceleration:2500,maxSpeed:1400},vt),pe=t.extend({deceleration:20,maxSpeed:1400},vt),Pe=t.extend({deceleration:1e3,maxSpeed:360},vt),qe=t.extend({deceleration:1e3,maxSpeed:90},vt),Ke=function(f){this._map=f,this.clear()};function nr(f,b){(!f.duration||f.duration<b.duration)&&(f.duration=b.duration,f.easing=b.easing)}function Nr(f,b,p){var E=p.maxSpeed,B=p.linearity,q=p.deceleration,V=t.clamp(f*B/(b/1e3),-E,E),Y=Math.abs(V)/(q*B);return{easing:p.easing,duration:1e3*Y,amount:V*(Y/2)}}Ke.prototype.clear=function(){this._inertiaBuffer=[]},Ke.prototype.record=function(f){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:f})},Ke.prototype._drainInertiaBuffer=function(){for(var f=this._inertiaBuffer,b=t.browser.now();f.length>0&&b-f[0].time>160;)f.shift()},Ke.prototype._onMoveEnd=function(f){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var b={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},p=0,E=this._inertiaBuffer;p<E.length;p+=1){var B=E[p].settings;b.zoom+=B.zoomDelta||0,b.bearing+=B.bearingDelta||0,b.pitch+=B.pitchDelta||0,B.panDelta&&b.pan._add(B.panDelta),B.around&&(b.around=B.around),B.pinchAround&&(b.pinchAround=B.pinchAround)}var q=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,V={};if(b.pan.mag()){var Y=Nr(b.pan.mag(),q,t.extend({},qt,f||{}));V.offset=b.pan.mult(Y.amount/b.pan.mag()),V.center=this._map.transform.center,nr(V,Y)}if(b.zoom){var ot=Nr(b.zoom,q,pe);V.zoom=this._map.transform.zoom+ot.amount,nr(V,ot)}if(b.bearing){var gt=Nr(b.bearing,q,Pe);V.bearing=this._map.transform.bearing+t.clamp(gt.amount,-179,179),nr(V,gt)}if(b.pitch){var St=Nr(b.pitch,q,qe);V.pitch=this._map.transform.pitch+St.amount,nr(V,St)}if(V.zoom||V.bearing){var kt=b.pinchAround===void 0?b.around:b.pinchAround;V.around=kt?this._map.unproject(kt):this._map.getCenter()}return this.clear(),t.extend(V,{noMoveStart:!0})}};var Ar=function(f){function b(E,B,q,V){V===void 0&&(V={});var Y=r.mousePos(B.getCanvasContainer(),q),ot=B.unproject(Y);f.call(this,E,t.extend({point:Y,lngLat:ot,originalEvent:q},V)),this._defaultPrevented=!1,this.target=B}f&&(b.__proto__=f),(b.prototype=Object.create(f&&f.prototype)).constructor=b;var p={defaultPrevented:{configurable:!0}};return b.prototype.preventDefault=function(){this._defaultPrevented=!0},p.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(b.prototype,p),b}(t.Event),ri=function(f){function b(E,B,q){var V=E==="touchend"?q.changedTouches:q.touches,Y=r.touchPos(B.getCanvasContainer(),V),ot=Y.map(function(kt){return B.unproject(kt)}),gt=Y.reduce(function(kt,It,Xt,Bt){return kt.add(It.div(Bt.length))},new t.Point(0,0)),St=B.unproject(gt);f.call(this,E,{points:Y,point:gt,lngLats:ot,lngLat:St,originalEvent:q}),this._defaultPrevented=!1}f&&(b.__proto__=f),(b.prototype=Object.create(f&&f.prototype)).constructor=b;var p={defaultPrevented:{configurable:!0}};return b.prototype.preventDefault=function(){this._defaultPrevented=!0},p.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(b.prototype,p),b}(t.Event),Zi=function(f){function b(E,B,q){f.call(this,E,{originalEvent:q}),this._defaultPrevented=!1}f&&(b.__proto__=f),(b.prototype=Object.create(f&&f.prototype)).constructor=b;var p={defaultPrevented:{configurable:!0}};return b.prototype.preventDefault=function(){this._defaultPrevented=!0},p.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(b.prototype,p),b}(t.Event),pi=function(f,b){this._map=f,this._clickTolerance=b.clickTolerance};pi.prototype.reset=function(){delete this._mousedownPos},pi.prototype.wheel=function(f){return this._firePreventable(new Zi(f.type,this._map,f))},pi.prototype.mousedown=function(f,b){return this._mousedownPos=b,this._firePreventable(new Ar(f.type,this._map,f))},pi.prototype.mouseup=function(f){this._map.fire(new Ar(f.type,this._map,f))},pi.prototype.click=function(f,b){this._mousedownPos&&this._mousedownPos.dist(b)>=this._clickTolerance||this._map.fire(new Ar(f.type,this._map,f))},pi.prototype.dblclick=function(f){return this._firePreventable(new Ar(f.type,this._map,f))},pi.prototype.mouseover=function(f){this._map.fire(new Ar(f.type,this._map,f))},pi.prototype.mouseout=function(f){this._map.fire(new Ar(f.type,this._map,f))},pi.prototype.touchstart=function(f){return this._firePreventable(new ri(f.type,this._map,f))},pi.prototype.touchmove=function(f){this._map.fire(new ri(f.type,this._map,f))},pi.prototype.touchend=function(f){this._map.fire(new ri(f.type,this._map,f))},pi.prototype.touchcancel=function(f){this._map.fire(new ri(f.type,this._map,f))},pi.prototype._firePreventable=function(f){if(this._map.fire(f),f.defaultPrevented)return{}},pi.prototype.isEnabled=function(){return!0},pi.prototype.isActive=function(){return!1},pi.prototype.enable=function(){},pi.prototype.disable=function(){};var sn=function(f){this._map=f};sn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},sn.prototype.mousemove=function(f){this._map.fire(new Ar(f.type,this._map,f))},sn.prototype.mousedown=function(){this._delayContextMenu=!0},sn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ar("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},sn.prototype.contextmenu=function(f){this._delayContextMenu?this._contextMenuEvent=f:this._map.fire(new Ar(f.type,this._map,f)),this._map.listens("contextmenu")&&f.preventDefault()},sn.prototype.isEnabled=function(){return!0},sn.prototype.isActive=function(){return!1},sn.prototype.enable=function(){},sn.prototype.disable=function(){};var pn=function(f,b){this._map=f,this._el=f.getCanvasContainer(),this._container=f.getContainer(),this._clickTolerance=b.clickTolerance||1};function Xa(f,b){for(var p={},E=0;E<f.length;E++)p[f[E].identifier]=b[E];return p}pn.prototype.isEnabled=function(){return!!this._enabled},pn.prototype.isActive=function(){return!!this._active},pn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},pn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},pn.prototype.mousedown=function(f,b){this.isEnabled()&&f.shiftKey&&f.button===0&&(r.disableDrag(),this._startPos=this._lastPos=b,this._active=!0)},pn.prototype.mousemoveWindow=function(f,b){if(this._active){var p=b;if(!(this._lastPos.equals(p)||!this._box&&p.dist(this._startPos)<this._clickTolerance)){var E=this._startPos;this._lastPos=p,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",f));var B=Math.min(E.x,p.x),q=Math.max(E.x,p.x),V=Math.min(E.y,p.y),Y=Math.max(E.y,p.y);r.setTransform(this._box,"translate("+B+"px,"+V+"px)"),this._box.style.width=q-B+"px",this._box.style.height=Y-V+"px"}}},pn.prototype.mouseupWindow=function(f,b){var p=this;if(this._active&&f.button===0){var E=this._startPos,B=b;if(this.reset(),r.suppressClick(),E.x!==B.x||E.y!==B.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:f})),{cameraAnimation:function(q){return q.fitScreenCoordinates(E,B,p._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",f)}},pn.prototype.keydown=function(f){this._active&&f.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",f))},pn.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},pn.prototype._fireEvent=function(f,b){return this._map.fire(new t.Event(f,{originalEvent:b}))};var va=function(f){this.reset(),this.numTouches=f.numTouches};va.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},va.prototype.touchstart=function(f,b,p){(this.centroid||p.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=f.timeStamp),p.length===this.numTouches&&(this.centroid=function(E){for(var B=new t.Point(0,0),q=0,V=E;q<V.length;q+=1)B._add(V[q]);return B.div(E.length)}(b),this.touches=Xa(p,b)))},va.prototype.touchmove=function(f,b,p){if(!this.aborted&&this.centroid){var E=Xa(p,b);for(var B in this.touches){var q=E[B];(!q||q.dist(this.touches[B])>30)&&(this.aborted=!0)}}},va.prototype.touchend=function(f,b,p){if((!this.centroid||f.timeStamp-this.startTime>500)&&(this.aborted=!0),p.length===0){var E=!this.aborted&&this.centroid;if(this.reset(),E)return E}};var us=function(f){this.singleTap=new va(f),this.numTaps=f.numTaps,this.reset()};us.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},us.prototype.touchstart=function(f,b,p){this.singleTap.touchstart(f,b,p)},us.prototype.touchmove=function(f,b,p){this.singleTap.touchmove(f,b,p)},us.prototype.touchend=function(f,b,p){var E=this.singleTap.touchend(f,b,p);if(E){var B=f.timeStamp-this.lastTime<500,q=!this.lastTap||this.lastTap.dist(E)<30;if(B&&q||this.reset(),this.count++,this.lastTime=f.timeStamp,this.lastTap=E,this.count===this.numTaps)return this.reset(),E}};var _a=function(){this._zoomIn=new us({numTouches:1,numTaps:2}),this._zoomOut=new us({numTouches:2,numTaps:1}),this.reset()};_a.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},_a.prototype.touchstart=function(f,b,p){this._zoomIn.touchstart(f,b,p),this._zoomOut.touchstart(f,b,p)},_a.prototype.touchmove=function(f,b,p){this._zoomIn.touchmove(f,b,p),this._zoomOut.touchmove(f,b,p)},_a.prototype.touchend=function(f,b,p){var E=this,B=this._zoomIn.touchend(f,b,p),q=this._zoomOut.touchend(f,b,p);return B?(this._active=!0,f.preventDefault(),setTimeout(function(){return E.reset()},0),{cameraAnimation:function(V){return V.easeTo({duration:300,zoom:V.getZoom()+1,around:V.unproject(B)},{originalEvent:f})}}):q?(this._active=!0,f.preventDefault(),setTimeout(function(){return E.reset()},0),{cameraAnimation:function(V){return V.easeTo({duration:300,zoom:V.getZoom()-1,around:V.unproject(q)},{originalEvent:f})}}):void 0},_a.prototype.touchcancel=function(){this.reset()},_a.prototype.enable=function(){this._enabled=!0},_a.prototype.disable=function(){this._enabled=!1,this.reset()},_a.prototype.isEnabled=function(){return this._enabled},_a.prototype.isActive=function(){return this._active};var zu={0:1,2:2},kn=function(f){this.reset(),this._clickTolerance=f.clickTolerance||1};kn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},kn.prototype._correctButton=function(f,b){return!1},kn.prototype._move=function(f,b){return{}},kn.prototype.mousedown=function(f,b){if(!this._lastPoint){var p=r.mouseButton(f);this._correctButton(f,p)&&(this._lastPoint=b,this._eventButton=p)}},kn.prototype.mousemoveWindow=function(f,b){var p=this._lastPoint;if(p){if(f.preventDefault(),function(E,B){var q=zu[B];return E.buttons===void 0||(E.buttons&q)!==q}(f,this._eventButton))this.reset();else if(this._moved||!(b.dist(p)<this._clickTolerance))return this._moved=!0,this._lastPoint=b,this._move(p,b)}},kn.prototype.mouseupWindow=function(f){this._lastPoint&&r.mouseButton(f)===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())},kn.prototype.enable=function(){this._enabled=!0},kn.prototype.disable=function(){this._enabled=!1,this.reset()},kn.prototype.isEnabled=function(){return this._enabled},kn.prototype.isActive=function(){return this._active};var Wa=function(f){function b(){f.apply(this,arguments)}return f&&(b.__proto__=f),(b.prototype=Object.create(f&&f.prototype)).constructor=b,b.prototype.mousedown=function(p,E){f.prototype.mousedown.call(this,p,E),this._lastPoint&&(this._active=!0)},b.prototype._correctButton=function(p,E){return E===0&&!p.ctrlKey},b.prototype._move=function(p,E){return{around:E,panDelta:E.sub(p)}},b}(kn),aa=function(f){function b(){f.apply(this,arguments)}return f&&(b.__proto__=f),(b.prototype=Object.create(f&&f.prototype)).constructor=b,b.prototype._correctButton=function(p,E){return E===0&&p.ctrlKey||E===2},b.prototype._move=function(p,E){var B=.8*(E.x-p.x);if(B)return this._active=!0,{bearingDelta:B}},b.prototype.contextmenu=function(p){p.preventDefault()},b}(kn),Oa=function(f){function b(){f.apply(this,arguments)}return f&&(b.__proto__=f),(b.prototype=Object.create(f&&f.prototype)).constructor=b,b.prototype._correctButton=function(p,E){return E===0&&p.ctrlKey||E===2},b.prototype._move=function(p,E){var B=-.5*(E.y-p.y);if(B)return this._active=!0,{pitchDelta:B}},b.prototype.contextmenu=function(p){p.preventDefault()},b}(kn),nn=function(f){this._minTouches=1,this._clickTolerance=f.clickTolerance||1,this.reset()};nn.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},nn.prototype.touchstart=function(f,b,p){return this._calculateTransform(f,b,p)},nn.prototype.touchmove=function(f,b,p){if(this._active&&!(p.length<this._minTouches))return f.preventDefault(),this._calculateTransform(f,b,p)},nn.prototype.touchend=function(f,b,p){this._calculateTransform(f,b,p),this._active&&p.length<this._minTouches&&this.reset()},nn.prototype.touchcancel=function(){this.reset()},nn.prototype._calculateTransform=function(f,b,p){p.length>0&&(this._active=!0);var E=Xa(p,b),B=new t.Point(0,0),q=new t.Point(0,0),V=0;for(var Y in E){var ot=E[Y],gt=this._touches[Y];gt&&(B._add(ot),q._add(ot.sub(gt)),V++,E[Y]=ot)}if(this._touches=E,!(V<this._minTouches)&&q.mag()){var St=q.div(V);if(this._sum._add(St),!(this._sum.mag()<this._clickTolerance))return{around:B.div(V),panDelta:St}}},nn.prototype.enable=function(){this._enabled=!0},nn.prototype.disable=function(){this._enabled=!1,this.reset()},nn.prototype.isEnabled=function(){return this._enabled},nn.prototype.isActive=function(){return this._active};var zr=function(){this.reset()};function Gu(f,b,p){for(var E=0;E<f.length;E++)if(f[E].identifier===p)return b[E]}function xo(f,b){return Math.log(f/b)/Math.LN2}zr.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},zr.prototype._start=function(f){},zr.prototype._move=function(f,b,p){return{}},zr.prototype.touchstart=function(f,b,p){this._firstTwoTouches||p.length<2||(this._firstTwoTouches=[p[0].identifier,p[1].identifier],this._start([b[0],b[1]]))},zr.prototype.touchmove=function(f,b,p){if(this._firstTwoTouches){f.preventDefault();var E=this._firstTwoTouches,B=E[1],q=Gu(p,b,E[0]),V=Gu(p,b,B);if(q&&V){var Y=this._aroundCenter?null:q.add(V).div(2);return this._move([q,V],Y,f)}}},zr.prototype.touchend=function(f,b,p){if(this._firstTwoTouches){var E=this._firstTwoTouches,B=E[1],q=Gu(p,b,E[0]),V=Gu(p,b,B);q&&V||(this._active&&r.suppressClick(),this.reset())}},zr.prototype.touchcancel=function(){this.reset()},zr.prototype.enable=function(f){this._enabled=!0,this._aroundCenter=!!f&&f.around==="center"},zr.prototype.disable=function(){this._enabled=!1,this.reset()},zr.prototype.isEnabled=function(){return this._enabled},zr.prototype.isActive=function(){return this._active};var ls=function(f){function b(){f.apply(this,arguments)}return f&&(b.__proto__=f),(b.prototype=Object.create(f&&f.prototype)).constructor=b,b.prototype.reset=function(){f.prototype.reset.call(this),delete this._distance,delete this._startDistance},b.prototype._start=function(p){this._startDistance=this._distance=p[0].dist(p[1])},b.prototype._move=function(p,E){var B=this._distance;if(this._distance=p[0].dist(p[1]),this._active||!(Math.abs(xo(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:xo(this._distance,B),pinchAround:E}},b}(zr);function Ra(f,b){return 180*f.angleWith(b)/Math.PI}var Xo=function(f){function b(){f.apply(this,arguments)}return f&&(b.__proto__=f),(b.prototype=Object.create(f&&f.prototype)).constructor=b,b.prototype.reset=function(){f.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},b.prototype._start=function(p){this._startVector=this._vector=p[0].sub(p[1]),this._minDiameter=p[0].dist(p[1])},b.prototype._move=function(p,E){var B=this._vector;if(this._vector=p[0].sub(p[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Ra(this._vector,B),pinchAround:E}},b.prototype._isBelowThreshold=function(p){this._minDiameter=Math.min(this._minDiameter,p.mag());var E=25/(Math.PI*this._minDiameter)*360,B=Ra(p,this._startVector);return Math.abs(B)<E},b}(zr);function Gi(f){return Math.abs(f.y)>Math.abs(f.x)}var hs=function(f){function b(){f.apply(this,arguments)}return f&&(b.__proto__=f),(b.prototype=Object.create(f&&f.prototype)).constructor=b,b.prototype.reset=function(){f.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},b.prototype._start=function(p){this._lastPoints=p,Gi(p[0].sub(p[1]))&&(this._valid=!1)},b.prototype._move=function(p,E,B){var q=p[0].sub(this._lastPoints[0]),V=p[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(q,V,B.timeStamp),this._valid)return this._lastPoints=p,this._active=!0,{pitchDelta:(q.y+V.y)/2*-.5}},b.prototype.gestureBeginsVertically=function(p,E,B){if(this._valid!==void 0)return this._valid;var q=p.mag()>=2,V=E.mag()>=2;if(q||V){if(!q||!V)return this._firstMove===void 0&&(this._firstMove=B),B-this._firstMove<100&&void 0;var Y=p.y>0==E.y>0;return Gi(p)&&Gi(E)&&Y}},b}(zr),qu={panStep:100,bearingStep:15,pitchStep:10},Ki=function(){var f=qu;this._panStep=f.panStep,this._bearingStep=f.bearingStep,this._pitchStep=f.pitchStep};function gc(f){return f*(2-f)}Ki.prototype.reset=function(){this._active=!1},Ki.prototype.keydown=function(f){var b=this;if(!(f.altKey||f.ctrlKey||f.metaKey)){var p=0,E=0,B=0,q=0,V=0;switch(f.keyCode){case 61:case 107:case 171:case 187:p=1;break;case 189:case 109:case 173:p=-1;break;case 37:f.shiftKey?E=-1:(f.preventDefault(),q=-1);break;case 39:f.shiftKey?E=1:(f.preventDefault(),q=1);break;case 38:f.shiftKey?B=1:(f.preventDefault(),V=-1);break;case 40:f.shiftKey?B=-1:(f.preventDefault(),V=1);break;default:return}return{cameraAnimation:function(Y){var ot=Y.getZoom();Y.easeTo({duration:300,easeId:"keyboardHandler",easing:gc,zoom:p?Math.round(ot)+p*(f.shiftKey?2:1):ot,bearing:Y.getBearing()+E*b._bearingStep,pitch:Y.getPitch()+B*b._pitchStep,offset:[-q*b._panStep,-V*b._panStep],center:Y.getCenter()},{originalEvent:f})}}}},Ki.prototype.enable=function(){this._enabled=!0},Ki.prototype.disable=function(){this._enabled=!1,this.reset()},Ki.prototype.isEnabled=function(){return this._enabled},Ki.prototype.isActive=function(){return this._active};var sa=function(f,b){this._map=f,this._el=f.getCanvasContainer(),this._handler=b,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)};sa.prototype.setZoomRate=function(f){this._defaultZoomRate=f},sa.prototype.setWheelZoomRate=function(f){this._wheelZoomRate=f},sa.prototype.isEnabled=function(){return!!this._enabled},sa.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},sa.prototype.isZooming=function(){return!!this._zooming},sa.prototype.enable=function(f){this.isEnabled()||(this._enabled=!0,this._aroundCenter=f&&f.around==="center")},sa.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},sa.prototype.wheel=function(f){if(this.isEnabled()){var b=f.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*f.deltaY:f.deltaY,p=t.browser.now(),E=p-(this._lastWheelEventTime||0);this._lastWheelEventTime=p,b!==0&&b%4.000244140625==0?this._type="wheel":b!==0&&Math.abs(b)<4?this._type="trackpad":E>400?(this._type=null,this._lastValue=b,this._timeout=setTimeout(this._onTimeout,40,f)):this._type||(this._type=Math.abs(E*b)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,b+=this._lastValue)),f.shiftKey&&b&&(b/=4),this._type&&(this._lastWheelEvent=f,this._delta-=b,this._active||this._start(f)),f.preventDefault()}},sa.prototype._onTimeout=function(f){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(f)},sa.prototype._start=function(f){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var b=r.mousePos(this._el,f);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(b)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},sa.prototype.renderFrame=function(){var f=this;if(this._frameId&&(this._frameId=null,this.isActive())){var b=this._map.transform;if(this._delta!==0){var p=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,E=2/(1+Math.exp(-Math.abs(this._delta*p)));this._delta<0&&E!==0&&(E=1/E);var B=typeof this._targetZoom=="number"?b.zoomScale(this._targetZoom):b.scale;this._targetZoom=Math.min(b.maxZoom,Math.max(b.minZoom,b.scaleZoom(B*E))),this._type==="wheel"&&(this._startZoom=b.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var q,V=typeof this._targetZoom=="number"?this._targetZoom:b.zoom,Y=this._startZoom,ot=this._easing,gt=!1;if(this._type==="wheel"&&Y&&ot){var St=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),kt=ot(St);q=t.number(Y,V,kt),St<1?this._frameId||(this._frameId=!0):gt=!0}else q=V,gt=!0;return this._active=!0,gt&&(this._active=!1,this._finishTimeout=setTimeout(function(){f._zooming=!1,f._handler._triggerRenderFrame(),delete f._targetZoom,delete f._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!gt,zoomDelta:q-b.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},sa.prototype._smoothOutEasing=function(f){var b=t.ease;if(this._prevEase){var p=this._prevEase,E=(t.browser.now()-p.start)/p.duration,B=p.easing(E+.01)-p.easing(E),q=.27/Math.sqrt(B*B+1e-4)*.01,V=Math.sqrt(.0729-q*q);b=t.bezier(q,V,.25,1)}return this._prevEase={start:t.browser.now(),duration:f,easing:b},b},sa.prototype.reset=function(){this._active=!1};var cs=function(f,b){this._clickZoom=f,this._tapZoom=b};cs.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},cs.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},cs.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},cs.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var fu=function(){this.reset()};fu.prototype.reset=function(){this._active=!1},fu.prototype.dblclick=function(f,b){return f.preventDefault(),{cameraAnimation:function(p){p.easeTo({duration:300,zoom:p.getZoom()+(f.shiftKey?-1:1),around:p.unproject(b)},{originalEvent:f})}}},fu.prototype.enable=function(){this._enabled=!0},fu.prototype.disable=function(){this._enabled=!1,this.reset()},fu.prototype.isEnabled=function(){return this._enabled},fu.prototype.isActive=function(){return this._active};var qn=function(){this._tap=new us({numTouches:1,numTaps:1}),this.reset()};qn.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},qn.prototype.touchstart=function(f,b,p){this._swipePoint||(this._tapTime&&f.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?p.length>0&&(this._swipePoint=b[0],this._swipeTouch=p[0].identifier):this._tap.touchstart(f,b,p))},qn.prototype.touchmove=function(f,b,p){if(this._tapTime){if(this._swipePoint){if(p[0].identifier!==this._swipeTouch)return;var E=b[0],B=E.y-this._swipePoint.y;return this._swipePoint=E,f.preventDefault(),this._active=!0,{zoomDelta:B/128}}}else this._tap.touchmove(f,b,p)},qn.prototype.touchend=function(f,b,p){this._tapTime?this._swipePoint&&p.length===0&&this.reset():this._tap.touchend(f,b,p)&&(this._tapTime=f.timeStamp)},qn.prototype.touchcancel=function(){this.reset()},qn.prototype.enable=function(){this._enabled=!0},qn.prototype.disable=function(){this._enabled=!1,this.reset()},qn.prototype.isEnabled=function(){return this._enabled},qn.prototype.isActive=function(){return this._active};var Wl=function(f,b,p){this._el=f,this._mousePan=b,this._touchPan=p};Wl.prototype.enable=function(f){this._inertiaOptions=f||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Wl.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Wl.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Wl.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Wo=function(f,b,p){this._pitchWithRotate=f.pitchWithRotate,this._mouseRotate=b,this._mousePitch=p};Wo.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Wo.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Wo.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Wo.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var yl=function(f,b,p,E){this._el=f,this._touchZoom=b,this._touchRotate=p,this._tapDragZoom=E,this._rotationDisabled=!1,this._enabled=!0};yl.prototype.enable=function(f){this._touchZoom.enable(f),this._rotationDisabled||this._touchRotate.enable(f),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},yl.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},yl.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},yl.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},yl.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},yl.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var bo=function(f){return f.zoom||f.drag||f.pitch||f.rotate},Hl=function(f){function b(){f.apply(this,arguments)}return f&&(b.__proto__=f),(b.prototype=Object.create(f&&f.prototype)).constructor=b,b}(t.Event);function mc(f){return f.panDelta&&f.panDelta.mag()||f.zoomDelta||f.bearingDelta||f.pitchDelta}var Ti=function(f,b){this._map=f,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ke(f),this._bearingSnap=b.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(b),t.bindAll(["handleEvent","handleWindowEvent"],this);var p=this._el;this._listeners=[[p,"touchstart",{passive:!0}],[p,"touchmove",{passive:!1}],[p,"touchend",void 0],[p,"touchcancel",void 0],[p,"mousedown",void 0],[p,"mousemove",void 0],[p,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[p,"mouseover",void 0],[p,"mouseout",void 0],[p,"dblclick",void 0],[p,"click",void 0],[p,"keydown",{capture:!1}],[p,"keyup",void 0],[p,"wheel",{passive:!1}],[p,"contextmenu",void 0],[t.window,"blur",void 0]];for(var E=0,B=this._listeners;E<B.length;E+=1){var q=B[E],V=q[0];r.addEventListener(V,q[1],V===t.window.document?this.handleWindowEvent:this.handleEvent,q[2])}};Ti.prototype.destroy=function(){for(var f=0,b=this._listeners;f<b.length;f+=1){var p=b[f],E=p[0];r.removeEventListener(E,p[1],E===t.window.document?this.handleWindowEvent:this.handleEvent,p[2])}},Ti.prototype._addDefaultHandlers=function(f){var b=this._map,p=b.getCanvasContainer();this._add("mapEvent",new pi(b,f));var E=b.boxZoom=new pn(b,f);this._add("boxZoom",E);var B=new _a,q=new fu;b.doubleClickZoom=new cs(q,B),this._add("tapZoom",B),this._add("clickZoom",q);var V=new qn;this._add("tapDragZoom",V);var Y=b.touchPitch=new hs;this._add("touchPitch",Y);var ot=new aa(f),gt=new Oa(f);b.dragRotate=new Wo(f,ot,gt),this._add("mouseRotate",ot,["mousePitch"]),this._add("mousePitch",gt,["mouseRotate"]);var St=new Wa(f),kt=new nn(f);b.dragPan=new Wl(p,St,kt),this._add("mousePan",St),this._add("touchPan",kt,["touchZoom","touchRotate"]);var It=new Xo,Xt=new ls;b.touchZoomRotate=new yl(p,Xt,It,V),this._add("touchRotate",It,["touchPan","touchZoom"]),this._add("touchZoom",Xt,["touchPan","touchRotate"]);var Bt=b.scrollZoom=new sa(b,this);this._add("scrollZoom",Bt,["mousePan"]);var ae=b.keyboard=new Ki;this._add("keyboard",ae),this._add("blockableMapEvent",new sn(b));for(var Jt=0,he=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];Jt<he.length;Jt+=1){var Me=he[Jt];f.interactive&&f[Me]&&b[Me].enable(f[Me])}},Ti.prototype._add=function(f,b,p){this._handlers.push({handlerName:f,handler:b,allowed:p}),this._handlersById[f]=b},Ti.prototype.stop=function(f){if(!this._updatingCamera){for(var b=0,p=this._handlers;b<p.length;b+=1)p[b].handler.reset();this._inertia.clear(),this._fireEvents({},{},f),this._changes=[]}},Ti.prototype.isActive=function(){for(var f=0,b=this._handlers;f<b.length;f+=1)if(b[f].handler.isActive())return!0;return!1},Ti.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Ti.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Ti.prototype.isMoving=function(){return!!bo(this._eventsInProgress)||this.isZooming()},Ti.prototype._blockedByActive=function(f,b,p){for(var E in f)if(E!==p&&(!b||b.indexOf(E)<0))return!0;return!1},Ti.prototype.handleWindowEvent=function(f){this.handleEvent(f,f.type+"Window")},Ti.prototype._getMapTouches=function(f){for(var b=[],p=0,E=f;p<E.length;p+=1){var B=E[p];this._el.contains(B.target)&&b.push(B)}return b},Ti.prototype.handleEvent=function(f,b){if(f.type!=="blur"){this._updatingCamera=!0;for(var p=f.type==="renderFrame"?void 0:f,E={needsRenderFrame:!1},B={},q={},V=f.touches?this._getMapTouches(f.touches):void 0,Y=V?r.touchPos(this._el,V):r.mousePos(this._el,f),ot=0,gt=this._handlers;ot<gt.length;ot+=1){var St=gt[ot],kt=St.handlerName,It=St.handler,Xt=St.allowed;if(It.isEnabled()){var Bt=void 0;this._blockedByActive(q,Xt,kt)?It.reset():It[b||f.type]&&(Bt=It[b||f.type](f,Y,V),this.mergeHandlerResult(E,B,Bt,kt,p),Bt&&Bt.needsRenderFrame&&this._triggerRenderFrame()),(Bt||It.isActive())&&(q[kt]=It)}}var ae={};for(var Jt in this._previousActiveHandlers)q[Jt]||(ae[Jt]=p);this._previousActiveHandlers=q,(Object.keys(ae).length||mc(E))&&(this._changes.push([E,B,ae]),this._triggerRenderFrame()),(Object.keys(q).length||mc(E))&&this._map._stop(!0),this._updatingCamera=!1;var he=E.cameraAnimation;he&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],he(this._map))}else this.stop(!0)},Ti.prototype.mergeHandlerResult=function(f,b,p,E,B){if(p){t.extend(f,p);var q={handlerName:E,originalEvent:p.originalEvent||B};p.zoomDelta!==void 0&&(b.zoom=q),p.panDelta!==void 0&&(b.drag=q),p.pitchDelta!==void 0&&(b.pitch=q),p.bearingDelta!==void 0&&(b.rotate=q)}},Ti.prototype._applyChanges=function(){for(var f={},b={},p={},E=0,B=this._changes;E<B.length;E+=1){var q=B[E],V=q[0],Y=q[1],ot=q[2];V.panDelta&&(f.panDelta=(f.panDelta||new t.Point(0,0))._add(V.panDelta)),V.zoomDelta&&(f.zoomDelta=(f.zoomDelta||0)+V.zoomDelta),V.bearingDelta&&(f.bearingDelta=(f.bearingDelta||0)+V.bearingDelta),V.pitchDelta&&(f.pitchDelta=(f.pitchDelta||0)+V.pitchDelta),V.around!==void 0&&(f.around=V.around),V.pinchAround!==void 0&&(f.pinchAround=V.pinchAround),V.noInertia&&(f.noInertia=V.noInertia),t.extend(b,Y),t.extend(p,ot)}this._updateMapTransform(f,b,p),this._changes=[]},Ti.prototype._updateMapTransform=function(f,b,p){var E=this._map,B=E.transform;if(!mc(f))return this._fireEvents(b,p,!0);var q=f.panDelta,V=f.zoomDelta,Y=f.bearingDelta,ot=f.pitchDelta,gt=f.around,St=f.pinchAround;St!==void 0&&(gt=St),E._stop(!0),gt=gt||E.transform.centerPoint;var kt=B.pointLocation(q?gt.sub(q):gt);Y&&(B.bearing+=Y),ot&&(B.pitch+=ot),V&&(B.zoom+=V),B.setLocationAtPoint(kt,gt),this._map._update(),f.noInertia||this._inertia.record(f),this._fireEvents(b,p,!0)},Ti.prototype._fireEvents=function(f,b,p){var E=this,B=bo(this._eventsInProgress),q=bo(f),V={};for(var Y in f)this._eventsInProgress[Y]||(V[Y+"start"]=f[Y].originalEvent),this._eventsInProgress[Y]=f[Y];for(var ot in!B&&q&&this._fireEvent("movestart",q.originalEvent),V)this._fireEvent(ot,V[ot]);for(var gt in q&&this._fireEvent("move",q.originalEvent),f)this._fireEvent(gt,f[gt].originalEvent);var St,kt={};for(var It in this._eventsInProgress){var Xt=this._eventsInProgress[It],Bt=Xt.handlerName,ae=Xt.originalEvent;this._handlersById[Bt].isActive()||(delete this._eventsInProgress[It],kt[It+"end"]=St=b[Bt]||ae)}for(var Jt in kt)this._fireEvent(Jt,kt[Jt]);var he=bo(this._eventsInProgress);if(p&&(B||q)&&!he){this._updatingCamera=!0;var Me=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Ie=function(De){return De!==0&&-E._bearingSnap<De&&De<E._bearingSnap};Me?(Ie(Me.bearing||this._map.getBearing())&&(Me.bearing=0),this._map.easeTo(Me,{originalEvent:St})):(this._map.fire(new t.Event("moveend",{originalEvent:St})),Ie(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},Ti.prototype._fireEvent=function(f,b){this._map.fire(new t.Event(f,b?{originalEvent:b}:{}))},Ti.prototype._requestFrame=function(){var f=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(b){delete f._frameId,f.handleEvent(new Hl("renderFrame",{timeStamp:b})),f._applyChanges()})},Ti.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var yc=function(f){function b(p,E){f.call(this),this._moving=!1,this._zooming=!1,this.transform=p,this._bearingSnap=E.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return f&&(b.__proto__=f),(b.prototype=Object.create(f&&f.prototype)).constructor=b,b.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},b.prototype.setCenter=function(p,E){return this.jumpTo({center:p},E)},b.prototype.panBy=function(p,E,B){return p=t.Point.convert(p).mult(-1),this.panTo(this.transform.center,t.extend({offset:p},E),B)},b.prototype.panTo=function(p,E,B){return this.easeTo(t.extend({center:p},E),B)},b.prototype.getZoom=function(){return this.transform.zoom},b.prototype.setZoom=function(p,E){return this.jumpTo({zoom:p},E),this},b.prototype.zoomTo=function(p,E,B){return this.easeTo(t.extend({zoom:p},E),B)},b.prototype.zoomIn=function(p,E){return this.zoomTo(this.getZoom()+1,p,E),this},b.prototype.zoomOut=function(p,E){return this.zoomTo(this.getZoom()-1,p,E),this},b.prototype.getBearing=function(){return this.transform.bearing},b.prototype.setBearing=function(p,E){return this.jumpTo({bearing:p},E),this},b.prototype.getPadding=function(){return this.transform.padding},b.prototype.setPadding=function(p,E){return this.jumpTo({padding:p},E),this},b.prototype.rotateTo=function(p,E,B){return this.easeTo(t.extend({bearing:p},E),B)},b.prototype.resetNorth=function(p,E){return this.rotateTo(0,t.extend({duration:1e3},p),E),this},b.prototype.resetNorthPitch=function(p,E){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},p),E),this},b.prototype.snapToNorth=function(p,E){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(p,E):this},b.prototype.getPitch=function(){return this.transform.pitch},b.prototype.setPitch=function(p,E){return this.jumpTo({pitch:p},E),this},b.prototype.cameraForBounds=function(p,E){return p=t.LngLatBounds.convert(p),this._cameraForBoxAndBearing(p.getNorthWest(),p.getSouthEast(),0,E)},b.prototype._cameraForBoxAndBearing=function(p,E,B,q){var V={top:0,bottom:0,right:0,left:0};if(typeof(q=t.extend({padding:V,offset:[0,0],maxZoom:this.transform.maxZoom},q)).padding=="number"){var Y=q.padding;q.padding={top:Y,bottom:Y,right:Y,left:Y}}q.padding=t.extend(V,q.padding);var ot=this.transform,gt=ot.padding,St=ot.project(t.LngLat.convert(p)),kt=ot.project(t.LngLat.convert(E)),It=St.rotate(-B*Math.PI/180),Xt=kt.rotate(-B*Math.PI/180),Bt=new t.Point(Math.max(It.x,Xt.x),Math.max(It.y,Xt.y)),ae=new t.Point(Math.min(It.x,Xt.x),Math.min(It.y,Xt.y)),Jt=Bt.sub(ae),he=(ot.width-(gt.left+gt.right+q.padding.left+q.padding.right))/Jt.x,Me=(ot.height-(gt.top+gt.bottom+q.padding.top+q.padding.bottom))/Jt.y;if(!(Me<0||he<0)){var Ie=Math.min(ot.scaleZoom(ot.scale*Math.min(he,Me)),q.maxZoom),De=t.Point.convert(q.offset),Ne=new t.Point(De.x+(q.padding.left-q.padding.right)/2,De.y+(q.padding.top-q.padding.bottom)/2).mult(ot.scale/ot.zoomScale(Ie));return{center:ot.unproject(St.add(kt).div(2).sub(Ne)),zoom:Ie,bearing:B}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},b.prototype.fitBounds=function(p,E,B){return this._fitInternal(this.cameraForBounds(p,E),E,B)},b.prototype.fitScreenCoordinates=function(p,E,B,q,V){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(p)),this.transform.pointLocation(t.Point.convert(E)),B,q),q,V)},b.prototype._fitInternal=function(p,E,B){return p?(delete(E=t.extend(p,E)).padding,E.linear?this.easeTo(E,B):this.flyTo(E,B)):this},b.prototype.jumpTo=function(p,E){this.stop();var B=this.transform,q=!1,V=!1,Y=!1;return"zoom"in p&&B.zoom!==+p.zoom&&(q=!0,B.zoom=+p.zoom),p.center!==void 0&&(B.center=t.LngLat.convert(p.center)),"bearing"in p&&B.bearing!==+p.bearing&&(V=!0,B.bearing=+p.bearing),"pitch"in p&&B.pitch!==+p.pitch&&(Y=!0,B.pitch=+p.pitch),p.padding==null||B.isPaddingEqual(p.padding)||(B.padding=p.padding),this.fire(new t.Event("movestart",E)).fire(new t.Event("move",E)),q&&this.fire(new t.Event("zoomstart",E)).fire(new t.Event("zoom",E)).fire(new t.Event("zoomend",E)),V&&this.fire(new t.Event("rotatestart",E)).fire(new t.Event("rotate",E)).fire(new t.Event("rotateend",E)),Y&&this.fire(new t.Event("pitchstart",E)).fire(new t.Event("pitch",E)).fire(new t.Event("pitchend",E)),this.fire(new t.Event("moveend",E))},b.prototype.easeTo=function(p,E){var B=this;this._stop(!1,p.easeId),((p=t.extend({offset:[0,0],duration:500,easing:t.ease},p)).animate===!1||!p.essential&&t.browser.prefersReducedMotion)&&(p.duration=0);var q=this.transform,V=this.getZoom(),Y=this.getBearing(),ot=this.getPitch(),gt=this.getPadding(),St="zoom"in p?+p.zoom:V,kt="bearing"in p?this._normalizeBearing(p.bearing,Y):Y,It="pitch"in p?+p.pitch:ot,Xt="padding"in p?p.padding:q.padding,Bt=t.Point.convert(p.offset),ae=q.centerPoint.add(Bt),Jt=q.pointLocation(ae),he=t.LngLat.convert(p.center||Jt);this._normalizeCenter(he);var Me,Ie,De=q.project(Jt),Ne=q.project(he).sub(De),Ge=q.zoomScale(St-V);p.around&&(Me=t.LngLat.convert(p.around),Ie=q.locationPoint(Me));var je={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||St!==V,this._rotating=this._rotating||Y!==kt,this._pitching=this._pitching||It!==ot,this._padding=!q.isPaddingEqual(Xt),this._easeId=p.easeId,this._prepareEase(E,p.noMoveStart,je),this._ease(function(Ye){if(B._zooming&&(q.zoom=t.number(V,St,Ye)),B._rotating&&(q.bearing=t.number(Y,kt,Ye)),B._pitching&&(q.pitch=t.number(ot,It,Ye)),B._padding&&(q.interpolatePadding(gt,Xt,Ye),ae=q.centerPoint.add(Bt)),Me)q.setLocationAtPoint(Me,Ie);else{var ar=q.zoomScale(q.zoom-V),cr=St>V?Math.min(2,Ge):Math.max(.5,Ge),kr=Math.pow(cr,1-Ye),qr=q.unproject(De.add(Ne.mult(Ye*kr)).mult(ar));q.setLocationAtPoint(q.renderWorldCopies?qr.wrap():qr,ae)}B._fireMoveEvents(E)},function(Ye){B._afterEase(E,Ye)},p),this},b.prototype._prepareEase=function(p,E,B){B===void 0&&(B={}),this._moving=!0,E||B.moving||this.fire(new t.Event("movestart",p)),this._zooming&&!B.zooming&&this.fire(new t.Event("zoomstart",p)),this._rotating&&!B.rotating&&this.fire(new t.Event("rotatestart",p)),this._pitching&&!B.pitching&&this.fire(new t.Event("pitchstart",p))},b.prototype._fireMoveEvents=function(p){this.fire(new t.Event("move",p)),this._zooming&&this.fire(new t.Event("zoom",p)),this._rotating&&this.fire(new t.Event("rotate",p)),this._pitching&&this.fire(new t.Event("pitch",p))},b.prototype._afterEase=function(p,E){if(!this._easeId||!E||this._easeId!==E){delete this._easeId;var B=this._zooming,q=this._rotating,V=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,B&&this.fire(new t.Event("zoomend",p)),q&&this.fire(new t.Event("rotateend",p)),V&&this.fire(new t.Event("pitchend",p)),this.fire(new t.Event("moveend",p))}},b.prototype.flyTo=function(p,E){var B=this;if(!p.essential&&t.browser.prefersReducedMotion){var q=t.pick(p,["center","zoom","bearing","pitch","around"]);return this.jumpTo(q,E)}this.stop(),p=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},p);var V=this.transform,Y=this.getZoom(),ot=this.getBearing(),gt=this.getPitch(),St=this.getPadding(),kt="zoom"in p?t.clamp(+p.zoom,V.minZoom,V.maxZoom):Y,It="bearing"in p?this._normalizeBearing(p.bearing,ot):ot,Xt="pitch"in p?+p.pitch:gt,Bt="padding"in p?p.padding:V.padding,ae=V.zoomScale(kt-Y),Jt=t.Point.convert(p.offset),he=V.centerPoint.add(Jt),Me=V.pointLocation(he),Ie=t.LngLat.convert(p.center||Me);this._normalizeCenter(Ie);var De=V.project(Me),Ne=V.project(Ie).sub(De),Ge=p.curve,je=Math.max(V.width,V.height),Ye=je/ae,ar=Ne.mag();if("minZoom"in p){var cr=t.clamp(Math.min(p.minZoom,Y,kt),V.minZoom,V.maxZoom),kr=je/V.zoomScale(cr-Y);Ge=Math.sqrt(kr/ar*2)}var qr=Ge*Ge;function Pr(it){var dt=(Ye*Ye-je*je+(it?-1:1)*qr*qr*ar*ar)/(2*(it?Ye:je)*qr*ar);return Math.log(Math.sqrt(dt*dt+1)-dt)}function m(it){return(Math.exp(it)-Math.exp(-it))/2}function S(it){return(Math.exp(it)+Math.exp(-it))/2}var T=Pr(0),D=function(it){return S(T)/S(T+Ge*it)},G=function(it){return je*((S(T)*(m(dt=T+Ge*it)/S(dt))-m(T))/qr)/ar;var dt},W=(Pr(1)-T)/Ge;if(Math.abs(ar)<1e-6||!isFinite(W)){if(Math.abs(je-Ye)<1e-6)return this.easeTo(p,E);var rt=Ye<je?-1:1;W=Math.abs(Math.log(Ye/je))/Ge,G=function(){return 0},D=function(it){return Math.exp(rt*Ge*it)}}return p.duration="duration"in p?+p.duration:1e3*W/("screenSpeed"in p?+p.screenSpeed/Ge:+p.speed),p.maxDuration&&p.duration>p.maxDuration&&(p.duration=0),this._zooming=!0,this._rotating=ot!==It,this._pitching=Xt!==gt,this._padding=!V.isPaddingEqual(Bt),this._prepareEase(E,!1),this._ease(function(it){var dt=it*W,Et=1/D(dt);V.zoom=it===1?kt:Y+V.scaleZoom(Et),B._rotating&&(V.bearing=t.number(ot,It,it)),B._pitching&&(V.pitch=t.number(gt,Xt,it)),B._padding&&(V.interpolatePadding(St,Bt,it),he=V.centerPoint.add(Jt));var $t=it===1?Ie:V.unproject(De.add(Ne.mult(G(dt))).mult(Et));V.setLocationAtPoint(V.renderWorldCopies?$t.wrap():$t,he),B._fireMoveEvents(E)},function(){return B._afterEase(E)},p),this},b.prototype.isEasing=function(){return!!this._easeFrameId},b.prototype.stop=function(){return this._stop()},b.prototype._stop=function(p,E){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var B=this._onEaseEnd;delete this._onEaseEnd,B.call(this,E)}if(!p){var q=this.handlers;q&&q.stop(!1)}return this},b.prototype._ease=function(p,E,B){B.animate===!1||B.duration===0?(p(1),E()):(this._easeStart=t.browser.now(),this._easeOptions=B,this._onEaseFrame=p,this._onEaseEnd=E,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},b.prototype._renderFrameCallback=function(){var p=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(p)),p<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},b.prototype._normalizeBearing=function(p,E){p=t.wrap(p,-180,180);var B=Math.abs(p-E);return Math.abs(p-360-E)<B&&(p-=360),Math.abs(p+360-E)<B&&(p+=360),p},b.prototype._normalizeCenter=function(p){var E=this.transform;if(E.renderWorldCopies&&!E.lngRange){var B=p.lng-E.center.lng;p.lng+=B>180?-360:B<-180?360:0}},b}(t.Evented),xa=function(f){f===void 0&&(f={}),this.options=f,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};xa.prototype.getDefaultPosition=function(){return"bottom-right"},xa.prototype.onAdd=function(f){var b=this.options&&this.options.compact;return this._map=f,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),b&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),b===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},xa.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},xa.prototype._updateEditLink=function(){var f=this._editLink;f||(f=this._editLink=this._container.querySelector(".mapbox-improve-map"));var b=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(f){var p=b.reduce(function(E,B,q){return B.value&&(E+=B.key+"="+B.value+(q<b.length-1?"&":"")),E},"?");f.href=t.config.FEEDBACK_URL+"/"+p+(this._map._hash?this._map._hash.getHashString(!0):""),f.rel="noopener nofollow"}},xa.prototype._updateData=function(f){!f||f.sourceDataType!=="metadata"&&f.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())},xa.prototype._updateAttributions=function(){if(this._map.style){var f=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?f=f.concat(this.options.customAttribution.map(function(Y){return typeof Y!="string"?"":Y})):typeof this.options.customAttribution=="string"&&f.push(this.options.customAttribution)),this._map.style.stylesheet){var b=this._map.style.stylesheet;this.styleOwner=b.owner,this.styleId=b.id}var p=this._map.style.sourceCaches;for(var E in p){var B=p[E];if(B.used){var q=B.getSource();q.attribution&&f.indexOf(q.attribution)<0&&f.push(q.attribution)}}f.sort(function(Y,ot){return Y.length-ot.length});var V=(f=f.filter(function(Y,ot){for(var gt=ot+1;gt<f.length;gt++)if(f[gt].indexOf(Y)>=0)return!1;return!0})).join(" | ");V!==this._attribHTML&&(this._attribHTML=V,f.length?(this._innerContainer.innerHTML=V,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},xa.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var Cs=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};Cs.prototype.onAdd=function(f){this._map=f,this._container=r.create("div","mapboxgl-ctrl");var b=r.create("a","mapboxgl-ctrl-logo");return b.target="_blank",b.rel="noopener nofollow",b.href="https://www.mapbox.com/",b.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),b.setAttribute("rel","noopener nofollow"),this._container.appendChild(b),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Cs.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Cs.prototype.getDefaultPosition=function(){return"bottom-left"},Cs.prototype._updateLogo=function(f){f&&f.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},Cs.prototype._logoRequired=function(){if(this._map.style){var f=this._map.style.sourceCaches;for(var b in f)if(f[b].getSource().mapbox_logo)return!0;return!1}},Cs.prototype._updateCompact=function(){var f=this._container.children;if(f.length){var b=f[0];this._map.getCanvasContainer().offsetWidth<250?b.classList.add("mapboxgl-compact"):b.classList.remove("mapboxgl-compact")}};var wo=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};wo.prototype.add=function(f){var b=++this._id;return this._queue.push({callback:f,id:b,cancelled:!1}),b},wo.prototype.remove=function(f){for(var b=this._currentlyRunning,p=0,E=b?this._queue.concat(b):this._queue;p<E.length;p+=1){var B=E[p];if(B.id===f)return void(B.cancelled=!0)}},wo.prototype.run=function(f){f===void 0&&(f=0);var b=this._currentlyRunning=this._queue;this._queue=[];for(var p=0,E=b;p<E.length;p+=1){var B=E[p];if(!B.cancelled&&(B.callback(f),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},wo.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Mo=[];function Ii(f){Mo.push.apply(Mo,f.names||[])}Ii(t.tmerc),Ii(t.etmerc),Ii(t.utm),Ii(t.sterea),Ii(t.stere),Ii(t.somerc),Ii(t.omerc),Ii(t.lcc),Ii(t.krovak),Ii(t.cass),Ii(t.laea),Ii(t.aea),Ii(t.gnom),Ii(t.cea),Ii(t.eqc),Ii(t.poly),Ii(t.nzmg),Ii(t.mill),Ii(t.sinu),Ii(t.moll),Ii(t.eqdc),Ii(t.vandg),Ii(t.aeqd),Ii(t.ortho$1),Ii(t.qsc),Ii(t.robin),Ii(t.geocent),Ii(t.tpers),Ii(t.geos);var ti=function f(b,p,E){var B;this.epsgCode=b,this.extent=E,this.renderWorldCopies=!0,Array.isArray(p)&&(this.extent=p,p=null),this.WKT=p||f.defaultWKTs[b],this.WKT&&(typeof(B=t.parseCode(this.WKT))!="object"&&gi.error("The projection defs value is not valid"),t.proj4.Proj.projections.get(B.projName)||gi.error("The projection name "+B.projName+" is not supported.Perhaps values are "+function(ot){for(var gt=ot.split(/[\s_-]+/),St=new Set,kt=0;kt<Mo.length;kt++)for(var It=Mo[kt],Xt=0;Xt<gt.length;Xt++)It.toLowerCase().indexOf(gt[Xt].toLowerCase())>=0&&St.add(It);return St.size>0?Array.from(St):Mo}(B.projName).join(",")),t.proj4.defs(b,this.WKT));var q=t.proj4.defs(b);if(!q)throw new Error(b+" was not defined,make sure the WKT param was not null");this.unit=q.units||"degree",this.proj4Projection=t.proj4(b);var V=this.proj4Projection.inverse([this.extent[0],this.extent[1]]),Y=this.proj4Projection.inverse([this.extent[2],this.extent[3]]);this.lngLatExtent=V.concat(Y),this._id=t.uniqueId(),f.set(this)};ti.prototype.getExtent=function(){if(!this._rectifyExtent){var f=this.extent[2]-this.extent[0],b=this.extent[3]-this.extent[1];if(f===b)this._rectifyExtent=[this.extent[0],this.extent[1],this.extent[2],this.extent[3]];else{var p=Math.max(f,b);this._rectifyExtent=[this.extent[0],this.extent[3]-p,this.extent[0]+p,this.extent[3]]}}return this._rectifyExtent},ti.prototype.getLngLatCenter=function(){return[this.lngLatExtent[2]-(this.lngLatExtent[2]-this.lngLatExtent[0])/2,this.lngLatExtent[3]-(this.lngLatExtent[3]-this.lngLatExtent[1])/2]},ti.prototype.getLngLatExtent=function(){if(!this._rectifyLngLatExtent){var f=this.proj4Projection.inverse([this.extent[0],this.extent[1]]),b=this.proj4Projection.inverse([this.extent[2],this.extent[3]]),p=b[0]-f[0],E=b[1]-f[1];if(p===E)this._rectifyLngLatExtent=[f[0],f[1],b[0],b[0]];else{var B=Math.max(p,E);this._rectifyLngLatExtent=[f[0],b[1]-B,f[0]+B,b[1]]}}return this._rectifyLngLatExtent},ti.prototype.getOrigin=function(){return[this.extent[0],this.extent[3]]},ti.prototype.getEpsgCode=function(){return this.epsgCode},ti.prototype.getUnit=function(){return this.unit},ti.prototype.getWKT=function(){return this.WKT},ti.prototype.getWidth=function(){return this._rectifyExtent[2]-this._rectifyExtent[0]},ti.prototype.getHeight=function(){return this._rectifyExtent[3]-this._rectifyExtent[1]},ti.prototype.getOriginX=function(){return this._rectifyExtent[0]},ti.prototype.getOriginY=function(){return this._rectifyExtent[3]},ti.prototype.toWGS84=function(f){return this.proj4Projection.inverse(f)},ti.prototype.fromWGS84=function(f){return this.proj4Projection.forward(f)},ti.prototype.fromLngLat=function(f){var b=t.LngLat.convert(f),p=this.renderWorldCopies?b.lng:t.clamp(b.lng,-180,180),E=this.fromWGS84([p,b.lat]);return{x:(E[0]-this.getOriginX())/this.getWidth(),y:(this.getOriginY()-E[1])/this.getHeight(),z:0}},ti.prototype.toLngLat=function(f,b){var p=this.renderWorldCopies?f:t.clamp(f,0,1),E=this.toWGS84([p*this.getWidth()+this.getOriginX(),this.getOriginY()-b*this.getHeight()]);return new t.LngLat(E[0],E[1])},ti.get=function(f){for(var b in ti)if(ti.hasOwnProperty(b)&&ti[b].getEpsgCode&&ti[b].getEpsgCode()===f)return ti[b];return null},ti.set=function(f){var b=f.getEpsgCode().replace(":","").toUpperCase();ti[b]=f},ti.defaultWKTs={"EPSG:4490":'GEOGCS["China Geodetic Coordinate System 2000",DATUM["China_2000",SPHEROID["CGCS2000",6378137,298.257222101,AUTHORITY["EPSG","1024"]],AUTHORITY["EPSG","1043"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4490"]]',"EPSG:4214":'GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3],TOWGS84[15.8,-154.4,-82.3,0,0,0,0]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4214"]]',"EPSG:4610":'GEOGCS["Xian 1980",DATUM["Xian_1980",SPHEROID["IAG 1975",6378140,298.257,AUTHORITY["EPSG","7049"]],AUTHORITY["EPSG","6610"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4610"]]'},ti.EPSG4326=new ti("EPSG:4326",[-180,-90,180,90]),ti.EPSG4490=new ti("EPSG:4490",[-180,-90,180,90]),ti.EPSG4214=new ti("EPSG:4214",[-180,-90,180,90]),ti.EPSG4610=new ti("EPSG:4610",[-180,-90,180,90]),ti.EPSG3857=new ti("EPSG:3857",[-200375083427892e-7,-200375083427892e-7,200375083427892e-7,200375083427892e-7]);var Eo={"FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},ao=t.window.HTMLImageElement,Rh=t.window.HTMLElement,Uu=t.window.ImageBitmap,pu={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},ng=function(f){function b(E){var B=this;if((E=t.extend({},pu,E)).minZoom!=null&&E.maxZoom!=null&&E.minZoom>E.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(E.minPitch!=null&&E.maxPitch!=null&&E.minPitch>E.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(E.minPitch!=null&&E.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(E.maxPitch!=null&&E.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var q=new F(E.minZoom,E.maxZoom,E.minPitch,E.maxPitch,E.renderWorldCopies);if(f.call(this,q,E),this.transform=q,this.crs=this.toCRS(E.crs),this.initCRS(this.crs),this._interactive=E.interactive,this._maxTileCacheSize=E.maxTileCacheSize,this._failIfMajorPerformanceCaveat=E.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=E.preserveDrawingBuffer,this._antialias=E.antialias,this._trackResize=E.trackResize,this._bearingSnap=E.bearingSnap,this._refreshExpiredTiles=E.refreshExpiredTiles,this._fadeDuration=E.fadeDuration,this._crossSourceCollisions=E.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=E.collectResourceTiming,this._renderTaskQueue=new wo,this._controls=[],this._markersCache=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Eo,E.locale),this._requestManager=new t.RequestManager(E.transformRequest,E.accessToken),typeof E.container=="string"){if(this._container=t.window.document.getElementById(E.container),!this._container)throw new Error("Container '"+E.container+"' not found.")}else{if(!(E.container instanceof Rh))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=E.container}if(E.maxBounds&&this.setMaxBounds(E.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return B._update(!1)}),this.on("moveend",function(){return B._update(!1)}),this.on("zoom",function(){return B._update(!0)}),t.window!==void 0&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Ti(this,E),this._hash=E.hash&&new at(typeof E.hash=="string"&&E.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:E.center,zoom:E.zoom,bearing:E.bearing,pitch:E.pitch}),E.bounds&&(this.resize(),this.fitBounds(E.bounds,t.extend({},E.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=E.localIdeographFontFamily,E.style&&this.setStyle(E.style,{localIdeographFontFamily:E.localIdeographFontFamily}),E.attributionControl&&this.addControl(new xa({customAttribution:E.customAttribution})),this.addControl(new Cs,E.logoPosition),this.on("style.load",function(){B.transform.unmodified&&B.jumpTo(B.style.stylesheet)}),this.on("data",function(V){B._update(V.dataType==="style"),B.fire(new t.Event(V.dataType+"data",V))}),this.on("dataloading",function(V){B.fire(new t.Event(V.dataType+"dataloading",V))})}f&&(b.__proto__=f),(b.prototype=Object.create(f&&f.prototype)).constructor=b;var p={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return b.prototype.toCRS=function(E){if(E&&typeof E=="string"&&!(E=ti.get(E)))throw new Error("crs "+E+" is not define");return E||ti.EPSG3857},b.prototype.getCRS=function(){return this.crs},b.prototype._getMapId=function(){return this._mapId},b.prototype.addControl=function(E,B){if(B===void 0&&E.getDefaultPosition&&(B=E.getDefaultPosition()),B===void 0&&(B="top-right"),!E||!E.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var q=E.onAdd(this);this._controls.push(E);var V=this._controlPositions[B];return B.indexOf("bottom")!==-1?V.insertBefore(q,V.firstChild):V.appendChild(q),this},b.prototype.removeControl=function(E){if(!E||!E.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var B=this._controls.indexOf(E);return B>-1&&this._controls.splice(B,1),E.onRemove(this),this},b.prototype.resize=function(E){var B=this._containerDimensions(),q=B[0],V=B[1];this._resizeCanvas(q,V),this.transform.resize(q,V),this.painter.resize(q,V);var Y=!this._moving;return Y&&(this.stop(),this.fire(new t.Event("movestart",E)).fire(new t.Event("move",E))),this.fire(new t.Event("resize",E)),Y&&this.fire(new t.Event("moveend",E)),this},b.prototype.getBounds=function(){return this.transform.getBounds()},b.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},b.prototype.setMaxBounds=function(E){return this.transform.setMaxBounds(t.LngLatBounds.convert(E)),this._update()},b.prototype.setMinZoom=function(E){if((E=E==null?-2:E)>=-2&&E<=this.transform.maxZoom)return this.transform.minZoom=E,this._update(),this.getZoom()<E&&this.setZoom(E),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},b.prototype.getMinZoom=function(){return this.transform.minZoom},b.prototype.setMaxZoom=function(E){if((E=E==null?22:E)>=this.transform.minZoom)return this.transform.maxZoom=E,this._update(),this.getZoom()>E&&this.setZoom(E),this;throw new Error("maxZoom must be greater than the current minZoom")},b.prototype.getMaxZoom=function(){return this.transform.maxZoom},b.prototype.setMinPitch=function(E){if((E=E==null?0:E)<0)throw new Error("minPitch must be greater than or equal to 0");if(E>=0&&E<=this.transform.maxPitch)return this.transform.minPitch=E,this._update(),this.getPitch()<E&&this.setPitch(E),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},b.prototype.getMinPitch=function(){return this.transform.minPitch},b.prototype.setMaxPitch=function(E){if((E=E==null?60:E)>60)throw new Error("maxPitch must be less than or equal to 60");if(E>=this.transform.minPitch)return this.transform.maxPitch=E,this._update(),this.getPitch()>E&&this.setPitch(E),this;throw new Error("maxPitch must be greater than the current minPitch")},b.prototype.getMaxPitch=function(){return this.transform.maxPitch},b.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},b.prototype.setRenderWorldCopies=function(E){return this.transform.renderWorldCopies=E,this.crs.renderWorldCopies=E,this._update()},b.prototype.project=function(E){return this.transform.locationPoint(t.LngLat.convert(E))},b.prototype.unproject=function(E){return this.transform.pointLocation(t.Point.convert(E))},b.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},b.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},b.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},b.prototype._createDelegatedListener=function(E,B,q){var V,Y=this;if(E==="mouseenter"||E==="mouseover"){var ot=!1;return{layer:B,listener:q,delegates:{mousemove:function(St){var kt=Y.getLayer(B)?Y.queryRenderedFeatures(St.point,{layers:[B]}):[];kt.length?ot||(ot=!0,q.call(Y,new Ar(E,Y,St.originalEvent,{features:kt}))):ot=!1},mouseout:function(){ot=!1}}}}if(E==="mouseleave"||E==="mouseout"){var gt=!1;return{layer:B,listener:q,delegates:{mousemove:function(St){(Y.getLayer(B)?Y.queryRenderedFeatures(St.point,{layers:[B]}):[]).length?gt=!0:gt&&(gt=!1,q.call(Y,new Ar(E,Y,St.originalEvent)))},mouseout:function(St){gt&&(gt=!1,q.call(Y,new Ar(E,Y,St.originalEvent)))}}}}return{layer:B,listener:q,delegates:(V={},V[E]=function(St){var kt=Y.getLayer(B)?Y.queryRenderedFeatures(St.point,{layers:[B]}):[];kt.length&&(St.features=kt,q.call(Y,St),delete St.features)},V)}},b.prototype.on=function(E,B,q){if(q===void 0)return f.prototype.on.call(this,E,B);var V=this._createDelegatedListener(E,B,q);for(var Y in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[E]=this._delegatedListeners[E]||[],this._delegatedListeners[E].push(V),V.delegates)this.on(Y,V.delegates[Y]);return this},b.prototype.once=function(E,B,q){if(q===void 0)return f.prototype.once.call(this,E,B);var V=this._createDelegatedListener(E,B,q);for(var Y in V.delegates)this.once(Y,V.delegates[Y]);return this},b.prototype.off=function(E,B,q){var V=this;return q===void 0?f.prototype.off.call(this,E,B):(this._delegatedListeners&&this._delegatedListeners[E]&&function(Y){for(var ot=Y[E],gt=0;gt<ot.length;gt++){var St=ot[gt];if(St.layer===B&&St.listener===q){for(var kt in St.delegates)V.off(kt,St.delegates[kt]);return ot.splice(gt,1),V}}}(this._delegatedListeners),this)},b.prototype.queryRenderedFeatures=function(E,B){if(!this.style)return[];var q;if(B!==void 0||E===void 0||E instanceof t.Point||Array.isArray(E)||(B=E,E=void 0),B=B||{},(E=E||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||typeof E[0]=="number")q=[t.Point.convert(E)];else{var V=t.Point.convert(E[0]),Y=t.Point.convert(E[1]);q=[V,new t.Point(Y.x,V.y),Y,new t.Point(V.x,Y.y),V]}return this.style.queryRenderedFeatures(q,B,this.transform)},b.prototype.querySourceFeatures=function(E,B){return this.style.querySourceFeatures(E,B)},b.prototype.setStyle=function(E,B){return(B=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},B)).diff!==!1&&B.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&E?(this._diffStyle(E,B),this):(this._localIdeographFontFamily=B.localIdeographFontFamily,this._updateStyle(E,B))},b.prototype._getUIString=function(E){var B=this._locale[E];if(B==null)throw new Error("Missing UI string '"+E+"'");return B},b.prototype._updateStyle=function(E,B){return this.style&&(this.style.setEventedParent(null),this.style._remove()),E?(this.style=new Za(this,B||{}),this.style.setEventedParent(this,{style:this.style}),typeof E=="string"?this.style.loadURL(E):this.style.loadJSON(E),this):(delete this.style,this)},b.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new Za(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},b.prototype._diffStyle=function(E,B){var q=this;if(typeof E=="string"){var V=this._requestManager.normalizeStyleURL(E),Y=this._requestManager.transformRequest(V,t.ResourceType.Style);t.getJSON(Y,function(ot,gt){ot?q.fire(new t.ErrorEvent(ot)):gt&&q._updateDiff(gt,B)})}else typeof E=="object"&&this._updateDiff(E,B)},b.prototype._updateDiff=function(E,B){var q=E.sources;if(typeof E.sprite=="string"){var V={};for(var Y in q)V[Y]=E.sprite;E.sprite=V}if(typeof E.glyphs=="string"){var ot={};for(var gt in q)ot[gt]=E.glyphs;E.glyphs=ot}try{this.style.setState(E)&&this._update(!0)}catch(St){t.warnOnce("Unable to perform style diff: "+(St.message||St.error||St)+". Rebuilding the style from scratch."),this._updateStyle(E,B)}},b.prototype.addStyle=function(E,B,q,V){var Y=this;if(typeof E=="string"){this.fire(new t.Event("dataloading",{dataType:"style"}));var ot=this._requestManager.transformRequest(this._requestManager.normalizeStyleURL(E),t.ResourceType.Style);t.getJSON(ot,function(gt,St){gt?Y.fire(new t.ErrorEvent(gt)):St&&Y._loadByAdd(St,B,q,V)})}else this._loadByAdd(JSON.parse(JSON.stringify(E)),B,q,V)},b.prototype._loadByAdd=function(E,B,q,V){var Y=this,ot=E.layers,gt=E.sources,St=E.sprite||{},kt=E.glyphs||{};for(var It in gt)this.addSource(It,gt[It]),typeof St=="string"?this.style.addSprite(It,St):St[It]&&this.style.addSprite(It,St[It]),typeof kt=="string"?this.style.addGlyphs(It,kt):kt[It]&&this.style.addGlyphs(It,kt[It]);ot.forEach(function(Xt){Xt.type!="background"&&(Y.addLayer(Xt,B),isNaN(q)&&isNaN(V)||Y.setLayerZoomRange(Xt.id,q,V))})},b.prototype.getStyle=function(){if(this.style)return this.style.serialize()},b.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},b.prototype.addSource=function(E,B){return this._mapCRS&&B.type=="geojson"&&B.data&&!B.data.customprj&&(B.customprj=this.customConvertPoint),this._lazyInitEmptyStyle(),this.style.addSource(E,B),this._update(!0)},b.prototype.isSourceLoaded=function(E){var B=this.style&&this.style.sourceCaches[E];if(B!==void 0)return B.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+E+"'")))},b.prototype.areTilesLoaded=function(){var E=this.style&&this.style.sourceCaches;for(var B in E){var q=E[B]._tiles;for(var V in q){var Y=q[V];if(Y.state!=="loaded"&&Y.state!=="errored")return!1}}return!0},b.prototype.addSourceType=function(E,B,q){return this._lazyInitEmptyStyle(),this.style.addSourceType(E,B,q)},b.prototype.removeSource=function(E){return this.style.removeSource(E),this._update(!0)},b.prototype.getSource=function(E){return this.style.getSource(E)},b.prototype.addImage=function(E,B,q){q===void 0&&(q={});var V=q.pixelRatio;V===void 0&&(V=1);var Y=q.sdf;Y===void 0&&(Y=!1);var ot=q.stretchX,gt=q.stretchY,St=q.content;if(this._lazyInitEmptyStyle(),B instanceof ao||Uu&&B instanceof Uu){var kt=t.browser.getImageData(B);this.style.addImage(E,{data:new t.RGBAImage({width:kt.width,height:kt.height},kt.data),pixelRatio:V,stretchX:ot,stretchY:gt,content:St,sdf:Y,version:0})}else{if(B.width===void 0||B.height===void 0)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var It=B;this.style.addImage(E,{data:new t.RGBAImage({width:B.width,height:B.height},new Uint8Array(B.data)),pixelRatio:V,stretchX:ot,stretchY:gt,content:St,sdf:Y,version:0,userImage:It}),It.onAdd&&It.onAdd(this,E)}},b.prototype.updateImage=function(E,B){var q=this.style.getImage(E);if(!q)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var V=B instanceof ao||Uu&&B instanceof Uu?t.browser.getImageData(B):B,Y=V.width,ot=V.height,gt=V.data;return Y===void 0||ot===void 0?this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):Y!==q.data.width||ot!==q.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(q.data.replace(gt,!(B instanceof ao||Uu&&B instanceof Uu)),void this.style.updateImage(E,q))},b.prototype.hasImage=function(E){return E?!!this.style.getImage(E):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},b.prototype.removeImage=function(E){this.style.removeImage(E)},b.prototype.loadImage=function(E,B){t.getImage(this._requestManager.transformRequest(E,t.ResourceType.Image),B)},b.prototype.listImages=function(){return this.style.listImages()},b.prototype.listMarkers=function(){return this._markersCache},b.prototype.addLayer=function(E,B){return typeof E.source=="object"&&this._mapCRS&&E.source&&E.source.type=="geojson"&&E.source.data&&!E.source.data.customprj&&(E.source.customprj=this.customConvertPoint),this._lazyInitEmptyStyle(),this.style.addLayer(E,B),this._update(!0)},b.prototype.moveLayer=function(E,B){return this.style.moveLayer(E,B),this._update(!0)},b.prototype.removeLayer=function(E){return this.style.removeLayer(E),this._update(!0)},b.prototype.getLayer=function(E){return this.style.getLayer(E)},b.prototype.setLayerZoomRange=function(E,B,q){return this.style.setLayerZoomRange(E,B,q),this._update(!0)},b.prototype.setFilter=function(E,B,q){return q===void 0&&(q={}),this.style.setFilter(E,B,q),this._update(!0)},b.prototype.getFilter=function(E){return this.style.getFilter(E)},b.prototype.setPaintProperty=function(E,B,q,V){return V===void 0&&(V={}),this.style.setPaintProperty(E,B,q,V),this._update(!0)},b.prototype.getPaintProperty=function(E,B){return this.style.getPaintProperty(E,B)},b.prototype.setLayoutProperty=function(E,B,q,V){return V===void 0&&(V={}),this.style.setLayoutProperty(E,B,q,V),this._update(!0)},b.prototype.getLayoutProperty=function(E,B){return this.style.getLayoutProperty(E,B)},b.prototype.setLight=function(E,B){return B===void 0&&(B={}),this._lazyInitEmptyStyle(),this.style.setLight(E,B),this._update(!0)},b.prototype.getLight=function(){return this.style.getLight()},b.prototype.setFeatureState=function(E,B){return this.style.setFeatureState(E,B),this._update()},b.prototype.removeFeatureState=function(E,B){return this.style.removeFeatureState(E,B),this._update()},b.prototype.getFeatureState=function(E){return this.style.getFeatureState(E)},b.prototype.getContainer=function(){return this._container},b.prototype.getCanvasContainer=function(){return this._canvasContainer},b.prototype.getCanvas=function(){return this._canvas},b.prototype._containerDimensions=function(){var E=0,B=0;return this._container&&(E=this._container.clientWidth||400,B=this._container.clientHeight||300),[E,B]},b.prototype._detectMissingCSS=function(){t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},b.prototype._setupContainer=function(){var E=this._container;E.classList.add("mapboxgl-map"),(this._missingCSSCanary=r.create("div","mapboxgl-canary",E)).style.visibility="hidden",this._detectMissingCSS();var B=this._canvasContainer=r.create("div","mapboxgl-canvas-container",E);this._interactive&&B.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",B),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var q=this._containerDimensions();this._resizeCanvas(q[0],q[1]);var V=this._controlContainer=r.create("div","mapboxgl-control-container",E),Y=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(ot){Y[ot]=r.create("div","mapboxgl-ctrl-"+ot,V)})},b.prototype._resizeCanvas=function(E,B){var q=t.browser.devicePixelRatio||1;this._canvas.width=q*E,this._canvas.height=q*B,this._canvas.style.width=E+"px",this._canvas.style.height=B+"px"},b.prototype._setupPainter=function(){var E=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),B=this._canvas.getContext("webgl",E)||this._canvas.getContext("experimental-webgl",E);B?(this.painter=new c(B,this.transform),t.webpSupported.testSupport(B)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},b.prototype._contextLost=function(E){E.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:E}))},b.prototype._contextRestored=function(E){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:E}))},b.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},b.prototype._update=function(E){return this.style?(this._styleDirty=this._styleDirty||E,this._sourcesDirty=!0,this.triggerRepaint(),this):this},b.prototype._requestRenderFrame=function(E){return this._update(),this._renderTaskQueue.add(E)},b.prototype._cancelRenderFrame=function(E){this._renderTaskQueue.remove(E)},b.prototype._render=function(E){var B,q=this,V=0,Y=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(B=Y.createQueryEXT(),Y.beginQueryEXT(Y.TIME_ELAPSED_EXT,B),V=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(E),!this._removed){var ot=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var gt=this.transform.zoom,St=t.browser.now();this.style.zoomHistory.update(gt,St);var kt=new t.EvaluationParameters(gt,{now:St,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),It=kt.crossFadingFactor();It===1&&It===this._crossFadingFactor||(ot=!0,this._crossFadingFactor=It),this.style.update(kt)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||ot)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var Xt=t.browser.now()-V;Y.endQueryEXT(Y.TIME_ELAPSED_EXT,B),setTimeout(function(){var Jt=Y.getQueryObjectEXT(B,Y.QUERY_RESULT_EXT)/1e6;Y.deleteQueryEXT(B),q.fire(new t.Event("gpu-timing-frame",{cpuTime:Xt,gpuTime:Jt}))},50)}if(this.listens("gpu-timing-layer")){var Bt=this.painter.collectGpuTimers();setTimeout(function(){var Jt=q.painter.queryGpuTimers(Bt);q.fire(new t.Event("gpu-timing-layer",{layerTimes:Jt}))},50)}var ae=this._sourcesDirty||this._styleDirty||this._placementDirty;return ae||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),!this._loaded||this._fullyLoaded||ae||(this._fullyLoaded=!0),this}},b.prototype.remove=function(){this._hash&&this._hash.remove();for(var E=0,B=this._controls;E<B.length;E+=1)B[E].onRemove(this);this._controls=[],this._markersCache=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),t.window!==void 0&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("orientationchange",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var q=this.painter.context.gl.getExtension("WEBGL_lose_context");q&&q.loseContext(),ef(this._canvasContainer),ef(this._controlContainer),ef(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},b.prototype.triggerRepaint=function(){var E=this;this.style&&!this._frame&&(this._frame=t.browser.frame(function(B){E._frame=null,E._render(B)}))},b.prototype._onWindowOnline=function(){this._update()},b.prototype._onWindowResize=function(E){this._trackResize&&this.resize({originalEvent:E})._update()},p.showTileBoundaries.get=function(){return!!this._showTileBoundaries},p.showTileBoundaries.set=function(E){this._showTileBoundaries!==E&&(this._showTileBoundaries=E,this._update())},p.showPadding.get=function(){return!!this._showPadding},p.showPadding.set=function(E){this._showPadding!==E&&(this._showPadding=E,this._update())},p.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},p.showCollisionBoxes.set=function(E){this._showCollisionBoxes!==E&&(this._showCollisionBoxes=E,E?this.style._generateCollisionBoxes():this._update())},p.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},p.showOverdrawInspector.set=function(E){this._showOverdrawInspector!==E&&(this._showOverdrawInspector=E,this._update())},p.repaint.get=function(){return!!this._repaint},p.repaint.set=function(E){this._repaint!==E&&(this._repaint=E,this.triggerRepaint())},p.vertices.get=function(){return!!this._vertices},p.vertices.set=function(E){this._vertices=E,this._update()},b.prototype._setCacheLimits=function(E,B){t.setCacheLimits(E,B)},b.prototype.setCRS=function(E){this.crs=this.toCRS(E),this.initCRS(this.crs);var B=this.style&&this.style.sourceCaches;if(B)for(var q in B)this._mapCRS&&B[q]._source.type=="geojson"&&this.style.getSource(q).setCustomprj(this.customConvertPoint);this._sourcesDirty=!0,this._canvas&&this.resize(),this._update(!0)},b.prototype.initCRS=function(E){this._mapCRS=E,this.transform.setCRS(E),this._tileExtent=E.getExtent();var B=this._tileExtent[2]-this._tileExtent[0],q=this._tileExtent[3]-this._tileExtent[1],V=(this._tileExtent[2]+this._tileExtent[0])/2,Y=(this._tileExtent[3]+this._tileExtent[1])/2,ot=this._tileExtent[0],gt=this._tileExtent[3];t.Feature.yLat=function(St,kt){return gt-St*q/kt},t.Feature.toLngLat=function(St,kt){return E.toWGS84([St*B+ot,gt-kt*q])},this.mercatorZfromAltitude=t.mercatorZfromAltitude,this.updateTransformByCRS(E.getUnit(),ot,gt,V,Y,B,q)},b.prototype.updateTransformByCRS=function(E,B,q,V,Y,ot,gt){this.transform.units=E;var St=function(kt,It,Xt){var Bt="";for(var ae in kt)Object.hasOwnProperty.call(kt,ae)&&(Bt+=ae+":"+kt[ae]+",");for(var Jt in Xt)if(Object.hasOwnProperty.call(Xt,Jt)){var he="("+Xt[Jt]+")";Bt=Bt.replace(new RegExp('"'+Jt+'"',"g"),he)}return"customConvertPoint={"+Bt+"}"}({toLngLat:function(kt,It,Xt){return Xt.inverse(["__width"*kt+"__originX","__originY"-"__height"*It])},projectXY:function(kt,It,Xt){var Bt=Xt.forward([kt,It]);return[(Bt[0]-"__originX")/"__width",("__originY"-Bt[1])/"__height"]},projectX:function(kt){return(kt-"__centerX")/"__width"+.5},projectY:function(kt){return(kt=.5-(kt-"__centerY")/"__height")<0?0:kt>1?1:kt},toY:function(kt){return"__height"*(.5-kt)+"__centerY"}},0,{__width:ot,__height:gt,__centerX:V,__centerY:Y,__originY:q,__originX:B});this.customConvertPoint=t.window.URL.createObjectURL(new Blob([St],{type:"text/javascript"}))},p.version.get=function(){return t.version},Object.defineProperties(b.prototype,p),b}(yc);function ef(f){f.parentNode&&f.parentNode.removeChild(f)}var np={showCompass:!0,showZoom:!0,visualizePitch:!1},Vu=function(f){var b=this;this.options=t.extend({},np,f),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(p){return p.preventDefault()}),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(p){return b._map.zoomIn({},{originalEvent:p})}),r.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(p){return b._map.zoomOut({},{originalEvent:p})}),r.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(p){b.options.visualizePitch?b._map.resetNorthPitch({},{originalEvent:p}):b._map.resetNorth({},{originalEvent:p})}),this._compassIcon=r.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Vu.prototype._updateZoomButtons=function(){var f=this._map.getZoom();this._zoomInButton.disabled=f===this._map.getMaxZoom(),this._zoomOutButton.disabled=f===this._map.getMinZoom()},Vu.prototype._rotateCompassArrow=function(){var f=this.options.visualizePitch?"rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle+"deg)";this._compassIcon.style.transform=f},Vu.prototype.onAdd=function(f){return this._map=f,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new so(this._map,this._compass,this.options.visualizePitch)),this._container},Vu.prototype.onRemove=function(){r.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},Vu.prototype._createButton=function(f,b){var p=r.create("button",f,this._container);return p.type="button",p.addEventListener("click",b),p},Vu.prototype._setButtonTitle=function(f,b){var p=this._map._getUIString("NavigationControl."+b);f.title=p,f.setAttribute("aria-label",p)};var so=function(f,b,p){p===void 0&&(p=!1),this._clickTolerance=10,this.element=b,this.mouseRotate=new aa({clickTolerance:f.dragRotate._mouseRotate._clickTolerance}),this.map=f,p&&(this.mousePitch=new Oa({clickTolerance:f.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(b,"mousedown",this.mousedown),r.addEventListener(b,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(b,"touchmove",this.touchmove),r.addEventListener(b,"touchend",this.touchend),r.addEventListener(b,"touchcancel",this.reset)};function So(f,b,p){if(f=new t.LngLat(f.lng,f.lat),b){var E=new t.LngLat(f.lng-360,f.lat),B=new t.LngLat(f.lng+360,f.lat),q=p.locationPoint(f).distSqr(b);p.locationPoint(E).distSqr(b)<q?f=E:p.locationPoint(B).distSqr(b)<q&&(f=B)}for(;Math.abs(f.lng-p.center.lng)>180;){var V=p.locationPoint(f);if(V.x>=0&&V.y>=0&&V.x<=p.width&&V.y<=p.height)break;f.lng>p.center.lng?f.lng-=360:f.lng+=360}return f}so.prototype.down=function(f,b){this.mouseRotate.mousedown(f,b),this.mousePitch&&this.mousePitch.mousedown(f,b),r.disableDrag()},so.prototype.move=function(f,b){var p=this.map,E=this.mouseRotate.mousemoveWindow(f,b);if(E&&E.bearingDelta&&p.setBearing(p.getBearing()+E.bearingDelta),this.mousePitch){var B=this.mousePitch.mousemoveWindow(f,b);B&&B.pitchDelta&&p.setPitch(p.getPitch()+B.pitchDelta)}},so.prototype.off=function(){var f=this.element;r.removeEventListener(f,"mousedown",this.mousedown),r.removeEventListener(f,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(f,"touchmove",this.touchmove),r.removeEventListener(f,"touchend",this.touchend),r.removeEventListener(f,"touchcancel",this.reset),this.offTemp()},so.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},so.prototype.mousedown=function(f){this.down(t.extend({},f,{ctrlKey:!0,preventDefault:function(){return f.preventDefault()}}),r.mousePos(this.element,f)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},so.prototype.mousemove=function(f){this.move(f,r.mousePos(this.element,f))},so.prototype.mouseup=function(f){this.mouseRotate.mouseupWindow(f),this.mousePitch&&this.mousePitch.mouseupWindow(f),this.offTemp()},so.prototype.touchstart=function(f){f.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,f.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return f.preventDefault()}},this._startPos))},so.prototype.touchmove=function(f){f.targetTouches.length!==1?this.reset():(this._lastPos=r.touchPos(this.element,f.targetTouches)[0],this.move({preventDefault:function(){return f.preventDefault()}},this._lastPos))},so.prototype.touchend=function(f){f.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},so.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var du={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function gu(f,b,p){var E=f.classList;for(var B in du)E.remove("mapboxgl-"+p+"-anchor-"+B);E.add("mapboxgl-"+p+"-anchor-"+b)}var mu,vc=function(f){function b(p,E){var B=this;if(f.call(this),(p instanceof t.window.HTMLElement||E)&&(p=t.extend({element:p},E)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=p&&p.anchor||"center",this._color=p&&p.color||"#3FB1CE",this._scale=p&&p.scale||1,this._draggable=p&&p.draggable||!1,this._state="inactive",this._rotation=p&&p.rotation||0,this._rotationAlignment=p&&p.rotationAlignment||"auto",this._pitchAlignment=p&&p.pitchAlignment&&p.pitchAlignment!=="auto"?p.pitchAlignment:this._rotationAlignment,p&&p.element)this._element=p.element,this._offset=t.Point.convert(p&&p.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var q=r.createNS("http://www.w3.org/2000/svg","svg");q.setAttributeNS(null,"display","block"),q.setAttributeNS(null,"height","41px"),q.setAttributeNS(null,"width","27px"),q.setAttributeNS(null,"viewBox","0 0 27 41");var V=r.createNS("http://www.w3.org/2000/svg","g");V.setAttributeNS(null,"stroke","none"),V.setAttributeNS(null,"stroke-width","1"),V.setAttributeNS(null,"fill","none"),V.setAttributeNS(null,"fill-rule","evenodd");var Y=r.createNS("http://www.w3.org/2000/svg","g");Y.setAttributeNS(null,"fill-rule","nonzero");var ot=r.createNS("http://www.w3.org/2000/svg","g");ot.setAttributeNS(null,"transform","translate(3.0, 29.0)"),ot.setAttributeNS(null,"fill","#000000");for(var gt=0,St=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];gt<St.length;gt+=1){var kt=St[gt],It=r.createNS("http://www.w3.org/2000/svg","ellipse");It.setAttributeNS(null,"opacity","0.04"),It.setAttributeNS(null,"cx","10.5"),It.setAttributeNS(null,"cy","5.80029008"),It.setAttributeNS(null,"rx",kt.rx),It.setAttributeNS(null,"ry",kt.ry),ot.appendChild(It)}var Xt=r.createNS("http://www.w3.org/2000/svg","g");Xt.setAttributeNS(null,"fill",this._color);var Bt=r.createNS("http://www.w3.org/2000/svg","path");Bt.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),Xt.appendChild(Bt);var ae=r.createNS("http://www.w3.org/2000/svg","g");ae.setAttributeNS(null,"opacity","0.25"),ae.setAttributeNS(null,"fill","#000000");var Jt=r.createNS("http://www.w3.org/2000/svg","path");Jt.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),ae.appendChild(Jt);var he=r.createNS("http://www.w3.org/2000/svg","g");he.setAttributeNS(null,"transform","translate(6.0, 7.0)"),he.setAttributeNS(null,"fill","#FFFFFF");var Me=r.createNS("http://www.w3.org/2000/svg","g");Me.setAttributeNS(null,"transform","translate(8.0, 8.0)");var Ie=r.createNS("http://www.w3.org/2000/svg","circle");Ie.setAttributeNS(null,"fill","#000000"),Ie.setAttributeNS(null,"opacity","0.25"),Ie.setAttributeNS(null,"cx","5.5"),Ie.setAttributeNS(null,"cy","5.5"),Ie.setAttributeNS(null,"r","5.4999962");var De=r.createNS("http://www.w3.org/2000/svg","circle");De.setAttributeNS(null,"fill","#FFFFFF"),De.setAttributeNS(null,"cx","5.5"),De.setAttributeNS(null,"cy","5.5"),De.setAttributeNS(null,"r","5.4999962"),Me.appendChild(Ie),Me.appendChild(De),Y.appendChild(ot),Y.appendChild(Xt),Y.appendChild(ae),Y.appendChild(he),Y.appendChild(Me),q.appendChild(Y),q.setAttributeNS(null,"height",41*this._scale+"px"),q.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(q),this._offset=t.Point.convert(p&&p.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(Ne){Ne.preventDefault()}),this._element.addEventListener("mousedown",function(Ne){Ne.preventDefault()}),this._element.addEventListener("focus",function(){var Ne=B._map.getContainer();Ne.scrollTop=0,Ne.scrollLeft=0}),gu(this._element,this._anchor,"marker"),this._popup=null}return f&&(b.__proto__=f),(b.prototype=Object.create(f&&f.prototype)).constructor=b,b.prototype.addTo=function(p){return this.remove(),this._map=p,p.getCanvasContainer().appendChild(this._element),p.on("move",this._update),p.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this._map._markersCache&&this._map._markersCache.push(this),this},b.prototype.remove=function(){if(this._map){this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove);var p=this._map._markersCache.indexOf(this);p>-1&&this._map._markersCache.splice(p,1),delete this._map}return r.remove(this._element),this._popup&&this._popup.remove(),this},b.prototype.getLngLat=function(){return this._lngLat},b.prototype.setLngLat=function(p){return this._lngLat=t.LngLat.convert(p),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},b.prototype.getElement=function(){return this._element},b.prototype.setPopup=function(p){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),p){if(!("offset"in p.options)){var E=Math.sqrt(Math.pow(13.5,2)/2);p.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[E,-1*(24.6+E)],"bottom-right":[-E,-1*(24.6+E)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=p,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},b.prototype._onKeyPress=function(p){var E=p.code,B=p.charCode||p.keyCode;E!=="Space"&&E!=="Enter"&&B!==32&&B!==13||this.togglePopup()},b.prototype._onMapClick=function(p){var E=p.originalEvent.target,B=this._element;this._popup&&(E===B||B.contains(E))&&this.togglePopup()},b.prototype.getPopup=function(){return this._popup},b.prototype.togglePopup=function(){var p=this._popup;return p?(p.isOpen()?p.remove():p.addTo(this._map),this):this},b.prototype._update=function(p){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=So(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var E="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?E="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(E="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var B="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?B="rotateX(0deg)":this._pitchAlignment==="map"&&(B="rotateX("+this._map.getPitch()+"deg)"),p&&p.type!=="moveend"||(this._pos=this._pos.round()),r.setTransform(this._element,du[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+B+" "+E)}},b.prototype.getOffset=function(){return this._offset},b.prototype.setOffset=function(p){return this._offset=t.Point.convert(p),this._update(),this},b.prototype._onMove=function(p){this._pos=p.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag"))},b.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new t.Event("dragend")),this._state="inactive"},b.prototype._addDragHandler=function(p){this._element.contains(p.originalEvent.target)&&(p.preventDefault(),this._positionDelta=p.point.sub(this._pos).add(this._offset),this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},b.prototype.setDraggable=function(p){return this._draggable=!!p,this._map&&(p?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},b.prototype.isDraggable=function(){return this._draggable},b.prototype.setRotation=function(p){return this._rotation=p||0,this._update(),this},b.prototype.getRotation=function(){return this._rotation},b.prototype.setRotationAlignment=function(p){return this._rotationAlignment=p||"auto",this._update(),this},b.prototype.getRotationAlignment=function(){return this._rotationAlignment},b.prototype.setPitchAlignment=function(p){return this._pitchAlignment=p&&p!=="auto"?p:this._rotationAlignment,this._update(),this},b.prototype.getPitchAlignment=function(){return this._pitchAlignment},b}(t.Evented),ap={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},yu=0,Ls=!1,sp=function(f){function b(p){f.call(this),this.options=t.extend({},ap,p),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return f&&(b.__proto__=f),(b.prototype=Object.create(f&&f.prototype)).constructor=b,b.prototype.onAdd=function(p){var E;return this._map=p,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),E=this._setupUI,mu!==void 0?E(mu):t.window.navigator.permissions!==void 0?t.window.navigator.permissions.query({name:"geolocation"}).then(function(B){E(mu=B.state!=="denied")}):E(mu=!!t.window.navigator.geolocation),this._container},b.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,yu=0,Ls=!1},b.prototype._isOutOfMapMaxBounds=function(p){var E=this._map.getMaxBounds(),B=p.coords;return E&&(B.longitude<E.getWest()||B.longitude>E.getEast()||B.latitude<E.getSouth()||B.latitude>E.getNorth())},b.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},b.prototype._onSuccess=function(p){if(this._map){if(this._isOutOfMapMaxBounds(p))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",p)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=p,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(p),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(p),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",p)),this._finish()}},b.prototype._updateCamera=function(p){var E=new t.LngLat(p.coords.longitude,p.coords.latitude),B=p.coords.accuracy,q=this._map.getBearing(),V=t.extend({bearing:q},this.options.fitBoundsOptions);this._map.fitBounds(E.toBounds(B),V,{geolocateSource:!0})},b.prototype._updateMarker=function(p){if(p){var E=new t.LngLat(p.coords.longitude,p.coords.latitude);this._accuracyCircleMarker.setLngLat(E).addTo(this._map),this._userLocationDotMarker.setLngLat(E).addTo(this._map),this._accuracy=p.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},b.prototype._updateCircleRadius=function(){var p=this._map._container.clientHeight/2,E=this._map.unproject([0,p]),B=this._map.unproject([1,p]),q=E.distanceTo(B),V=Math.ceil(2*this._accuracy/q);this._circleElement.style.width=V+"px",this._circleElement.style.height=V+"px"},b.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},b.prototype._onError=function(p){if(this._map){if(this.options.trackUserLocation)if(p.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var E=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=E,this._geolocateButton.setAttribute("aria-label",E),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(p.code===3&&Ls)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",p)),this._finish()}},b.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},b.prototype._setupUI=function(p){var E=this;if(this._container.addEventListener("contextmenu",function(V){return V.preventDefault()}),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",p===!1){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var B=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=B,this._geolocateButton.setAttribute("aria-label",B)}else{var q=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=q,this._geolocateButton.setAttribute("aria-label",q)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new vc(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new vc({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(V){V.geolocateSource||E._watchState!=="ACTIVE_LOCK"||V.originalEvent&&V.originalEvent.type==="resize"||(E._watchState="BACKGROUND",E._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),E._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),E.fire(new t.Event("trackuserlocationend")))})},b.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":yu--,Ls=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var p;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++yu>1?(p={maximumAge:6e5,timeout:0},Ls=!0):(p=this.options.positionOptions,Ls=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,p)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},b.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},b}(t.Evented),vu={maxWidth:100,unit:"metric"},oo=function(f){this.options=t.extend({},vu,f),t.bindAll(["_onMove","setUnit"],this)};function rf(f,b,p){var E=p&&p.maxWidth||100,B=f.project(f.crs.getLngLatCenter()),q=f.unproject([B.x,B.y]),V=f.unproject([B.x+E,B.y]);V.lng===q.lng&&(V=f.unproject([B.x-E,B.y]));var Y=q.distanceTo(V);if(p&&p.unit==="imperial"){var ot=3.2808*Y;ot>5280?ju(b,E,ot/5280,f._getUIString("ScaleControl.Miles")):ju(b,E,ot,f._getUIString("ScaleControl.Feet"))}else p&&p.unit==="nautical"?ju(b,E,Y/1852,f._getUIString("ScaleControl.NauticalMiles")):Y>=1e3?ju(b,E,Y/1e3,f._getUIString("ScaleControl.Kilometers")):ju(b,E,Y,f._getUIString("ScaleControl.Meters"))}function ju(f,b,p,E){var B,q,V,Y=(B=p,(q=Math.pow(10,(""+Math.floor(B)).length-1))*(V=(V=B/q)>=10?10:V>=5?5:V>=3?3:V>=2?2:V>=1?1:function(ot){var gt=Math.pow(10,Math.ceil(-Math.log(ot)/Math.LN10));return Math.round(ot*gt)/gt}(V)));f.style.width=b*(Y/p)+"px",f.innerHTML=Y+" "+E}oo.prototype.getDefaultPosition=function(){return"bottom-left"},oo.prototype._onMove=function(){rf(this._map,this._container,this.options)},oo.prototype.onAdd=function(f){return this._map=f,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",f.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},oo.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},oo.prototype.setUnit=function(f){this.options.unit=f,rf(this._map,this._container,this.options)};var Si=function(f){this._fullscreen=!1,f&&f.container&&(f.container instanceof t.window.HTMLElement?this._container=f.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Si.prototype.onAdd=function(f){return this._map=f,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Si.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Si.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Si.prototype._setupUI=function(){var f=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",f).setAttribute("aria-hidden",!0),f.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Si.prototype._updateTitle=function(){var f=this._getTitle();this._fullscreenButton.setAttribute("aria-label",f),this._fullscreenButton.title=f},Si.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Si.prototype._isFullscreen=function(){return this._fullscreen},Si.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Si.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var nf={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px",showArrow:!0,contentClass:null},_c=function(f){function b(p){f.call(this),this.options=t.extend(Object.create(nf),p),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return f&&(b.__proto__=f),(b.prototype=Object.create(f&&f.prototype)).constructor=b,b.prototype.addTo=function(p){return this._map&&this.remove(),this._map=p,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},b.prototype.isOpen=function(){return!!this._map},b.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},b.prototype.getLngLat=function(){return this._lngLat},b.prototype.setLngLat=function(p){return this._lngLat=t.LngLat.convert(p),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},b.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},b.prototype.getElement=function(){return this._container},b.prototype.setText=function(p){return this.setDOMContent(t.window.document.createTextNode(p))},b.prototype.setHTML=function(p){var E,B=t.window.document.createDocumentFragment(),q=t.window.document.createElement("body");for(q.innerHTML=p;E=q.firstChild;)B.appendChild(E);return this.setDOMContent(B)},b.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},b.prototype.setMaxWidth=function(p){return this.options.maxWidth=p,this._update(),this},b.prototype.setDOMContent=function(p){return this._createContent(),this._content.appendChild(p),this._update(),this},b.prototype.addClassName=function(p){this._container&&this._container.classList.add(p)},b.prototype.removeClassName=function(p){this._container&&this._container.classList.remove(p)},b.prototype.toggleClassName=function(p){if(this._container)return this._container.classList.toggle(p)},b.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content"+(this.options.contentClass?" "+this.options.contentClass:""),this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},b.prototype._onMouseUp=function(p){this._update(p.point)},b.prototype._onMouseMove=function(p){this._update(p.point)},b.prototype._onDrag=function(p){this._update(p.point)},b.prototype._update=function(p){var E=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(kt){return E._container.classList.add(kt)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=So(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||p)){var B=this._pos=this._trackPointer&&p?p:this._map.project(this._lngLat),q=this.options.anchor,V=function kt(It){if(It){if(typeof It=="number"){var Xt=Math.round(Math.sqrt(.5*Math.pow(It,2)));return{center:new t.Point(0,0),top:new t.Point(0,It),"top-left":new t.Point(Xt,Xt),"top-right":new t.Point(-Xt,Xt),bottom:new t.Point(0,-It),"bottom-left":new t.Point(Xt,-Xt),"bottom-right":new t.Point(-Xt,-Xt),left:new t.Point(It,0),right:new t.Point(-It,0)}}if(It instanceof t.Point||Array.isArray(It)){var Bt=t.Point.convert(It);return{center:Bt,top:Bt,"top-left":Bt,"top-right":Bt,bottom:Bt,"bottom-left":Bt,"bottom-right":Bt,left:Bt,right:Bt}}return{center:t.Point.convert(It.center||[0,0]),top:t.Point.convert(It.top||[0,0]),"top-left":t.Point.convert(It["top-left"]||[0,0]),"top-right":t.Point.convert(It["top-right"]||[0,0]),bottom:t.Point.convert(It.bottom||[0,0]),"bottom-left":t.Point.convert(It["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(It["bottom-right"]||[0,0]),left:t.Point.convert(It.left||[0,0]),right:t.Point.convert(It.right||[0,0])}}return kt(new t.Point(0,0))}(this.options.offset);if(!q){var Y,ot=this._container.offsetWidth,gt=this._container.offsetHeight;Y=B.y+V.bottom.y<gt?["top"]:B.y>this._map.transform.height-gt?["bottom"]:[],B.x<ot/2?Y.push("left"):B.x>this._map.transform.width-ot/2&&Y.push("right"),q=Y.length===0?"bottom":Y.join("-")}var St=B.add(V[q]).round();r.setTransform(this._container,du[q]+" translate("+St.x+"px,"+St.y+"px)"),gu(this._container,q,"popup")}},b.prototype._onClose=function(){this.remove()},b}(t.Evented),_u={proj4:t.proj4,version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:ng,NavigationControl:Vu,GeolocateControl:sp,AttributionControl:xa,ScaleControl:oo,FullscreenControl:Si,Popup:_c,Marker:vc,Style:Za,CRS:ti,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){vr().acquire(Ve)},clearPrewarmedResources:function(){var f=ir;f&&(f.isPreloaded()&&f.numActive()===1?(f.release(Ve),ir=null):gi.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(f){t.config.ACCESS_TOKEN=f},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(f){t.config.API_URL=f},get workerCount(){return Je.workerCount},set workerCount(f){Je.workerCount=f},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(f){t.config.MAX_PARALLEL_IMAGE_REQUESTS=f},clearStorage:function(f){t.clearTileCache(f)},workerUrl:""};return _u}),window&&(window.mapboxgl=rp);const yV=Ht.Layer.extend({options:{updateInterval:32,padding:.1,interactive:!1,pane:"tilePane",zIndex:1,opacity:1},initialize(t){Ht.setOptions(this,t),t.accessToken&&(rp.accessToken=t.accessToken),this._throttledUpdate=Ht.Util.throttle(this._update,this.options.updateInterval,this)},onAdd(t){this._container||this._initContainer();const e=this.getPaneName();t.getPane(e).appendChild(this._container),this._initGL(),this._offset=this._map.containerPointToLayerPoint([0,0]),t.options.zoomAnimation&&Ht.DomEvent.on(t._proxy,Ht.DomUtil.TRANSITION_END,this._transitionEnd,this),t._addZoomLimit(this)},onRemove(t){this._map._proxy&&this._map.options.zoomAnimation&&Ht.DomEvent.off(this._map._proxy,Ht.DomUtil.TRANSITION_END,this._transitionEnd,this);const e=this.getPaneName();t.getPane(e).removeChild(this._container)},getEvents(){return{move:this._throttledUpdate,zoomanim:this._animateZoom,zoom:this._pinchZoom,zoomstart:this._zoomStart,zoomend:this._zoomEnd,resize:this._resize}},getMapboxMap(){return this._glMap},getCanvas(){return this._glMap.getCanvas()},getSize(){return this._map.getSize().multiplyBy(1+this.options.padding*2)},getBounds(){const t=this.getSize().multiplyBy(.5),e=this._map.latLngToContainerPoint(this._map.getCenter());return Ht.latLngBounds(this._map.containerPointToLatLng(e.subtract(t)),this._map.containerPointToLatLng(e.add(t)))},getContainer(){return this._container},getPaneName(){return this._map.getPane(this.options.pane)?this.options.pane:"tilePane"},bringToFront(){return this._map&&(Ht.DomUtil.toFront(this._container),this._setAutoZIndex(Math.max)),this},bringToBack(){return this._map&&(Ht.DomUtil.toBack(this._container),this._setAutoZIndex(Math.min)),this},setOpacity(t){return this.options.opacity=t,this._updateOpacity(),this},_updateOpacity(){this._map&&(this._container.style.opacity=this.options.opacity)},_initContainer(){const t=this._container=Ht.DomUtil.create("div","leaflet-gl-layer");this._updateZIndex(),this.options.opacity<1&&this._updateOpacity();const e=this.getSize(),r=this._map.getSize().multiplyBy(this.options.padding);t.style.width=`${e.x}px`,t.style.height=`${e.y}px`;const n=this._map.containerPointToLayerPoint([0,0]).subtract(r);Ht.DomUtil.setPosition(t,n)},_initGL(){const t=this._map.getCenter(),e=Ht.extend({},this.options,{container:this._container,center:[t.lng,t.lat],zoom:this._map.getZoom()-1,attributionControl:!1});this._glMap?(this._glMap.setCenter(e.center),this._glMap.setZoom(e.zoom)):this._glMap=new rp.Map(e),this._glMap.transform.latRange=null,this._transformGL(this._glMap),this._glMap._canvas.canvas?this._glMap._actualCanvas=this._glMap._canvas.canvas:this._glMap._actualCanvas=this._glMap._canvas;const r=this._glMap._actualCanvas;Ht.DomUtil.addClass(r,"leaflet-image-layer"),Ht.DomUtil.addClass(r,"leaflet-zoom-animated"),this.options.interactive&&Ht.DomUtil.addClass(r,"leaflet-interactive"),this.options.className&&Ht.DomUtil.addClass(r,this.options.className)},_update(t){if(!this._map||(this._offset=this._map.containerPointToLayerPoint([0,0]),this._zooming))return;const e=this.getSize(),r=this._container,n=this._glMap,a=this._map.getSize().multiplyBy(this.options.padding),s=this._map.containerPointToLayerPoint([0,0]).subtract(a);Ht.DomUtil.setPosition(r,s),this._transformGL(n);const u=Math.round(e.x),h=Math.round(e.y);Math.round(n.transform.width)!==u||Math.round(n.transform.height)!==h?(r.style.width=`${u}px`,r.style.height=`${h}px`,n._resize!==null&&n._resize!==void 0?n._resize():n.resize()):n._update!==null&&n._update!==void 0?n._update():n.update()},_transformGL(t){const e=this._map.getCenter(),r=t.transform;r.center=rp.LngLat.convert([e.lng,e.lat]),r.zoom=this._map.getZoom()-1},_pinchZoom(t){this._glMap.jumpTo({zoom:this._map.getZoom()-1,center:this._map.getCenter()})},_animateZoom(t){const e=this._map.getZoomScale(t.zoom),r=this._map.getSize().multiplyBy(this.options.padding*e),n=this.getSize()._divideBy(2),a=this._map.project(t.center,t.zoom)._subtract(n)._add(this._map._getMapPanePos().add(r))._round(),s=this._map.project(this._map.getBounds().getNorthWest(),t.zoom)._subtract(a);Ht.DomUtil.setTransform(this._glMap._actualCanvas,s.subtract(this._offset),e)},_zoomStart(t){this._zooming=!0},_zoomEnd(){const t=this._map.getZoomScale(this._map.getZoom());Ht.DomUtil.setTransform(this._glMap._actualCanvas,null,t),this._zooming=!1,this._update()},_transitionEnd(t){Ht.Util.requestAnimFrame(function(){const e=this._map.getZoom(),r=this._map.getCenter(),n=this._map.latLngToContainerPoint(this._map.getBounds().getNorthWest());Ht.DomUtil.setTransform(this._glMap._actualCanvas,n,1),this._glMap.once("moveend",Ht.Util.bind(function(){this._zoomEnd()},this)),this._glMap.jumpTo({center:r,zoom:e-1})},this)},_resize(t){this._transitionEnd(t)},_setAutoZIndex(t){const e=this.getPane().children;let r=-t(-1/0,1/0);for(let n=0,a=e.length,s;n<a;n++)s=e[n].style.zIndex,e[n]!==this._container&&s&&(r=t(r,+s));Number.isFinite(r)&&(this.options.zIndex=r+t(-1,1),this._updateZIndex())},_updateZIndex(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)}}),vV=Object.freeze(Object.defineProperty({__proto__:null,MapboxGL:yV},Symbol.toStringTag,{value:"Module"}));var Kc=[],_V=function(){return Kc.some(function(t){return t.activeTargets.length>0})},xV=function(){return Kc.some(function(t){return t.skippedTargets.length>0})},RL="ResizeObserver loop completed with undelivered notifications.",bV=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:RL}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=RL),window.dispatchEvent(t)},rg;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(rg||(rg={}));var Qc=function(t){return Object.freeze(t)},BL=function(){function t(e,r){this.inlineSize=e,this.blockSize=r,Qc(this)}return t}(),DL=function(){function t(e,r,n,a){return this.x=e,this.y=r,this.width=n,this.height=a,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Qc(this)}return t.prototype.toJSON=function(){var e=this,r=e.x,n=e.y,a=e.top,s=e.right,u=e.bottom,h=e.left,v=e.width,M=e.height;return{x:r,y:n,top:a,right:s,bottom:u,left:h,width:v,height:M}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),j1=function(t){return t instanceof SVGElement&&"getBBox"in t},NL=function(t){if(j1(t)){var e=t.getBBox(),r=e.width,n=e.height;return!r&&!n}var a=t,s=a.offsetWidth,u=a.offsetHeight;return!(s||u||t.getClientRects().length)},FL=function(t){var e;if(t instanceof Element)return!0;var r=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(r&&t instanceof r.Element)},wV=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},ig=typeof window!="undefined"?window:{},Jy=new WeakMap,zL=/auto|scroll/,MV=/^tb|vertical/,EV=/msie|trident/i.test(ig.navigator&&ig.navigator.userAgent),Fl=function(t){return parseFloat(t||"0")},ip=function(t,e,r){return t===void 0&&(t=0),e===void 0&&(e=0),r===void 0&&(r=!1),new BL((r?e:t)||0,(r?t:e)||0)},GL=Qc({devicePixelContentBoxSize:ip(),borderBoxSize:ip(),contentBoxSize:ip(),contentRect:new DL(0,0,0,0)}),qL=function(t,e){if(e===void 0&&(e=!1),Jy.has(t)&&!e)return Jy.get(t);if(NL(t))return Jy.set(t,GL),GL;var r=getComputedStyle(t),n=j1(t)&&t.ownerSVGElement&&t.getBBox(),a=!EV&&r.boxSizing==="border-box",s=MV.test(r.writingMode||""),u=!n&&zL.test(r.overflowY||""),h=!n&&zL.test(r.overflowX||""),v=n?0:Fl(r.paddingTop),M=n?0:Fl(r.paddingRight),k=n?0:Fl(r.paddingBottom),I=n?0:Fl(r.paddingLeft),N=n?0:Fl(r.borderTopWidth),z=n?0:Fl(r.borderRightWidth),j=n?0:Fl(r.borderBottomWidth),K=n?0:Fl(r.borderLeftWidth),$=I+M,ut=v+k,Z=K+z,et=N+j,nt=h?t.offsetHeight-et-t.clientHeight:0,ht=u?t.offsetWidth-Z-t.clientWidth:0,_t=a?$+Z:0,wt=a?ut+et:0,Ot=n?n.width:Fl(r.width)-_t-ht,jt=n?n.height:Fl(r.height)-wt-nt,fe=Ot+$+ht+Z,me=jt+ut+nt+et,ke=Qc({devicePixelContentBoxSize:ip(Math.round(Ot*devicePixelRatio),Math.round(jt*devicePixelRatio),s),borderBoxSize:ip(fe,me,s),contentBoxSize:ip(Ot,jt,s),contentRect:new DL(I,v,Ot,jt)});return Jy.set(t,ke),ke},UL=function(t,e,r){var n=qL(t,r),a=n.borderBoxSize,s=n.contentBoxSize,u=n.devicePixelContentBoxSize;switch(e){case rg.DEVICE_PIXEL_CONTENT_BOX:return u;case rg.BORDER_BOX:return a;default:return s}},VL=function(){function t(e){var r=qL(e);this.target=e,this.contentRect=r.contentRect,this.borderBoxSize=Qc([r.borderBoxSize]),this.contentBoxSize=Qc([r.contentBoxSize]),this.devicePixelContentBoxSize=Qc([r.devicePixelContentBoxSize])}return t}(),jL=function(t){if(NL(t))return 1/0;for(var e=0,r=t.parentNode;r;)e+=1,r=r.parentNode;return e},SV=function(){var t=1/0,e=[];Kc.forEach(function(u){if(u.activeTargets.length!==0){var h=[];u.activeTargets.forEach(function(M){var k=new VL(M.target),I=jL(M.target);h.push(k),M.lastReportedSize=UL(M.target,M.observedBox),I<t&&(t=I)}),e.push(function(){u.callback.call(u.observer,h,u.observer)}),u.activeTargets.splice(0,u.activeTargets.length)}});for(var r=0,n=e;r<n.length;r++){var a=n[r];a()}return t},ZL=function(t){Kc.forEach(function(r){r.activeTargets.splice(0,r.activeTargets.length),r.skippedTargets.splice(0,r.skippedTargets.length),r.observationTargets.forEach(function(a){a.isActive()&&(jL(a.target)>t?r.activeTargets.push(a):r.skippedTargets.push(a))})})},CV=function(){var t=0;for(ZL(t);_V();)t=SV(),ZL(t);return xV()&&bV(),t>0},Z1,XL=[],LV=function(){return XL.splice(0).forEach(function(t){return t()})},kV=function(t){if(!Z1){var e=0,r=document.createTextNode(""),n={characterData:!0};new MutationObserver(function(){return LV()}).observe(r,n),Z1=function(){r.textContent="".concat(e?e--:e++)}}XL.push(t),Z1()},PV=function(t){kV(function(){requestAnimationFrame(t)})},Ky=0,IV=function(){return!!Ky},TV=250,AV={attributes:!0,characterData:!0,childList:!0,subtree:!0},WL=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],HL=function(t){return t===void 0&&(t=0),Date.now()+t},X1=!1,OV=function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var r=this;if(e===void 0&&(e=TV),!X1){X1=!0;var n=HL(e);PV(function(){var a=!1;try{a=CV()}finally{if(X1=!1,e=n-HL(),!IV())return;a?r.run(1e3):e>0?r.run(e):r.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,r=function(){return e.observer&&e.observer.observe(document.body,AV)};document.body?r():ig.addEventListener("DOMContentLoaded",r)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),WL.forEach(function(r){return ig.addEventListener(r,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),WL.forEach(function(r){return ig.removeEventListener(r,e.listener,!0)}),this.stopped=!0)},t}(),W1=new OV,YL=function(t){!Ky&&t>0&&W1.start(),Ky+=t,!Ky&&W1.stop()},RV=function(t){return!j1(t)&&!wV(t)&&getComputedStyle(t).display==="inline"},BV=function(){function t(e,r){this.target=e,this.observedBox=r||rg.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=UL(this.target,this.observedBox,!0);return RV(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),DV=function(){function t(e,r){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=r}return t}(),Qy=new WeakMap,JL=function(t,e){for(var r=0;r<t.length;r+=1)if(t[r].target===e)return r;return-1},$y=function(){function t(){}return t.connect=function(e,r){var n=new DV(e,r);Qy.set(e,n)},t.observe=function(e,r,n){var a=Qy.get(e),s=a.observationTargets.length===0;JL(a.observationTargets,r)<0&&(s&&Kc.push(a),a.observationTargets.push(new BV(r,n&&n.box)),YL(1),W1.schedule())},t.unobserve=function(e,r){var n=Qy.get(e),a=JL(n.observationTargets,r),s=n.observationTargets.length===1;a>=0&&(s&&Kc.splice(Kc.indexOf(n),1),n.observationTargets.splice(a,1),YL(-1))},t.disconnect=function(e){var r=this,n=Qy.get(e);n.observationTargets.slice().forEach(function(a){return r.unobserve(e,a.target)}),n.activeTargets.splice(0,n.activeTargets.length)},t}(),NV=function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");$y.connect(this,e)}return t.prototype.observe=function(e,r){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!FL(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");$y.observe(this,e,r)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!FL(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");$y.unobserve(this,e)},t.prototype.disconnect=function(){$y.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const FV=Object.freeze(Object.defineProperty({__proto__:null,ResizeObserver:NV,ResizeObserverEntry:VL,ResizeObserverSize:BL},Symbol.toStringTag,{value:"Module"}));Kr.CompareMapUtils=p2,Kr.Config=Ku,Kr.CrsUtils=Bf,Kr.DrawUtils=e2,Kr.FeatureStyleUtils=pE,Kr.GeojsonUtils=Fc,Kr.GeometryUtils=Pd,Kr.LayerUtils=L_,Kr.MapUtils=kd,Kr.MeasureUtils=o2,Kr.PopupUtils=v2,Kr.QueryUtils=QE,Kr.SwipeUtils=d2,Kr.TransformUtils=iu,Kr.ViewUtils=$M,Kr.extend=q1,Object.defineProperty(Kr,Symbol.toStringTag,{value:"Module"})});
|
|
644
|
-
//# sourceMappingURL=
|
|
644
|
+
//# sourceMappingURL=map-sdk.cjs.map
|