@golstats/gsc-game-data 1.0.291 → 1.0.292

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.
@@ -8198,7 +8198,7 @@ uniform ${ze} ${$e} u_${nt};
8198
8198
  #endif
8199
8199
  `}),staticAttributes:F,staticUniforms:ie}}class Fn{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(u,m,F,$,Z,ie,he,be,Ce){this.context=u;let ze=this.boundPaintVertexBuffers.length!==$.length;for(let $e=0;!ze&&$e<$.length;$e++)this.boundPaintVertexBuffers[$e]!==$[$e]&&(ze=!0);!this.vao||this.boundProgram!==m||this.boundLayoutVertexBuffer!==F||ze||this.boundIndexBuffer!==Z||this.boundVertexOffset!==ie||this.boundDynamicVertexBuffer!==he||this.boundDynamicVertexBuffer2!==be||this.boundDynamicVertexBuffer3!==Ce?this.freshBind(m,F,$,Z,ie,he,be,Ce):(u.bindVertexArray.set(this.vao),he&&he.bind(),Z&&Z.dynamicDraw&&Z.bind(),be&&be.bind(),Ce&&Ce.bind())}freshBind(u,m,F,$,Z,ie,he,be){const Ce=u.numAttributes,ze=this.context,$e=ze.gl;this.vao&&this.destroy(),this.vao=ze.createVertexArray(),ze.bindVertexArray.set(this.vao),this.boundProgram=u,this.boundLayoutVertexBuffer=m,this.boundPaintVertexBuffers=F,this.boundIndexBuffer=$,this.boundVertexOffset=Z,this.boundDynamicVertexBuffer=ie,this.boundDynamicVertexBuffer2=he,this.boundDynamicVertexBuffer3=be,m.enableAttributes($e,u);for(const nt of F)nt.enableAttributes($e,u);ie&&ie.enableAttributes($e,u),he&&he.enableAttributes($e,u),be&&be.enableAttributes($e,u),m.bind(),m.setVertexAttribPointers($e,u,Z);for(const nt of F)nt.bind(),nt.setVertexAttribPointers($e,u,Z);ie&&(ie.bind(),ie.setVertexAttribPointers($e,u,Z)),$&&$.bind(),he&&(he.bind(),he.setVertexAttribPointers($e,u,Z)),be&&(be.bind(),be.setVertexAttribPointers($e,u,Z)),ze.currentNumAttributes=Ce}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const va=(j,u,m,F,$)=>({u_matrix:j,u_texture:0,u_ele_delta:u,u_fog_matrix:m,u_fog_color:F?F.properties.get("fog-color"):a.aN.white,u_fog_ground_blend:F?F.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:F?F.calculateFogBlendOpacity($):0,u_horizon_color:F?F.properties.get("horizon-color"):a.aN.white,u_horizon_fog_blend:F?F.properties.get("horizon-fog-blend"):1});function wa(j){const u=[];for(let m=0;m<j.length;m++){if(j[m]===null)continue;const F=j[m].split(" ");u.push(F.pop())}return u}class tn{constructor(u,m,F,$,Z,ie){const he=u.gl;this.program=he.createProgram();const be=wa(m.staticAttributes),Ce=F?F.getBinderAttributes():[],ze=be.concat(Ce),$e=bn.prelude.staticUniforms?wa(bn.prelude.staticUniforms):[],nt=m.staticUniforms?wa(m.staticUniforms):[],ct=F?F.getBinderUniforms():[],pt=$e.concat(nt).concat(ct),xt=[];for(const Yt of pt)xt.indexOf(Yt)<0&&xt.push(Yt);const Et=F?F.defines():[];Z&&Et.push("#define OVERDRAW_INSPECTOR;"),ie&&Et.push("#define TERRAIN3D;");const Ct=Et.concat(bn.prelude.fragmentSource,m.fragmentSource).join(`
8200
8200
  `),Rt=Et.concat(bn.prelude.vertexSource,m.vertexSource).join(`
8201
- `),At=he.createShader(he.FRAGMENT_SHADER);if(he.isContextLost())return void(this.failedToCreate=!0);if(he.shaderSource(At,Ct),he.compileShader(At),!he.getShaderParameter(At,he.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${he.getShaderInfoLog(At)}`);he.attachShader(this.program,At);const Zt=he.createShader(he.VERTEX_SHADER);if(he.isContextLost())return void(this.failedToCreate=!0);if(he.shaderSource(Zt,Rt),he.compileShader(Zt),!he.getShaderParameter(Zt,he.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${he.getShaderInfoLog(Zt)}`);he.attachShader(this.program,Zt),this.attributes={};const Kt={};this.numAttributes=ze.length;for(let Yt=0;Yt<this.numAttributes;Yt++)ze[Yt]&&(he.bindAttribLocation(this.program,Yt,ze[Yt]),this.attributes[ze[Yt]]=Yt);if(he.linkProgram(this.program),!he.getProgramParameter(this.program,he.LINK_STATUS))throw new Error(`Program failed to link: ${he.getProgramInfoLog(this.program)}`);he.deleteShader(Zt),he.deleteShader(At);for(let Yt=0;Yt<xt.length;Yt++){const da=xt[Yt];if(da&&!Kt[da]){const ba=he.getUniformLocation(this.program,da);ba&&(Kt[da]=ba)}}this.fixedUniforms=$(u,Kt),this.terrainUniforms=((Yt,da)=>({u_depth:new a.aI(Yt,da.u_depth),u_terrain:new a.aI(Yt,da.u_terrain),u_terrain_dim:new a.aJ(Yt,da.u_terrain_dim),u_terrain_matrix:new a.aK(Yt,da.u_terrain_matrix),u_terrain_unpack:new a.aL(Yt,da.u_terrain_unpack),u_terrain_exaggeration:new a.aJ(Yt,da.u_terrain_exaggeration)}))(u,Kt),this.binderUniforms=F?F.getUniforms(u,Kt):[]}draw(u,m,F,$,Z,ie,he,be,Ce,ze,$e,nt,ct,pt,xt,Et,Ct,Rt){const At=u.gl;if(this.failedToCreate)return;if(u.program.set(this.program),u.setDepthMode(F),u.setStencilMode($),u.setColorMode(Z),u.setCullFace(ie),be){u.activeTexture.set(At.TEXTURE2),At.bindTexture(At.TEXTURE_2D,be.depthTexture),u.activeTexture.set(At.TEXTURE3),At.bindTexture(At.TEXTURE_2D,be.texture);for(const Kt in this.terrainUniforms)this.terrainUniforms[Kt].set(be[Kt])}for(const Kt in this.fixedUniforms)this.fixedUniforms[Kt].set(he[Kt]);xt&&xt.setUniforms(u,this.binderUniforms,ct,{zoom:pt});let Zt=0;switch(m){case At.LINES:Zt=2;break;case At.TRIANGLES:Zt=3;break;case At.LINE_STRIP:Zt=1}for(const Kt of nt.get()){const Yt=Kt.vaos||(Kt.vaos={});(Yt[Ce]||(Yt[Ce]=new Fn)).bind(u,this,ze,xt?xt.getPaintVertexBuffers():[],$e,Kt.vertexOffset,Et,Ct,Rt),At.drawElements(m,Kt.primitiveLength*Zt,At.UNSIGNED_SHORT,Kt.primitiveOffset*Zt*2)}}}function Va(j,u,m){const F=1/St(m,1,u.transform.tileZoom),$=Math.pow(2,m.tileID.overscaledZ),Z=m.tileSize*Math.pow(2,u.transform.tileZoom)/$,ie=Z*(m.tileID.canonical.x+m.tileID.wrap*$),he=Z*m.tileID.canonical.y;return{u_image:0,u_texsize:m.imageAtlasTexture.size,u_scale:[F,j.fromScale,j.toScale],u_fade:j.t,u_pixel_coord_upper:[ie>>16,he>>16],u_pixel_coord_lower:[65535&ie,65535&he]}}const an=(j,u,m,F)=>{const $=u.style.light,Z=$.properties.get("position"),ie=[Z.x,Z.y,Z.z],he=function(){var Ce=new a.A(9);return a.A!=Float32Array&&(Ce[1]=0,Ce[2]=0,Ce[3]=0,Ce[5]=0,Ce[6]=0,Ce[7]=0),Ce[0]=1,Ce[4]=1,Ce[8]=1,Ce}();$.properties.get("anchor")==="viewport"&&function(Ce,ze){var $e=Math.sin(ze),nt=Math.cos(ze);Ce[0]=nt,Ce[1]=$e,Ce[2]=0,Ce[3]=-$e,Ce[4]=nt,Ce[5]=0,Ce[6]=0,Ce[7]=0,Ce[8]=1}(he,-u.transform.angle),function(Ce,ze,$e){var nt=ze[0],ct=ze[1],pt=ze[2];Ce[0]=nt*$e[0]+ct*$e[3]+pt*$e[6],Ce[1]=nt*$e[1]+ct*$e[4]+pt*$e[7],Ce[2]=nt*$e[2]+ct*$e[5]+pt*$e[8]}(ie,ie,he);const be=$.properties.get("color");return{u_matrix:j,u_lightpos:ie,u_lightintensity:$.properties.get("intensity"),u_lightcolor:[be.r,be.g,be.b],u_vertical_gradient:+m,u_opacity:F}},_n=(j,u,m,F,$,Z,ie)=>a.e(an(j,u,m,F),Va(Z,u,ie),{u_height_factor:-Math.pow(2,$.overscaledZ)/ie.tileSize/8}),gn=j=>({u_matrix:j}),Ln=(j,u,m,F)=>a.e(gn(j),Va(m,u,F)),Un=(j,u)=>({u_matrix:j,u_world:u}),ma=(j,u,m,F,$)=>a.e(Ln(j,u,m,F),{u_world:$}),$a=(j,u,m,F)=>{const $=j.transform;let Z,ie;if(F.paint.get("circle-pitch-alignment")==="map"){const he=St(m,1,$.zoom);Z=!0,ie=[he,he]}else Z=!1,ie=$.pixelsToGLUnits;return{u_camera_to_center_distance:$.cameraToCenterDistance,u_scale_with_map:+(F.paint.get("circle-pitch-scale")==="map"),u_matrix:j.translatePosMatrix(u.posMatrix,m,F.paint.get("circle-translate"),F.paint.get("circle-translate-anchor")),u_pitch_with_map:+Z,u_device_pixel_ratio:j.pixelRatio,u_extrude_scale:ie}},ta=(j,u)=>({u_matrix:u,u_pixel_extrude_scale:[1/j.width,1/j.height]}),ca=(j,u,m)=>({u_matrix:j,u_inv_matrix:u,u_camera_to_center_distance:m.cameraToCenterDistance,u_viewport_size:[m.width,m.height]}),fa=(j,u,m=1)=>({u_matrix:j,u_color:u,u_overlay:0,u_overlay_scale:m}),za=j=>({u_matrix:j}),La=(j,u,m,F)=>({u_matrix:j,u_extrude_scale:St(u,1,m),u_intensity:F}),Wa=(j,u,m,F)=>{const $=a.H();a.aQ($,0,j.width,j.height,0,0,1);const Z=j.context.gl;return{u_matrix:$,u_world:[Z.drawingBufferWidth,Z.drawingBufferHeight],u_image:m,u_color_ramp:F,u_opacity:u.paint.get("heatmap-opacity")}},Ra=(j,u,m,F)=>{const $=m.paint.get("hillshade-shadow-color"),Z=m.paint.get("hillshade-highlight-color"),ie=m.paint.get("hillshade-accent-color");let he=m.paint.get("hillshade-illumination-direction")*(Math.PI/180);m.paint.get("hillshade-illumination-anchor")==="viewport"&&(he-=j.transform.angle);const be=!j.options.moving;return{u_matrix:F?F.posMatrix:j.transform.calculatePosMatrix(u.tileID.toUnwrapped(),be),u_image:0,u_latrange:la(0,u.tileID),u_light:[m.paint.get("hillshade-exaggeration"),he],u_shadow:$,u_highlight:Z,u_accent:ie}},Ia=(j,u)=>{const m=u.stride,F=a.H();return a.aQ(F,0,a.X,-a.X,0,0,1),a.J(F,F,[0,-a.X,0]),{u_matrix:F,u_image:1,u_dimension:[m,m],u_zoom:j.overscaledZ,u_unpack:u.getUnpackVector()}};function la(j,u){const m=Math.pow(2,u.canonical.z),F=u.canonical.y;return[new a.Z(0,F/m).toLngLat().lat,new a.Z(0,(F+1)/m).toLngLat().lat]}const oa=(j,u,m,F)=>{const $=j.transform;return{u_matrix:un(j,u,m,F),u_ratio:1/St(u,1,$.zoom),u_device_pixel_ratio:j.pixelRatio,u_units_to_pixels:[1/$.pixelsToGLUnits[0],1/$.pixelsToGLUnits[1]]}},Sa=(j,u,m,F,$)=>a.e(oa(j,u,m,$),{u_image:0,u_image_height:F}),Za=(j,u,m,F,$)=>{const Z=j.transform,ie=ln(u,Z);return{u_matrix:un(j,u,m,$),u_texsize:u.imageAtlasTexture.size,u_ratio:1/St(u,1,Z.zoom),u_device_pixel_ratio:j.pixelRatio,u_image:0,u_scale:[ie,F.fromScale,F.toScale],u_fade:F.t,u_units_to_pixels:[1/Z.pixelsToGLUnits[0],1/Z.pixelsToGLUnits[1]]}},cn=(j,u,m,F,$,Z)=>{const ie=j.transform,he=j.lineAtlas,be=ln(u,ie),Ce=m.layout.get("line-cap")==="round",ze=he.getDash(F.from,Ce),$e=he.getDash(F.to,Ce),nt=ze.width*$.fromScale,ct=$e.width*$.toScale;return a.e(oa(j,u,m,Z),{u_patternscale_a:[be/nt,-ze.height/2],u_patternscale_b:[be/ct,-$e.height/2],u_sdfgamma:he.width/(256*Math.min(nt,ct)*j.pixelRatio)/2,u_image:0,u_tex_y_a:ze.y,u_tex_y_b:$e.y,u_mix:$.t})};function ln(j,u){return 1/St(j,1,u.tileZoom)}function un(j,u,m,F){return j.translatePosMatrix(F?F.posMatrix:u.tileID.posMatrix,u,m.paint.get("line-translate"),m.paint.get("line-translate-anchor"))}const En=(j,u,m,F,$)=>{return{u_matrix:j,u_tl_parent:u,u_scale_parent:m,u_buffer_scale:1,u_fade_t:F.mix,u_opacity:F.opacity*$.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:$.paint.get("raster-brightness-min"),u_brightness_high:$.paint.get("raster-brightness-max"),u_saturation_factor:(ie=$.paint.get("raster-saturation"),ie>0?1-1/(1.001-ie):-ie),u_contrast_factor:(Z=$.paint.get("raster-contrast"),Z>0?1/(1-Z):1+Z),u_spin_weights:kn($.paint.get("raster-hue-rotate"))};var Z,ie};function kn(j){j*=Math.PI/180;const u=Math.sin(j),m=Math.cos(j);return[(2*m+1)/3,(-Math.sqrt(3)*u-m+1)/3,(Math.sqrt(3)*u-m+1)/3]}const Pn=(j,u,m,F,$,Z,ie,he,be,Ce,ze,$e,nt,ct)=>{const pt=ie.transform;return{u_is_size_zoom_constant:+(j==="constant"||j==="source"),u_is_size_feature_constant:+(j==="constant"||j==="camera"),u_size_t:u?u.uSizeT:0,u_size:u?u.uSize:0,u_camera_to_center_distance:pt.cameraToCenterDistance,u_pitch:pt.pitch/360*2*Math.PI,u_rotate_symbol:+m,u_aspect_ratio:pt.width/pt.height,u_fade_change:ie.options.fadeDuration?ie.symbolFadeChange:1,u_matrix:he,u_label_plane_matrix:be,u_coord_matrix:Ce,u_is_text:+$e,u_pitch_with_map:+F,u_is_along_line:$,u_is_variable_anchor:Z,u_texsize:nt,u_texture:0,u_translation:ze,u_pitched_scale:ct}},xn=(j,u,m,F,$,Z,ie,he,be,Ce,ze,$e,nt,ct,pt)=>{const xt=ie.transform;return a.e(Pn(j,u,m,F,$,Z,ie,he,be,Ce,ze,$e,nt,pt),{u_gamma_scale:F?Math.cos(xt._pitch)*xt.cameraToCenterDistance:1,u_device_pixel_ratio:ie.pixelRatio,u_is_halo:+ct})},Tn=(j,u,m,F,$,Z,ie,he,be,Ce,ze,$e,nt,ct)=>a.e(xn(j,u,m,F,$,Z,ie,he,be,Ce,ze,!0,$e,!0,ct),{u_texsize_icon:nt,u_texture_icon:1}),Nn=(j,u,m)=>({u_matrix:j,u_opacity:u,u_color:m}),Jn=(j,u,m,F,$,Z)=>a.e(function(ie,he,be,Ce){const ze=be.imageManager.getPattern(ie.from.toString()),$e=be.imageManager.getPattern(ie.to.toString()),{width:nt,height:ct}=be.imageManager.getPixelSize(),pt=Math.pow(2,Ce.tileID.overscaledZ),xt=Ce.tileSize*Math.pow(2,be.transform.tileZoom)/pt,Et=xt*(Ce.tileID.canonical.x+Ce.tileID.wrap*pt),Ct=xt*Ce.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:ze.tl,u_pattern_br_a:ze.br,u_pattern_tl_b:$e.tl,u_pattern_br_b:$e.br,u_texsize:[nt,ct],u_mix:he.t,u_pattern_size_a:ze.displaySize,u_pattern_size_b:$e.displaySize,u_scale_a:he.fromScale,u_scale_b:he.toScale,u_tile_units_to_pixels:1/St(Ce,1,be.transform.tileZoom),u_pixel_coord_upper:[Et>>16,Ct>>16],u_pixel_coord_lower:[65535&Et,65535&Ct]}}(F,Z,m,$),{u_matrix:j,u_opacity:u}),$n={fillExtrusion:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_lightpos:new a.aO(j,u.u_lightpos),u_lightintensity:new a.aJ(j,u.u_lightintensity),u_lightcolor:new a.aO(j,u.u_lightcolor),u_vertical_gradient:new a.aJ(j,u.u_vertical_gradient),u_opacity:new a.aJ(j,u.u_opacity)}),fillExtrusionPattern:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_lightpos:new a.aO(j,u.u_lightpos),u_lightintensity:new a.aJ(j,u.u_lightintensity),u_lightcolor:new a.aO(j,u.u_lightcolor),u_vertical_gradient:new a.aJ(j,u.u_vertical_gradient),u_height_factor:new a.aJ(j,u.u_height_factor),u_image:new a.aI(j,u.u_image),u_texsize:new a.aP(j,u.u_texsize),u_pixel_coord_upper:new a.aP(j,u.u_pixel_coord_upper),u_pixel_coord_lower:new a.aP(j,u.u_pixel_coord_lower),u_scale:new a.aO(j,u.u_scale),u_fade:new a.aJ(j,u.u_fade),u_opacity:new a.aJ(j,u.u_opacity)}),fill:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix)}),fillPattern:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_image:new a.aI(j,u.u_image),u_texsize:new a.aP(j,u.u_texsize),u_pixel_coord_upper:new a.aP(j,u.u_pixel_coord_upper),u_pixel_coord_lower:new a.aP(j,u.u_pixel_coord_lower),u_scale:new a.aO(j,u.u_scale),u_fade:new a.aJ(j,u.u_fade)}),fillOutline:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_world:new a.aP(j,u.u_world)}),fillOutlinePattern:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_world:new a.aP(j,u.u_world),u_image:new a.aI(j,u.u_image),u_texsize:new a.aP(j,u.u_texsize),u_pixel_coord_upper:new a.aP(j,u.u_pixel_coord_upper),u_pixel_coord_lower:new a.aP(j,u.u_pixel_coord_lower),u_scale:new a.aO(j,u.u_scale),u_fade:new a.aJ(j,u.u_fade)}),circle:(j,u)=>({u_camera_to_center_distance:new a.aJ(j,u.u_camera_to_center_distance),u_scale_with_map:new a.aI(j,u.u_scale_with_map),u_pitch_with_map:new a.aI(j,u.u_pitch_with_map),u_extrude_scale:new a.aP(j,u.u_extrude_scale),u_device_pixel_ratio:new a.aJ(j,u.u_device_pixel_ratio),u_matrix:new a.aK(j,u.u_matrix)}),collisionBox:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_pixel_extrude_scale:new a.aP(j,u.u_pixel_extrude_scale)}),collisionCircle:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_inv_matrix:new a.aK(j,u.u_inv_matrix),u_camera_to_center_distance:new a.aJ(j,u.u_camera_to_center_distance),u_viewport_size:new a.aP(j,u.u_viewport_size)}),debug:(j,u)=>({u_color:new a.aM(j,u.u_color),u_matrix:new a.aK(j,u.u_matrix),u_overlay:new a.aI(j,u.u_overlay),u_overlay_scale:new a.aJ(j,u.u_overlay_scale)}),clippingMask:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix)}),heatmap:(j,u)=>({u_extrude_scale:new a.aJ(j,u.u_extrude_scale),u_intensity:new a.aJ(j,u.u_intensity),u_matrix:new a.aK(j,u.u_matrix)}),heatmapTexture:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_world:new a.aP(j,u.u_world),u_image:new a.aI(j,u.u_image),u_color_ramp:new a.aI(j,u.u_color_ramp),u_opacity:new a.aJ(j,u.u_opacity)}),hillshade:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_image:new a.aI(j,u.u_image),u_latrange:new a.aP(j,u.u_latrange),u_light:new a.aP(j,u.u_light),u_shadow:new a.aM(j,u.u_shadow),u_highlight:new a.aM(j,u.u_highlight),u_accent:new a.aM(j,u.u_accent)}),hillshadePrepare:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_image:new a.aI(j,u.u_image),u_dimension:new a.aP(j,u.u_dimension),u_zoom:new a.aJ(j,u.u_zoom),u_unpack:new a.aL(j,u.u_unpack)}),line:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_ratio:new a.aJ(j,u.u_ratio),u_device_pixel_ratio:new a.aJ(j,u.u_device_pixel_ratio),u_units_to_pixels:new a.aP(j,u.u_units_to_pixels)}),lineGradient:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_ratio:new a.aJ(j,u.u_ratio),u_device_pixel_ratio:new a.aJ(j,u.u_device_pixel_ratio),u_units_to_pixels:new a.aP(j,u.u_units_to_pixels),u_image:new a.aI(j,u.u_image),u_image_height:new a.aJ(j,u.u_image_height)}),linePattern:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_texsize:new a.aP(j,u.u_texsize),u_ratio:new a.aJ(j,u.u_ratio),u_device_pixel_ratio:new a.aJ(j,u.u_device_pixel_ratio),u_image:new a.aI(j,u.u_image),u_units_to_pixels:new a.aP(j,u.u_units_to_pixels),u_scale:new a.aO(j,u.u_scale),u_fade:new a.aJ(j,u.u_fade)}),lineSDF:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_ratio:new a.aJ(j,u.u_ratio),u_device_pixel_ratio:new a.aJ(j,u.u_device_pixel_ratio),u_units_to_pixels:new a.aP(j,u.u_units_to_pixels),u_patternscale_a:new a.aP(j,u.u_patternscale_a),u_patternscale_b:new a.aP(j,u.u_patternscale_b),u_sdfgamma:new a.aJ(j,u.u_sdfgamma),u_image:new a.aI(j,u.u_image),u_tex_y_a:new a.aJ(j,u.u_tex_y_a),u_tex_y_b:new a.aJ(j,u.u_tex_y_b),u_mix:new a.aJ(j,u.u_mix)}),raster:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_tl_parent:new a.aP(j,u.u_tl_parent),u_scale_parent:new a.aJ(j,u.u_scale_parent),u_buffer_scale:new a.aJ(j,u.u_buffer_scale),u_fade_t:new a.aJ(j,u.u_fade_t),u_opacity:new a.aJ(j,u.u_opacity),u_image0:new a.aI(j,u.u_image0),u_image1:new a.aI(j,u.u_image1),u_brightness_low:new a.aJ(j,u.u_brightness_low),u_brightness_high:new a.aJ(j,u.u_brightness_high),u_saturation_factor:new a.aJ(j,u.u_saturation_factor),u_contrast_factor:new a.aJ(j,u.u_contrast_factor),u_spin_weights:new a.aO(j,u.u_spin_weights)}),symbolIcon:(j,u)=>({u_is_size_zoom_constant:new a.aI(j,u.u_is_size_zoom_constant),u_is_size_feature_constant:new a.aI(j,u.u_is_size_feature_constant),u_size_t:new a.aJ(j,u.u_size_t),u_size:new a.aJ(j,u.u_size),u_camera_to_center_distance:new a.aJ(j,u.u_camera_to_center_distance),u_pitch:new a.aJ(j,u.u_pitch),u_rotate_symbol:new a.aI(j,u.u_rotate_symbol),u_aspect_ratio:new a.aJ(j,u.u_aspect_ratio),u_fade_change:new a.aJ(j,u.u_fade_change),u_matrix:new a.aK(j,u.u_matrix),u_label_plane_matrix:new a.aK(j,u.u_label_plane_matrix),u_coord_matrix:new a.aK(j,u.u_coord_matrix),u_is_text:new a.aI(j,u.u_is_text),u_pitch_with_map:new a.aI(j,u.u_pitch_with_map),u_is_along_line:new a.aI(j,u.u_is_along_line),u_is_variable_anchor:new a.aI(j,u.u_is_variable_anchor),u_texsize:new a.aP(j,u.u_texsize),u_texture:new a.aI(j,u.u_texture),u_translation:new a.aP(j,u.u_translation),u_pitched_scale:new a.aJ(j,u.u_pitched_scale)}),symbolSDF:(j,u)=>({u_is_size_zoom_constant:new a.aI(j,u.u_is_size_zoom_constant),u_is_size_feature_constant:new a.aI(j,u.u_is_size_feature_constant),u_size_t:new a.aJ(j,u.u_size_t),u_size:new a.aJ(j,u.u_size),u_camera_to_center_distance:new a.aJ(j,u.u_camera_to_center_distance),u_pitch:new a.aJ(j,u.u_pitch),u_rotate_symbol:new a.aI(j,u.u_rotate_symbol),u_aspect_ratio:new a.aJ(j,u.u_aspect_ratio),u_fade_change:new a.aJ(j,u.u_fade_change),u_matrix:new a.aK(j,u.u_matrix),u_label_plane_matrix:new a.aK(j,u.u_label_plane_matrix),u_coord_matrix:new a.aK(j,u.u_coord_matrix),u_is_text:new a.aI(j,u.u_is_text),u_pitch_with_map:new a.aI(j,u.u_pitch_with_map),u_is_along_line:new a.aI(j,u.u_is_along_line),u_is_variable_anchor:new a.aI(j,u.u_is_variable_anchor),u_texsize:new a.aP(j,u.u_texsize),u_texture:new a.aI(j,u.u_texture),u_gamma_scale:new a.aJ(j,u.u_gamma_scale),u_device_pixel_ratio:new a.aJ(j,u.u_device_pixel_ratio),u_is_halo:new a.aI(j,u.u_is_halo),u_translation:new a.aP(j,u.u_translation),u_pitched_scale:new a.aJ(j,u.u_pitched_scale)}),symbolTextAndIcon:(j,u)=>({u_is_size_zoom_constant:new a.aI(j,u.u_is_size_zoom_constant),u_is_size_feature_constant:new a.aI(j,u.u_is_size_feature_constant),u_size_t:new a.aJ(j,u.u_size_t),u_size:new a.aJ(j,u.u_size),u_camera_to_center_distance:new a.aJ(j,u.u_camera_to_center_distance),u_pitch:new a.aJ(j,u.u_pitch),u_rotate_symbol:new a.aI(j,u.u_rotate_symbol),u_aspect_ratio:new a.aJ(j,u.u_aspect_ratio),u_fade_change:new a.aJ(j,u.u_fade_change),u_matrix:new a.aK(j,u.u_matrix),u_label_plane_matrix:new a.aK(j,u.u_label_plane_matrix),u_coord_matrix:new a.aK(j,u.u_coord_matrix),u_is_text:new a.aI(j,u.u_is_text),u_pitch_with_map:new a.aI(j,u.u_pitch_with_map),u_is_along_line:new a.aI(j,u.u_is_along_line),u_is_variable_anchor:new a.aI(j,u.u_is_variable_anchor),u_texsize:new a.aP(j,u.u_texsize),u_texsize_icon:new a.aP(j,u.u_texsize_icon),u_texture:new a.aI(j,u.u_texture),u_texture_icon:new a.aI(j,u.u_texture_icon),u_gamma_scale:new a.aJ(j,u.u_gamma_scale),u_device_pixel_ratio:new a.aJ(j,u.u_device_pixel_ratio),u_is_halo:new a.aI(j,u.u_is_halo),u_translation:new a.aP(j,u.u_translation),u_pitched_scale:new a.aJ(j,u.u_pitched_scale)}),background:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_opacity:new a.aJ(j,u.u_opacity),u_color:new a.aM(j,u.u_color)}),backgroundPattern:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_opacity:new a.aJ(j,u.u_opacity),u_image:new a.aI(j,u.u_image),u_pattern_tl_a:new a.aP(j,u.u_pattern_tl_a),u_pattern_br_a:new a.aP(j,u.u_pattern_br_a),u_pattern_tl_b:new a.aP(j,u.u_pattern_tl_b),u_pattern_br_b:new a.aP(j,u.u_pattern_br_b),u_texsize:new a.aP(j,u.u_texsize),u_mix:new a.aJ(j,u.u_mix),u_pattern_size_a:new a.aP(j,u.u_pattern_size_a),u_pattern_size_b:new a.aP(j,u.u_pattern_size_b),u_scale_a:new a.aJ(j,u.u_scale_a),u_scale_b:new a.aJ(j,u.u_scale_b),u_pixel_coord_upper:new a.aP(j,u.u_pixel_coord_upper),u_pixel_coord_lower:new a.aP(j,u.u_pixel_coord_lower),u_tile_units_to_pixels:new a.aJ(j,u.u_tile_units_to_pixels)}),terrain:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_texture:new a.aI(j,u.u_texture),u_ele_delta:new a.aJ(j,u.u_ele_delta),u_fog_matrix:new a.aK(j,u.u_fog_matrix),u_fog_color:new a.aM(j,u.u_fog_color),u_fog_ground_blend:new a.aJ(j,u.u_fog_ground_blend),u_fog_ground_blend_opacity:new a.aJ(j,u.u_fog_ground_blend_opacity),u_horizon_color:new a.aM(j,u.u_horizon_color),u_horizon_fog_blend:new a.aJ(j,u.u_horizon_fog_blend)}),terrainDepth:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_ele_delta:new a.aJ(j,u.u_ele_delta)}),terrainCoords:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_texture:new a.aI(j,u.u_texture),u_terrain_coords_id:new a.aJ(j,u.u_terrain_coords_id),u_ele_delta:new a.aJ(j,u.u_ele_delta)}),sky:(j,u)=>({u_sky_color:new a.aM(j,u.u_sky_color),u_horizon_color:new a.aM(j,u.u_horizon_color),u_horizon:new a.aJ(j,u.u_horizon),u_sky_horizon_blend:new a.aJ(j,u.u_sky_horizon_blend)})};class zn{constructor(u,m,F){this.context=u;const $=u.gl;this.buffer=$.createBuffer(),this.dynamicDraw=!!F,this.context.unbindVAO(),u.bindElementBuffer.set(this.buffer),$.bufferData($.ELEMENT_ARRAY_BUFFER,m.arrayBuffer,this.dynamicDraw?$.DYNAMIC_DRAW:$.STATIC_DRAW),this.dynamicDraw||delete m.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(u){const m=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),m.bufferSubData(m.ELEMENT_ARRAY_BUFFER,0,u.arrayBuffer)}destroy(){const u=this.context.gl;this.buffer&&(u.deleteBuffer(this.buffer),delete this.buffer)}}const Gn={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class ur{constructor(u,m,F,$){this.length=m.length,this.attributes=F,this.itemSize=m.bytesPerElement,this.dynamicDraw=$,this.context=u;const Z=u.gl;this.buffer=Z.createBuffer(),u.bindVertexBuffer.set(this.buffer),Z.bufferData(Z.ARRAY_BUFFER,m.arrayBuffer,this.dynamicDraw?Z.DYNAMIC_DRAW:Z.STATIC_DRAW),this.dynamicDraw||delete m.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(u){if(u.length!==this.length)throw new Error(`Length of new data is ${u.length}, which doesn't match current length of ${this.length}`);const m=this.context.gl;this.bind(),m.bufferSubData(m.ARRAY_BUFFER,0,u.arrayBuffer)}enableAttributes(u,m){for(let F=0;F<this.attributes.length;F++){const $=this.attributes[F],Z=m.attributes[$.name];Z!==void 0&&u.enableVertexAttribArray(Z)}}setVertexAttribPointers(u,m,F){for(let $=0;$<this.attributes.length;$++){const Z=this.attributes[$],ie=m.attributes[Z.name];ie!==void 0&&u.vertexAttribPointer(ie,Z.components,u[Gn[Z.type]],!1,this.itemSize,Z.offset+this.itemSize*(F||0))}}destroy(){const u=this.context.gl;this.buffer&&(u.deleteBuffer(this.buffer),delete this.buffer)}}const kr=new WeakMap;function vi(j){var u;if(kr.has(j))return kr.get(j);{const m=(u=j.getParameter(j.VERSION))===null||u===void 0?void 0:u.startsWith("WebGL 2.0");return kr.set(j,m),m}}class xr{constructor(u){this.gl=u.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(u){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class co extends xr{getDefault(){return a.aN.transparent}set(u){const m=this.current;(u.r!==m.r||u.g!==m.g||u.b!==m.b||u.a!==m.a||this.dirty)&&(this.gl.clearColor(u.r,u.g,u.b,u.a),this.current=u,this.dirty=!1)}}class Ti extends xr{getDefault(){return 1}set(u){(u!==this.current||this.dirty)&&(this.gl.clearDepth(u),this.current=u,this.dirty=!1)}}class qi extends xr{getDefault(){return 0}set(u){(u!==this.current||this.dirty)&&(this.gl.clearStencil(u),this.current=u,this.dirty=!1)}}class jo extends xr{getDefault(){return[!0,!0,!0,!0]}set(u){const m=this.current;(u[0]!==m[0]||u[1]!==m[1]||u[2]!==m[2]||u[3]!==m[3]||this.dirty)&&(this.gl.colorMask(u[0],u[1],u[2],u[3]),this.current=u,this.dirty=!1)}}class oi extends xr{getDefault(){return!0}set(u){(u!==this.current||this.dirty)&&(this.gl.depthMask(u),this.current=u,this.dirty=!1)}}class ui extends xr{getDefault(){return 255}set(u){(u!==this.current||this.dirty)&&(this.gl.stencilMask(u),this.current=u,this.dirty=!1)}}class es extends xr{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(u){const m=this.current;(u.func!==m.func||u.ref!==m.ref||u.mask!==m.mask||this.dirty)&&(this.gl.stencilFunc(u.func,u.ref,u.mask),this.current=u,this.dirty=!1)}}class yo extends xr{getDefault(){const u=this.gl;return[u.KEEP,u.KEEP,u.KEEP]}set(u){const m=this.current;(u[0]!==m[0]||u[1]!==m[1]||u[2]!==m[2]||this.dirty)&&(this.gl.stencilOp(u[0],u[1],u[2]),this.current=u,this.dirty=!1)}}class Uo extends xr{getDefault(){return!1}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;u?m.enable(m.STENCIL_TEST):m.disable(m.STENCIL_TEST),this.current=u,this.dirty=!1}}class cs extends xr{getDefault(){return[0,1]}set(u){const m=this.current;(u[0]!==m[0]||u[1]!==m[1]||this.dirty)&&(this.gl.depthRange(u[0],u[1]),this.current=u,this.dirty=!1)}}class Po extends xr{getDefault(){return!1}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;u?m.enable(m.DEPTH_TEST):m.disable(m.DEPTH_TEST),this.current=u,this.dirty=!1}}class Cl extends xr{getDefault(){return this.gl.LESS}set(u){(u!==this.current||this.dirty)&&(this.gl.depthFunc(u),this.current=u,this.dirty=!1)}}class Tl extends xr{getDefault(){return!1}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;u?m.enable(m.BLEND):m.disable(m.BLEND),this.current=u,this.dirty=!1}}class Al extends xr{getDefault(){const u=this.gl;return[u.ONE,u.ZERO]}set(u){const m=this.current;(u[0]!==m[0]||u[1]!==m[1]||this.dirty)&&(this.gl.blendFunc(u[0],u[1]),this.current=u,this.dirty=!1)}}class $o extends xr{getDefault(){return a.aN.transparent}set(u){const m=this.current;(u.r!==m.r||u.g!==m.g||u.b!==m.b||u.a!==m.a||this.dirty)&&(this.gl.blendColor(u.r,u.g,u.b,u.a),this.current=u,this.dirty=!1)}}class Xs extends xr{getDefault(){return this.gl.FUNC_ADD}set(u){(u!==this.current||this.dirty)&&(this.gl.blendEquation(u),this.current=u,this.dirty=!1)}}class vs extends xr{getDefault(){return!1}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;u?m.enable(m.CULL_FACE):m.disable(m.CULL_FACE),this.current=u,this.dirty=!1}}class Ai extends xr{getDefault(){return this.gl.BACK}set(u){(u!==this.current||this.dirty)&&(this.gl.cullFace(u),this.current=u,this.dirty=!1)}}class Qi extends xr{getDefault(){return this.gl.CCW}set(u){(u!==this.current||this.dirty)&&(this.gl.frontFace(u),this.current=u,this.dirty=!1)}}class El extends xr{getDefault(){return null}set(u){(u!==this.current||this.dirty)&&(this.gl.useProgram(u),this.current=u,this.dirty=!1)}}class Js extends xr{getDefault(){return this.gl.TEXTURE0}set(u){(u!==this.current||this.dirty)&&(this.gl.activeTexture(u),this.current=u,this.dirty=!1)}}class Ns extends xr{getDefault(){const u=this.gl;return[0,0,u.drawingBufferWidth,u.drawingBufferHeight]}set(u){const m=this.current;(u[0]!==m[0]||u[1]!==m[1]||u[2]!==m[2]||u[3]!==m[3]||this.dirty)&&(this.gl.viewport(u[0],u[1],u[2],u[3]),this.current=u,this.dirty=!1)}}class Ml extends xr{getDefault(){return null}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;m.bindFramebuffer(m.FRAMEBUFFER,u),this.current=u,this.dirty=!1}}class Fs extends xr{getDefault(){return null}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;m.bindRenderbuffer(m.RENDERBUFFER,u),this.current=u,this.dirty=!1}}class Il extends xr{getDefault(){return null}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;m.bindTexture(m.TEXTURE_2D,u),this.current=u,this.dirty=!1}}class Bl extends xr{getDefault(){return null}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;m.bindBuffer(m.ARRAY_BUFFER,u),this.current=u,this.dirty=!1}}class Ks extends xr{getDefault(){return null}set(u){const m=this.gl;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,u),this.current=u,this.dirty=!1}}class To extends xr{getDefault(){return null}set(u){var m;if(u===this.current&&!this.dirty)return;const F=this.gl;vi(F)?F.bindVertexArray(u):(m=F.getExtension("OES_vertex_array_object"))===null||m===void 0||m.bindVertexArrayOES(u),this.current=u,this.dirty=!1}}class Jc extends xr{getDefault(){return 4}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;m.pixelStorei(m.UNPACK_ALIGNMENT,u),this.current=u,this.dirty=!1}}class Dc extends xr{getDefault(){return!1}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),this.current=u,this.dirty=!1}}class Hl extends xr{getDefault(){return!1}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,u),this.current=u,this.dirty=!1}}class Kc extends xr{constructor(u,m){super(u),this.context=u,this.parent=m}getDefault(){return null}}class su extends Kc{setDirty(){this.dirty=!0}set(u){if(u===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const m=this.gl;m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.TEXTURE_2D,u,0),this.current=u,this.dirty=!1}}class _s extends Kc{set(u){if(u===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const m=this.gl;m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,u),this.current=u,this.dirty=!1}}class lu extends Kc{set(u){if(u===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const m=this.gl;m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,u),this.current=u,this.dirty=!1}}class Du{constructor(u,m,F,$,Z){this.context=u,this.width=m,this.height=F;const ie=u.gl,he=this.framebuffer=ie.createFramebuffer();if(this.colorAttachment=new su(u,he),$)this.depthAttachment=Z?new lu(u,he):new _s(u,he);else if(Z)throw new Error("Stencil cannot be set without depth");if(ie.checkFramebufferStatus(ie.FRAMEBUFFER)!==ie.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const u=this.context.gl,m=this.colorAttachment.get();if(m&&u.deleteTexture(m),this.depthAttachment){const F=this.depthAttachment.get();F&&u.deleteRenderbuffer(F)}u.deleteFramebuffer(this.framebuffer)}}class to{constructor(u,m,F){this.blendFunction=u,this.blendColor=m,this.mask=F}}to.Replace=[1,0],to.disabled=new to(to.Replace,a.aN.transparent,[!1,!1,!1,!1]),to.unblended=new to(to.Replace,a.aN.transparent,[!0,!0,!0,!0]),to.alphaBlended=new to([1,771],a.aN.transparent,[!0,!0,!0,!0]);class xc{constructor(u){var m,F;if(this.gl=u,this.clearColor=new co(this),this.clearDepth=new Ti(this),this.clearStencil=new qi(this),this.colorMask=new jo(this),this.depthMask=new oi(this),this.stencilMask=new ui(this),this.stencilFunc=new es(this),this.stencilOp=new yo(this),this.stencilTest=new Uo(this),this.depthRange=new cs(this),this.depthTest=new Po(this),this.depthFunc=new Cl(this),this.blend=new Tl(this),this.blendFunc=new Al(this),this.blendColor=new $o(this),this.blendEquation=new Xs(this),this.cullFace=new vs(this),this.cullFaceSide=new Ai(this),this.frontFace=new Qi(this),this.program=new El(this),this.activeTexture=new Js(this),this.viewport=new Ns(this),this.bindFramebuffer=new Ml(this),this.bindRenderbuffer=new Fs(this),this.bindTexture=new Il(this),this.bindVertexBuffer=new Bl(this),this.bindElementBuffer=new Ks(this),this.bindVertexArray=new To(this),this.pixelStoreUnpack=new Jc(this),this.pixelStoreUnpackPremultiplyAlpha=new Dc(this),this.pixelStoreUnpackFlipY=new Hl(this),this.extTextureFilterAnisotropic=u.getExtension("EXT_texture_filter_anisotropic")||u.getExtension("MOZ_EXT_texture_filter_anisotropic")||u.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=u.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),vi(u)){this.HALF_FLOAT=u.HALF_FLOAT;const $=u.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(m=u.RGBA16F)!==null&&m!==void 0?m:$==null?void 0:$.RGBA16F_EXT,this.RGB16F=(F=u.RGB16F)!==null&&F!==void 0?F:$==null?void 0:$.RGB16F_EXT,u.getExtension("EXT_color_buffer_float")}else{u.getExtension("EXT_color_buffer_half_float"),u.getExtension("OES_texture_half_float_linear");const $=u.getExtension("OES_texture_half_float");this.HALF_FLOAT=$==null?void 0:$.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(u,m){return new zn(this,u,m)}createVertexBuffer(u,m,F){return new ur(this,u,m,F)}createRenderbuffer(u,m,F){const $=this.gl,Z=$.createRenderbuffer();return this.bindRenderbuffer.set(Z),$.renderbufferStorage($.RENDERBUFFER,u,m,F),this.bindRenderbuffer.set(null),Z}createFramebuffer(u,m,F,$){return new Du(this,u,m,F,$)}clear({color:u,depth:m,stencil:F}){const $=this.gl;let Z=0;u&&(Z|=$.COLOR_BUFFER_BIT,this.clearColor.set(u),this.colorMask.set([!0,!0,!0,!0])),m!==void 0&&(Z|=$.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(m),this.depthMask.set(!0)),F!==void 0&&(Z|=$.STENCIL_BUFFER_BIT,this.clearStencil.set(F),this.stencilMask.set(255)),$.clear(Z)}setCullFace(u){u.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(u.mode),this.frontFace.set(u.frontFace))}setDepthMode(u){u.func!==this.gl.ALWAYS||u.mask?(this.depthTest.set(!0),this.depthFunc.set(u.func),this.depthMask.set(u.mask),this.depthRange.set(u.range)):this.depthTest.set(!1)}setStencilMode(u){u.test.func!==this.gl.ALWAYS||u.mask?(this.stencilTest.set(!0),this.stencilMask.set(u.mask),this.stencilOp.set([u.fail,u.depthFail,u.pass]),this.stencilFunc.set({func:u.test.func,ref:u.ref,mask:u.test.mask})):this.stencilTest.set(!1)}setColorMode(u){a.aF(u.blendFunction,to.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(u.blendFunction),this.blendColor.set(u.blendColor)),this.colorMask.set(u.mask)}createVertexArray(){var u;return vi(this.gl)?this.gl.createVertexArray():(u=this.gl.getExtension("OES_vertex_array_object"))===null||u===void 0?void 0:u.createVertexArrayOES()}deleteVertexArray(u){var m;return vi(this.gl)?this.gl.deleteVertexArray(u):(m=this.gl.getExtension("OES_vertex_array_object"))===null||m===void 0?void 0:m.deleteVertexArrayOES(u)}unbindVAO(){this.bindVertexArray.set(null)}}class Gr{constructor(u,m,F){this.func=u,this.mask=m,this.range=F}}Gr.ReadOnly=!1,Gr.ReadWrite=!0,Gr.disabled=new Gr(519,Gr.ReadOnly,[0,1]);const Gl=7680;class ki{constructor(u,m,F,$,Z,ie){this.test=u,this.ref=m,this.mask=F,this.fail=$,this.depthFail=Z,this.pass=ie}}ki.disabled=new ki({func:519,mask:0},0,0,Gl,Gl,Gl);class Si{constructor(u,m,F){this.enable=u,this.mode=m,this.frontFace=F}}let bs;function ts(j,u,m,F,$){const Z=j.context,ie=Z.gl,he=j.useProgram("collisionBox"),be=[];let Ce=0,ze=0;for(let Et=0;Et<F.length;Et++){const Ct=F[Et],Rt=u.getTile(Ct).getBucket(m);if(!Rt)continue;const At=$?Rt.textCollisionBox:Rt.iconCollisionBox,Zt=Rt.collisionCircleArray;if(Zt.length>0){const Kt=a.H();a.aR(Kt,Rt.placementInvProjMatrix,j.transform.glCoordMatrix),a.aR(Kt,Kt,Rt.placementViewportMatrix),be.push({circleArray:Zt,circleOffset:ze,transform:Ct.posMatrix,invTransform:Kt,coord:Ct}),Ce+=Zt.length/4,ze=Ce}At&&he.draw(Z,ie.LINES,Gr.disabled,ki.disabled,j.colorModeForRenderPass(),Si.disabled,ta(j.transform,Ct.posMatrix),j.style.map.terrain&&j.style.map.terrain.getTerrainData(Ct),m.id,At.layoutVertexBuffer,At.indexBuffer,At.segments,null,j.transform.zoom,null,null,At.collisionVertexBuffer)}if(!$||!be.length)return;const $e=j.useProgram("collisionCircle"),nt=new a.aS;nt.resize(4*Ce),nt._trim();let ct=0;for(const Et of be)for(let Ct=0;Ct<Et.circleArray.length/4;Ct++){const Rt=4*Ct,At=Et.circleArray[Rt+0],Zt=Et.circleArray[Rt+1],Kt=Et.circleArray[Rt+2],Yt=Et.circleArray[Rt+3];nt.emplace(ct++,At,Zt,Kt,Yt,0),nt.emplace(ct++,At,Zt,Kt,Yt,1),nt.emplace(ct++,At,Zt,Kt,Yt,2),nt.emplace(ct++,At,Zt,Kt,Yt,3)}(!bs||bs.length<2*Ce)&&(bs=function(Et){const Ct=2*Et,Rt=new a.aU;Rt.resize(Ct),Rt._trim();for(let At=0;At<Ct;At++){const Zt=6*At;Rt.uint16[Zt+0]=4*At+0,Rt.uint16[Zt+1]=4*At+1,Rt.uint16[Zt+2]=4*At+2,Rt.uint16[Zt+3]=4*At+2,Rt.uint16[Zt+4]=4*At+3,Rt.uint16[Zt+5]=4*At+0}return Rt}(Ce));const pt=Z.createIndexBuffer(bs,!0),xt=Z.createVertexBuffer(nt,a.aT.members,!0);for(const Et of be){const Ct=ca(Et.transform,Et.invTransform,j.transform);$e.draw(Z,ie.TRIANGLES,Gr.disabled,ki.disabled,j.colorModeForRenderPass(),Si.disabled,Ct,j.style.map.terrain&&j.style.map.terrain.getTerrainData(Et.coord),m.id,xt,pt,a.a0.simpleSegment(0,2*Et.circleOffset,Et.circleArray.length,Et.circleArray.length/2),null,j.transform.zoom,null,null,null)}xt.destroy(),pt.destroy()}Si.disabled=new Si(!1,1029,2305),Si.backCCW=new Si(!0,1029,2305);const wc=a.ao(new Float32Array(16));function Pl(j,u,m,F,$){if(j.renderPass!=="translucent")return;const Z=ki.disabled,ie=j.colorModeForRenderPass();(m._unevaluatedLayout.hasValue("text-variable-anchor")||m._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(he,be,Ce,ze,$e,nt,ct,pt,xt){const Et=be.transform,Ct=Ba(),Rt=$e==="map",At=nt==="map";for(const Zt of he){const Kt=ze.getTile(Zt),Yt=Kt.getBucket(Ce);if(!Yt||!Yt.text||!Yt.text.segments.get().length)continue;const da=Yt.textSizeData,ba=a.ah(da,Et.zoom),Na=St(Kt,1,be.transform.zoom),Fa=Vt(Zt.posMatrix,At,Rt,be.transform,Na),Ua=Ce.layout.get("icon-text-fit")!=="none"&&Yt.hasIconData();if(ba){const Ja=Math.pow(2,Et.zoom-Kt.tileID.overscaledZ),yn=be.style.map.terrain?(wn,rn)=>be.style.map.terrain.getElevation(Zt,wn,rn):null,Qa=Ct.translatePosition(Et,Kt,ct,pt);vo(Yt,Rt,At,xt,Et,Fa,Zt.posMatrix,Ja,ba,Ua,Ct,Qa,Zt.toUnwrapped(),yn)}}}(F,j,m,u,m.layout.get("text-rotation-alignment"),m.layout.get("text-pitch-alignment"),m.paint.get("text-translate"),m.paint.get("text-translate-anchor"),$),m.paint.get("icon-opacity").constantOr(1)!==0&&ic(j,u,m,F,!1,m.paint.get("icon-translate"),m.paint.get("icon-translate-anchor"),m.layout.get("icon-rotation-alignment"),m.layout.get("icon-pitch-alignment"),m.layout.get("icon-keep-upright"),Z,ie),m.paint.get("text-opacity").constantOr(1)!==0&&ic(j,u,m,F,!0,m.paint.get("text-translate"),m.paint.get("text-translate-anchor"),m.layout.get("text-rotation-alignment"),m.layout.get("text-pitch-alignment"),m.layout.get("text-keep-upright"),Z,ie),u.map.showCollisionBoxes&&(ts(j,u,m,F,!0),ts(j,u,m,F,!1))}function as(j,u,m,F,$,Z){const{horizontalAlign:ie,verticalAlign:he}=a.av(j),be=-(ie-.5)*u,Ce=-(he-.5)*m;return new a.P((be/$+F[0])*Z,(Ce/$+F[1])*Z)}function us(j,u,m,F,$,Z){const ie=u.tileAnchorPoint.add(new a.P(u.translation[0],u.translation[1]));if(u.pitchWithMap){let he=F.mult(Z);return m||(he=he.rotate(-$)),Ut(ie.add(he),u.labelPlaneMatrix,u.getElevation).point}if(m){const he=Ze(u.tileAnchorPoint.x+1,u.tileAnchorPoint.y,u).point.sub(j),be=Math.atan(he.y/he.x)+(he.x<0?Math.PI:0);return j.add(F.rotate(be))}return j.add(F)}function vo(j,u,m,F,$,Z,ie,he,be,Ce,ze,$e,nt,ct){const pt=j.text.placedSymbolArray,xt=j.text.dynamicLayoutVertexArray,Et=j.icon.dynamicLayoutVertexArray,Ct={};xt.clear();for(let Rt=0;Rt<pt.length;Rt++){const At=pt.get(Rt),Zt=j.allowVerticalPlacement&&!At.placedOrientation,Kt=At.hidden||!At.crossTileID||Zt?null:F[At.crossTileID];if(Kt){const Yt=new a.P(At.anchorX,At.anchorY),da={getElevation:ct,width:$.width,height:$.height,labelPlaneMatrix:Z,lineVertexArray:null,pitchWithMap:m,projection:ze,projectionCache:null,tileAnchorPoint:Yt,translation:$e,unwrappedTileID:nt},ba=m?Ut(Yt,ie,ct):Ze(Yt.x,Yt.y,da),Na=ot($.cameraToCenterDistance,ba.signedDistanceFromCamera);let Fa=a.aj(j.textSizeData,be,At)*Na/a.aq;m&&(Fa*=j.tilePixelRatio/he);const{width:Ua,height:Ja,anchor:yn,textOffset:Qa,textBoxScale:wn}=Kt,rn=as(yn,Ua,Ja,Qa,wn,Fa),Cn=ze.getPitchedTextCorrection($,Yt.add(new a.P($e[0],$e[1])),nt),fn=us(ba.point,da,u,rn,$.angle,Cn),In=j.allowVerticalPlacement&&At.placedOrientation===a.ai.vertical?Math.PI/2:0;for(let Wn=0;Wn<At.numGlyphs;Wn++)a.ak(xt,fn,In);Ce&&At.associatedIconIndex>=0&&(Ct[At.associatedIconIndex]={shiftedAnchor:fn,angle:In})}else Dt(At.numGlyphs,xt)}if(Ce){Et.clear();const Rt=j.icon.placedSymbolArray;for(let At=0;At<Rt.length;At++){const Zt=Rt.get(At);if(Zt.hidden)Dt(Zt.numGlyphs,Et);else{const Kt=Ct[At];if(Kt)for(let Yt=0;Yt<Zt.numGlyphs;Yt++)a.ak(Et,Kt.shiftedAnchor,Kt.angle);else Dt(Zt.numGlyphs,Et)}}j.icon.dynamicLayoutVertexBuffer.updateData(Et)}j.text.dynamicLayoutVertexBuffer.updateData(xt)}function ni(j,u,m){return m.iconsInText&&u?"symbolTextAndIcon":j?"symbolSDF":"symbolIcon"}function ic(j,u,m,F,$,Z,ie,he,be,Ce,ze,$e){const nt=j.context,ct=nt.gl,pt=j.transform,xt=Ba(),Et=he==="map",Ct=be==="map",Rt=he!=="viewport"&&m.layout.get("symbol-placement")!=="point",At=Et&&!Ct&&!Rt,Zt=!Ct&&Rt,Kt=!m.layout.get("symbol-sort-key").isConstant();let Yt=!1;const da=j.depthModeForSublayer(0,Gr.ReadOnly),ba=m._unevaluatedLayout.hasValue("text-variable-anchor")||m._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Na=[],Fa=xt.getCircleRadiusCorrection(pt);for(const Ua of F){const Ja=u.getTile(Ua),yn=Ja.getBucket(m);if(!yn)continue;const Qa=$?yn.text:yn.icon;if(!Qa||!Qa.segments.get().length||!Qa.hasVisibleVertices)continue;const wn=Qa.programConfigurations.get(m.id),rn=$||yn.sdfIcons,Cn=$?yn.textSizeData:yn.iconSizeData,fn=Ct||pt.pitch!==0,In=j.useProgram(ni(rn,$,yn),wn),Wn=a.ah(Cn,pt.zoom),Mn=j.style.map.terrain&&j.style.map.terrain.getTerrainData(Ua);let Hn,ar,Cr,yr,jr=[0,0],Rr=null;if($){if(ar=Ja.glyphAtlasTexture,Cr=ct.LINEAR,Hn=Ja.glyphAtlasTexture.size,yn.iconsInText){jr=Ja.imageAtlasTexture.size,Rr=Ja.imageAtlasTexture;const Tr=Cn.kind==="composite"||Cn.kind==="camera";yr=fn||j.options.rotating||j.options.zooming||Tr?ct.LINEAR:ct.NEAREST}}else{const Tr=m.layout.get("icon-size").constantOr(0)!==1||yn.iconsNeedLinear;ar=Ja.imageAtlasTexture,Cr=rn||j.options.rotating||j.options.zooming||Tr||fn?ct.LINEAR:ct.NEAREST,Hn=Ja.imageAtlasTexture.size}const qr=St(Ja,1,j.transform.zoom),ci=Zt?Ua.posMatrix:wc,$i=Vt(ci,Ct,Et,j.transform,qr),Ni=$t(ci,Ct,Et,j.transform,qr),io=$t(Ua.posMatrix,Ct,Et,j.transform,qr),hi=xt.translatePosition(j.transform,Ja,Z,ie),ei=ba&&yn.hasTextData(),Ii=m.layout.get("icon-text-fit")!=="none"&&ei&&yn.hasIconData();if(Rt){const Tr=j.style.map.terrain?(Ki,ps)=>j.style.map.terrain.getElevation(Ua,Ki,ps):null,wo=m.layout.get("text-rotation-alignment")==="map";ht(yn,Ua.posMatrix,j,$,$i,io,Ct,Ce,wo,xt,Ua.toUnwrapped(),pt.width,pt.height,hi,Tr)}const gi=Ua.posMatrix,ii=$&&ba||Ii,pi=Rt||ii?wc:$i,wi=Ni,ti=rn&&m.paint.get($?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Bs;Bs=rn?yn.iconsInText?Tn(Cn.kind,Wn,At,Ct,Rt,ii,j,gi,pi,wi,hi,Hn,jr,Fa):xn(Cn.kind,Wn,At,Ct,Rt,ii,j,gi,pi,wi,hi,$,Hn,!0,Fa):Pn(Cn.kind,Wn,At,Ct,Rt,ii,j,gi,pi,wi,hi,$,Hn,Fa);const Wi={program:In,buffers:Qa,uniformValues:Bs,atlasTexture:ar,atlasTextureIcon:Rr,atlasInterpolation:Cr,atlasInterpolationIcon:yr,isSDF:rn,hasHalo:ti};if(Kt&&yn.canOverlap){Yt=!0;const Tr=Qa.segments.get();for(const wo of Tr)Na.push({segments:new a.a0([wo]),sortKey:wo.sortKey,state:Wi,terrainData:Mn})}else Na.push({segments:Qa.segments,sortKey:0,state:Wi,terrainData:Mn})}Yt&&Na.sort((Ua,Ja)=>Ua.sortKey-Ja.sortKey);for(const Ua of Na){const Ja=Ua.state;if(nt.activeTexture.set(ct.TEXTURE0),Ja.atlasTexture.bind(Ja.atlasInterpolation,ct.CLAMP_TO_EDGE),Ja.atlasTextureIcon&&(nt.activeTexture.set(ct.TEXTURE1),Ja.atlasTextureIcon&&Ja.atlasTextureIcon.bind(Ja.atlasInterpolationIcon,ct.CLAMP_TO_EDGE)),Ja.isSDF){const yn=Ja.uniformValues;Ja.hasHalo&&(yn.u_is_halo=1,cu(Ja.buffers,Ua.segments,m,j,Ja.program,da,ze,$e,yn,Ua.terrainData)),yn.u_is_halo=0}cu(Ja.buffers,Ua.segments,m,j,Ja.program,da,ze,$e,Ja.uniformValues,Ua.terrainData)}}function cu(j,u,m,F,$,Z,ie,he,be,Ce){const ze=F.context,$e=ze.gl;$.draw(ze,$e.TRIANGLES,Z,ie,he,Si.disabled,be,Ce,m.id,j.layoutVertexBuffer,j.indexBuffer,u,m.paint,F.transform.zoom,j.programConfigurations.get(m.id),j.dynamicLayoutVertexBuffer,j.opacityVertexBuffer)}function Ol(j,u,m,F){if(m.paint.get("heatmap-opacity")!==0)if(j.renderPass==="offscreen"){const $=j.context,Z=$.gl,ie=ki.disabled,he=new to([Z.ONE,Z.ONE],a.aN.transparent,[!0,!0,!0,!0]);(function(be,Ce,ze){const $e=be.gl;be.activeTexture.set($e.TEXTURE1),be.viewport.set([0,0,Ce.width/4,Ce.height/4]);let nt=ze.heatmapFbo;if(nt)$e.bindTexture($e.TEXTURE_2D,nt.colorAttachment.get()),be.bindFramebuffer.set(nt.framebuffer);else{const ct=$e.createTexture();$e.bindTexture($e.TEXTURE_2D,ct),$e.texParameteri($e.TEXTURE_2D,$e.TEXTURE_WRAP_S,$e.CLAMP_TO_EDGE),$e.texParameteri($e.TEXTURE_2D,$e.TEXTURE_WRAP_T,$e.CLAMP_TO_EDGE),$e.texParameteri($e.TEXTURE_2D,$e.TEXTURE_MIN_FILTER,$e.LINEAR),$e.texParameteri($e.TEXTURE_2D,$e.TEXTURE_MAG_FILTER,$e.LINEAR),nt=ze.heatmapFbo=be.createFramebuffer(Ce.width/4,Ce.height/4,!1,!1),function(pt,xt,Et,Ct){var Rt,At;const Zt=pt.gl,Kt=(Rt=pt.HALF_FLOAT)!==null&&Rt!==void 0?Rt:Zt.UNSIGNED_BYTE,Yt=(At=pt.RGBA16F)!==null&&At!==void 0?At:Zt.RGBA;Zt.texImage2D(Zt.TEXTURE_2D,0,Yt,xt.width/4,xt.height/4,0,Zt.RGBA,Kt,null),Ct.colorAttachment.set(Et)}(be,Ce,ct,nt)}})($,j,m),$.clear({color:a.aN.transparent});for(let be=0;be<F.length;be++){const Ce=F[be];if(u.hasRenderableParent(Ce))continue;const ze=u.getTile(Ce),$e=ze.getBucket(m);if(!$e)continue;const nt=$e.programConfigurations.get(m.id),ct=j.useProgram("heatmap",nt),{zoom:pt}=j.transform;ct.draw($,Z.TRIANGLES,Gr.disabled,ie,he,Si.disabled,La(Ce.posMatrix,ze,pt,m.paint.get("heatmap-intensity")),null,m.id,$e.layoutVertexBuffer,$e.indexBuffer,$e.segments,m.paint,j.transform.zoom,nt)}$.viewport.set([0,0,j.width,j.height])}else j.renderPass==="translucent"&&(j.context.setColorMode(j.colorModeForRenderPass()),function($,Z){const ie=$.context,he=ie.gl,be=Z.heatmapFbo;if(!be)return;ie.activeTexture.set(he.TEXTURE0),he.bindTexture(he.TEXTURE_2D,be.colorAttachment.get()),ie.activeTexture.set(he.TEXTURE1);let Ce=Z.colorRampTexture;Ce||(Ce=Z.colorRampTexture=new L(ie,Z.colorRamp,he.RGBA)),Ce.bind(he.LINEAR,he.CLAMP_TO_EDGE),$.useProgram("heatmapTexture").draw(ie,he.TRIANGLES,Gr.disabled,ki.disabled,$.colorModeForRenderPass(),Si.disabled,Wa($,Z,0,1),null,Z.id,$.viewportBuffer,$.quadTriangleIndexBuffer,$.viewportSegments,Z.paint,$.transform.zoom)}(j,m))}function Ll(j,u,m,F,$){if(!m||!F||!F.imageAtlas)return;const Z=F.imageAtlas.patternPositions;let ie=Z[m.to.toString()],he=Z[m.from.toString()];if(!ie&&he&&(ie=he),!he&&ie&&(he=ie),!ie||!he){const be=$.getPaintProperty(u);ie=Z[be],he=Z[be]}ie&&he&&j.setConstantPatternPositions(ie,he)}function Rc(j,u,m,F,$,Z,ie){const he=j.context.gl,be="fill-pattern",Ce=m.paint.get(be),ze=Ce&&Ce.constantOr(1),$e=m.getCrossfadeParameters();let nt,ct,pt,xt,Et;ie?(ct=ze&&!m.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",nt=he.LINES):(ct=ze?"fillPattern":"fill",nt=he.TRIANGLES);const Ct=Ce.constantOr(null);for(const Rt of F){const At=u.getTile(Rt);if(ze&&!At.patternsLoaded())continue;const Zt=At.getBucket(m);if(!Zt)continue;const Kt=Zt.programConfigurations.get(m.id),Yt=j.useProgram(ct,Kt),da=j.style.map.terrain&&j.style.map.terrain.getTerrainData(Rt);ze&&(j.context.activeTexture.set(he.TEXTURE0),At.imageAtlasTexture.bind(he.LINEAR,he.CLAMP_TO_EDGE),Kt.updatePaintBuffers($e)),Ll(Kt,be,Ct,At,m);const ba=da?Rt:null,Na=ba?ba.posMatrix:Rt.posMatrix,Fa=j.translatePosMatrix(Na,At,m.paint.get("fill-translate"),m.paint.get("fill-translate-anchor"));if(ie){xt=Zt.indexBuffer2,Et=Zt.segments2;const Ua=[he.drawingBufferWidth,he.drawingBufferHeight];pt=ct==="fillOutlinePattern"&&ze?ma(Fa,j,$e,At,Ua):Un(Fa,Ua)}else xt=Zt.indexBuffer,Et=Zt.segments,pt=ze?Ln(Fa,j,$e,At):gn(Fa);Yt.draw(j.context,nt,$,j.stencilModeForClipping(Rt),Z,Si.disabled,pt,da,m.id,Zt.layoutVertexBuffer,xt,Et,m.paint,j.transform.zoom,Kt)}}function kc(j,u,m,F,$,Z,ie){const he=j.context,be=he.gl,Ce="fill-extrusion-pattern",ze=m.paint.get(Ce),$e=ze.constantOr(1),nt=m.getCrossfadeParameters(),ct=m.paint.get("fill-extrusion-opacity"),pt=ze.constantOr(null);for(const xt of F){const Et=u.getTile(xt),Ct=Et.getBucket(m);if(!Ct)continue;const Rt=j.style.map.terrain&&j.style.map.terrain.getTerrainData(xt),At=Ct.programConfigurations.get(m.id),Zt=j.useProgram($e?"fillExtrusionPattern":"fillExtrusion",At);$e&&(j.context.activeTexture.set(be.TEXTURE0),Et.imageAtlasTexture.bind(be.LINEAR,be.CLAMP_TO_EDGE),At.updatePaintBuffers(nt)),Ll(At,Ce,pt,Et,m);const Kt=j.translatePosMatrix(xt.posMatrix,Et,m.paint.get("fill-extrusion-translate"),m.paint.get("fill-extrusion-translate-anchor")),Yt=m.paint.get("fill-extrusion-vertical-gradient"),da=$e?_n(Kt,j,Yt,ct,xt,nt,Et):an(Kt,j,Yt,ct);Zt.draw(he,he.gl.TRIANGLES,$,Z,ie,Si.backCCW,da,Rt,m.id,Ct.layoutVertexBuffer,Ct.indexBuffer,Ct.segments,m.paint,j.transform.zoom,At,j.style.map.terrain&&Ct.centroidVertexBuffer)}}function Sc(j,u,m,F,$,Z,ie){const he=j.context,be=he.gl,Ce=m.fbo;if(!Ce)return;const ze=j.useProgram("hillshade"),$e=j.style.map.terrain&&j.style.map.terrain.getTerrainData(u);he.activeTexture.set(be.TEXTURE0),be.bindTexture(be.TEXTURE_2D,Ce.colorAttachment.get());const nt=$e?u:null;ze.draw(he,be.TRIANGLES,$,Z,ie,Si.disabled,Ra(j,m,F,nt),$e,F.id,j.rasterBoundsBuffer,j.quadTriangleIndexBuffer,j.rasterBoundsSegments)}function bu(j,u,m,F,$,Z){const ie=j.context,he=ie.gl,be=u.dem;if(be&&be.data){const Ce=be.dim,ze=be.stride,$e=be.getPixels();if(ie.activeTexture.set(he.TEXTURE1),ie.pixelStoreUnpackPremultiplyAlpha.set(!1),u.demTexture=u.demTexture||j.getTileTexture(ze),u.demTexture){const ct=u.demTexture;ct.update($e,{premultiply:!1}),ct.bind(he.NEAREST,he.CLAMP_TO_EDGE)}else u.demTexture=new L(ie,$e,he.RGBA,{premultiply:!1}),u.demTexture.bind(he.NEAREST,he.CLAMP_TO_EDGE);ie.activeTexture.set(he.TEXTURE0);let nt=u.fbo;if(!nt){const ct=new L(ie,{width:Ce,height:Ce,data:null},he.RGBA);ct.bind(he.LINEAR,he.CLAMP_TO_EDGE),nt=u.fbo=ie.createFramebuffer(Ce,Ce,!0,!1),nt.colorAttachment.set(ct.texture)}ie.bindFramebuffer.set(nt.framebuffer),ie.viewport.set([0,0,Ce,Ce]),j.useProgram("hillshadePrepare").draw(ie,he.TRIANGLES,F,$,Z,Si.disabled,Ia(u.tileID,be),null,m.id,j.rasterBoundsBuffer,j.quadTriangleIndexBuffer,j.rasterBoundsSegments),u.needsHillshadePrepare=!1}}function xs(j,u,m,F,$,Z){const ie=F.paint.get("raster-fade-duration");if(!Z&&ie>0){const he=c.now(),be=(he-j.timeAdded)/ie,Ce=u?(he-u.timeAdded)/ie:-1,ze=m.getSource(),$e=$.coveringZoomLevel({tileSize:ze.tileSize,roundZoom:ze.roundZoom}),nt=!u||Math.abs(u.tileID.overscaledZ-$e)>Math.abs(j.tileID.overscaledZ-$e),ct=nt&&j.refreshedUponExpiration?1:a.ad(nt?be:1-Ce,0,1);return j.refreshedUponExpiration&&be>=1&&(j.refreshedUponExpiration=!1),u?{opacity:1,mix:1-ct}:{opacity:ct,mix:0}}return{opacity:1,mix:0}}const Ds=new a.aN(1,0,0,1),zl=new a.aN(0,1,0,1),ws=new a.aN(0,0,1,1),ri=new a.aN(1,0,1,1),Qc=new a.aN(0,1,1,1);function eu(j){const u=j.transform.padding;Vc(j,j.transform.height-(u.top||0),3,Ds),Vc(j,u.bottom||0,3,zl),Ao(j,u.left||0,3,ws),Ao(j,j.transform.width-(u.right||0),3,ri);const m=j.transform.centerPoint;(function(F,$,Z,ie){Cc(F,$-1,Z-10,2,20,ie),Cc(F,$-10,Z-1,20,2,ie)})(j,m.x,j.transform.height-m.y,Qc)}function Vc(j,u,m,F){Cc(j,0,u+m/2,j.transform.width,m,F)}function Ao(j,u,m,F){Cc(j,u-m/2,0,m,j.transform.height,F)}function Cc(j,u,m,F,$,Z){const ie=j.context,he=ie.gl;he.enable(he.SCISSOR_TEST),he.scissor(u*j.pixelRatio,m*j.pixelRatio,F*j.pixelRatio,$*j.pixelRatio),ie.clear({color:Z}),he.disable(he.SCISSOR_TEST)}function Mu(j,u,m){const F=j.context,$=F.gl,Z=m.posMatrix,ie=j.useProgram("debug"),he=Gr.disabled,be=ki.disabled,Ce=j.colorModeForRenderPass(),ze="$debug",$e=j.style.map.terrain&&j.style.map.terrain.getTerrainData(m);F.activeTexture.set($.TEXTURE0);const nt=u.getTileByID(m.key).latestRawTileData,ct=nt&&nt.byteLength||0,pt=Math.floor(ct/1024),xt=u.getTile(m).tileSize,Et=512/Math.min(xt,512)*(m.overscaledZ/j.transform.zoom)*.5;let Ct=m.canonical.toString();m.overscaledZ!==m.canonical.z&&(Ct+=` => ${m.overscaledZ}`),function(Rt,At){Rt.initDebugOverlayCanvas();const Zt=Rt.debugOverlayCanvas,Kt=Rt.context.gl,Yt=Rt.debugOverlayCanvas.getContext("2d");Yt.clearRect(0,0,Zt.width,Zt.height),Yt.shadowColor="white",Yt.shadowBlur=2,Yt.lineWidth=1.5,Yt.strokeStyle="white",Yt.textBaseline="top",Yt.font="bold 36px Open Sans, sans-serif",Yt.fillText(At,5,5),Yt.strokeText(At,5,5),Rt.debugOverlayTexture.update(Zt),Rt.debugOverlayTexture.bind(Kt.LINEAR,Kt.CLAMP_TO_EDGE)}(j,`${Ct} ${pt}kB`),ie.draw(F,$.TRIANGLES,he,be,to.alphaBlended,Si.disabled,fa(Z,a.aN.transparent,Et),null,ze,j.debugBuffer,j.quadTriangleIndexBuffer,j.debugSegments),ie.draw(F,$.LINE_STRIP,he,be,Ce,Si.disabled,fa(Z,a.aN.red),$e,ze,j.debugBuffer,j.tileBorderIndexBuffer,j.debugSegments)}function oc(j,u,m){const F=j.context,$=F.gl,Z=j.colorModeForRenderPass(),ie=new Gr($.LEQUAL,Gr.ReadWrite,j.depthRangeFor3D),he=j.useProgram("terrain"),be=u.getTerrainMesh();F.bindFramebuffer.set(null),F.viewport.set([0,0,j.width,j.height]);for(const Ce of m){const ze=j.renderToTexture.getTexture(Ce),$e=u.getTerrainData(Ce.tileID);F.activeTexture.set($.TEXTURE0),$.bindTexture($.TEXTURE_2D,ze.texture);const nt=j.transform.calculatePosMatrix(Ce.tileID.toUnwrapped()),ct=u.getMeshFrameDelta(j.transform.zoom),pt=j.transform.calculateFogMatrix(Ce.tileID.toUnwrapped()),xt=va(nt,ct,pt,j.style.sky,j.transform.pitch);he.draw(F,$.TRIANGLES,ie,ki.disabled,Z,Si.backCCW,xt,$e,"terrain",be.vertexBuffer,be.indexBuffer,be.segments)}}class sc{constructor(u,m,F){this.vertexBuffer=u,this.indexBuffer=m,this.segments=F}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class lc{constructor(u,m){this.context=new xc(u),this.transform=m,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:a.ao(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Ge.maxUnderzooming+Ge.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new en}resize(u,m,F){if(this.width=Math.floor(u*F),this.height=Math.floor(m*F),this.pixelRatio=F,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const $ of this.style._order)this.style._layers[$].resize()}setup(){const u=this.context,m=new a.aX;m.emplaceBack(0,0),m.emplaceBack(a.X,0),m.emplaceBack(0,a.X),m.emplaceBack(a.X,a.X),this.tileExtentBuffer=u.createVertexBuffer(m,vn.members),this.tileExtentSegments=a.a0.simpleSegment(0,0,4,2);const F=new a.aX;F.emplaceBack(0,0),F.emplaceBack(a.X,0),F.emplaceBack(0,a.X),F.emplaceBack(a.X,a.X),this.debugBuffer=u.createVertexBuffer(F,vn.members),this.debugSegments=a.a0.simpleSegment(0,0,4,5);const $=new a.$;$.emplaceBack(0,0,0,0),$.emplaceBack(a.X,0,a.X,0),$.emplaceBack(0,a.X,0,a.X),$.emplaceBack(a.X,a.X,a.X,a.X),this.rasterBoundsBuffer=u.createVertexBuffer($,De.members),this.rasterBoundsSegments=a.a0.simpleSegment(0,0,4,2);const Z=new a.aX;Z.emplaceBack(0,0),Z.emplaceBack(1,0),Z.emplaceBack(0,1),Z.emplaceBack(1,1),this.viewportBuffer=u.createVertexBuffer(Z,vn.members),this.viewportSegments=a.a0.simpleSegment(0,0,4,2);const ie=new a.aZ;ie.emplaceBack(0),ie.emplaceBack(1),ie.emplaceBack(3),ie.emplaceBack(2),ie.emplaceBack(0),this.tileBorderIndexBuffer=u.createIndexBuffer(ie);const he=new a.aY;he.emplaceBack(0,1,2),he.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=u.createIndexBuffer(he);const be=this.context.gl;this.stencilClearMode=new ki({func:be.ALWAYS,mask:0},0,255,be.ZERO,be.ZERO,be.ZERO)}clearStencil(){const u=this.context,m=u.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const F=a.H();a.aQ(F,0,this.width,this.height,0,0,1),a.K(F,F,[m.drawingBufferWidth,m.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(u,m.TRIANGLES,Gr.disabled,this.stencilClearMode,to.disabled,Si.disabled,za(F),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(u,m){if(this.currentStencilSource===u.source||!u.isTileClipped()||!m||!m.length)return;this.currentStencilSource=u.source;const F=this.context,$=F.gl;this.nextStencilID+m.length>256&&this.clearStencil(),F.setColorMode(to.disabled),F.setDepthMode(Gr.disabled);const Z=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const ie of m){const he=this._tileClippingMaskIDs[ie.key]=this.nextStencilID++,be=this.style.map.terrain&&this.style.map.terrain.getTerrainData(ie);Z.draw(F,$.TRIANGLES,Gr.disabled,new ki({func:$.ALWAYS,mask:0},he,255,$.KEEP,$.KEEP,$.REPLACE),to.disabled,Si.disabled,za(ie.posMatrix),be,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const u=this.nextStencilID++,m=this.context.gl;return new ki({func:m.NOTEQUAL,mask:255},u,255,m.KEEP,m.KEEP,m.REPLACE)}stencilModeForClipping(u){const m=this.context.gl;return new ki({func:m.EQUAL,mask:255},this._tileClippingMaskIDs[u.key],0,m.KEEP,m.KEEP,m.REPLACE)}stencilConfigForOverlap(u){const m=this.context.gl,F=u.sort((ie,he)=>he.overscaledZ-ie.overscaledZ),$=F[F.length-1].overscaledZ,Z=F[0].overscaledZ-$+1;if(Z>1){this.currentStencilSource=void 0,this.nextStencilID+Z>256&&this.clearStencil();const ie={};for(let he=0;he<Z;he++)ie[he+$]=new ki({func:m.GEQUAL,mask:255},he+this.nextStencilID,255,m.KEEP,m.KEEP,m.REPLACE);return this.nextStencilID+=Z,[ie,F]}return[{[$]:ki.disabled},F]}colorModeForRenderPass(){const u=this.context.gl;return this._showOverdrawInspector?new to([u.CONSTANT_COLOR,u.ONE],new a.aN(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?to.unblended:to.alphaBlended}depthModeForSublayer(u,m,F){if(!this.opaquePassEnabledForLayer())return Gr.disabled;const $=1-((1+this.currentLayer)*this.numSublayers+u)*this.depthEpsilon;return new Gr(F||this.context.gl.LEQUAL,m,[$,$])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(u,m){var F;this.style=u,this.options=m,this.lineAtlas=u.lineAtlas,this.imageManager=u.imageManager,this.glyphManager=u.glyphManager,this.symbolFadeChange=u.placement.symbolFadeChange(c.now()),this.imageManager.beginFrame();const $=this.style._order,Z=this.style.sourceCaches,ie={},he={},be={};for(const Ce in Z){const ze=Z[Ce];ze.used&&ze.prepare(this.context),ie[Ce]=ze.getVisibleCoordinates(),he[Ce]=ie[Ce].slice().reverse(),be[Ce]=ze.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let Ce=0;Ce<$.length;Ce++){const ze=$[Ce];if(this.style._layers[ze].is3D()){this.opaquePassCutoff=Ce;break}}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const Ce of $){const ze=this.style._layers[Ce];if(!ze.hasOffscreenPass()||ze.isHidden(this.transform.zoom))continue;const $e=he[ze.source];(ze.type==="custom"||$e.length)&&this.renderLayer(this,Z[ze.source],ze,$e)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:m.showOverdrawInspector?a.aN.black:a.aN.transparent,depth:1}),this.clearStencil(),!((F=this.style.stylesheet)===null||F===void 0)&&F.sky&&function(Ce,ze){const $e=Ce.context,nt=$e.gl,ct=((Rt,At,Zt)=>({u_sky_color:Rt.properties.get("sky-color"),u_horizon_color:Rt.properties.get("horizon-color"),u_horizon:(At.height/2+At.getHorizon())*Zt,u_sky_horizon_blend:Rt.properties.get("sky-horizon-blend")*At.height/2*Zt}))(ze,Ce.style.map.transform,Ce.pixelRatio),pt=new Gr(nt.LEQUAL,Gr.ReadWrite,[0,1]),xt=ki.disabled,Et=Ce.colorModeForRenderPass(),Ct=Ce.useProgram("sky");if(!ze.mesh){const Rt=new a.aX;Rt.emplaceBack(-1,-1),Rt.emplaceBack(1,-1),Rt.emplaceBack(1,1),Rt.emplaceBack(-1,1);const At=new a.aY;At.emplaceBack(0,1,2),At.emplaceBack(0,2,3),ze.mesh=new sc($e.createVertexBuffer(Rt,vn.members),$e.createIndexBuffer(At),a.a0.simpleSegment(0,0,Rt.length,At.length))}Ct.draw($e,nt.TRIANGLES,pt,xt,Et,Si.disabled,ct,void 0,"sky",ze.mesh.vertexBuffer,ze.mesh.indexBuffer,ze.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=m.showOverdrawInspector,this.depthRangeFor3D=[0,1-(u._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=$.length-1;this.currentLayer>=0;this.currentLayer--){const Ce=this.style._layers[$[this.currentLayer]],ze=Z[Ce.source],$e=ie[Ce.source];this._renderTileClippingMasks(Ce,$e),this.renderLayer(this,ze,Ce,$e)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<$.length;this.currentLayer++){const Ce=this.style._layers[$[this.currentLayer]],ze=Z[Ce.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(Ce))continue;const $e=(Ce.type==="symbol"?be:he)[Ce.source];this._renderTileClippingMasks(Ce,ie[Ce.source]),this.renderLayer(this,ze,Ce,$e)}if(this.options.showTileBoundaries){const Ce=function(ze,$e){let nt=null;const ct=Object.values(ze._layers).flatMap(Ct=>Ct.source&&!Ct.isHidden($e)?[ze.sourceCaches[Ct.source]]:[]),pt=ct.filter(Ct=>Ct.getSource().type==="vector"),xt=ct.filter(Ct=>Ct.getSource().type!=="vector"),Et=Ct=>{(!nt||nt.getSource().maxzoom<Ct.getSource().maxzoom)&&(nt=Ct)};return pt.forEach(Ct=>Et(Ct)),nt||xt.forEach(Ct=>Et(Ct)),nt}(this.style,this.transform.zoom);Ce&&function(ze,$e,nt){for(let ct=0;ct<nt.length;ct++)Mu(ze,$e,nt[ct])}(this,Ce,Ce.getVisibleCoordinates())}this.options.showPadding&&eu(this),this.context.setDefault()}maybeDrawDepthAndCoords(u){if(!this.style||!this.style.map||!this.style.map.terrain)return;const m=this.terrainFacilitator.matrix,F=this.transform.modelViewProjectionMatrix;let $=this.terrainFacilitator.dirty;$||($=u?!a.a_(m,F):!a.a$(m,F)),$||($=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),$&&(a.b0(m,F),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(Z,ie){const he=Z.context,be=he.gl,Ce=to.unblended,ze=new Gr(be.LEQUAL,Gr.ReadWrite,[0,1]),$e=ie.getTerrainMesh(),nt=ie.sourceCache.getRenderableTiles(),ct=Z.useProgram("terrainDepth");he.bindFramebuffer.set(ie.getFramebuffer("depth").framebuffer),he.viewport.set([0,0,Z.width/devicePixelRatio,Z.height/devicePixelRatio]),he.clear({color:a.aN.transparent,depth:1});for(const pt of nt){const xt=ie.getTerrainData(pt.tileID),Et={u_matrix:Z.transform.calculatePosMatrix(pt.tileID.toUnwrapped()),u_ele_delta:ie.getMeshFrameDelta(Z.transform.zoom)};ct.draw(he,be.TRIANGLES,ze,ki.disabled,Ce,Si.backCCW,Et,xt,"terrain",$e.vertexBuffer,$e.indexBuffer,$e.segments)}he.bindFramebuffer.set(null),he.viewport.set([0,0,Z.width,Z.height])}(this,this.style.map.terrain),function(Z,ie){const he=Z.context,be=he.gl,Ce=to.unblended,ze=new Gr(be.LEQUAL,Gr.ReadWrite,[0,1]),$e=ie.getTerrainMesh(),nt=ie.getCoordsTexture(),ct=ie.sourceCache.getRenderableTiles(),pt=Z.useProgram("terrainCoords");he.bindFramebuffer.set(ie.getFramebuffer("coords").framebuffer),he.viewport.set([0,0,Z.width/devicePixelRatio,Z.height/devicePixelRatio]),he.clear({color:a.aN.transparent,depth:1}),ie.coordsIndex=[];for(const xt of ct){const Et=ie.getTerrainData(xt.tileID);he.activeTexture.set(be.TEXTURE0),be.bindTexture(be.TEXTURE_2D,nt.texture);const Ct={u_matrix:Z.transform.calculatePosMatrix(xt.tileID.toUnwrapped()),u_terrain_coords_id:(255-ie.coordsIndex.length)/255,u_texture:0,u_ele_delta:ie.getMeshFrameDelta(Z.transform.zoom)};pt.draw(he,be.TRIANGLES,ze,ki.disabled,Ce,Si.backCCW,Ct,Et,"terrain",$e.vertexBuffer,$e.indexBuffer,$e.segments),ie.coordsIndex.push(xt.tileID.key)}he.bindFramebuffer.set(null),he.viewport.set([0,0,Z.width,Z.height])}(this,this.style.map.terrain))}renderLayer(u,m,F,$){if(!F.isHidden(this.transform.zoom)&&(F.type==="background"||F.type==="custom"||($||[]).length))switch(this.id=F.id,F.type){case"symbol":Pl(u,m,F,$,this.style.placement.variableOffsets);break;case"circle":(function(Z,ie,he,be){if(Z.renderPass!=="translucent")return;const Ce=he.paint.get("circle-opacity"),ze=he.paint.get("circle-stroke-width"),$e=he.paint.get("circle-stroke-opacity"),nt=!he.layout.get("circle-sort-key").isConstant();if(Ce.constantOr(1)===0&&(ze.constantOr(1)===0||$e.constantOr(1)===0))return;const ct=Z.context,pt=ct.gl,xt=Z.depthModeForSublayer(0,Gr.ReadOnly),Et=ki.disabled,Ct=Z.colorModeForRenderPass(),Rt=[];for(let At=0;At<be.length;At++){const Zt=be[At],Kt=ie.getTile(Zt),Yt=Kt.getBucket(he);if(!Yt)continue;const da=Yt.programConfigurations.get(he.id),ba=Z.useProgram("circle",da),Na=Yt.layoutVertexBuffer,Fa=Yt.indexBuffer,Ua=Z.style.map.terrain&&Z.style.map.terrain.getTerrainData(Zt),Ja={programConfiguration:da,program:ba,layoutVertexBuffer:Na,indexBuffer:Fa,uniformValues:$a(Z,Zt,Kt,he),terrainData:Ua};if(nt){const yn=Yt.segments.get();for(const Qa of yn)Rt.push({segments:new a.a0([Qa]),sortKey:Qa.sortKey,state:Ja})}else Rt.push({segments:Yt.segments,sortKey:0,state:Ja})}nt&&Rt.sort((At,Zt)=>At.sortKey-Zt.sortKey);for(const At of Rt){const{programConfiguration:Zt,program:Kt,layoutVertexBuffer:Yt,indexBuffer:da,uniformValues:ba,terrainData:Na}=At.state,Fa=At.segments;Kt.draw(ct,pt.TRIANGLES,xt,Et,Ct,Si.disabled,ba,Na,he.id,Yt,da,Fa,he.paint,Z.transform.zoom,Zt)}})(u,m,F,$);break;case"heatmap":Ol(u,m,F,$);break;case"line":(function(Z,ie,he,be){if(Z.renderPass!=="translucent")return;const Ce=he.paint.get("line-opacity"),ze=he.paint.get("line-width");if(Ce.constantOr(1)===0||ze.constantOr(1)===0)return;const $e=Z.depthModeForSublayer(0,Gr.ReadOnly),nt=Z.colorModeForRenderPass(),ct=he.paint.get("line-dasharray"),pt=he.paint.get("line-pattern"),xt=pt.constantOr(1),Et=he.paint.get("line-gradient"),Ct=he.getCrossfadeParameters(),Rt=xt?"linePattern":ct?"lineSDF":Et?"lineGradient":"line",At=Z.context,Zt=At.gl;let Kt=!0;for(const Yt of be){const da=ie.getTile(Yt);if(xt&&!da.patternsLoaded())continue;const ba=da.getBucket(he);if(!ba)continue;const Na=ba.programConfigurations.get(he.id),Fa=Z.context.program.get(),Ua=Z.useProgram(Rt,Na),Ja=Kt||Ua.program!==Fa,yn=Z.style.map.terrain&&Z.style.map.terrain.getTerrainData(Yt),Qa=pt.constantOr(null);if(Qa&&da.imageAtlas){const Cn=da.imageAtlas,fn=Cn.patternPositions[Qa.to.toString()],In=Cn.patternPositions[Qa.from.toString()];fn&&In&&Na.setConstantPatternPositions(fn,In)}const wn=yn?Yt:null,rn=xt?Za(Z,da,he,Ct,wn):ct?cn(Z,da,he,ct,Ct,wn):Et?Sa(Z,da,he,ba.lineClipsArray.length,wn):oa(Z,da,he,wn);if(xt)At.activeTexture.set(Zt.TEXTURE0),da.imageAtlasTexture.bind(Zt.LINEAR,Zt.CLAMP_TO_EDGE),Na.updatePaintBuffers(Ct);else if(ct&&(Ja||Z.lineAtlas.dirty))At.activeTexture.set(Zt.TEXTURE0),Z.lineAtlas.bind(At);else if(Et){const Cn=ba.gradients[he.id];let fn=Cn.texture;if(he.gradientVersion!==Cn.version){let In=256;if(he.stepInterpolant){const Wn=ie.getSource().maxzoom,Mn=Yt.canonical.z===Wn?Math.ceil(1<<Z.transform.maxZoom-Yt.canonical.z):1,Hn=ba.maxLineLength/a.X*1024*Mn;In=a.ad(a.aV(Hn),256,At.maxTextureSize)}Cn.gradient=a.aW({expression:he.gradientExpression(),evaluationKey:"lineProgress",resolution:In,image:Cn.gradient||void 0,clips:ba.lineClipsArray}),Cn.texture?Cn.texture.update(Cn.gradient):Cn.texture=new L(At,Cn.gradient,Zt.RGBA),Cn.version=he.gradientVersion,fn=Cn.texture}At.activeTexture.set(Zt.TEXTURE0),fn.bind(he.stepInterpolant?Zt.NEAREST:Zt.LINEAR,Zt.CLAMP_TO_EDGE)}Ua.draw(At,Zt.TRIANGLES,$e,Z.stencilModeForClipping(Yt),nt,Si.disabled,rn,yn,he.id,ba.layoutVertexBuffer,ba.indexBuffer,ba.segments,he.paint,Z.transform.zoom,Na,ba.layoutVertexBuffer2),Kt=!1}})(u,m,F,$);break;case"fill":(function(Z,ie,he,be){const Ce=he.paint.get("fill-color"),ze=he.paint.get("fill-opacity");if(ze.constantOr(1)===0)return;const $e=Z.colorModeForRenderPass(),nt=he.paint.get("fill-pattern"),ct=Z.opaquePassEnabledForLayer()&&!nt.constantOr(1)&&Ce.constantOr(a.aN.transparent).a===1&&ze.constantOr(0)===1?"opaque":"translucent";if(Z.renderPass===ct){const pt=Z.depthModeForSublayer(1,Z.renderPass==="opaque"?Gr.ReadWrite:Gr.ReadOnly);Rc(Z,ie,he,be,pt,$e,!1)}if(Z.renderPass==="translucent"&&he.paint.get("fill-antialias")){const pt=Z.depthModeForSublayer(he.getPaintProperty("fill-outline-color")?2:0,Gr.ReadOnly);Rc(Z,ie,he,be,pt,$e,!0)}})(u,m,F,$);break;case"fill-extrusion":(function(Z,ie,he,be){const Ce=he.paint.get("fill-extrusion-opacity");if(Ce!==0&&Z.renderPass==="translucent"){const ze=new Gr(Z.context.gl.LEQUAL,Gr.ReadWrite,Z.depthRangeFor3D);if(Ce!==1||he.paint.get("fill-extrusion-pattern").constantOr(1))kc(Z,ie,he,be,ze,ki.disabled,to.disabled),kc(Z,ie,he,be,ze,Z.stencilModeFor3D(),Z.colorModeForRenderPass());else{const $e=Z.colorModeForRenderPass();kc(Z,ie,he,be,ze,ki.disabled,$e)}}})(u,m,F,$);break;case"hillshade":(function(Z,ie,he,be){if(Z.renderPass!=="offscreen"&&Z.renderPass!=="translucent")return;const Ce=Z.context,ze=Z.depthModeForSublayer(0,Gr.ReadOnly),$e=Z.colorModeForRenderPass(),[nt,ct]=Z.renderPass==="translucent"?Z.stencilConfigForOverlap(be):[{},be];for(const pt of ct){const xt=ie.getTile(pt);xt.needsHillshadePrepare!==void 0&&xt.needsHillshadePrepare&&Z.renderPass==="offscreen"?bu(Z,xt,he,ze,ki.disabled,$e):Z.renderPass==="translucent"&&Sc(Z,pt,xt,he,ze,nt[pt.overscaledZ],$e)}Ce.viewport.set([0,0,Z.width,Z.height])})(u,m,F,$);break;case"raster":(function(Z,ie,he,be){if(Z.renderPass!=="translucent"||he.paint.get("raster-opacity")===0||!be.length)return;const Ce=Z.context,ze=Ce.gl,$e=ie.getSource(),nt=Z.useProgram("raster"),ct=Z.colorModeForRenderPass(),[pt,xt]=$e instanceof Be?[{},be]:Z.stencilConfigForOverlap(be),Et=xt[xt.length-1].overscaledZ,Ct=!Z.options.moving;for(const Rt of xt){const At=Z.depthModeForSublayer(Rt.overscaledZ-Et,he.paint.get("raster-opacity")===1?Gr.ReadWrite:Gr.ReadOnly,ze.LESS),Zt=ie.getTile(Rt);Zt.registerFadeDuration(he.paint.get("raster-fade-duration"));const Kt=ie.findLoadedParent(Rt,0),Yt=ie.findLoadedSibling(Rt),da=xs(Zt,Kt||Yt||null,ie,he,Z.transform,Z.style.map.terrain);let ba,Na;const Fa=he.paint.get("raster-resampling")==="nearest"?ze.NEAREST:ze.LINEAR;Ce.activeTexture.set(ze.TEXTURE0),Zt.texture.bind(Fa,ze.CLAMP_TO_EDGE,ze.LINEAR_MIPMAP_NEAREST),Ce.activeTexture.set(ze.TEXTURE1),Kt?(Kt.texture.bind(Fa,ze.CLAMP_TO_EDGE,ze.LINEAR_MIPMAP_NEAREST),ba=Math.pow(2,Kt.tileID.overscaledZ-Zt.tileID.overscaledZ),Na=[Zt.tileID.canonical.x*ba%1,Zt.tileID.canonical.y*ba%1]):Zt.texture.bind(Fa,ze.CLAMP_TO_EDGE,ze.LINEAR_MIPMAP_NEAREST),Zt.texture.useMipmap&&Ce.extTextureFilterAnisotropic&&Z.transform.pitch>20&&ze.texParameterf(ze.TEXTURE_2D,Ce.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Ce.extTextureFilterAnisotropicMax);const Ua=Z.style.map.terrain&&Z.style.map.terrain.getTerrainData(Rt),Ja=Ua?Rt:null,yn=Ja?Ja.posMatrix:Z.transform.calculatePosMatrix(Rt.toUnwrapped(),Ct),Qa=En(yn,Na||[0,0],ba||1,da,he);$e instanceof Be?nt.draw(Ce,ze.TRIANGLES,At,ki.disabled,ct,Si.disabled,Qa,Ua,he.id,$e.boundsBuffer,Z.quadTriangleIndexBuffer,$e.boundsSegments):nt.draw(Ce,ze.TRIANGLES,At,pt[Rt.overscaledZ],ct,Si.disabled,Qa,Ua,he.id,Z.rasterBoundsBuffer,Z.quadTriangleIndexBuffer,Z.rasterBoundsSegments)}})(u,m,F,$);break;case"background":(function(Z,ie,he,be){const Ce=he.paint.get("background-color"),ze=he.paint.get("background-opacity");if(ze===0)return;const $e=Z.context,nt=$e.gl,ct=Z.transform,pt=ct.tileSize,xt=he.paint.get("background-pattern");if(Z.isPatternMissing(xt))return;const Et=!xt&&Ce.a===1&&ze===1&&Z.opaquePassEnabledForLayer()?"opaque":"translucent";if(Z.renderPass!==Et)return;const Ct=ki.disabled,Rt=Z.depthModeForSublayer(0,Et==="opaque"?Gr.ReadWrite:Gr.ReadOnly),At=Z.colorModeForRenderPass(),Zt=Z.useProgram(xt?"backgroundPattern":"background"),Kt=be||ct.coveringTiles({tileSize:pt,terrain:Z.style.map.terrain});xt&&($e.activeTexture.set(nt.TEXTURE0),Z.imageManager.bind(Z.context));const Yt=he.getCrossfadeParameters();for(const da of Kt){const ba=be?da.posMatrix:Z.transform.calculatePosMatrix(da.toUnwrapped()),Na=xt?Jn(ba,ze,Z,xt,{tileID:da,tileSize:pt},Yt):Nn(ba,ze,Ce),Fa=Z.style.map.terrain&&Z.style.map.terrain.getTerrainData(da);Zt.draw($e,nt.TRIANGLES,Rt,Ct,At,Si.disabled,Na,Fa,he.id,Z.tileExtentBuffer,Z.quadTriangleIndexBuffer,Z.tileExtentSegments)}})(u,0,F,$);break;case"custom":(function(Z,ie,he){const be=Z.context,Ce=he.implementation;if(Z.renderPass==="offscreen"){const ze=Ce.prerender;ze&&(Z.setCustomLayerDefaults(),be.setColorMode(Z.colorModeForRenderPass()),ze.call(Ce,be.gl,Z.transform.customLayerMatrix()),be.setDirty(),Z.setBaseState())}else if(Z.renderPass==="translucent"){Z.setCustomLayerDefaults(),be.setColorMode(Z.colorModeForRenderPass()),be.setStencilMode(ki.disabled);const ze=Ce.renderingMode==="3d"?new Gr(Z.context.gl.LEQUAL,Gr.ReadWrite,Z.depthRangeFor3D):Z.depthModeForSublayer(0,Gr.ReadOnly);be.setDepthMode(ze),Ce.render(be.gl,Z.transform.customLayerMatrix(),{farZ:Z.transform.farZ,nearZ:Z.transform.nearZ,fov:Z.transform._fov,modelViewProjectionMatrix:Z.transform.modelViewProjectionMatrix,projectionMatrix:Z.transform.projectionMatrix}),be.setDirty(),Z.setBaseState(),be.bindFramebuffer.set(null)}})(u,0,F)}}translatePosMatrix(u,m,F,$,Z){if(!F[0]&&!F[1])return u;const ie=Z?$==="map"?this.transform.angle:0:$==="viewport"?-this.transform.angle:0;if(ie){const Ce=Math.sin(ie),ze=Math.cos(ie);F=[F[0]*ze-F[1]*Ce,F[0]*Ce+F[1]*ze]}const he=[Z?F[0]:St(m,F[0],this.transform.zoom),Z?F[1]:St(m,F[1],this.transform.zoom),0],be=new Float32Array(16);return a.J(be,u,he),be}saveTileTexture(u){const m=this._tileTextures[u.size[0]];m?m.push(u):this._tileTextures[u.size[0]]=[u]}getTileTexture(u){const m=this._tileTextures[u];return m&&m.length>0?m.pop():null}isPatternMissing(u){if(!u)return!1;if(!u.from||!u.to)return!0;const m=this.imageManager.getPattern(u.from.toString()),F=this.imageManager.getPattern(u.to.toString());return!m||!F}useProgram(u,m){this.cache=this.cache||{};const F=u+(m?m.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[F]||(this.cache[F]=new tn(this.context,bn[u],m,$n[u],this._showOverdrawInspector,this.style.map.terrain)),this.cache[F]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const u=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(u.FUNC_ADD)}initDebugOverlayCanvas(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;const u=this.context.gl;this.debugOverlayTexture=new L(this.context,this.debugOverlayCanvas,u.RGBA)}}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:u,drawingBufferHeight:m}=this.context.gl;return this.width!==u||this.height!==m}}class Rs{constructor(u,m){this.points=u,this.planes=m}static fromInvProjectionMatrix(u,m,F){const $=Math.pow(2,F),Z=[[-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(he=>{const be=1/(he=a.ag([],he,u))[3]/m*$;return a.b1(he,he,[be,be,1/he[3],be])}),ie=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(he=>{const be=function(nt,ct){var pt=ct[0],xt=ct[1],Et=ct[2],Ct=pt*pt+xt*xt+Et*Et;return Ct>0&&(Ct=1/Math.sqrt(Ct)),nt[0]=ct[0]*Ct,nt[1]=ct[1]*Ct,nt[2]=ct[2]*Ct,nt}([],function(nt,ct,pt){var xt=ct[0],Et=ct[1],Ct=ct[2],Rt=pt[0],At=pt[1],Zt=pt[2];return nt[0]=Et*Zt-Ct*At,nt[1]=Ct*Rt-xt*Zt,nt[2]=xt*At-Et*Rt,nt}([],P([],Z[he[0]],Z[he[1]]),P([],Z[he[2]],Z[he[1]]))),Ce=(ze=be,$e=Z[he[1]],-(ze[0]*$e[0]+ze[1]*$e[1]+ze[2]*$e[2]));var ze,$e;return be.concat(Ce)});return new Rs(Z,ie)}}class ks{constructor(u,m){this.min=u,this.max=m,this.center=function(F,$,Z){return F[0]=$[0]*Z,F[1]=$[1]*Z,F[2]=$[2]*Z,F}([],function(F,$,Z){return F[0]=$[0]+Z[0],F[1]=$[1]+Z[1],F[2]=$[2]+Z[2],F}([],this.min,this.max),.5)}quadrant(u){const m=[u%2==0,u<2],F=T(this.min),$=T(this.max);for(let Z=0;Z<m.length;Z++)F[Z]=m[Z]?this.min[Z]:this.center[Z],$[Z]=m[Z]?this.center[Z]:this.max[Z];return $[2]=this.max[2],new ks(F,$)}distanceX(u){return Math.max(Math.min(this.max[0],u[0]),this.min[0])-u[0]}distanceY(u){return Math.max(Math.min(this.max[1],u[1]),this.min[1])-u[1]}intersects(u){const m=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let F=!0;for(let $=0;$<u.planes.length;$++){const Z=u.planes[$];let ie=0;for(let he=0;he<m.length;he++)a.b2(Z,m[he])>=0&&ie++;if(ie===0)return 0;ie!==m.length&&(F=!1)}if(F)return 2;for(let $=0;$<3;$++){let Z=Number.MAX_VALUE,ie=-Number.MAX_VALUE;for(let he=0;he<u.points.length;he++){const be=u.points[he][$]-this.min[$];Z=Math.min(Z,be),ie=Math.max(ie,be)}if(ie<0||Z>this.max[$]-this.min[$])return 0}return 1}}class Nl{constructor(u=0,m=0,F=0,$=0){if(isNaN(u)||u<0||isNaN(m)||m<0||isNaN(F)||F<0||isNaN($)||$<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=u,this.bottom=m,this.left=F,this.right=$}interpolate(u,m,F){return m.top!=null&&u.top!=null&&(this.top=a.z.number(u.top,m.top,F)),m.bottom!=null&&u.bottom!=null&&(this.bottom=a.z.number(u.bottom,m.bottom,F)),m.left!=null&&u.left!=null&&(this.left=a.z.number(u.left,m.left,F)),m.right!=null&&u.right!=null&&(this.right=a.z.number(u.right,m.right,F)),this}getCenter(u,m){const F=a.ad((this.left+u-this.right)/2,0,u),$=a.ad((this.top+m-this.bottom)/2,0,m);return new a.P(F,$)}equals(u){return this.top===u.top&&this.bottom===u.bottom&&this.left===u.left&&this.right===u.right}clone(){return new Nl(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Tc=85.051129;class fi{constructor(u,m,F,$,Z){this.tileSize=512,this._renderWorldCopies=Z===void 0||!!Z,this._minZoom=u||0,this._maxZoom=m||22,this._minPitch=F??0,this._maxPitch=$??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new a.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Nl,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const u=new fi(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return u.apply(this),u}apply(u){this.tileSize=u.tileSize,this.latRange=u.latRange,this.width=u.width,this.height=u.height,this._center=u._center,this._elevation=u._elevation,this.minElevationForCurrentTile=u.minElevationForCurrentTile,this.zoom=u.zoom,this.angle=u.angle,this._fov=u._fov,this._pitch=u._pitch,this._unmodified=u._unmodified,this._edgeInsets=u._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(u){this._minZoom!==u&&(this._minZoom=u,this.zoom=Math.max(this.zoom,u))}get maxZoom(){return this._maxZoom}set maxZoom(u){this._maxZoom!==u&&(this._maxZoom=u,this.zoom=Math.min(this.zoom,u))}get minPitch(){return this._minPitch}set minPitch(u){this._minPitch!==u&&(this._minPitch=u,this.pitch=Math.max(this.pitch,u))}get maxPitch(){return this._maxPitch}set maxPitch(u){this._maxPitch!==u&&(this._maxPitch=u,this.pitch=Math.min(this.pitch,u))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(u){u===void 0?u=!0:u===null&&(u=!1),this._renderWorldCopies=u}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new a.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(u){const m=-a.b3(u,-180,180)*Math.PI/180;this.angle!==m&&(this._unmodified=!1,this.angle=m,this._calcMatrices(),this.rotationMatrix=function(){var F=new a.A(4);return a.A!=Float32Array&&(F[1]=0,F[2]=0),F[0]=1,F[3]=1,F}(),function(F,$,Z){var ie=$[0],he=$[1],be=$[2],Ce=$[3],ze=Math.sin(Z),$e=Math.cos(Z);F[0]=ie*$e+be*ze,F[1]=he*$e+Ce*ze,F[2]=ie*-ze+be*$e,F[3]=he*-ze+Ce*$e}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(u){const m=a.ad(u,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==m&&(this._unmodified=!1,this._pitch=m,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(u){u=Math.max(.01,Math.min(60,u)),this._fov!==u&&(this._unmodified=!1,this._fov=u/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(u){const m=Math.min(Math.max(u,this.minZoom),this.maxZoom);this._zoom!==m&&(this._unmodified=!1,this._zoom=m,this.tileZoom=Math.max(0,Math.floor(m)),this.scale=this.zoomScale(m),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(u){u.lat===this._center.lat&&u.lng===this._center.lng||(this._unmodified=!1,this._center=u,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(u){u!==this._elevation&&(this._elevation=u,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(u){this._edgeInsets.equals(u)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,u,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(u){return this._edgeInsets.equals(u)}interpolatePadding(u,m,F){this._unmodified=!1,this._edgeInsets.interpolate(u,m,F),this._constrain(),this._calcMatrices()}coveringZoomLevel(u){const m=(u.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/u.tileSize));return Math.max(0,m)}getVisibleUnwrappedCoordinates(u){const m=[new a.b4(0,u)];if(this._renderWorldCopies){const F=this.pointCoordinate(new a.P(0,0)),$=this.pointCoordinate(new a.P(this.width,0)),Z=this.pointCoordinate(new a.P(this.width,this.height)),ie=this.pointCoordinate(new a.P(0,this.height)),he=Math.floor(Math.min(F.x,$.x,Z.x,ie.x)),be=Math.floor(Math.max(F.x,$.x,Z.x,ie.x)),Ce=1;for(let ze=he-Ce;ze<=be+Ce;ze++)ze!==0&&m.push(new a.b4(ze,u))}return m}coveringTiles(u){var m,F;let $=this.coveringZoomLevel(u);const Z=$;if(u.minzoom!==void 0&&$<u.minzoom)return[];u.maxzoom!==void 0&&$>u.maxzoom&&($=u.maxzoom);const ie=this.pointCoordinate(this.getCameraPoint()),he=a.Z.fromLngLat(this.center),be=Math.pow(2,$),Ce=[be*ie.x,be*ie.y,0],ze=[be*he.x,be*he.y,0],$e=Rs.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,$);let nt=u.minzoom||0;!u.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(nt=$);const ct=u.terrain?2/Math.min(this.tileSize,u.tileSize)*this.tileSize:3,pt=At=>({aabb:new ks([At*be,0,0],[(At+1)*be,be,0]),zoom:0,x:0,y:0,wrap:At,fullyVisible:!1}),xt=[],Et=[],Ct=$,Rt=u.reparseOverscaled?Z:$;if(this._renderWorldCopies)for(let At=1;At<=3;At++)xt.push(pt(-At)),xt.push(pt(At));for(xt.push(pt(0));xt.length>0;){const At=xt.pop(),Zt=At.x,Kt=At.y;let Yt=At.fullyVisible;if(!Yt){const Ja=At.aabb.intersects($e);if(Ja===0)continue;Yt=Ja===2}const da=u.terrain?Ce:ze,ba=At.aabb.distanceX(da),Na=At.aabb.distanceY(da),Fa=Math.max(Math.abs(ba),Math.abs(Na)),Ua=ct+(1<<Ct-At.zoom)-2;if(At.zoom===Ct||Fa>Ua&&At.zoom>=nt){const Ja=Ct-At.zoom,yn=Ce[0]-.5-(Zt<<Ja),Qa=Ce[1]-.5-(Kt<<Ja);Et.push({tileID:new a.S(At.zoom===Ct?Rt:At.zoom,At.wrap,At.zoom,Zt,Kt),distanceSq:E([ze[0]-.5-Zt,ze[1]-.5-Kt]),tileDistanceToCamera:Math.sqrt(yn*yn+Qa*Qa)})}else for(let Ja=0;Ja<4;Ja++){const yn=(Zt<<1)+Ja%2,Qa=(Kt<<1)+(Ja>>1),wn=At.zoom+1;let rn=At.aabb.quadrant(Ja);if(u.terrain){const Cn=new a.S(wn,At.wrap,wn,yn,Qa),fn=u.terrain.getMinMaxElevation(Cn),In=(m=fn.minElevation)!==null&&m!==void 0?m:this.elevation,Wn=(F=fn.maxElevation)!==null&&F!==void 0?F:this.elevation;rn=new ks([rn.min[0],rn.min[1],In],[rn.max[0],rn.max[1],Wn])}xt.push({aabb:rn,zoom:wn,x:yn,y:Qa,wrap:At.wrap,fullyVisible:Yt})}}return Et.sort((At,Zt)=>At.distanceSq-Zt.distanceSq).map(At=>At.tileID)}resize(u,m){this.width=u,this.height=m,this.pixelsToGLUnits=[2/u,-2/m],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(u){return Math.pow(2,u)}scaleZoom(u){return Math.log(u)/Math.LN2}project(u){const m=a.ad(u.lat,-85.051129,Tc);return new a.P(a.O(u.lng)*this.worldSize,a.Q(m)*this.worldSize)}unproject(u){return new a.Z(u.x/this.worldSize,u.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(u){const m=this.elevation,F=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,$=this.pointLocation(this.centerPoint,u),Z=u.getElevationForLngLatZoom($,this.tileZoom);if(!(this.elevation-Z))return;const ie=F+m-Z,he=Math.cos(this._pitch)*this.cameraToCenterDistance/ie/a.b5(1,$.lat)/this.tileSize,be=this.scaleZoom(he);this._elevation=Z,this._center=$,this.zoom=be}setLocationAtPoint(u,m){const F=this.pointCoordinate(m),$=this.pointCoordinate(this.centerPoint),Z=this.locationCoordinate(u),ie=new a.Z(Z.x-(F.x-$.x),Z.y-(F.y-$.y));this.center=this.coordinateLocation(ie),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(u,m){return m?this.coordinatePoint(this.locationCoordinate(u),m.getElevationForLngLatZoom(u,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(u))}pointLocation(u,m){return this.coordinateLocation(this.pointCoordinate(u,m))}locationCoordinate(u){return a.Z.fromLngLat(u)}coordinateLocation(u){return u&&u.toLngLat()}pointCoordinate(u,m){if(m){const pt=m.pointCoordinate(u);if(pt!=null)return pt}const F=[u.x,u.y,0,1],$=[u.x,u.y,1,1];a.ag(F,F,this.pixelMatrixInverse),a.ag($,$,this.pixelMatrixInverse);const Z=F[3],ie=$[3],he=F[0]/Z,be=$[0]/ie,Ce=F[1]/Z,ze=$[1]/ie,$e=F[2]/Z,nt=$[2]/ie,ct=$e===nt?0:(0-$e)/(nt-$e);return new a.Z(a.z.number(he,be,ct)/this.worldSize,a.z.number(Ce,ze,ct)/this.worldSize)}coordinatePoint(u,m=0,F=this.pixelMatrix){const $=[u.x*this.worldSize,u.y*this.worldSize,m,1];return a.ag($,$,F),new a.P($[0]/$[3],$[1]/$[3])}getBounds(){const u=Math.max(0,this.height/2-this.getHorizon());return new Ae().extend(this.pointLocation(new a.P(0,u))).extend(this.pointLocation(new a.P(this.width,u))).extend(this.pointLocation(new a.P(this.width,this.height))).extend(this.pointLocation(new a.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new Ae([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(u){u?(this.lngRange=[u.getWest(),u.getEast()],this.latRange=[u.getSouth(),u.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Tc])}calculateTileMatrix(u){const m=u.canonical,F=this.worldSize/this.zoomScale(m.z),$=m.x+Math.pow(2,m.z)*u.wrap,Z=a.ao(new Float64Array(16));return a.J(Z,Z,[$*F,m.y*F,0]),a.K(Z,Z,[F/a.X,F/a.X,1]),Z}calculatePosMatrix(u,m=!1){const F=u.key,$=m?this._alignedPosMatrixCache:this._posMatrixCache;if($[F])return $[F];const Z=this.calculateTileMatrix(u);return a.L(Z,m?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Z),$[F]=new Float32Array(Z),$[F]}calculateFogMatrix(u){const m=u.key,F=this._fogMatrixCache;if(F[m])return F[m];const $=this.calculateTileMatrix(u);return a.L($,this.fogMatrix,$),F[m]=new Float32Array($),F[m]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(u,m){m=a.ad(+m,this.minZoom,this.maxZoom);const F={center:new a.N(u.lng,u.lat),zoom:m};let $=this.lngRange;if(!this._renderWorldCopies&&$===null){const At=179.9999999999;$=[-At,At]}const Z=this.tileSize*this.zoomScale(F.zoom);let ie=0,he=Z,be=0,Ce=Z,ze=0,$e=0;const{x:nt,y:ct}=this.size;if(this.latRange){const At=this.latRange;ie=a.Q(At[1])*Z,he=a.Q(At[0])*Z,he-ie<ct&&(ze=ct/(he-ie))}$&&(be=a.b3(a.O($[0])*Z,0,Z),Ce=a.b3(a.O($[1])*Z,0,Z),Ce<be&&(Ce+=Z),Ce-be<nt&&($e=nt/(Ce-be)));const{x:pt,y:xt}=this.project.call({worldSize:Z},u);let Et,Ct;const Rt=Math.max($e||0,ze||0);if(Rt){const At=new a.P($e?(Ce+be)/2:pt,ze?(he+ie)/2:xt);return F.center=this.unproject.call({worldSize:Z},At).wrap(),F.zoom+=this.scaleZoom(Rt),F}if(this.latRange){const At=ct/2;xt-At<ie&&(Ct=ie+At),xt+At>he&&(Ct=he-At)}if($){const At=(be+Ce)/2;let Zt=pt;this._renderWorldCopies&&(Zt=a.b3(pt,At-Z/2,At+Z/2));const Kt=nt/2;Zt-Kt<be&&(Et=be+Kt),Zt+Kt>Ce&&(Et=Ce-Kt)}if(Et!==void 0||Ct!==void 0){const At=new a.P(Et??pt,Ct??xt);F.center=this.unproject.call({worldSize:Z},At).wrap()}return F}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const u=this._unmodified,{center:m,zoom:F}=this.getConstrained(this.center,this.zoom);this.center=m,this.zoom=F,this._unmodified=u,this._constraining=!1}_calcMatrices(){if(!this.height)return;const u=this._fov/2,m=this.centerOffset,F=this.point.x,$=this.point.y;this.cameraToCenterDistance=.5/Math.tan(u)*this.height,this._pixelPerMeter=a.b5(1,this.center.lat)*this.worldSize;let Z=a.ao(new Float64Array(16));a.K(Z,Z,[this.width/2,-this.height/2,1]),a.J(Z,Z,[1,-1,0]),this.labelPlaneMatrix=Z,Z=a.ao(new Float64Array(16)),a.K(Z,Z,[1,-1,1]),a.J(Z,Z,[-1,-1,0]),a.K(Z,Z,[2/this.width,2/this.height,1]),this.glCoordMatrix=Z;const ie=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),he=Math.min(this.elevation,this.minElevationForCurrentTile),be=ie-he*this._pixelPerMeter/Math.cos(this._pitch),Ce=he<0?be:ie,ze=Math.PI/2+this._pitch,$e=this._fov*(.5+m.y/this.height),nt=Math.sin($e)*Ce/Math.sin(a.ad(Math.PI-ze-$e,.01,Math.PI-.01)),ct=this.getHorizon(),pt=2*Math.atan(ct/this.cameraToCenterDistance)*(.5+m.y/(2*ct)),xt=Math.sin(pt)*Ce/Math.sin(a.ad(Math.PI-ze-pt,.01,Math.PI-.01)),Et=Math.min(nt,xt);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Et+Ce),this.nearZ=this.height/50,Z=new Float64Array(16),a.b6(Z,this._fov,this.width/this.height,this.nearZ,this.farZ),Z[8]=2*-m.x/this.width,Z[9]=2*m.y/this.height,this.projectionMatrix=a.af(Z),a.K(Z,Z,[1,-1,1]),a.J(Z,Z,[0,0,-this.cameraToCenterDistance]),a.b7(Z,Z,this._pitch),a.ae(Z,Z,this.angle),a.J(Z,Z,[-F,-$,0]),this.mercatorMatrix=a.K([],Z,[this.worldSize,this.worldSize,this.worldSize]),a.K(Z,Z,[1,1,this._pixelPerMeter]),this.pixelMatrix=a.L(new Float64Array(16),this.labelPlaneMatrix,Z),a.J(Z,Z,[0,0,-this.elevation]),this.modelViewProjectionMatrix=Z,this.invModelViewProjectionMatrix=a.at([],Z),this.fogMatrix=new Float64Array(16),a.b6(this.fogMatrix,this._fov,this.width/this.height,ie,this.farZ),this.fogMatrix[8]=2*-m.x/this.width,this.fogMatrix[9]=2*m.y/this.height,a.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),a.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),a.b7(this.fogMatrix,this.fogMatrix,this._pitch),a.ae(this.fogMatrix,this.fogMatrix,this.angle),a.J(this.fogMatrix,this.fogMatrix,[-F,-$,0]),a.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),a.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=a.L(new Float64Array(16),this.labelPlaneMatrix,Z);const Ct=this.width%2/2,Rt=this.height%2/2,At=Math.cos(this.angle),Zt=Math.sin(this.angle),Kt=F-Math.round(F)+At*Ct+Zt*Rt,Yt=$-Math.round($)+At*Rt+Zt*Ct,da=new Float64Array(Z);if(a.J(da,da,[Kt>.5?Kt-1:Kt,Yt>.5?Yt-1:Yt,0]),this.alignedModelViewProjectionMatrix=da,Z=a.at(new Float64Array(16),this.pixelMatrix),!Z)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Z,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const u=this.pointCoordinate(new a.P(0,0)),m=[u.x*this.worldSize,u.y*this.worldSize,0,1];return a.ag(m,m,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const u=this._pitch,m=Math.tan(u)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new a.P(0,m))}getCameraQueryGeometry(u){const m=this.getCameraPoint();if(u.length===1)return[u[0],m];{let F=m.x,$=m.y,Z=m.x,ie=m.y;for(const he of u)F=Math.min(F,he.x),$=Math.min($,he.y),Z=Math.max(Z,he.x),ie=Math.max(ie,he.y);return[new a.P(F,$),new a.P(Z,$),new a.P(Z,ie),new a.P(F,ie),new a.P(F,$)]}}lngLatToCameraDepth(u,m){const F=this.locationCoordinate(u),$=[F.x*this.worldSize,F.y*this.worldSize,m,1];return a.ag($,$,this.modelViewProjectionMatrix),$[2]/$[3]}}function Vs(j,u){let m,F=!1,$=null,Z=null;const ie=()=>{$=null,F&&(j.apply(Z,m),$=setTimeout(ie,u),F=!1)};return(...he)=>(F=!0,Z=this,m=he,$||ie(),$)}class ao{constructor(u){this._getCurrentHash=()=>{const m=window.location.hash.replace("#","");if(this._hashName){let F;return m.split("&").map($=>$.split("=")).forEach($=>{$[0]===this._hashName&&(F=$)}),(F&&F[1]||"").split("/")}return m.split("/")},this._onHashChange=()=>{const m=this._getCurrentHash();if(m.length>=3&&!m.some(F=>isNaN(F))){const F=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(m[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+m[2],+m[1]],zoom:+m[0],bearing:F,pitch:+(m[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const m=window.location.href.replace(/(#.+)?$/,this.getHashString());window.history.replaceState(window.history.state,null,m)},this._removeHash=()=>{const m=this._getCurrentHash();if(m.length===0)return;const F=m.join("/");let $=F;$.split("&").length>0&&($=$.split("&")[0]),this._hashName&&($=`${this._hashName}=${F}`);let Z=window.location.hash.replace($,"");Z.startsWith("#&")?Z=Z.slice(0,1)+Z.slice(2):Z==="#"&&(Z="");let ie=window.location.href.replace(/(#.+)?$/,Z);ie=ie.replace("&&","&"),window.history.replaceState(window.history.state,null,ie)},this._updateHash=Vs(this._updateHashUnthrottled,300),this._hashName=u&&encodeURIComponent(u)}addTo(u){return this._map=u,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(u){const m=this._map.getCenter(),F=Math.round(100*this._map.getZoom())/100,$=Math.ceil((F*Math.LN2+Math.log(512/360/.5))/Math.LN10),Z=Math.pow(10,$),ie=Math.round(m.lng*Z)/Z,he=Math.round(m.lat*Z)/Z,be=this._map.getBearing(),Ce=this._map.getPitch();let ze="";if(ze+=u?`/${ie}/${he}/${F}`:`${F}/${he}/${ie}`,(be||Ce)&&(ze+="/"+Math.round(10*be)/10),Ce&&(ze+=`/${Math.round(Ce)}`),this._hashName){const $e=this._hashName;let nt=!1;const ct=window.location.hash.slice(1).split("&").map(pt=>{const xt=pt.split("=")[0];return xt===$e?(nt=!0,`${xt}=${ze}`):pt}).filter(pt=>pt);return nt||ct.push(`${$e}=${ze}`),`#${ct.join("&")}`}return`#${ze}`}}const Ho={linearity:.3,easing:a.b8(0,0,.3,1)},di=a.e({deceleration:2500,maxSpeed:1400},Ho),mi=a.e({deceleration:20,maxSpeed:1400},Ho),Ss=a.e({deceleration:1e3,maxSpeed:360},Ho),Ac=a.e({deceleration:1e3,maxSpeed:90},Ho);class cc{constructor(u){this._map=u,this.clear()}clear(){this._inertiaBuffer=[]}record(u){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:c.now(),settings:u})}_drainInertiaBuffer(){const u=this._inertiaBuffer,m=c.now();for(;u.length>0&&m-u[0].time>160;)u.shift()}_onMoveEnd(u){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const m={zoom:0,bearing:0,pitch:0,pan:new a.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:Z}of this._inertiaBuffer)m.zoom+=Z.zoomDelta||0,m.bearing+=Z.bearingDelta||0,m.pitch+=Z.pitchDelta||0,Z.panDelta&&m.pan._add(Z.panDelta),Z.around&&(m.around=Z.around),Z.pinchAround&&(m.pinchAround=Z.pinchAround);const F=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,$={};if(m.pan.mag()){const Z=Wl(m.pan.mag(),F,a.e({},di,u||{}));$.offset=m.pan.mult(Z.amount/m.pan.mag()),$.center=this._map.transform.center,ql($,Z)}if(m.zoom){const Z=Wl(m.zoom,F,mi);$.zoom=this._map.transform.zoom+Z.amount,ql($,Z)}if(m.bearing){const Z=Wl(m.bearing,F,Ss);$.bearing=this._map.transform.bearing+a.ad(Z.amount,-179,179),ql($,Z)}if(m.pitch){const Z=Wl(m.pitch,F,Ac);$.pitch=this._map.transform.pitch+Z.amount,ql($,Z)}if($.zoom||$.bearing){const Z=m.pinchAround===void 0?m.around:m.pinchAround;$.around=Z?this._map.unproject(Z):this._map.getCenter()}return this.clear(),a.e($,{noMoveStart:!0})}}function ql(j,u){(!j.duration||j.duration<u.duration)&&(j.duration=u.duration,j.easing=u.easing)}function Wl(j,u,m){const{maxSpeed:F,linearity:$,deceleration:Z}=m,ie=a.ad(j*$/(u/1e3),-F,F),he=Math.abs(ie)/(Z*$);return{easing:m.easing,duration:1e3*he,amount:ie*(he/2)}}class Eo extends a.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(u,m,F,$={}){const Z=o.mousePos(m.getCanvas(),F),ie=m.unproject(Z);super(u,a.e({point:Z,lngLat:ie,originalEvent:F},$)),this._defaultPrevented=!1,this.target=m}}class _o extends a.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(u,m,F){const $=u==="touchend"?F.changedTouches:F.touches,Z=o.touchPos(m.getCanvasContainer(),$),ie=Z.map(be=>m.unproject(be)),he=Z.reduce((be,Ce,ze,$e)=>be.add(Ce.div($e.length)),new a.P(0,0));super(u,{points:Z,point:he,lngLats:ie,lngLat:m.unproject(he),originalEvent:F}),this._defaultPrevented=!1}}class Qs extends a.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(u,m,F){super(u,{originalEvent:F}),this._defaultPrevented=!1}}class uc{constructor(u,m){this._map=u,this._clickTolerance=m.clickTolerance}reset(){delete this._mousedownPos}wheel(u){return this._firePreventable(new Qs(u.type,this._map,u))}mousedown(u,m){return this._mousedownPos=m,this._firePreventable(new Eo(u.type,this._map,u))}mouseup(u){this._map.fire(new Eo(u.type,this._map,u))}click(u,m){this._mousedownPos&&this._mousedownPos.dist(m)>=this._clickTolerance||this._map.fire(new Eo(u.type,this._map,u))}dblclick(u){return this._firePreventable(new Eo(u.type,this._map,u))}mouseover(u){this._map.fire(new Eo(u.type,this._map,u))}mouseout(u){this._map.fire(new Eo(u.type,this._map,u))}touchstart(u){return this._firePreventable(new _o(u.type,this._map,u))}touchmove(u){this._map.fire(new _o(u.type,this._map,u))}touchend(u){this._map.fire(new _o(u.type,this._map,u))}touchcancel(u){this._map.fire(new _o(u.type,this._map,u))}_firePreventable(u){if(this._map.fire(u),u.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Oo{constructor(u){this._map=u}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(u){this._map.fire(new Eo(u.type,this._map,u))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Eo("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(u){this._delayContextMenu?this._contextMenuEvent=u:this._ignoreContextMenu||this._map.fire(new Eo(u.type,this._map,u)),this._map.listens("contextmenu")&&u.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ei{constructor(u){this._map=u}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(u){return this.transform.pointLocation(a.P.convert(u),this._map.terrain)}}class bo{constructor(u,m){this._map=u,this._tr=new Ei(u),this._el=u.getCanvasContainer(),this._container=u.getContainer(),this._clickTolerance=m.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(u,m){this.isEnabled()&&u.shiftKey&&u.button===0&&(o.disableDrag(),this._startPos=this._lastPos=m,this._active=!0)}mousemoveWindow(u,m){if(!this._active)return;const F=m;if(this._lastPos.equals(F)||!this._box&&F.dist(this._startPos)<this._clickTolerance)return;const $=this._startPos;this._lastPos=F,this._box||(this._box=o.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",u));const Z=Math.min($.x,F.x),ie=Math.max($.x,F.x),he=Math.min($.y,F.y),be=Math.max($.y,F.y);o.setTransform(this._box,`translate(${Z}px,${he}px)`),this._box.style.width=ie-Z+"px",this._box.style.height=be-he+"px"}mouseupWindow(u,m){if(!this._active||u.button!==0)return;const F=this._startPos,$=m;if(this.reset(),o.suppressClick(),F.x!==$.x||F.y!==$.y)return this._map.fire(new a.k("boxzoomend",{originalEvent:u})),{cameraAnimation:Z=>Z.fitScreenCoordinates(F,$,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",u)}keydown(u){this._active&&u.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",u))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(o.remove(this._box),this._box=null),o.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(u,m){return this._map.fire(new a.k(u,{originalEvent:m}))}}function _i(j,u){if(j.length!==u.length)throw new Error(`The number of touches and points are not equal - touches ${j.length}, points ${u.length}`);const m={};for(let F=0;F<j.length;F++)m[j[F].identifier]=u[F];return m}class no{constructor(u){this.reset(),this.numTouches=u.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(u,m,F){(this.centroid||F.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=u.timeStamp),F.length===this.numTouches&&(this.centroid=function($){const Z=new a.P(0,0);for(const ie of $)Z._add(ie);return Z.div($.length)}(m),this.touches=_i(F,m)))}touchmove(u,m,F){if(this.aborted||!this.centroid)return;const $=_i(F,m);for(const Z in this.touches){const ie=this.touches[Z],he=$[Z];(!he||he.dist(ie)>30)&&(this.aborted=!0)}}touchend(u,m,F){if((!this.centroid||u.timeStamp-this.startTime>500)&&(this.aborted=!0),F.length===0){const $=!this.aborted&&this.centroid;if(this.reset(),$)return $}}}class bi{constructor(u){this.singleTap=new no(u),this.numTaps=u.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(u,m,F){this.singleTap.touchstart(u,m,F)}touchmove(u,m,F){this.singleTap.touchmove(u,m,F)}touchend(u,m,F){const $=this.singleTap.touchend(u,m,F);if($){const Z=u.timeStamp-this.lastTime<500,ie=!this.lastTap||this.lastTap.dist($)<30;if(Z&&ie||this.reset(),this.count++,this.lastTime=u.timeStamp,this.lastTap=$,this.count===this.numTaps)return this.reset(),$}}}class uo{constructor(u){this._tr=new Ei(u),this._zoomIn=new bi({numTouches:1,numTaps:2}),this._zoomOut=new bi({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(u,m,F){this._zoomIn.touchstart(u,m,F),this._zoomOut.touchstart(u,m,F)}touchmove(u,m,F){this._zoomIn.touchmove(u,m,F),this._zoomOut.touchmove(u,m,F)}touchend(u,m,F){const $=this._zoomIn.touchend(u,m,F),Z=this._zoomOut.touchend(u,m,F),ie=this._tr;return $?(this._active=!0,u.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:he=>he.easeTo({duration:300,zoom:ie.zoom+1,around:ie.unproject($)},{originalEvent:u})}):Z?(this._active=!0,u.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:he=>he.easeTo({duration:300,zoom:ie.zoom-1,around:ie.unproject(Z)},{originalEvent:u})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class xo{constructor(u){this._enabled=!!u.enable,this._moveStateManager=u.moveStateManager,this._clickTolerance=u.clickTolerance||1,this._moveFunction=u.move,this._activateOnStart=!!u.activateOnStart,u.assignEvents(this),this.reset()}reset(u){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(u)}_move(...u){const m=this._moveFunction(...u);if(m.bearingDelta||m.pitchDelta||m.around||m.panDelta)return this._active=!0,m}dragStart(u,m){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(u)&&(this._moveStateManager.startMove(u),this._lastPoint=m.length?m[0]:m,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(u,m){if(!this.isEnabled())return;const F=this._lastPoint;if(!F)return;if(u.preventDefault(),!this._moveStateManager.isValidMoveEvent(u))return void this.reset(u);const $=m.length?m[0]:m;return!this._moved&&$.dist(F)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=$,this._move(F,$))}dragEnd(u){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(u)&&(this._moved&&o.suppressClick(),this.reset(u))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const el={0:1,2:2};class ns{constructor(u){this._correctEvent=u.checkCorrectEvent}startMove(u){const m=o.mouseButton(u);this._eventButton=m}endMove(u){delete this._eventButton}isValidStartEvent(u){return this._correctEvent(u)}isValidMoveEvent(u){return!function(m,F){const $=el[F];return m.buttons===void 0||(m.buttons&$)!==$}(u,this._eventButton)}isValidEndEvent(u){return o.mouseButton(u)===this._eventButton}}class Fl{constructor(){this._firstTouch=void 0}_isOneFingerTouch(u){return u.targetTouches.length===1}_isSameTouchEvent(u){return u.targetTouches[0].identifier===this._firstTouch}startMove(u){const m=u.targetTouches[0].identifier;this._firstTouch=m}endMove(u){delete this._firstTouch}isValidStartEvent(u){return this._isOneFingerTouch(u)}isValidMoveEvent(u){return this._isOneFingerTouch(u)&&this._isSameTouchEvent(u)}isValidEndEvent(u){return this._isOneFingerTouch(u)&&this._isSameTouchEvent(u)}}const Mo=j=>{j.mousedown=j.dragStart,j.mousemoveWindow=j.dragMove,j.mouseup=j.dragEnd,j.contextmenu=u=>{u.preventDefault()}},Zl=({enable:j,clickTolerance:u,bearingDegreesPerPixelMoved:m=.8})=>{const F=new ns({checkCorrectEvent:$=>o.mouseButton($)===0&&$.ctrlKey||o.mouseButton($)===2});return new xo({clickTolerance:u,move:($,Z)=>({bearingDelta:(Z.x-$.x)*m}),moveStateManager:F,enable:j,assignEvents:Mo})},tl=({enable:j,clickTolerance:u,pitchDegreesPerPixelMoved:m=-.5})=>{const F=new ns({checkCorrectEvent:$=>o.mouseButton($)===0&&$.ctrlKey||o.mouseButton($)===2});return new xo({clickTolerance:u,move:($,Z)=>({pitchDelta:(Z.y-$.y)*m}),moveStateManager:F,enable:j,assignEvents:Mo})};class Cs{constructor(u,m){this._clickTolerance=u.clickTolerance||1,this._map=m,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new a.P(0,0)}_shouldBePrevented(u){return u<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(u,m,F){return this._calculateTransform(u,m,F)}touchmove(u,m,F){if(this._active){if(!this._shouldBePrevented(F.length))return u.preventDefault(),this._calculateTransform(u,m,F);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",u)}}touchend(u,m,F){this._calculateTransform(u,m,F),this._active&&this._shouldBePrevented(F.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(u,m,F){F.length>0&&(this._active=!0);const $=_i(F,m),Z=new a.P(0,0),ie=new a.P(0,0);let he=0;for(const Ce in $){const ze=$[Ce],$e=this._touches[Ce];$e&&(Z._add(ze),ie._add(ze.sub($e)),he++,$[Ce]=ze)}if(this._touches=$,this._shouldBePrevented(he)||!ie.mag())return;const be=ie.div(he);return this._sum._add(be),this._sum.mag()<this._clickTolerance?void 0:{around:Z.div(he),panDelta:be}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ho{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(u,m,F){this._firstTwoTouches||F.length<2||(this._firstTwoTouches=[F[0].identifier,F[1].identifier],this._start([m[0],m[1]]))}touchmove(u,m,F){if(!this._firstTwoTouches)return;u.preventDefault();const[$,Z]=this._firstTwoTouches,ie=xi(F,m,$),he=xi(F,m,Z);if(!ie||!he)return;const be=this._aroundCenter?null:ie.add(he).div(2);return this._move([ie,he],be,u)}touchend(u,m,F){if(!this._firstTwoTouches)return;const[$,Z]=this._firstTwoTouches,ie=xi(F,m,$),he=xi(F,m,Z);ie&&he||(this._active&&o.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(u){this._enabled=!0,this._aroundCenter=!!u&&u.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function xi(j,u,m){for(let F=0;F<j.length;F++)if(j[F].identifier===m)return u[F]}function Ts(j,u){return Math.log(j/u)/Math.LN2}class sr extends ho{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(u){this._startDistance=this._distance=u[0].dist(u[1])}_move(u,m){const F=this._distance;if(this._distance=u[0].dist(u[1]),this._active||!(Math.abs(Ts(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Ts(this._distance,F),pinchAround:m}}}function Ec(j,u){return 180*j.angleWith(u)/Math.PI}class tu extends ho{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(u){this._startVector=this._vector=u[0].sub(u[1]),this._minDiameter=u[0].dist(u[1])}_move(u,m,F){const $=this._vector;if(this._vector=u[0].sub(u[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Ec(this._vector,$),pinchAround:m}}_isBelowThreshold(u){this._minDiameter=Math.min(this._minDiameter,u.mag());const m=25/(Math.PI*this._minDiameter)*360,F=Ec(u,this._startVector);return Math.abs(F)<m}}function al(j){return Math.abs(j.y)>Math.abs(j.x)}class Dl extends ho{constructor(u){super(),this._currentTouchCount=0,this._map=u}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(u,m,F){super.touchstart(u,m,F),this._currentTouchCount=F.length}_start(u){this._lastPoints=u,al(u[0].sub(u[1]))&&(this._valid=!1)}_move(u,m,F){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const $=u[0].sub(this._lastPoints[0]),Z=u[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically($,Z,F.timeStamp),this._valid?(this._lastPoints=u,this._active=!0,{pitchDelta:($.y+Z.y)/2*-.5}):void 0}gestureBeginsVertically(u,m,F){if(this._valid!==void 0)return this._valid;const $=u.mag()>=2,Z=m.mag()>=2;if(!$&&!Z)return;if(!$||!Z)return this._firstMove===void 0&&(this._firstMove=F),F-this._firstMove<100&&void 0;const ie=u.y>0==m.y>0;return al(u)&&al(m)&&ie}}const nl={panStep:100,bearingStep:15,pitchStep:10};class dc{constructor(u){this._tr=new Ei(u);const m=nl;this._panStep=m.panStep,this._bearingStep=m.bearingStep,this._pitchStep=m.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(u){if(u.altKey||u.ctrlKey||u.metaKey)return;let m=0,F=0,$=0,Z=0,ie=0;switch(u.keyCode){case 61:case 107:case 171:case 187:m=1;break;case 189:case 109:case 173:m=-1;break;case 37:u.shiftKey?F=-1:(u.preventDefault(),Z=-1);break;case 39:u.shiftKey?F=1:(u.preventDefault(),Z=1);break;case 38:u.shiftKey?$=1:(u.preventDefault(),ie=-1);break;case 40:u.shiftKey?$=-1:(u.preventDefault(),ie=1);break;default:return}return this._rotationDisabled&&(F=0,$=0),{cameraAnimation:he=>{const be=this._tr;he.easeTo({duration:300,easeId:"keyboardHandler",easing:qn,zoom:m?Math.round(be.zoom)+m*(u.shiftKey?2:1):be.zoom,bearing:be.bearing+F*this._bearingStep,pitch:be.pitch+$*this._pitchStep,offset:[-Z*this._panStep,-ie*this._panStep],center:be.center},{originalEvent:u})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function qn(j){return j*(2-j)}const rs=4.000244140625;class rl{constructor(u,m){this._onTimeout=F=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(F)},this._map=u,this._tr=new Ei(u),this._triggerRenderFrame=m,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(u){this._defaultZoomRate=u}setWheelZoomRate(u){this._wheelZoomRate=u}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(u){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!u&&u.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(u){return!!this._map.cooperativeGestures.isEnabled()&&!(u.ctrlKey||this._map.cooperativeGestures.isBypassed(u))}wheel(u){if(!this.isEnabled())return;if(this._shouldBePrevented(u))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",u);let m=u.deltaMode===WheelEvent.DOM_DELTA_LINE?40*u.deltaY:u.deltaY;const F=c.now(),$=F-(this._lastWheelEventTime||0);this._lastWheelEventTime=F,m!==0&&m%rs==0?this._type="wheel":m!==0&&Math.abs(m)<4?this._type="trackpad":$>400?(this._type=null,this._lastValue=m,this._timeout=setTimeout(this._onTimeout,40,u)):this._type||(this._type=Math.abs($*m)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,m+=this._lastValue)),u.shiftKey&&m&&(m/=4),this._type&&(this._lastWheelEvent=u,this._delta-=m,this._active||this._start(u)),u.preventDefault()}_start(u){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const m=o.mousePos(this._map.getCanvas(),u),F=this._tr;m.y>F.transform.height/2-F.transform.getHorizon()?this._around=a.N.convert(this._aroundCenter?F.center:F.unproject(m)):this._around=a.N.convert(F.center),this._aroundPoint=F.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const u=this._tr.transform;if(this._delta!==0){const be=this._type==="wheel"&&Math.abs(this._delta)>rs?this._wheelZoomRate:this._defaultZoomRate;let Ce=2/(1+Math.exp(-Math.abs(this._delta*be)));this._delta<0&&Ce!==0&&(Ce=1/Ce);const ze=typeof this._targetZoom=="number"?u.zoomScale(this._targetZoom):u.scale;this._targetZoom=Math.min(u.maxZoom,Math.max(u.minZoom,u.scaleZoom(ze*Ce))),this._type==="wheel"&&(this._startZoom=u.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const m=typeof this._targetZoom=="number"?this._targetZoom:u.zoom,F=this._startZoom,$=this._easing;let Z,ie=!1;const he=c.now()-this._lastWheelEventTime;if(this._type==="wheel"&&F&&$&&he){const be=Math.min(he/200,1),Ce=$(be);Z=a.z.number(F,m,Ce),be<1?this._frameId||(this._frameId=!0):ie=!0}else Z=m,ie=!0;return this._active=!0,ie&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ie,zoomDelta:Z-u.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(u){let m=a.b9;if(this._prevEase){const F=this._prevEase,$=(c.now()-F.start)/F.duration,Z=F.easing($+.01)-F.easing($),ie=.27/Math.sqrt(Z*Z+1e-4)*.01,he=Math.sqrt(.0729-ie*ie);m=a.b8(ie,he,.25,1)}return this._prevEase={start:c.now(),duration:u,easing:m},m}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Mi{constructor(u,m){this._clickZoom=u,this._tapZoom=m}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Go{constructor(u){this._tr=new Ei(u),this.reset()}reset(){this._active=!1}dblclick(u,m){return u.preventDefault(),{cameraAnimation:F=>{F.easeTo({duration:300,zoom:this._tr.zoom+(u.shiftKey?-1:1),around:this._tr.unproject(m)},{originalEvent:u})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class il{constructor(){this._tap=new bi({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(u,m,F){if(!this._swipePoint)if(this._tapTime){const $=m[0],Z=u.timeStamp-this._tapTime<500,ie=this._tapPoint.dist($)<30;Z&&ie?F.length>0&&(this._swipePoint=$,this._swipeTouch=F[0].identifier):this.reset()}else this._tap.touchstart(u,m,F)}touchmove(u,m,F){if(this._tapTime){if(this._swipePoint){if(F[0].identifier!==this._swipeTouch)return;const $=m[0],Z=$.y-this._swipePoint.y;return this._swipePoint=$,u.preventDefault(),this._active=!0,{zoomDelta:Z/128}}}else this._tap.touchmove(u,m,F)}touchend(u,m,F){if(this._tapTime)this._swipePoint&&F.length===0&&this.reset();else{const $=this._tap.touchend(u,m,F);$&&(this._tapTime=u.timeStamp,this._tapPoint=$)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class As{constructor(u,m,F){this._el=u,this._mousePan=m,this._touchPan=F}enable(u){this._inertiaOptions=u||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Lo{constructor(u,m,F){this._pitchWithRotate=u.pitchWithRotate,this._mouseRotate=m,this._mousePitch=F}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class ol{constructor(u,m,F,$){this._el=u,this._touchZoom=m,this._touchRotate=F,this._tapDragZoom=$,this._rotationDisabled=!1,this._enabled=!0}enable(u){this._touchZoom.enable(u),this._rotationDisabled||this._touchRotate.enable(u),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class ds{constructor(u,m){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=u,this._options=m,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const u=this._map.getCanvasContainer();u.classList.add("maplibregl-cooperative-gestures"),this._container=o.create("div","maplibregl-cooperative-gesture-screen",u);let m=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(m=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const F=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),$=document.createElement("div");$.className="maplibregl-desktop-message",$.textContent=m,this._container.appendChild($);const Z=document.createElement("div");Z.className="maplibregl-mobile-message",Z.textContent=F,this._container.appendChild(Z),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(o.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(u){return u[this._bypassKey]}notifyGestureBlocked(u,m){this._enabled&&(this._map.fire(new a.k("cooperativegestureprevented",{gestureType:u,originalEvent:m})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const qo=j=>j.zoom||j.drag||j.pitch||j.rotate;class Es extends a.k{}function nr(j){return j.panDelta&&j.panDelta.mag()||j.zoomDelta||j.bearingDelta||j.pitchDelta}class si{constructor(u,m){this.handleWindowEvent=$=>{this.handleEvent($,`${$.type}Window`)},this.handleEvent=($,Z)=>{if($.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const ie=$.type==="renderFrame"?void 0:$,he={needsRenderFrame:!1},be={},Ce={},ze=$.touches,$e=ze?this._getMapTouches(ze):void 0,nt=$e?o.touchPos(this._map.getCanvas(),$e):o.mousePos(this._map.getCanvas(),$);for(const{handlerName:xt,handler:Et,allowed:Ct}of this._handlers){if(!Et.isEnabled())continue;let Rt;this._blockedByActive(Ce,Ct,xt)?Et.reset():Et[Z||$.type]&&(Rt=Et[Z||$.type]($,nt,$e),this.mergeHandlerResult(he,be,Rt,xt,ie),Rt&&Rt.needsRenderFrame&&this._triggerRenderFrame()),(Rt||Et.isActive())&&(Ce[xt]=Et)}const ct={};for(const xt in this._previousActiveHandlers)Ce[xt]||(ct[xt]=ie);this._previousActiveHandlers=Ce,(Object.keys(ct).length||nr(he))&&(this._changes.push([he,be,ct]),this._triggerRenderFrame()),(Object.keys(Ce).length||nr(he))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:pt}=he;pt&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],pt(this._map))},this._map=u,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new cc(u),this._bearingSnap=m.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(m);const F=this._el;this._listeners=[[F,"touchstart",{passive:!0}],[F,"touchmove",{passive:!1}],[F,"touchend",void 0],[F,"touchcancel",void 0],[F,"mousedown",void 0],[F,"mousemove",void 0],[F,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[F,"mouseover",void 0],[F,"mouseout",void 0],[F,"dblclick",void 0],[F,"click",void 0],[F,"keydown",{capture:!1}],[F,"keyup",void 0],[F,"wheel",{passive:!1}],[F,"contextmenu",void 0],[window,"blur",void 0]];for(const[$,Z,ie]of this._listeners)o.addEventListener($,Z,$===document?this.handleWindowEvent:this.handleEvent,ie)}destroy(){for(const[u,m,F]of this._listeners)o.removeEventListener(u,m,u===document?this.handleWindowEvent:this.handleEvent,F)}_addDefaultHandlers(u){const m=this._map,F=m.getCanvasContainer();this._add("mapEvent",new uc(m,u));const $=m.boxZoom=new bo(m,u);this._add("boxZoom",$),u.interactive&&u.boxZoom&&$.enable();const Z=m.cooperativeGestures=new ds(m,u.cooperativeGestures);this._add("cooperativeGestures",Z),u.cooperativeGestures&&Z.enable();const ie=new uo(m),he=new Go(m);m.doubleClickZoom=new Mi(he,ie),this._add("tapZoom",ie),this._add("clickZoom",he),u.interactive&&u.doubleClickZoom&&m.doubleClickZoom.enable();const be=new il;this._add("tapDragZoom",be);const Ce=m.touchPitch=new Dl(m);this._add("touchPitch",Ce),u.interactive&&u.touchPitch&&m.touchPitch.enable(u.touchPitch);const ze=Zl(u),$e=tl(u);m.dragRotate=new Lo(u,ze,$e),this._add("mouseRotate",ze,["mousePitch"]),this._add("mousePitch",$e,["mouseRotate"]),u.interactive&&u.dragRotate&&m.dragRotate.enable();const nt=(({enable:Rt,clickTolerance:At})=>{const Zt=new ns({checkCorrectEvent:Kt=>o.mouseButton(Kt)===0&&!Kt.ctrlKey});return new xo({clickTolerance:At,move:(Kt,Yt)=>({around:Yt,panDelta:Yt.sub(Kt)}),activateOnStart:!0,moveStateManager:Zt,enable:Rt,assignEvents:Mo})})(u),ct=new Cs(u,m);m.dragPan=new As(F,nt,ct),this._add("mousePan",nt),this._add("touchPan",ct,["touchZoom","touchRotate"]),u.interactive&&u.dragPan&&m.dragPan.enable(u.dragPan);const pt=new tu,xt=new sr;m.touchZoomRotate=new ol(F,xt,pt,be),this._add("touchRotate",pt,["touchPan","touchZoom"]),this._add("touchZoom",xt,["touchPan","touchRotate"]),u.interactive&&u.touchZoomRotate&&m.touchZoomRotate.enable(u.touchZoomRotate);const Et=m.scrollZoom=new rl(m,()=>this._triggerRenderFrame());this._add("scrollZoom",Et,["mousePan"]),u.interactive&&u.scrollZoom&&m.scrollZoom.enable(u.scrollZoom);const Ct=m.keyboard=new dc(m);this._add("keyboard",Ct),u.interactive&&u.keyboard&&m.keyboard.enable(),this._add("blockableMapEvent",new Oo(m))}_add(u,m,F){this._handlers.push({handlerName:u,handler:m,allowed:F}),this._handlersById[u]=m}stop(u){if(!this._updatingCamera){for(const{handler:m}of this._handlers)m.reset();this._inertia.clear(),this._fireEvents({},{},u),this._changes=[]}}isActive(){for(const{handler:u}of this._handlers)if(u.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!qo(this._eventsInProgress)||this.isZooming()}_blockedByActive(u,m,F){for(const $ in u)if($!==F&&(!m||m.indexOf($)<0))return!0;return!1}_getMapTouches(u){const m=[];for(const F of u){const $=F.target;this._el.contains($)&&m.push(F)}return m}mergeHandlerResult(u,m,F,$,Z){if(!F)return;a.e(u,F);const ie={handlerName:$,originalEvent:F.originalEvent||Z};F.zoomDelta!==void 0&&(m.zoom=ie),F.panDelta!==void 0&&(m.drag=ie),F.pitchDelta!==void 0&&(m.pitch=ie),F.bearingDelta!==void 0&&(m.rotate=ie)}_applyChanges(){const u={},m={},F={};for(const[$,Z,ie]of this._changes)$.panDelta&&(u.panDelta=(u.panDelta||new a.P(0,0))._add($.panDelta)),$.zoomDelta&&(u.zoomDelta=(u.zoomDelta||0)+$.zoomDelta),$.bearingDelta&&(u.bearingDelta=(u.bearingDelta||0)+$.bearingDelta),$.pitchDelta&&(u.pitchDelta=(u.pitchDelta||0)+$.pitchDelta),$.around!==void 0&&(u.around=$.around),$.pinchAround!==void 0&&(u.pinchAround=$.pinchAround),$.noInertia&&(u.noInertia=$.noInertia),a.e(m,Z),a.e(F,ie);this._updateMapTransform(u,m,F),this._changes=[]}_updateMapTransform(u,m,F){const $=this._map,Z=$._getTransformForUpdate(),ie=$.terrain;if(!(nr(u)||ie&&this._terrainMovement))return this._fireEvents(m,F,!0);let{panDelta:he,zoomDelta:be,bearingDelta:Ce,pitchDelta:ze,around:$e,pinchAround:nt}=u;nt!==void 0&&($e=nt),$._stop(!0),$e=$e||$.transform.centerPoint;const ct=Z.pointLocation(he?$e.sub(he):$e);Ce&&(Z.bearing+=Ce),ze&&(Z.pitch+=ze),be&&(Z.zoom+=be),ie?this._terrainMovement||!m.drag&&!m.zoom?m.drag&&this._terrainMovement?Z.center=Z.pointLocation(Z.centerPoint.sub(he)):Z.setLocationAtPoint(ct,$e):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Z.setLocationAtPoint(ct,$e)):Z.setLocationAtPoint(ct,$e),$._applyUpdatedTransform(Z),this._map._update(),u.noInertia||this._inertia.record(u),this._fireEvents(m,F,!0)}_fireEvents(u,m,F){const $=qo(this._eventsInProgress),Z=qo(u),ie={};for(const $e in u){const{originalEvent:nt}=u[$e];this._eventsInProgress[$e]||(ie[`${$e}start`]=nt),this._eventsInProgress[$e]=u[$e]}!$&&Z&&this._fireEvent("movestart",Z.originalEvent);for(const $e in ie)this._fireEvent($e,ie[$e]);Z&&this._fireEvent("move",Z.originalEvent);for(const $e in u){const{originalEvent:nt}=u[$e];this._fireEvent($e,nt)}const he={};let be;for(const $e in this._eventsInProgress){const{handlerName:nt,originalEvent:ct}=this._eventsInProgress[$e];this._handlersById[nt].isActive()||(delete this._eventsInProgress[$e],be=m[nt]||ct,he[`${$e}end`]=be)}for(const $e in he)this._fireEvent($e,he[$e]);const Ce=qo(this._eventsInProgress),ze=($||Z)&&!Ce;if(ze&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const $e=this._map._getTransformForUpdate();$e.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform($e)}if(F&&ze){this._updatingCamera=!0;const $e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),nt=ct=>ct!==0&&-this._bearingSnap<ct&&ct<this._bearingSnap;!$e||!$e.essential&&c.prefersReducedMotion?(this._map.fire(new a.k("moveend",{originalEvent:be})),nt(this._map.getBearing())&&this._map.resetNorth()):(nt($e.bearing||this._map.getBearing())&&($e.bearing=0),$e.freezeElevation=!0,this._map.easeTo($e,{originalEvent:be})),this._updatingCamera=!1}}_fireEvent(u,m){this._map.fire(new a.k(u,m?{originalEvent:m}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(u=>{delete this._frameId,this.handleEvent(new Es("renderFrame",{timeStamp:u})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class ro extends a.E{constructor(u,m){super(),this._renderFrameCallback=()=>{const F=Math.min((c.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(F)),F<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=u,this._bearingSnap=m.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new a.N(this.transform.center.lng,this.transform.center.lat)}setCenter(u,m){return this.jumpTo({center:u},m)}panBy(u,m,F){return u=a.P.convert(u).mult(-1),this.panTo(this.transform.center,a.e({offset:u},m),F)}panTo(u,m,F){return this.easeTo(a.e({center:u},m),F)}getZoom(){return this.transform.zoom}setZoom(u,m){return this.jumpTo({zoom:u},m),this}zoomTo(u,m,F){return this.easeTo(a.e({zoom:u},m),F)}zoomIn(u,m){return this.zoomTo(this.getZoom()+1,u,m),this}zoomOut(u,m){return this.zoomTo(this.getZoom()-1,u,m),this}getBearing(){return this.transform.bearing}setBearing(u,m){return this.jumpTo({bearing:u},m),this}getPadding(){return this.transform.padding}setPadding(u,m){return this.jumpTo({padding:u},m),this}rotateTo(u,m,F){return this.easeTo(a.e({bearing:u},m),F)}resetNorth(u,m){return this.rotateTo(0,a.e({duration:1e3},u),m),this}resetNorthPitch(u,m){return this.easeTo(a.e({bearing:0,pitch:0,duration:1e3},u),m),this}snapToNorth(u,m){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(u,m):this}getPitch(){return this.transform.pitch}setPitch(u,m){return this.jumpTo({pitch:u},m),this}cameraForBounds(u,m){u=Ae.convert(u);const F=m&&m.bearing||0;return this._cameraForBoxAndBearing(u.getNorthWest(),u.getSouthEast(),F,m)}_cameraForBoxAndBearing(u,m,F,$){const Z={top:0,bottom:0,right:0,left:0};if(typeof($=a.e({padding:Z,offset:[0,0],maxZoom:this.transform.maxZoom},$)).padding=="number"){const yn=$.padding;$.padding={top:yn,bottom:yn,right:yn,left:yn}}$.padding=a.e(Z,$.padding);const ie=this.transform,he=ie.padding,be=new Ae(u,m),Ce=ie.project(be.getNorthWest()),ze=ie.project(be.getNorthEast()),$e=ie.project(be.getSouthEast()),nt=ie.project(be.getSouthWest()),ct=a.ba(-F),pt=Ce.rotate(ct),xt=ze.rotate(ct),Et=$e.rotate(ct),Ct=nt.rotate(ct),Rt=new a.P(Math.max(pt.x,xt.x,Ct.x,Et.x),Math.max(pt.y,xt.y,Ct.y,Et.y)),At=new a.P(Math.min(pt.x,xt.x,Ct.x,Et.x),Math.min(pt.y,xt.y,Ct.y,Et.y)),Zt=Rt.sub(At),Kt=(ie.width-(he.left+he.right+$.padding.left+$.padding.right))/Zt.x,Yt=(ie.height-(he.top+he.bottom+$.padding.top+$.padding.bottom))/Zt.y;if(Yt<0||Kt<0)return void a.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const da=Math.min(ie.scaleZoom(ie.scale*Math.min(Kt,Yt)),$.maxZoom),ba=a.P.convert($.offset),Na=($.padding.left-$.padding.right)/2,Fa=($.padding.top-$.padding.bottom)/2,Ua=new a.P(Na,Fa).rotate(a.ba(F)),Ja=ba.add(Ua).mult(ie.scale/ie.zoomScale(da));return{center:ie.unproject(Ce.add($e).div(2).sub(Ja)),zoom:da,bearing:F}}fitBounds(u,m,F){return this._fitInternal(this.cameraForBounds(u,m),m,F)}fitScreenCoordinates(u,m,F,$,Z){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(a.P.convert(u)),this.transform.pointLocation(a.P.convert(m)),F,$),$,Z)}_fitInternal(u,m,F){return u?(delete(m=a.e(u,m)).padding,m.linear?this.easeTo(m,F):this.flyTo(m,F)):this}jumpTo(u,m){this.stop();const F=this._getTransformForUpdate();let $=!1,Z=!1,ie=!1;return"zoom"in u&&F.zoom!==+u.zoom&&($=!0,F.zoom=+u.zoom),u.center!==void 0&&(F.center=a.N.convert(u.center)),"bearing"in u&&F.bearing!==+u.bearing&&(Z=!0,F.bearing=+u.bearing),"pitch"in u&&F.pitch!==+u.pitch&&(ie=!0,F.pitch=+u.pitch),u.padding==null||F.isPaddingEqual(u.padding)||(F.padding=u.padding),this._applyUpdatedTransform(F),this.fire(new a.k("movestart",m)).fire(new a.k("move",m)),$&&this.fire(new a.k("zoomstart",m)).fire(new a.k("zoom",m)).fire(new a.k("zoomend",m)),Z&&this.fire(new a.k("rotatestart",m)).fire(new a.k("rotate",m)).fire(new a.k("rotateend",m)),ie&&this.fire(new a.k("pitchstart",m)).fire(new a.k("pitch",m)).fire(new a.k("pitchend",m)),this.fire(new a.k("moveend",m))}calculateCameraOptionsFromTo(u,m,F,$=0){const Z=a.Z.fromLngLat(u,m),ie=a.Z.fromLngLat(F,$),he=ie.x-Z.x,be=ie.y-Z.y,Ce=ie.z-Z.z,ze=Math.hypot(he,be,Ce);if(ze===0)throw new Error("Can't calculate camera options with same From and To");const $e=Math.hypot(he,be),nt=this.transform.scaleZoom(this.transform.cameraToCenterDistance/ze/this.transform.tileSize),ct=180*Math.atan2(he,-be)/Math.PI;let pt=180*Math.acos($e/ze)/Math.PI;return pt=Ce<0?90-pt:90+pt,{center:ie.toLngLat(),zoom:nt,pitch:pt,bearing:ct}}easeTo(u,m){var F;this._stop(!1,u.easeId),((u=a.e({offset:[0,0],duration:500,easing:a.b9},u)).animate===!1||!u.essential&&c.prefersReducedMotion)&&(u.duration=0);const $=this._getTransformForUpdate(),Z=$.zoom,ie=$.bearing,he=$.pitch,be=$.padding,Ce="bearing"in u?this._normalizeBearing(u.bearing,ie):ie,ze="pitch"in u?+u.pitch:he,$e="padding"in u?u.padding:$.padding,nt=a.P.convert(u.offset);let ct=$.centerPoint.add(nt);const pt=$.pointLocation(ct),{center:xt,zoom:Et}=$.getConstrained(a.N.convert(u.center||pt),(F=u.zoom)!==null&&F!==void 0?F:Z);this._normalizeCenter(xt,$);const Ct=$.project(pt),Rt=$.project(xt).sub(Ct),At=$.zoomScale(Et-Z);let Zt,Kt;u.around&&(Zt=a.N.convert(u.around),Kt=$.locationPoint(Zt));const Yt={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||Et!==Z,this._rotating=this._rotating||ie!==Ce,this._pitching=this._pitching||ze!==he,this._padding=!$.isPaddingEqual($e),this._easeId=u.easeId,this._prepareEase(m,u.noMoveStart,Yt),this.terrain&&this._prepareElevation(xt),this._ease(da=>{if(this._zooming&&($.zoom=a.z.number(Z,Et,da)),this._rotating&&($.bearing=a.z.number(ie,Ce,da)),this._pitching&&($.pitch=a.z.number(he,ze,da)),this._padding&&($.interpolatePadding(be,$e,da),ct=$.centerPoint.add(nt)),this.terrain&&!u.freezeElevation&&this._updateElevation(da),Zt)$.setLocationAtPoint(Zt,Kt);else{const ba=$.zoomScale($.zoom-Z),Na=Et>Z?Math.min(2,At):Math.max(.5,At),Fa=Math.pow(Na,1-da),Ua=$.unproject(Ct.add(Rt.mult(da*Fa)).mult(ba));$.setLocationAtPoint($.renderWorldCopies?Ua.wrap():Ua,ct)}this._applyUpdatedTransform($),this._fireMoveEvents(m)},da=>{this.terrain&&u.freezeElevation&&this._finalizeElevation(),this._afterEase(m,da)},u),this}_prepareEase(u,m,F={}){this._moving=!0,m||F.moving||this.fire(new a.k("movestart",u)),this._zooming&&!F.zooming&&this.fire(new a.k("zoomstart",u)),this._rotating&&!F.rotating&&this.fire(new a.k("rotatestart",u)),this._pitching&&!F.pitching&&this.fire(new a.k("pitchstart",u))}_prepareElevation(u){this._elevationCenter=u,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(u,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(u){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const m=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(u<1&&m!==this._elevationTarget){const F=this._elevationTarget-this._elevationStart,$=(m-(F*u+this._elevationStart))/(1-u);this._elevationStart+=u*(F-$),this._elevationTarget=m}this.transform.elevation=a.z.number(this._elevationStart,this._elevationTarget,u)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(u){const m=u.getCameraPosition(),F=this.terrain.getElevationForLngLatZoom(m.lngLat,u.zoom);if(m.altitude<F){const $=this.calculateCameraOptionsFromTo(m.lngLat,F,u.center,u.elevation);return{pitch:$.pitch,zoom:$.zoom}}return{}}_applyUpdatedTransform(u){const m=[];if(this.terrain&&m.push($=>this._elevateCameraIfInsideTerrain($)),this.transformCameraUpdate&&m.push($=>this.transformCameraUpdate($)),!m.length)return;const F=u.clone();for(const $ of m){const Z=F.clone(),{center:ie,zoom:he,pitch:be,bearing:Ce,elevation:ze}=$(Z);ie&&(Z.center=ie),he!==void 0&&(Z.zoom=he),be!==void 0&&(Z.pitch=be),Ce!==void 0&&(Z.bearing=Ce),ze!==void 0&&(Z.elevation=ze),F.apply(Z)}this.transform.apply(F)}_fireMoveEvents(u){this.fire(new a.k("move",u)),this._zooming&&this.fire(new a.k("zoom",u)),this._rotating&&this.fire(new a.k("rotate",u)),this._pitching&&this.fire(new a.k("pitch",u))}_afterEase(u,m){if(this._easeId&&m&&this._easeId===m)return;delete this._easeId;const F=this._zooming,$=this._rotating,Z=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,F&&this.fire(new a.k("zoomend",u)),$&&this.fire(new a.k("rotateend",u)),Z&&this.fire(new a.k("pitchend",u)),this.fire(new a.k("moveend",u))}flyTo(u,m){var F;if(!u.essential&&c.prefersReducedMotion){const rn=a.M(u,["center","zoom","bearing","pitch","around"]);return this.jumpTo(rn,m)}this.stop(),u=a.e({offset:[0,0],speed:1.2,curve:1.42,easing:a.b9},u);const $=this._getTransformForUpdate(),Z=$.zoom,ie=$.bearing,he=$.pitch,be=$.padding,Ce="bearing"in u?this._normalizeBearing(u.bearing,ie):ie,ze="pitch"in u?+u.pitch:he,$e="padding"in u?u.padding:$.padding,nt=a.P.convert(u.offset);let ct=$.centerPoint.add(nt);const pt=$.pointLocation(ct),{center:xt,zoom:Et}=$.getConstrained(a.N.convert(u.center||pt),(F=u.zoom)!==null&&F!==void 0?F:Z);this._normalizeCenter(xt,$);const Ct=$.zoomScale(Et-Z),Rt=$.project(pt),At=$.project(xt).sub(Rt);let Zt=u.curve;const Kt=Math.max($.width,$.height),Yt=Kt/Ct,da=At.mag();if("minZoom"in u){const rn=a.ad(Math.min(u.minZoom,Z,Et),$.minZoom,$.maxZoom),Cn=Kt/$.zoomScale(rn-Z);Zt=Math.sqrt(Cn/da*2)}const ba=Zt*Zt;function Na(rn){const Cn=(Yt*Yt-Kt*Kt+(rn?-1:1)*ba*ba*da*da)/(2*(rn?Yt:Kt)*ba*da);return Math.log(Math.sqrt(Cn*Cn+1)-Cn)}function Fa(rn){return(Math.exp(rn)-Math.exp(-rn))/2}function Ua(rn){return(Math.exp(rn)+Math.exp(-rn))/2}const Ja=Na(!1);let yn=function(rn){return Ua(Ja)/Ua(Ja+Zt*rn)},Qa=function(rn){return Kt*((Ua(Ja)*(Fa(Cn=Ja+Zt*rn)/Ua(Cn))-Fa(Ja))/ba)/da;var Cn},wn=(Na(!0)-Ja)/Zt;if(Math.abs(da)<1e-6||!isFinite(wn)){if(Math.abs(Kt-Yt)<1e-6)return this.easeTo(u,m);const rn=Yt<Kt?-1:1;wn=Math.abs(Math.log(Yt/Kt))/Zt,Qa=()=>0,yn=Cn=>Math.exp(rn*Zt*Cn)}if("duration"in u)u.duration=+u.duration;else{const rn="screenSpeed"in u?+u.screenSpeed/Zt:+u.speed;u.duration=1e3*wn/rn}return u.maxDuration&&u.duration>u.maxDuration&&(u.duration=0),this._zooming=!0,this._rotating=ie!==Ce,this._pitching=ze!==he,this._padding=!$.isPaddingEqual($e),this._prepareEase(m,!1),this.terrain&&this._prepareElevation(xt),this._ease(rn=>{const Cn=rn*wn,fn=1/yn(Cn);$.zoom=rn===1?Et:Z+$.scaleZoom(fn),this._rotating&&($.bearing=a.z.number(ie,Ce,rn)),this._pitching&&($.pitch=a.z.number(he,ze,rn)),this._padding&&($.interpolatePadding(be,$e,rn),ct=$.centerPoint.add(nt)),this.terrain&&!u.freezeElevation&&this._updateElevation(rn);const In=rn===1?xt:$.unproject(Rt.add(At.mult(Qa(Cn))).mult(fn));$.setLocationAtPoint($.renderWorldCopies?In.wrap():In,ct),this._applyUpdatedTransform($),this._fireMoveEvents(m)},()=>{this.terrain&&u.freezeElevation&&this._finalizeElevation(),this._afterEase(m)},u),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(u,m){var F;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const $=this._onEaseEnd;delete this._onEaseEnd,$.call(this,m)}return u||(F=this.handlers)===null||F===void 0||F.stop(!1),this}_ease(u,m,F){F.animate===!1||F.duration===0?(u(1),m()):(this._easeStart=c.now(),this._easeOptions=F,this._onEaseFrame=u,this._onEaseEnd=m,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(u,m){u=a.b3(u,-180,180);const F=Math.abs(u-m);return Math.abs(u-360-m)<F&&(u-=360),Math.abs(u+360-m)<F&&(u+=360),u}_normalizeCenter(u,m){if(!m.renderWorldCopies||m.lngRange)return;const F=u.lng-m.center.lng;u.lng+=F>180?-360:F<-180?360:0}queryTerrainElevation(u){return this.terrain?this.terrain.getElevationForLngLatZoom(a.N.convert(u),this.transform.tileZoom)-this.transform.elevation:null}}const zo={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class is{constructor(u=zo){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=m=>{!m||m.sourceDataType!=="metadata"&&m.sourceDataType!=="visibility"&&m.dataType!=="style"&&m.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=u}getDefaultPosition(){return"bottom-right"}onAdd(u){return this._map=u,this._compact=this.options.compact,this._container=o.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=o.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){o.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(u,m){const F=this._map._getUIString(`AttributionControl.${m}`);u.title=F,u.setAttribute("aria-label",F)}_updateAttributions(){if(!this._map.style)return;let u=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?u=u.concat(this.options.customAttribution.map($=>typeof $!="string"?"":$)):typeof this.options.customAttribution=="string"&&u.push(this.options.customAttribution)),this._map.style.stylesheet){const $=this._map.style.stylesheet;this.styleOwner=$.owner,this.styleId=$.id}const m=this._map.style.sourceCaches;for(const $ in m){const Z=m[$];if(Z.used||Z.usedForTerrain){const ie=Z.getSource();ie.attribution&&u.indexOf(ie.attribution)<0&&u.push(ie.attribution)}}u=u.filter($=>String($).trim()),u.sort(($,Z)=>$.length-Z.length),u=u.filter(($,Z)=>{for(let ie=Z+1;ie<u.length;ie++)if(u[ie].indexOf($)>=0)return!1;return!0});const F=u.join(" | ");F!==this._attribHTML&&(this._attribHTML=F,u.length?(this._innerContainer.innerHTML=F,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class po{constructor(u={}){this._updateCompact=()=>{const m=this._container.children;if(m.length){const F=m[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&F.classList.add("maplibregl-compact"):F.classList.remove("maplibregl-compact")}},this.options=u}getDefaultPosition(){return"bottom-left"}onAdd(u){this._map=u,this._compact=this.options&&this.options.compact,this._container=o.create("div","maplibregl-ctrl");const m=o.create("a","maplibregl-ctrl-logo");return m.target="_blank",m.rel="noopener nofollow",m.href="https://maplibre.org/",m.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),m.setAttribute("rel","noopener nofollow"),this._container.appendChild(m),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){o.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Mc{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(u){const m=++this._id;return this._queue.push({callback:u,id:m,cancelled:!1}),m}remove(u){const m=this._currentlyRunning,F=m?this._queue.concat(m):this._queue;for(const $ of F)if($.id===u)return void($.cancelled=!0)}run(u=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const m=this._currentlyRunning=this._queue;this._queue=[];for(const F of m)if(!F.cancelled&&(F.callback(u),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var er=a.Y([{name:"a_pos3d",type:"Int16",components:3}]);class No extends a.E{constructor(u){super(),this.sourceCache=u,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,u.usedForTerrain=!0,u.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(u,m){this.sourceCache.update(u,m),this._renderableTilesKeys=[];const F={};for(const $ of u.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:m}))F[$.key]=!0,this._renderableTilesKeys.push($.key),this._tiles[$.key]||($.posMatrix=new Float64Array(16),a.aQ($.posMatrix,0,a.X,0,a.X,0,1),this._tiles[$.key]=new we($,this.tileSize));for(const $ in this._tiles)F[$]||delete this._tiles[$]}freeRtt(u){for(const m in this._tiles){const F=this._tiles[m];(!u||F.tileID.equals(u)||F.tileID.isChildOf(u)||u.isChildOf(F.tileID))&&(F.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(u=>this.getTileByID(u))}getTileByID(u){return this._tiles[u]}getTerrainCoords(u){const m={};for(const F of this._renderableTilesKeys){const $=this._tiles[F].tileID;if($.canonical.equals(u.canonical)){const Z=u.clone();Z.posMatrix=new Float64Array(16),a.aQ(Z.posMatrix,0,a.X,0,a.X,0,1),m[F]=Z}else if($.canonical.isChildOf(u.canonical)){const Z=u.clone();Z.posMatrix=new Float64Array(16);const ie=$.canonical.z-u.canonical.z,he=$.canonical.x-($.canonical.x>>ie<<ie),be=$.canonical.y-($.canonical.y>>ie<<ie),Ce=a.X>>ie;a.aQ(Z.posMatrix,0,Ce,0,Ce,0,1),a.J(Z.posMatrix,Z.posMatrix,[-he*Ce,-be*Ce,0]),m[F]=Z}else if(u.canonical.isChildOf($.canonical)){const Z=u.clone();Z.posMatrix=new Float64Array(16);const ie=u.canonical.z-$.canonical.z,he=u.canonical.x-(u.canonical.x>>ie<<ie),be=u.canonical.y-(u.canonical.y>>ie<<ie),Ce=a.X>>ie;a.aQ(Z.posMatrix,0,a.X,0,a.X,0,1),a.J(Z.posMatrix,Z.posMatrix,[he*Ce,be*Ce,0]),a.K(Z.posMatrix,Z.posMatrix,[1/2**ie,1/2**ie,0]),m[F]=Z}}return m}getSourceTile(u,m){const F=this.sourceCache._source;let $=u.overscaledZ-this.deltaZoom;if($>F.maxzoom&&($=F.maxzoom),$<F.minzoom)return null;this._sourceTileCache[u.key]||(this._sourceTileCache[u.key]=u.scaledTo($).key);let Z=this.sourceCache.getTileByID(this._sourceTileCache[u.key]);if((!Z||!Z.dem)&&m)for(;$>=F.minzoom&&(!Z||!Z.dem);)Z=this.sourceCache.getTileByID(u.scaledTo($--).key);return Z}tilesAfterTime(u=Date.now()){return Object.values(this._tiles).filter(m=>m.timeAdded>=u)}}class li{constructor(u,m,F){this.painter=u,this.sourceCache=new No(m),this.options=F,this.exaggeration=typeof F.exaggeration=="number"?F.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(u,m,F,$=a.X){var Z;if(!(m>=0&&m<$&&F>=0&&F<$))return 0;const ie=this.getTerrainData(u),he=(Z=ie.tile)===null||Z===void 0?void 0:Z.dem;if(!he)return 0;const be=function(pt,xt,Et){var Ct=xt[0],Rt=xt[1];return pt[0]=Et[0]*Ct+Et[4]*Rt+Et[12],pt[1]=Et[1]*Ct+Et[5]*Rt+Et[13],pt}([],[m/$*a.X,F/$*a.X],ie.u_terrain_matrix),Ce=[be[0]*he.dim,be[1]*he.dim],ze=Math.floor(Ce[0]),$e=Math.floor(Ce[1]),nt=Ce[0]-ze,ct=Ce[1]-$e;return he.get(ze,$e)*(1-nt)*(1-ct)+he.get(ze+1,$e)*nt*(1-ct)+he.get(ze,$e+1)*(1-nt)*ct+he.get(ze+1,$e+1)*nt*ct}getElevationForLngLatZoom(u,m){const{tileID:F,mercatorX:$,mercatorY:Z}=this._getOverscaledTileIDFromLngLatZoom(u,m);return this.getElevation(F,$%a.X,Z%a.X,a.X)}getElevation(u,m,F,$=a.X){return this.getDEMElevation(u,m,F,$)*this.exaggeration}getTerrainData(u){if(!this._emptyDemTexture){const $=this.painter.context,Z=new a.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new L($,Z,$.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new L($,new a.R({width:1,height:1}),$.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind($.gl.NEAREST,$.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=a.ao([])}const m=this.sourceCache.getSourceTile(u,!0);if(m&&m.dem&&(!m.demTexture||m.needsTerrainPrepare)){const $=this.painter.context;m.demTexture=this.painter.getTileTexture(m.dem.stride),m.demTexture?m.demTexture.update(m.dem.getPixels(),{premultiply:!1}):m.demTexture=new L($,m.dem.getPixels(),$.gl.RGBA,{premultiply:!1}),m.demTexture.bind($.gl.NEAREST,$.gl.CLAMP_TO_EDGE),m.needsTerrainPrepare=!1}const F=m&&m+m.tileID.key+u.key;if(F&&!this._demMatrixCache[F]){const $=this.sourceCache.sourceCache._source.maxzoom;let Z=u.canonical.z-m.tileID.canonical.z;u.overscaledZ>u.canonical.z&&(u.canonical.z>=$?Z=u.canonical.z-$:a.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const ie=u.canonical.x-(u.canonical.x>>Z<<Z),he=u.canonical.y-(u.canonical.y>>Z<<Z),be=a.bb(new Float64Array(16),[1/(a.X<<Z),1/(a.X<<Z),0]);a.J(be,be,[ie*a.X,he*a.X,0]),this._demMatrixCache[u.key]={matrix:be,coord:u}}return{u_depth:2,u_terrain:3,u_terrain_dim:m&&m.dem&&m.dem.dim||1,u_terrain_matrix:F?this._demMatrixCache[u.key].matrix:this._emptyDemMatrix,u_terrain_unpack:m&&m.dem&&m.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(m&&m.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:m}}getFramebuffer(u){const m=this.painter,F=m.width/devicePixelRatio,$=m.height/devicePixelRatio;return!this._fbo||this._fbo.width===F&&this._fbo.height===$||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new L(m.context,{width:F,height:$,data:null},m.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(m.context.gl.NEAREST,m.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new L(m.context,{width:F,height:$,data:null},m.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(m.context.gl.NEAREST,m.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=m.context.createFramebuffer(F,$,!0,!1),this._fbo.depthAttachment.set(m.context.createRenderbuffer(m.context.gl.DEPTH_COMPONENT16,F,$))),this._fbo.colorAttachment.set(u==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const u=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const m=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let Z=0,ie=0;Z<this._coordsTextureSize;Z++)for(let he=0;he<this._coordsTextureSize;he++,ie+=4)m[ie+0]=255&he,m[ie+1]=255&Z,m[ie+2]=he>>8<<4|Z>>8,m[ie+3]=0;const F=new a.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(m.buffer)),$=new L(u,F,u.gl.RGBA,{premultiply:!1});return $.bind(u.gl.NEAREST,u.gl.CLAMP_TO_EDGE),this._coordsTexture=$,$}pointCoordinate(u){this.painter.maybeDrawDepthAndCoords(!0);const m=new Uint8Array(4),F=this.painter.context,$=F.gl,Z=Math.round(u.x*this.painter.pixelRatio/devicePixelRatio),ie=Math.round(u.y*this.painter.pixelRatio/devicePixelRatio),he=Math.round(this.painter.height/devicePixelRatio);F.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),$.readPixels(Z,he-ie-1,1,1,$.RGBA,$.UNSIGNED_BYTE,m),F.bindFramebuffer.set(null);const be=m[0]+(m[2]>>4<<8),Ce=m[1]+((15&m[2])<<8),ze=this.coordsIndex[255-m[3]],$e=ze&&this.sourceCache.getTileByID(ze);if(!$e)return null;const nt=this._coordsTextureSize,ct=(1<<$e.tileID.canonical.z)*nt;return new a.Z(($e.tileID.canonical.x*nt+be)/ct+$e.tileID.wrap,($e.tileID.canonical.y*nt+Ce)/ct,this.getElevation($e.tileID,be,Ce,nt))}depthAtPoint(u){const m=new Uint8Array(4),F=this.painter.context,$=F.gl;return F.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),$.readPixels(u.x,this.painter.height/devicePixelRatio-u.y-1,1,1,$.RGBA,$.UNSIGNED_BYTE,m),F.bindFramebuffer.set(null),(m[0]/16777216+m[1]/65536+m[2]/256+m[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;const u=this.painter.context,m=new a.bc,F=new a.aY,$=this.meshSize,Z=a.X/$,ie=$*$;for(let $e=0;$e<=$;$e++)for(let nt=0;nt<=$;nt++)m.emplaceBack(nt*Z,$e*Z,0);for(let $e=0;$e<ie;$e+=$+1)for(let nt=0;nt<$;nt++)F.emplaceBack(nt+$e,$+nt+$e+1,$+nt+$e+2),F.emplaceBack(nt+$e,$+nt+$e+2,nt+$e+1);const he=m.length,be=he+2*($+1);for(const $e of[0,1])for(let nt=0;nt<=$;nt++)for(const ct of[0,1])m.emplaceBack(nt*Z,$e*a.X,ct);for(let $e=0;$e<2*$;$e+=2)F.emplaceBack(be+$e,be+$e+1,be+$e+3),F.emplaceBack(be+$e,be+$e+3,be+$e+2),F.emplaceBack(he+$e,he+$e+3,he+$e+1),F.emplaceBack(he+$e,he+$e+2,he+$e+3);const Ce=m.length,ze=Ce+2*($+1);for(const $e of[0,1])for(let nt=0;nt<=$;nt++)for(const ct of[0,1])m.emplaceBack($e*a.X,nt*Z,ct);for(let $e=0;$e<2*$;$e+=2)F.emplaceBack(Ce+$e,Ce+$e+1,Ce+$e+3),F.emplaceBack(Ce+$e,Ce+$e+3,Ce+$e+2),F.emplaceBack(ze+$e,ze+$e+3,ze+$e+1),F.emplaceBack(ze+$e,ze+$e+2,ze+$e+3);return this._mesh=new sc(u.createVertexBuffer(m,er.members),u.createIndexBuffer(F),a.a0.simpleSegment(0,0,m.length,F.length)),this._mesh}getMeshFrameDelta(u){return 2*Math.PI*a.bd/Math.pow(2,u)/5}getMinTileElevationForLngLatZoom(u,m){var F;const{tileID:$}=this._getOverscaledTileIDFromLngLatZoom(u,m);return(F=this.getMinMaxElevation($).minElevation)!==null&&F!==void 0?F:0}getMinMaxElevation(u){const m=this.getTerrainData(u).tile,F={minElevation:null,maxElevation:null};return m&&m.dem&&(F.minElevation=m.dem.min*this.exaggeration,F.maxElevation=m.dem.max*this.exaggeration),F}_getOverscaledTileIDFromLngLatZoom(u,m){const F=a.Z.fromLngLat(u.wrap()),$=(1<<m)*a.X,Z=F.x*$,ie=F.y*$,he=Math.floor(Z/a.X),be=Math.floor(ie/a.X);return{tileID:new a.S(m,0,m,he,be),mercatorX:Z,mercatorY:ie}}}class Rl{constructor(u,m,F){this._context=u,this._size=m,this._tileSize=F,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const u of this._objects)u.texture.destroy(),u.fbo.destroy()}_createObject(u){const m=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),F=new L(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return F.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),m.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),m.colorAttachment.set(F.texture),{id:u,fbo:m,texture:F,stamp:-1,inUse:!1}}getObjectForId(u){return this._objects[u]}useObject(u){u.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(m=>u.id!==m),this._recentlyUsed.push(u.id)}stampObject(u){u.stamp=++this._stamp}getOrCreateFreeObject(){for(const m of this._recentlyUsed)if(!this._objects[m].inUse)return this._objects[m];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const u=this._createObject(this._objects.length);return this._objects.push(u),u}freeObject(u){u.inUse=!1}freeAllObjects(){for(const u of this._objects)this.freeObject(u)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(u=>!u.inUse)===!1}}const hs={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class js{constructor(u,m){this.painter=u,this.terrain=m,this.pool=new Rl(u.context,30,m.sourceCache.tileSize*m.qualityFactor)}destruct(){this.pool.destruct()}getTexture(u){return this.pool.getObjectForId(u.rtt[this._stacks.length-1].id).texture}prepareForRender(u,m){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=u._order.filter(F=>!u._layers[F].isHidden(m)),this._coordsDescendingInv={};for(const F in u.sourceCaches){this._coordsDescendingInv[F]={};const $=u.sourceCaches[F].getVisibleCoordinates();for(const Z of $){const ie=this.terrain.sourceCache.getTerrainCoords(Z);for(const he in ie)this._coordsDescendingInv[F][he]||(this._coordsDescendingInv[F][he]=[]),this._coordsDescendingInv[F][he].push(ie[he])}}this._coordsDescendingInvStr={};for(const F of u._order){const $=u._layers[F],Z=$.source;if(hs[$.type]&&!this._coordsDescendingInvStr[Z]){this._coordsDescendingInvStr[Z]={};for(const ie in this._coordsDescendingInv[Z])this._coordsDescendingInvStr[Z][ie]=this._coordsDescendingInv[Z][ie].map(he=>he.key).sort().join()}}for(const F of this._renderableTiles)for(const $ in this._coordsDescendingInvStr){const Z=this._coordsDescendingInvStr[$][F.tileID.key];Z&&Z!==F.rttCoords[$]&&(F.rtt=[])}}renderLayer(u){if(u.isHidden(this.painter.transform.zoom))return!1;const m=u.type,F=this.painter,$=this._renderableLayerIds[this._renderableLayerIds.length-1]===u.id;if(hs[m]&&(this._prevType&&hs[this._prevType]||this._stacks.push([]),this._prevType=m,this._stacks[this._stacks.length-1].push(u.id),!$))return!0;if(hs[this._prevType]||hs[m]&&$){this._prevType=m;const Z=this._stacks.length-1,ie=this._stacks[Z]||[];for(const he of this._renderableTiles){if(this.pool.isFull()&&(oc(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(he),he.rtt[Z]){const Ce=this.pool.getObjectForId(he.rtt[Z].id);if(Ce.stamp===he.rtt[Z].stamp){this.pool.useObject(Ce);continue}}const be=this.pool.getOrCreateFreeObject();this.pool.useObject(be),this.pool.stampObject(be),he.rtt[Z]={id:be.id,stamp:be.stamp},F.context.bindFramebuffer.set(be.fbo.framebuffer),F.context.clear({color:a.aN.transparent,stencil:0}),F.currentStencilSource=void 0;for(let Ce=0;Ce<ie.length;Ce++){const ze=F.style._layers[ie[Ce]],$e=ze.source?this._coordsDescendingInv[ze.source][he.tileID.key]:[he.tileID];F.context.viewport.set([0,0,be.fbo.width,be.fbo.height]),F._renderTileClippingMasks(ze,$e),F.renderLayer(F,F.style.sourceCaches[ze.source],ze,$e),ze.source&&(he.rttCoords[ze.source]=this._coordsDescendingInvStr[ze.source][he.tileID.key])}}return oc(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),hs[m]}return!1}}const jc={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Ic=_,sl={hash:!1,interactive:!0,bearingSnap:7,attributionControl:zo,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:a.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},Bi=j=>{j.touchstart=j.dragStart,j.touchmoveWindow=j.dragMove,j.touchend=j.dragEnd},Ms={showCompass:!0,showZoom:!0,visualizePitch:!1};class Zn{constructor(u,m,F=!1){this.mousedown=ie=>{this.startMouse(a.e({},ie,{ctrlKey:!0,preventDefault:()=>ie.preventDefault()}),o.mousePos(this.element,ie)),o.addEventListener(window,"mousemove",this.mousemove),o.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=ie=>{this.moveMouse(ie,o.mousePos(this.element,ie))},this.mouseup=ie=>{this.mouseRotate.dragEnd(ie),this.mousePitch&&this.mousePitch.dragEnd(ie),this.offTemp()},this.touchstart=ie=>{ie.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=o.touchPos(this.element,ie.targetTouches)[0],this.startTouch(ie,this._startPos),o.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.addEventListener(window,"touchend",this.touchend))},this.touchmove=ie=>{ie.targetTouches.length!==1?this.reset():(this._lastPos=o.touchPos(this.element,ie.targetTouches)[0],this.moveTouch(ie,this._lastPos))},this.touchend=ie=>{ie.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const $=u.dragRotate._mouseRotate.getClickTolerance(),Z=u.dragRotate._mousePitch.getClickTolerance();this.element=m,this.mouseRotate=Zl({clickTolerance:$,enable:!0}),this.touchRotate=(({enable:ie,clickTolerance:he,bearingDegreesPerPixelMoved:be=.8})=>{const Ce=new Fl;return new xo({clickTolerance:he,move:(ze,$e)=>({bearingDelta:($e.x-ze.x)*be}),moveStateManager:Ce,enable:ie,assignEvents:Bi})})({clickTolerance:$,enable:!0}),this.map=u,F&&(this.mousePitch=tl({clickTolerance:Z,enable:!0}),this.touchPitch=(({enable:ie,clickTolerance:he,pitchDegreesPerPixelMoved:be=-.5})=>{const Ce=new Fl;return new xo({clickTolerance:he,move:(ze,$e)=>({pitchDelta:($e.y-ze.y)*be}),moveStateManager:Ce,enable:ie,assignEvents:Bi})})({clickTolerance:Z,enable:!0})),o.addEventListener(m,"mousedown",this.mousedown),o.addEventListener(m,"touchstart",this.touchstart,{passive:!1}),o.addEventListener(m,"touchcancel",this.reset)}startMouse(u,m){this.mouseRotate.dragStart(u,m),this.mousePitch&&this.mousePitch.dragStart(u,m),o.disableDrag()}startTouch(u,m){this.touchRotate.dragStart(u,m),this.touchPitch&&this.touchPitch.dragStart(u,m),o.disableDrag()}moveMouse(u,m){const F=this.map,{bearingDelta:$}=this.mouseRotate.dragMove(u,m)||{};if($&&F.setBearing(F.getBearing()+$),this.mousePitch){const{pitchDelta:Z}=this.mousePitch.dragMove(u,m)||{};Z&&F.setPitch(F.getPitch()+Z)}}moveTouch(u,m){const F=this.map,{bearingDelta:$}=this.touchRotate.dragMove(u,m)||{};if($&&F.setBearing(F.getBearing()+$),this.touchPitch){const{pitchDelta:Z}=this.touchPitch.dragMove(u,m)||{};Z&&F.setPitch(F.getPitch()+Z)}}off(){const u=this.element;o.removeEventListener(u,"mousedown",this.mousedown),o.removeEventListener(u,"touchstart",this.touchstart,{passive:!1}),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend),o.removeEventListener(u,"touchcancel",this.reset),this.offTemp()}offTemp(){o.enableDrag(),o.removeEventListener(window,"mousemove",this.mousemove),o.removeEventListener(window,"mouseup",this.mouseup),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend)}}let gr;function Wo(j,u,m){const F=new a.N(j.lng,j.lat);if(j=new a.N(j.lng,j.lat),u){const $=new a.N(j.lng-360,j.lat),Z=new a.N(j.lng+360,j.lat),ie=m.locationPoint(j).distSqr(u);m.locationPoint($).distSqr(u)<ie?j=$:m.locationPoint(Z).distSqr(u)<ie&&(j=Z)}for(;Math.abs(j.lng-m.center.lng)>180;){const $=m.locationPoint(j);if($.x>=0&&$.y>=0&&$.x<=m.width&&$.y<=m.height)break;j.lng>m.center.lng?j.lng-=360:j.lng+=360}return j.lng!==F.lng&&m.locationPoint(j).y>m.height/2-m.getHorizon()?j:F}const Is={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 ll(j,u,m){const F=j.classList;for(const $ in Is)F.remove(`maplibregl-${m}-anchor-${$}`);F.add(`maplibregl-${m}-anchor-${u}`)}class Fi extends a.E{constructor(u){if(super(),this._onKeyPress=m=>{const F=m.code,$=m.charCode||m.keyCode;F!=="Space"&&F!=="Enter"&&$!==32&&$!==13||this.togglePopup()},this._onMapClick=m=>{const F=m.originalEvent.target,$=this._element;this._popup&&(F===$||$.contains(F))&&this.togglePopup()},this._update=m=>{var F;if(!this._map)return;const $=this._map.loaded()&&!this._map.isMoving();((m==null?void 0:m.type)==="terrain"||(m==null?void 0:m.type)==="render"&&!$)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies?this._lngLat=Wo(this._lngLat,this._flatPos,this._map.transform):this._lngLat=(F=this._lngLat)===null||F===void 0?void 0:F.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let Z="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Z=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Z=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let ie="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?ie="rotateX(0deg)":this._pitchAlignment==="map"&&(ie=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||m&&m.type!=="moveend"||(this._pos=this._pos.round()),o.setTransform(this._element,`${Is[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${ie} ${Z}`),c.frameAsync(new AbortController).then(()=>{this._updateOpacity(m&&m.type==="moveend")}).catch(()=>{})},this._onMove=m=>{if(!this._isDragging){const F=this._clickTolerance||this._map._clickTolerance;this._isDragging=m.point.dist(this._pointerdownPos)>=F}this._isDragging&&(this._pos=m.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 a.k("dragstart"))),this.fire(new a.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new a.k("dragend")),this._state="inactive"},this._addDragHandler=m=>{this._element.contains(m.originalEvent.target)&&(m.preventDefault(),this._positionDelta=m.point.sub(this._pos).add(this._offset),this._pointerdownPos=m.point,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))},this._anchor=u&&u.anchor||"center",this._color=u&&u.color||"#3FB1CE",this._scale=u&&u.scale||1,this._draggable=u&&u.draggable||!1,this._clickTolerance=u&&u.clickTolerance||0,this._subpixelPositioning=u&&u.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=u&&u.rotation||0,this._rotationAlignment=u&&u.rotationAlignment||"auto",this._pitchAlignment=u&&u.pitchAlignment&&u.pitchAlignment!=="auto"?u.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(u==null?void 0:u.opacity,u==null?void 0:u.opacityWhenCovered),u&&u.element)this._element=u.element,this._offset=a.P.convert(u&&u.offset||[0,0]);else{this._defaultMarker=!0,this._element=o.create("div");const m=o.createNS("http://www.w3.org/2000/svg","svg"),F=41,$=27;m.setAttributeNS(null,"display","block"),m.setAttributeNS(null,"height",`${F}px`),m.setAttributeNS(null,"width",`${$}px`),m.setAttributeNS(null,"viewBox",`0 0 ${$} ${F}`);const Z=o.createNS("http://www.w3.org/2000/svg","g");Z.setAttributeNS(null,"stroke","none"),Z.setAttributeNS(null,"stroke-width","1"),Z.setAttributeNS(null,"fill","none"),Z.setAttributeNS(null,"fill-rule","evenodd");const ie=o.createNS("http://www.w3.org/2000/svg","g");ie.setAttributeNS(null,"fill-rule","nonzero");const he=o.createNS("http://www.w3.org/2000/svg","g");he.setAttributeNS(null,"transform","translate(3.0, 29.0)"),he.setAttributeNS(null,"fill","#000000");const be=[{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"}];for(const Ct of be){const Rt=o.createNS("http://www.w3.org/2000/svg","ellipse");Rt.setAttributeNS(null,"opacity","0.04"),Rt.setAttributeNS(null,"cx","10.5"),Rt.setAttributeNS(null,"cy","5.80029008"),Rt.setAttributeNS(null,"rx",Ct.rx),Rt.setAttributeNS(null,"ry",Ct.ry),he.appendChild(Rt)}const Ce=o.createNS("http://www.w3.org/2000/svg","g");Ce.setAttributeNS(null,"fill",this._color);const ze=o.createNS("http://www.w3.org/2000/svg","path");ze.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"),Ce.appendChild(ze);const $e=o.createNS("http://www.w3.org/2000/svg","g");$e.setAttributeNS(null,"opacity","0.25"),$e.setAttributeNS(null,"fill","#000000");const nt=o.createNS("http://www.w3.org/2000/svg","path");nt.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"),$e.appendChild(nt);const ct=o.createNS("http://www.w3.org/2000/svg","g");ct.setAttributeNS(null,"transform","translate(6.0, 7.0)"),ct.setAttributeNS(null,"fill","#FFFFFF");const pt=o.createNS("http://www.w3.org/2000/svg","g");pt.setAttributeNS(null,"transform","translate(8.0, 8.0)");const xt=o.createNS("http://www.w3.org/2000/svg","circle");xt.setAttributeNS(null,"fill","#000000"),xt.setAttributeNS(null,"opacity","0.25"),xt.setAttributeNS(null,"cx","5.5"),xt.setAttributeNS(null,"cy","5.5"),xt.setAttributeNS(null,"r","5.4999962");const Et=o.createNS("http://www.w3.org/2000/svg","circle");Et.setAttributeNS(null,"fill","#FFFFFF"),Et.setAttributeNS(null,"cx","5.5"),Et.setAttributeNS(null,"cy","5.5"),Et.setAttributeNS(null,"r","5.4999962"),pt.appendChild(xt),pt.appendChild(Et),ie.appendChild(he),ie.appendChild(Ce),ie.appendChild($e),ie.appendChild(ct),ie.appendChild(pt),m.appendChild(ie),m.setAttributeNS(null,"height",F*this._scale+"px"),m.setAttributeNS(null,"width",$*this._scale+"px"),this._element.appendChild(m),this._offset=a.P.convert(u&&u.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",m=>{m.preventDefault()}),this._element.addEventListener("mousedown",m=>{m.preventDefault()}),ll(this._element,this._anchor,"marker"),u&&u.className)for(const m of u.className.split(" "))this._element.classList.add(m);this._popup=null}addTo(u){return this.remove(),this._map=u,this._element.setAttribute("aria-label",u._getUIString("Marker.Title")),u.getCanvasContainer().appendChild(this._element),u.on("move",this._update),u.on("moveend",this._update),u.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",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),delete this._map),o.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(u){return this._lngLat=a.N.convert(u),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(u){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),u){if(!("offset"in u.options)){const m=Math.abs(13.5)/Math.SQRT2;u.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[m,-1*(24.6+m)],"bottom-right":[-m,-1*(24.6+m)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=u,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(u){return this._subpixelPositioning=u,this}getPopup(){return this._popup}togglePopup(){const u=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:u?(u.isOpen()?u.remove():(u.setLngLat(this._lngLat),u.addTo(this._map)),this):this}_updateOpacity(u=!1){var m,F;if(!(!((m=this._map)===null||m===void 0)&&m.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(u)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const $=this._map,Z=$.terrain.depthAtPoint(this._pos),ie=$.terrain.getElevationForLngLatZoom(this._lngLat,$.transform.tileZoom);if($.transform.lngLatToCameraDepth(this._lngLat,ie)-Z<.006)return void(this._element.style.opacity=this._opacity);const he=-this._offset.y/$.transform._pixelPerMeter,be=Math.sin($.getPitch()*Math.PI/180)*he,Ce=$.terrain.depthAtPoint(new a.P(this._pos.x,this._pos.y-this._offset.y)),ze=$.transform.lngLatToCameraDepth(this._lngLat,ie+be)-Ce>.006;!((F=this._popup)===null||F===void 0)&&F.isOpen()&&ze&&this._popup.remove(),this._element.style.opacity=ze?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(u){return this._offset=a.P.convert(u),this._update(),this}addClassName(u){this._element.classList.add(u)}removeClassName(u){this._element.classList.remove(u)}toggleClassName(u){return this._element.classList.toggle(u)}setDraggable(u){return this._draggable=!!u,this._map&&(u?(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}isDraggable(){return this._draggable}setRotation(u){return this._rotation=u||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(u){return this._rotationAlignment=u||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(u){return this._pitchAlignment=u&&u!=="auto"?u:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(u,m){return u===void 0&&m===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),u!==void 0&&(this._opacity=u),m!==void 0&&(this._opacityWhenCovered=m),this._map&&this._updateOpacity(!0),this}}const Vl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Qr=0,Yl=!1;class ir extends a.E{constructor(u){super(),this._onSuccess=m=>{if(this._map){if(this._isOutOfMapMaxBounds(m))return this._setErrorState(),this.fire(new a.k("outofmaxbounds",m)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=m,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(m),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(m),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new a.k("geolocate",m)),this._finish()}},this._updateCamera=m=>{const F=new a.N(m.coords.longitude,m.coords.latitude),$=m.coords.accuracy,Z=this._map.getBearing(),ie=a.e({bearing:Z},this.options.fitBoundsOptions),he=Ae.fromLngLat(F,$);this._map.fitBounds(he,ie,{geolocateSource:!0})},this._updateMarker=m=>{if(m){const F=new a.N(m.coords.longitude,m.coords.latitude);this._accuracyCircleMarker.setLngLat(F).addTo(this._map),this._userLocationDotMarker.setLngLat(F).addTo(this._map),this._accuracy=m.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=m=>{if(this._map){if(this.options.trackUserLocation)if(m.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const F=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=F,this._geolocateButton.setAttribute("aria-label",F),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(m.code===3&&Yl)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new a.k("error",m)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",m=>m.preventDefault()),this._geolocateButton=o.create("button","maplibregl-ctrl-geolocate",this._container),o.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=m=>{if(this._map){if(m===!1){a.w("Geolocation support is not available so the GeolocateControl will be disabled.");const F=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=F,this._geolocateButton.setAttribute("aria-label",F)}else{const F=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=F,this._geolocateButton.setAttribute("aria-label",F)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Fi({element:this._dotElement}),this._circleElement=o.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Fi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",F=>{const $=F.originalEvent&&F.originalEvent.type==="resize";F.geolocateSource||this._watchState!=="ACTIVE_LOCK"||$||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new a.k("trackuserlocationend")),this.fire(new a.k("userlocationlostfocus")))})}},this.options=a.e({},Vl,u)}onAdd(u){return this._map=u,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return a._(this,arguments,void 0,function*(m=!1){if(gr!==void 0&&!m)return gr;if(window.navigator.permissions===void 0)return gr=!!window.navigator.geolocation,gr;try{gr=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{gr=!!window.navigator.geolocation}return gr})}().then(m=>this._finishSetupUI(m)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(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(),o.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Qr=0,Yl=!1}_isOutOfMapMaxBounds(u){const m=this._map.getMaxBounds(),F=u.coords;return m&&(F.longitude<m.getWest()||F.longitude>m.getEast()||F.latitude<m.getSouth()||F.latitude>m.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const u=this._map.getBounds(),m=u.getSouthEast(),F=u.getNorthEast(),$=m.distanceTo(F),Z=this._map._container.clientHeight,ie=Math.ceil(this._accuracy/($/Z)*2);this._circleElement.style.width=`${ie}px`,this._circleElement.style.height=`${ie}px`}trigger(){if(!this._setup)return a.w("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 a.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Qr--,Yl=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new a.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new a.k("trackuserlocationstart")),this.fire(new a.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let u;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Qr++,Qr>1?(u={maximumAge:6e5,timeout:0},Yl=!0):(u=this.options.positionOptions,Yl=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,u)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}}const tr={maxWidth:100,unit:"metric"};function Ci(j,u,m){const F=m&&m.maxWidth||100,$=j._container.clientHeight/2,Z=j.unproject([0,$]),ie=j.unproject([F,$]),he=Z.distanceTo(ie);if(m&&m.unit==="imperial"){const be=3.2808*he;be>5280?fo(u,F,be/5280,j._getUIString("ScaleControl.Miles")):fo(u,F,be,j._getUIString("ScaleControl.Feet"))}else m&&m.unit==="nautical"?fo(u,F,he/1852,j._getUIString("ScaleControl.NauticalMiles")):he>=1e3?fo(u,F,he/1e3,j._getUIString("ScaleControl.Kilometers")):fo(u,F,he,j._getUIString("ScaleControl.Meters"))}function fo(j,u,m,F){const $=function(ie){const he=Math.pow(10,`${Math.floor(ie)}`.length-1);let be=ie/he;return be=be>=10?10:be>=5?5:be>=3?3:be>=2?2:be>=1?1:function(Ce){const ze=Math.pow(10,Math.ceil(-Math.log(Ce)/Math.LN10));return Math.round(Ce*ze)/ze}(be),he*be}(m),Z=$/m;j.style.width=u*Z+"px",j.innerHTML=`${$}&nbsp;${F}`}class jl extends a.E{constructor(u={}){super(),this._onFullscreenChange=()=>{var m;let F=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((m=F==null?void 0:F.shadowRoot)===null||m===void 0)&&m.fullscreenElement;)F=F.shadowRoot.fullscreenElement;F===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,u&&u.container&&(u.container instanceof HTMLElement?this._container=u.container:a.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(u){return this._map=u,this._container||(this._container=this._map.getContainer()),this._controlContainer=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){o.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const u=this._fullscreenButton=o.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);o.create("span","maplibregl-ctrl-icon",u).setAttribute("aria-hidden","true"),u.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const u=this._getTitle();this._fullscreenButton.setAttribute("aria-label",u),this._fullscreenButton.title=u}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new a.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new a.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}}const Zo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},yt=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");class wt extends a.E{constructor(u){super(),this.remove=()=>(this._content&&o.remove(this._content),this._container&&(o.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),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new a.k("close"))),this),this._onMouseUp=m=>{this._update(m.point)},this._onMouseMove=m=>{this._update(m.point)},this._onDrag=m=>{this._update(m.point)},this._update=m=>{var F;const $=this._lngLat||this._trackPointer;if(!this._map||!$||!this._content)return;if(!this._container){if(this._container=o.create("div","maplibregl-popup",this._map.getContainer()),this._tip=o.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const Ce of this.options.className.split(" "))this._container.classList.add(Ce);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(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=Wo(this._lngLat,this._flatPos,this._map.transform):this._lngLat=(F=this._lngLat)===null||F===void 0?void 0:F.wrap(),this._trackPointer&&!m)return;const Z=this._flatPos=this._pos=this._trackPointer&&m?m:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&m?m:this._map.transform.locationPoint(this._lngLat));let ie=this.options.anchor;const he=Ot(this.options.offset);if(!ie){const Ce=this._container.offsetWidth,ze=this._container.offsetHeight;let $e;$e=Z.y+he.bottom.y<ze?["top"]:Z.y>this._map.transform.height-ze?["bottom"]:[],Z.x<Ce/2?$e.push("left"):Z.x>this._map.transform.width-Ce/2&&$e.push("right"),ie=$e.length===0?"bottom":$e.join("-")}let be=Z.add(he[ie]);this.options.subpixelPositioning||(be=be.round()),o.setTransform(this._container,`${Is[ie]} translate(${be.x}px,${be.y}px)`),ll(this._container,ie,"popup")},this._onClose=()=>{this.remove()},this.options=a.e(Object.create(Zo),u)}addTo(u){return this._map&&this.remove(),this._map=u,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._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new a.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(u){return this._lngLat=a.N.convert(u),this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(u){return this.setDOMContent(document.createTextNode(u))}setHTML(u){const m=document.createDocumentFragment(),F=document.createElement("body");let $;for(F.innerHTML=u;$=F.firstChild,$;)m.appendChild($);return this.setDOMContent(m)}getMaxWidth(){var u;return(u=this._container)===null||u===void 0?void 0:u.style.maxWidth}setMaxWidth(u){return this.options.maxWidth=u,this._update(),this}setDOMContent(u){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=o.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(u),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(u){return this._container&&this._container.classList.add(u),this}removeClassName(u){return this._container&&this._container.classList.remove(u),this}setOffset(u){return this.options.offset=u,this._update(),this}toggleClassName(u){if(this._container)return this._container.classList.toggle(u)}setSubpixelPositioning(u){this.options.subpixelPositioning=u}_createCloseButton(){this.options.closeButton&&(this._closeButton=o.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const u=this._container.querySelector(yt);u&&u.focus()}}function Ot(j){if(j){if(typeof j=="number"){const u=Math.round(Math.abs(j)/Math.SQRT2);return{center:new a.P(0,0),top:new a.P(0,j),"top-left":new a.P(u,u),"top-right":new a.P(-u,u),bottom:new a.P(0,-j),"bottom-left":new a.P(u,-u),"bottom-right":new a.P(-u,-u),left:new a.P(j,0),right:new a.P(-j,0)}}if(j instanceof a.P||Array.isArray(j)){const u=a.P.convert(j);return{center:u,top:u,"top-left":u,"top-right":u,bottom:u,"bottom-left":u,"bottom-right":u,left:u,right:u}}return{center:a.P.convert(j.center||[0,0]),top:a.P.convert(j.top||[0,0]),"top-left":a.P.convert(j["top-left"]||[0,0]),"top-right":a.P.convert(j["top-right"]||[0,0]),bottom:a.P.convert(j.bottom||[0,0]),"bottom-left":a.P.convert(j["bottom-left"]||[0,0]),"bottom-right":a.P.convert(j["bottom-right"]||[0,0]),left:a.P.convert(j.left||[0,0]),right:a.P.convert(j.right||[0,0])}}return Ot(new a.P(0,0))}const te=_;d.AJAXError=a.bg,d.Evented=a.E,d.LngLat=a.N,d.MercatorCoordinate=a.Z,d.Point=a.P,d.addProtocol=a.bh,d.config=a.a,d.removeProtocol=a.bi,d.AttributionControl=is,d.BoxZoomHandler=bo,d.CanvasSource=Me,d.CooperativeGesturesHandler=ds,d.DoubleClickZoomHandler=Mi,d.DragPanHandler=As,d.DragRotateHandler=Lo,d.EdgeInsets=Nl,d.FullscreenControl=jl,d.GeoJSONSource=Ie,d.GeolocateControl=ir,d.Hash=ao,d.ImageSource=Be,d.KeyboardHandler=dc,d.LngLatBounds=Ae,d.LogoControl=po,d.Map=class extends ro{constructor(j){a.be.mark(a.bf.create);const u=Object.assign(Object.assign({},sl),j);if(u.minZoom!=null&&u.maxZoom!=null&&u.minZoom>u.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(u.minPitch!=null&&u.maxPitch!=null&&u.minPitch>u.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(u.minPitch!=null&&u.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(u.maxPitch!=null&&u.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new fi(u.minZoom,u.maxZoom,u.minPitch,u.maxPitch,u.renderWorldCopies),{bearingSnap:u.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Mc,this._controls=[],this._mapId=a.a4(),this._contextLost=F=>{F.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new a.k("webglcontextlost",{originalEvent:F}))},this._contextRestored=F=>{this._setupPainter(),this.resize(),this._update(),this.fire(new a.k("webglcontextrestored",{originalEvent:F}))},this._onMapScroll=F=>{if(F.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=u.interactive,this._maxTileCacheSize=u.maxTileCacheSize,this._maxTileCacheZoomLevels=u.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=u.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=u.preserveDrawingBuffer===!0,this._antialias=u.antialias===!0,this._trackResize=u.trackResize===!0,this._bearingSnap=u.bearingSnap,this._refreshExpiredTiles=u.refreshExpiredTiles===!0,this._fadeDuration=u.fadeDuration,this._crossSourceCollisions=u.crossSourceCollisions===!0,this._collectResourceTiming=u.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},jc),u.locale),this._clickTolerance=u.clickTolerance,this._overridePixelRatio=u.pixelRatio,this._maxCanvasSize=u.maxCanvasSize,this.transformCameraUpdate=u.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=u.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=C.addThrottleControl(()=>this.isMoving()),this._requestManager=new A(u.transformRequest),typeof u.container=="string"){if(this._container=document.getElementById(u.container),!this._container)throw new Error(`Container '${u.container}' not found.`)}else{if(!(u.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=u.container}if(u.maxBounds&&this.setMaxBounds(u.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let F=!1;const $=Vs(Z=>{this._trackResize&&!this._removed&&this.resize(Z)._update()},50);this._resizeObserver=new ResizeObserver(Z=>{F?$(Z):F=!0}),this._resizeObserver.observe(this._container)}this.handlers=new si(this,u);const m=typeof u.hash=="string"&&u.hash||void 0;this._hash=u.hash&&new ao(m).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:u.center,zoom:u.zoom,bearing:u.bearing,pitch:u.pitch}),u.bounds&&(this.resize(),this.fitBounds(u.bounds,a.e({},u.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=u.localIdeographFontFamily,this._validateStyle=u.validateStyle,u.style&&this.setStyle(u.style,{localIdeographFontFamily:u.localIdeographFontFamily}),u.attributionControl&&this.addControl(new is(typeof u.attributionControl=="boolean"?void 0:u.attributionControl)),u.maplibreLogo&&this.addControl(new po,u.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",F=>{this._update(F.dataType==="style"),this.fire(new a.k(`${F.dataType}data`,F))}),this.on("dataloading",F=>{this.fire(new a.k(`${F.dataType}dataloading`,F))}),this.on("dataabort",F=>{this.fire(new a.k("sourcedataabort",F))})}_getMapId(){return this._mapId}addControl(j,u){if(u===void 0&&(u=j.getDefaultPosition?j.getDefaultPosition():"top-right"),!j||!j.onAdd)return this.fire(new a.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const m=j.onAdd(this);this._controls.push(j);const F=this._controlPositions[u];return u.indexOf("bottom")!==-1?F.insertBefore(m,F.firstChild):F.appendChild(m),this}removeControl(j){if(!j||!j.onRemove)return this.fire(new a.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const u=this._controls.indexOf(j);return u>-1&&this._controls.splice(u,1),j.onRemove(this),this}hasControl(j){return this._controls.indexOf(j)>-1}calculateCameraOptionsFromTo(j,u,m,F){return F==null&&this.terrain&&(F=this.terrain.getElevationForLngLatZoom(m,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(j,u,m,F)}resize(j){var u;const m=this._containerDimensions(),F=m[0],$=m[1],Z=this._getClampedPixelRatio(F,$);if(this._resizeCanvas(F,$,Z),this.painter.resize(F,$,Z),this.painter.overLimit()){const he=this.painter.context.gl;this._maxCanvasSize=[he.drawingBufferWidth,he.drawingBufferHeight];const be=this._getClampedPixelRatio(F,$);this._resizeCanvas(F,$,be),this.painter.resize(F,$,be)}this.transform.resize(F,$),(u=this._requestedCameraState)===null||u===void 0||u.resize(F,$);const ie=!this._moving;return ie&&(this.stop(),this.fire(new a.k("movestart",j)).fire(new a.k("move",j))),this.fire(new a.k("resize",j)),ie&&this.fire(new a.k("moveend",j)),this}_getClampedPixelRatio(j,u){const{0:m,1:F}=this._maxCanvasSize,$=this.getPixelRatio(),Z=j*$,ie=u*$,he=Z>m?m/Z:1,be=ie>F?F/ie:1;return Math.min(he,be)*$}getPixelRatio(){var j;return(j=this._overridePixelRatio)!==null&&j!==void 0?j:devicePixelRatio}setPixelRatio(j){this._overridePixelRatio=j,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(j){return this.transform.setMaxBounds(Ae.convert(j)),this._update()}setMinZoom(j){if((j=j??-2)>=-2&&j<=this.transform.maxZoom)return this.transform.minZoom=j,this._update(),this.getZoom()<j&&this.setZoom(j),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(j){if((j=j??22)>=this.transform.minZoom)return this.transform.maxZoom=j,this._update(),this.getZoom()>j&&this.setZoom(j),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(j){if((j=j??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(j>=0&&j<=this.transform.maxPitch)return this.transform.minPitch=j,this._update(),this.getPitch()<j&&this.setPitch(j),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(j){if((j=j??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(j>=this.transform.minPitch)return this.transform.maxPitch=j,this._update(),this.getPitch()>j&&this.setPitch(j),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(j){return this.transform.renderWorldCopies=j,this._update()}project(j){return this.transform.locationPoint(a.N.convert(j),this.style&&this.terrain)}unproject(j){return this.transform.pointLocation(a.P.convert(j),this.terrain)}isMoving(){var j;return this._moving||((j=this.handlers)===null||j===void 0?void 0:j.isMoving())}isZooming(){var j;return this._zooming||((j=this.handlers)===null||j===void 0?void 0:j.isZooming())}isRotating(){var j;return this._rotating||((j=this.handlers)===null||j===void 0?void 0:j.isRotating())}_createDelegatedListener(j,u,m){if(j==="mouseenter"||j==="mouseover"){let F=!1;return{layer:u,listener:m,delegates:{mousemove:$=>{const Z=this.getLayer(u)?this.queryRenderedFeatures($.point,{layers:[u]}):[];Z.length?F||(F=!0,m.call(this,new Eo(j,this,$.originalEvent,{features:Z}))):F=!1},mouseout:()=>{F=!1}}}}if(j==="mouseleave"||j==="mouseout"){let F=!1;return{layer:u,listener:m,delegates:{mousemove:$=>{(this.getLayer(u)?this.queryRenderedFeatures($.point,{layers:[u]}):[]).length?F=!0:F&&(F=!1,m.call(this,new Eo(j,this,$.originalEvent)))},mouseout:$=>{F&&(F=!1,m.call(this,new Eo(j,this,$.originalEvent)))}}}}{const F=$=>{const Z=this.getLayer(u)?this.queryRenderedFeatures($.point,{layers:[u]}):[];Z.length&&($.features=Z,m.call(this,$),delete $.features)};return{layer:u,listener:m,delegates:{[j]:F}}}}on(j,u,m){if(m===void 0)return super.on(j,u);const F=this._createDelegatedListener(j,u,m);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[j]=this._delegatedListeners[j]||[],this._delegatedListeners[j].push(F);for(const $ in F.delegates)this.on($,F.delegates[$]);return this}once(j,u,m){if(m===void 0)return super.once(j,u);const F=this._createDelegatedListener(j,u,m);for(const $ in F.delegates)this.once($,F.delegates[$]);return this}off(j,u,m){return m===void 0?super.off(j,u):(this._delegatedListeners&&this._delegatedListeners[j]&&(F=>{const $=F[j];for(let Z=0;Z<$.length;Z++){const ie=$[Z];if(ie.layer===u&&ie.listener===m){for(const he in ie.delegates)this.off(he,ie.delegates[he]);return $.splice(Z,1),this}}})(this._delegatedListeners),this)}queryRenderedFeatures(j,u){if(!this.style)return[];let m;const F=j instanceof a.P||Array.isArray(j),$=F?j:[[0,0],[this.transform.width,this.transform.height]];if(u=u||(F?{}:j)||{},$ instanceof a.P||typeof $[0]=="number")m=[a.P.convert($)];else{const Z=a.P.convert($[0]),ie=a.P.convert($[1]);m=[Z,new a.P(ie.x,Z.y),ie,new a.P(Z.x,ie.y),Z]}return this.style.queryRenderedFeatures(m,u,this.transform)}querySourceFeatures(j,u){return this.style.querySourceFeatures(j,u)}setStyle(j,u){return(u=a.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},u)).diff!==!1&&u.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&j?(this._diffStyle(j,u),this):(this._localIdeographFontFamily=u.localIdeographFontFamily,this._updateStyle(j,u))}setTransformRequest(j){return this._requestManager.setTransformRequest(j),this}_getUIString(j){const u=this._locale[j];if(u==null)throw new Error(`Missing UI string '${j}'`);return u}_updateStyle(j,u){if(u.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(j,u));const m=this.style&&u.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!j)),j?(this.style=new jn(this,u||{}),this.style.setEventedParent(this,{style:this.style}),typeof j=="string"?this.style.loadURL(j,u,m):this.style.loadJSON(j,u,m),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new jn(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(j,u){if(typeof j=="string"){const m=j,F=this._requestManager.transformRequest(m,"Style");a.h(F,new AbortController).then($=>{this._updateDiff($.data,u)}).catch($=>{$&&this.fire(new a.j($))})}else typeof j=="object"&&this._updateDiff(j,u)}_updateDiff(j,u){try{this.style.setState(j,u)&&this._update(!0)}catch(m){a.w(`Unable to perform style diff: ${m.message||m.error||m}. Rebuilding the style from scratch.`),this._updateStyle(j,u)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():a.w("There is no style added to the map.")}addSource(j,u){return this._lazyInitEmptyStyle(),this.style.addSource(j,u),this._update(!0)}isSourceLoaded(j){const u=this.style&&this.style.sourceCaches[j];if(u!==void 0)return u.loaded();this.fire(new a.j(new Error(`There is no source with ID '${j}'`)))}setTerrain(j){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),j){const u=this.style.sourceCaches[j.source];if(!u)throw new Error(`cannot load terrain, because there exists no source with ID: ${j.source}`);this.terrain===null&&u.reload();for(const m in this.style._layers){const F=this.style._layers[m];F.type==="hillshade"&&F.source===j.source&&a.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new li(this.painter,u,j),this.painter.renderToTexture=new js(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=m=>{m.dataType==="style"?this.terrain.sourceCache.freeRtt():m.dataType==="source"&&m.tile&&(m.sourceId!==j.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(m.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new a.k("terrain",{terrain:j})),this}getTerrain(){var j,u;return(u=(j=this.terrain)===null||j===void 0?void 0:j.options)!==null&&u!==void 0?u:null}areTilesLoaded(){const j=this.style&&this.style.sourceCaches;for(const u in j){const m=j[u]._tiles;for(const F in m){const $=m[F];if($.state!=="loaded"&&$.state!=="errored")return!1}}return!0}removeSource(j){return this.style.removeSource(j),this._update(!0)}getSource(j){return this.style.getSource(j)}addImage(j,u,m={}){const{pixelRatio:F=1,sdf:$=!1,stretchX:Z,stretchY:ie,content:he,textFitWidth:be,textFitHeight:Ce}=m;if(this._lazyInitEmptyStyle(),!(u instanceof HTMLImageElement||a.b(u))){if(u.width===void 0||u.height===void 0)return this.fire(new a.j(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`")));{const{width:ze,height:$e,data:nt}=u,ct=u;return this.style.addImage(j,{data:new a.R({width:ze,height:$e},new Uint8Array(nt)),pixelRatio:F,stretchX:Z,stretchY:ie,content:he,textFitWidth:be,textFitHeight:Ce,sdf:$,version:0,userImage:ct}),ct.onAdd&&ct.onAdd(this,j),this}}{const{width:ze,height:$e,data:nt}=c.getImageData(u);this.style.addImage(j,{data:new a.R({width:ze,height:$e},nt),pixelRatio:F,stretchX:Z,stretchY:ie,content:he,textFitWidth:be,textFitHeight:Ce,sdf:$,version:0})}}updateImage(j,u){const m=this.style.getImage(j);if(!m)return this.fire(new a.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const F=u instanceof HTMLImageElement||a.b(u)?c.getImageData(u):u,{width:$,height:Z,data:ie}=F;if($===void 0||Z===void 0)return this.fire(new a.j(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`")));if($!==m.data.width||Z!==m.data.height)return this.fire(new a.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const he=!(u instanceof HTMLImageElement||a.b(u));return m.data.replace(ie,he),this.style.updateImage(j,m),this}getImage(j){return this.style.getImage(j)}hasImage(j){return j?!!this.style.getImage(j):(this.fire(new a.j(new Error("Missing required image id"))),!1)}removeImage(j){this.style.removeImage(j)}loadImage(j){return C.getImage(this._requestManager.transformRequest(j,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(j,u){return this._lazyInitEmptyStyle(),this.style.addLayer(j,u),this._update(!0)}moveLayer(j,u){return this.style.moveLayer(j,u),this._update(!0)}removeLayer(j){return this.style.removeLayer(j),this._update(!0)}getLayer(j){return this.style.getLayer(j)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(j,u,m){return this.style.setLayerZoomRange(j,u,m),this._update(!0)}setFilter(j,u,m={}){return this.style.setFilter(j,u,m),this._update(!0)}getFilter(j){return this.style.getFilter(j)}setPaintProperty(j,u,m,F={}){return this.style.setPaintProperty(j,u,m,F),this._update(!0)}getPaintProperty(j,u){return this.style.getPaintProperty(j,u)}setLayoutProperty(j,u,m,F={}){return this.style.setLayoutProperty(j,u,m,F),this._update(!0)}getLayoutProperty(j,u){return this.style.getLayoutProperty(j,u)}setGlyphs(j,u={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(j,u),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(j,u,m={}){return this._lazyInitEmptyStyle(),this.style.addSprite(j,u,m,F=>{F||this._update(!0)}),this}removeSprite(j){return this._lazyInitEmptyStyle(),this.style.removeSprite(j),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(j,u={}){return this._lazyInitEmptyStyle(),this.style.setSprite(j,u,m=>{m||this._update(!0)}),this}setLight(j,u={}){return this._lazyInitEmptyStyle(),this.style.setLight(j,u),this._update(!0)}getLight(){return this.style.getLight()}setSky(j){return this._lazyInitEmptyStyle(),this.style.setSky(j),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(j,u){return this.style.setFeatureState(j,u),this._update()}removeFeatureState(j,u){return this.style.removeFeatureState(j,u),this._update()}getFeatureState(j){return this.style.getFeatureState(j)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let j=0,u=0;return this._container&&(j=this._container.clientWidth||400,u=this._container.clientHeight||300),[j,u]}_setupContainer(){const j=this._container;j.classList.add("maplibregl-map");const u=this._canvasContainer=o.create("div","maplibregl-canvas-container",j);this._interactive&&u.classList.add("maplibregl-interactive"),this._canvas=o.create("canvas","maplibregl-canvas",u),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const m=this._containerDimensions(),F=this._getClampedPixelRatio(m[0],m[1]);this._resizeCanvas(m[0],m[1],F);const $=this._controlContainer=o.create("div","maplibregl-control-container",j),Z=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(ie=>{Z[ie]=o.create("div",`maplibregl-ctrl-${ie} `,$)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(j,u,m){this._canvas.width=Math.floor(m*j),this._canvas.height=Math.floor(m*u),this._canvas.style.width=`${j}px`,this._canvas.style.height=`${u}px`}_setupPainter(){const j={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let u=null;this._canvas.addEventListener("webglcontextcreationerror",F=>{u={requestedAttributes:j},F&&(u.statusMessage=F.statusMessage,u.type=F.type)},{once:!0});const m=this._canvas.getContext("webgl2",j)||this._canvas.getContext("webgl",j);if(!m){const F="Failed to initialize WebGL";throw u?(u.message=F,new Error(JSON.stringify(u))):new Error(F)}this.painter=new lc(m,this.transform),s.testSupport(m)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(j){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||j,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(j){return this._update(),this._renderTaskQueue.add(j)}_cancelRenderFrame(j){this._renderTaskQueue.remove(j)}_render(j){const u=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(j),this._removed)return;let m=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const $=this.transform.zoom,Z=c.now();this.style.zoomHistory.update($,Z);const ie=new a.a9($,{now:Z,fadeDuration:u,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),he=ie.crossFadingFactor();he===1&&he===this._crossFadingFactor||(m=!0,this._crossFadingFactor=he),this.style.update(ie)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,u,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:u,showPadding:this.showPadding}),this.fire(new a.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,a.be.mark(a.bf.load),this.fire(new a.k("load"))),this.style&&(this.style.hasTransitions()||m)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const F=this._sourcesDirty||this._styleDirty||this._placementDirty;return F||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new a.k("idle")),!this._loaded||this._fullyLoaded||F||(this._fullyLoaded=!0,a.be.mark(a.bf.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var j;this._hash&&this._hash.remove();for(const m of this._controls)m.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),C.removeThrottleControl(this._imageQueueHandle),(j=this._resizeObserver)===null||j===void 0||j.disconnect();const u=this.painter.context.gl.getExtension("WEBGL_lose_context");u!=null&&u.loseContext&&u.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),o.remove(this._canvasContainer),o.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),a.be.clearMetrics(),this._removed=!0,this.fire(new a.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,c.frameAsync(this._frameRequest).then(j=>{a.be.frame(j),this._frameRequest=null,this._render(j)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(j){this._showTileBoundaries!==j&&(this._showTileBoundaries=j,this._update())}get showPadding(){return!!this._showPadding}set showPadding(j){this._showPadding!==j&&(this._showPadding=j,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(j){this._showCollisionBoxes!==j&&(this._showCollisionBoxes=j,j?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(j){this._showOverdrawInspector!==j&&(this._showOverdrawInspector=j,this._update())}get repaint(){return!!this._repaint}set repaint(j){this._repaint!==j&&(this._repaint=j,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(j){this._vertices=j,this._update()}get version(){return Ic}getCameraTargetElevation(){return this.transform.elevation}},d.MapMouseEvent=Eo,d.MapTouchEvent=_o,d.MapWheelEvent=Qs,d.Marker=Fi,d.NavigationControl=class{constructor(j){this._updateZoomButtons=()=>{const u=this._map.getZoom(),m=u===this._map.getMaxZoom(),F=u===this._map.getMinZoom();this._zoomInButton.disabled=m,this._zoomOutButton.disabled=F,this._zoomInButton.setAttribute("aria-disabled",m.toString()),this._zoomOutButton.setAttribute("aria-disabled",F.toString())},this._rotateCompassArrow=()=>{const u=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=u},this._setButtonTitle=(u,m)=>{const F=this._map._getUIString(`NavigationControl.${m}`);u.title=F,u.setAttribute("aria-label",F)},this.options=a.e({},Ms,j),this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",u=>u.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",u=>this._map.zoomIn({},{originalEvent:u})),o.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",u=>this._map.zoomOut({},{originalEvent:u})),o.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",u=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:u}):this._map.resetNorth({},{originalEvent:u})}),this._compassIcon=o.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(j){return this._map=j,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 Zn(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){o.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}_createButton(j,u){const m=o.create("button",j,this._container);return m.type="button",m.addEventListener("click",u),m}},d.Popup=wt,d.RasterDEMTileSource=Ue,d.RasterTileSource=Oe,d.ScaleControl=class{constructor(j){this._onMove=()=>{Ci(this._map,this._container,this.options)},this.setUnit=u=>{this.options.unit=u,Ci(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},tr),j)}getDefaultPosition(){return"bottom-left"}onAdd(j){return this._map=j,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-scale",j.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){o.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},d.ScrollZoomHandler=rl,d.Style=jn,d.TerrainControl=class{constructor(j){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=j}onAdd(j){return this._map=j,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=o.create("button","maplibregl-ctrl-terrain",this._container),o.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){o.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},d.TwoFingersTouchPitchHandler=Dl,d.TwoFingersTouchRotateHandler=tu,d.TwoFingersTouchZoomHandler=sr,d.TwoFingersTouchZoomRotateHandler=ol,d.VectorTileSource=Pe,d.VideoSource=ye,d.addSourceType=(j,u)=>a._(void 0,void 0,void 0,function*(){if(He(j))throw new Error(`A source type called "${j}" already exists.`);((m,F)=>{Se[m]=F})(j,u)}),d.clearPrewarmedResources=function(){const j=fe;j&&(j.isPreloaded()&&j.numActive()===1?(j.release(ue),fe=null):console.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()"))},d.getMaxParallelImageRequests=function(){return a.a.MAX_PARALLEL_IMAGE_REQUESTS},d.getRTLTextPluginStatus=function(){return Xe().getRTLTextPluginStatus()},d.getVersion=function(){return te},d.getWorkerCount=function(){return de.workerCount},d.getWorkerUrl=function(){return a.a.WORKER_URL},d.importScriptInWorkers=function(j){return ge().broadcast("IS",j)},d.prewarm=function(){le().acquire(ue)},d.setMaxParallelImageRequests=function(j){a.a.MAX_PARALLEL_IMAGE_REQUESTS=j},d.setRTLTextPlugin=function(j,u){return Xe().setRTLTextPlugin(j,u)},d.setWorkerCount=function(j){de.workerCount=j},d.setWorkerUrl=function(j){a.a.WORKER_URL=j}}),g}()},88640:function(l,g,n){function x(xe,Te,Ae){xe.prototype=Te.prototype=Ae,Ae.constructor=xe}function d(xe,Te){var Ae=Object.create(xe.prototype);for(var Ee in Te)Ae[Ee]=Te[Ee];return Ae}function a(){}n.d(g,{GW:function(){return me},Dj:function(){return de}});var _=.7,b=1/_,y="\\s*([+-]?\\d+)\\s*",c="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",o="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s=/^#([0-9a-f]{3,8})$/,f=new RegExp("^rgb\\(".concat(y,",").concat(y,",").concat(y,"\\)$")),h=new RegExp("^rgb\\(".concat(o,",").concat(o,",").concat(o,"\\)$")),p=new RegExp("^rgba\\(".concat(y,",").concat(y,",").concat(y,",").concat(c,"\\)$")),v=new RegExp("^rgba\\(".concat(o,",").concat(o,",").concat(o,",").concat(c,"\\)$")),w=new RegExp("^hsl\\(".concat(c,",").concat(o,",").concat(o,"\\)$")),C=new RegExp("^hsla\\(".concat(c,",").concat(o,",").concat(o,",").concat(c,"\\)$")),A={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function T(){return this.rgb().formatHex()}function B(){return this.rgb().formatRgb()}function P(xe){var Te,Ae;return xe=(xe+"").trim().toLowerCase(),(Te=s.exec(xe))?(Ae=Te[1].length,Te=parseInt(Te[1],16),Ae===6?E(Te):Ae===3?new S(Te>>8&15|Te>>4&240,Te>>4&15|240&Te,(15&Te)<<4|15&Te,1):Ae===8?I(Te>>24&255,Te>>16&255,Te>>8&255,(255&Te)/255):Ae===4?I(Te>>12&15|Te>>8&240,Te>>8&15|Te>>4&240,Te>>4&15|240&Te,((15&Te)<<4|15&Te)/255):null):(Te=f.exec(xe))?new S(Te[1],Te[2],Te[3],1):(Te=h.exec(xe))?new S(255*Te[1]/100,255*Te[2]/100,255*Te[3]/100,1):(Te=p.exec(xe))?I(Te[1],Te[2],Te[3],Te[4]):(Te=v.exec(xe))?I(255*Te[1]/100,255*Te[2]/100,255*Te[3]/100,Te[4]):(Te=w.exec(xe))?U(Te[1],Te[2]/100,Te[3]/100,1):(Te=C.exec(xe))?U(Te[1],Te[2]/100,Te[3]/100,Te[4]):A.hasOwnProperty(xe)?E(A[xe]):xe==="transparent"?new S(NaN,NaN,NaN,0):null}function E(xe){return new S(xe>>16&255,xe>>8&255,255&xe,1)}function I(xe,Te,Ae,Ee){return Ee<=0&&(xe=Te=Ae=NaN),new S(xe,Te,Ae,Ee)}function M(xe,Te,Ae,Ee){return arguments.length===1?((Pe=xe)instanceof a||(Pe=P(Pe)),Pe?new S((Pe=Pe.rgb()).r,Pe.g,Pe.b,Pe.opacity):new S):new S(xe,Te,Ae,Ee??1);var Pe}function S(xe,Te,Ae,Ee){this.r=+xe,this.g=+Te,this.b=+Ae,this.opacity=+Ee}function L(){return"#".concat(V(this.r)).concat(V(this.g)).concat(V(this.b))}function k(){var xe=z(this.opacity);return"".concat(xe===1?"rgb(":"rgba(").concat(N(this.r),", ").concat(N(this.g),", ").concat(N(this.b)).concat(xe===1?")":", ".concat(xe,")"))}function z(xe){return isNaN(xe)?1:Math.max(0,Math.min(1,xe))}function N(xe){return Math.max(0,Math.min(255,Math.round(xe)||0))}function V(xe){return((xe=N(xe))<16?"0":"")+xe.toString(16)}function U(xe,Te,Ae,Ee){return Ee<=0?xe=Te=Ae=NaN:Ae<=0||Ae>=1?xe=Te=NaN:Te<=0&&(xe=NaN),new H(xe,Te,Ae,Ee)}function G(xe){if(xe instanceof H)return new H(xe.h,xe.s,xe.l,xe.opacity);if(xe instanceof a||(xe=P(xe)),!xe)return new H;if(xe instanceof H)return xe;var Te=(xe=xe.rgb()).r/255,Ae=xe.g/255,Ee=xe.b/255,Pe=Math.min(Te,Ae,Ee),Oe=Math.max(Te,Ae,Ee),Ue=NaN,Ie=Oe-Pe,De=(Oe+Pe)/2;return Ie?(Ue=Te===Oe?(Ae-Ee)/Ie+6*(Ae<Ee):Ae===Oe?(Ee-Te)/Ie+2:(Te-Ae)/Ie+4,Ie/=De<.5?Oe+Pe:2-Oe-Pe,Ue*=60):Ie=De>0&&De<1?0:Ue,new H(Ue,Ie,De,xe.opacity)}function H(xe,Te,Ae,Ee){this.h=+xe,this.s=+Te,this.l=+Ae,this.opacity=+Ee}function J(xe){return(xe=(xe||0)%360)<0?xe+360:xe}function ne(xe){return Math.max(0,Math.min(1,xe||0))}function W(xe,Te,Ae){return 255*(xe<60?Te+(Ae-Te)*xe/60:xe<180?Ae:xe<240?Te+(Ae-Te)*(240-xe)/60:Te)}x(a,P,{copy:function(xe){return Object.assign(new this.constructor,this,xe)},displayable:function(){return this.rgb().displayable()},hex:T,formatHex:T,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return G(this).formatHsl()},formatRgb:B,toString:B}),x(S,M,d(a,{brighter:function(xe){return xe=xe==null?b:Math.pow(b,xe),new S(this.r*xe,this.g*xe,this.b*xe,this.opacity)},darker:function(xe){return xe=xe==null?_:Math.pow(_,xe),new S(this.r*xe,this.g*xe,this.b*xe,this.opacity)},rgb:function(){return this},clamp:function(){return new S(N(this.r),N(this.g),N(this.b),z(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:L,formatHex:L,formatHex8:function(){return"#".concat(V(this.r)).concat(V(this.g)).concat(V(this.b)).concat(V(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:k,toString:k})),x(H,function(xe,Te,Ae,Ee){return arguments.length===1?G(xe):new H(xe,Te,Ae,Ee??1)},d(a,{brighter:function(xe){return xe=xe==null?b:Math.pow(b,xe),new H(this.h,this.s,this.l*xe,this.opacity)},darker:function(xe){return xe=xe==null?_:Math.pow(_,xe),new H(this.h,this.s,this.l*xe,this.opacity)},rgb:function(){var xe=this.h%360+360*(this.h<0),Te=isNaN(xe)||isNaN(this.s)?0:this.s,Ae=this.l,Ee=Ae+(Ae<.5?Ae:1-Ae)*Te,Pe=2*Ae-Ee;return new S(W(xe>=240?xe-240:xe+120,Pe,Ee),W(xe,Pe,Ee),W(xe<120?xe+240:xe-120,Pe,Ee),this.opacity)},clamp:function(){return new H(J(this.h),ne(this.s),ne(this.l),z(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var xe=z(this.opacity);return"".concat(xe===1?"hsl(":"hsla(").concat(J(this.h),", ").concat(100*ne(this.s),"%, ").concat(100*ne(this.l),"%").concat(xe===1?")":", ".concat(xe,")"))}}));var Q=function(xe){return function(){return xe}};function ae(xe,Te){var Ae=Te-xe;return Ae?function(Ee,Pe){return function(Oe){return Ee+Oe*Pe}}(xe,Ae):Q(isNaN(xe)?Te:xe)}var X=function xe(Te){var Ae=function(Pe){return(Pe=+Pe)==1?ae:function(Oe,Ue){return Ue-Oe?function(Ie,De,Be){return Ie=Math.pow(Ie,Be),De=Math.pow(De,Be)-Ie,Be=1/Be,function(ye){return Math.pow(Ie+ye*De,Be)}}(Oe,Ue,Pe):Q(isNaN(Oe)?Ue:Oe)}}(Te);function Ee(Pe,Oe){var Ue=Ae((Pe=M(Pe)).r,(Oe=M(Oe)).r),Ie=Ae(Pe.g,Oe.g),De=Ae(Pe.b,Oe.b),Be=ae(Pe.opacity,Oe.opacity);return function(ye){return Pe.r=Ue(ye),Pe.g=Ie(ye),Pe.b=De(ye),Pe.opacity=Be(ye),Pe+""}}return Ee.gamma=xe,Ee}(1);function ee(xe,Te){var Ae,Ee=Te?Te.length:0,Pe=xe?Math.min(Ee,xe.length):0,Oe=new Array(Pe),Ue=new Array(Ee);for(Ae=0;Ae<Pe;++Ae)Oe[Ae]=me(xe[Ae],Te[Ae]);for(;Ae<Ee;++Ae)Ue[Ae]=Te[Ae];return function(Ie){for(Ae=0;Ae<Pe;++Ae)Ue[Ae]=Oe[Ae](Ie);return Ue}}function ue(xe,Te){var Ae=new Date;return xe=+xe,Te=+Te,function(Ee){return Ae.setTime(xe*(1-Ee)+Te*Ee),Ae}}function de(xe,Te){return xe=+xe,Te=+Te,function(Ae){return xe*(1-Ae)+Te*Ae}}function pe(xe){return pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Te){return typeof Te}:function(Te){return Te&&typeof Symbol=="function"&&Te.constructor===Symbol&&Te!==Symbol.prototype?"symbol":typeof Te},pe(xe)}function fe(xe,Te){var Ae,Ee={},Pe={};for(Ae in xe!==null&&pe(xe)==="object"||(xe={}),Te!==null&&pe(Te)==="object"||(Te={}),Te)Ae in xe?Ee[Ae]=me(xe[Ae],Te[Ae]):Pe[Ae]=Te[Ae];return function(Oe){for(Ae in Ee)Pe[Ae]=Ee[Ae](Oe);return Pe}}var re=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,le=new RegExp(re.source,"g");function se(xe,Te){var Ae,Ee,Pe,Oe=re.lastIndex=le.lastIndex=0,Ue=-1,Ie=[],De=[];for(xe+="",Te+="";(Ae=re.exec(xe))&&(Ee=le.exec(Te));)(Pe=Ee.index)>Oe&&(Pe=Te.slice(Oe,Pe),Ie[Ue]?Ie[Ue]+=Pe:Ie[++Ue]=Pe),(Ae=Ae[0])===(Ee=Ee[0])?Ie[Ue]?Ie[Ue]+=Ee:Ie[++Ue]=Ee:(Ie[++Ue]=null,De.push({i:Ue,x:de(Ae,Ee)})),Oe=le.lastIndex;return Oe<Te.length&&(Pe=Te.slice(Oe),Ie[Ue]?Ie[Ue]+=Pe:Ie[++Ue]=Pe),Ie.length<2?De[0]?function(Be){return function(ye){return Be(ye)+""}}(De[0].x):function(Be){return function(){return Be}}(Te):(Te=De.length,function(Be){for(var ye,Me=0;Me<Te;++Me)Ie[(ye=De[Me]).i]=ye.x(Be);return Ie.join("")})}function ge(xe,Te){Te||(Te=[]);var Ae,Ee=xe?Math.min(Te.length,xe.length):0,Pe=Te.slice();return function(Oe){for(Ae=0;Ae<Ee;++Ae)Pe[Ae]=xe[Ae]*(1-Oe)+Te[Ae]*Oe;return Pe}}function ve(xe){return ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Te){return typeof Te}:function(Te){return Te&&typeof Symbol=="function"&&Te.constructor===Symbol&&Te!==Symbol.prototype?"symbol":typeof Te},ve(xe)}function me(xe,Te){var Ae,Ee,Pe=ve(Te);return Te==null||Pe==="boolean"?Q(Te):(Pe==="number"?de:Pe==="string"?(Ae=P(Te))?(Te=Ae,X):se:Te instanceof P?X:Te instanceof Date?ue:(Ee=Te,!ArrayBuffer.isView(Ee)||Ee instanceof DataView?Array.isArray(Te)?ee:typeof Te.valueOf!="function"&&typeof Te.toString!="function"||isNaN(Te)?fe:de:ge))(xe,Te)}},23648:function(l){l.exports=JSON.parse('["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]')},2362:function(l){l.exports=JSON.parse('["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]')},87486:function(l){l.exports=JSON.parse('["normal","italic","oblique"]')},99803:function(l){l.exports=JSON.parse('["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]')},54324:function(l){l.exports=JSON.parse('["inherit","initial","unset"]')},94316:function(l){l.exports=JSON.parse('["caption","icon","menu","message-box","small-caption","status-bar"]')},37071:function(l){l.exports=JSON.parse(`{"version":8,"name":"orto","metadata":{"maputnik:renderer":"mlgljs"},"center":[1.537786,41.837539],"zoom":12,"bearing":0,"pitch":0,"light":{"anchor":"viewport","color":"white","intensity":0.4,"position":[1.15,45,30]},"sources":{"ortoEsri":{"type":"raster","tiles":["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],"tileSize":256,"maxzoom":18,"attribution":"ESRI &copy; <a href='http://www.esri.com'>ESRI</a>"},"ortoInstaMaps":{"type":"raster","tiles":["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],"tileSize":256,"maxzoom":13},"ortoICGC":{"type":"raster","tiles":["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],"tileSize":256,"minzoom":13.1,"maxzoom":20},"openmaptiles":{"type":"vector","url":"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},"sprite":"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1","glyphs":"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf","layers":[{"id":"background","type":"background","paint":{"background-color":"#F4F9F4"}},{"id":"ortoEsri","type":"raster","source":"ortoEsri","maxzoom":16,"layout":{"visibility":"visible"}},{"id":"ortoICGC","type":"raster","source":"ortoICGC","minzoom":13.1,"maxzoom":19,"layout":{"visibility":"visible"}},{"id":"ortoInstaMaps","type":"raster","source":"ortoInstaMaps","maxzoom":13,"layout":{"visibility":"visible"}},{"id":"waterway_tunnel","type":"line","source":"openmaptiles","source-layer":"waterway","minzoom":14,"filter":["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],"layout":{"line-cap":"round"},"paint":{"line-color":"#a0c8f0","line-width":{"base":1.3,"stops":[[13,0.5],[20,6]]},"line-dasharray":[2,4]}},{"id":"waterway-other","type":"line","metadata":{"mapbox:group":"1444849382550.77"},"source":"openmaptiles","source-layer":"waterway","filter":["!in","class","canal","river","stream"],"layout":{"line-cap":"round"},"paint":{"line-color":"#a0c8f0","line-width":{"base":1.3,"stops":[[13,0.5],[20,2]]}}},{"id":"waterway-stream-canal","type":"line","metadata":{"mapbox:group":"1444849382550.77"},"source":"openmaptiles","source-layer":"waterway","filter":["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],"layout":{"line-cap":"round"},"paint":{"line-color":"#a0c8f0","line-width":{"base":1.3,"stops":[[13,0.5],[20,6]]}}},{"id":"waterway-river","type":"line","metadata":{"mapbox:group":"1444849382550.77"},"source":"openmaptiles","source-layer":"waterway","filter":["all",["==","class","river"],["!=","brunnel","tunnel"]],"layout":{"line-cap":"round"},"paint":{"line-color":"#a0c8f0","line-width":{"base":1.2,"stops":[[10,0.8],[20,4]]},"line-opacity":0.5}},{"id":"water-offset","type":"fill","metadata":{"mapbox:group":"1444849382550.77"},"source":"openmaptiles","source-layer":"water","maxzoom":8,"filter":["==","$type","Polygon"],"layout":{"visibility":"visible"},"paint":{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{"base":1,"stops":[[6,[2,0]],[8,[0,0]]]}}},{"id":"water","type":"fill","metadata":{"mapbox:group":"1444849382550.77"},"source":"openmaptiles","source-layer":"water","layout":{"visibility":"visible"},"paint":{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{"id":"water-pattern","type":"fill","metadata":{"mapbox:group":"1444849382550.77"},"source":"openmaptiles","source-layer":"water","layout":{"visibility":"visible"},"paint":{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{"id":"landcover-ice-shelf","type":"fill","metadata":{"mapbox:group":"1444849382550.77"},"source":"openmaptiles","source-layer":"landcover","filter":["==","subclass","ice_shelf"],"layout":{"visibility":"visible"},"paint":{"fill-color":"#fff","fill-opacity":{"base":1,"stops":[[0,0.9],[10,0.3]]}}},{"id":"tunnel-service-track-casing","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["in","class","service","track"]],"layout":{"line-join":"round"},"paint":{"line-color":"#cfcdca","line-dasharray":[0.5,0.25],"line-width":{"base":1.2,"stops":[[15,1],[16,4],[20,11]]}}},{"id":"tunnel-minor-casing","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["==","class","minor"]],"layout":{"line-join":"round"},"paint":{"line-color":"#cfcdca","line-opacity":{"stops":[[12,0],[12.5,1]]},"line-width":{"base":1.2,"stops":[[12,0.5],[13,1],[14,4],[20,15]]}}},{"id":"tunnel-secondary-tertiary-casing","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],"layout":{"line-join":"round"},"paint":{"line-color":"#e9ac77","line-opacity":1,"line-width":{"base":1.2,"stops":[[8,1.5],[20,17]]}}},{"id":"tunnel-trunk-primary-casing","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],"layout":{"line-join":"round"},"paint":{"line-color":"#e9ac77","line-width":{"base":1.2,"stops":[[5,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.7}},{"id":"tunnel-motorway-casing","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["==","class","motorway"]],"layout":{"line-join":"round","visibility":"visible"},"paint":{"line-color":"#e9ac77","line-dasharray":[0.5,0.25],"line-width":{"base":1.2,"stops":[[5,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.5}},{"id":"tunnel-path","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],"paint":{"line-color":"#cba","line-dasharray":[1.5,0.75],"line-width":{"base":1.2,"stops":[[15,1.2],[20,4]]}}},{"id":"tunnel-service-track","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["in","class","service","track"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fff","line-width":{"base":1.2,"stops":[[15.5,0],[16,2],[20,7.5]]}}},{"id":"tunnel-minor","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["==","class","minor_road"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fff","line-opacity":1,"line-width":{"base":1.2,"stops":[[13.5,0],[14,2.5],[20,11.5]]}}},{"id":"tunnel-secondary-tertiary","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fff4c6","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,10]]}}},{"id":"tunnel-trunk-primary","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fff4c6","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,18]]},"line-opacity":0.5}},{"id":"tunnel-motorway","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["==","class","motorway"]],"layout":{"line-join":"round","visibility":"visible"},"paint":{"line-color":"#ffdaa6","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,18]]},"line-opacity":0.5}},{"id":"tunnel-railway","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["==","class","rail"]],"paint":{"line-color":"#bbb","line-width":{"base":1.4,"stops":[[14,0.4],[15,0.75],[20,2]]},"line-dasharray":[2,2]}},{"id":"ferry","type":"line","source":"openmaptiles","source-layer":"transportation","filter":["all",["in","class","ferry"]],"layout":{"line-join":"round","visibility":"visible"},"paint":{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{"id":"aeroway-taxiway-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"aeroway","minzoom":12,"filter":["all",["in","class","taxiway"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"rgba(153, 153, 153, 1)","line-width":{"base":1.5,"stops":[[11,2],[17,12]]},"line-opacity":1}},{"id":"aeroway-runway-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"aeroway","minzoom":12,"filter":["all",["in","class","runway"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"rgba(153, 153, 153, 1)","line-width":{"base":1.5,"stops":[[11,5],[17,55]]},"line-opacity":1}},{"id":"aeroway-taxiway","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"aeroway","minzoom":4,"filter":["all",["in","class","taxiway"],["==","$type","LineString"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"rgba(255, 255, 255, 1)","line-width":{"base":1.5,"stops":[[11,1],[17,10]]},"line-opacity":{"base":1,"stops":[[11,0],[12,1]]}}},{"id":"aeroway-runway","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"aeroway","minzoom":4,"filter":["all",["in","class","runway"],["==","$type","LineString"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"rgba(255, 255, 255, 1)","line-width":{"base":1.5,"stops":[[11,4],[17,50]]},"line-opacity":{"base":1,"stops":[[11,0],[12,1]]}}},{"id":"highway-motorway-link-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":12,"filter":["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],"layout":{"line-cap":"round","line-join":"round"},"paint":{"line-color":"#e9ac77","line-opacity":1,"line-width":{"base":1.2,"stops":[[12,1],[13,3],[14,4],[20,15]]}}},{"id":"highway-link-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":13,"filter":["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"#e9ac77","line-opacity":1,"line-width":{"base":1.2,"stops":[[12,1],[13,3],[14,4],[20,15]]}}},{"id":"highway-minor-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],"layout":{"line-cap":"round","line-join":"round"},"paint":{"line-color":"#cfcdca","line-opacity":{"stops":[[12,0],[12.5,0]]},"line-width":{"base":1.2,"stops":[[12,0.5],[13,1],[14,4],[20,15]]}}},{"id":"highway-secondary-tertiary-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],"layout":{"line-cap":"butt","line-join":"round","visibility":"visible"},"paint":{"line-color":"#e9ac77","line-opacity":0.5,"line-width":{"base":1.2,"stops":[[8,1.5],[20,17]]}}},{"id":"highway-primary-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":5,"filter":["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],"layout":{"line-cap":"butt","line-join":"round","visibility":"visible"},"paint":{"line-color":"#e9ac77","line-opacity":{"stops":[[7,0],[8,0.6]]},"line-width":{"base":1.2,"stops":[[7,0],[8,0.6],[9,1.5],[20,22]]}}},{"id":"highway-trunk-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":5,"filter":["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],"layout":{"line-cap":"butt","line-join":"round","visibility":"visible"},"paint":{"line-color":"#e9ac77","line-opacity":{"stops":[[5,0],[6,0.5]]},"line-width":{"base":1.2,"stops":[[5,0],[6,0.6],[7,1.5],[20,22]]}}},{"id":"highway-motorway-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":4,"filter":["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],"layout":{"line-cap":"butt","line-join":"round","visibility":"visible"},"paint":{"line-color":"#e9ac77","line-width":{"base":1.2,"stops":[[4,0],[5,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":{"stops":[[4,0],[5,0.5]]}}},{"id":"highway-path","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],"paint":{"line-color":"#cba","line-dasharray":[1.5,0.75],"line-width":{"base":1.2,"stops":[[15,1.2],[20,4]]}}},{"id":"highway-motorway-link","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":12,"filter":["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],"layout":{"line-cap":"round","line-join":"round"},"paint":{"line-color":"#fc8","line-width":{"base":1.2,"stops":[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{"id":"highway-link","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":13,"filter":["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"#fea","line-width":{"base":1.2,"stops":[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{"id":"highway-minor","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],"layout":{"line-cap":"round","line-join":"round"},"paint":{"line-color":"#fff","line-opacity":0.5,"line-width":{"base":1.2,"stops":[[13.5,0],[14,2.5],[20,11.5]]}}},{"id":"highway-secondary-tertiary","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"#fea","line-width":{"base":1.2,"stops":[[6.5,0],[8,0.5],[20,13]]},"line-opacity":0.5}},{"id":"highway-primary","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"#fea","line-width":{"base":1.2,"stops":[[8.5,0],[9,0.5],[20,18]]},"line-opacity":0}},{"id":"highway-trunk","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"#fea","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,18]]},"line-opacity":0.5}},{"id":"highway-motorway","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":5,"filter":["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"#fc8","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,18]]},"line-opacity":0.5}},{"id":"railway-transit","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],"layout":{"visibility":"visible"},"paint":{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{"base":1.4,"stops":[[14,0.4],[20,1]]}}},{"id":"railway-transit-hatching","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],"layout":{"visibility":"visible"},"paint":{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[0.2,8],"line-width":{"base":1.4,"stops":[[14.5,0],[15,2],[20,6]]}}},{"id":"railway-service","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],"paint":{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{"base":1.4,"stops":[[14,0.4],[20,1]]}}},{"id":"railway-service-hatching","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],"layout":{"visibility":"visible"},"paint":{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[0.2,8],"line-width":{"base":1.4,"stops":[[14.5,0],[15,2],[20,6]]}}},{"id":"railway","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],"paint":{"line-color":"#bbb","line-width":{"base":1.4,"stops":[[14,0.4],[15,0.75],[20,2]]}}},{"id":"railway-hatching","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],"paint":{"line-color":"#bbb","line-dasharray":[0.2,8],"line-width":{"base":1.4,"stops":[[14.5,0],[15,3],[20,8]]}}},{"id":"bridge-motorway-link-casing","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["==","class","motorway_link"]],"layout":{"line-join":"round"},"paint":{"line-color":"#e9ac77","line-opacity":1,"line-width":{"base":1.2,"stops":[[12,1],[13,3],[14,4],[20,15]]}}},{"id":"bridge-link-casing","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],"layout":{"line-join":"round"},"paint":{"line-color":"#e9ac77","line-opacity":1,"line-width":{"base":1.2,"stops":[[12,1],[13,3],[14,4],[20,15]]}}},{"id":"bridge-secondary-tertiary-casing","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],"layout":{"line-join":"round"},"paint":{"line-color":"#e9ac77","line-opacity":1,"line-width":{"base":1.2,"stops":[[8,1.5],[20,28]]}}},{"id":"bridge-trunk-primary-casing","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],"layout":{"line-join":"round"},"paint":{"line-color":"hsl(28, 76%, 67%)","line-width":{"base":1.2,"stops":[[5,0.4],[6,0.6],[7,1.5],[20,26]]}}},{"id":"bridge-motorway-casing","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["==","class","motorway"]],"layout":{"line-join":"round"},"paint":{"line-color":"#e9ac77","line-width":{"base":1.2,"stops":[[5,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.5}},{"id":"bridge-path-casing","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],"paint":{"line-color":"#f8f4f0","line-width":{"base":1.2,"stops":[[15,1.2],[20,18]]}}},{"id":"bridge-path","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],"paint":{"line-color":"#cba","line-width":{"base":1.2,"stops":[[15,1.2],[20,4]]},"line-dasharray":[1.5,0.75]}},{"id":"bridge-motorway-link","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["==","class","motorway_link"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fc8","line-width":{"base":1.2,"stops":[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{"id":"bridge-link","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fea","line-width":{"base":1.2,"stops":[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{"id":"bridge-secondary-tertiary","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fea","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,20]]}}},{"id":"bridge-trunk-primary","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fea","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,18]]}}},{"id":"bridge-motorway","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["==","class","motorway"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fc8","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,18]]},"line-opacity":0.5}},{"id":"bridge-railway","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["==","class","rail"]],"paint":{"line-color":"#bbb","line-width":{"base":1.4,"stops":[[14,0.4],[15,0.75],[20,2]]}}},{"id":"bridge-railway-hatching","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["==","class","rail"]],"paint":{"line-color":"#bbb","line-dasharray":[0.2,8],"line-width":{"base":1.4,"stops":[[14.5,0],[15,3],[20,8]]}}},{"id":"cablecar","type":"line","source":"openmaptiles","source-layer":"transportation","minzoom":13,"filter":["==","class","cable_car"],"layout":{"visibility":"visible","line-cap":"round"},"paint":{"line-color":"hsl(0, 0%, 70%)","line-width":{"base":1,"stops":[[11,1],[19,2.5]]}}},{"id":"cablecar-dash","type":"line","source":"openmaptiles","source-layer":"transportation","minzoom":13,"filter":["==","class","cable_car"],"layout":{"visibility":"visible","line-cap":"round"},"paint":{"line-color":"hsl(0, 0%, 70%)","line-width":{"base":1,"stops":[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{"id":"boundary-land-level-4","type":"line","source":"openmaptiles","source-layer":"boundary","filter":["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],"layout":{"line-join":"round"},"paint":{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{"base":1.4,"stops":[[4,0.4],[5,1],[12,3]]},"line-opacity":0.6}},{"id":"boundary-land-level-2","type":"line","source":"openmaptiles","source-layer":"boundary","filter":["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],"layout":{"line-cap":"round","line-join":"round"},"paint":{"line-color":"hsl(248, 7%, 66%)","line-width":{"base":1,"stops":[[0,0.6],[4,1.4],[5,2],[12,2]]}}},{"id":"boundary-land-disputed","type":"line","source":"openmaptiles","source-layer":"boundary","filter":["all",["!=","maritime",1],["==","disputed",1]],"layout":{"line-cap":"round","line-join":"round"},"paint":{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{"base":1,"stops":[[0,0.6],[4,1.4],[5,2],[12,8]]}}},{"id":"boundary-water","type":"line","source":"openmaptiles","source-layer":"boundary","filter":["all",["in","admin_level",2,4],["==","maritime",1]],"layout":{"line-cap":"round","line-join":"round"},"paint":{"line-color":"rgba(154, 189, 214, 1)","line-width":{"base":1,"stops":[[0,0.6],[4,1],[5,1],[12,1]]},"line-opacity":{"stops":[[6,0],[10,0]]}}},{"id":"waterway-name","type":"symbol","source":"openmaptiles","source-layer":"waterway","minzoom":13,"filter":["all",["==","$type","LineString"],["has","name"]],"layout":{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":0.2,"symbol-spacing":350},"paint":{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{"id":"water-name-lakeline","type":"symbol","source":"openmaptiles","source-layer":"water_name","filter":["==","$type","LineString"],"layout":{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":0.2},"paint":{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{"id":"water-name-ocean","type":"symbol","source":"openmaptiles","source-layer":"water_name","filter":["all",["==","$type","Point"],["==","class","ocean"]],"layout":{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":0.2},"paint":{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{"id":"water-name-other","type":"symbol","source":"openmaptiles","source-layer":"water_name","filter":["all",["==","$type","Point"],["!in","class","ocean"]],"layout":{"text-font":["Noto Sans Italic"],"text-size":{"stops":[[0,10],[6,14]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":0.2,"visibility":"visible"},"paint":{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{"id":"poi-level-3","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":16,"filter":["all",["==","$type","Point"],[">=","rank",25]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":12,"text-max-width":9},"paint":{"text-halo-blur":0.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{"id":"poi-level-2","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":15,"filter":["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":12,"text-max-width":9},"paint":{"text-halo-blur":0.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{"id":"poi-level-1","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":14,"filter":["all",["==","$type","Point"],["<=","rank",14],["has","name"]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":11,"text-max-width":9},"paint":{"text-halo-blur":0.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{"id":"poi-railway","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":13,"filter":["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":12,"text-max-width":9,"icon-optional":false,"icon-ignore-placement":false,"icon-allow-overlap":false,"text-ignore-placement":false,"text-allow-overlap":false,"text-optional":true},"paint":{"text-halo-blur":0.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{"id":"road_oneway","type":"symbol","source":"openmaptiles","source-layer":"transportation","minzoom":15,"filter":["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],"layout":{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{"stops":[[15,0.5],[19,1]]}},"paint":{"icon-opacity":0.5}},{"id":"road_oneway_opposite","type":"symbol","source":"openmaptiles","source-layer":"transportation","minzoom":15,"filter":["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],"layout":{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{"stops":[[15,0.5],[19,1]]}},"paint":{"icon-opacity":0.5}},{"id":"highway-name-path","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":15.5,"filter":["==","class","path"],"layout":{"text-size":{"base":1,"stops":[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},"paint":{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":0.5}},{"id":"highway-name-minor","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":15,"filter":["all",["==","$type","LineString"],["in","class","minor","service","track"]],"layout":{"text-size":{"base":1,"stops":[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},"paint":{"text-halo-blur":0.5,"text-color":"#765","text-halo-width":1}},{"id":"highway-name-major","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":12.2,"filter":["in","class","primary","secondary","tertiary","trunk"],"layout":{"text-size":{"base":1,"stops":[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},"paint":{"text-halo-blur":0.5,"text-color":"#765","text-halo-width":1}},{"id":"highway-shield","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":8,"filter":["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],"layout":{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{"base":1,"stops":[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},"paint":{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":0.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{"id":"highway-shield-us-interstate","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":7,"filter":["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],"layout":{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{"base":1,"stops":[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},"paint":{"text-color":"rgba(0, 0, 0, 1)"}},{"id":"highway-shield-us-other","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":9,"filter":["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],"layout":{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{"base":1,"stops":[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},"paint":{"text-color":"rgba(0, 0, 0, 1)"}},{"id":"place-other","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","minzoom":12,"filter":["!in","class","city","town","village","country","continent"],"layout":{"text-letter-spacing":0.1,"text-size":{"base":1.2,"stops":[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":"{name:latin}\\n{name:nonlatin}","text-transform":"uppercase","text-max-width":9,"visibility":"visible"},"paint":{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{"id":"place-village","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","minzoom":10,"filter":["==","class","village"],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[10,12],[15,16]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"visibility":"visible"},"paint":{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{"id":"place-town","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["==","class","town"],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[10,14],[15,24]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"visibility":"visible"},"paint":{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{"id":"place-city","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["!=","capital",2],["==","class","city"]],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[7,14],[11,24]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"visibility":"visible"},"paint":{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-city-capital","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","capital",2],["==","class","city"]],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[7,14],[11,24]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"icon-image":"star_11","text-offset":[0.4,0],"icon-size":0.8,"text-anchor":"left","visibility":"visible"},"paint":{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-other","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],"layout":{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{"stops":[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-3","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{"stops":[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-2","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{"stops":[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-1","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{"stops":[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-continent","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","maxzoom":1,"filter":["==","class","continent"],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase","visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],"id":"qebnlkra6"}`)},51962:function(l){l.exports=JSON.parse(`{"version":8,"name":"orto","metadata":{},"center":[1.537786,41.837539],"zoom":12,"bearing":0,"pitch":0,"light":{"anchor":"viewport","color":"white","intensity":0.4,"position":[1.15,45,30]},"sources":{"ortoEsri":{"type":"raster","tiles":["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],"tileSize":256,"maxzoom":18,"attribution":"ESRI &copy; <a href='http://www.esri.com'>ESRI</a>"},"ortoInstaMaps":{"type":"raster","tiles":["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],"tileSize":256,"maxzoom":13},"ortoICGC":{"type":"raster","tiles":["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],"tileSize":256,"minzoom":13.1,"maxzoom":20},"openmaptiles":{"type":"vector","url":"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},"sprite":"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1","glyphs":"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf","layers":[{"id":"background","type":"background","paint":{"background-color":"#F4F9F4"}},{"id":"ortoEsri","type":"raster","source":"ortoEsri","maxzoom":16,"layout":{"visibility":"visible"}},{"id":"ortoICGC","type":"raster","source":"ortoICGC","minzoom":13.1,"maxzoom":19,"layout":{"visibility":"visible"}},{"id":"ortoInstaMaps","type":"raster","source":"ortoInstaMaps","maxzoom":13,"layout":{"visibility":"visible"}}]}`)}},O={};function R(l){var g=O[l];if(g!==void 0)return g.exports;var n=O[l]={id:l,exports:{}};return i[l].call(n.exports,n,n.exports,R),n.exports}return R.m=i,R.n=function(l){var g=l&&l.__esModule?function(){return l.default}:function(){return l};return R.d(g,{a:g}),g},R.d=function(l,g){for(var n in g)R.o(g,n)&&!R.o(l,n)&&Object.defineProperty(l,n,{enumerable:!0,get:g[n]})},R.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),R.o=function(l,g){return Object.prototype.hasOwnProperty.call(l,g)},R.r=function(l){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})},R.b=document.baseURI||self.location.href,R.nc=void 0,R(20260)}()})})(WY);var ooa=WY.exports;const ZY=ioa(ooa),soa={id:"main-container"},loa={id:"surface-container"},YY=39,mb=76,coa=0,XY=2,JY=4,KY=5,QY=6,eX=7,uoa=8,doa=9,tX=10,aX=11,nX=13,hoa=14,poa=15,foa=18,L1=19,moa=800,rX=300,iX=.1208,oX=5,goa=2,yoa=3,voa=4,_oa=7,boa=-46,sX=100,lX=-14,xoa={__name:"CardField",props:{selected_category:{type:Number,default:31},selected_team:{type:[Array,Number],default:()=>[]},showBallPosition:{type:Boolean,default:!0},showPlayersPosition:{type:Boolean,default:!0},widthContainer:{type:Number,default:1280},dataPaintInfo:{type:Object,default:()=>{}},showTracks:{type:Boolean,default:!1},touches:{type:Number,default:1},showPlayersEndPosition:{type:Boolean,default:!1},secondStart:{type:Number,default:0},operationStart:{type:Number,default:0},secondEnd:{type:Number,default:1},operationEnd:{type:Number,default:1},inFavor:{type:Boolean,default:!0}},emits:["changelateralidad"],setup(e,{emit:r}){var i;let O=.75,R=t.ref("left");const l=r,g=t.ref(null),n=t.ref(null),x=t.ref(0),d=t.ref(null),a=new Set([583,585,587,589]),_=new Set([584,586,588,590]),b=new Set([122,128,136,142]),y=new Set([125,131,139,145]),c=new Set([124,130,138,144]),o=new Set([123,129,137,143]),s=e;let f=null;t.watch(()=>x.value,V=>{p(V),n.value&&(n.value.style.height=`${v(V)}px`),d.value&&(d.value.style.top=`${w(v(V))}px`)}),t.watch(()=>s.selected_category,V=>{V==32?R.value="right":R.value="left"});function h(){f=new ResizeObserver(V=>{for(const U of V)x.value=U.contentRect.width}),f.observe(g.value)}function p(V){ZY.relayout(g.value,{width:V,height:v(V)})}function v(V){return Math.round(rX/moa*V,0)}function w(V){return lX+(V-sX)/(rX-sX)*(boa-lX)}t.watch(()=>s.dataPaintInfo,V=>{k(V)},{deep:!0}),t.watch(()=>s.selected_team,V=>{V.data.length>0&&k(V)}),t.watch(()=>s.secondStart,V=>{k(V)});function C(V,U){let G=.01321,H=.00929,J=0,ne=0,W=[];const Q=U.length;let ae=Math.floor(Q/10);for(;J<mb;)ne=U.filter(X=>X[0]>=J*G&&X[0]<=(J+1)*G&&X[1]>=V*H&&X[1]<=(V+1)*H).map(X=>X[1]).length,ae=ae===0?1:ae,W.push(parseFloat((ne/ae).toFixed(4))),J++;return W.reverse()}function A(V){let U=[T(mb),T(mb)],G=[],H=YY;for(;H>0&&H<=YY;)G=C(H,V),U.push(G),H--;return U.push(T(mb),T(mb)),U}function T(V){return Array.from({length:V},()=>0)}function B(V,U,G){const H=[];let J=0,ne=0;H.push(V[0]);for(let W=1;W<G-1;W++){const Q=[];Q.push(V[W][0]);for(let ae=1;ae<U-1;ae++)J=V[W][ae-1],ne=V[W][ae+1],Q.push(J+.5*(V[W][ae]+ne-J));Q.push(V[W][U-1]),H.push(Q)}H.push(V[G-1]);for(let W=1;W<U-1;W++)for(let Q=1;Q<G-1;Q++)J=H[Q-1][W],ne=H[Q+1][W],H[Q][W]=J+.5*(H[Q][W]+ne-J);return H}function P(V){for(var U=[],G=0;G<V.length;G++)if(V[G][L1]==0&&V[G][JY]===s.selected_category){let H=V[G][aX];U.push([V[G][tX],H])}return U}function E(V,U,G=1){let H=[],J=[];return V.forEach(ne=>{if(ne[JY]===s.selected_category){let W=V.filter(Q=>ne[0]===Q[foa]&&Q[L1]<=G).sort((Q,ae)=>Q[L1]-ae[L1]);W.length>0&&H.push(W),ne[L1]===0&&J.push([ne[coa],ne[nX],ne[hoa],ne[poa]])}}),{sequences:H,main_plays:J}}function I(V,U,G,H,J){let ne=.1,W=H*4,Q=H*3,ae=[],X=[],ee=[],ue=[],de=[],pe=[],fe=[],re=[],le=[],se=[],ge=[],ve=[],me=[];const xe=.7,Te="rgba(253, 101, 36, 1)",Ae="rgba(249, 189, 50, 1)",Ee="rgba(255, 255, 255, 1)",Pe="rgba(203, 238, 107, 1)",Oe="rgba(55, 181, 252, 1)",Ue="rgba(55, 252, 217, 1)",Ie="rgba(195, 198, 201, 1)",De=new Map([[a,{color:Pe,symbol:"circle"}],[_,{color:Oe,symbol:"circle"}],[b,{color:Ue,symbol:"circle"}],[y,{color:Ie,symbol:"x"}],[c,{color:Te,symbol:"square"}],[o,{color:Ae,symbol:"triangle-up"}]]);return V.forEach(Be=>{if(Be.length===1){if(Be[0][L1]===0)return;let ye=Be[0][QY]*G,Me=Be[0][eX]*W-Q,Se=H*iX,He=H*ne,Ne=Me+Se+He;if(Ne=Ne>=H?H-1:Ne,X.push(ye),ee.push(Ne-xe),ue.push(ye),de.push(Ne),J===1){let je=Be[0][KY].split(","),qe=!1;je=je.map(Number);for(const[Xe,we]of De)if(je.some(Fe=>Xe.has(Fe))){pe.push(we.color),fe.push(we.symbol),qe=!0;break}qe||(pe.push(Ee),fe.push("circle"))}else Be[0][XY]===U?pe.push(Ee):pe.push(Te)}else Be.forEach((ye,Me)=>{if(ye[L1]===0)return;let Se=ye[QY]*G,He=ye[eX]*W-Q,Ne=H*iX,je=H*ne,qe=He+Ne+je;if(qe=qe>=H?H-1:qe,X.push(Se),ee.push(qe-xe),ue.push(Se),de.push(qe),J===1){let Xe=Be[0][KY].split(","),we=!1;Xe=Xe.map(Number);for(const[Fe,Re]of De)if(Xe.some(Ge=>Fe.has(Ge))){pe.push(Re.color),fe.push(Re.symbol),we=!0;break}we||(pe.push(Ee),fe.push("circle"))}else{let Xe=ye[uoa]*G,we=ye[doa]*W-Q+Ne+je;we=we>=H?H-1:we;let Fe=ye[tX]*G,Re=ye[aX]*W-Q+Ne+je;Re=Re>=H?H-1:Re,ye[XY]===U?pe.push(Ee):pe.push(Te),se.push(Se,Xe,null),ge.push(qe,we,null),re.push(Se,Xe),le.push(qe,we),Be.length-1===Me&&(re.push(Fe,null),le.push(Re,null),ve.push(Fe),me.push(Re))}})}),ae.shadowXPoints=X,ae.shadowYPoints=ee,ae.playerXPoints=ue,ae.playerYPoints=de,ae.playerColorPoints=pe,ae.trackX=re,ae.trackY=le,ae.sprintX=se,ae.sprintY=ge,ae.arrowX=ve,ae.arrowY=me,ae.symbols=fe,ae}function M(V,U){return V.map((G,H)=>G.map((J,ne)=>{if(ne===U){let[W,Q,ae]=J.split(/[:.]/);return parseInt(W)*60+parseInt(Q)}else return J}))}function S(V,U,G,H,J=0,ne){let W=[];return H.forEach(Q=>{let ae=J===0?parseInt(Q[1])-parseInt(G):parseInt(Q[1])+parseInt(G);V.filter(X=>Q[0]===X[_oa]&&ae===X[oX]&&U===X[goa]).forEach(X=>{let ee=X[yoa],ue=X[voa];ue<=ne&&W.push([ee,ue])})}),W}function L(V){return V.flat().every(U=>U===0)}function k(V){V.data=M(V.data,nX),V.field_positions=M(V.field_positions,oX);let U=E(V.data,O,s.touches),G=P(V.data),H=S(V.field_positions,s.selected_team,s.secondStart,U.main_plays,s.operationStart,O),J=S(V.field_positions,s.selected_team,s.secondEnd,U.main_plays,s.operationEnd,O),ne=A(G),W=A(H),Q=A(J),ae=ne[0].length,X=ne.length;ne=B(B(ne,ae,X),ae,X),W=B(B(W,ae,X),ae,X),Q=B(B(Q,ae,X),ae,X),ae=ne[0].length,X=ne.length;let ee=I(U.sequences,s.selected_team,ae,X,s.touches);var ue=[[0,"rgba(12,31,82,0)"],[.2,"rgba(14, 55, 115, 0.8)"],[.4,"rgba(33, 85, 160, 0.8)"],[.6,"rgba(16, 124, 170, 0.8)"],[.8,"rgba(32, 154, 207, 0.8)"],[1,"rgba(32, 174, 207, 0.8)"]],de=[[0,"rgba(12,31,82,0)"],[.2,"rgba(73, 13, 67, 0.8)"],[.4,"rgba(98, 32, 91, 0.8)"],[.6,"rgba(121, 52, 114, 0.8)"],[.8,"rgba(176, 36, 121, 0.8)"],[1,"rgba(230, 49, 158, 0.8)"]],pe=[[0,"rgba(12,31,82,0)"],[.2,"rgba(94, 111, 79, 1)"],[.4,"rgba(111, 142, 28, 1)"],[.6,"rgba(142, 177, 50, 1)"],[.8,"rgba(169, 211, 57, 1)"],[1,"rgba(195, 229, 105, 1)"]],fe=[{z:ne,type:"heatmap",connectgaps:!0,opacity:1,colorscale:pe,autoscale:!1,showscale:!1,zsmooth:"best",showgrid:!1,showline:!1}],re=[{z:W,type:"heatmap",connectgaps:!0,opacity:1,colorscale:ue,autoscale:!1,showscale:!1,zsmooth:"best",showgrid:!1,showline:!1}],le=[{z:Q,type:"heatmap",connectgaps:!0,opacity:1,colorscale:de,autoscale:!1,showscale:!1,zsmooth:"best",showgrid:!1,showline:!1}],se={x:ee.shadowXPoints,y:ee.shadowYPoints,mode:"markers",marker:{symbol:ee.symbols,color:"rgba(0, 0, 0, 0.5)",size:9}},ge={x:ee.playerXPoints,y:ee.playerYPoints,mode:"markers",marker:{symbol:ee.symbols,color:ee.playerColorPoints,size:8}},ve={x:ee.trackX,y:ee.trackY,mode:"lines",line:{color:"rgba(255, 255, 255, 1)",width:1,dash:"2px 2px",arrowhead:"end"}},me={x:ee.sprintX,y:ee.sprintY,mode:"lines",line:{color:"rgba(255, 255, 255, 1)",width:1}},xe={x:ee.arrowX,y:ee.arrowY,mode:"markers",marker:{symbol:"triangle-up",size:10,color:"rgba(255, 255, 255, 1)",angle:120}},Te=[];s.showTracks&&s.touches>1&&Te.push(me,ve,xe),s.showTracks&&Te.push(se,ge),s.showPlayersEndPosition&&!L(Q)&&Te.push(...le),s.showPlayersPosition&&!L(W)&&Te.push(...re),s.showBallPosition&&!L(ne)&&Te.push(...fe);const Ae=[0,ae],Ee=[0,X];i={showlegend:!1,width:x.value,height:v(x.value),xaxis:{title:"",showgrid:!1,showline:!1,zeroline:!1,showticklabels:!1,ticks:"",showbackground:!1,backgroundcolor:"transparent",range:Ae},yaxis:{title:"",showgrid:!1,showline:!1,zeroline:!1,showticklabels:!1,ticks:"",showbackground:!1,backgroundcolor:"transparent",range:Ee},margin:{l:0,r:0,b:0,t:5}},ZY.newPlot("surface-plot-heatmap",Te,i,{displayModeBar:!1,staticPlot:!0},{responsive:!0})}const z=()=>{};function N(V){R.value=V,l("changelateralidad",R.value)}return t.onBeforeUnmount(()=>{window.removeEventListener("resize",z)}),t.onMounted(()=>{g.value&&(g.value.style.pointerEvents="none"),window.addEventListener("resize",z),h()}),(V,U)=>(t.openBlock(),t.createElementBlock("div",soa,[t.createElementVNode("div",loa,[s.dataPaintInfo.data.length==0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(e.widthContainer<768?"class-not-result-field-movil":"class-not-result-field")},[e.widthContainer<768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[U[2]||(U[2]=t.createTextVNode("No se muestran resultados debido")),U[3]||(U[3]=t.createElementVNode("br",null,null,-1)),U[4]||(U[4]=t.createTextVNode(" a los filtros aplicados."))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("No se muestran resultados debido a los filtros aplicados.")],64))],2)):t.createCommentVNode("",!0),t.createElementVNode("div",{id:"label-left-zone",style:t.normalizeStyle(t.unref(R)=="left"?"":"opacity: 0.6"),onClick:U[0]||(U[0]=G=>N("left"))},null,4),t.createElementVNode("div",{id:"label-right-zone",style:t.normalizeStyle(t.unref(R)=="right"?"":"opacity: 0.6"),onClick:U[1]||(U[1]=G=>N("right"))},null,4),t.createElementVNode("div",{ref_key:"surfacePlot",ref:g,id:"surface-plot-heatmap",class:t.normalizeClass(e.inFavor?"":"against")},null,2)])]))}},cX="/arrowbtn.png",woa={components:{GSCTrendMenuBall:Bra,GSCCheckbox:Yv,GSCTrendPosition:roa,CardField:xoa},props:{acronymHome:{type:String,default:""},acronymAway:{type:String,default:""},typePlay:{type:String,default:"A favor"},tournamentSelected:{type:Object,default:()=>({})},widthContainer:{type:Number,default:1280},touchAllData:{type:Array,default:()=>[]},playersData:{type:Object,default:()=>{}},homeTeam:{type:Number,default:0},awayTeam:{type:Number,default:0},selected_category:{type:Number,default:31},team:{type:Number,default:0},forGame:{type:Boolean,required:!1},teamsData:{type:Object,default:()=>{}},fieldPositionsAll:{type:Array,default:()=>[]},inFavor:{type:Boolean,required:!1},isTacticVisible:{type:Boolean,required:!1}},data(){return{type:"ball",show:!1,game:62276,trajectories:[],rival:3014,totalCorners:0,typepositioning:"Posición",BallOnOff:"OFF",numberTouches:1,playersList:{},timepositioning:-1,checkedBallGo:!0,checkedHeatMap:!0,filterFieldPositions:[],timepositioningFinal:-1,arrayPlayers:{},season:1325,timepositioningend:1,zonesFilter:[],touchFilter:{},token:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"}},watch:{touchAllData:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},zonesFilter:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},typepositioning:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},timepositioning:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},timepositioningend:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0}},computed:{firstTeam(){return this.homeTeam===this.team?this.acronymHome:this.acronymAway},secondTeam(){return this.homeTeam===this.team?this.acronymAway:this.acronymHome},firstTeam1Touch(){return this.inFavor?this.homeTeam===this.team?this.acronymHome:this.acronymAway:this.homeTeam===this.team?this.acronymAway:this.acronymHome},secondTeam1Touch(){return this.inFavor?this.homeTeam===this.team?this.acronymAway:this.acronymHome:this.homeTeam===this.team?this.acronymHome:this.acronymAway},reftrendteamsTouches(){const e=this.widthContainer;return e<=480?"ref-trend-teams-touches480":e<=768?"ref-trend-teams-touches768":"ref-trend-teams-touches"},reftrendteamslocal(){const e=this.widthContainer;return e<=480?"ref-trend-teams-local480":e<=768?"ref-trend-teams-local768":"ref-trend-teams-local"},reftrendteamsrival(){return this.widthContainer<=768?"ref-trend-teams-rival768":"ref-trend-teams-rival"},reftrendteamsall(){const e=this.widthContainer;return e<=480?"ref-trend-teams-all480":e<=768?"ref-trend-teams-all768":"ref-trend-teams-all"},refpointlebeltext(){const e=this.widthContainer;return e<=480?"ref-point-lebel-text480":e<=768?"ref-point-lebel-text768":e<=860?"ref-point-lebel-text870":"ref-point-lebel-text"},trendcontentcontrols(){return this.widthContainer<=768?"trend-content-controls768":["trend-content-controls","to-right"]},trendtitle(){return this.widthContainer<=768?"trend-title768":"trend-title"},trendtitlecontainer(){return this.widthContainer<=768?"trend-titlecontainer768":"trend-titlecontainer"},trendcontentcontrolscontainer(){const e=this.widthContainer;return e<=400?"trend-content-controls-container400":e<=860?"trend-content-controls-container860":"trend-content-controls-container"},trendcontentcontrolsleyendcheckscontent(){const e=this.widthContainer;return e<=400?"trend-content-controls-leyend-checkscontent400":e<=768?"trend-content-controls-leyend-checkscontent768":e<=1e3?"trend-content-controls-leyend-checkscontent1000":"trend-content-controls-leyend-checkscontent"},trendcontentcontrolsleyend(){const e=this.widthContainer;return e<=768?"trend-content-controls-leyend768":e<=1e3?"trend-content-controls-leyend1000":"trend-content-controls-leyend"},contDataClass(){return this.widthContainer<=768?"cont-data768":"cont-data"},contDataClass2(){return this.widthContainer<=768?"cont-data-ref768":"cont-data-ref"},contCollectorsClass(){const e=this.widthContainer;return e<=768?"cont-collectors768":e<=900?"cont-collectors900":"cont-collectors"},contCollectorsClass2(){const e=this.widthContainer;return e<=768?"cont-collectors-ref768":e<=900?"cont-collectors-ref900":"cont-collectors-ref"},contWhoCnnectedClass(){const e=this.widthContainer;return e<=768?"cont-who-connected768":e<=900?"cont-who-connected900":"cont-who-connected"},contWhoCnnectedClass2(){const e=this.widthContainer;return e<=768?"cont-who-connected-ref768":e<=900?"cont-who-connected-ref900":"cont-who-connected-ref"}},methods:{changelateralidad(e){this.$emit("changelateralidad",e)},changeTouchesnum(e){this.numberTouches=e},checkBallGo(){this.checkedBallGo=!this.checkedBallGo},checkHeatMap(){this.checkedHeatMap=!this.checkedHeatMap},changeBallOnOff(e){typeof e=="string"&&(this.BallOnOff=e)},getDataPosition(){if(this.touchAllData.length>0){const r=this.touchAllData.filter(a=>a[19]===0).map(a=>this.tiempoASegundosEnteros(a[13]));let i=[];this.timepositioning>=0?i=r.map(a=>a+this.timepositioning):i=r.map(a=>a-this.timepositioning);const O=this.fieldPositionsAll.filter(a=>i.includes(this.tiempoASegundosEnteros(a[5]))&&a[2]===this.team),R=this.contarYAgruparPorPosicion(O);let l=[];this.zonesFilter.length!=35?l=this.fieldPositionsAll.filter(a=>this.zonesFilter.includes(a[6])&&a[2]===this.team):l=this.fieldPositionsAll.filter(a=>this.zonesFilter.includes(a[6])&&a[2]===this.team),this.filterFieldPositions=l;let g=[],n=[];for(var e in this.arrayPlayers)this.arrayPlayers[e].selected&&g.push(this.arrayPlayers[e].id),n.push(this.arrayPlayers[e].id);g.length>0&&(this.filterFieldPositions=this.filterFieldPositions.filter(a=>g.includes(a[1])));const x=l.filter(a=>i.includes(this.tiempoASegundosEnteros(a[5]))&&a[2]===this.team),d=this.contarYAgruparPorPosicion(x);this.arrayPlayers={};for(let a=0;a<R.length;a++){const _=d.filter(function(b){return b.id_player==R[a].id_player});this.arrayPlayers[R[a].id_player]={id:R[a].id_player,corners:R[a].corners,cornersfilter:_[0]?_[0].corners:0,data:this.playersData[R[a].id_player]?this.playersData[R[a].id_player]:{name:"-",img:"-",position:11,id:"-",team:"-",nationality_id:"-",nationality_flag:"https://az755631.vo.msecnd.net/flags/undefined.jpg",jersey:"-"},selected:Object.keys(this.arrayPlayers).length>0&&n.includes(R[a].id_player)?!!g.includes(R[a].id_player):!0}}}else this.arrayPlayers={},this.filterFieldPositions=[]},getDataTrajectory(){if(this.touchAllData.length>0){const r=this.touchAllData.filter(y=>y[19]===0).map(y=>this.tiempoASegundosEnteros(y[13]));let i=[];this.timepositioning>=0?i=r.map(y=>y+Math.abs(this.timepositioning)):i=r.map(y=>y-Math.abs(this.timepositioning));let O=[];this.timepositioningend>=0?O=r.map(y=>y+Math.abs(this.timepositioningend)):O=r.map(y=>y-Math.abs(this.timepositioningend));const R=this.fieldPositionsAll.filter(y=>this.zonesFilter.includes(y[6])&&y[2]===this.team);this.filterFieldPositions=R;let l=[],g=[];for(var e in this.arrayPlayers)this.arrayPlayers[e].selected&&l.push(this.arrayPlayers[e].id),g.push(this.arrayPlayers[e].id);l.length>0&&(this.filterFieldPositions=this.filterFieldPositions.filter(y=>l.includes(y[1])));const n=this.fieldPositionsAll.filter(y=>r.includes(this.tiempoASegundosEnteros(y[5]))&&y[2]===this.team),x=R.filter(y=>i.includes(this.tiempoASegundosEnteros(y[5]))&&y[2]===this.team),d=R.filter(y=>O.includes(this.tiempoASegundosEnteros(y[5]))&&y[2]===this.team),a=this.contarYAgruparPorPosicion(n),_=this.contarYAgruparPorPosicion(x),b=this.contarYAgruparPorPosicion(d);for(let y=0;y<a.length;y++){const c=_.filter(function(s){return s.id_player==a[y].id_player}),o=b.filter(function(s){return s.id_player==a[y].id_player});this.arrayPlayers[a[y].id_player]={id:a[y].id_player,corners:a[y].corners,cornersfilter:c[0]?c[0].corners:0,cornersfilterfinal:o[0]?o[0].corners:0,data:this.playersData[a[y].id_player]?this.playersData[a[y].id_player]:{name:"-",img:"-",position:11,id:"-",team:"-",nationality_id:"-",nationality_flag:"https://az755631.vo.msecnd.net/flags/undefined.jpg",jersey:"-"},selected:Object.keys(this.arrayPlayers).length>0&&g.includes(a[y].id_player)?!!l.includes(a[y].id_player):!0}}}else this.arrayPlayers={},this.filterFieldPositions=[]},contarYAgruparPorPosicion(e){const r=e.reduce((i,O)=>{const R=O[1];return i[R]?i[R]+=1:i[R]=1,i},{});return Object.keys(r).map(i=>({id_player:parseInt(i,10),corners:r[i]}))},tiempoASegundosEnteros(e){let r=e.split(":"),i=parseInt(r[0],10),O=parseFloat(r[1]);return i*60+Math.floor(O)},getTimePositioning(e){this.timepositioning=e},getTimePositioningEnd(e){this.timepositioningend=e},getTypePositioning(e){this.typepositioning=e},getArrayZonesField(e){this.zonesFilter=e},selectcheckplayerall(e){for(let r in this.arrayPlayers)this.arrayPlayers[r].selected=e;this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},selectcheckplayer(e){this.arrayPlayers[e].selected=!this.arrayPlayers[e].selected,this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},clickTypeButton(e){this.type=e},clickAdvanced(){this.show=!this.show},async getData(){}},mounted(){}},koa={class:"text-diferent"},Soa={key:0,class:"btnAdvance",src:cX},Coa={key:1,class:"btnAdvanceHide",src:cX},Toa={class:"menu-advanced-container"},Aoa={class:"container-buttons-menu"},Eoa={key:1,class:"position-only"},Moa={class:"buttons-menu-select-data"},Ioa={key:0,class:"ref-trend-ball-player-container"},Boa={class:"ref-trend-ball-player"},Poa={class:"ref-trend-ball-player-label"},Ooa={key:1,class:"ref-trend-ball-player-container-route"},Loa={class:"ref-trend-teams-rival-container-table"},zoa={class:"ref-trend-teams-rival-container-row1"},Noa={class:"ref-trend-teams-rival-container-row2"},Foa={class:"ref-trend-teams-rival-container-table"},Doa={class:"ref-trend-teams-rival-container-row1"},Roa={class:"ref-trend-teams-rival-container-row2"};function Voa(e,r,i,O,R,l){const g=t.resolveComponent("GSCCheckbox"),n=t.resolveComponent("GSCTrendMenuBall"),x=t.resolveComponent("GSCTrendPosition"),d=t.resolveComponent("CardField");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(i.widthContainer<=768?"gsc-trend-movil":"gsc-trend-plays")},[t.createElementVNode("div",{class:t.normalizeClass(l.trendtitlecontainer)},[t.createElementVNode("div",{class:t.normalizeClass(l.trendtitle)},[r[5]||(r[5]=t.createTextVNode(" Tendencia General ")),t.createElementVNode("span",koa,"("+t.toDisplayString(i.inFavor?"A favor":"En contra")+")",1)],2),t.createElementVNode("div",{class:t.normalizeClass(l.trendcontentcontrols)},[t.createElementVNode("div",{class:t.normalizeClass(l.trendcontentcontrolsleyend)},[i.widthContainer>1e3||i.widthContainer<=768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Elige que quieres ver: ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[r[6]||(r[6]=t.createTextVNode("Elige que ")),r[7]||(r[7]=t.createElementVNode("br",null,null,-1)),r[8]||(r[8]=t.createTextVNode("quieres ver:"))],64))],2),t.createElementVNode("div",{class:t.normalizeClass(l.trendcontentcontrolsleyendcheckscontent)},[t.createElementVNode("div",{class:t.normalizeClass(l.trendcontentcontrolscontainer)},[t.createVNode(g,{label:"¿A dónde fue el balón?",fontFamily:"Poppins-Regular",labelFontSize:i.widthContainer>=870?"13px":"12px","label-color":"#FFF","model-value":R.checkedBallGo,"onUpdate:modelValue":r[0]||(r[0]=a=>l.checkBallGo())},null,8,["labelFontSize","model-value"])],2),t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(l.trendcontentcontrolscontainer)},[t.createVNode(g,{label:i.tournamentSelected.is_female==1?"Jugadoras ofensivas":"Jugadores ofensivos",fontFamily:"Poppins-Regular",labelFontSize:i.widthContainer>=870?"13px":"12px","label-color":"#FFF",boxBackgroundColor:"#15a9e0","model-value":R.checkedHeatMap,"onUpdate:modelValue":r[1]||(r[1]=a=>l.checkHeatMap())},null,8,["label","labelFontSize","model-value"])],2),[[t.vShow,i.isTacticVisible]])],2)],2)],2),t.createElementVNode("div",{class:t.normalizeClass(l.contDataClass)},[t.createElementVNode("div",{class:t.normalizeClass(l.contCollectorsClass)},[t.createElementVNode("div",{class:t.normalizeClass(i.widthContainer<=768?"button-avanced-movil":"button-avanced"),onClick:r[2]||(r[2]=(...a)=>l.clickAdvanced&&l.clickAdvanced(...a))},[R.show?(t.openBlock(),t.createElementBlock("img",Soa)):t.createCommentVNode("",!0),r[9]||(r[9]=t.createTextVNode("Avanzado")),R.show?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("img",Coa))],2),t.withDirectives(t.createElementVNode("div",Toa,[t.createElementVNode("div",Aoa,[i.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",{class:t.normalizeClass(["buttons-menu",R.type=="ball"?"active":""]),onClick:r[3]||(r[3]=a=>l.clickTypeButton("ball"))}," A dónde fue el balón ",2),t.createElementVNode("div",{class:t.normalizeClass(["buttons-menu",R.type=="position"?"active":""]),onClick:r[4]||(r[4]=a=>l.clickTypeButton("position"))}," Posicionamiento ",2)],64)):(t.openBlock(),t.createElementBlock("div",Eoa,"Posicionamiento"))]),t.createElementVNode("div",Moa,[t.withDirectives(t.createVNode(n,{"Ball-on-off":R.BallOnOff,onChangeBallOnOff:l.changeBallOnOff,onTouchesnum:l.changeTouchesnum},null,8,["Ball-on-off","onChangeBallOnOff","onTouchesnum"]),[[t.vShow,R.type=="ball"]]),t.withDirectives(t.createVNode(x,{onSelectcheckplayer:l.selectcheckplayer,onSelectcheckplayerall:l.selectcheckplayerall,data:R.arrayPlayers,onShowfield:l.getArrayZonesField,onTypepositioning:l.getTypePositioning,"width-container":i.widthContainer,onTimepositioning:l.getTimePositioning,onTimepositioningend:l.getTimePositioningEnd},null,8,["onSelectcheckplayer","onSelectcheckplayerall","data","onShowfield","onTypepositioning","width-container","onTimepositioning","onTimepositioningend"]),[[t.vShow,i.isTacticVisible&&R.type==="position"]])])],512),[[t.vShow,R.show]])],2),t.createElementVNode("div",{class:t.normalizeClass(l.contWhoCnnectedClass)},[t.createVNode(d,{"width-container":i.widthContainer,selected_team:i.team,"show-ball-position":R.checkedBallGo,"show-players-position":R.checkedHeatMap,selected_category:i.selected_category,"show-tracks":R.BallOnOff=="ON",touches:R.numberTouches,"operation-start":R.timepositioning>0?1:0,"second-start":Math.abs(R.timepositioning),"second-end":R.timepositioningend>0?1:0,"operation-end":Math.abs(R.timepositioningend),onChangelateralidad:l.changelateralidad,"show-players-end-position":R.typepositioning=="Recorrido","in-favor":i.inFavor,"data-paint-info":{data:i.touchAllData,field_positions:R.filterFieldPositions,home_atk_direction:1}},null,8,["width-container","selected_team","show-ball-position","show-players-position","selected_category","show-tracks","touches","operation-start","second-start","second-end","operation-end","onChangelateralidad","show-players-end-position","in-favor","data-paint-info"])],2)],2),t.createElementVNode("div",{class:t.normalizeClass(l.contDataClass2)},[t.createElementVNode("div",{class:t.normalizeClass(l.contCollectorsClass2)},[R.typepositioning==="Posición"?(t.openBlock(),t.createElementBlock("div",Ioa,[r[11]||(r[11]=t.createElementVNode("div",{class:"ref-trend-ball-ball"},[t.createElementVNode("div",{class:"ref-trend-ball-ball-point"}),t.createElementVNode("div",{class:"ref-trend-ball-ball-label"},"BALÓN")],-1)),t.createElementVNode("div",Boa,[r[10]||(r[10]=t.createElementVNode("div",{class:"ref-trend-ball-playe-point"},null,-1)),t.createElementVNode("div",Poa,[i.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("JUGADORAS OFENSIVAS")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("JUGADORES OFENSIVOS")],64))])])])):(t.openBlock(),t.createElementBlock("div",Ooa,r[12]||(r[12]=[t.createStaticVNode('<div class="ref-trend-ball-ball" data-v-a81b154d><div class="ref-trend-ball-ball-point" data-v-a81b154d></div><div class="ref-trend-ball-ball-label" data-v-a81b154d>BALÓN</div></div><div class="ref-trend-ball-player-route" data-v-a81b154d><div class="ref-trend-ball-player-label" data-v-a81b154d>RECORRIDOS:    </div><div class="ref-trend-ball-playe-point" data-v-a81b154d></div><div class="ref-trend-ball-player-label" data-v-a81b154d>INICIO   </div><div class="ref-trend-ball-playe-point-end" data-v-a81b154d></div><div class="ref-trend-ball-player-label" data-v-a81b154d>FINAL</div></div>',2)])))],2),R.BallOnOff=="ON"?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(l.contWhoCnnectedClass2),style:t.normalizeStyle(R.numberTouches>1?"margin-left: 0%; display: flex; justify-content: center;":"")},[R.numberTouches>1?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(l.reftrendteamsTouches)},[t.createElementVNode("div",{class:"ref-trend-teams-rival-label-title",style:t.normalizeStyle(i.widthContainer<=768?"justify-content: center !important;":"")}," COORDENADAS: ",4),t.createElementVNode("div",Loa,[t.createElementVNode("div",zoa,[r[13]||(r[13]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(/circle-my-team.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext),style:{"font-size":"9px"}},[i.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(l.firstTeam),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(i.teamsData[i.team].acronym),1)],64))],2)]),t.createElementVNode("div",Noa,[r[14]||(r[14]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(/circle-other-team.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext),style:{"font-size":"9px"}},[i.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(l.secondTeam),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Rival")],64))],2)])])],2)):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(l.reftrendteamsall)},[t.createElementVNode("div",{class:t.normalizeClass(l.reftrendteamslocal)},[t.createElementVNode("div",{class:"ref-trend-teams-local-label-title",style:t.normalizeStyle(i.widthContainer<=768?"justify-content: center !important;":"")},[i.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(l.firstTeam1Touch),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(i.inFavor?i.teamsData[i.team].acronym:"Rival"),1)],64))],4),t.createElementVNode("div",{class:t.normalizeClass(i.widthContainer<=480?"ref-trend-teams-local-container-table-movil":"ref-trend-teams-local-container-table")},[t.createElementVNode("div",{class:"ref-trend-teams-local-container-row1",style:t.normalizeStyle(i.widthContainer<=480?"display: inline-block !important;":"")},[r[16]||(r[16]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/rematado-gol.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext)},r[15]||(r[15]=[t.createTextVNode("Remata destino "),t.createElementVNode("br",null,null,-1),t.createTextVNode("portería fue gol")]),2)],4),t.createElementVNode("div",{class:"ref-trend-teams-local-container-row2",style:t.normalizeStyle(i.widthContainer<=480?"display: inline-block !important;":"")},[r[18]||(r[18]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/rematado-con-destino.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext)},r[17]||(r[17]=[t.createTextVNode("Rematado destino "),t.createElementVNode("br",null,null,-1),t.createTextVNode("a portería no fue gol")]),2)],4),t.createElementVNode("div",{class:"ref-trend-teams-local-container-row3",style:t.normalizeStyle(i.widthContainer<=480?"display: inline-block !important;":"")},[r[20]||(r[20]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/rematado-sin-destino.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext)},r[19]||(r[19]=[t.createTextVNode("Rematado sin "),t.createElementVNode("br",null,null,-1),t.createTextVNode("destino a portería")]),2)],4),t.createElementVNode("div",{class:"ref-trend-teams-local-container-row4",style:t.normalizeStyle(i.widthContainer<=480?"display: inline-block !important;":"")},[r[21]||(r[21]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/sin-destino.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext)},"Sin destino",2)],4)],2)],2),t.createElementVNode("div",{class:t.normalizeClass(l.reftrendteamsrival)},[t.createElementVNode("div",{class:"ref-trend-teams-rival-label-title",style:t.normalizeStyle(i.widthContainer<=768?"justify-content: center;":"")},[i.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(l.secondTeam1Touch),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(i.inFavor?"Rival":i.teamsData[i.team].acronym),1)],64))],4),t.createElementVNode("div",Foa,[t.createElementVNode("div",Doa,[r[30]||(r[30]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/ganados-jugador-rival.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext)},[i.widthContainer<=768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[i.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[r[22]||(r[22]=t.createTextVNode("Ganados ")),i.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Jugadora ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Jugador ")],64)),r[23]||(r[23]=t.createTextVNode("rival"))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Ganados por defensivo")],64))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[i.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[r[27]||(r[27]=t.createTextVNode("Ganados ")),r[28]||(r[28]=t.createElementVNode("br",null,null,-1)),i.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Jugadora ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Jugador ")],64)),r[29]||(r[29]=t.createTextVNode(" rival"))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[r[24]||(r[24]=t.createTextVNode("Ganados por")),r[25]||(r[25]=t.createElementVNode("br",null,null,-1)),r[26]||(r[26]=t.createTextVNode("defensivo"))],64))],64))],2)]),t.createElementVNode("div",Roa,[r[40]||(r[40]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/ganados-portero.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext)},[i.widthContainer<=768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[i.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[r[32]||(r[32]=t.createTextVNode("Ganados ")),i.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Portera ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Portero ")],64)),r[33]||(r[33]=t.createTextVNode("rival"))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[r[31]||(r[31]=t.createTextVNode("Ganados por ")),i.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("portera")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("portero")],64))],64))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[i.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[r[37]||(r[37]=t.createTextVNode("Ganados ")),r[38]||(r[38]=t.createElementVNode("br",null,null,-1)),i.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Portera ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Portero ")],64)),r[39]||(r[39]=t.createTextVNode("rival"))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[r[34]||(r[34]=t.createTextVNode("Ganados por")),r[35]||(r[35]=t.createElementVNode("br",null,null,-1)),r[36]||(r[36]=t.createTextVNode("portero"))],64))],64))],2)])])],2)],2))],6)):t.createCommentVNode("",!0)],2)],2)}const joa=yu(woa,[["render",Voa],["__scopeId","data-v-a81b154d"]]),eM={components:{GSCConnectionsSetPiece:hVt,GSCHeaderSetPiece:DQt,GSCDataToHighlight:Cea,GSCModalBreakdown:xta,GSCSpecificPlays:wra,GSCTrend:joa},props:{game:{type:Object,required:!0},forSeason:{type:Boolean,default:!1},forTeam:{type:Boolean,default:!1},tournamentSelected:{type:Object,default:()=>({})},forGame:{type:Boolean,default:!1},team:{type:Number,default:0},isTacticVisible:{type:Boolean,default:!0},isSynchronization:{type:Boolean,default:!1},canPlayVideos:{type:Boolean,default:!0},clientPrivilegesBySeasons:{type:Object,default:()=>null},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])}},data(){return{isSpecificPlaysVisible:!1,token:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE",touchAllDataHome:[],touchAllDataAway:[],regularflag:null,filters:{isMoment:!1,final:[1,2,3],moment:[1,2,3],playingAs:[1,2],sections:[1,2,3,4,5,6],games:[],players:[],cornertype:31,howWas:[120,126,327,133],zona:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],whathappened:[583,585,587,589,584,586,588,590,122,128,136,142,123,129,137,143,124,130,138,144,125,131,139,14,146,147,327,133],isWhatHappenedFull:!0,isZoneFull:!0},containerWidth:0,openModal:!1,playersData:{},teamsData:{},teamCorners:{corners:0,cornersAgainst:0},gamesAllHome:[],gamesAllAway:[],teamSelected:0,touchDataSelected:[],auxChangeFilterPlayer:!0,auxChangeFilterGames:!0,positionsDataSelected:[],copyLastFilters:{},seasonId:0,totalDataCollection:{},seasonsByGame:{},matchesByGame:{},rivalsByGame:{},updateConnections:0,showCorners:0,filterPlayersAvailable:[],filterGamesAvailable:[],updateTrend:0,lateralidad:"left",updateFilter:0,copyplayers:[],infavoragainst:!0,typePlay:"A favor",modalInitialData:{},areFiltersOpen:!1,heightFilters:"123px",isLoading:!1}},watch:{isLoading(e){this.isSpecificPlaysVisible=!e},game:{immediate:!0,handler(e){this.getDataCorners(e),this.createStorageGame()}},teamSelected:{immediate:!0,handler(){this.fillFilterGamesReset(),this.fillFilterPlayersReset(),this.updateConnections+=1}},infavoragainst:{immediate:!0,handler(){this.fillFilterGamesReset(),this.fillFilterPlayersReset(),this.updateConnections+=1}},calculationTouchesData:{immediate:!0,handler(){this.showCorners=this.calculationTouchesData.filter(e=>e[19]==0).length}}},computed:{isGameOnly(){return this.forGame&&!this.forSeason&&!this.forTeam},calculateTotal(){return this.touchDataSelected.filter(e=>e[19]==0).length},calculationPositionsData(){return this.positionsDataSelected},calculationTouchesData(){let e=[],r=[];if(this.touchDataSelected.length>0){this.updateCopyfilter(),this.filters.isMoment?r=this.touchDataSelected.filter(O=>this.filters.moment.includes(O[17])&&this.filters.playingAs.includes(O[14])&&this.filters.sections.includes(O[20])&&O[19]==0):r=this.touchDataSelected.filter(O=>this.filters.final.includes(O[16])&&this.filters.playingAs.includes(O[14])&&this.filters.sections.includes(O[20])&&O[19]==0),this.updateGamesListFilter({corners:r}),this.filters.games.length>0&&(r=r.filter(O=>this.filters.games.includes(O[3]))),this.infavoragainst&&(this.updatePlayerListFilter({corners:r,players:this.filters.players}),this.filters.players.length>0&&(r=r.filter(O=>this.filters.players.includes(O[1])))),r=r.filter(O=>this.filters.cornertype==O[4]),this.filters.zona.length!=35&&(r=r.filter(O=>this.filters.zona.includes(O[12]))),r=r.filter(O=>O[5].split(",").map(R=>parseInt(R)).some(R=>this.filters.howWas.includes(R))),this.filters.whathappened.length!=24&&(r=r.filter(O=>O[5].split(",").map(R=>parseInt(R)).some(R=>this.filters.whathappened.includes(R))));const i=r.map(O=>O[18]);e=this.touchDataSelected.filter(O=>i.includes(O[18]))}return e},cornersInFavor(){return"-"},cornersAgainst(){return"-"},isMovil(){return this.containerWidth<=768}},methods:{setHeaderStickyListener(){const e=this.$refs.header.getBoundingClientRect().top-1+(window.scrollY||window.pageYOffset);window.onscroll=()=>{(window.scrollY||window.pageYOffset)>e?(this.$refs.header.classList.add("sticky"),this.areFiltersOpen?this.heightFilters="282px":this.isMovil?this.forTeam?this.heightFilters="170px":this.heightFilters="222px":this.heightFilters="123px"):this.$refs.header.classList.remove("sticky")}},setCornersSide(e){this.lateralidad=e},onChangeShowFilters(e){this.areFiltersOpen=e},fillFilterPlayersReset(){setTimeout(()=>{if(this.infavoragainst){const e=this.forGame?this.infavoragainst?this.teamSelected:this.teamSelected==this.game.home_team?this.game.away_team:this.game.home_team:this.teamSelected,r=this.touchDataSelected.filter(O=>O[19]==0&&e).map(O=>O[1]),i=[...new Set(r)];this.getFilterTakenCorners({players:i})}},100)},fillFilterGamesReset(){setTimeout(()=>{const e=this.touchDataSelected.filter(i=>i[19]==0).map(i=>i[3]),r=[...new Set(e)];this.getFilterGames({games:r})},100)},updateCopyfilter(){this.copyLastFilters=this.filters},fillGameDataTeam(e){return{teamsIds:[e.home_team,e.visiting_team],label:`${e.matchday_abbreviation.replace("M","J")} ${this.teamsData[this.game.home_team].acronym} vs ${this.game.home_team==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym}`,id:e.game_id,isSelected:!0,dateTimeMillis:Date.parse(e.date_time_utc),rivalTeam:{logo:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,team_id:this.game.home_team==e.home_team?e.visiting_team:e.home_team,provisional_logo:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,colloquial_name:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,acronym:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,team_name:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].name:this.teamsData[e.home_team].name},roundAbbreviation:e.matchday_abbreviation.replace("M","J")}},fillGameData(e){return{teamsIds:[e.home_team,e.visiting_team],label:`${e.matchday_abbreviation.replace("M","J")} ${this.teamsData[this.teamSelected].acronym} vs ${this.teamSelected==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym}`,id:e.game_id,isSelected:!0,dateTimeMillis:Date.parse(e.date_time_utc),rivalTeam:{logo:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,team_id:this.teamSelected==e.home_team?e.visiting_team:e.home_team,provisional_logo:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,colloquial_name:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,acronym:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,team_name:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].name:this.teamsData[e.home_team].name},roundAbbreviation:e.matchday_abbreviation.replace("M","J")}},updatePlayerListFilter(e){if(this.infavoragainst){let r={},i=[];for(let O=0;O<e.corners.length;O++){const R=e.corners[O];if(R[19]===0&&R[2]===this.teamSelected){const l=R[1],g=this.playersData[l];l in r||(r[l]=g,i.push(g))}}if(this.filterPlayersAvailable=i,e.players.length>0&&this.filterPlayersAvailable.length>0)for(let O=0;O<this.filterPlayersAvailable.length;O++)e.players.includes(this.filterPlayersAvailable[O].id)?this.filterPlayersAvailable[O].isSelected=!0:this.filterPlayersAvailable[O].isSelected=!1}},updateGamesListFilter(e){if(!this.forGame){this.filterGamesAvailable=[];const r=this.obtenerIDsGames(e.corners);this.forSeason?this.teamSelected==this.game.home_team?this.filterGamesAvailable=r.map(i=>{let O=this.gamesAllHome.find(R=>R.game_id===i);if(O)return this.fillGameData(O)}):this.filterGamesAvailable=r.map(i=>{let O=this.gamesAllAway.find(R=>R.game_id===i);if(O)return this.fillGameData(O)}):this.filterGamesAvailable=r.map(i=>{let O=this.gamesAllHome.find(R=>R.game_id===i);if(O)return this.fillGameDataTeam(O)})}if(this.filters.games.length>0&&this.filterGamesAvailable.length>0)for(let r=0;r<this.filterGamesAvailable.length;r++)this.filters.games.includes(this.filterGamesAvailable[r].id)?this.filterGamesAvailable[r].isSelected=!0:this.filterGamesAvailable[r].isSelected=!1},getResetPlayers(){for(let e in this.playersData)this.playersData[e].isSelected=!0},getFilterZone(e){this.filters.zona=e,this.filters.isZoneFull=e.length===35},getFilterHowWasCorner(e){e.cornertype==31&&(this.lateralidad="left"),e.cornertype==32&&(this.lateralidad="right"),this.filters.cornertype=e.cornertype,this.filters.howWas=e.howWas},getFilterTakenCorners(e){this.arraysAreEqual(this.filters.players,e.players)||(this.filters.players=e.players)},arraysAreEqual(e,r){if(e.length!==r.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==r[i])return!1;return!0},getFilterGames(e){this.areGamesIdsArraysContentEqual(this.filters.games,e.games)||(this.filters.games=e.games,this.fillFilterPlayersReset())},areGamesIdsArraysContentEqual(e,r){return e.length===r.length&&e.every((i,O)=>i===r[O])},getFilterDetails(e){this.filters.playingAs=e.playingAs,this.filters.sections=e.sections,this.fillFilterGamesReset(),this.fillFilterPlayersReset()},getFilterResultsByTime(e){this.filters.final=e.final,this.filters.isMoment=e.isMoment,this.filters.moment=e.moment,this.fillFilterGamesReset(),this.fillFilterPlayersReset()},getFilterWhatHappened(e){this.filters.whathappened=e,this.filters.isWhatHappenedFull=e.length===24},obtenerIDsGames(e){return[...new Set(e.map(r=>r[3]))]},async getInFavorAgainstTeam(e){this.updateTrend+=1,this.infavoragainst=e,this.validateDataLocalStorage({team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})&&(this.teamSelected==this.game.home_team?await this.requestOrchestrator({games:this.gamesAllHome,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game}):await this.requestOrchestrator({games:this.gamesAllAway,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game}))},async getTeamSelected(e){this.teamSelected!=e&&(this.updateConnections+=1,this.updateTrend+=1,this.teamSelected=e,this.touchDataSelected=[],this.gamesAllHome.length!=0&&this.gamesAllAway.length!=0&&(this.teamSelected==this.game.home_team?this.validateDataLocalStorage({team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game}):this.validateDataLocalStorage({team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllAway,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})))},async requestOrchestrator(e){let r=[];const i=_u.create({headers:{Authorization:`${this.token}`}});for(let n=0;n<e.games.length;n++)this.seasonId=e.games[n].season_id,r.push(e.inFavor?"https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/"+e.games[n].season_id+"/corners/trends/teams/"+e.team+"/"+e.games[n].game_id:"https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/"+e.games[n].season_id+"/corners/trends/teams/"+e.team+"/"+e.games[n].game_id+"?isR=1");const O=async n=>{this.isLoading=!0,document.body.classList.add("no-scroll");try{return(await i.get(n)).data}catch(x){throw console.error("Error al obtener datos:",x),x}};var R=[],l=[];const g=r.map(n=>O(n));Promise.all(g).then(n=>{for(let x=0;x<n.length;x++)n[x].data=this.changeLateralityCoordenatesPlays(n[x].data,!1),n[x].field_positions=this.changeLateralityCoordenatesPlays(n[x].field_positions,!0),R=R.concat(n[x].data),l=l.concat(n[x].field_positions),this.getDataPlayers(n[x].players),this.getDataPlayers(n[x].rival_players),this.getDataTeams(n[x].teams),this.getSeasonByGame({season:n[x]&&n[x].hasOwnProperty("season_name")?n[x].season_name:"",game:n[x].data[0]?n[x].data[0][3]:0}),this.getMatchByGame({match:n[x]&&n[x].hasOwnProperty("matchday_abbreviation")?n[x].matchday_abbreviation:"",game:n[x].data[0]?n[x].data[0][3]:0}),this.getRivalsByGame({rival:this.infavoragainst?this.teamSelected==n[x].teams[0].team_id?n[x].teams[1].name:n[x].teams[0].name:this.teamSelected==n[x].teams[0].team_id?n[x].teams[0].name:n[x].teams[1].name,game:n[x].data[0]?n[x].data[0][3]:0,team:this.teamSelected,favor:this.infavoragainst});this.touchDataSelected=R,this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].touch=R,this.positionsDataSelected=l,this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].positions=l}).then(()=>{this.isLoading=!1,document.body.classList.remove("no-scroll")}).catch(n=>{console.error("Error al obtener datos:",n),this.isLoading=!1,document.body.classList.remove("no-scroll")})},getRowMatrix(e,r){let i=.01351,O=.02439,R=0,l=0,g=[];const n=r.length;let x=Math.floor(n/10);for(;R<74;)l=r.filter(d=>d[0]>=R*i&&d[0]<=(R+1)*i&&d[1]>=e*O&&d[1]<=(e+1)*O).map(d=>d[1]).length,x=x===0?1:x,g.push(parseFloat((l/x).toFixed(4))),R++;return g.reverse()},getEmptyArray(e){return Array.from({length:e},()=>0)},getMatrix(e){let r=[this.getEmptyArray(74),this.getEmptyArray(74)],i=[],O=39;for(;O>0&&O<=39;)i=this.getRowMatrix(O,e),r.push(i),O--;return r.push(this.getEmptyArray(74),this.getEmptyArray(74)),r},getSoftData(e,r,i){const O=[];let R=0,l=0;O.push(e[0]);for(let g=1;g<i-1;g++){const n=[];n.push(e[g][0]);for(let x=1;x<r-1;x++)R=e[g][x-1],l=e[g][x+1],n.push(R+.5*(e[g][x]+l-R));n.push(e[g][r-1]),O.push(n)}O.push(e[i-1]);for(let g=1;g<r-1;g++)for(let n=1;n<i-1;n++)R=O[n-1][g],l=O[n+1][g],O[n][g]=R+.5*(O[n][g]+l-R);return O},changeLateralityCoordenatesPlays(e,r){return r?e.forEach((i,O)=>{let R=0,l=0;this.infavoragainst?(R=i[2]===this.teamSelected?1-i[3]:i[3],l=i[2]===this.teamSelected?1-i[4]:i[4]):(R=i[2]===this.teamSelected?i[3]:1-i[3],l=i[2]===this.teamSelected?i[4]:1-i[4]),e[O][3]=R,e[O][4]=l}):e.forEach((i,O)=>{let R=0,l=0,g=0,n=0,x=0,d=0;i[19]!=0?this.infavoragainst?(R=i[2]===this.teamSelected?i[6]:1-i[6],l=i[2]===this.teamSelected?1-i[7]:i[7],g=i[2]===this.teamSelected?i[8]:1-i[8],n=i[2]===this.teamSelected?1-i[9]:i[9],x=i[2]===this.teamSelected?i[10]:1-i[10],d=i[2]===this.teamSelected?1-i[11]:i[11]):(R=i[2]===this.teamSelected?1-i[6]:i[6],l=i[2]===this.teamSelected?i[7]:1-i[7],g=i[2]===this.teamSelected?1-i[8]:i[8],n=i[2]===this.teamSelected?i[9]:1-i[9],x=i[2]===this.teamSelected?1-i[10]:i[10],d=i[2]===this.teamSelected?i[11]:1-i[11]):(R=1-i[6],l=i[7],g=1-i[8],n=i[9],x=1-i[10],d=i[11]),e[O][6]=R,e[O][7]=l,e[O][8]=g,e[O][9]=n,e[O][10]=x,e[O][11]=d}),e},changeLateralityPlays(e){e.field_positions=e.field_positions.map(i=>[...i.slice(0,3),i[4],i[3],...i.slice(5)]);let r=[];return e.data.forEach(i=>{i[19]===0&&r.push([i[0],i[13],i[14],i[15]])}),r.forEach(i=>{e.field_positions.filter(O=>i[0]===O[7]&&this.teamSelected===O[2]).forEach(O=>{let R=O[3],l=O[4];(e.homeTeamAtkDirection===1&&i[3]===1||e.homeTeamAtkDirection===2&&i[3]===2||e.homeTeamAtkDirection===1&&i[3]===3||e.homeTeamAtkDirection===2&&i[3]===4)&&(R=1-R,l=1-l),O[3]=R,O[4]=l})}),e.field_positions},createStorageGame(){this.totalDataCollection[this.game.id]={},this.totalDataCollection[this.game.id][this.game.home_team]={},this.totalDataCollection[this.game.id][this.game.home_team].InFavor={},this.totalDataCollection[this.game.id][this.game.home_team].InFavor.touch=[],this.totalDataCollection[this.game.id][this.game.home_team].InFavor.positions=[],this.totalDataCollection[this.game.id][this.game.home_team].Against={},this.totalDataCollection[this.game.id][this.game.home_team].Against.touch=[],this.totalDataCollection[this.game.id][this.game.home_team].Against.positions=[],(this.forGame||this.forSeason)&&(this.totalDataCollection[this.game.id][this.game.away_team]={},this.totalDataCollection[this.game.id][this.game.away_team].InFavor={},this.totalDataCollection[this.game.id][this.game.away_team].InFavor.touch=[],this.totalDataCollection[this.game.id][this.game.away_team].InFavor.positions=[],this.totalDataCollection[this.game.id][this.game.away_team].Against={},this.totalDataCollection[this.game.id][this.game.away_team].Against.touch=[],this.totalDataCollection[this.game.id][this.game.away_team].Against.positions=[])},validateDataLocalStorage(e){return this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].touch.length>0&&this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].positions.length>0?(this.touchDataSelected=this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].touch,this.positionsDataSelected=this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].positions,!1):!0},getGamesByTeam(e){this.forSeason?e.type=="home"?this.gamesAllHome=e.games.filter(function(r){return(r.home_team==e.idTeam||r.visiting_team==e.idTeam)&&r.game_status==1}):this.gamesAllAway=e.games.filter(function(r){return(r.home_team==e.idTeam||r.visiting_team==e.idTeam)&&r.game_status==1}):this.forGame?e.type=="home"?this.gamesAllHome=e.games.filter(function(r){return r.game_id==e.game.id}):this.gamesAllAway=e.games.filter(function(r){return r.game_id==e.game.id}):this.gamesAllHome=e.games.filter(function(r){return(r.home_team==e.idTeam||r.visiting_team==e.idTeam)&&r.game_status==1})},async getDataCorners(e){const r=_u.create({headers:{Authorization:`${this.token}`}});let i=await r.get("https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?seasons="+e.season);i.data.data[0].games.filter(O=>O.game_status===1).length==0?(this.regularflag=!0,i=await r.get("https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?seasons="+this.game.regularSeasonId)):this.regularflag=!1,this.forSeason?(this.getGamesByTeam({games:i.data.data[0].games,idTeam:e.home_team,type:"home"}),this.getGamesByTeam({games:i.data.data[0].games,idTeam:e.away_team,type:"away"}),this.validateDataLocalStorage({team:this.game.home_team,inFavor:!0,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.game.home_team,inFavor:!0,game:this.game})):this.forGame?(this.getGamesByTeam({games:i.data.data[0].games,idTeam:e.home_team,game:this.game,type:"home"}),this.getGamesByTeam({games:i.data.data[0].games,idTeam:e.away_team,game:this.game,type:"away"}),this.validateDataLocalStorage({team:this.game.home_team,inFavor:!0,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.game.home_team,inFavor:!0,game:this.game})):(this.getGamesByTeam({games:i.data.data[0].games,idTeam:e.home_team,type:"home"}),this.validateDataLocalStorage({team:e.home_team,inFavor:!0,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.game.home_team,inFavor:!0,game:this.game}))},obtenerNombreAbreviado(e){let r=e.split(", ");if(r.length!==2)return e;let i=r[0],O=r[1],R=i.split(" ")[0];return O.charAt(0).toUpperCase()+". "+R},getDataPlayers(e){for(let r=0;r<e.length;r++)this.playersData.hasOwnProperty(e[r].player_id)||(this.playersData[e[r].player_id]={name:this.obtenerNombreAbreviado(e[r].name),last_name:e[r].name.includes(",")?e[r].name.split(",")[0].trim():"",first_name:e[r].name.includes(",")?e[r].name.split(",")[1].trim():"",img:e[r].photo,photo:e[r].photo,position:e[r].position_id,positions:[e[r].position_id],id:e[r].player_id,player_id:e[r].player_id,team_id:e[r].team_id,team:e[r].team_id,nationality_id:e[r].nationality_id,nationality_flag:"https://az755631.vo.msecnd.net/flags/"+e[r].nationality_id+".jpg",jersey:e[r].jersey,isSelected:!0})},getSeasonByGame(e){e.season!=""?this.seasonsByGame[e.game]=e.season:this.seasonsByGame[e.game]="-"},getMatchByGame(e){e.match!=""?this.matchesByGame[e.game]=e.match.replace("M","J"):this.matchesByGame[e.game]="-"},getRivalsByGame(e){this.rivalsByGame[e.favor?"InFavor":"Against"]?this.rivalsByGame[e.favor?"InFavor":"Against"][e.team]?this.rivalsByGame[e.favor?"InFavor":"Against"][e.team][e.game]=e.rival:(this.rivalsByGame[e.favor?"InFavor":"Against"][e.team]={},this.rivalsByGame[e.favor?"InFavor":"Against"][e.team][e.game]=e.rival):(this.rivalsByGame[e.favor?"InFavor":"Against"]={},this.rivalsByGame[e.favor?"InFavor":"Against"][e.team]={},this.rivalsByGame[e.favor?"InFavor":"Against"][e.team][e.game]=e.rival)},getDataTeams(e){for(let r=0;r<e.length;r++)this.teamsData.hasOwnProperty(e[r].team_id)||(this.teamsData[e[r].team_id]={name:e[r].name,acronym:e[r].acronym,img:"https://az755631.vo.msecnd.net/teams-80/"+e[r].team_id+".png",id:e[r].team_id})},getTypePlay(e){typeof e=="string"&&(this.typePlay=e)},clickOpenModal(){this.openModal=!this.openModal,document.body.classList.add("no-scroll")},clickCloseFinal(){this.openModal=!1,document.body.classList.remove("no-scroll")},onCornersFilled({corners:e,cornersAgainst:r}){this.teamCorners={corners:e,cornersAgainst:r}},onOpenMediaPlayer(e){this.$emit("open-media-player",e)},onOpenMediaPlayerJson(e){let r={seasonId:this.seasonId,mainSectionType:1,playListType:3,categoryIds:[e.id],gameIds:this.forGame?[this.game.id]:null,playerIds:[],goalkeeperIds:[],teamId:this.teamSelected,matchResult:[1,2,3],playData:{},advancedFilter:{playListTitle:""}};this.$emit("open-media-player",r)}},mounted(){this.isLoading=!0,document.body.classList.add("no-scroll"),this.setHeaderStickyListener();const e=()=>{const r=document.querySelector(".gsc-set-piece");r?this.containerWidth=r.clientWidth:setTimeout(()=>{},400)};window.addEventListener("resize",e),this.$nextTick(e)}},uX=()=>{t.useCssVars(e=>({"5093f9b4":e.heightFilters}))},dX=eM.setup;eM.setup=dX?(e,r)=>(uX(),dX(e,r)):uX;const $oa={class:"gsc-set-piece"},Uoa={key:0,class:"overlay-loading"},Hoa={ref:"header",class:"gsc-set-piece__header"};function Goa(e,r,i,O,R,l){const g=t.resolveComponent("GSCHeaderSetPiece"),n=t.resolveComponent("GSCDataToHighlight"),x=t.resolveComponent("GSCTrend"),d=t.resolveComponent("GSCConnectionsSetPiece"),a=t.resolveComponent("GSCModalBreakdown"),_=t.resolveComponent("GSCSpecificPlays");return t.openBlock(),t.createElementBlock("div",$oa,[R.isLoading?(t.openBlock(),t.createElementBlock("div",Uoa,r[0]||(r[0]=[t.createElementVNode("div",{class:"overlay-loading__spinner"},[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/balon_liga.png",alt:""})],-1),t.createElementVNode("div",{class:"overlay-loading__text"},"Loading...",-1)]))):t.createCommentVNode("",!0),t.createElementVNode("div",Hoa,[(t.openBlock(),t.createBlock(g,{"width-container":R.containerWidth,type:i.forTeam?0:3,"teams-data":R.teamsData,"tournament-selected":i.tournamentSelected,"game-info":i.game,"total-corners":l.calculateTotal,"show-corners":R.showCorners,"in-favor":R.infavoragainst,"corners-in-favor":R.teamCorners.corners,"corners-against":R.teamCorners.cornersAgainst,"for-game":i.forGame,key:R.updateFilter,lateralidad:R.lateralidad,"available-players":R.filterPlayersAvailable,"available-games":R.filterGamesAvailable,"is-synchronization":i.isSynchronization,onChangeShowFilters:l.onChangeShowFilters,onChangetypePlay:l.getTypePlay,onOpenModal:l.clickOpenModal,onTeamselected:l.getTeamSelected,onInfavoragainstteam:l.getInFavorAgainstTeam,onFilter_results_by_time:l.getFilterResultsByTime,onFilter_details:l.getFilterDetails,onFilter_games:l.getFilterGames,onFilter_takencorners:l.getFilterTakenCorners,onFilter_howwascorner:l.getFilterHowWasCorner,onFilter_zone:l.getFilterZone,onFilter_whathappened:l.getFilterWhatHappened},null,8,["width-container","type","teams-data","tournament-selected","game-info","total-corners","show-corners","in-favor","corners-in-favor","corners-against","for-game","lateralidad","available-players","available-games","is-synchronization","onChangeShowFilters","onChangetypePlay","onOpenModal","onTeamselected","onInfavoragainstteam","onFilter_results_by_time","onFilter_details","onFilter_games","onFilter_takencorners","onFilter_howwascorner","onFilter_zone","onFilter_whathappened"]))],512),!i.isSynchronization&&R.teamSelected>0&&R.regularflag?(t.openBlock(),t.createBlock(n,{key:1,team:R.teamSelected,season:i.game.season,game:i.game,"flag-regular":R.regularflag,"in-favor":R.infavoragainst,"width-container":R.containerWidth},null,8,["team","season","game","flag-regular","in-favor","width-container"])):t.createCommentVNode("",!0),i.isSynchronization?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(x,{"players-data":R.playersData,"teams-data":R.teamsData,"tournament-selected":i.tournamentSelected,"touch-all-data":l.calculationTouchesData,"field-positions-all":l.calculationPositionsData,"width-container":R.containerWidth,"in-favor":R.infavoragainst,"for-game":i.forGame,"home-team":i.game.home_team,"away-team":i.game.away_team,"acronym-home":i.game.home_acronym,"acronym-away":i.game.away_acronym,team:R.teamSelected,"type-play":R.typePlay,selected_category:R.filters.cornertype,"is-tactic-visible":i.isTacticVisible,key:R.updateTrend,onChangelateralidad:l.setCornersSide},null,8,["players-data","teams-data","tournament-selected","touch-all-data","field-positions-all","width-container","in-favor","for-game","home-team","away-team","acronym-home","acronym-away","team","type-play","selected_category","is-tactic-visible","onChangelateralidad"])),!i.isSynchronization&&R.teamSelected>0?(t.openBlock(),t.createBlock(d,{"seasons-by-game":R.seasonsByGame,"matches-by-game":R.matchesByGame,"rivals-by-game":R.rivalsByGame,"width-container":R.containerWidth,selected_category:R.filters.cornertype,"players-data":R.playersData,"tournament-selected":i.tournamentSelected,"teams-data":R.teamsData,onChangelateralidad:l.setCornersSide,"touch-all-data":l.calculationTouchesData,"team-id":i.forGame?R.infavoragainst?R.teamSelected:R.teamSelected==i.game.home_team?i.game.away_team:i.game.home_team:R.teamSelected,"in-favor":R.infavoragainst,"for-game":i.forGame,key:R.updateConnections},null,8,["seasons-by-game","matches-by-game","rivals-by-game","width-container","selected_category","players-data","tournament-selected","teams-data","onChangelateralidad","touch-all-data","team-id","in-favor","for-game"])):t.createCommentVNode("",!0),R.openModal?(t.openBlock(),t.createBlock(a,{key:4,"component-width":R.containerWidth,onClickClose:l.clickCloseFinal,"show-modal-prop":R.openModal,id:R.teamSelected,"season-id":i.game.season,game:i.game.id,onClickPlay:l.onOpenMediaPlayerJson,prematch:!!i.forGame},null,8,["component-width","onClickClose","show-modal-prop","id","season-id","game","onClickPlay","prematch"])):t.createCommentVNode("",!0),R.isSpecificPlaysVisible&&R.teamSelected&&i.game.season?(t.openBlock(),t.createBlock(_,{key:5,"team-id-for-analysis":R.teamSelected,"season-id-for-analysis":i.game?i.game.season:R.seasonId,"width-container":R.containerWidth,filters:R.filters,"is-game-only":l.isGameOnly,"tournament-selected":i.tournamentSelected,selected_category:R.filters.cornertype,onChangelateralidad:l.setCornersSide,game:i.game,"is-against-mode":!R.infavoragainst,"are-filters-open":R.areFiltersOpen,"is-tactic-visible":i.isTacticVisible,"is-synchronization":i.isSynchronization,"can-play-videos":i.canPlayVideos,"video-privileges-playing-as":i.videoPrivilegesPlayingAs,onOpenMediaPlayer:l.onOpenMediaPlayer,onCornersFilled:l.onCornersFilled},null,8,["team-id-for-analysis","season-id-for-analysis","width-container","filters","is-game-only","tournament-selected","selected_category","onChangelateralidad","game","is-against-mode","are-filters-open","is-tactic-visible","is-synchronization","can-play-videos","video-privileges-playing-as","onOpenMediaPlayer","onCornersFilled"])):t.createCommentVNode("",!0)])}const qoa=yu(eM,[["render",Goa],["__scopeId","data-v-d1d7c074"]]),$2a="",U2a="",Woa={class:"datagame-container"},Zoa=eo({__name:"GSCTacticaFijaMain",props:{game:{type:Object,default:()=>({})},isTacticVisible:{type:Boolean,default:!0},isSynchronization:{type:Boolean,default:!1},tournamentSelected:{type:Object,default:()=>({})},canPlayVideos:{type:Boolean,default:!0},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])}},emits:["open-media-player"],setup(e,{emit:r}){function i(O){r("open-media-player",O)}return(O,R)=>(t.openBlock(),t.createElementBlock("div",Woa,[t.createVNode(t.unref(qoa),{game:{id:e.game.gameId,home_team:e.game.homeTeam.team_id,away_team:e.game.awayTeam.team_id,season:e.game.seasonId,regularSeasonId:e.game.regularSeasonId,game_status:e.game.game_status,home_acronym:e.game.homeTeam.acronym,away_acronym:e.game.awayTeam.acronym,logo_home:"https://az755631.vo.msecnd.net/teams-80/"+e.game.homeTeam.team_id+".png",logo_away:"https://az755631.vo.msecnd.net/teams-80/"+e.game.awayTeam.team_id+".png"},"tournament-selected":e.tournamentSelected,"for-season":e.game.game_status===4,"for-team":!1,"for-game":e.game.game_status!==4,"is-tactic-visible":e.isTacticVisible,"is-synchronization":e.isSynchronization,"can-play-videos":e.canPlayVideos,"video-privileges-playing-as":e.videoPrivilegesPlayingAs,onOpenMediaPlayer:i},null,8,["game","tournament-selected","for-season","for-game","is-tactic-visible","is-synchronization","can-play-videos","video-privileges-playing-as"])]))}},[["__scopeId","data-v-d1bc575d"]]),gb=(e,r)=>{const i=e.__vccOpts||e;for(const[O,R]of r)i[O]=R;return i},Yoa={__name:"ButtonCustom",props:{text:{type:String,default:""},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},padding:{type:String,default:"0px"},borderRadius:{type:String,default:"0px"},borderWidth:{type:String,default:"1px"},borderColor:{type:String,default:"#d9d9d9"},backgroundColor:{type:String,default:"#FFFFFF"},activeBackgroundColor:{type:String,default:""},activeBorderColor:{type:String,default:""},activeBorderWidth:{type:String,default:"1px"},activeFontColor:{type:String,default:""},fontColor:{type:String,default:"#000000"},fontSize:{type:String,default:"16px"},fontFamily:{type:String,default:"Poppins-Regular, sans-serif"},isActive:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:r}){const i=e,O=t.computed(()=>({"--height":i.height,"--width":i.width,"--padding":i.padding,"--border-radius":i.borderRadius,"--border":`solid ${i.borderWidth} ${i.borderColor}`,"--background-color":i.backgroundColor,"--font-color":i.fontColor,"--font-size":i.fontSize,"--font-family":i.fontFamily,"--active-background-color":i.activeBackgroundColor||i.backgroundColor,"--active-border-color":i.activeBorderColor||i.borderColor,"--active-font-color":i.activeFontColor||i.fontColor}));function R(){r("click")}return(l,g)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["button",{active:e.isActive}]),style:t.normalizeStyle(O.value),onClick:R},t.toDisplayString(e.text),7))}},Xoa=gb(Yoa,[["__scopeId","data-v-ea76c1c1"]]);function hX(e,r){return function(){return e.apply(r,arguments)}}const{toString:Joa}=Object.prototype,{getPrototypeOf:tM}=Object,o6=(e=>r=>{const i=Joa.call(r);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Qm=e=>(e=e.toLowerCase(),r=>o6(r)===e),s6=e=>r=>typeof r===e,{isArray:Xv}=Array,yb=s6("undefined");function Koa(e){return e!==null&&!yb(e)&&e.constructor!==null&&!yb(e.constructor)&&hf(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const pX=Qm("ArrayBuffer");function Qoa(e){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(e):r=e&&e.buffer&&pX(e.buffer),r}const esa=s6("string"),hf=s6("function"),fX=s6("number"),l6=e=>e!==null&&typeof e=="object",tsa=e=>e===!0||e===!1,c6=e=>{if(o6(e)!=="object")return!1;const r=tM(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},asa=Qm("Date"),nsa=Qm("File"),rsa=Qm("Blob"),isa=Qm("FileList"),osa=e=>l6(e)&&hf(e.pipe),ssa=e=>{let r;return e&&(typeof FormData=="function"&&e instanceof FormData||hf(e.append)&&((r=o6(e))==="formdata"||r==="object"&&hf(e.toString)&&e.toString()==="[object FormData]"))},lsa=Qm("URLSearchParams"),csa=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function vb(e,r,{allOwnKeys:i=!1}={}){if(e===null||typeof e>"u")return;let O,R;if(typeof e!="object"&&(e=[e]),Xv(e))for(O=0,R=e.length;O<R;O++)r.call(null,e[O],O,e);else{const l=i?Object.getOwnPropertyNames(e):Object.keys(e),g=l.length;let n;for(O=0;O<g;O++)n=l[O],r.call(null,e[n],n,e)}}function mX(e,r){r=r.toLowerCase();const i=Object.keys(e);let O=i.length,R;for(;O-- >0;)if(R=i[O],r===R.toLowerCase())return R;return null}const gX=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),yX=e=>!yb(e)&&e!==gX;function aM(){const{caseless:e}=yX(this)&&this||{},r={},i=(O,R)=>{const l=e&&mX(r,R)||R;c6(r[l])&&c6(O)?r[l]=aM(r[l],O):c6(O)?r[l]=aM({},O):Xv(O)?r[l]=O.slice():r[l]=O};for(let O=0,R=arguments.length;O<R;O++)arguments[O]&&vb(arguments[O],i);return r}const usa=(e,r,i,{allOwnKeys:O}={})=>(vb(r,(R,l)=>{i&&hf(R)?e[l]=hX(R,i):e[l]=R},{allOwnKeys:O}),e),dsa=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),hsa=(e,r,i,O)=>{e.prototype=Object.create(r.prototype,O),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:r.prototype}),i&&Object.assign(e.prototype,i)},psa=(e,r,i,O)=>{let R,l,g;const n={};if(r=r||{},e==null)return r;do{for(R=Object.getOwnPropertyNames(e),l=R.length;l-- >0;)g=R[l],(!O||O(g,e,r))&&!n[g]&&(r[g]=e[g],n[g]=!0);e=i!==!1&&tM(e)}while(e&&(!i||i(e,r))&&e!==Object.prototype);return r},fsa=(e,r,i)=>{e=String(e),(i===void 0||i>e.length)&&(i=e.length),i-=r.length;const O=e.indexOf(r,i);return O!==-1&&O===i},msa=e=>{if(!e)return null;if(Xv(e))return e;let r=e.length;if(!fX(r))return null;const i=new Array(r);for(;r-- >0;)i[r]=e[r];return i},gsa=(e=>r=>e&&r instanceof e)(typeof Uint8Array<"u"&&tM(Uint8Array)),ysa=(e,r)=>{const i=(e&&e[Symbol.iterator]).call(e);let O;for(;(O=i.next())&&!O.done;){const R=O.value;r.call(e,R[0],R[1])}},vsa=(e,r)=>{let i;const O=[];for(;(i=e.exec(r))!==null;)O.push(i);return O},_sa=Qm("HTMLFormElement"),bsa=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,O){return i.toUpperCase()+O}),vX=(({hasOwnProperty:e})=>(r,i)=>e.call(r,i))(Object.prototype),xsa=Qm("RegExp"),_X=(e,r)=>{const i=Object.getOwnPropertyDescriptors(e),O={};vb(i,(R,l)=>{let g;(g=r(R,l,e))!==!1&&(O[l]=g||R)}),Object.defineProperties(e,O)},wsa=e=>{_X(e,(r,i)=>{if(hf(e)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const O=e[i];if(hf(O)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},ksa=(e,r)=>{const i={},O=R=>{R.forEach(l=>{i[l]=!0})};return Xv(e)?O(e):O(String(e).split(r)),i},Ssa=()=>{},Csa=(e,r)=>(e=+e,Number.isFinite(e)?e:r),nM="abcdefghijklmnopqrstuvwxyz",bX="0123456789",xX={DIGIT:bX,ALPHA:nM,ALPHA_DIGIT:nM+nM.toUpperCase()+bX},Tsa=(e=16,r=xX.ALPHA_DIGIT)=>{let i="";const{length:O}=r;for(;e--;)i+=r[Math.random()*O|0];return i};function Asa(e){return!!(e&&hf(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Esa=e=>{const r=new Array(10),i=(O,R)=>{if(l6(O)){if(r.indexOf(O)>=0)return;if(!("toJSON"in O)){r[R]=O;const l=Xv(O)?[]:{};return vb(O,(g,n)=>{const x=i(g,R+1);!yb(x)&&(l[n]=x)}),r[R]=void 0,l}}return O};return i(e,0)},Msa=Qm("AsyncFunction"),Isa=e=>e&&(l6(e)||hf(e))&&hf(e.then)&&hf(e.catch),Kr={isArray:Xv,isArrayBuffer:pX,isBuffer:Koa,isFormData:ssa,isArrayBufferView:Qoa,isString:esa,isNumber:fX,isBoolean:tsa,isObject:l6,isPlainObject:c6,isUndefined:yb,isDate:asa,isFile:nsa,isBlob:rsa,isRegExp:xsa,isFunction:hf,isStream:osa,isURLSearchParams:lsa,isTypedArray:gsa,isFileList:isa,forEach:vb,merge:aM,extend:usa,trim:csa,stripBOM:dsa,inherits:hsa,toFlatObject:psa,kindOf:o6,kindOfTest:Qm,endsWith:fsa,toArray:msa,forEachEntry:ysa,matchAll:vsa,isHTMLForm:_sa,hasOwnProperty:vX,hasOwnProp:vX,reduceDescriptors:_X,freezeMethods:wsa,toObjectSet:ksa,toCamelCase:bsa,noop:Ssa,toFiniteNumber:Csa,findKey:mX,global:gX,isContextDefined:yX,ALPHABET:xX,generateString:Tsa,isSpecCompliantForm:Asa,toJSONObject:Esa,isAsyncFn:Msa,isThenable:Isa};function Fc(e,r,i,O,R){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",r&&(this.code=r),i&&(this.config=i),O&&(this.request=O),R&&(this.response=R)}Kr.inherits(Fc,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Kr.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const wX=Fc.prototype,kX={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{kX[e]={value:e}}),Object.defineProperties(Fc,kX),Object.defineProperty(wX,"isAxiosError",{value:!0}),Fc.from=(e,r,i,O,R,l)=>{const g=Object.create(wX);return Kr.toFlatObject(e,g,function(n){return n!==Error.prototype},n=>n!=="isAxiosError"),Fc.call(g,e.message,r,i,O,R),g.cause=e,g.name=e.name,l&&Object.assign(g,l),g};const Bsa=null;function rM(e){return Kr.isPlainObject(e)||Kr.isArray(e)}function SX(e){return Kr.endsWith(e,"[]")?e.slice(0,-2):e}function CX(e,r,i){return e?e.concat(r).map(function(O,R){return O=SX(O),!i&&R?"["+O+"]":O}).join(i?".":""):r}function Psa(e){return Kr.isArray(e)&&!e.some(rM)}const Osa=Kr.toFlatObject(Kr,{},null,function(e){return/^is[A-Z]/.test(e)});function u6(e,r,i){if(!Kr.isObject(e))throw new TypeError("target must be an object");r=r||new FormData,i=Kr.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,c){return!Kr.isUndefined(c[y])});const O=i.metaTokens,R=i.visitor||d,l=i.dots,g=i.indexes,n=(i.Blob||typeof Blob<"u"&&Blob)&&Kr.isSpecCompliantForm(r);if(!Kr.isFunction(R))throw new TypeError("visitor must be a function");function x(y){if(y===null)return"";if(Kr.isDate(y))return y.toISOString();if(!n&&Kr.isBlob(y))throw new Fc("Blob is not supported. Use a Buffer instead.");return Kr.isArrayBuffer(y)||Kr.isTypedArray(y)?n&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function d(y,c,o){let s=y;if(y&&!o&&typeof y=="object"){if(Kr.endsWith(c,"{}"))c=O?c:c.slice(0,-2),y=JSON.stringify(y);else if(Kr.isArray(y)&&Psa(y)||(Kr.isFileList(y)||Kr.endsWith(c,"[]"))&&(s=Kr.toArray(y)))return c=SX(c),s.forEach(function(f,h){!(Kr.isUndefined(f)||f===null)&&r.append(g===!0?CX([c],h,l):g===null?c:c+"[]",x(f))}),!1}return rM(y)?!0:(r.append(CX(o,c,l),x(y)),!1)}const a=[],_=Object.assign(Osa,{defaultVisitor:d,convertValue:x,isVisitable:rM});function b(y,c){if(!Kr.isUndefined(y)){if(a.indexOf(y)!==-1)throw Error("Circular reference detected in "+c.join("."));a.push(y),Kr.forEach(y,function(o,s){(!(Kr.isUndefined(o)||o===null)&&R.call(r,o,Kr.isString(s)?s.trim():s,c,_))===!0&&b(o,c?c.concat(s):[s])}),a.pop()}}if(!Kr.isObject(e))throw new TypeError("data must be an object");return b(e),r}function TX(e){const r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return r[i]})}function iM(e,r){this._pairs=[],e&&u6(e,this,r)}const AX=iM.prototype;AX.append=function(e,r){this._pairs.push([e,r])},AX.toString=function(e){const r=e?function(i){return e.call(this,i,TX)}:TX;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function Lsa(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function EX(e,r,i){if(!r)return e;const O=i&&i.encode||Lsa,R=i&&i.serialize;let l;if(R?l=R(r,i):l=Kr.isURLSearchParams(r)?r.toString():new iM(r,i).toString(O),l){const g=e.indexOf("#");g!==-1&&(e=e.slice(0,g)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class zsa{constructor(){this.handlers=[]}use(r,i,O){return this.handlers.push({fulfilled:r,rejected:i,synchronous:O?O.synchronous:!1,runWhen:O?O.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){Kr.forEach(this.handlers,function(i){i!==null&&r(i)})}}const MX=zsa,IX={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Nsa=typeof URLSearchParams<"u"?URLSearchParams:iM,Fsa=typeof FormData<"u"?FormData:null,Dsa=typeof Blob<"u"?Blob:null,Rsa={isBrowser:!0,classes:{URLSearchParams:Nsa,FormData:Fsa,Blob:Dsa},protocols:["http","https","file","blob","url","data"]},BX=typeof window<"u"&&typeof document<"u",Vsa=(e=>BX&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),jsa=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),$sa=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:BX,hasStandardBrowserEnv:Vsa,hasStandardBrowserWebWorkerEnv:jsa},Symbol.toStringTag,{value:"Module"})),e0={...$sa,...Rsa};function Usa(e,r){return u6(e,new e0.classes.URLSearchParams,Object.assign({visitor:function(i,O,R,l){return e0.isNode&&Kr.isBuffer(i)?(this.append(O,i.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)}},r))}function Hsa(e){return Kr.matchAll(/\w+|\[(\w*)]/g,e).map(r=>r[0]==="[]"?"":r[1]||r[0])}function Gsa(e){const r={},i=Object.keys(e);let O;const R=i.length;let l;for(O=0;O<R;O++)l=i[O],r[l]=e[l];return r}function PX(e){function r(i,O,R,l){let g=i[l++];if(g==="__proto__")return!0;const n=Number.isFinite(+g),x=l>=i.length;return g=!g&&Kr.isArray(R)?R.length:g,x?(Kr.hasOwnProp(R,g)?R[g]=[R[g],O]:R[g]=O,!n):((!R[g]||!Kr.isObject(R[g]))&&(R[g]=[]),r(i,O,R[g],l)&&Kr.isArray(R[g])&&(R[g]=Gsa(R[g])),!n)}if(Kr.isFormData(e)&&Kr.isFunction(e.entries)){const i={};return Kr.forEachEntry(e,(O,R)=>{r(Hsa(O),R,i,0)}),i}return null}function qsa(e,r,i){if(Kr.isString(e))try{return(r||JSON.parse)(e),Kr.trim(e)}catch(O){if(O.name!=="SyntaxError")throw O}return(i||JSON.stringify)(e)}const oM={transitional:IX,adapter:["xhr","http"],transformRequest:[function(e,r){const i=r.getContentType()||"",O=i.indexOf("application/json")>-1,R=Kr.isObject(e);if(R&&Kr.isHTMLForm(e)&&(e=new FormData(e)),Kr.isFormData(e))return O?JSON.stringify(PX(e)):e;if(Kr.isArrayBuffer(e)||Kr.isBuffer(e)||Kr.isStream(e)||Kr.isFile(e)||Kr.isBlob(e))return e;if(Kr.isArrayBufferView(e))return e.buffer;if(Kr.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(R){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Usa(e,this.formSerializer).toString();if((l=Kr.isFileList(e))||i.indexOf("multipart/form-data")>-1){const g=this.env&&this.env.FormData;return u6(l?{"files[]":e}:e,g&&new g,this.formSerializer)}}return R||O?(r.setContentType("application/json",!1),qsa(e)):e}],transformResponse:[function(e){const r=this.transitional||oM.transitional,i=r&&r.forcedJSONParsing,O=this.responseType==="json";if(e&&Kr.isString(e)&&(i&&!this.responseType||O)){const R=!(r&&r.silentJSONParsing)&&O;try{return JSON.parse(e)}catch(l){if(R)throw l.name==="SyntaxError"?Fc.from(l,Fc.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:e0.classes.FormData,Blob:e0.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Kr.forEach(["delete","get","head","post","put","patch"],e=>{oM.headers[e]={}});const sM=oM,Wsa=Kr.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Zsa=e=>{const r={};let i,O,R;return e&&e.split(`
8201
+ `),At=he.createShader(he.FRAGMENT_SHADER);if(he.isContextLost())return void(this.failedToCreate=!0);if(he.shaderSource(At,Ct),he.compileShader(At),!he.getShaderParameter(At,he.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${he.getShaderInfoLog(At)}`);he.attachShader(this.program,At);const Zt=he.createShader(he.VERTEX_SHADER);if(he.isContextLost())return void(this.failedToCreate=!0);if(he.shaderSource(Zt,Rt),he.compileShader(Zt),!he.getShaderParameter(Zt,he.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${he.getShaderInfoLog(Zt)}`);he.attachShader(this.program,Zt),this.attributes={};const Kt={};this.numAttributes=ze.length;for(let Yt=0;Yt<this.numAttributes;Yt++)ze[Yt]&&(he.bindAttribLocation(this.program,Yt,ze[Yt]),this.attributes[ze[Yt]]=Yt);if(he.linkProgram(this.program),!he.getProgramParameter(this.program,he.LINK_STATUS))throw new Error(`Program failed to link: ${he.getProgramInfoLog(this.program)}`);he.deleteShader(Zt),he.deleteShader(At);for(let Yt=0;Yt<xt.length;Yt++){const da=xt[Yt];if(da&&!Kt[da]){const ba=he.getUniformLocation(this.program,da);ba&&(Kt[da]=ba)}}this.fixedUniforms=$(u,Kt),this.terrainUniforms=((Yt,da)=>({u_depth:new a.aI(Yt,da.u_depth),u_terrain:new a.aI(Yt,da.u_terrain),u_terrain_dim:new a.aJ(Yt,da.u_terrain_dim),u_terrain_matrix:new a.aK(Yt,da.u_terrain_matrix),u_terrain_unpack:new a.aL(Yt,da.u_terrain_unpack),u_terrain_exaggeration:new a.aJ(Yt,da.u_terrain_exaggeration)}))(u,Kt),this.binderUniforms=F?F.getUniforms(u,Kt):[]}draw(u,m,F,$,Z,ie,he,be,Ce,ze,$e,nt,ct,pt,xt,Et,Ct,Rt){const At=u.gl;if(this.failedToCreate)return;if(u.program.set(this.program),u.setDepthMode(F),u.setStencilMode($),u.setColorMode(Z),u.setCullFace(ie),be){u.activeTexture.set(At.TEXTURE2),At.bindTexture(At.TEXTURE_2D,be.depthTexture),u.activeTexture.set(At.TEXTURE3),At.bindTexture(At.TEXTURE_2D,be.texture);for(const Kt in this.terrainUniforms)this.terrainUniforms[Kt].set(be[Kt])}for(const Kt in this.fixedUniforms)this.fixedUniforms[Kt].set(he[Kt]);xt&&xt.setUniforms(u,this.binderUniforms,ct,{zoom:pt});let Zt=0;switch(m){case At.LINES:Zt=2;break;case At.TRIANGLES:Zt=3;break;case At.LINE_STRIP:Zt=1}for(const Kt of nt.get()){const Yt=Kt.vaos||(Kt.vaos={});(Yt[Ce]||(Yt[Ce]=new Fn)).bind(u,this,ze,xt?xt.getPaintVertexBuffers():[],$e,Kt.vertexOffset,Et,Ct,Rt),At.drawElements(m,Kt.primitiveLength*Zt,At.UNSIGNED_SHORT,Kt.primitiveOffset*Zt*2)}}}function Va(j,u,m){const F=1/St(m,1,u.transform.tileZoom),$=Math.pow(2,m.tileID.overscaledZ),Z=m.tileSize*Math.pow(2,u.transform.tileZoom)/$,ie=Z*(m.tileID.canonical.x+m.tileID.wrap*$),he=Z*m.tileID.canonical.y;return{u_image:0,u_texsize:m.imageAtlasTexture.size,u_scale:[F,j.fromScale,j.toScale],u_fade:j.t,u_pixel_coord_upper:[ie>>16,he>>16],u_pixel_coord_lower:[65535&ie,65535&he]}}const an=(j,u,m,F)=>{const $=u.style.light,Z=$.properties.get("position"),ie=[Z.x,Z.y,Z.z],he=function(){var Ce=new a.A(9);return a.A!=Float32Array&&(Ce[1]=0,Ce[2]=0,Ce[3]=0,Ce[5]=0,Ce[6]=0,Ce[7]=0),Ce[0]=1,Ce[4]=1,Ce[8]=1,Ce}();$.properties.get("anchor")==="viewport"&&function(Ce,ze){var $e=Math.sin(ze),nt=Math.cos(ze);Ce[0]=nt,Ce[1]=$e,Ce[2]=0,Ce[3]=-$e,Ce[4]=nt,Ce[5]=0,Ce[6]=0,Ce[7]=0,Ce[8]=1}(he,-u.transform.angle),function(Ce,ze,$e){var nt=ze[0],ct=ze[1],pt=ze[2];Ce[0]=nt*$e[0]+ct*$e[3]+pt*$e[6],Ce[1]=nt*$e[1]+ct*$e[4]+pt*$e[7],Ce[2]=nt*$e[2]+ct*$e[5]+pt*$e[8]}(ie,ie,he);const be=$.properties.get("color");return{u_matrix:j,u_lightpos:ie,u_lightintensity:$.properties.get("intensity"),u_lightcolor:[be.r,be.g,be.b],u_vertical_gradient:+m,u_opacity:F}},_n=(j,u,m,F,$,Z,ie)=>a.e(an(j,u,m,F),Va(Z,u,ie),{u_height_factor:-Math.pow(2,$.overscaledZ)/ie.tileSize/8}),gn=j=>({u_matrix:j}),Ln=(j,u,m,F)=>a.e(gn(j),Va(m,u,F)),Un=(j,u)=>({u_matrix:j,u_world:u}),ma=(j,u,m,F,$)=>a.e(Ln(j,u,m,F),{u_world:$}),$a=(j,u,m,F)=>{const $=j.transform;let Z,ie;if(F.paint.get("circle-pitch-alignment")==="map"){const he=St(m,1,$.zoom);Z=!0,ie=[he,he]}else Z=!1,ie=$.pixelsToGLUnits;return{u_camera_to_center_distance:$.cameraToCenterDistance,u_scale_with_map:+(F.paint.get("circle-pitch-scale")==="map"),u_matrix:j.translatePosMatrix(u.posMatrix,m,F.paint.get("circle-translate"),F.paint.get("circle-translate-anchor")),u_pitch_with_map:+Z,u_device_pixel_ratio:j.pixelRatio,u_extrude_scale:ie}},ta=(j,u)=>({u_matrix:u,u_pixel_extrude_scale:[1/j.width,1/j.height]}),ca=(j,u,m)=>({u_matrix:j,u_inv_matrix:u,u_camera_to_center_distance:m.cameraToCenterDistance,u_viewport_size:[m.width,m.height]}),fa=(j,u,m=1)=>({u_matrix:j,u_color:u,u_overlay:0,u_overlay_scale:m}),za=j=>({u_matrix:j}),La=(j,u,m,F)=>({u_matrix:j,u_extrude_scale:St(u,1,m),u_intensity:F}),Wa=(j,u,m,F)=>{const $=a.H();a.aQ($,0,j.width,j.height,0,0,1);const Z=j.context.gl;return{u_matrix:$,u_world:[Z.drawingBufferWidth,Z.drawingBufferHeight],u_image:m,u_color_ramp:F,u_opacity:u.paint.get("heatmap-opacity")}},Ra=(j,u,m,F)=>{const $=m.paint.get("hillshade-shadow-color"),Z=m.paint.get("hillshade-highlight-color"),ie=m.paint.get("hillshade-accent-color");let he=m.paint.get("hillshade-illumination-direction")*(Math.PI/180);m.paint.get("hillshade-illumination-anchor")==="viewport"&&(he-=j.transform.angle);const be=!j.options.moving;return{u_matrix:F?F.posMatrix:j.transform.calculatePosMatrix(u.tileID.toUnwrapped(),be),u_image:0,u_latrange:la(0,u.tileID),u_light:[m.paint.get("hillshade-exaggeration"),he],u_shadow:$,u_highlight:Z,u_accent:ie}},Ia=(j,u)=>{const m=u.stride,F=a.H();return a.aQ(F,0,a.X,-a.X,0,0,1),a.J(F,F,[0,-a.X,0]),{u_matrix:F,u_image:1,u_dimension:[m,m],u_zoom:j.overscaledZ,u_unpack:u.getUnpackVector()}};function la(j,u){const m=Math.pow(2,u.canonical.z),F=u.canonical.y;return[new a.Z(0,F/m).toLngLat().lat,new a.Z(0,(F+1)/m).toLngLat().lat]}const oa=(j,u,m,F)=>{const $=j.transform;return{u_matrix:un(j,u,m,F),u_ratio:1/St(u,1,$.zoom),u_device_pixel_ratio:j.pixelRatio,u_units_to_pixels:[1/$.pixelsToGLUnits[0],1/$.pixelsToGLUnits[1]]}},Sa=(j,u,m,F,$)=>a.e(oa(j,u,m,$),{u_image:0,u_image_height:F}),Za=(j,u,m,F,$)=>{const Z=j.transform,ie=ln(u,Z);return{u_matrix:un(j,u,m,$),u_texsize:u.imageAtlasTexture.size,u_ratio:1/St(u,1,Z.zoom),u_device_pixel_ratio:j.pixelRatio,u_image:0,u_scale:[ie,F.fromScale,F.toScale],u_fade:F.t,u_units_to_pixels:[1/Z.pixelsToGLUnits[0],1/Z.pixelsToGLUnits[1]]}},cn=(j,u,m,F,$,Z)=>{const ie=j.transform,he=j.lineAtlas,be=ln(u,ie),Ce=m.layout.get("line-cap")==="round",ze=he.getDash(F.from,Ce),$e=he.getDash(F.to,Ce),nt=ze.width*$.fromScale,ct=$e.width*$.toScale;return a.e(oa(j,u,m,Z),{u_patternscale_a:[be/nt,-ze.height/2],u_patternscale_b:[be/ct,-$e.height/2],u_sdfgamma:he.width/(256*Math.min(nt,ct)*j.pixelRatio)/2,u_image:0,u_tex_y_a:ze.y,u_tex_y_b:$e.y,u_mix:$.t})};function ln(j,u){return 1/St(j,1,u.tileZoom)}function un(j,u,m,F){return j.translatePosMatrix(F?F.posMatrix:u.tileID.posMatrix,u,m.paint.get("line-translate"),m.paint.get("line-translate-anchor"))}const En=(j,u,m,F,$)=>{return{u_matrix:j,u_tl_parent:u,u_scale_parent:m,u_buffer_scale:1,u_fade_t:F.mix,u_opacity:F.opacity*$.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:$.paint.get("raster-brightness-min"),u_brightness_high:$.paint.get("raster-brightness-max"),u_saturation_factor:(ie=$.paint.get("raster-saturation"),ie>0?1-1/(1.001-ie):-ie),u_contrast_factor:(Z=$.paint.get("raster-contrast"),Z>0?1/(1-Z):1+Z),u_spin_weights:kn($.paint.get("raster-hue-rotate"))};var Z,ie};function kn(j){j*=Math.PI/180;const u=Math.sin(j),m=Math.cos(j);return[(2*m+1)/3,(-Math.sqrt(3)*u-m+1)/3,(Math.sqrt(3)*u-m+1)/3]}const Pn=(j,u,m,F,$,Z,ie,he,be,Ce,ze,$e,nt,ct)=>{const pt=ie.transform;return{u_is_size_zoom_constant:+(j==="constant"||j==="source"),u_is_size_feature_constant:+(j==="constant"||j==="camera"),u_size_t:u?u.uSizeT:0,u_size:u?u.uSize:0,u_camera_to_center_distance:pt.cameraToCenterDistance,u_pitch:pt.pitch/360*2*Math.PI,u_rotate_symbol:+m,u_aspect_ratio:pt.width/pt.height,u_fade_change:ie.options.fadeDuration?ie.symbolFadeChange:1,u_matrix:he,u_label_plane_matrix:be,u_coord_matrix:Ce,u_is_text:+$e,u_pitch_with_map:+F,u_is_along_line:$,u_is_variable_anchor:Z,u_texsize:nt,u_texture:0,u_translation:ze,u_pitched_scale:ct}},xn=(j,u,m,F,$,Z,ie,he,be,Ce,ze,$e,nt,ct,pt)=>{const xt=ie.transform;return a.e(Pn(j,u,m,F,$,Z,ie,he,be,Ce,ze,$e,nt,pt),{u_gamma_scale:F?Math.cos(xt._pitch)*xt.cameraToCenterDistance:1,u_device_pixel_ratio:ie.pixelRatio,u_is_halo:+ct})},Tn=(j,u,m,F,$,Z,ie,he,be,Ce,ze,$e,nt,ct)=>a.e(xn(j,u,m,F,$,Z,ie,he,be,Ce,ze,!0,$e,!0,ct),{u_texsize_icon:nt,u_texture_icon:1}),Nn=(j,u,m)=>({u_matrix:j,u_opacity:u,u_color:m}),Jn=(j,u,m,F,$,Z)=>a.e(function(ie,he,be,Ce){const ze=be.imageManager.getPattern(ie.from.toString()),$e=be.imageManager.getPattern(ie.to.toString()),{width:nt,height:ct}=be.imageManager.getPixelSize(),pt=Math.pow(2,Ce.tileID.overscaledZ),xt=Ce.tileSize*Math.pow(2,be.transform.tileZoom)/pt,Et=xt*(Ce.tileID.canonical.x+Ce.tileID.wrap*pt),Ct=xt*Ce.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:ze.tl,u_pattern_br_a:ze.br,u_pattern_tl_b:$e.tl,u_pattern_br_b:$e.br,u_texsize:[nt,ct],u_mix:he.t,u_pattern_size_a:ze.displaySize,u_pattern_size_b:$e.displaySize,u_scale_a:he.fromScale,u_scale_b:he.toScale,u_tile_units_to_pixels:1/St(Ce,1,be.transform.tileZoom),u_pixel_coord_upper:[Et>>16,Ct>>16],u_pixel_coord_lower:[65535&Et,65535&Ct]}}(F,Z,m,$),{u_matrix:j,u_opacity:u}),$n={fillExtrusion:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_lightpos:new a.aO(j,u.u_lightpos),u_lightintensity:new a.aJ(j,u.u_lightintensity),u_lightcolor:new a.aO(j,u.u_lightcolor),u_vertical_gradient:new a.aJ(j,u.u_vertical_gradient),u_opacity:new a.aJ(j,u.u_opacity)}),fillExtrusionPattern:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_lightpos:new a.aO(j,u.u_lightpos),u_lightintensity:new a.aJ(j,u.u_lightintensity),u_lightcolor:new a.aO(j,u.u_lightcolor),u_vertical_gradient:new a.aJ(j,u.u_vertical_gradient),u_height_factor:new a.aJ(j,u.u_height_factor),u_image:new a.aI(j,u.u_image),u_texsize:new a.aP(j,u.u_texsize),u_pixel_coord_upper:new a.aP(j,u.u_pixel_coord_upper),u_pixel_coord_lower:new a.aP(j,u.u_pixel_coord_lower),u_scale:new a.aO(j,u.u_scale),u_fade:new a.aJ(j,u.u_fade),u_opacity:new a.aJ(j,u.u_opacity)}),fill:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix)}),fillPattern:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_image:new a.aI(j,u.u_image),u_texsize:new a.aP(j,u.u_texsize),u_pixel_coord_upper:new a.aP(j,u.u_pixel_coord_upper),u_pixel_coord_lower:new a.aP(j,u.u_pixel_coord_lower),u_scale:new a.aO(j,u.u_scale),u_fade:new a.aJ(j,u.u_fade)}),fillOutline:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_world:new a.aP(j,u.u_world)}),fillOutlinePattern:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_world:new a.aP(j,u.u_world),u_image:new a.aI(j,u.u_image),u_texsize:new a.aP(j,u.u_texsize),u_pixel_coord_upper:new a.aP(j,u.u_pixel_coord_upper),u_pixel_coord_lower:new a.aP(j,u.u_pixel_coord_lower),u_scale:new a.aO(j,u.u_scale),u_fade:new a.aJ(j,u.u_fade)}),circle:(j,u)=>({u_camera_to_center_distance:new a.aJ(j,u.u_camera_to_center_distance),u_scale_with_map:new a.aI(j,u.u_scale_with_map),u_pitch_with_map:new a.aI(j,u.u_pitch_with_map),u_extrude_scale:new a.aP(j,u.u_extrude_scale),u_device_pixel_ratio:new a.aJ(j,u.u_device_pixel_ratio),u_matrix:new a.aK(j,u.u_matrix)}),collisionBox:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_pixel_extrude_scale:new a.aP(j,u.u_pixel_extrude_scale)}),collisionCircle:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_inv_matrix:new a.aK(j,u.u_inv_matrix),u_camera_to_center_distance:new a.aJ(j,u.u_camera_to_center_distance),u_viewport_size:new a.aP(j,u.u_viewport_size)}),debug:(j,u)=>({u_color:new a.aM(j,u.u_color),u_matrix:new a.aK(j,u.u_matrix),u_overlay:new a.aI(j,u.u_overlay),u_overlay_scale:new a.aJ(j,u.u_overlay_scale)}),clippingMask:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix)}),heatmap:(j,u)=>({u_extrude_scale:new a.aJ(j,u.u_extrude_scale),u_intensity:new a.aJ(j,u.u_intensity),u_matrix:new a.aK(j,u.u_matrix)}),heatmapTexture:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_world:new a.aP(j,u.u_world),u_image:new a.aI(j,u.u_image),u_color_ramp:new a.aI(j,u.u_color_ramp),u_opacity:new a.aJ(j,u.u_opacity)}),hillshade:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_image:new a.aI(j,u.u_image),u_latrange:new a.aP(j,u.u_latrange),u_light:new a.aP(j,u.u_light),u_shadow:new a.aM(j,u.u_shadow),u_highlight:new a.aM(j,u.u_highlight),u_accent:new a.aM(j,u.u_accent)}),hillshadePrepare:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_image:new a.aI(j,u.u_image),u_dimension:new a.aP(j,u.u_dimension),u_zoom:new a.aJ(j,u.u_zoom),u_unpack:new a.aL(j,u.u_unpack)}),line:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_ratio:new a.aJ(j,u.u_ratio),u_device_pixel_ratio:new a.aJ(j,u.u_device_pixel_ratio),u_units_to_pixels:new a.aP(j,u.u_units_to_pixels)}),lineGradient:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_ratio:new a.aJ(j,u.u_ratio),u_device_pixel_ratio:new a.aJ(j,u.u_device_pixel_ratio),u_units_to_pixels:new a.aP(j,u.u_units_to_pixels),u_image:new a.aI(j,u.u_image),u_image_height:new a.aJ(j,u.u_image_height)}),linePattern:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_texsize:new a.aP(j,u.u_texsize),u_ratio:new a.aJ(j,u.u_ratio),u_device_pixel_ratio:new a.aJ(j,u.u_device_pixel_ratio),u_image:new a.aI(j,u.u_image),u_units_to_pixels:new a.aP(j,u.u_units_to_pixels),u_scale:new a.aO(j,u.u_scale),u_fade:new a.aJ(j,u.u_fade)}),lineSDF:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_ratio:new a.aJ(j,u.u_ratio),u_device_pixel_ratio:new a.aJ(j,u.u_device_pixel_ratio),u_units_to_pixels:new a.aP(j,u.u_units_to_pixels),u_patternscale_a:new a.aP(j,u.u_patternscale_a),u_patternscale_b:new a.aP(j,u.u_patternscale_b),u_sdfgamma:new a.aJ(j,u.u_sdfgamma),u_image:new a.aI(j,u.u_image),u_tex_y_a:new a.aJ(j,u.u_tex_y_a),u_tex_y_b:new a.aJ(j,u.u_tex_y_b),u_mix:new a.aJ(j,u.u_mix)}),raster:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_tl_parent:new a.aP(j,u.u_tl_parent),u_scale_parent:new a.aJ(j,u.u_scale_parent),u_buffer_scale:new a.aJ(j,u.u_buffer_scale),u_fade_t:new a.aJ(j,u.u_fade_t),u_opacity:new a.aJ(j,u.u_opacity),u_image0:new a.aI(j,u.u_image0),u_image1:new a.aI(j,u.u_image1),u_brightness_low:new a.aJ(j,u.u_brightness_low),u_brightness_high:new a.aJ(j,u.u_brightness_high),u_saturation_factor:new a.aJ(j,u.u_saturation_factor),u_contrast_factor:new a.aJ(j,u.u_contrast_factor),u_spin_weights:new a.aO(j,u.u_spin_weights)}),symbolIcon:(j,u)=>({u_is_size_zoom_constant:new a.aI(j,u.u_is_size_zoom_constant),u_is_size_feature_constant:new a.aI(j,u.u_is_size_feature_constant),u_size_t:new a.aJ(j,u.u_size_t),u_size:new a.aJ(j,u.u_size),u_camera_to_center_distance:new a.aJ(j,u.u_camera_to_center_distance),u_pitch:new a.aJ(j,u.u_pitch),u_rotate_symbol:new a.aI(j,u.u_rotate_symbol),u_aspect_ratio:new a.aJ(j,u.u_aspect_ratio),u_fade_change:new a.aJ(j,u.u_fade_change),u_matrix:new a.aK(j,u.u_matrix),u_label_plane_matrix:new a.aK(j,u.u_label_plane_matrix),u_coord_matrix:new a.aK(j,u.u_coord_matrix),u_is_text:new a.aI(j,u.u_is_text),u_pitch_with_map:new a.aI(j,u.u_pitch_with_map),u_is_along_line:new a.aI(j,u.u_is_along_line),u_is_variable_anchor:new a.aI(j,u.u_is_variable_anchor),u_texsize:new a.aP(j,u.u_texsize),u_texture:new a.aI(j,u.u_texture),u_translation:new a.aP(j,u.u_translation),u_pitched_scale:new a.aJ(j,u.u_pitched_scale)}),symbolSDF:(j,u)=>({u_is_size_zoom_constant:new a.aI(j,u.u_is_size_zoom_constant),u_is_size_feature_constant:new a.aI(j,u.u_is_size_feature_constant),u_size_t:new a.aJ(j,u.u_size_t),u_size:new a.aJ(j,u.u_size),u_camera_to_center_distance:new a.aJ(j,u.u_camera_to_center_distance),u_pitch:new a.aJ(j,u.u_pitch),u_rotate_symbol:new a.aI(j,u.u_rotate_symbol),u_aspect_ratio:new a.aJ(j,u.u_aspect_ratio),u_fade_change:new a.aJ(j,u.u_fade_change),u_matrix:new a.aK(j,u.u_matrix),u_label_plane_matrix:new a.aK(j,u.u_label_plane_matrix),u_coord_matrix:new a.aK(j,u.u_coord_matrix),u_is_text:new a.aI(j,u.u_is_text),u_pitch_with_map:new a.aI(j,u.u_pitch_with_map),u_is_along_line:new a.aI(j,u.u_is_along_line),u_is_variable_anchor:new a.aI(j,u.u_is_variable_anchor),u_texsize:new a.aP(j,u.u_texsize),u_texture:new a.aI(j,u.u_texture),u_gamma_scale:new a.aJ(j,u.u_gamma_scale),u_device_pixel_ratio:new a.aJ(j,u.u_device_pixel_ratio),u_is_halo:new a.aI(j,u.u_is_halo),u_translation:new a.aP(j,u.u_translation),u_pitched_scale:new a.aJ(j,u.u_pitched_scale)}),symbolTextAndIcon:(j,u)=>({u_is_size_zoom_constant:new a.aI(j,u.u_is_size_zoom_constant),u_is_size_feature_constant:new a.aI(j,u.u_is_size_feature_constant),u_size_t:new a.aJ(j,u.u_size_t),u_size:new a.aJ(j,u.u_size),u_camera_to_center_distance:new a.aJ(j,u.u_camera_to_center_distance),u_pitch:new a.aJ(j,u.u_pitch),u_rotate_symbol:new a.aI(j,u.u_rotate_symbol),u_aspect_ratio:new a.aJ(j,u.u_aspect_ratio),u_fade_change:new a.aJ(j,u.u_fade_change),u_matrix:new a.aK(j,u.u_matrix),u_label_plane_matrix:new a.aK(j,u.u_label_plane_matrix),u_coord_matrix:new a.aK(j,u.u_coord_matrix),u_is_text:new a.aI(j,u.u_is_text),u_pitch_with_map:new a.aI(j,u.u_pitch_with_map),u_is_along_line:new a.aI(j,u.u_is_along_line),u_is_variable_anchor:new a.aI(j,u.u_is_variable_anchor),u_texsize:new a.aP(j,u.u_texsize),u_texsize_icon:new a.aP(j,u.u_texsize_icon),u_texture:new a.aI(j,u.u_texture),u_texture_icon:new a.aI(j,u.u_texture_icon),u_gamma_scale:new a.aJ(j,u.u_gamma_scale),u_device_pixel_ratio:new a.aJ(j,u.u_device_pixel_ratio),u_is_halo:new a.aI(j,u.u_is_halo),u_translation:new a.aP(j,u.u_translation),u_pitched_scale:new a.aJ(j,u.u_pitched_scale)}),background:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_opacity:new a.aJ(j,u.u_opacity),u_color:new a.aM(j,u.u_color)}),backgroundPattern:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_opacity:new a.aJ(j,u.u_opacity),u_image:new a.aI(j,u.u_image),u_pattern_tl_a:new a.aP(j,u.u_pattern_tl_a),u_pattern_br_a:new a.aP(j,u.u_pattern_br_a),u_pattern_tl_b:new a.aP(j,u.u_pattern_tl_b),u_pattern_br_b:new a.aP(j,u.u_pattern_br_b),u_texsize:new a.aP(j,u.u_texsize),u_mix:new a.aJ(j,u.u_mix),u_pattern_size_a:new a.aP(j,u.u_pattern_size_a),u_pattern_size_b:new a.aP(j,u.u_pattern_size_b),u_scale_a:new a.aJ(j,u.u_scale_a),u_scale_b:new a.aJ(j,u.u_scale_b),u_pixel_coord_upper:new a.aP(j,u.u_pixel_coord_upper),u_pixel_coord_lower:new a.aP(j,u.u_pixel_coord_lower),u_tile_units_to_pixels:new a.aJ(j,u.u_tile_units_to_pixels)}),terrain:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_texture:new a.aI(j,u.u_texture),u_ele_delta:new a.aJ(j,u.u_ele_delta),u_fog_matrix:new a.aK(j,u.u_fog_matrix),u_fog_color:new a.aM(j,u.u_fog_color),u_fog_ground_blend:new a.aJ(j,u.u_fog_ground_blend),u_fog_ground_blend_opacity:new a.aJ(j,u.u_fog_ground_blend_opacity),u_horizon_color:new a.aM(j,u.u_horizon_color),u_horizon_fog_blend:new a.aJ(j,u.u_horizon_fog_blend)}),terrainDepth:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_ele_delta:new a.aJ(j,u.u_ele_delta)}),terrainCoords:(j,u)=>({u_matrix:new a.aK(j,u.u_matrix),u_texture:new a.aI(j,u.u_texture),u_terrain_coords_id:new a.aJ(j,u.u_terrain_coords_id),u_ele_delta:new a.aJ(j,u.u_ele_delta)}),sky:(j,u)=>({u_sky_color:new a.aM(j,u.u_sky_color),u_horizon_color:new a.aM(j,u.u_horizon_color),u_horizon:new a.aJ(j,u.u_horizon),u_sky_horizon_blend:new a.aJ(j,u.u_sky_horizon_blend)})};class zn{constructor(u,m,F){this.context=u;const $=u.gl;this.buffer=$.createBuffer(),this.dynamicDraw=!!F,this.context.unbindVAO(),u.bindElementBuffer.set(this.buffer),$.bufferData($.ELEMENT_ARRAY_BUFFER,m.arrayBuffer,this.dynamicDraw?$.DYNAMIC_DRAW:$.STATIC_DRAW),this.dynamicDraw||delete m.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(u){const m=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),m.bufferSubData(m.ELEMENT_ARRAY_BUFFER,0,u.arrayBuffer)}destroy(){const u=this.context.gl;this.buffer&&(u.deleteBuffer(this.buffer),delete this.buffer)}}const Gn={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class ur{constructor(u,m,F,$){this.length=m.length,this.attributes=F,this.itemSize=m.bytesPerElement,this.dynamicDraw=$,this.context=u;const Z=u.gl;this.buffer=Z.createBuffer(),u.bindVertexBuffer.set(this.buffer),Z.bufferData(Z.ARRAY_BUFFER,m.arrayBuffer,this.dynamicDraw?Z.DYNAMIC_DRAW:Z.STATIC_DRAW),this.dynamicDraw||delete m.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(u){if(u.length!==this.length)throw new Error(`Length of new data is ${u.length}, which doesn't match current length of ${this.length}`);const m=this.context.gl;this.bind(),m.bufferSubData(m.ARRAY_BUFFER,0,u.arrayBuffer)}enableAttributes(u,m){for(let F=0;F<this.attributes.length;F++){const $=this.attributes[F],Z=m.attributes[$.name];Z!==void 0&&u.enableVertexAttribArray(Z)}}setVertexAttribPointers(u,m,F){for(let $=0;$<this.attributes.length;$++){const Z=this.attributes[$],ie=m.attributes[Z.name];ie!==void 0&&u.vertexAttribPointer(ie,Z.components,u[Gn[Z.type]],!1,this.itemSize,Z.offset+this.itemSize*(F||0))}}destroy(){const u=this.context.gl;this.buffer&&(u.deleteBuffer(this.buffer),delete this.buffer)}}const kr=new WeakMap;function vi(j){var u;if(kr.has(j))return kr.get(j);{const m=(u=j.getParameter(j.VERSION))===null||u===void 0?void 0:u.startsWith("WebGL 2.0");return kr.set(j,m),m}}class xr{constructor(u){this.gl=u.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(u){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class co extends xr{getDefault(){return a.aN.transparent}set(u){const m=this.current;(u.r!==m.r||u.g!==m.g||u.b!==m.b||u.a!==m.a||this.dirty)&&(this.gl.clearColor(u.r,u.g,u.b,u.a),this.current=u,this.dirty=!1)}}class Ti extends xr{getDefault(){return 1}set(u){(u!==this.current||this.dirty)&&(this.gl.clearDepth(u),this.current=u,this.dirty=!1)}}class qi extends xr{getDefault(){return 0}set(u){(u!==this.current||this.dirty)&&(this.gl.clearStencil(u),this.current=u,this.dirty=!1)}}class jo extends xr{getDefault(){return[!0,!0,!0,!0]}set(u){const m=this.current;(u[0]!==m[0]||u[1]!==m[1]||u[2]!==m[2]||u[3]!==m[3]||this.dirty)&&(this.gl.colorMask(u[0],u[1],u[2],u[3]),this.current=u,this.dirty=!1)}}class oi extends xr{getDefault(){return!0}set(u){(u!==this.current||this.dirty)&&(this.gl.depthMask(u),this.current=u,this.dirty=!1)}}class ui extends xr{getDefault(){return 255}set(u){(u!==this.current||this.dirty)&&(this.gl.stencilMask(u),this.current=u,this.dirty=!1)}}class es extends xr{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(u){const m=this.current;(u.func!==m.func||u.ref!==m.ref||u.mask!==m.mask||this.dirty)&&(this.gl.stencilFunc(u.func,u.ref,u.mask),this.current=u,this.dirty=!1)}}class yo extends xr{getDefault(){const u=this.gl;return[u.KEEP,u.KEEP,u.KEEP]}set(u){const m=this.current;(u[0]!==m[0]||u[1]!==m[1]||u[2]!==m[2]||this.dirty)&&(this.gl.stencilOp(u[0],u[1],u[2]),this.current=u,this.dirty=!1)}}class Uo extends xr{getDefault(){return!1}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;u?m.enable(m.STENCIL_TEST):m.disable(m.STENCIL_TEST),this.current=u,this.dirty=!1}}class cs extends xr{getDefault(){return[0,1]}set(u){const m=this.current;(u[0]!==m[0]||u[1]!==m[1]||this.dirty)&&(this.gl.depthRange(u[0],u[1]),this.current=u,this.dirty=!1)}}class Po extends xr{getDefault(){return!1}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;u?m.enable(m.DEPTH_TEST):m.disable(m.DEPTH_TEST),this.current=u,this.dirty=!1}}class Cl extends xr{getDefault(){return this.gl.LESS}set(u){(u!==this.current||this.dirty)&&(this.gl.depthFunc(u),this.current=u,this.dirty=!1)}}class Tl extends xr{getDefault(){return!1}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;u?m.enable(m.BLEND):m.disable(m.BLEND),this.current=u,this.dirty=!1}}class Al extends xr{getDefault(){const u=this.gl;return[u.ONE,u.ZERO]}set(u){const m=this.current;(u[0]!==m[0]||u[1]!==m[1]||this.dirty)&&(this.gl.blendFunc(u[0],u[1]),this.current=u,this.dirty=!1)}}class $o extends xr{getDefault(){return a.aN.transparent}set(u){const m=this.current;(u.r!==m.r||u.g!==m.g||u.b!==m.b||u.a!==m.a||this.dirty)&&(this.gl.blendColor(u.r,u.g,u.b,u.a),this.current=u,this.dirty=!1)}}class Xs extends xr{getDefault(){return this.gl.FUNC_ADD}set(u){(u!==this.current||this.dirty)&&(this.gl.blendEquation(u),this.current=u,this.dirty=!1)}}class vs extends xr{getDefault(){return!1}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;u?m.enable(m.CULL_FACE):m.disable(m.CULL_FACE),this.current=u,this.dirty=!1}}class Ai extends xr{getDefault(){return this.gl.BACK}set(u){(u!==this.current||this.dirty)&&(this.gl.cullFace(u),this.current=u,this.dirty=!1)}}class Qi extends xr{getDefault(){return this.gl.CCW}set(u){(u!==this.current||this.dirty)&&(this.gl.frontFace(u),this.current=u,this.dirty=!1)}}class El extends xr{getDefault(){return null}set(u){(u!==this.current||this.dirty)&&(this.gl.useProgram(u),this.current=u,this.dirty=!1)}}class Js extends xr{getDefault(){return this.gl.TEXTURE0}set(u){(u!==this.current||this.dirty)&&(this.gl.activeTexture(u),this.current=u,this.dirty=!1)}}class Ns extends xr{getDefault(){const u=this.gl;return[0,0,u.drawingBufferWidth,u.drawingBufferHeight]}set(u){const m=this.current;(u[0]!==m[0]||u[1]!==m[1]||u[2]!==m[2]||u[3]!==m[3]||this.dirty)&&(this.gl.viewport(u[0],u[1],u[2],u[3]),this.current=u,this.dirty=!1)}}class Ml extends xr{getDefault(){return null}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;m.bindFramebuffer(m.FRAMEBUFFER,u),this.current=u,this.dirty=!1}}class Fs extends xr{getDefault(){return null}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;m.bindRenderbuffer(m.RENDERBUFFER,u),this.current=u,this.dirty=!1}}class Il extends xr{getDefault(){return null}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;m.bindTexture(m.TEXTURE_2D,u),this.current=u,this.dirty=!1}}class Bl extends xr{getDefault(){return null}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;m.bindBuffer(m.ARRAY_BUFFER,u),this.current=u,this.dirty=!1}}class Ks extends xr{getDefault(){return null}set(u){const m=this.gl;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,u),this.current=u,this.dirty=!1}}class To extends xr{getDefault(){return null}set(u){var m;if(u===this.current&&!this.dirty)return;const F=this.gl;vi(F)?F.bindVertexArray(u):(m=F.getExtension("OES_vertex_array_object"))===null||m===void 0||m.bindVertexArrayOES(u),this.current=u,this.dirty=!1}}class Jc extends xr{getDefault(){return 4}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;m.pixelStorei(m.UNPACK_ALIGNMENT,u),this.current=u,this.dirty=!1}}class Dc extends xr{getDefault(){return!1}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),this.current=u,this.dirty=!1}}class Hl extends xr{getDefault(){return!1}set(u){if(u===this.current&&!this.dirty)return;const m=this.gl;m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,u),this.current=u,this.dirty=!1}}class Kc extends xr{constructor(u,m){super(u),this.context=u,this.parent=m}getDefault(){return null}}class su extends Kc{setDirty(){this.dirty=!0}set(u){if(u===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const m=this.gl;m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.TEXTURE_2D,u,0),this.current=u,this.dirty=!1}}class _s extends Kc{set(u){if(u===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const m=this.gl;m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,u),this.current=u,this.dirty=!1}}class lu extends Kc{set(u){if(u===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const m=this.gl;m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,u),this.current=u,this.dirty=!1}}class Du{constructor(u,m,F,$,Z){this.context=u,this.width=m,this.height=F;const ie=u.gl,he=this.framebuffer=ie.createFramebuffer();if(this.colorAttachment=new su(u,he),$)this.depthAttachment=Z?new lu(u,he):new _s(u,he);else if(Z)throw new Error("Stencil cannot be set without depth");if(ie.checkFramebufferStatus(ie.FRAMEBUFFER)!==ie.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const u=this.context.gl,m=this.colorAttachment.get();if(m&&u.deleteTexture(m),this.depthAttachment){const F=this.depthAttachment.get();F&&u.deleteRenderbuffer(F)}u.deleteFramebuffer(this.framebuffer)}}class to{constructor(u,m,F){this.blendFunction=u,this.blendColor=m,this.mask=F}}to.Replace=[1,0],to.disabled=new to(to.Replace,a.aN.transparent,[!1,!1,!1,!1]),to.unblended=new to(to.Replace,a.aN.transparent,[!0,!0,!0,!0]),to.alphaBlended=new to([1,771],a.aN.transparent,[!0,!0,!0,!0]);class xc{constructor(u){var m,F;if(this.gl=u,this.clearColor=new co(this),this.clearDepth=new Ti(this),this.clearStencil=new qi(this),this.colorMask=new jo(this),this.depthMask=new oi(this),this.stencilMask=new ui(this),this.stencilFunc=new es(this),this.stencilOp=new yo(this),this.stencilTest=new Uo(this),this.depthRange=new cs(this),this.depthTest=new Po(this),this.depthFunc=new Cl(this),this.blend=new Tl(this),this.blendFunc=new Al(this),this.blendColor=new $o(this),this.blendEquation=new Xs(this),this.cullFace=new vs(this),this.cullFaceSide=new Ai(this),this.frontFace=new Qi(this),this.program=new El(this),this.activeTexture=new Js(this),this.viewport=new Ns(this),this.bindFramebuffer=new Ml(this),this.bindRenderbuffer=new Fs(this),this.bindTexture=new Il(this),this.bindVertexBuffer=new Bl(this),this.bindElementBuffer=new Ks(this),this.bindVertexArray=new To(this),this.pixelStoreUnpack=new Jc(this),this.pixelStoreUnpackPremultiplyAlpha=new Dc(this),this.pixelStoreUnpackFlipY=new Hl(this),this.extTextureFilterAnisotropic=u.getExtension("EXT_texture_filter_anisotropic")||u.getExtension("MOZ_EXT_texture_filter_anisotropic")||u.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=u.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),vi(u)){this.HALF_FLOAT=u.HALF_FLOAT;const $=u.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(m=u.RGBA16F)!==null&&m!==void 0?m:$==null?void 0:$.RGBA16F_EXT,this.RGB16F=(F=u.RGB16F)!==null&&F!==void 0?F:$==null?void 0:$.RGB16F_EXT,u.getExtension("EXT_color_buffer_float")}else{u.getExtension("EXT_color_buffer_half_float"),u.getExtension("OES_texture_half_float_linear");const $=u.getExtension("OES_texture_half_float");this.HALF_FLOAT=$==null?void 0:$.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(u,m){return new zn(this,u,m)}createVertexBuffer(u,m,F){return new ur(this,u,m,F)}createRenderbuffer(u,m,F){const $=this.gl,Z=$.createRenderbuffer();return this.bindRenderbuffer.set(Z),$.renderbufferStorage($.RENDERBUFFER,u,m,F),this.bindRenderbuffer.set(null),Z}createFramebuffer(u,m,F,$){return new Du(this,u,m,F,$)}clear({color:u,depth:m,stencil:F}){const $=this.gl;let Z=0;u&&(Z|=$.COLOR_BUFFER_BIT,this.clearColor.set(u),this.colorMask.set([!0,!0,!0,!0])),m!==void 0&&(Z|=$.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(m),this.depthMask.set(!0)),F!==void 0&&(Z|=$.STENCIL_BUFFER_BIT,this.clearStencil.set(F),this.stencilMask.set(255)),$.clear(Z)}setCullFace(u){u.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(u.mode),this.frontFace.set(u.frontFace))}setDepthMode(u){u.func!==this.gl.ALWAYS||u.mask?(this.depthTest.set(!0),this.depthFunc.set(u.func),this.depthMask.set(u.mask),this.depthRange.set(u.range)):this.depthTest.set(!1)}setStencilMode(u){u.test.func!==this.gl.ALWAYS||u.mask?(this.stencilTest.set(!0),this.stencilMask.set(u.mask),this.stencilOp.set([u.fail,u.depthFail,u.pass]),this.stencilFunc.set({func:u.test.func,ref:u.ref,mask:u.test.mask})):this.stencilTest.set(!1)}setColorMode(u){a.aF(u.blendFunction,to.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(u.blendFunction),this.blendColor.set(u.blendColor)),this.colorMask.set(u.mask)}createVertexArray(){var u;return vi(this.gl)?this.gl.createVertexArray():(u=this.gl.getExtension("OES_vertex_array_object"))===null||u===void 0?void 0:u.createVertexArrayOES()}deleteVertexArray(u){var m;return vi(this.gl)?this.gl.deleteVertexArray(u):(m=this.gl.getExtension("OES_vertex_array_object"))===null||m===void 0?void 0:m.deleteVertexArrayOES(u)}unbindVAO(){this.bindVertexArray.set(null)}}class Gr{constructor(u,m,F){this.func=u,this.mask=m,this.range=F}}Gr.ReadOnly=!1,Gr.ReadWrite=!0,Gr.disabled=new Gr(519,Gr.ReadOnly,[0,1]);const Gl=7680;class ki{constructor(u,m,F,$,Z,ie){this.test=u,this.ref=m,this.mask=F,this.fail=$,this.depthFail=Z,this.pass=ie}}ki.disabled=new ki({func:519,mask:0},0,0,Gl,Gl,Gl);class Si{constructor(u,m,F){this.enable=u,this.mode=m,this.frontFace=F}}let bs;function ts(j,u,m,F,$){const Z=j.context,ie=Z.gl,he=j.useProgram("collisionBox"),be=[];let Ce=0,ze=0;for(let Et=0;Et<F.length;Et++){const Ct=F[Et],Rt=u.getTile(Ct).getBucket(m);if(!Rt)continue;const At=$?Rt.textCollisionBox:Rt.iconCollisionBox,Zt=Rt.collisionCircleArray;if(Zt.length>0){const Kt=a.H();a.aR(Kt,Rt.placementInvProjMatrix,j.transform.glCoordMatrix),a.aR(Kt,Kt,Rt.placementViewportMatrix),be.push({circleArray:Zt,circleOffset:ze,transform:Ct.posMatrix,invTransform:Kt,coord:Ct}),Ce+=Zt.length/4,ze=Ce}At&&he.draw(Z,ie.LINES,Gr.disabled,ki.disabled,j.colorModeForRenderPass(),Si.disabled,ta(j.transform,Ct.posMatrix),j.style.map.terrain&&j.style.map.terrain.getTerrainData(Ct),m.id,At.layoutVertexBuffer,At.indexBuffer,At.segments,null,j.transform.zoom,null,null,At.collisionVertexBuffer)}if(!$||!be.length)return;const $e=j.useProgram("collisionCircle"),nt=new a.aS;nt.resize(4*Ce),nt._trim();let ct=0;for(const Et of be)for(let Ct=0;Ct<Et.circleArray.length/4;Ct++){const Rt=4*Ct,At=Et.circleArray[Rt+0],Zt=Et.circleArray[Rt+1],Kt=Et.circleArray[Rt+2],Yt=Et.circleArray[Rt+3];nt.emplace(ct++,At,Zt,Kt,Yt,0),nt.emplace(ct++,At,Zt,Kt,Yt,1),nt.emplace(ct++,At,Zt,Kt,Yt,2),nt.emplace(ct++,At,Zt,Kt,Yt,3)}(!bs||bs.length<2*Ce)&&(bs=function(Et){const Ct=2*Et,Rt=new a.aU;Rt.resize(Ct),Rt._trim();for(let At=0;At<Ct;At++){const Zt=6*At;Rt.uint16[Zt+0]=4*At+0,Rt.uint16[Zt+1]=4*At+1,Rt.uint16[Zt+2]=4*At+2,Rt.uint16[Zt+3]=4*At+2,Rt.uint16[Zt+4]=4*At+3,Rt.uint16[Zt+5]=4*At+0}return Rt}(Ce));const pt=Z.createIndexBuffer(bs,!0),xt=Z.createVertexBuffer(nt,a.aT.members,!0);for(const Et of be){const Ct=ca(Et.transform,Et.invTransform,j.transform);$e.draw(Z,ie.TRIANGLES,Gr.disabled,ki.disabled,j.colorModeForRenderPass(),Si.disabled,Ct,j.style.map.terrain&&j.style.map.terrain.getTerrainData(Et.coord),m.id,xt,pt,a.a0.simpleSegment(0,2*Et.circleOffset,Et.circleArray.length,Et.circleArray.length/2),null,j.transform.zoom,null,null,null)}xt.destroy(),pt.destroy()}Si.disabled=new Si(!1,1029,2305),Si.backCCW=new Si(!0,1029,2305);const wc=a.ao(new Float32Array(16));function Pl(j,u,m,F,$){if(j.renderPass!=="translucent")return;const Z=ki.disabled,ie=j.colorModeForRenderPass();(m._unevaluatedLayout.hasValue("text-variable-anchor")||m._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(he,be,Ce,ze,$e,nt,ct,pt,xt){const Et=be.transform,Ct=Ba(),Rt=$e==="map",At=nt==="map";for(const Zt of he){const Kt=ze.getTile(Zt),Yt=Kt.getBucket(Ce);if(!Yt||!Yt.text||!Yt.text.segments.get().length)continue;const da=Yt.textSizeData,ba=a.ah(da,Et.zoom),Na=St(Kt,1,be.transform.zoom),Fa=Vt(Zt.posMatrix,At,Rt,be.transform,Na),Ua=Ce.layout.get("icon-text-fit")!=="none"&&Yt.hasIconData();if(ba){const Ja=Math.pow(2,Et.zoom-Kt.tileID.overscaledZ),yn=be.style.map.terrain?(wn,rn)=>be.style.map.terrain.getElevation(Zt,wn,rn):null,Qa=Ct.translatePosition(Et,Kt,ct,pt);vo(Yt,Rt,At,xt,Et,Fa,Zt.posMatrix,Ja,ba,Ua,Ct,Qa,Zt.toUnwrapped(),yn)}}}(F,j,m,u,m.layout.get("text-rotation-alignment"),m.layout.get("text-pitch-alignment"),m.paint.get("text-translate"),m.paint.get("text-translate-anchor"),$),m.paint.get("icon-opacity").constantOr(1)!==0&&ic(j,u,m,F,!1,m.paint.get("icon-translate"),m.paint.get("icon-translate-anchor"),m.layout.get("icon-rotation-alignment"),m.layout.get("icon-pitch-alignment"),m.layout.get("icon-keep-upright"),Z,ie),m.paint.get("text-opacity").constantOr(1)!==0&&ic(j,u,m,F,!0,m.paint.get("text-translate"),m.paint.get("text-translate-anchor"),m.layout.get("text-rotation-alignment"),m.layout.get("text-pitch-alignment"),m.layout.get("text-keep-upright"),Z,ie),u.map.showCollisionBoxes&&(ts(j,u,m,F,!0),ts(j,u,m,F,!1))}function as(j,u,m,F,$,Z){const{horizontalAlign:ie,verticalAlign:he}=a.av(j),be=-(ie-.5)*u,Ce=-(he-.5)*m;return new a.P((be/$+F[0])*Z,(Ce/$+F[1])*Z)}function us(j,u,m,F,$,Z){const ie=u.tileAnchorPoint.add(new a.P(u.translation[0],u.translation[1]));if(u.pitchWithMap){let he=F.mult(Z);return m||(he=he.rotate(-$)),Ut(ie.add(he),u.labelPlaneMatrix,u.getElevation).point}if(m){const he=Ze(u.tileAnchorPoint.x+1,u.tileAnchorPoint.y,u).point.sub(j),be=Math.atan(he.y/he.x)+(he.x<0?Math.PI:0);return j.add(F.rotate(be))}return j.add(F)}function vo(j,u,m,F,$,Z,ie,he,be,Ce,ze,$e,nt,ct){const pt=j.text.placedSymbolArray,xt=j.text.dynamicLayoutVertexArray,Et=j.icon.dynamicLayoutVertexArray,Ct={};xt.clear();for(let Rt=0;Rt<pt.length;Rt++){const At=pt.get(Rt),Zt=j.allowVerticalPlacement&&!At.placedOrientation,Kt=At.hidden||!At.crossTileID||Zt?null:F[At.crossTileID];if(Kt){const Yt=new a.P(At.anchorX,At.anchorY),da={getElevation:ct,width:$.width,height:$.height,labelPlaneMatrix:Z,lineVertexArray:null,pitchWithMap:m,projection:ze,projectionCache:null,tileAnchorPoint:Yt,translation:$e,unwrappedTileID:nt},ba=m?Ut(Yt,ie,ct):Ze(Yt.x,Yt.y,da),Na=ot($.cameraToCenterDistance,ba.signedDistanceFromCamera);let Fa=a.aj(j.textSizeData,be,At)*Na/a.aq;m&&(Fa*=j.tilePixelRatio/he);const{width:Ua,height:Ja,anchor:yn,textOffset:Qa,textBoxScale:wn}=Kt,rn=as(yn,Ua,Ja,Qa,wn,Fa),Cn=ze.getPitchedTextCorrection($,Yt.add(new a.P($e[0],$e[1])),nt),fn=us(ba.point,da,u,rn,$.angle,Cn),In=j.allowVerticalPlacement&&At.placedOrientation===a.ai.vertical?Math.PI/2:0;for(let Wn=0;Wn<At.numGlyphs;Wn++)a.ak(xt,fn,In);Ce&&At.associatedIconIndex>=0&&(Ct[At.associatedIconIndex]={shiftedAnchor:fn,angle:In})}else Dt(At.numGlyphs,xt)}if(Ce){Et.clear();const Rt=j.icon.placedSymbolArray;for(let At=0;At<Rt.length;At++){const Zt=Rt.get(At);if(Zt.hidden)Dt(Zt.numGlyphs,Et);else{const Kt=Ct[At];if(Kt)for(let Yt=0;Yt<Zt.numGlyphs;Yt++)a.ak(Et,Kt.shiftedAnchor,Kt.angle);else Dt(Zt.numGlyphs,Et)}}j.icon.dynamicLayoutVertexBuffer.updateData(Et)}j.text.dynamicLayoutVertexBuffer.updateData(xt)}function ni(j,u,m){return m.iconsInText&&u?"symbolTextAndIcon":j?"symbolSDF":"symbolIcon"}function ic(j,u,m,F,$,Z,ie,he,be,Ce,ze,$e){const nt=j.context,ct=nt.gl,pt=j.transform,xt=Ba(),Et=he==="map",Ct=be==="map",Rt=he!=="viewport"&&m.layout.get("symbol-placement")!=="point",At=Et&&!Ct&&!Rt,Zt=!Ct&&Rt,Kt=!m.layout.get("symbol-sort-key").isConstant();let Yt=!1;const da=j.depthModeForSublayer(0,Gr.ReadOnly),ba=m._unevaluatedLayout.hasValue("text-variable-anchor")||m._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Na=[],Fa=xt.getCircleRadiusCorrection(pt);for(const Ua of F){const Ja=u.getTile(Ua),yn=Ja.getBucket(m);if(!yn)continue;const Qa=$?yn.text:yn.icon;if(!Qa||!Qa.segments.get().length||!Qa.hasVisibleVertices)continue;const wn=Qa.programConfigurations.get(m.id),rn=$||yn.sdfIcons,Cn=$?yn.textSizeData:yn.iconSizeData,fn=Ct||pt.pitch!==0,In=j.useProgram(ni(rn,$,yn),wn),Wn=a.ah(Cn,pt.zoom),Mn=j.style.map.terrain&&j.style.map.terrain.getTerrainData(Ua);let Hn,ar,Cr,yr,jr=[0,0],Rr=null;if($){if(ar=Ja.glyphAtlasTexture,Cr=ct.LINEAR,Hn=Ja.glyphAtlasTexture.size,yn.iconsInText){jr=Ja.imageAtlasTexture.size,Rr=Ja.imageAtlasTexture;const Tr=Cn.kind==="composite"||Cn.kind==="camera";yr=fn||j.options.rotating||j.options.zooming||Tr?ct.LINEAR:ct.NEAREST}}else{const Tr=m.layout.get("icon-size").constantOr(0)!==1||yn.iconsNeedLinear;ar=Ja.imageAtlasTexture,Cr=rn||j.options.rotating||j.options.zooming||Tr||fn?ct.LINEAR:ct.NEAREST,Hn=Ja.imageAtlasTexture.size}const qr=St(Ja,1,j.transform.zoom),ci=Zt?Ua.posMatrix:wc,$i=Vt(ci,Ct,Et,j.transform,qr),Ni=$t(ci,Ct,Et,j.transform,qr),io=$t(Ua.posMatrix,Ct,Et,j.transform,qr),hi=xt.translatePosition(j.transform,Ja,Z,ie),ei=ba&&yn.hasTextData(),Ii=m.layout.get("icon-text-fit")!=="none"&&ei&&yn.hasIconData();if(Rt){const Tr=j.style.map.terrain?(Ki,ps)=>j.style.map.terrain.getElevation(Ua,Ki,ps):null,wo=m.layout.get("text-rotation-alignment")==="map";ht(yn,Ua.posMatrix,j,$,$i,io,Ct,Ce,wo,xt,Ua.toUnwrapped(),pt.width,pt.height,hi,Tr)}const gi=Ua.posMatrix,ii=$&&ba||Ii,pi=Rt||ii?wc:$i,wi=Ni,ti=rn&&m.paint.get($?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Bs;Bs=rn?yn.iconsInText?Tn(Cn.kind,Wn,At,Ct,Rt,ii,j,gi,pi,wi,hi,Hn,jr,Fa):xn(Cn.kind,Wn,At,Ct,Rt,ii,j,gi,pi,wi,hi,$,Hn,!0,Fa):Pn(Cn.kind,Wn,At,Ct,Rt,ii,j,gi,pi,wi,hi,$,Hn,Fa);const Wi={program:In,buffers:Qa,uniformValues:Bs,atlasTexture:ar,atlasTextureIcon:Rr,atlasInterpolation:Cr,atlasInterpolationIcon:yr,isSDF:rn,hasHalo:ti};if(Kt&&yn.canOverlap){Yt=!0;const Tr=Qa.segments.get();for(const wo of Tr)Na.push({segments:new a.a0([wo]),sortKey:wo.sortKey,state:Wi,terrainData:Mn})}else Na.push({segments:Qa.segments,sortKey:0,state:Wi,terrainData:Mn})}Yt&&Na.sort((Ua,Ja)=>Ua.sortKey-Ja.sortKey);for(const Ua of Na){const Ja=Ua.state;if(nt.activeTexture.set(ct.TEXTURE0),Ja.atlasTexture.bind(Ja.atlasInterpolation,ct.CLAMP_TO_EDGE),Ja.atlasTextureIcon&&(nt.activeTexture.set(ct.TEXTURE1),Ja.atlasTextureIcon&&Ja.atlasTextureIcon.bind(Ja.atlasInterpolationIcon,ct.CLAMP_TO_EDGE)),Ja.isSDF){const yn=Ja.uniformValues;Ja.hasHalo&&(yn.u_is_halo=1,cu(Ja.buffers,Ua.segments,m,j,Ja.program,da,ze,$e,yn,Ua.terrainData)),yn.u_is_halo=0}cu(Ja.buffers,Ua.segments,m,j,Ja.program,da,ze,$e,Ja.uniformValues,Ua.terrainData)}}function cu(j,u,m,F,$,Z,ie,he,be,Ce){const ze=F.context,$e=ze.gl;$.draw(ze,$e.TRIANGLES,Z,ie,he,Si.disabled,be,Ce,m.id,j.layoutVertexBuffer,j.indexBuffer,u,m.paint,F.transform.zoom,j.programConfigurations.get(m.id),j.dynamicLayoutVertexBuffer,j.opacityVertexBuffer)}function Ol(j,u,m,F){if(m.paint.get("heatmap-opacity")!==0)if(j.renderPass==="offscreen"){const $=j.context,Z=$.gl,ie=ki.disabled,he=new to([Z.ONE,Z.ONE],a.aN.transparent,[!0,!0,!0,!0]);(function(be,Ce,ze){const $e=be.gl;be.activeTexture.set($e.TEXTURE1),be.viewport.set([0,0,Ce.width/4,Ce.height/4]);let nt=ze.heatmapFbo;if(nt)$e.bindTexture($e.TEXTURE_2D,nt.colorAttachment.get()),be.bindFramebuffer.set(nt.framebuffer);else{const ct=$e.createTexture();$e.bindTexture($e.TEXTURE_2D,ct),$e.texParameteri($e.TEXTURE_2D,$e.TEXTURE_WRAP_S,$e.CLAMP_TO_EDGE),$e.texParameteri($e.TEXTURE_2D,$e.TEXTURE_WRAP_T,$e.CLAMP_TO_EDGE),$e.texParameteri($e.TEXTURE_2D,$e.TEXTURE_MIN_FILTER,$e.LINEAR),$e.texParameteri($e.TEXTURE_2D,$e.TEXTURE_MAG_FILTER,$e.LINEAR),nt=ze.heatmapFbo=be.createFramebuffer(Ce.width/4,Ce.height/4,!1,!1),function(pt,xt,Et,Ct){var Rt,At;const Zt=pt.gl,Kt=(Rt=pt.HALF_FLOAT)!==null&&Rt!==void 0?Rt:Zt.UNSIGNED_BYTE,Yt=(At=pt.RGBA16F)!==null&&At!==void 0?At:Zt.RGBA;Zt.texImage2D(Zt.TEXTURE_2D,0,Yt,xt.width/4,xt.height/4,0,Zt.RGBA,Kt,null),Ct.colorAttachment.set(Et)}(be,Ce,ct,nt)}})($,j,m),$.clear({color:a.aN.transparent});for(let be=0;be<F.length;be++){const Ce=F[be];if(u.hasRenderableParent(Ce))continue;const ze=u.getTile(Ce),$e=ze.getBucket(m);if(!$e)continue;const nt=$e.programConfigurations.get(m.id),ct=j.useProgram("heatmap",nt),{zoom:pt}=j.transform;ct.draw($,Z.TRIANGLES,Gr.disabled,ie,he,Si.disabled,La(Ce.posMatrix,ze,pt,m.paint.get("heatmap-intensity")),null,m.id,$e.layoutVertexBuffer,$e.indexBuffer,$e.segments,m.paint,j.transform.zoom,nt)}$.viewport.set([0,0,j.width,j.height])}else j.renderPass==="translucent"&&(j.context.setColorMode(j.colorModeForRenderPass()),function($,Z){const ie=$.context,he=ie.gl,be=Z.heatmapFbo;if(!be)return;ie.activeTexture.set(he.TEXTURE0),he.bindTexture(he.TEXTURE_2D,be.colorAttachment.get()),ie.activeTexture.set(he.TEXTURE1);let Ce=Z.colorRampTexture;Ce||(Ce=Z.colorRampTexture=new L(ie,Z.colorRamp,he.RGBA)),Ce.bind(he.LINEAR,he.CLAMP_TO_EDGE),$.useProgram("heatmapTexture").draw(ie,he.TRIANGLES,Gr.disabled,ki.disabled,$.colorModeForRenderPass(),Si.disabled,Wa($,Z,0,1),null,Z.id,$.viewportBuffer,$.quadTriangleIndexBuffer,$.viewportSegments,Z.paint,$.transform.zoom)}(j,m))}function Ll(j,u,m,F,$){if(!m||!F||!F.imageAtlas)return;const Z=F.imageAtlas.patternPositions;let ie=Z[m.to.toString()],he=Z[m.from.toString()];if(!ie&&he&&(ie=he),!he&&ie&&(he=ie),!ie||!he){const be=$.getPaintProperty(u);ie=Z[be],he=Z[be]}ie&&he&&j.setConstantPatternPositions(ie,he)}function Rc(j,u,m,F,$,Z,ie){const he=j.context.gl,be="fill-pattern",Ce=m.paint.get(be),ze=Ce&&Ce.constantOr(1),$e=m.getCrossfadeParameters();let nt,ct,pt,xt,Et;ie?(ct=ze&&!m.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",nt=he.LINES):(ct=ze?"fillPattern":"fill",nt=he.TRIANGLES);const Ct=Ce.constantOr(null);for(const Rt of F){const At=u.getTile(Rt);if(ze&&!At.patternsLoaded())continue;const Zt=At.getBucket(m);if(!Zt)continue;const Kt=Zt.programConfigurations.get(m.id),Yt=j.useProgram(ct,Kt),da=j.style.map.terrain&&j.style.map.terrain.getTerrainData(Rt);ze&&(j.context.activeTexture.set(he.TEXTURE0),At.imageAtlasTexture.bind(he.LINEAR,he.CLAMP_TO_EDGE),Kt.updatePaintBuffers($e)),Ll(Kt,be,Ct,At,m);const ba=da?Rt:null,Na=ba?ba.posMatrix:Rt.posMatrix,Fa=j.translatePosMatrix(Na,At,m.paint.get("fill-translate"),m.paint.get("fill-translate-anchor"));if(ie){xt=Zt.indexBuffer2,Et=Zt.segments2;const Ua=[he.drawingBufferWidth,he.drawingBufferHeight];pt=ct==="fillOutlinePattern"&&ze?ma(Fa,j,$e,At,Ua):Un(Fa,Ua)}else xt=Zt.indexBuffer,Et=Zt.segments,pt=ze?Ln(Fa,j,$e,At):gn(Fa);Yt.draw(j.context,nt,$,j.stencilModeForClipping(Rt),Z,Si.disabled,pt,da,m.id,Zt.layoutVertexBuffer,xt,Et,m.paint,j.transform.zoom,Kt)}}function kc(j,u,m,F,$,Z,ie){const he=j.context,be=he.gl,Ce="fill-extrusion-pattern",ze=m.paint.get(Ce),$e=ze.constantOr(1),nt=m.getCrossfadeParameters(),ct=m.paint.get("fill-extrusion-opacity"),pt=ze.constantOr(null);for(const xt of F){const Et=u.getTile(xt),Ct=Et.getBucket(m);if(!Ct)continue;const Rt=j.style.map.terrain&&j.style.map.terrain.getTerrainData(xt),At=Ct.programConfigurations.get(m.id),Zt=j.useProgram($e?"fillExtrusionPattern":"fillExtrusion",At);$e&&(j.context.activeTexture.set(be.TEXTURE0),Et.imageAtlasTexture.bind(be.LINEAR,be.CLAMP_TO_EDGE),At.updatePaintBuffers(nt)),Ll(At,Ce,pt,Et,m);const Kt=j.translatePosMatrix(xt.posMatrix,Et,m.paint.get("fill-extrusion-translate"),m.paint.get("fill-extrusion-translate-anchor")),Yt=m.paint.get("fill-extrusion-vertical-gradient"),da=$e?_n(Kt,j,Yt,ct,xt,nt,Et):an(Kt,j,Yt,ct);Zt.draw(he,he.gl.TRIANGLES,$,Z,ie,Si.backCCW,da,Rt,m.id,Ct.layoutVertexBuffer,Ct.indexBuffer,Ct.segments,m.paint,j.transform.zoom,At,j.style.map.terrain&&Ct.centroidVertexBuffer)}}function Sc(j,u,m,F,$,Z,ie){const he=j.context,be=he.gl,Ce=m.fbo;if(!Ce)return;const ze=j.useProgram("hillshade"),$e=j.style.map.terrain&&j.style.map.terrain.getTerrainData(u);he.activeTexture.set(be.TEXTURE0),be.bindTexture(be.TEXTURE_2D,Ce.colorAttachment.get());const nt=$e?u:null;ze.draw(he,be.TRIANGLES,$,Z,ie,Si.disabled,Ra(j,m,F,nt),$e,F.id,j.rasterBoundsBuffer,j.quadTriangleIndexBuffer,j.rasterBoundsSegments)}function bu(j,u,m,F,$,Z){const ie=j.context,he=ie.gl,be=u.dem;if(be&&be.data){const Ce=be.dim,ze=be.stride,$e=be.getPixels();if(ie.activeTexture.set(he.TEXTURE1),ie.pixelStoreUnpackPremultiplyAlpha.set(!1),u.demTexture=u.demTexture||j.getTileTexture(ze),u.demTexture){const ct=u.demTexture;ct.update($e,{premultiply:!1}),ct.bind(he.NEAREST,he.CLAMP_TO_EDGE)}else u.demTexture=new L(ie,$e,he.RGBA,{premultiply:!1}),u.demTexture.bind(he.NEAREST,he.CLAMP_TO_EDGE);ie.activeTexture.set(he.TEXTURE0);let nt=u.fbo;if(!nt){const ct=new L(ie,{width:Ce,height:Ce,data:null},he.RGBA);ct.bind(he.LINEAR,he.CLAMP_TO_EDGE),nt=u.fbo=ie.createFramebuffer(Ce,Ce,!0,!1),nt.colorAttachment.set(ct.texture)}ie.bindFramebuffer.set(nt.framebuffer),ie.viewport.set([0,0,Ce,Ce]),j.useProgram("hillshadePrepare").draw(ie,he.TRIANGLES,F,$,Z,Si.disabled,Ia(u.tileID,be),null,m.id,j.rasterBoundsBuffer,j.quadTriangleIndexBuffer,j.rasterBoundsSegments),u.needsHillshadePrepare=!1}}function xs(j,u,m,F,$,Z){const ie=F.paint.get("raster-fade-duration");if(!Z&&ie>0){const he=c.now(),be=(he-j.timeAdded)/ie,Ce=u?(he-u.timeAdded)/ie:-1,ze=m.getSource(),$e=$.coveringZoomLevel({tileSize:ze.tileSize,roundZoom:ze.roundZoom}),nt=!u||Math.abs(u.tileID.overscaledZ-$e)>Math.abs(j.tileID.overscaledZ-$e),ct=nt&&j.refreshedUponExpiration?1:a.ad(nt?be:1-Ce,0,1);return j.refreshedUponExpiration&&be>=1&&(j.refreshedUponExpiration=!1),u?{opacity:1,mix:1-ct}:{opacity:ct,mix:0}}return{opacity:1,mix:0}}const Ds=new a.aN(1,0,0,1),zl=new a.aN(0,1,0,1),ws=new a.aN(0,0,1,1),ri=new a.aN(1,0,1,1),Qc=new a.aN(0,1,1,1);function eu(j){const u=j.transform.padding;Vc(j,j.transform.height-(u.top||0),3,Ds),Vc(j,u.bottom||0,3,zl),Ao(j,u.left||0,3,ws),Ao(j,j.transform.width-(u.right||0),3,ri);const m=j.transform.centerPoint;(function(F,$,Z,ie){Cc(F,$-1,Z-10,2,20,ie),Cc(F,$-10,Z-1,20,2,ie)})(j,m.x,j.transform.height-m.y,Qc)}function Vc(j,u,m,F){Cc(j,0,u+m/2,j.transform.width,m,F)}function Ao(j,u,m,F){Cc(j,u-m/2,0,m,j.transform.height,F)}function Cc(j,u,m,F,$,Z){const ie=j.context,he=ie.gl;he.enable(he.SCISSOR_TEST),he.scissor(u*j.pixelRatio,m*j.pixelRatio,F*j.pixelRatio,$*j.pixelRatio),ie.clear({color:Z}),he.disable(he.SCISSOR_TEST)}function Mu(j,u,m){const F=j.context,$=F.gl,Z=m.posMatrix,ie=j.useProgram("debug"),he=Gr.disabled,be=ki.disabled,Ce=j.colorModeForRenderPass(),ze="$debug",$e=j.style.map.terrain&&j.style.map.terrain.getTerrainData(m);F.activeTexture.set($.TEXTURE0);const nt=u.getTileByID(m.key).latestRawTileData,ct=nt&&nt.byteLength||0,pt=Math.floor(ct/1024),xt=u.getTile(m).tileSize,Et=512/Math.min(xt,512)*(m.overscaledZ/j.transform.zoom)*.5;let Ct=m.canonical.toString();m.overscaledZ!==m.canonical.z&&(Ct+=` => ${m.overscaledZ}`),function(Rt,At){Rt.initDebugOverlayCanvas();const Zt=Rt.debugOverlayCanvas,Kt=Rt.context.gl,Yt=Rt.debugOverlayCanvas.getContext("2d");Yt.clearRect(0,0,Zt.width,Zt.height),Yt.shadowColor="white",Yt.shadowBlur=2,Yt.lineWidth=1.5,Yt.strokeStyle="white",Yt.textBaseline="top",Yt.font="bold 36px Open Sans, sans-serif",Yt.fillText(At,5,5),Yt.strokeText(At,5,5),Rt.debugOverlayTexture.update(Zt),Rt.debugOverlayTexture.bind(Kt.LINEAR,Kt.CLAMP_TO_EDGE)}(j,`${Ct} ${pt}kB`),ie.draw(F,$.TRIANGLES,he,be,to.alphaBlended,Si.disabled,fa(Z,a.aN.transparent,Et),null,ze,j.debugBuffer,j.quadTriangleIndexBuffer,j.debugSegments),ie.draw(F,$.LINE_STRIP,he,be,Ce,Si.disabled,fa(Z,a.aN.red),$e,ze,j.debugBuffer,j.tileBorderIndexBuffer,j.debugSegments)}function oc(j,u,m){const F=j.context,$=F.gl,Z=j.colorModeForRenderPass(),ie=new Gr($.LEQUAL,Gr.ReadWrite,j.depthRangeFor3D),he=j.useProgram("terrain"),be=u.getTerrainMesh();F.bindFramebuffer.set(null),F.viewport.set([0,0,j.width,j.height]);for(const Ce of m){const ze=j.renderToTexture.getTexture(Ce),$e=u.getTerrainData(Ce.tileID);F.activeTexture.set($.TEXTURE0),$.bindTexture($.TEXTURE_2D,ze.texture);const nt=j.transform.calculatePosMatrix(Ce.tileID.toUnwrapped()),ct=u.getMeshFrameDelta(j.transform.zoom),pt=j.transform.calculateFogMatrix(Ce.tileID.toUnwrapped()),xt=va(nt,ct,pt,j.style.sky,j.transform.pitch);he.draw(F,$.TRIANGLES,ie,ki.disabled,Z,Si.backCCW,xt,$e,"terrain",be.vertexBuffer,be.indexBuffer,be.segments)}}class sc{constructor(u,m,F){this.vertexBuffer=u,this.indexBuffer=m,this.segments=F}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class lc{constructor(u,m){this.context=new xc(u),this.transform=m,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:a.ao(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Ge.maxUnderzooming+Ge.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new en}resize(u,m,F){if(this.width=Math.floor(u*F),this.height=Math.floor(m*F),this.pixelRatio=F,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const $ of this.style._order)this.style._layers[$].resize()}setup(){const u=this.context,m=new a.aX;m.emplaceBack(0,0),m.emplaceBack(a.X,0),m.emplaceBack(0,a.X),m.emplaceBack(a.X,a.X),this.tileExtentBuffer=u.createVertexBuffer(m,vn.members),this.tileExtentSegments=a.a0.simpleSegment(0,0,4,2);const F=new a.aX;F.emplaceBack(0,0),F.emplaceBack(a.X,0),F.emplaceBack(0,a.X),F.emplaceBack(a.X,a.X),this.debugBuffer=u.createVertexBuffer(F,vn.members),this.debugSegments=a.a0.simpleSegment(0,0,4,5);const $=new a.$;$.emplaceBack(0,0,0,0),$.emplaceBack(a.X,0,a.X,0),$.emplaceBack(0,a.X,0,a.X),$.emplaceBack(a.X,a.X,a.X,a.X),this.rasterBoundsBuffer=u.createVertexBuffer($,De.members),this.rasterBoundsSegments=a.a0.simpleSegment(0,0,4,2);const Z=new a.aX;Z.emplaceBack(0,0),Z.emplaceBack(1,0),Z.emplaceBack(0,1),Z.emplaceBack(1,1),this.viewportBuffer=u.createVertexBuffer(Z,vn.members),this.viewportSegments=a.a0.simpleSegment(0,0,4,2);const ie=new a.aZ;ie.emplaceBack(0),ie.emplaceBack(1),ie.emplaceBack(3),ie.emplaceBack(2),ie.emplaceBack(0),this.tileBorderIndexBuffer=u.createIndexBuffer(ie);const he=new a.aY;he.emplaceBack(0,1,2),he.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=u.createIndexBuffer(he);const be=this.context.gl;this.stencilClearMode=new ki({func:be.ALWAYS,mask:0},0,255,be.ZERO,be.ZERO,be.ZERO)}clearStencil(){const u=this.context,m=u.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const F=a.H();a.aQ(F,0,this.width,this.height,0,0,1),a.K(F,F,[m.drawingBufferWidth,m.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(u,m.TRIANGLES,Gr.disabled,this.stencilClearMode,to.disabled,Si.disabled,za(F),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(u,m){if(this.currentStencilSource===u.source||!u.isTileClipped()||!m||!m.length)return;this.currentStencilSource=u.source;const F=this.context,$=F.gl;this.nextStencilID+m.length>256&&this.clearStencil(),F.setColorMode(to.disabled),F.setDepthMode(Gr.disabled);const Z=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const ie of m){const he=this._tileClippingMaskIDs[ie.key]=this.nextStencilID++,be=this.style.map.terrain&&this.style.map.terrain.getTerrainData(ie);Z.draw(F,$.TRIANGLES,Gr.disabled,new ki({func:$.ALWAYS,mask:0},he,255,$.KEEP,$.KEEP,$.REPLACE),to.disabled,Si.disabled,za(ie.posMatrix),be,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const u=this.nextStencilID++,m=this.context.gl;return new ki({func:m.NOTEQUAL,mask:255},u,255,m.KEEP,m.KEEP,m.REPLACE)}stencilModeForClipping(u){const m=this.context.gl;return new ki({func:m.EQUAL,mask:255},this._tileClippingMaskIDs[u.key],0,m.KEEP,m.KEEP,m.REPLACE)}stencilConfigForOverlap(u){const m=this.context.gl,F=u.sort((ie,he)=>he.overscaledZ-ie.overscaledZ),$=F[F.length-1].overscaledZ,Z=F[0].overscaledZ-$+1;if(Z>1){this.currentStencilSource=void 0,this.nextStencilID+Z>256&&this.clearStencil();const ie={};for(let he=0;he<Z;he++)ie[he+$]=new ki({func:m.GEQUAL,mask:255},he+this.nextStencilID,255,m.KEEP,m.KEEP,m.REPLACE);return this.nextStencilID+=Z,[ie,F]}return[{[$]:ki.disabled},F]}colorModeForRenderPass(){const u=this.context.gl;return this._showOverdrawInspector?new to([u.CONSTANT_COLOR,u.ONE],new a.aN(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?to.unblended:to.alphaBlended}depthModeForSublayer(u,m,F){if(!this.opaquePassEnabledForLayer())return Gr.disabled;const $=1-((1+this.currentLayer)*this.numSublayers+u)*this.depthEpsilon;return new Gr(F||this.context.gl.LEQUAL,m,[$,$])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(u,m){var F;this.style=u,this.options=m,this.lineAtlas=u.lineAtlas,this.imageManager=u.imageManager,this.glyphManager=u.glyphManager,this.symbolFadeChange=u.placement.symbolFadeChange(c.now()),this.imageManager.beginFrame();const $=this.style._order,Z=this.style.sourceCaches,ie={},he={},be={};for(const Ce in Z){const ze=Z[Ce];ze.used&&ze.prepare(this.context),ie[Ce]=ze.getVisibleCoordinates(),he[Ce]=ie[Ce].slice().reverse(),be[Ce]=ze.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let Ce=0;Ce<$.length;Ce++){const ze=$[Ce];if(this.style._layers[ze].is3D()){this.opaquePassCutoff=Ce;break}}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const Ce of $){const ze=this.style._layers[Ce];if(!ze.hasOffscreenPass()||ze.isHidden(this.transform.zoom))continue;const $e=he[ze.source];(ze.type==="custom"||$e.length)&&this.renderLayer(this,Z[ze.source],ze,$e)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:m.showOverdrawInspector?a.aN.black:a.aN.transparent,depth:1}),this.clearStencil(),!((F=this.style.stylesheet)===null||F===void 0)&&F.sky&&function(Ce,ze){const $e=Ce.context,nt=$e.gl,ct=((Rt,At,Zt)=>({u_sky_color:Rt.properties.get("sky-color"),u_horizon_color:Rt.properties.get("horizon-color"),u_horizon:(At.height/2+At.getHorizon())*Zt,u_sky_horizon_blend:Rt.properties.get("sky-horizon-blend")*At.height/2*Zt}))(ze,Ce.style.map.transform,Ce.pixelRatio),pt=new Gr(nt.LEQUAL,Gr.ReadWrite,[0,1]),xt=ki.disabled,Et=Ce.colorModeForRenderPass(),Ct=Ce.useProgram("sky");if(!ze.mesh){const Rt=new a.aX;Rt.emplaceBack(-1,-1),Rt.emplaceBack(1,-1),Rt.emplaceBack(1,1),Rt.emplaceBack(-1,1);const At=new a.aY;At.emplaceBack(0,1,2),At.emplaceBack(0,2,3),ze.mesh=new sc($e.createVertexBuffer(Rt,vn.members),$e.createIndexBuffer(At),a.a0.simpleSegment(0,0,Rt.length,At.length))}Ct.draw($e,nt.TRIANGLES,pt,xt,Et,Si.disabled,ct,void 0,"sky",ze.mesh.vertexBuffer,ze.mesh.indexBuffer,ze.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=m.showOverdrawInspector,this.depthRangeFor3D=[0,1-(u._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=$.length-1;this.currentLayer>=0;this.currentLayer--){const Ce=this.style._layers[$[this.currentLayer]],ze=Z[Ce.source],$e=ie[Ce.source];this._renderTileClippingMasks(Ce,$e),this.renderLayer(this,ze,Ce,$e)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<$.length;this.currentLayer++){const Ce=this.style._layers[$[this.currentLayer]],ze=Z[Ce.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(Ce))continue;const $e=(Ce.type==="symbol"?be:he)[Ce.source];this._renderTileClippingMasks(Ce,ie[Ce.source]),this.renderLayer(this,ze,Ce,$e)}if(this.options.showTileBoundaries){const Ce=function(ze,$e){let nt=null;const ct=Object.values(ze._layers).flatMap(Ct=>Ct.source&&!Ct.isHidden($e)?[ze.sourceCaches[Ct.source]]:[]),pt=ct.filter(Ct=>Ct.getSource().type==="vector"),xt=ct.filter(Ct=>Ct.getSource().type!=="vector"),Et=Ct=>{(!nt||nt.getSource().maxzoom<Ct.getSource().maxzoom)&&(nt=Ct)};return pt.forEach(Ct=>Et(Ct)),nt||xt.forEach(Ct=>Et(Ct)),nt}(this.style,this.transform.zoom);Ce&&function(ze,$e,nt){for(let ct=0;ct<nt.length;ct++)Mu(ze,$e,nt[ct])}(this,Ce,Ce.getVisibleCoordinates())}this.options.showPadding&&eu(this),this.context.setDefault()}maybeDrawDepthAndCoords(u){if(!this.style||!this.style.map||!this.style.map.terrain)return;const m=this.terrainFacilitator.matrix,F=this.transform.modelViewProjectionMatrix;let $=this.terrainFacilitator.dirty;$||($=u?!a.a_(m,F):!a.a$(m,F)),$||($=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),$&&(a.b0(m,F),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(Z,ie){const he=Z.context,be=he.gl,Ce=to.unblended,ze=new Gr(be.LEQUAL,Gr.ReadWrite,[0,1]),$e=ie.getTerrainMesh(),nt=ie.sourceCache.getRenderableTiles(),ct=Z.useProgram("terrainDepth");he.bindFramebuffer.set(ie.getFramebuffer("depth").framebuffer),he.viewport.set([0,0,Z.width/devicePixelRatio,Z.height/devicePixelRatio]),he.clear({color:a.aN.transparent,depth:1});for(const pt of nt){const xt=ie.getTerrainData(pt.tileID),Et={u_matrix:Z.transform.calculatePosMatrix(pt.tileID.toUnwrapped()),u_ele_delta:ie.getMeshFrameDelta(Z.transform.zoom)};ct.draw(he,be.TRIANGLES,ze,ki.disabled,Ce,Si.backCCW,Et,xt,"terrain",$e.vertexBuffer,$e.indexBuffer,$e.segments)}he.bindFramebuffer.set(null),he.viewport.set([0,0,Z.width,Z.height])}(this,this.style.map.terrain),function(Z,ie){const he=Z.context,be=he.gl,Ce=to.unblended,ze=new Gr(be.LEQUAL,Gr.ReadWrite,[0,1]),$e=ie.getTerrainMesh(),nt=ie.getCoordsTexture(),ct=ie.sourceCache.getRenderableTiles(),pt=Z.useProgram("terrainCoords");he.bindFramebuffer.set(ie.getFramebuffer("coords").framebuffer),he.viewport.set([0,0,Z.width/devicePixelRatio,Z.height/devicePixelRatio]),he.clear({color:a.aN.transparent,depth:1}),ie.coordsIndex=[];for(const xt of ct){const Et=ie.getTerrainData(xt.tileID);he.activeTexture.set(be.TEXTURE0),be.bindTexture(be.TEXTURE_2D,nt.texture);const Ct={u_matrix:Z.transform.calculatePosMatrix(xt.tileID.toUnwrapped()),u_terrain_coords_id:(255-ie.coordsIndex.length)/255,u_texture:0,u_ele_delta:ie.getMeshFrameDelta(Z.transform.zoom)};pt.draw(he,be.TRIANGLES,ze,ki.disabled,Ce,Si.backCCW,Ct,Et,"terrain",$e.vertexBuffer,$e.indexBuffer,$e.segments),ie.coordsIndex.push(xt.tileID.key)}he.bindFramebuffer.set(null),he.viewport.set([0,0,Z.width,Z.height])}(this,this.style.map.terrain))}renderLayer(u,m,F,$){if(!F.isHidden(this.transform.zoom)&&(F.type==="background"||F.type==="custom"||($||[]).length))switch(this.id=F.id,F.type){case"symbol":Pl(u,m,F,$,this.style.placement.variableOffsets);break;case"circle":(function(Z,ie,he,be){if(Z.renderPass!=="translucent")return;const Ce=he.paint.get("circle-opacity"),ze=he.paint.get("circle-stroke-width"),$e=he.paint.get("circle-stroke-opacity"),nt=!he.layout.get("circle-sort-key").isConstant();if(Ce.constantOr(1)===0&&(ze.constantOr(1)===0||$e.constantOr(1)===0))return;const ct=Z.context,pt=ct.gl,xt=Z.depthModeForSublayer(0,Gr.ReadOnly),Et=ki.disabled,Ct=Z.colorModeForRenderPass(),Rt=[];for(let At=0;At<be.length;At++){const Zt=be[At],Kt=ie.getTile(Zt),Yt=Kt.getBucket(he);if(!Yt)continue;const da=Yt.programConfigurations.get(he.id),ba=Z.useProgram("circle",da),Na=Yt.layoutVertexBuffer,Fa=Yt.indexBuffer,Ua=Z.style.map.terrain&&Z.style.map.terrain.getTerrainData(Zt),Ja={programConfiguration:da,program:ba,layoutVertexBuffer:Na,indexBuffer:Fa,uniformValues:$a(Z,Zt,Kt,he),terrainData:Ua};if(nt){const yn=Yt.segments.get();for(const Qa of yn)Rt.push({segments:new a.a0([Qa]),sortKey:Qa.sortKey,state:Ja})}else Rt.push({segments:Yt.segments,sortKey:0,state:Ja})}nt&&Rt.sort((At,Zt)=>At.sortKey-Zt.sortKey);for(const At of Rt){const{programConfiguration:Zt,program:Kt,layoutVertexBuffer:Yt,indexBuffer:da,uniformValues:ba,terrainData:Na}=At.state,Fa=At.segments;Kt.draw(ct,pt.TRIANGLES,xt,Et,Ct,Si.disabled,ba,Na,he.id,Yt,da,Fa,he.paint,Z.transform.zoom,Zt)}})(u,m,F,$);break;case"heatmap":Ol(u,m,F,$);break;case"line":(function(Z,ie,he,be){if(Z.renderPass!=="translucent")return;const Ce=he.paint.get("line-opacity"),ze=he.paint.get("line-width");if(Ce.constantOr(1)===0||ze.constantOr(1)===0)return;const $e=Z.depthModeForSublayer(0,Gr.ReadOnly),nt=Z.colorModeForRenderPass(),ct=he.paint.get("line-dasharray"),pt=he.paint.get("line-pattern"),xt=pt.constantOr(1),Et=he.paint.get("line-gradient"),Ct=he.getCrossfadeParameters(),Rt=xt?"linePattern":ct?"lineSDF":Et?"lineGradient":"line",At=Z.context,Zt=At.gl;let Kt=!0;for(const Yt of be){const da=ie.getTile(Yt);if(xt&&!da.patternsLoaded())continue;const ba=da.getBucket(he);if(!ba)continue;const Na=ba.programConfigurations.get(he.id),Fa=Z.context.program.get(),Ua=Z.useProgram(Rt,Na),Ja=Kt||Ua.program!==Fa,yn=Z.style.map.terrain&&Z.style.map.terrain.getTerrainData(Yt),Qa=pt.constantOr(null);if(Qa&&da.imageAtlas){const Cn=da.imageAtlas,fn=Cn.patternPositions[Qa.to.toString()],In=Cn.patternPositions[Qa.from.toString()];fn&&In&&Na.setConstantPatternPositions(fn,In)}const wn=yn?Yt:null,rn=xt?Za(Z,da,he,Ct,wn):ct?cn(Z,da,he,ct,Ct,wn):Et?Sa(Z,da,he,ba.lineClipsArray.length,wn):oa(Z,da,he,wn);if(xt)At.activeTexture.set(Zt.TEXTURE0),da.imageAtlasTexture.bind(Zt.LINEAR,Zt.CLAMP_TO_EDGE),Na.updatePaintBuffers(Ct);else if(ct&&(Ja||Z.lineAtlas.dirty))At.activeTexture.set(Zt.TEXTURE0),Z.lineAtlas.bind(At);else if(Et){const Cn=ba.gradients[he.id];let fn=Cn.texture;if(he.gradientVersion!==Cn.version){let In=256;if(he.stepInterpolant){const Wn=ie.getSource().maxzoom,Mn=Yt.canonical.z===Wn?Math.ceil(1<<Z.transform.maxZoom-Yt.canonical.z):1,Hn=ba.maxLineLength/a.X*1024*Mn;In=a.ad(a.aV(Hn),256,At.maxTextureSize)}Cn.gradient=a.aW({expression:he.gradientExpression(),evaluationKey:"lineProgress",resolution:In,image:Cn.gradient||void 0,clips:ba.lineClipsArray}),Cn.texture?Cn.texture.update(Cn.gradient):Cn.texture=new L(At,Cn.gradient,Zt.RGBA),Cn.version=he.gradientVersion,fn=Cn.texture}At.activeTexture.set(Zt.TEXTURE0),fn.bind(he.stepInterpolant?Zt.NEAREST:Zt.LINEAR,Zt.CLAMP_TO_EDGE)}Ua.draw(At,Zt.TRIANGLES,$e,Z.stencilModeForClipping(Yt),nt,Si.disabled,rn,yn,he.id,ba.layoutVertexBuffer,ba.indexBuffer,ba.segments,he.paint,Z.transform.zoom,Na,ba.layoutVertexBuffer2),Kt=!1}})(u,m,F,$);break;case"fill":(function(Z,ie,he,be){const Ce=he.paint.get("fill-color"),ze=he.paint.get("fill-opacity");if(ze.constantOr(1)===0)return;const $e=Z.colorModeForRenderPass(),nt=he.paint.get("fill-pattern"),ct=Z.opaquePassEnabledForLayer()&&!nt.constantOr(1)&&Ce.constantOr(a.aN.transparent).a===1&&ze.constantOr(0)===1?"opaque":"translucent";if(Z.renderPass===ct){const pt=Z.depthModeForSublayer(1,Z.renderPass==="opaque"?Gr.ReadWrite:Gr.ReadOnly);Rc(Z,ie,he,be,pt,$e,!1)}if(Z.renderPass==="translucent"&&he.paint.get("fill-antialias")){const pt=Z.depthModeForSublayer(he.getPaintProperty("fill-outline-color")?2:0,Gr.ReadOnly);Rc(Z,ie,he,be,pt,$e,!0)}})(u,m,F,$);break;case"fill-extrusion":(function(Z,ie,he,be){const Ce=he.paint.get("fill-extrusion-opacity");if(Ce!==0&&Z.renderPass==="translucent"){const ze=new Gr(Z.context.gl.LEQUAL,Gr.ReadWrite,Z.depthRangeFor3D);if(Ce!==1||he.paint.get("fill-extrusion-pattern").constantOr(1))kc(Z,ie,he,be,ze,ki.disabled,to.disabled),kc(Z,ie,he,be,ze,Z.stencilModeFor3D(),Z.colorModeForRenderPass());else{const $e=Z.colorModeForRenderPass();kc(Z,ie,he,be,ze,ki.disabled,$e)}}})(u,m,F,$);break;case"hillshade":(function(Z,ie,he,be){if(Z.renderPass!=="offscreen"&&Z.renderPass!=="translucent")return;const Ce=Z.context,ze=Z.depthModeForSublayer(0,Gr.ReadOnly),$e=Z.colorModeForRenderPass(),[nt,ct]=Z.renderPass==="translucent"?Z.stencilConfigForOverlap(be):[{},be];for(const pt of ct){const xt=ie.getTile(pt);xt.needsHillshadePrepare!==void 0&&xt.needsHillshadePrepare&&Z.renderPass==="offscreen"?bu(Z,xt,he,ze,ki.disabled,$e):Z.renderPass==="translucent"&&Sc(Z,pt,xt,he,ze,nt[pt.overscaledZ],$e)}Ce.viewport.set([0,0,Z.width,Z.height])})(u,m,F,$);break;case"raster":(function(Z,ie,he,be){if(Z.renderPass!=="translucent"||he.paint.get("raster-opacity")===0||!be.length)return;const Ce=Z.context,ze=Ce.gl,$e=ie.getSource(),nt=Z.useProgram("raster"),ct=Z.colorModeForRenderPass(),[pt,xt]=$e instanceof Be?[{},be]:Z.stencilConfigForOverlap(be),Et=xt[xt.length-1].overscaledZ,Ct=!Z.options.moving;for(const Rt of xt){const At=Z.depthModeForSublayer(Rt.overscaledZ-Et,he.paint.get("raster-opacity")===1?Gr.ReadWrite:Gr.ReadOnly,ze.LESS),Zt=ie.getTile(Rt);Zt.registerFadeDuration(he.paint.get("raster-fade-duration"));const Kt=ie.findLoadedParent(Rt,0),Yt=ie.findLoadedSibling(Rt),da=xs(Zt,Kt||Yt||null,ie,he,Z.transform,Z.style.map.terrain);let ba,Na;const Fa=he.paint.get("raster-resampling")==="nearest"?ze.NEAREST:ze.LINEAR;Ce.activeTexture.set(ze.TEXTURE0),Zt.texture.bind(Fa,ze.CLAMP_TO_EDGE,ze.LINEAR_MIPMAP_NEAREST),Ce.activeTexture.set(ze.TEXTURE1),Kt?(Kt.texture.bind(Fa,ze.CLAMP_TO_EDGE,ze.LINEAR_MIPMAP_NEAREST),ba=Math.pow(2,Kt.tileID.overscaledZ-Zt.tileID.overscaledZ),Na=[Zt.tileID.canonical.x*ba%1,Zt.tileID.canonical.y*ba%1]):Zt.texture.bind(Fa,ze.CLAMP_TO_EDGE,ze.LINEAR_MIPMAP_NEAREST),Zt.texture.useMipmap&&Ce.extTextureFilterAnisotropic&&Z.transform.pitch>20&&ze.texParameterf(ze.TEXTURE_2D,Ce.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Ce.extTextureFilterAnisotropicMax);const Ua=Z.style.map.terrain&&Z.style.map.terrain.getTerrainData(Rt),Ja=Ua?Rt:null,yn=Ja?Ja.posMatrix:Z.transform.calculatePosMatrix(Rt.toUnwrapped(),Ct),Qa=En(yn,Na||[0,0],ba||1,da,he);$e instanceof Be?nt.draw(Ce,ze.TRIANGLES,At,ki.disabled,ct,Si.disabled,Qa,Ua,he.id,$e.boundsBuffer,Z.quadTriangleIndexBuffer,$e.boundsSegments):nt.draw(Ce,ze.TRIANGLES,At,pt[Rt.overscaledZ],ct,Si.disabled,Qa,Ua,he.id,Z.rasterBoundsBuffer,Z.quadTriangleIndexBuffer,Z.rasterBoundsSegments)}})(u,m,F,$);break;case"background":(function(Z,ie,he,be){const Ce=he.paint.get("background-color"),ze=he.paint.get("background-opacity");if(ze===0)return;const $e=Z.context,nt=$e.gl,ct=Z.transform,pt=ct.tileSize,xt=he.paint.get("background-pattern");if(Z.isPatternMissing(xt))return;const Et=!xt&&Ce.a===1&&ze===1&&Z.opaquePassEnabledForLayer()?"opaque":"translucent";if(Z.renderPass!==Et)return;const Ct=ki.disabled,Rt=Z.depthModeForSublayer(0,Et==="opaque"?Gr.ReadWrite:Gr.ReadOnly),At=Z.colorModeForRenderPass(),Zt=Z.useProgram(xt?"backgroundPattern":"background"),Kt=be||ct.coveringTiles({tileSize:pt,terrain:Z.style.map.terrain});xt&&($e.activeTexture.set(nt.TEXTURE0),Z.imageManager.bind(Z.context));const Yt=he.getCrossfadeParameters();for(const da of Kt){const ba=be?da.posMatrix:Z.transform.calculatePosMatrix(da.toUnwrapped()),Na=xt?Jn(ba,ze,Z,xt,{tileID:da,tileSize:pt},Yt):Nn(ba,ze,Ce),Fa=Z.style.map.terrain&&Z.style.map.terrain.getTerrainData(da);Zt.draw($e,nt.TRIANGLES,Rt,Ct,At,Si.disabled,Na,Fa,he.id,Z.tileExtentBuffer,Z.quadTriangleIndexBuffer,Z.tileExtentSegments)}})(u,0,F,$);break;case"custom":(function(Z,ie,he){const be=Z.context,Ce=he.implementation;if(Z.renderPass==="offscreen"){const ze=Ce.prerender;ze&&(Z.setCustomLayerDefaults(),be.setColorMode(Z.colorModeForRenderPass()),ze.call(Ce,be.gl,Z.transform.customLayerMatrix()),be.setDirty(),Z.setBaseState())}else if(Z.renderPass==="translucent"){Z.setCustomLayerDefaults(),be.setColorMode(Z.colorModeForRenderPass()),be.setStencilMode(ki.disabled);const ze=Ce.renderingMode==="3d"?new Gr(Z.context.gl.LEQUAL,Gr.ReadWrite,Z.depthRangeFor3D):Z.depthModeForSublayer(0,Gr.ReadOnly);be.setDepthMode(ze),Ce.render(be.gl,Z.transform.customLayerMatrix(),{farZ:Z.transform.farZ,nearZ:Z.transform.nearZ,fov:Z.transform._fov,modelViewProjectionMatrix:Z.transform.modelViewProjectionMatrix,projectionMatrix:Z.transform.projectionMatrix}),be.setDirty(),Z.setBaseState(),be.bindFramebuffer.set(null)}})(u,0,F)}}translatePosMatrix(u,m,F,$,Z){if(!F[0]&&!F[1])return u;const ie=Z?$==="map"?this.transform.angle:0:$==="viewport"?-this.transform.angle:0;if(ie){const Ce=Math.sin(ie),ze=Math.cos(ie);F=[F[0]*ze-F[1]*Ce,F[0]*Ce+F[1]*ze]}const he=[Z?F[0]:St(m,F[0],this.transform.zoom),Z?F[1]:St(m,F[1],this.transform.zoom),0],be=new Float32Array(16);return a.J(be,u,he),be}saveTileTexture(u){const m=this._tileTextures[u.size[0]];m?m.push(u):this._tileTextures[u.size[0]]=[u]}getTileTexture(u){const m=this._tileTextures[u];return m&&m.length>0?m.pop():null}isPatternMissing(u){if(!u)return!1;if(!u.from||!u.to)return!0;const m=this.imageManager.getPattern(u.from.toString()),F=this.imageManager.getPattern(u.to.toString());return!m||!F}useProgram(u,m){this.cache=this.cache||{};const F=u+(m?m.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[F]||(this.cache[F]=new tn(this.context,bn[u],m,$n[u],this._showOverdrawInspector,this.style.map.terrain)),this.cache[F]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const u=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(u.FUNC_ADD)}initDebugOverlayCanvas(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;const u=this.context.gl;this.debugOverlayTexture=new L(this.context,this.debugOverlayCanvas,u.RGBA)}}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:u,drawingBufferHeight:m}=this.context.gl;return this.width!==u||this.height!==m}}class Rs{constructor(u,m){this.points=u,this.planes=m}static fromInvProjectionMatrix(u,m,F){const $=Math.pow(2,F),Z=[[-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(he=>{const be=1/(he=a.ag([],he,u))[3]/m*$;return a.b1(he,he,[be,be,1/he[3],be])}),ie=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(he=>{const be=function(nt,ct){var pt=ct[0],xt=ct[1],Et=ct[2],Ct=pt*pt+xt*xt+Et*Et;return Ct>0&&(Ct=1/Math.sqrt(Ct)),nt[0]=ct[0]*Ct,nt[1]=ct[1]*Ct,nt[2]=ct[2]*Ct,nt}([],function(nt,ct,pt){var xt=ct[0],Et=ct[1],Ct=ct[2],Rt=pt[0],At=pt[1],Zt=pt[2];return nt[0]=Et*Zt-Ct*At,nt[1]=Ct*Rt-xt*Zt,nt[2]=xt*At-Et*Rt,nt}([],P([],Z[he[0]],Z[he[1]]),P([],Z[he[2]],Z[he[1]]))),Ce=(ze=be,$e=Z[he[1]],-(ze[0]*$e[0]+ze[1]*$e[1]+ze[2]*$e[2]));var ze,$e;return be.concat(Ce)});return new Rs(Z,ie)}}class ks{constructor(u,m){this.min=u,this.max=m,this.center=function(F,$,Z){return F[0]=$[0]*Z,F[1]=$[1]*Z,F[2]=$[2]*Z,F}([],function(F,$,Z){return F[0]=$[0]+Z[0],F[1]=$[1]+Z[1],F[2]=$[2]+Z[2],F}([],this.min,this.max),.5)}quadrant(u){const m=[u%2==0,u<2],F=T(this.min),$=T(this.max);for(let Z=0;Z<m.length;Z++)F[Z]=m[Z]?this.min[Z]:this.center[Z],$[Z]=m[Z]?this.center[Z]:this.max[Z];return $[2]=this.max[2],new ks(F,$)}distanceX(u){return Math.max(Math.min(this.max[0],u[0]),this.min[0])-u[0]}distanceY(u){return Math.max(Math.min(this.max[1],u[1]),this.min[1])-u[1]}intersects(u){const m=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let F=!0;for(let $=0;$<u.planes.length;$++){const Z=u.planes[$];let ie=0;for(let he=0;he<m.length;he++)a.b2(Z,m[he])>=0&&ie++;if(ie===0)return 0;ie!==m.length&&(F=!1)}if(F)return 2;for(let $=0;$<3;$++){let Z=Number.MAX_VALUE,ie=-Number.MAX_VALUE;for(let he=0;he<u.points.length;he++){const be=u.points[he][$]-this.min[$];Z=Math.min(Z,be),ie=Math.max(ie,be)}if(ie<0||Z>this.max[$]-this.min[$])return 0}return 1}}class Nl{constructor(u=0,m=0,F=0,$=0){if(isNaN(u)||u<0||isNaN(m)||m<0||isNaN(F)||F<0||isNaN($)||$<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=u,this.bottom=m,this.left=F,this.right=$}interpolate(u,m,F){return m.top!=null&&u.top!=null&&(this.top=a.z.number(u.top,m.top,F)),m.bottom!=null&&u.bottom!=null&&(this.bottom=a.z.number(u.bottom,m.bottom,F)),m.left!=null&&u.left!=null&&(this.left=a.z.number(u.left,m.left,F)),m.right!=null&&u.right!=null&&(this.right=a.z.number(u.right,m.right,F)),this}getCenter(u,m){const F=a.ad((this.left+u-this.right)/2,0,u),$=a.ad((this.top+m-this.bottom)/2,0,m);return new a.P(F,$)}equals(u){return this.top===u.top&&this.bottom===u.bottom&&this.left===u.left&&this.right===u.right}clone(){return new Nl(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Tc=85.051129;class fi{constructor(u,m,F,$,Z){this.tileSize=512,this._renderWorldCopies=Z===void 0||!!Z,this._minZoom=u||0,this._maxZoom=m||22,this._minPitch=F??0,this._maxPitch=$??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new a.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Nl,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const u=new fi(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return u.apply(this),u}apply(u){this.tileSize=u.tileSize,this.latRange=u.latRange,this.width=u.width,this.height=u.height,this._center=u._center,this._elevation=u._elevation,this.minElevationForCurrentTile=u.minElevationForCurrentTile,this.zoom=u.zoom,this.angle=u.angle,this._fov=u._fov,this._pitch=u._pitch,this._unmodified=u._unmodified,this._edgeInsets=u._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(u){this._minZoom!==u&&(this._minZoom=u,this.zoom=Math.max(this.zoom,u))}get maxZoom(){return this._maxZoom}set maxZoom(u){this._maxZoom!==u&&(this._maxZoom=u,this.zoom=Math.min(this.zoom,u))}get minPitch(){return this._minPitch}set minPitch(u){this._minPitch!==u&&(this._minPitch=u,this.pitch=Math.max(this.pitch,u))}get maxPitch(){return this._maxPitch}set maxPitch(u){this._maxPitch!==u&&(this._maxPitch=u,this.pitch=Math.min(this.pitch,u))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(u){u===void 0?u=!0:u===null&&(u=!1),this._renderWorldCopies=u}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new a.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(u){const m=-a.b3(u,-180,180)*Math.PI/180;this.angle!==m&&(this._unmodified=!1,this.angle=m,this._calcMatrices(),this.rotationMatrix=function(){var F=new a.A(4);return a.A!=Float32Array&&(F[1]=0,F[2]=0),F[0]=1,F[3]=1,F}(),function(F,$,Z){var ie=$[0],he=$[1],be=$[2],Ce=$[3],ze=Math.sin(Z),$e=Math.cos(Z);F[0]=ie*$e+be*ze,F[1]=he*$e+Ce*ze,F[2]=ie*-ze+be*$e,F[3]=he*-ze+Ce*$e}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(u){const m=a.ad(u,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==m&&(this._unmodified=!1,this._pitch=m,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(u){u=Math.max(.01,Math.min(60,u)),this._fov!==u&&(this._unmodified=!1,this._fov=u/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(u){const m=Math.min(Math.max(u,this.minZoom),this.maxZoom);this._zoom!==m&&(this._unmodified=!1,this._zoom=m,this.tileZoom=Math.max(0,Math.floor(m)),this.scale=this.zoomScale(m),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(u){u.lat===this._center.lat&&u.lng===this._center.lng||(this._unmodified=!1,this._center=u,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(u){u!==this._elevation&&(this._elevation=u,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(u){this._edgeInsets.equals(u)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,u,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(u){return this._edgeInsets.equals(u)}interpolatePadding(u,m,F){this._unmodified=!1,this._edgeInsets.interpolate(u,m,F),this._constrain(),this._calcMatrices()}coveringZoomLevel(u){const m=(u.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/u.tileSize));return Math.max(0,m)}getVisibleUnwrappedCoordinates(u){const m=[new a.b4(0,u)];if(this._renderWorldCopies){const F=this.pointCoordinate(new a.P(0,0)),$=this.pointCoordinate(new a.P(this.width,0)),Z=this.pointCoordinate(new a.P(this.width,this.height)),ie=this.pointCoordinate(new a.P(0,this.height)),he=Math.floor(Math.min(F.x,$.x,Z.x,ie.x)),be=Math.floor(Math.max(F.x,$.x,Z.x,ie.x)),Ce=1;for(let ze=he-Ce;ze<=be+Ce;ze++)ze!==0&&m.push(new a.b4(ze,u))}return m}coveringTiles(u){var m,F;let $=this.coveringZoomLevel(u);const Z=$;if(u.minzoom!==void 0&&$<u.minzoom)return[];u.maxzoom!==void 0&&$>u.maxzoom&&($=u.maxzoom);const ie=this.pointCoordinate(this.getCameraPoint()),he=a.Z.fromLngLat(this.center),be=Math.pow(2,$),Ce=[be*ie.x,be*ie.y,0],ze=[be*he.x,be*he.y,0],$e=Rs.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,$);let nt=u.minzoom||0;!u.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(nt=$);const ct=u.terrain?2/Math.min(this.tileSize,u.tileSize)*this.tileSize:3,pt=At=>({aabb:new ks([At*be,0,0],[(At+1)*be,be,0]),zoom:0,x:0,y:0,wrap:At,fullyVisible:!1}),xt=[],Et=[],Ct=$,Rt=u.reparseOverscaled?Z:$;if(this._renderWorldCopies)for(let At=1;At<=3;At++)xt.push(pt(-At)),xt.push(pt(At));for(xt.push(pt(0));xt.length>0;){const At=xt.pop(),Zt=At.x,Kt=At.y;let Yt=At.fullyVisible;if(!Yt){const Ja=At.aabb.intersects($e);if(Ja===0)continue;Yt=Ja===2}const da=u.terrain?Ce:ze,ba=At.aabb.distanceX(da),Na=At.aabb.distanceY(da),Fa=Math.max(Math.abs(ba),Math.abs(Na)),Ua=ct+(1<<Ct-At.zoom)-2;if(At.zoom===Ct||Fa>Ua&&At.zoom>=nt){const Ja=Ct-At.zoom,yn=Ce[0]-.5-(Zt<<Ja),Qa=Ce[1]-.5-(Kt<<Ja);Et.push({tileID:new a.S(At.zoom===Ct?Rt:At.zoom,At.wrap,At.zoom,Zt,Kt),distanceSq:E([ze[0]-.5-Zt,ze[1]-.5-Kt]),tileDistanceToCamera:Math.sqrt(yn*yn+Qa*Qa)})}else for(let Ja=0;Ja<4;Ja++){const yn=(Zt<<1)+Ja%2,Qa=(Kt<<1)+(Ja>>1),wn=At.zoom+1;let rn=At.aabb.quadrant(Ja);if(u.terrain){const Cn=new a.S(wn,At.wrap,wn,yn,Qa),fn=u.terrain.getMinMaxElevation(Cn),In=(m=fn.minElevation)!==null&&m!==void 0?m:this.elevation,Wn=(F=fn.maxElevation)!==null&&F!==void 0?F:this.elevation;rn=new ks([rn.min[0],rn.min[1],In],[rn.max[0],rn.max[1],Wn])}xt.push({aabb:rn,zoom:wn,x:yn,y:Qa,wrap:At.wrap,fullyVisible:Yt})}}return Et.sort((At,Zt)=>At.distanceSq-Zt.distanceSq).map(At=>At.tileID)}resize(u,m){this.width=u,this.height=m,this.pixelsToGLUnits=[2/u,-2/m],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(u){return Math.pow(2,u)}scaleZoom(u){return Math.log(u)/Math.LN2}project(u){const m=a.ad(u.lat,-85.051129,Tc);return new a.P(a.O(u.lng)*this.worldSize,a.Q(m)*this.worldSize)}unproject(u){return new a.Z(u.x/this.worldSize,u.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(u){const m=this.elevation,F=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,$=this.pointLocation(this.centerPoint,u),Z=u.getElevationForLngLatZoom($,this.tileZoom);if(!(this.elevation-Z))return;const ie=F+m-Z,he=Math.cos(this._pitch)*this.cameraToCenterDistance/ie/a.b5(1,$.lat)/this.tileSize,be=this.scaleZoom(he);this._elevation=Z,this._center=$,this.zoom=be}setLocationAtPoint(u,m){const F=this.pointCoordinate(m),$=this.pointCoordinate(this.centerPoint),Z=this.locationCoordinate(u),ie=new a.Z(Z.x-(F.x-$.x),Z.y-(F.y-$.y));this.center=this.coordinateLocation(ie),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(u,m){return m?this.coordinatePoint(this.locationCoordinate(u),m.getElevationForLngLatZoom(u,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(u))}pointLocation(u,m){return this.coordinateLocation(this.pointCoordinate(u,m))}locationCoordinate(u){return a.Z.fromLngLat(u)}coordinateLocation(u){return u&&u.toLngLat()}pointCoordinate(u,m){if(m){const pt=m.pointCoordinate(u);if(pt!=null)return pt}const F=[u.x,u.y,0,1],$=[u.x,u.y,1,1];a.ag(F,F,this.pixelMatrixInverse),a.ag($,$,this.pixelMatrixInverse);const Z=F[3],ie=$[3],he=F[0]/Z,be=$[0]/ie,Ce=F[1]/Z,ze=$[1]/ie,$e=F[2]/Z,nt=$[2]/ie,ct=$e===nt?0:(0-$e)/(nt-$e);return new a.Z(a.z.number(he,be,ct)/this.worldSize,a.z.number(Ce,ze,ct)/this.worldSize)}coordinatePoint(u,m=0,F=this.pixelMatrix){const $=[u.x*this.worldSize,u.y*this.worldSize,m,1];return a.ag($,$,F),new a.P($[0]/$[3],$[1]/$[3])}getBounds(){const u=Math.max(0,this.height/2-this.getHorizon());return new Ae().extend(this.pointLocation(new a.P(0,u))).extend(this.pointLocation(new a.P(this.width,u))).extend(this.pointLocation(new a.P(this.width,this.height))).extend(this.pointLocation(new a.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new Ae([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(u){u?(this.lngRange=[u.getWest(),u.getEast()],this.latRange=[u.getSouth(),u.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Tc])}calculateTileMatrix(u){const m=u.canonical,F=this.worldSize/this.zoomScale(m.z),$=m.x+Math.pow(2,m.z)*u.wrap,Z=a.ao(new Float64Array(16));return a.J(Z,Z,[$*F,m.y*F,0]),a.K(Z,Z,[F/a.X,F/a.X,1]),Z}calculatePosMatrix(u,m=!1){const F=u.key,$=m?this._alignedPosMatrixCache:this._posMatrixCache;if($[F])return $[F];const Z=this.calculateTileMatrix(u);return a.L(Z,m?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Z),$[F]=new Float32Array(Z),$[F]}calculateFogMatrix(u){const m=u.key,F=this._fogMatrixCache;if(F[m])return F[m];const $=this.calculateTileMatrix(u);return a.L($,this.fogMatrix,$),F[m]=new Float32Array($),F[m]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(u,m){m=a.ad(+m,this.minZoom,this.maxZoom);const F={center:new a.N(u.lng,u.lat),zoom:m};let $=this.lngRange;if(!this._renderWorldCopies&&$===null){const At=179.9999999999;$=[-At,At]}const Z=this.tileSize*this.zoomScale(F.zoom);let ie=0,he=Z,be=0,Ce=Z,ze=0,$e=0;const{x:nt,y:ct}=this.size;if(this.latRange){const At=this.latRange;ie=a.Q(At[1])*Z,he=a.Q(At[0])*Z,he-ie<ct&&(ze=ct/(he-ie))}$&&(be=a.b3(a.O($[0])*Z,0,Z),Ce=a.b3(a.O($[1])*Z,0,Z),Ce<be&&(Ce+=Z),Ce-be<nt&&($e=nt/(Ce-be)));const{x:pt,y:xt}=this.project.call({worldSize:Z},u);let Et,Ct;const Rt=Math.max($e||0,ze||0);if(Rt){const At=new a.P($e?(Ce+be)/2:pt,ze?(he+ie)/2:xt);return F.center=this.unproject.call({worldSize:Z},At).wrap(),F.zoom+=this.scaleZoom(Rt),F}if(this.latRange){const At=ct/2;xt-At<ie&&(Ct=ie+At),xt+At>he&&(Ct=he-At)}if($){const At=(be+Ce)/2;let Zt=pt;this._renderWorldCopies&&(Zt=a.b3(pt,At-Z/2,At+Z/2));const Kt=nt/2;Zt-Kt<be&&(Et=be+Kt),Zt+Kt>Ce&&(Et=Ce-Kt)}if(Et!==void 0||Ct!==void 0){const At=new a.P(Et??pt,Ct??xt);F.center=this.unproject.call({worldSize:Z},At).wrap()}return F}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const u=this._unmodified,{center:m,zoom:F}=this.getConstrained(this.center,this.zoom);this.center=m,this.zoom=F,this._unmodified=u,this._constraining=!1}_calcMatrices(){if(!this.height)return;const u=this._fov/2,m=this.centerOffset,F=this.point.x,$=this.point.y;this.cameraToCenterDistance=.5/Math.tan(u)*this.height,this._pixelPerMeter=a.b5(1,this.center.lat)*this.worldSize;let Z=a.ao(new Float64Array(16));a.K(Z,Z,[this.width/2,-this.height/2,1]),a.J(Z,Z,[1,-1,0]),this.labelPlaneMatrix=Z,Z=a.ao(new Float64Array(16)),a.K(Z,Z,[1,-1,1]),a.J(Z,Z,[-1,-1,0]),a.K(Z,Z,[2/this.width,2/this.height,1]),this.glCoordMatrix=Z;const ie=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),he=Math.min(this.elevation,this.minElevationForCurrentTile),be=ie-he*this._pixelPerMeter/Math.cos(this._pitch),Ce=he<0?be:ie,ze=Math.PI/2+this._pitch,$e=this._fov*(.5+m.y/this.height),nt=Math.sin($e)*Ce/Math.sin(a.ad(Math.PI-ze-$e,.01,Math.PI-.01)),ct=this.getHorizon(),pt=2*Math.atan(ct/this.cameraToCenterDistance)*(.5+m.y/(2*ct)),xt=Math.sin(pt)*Ce/Math.sin(a.ad(Math.PI-ze-pt,.01,Math.PI-.01)),Et=Math.min(nt,xt);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Et+Ce),this.nearZ=this.height/50,Z=new Float64Array(16),a.b6(Z,this._fov,this.width/this.height,this.nearZ,this.farZ),Z[8]=2*-m.x/this.width,Z[9]=2*m.y/this.height,this.projectionMatrix=a.af(Z),a.K(Z,Z,[1,-1,1]),a.J(Z,Z,[0,0,-this.cameraToCenterDistance]),a.b7(Z,Z,this._pitch),a.ae(Z,Z,this.angle),a.J(Z,Z,[-F,-$,0]),this.mercatorMatrix=a.K([],Z,[this.worldSize,this.worldSize,this.worldSize]),a.K(Z,Z,[1,1,this._pixelPerMeter]),this.pixelMatrix=a.L(new Float64Array(16),this.labelPlaneMatrix,Z),a.J(Z,Z,[0,0,-this.elevation]),this.modelViewProjectionMatrix=Z,this.invModelViewProjectionMatrix=a.at([],Z),this.fogMatrix=new Float64Array(16),a.b6(this.fogMatrix,this._fov,this.width/this.height,ie,this.farZ),this.fogMatrix[8]=2*-m.x/this.width,this.fogMatrix[9]=2*m.y/this.height,a.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),a.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),a.b7(this.fogMatrix,this.fogMatrix,this._pitch),a.ae(this.fogMatrix,this.fogMatrix,this.angle),a.J(this.fogMatrix,this.fogMatrix,[-F,-$,0]),a.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),a.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=a.L(new Float64Array(16),this.labelPlaneMatrix,Z);const Ct=this.width%2/2,Rt=this.height%2/2,At=Math.cos(this.angle),Zt=Math.sin(this.angle),Kt=F-Math.round(F)+At*Ct+Zt*Rt,Yt=$-Math.round($)+At*Rt+Zt*Ct,da=new Float64Array(Z);if(a.J(da,da,[Kt>.5?Kt-1:Kt,Yt>.5?Yt-1:Yt,0]),this.alignedModelViewProjectionMatrix=da,Z=a.at(new Float64Array(16),this.pixelMatrix),!Z)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Z,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const u=this.pointCoordinate(new a.P(0,0)),m=[u.x*this.worldSize,u.y*this.worldSize,0,1];return a.ag(m,m,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const u=this._pitch,m=Math.tan(u)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new a.P(0,m))}getCameraQueryGeometry(u){const m=this.getCameraPoint();if(u.length===1)return[u[0],m];{let F=m.x,$=m.y,Z=m.x,ie=m.y;for(const he of u)F=Math.min(F,he.x),$=Math.min($,he.y),Z=Math.max(Z,he.x),ie=Math.max(ie,he.y);return[new a.P(F,$),new a.P(Z,$),new a.P(Z,ie),new a.P(F,ie),new a.P(F,$)]}}lngLatToCameraDepth(u,m){const F=this.locationCoordinate(u),$=[F.x*this.worldSize,F.y*this.worldSize,m,1];return a.ag($,$,this.modelViewProjectionMatrix),$[2]/$[3]}}function Vs(j,u){let m,F=!1,$=null,Z=null;const ie=()=>{$=null,F&&(j.apply(Z,m),$=setTimeout(ie,u),F=!1)};return(...he)=>(F=!0,Z=this,m=he,$||ie(),$)}class ao{constructor(u){this._getCurrentHash=()=>{const m=window.location.hash.replace("#","");if(this._hashName){let F;return m.split("&").map($=>$.split("=")).forEach($=>{$[0]===this._hashName&&(F=$)}),(F&&F[1]||"").split("/")}return m.split("/")},this._onHashChange=()=>{const m=this._getCurrentHash();if(m.length>=3&&!m.some(F=>isNaN(F))){const F=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(m[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+m[2],+m[1]],zoom:+m[0],bearing:F,pitch:+(m[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const m=window.location.href.replace(/(#.+)?$/,this.getHashString());window.history.replaceState(window.history.state,null,m)},this._removeHash=()=>{const m=this._getCurrentHash();if(m.length===0)return;const F=m.join("/");let $=F;$.split("&").length>0&&($=$.split("&")[0]),this._hashName&&($=`${this._hashName}=${F}`);let Z=window.location.hash.replace($,"");Z.startsWith("#&")?Z=Z.slice(0,1)+Z.slice(2):Z==="#"&&(Z="");let ie=window.location.href.replace(/(#.+)?$/,Z);ie=ie.replace("&&","&"),window.history.replaceState(window.history.state,null,ie)},this._updateHash=Vs(this._updateHashUnthrottled,300),this._hashName=u&&encodeURIComponent(u)}addTo(u){return this._map=u,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(u){const m=this._map.getCenter(),F=Math.round(100*this._map.getZoom())/100,$=Math.ceil((F*Math.LN2+Math.log(512/360/.5))/Math.LN10),Z=Math.pow(10,$),ie=Math.round(m.lng*Z)/Z,he=Math.round(m.lat*Z)/Z,be=this._map.getBearing(),Ce=this._map.getPitch();let ze="";if(ze+=u?`/${ie}/${he}/${F}`:`${F}/${he}/${ie}`,(be||Ce)&&(ze+="/"+Math.round(10*be)/10),Ce&&(ze+=`/${Math.round(Ce)}`),this._hashName){const $e=this._hashName;let nt=!1;const ct=window.location.hash.slice(1).split("&").map(pt=>{const xt=pt.split("=")[0];return xt===$e?(nt=!0,`${xt}=${ze}`):pt}).filter(pt=>pt);return nt||ct.push(`${$e}=${ze}`),`#${ct.join("&")}`}return`#${ze}`}}const Ho={linearity:.3,easing:a.b8(0,0,.3,1)},di=a.e({deceleration:2500,maxSpeed:1400},Ho),mi=a.e({deceleration:20,maxSpeed:1400},Ho),Ss=a.e({deceleration:1e3,maxSpeed:360},Ho),Ac=a.e({deceleration:1e3,maxSpeed:90},Ho);class cc{constructor(u){this._map=u,this.clear()}clear(){this._inertiaBuffer=[]}record(u){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:c.now(),settings:u})}_drainInertiaBuffer(){const u=this._inertiaBuffer,m=c.now();for(;u.length>0&&m-u[0].time>160;)u.shift()}_onMoveEnd(u){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const m={zoom:0,bearing:0,pitch:0,pan:new a.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:Z}of this._inertiaBuffer)m.zoom+=Z.zoomDelta||0,m.bearing+=Z.bearingDelta||0,m.pitch+=Z.pitchDelta||0,Z.panDelta&&m.pan._add(Z.panDelta),Z.around&&(m.around=Z.around),Z.pinchAround&&(m.pinchAround=Z.pinchAround);const F=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,$={};if(m.pan.mag()){const Z=Wl(m.pan.mag(),F,a.e({},di,u||{}));$.offset=m.pan.mult(Z.amount/m.pan.mag()),$.center=this._map.transform.center,ql($,Z)}if(m.zoom){const Z=Wl(m.zoom,F,mi);$.zoom=this._map.transform.zoom+Z.amount,ql($,Z)}if(m.bearing){const Z=Wl(m.bearing,F,Ss);$.bearing=this._map.transform.bearing+a.ad(Z.amount,-179,179),ql($,Z)}if(m.pitch){const Z=Wl(m.pitch,F,Ac);$.pitch=this._map.transform.pitch+Z.amount,ql($,Z)}if($.zoom||$.bearing){const Z=m.pinchAround===void 0?m.around:m.pinchAround;$.around=Z?this._map.unproject(Z):this._map.getCenter()}return this.clear(),a.e($,{noMoveStart:!0})}}function ql(j,u){(!j.duration||j.duration<u.duration)&&(j.duration=u.duration,j.easing=u.easing)}function Wl(j,u,m){const{maxSpeed:F,linearity:$,deceleration:Z}=m,ie=a.ad(j*$/(u/1e3),-F,F),he=Math.abs(ie)/(Z*$);return{easing:m.easing,duration:1e3*he,amount:ie*(he/2)}}class Eo extends a.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(u,m,F,$={}){const Z=o.mousePos(m.getCanvas(),F),ie=m.unproject(Z);super(u,a.e({point:Z,lngLat:ie,originalEvent:F},$)),this._defaultPrevented=!1,this.target=m}}class _o extends a.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(u,m,F){const $=u==="touchend"?F.changedTouches:F.touches,Z=o.touchPos(m.getCanvasContainer(),$),ie=Z.map(be=>m.unproject(be)),he=Z.reduce((be,Ce,ze,$e)=>be.add(Ce.div($e.length)),new a.P(0,0));super(u,{points:Z,point:he,lngLats:ie,lngLat:m.unproject(he),originalEvent:F}),this._defaultPrevented=!1}}class Qs extends a.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(u,m,F){super(u,{originalEvent:F}),this._defaultPrevented=!1}}class uc{constructor(u,m){this._map=u,this._clickTolerance=m.clickTolerance}reset(){delete this._mousedownPos}wheel(u){return this._firePreventable(new Qs(u.type,this._map,u))}mousedown(u,m){return this._mousedownPos=m,this._firePreventable(new Eo(u.type,this._map,u))}mouseup(u){this._map.fire(new Eo(u.type,this._map,u))}click(u,m){this._mousedownPos&&this._mousedownPos.dist(m)>=this._clickTolerance||this._map.fire(new Eo(u.type,this._map,u))}dblclick(u){return this._firePreventable(new Eo(u.type,this._map,u))}mouseover(u){this._map.fire(new Eo(u.type,this._map,u))}mouseout(u){this._map.fire(new Eo(u.type,this._map,u))}touchstart(u){return this._firePreventable(new _o(u.type,this._map,u))}touchmove(u){this._map.fire(new _o(u.type,this._map,u))}touchend(u){this._map.fire(new _o(u.type,this._map,u))}touchcancel(u){this._map.fire(new _o(u.type,this._map,u))}_firePreventable(u){if(this._map.fire(u),u.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Oo{constructor(u){this._map=u}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(u){this._map.fire(new Eo(u.type,this._map,u))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Eo("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(u){this._delayContextMenu?this._contextMenuEvent=u:this._ignoreContextMenu||this._map.fire(new Eo(u.type,this._map,u)),this._map.listens("contextmenu")&&u.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ei{constructor(u){this._map=u}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(u){return this.transform.pointLocation(a.P.convert(u),this._map.terrain)}}class bo{constructor(u,m){this._map=u,this._tr=new Ei(u),this._el=u.getCanvasContainer(),this._container=u.getContainer(),this._clickTolerance=m.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(u,m){this.isEnabled()&&u.shiftKey&&u.button===0&&(o.disableDrag(),this._startPos=this._lastPos=m,this._active=!0)}mousemoveWindow(u,m){if(!this._active)return;const F=m;if(this._lastPos.equals(F)||!this._box&&F.dist(this._startPos)<this._clickTolerance)return;const $=this._startPos;this._lastPos=F,this._box||(this._box=o.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",u));const Z=Math.min($.x,F.x),ie=Math.max($.x,F.x),he=Math.min($.y,F.y),be=Math.max($.y,F.y);o.setTransform(this._box,`translate(${Z}px,${he}px)`),this._box.style.width=ie-Z+"px",this._box.style.height=be-he+"px"}mouseupWindow(u,m){if(!this._active||u.button!==0)return;const F=this._startPos,$=m;if(this.reset(),o.suppressClick(),F.x!==$.x||F.y!==$.y)return this._map.fire(new a.k("boxzoomend",{originalEvent:u})),{cameraAnimation:Z=>Z.fitScreenCoordinates(F,$,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",u)}keydown(u){this._active&&u.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",u))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(o.remove(this._box),this._box=null),o.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(u,m){return this._map.fire(new a.k(u,{originalEvent:m}))}}function _i(j,u){if(j.length!==u.length)throw new Error(`The number of touches and points are not equal - touches ${j.length}, points ${u.length}`);const m={};for(let F=0;F<j.length;F++)m[j[F].identifier]=u[F];return m}class no{constructor(u){this.reset(),this.numTouches=u.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(u,m,F){(this.centroid||F.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=u.timeStamp),F.length===this.numTouches&&(this.centroid=function($){const Z=new a.P(0,0);for(const ie of $)Z._add(ie);return Z.div($.length)}(m),this.touches=_i(F,m)))}touchmove(u,m,F){if(this.aborted||!this.centroid)return;const $=_i(F,m);for(const Z in this.touches){const ie=this.touches[Z],he=$[Z];(!he||he.dist(ie)>30)&&(this.aborted=!0)}}touchend(u,m,F){if((!this.centroid||u.timeStamp-this.startTime>500)&&(this.aborted=!0),F.length===0){const $=!this.aborted&&this.centroid;if(this.reset(),$)return $}}}class bi{constructor(u){this.singleTap=new no(u),this.numTaps=u.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(u,m,F){this.singleTap.touchstart(u,m,F)}touchmove(u,m,F){this.singleTap.touchmove(u,m,F)}touchend(u,m,F){const $=this.singleTap.touchend(u,m,F);if($){const Z=u.timeStamp-this.lastTime<500,ie=!this.lastTap||this.lastTap.dist($)<30;if(Z&&ie||this.reset(),this.count++,this.lastTime=u.timeStamp,this.lastTap=$,this.count===this.numTaps)return this.reset(),$}}}class uo{constructor(u){this._tr=new Ei(u),this._zoomIn=new bi({numTouches:1,numTaps:2}),this._zoomOut=new bi({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(u,m,F){this._zoomIn.touchstart(u,m,F),this._zoomOut.touchstart(u,m,F)}touchmove(u,m,F){this._zoomIn.touchmove(u,m,F),this._zoomOut.touchmove(u,m,F)}touchend(u,m,F){const $=this._zoomIn.touchend(u,m,F),Z=this._zoomOut.touchend(u,m,F),ie=this._tr;return $?(this._active=!0,u.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:he=>he.easeTo({duration:300,zoom:ie.zoom+1,around:ie.unproject($)},{originalEvent:u})}):Z?(this._active=!0,u.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:he=>he.easeTo({duration:300,zoom:ie.zoom-1,around:ie.unproject(Z)},{originalEvent:u})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class xo{constructor(u){this._enabled=!!u.enable,this._moveStateManager=u.moveStateManager,this._clickTolerance=u.clickTolerance||1,this._moveFunction=u.move,this._activateOnStart=!!u.activateOnStart,u.assignEvents(this),this.reset()}reset(u){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(u)}_move(...u){const m=this._moveFunction(...u);if(m.bearingDelta||m.pitchDelta||m.around||m.panDelta)return this._active=!0,m}dragStart(u,m){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(u)&&(this._moveStateManager.startMove(u),this._lastPoint=m.length?m[0]:m,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(u,m){if(!this.isEnabled())return;const F=this._lastPoint;if(!F)return;if(u.preventDefault(),!this._moveStateManager.isValidMoveEvent(u))return void this.reset(u);const $=m.length?m[0]:m;return!this._moved&&$.dist(F)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=$,this._move(F,$))}dragEnd(u){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(u)&&(this._moved&&o.suppressClick(),this.reset(u))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const el={0:1,2:2};class ns{constructor(u){this._correctEvent=u.checkCorrectEvent}startMove(u){const m=o.mouseButton(u);this._eventButton=m}endMove(u){delete this._eventButton}isValidStartEvent(u){return this._correctEvent(u)}isValidMoveEvent(u){return!function(m,F){const $=el[F];return m.buttons===void 0||(m.buttons&$)!==$}(u,this._eventButton)}isValidEndEvent(u){return o.mouseButton(u)===this._eventButton}}class Fl{constructor(){this._firstTouch=void 0}_isOneFingerTouch(u){return u.targetTouches.length===1}_isSameTouchEvent(u){return u.targetTouches[0].identifier===this._firstTouch}startMove(u){const m=u.targetTouches[0].identifier;this._firstTouch=m}endMove(u){delete this._firstTouch}isValidStartEvent(u){return this._isOneFingerTouch(u)}isValidMoveEvent(u){return this._isOneFingerTouch(u)&&this._isSameTouchEvent(u)}isValidEndEvent(u){return this._isOneFingerTouch(u)&&this._isSameTouchEvent(u)}}const Mo=j=>{j.mousedown=j.dragStart,j.mousemoveWindow=j.dragMove,j.mouseup=j.dragEnd,j.contextmenu=u=>{u.preventDefault()}},Zl=({enable:j,clickTolerance:u,bearingDegreesPerPixelMoved:m=.8})=>{const F=new ns({checkCorrectEvent:$=>o.mouseButton($)===0&&$.ctrlKey||o.mouseButton($)===2});return new xo({clickTolerance:u,move:($,Z)=>({bearingDelta:(Z.x-$.x)*m}),moveStateManager:F,enable:j,assignEvents:Mo})},tl=({enable:j,clickTolerance:u,pitchDegreesPerPixelMoved:m=-.5})=>{const F=new ns({checkCorrectEvent:$=>o.mouseButton($)===0&&$.ctrlKey||o.mouseButton($)===2});return new xo({clickTolerance:u,move:($,Z)=>({pitchDelta:(Z.y-$.y)*m}),moveStateManager:F,enable:j,assignEvents:Mo})};class Cs{constructor(u,m){this._clickTolerance=u.clickTolerance||1,this._map=m,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new a.P(0,0)}_shouldBePrevented(u){return u<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(u,m,F){return this._calculateTransform(u,m,F)}touchmove(u,m,F){if(this._active){if(!this._shouldBePrevented(F.length))return u.preventDefault(),this._calculateTransform(u,m,F);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",u)}}touchend(u,m,F){this._calculateTransform(u,m,F),this._active&&this._shouldBePrevented(F.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(u,m,F){F.length>0&&(this._active=!0);const $=_i(F,m),Z=new a.P(0,0),ie=new a.P(0,0);let he=0;for(const Ce in $){const ze=$[Ce],$e=this._touches[Ce];$e&&(Z._add(ze),ie._add(ze.sub($e)),he++,$[Ce]=ze)}if(this._touches=$,this._shouldBePrevented(he)||!ie.mag())return;const be=ie.div(he);return this._sum._add(be),this._sum.mag()<this._clickTolerance?void 0:{around:Z.div(he),panDelta:be}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ho{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(u,m,F){this._firstTwoTouches||F.length<2||(this._firstTwoTouches=[F[0].identifier,F[1].identifier],this._start([m[0],m[1]]))}touchmove(u,m,F){if(!this._firstTwoTouches)return;u.preventDefault();const[$,Z]=this._firstTwoTouches,ie=xi(F,m,$),he=xi(F,m,Z);if(!ie||!he)return;const be=this._aroundCenter?null:ie.add(he).div(2);return this._move([ie,he],be,u)}touchend(u,m,F){if(!this._firstTwoTouches)return;const[$,Z]=this._firstTwoTouches,ie=xi(F,m,$),he=xi(F,m,Z);ie&&he||(this._active&&o.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(u){this._enabled=!0,this._aroundCenter=!!u&&u.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function xi(j,u,m){for(let F=0;F<j.length;F++)if(j[F].identifier===m)return u[F]}function Ts(j,u){return Math.log(j/u)/Math.LN2}class sr extends ho{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(u){this._startDistance=this._distance=u[0].dist(u[1])}_move(u,m){const F=this._distance;if(this._distance=u[0].dist(u[1]),this._active||!(Math.abs(Ts(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Ts(this._distance,F),pinchAround:m}}}function Ec(j,u){return 180*j.angleWith(u)/Math.PI}class tu extends ho{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(u){this._startVector=this._vector=u[0].sub(u[1]),this._minDiameter=u[0].dist(u[1])}_move(u,m,F){const $=this._vector;if(this._vector=u[0].sub(u[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Ec(this._vector,$),pinchAround:m}}_isBelowThreshold(u){this._minDiameter=Math.min(this._minDiameter,u.mag());const m=25/(Math.PI*this._minDiameter)*360,F=Ec(u,this._startVector);return Math.abs(F)<m}}function al(j){return Math.abs(j.y)>Math.abs(j.x)}class Dl extends ho{constructor(u){super(),this._currentTouchCount=0,this._map=u}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(u,m,F){super.touchstart(u,m,F),this._currentTouchCount=F.length}_start(u){this._lastPoints=u,al(u[0].sub(u[1]))&&(this._valid=!1)}_move(u,m,F){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const $=u[0].sub(this._lastPoints[0]),Z=u[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically($,Z,F.timeStamp),this._valid?(this._lastPoints=u,this._active=!0,{pitchDelta:($.y+Z.y)/2*-.5}):void 0}gestureBeginsVertically(u,m,F){if(this._valid!==void 0)return this._valid;const $=u.mag()>=2,Z=m.mag()>=2;if(!$&&!Z)return;if(!$||!Z)return this._firstMove===void 0&&(this._firstMove=F),F-this._firstMove<100&&void 0;const ie=u.y>0==m.y>0;return al(u)&&al(m)&&ie}}const nl={panStep:100,bearingStep:15,pitchStep:10};class dc{constructor(u){this._tr=new Ei(u);const m=nl;this._panStep=m.panStep,this._bearingStep=m.bearingStep,this._pitchStep=m.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(u){if(u.altKey||u.ctrlKey||u.metaKey)return;let m=0,F=0,$=0,Z=0,ie=0;switch(u.keyCode){case 61:case 107:case 171:case 187:m=1;break;case 189:case 109:case 173:m=-1;break;case 37:u.shiftKey?F=-1:(u.preventDefault(),Z=-1);break;case 39:u.shiftKey?F=1:(u.preventDefault(),Z=1);break;case 38:u.shiftKey?$=1:(u.preventDefault(),ie=-1);break;case 40:u.shiftKey?$=-1:(u.preventDefault(),ie=1);break;default:return}return this._rotationDisabled&&(F=0,$=0),{cameraAnimation:he=>{const be=this._tr;he.easeTo({duration:300,easeId:"keyboardHandler",easing:qn,zoom:m?Math.round(be.zoom)+m*(u.shiftKey?2:1):be.zoom,bearing:be.bearing+F*this._bearingStep,pitch:be.pitch+$*this._pitchStep,offset:[-Z*this._panStep,-ie*this._panStep],center:be.center},{originalEvent:u})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function qn(j){return j*(2-j)}const rs=4.000244140625;class rl{constructor(u,m){this._onTimeout=F=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(F)},this._map=u,this._tr=new Ei(u),this._triggerRenderFrame=m,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(u){this._defaultZoomRate=u}setWheelZoomRate(u){this._wheelZoomRate=u}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(u){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!u&&u.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(u){return!!this._map.cooperativeGestures.isEnabled()&&!(u.ctrlKey||this._map.cooperativeGestures.isBypassed(u))}wheel(u){if(!this.isEnabled())return;if(this._shouldBePrevented(u))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",u);let m=u.deltaMode===WheelEvent.DOM_DELTA_LINE?40*u.deltaY:u.deltaY;const F=c.now(),$=F-(this._lastWheelEventTime||0);this._lastWheelEventTime=F,m!==0&&m%rs==0?this._type="wheel":m!==0&&Math.abs(m)<4?this._type="trackpad":$>400?(this._type=null,this._lastValue=m,this._timeout=setTimeout(this._onTimeout,40,u)):this._type||(this._type=Math.abs($*m)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,m+=this._lastValue)),u.shiftKey&&m&&(m/=4),this._type&&(this._lastWheelEvent=u,this._delta-=m,this._active||this._start(u)),u.preventDefault()}_start(u){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const m=o.mousePos(this._map.getCanvas(),u),F=this._tr;m.y>F.transform.height/2-F.transform.getHorizon()?this._around=a.N.convert(this._aroundCenter?F.center:F.unproject(m)):this._around=a.N.convert(F.center),this._aroundPoint=F.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const u=this._tr.transform;if(this._delta!==0){const be=this._type==="wheel"&&Math.abs(this._delta)>rs?this._wheelZoomRate:this._defaultZoomRate;let Ce=2/(1+Math.exp(-Math.abs(this._delta*be)));this._delta<0&&Ce!==0&&(Ce=1/Ce);const ze=typeof this._targetZoom=="number"?u.zoomScale(this._targetZoom):u.scale;this._targetZoom=Math.min(u.maxZoom,Math.max(u.minZoom,u.scaleZoom(ze*Ce))),this._type==="wheel"&&(this._startZoom=u.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const m=typeof this._targetZoom=="number"?this._targetZoom:u.zoom,F=this._startZoom,$=this._easing;let Z,ie=!1;const he=c.now()-this._lastWheelEventTime;if(this._type==="wheel"&&F&&$&&he){const be=Math.min(he/200,1),Ce=$(be);Z=a.z.number(F,m,Ce),be<1?this._frameId||(this._frameId=!0):ie=!0}else Z=m,ie=!0;return this._active=!0,ie&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ie,zoomDelta:Z-u.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(u){let m=a.b9;if(this._prevEase){const F=this._prevEase,$=(c.now()-F.start)/F.duration,Z=F.easing($+.01)-F.easing($),ie=.27/Math.sqrt(Z*Z+1e-4)*.01,he=Math.sqrt(.0729-ie*ie);m=a.b8(ie,he,.25,1)}return this._prevEase={start:c.now(),duration:u,easing:m},m}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Mi{constructor(u,m){this._clickZoom=u,this._tapZoom=m}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Go{constructor(u){this._tr=new Ei(u),this.reset()}reset(){this._active=!1}dblclick(u,m){return u.preventDefault(),{cameraAnimation:F=>{F.easeTo({duration:300,zoom:this._tr.zoom+(u.shiftKey?-1:1),around:this._tr.unproject(m)},{originalEvent:u})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class il{constructor(){this._tap=new bi({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(u,m,F){if(!this._swipePoint)if(this._tapTime){const $=m[0],Z=u.timeStamp-this._tapTime<500,ie=this._tapPoint.dist($)<30;Z&&ie?F.length>0&&(this._swipePoint=$,this._swipeTouch=F[0].identifier):this.reset()}else this._tap.touchstart(u,m,F)}touchmove(u,m,F){if(this._tapTime){if(this._swipePoint){if(F[0].identifier!==this._swipeTouch)return;const $=m[0],Z=$.y-this._swipePoint.y;return this._swipePoint=$,u.preventDefault(),this._active=!0,{zoomDelta:Z/128}}}else this._tap.touchmove(u,m,F)}touchend(u,m,F){if(this._tapTime)this._swipePoint&&F.length===0&&this.reset();else{const $=this._tap.touchend(u,m,F);$&&(this._tapTime=u.timeStamp,this._tapPoint=$)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class As{constructor(u,m,F){this._el=u,this._mousePan=m,this._touchPan=F}enable(u){this._inertiaOptions=u||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Lo{constructor(u,m,F){this._pitchWithRotate=u.pitchWithRotate,this._mouseRotate=m,this._mousePitch=F}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class ol{constructor(u,m,F,$){this._el=u,this._touchZoom=m,this._touchRotate=F,this._tapDragZoom=$,this._rotationDisabled=!1,this._enabled=!0}enable(u){this._touchZoom.enable(u),this._rotationDisabled||this._touchRotate.enable(u),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class ds{constructor(u,m){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=u,this._options=m,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const u=this._map.getCanvasContainer();u.classList.add("maplibregl-cooperative-gestures"),this._container=o.create("div","maplibregl-cooperative-gesture-screen",u);let m=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(m=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const F=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),$=document.createElement("div");$.className="maplibregl-desktop-message",$.textContent=m,this._container.appendChild($);const Z=document.createElement("div");Z.className="maplibregl-mobile-message",Z.textContent=F,this._container.appendChild(Z),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(o.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(u){return u[this._bypassKey]}notifyGestureBlocked(u,m){this._enabled&&(this._map.fire(new a.k("cooperativegestureprevented",{gestureType:u,originalEvent:m})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const qo=j=>j.zoom||j.drag||j.pitch||j.rotate;class Es extends a.k{}function nr(j){return j.panDelta&&j.panDelta.mag()||j.zoomDelta||j.bearingDelta||j.pitchDelta}class si{constructor(u,m){this.handleWindowEvent=$=>{this.handleEvent($,`${$.type}Window`)},this.handleEvent=($,Z)=>{if($.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const ie=$.type==="renderFrame"?void 0:$,he={needsRenderFrame:!1},be={},Ce={},ze=$.touches,$e=ze?this._getMapTouches(ze):void 0,nt=$e?o.touchPos(this._map.getCanvas(),$e):o.mousePos(this._map.getCanvas(),$);for(const{handlerName:xt,handler:Et,allowed:Ct}of this._handlers){if(!Et.isEnabled())continue;let Rt;this._blockedByActive(Ce,Ct,xt)?Et.reset():Et[Z||$.type]&&(Rt=Et[Z||$.type]($,nt,$e),this.mergeHandlerResult(he,be,Rt,xt,ie),Rt&&Rt.needsRenderFrame&&this._triggerRenderFrame()),(Rt||Et.isActive())&&(Ce[xt]=Et)}const ct={};for(const xt in this._previousActiveHandlers)Ce[xt]||(ct[xt]=ie);this._previousActiveHandlers=Ce,(Object.keys(ct).length||nr(he))&&(this._changes.push([he,be,ct]),this._triggerRenderFrame()),(Object.keys(Ce).length||nr(he))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:pt}=he;pt&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],pt(this._map))},this._map=u,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new cc(u),this._bearingSnap=m.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(m);const F=this._el;this._listeners=[[F,"touchstart",{passive:!0}],[F,"touchmove",{passive:!1}],[F,"touchend",void 0],[F,"touchcancel",void 0],[F,"mousedown",void 0],[F,"mousemove",void 0],[F,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[F,"mouseover",void 0],[F,"mouseout",void 0],[F,"dblclick",void 0],[F,"click",void 0],[F,"keydown",{capture:!1}],[F,"keyup",void 0],[F,"wheel",{passive:!1}],[F,"contextmenu",void 0],[window,"blur",void 0]];for(const[$,Z,ie]of this._listeners)o.addEventListener($,Z,$===document?this.handleWindowEvent:this.handleEvent,ie)}destroy(){for(const[u,m,F]of this._listeners)o.removeEventListener(u,m,u===document?this.handleWindowEvent:this.handleEvent,F)}_addDefaultHandlers(u){const m=this._map,F=m.getCanvasContainer();this._add("mapEvent",new uc(m,u));const $=m.boxZoom=new bo(m,u);this._add("boxZoom",$),u.interactive&&u.boxZoom&&$.enable();const Z=m.cooperativeGestures=new ds(m,u.cooperativeGestures);this._add("cooperativeGestures",Z),u.cooperativeGestures&&Z.enable();const ie=new uo(m),he=new Go(m);m.doubleClickZoom=new Mi(he,ie),this._add("tapZoom",ie),this._add("clickZoom",he),u.interactive&&u.doubleClickZoom&&m.doubleClickZoom.enable();const be=new il;this._add("tapDragZoom",be);const Ce=m.touchPitch=new Dl(m);this._add("touchPitch",Ce),u.interactive&&u.touchPitch&&m.touchPitch.enable(u.touchPitch);const ze=Zl(u),$e=tl(u);m.dragRotate=new Lo(u,ze,$e),this._add("mouseRotate",ze,["mousePitch"]),this._add("mousePitch",$e,["mouseRotate"]),u.interactive&&u.dragRotate&&m.dragRotate.enable();const nt=(({enable:Rt,clickTolerance:At})=>{const Zt=new ns({checkCorrectEvent:Kt=>o.mouseButton(Kt)===0&&!Kt.ctrlKey});return new xo({clickTolerance:At,move:(Kt,Yt)=>({around:Yt,panDelta:Yt.sub(Kt)}),activateOnStart:!0,moveStateManager:Zt,enable:Rt,assignEvents:Mo})})(u),ct=new Cs(u,m);m.dragPan=new As(F,nt,ct),this._add("mousePan",nt),this._add("touchPan",ct,["touchZoom","touchRotate"]),u.interactive&&u.dragPan&&m.dragPan.enable(u.dragPan);const pt=new tu,xt=new sr;m.touchZoomRotate=new ol(F,xt,pt,be),this._add("touchRotate",pt,["touchPan","touchZoom"]),this._add("touchZoom",xt,["touchPan","touchRotate"]),u.interactive&&u.touchZoomRotate&&m.touchZoomRotate.enable(u.touchZoomRotate);const Et=m.scrollZoom=new rl(m,()=>this._triggerRenderFrame());this._add("scrollZoom",Et,["mousePan"]),u.interactive&&u.scrollZoom&&m.scrollZoom.enable(u.scrollZoom);const Ct=m.keyboard=new dc(m);this._add("keyboard",Ct),u.interactive&&u.keyboard&&m.keyboard.enable(),this._add("blockableMapEvent",new Oo(m))}_add(u,m,F){this._handlers.push({handlerName:u,handler:m,allowed:F}),this._handlersById[u]=m}stop(u){if(!this._updatingCamera){for(const{handler:m}of this._handlers)m.reset();this._inertia.clear(),this._fireEvents({},{},u),this._changes=[]}}isActive(){for(const{handler:u}of this._handlers)if(u.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!qo(this._eventsInProgress)||this.isZooming()}_blockedByActive(u,m,F){for(const $ in u)if($!==F&&(!m||m.indexOf($)<0))return!0;return!1}_getMapTouches(u){const m=[];for(const F of u){const $=F.target;this._el.contains($)&&m.push(F)}return m}mergeHandlerResult(u,m,F,$,Z){if(!F)return;a.e(u,F);const ie={handlerName:$,originalEvent:F.originalEvent||Z};F.zoomDelta!==void 0&&(m.zoom=ie),F.panDelta!==void 0&&(m.drag=ie),F.pitchDelta!==void 0&&(m.pitch=ie),F.bearingDelta!==void 0&&(m.rotate=ie)}_applyChanges(){const u={},m={},F={};for(const[$,Z,ie]of this._changes)$.panDelta&&(u.panDelta=(u.panDelta||new a.P(0,0))._add($.panDelta)),$.zoomDelta&&(u.zoomDelta=(u.zoomDelta||0)+$.zoomDelta),$.bearingDelta&&(u.bearingDelta=(u.bearingDelta||0)+$.bearingDelta),$.pitchDelta&&(u.pitchDelta=(u.pitchDelta||0)+$.pitchDelta),$.around!==void 0&&(u.around=$.around),$.pinchAround!==void 0&&(u.pinchAround=$.pinchAround),$.noInertia&&(u.noInertia=$.noInertia),a.e(m,Z),a.e(F,ie);this._updateMapTransform(u,m,F),this._changes=[]}_updateMapTransform(u,m,F){const $=this._map,Z=$._getTransformForUpdate(),ie=$.terrain;if(!(nr(u)||ie&&this._terrainMovement))return this._fireEvents(m,F,!0);let{panDelta:he,zoomDelta:be,bearingDelta:Ce,pitchDelta:ze,around:$e,pinchAround:nt}=u;nt!==void 0&&($e=nt),$._stop(!0),$e=$e||$.transform.centerPoint;const ct=Z.pointLocation(he?$e.sub(he):$e);Ce&&(Z.bearing+=Ce),ze&&(Z.pitch+=ze),be&&(Z.zoom+=be),ie?this._terrainMovement||!m.drag&&!m.zoom?m.drag&&this._terrainMovement?Z.center=Z.pointLocation(Z.centerPoint.sub(he)):Z.setLocationAtPoint(ct,$e):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Z.setLocationAtPoint(ct,$e)):Z.setLocationAtPoint(ct,$e),$._applyUpdatedTransform(Z),this._map._update(),u.noInertia||this._inertia.record(u),this._fireEvents(m,F,!0)}_fireEvents(u,m,F){const $=qo(this._eventsInProgress),Z=qo(u),ie={};for(const $e in u){const{originalEvent:nt}=u[$e];this._eventsInProgress[$e]||(ie[`${$e}start`]=nt),this._eventsInProgress[$e]=u[$e]}!$&&Z&&this._fireEvent("movestart",Z.originalEvent);for(const $e in ie)this._fireEvent($e,ie[$e]);Z&&this._fireEvent("move",Z.originalEvent);for(const $e in u){const{originalEvent:nt}=u[$e];this._fireEvent($e,nt)}const he={};let be;for(const $e in this._eventsInProgress){const{handlerName:nt,originalEvent:ct}=this._eventsInProgress[$e];this._handlersById[nt].isActive()||(delete this._eventsInProgress[$e],be=m[nt]||ct,he[`${$e}end`]=be)}for(const $e in he)this._fireEvent($e,he[$e]);const Ce=qo(this._eventsInProgress),ze=($||Z)&&!Ce;if(ze&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const $e=this._map._getTransformForUpdate();$e.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform($e)}if(F&&ze){this._updatingCamera=!0;const $e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),nt=ct=>ct!==0&&-this._bearingSnap<ct&&ct<this._bearingSnap;!$e||!$e.essential&&c.prefersReducedMotion?(this._map.fire(new a.k("moveend",{originalEvent:be})),nt(this._map.getBearing())&&this._map.resetNorth()):(nt($e.bearing||this._map.getBearing())&&($e.bearing=0),$e.freezeElevation=!0,this._map.easeTo($e,{originalEvent:be})),this._updatingCamera=!1}}_fireEvent(u,m){this._map.fire(new a.k(u,m?{originalEvent:m}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(u=>{delete this._frameId,this.handleEvent(new Es("renderFrame",{timeStamp:u})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class ro extends a.E{constructor(u,m){super(),this._renderFrameCallback=()=>{const F=Math.min((c.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(F)),F<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=u,this._bearingSnap=m.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new a.N(this.transform.center.lng,this.transform.center.lat)}setCenter(u,m){return this.jumpTo({center:u},m)}panBy(u,m,F){return u=a.P.convert(u).mult(-1),this.panTo(this.transform.center,a.e({offset:u},m),F)}panTo(u,m,F){return this.easeTo(a.e({center:u},m),F)}getZoom(){return this.transform.zoom}setZoom(u,m){return this.jumpTo({zoom:u},m),this}zoomTo(u,m,F){return this.easeTo(a.e({zoom:u},m),F)}zoomIn(u,m){return this.zoomTo(this.getZoom()+1,u,m),this}zoomOut(u,m){return this.zoomTo(this.getZoom()-1,u,m),this}getBearing(){return this.transform.bearing}setBearing(u,m){return this.jumpTo({bearing:u},m),this}getPadding(){return this.transform.padding}setPadding(u,m){return this.jumpTo({padding:u},m),this}rotateTo(u,m,F){return this.easeTo(a.e({bearing:u},m),F)}resetNorth(u,m){return this.rotateTo(0,a.e({duration:1e3},u),m),this}resetNorthPitch(u,m){return this.easeTo(a.e({bearing:0,pitch:0,duration:1e3},u),m),this}snapToNorth(u,m){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(u,m):this}getPitch(){return this.transform.pitch}setPitch(u,m){return this.jumpTo({pitch:u},m),this}cameraForBounds(u,m){u=Ae.convert(u);const F=m&&m.bearing||0;return this._cameraForBoxAndBearing(u.getNorthWest(),u.getSouthEast(),F,m)}_cameraForBoxAndBearing(u,m,F,$){const Z={top:0,bottom:0,right:0,left:0};if(typeof($=a.e({padding:Z,offset:[0,0],maxZoom:this.transform.maxZoom},$)).padding=="number"){const yn=$.padding;$.padding={top:yn,bottom:yn,right:yn,left:yn}}$.padding=a.e(Z,$.padding);const ie=this.transform,he=ie.padding,be=new Ae(u,m),Ce=ie.project(be.getNorthWest()),ze=ie.project(be.getNorthEast()),$e=ie.project(be.getSouthEast()),nt=ie.project(be.getSouthWest()),ct=a.ba(-F),pt=Ce.rotate(ct),xt=ze.rotate(ct),Et=$e.rotate(ct),Ct=nt.rotate(ct),Rt=new a.P(Math.max(pt.x,xt.x,Ct.x,Et.x),Math.max(pt.y,xt.y,Ct.y,Et.y)),At=new a.P(Math.min(pt.x,xt.x,Ct.x,Et.x),Math.min(pt.y,xt.y,Ct.y,Et.y)),Zt=Rt.sub(At),Kt=(ie.width-(he.left+he.right+$.padding.left+$.padding.right))/Zt.x,Yt=(ie.height-(he.top+he.bottom+$.padding.top+$.padding.bottom))/Zt.y;if(Yt<0||Kt<0)return void a.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const da=Math.min(ie.scaleZoom(ie.scale*Math.min(Kt,Yt)),$.maxZoom),ba=a.P.convert($.offset),Na=($.padding.left-$.padding.right)/2,Fa=($.padding.top-$.padding.bottom)/2,Ua=new a.P(Na,Fa).rotate(a.ba(F)),Ja=ba.add(Ua).mult(ie.scale/ie.zoomScale(da));return{center:ie.unproject(Ce.add($e).div(2).sub(Ja)),zoom:da,bearing:F}}fitBounds(u,m,F){return this._fitInternal(this.cameraForBounds(u,m),m,F)}fitScreenCoordinates(u,m,F,$,Z){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(a.P.convert(u)),this.transform.pointLocation(a.P.convert(m)),F,$),$,Z)}_fitInternal(u,m,F){return u?(delete(m=a.e(u,m)).padding,m.linear?this.easeTo(m,F):this.flyTo(m,F)):this}jumpTo(u,m){this.stop();const F=this._getTransformForUpdate();let $=!1,Z=!1,ie=!1;return"zoom"in u&&F.zoom!==+u.zoom&&($=!0,F.zoom=+u.zoom),u.center!==void 0&&(F.center=a.N.convert(u.center)),"bearing"in u&&F.bearing!==+u.bearing&&(Z=!0,F.bearing=+u.bearing),"pitch"in u&&F.pitch!==+u.pitch&&(ie=!0,F.pitch=+u.pitch),u.padding==null||F.isPaddingEqual(u.padding)||(F.padding=u.padding),this._applyUpdatedTransform(F),this.fire(new a.k("movestart",m)).fire(new a.k("move",m)),$&&this.fire(new a.k("zoomstart",m)).fire(new a.k("zoom",m)).fire(new a.k("zoomend",m)),Z&&this.fire(new a.k("rotatestart",m)).fire(new a.k("rotate",m)).fire(new a.k("rotateend",m)),ie&&this.fire(new a.k("pitchstart",m)).fire(new a.k("pitch",m)).fire(new a.k("pitchend",m)),this.fire(new a.k("moveend",m))}calculateCameraOptionsFromTo(u,m,F,$=0){const Z=a.Z.fromLngLat(u,m),ie=a.Z.fromLngLat(F,$),he=ie.x-Z.x,be=ie.y-Z.y,Ce=ie.z-Z.z,ze=Math.hypot(he,be,Ce);if(ze===0)throw new Error("Can't calculate camera options with same From and To");const $e=Math.hypot(he,be),nt=this.transform.scaleZoom(this.transform.cameraToCenterDistance/ze/this.transform.tileSize),ct=180*Math.atan2(he,-be)/Math.PI;let pt=180*Math.acos($e/ze)/Math.PI;return pt=Ce<0?90-pt:90+pt,{center:ie.toLngLat(),zoom:nt,pitch:pt,bearing:ct}}easeTo(u,m){var F;this._stop(!1,u.easeId),((u=a.e({offset:[0,0],duration:500,easing:a.b9},u)).animate===!1||!u.essential&&c.prefersReducedMotion)&&(u.duration=0);const $=this._getTransformForUpdate(),Z=$.zoom,ie=$.bearing,he=$.pitch,be=$.padding,Ce="bearing"in u?this._normalizeBearing(u.bearing,ie):ie,ze="pitch"in u?+u.pitch:he,$e="padding"in u?u.padding:$.padding,nt=a.P.convert(u.offset);let ct=$.centerPoint.add(nt);const pt=$.pointLocation(ct),{center:xt,zoom:Et}=$.getConstrained(a.N.convert(u.center||pt),(F=u.zoom)!==null&&F!==void 0?F:Z);this._normalizeCenter(xt,$);const Ct=$.project(pt),Rt=$.project(xt).sub(Ct),At=$.zoomScale(Et-Z);let Zt,Kt;u.around&&(Zt=a.N.convert(u.around),Kt=$.locationPoint(Zt));const Yt={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||Et!==Z,this._rotating=this._rotating||ie!==Ce,this._pitching=this._pitching||ze!==he,this._padding=!$.isPaddingEqual($e),this._easeId=u.easeId,this._prepareEase(m,u.noMoveStart,Yt),this.terrain&&this._prepareElevation(xt),this._ease(da=>{if(this._zooming&&($.zoom=a.z.number(Z,Et,da)),this._rotating&&($.bearing=a.z.number(ie,Ce,da)),this._pitching&&($.pitch=a.z.number(he,ze,da)),this._padding&&($.interpolatePadding(be,$e,da),ct=$.centerPoint.add(nt)),this.terrain&&!u.freezeElevation&&this._updateElevation(da),Zt)$.setLocationAtPoint(Zt,Kt);else{const ba=$.zoomScale($.zoom-Z),Na=Et>Z?Math.min(2,At):Math.max(.5,At),Fa=Math.pow(Na,1-da),Ua=$.unproject(Ct.add(Rt.mult(da*Fa)).mult(ba));$.setLocationAtPoint($.renderWorldCopies?Ua.wrap():Ua,ct)}this._applyUpdatedTransform($),this._fireMoveEvents(m)},da=>{this.terrain&&u.freezeElevation&&this._finalizeElevation(),this._afterEase(m,da)},u),this}_prepareEase(u,m,F={}){this._moving=!0,m||F.moving||this.fire(new a.k("movestart",u)),this._zooming&&!F.zooming&&this.fire(new a.k("zoomstart",u)),this._rotating&&!F.rotating&&this.fire(new a.k("rotatestart",u)),this._pitching&&!F.pitching&&this.fire(new a.k("pitchstart",u))}_prepareElevation(u){this._elevationCenter=u,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(u,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(u){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const m=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(u<1&&m!==this._elevationTarget){const F=this._elevationTarget-this._elevationStart,$=(m-(F*u+this._elevationStart))/(1-u);this._elevationStart+=u*(F-$),this._elevationTarget=m}this.transform.elevation=a.z.number(this._elevationStart,this._elevationTarget,u)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(u){const m=u.getCameraPosition(),F=this.terrain.getElevationForLngLatZoom(m.lngLat,u.zoom);if(m.altitude<F){const $=this.calculateCameraOptionsFromTo(m.lngLat,F,u.center,u.elevation);return{pitch:$.pitch,zoom:$.zoom}}return{}}_applyUpdatedTransform(u){const m=[];if(this.terrain&&m.push($=>this._elevateCameraIfInsideTerrain($)),this.transformCameraUpdate&&m.push($=>this.transformCameraUpdate($)),!m.length)return;const F=u.clone();for(const $ of m){const Z=F.clone(),{center:ie,zoom:he,pitch:be,bearing:Ce,elevation:ze}=$(Z);ie&&(Z.center=ie),he!==void 0&&(Z.zoom=he),be!==void 0&&(Z.pitch=be),Ce!==void 0&&(Z.bearing=Ce),ze!==void 0&&(Z.elevation=ze),F.apply(Z)}this.transform.apply(F)}_fireMoveEvents(u){this.fire(new a.k("move",u)),this._zooming&&this.fire(new a.k("zoom",u)),this._rotating&&this.fire(new a.k("rotate",u)),this._pitching&&this.fire(new a.k("pitch",u))}_afterEase(u,m){if(this._easeId&&m&&this._easeId===m)return;delete this._easeId;const F=this._zooming,$=this._rotating,Z=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,F&&this.fire(new a.k("zoomend",u)),$&&this.fire(new a.k("rotateend",u)),Z&&this.fire(new a.k("pitchend",u)),this.fire(new a.k("moveend",u))}flyTo(u,m){var F;if(!u.essential&&c.prefersReducedMotion){const rn=a.M(u,["center","zoom","bearing","pitch","around"]);return this.jumpTo(rn,m)}this.stop(),u=a.e({offset:[0,0],speed:1.2,curve:1.42,easing:a.b9},u);const $=this._getTransformForUpdate(),Z=$.zoom,ie=$.bearing,he=$.pitch,be=$.padding,Ce="bearing"in u?this._normalizeBearing(u.bearing,ie):ie,ze="pitch"in u?+u.pitch:he,$e="padding"in u?u.padding:$.padding,nt=a.P.convert(u.offset);let ct=$.centerPoint.add(nt);const pt=$.pointLocation(ct),{center:xt,zoom:Et}=$.getConstrained(a.N.convert(u.center||pt),(F=u.zoom)!==null&&F!==void 0?F:Z);this._normalizeCenter(xt,$);const Ct=$.zoomScale(Et-Z),Rt=$.project(pt),At=$.project(xt).sub(Rt);let Zt=u.curve;const Kt=Math.max($.width,$.height),Yt=Kt/Ct,da=At.mag();if("minZoom"in u){const rn=a.ad(Math.min(u.minZoom,Z,Et),$.minZoom,$.maxZoom),Cn=Kt/$.zoomScale(rn-Z);Zt=Math.sqrt(Cn/da*2)}const ba=Zt*Zt;function Na(rn){const Cn=(Yt*Yt-Kt*Kt+(rn?-1:1)*ba*ba*da*da)/(2*(rn?Yt:Kt)*ba*da);return Math.log(Math.sqrt(Cn*Cn+1)-Cn)}function Fa(rn){return(Math.exp(rn)-Math.exp(-rn))/2}function Ua(rn){return(Math.exp(rn)+Math.exp(-rn))/2}const Ja=Na(!1);let yn=function(rn){return Ua(Ja)/Ua(Ja+Zt*rn)},Qa=function(rn){return Kt*((Ua(Ja)*(Fa(Cn=Ja+Zt*rn)/Ua(Cn))-Fa(Ja))/ba)/da;var Cn},wn=(Na(!0)-Ja)/Zt;if(Math.abs(da)<1e-6||!isFinite(wn)){if(Math.abs(Kt-Yt)<1e-6)return this.easeTo(u,m);const rn=Yt<Kt?-1:1;wn=Math.abs(Math.log(Yt/Kt))/Zt,Qa=()=>0,yn=Cn=>Math.exp(rn*Zt*Cn)}if("duration"in u)u.duration=+u.duration;else{const rn="screenSpeed"in u?+u.screenSpeed/Zt:+u.speed;u.duration=1e3*wn/rn}return u.maxDuration&&u.duration>u.maxDuration&&(u.duration=0),this._zooming=!0,this._rotating=ie!==Ce,this._pitching=ze!==he,this._padding=!$.isPaddingEqual($e),this._prepareEase(m,!1),this.terrain&&this._prepareElevation(xt),this._ease(rn=>{const Cn=rn*wn,fn=1/yn(Cn);$.zoom=rn===1?Et:Z+$.scaleZoom(fn),this._rotating&&($.bearing=a.z.number(ie,Ce,rn)),this._pitching&&($.pitch=a.z.number(he,ze,rn)),this._padding&&($.interpolatePadding(be,$e,rn),ct=$.centerPoint.add(nt)),this.terrain&&!u.freezeElevation&&this._updateElevation(rn);const In=rn===1?xt:$.unproject(Rt.add(At.mult(Qa(Cn))).mult(fn));$.setLocationAtPoint($.renderWorldCopies?In.wrap():In,ct),this._applyUpdatedTransform($),this._fireMoveEvents(m)},()=>{this.terrain&&u.freezeElevation&&this._finalizeElevation(),this._afterEase(m)},u),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(u,m){var F;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const $=this._onEaseEnd;delete this._onEaseEnd,$.call(this,m)}return u||(F=this.handlers)===null||F===void 0||F.stop(!1),this}_ease(u,m,F){F.animate===!1||F.duration===0?(u(1),m()):(this._easeStart=c.now(),this._easeOptions=F,this._onEaseFrame=u,this._onEaseEnd=m,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(u,m){u=a.b3(u,-180,180);const F=Math.abs(u-m);return Math.abs(u-360-m)<F&&(u-=360),Math.abs(u+360-m)<F&&(u+=360),u}_normalizeCenter(u,m){if(!m.renderWorldCopies||m.lngRange)return;const F=u.lng-m.center.lng;u.lng+=F>180?-360:F<-180?360:0}queryTerrainElevation(u){return this.terrain?this.terrain.getElevationForLngLatZoom(a.N.convert(u),this.transform.tileZoom)-this.transform.elevation:null}}const zo={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class is{constructor(u=zo){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=m=>{!m||m.sourceDataType!=="metadata"&&m.sourceDataType!=="visibility"&&m.dataType!=="style"&&m.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=u}getDefaultPosition(){return"bottom-right"}onAdd(u){return this._map=u,this._compact=this.options.compact,this._container=o.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=o.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){o.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(u,m){const F=this._map._getUIString(`AttributionControl.${m}`);u.title=F,u.setAttribute("aria-label",F)}_updateAttributions(){if(!this._map.style)return;let u=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?u=u.concat(this.options.customAttribution.map($=>typeof $!="string"?"":$)):typeof this.options.customAttribution=="string"&&u.push(this.options.customAttribution)),this._map.style.stylesheet){const $=this._map.style.stylesheet;this.styleOwner=$.owner,this.styleId=$.id}const m=this._map.style.sourceCaches;for(const $ in m){const Z=m[$];if(Z.used||Z.usedForTerrain){const ie=Z.getSource();ie.attribution&&u.indexOf(ie.attribution)<0&&u.push(ie.attribution)}}u=u.filter($=>String($).trim()),u.sort(($,Z)=>$.length-Z.length),u=u.filter(($,Z)=>{for(let ie=Z+1;ie<u.length;ie++)if(u[ie].indexOf($)>=0)return!1;return!0});const F=u.join(" | ");F!==this._attribHTML&&(this._attribHTML=F,u.length?(this._innerContainer.innerHTML=F,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class po{constructor(u={}){this._updateCompact=()=>{const m=this._container.children;if(m.length){const F=m[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&F.classList.add("maplibregl-compact"):F.classList.remove("maplibregl-compact")}},this.options=u}getDefaultPosition(){return"bottom-left"}onAdd(u){this._map=u,this._compact=this.options&&this.options.compact,this._container=o.create("div","maplibregl-ctrl");const m=o.create("a","maplibregl-ctrl-logo");return m.target="_blank",m.rel="noopener nofollow",m.href="https://maplibre.org/",m.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),m.setAttribute("rel","noopener nofollow"),this._container.appendChild(m),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){o.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Mc{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(u){const m=++this._id;return this._queue.push({callback:u,id:m,cancelled:!1}),m}remove(u){const m=this._currentlyRunning,F=m?this._queue.concat(m):this._queue;for(const $ of F)if($.id===u)return void($.cancelled=!0)}run(u=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const m=this._currentlyRunning=this._queue;this._queue=[];for(const F of m)if(!F.cancelled&&(F.callback(u),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var er=a.Y([{name:"a_pos3d",type:"Int16",components:3}]);class No extends a.E{constructor(u){super(),this.sourceCache=u,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,u.usedForTerrain=!0,u.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(u,m){this.sourceCache.update(u,m),this._renderableTilesKeys=[];const F={};for(const $ of u.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:m}))F[$.key]=!0,this._renderableTilesKeys.push($.key),this._tiles[$.key]||($.posMatrix=new Float64Array(16),a.aQ($.posMatrix,0,a.X,0,a.X,0,1),this._tiles[$.key]=new we($,this.tileSize));for(const $ in this._tiles)F[$]||delete this._tiles[$]}freeRtt(u){for(const m in this._tiles){const F=this._tiles[m];(!u||F.tileID.equals(u)||F.tileID.isChildOf(u)||u.isChildOf(F.tileID))&&(F.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(u=>this.getTileByID(u))}getTileByID(u){return this._tiles[u]}getTerrainCoords(u){const m={};for(const F of this._renderableTilesKeys){const $=this._tiles[F].tileID;if($.canonical.equals(u.canonical)){const Z=u.clone();Z.posMatrix=new Float64Array(16),a.aQ(Z.posMatrix,0,a.X,0,a.X,0,1),m[F]=Z}else if($.canonical.isChildOf(u.canonical)){const Z=u.clone();Z.posMatrix=new Float64Array(16);const ie=$.canonical.z-u.canonical.z,he=$.canonical.x-($.canonical.x>>ie<<ie),be=$.canonical.y-($.canonical.y>>ie<<ie),Ce=a.X>>ie;a.aQ(Z.posMatrix,0,Ce,0,Ce,0,1),a.J(Z.posMatrix,Z.posMatrix,[-he*Ce,-be*Ce,0]),m[F]=Z}else if(u.canonical.isChildOf($.canonical)){const Z=u.clone();Z.posMatrix=new Float64Array(16);const ie=u.canonical.z-$.canonical.z,he=u.canonical.x-(u.canonical.x>>ie<<ie),be=u.canonical.y-(u.canonical.y>>ie<<ie),Ce=a.X>>ie;a.aQ(Z.posMatrix,0,a.X,0,a.X,0,1),a.J(Z.posMatrix,Z.posMatrix,[he*Ce,be*Ce,0]),a.K(Z.posMatrix,Z.posMatrix,[1/2**ie,1/2**ie,0]),m[F]=Z}}return m}getSourceTile(u,m){const F=this.sourceCache._source;let $=u.overscaledZ-this.deltaZoom;if($>F.maxzoom&&($=F.maxzoom),$<F.minzoom)return null;this._sourceTileCache[u.key]||(this._sourceTileCache[u.key]=u.scaledTo($).key);let Z=this.sourceCache.getTileByID(this._sourceTileCache[u.key]);if((!Z||!Z.dem)&&m)for(;$>=F.minzoom&&(!Z||!Z.dem);)Z=this.sourceCache.getTileByID(u.scaledTo($--).key);return Z}tilesAfterTime(u=Date.now()){return Object.values(this._tiles).filter(m=>m.timeAdded>=u)}}class li{constructor(u,m,F){this.painter=u,this.sourceCache=new No(m),this.options=F,this.exaggeration=typeof F.exaggeration=="number"?F.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(u,m,F,$=a.X){var Z;if(!(m>=0&&m<$&&F>=0&&F<$))return 0;const ie=this.getTerrainData(u),he=(Z=ie.tile)===null||Z===void 0?void 0:Z.dem;if(!he)return 0;const be=function(pt,xt,Et){var Ct=xt[0],Rt=xt[1];return pt[0]=Et[0]*Ct+Et[4]*Rt+Et[12],pt[1]=Et[1]*Ct+Et[5]*Rt+Et[13],pt}([],[m/$*a.X,F/$*a.X],ie.u_terrain_matrix),Ce=[be[0]*he.dim,be[1]*he.dim],ze=Math.floor(Ce[0]),$e=Math.floor(Ce[1]),nt=Ce[0]-ze,ct=Ce[1]-$e;return he.get(ze,$e)*(1-nt)*(1-ct)+he.get(ze+1,$e)*nt*(1-ct)+he.get(ze,$e+1)*(1-nt)*ct+he.get(ze+1,$e+1)*nt*ct}getElevationForLngLatZoom(u,m){const{tileID:F,mercatorX:$,mercatorY:Z}=this._getOverscaledTileIDFromLngLatZoom(u,m);return this.getElevation(F,$%a.X,Z%a.X,a.X)}getElevation(u,m,F,$=a.X){return this.getDEMElevation(u,m,F,$)*this.exaggeration}getTerrainData(u){if(!this._emptyDemTexture){const $=this.painter.context,Z=new a.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new L($,Z,$.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new L($,new a.R({width:1,height:1}),$.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind($.gl.NEAREST,$.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=a.ao([])}const m=this.sourceCache.getSourceTile(u,!0);if(m&&m.dem&&(!m.demTexture||m.needsTerrainPrepare)){const $=this.painter.context;m.demTexture=this.painter.getTileTexture(m.dem.stride),m.demTexture?m.demTexture.update(m.dem.getPixels(),{premultiply:!1}):m.demTexture=new L($,m.dem.getPixels(),$.gl.RGBA,{premultiply:!1}),m.demTexture.bind($.gl.NEAREST,$.gl.CLAMP_TO_EDGE),m.needsTerrainPrepare=!1}const F=m&&m+m.tileID.key+u.key;if(F&&!this._demMatrixCache[F]){const $=this.sourceCache.sourceCache._source.maxzoom;let Z=u.canonical.z-m.tileID.canonical.z;u.overscaledZ>u.canonical.z&&(u.canonical.z>=$?Z=u.canonical.z-$:a.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const ie=u.canonical.x-(u.canonical.x>>Z<<Z),he=u.canonical.y-(u.canonical.y>>Z<<Z),be=a.bb(new Float64Array(16),[1/(a.X<<Z),1/(a.X<<Z),0]);a.J(be,be,[ie*a.X,he*a.X,0]),this._demMatrixCache[u.key]={matrix:be,coord:u}}return{u_depth:2,u_terrain:3,u_terrain_dim:m&&m.dem&&m.dem.dim||1,u_terrain_matrix:F?this._demMatrixCache[u.key].matrix:this._emptyDemMatrix,u_terrain_unpack:m&&m.dem&&m.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(m&&m.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:m}}getFramebuffer(u){const m=this.painter,F=m.width/devicePixelRatio,$=m.height/devicePixelRatio;return!this._fbo||this._fbo.width===F&&this._fbo.height===$||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new L(m.context,{width:F,height:$,data:null},m.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(m.context.gl.NEAREST,m.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new L(m.context,{width:F,height:$,data:null},m.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(m.context.gl.NEAREST,m.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=m.context.createFramebuffer(F,$,!0,!1),this._fbo.depthAttachment.set(m.context.createRenderbuffer(m.context.gl.DEPTH_COMPONENT16,F,$))),this._fbo.colorAttachment.set(u==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const u=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const m=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let Z=0,ie=0;Z<this._coordsTextureSize;Z++)for(let he=0;he<this._coordsTextureSize;he++,ie+=4)m[ie+0]=255&he,m[ie+1]=255&Z,m[ie+2]=he>>8<<4|Z>>8,m[ie+3]=0;const F=new a.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(m.buffer)),$=new L(u,F,u.gl.RGBA,{premultiply:!1});return $.bind(u.gl.NEAREST,u.gl.CLAMP_TO_EDGE),this._coordsTexture=$,$}pointCoordinate(u){this.painter.maybeDrawDepthAndCoords(!0);const m=new Uint8Array(4),F=this.painter.context,$=F.gl,Z=Math.round(u.x*this.painter.pixelRatio/devicePixelRatio),ie=Math.round(u.y*this.painter.pixelRatio/devicePixelRatio),he=Math.round(this.painter.height/devicePixelRatio);F.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),$.readPixels(Z,he-ie-1,1,1,$.RGBA,$.UNSIGNED_BYTE,m),F.bindFramebuffer.set(null);const be=m[0]+(m[2]>>4<<8),Ce=m[1]+((15&m[2])<<8),ze=this.coordsIndex[255-m[3]],$e=ze&&this.sourceCache.getTileByID(ze);if(!$e)return null;const nt=this._coordsTextureSize,ct=(1<<$e.tileID.canonical.z)*nt;return new a.Z(($e.tileID.canonical.x*nt+be)/ct+$e.tileID.wrap,($e.tileID.canonical.y*nt+Ce)/ct,this.getElevation($e.tileID,be,Ce,nt))}depthAtPoint(u){const m=new Uint8Array(4),F=this.painter.context,$=F.gl;return F.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),$.readPixels(u.x,this.painter.height/devicePixelRatio-u.y-1,1,1,$.RGBA,$.UNSIGNED_BYTE,m),F.bindFramebuffer.set(null),(m[0]/16777216+m[1]/65536+m[2]/256+m[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;const u=this.painter.context,m=new a.bc,F=new a.aY,$=this.meshSize,Z=a.X/$,ie=$*$;for(let $e=0;$e<=$;$e++)for(let nt=0;nt<=$;nt++)m.emplaceBack(nt*Z,$e*Z,0);for(let $e=0;$e<ie;$e+=$+1)for(let nt=0;nt<$;nt++)F.emplaceBack(nt+$e,$+nt+$e+1,$+nt+$e+2),F.emplaceBack(nt+$e,$+nt+$e+2,nt+$e+1);const he=m.length,be=he+2*($+1);for(const $e of[0,1])for(let nt=0;nt<=$;nt++)for(const ct of[0,1])m.emplaceBack(nt*Z,$e*a.X,ct);for(let $e=0;$e<2*$;$e+=2)F.emplaceBack(be+$e,be+$e+1,be+$e+3),F.emplaceBack(be+$e,be+$e+3,be+$e+2),F.emplaceBack(he+$e,he+$e+3,he+$e+1),F.emplaceBack(he+$e,he+$e+2,he+$e+3);const Ce=m.length,ze=Ce+2*($+1);for(const $e of[0,1])for(let nt=0;nt<=$;nt++)for(const ct of[0,1])m.emplaceBack($e*a.X,nt*Z,ct);for(let $e=0;$e<2*$;$e+=2)F.emplaceBack(Ce+$e,Ce+$e+1,Ce+$e+3),F.emplaceBack(Ce+$e,Ce+$e+3,Ce+$e+2),F.emplaceBack(ze+$e,ze+$e+3,ze+$e+1),F.emplaceBack(ze+$e,ze+$e+2,ze+$e+3);return this._mesh=new sc(u.createVertexBuffer(m,er.members),u.createIndexBuffer(F),a.a0.simpleSegment(0,0,m.length,F.length)),this._mesh}getMeshFrameDelta(u){return 2*Math.PI*a.bd/Math.pow(2,u)/5}getMinTileElevationForLngLatZoom(u,m){var F;const{tileID:$}=this._getOverscaledTileIDFromLngLatZoom(u,m);return(F=this.getMinMaxElevation($).minElevation)!==null&&F!==void 0?F:0}getMinMaxElevation(u){const m=this.getTerrainData(u).tile,F={minElevation:null,maxElevation:null};return m&&m.dem&&(F.minElevation=m.dem.min*this.exaggeration,F.maxElevation=m.dem.max*this.exaggeration),F}_getOverscaledTileIDFromLngLatZoom(u,m){const F=a.Z.fromLngLat(u.wrap()),$=(1<<m)*a.X,Z=F.x*$,ie=F.y*$,he=Math.floor(Z/a.X),be=Math.floor(ie/a.X);return{tileID:new a.S(m,0,m,he,be),mercatorX:Z,mercatorY:ie}}}class Rl{constructor(u,m,F){this._context=u,this._size=m,this._tileSize=F,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const u of this._objects)u.texture.destroy(),u.fbo.destroy()}_createObject(u){const m=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),F=new L(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return F.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),m.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),m.colorAttachment.set(F.texture),{id:u,fbo:m,texture:F,stamp:-1,inUse:!1}}getObjectForId(u){return this._objects[u]}useObject(u){u.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(m=>u.id!==m),this._recentlyUsed.push(u.id)}stampObject(u){u.stamp=++this._stamp}getOrCreateFreeObject(){for(const m of this._recentlyUsed)if(!this._objects[m].inUse)return this._objects[m];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const u=this._createObject(this._objects.length);return this._objects.push(u),u}freeObject(u){u.inUse=!1}freeAllObjects(){for(const u of this._objects)this.freeObject(u)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(u=>!u.inUse)===!1}}const hs={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class js{constructor(u,m){this.painter=u,this.terrain=m,this.pool=new Rl(u.context,30,m.sourceCache.tileSize*m.qualityFactor)}destruct(){this.pool.destruct()}getTexture(u){return this.pool.getObjectForId(u.rtt[this._stacks.length-1].id).texture}prepareForRender(u,m){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=u._order.filter(F=>!u._layers[F].isHidden(m)),this._coordsDescendingInv={};for(const F in u.sourceCaches){this._coordsDescendingInv[F]={};const $=u.sourceCaches[F].getVisibleCoordinates();for(const Z of $){const ie=this.terrain.sourceCache.getTerrainCoords(Z);for(const he in ie)this._coordsDescendingInv[F][he]||(this._coordsDescendingInv[F][he]=[]),this._coordsDescendingInv[F][he].push(ie[he])}}this._coordsDescendingInvStr={};for(const F of u._order){const $=u._layers[F],Z=$.source;if(hs[$.type]&&!this._coordsDescendingInvStr[Z]){this._coordsDescendingInvStr[Z]={};for(const ie in this._coordsDescendingInv[Z])this._coordsDescendingInvStr[Z][ie]=this._coordsDescendingInv[Z][ie].map(he=>he.key).sort().join()}}for(const F of this._renderableTiles)for(const $ in this._coordsDescendingInvStr){const Z=this._coordsDescendingInvStr[$][F.tileID.key];Z&&Z!==F.rttCoords[$]&&(F.rtt=[])}}renderLayer(u){if(u.isHidden(this.painter.transform.zoom))return!1;const m=u.type,F=this.painter,$=this._renderableLayerIds[this._renderableLayerIds.length-1]===u.id;if(hs[m]&&(this._prevType&&hs[this._prevType]||this._stacks.push([]),this._prevType=m,this._stacks[this._stacks.length-1].push(u.id),!$))return!0;if(hs[this._prevType]||hs[m]&&$){this._prevType=m;const Z=this._stacks.length-1,ie=this._stacks[Z]||[];for(const he of this._renderableTiles){if(this.pool.isFull()&&(oc(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(he),he.rtt[Z]){const Ce=this.pool.getObjectForId(he.rtt[Z].id);if(Ce.stamp===he.rtt[Z].stamp){this.pool.useObject(Ce);continue}}const be=this.pool.getOrCreateFreeObject();this.pool.useObject(be),this.pool.stampObject(be),he.rtt[Z]={id:be.id,stamp:be.stamp},F.context.bindFramebuffer.set(be.fbo.framebuffer),F.context.clear({color:a.aN.transparent,stencil:0}),F.currentStencilSource=void 0;for(let Ce=0;Ce<ie.length;Ce++){const ze=F.style._layers[ie[Ce]],$e=ze.source?this._coordsDescendingInv[ze.source][he.tileID.key]:[he.tileID];F.context.viewport.set([0,0,be.fbo.width,be.fbo.height]),F._renderTileClippingMasks(ze,$e),F.renderLayer(F,F.style.sourceCaches[ze.source],ze,$e),ze.source&&(he.rttCoords[ze.source]=this._coordsDescendingInvStr[ze.source][he.tileID.key])}}return oc(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),hs[m]}return!1}}const jc={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Ic=_,sl={hash:!1,interactive:!0,bearingSnap:7,attributionControl:zo,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:a.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},Bi=j=>{j.touchstart=j.dragStart,j.touchmoveWindow=j.dragMove,j.touchend=j.dragEnd},Ms={showCompass:!0,showZoom:!0,visualizePitch:!1};class Zn{constructor(u,m,F=!1){this.mousedown=ie=>{this.startMouse(a.e({},ie,{ctrlKey:!0,preventDefault:()=>ie.preventDefault()}),o.mousePos(this.element,ie)),o.addEventListener(window,"mousemove",this.mousemove),o.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=ie=>{this.moveMouse(ie,o.mousePos(this.element,ie))},this.mouseup=ie=>{this.mouseRotate.dragEnd(ie),this.mousePitch&&this.mousePitch.dragEnd(ie),this.offTemp()},this.touchstart=ie=>{ie.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=o.touchPos(this.element,ie.targetTouches)[0],this.startTouch(ie,this._startPos),o.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.addEventListener(window,"touchend",this.touchend))},this.touchmove=ie=>{ie.targetTouches.length!==1?this.reset():(this._lastPos=o.touchPos(this.element,ie.targetTouches)[0],this.moveTouch(ie,this._lastPos))},this.touchend=ie=>{ie.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const $=u.dragRotate._mouseRotate.getClickTolerance(),Z=u.dragRotate._mousePitch.getClickTolerance();this.element=m,this.mouseRotate=Zl({clickTolerance:$,enable:!0}),this.touchRotate=(({enable:ie,clickTolerance:he,bearingDegreesPerPixelMoved:be=.8})=>{const Ce=new Fl;return new xo({clickTolerance:he,move:(ze,$e)=>({bearingDelta:($e.x-ze.x)*be}),moveStateManager:Ce,enable:ie,assignEvents:Bi})})({clickTolerance:$,enable:!0}),this.map=u,F&&(this.mousePitch=tl({clickTolerance:Z,enable:!0}),this.touchPitch=(({enable:ie,clickTolerance:he,pitchDegreesPerPixelMoved:be=-.5})=>{const Ce=new Fl;return new xo({clickTolerance:he,move:(ze,$e)=>({pitchDelta:($e.y-ze.y)*be}),moveStateManager:Ce,enable:ie,assignEvents:Bi})})({clickTolerance:Z,enable:!0})),o.addEventListener(m,"mousedown",this.mousedown),o.addEventListener(m,"touchstart",this.touchstart,{passive:!1}),o.addEventListener(m,"touchcancel",this.reset)}startMouse(u,m){this.mouseRotate.dragStart(u,m),this.mousePitch&&this.mousePitch.dragStart(u,m),o.disableDrag()}startTouch(u,m){this.touchRotate.dragStart(u,m),this.touchPitch&&this.touchPitch.dragStart(u,m),o.disableDrag()}moveMouse(u,m){const F=this.map,{bearingDelta:$}=this.mouseRotate.dragMove(u,m)||{};if($&&F.setBearing(F.getBearing()+$),this.mousePitch){const{pitchDelta:Z}=this.mousePitch.dragMove(u,m)||{};Z&&F.setPitch(F.getPitch()+Z)}}moveTouch(u,m){const F=this.map,{bearingDelta:$}=this.touchRotate.dragMove(u,m)||{};if($&&F.setBearing(F.getBearing()+$),this.touchPitch){const{pitchDelta:Z}=this.touchPitch.dragMove(u,m)||{};Z&&F.setPitch(F.getPitch()+Z)}}off(){const u=this.element;o.removeEventListener(u,"mousedown",this.mousedown),o.removeEventListener(u,"touchstart",this.touchstart,{passive:!1}),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend),o.removeEventListener(u,"touchcancel",this.reset),this.offTemp()}offTemp(){o.enableDrag(),o.removeEventListener(window,"mousemove",this.mousemove),o.removeEventListener(window,"mouseup",this.mouseup),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend)}}let gr;function Wo(j,u,m){const F=new a.N(j.lng,j.lat);if(j=new a.N(j.lng,j.lat),u){const $=new a.N(j.lng-360,j.lat),Z=new a.N(j.lng+360,j.lat),ie=m.locationPoint(j).distSqr(u);m.locationPoint($).distSqr(u)<ie?j=$:m.locationPoint(Z).distSqr(u)<ie&&(j=Z)}for(;Math.abs(j.lng-m.center.lng)>180;){const $=m.locationPoint(j);if($.x>=0&&$.y>=0&&$.x<=m.width&&$.y<=m.height)break;j.lng>m.center.lng?j.lng-=360:j.lng+=360}return j.lng!==F.lng&&m.locationPoint(j).y>m.height/2-m.getHorizon()?j:F}const Is={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 ll(j,u,m){const F=j.classList;for(const $ in Is)F.remove(`maplibregl-${m}-anchor-${$}`);F.add(`maplibregl-${m}-anchor-${u}`)}class Fi extends a.E{constructor(u){if(super(),this._onKeyPress=m=>{const F=m.code,$=m.charCode||m.keyCode;F!=="Space"&&F!=="Enter"&&$!==32&&$!==13||this.togglePopup()},this._onMapClick=m=>{const F=m.originalEvent.target,$=this._element;this._popup&&(F===$||$.contains(F))&&this.togglePopup()},this._update=m=>{var F;if(!this._map)return;const $=this._map.loaded()&&!this._map.isMoving();((m==null?void 0:m.type)==="terrain"||(m==null?void 0:m.type)==="render"&&!$)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies?this._lngLat=Wo(this._lngLat,this._flatPos,this._map.transform):this._lngLat=(F=this._lngLat)===null||F===void 0?void 0:F.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let Z="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Z=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Z=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let ie="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?ie="rotateX(0deg)":this._pitchAlignment==="map"&&(ie=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||m&&m.type!=="moveend"||(this._pos=this._pos.round()),o.setTransform(this._element,`${Is[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${ie} ${Z}`),c.frameAsync(new AbortController).then(()=>{this._updateOpacity(m&&m.type==="moveend")}).catch(()=>{})},this._onMove=m=>{if(!this._isDragging){const F=this._clickTolerance||this._map._clickTolerance;this._isDragging=m.point.dist(this._pointerdownPos)>=F}this._isDragging&&(this._pos=m.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 a.k("dragstart"))),this.fire(new a.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new a.k("dragend")),this._state="inactive"},this._addDragHandler=m=>{this._element.contains(m.originalEvent.target)&&(m.preventDefault(),this._positionDelta=m.point.sub(this._pos).add(this._offset),this._pointerdownPos=m.point,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))},this._anchor=u&&u.anchor||"center",this._color=u&&u.color||"#3FB1CE",this._scale=u&&u.scale||1,this._draggable=u&&u.draggable||!1,this._clickTolerance=u&&u.clickTolerance||0,this._subpixelPositioning=u&&u.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=u&&u.rotation||0,this._rotationAlignment=u&&u.rotationAlignment||"auto",this._pitchAlignment=u&&u.pitchAlignment&&u.pitchAlignment!=="auto"?u.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(u==null?void 0:u.opacity,u==null?void 0:u.opacityWhenCovered),u&&u.element)this._element=u.element,this._offset=a.P.convert(u&&u.offset||[0,0]);else{this._defaultMarker=!0,this._element=o.create("div");const m=o.createNS("http://www.w3.org/2000/svg","svg"),F=41,$=27;m.setAttributeNS(null,"display","block"),m.setAttributeNS(null,"height",`${F}px`),m.setAttributeNS(null,"width",`${$}px`),m.setAttributeNS(null,"viewBox",`0 0 ${$} ${F}`);const Z=o.createNS("http://www.w3.org/2000/svg","g");Z.setAttributeNS(null,"stroke","none"),Z.setAttributeNS(null,"stroke-width","1"),Z.setAttributeNS(null,"fill","none"),Z.setAttributeNS(null,"fill-rule","evenodd");const ie=o.createNS("http://www.w3.org/2000/svg","g");ie.setAttributeNS(null,"fill-rule","nonzero");const he=o.createNS("http://www.w3.org/2000/svg","g");he.setAttributeNS(null,"transform","translate(3.0, 29.0)"),he.setAttributeNS(null,"fill","#000000");const be=[{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"}];for(const Ct of be){const Rt=o.createNS("http://www.w3.org/2000/svg","ellipse");Rt.setAttributeNS(null,"opacity","0.04"),Rt.setAttributeNS(null,"cx","10.5"),Rt.setAttributeNS(null,"cy","5.80029008"),Rt.setAttributeNS(null,"rx",Ct.rx),Rt.setAttributeNS(null,"ry",Ct.ry),he.appendChild(Rt)}const Ce=o.createNS("http://www.w3.org/2000/svg","g");Ce.setAttributeNS(null,"fill",this._color);const ze=o.createNS("http://www.w3.org/2000/svg","path");ze.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"),Ce.appendChild(ze);const $e=o.createNS("http://www.w3.org/2000/svg","g");$e.setAttributeNS(null,"opacity","0.25"),$e.setAttributeNS(null,"fill","#000000");const nt=o.createNS("http://www.w3.org/2000/svg","path");nt.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"),$e.appendChild(nt);const ct=o.createNS("http://www.w3.org/2000/svg","g");ct.setAttributeNS(null,"transform","translate(6.0, 7.0)"),ct.setAttributeNS(null,"fill","#FFFFFF");const pt=o.createNS("http://www.w3.org/2000/svg","g");pt.setAttributeNS(null,"transform","translate(8.0, 8.0)");const xt=o.createNS("http://www.w3.org/2000/svg","circle");xt.setAttributeNS(null,"fill","#000000"),xt.setAttributeNS(null,"opacity","0.25"),xt.setAttributeNS(null,"cx","5.5"),xt.setAttributeNS(null,"cy","5.5"),xt.setAttributeNS(null,"r","5.4999962");const Et=o.createNS("http://www.w3.org/2000/svg","circle");Et.setAttributeNS(null,"fill","#FFFFFF"),Et.setAttributeNS(null,"cx","5.5"),Et.setAttributeNS(null,"cy","5.5"),Et.setAttributeNS(null,"r","5.4999962"),pt.appendChild(xt),pt.appendChild(Et),ie.appendChild(he),ie.appendChild(Ce),ie.appendChild($e),ie.appendChild(ct),ie.appendChild(pt),m.appendChild(ie),m.setAttributeNS(null,"height",F*this._scale+"px"),m.setAttributeNS(null,"width",$*this._scale+"px"),this._element.appendChild(m),this._offset=a.P.convert(u&&u.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",m=>{m.preventDefault()}),this._element.addEventListener("mousedown",m=>{m.preventDefault()}),ll(this._element,this._anchor,"marker"),u&&u.className)for(const m of u.className.split(" "))this._element.classList.add(m);this._popup=null}addTo(u){return this.remove(),this._map=u,this._element.setAttribute("aria-label",u._getUIString("Marker.Title")),u.getCanvasContainer().appendChild(this._element),u.on("move",this._update),u.on("moveend",this._update),u.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",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),delete this._map),o.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(u){return this._lngLat=a.N.convert(u),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(u){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),u){if(!("offset"in u.options)){const m=Math.abs(13.5)/Math.SQRT2;u.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[m,-1*(24.6+m)],"bottom-right":[-m,-1*(24.6+m)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=u,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(u){return this._subpixelPositioning=u,this}getPopup(){return this._popup}togglePopup(){const u=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:u?(u.isOpen()?u.remove():(u.setLngLat(this._lngLat),u.addTo(this._map)),this):this}_updateOpacity(u=!1){var m,F;if(!(!((m=this._map)===null||m===void 0)&&m.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(u)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const $=this._map,Z=$.terrain.depthAtPoint(this._pos),ie=$.terrain.getElevationForLngLatZoom(this._lngLat,$.transform.tileZoom);if($.transform.lngLatToCameraDepth(this._lngLat,ie)-Z<.006)return void(this._element.style.opacity=this._opacity);const he=-this._offset.y/$.transform._pixelPerMeter,be=Math.sin($.getPitch()*Math.PI/180)*he,Ce=$.terrain.depthAtPoint(new a.P(this._pos.x,this._pos.y-this._offset.y)),ze=$.transform.lngLatToCameraDepth(this._lngLat,ie+be)-Ce>.006;!((F=this._popup)===null||F===void 0)&&F.isOpen()&&ze&&this._popup.remove(),this._element.style.opacity=ze?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(u){return this._offset=a.P.convert(u),this._update(),this}addClassName(u){this._element.classList.add(u)}removeClassName(u){this._element.classList.remove(u)}toggleClassName(u){return this._element.classList.toggle(u)}setDraggable(u){return this._draggable=!!u,this._map&&(u?(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}isDraggable(){return this._draggable}setRotation(u){return this._rotation=u||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(u){return this._rotationAlignment=u||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(u){return this._pitchAlignment=u&&u!=="auto"?u:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(u,m){return u===void 0&&m===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),u!==void 0&&(this._opacity=u),m!==void 0&&(this._opacityWhenCovered=m),this._map&&this._updateOpacity(!0),this}}const Vl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Qr=0,Yl=!1;class ir extends a.E{constructor(u){super(),this._onSuccess=m=>{if(this._map){if(this._isOutOfMapMaxBounds(m))return this._setErrorState(),this.fire(new a.k("outofmaxbounds",m)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=m,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(m),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(m),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new a.k("geolocate",m)),this._finish()}},this._updateCamera=m=>{const F=new a.N(m.coords.longitude,m.coords.latitude),$=m.coords.accuracy,Z=this._map.getBearing(),ie=a.e({bearing:Z},this.options.fitBoundsOptions),he=Ae.fromLngLat(F,$);this._map.fitBounds(he,ie,{geolocateSource:!0})},this._updateMarker=m=>{if(m){const F=new a.N(m.coords.longitude,m.coords.latitude);this._accuracyCircleMarker.setLngLat(F).addTo(this._map),this._userLocationDotMarker.setLngLat(F).addTo(this._map),this._accuracy=m.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=m=>{if(this._map){if(this.options.trackUserLocation)if(m.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const F=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=F,this._geolocateButton.setAttribute("aria-label",F),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(m.code===3&&Yl)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new a.k("error",m)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",m=>m.preventDefault()),this._geolocateButton=o.create("button","maplibregl-ctrl-geolocate",this._container),o.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=m=>{if(this._map){if(m===!1){a.w("Geolocation support is not available so the GeolocateControl will be disabled.");const F=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=F,this._geolocateButton.setAttribute("aria-label",F)}else{const F=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=F,this._geolocateButton.setAttribute("aria-label",F)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Fi({element:this._dotElement}),this._circleElement=o.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Fi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",F=>{const $=F.originalEvent&&F.originalEvent.type==="resize";F.geolocateSource||this._watchState!=="ACTIVE_LOCK"||$||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new a.k("trackuserlocationend")),this.fire(new a.k("userlocationlostfocus")))})}},this.options=a.e({},Vl,u)}onAdd(u){return this._map=u,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return a._(this,arguments,void 0,function*(m=!1){if(gr!==void 0&&!m)return gr;if(window.navigator.permissions===void 0)return gr=!!window.navigator.geolocation,gr;try{gr=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{gr=!!window.navigator.geolocation}return gr})}().then(m=>this._finishSetupUI(m)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(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(),o.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Qr=0,Yl=!1}_isOutOfMapMaxBounds(u){const m=this._map.getMaxBounds(),F=u.coords;return m&&(F.longitude<m.getWest()||F.longitude>m.getEast()||F.latitude<m.getSouth()||F.latitude>m.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const u=this._map.getBounds(),m=u.getSouthEast(),F=u.getNorthEast(),$=m.distanceTo(F),Z=this._map._container.clientHeight,ie=Math.ceil(this._accuracy/($/Z)*2);this._circleElement.style.width=`${ie}px`,this._circleElement.style.height=`${ie}px`}trigger(){if(!this._setup)return a.w("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 a.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Qr--,Yl=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new a.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new a.k("trackuserlocationstart")),this.fire(new a.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let u;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Qr++,Qr>1?(u={maximumAge:6e5,timeout:0},Yl=!0):(u=this.options.positionOptions,Yl=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,u)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}}const tr={maxWidth:100,unit:"metric"};function Ci(j,u,m){const F=m&&m.maxWidth||100,$=j._container.clientHeight/2,Z=j.unproject([0,$]),ie=j.unproject([F,$]),he=Z.distanceTo(ie);if(m&&m.unit==="imperial"){const be=3.2808*he;be>5280?fo(u,F,be/5280,j._getUIString("ScaleControl.Miles")):fo(u,F,be,j._getUIString("ScaleControl.Feet"))}else m&&m.unit==="nautical"?fo(u,F,he/1852,j._getUIString("ScaleControl.NauticalMiles")):he>=1e3?fo(u,F,he/1e3,j._getUIString("ScaleControl.Kilometers")):fo(u,F,he,j._getUIString("ScaleControl.Meters"))}function fo(j,u,m,F){const $=function(ie){const he=Math.pow(10,`${Math.floor(ie)}`.length-1);let be=ie/he;return be=be>=10?10:be>=5?5:be>=3?3:be>=2?2:be>=1?1:function(Ce){const ze=Math.pow(10,Math.ceil(-Math.log(Ce)/Math.LN10));return Math.round(Ce*ze)/ze}(be),he*be}(m),Z=$/m;j.style.width=u*Z+"px",j.innerHTML=`${$}&nbsp;${F}`}class jl extends a.E{constructor(u={}){super(),this._onFullscreenChange=()=>{var m;let F=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((m=F==null?void 0:F.shadowRoot)===null||m===void 0)&&m.fullscreenElement;)F=F.shadowRoot.fullscreenElement;F===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,u&&u.container&&(u.container instanceof HTMLElement?this._container=u.container:a.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(u){return this._map=u,this._container||(this._container=this._map.getContainer()),this._controlContainer=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){o.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const u=this._fullscreenButton=o.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);o.create("span","maplibregl-ctrl-icon",u).setAttribute("aria-hidden","true"),u.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const u=this._getTitle();this._fullscreenButton.setAttribute("aria-label",u),this._fullscreenButton.title=u}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new a.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new a.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}}const Zo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},yt=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");class wt extends a.E{constructor(u){super(),this.remove=()=>(this._content&&o.remove(this._content),this._container&&(o.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),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new a.k("close"))),this),this._onMouseUp=m=>{this._update(m.point)},this._onMouseMove=m=>{this._update(m.point)},this._onDrag=m=>{this._update(m.point)},this._update=m=>{var F;const $=this._lngLat||this._trackPointer;if(!this._map||!$||!this._content)return;if(!this._container){if(this._container=o.create("div","maplibregl-popup",this._map.getContainer()),this._tip=o.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const Ce of this.options.className.split(" "))this._container.classList.add(Ce);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(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=Wo(this._lngLat,this._flatPos,this._map.transform):this._lngLat=(F=this._lngLat)===null||F===void 0?void 0:F.wrap(),this._trackPointer&&!m)return;const Z=this._flatPos=this._pos=this._trackPointer&&m?m:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&m?m:this._map.transform.locationPoint(this._lngLat));let ie=this.options.anchor;const he=Ot(this.options.offset);if(!ie){const Ce=this._container.offsetWidth,ze=this._container.offsetHeight;let $e;$e=Z.y+he.bottom.y<ze?["top"]:Z.y>this._map.transform.height-ze?["bottom"]:[],Z.x<Ce/2?$e.push("left"):Z.x>this._map.transform.width-Ce/2&&$e.push("right"),ie=$e.length===0?"bottom":$e.join("-")}let be=Z.add(he[ie]);this.options.subpixelPositioning||(be=be.round()),o.setTransform(this._container,`${Is[ie]} translate(${be.x}px,${be.y}px)`),ll(this._container,ie,"popup")},this._onClose=()=>{this.remove()},this.options=a.e(Object.create(Zo),u)}addTo(u){return this._map&&this.remove(),this._map=u,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._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new a.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(u){return this._lngLat=a.N.convert(u),this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(u){return this.setDOMContent(document.createTextNode(u))}setHTML(u){const m=document.createDocumentFragment(),F=document.createElement("body");let $;for(F.innerHTML=u;$=F.firstChild,$;)m.appendChild($);return this.setDOMContent(m)}getMaxWidth(){var u;return(u=this._container)===null||u===void 0?void 0:u.style.maxWidth}setMaxWidth(u){return this.options.maxWidth=u,this._update(),this}setDOMContent(u){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=o.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(u),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(u){return this._container&&this._container.classList.add(u),this}removeClassName(u){return this._container&&this._container.classList.remove(u),this}setOffset(u){return this.options.offset=u,this._update(),this}toggleClassName(u){if(this._container)return this._container.classList.toggle(u)}setSubpixelPositioning(u){this.options.subpixelPositioning=u}_createCloseButton(){this.options.closeButton&&(this._closeButton=o.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const u=this._container.querySelector(yt);u&&u.focus()}}function Ot(j){if(j){if(typeof j=="number"){const u=Math.round(Math.abs(j)/Math.SQRT2);return{center:new a.P(0,0),top:new a.P(0,j),"top-left":new a.P(u,u),"top-right":new a.P(-u,u),bottom:new a.P(0,-j),"bottom-left":new a.P(u,-u),"bottom-right":new a.P(-u,-u),left:new a.P(j,0),right:new a.P(-j,0)}}if(j instanceof a.P||Array.isArray(j)){const u=a.P.convert(j);return{center:u,top:u,"top-left":u,"top-right":u,bottom:u,"bottom-left":u,"bottom-right":u,left:u,right:u}}return{center:a.P.convert(j.center||[0,0]),top:a.P.convert(j.top||[0,0]),"top-left":a.P.convert(j["top-left"]||[0,0]),"top-right":a.P.convert(j["top-right"]||[0,0]),bottom:a.P.convert(j.bottom||[0,0]),"bottom-left":a.P.convert(j["bottom-left"]||[0,0]),"bottom-right":a.P.convert(j["bottom-right"]||[0,0]),left:a.P.convert(j.left||[0,0]),right:a.P.convert(j.right||[0,0])}}return Ot(new a.P(0,0))}const te=_;d.AJAXError=a.bg,d.Evented=a.E,d.LngLat=a.N,d.MercatorCoordinate=a.Z,d.Point=a.P,d.addProtocol=a.bh,d.config=a.a,d.removeProtocol=a.bi,d.AttributionControl=is,d.BoxZoomHandler=bo,d.CanvasSource=Me,d.CooperativeGesturesHandler=ds,d.DoubleClickZoomHandler=Mi,d.DragPanHandler=As,d.DragRotateHandler=Lo,d.EdgeInsets=Nl,d.FullscreenControl=jl,d.GeoJSONSource=Ie,d.GeolocateControl=ir,d.Hash=ao,d.ImageSource=Be,d.KeyboardHandler=dc,d.LngLatBounds=Ae,d.LogoControl=po,d.Map=class extends ro{constructor(j){a.be.mark(a.bf.create);const u=Object.assign(Object.assign({},sl),j);if(u.minZoom!=null&&u.maxZoom!=null&&u.minZoom>u.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(u.minPitch!=null&&u.maxPitch!=null&&u.minPitch>u.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(u.minPitch!=null&&u.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(u.maxPitch!=null&&u.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new fi(u.minZoom,u.maxZoom,u.minPitch,u.maxPitch,u.renderWorldCopies),{bearingSnap:u.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Mc,this._controls=[],this._mapId=a.a4(),this._contextLost=F=>{F.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new a.k("webglcontextlost",{originalEvent:F}))},this._contextRestored=F=>{this._setupPainter(),this.resize(),this._update(),this.fire(new a.k("webglcontextrestored",{originalEvent:F}))},this._onMapScroll=F=>{if(F.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=u.interactive,this._maxTileCacheSize=u.maxTileCacheSize,this._maxTileCacheZoomLevels=u.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=u.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=u.preserveDrawingBuffer===!0,this._antialias=u.antialias===!0,this._trackResize=u.trackResize===!0,this._bearingSnap=u.bearingSnap,this._refreshExpiredTiles=u.refreshExpiredTiles===!0,this._fadeDuration=u.fadeDuration,this._crossSourceCollisions=u.crossSourceCollisions===!0,this._collectResourceTiming=u.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},jc),u.locale),this._clickTolerance=u.clickTolerance,this._overridePixelRatio=u.pixelRatio,this._maxCanvasSize=u.maxCanvasSize,this.transformCameraUpdate=u.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=u.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=C.addThrottleControl(()=>this.isMoving()),this._requestManager=new A(u.transformRequest),typeof u.container=="string"){if(this._container=document.getElementById(u.container),!this._container)throw new Error(`Container '${u.container}' not found.`)}else{if(!(u.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=u.container}if(u.maxBounds&&this.setMaxBounds(u.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let F=!1;const $=Vs(Z=>{this._trackResize&&!this._removed&&this.resize(Z)._update()},50);this._resizeObserver=new ResizeObserver(Z=>{F?$(Z):F=!0}),this._resizeObserver.observe(this._container)}this.handlers=new si(this,u);const m=typeof u.hash=="string"&&u.hash||void 0;this._hash=u.hash&&new ao(m).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:u.center,zoom:u.zoom,bearing:u.bearing,pitch:u.pitch}),u.bounds&&(this.resize(),this.fitBounds(u.bounds,a.e({},u.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=u.localIdeographFontFamily,this._validateStyle=u.validateStyle,u.style&&this.setStyle(u.style,{localIdeographFontFamily:u.localIdeographFontFamily}),u.attributionControl&&this.addControl(new is(typeof u.attributionControl=="boolean"?void 0:u.attributionControl)),u.maplibreLogo&&this.addControl(new po,u.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",F=>{this._update(F.dataType==="style"),this.fire(new a.k(`${F.dataType}data`,F))}),this.on("dataloading",F=>{this.fire(new a.k(`${F.dataType}dataloading`,F))}),this.on("dataabort",F=>{this.fire(new a.k("sourcedataabort",F))})}_getMapId(){return this._mapId}addControl(j,u){if(u===void 0&&(u=j.getDefaultPosition?j.getDefaultPosition():"top-right"),!j||!j.onAdd)return this.fire(new a.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const m=j.onAdd(this);this._controls.push(j);const F=this._controlPositions[u];return u.indexOf("bottom")!==-1?F.insertBefore(m,F.firstChild):F.appendChild(m),this}removeControl(j){if(!j||!j.onRemove)return this.fire(new a.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const u=this._controls.indexOf(j);return u>-1&&this._controls.splice(u,1),j.onRemove(this),this}hasControl(j){return this._controls.indexOf(j)>-1}calculateCameraOptionsFromTo(j,u,m,F){return F==null&&this.terrain&&(F=this.terrain.getElevationForLngLatZoom(m,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(j,u,m,F)}resize(j){var u;const m=this._containerDimensions(),F=m[0],$=m[1],Z=this._getClampedPixelRatio(F,$);if(this._resizeCanvas(F,$,Z),this.painter.resize(F,$,Z),this.painter.overLimit()){const he=this.painter.context.gl;this._maxCanvasSize=[he.drawingBufferWidth,he.drawingBufferHeight];const be=this._getClampedPixelRatio(F,$);this._resizeCanvas(F,$,be),this.painter.resize(F,$,be)}this.transform.resize(F,$),(u=this._requestedCameraState)===null||u===void 0||u.resize(F,$);const ie=!this._moving;return ie&&(this.stop(),this.fire(new a.k("movestart",j)).fire(new a.k("move",j))),this.fire(new a.k("resize",j)),ie&&this.fire(new a.k("moveend",j)),this}_getClampedPixelRatio(j,u){const{0:m,1:F}=this._maxCanvasSize,$=this.getPixelRatio(),Z=j*$,ie=u*$,he=Z>m?m/Z:1,be=ie>F?F/ie:1;return Math.min(he,be)*$}getPixelRatio(){var j;return(j=this._overridePixelRatio)!==null&&j!==void 0?j:devicePixelRatio}setPixelRatio(j){this._overridePixelRatio=j,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(j){return this.transform.setMaxBounds(Ae.convert(j)),this._update()}setMinZoom(j){if((j=j??-2)>=-2&&j<=this.transform.maxZoom)return this.transform.minZoom=j,this._update(),this.getZoom()<j&&this.setZoom(j),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(j){if((j=j??22)>=this.transform.minZoom)return this.transform.maxZoom=j,this._update(),this.getZoom()>j&&this.setZoom(j),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(j){if((j=j??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(j>=0&&j<=this.transform.maxPitch)return this.transform.minPitch=j,this._update(),this.getPitch()<j&&this.setPitch(j),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(j){if((j=j??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(j>=this.transform.minPitch)return this.transform.maxPitch=j,this._update(),this.getPitch()>j&&this.setPitch(j),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(j){return this.transform.renderWorldCopies=j,this._update()}project(j){return this.transform.locationPoint(a.N.convert(j),this.style&&this.terrain)}unproject(j){return this.transform.pointLocation(a.P.convert(j),this.terrain)}isMoving(){var j;return this._moving||((j=this.handlers)===null||j===void 0?void 0:j.isMoving())}isZooming(){var j;return this._zooming||((j=this.handlers)===null||j===void 0?void 0:j.isZooming())}isRotating(){var j;return this._rotating||((j=this.handlers)===null||j===void 0?void 0:j.isRotating())}_createDelegatedListener(j,u,m){if(j==="mouseenter"||j==="mouseover"){let F=!1;return{layer:u,listener:m,delegates:{mousemove:$=>{const Z=this.getLayer(u)?this.queryRenderedFeatures($.point,{layers:[u]}):[];Z.length?F||(F=!0,m.call(this,new Eo(j,this,$.originalEvent,{features:Z}))):F=!1},mouseout:()=>{F=!1}}}}if(j==="mouseleave"||j==="mouseout"){let F=!1;return{layer:u,listener:m,delegates:{mousemove:$=>{(this.getLayer(u)?this.queryRenderedFeatures($.point,{layers:[u]}):[]).length?F=!0:F&&(F=!1,m.call(this,new Eo(j,this,$.originalEvent)))},mouseout:$=>{F&&(F=!1,m.call(this,new Eo(j,this,$.originalEvent)))}}}}{const F=$=>{const Z=this.getLayer(u)?this.queryRenderedFeatures($.point,{layers:[u]}):[];Z.length&&($.features=Z,m.call(this,$),delete $.features)};return{layer:u,listener:m,delegates:{[j]:F}}}}on(j,u,m){if(m===void 0)return super.on(j,u);const F=this._createDelegatedListener(j,u,m);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[j]=this._delegatedListeners[j]||[],this._delegatedListeners[j].push(F);for(const $ in F.delegates)this.on($,F.delegates[$]);return this}once(j,u,m){if(m===void 0)return super.once(j,u);const F=this._createDelegatedListener(j,u,m);for(const $ in F.delegates)this.once($,F.delegates[$]);return this}off(j,u,m){return m===void 0?super.off(j,u):(this._delegatedListeners&&this._delegatedListeners[j]&&(F=>{const $=F[j];for(let Z=0;Z<$.length;Z++){const ie=$[Z];if(ie.layer===u&&ie.listener===m){for(const he in ie.delegates)this.off(he,ie.delegates[he]);return $.splice(Z,1),this}}})(this._delegatedListeners),this)}queryRenderedFeatures(j,u){if(!this.style)return[];let m;const F=j instanceof a.P||Array.isArray(j),$=F?j:[[0,0],[this.transform.width,this.transform.height]];if(u=u||(F?{}:j)||{},$ instanceof a.P||typeof $[0]=="number")m=[a.P.convert($)];else{const Z=a.P.convert($[0]),ie=a.P.convert($[1]);m=[Z,new a.P(ie.x,Z.y),ie,new a.P(Z.x,ie.y),Z]}return this.style.queryRenderedFeatures(m,u,this.transform)}querySourceFeatures(j,u){return this.style.querySourceFeatures(j,u)}setStyle(j,u){return(u=a.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},u)).diff!==!1&&u.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&j?(this._diffStyle(j,u),this):(this._localIdeographFontFamily=u.localIdeographFontFamily,this._updateStyle(j,u))}setTransformRequest(j){return this._requestManager.setTransformRequest(j),this}_getUIString(j){const u=this._locale[j];if(u==null)throw new Error(`Missing UI string '${j}'`);return u}_updateStyle(j,u){if(u.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(j,u));const m=this.style&&u.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!j)),j?(this.style=new jn(this,u||{}),this.style.setEventedParent(this,{style:this.style}),typeof j=="string"?this.style.loadURL(j,u,m):this.style.loadJSON(j,u,m),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new jn(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(j,u){if(typeof j=="string"){const m=j,F=this._requestManager.transformRequest(m,"Style");a.h(F,new AbortController).then($=>{this._updateDiff($.data,u)}).catch($=>{$&&this.fire(new a.j($))})}else typeof j=="object"&&this._updateDiff(j,u)}_updateDiff(j,u){try{this.style.setState(j,u)&&this._update(!0)}catch(m){a.w(`Unable to perform style diff: ${m.message||m.error||m}. Rebuilding the style from scratch.`),this._updateStyle(j,u)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():a.w("There is no style added to the map.")}addSource(j,u){return this._lazyInitEmptyStyle(),this.style.addSource(j,u),this._update(!0)}isSourceLoaded(j){const u=this.style&&this.style.sourceCaches[j];if(u!==void 0)return u.loaded();this.fire(new a.j(new Error(`There is no source with ID '${j}'`)))}setTerrain(j){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),j){const u=this.style.sourceCaches[j.source];if(!u)throw new Error(`cannot load terrain, because there exists no source with ID: ${j.source}`);this.terrain===null&&u.reload();for(const m in this.style._layers){const F=this.style._layers[m];F.type==="hillshade"&&F.source===j.source&&a.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new li(this.painter,u,j),this.painter.renderToTexture=new js(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=m=>{m.dataType==="style"?this.terrain.sourceCache.freeRtt():m.dataType==="source"&&m.tile&&(m.sourceId!==j.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(m.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new a.k("terrain",{terrain:j})),this}getTerrain(){var j,u;return(u=(j=this.terrain)===null||j===void 0?void 0:j.options)!==null&&u!==void 0?u:null}areTilesLoaded(){const j=this.style&&this.style.sourceCaches;for(const u in j){const m=j[u]._tiles;for(const F in m){const $=m[F];if($.state!=="loaded"&&$.state!=="errored")return!1}}return!0}removeSource(j){return this.style.removeSource(j),this._update(!0)}getSource(j){return this.style.getSource(j)}addImage(j,u,m={}){const{pixelRatio:F=1,sdf:$=!1,stretchX:Z,stretchY:ie,content:he,textFitWidth:be,textFitHeight:Ce}=m;if(this._lazyInitEmptyStyle(),!(u instanceof HTMLImageElement||a.b(u))){if(u.width===void 0||u.height===void 0)return this.fire(new a.j(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`")));{const{width:ze,height:$e,data:nt}=u,ct=u;return this.style.addImage(j,{data:new a.R({width:ze,height:$e},new Uint8Array(nt)),pixelRatio:F,stretchX:Z,stretchY:ie,content:he,textFitWidth:be,textFitHeight:Ce,sdf:$,version:0,userImage:ct}),ct.onAdd&&ct.onAdd(this,j),this}}{const{width:ze,height:$e,data:nt}=c.getImageData(u);this.style.addImage(j,{data:new a.R({width:ze,height:$e},nt),pixelRatio:F,stretchX:Z,stretchY:ie,content:he,textFitWidth:be,textFitHeight:Ce,sdf:$,version:0})}}updateImage(j,u){const m=this.style.getImage(j);if(!m)return this.fire(new a.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const F=u instanceof HTMLImageElement||a.b(u)?c.getImageData(u):u,{width:$,height:Z,data:ie}=F;if($===void 0||Z===void 0)return this.fire(new a.j(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`")));if($!==m.data.width||Z!==m.data.height)return this.fire(new a.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const he=!(u instanceof HTMLImageElement||a.b(u));return m.data.replace(ie,he),this.style.updateImage(j,m),this}getImage(j){return this.style.getImage(j)}hasImage(j){return j?!!this.style.getImage(j):(this.fire(new a.j(new Error("Missing required image id"))),!1)}removeImage(j){this.style.removeImage(j)}loadImage(j){return C.getImage(this._requestManager.transformRequest(j,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(j,u){return this._lazyInitEmptyStyle(),this.style.addLayer(j,u),this._update(!0)}moveLayer(j,u){return this.style.moveLayer(j,u),this._update(!0)}removeLayer(j){return this.style.removeLayer(j),this._update(!0)}getLayer(j){return this.style.getLayer(j)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(j,u,m){return this.style.setLayerZoomRange(j,u,m),this._update(!0)}setFilter(j,u,m={}){return this.style.setFilter(j,u,m),this._update(!0)}getFilter(j){return this.style.getFilter(j)}setPaintProperty(j,u,m,F={}){return this.style.setPaintProperty(j,u,m,F),this._update(!0)}getPaintProperty(j,u){return this.style.getPaintProperty(j,u)}setLayoutProperty(j,u,m,F={}){return this.style.setLayoutProperty(j,u,m,F),this._update(!0)}getLayoutProperty(j,u){return this.style.getLayoutProperty(j,u)}setGlyphs(j,u={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(j,u),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(j,u,m={}){return this._lazyInitEmptyStyle(),this.style.addSprite(j,u,m,F=>{F||this._update(!0)}),this}removeSprite(j){return this._lazyInitEmptyStyle(),this.style.removeSprite(j),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(j,u={}){return this._lazyInitEmptyStyle(),this.style.setSprite(j,u,m=>{m||this._update(!0)}),this}setLight(j,u={}){return this._lazyInitEmptyStyle(),this.style.setLight(j,u),this._update(!0)}getLight(){return this.style.getLight()}setSky(j){return this._lazyInitEmptyStyle(),this.style.setSky(j),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(j,u){return this.style.setFeatureState(j,u),this._update()}removeFeatureState(j,u){return this.style.removeFeatureState(j,u),this._update()}getFeatureState(j){return this.style.getFeatureState(j)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let j=0,u=0;return this._container&&(j=this._container.clientWidth||400,u=this._container.clientHeight||300),[j,u]}_setupContainer(){const j=this._container;j.classList.add("maplibregl-map");const u=this._canvasContainer=o.create("div","maplibregl-canvas-container",j);this._interactive&&u.classList.add("maplibregl-interactive"),this._canvas=o.create("canvas","maplibregl-canvas",u),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const m=this._containerDimensions(),F=this._getClampedPixelRatio(m[0],m[1]);this._resizeCanvas(m[0],m[1],F);const $=this._controlContainer=o.create("div","maplibregl-control-container",j),Z=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(ie=>{Z[ie]=o.create("div",`maplibregl-ctrl-${ie} `,$)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(j,u,m){this._canvas.width=Math.floor(m*j),this._canvas.height=Math.floor(m*u),this._canvas.style.width=`${j}px`,this._canvas.style.height=`${u}px`}_setupPainter(){const j={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let u=null;this._canvas.addEventListener("webglcontextcreationerror",F=>{u={requestedAttributes:j},F&&(u.statusMessage=F.statusMessage,u.type=F.type)},{once:!0});const m=this._canvas.getContext("webgl2",j)||this._canvas.getContext("webgl",j);if(!m){const F="Failed to initialize WebGL";throw u?(u.message=F,new Error(JSON.stringify(u))):new Error(F)}this.painter=new lc(m,this.transform),s.testSupport(m)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(j){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||j,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(j){return this._update(),this._renderTaskQueue.add(j)}_cancelRenderFrame(j){this._renderTaskQueue.remove(j)}_render(j){const u=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(j),this._removed)return;let m=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const $=this.transform.zoom,Z=c.now();this.style.zoomHistory.update($,Z);const ie=new a.a9($,{now:Z,fadeDuration:u,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),he=ie.crossFadingFactor();he===1&&he===this._crossFadingFactor||(m=!0,this._crossFadingFactor=he),this.style.update(ie)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,u,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:u,showPadding:this.showPadding}),this.fire(new a.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,a.be.mark(a.bf.load),this.fire(new a.k("load"))),this.style&&(this.style.hasTransitions()||m)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const F=this._sourcesDirty||this._styleDirty||this._placementDirty;return F||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new a.k("idle")),!this._loaded||this._fullyLoaded||F||(this._fullyLoaded=!0,a.be.mark(a.bf.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var j;this._hash&&this._hash.remove();for(const m of this._controls)m.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),C.removeThrottleControl(this._imageQueueHandle),(j=this._resizeObserver)===null||j===void 0||j.disconnect();const u=this.painter.context.gl.getExtension("WEBGL_lose_context");u!=null&&u.loseContext&&u.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),o.remove(this._canvasContainer),o.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),a.be.clearMetrics(),this._removed=!0,this.fire(new a.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,c.frameAsync(this._frameRequest).then(j=>{a.be.frame(j),this._frameRequest=null,this._render(j)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(j){this._showTileBoundaries!==j&&(this._showTileBoundaries=j,this._update())}get showPadding(){return!!this._showPadding}set showPadding(j){this._showPadding!==j&&(this._showPadding=j,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(j){this._showCollisionBoxes!==j&&(this._showCollisionBoxes=j,j?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(j){this._showOverdrawInspector!==j&&(this._showOverdrawInspector=j,this._update())}get repaint(){return!!this._repaint}set repaint(j){this._repaint!==j&&(this._repaint=j,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(j){this._vertices=j,this._update()}get version(){return Ic}getCameraTargetElevation(){return this.transform.elevation}},d.MapMouseEvent=Eo,d.MapTouchEvent=_o,d.MapWheelEvent=Qs,d.Marker=Fi,d.NavigationControl=class{constructor(j){this._updateZoomButtons=()=>{const u=this._map.getZoom(),m=u===this._map.getMaxZoom(),F=u===this._map.getMinZoom();this._zoomInButton.disabled=m,this._zoomOutButton.disabled=F,this._zoomInButton.setAttribute("aria-disabled",m.toString()),this._zoomOutButton.setAttribute("aria-disabled",F.toString())},this._rotateCompassArrow=()=>{const u=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=u},this._setButtonTitle=(u,m)=>{const F=this._map._getUIString(`NavigationControl.${m}`);u.title=F,u.setAttribute("aria-label",F)},this.options=a.e({},Ms,j),this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",u=>u.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",u=>this._map.zoomIn({},{originalEvent:u})),o.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",u=>this._map.zoomOut({},{originalEvent:u})),o.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",u=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:u}):this._map.resetNorth({},{originalEvent:u})}),this._compassIcon=o.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(j){return this._map=j,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 Zn(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){o.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}_createButton(j,u){const m=o.create("button",j,this._container);return m.type="button",m.addEventListener("click",u),m}},d.Popup=wt,d.RasterDEMTileSource=Ue,d.RasterTileSource=Oe,d.ScaleControl=class{constructor(j){this._onMove=()=>{Ci(this._map,this._container,this.options)},this.setUnit=u=>{this.options.unit=u,Ci(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},tr),j)}getDefaultPosition(){return"bottom-left"}onAdd(j){return this._map=j,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-scale",j.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){o.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},d.ScrollZoomHandler=rl,d.Style=jn,d.TerrainControl=class{constructor(j){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=j}onAdd(j){return this._map=j,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=o.create("button","maplibregl-ctrl-terrain",this._container),o.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){o.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},d.TwoFingersTouchPitchHandler=Dl,d.TwoFingersTouchRotateHandler=tu,d.TwoFingersTouchZoomHandler=sr,d.TwoFingersTouchZoomRotateHandler=ol,d.VectorTileSource=Pe,d.VideoSource=ye,d.addSourceType=(j,u)=>a._(void 0,void 0,void 0,function*(){if(He(j))throw new Error(`A source type called "${j}" already exists.`);((m,F)=>{Se[m]=F})(j,u)}),d.clearPrewarmedResources=function(){const j=fe;j&&(j.isPreloaded()&&j.numActive()===1?(j.release(ue),fe=null):console.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()"))},d.getMaxParallelImageRequests=function(){return a.a.MAX_PARALLEL_IMAGE_REQUESTS},d.getRTLTextPluginStatus=function(){return Xe().getRTLTextPluginStatus()},d.getVersion=function(){return te},d.getWorkerCount=function(){return de.workerCount},d.getWorkerUrl=function(){return a.a.WORKER_URL},d.importScriptInWorkers=function(j){return ge().broadcast("IS",j)},d.prewarm=function(){le().acquire(ue)},d.setMaxParallelImageRequests=function(j){a.a.MAX_PARALLEL_IMAGE_REQUESTS=j},d.setRTLTextPlugin=function(j,u){return Xe().setRTLTextPlugin(j,u)},d.setWorkerCount=function(j){de.workerCount=j},d.setWorkerUrl=function(j){a.a.WORKER_URL=j}}),g}()},88640:function(l,g,n){function x(xe,Te,Ae){xe.prototype=Te.prototype=Ae,Ae.constructor=xe}function d(xe,Te){var Ae=Object.create(xe.prototype);for(var Ee in Te)Ae[Ee]=Te[Ee];return Ae}function a(){}n.d(g,{GW:function(){return me},Dj:function(){return de}});var _=.7,b=1/_,y="\\s*([+-]?\\d+)\\s*",c="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",o="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s=/^#([0-9a-f]{3,8})$/,f=new RegExp("^rgb\\(".concat(y,",").concat(y,",").concat(y,"\\)$")),h=new RegExp("^rgb\\(".concat(o,",").concat(o,",").concat(o,"\\)$")),p=new RegExp("^rgba\\(".concat(y,",").concat(y,",").concat(y,",").concat(c,"\\)$")),v=new RegExp("^rgba\\(".concat(o,",").concat(o,",").concat(o,",").concat(c,"\\)$")),w=new RegExp("^hsl\\(".concat(c,",").concat(o,",").concat(o,"\\)$")),C=new RegExp("^hsla\\(".concat(c,",").concat(o,",").concat(o,",").concat(c,"\\)$")),A={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function T(){return this.rgb().formatHex()}function B(){return this.rgb().formatRgb()}function P(xe){var Te,Ae;return xe=(xe+"").trim().toLowerCase(),(Te=s.exec(xe))?(Ae=Te[1].length,Te=parseInt(Te[1],16),Ae===6?E(Te):Ae===3?new S(Te>>8&15|Te>>4&240,Te>>4&15|240&Te,(15&Te)<<4|15&Te,1):Ae===8?I(Te>>24&255,Te>>16&255,Te>>8&255,(255&Te)/255):Ae===4?I(Te>>12&15|Te>>8&240,Te>>8&15|Te>>4&240,Te>>4&15|240&Te,((15&Te)<<4|15&Te)/255):null):(Te=f.exec(xe))?new S(Te[1],Te[2],Te[3],1):(Te=h.exec(xe))?new S(255*Te[1]/100,255*Te[2]/100,255*Te[3]/100,1):(Te=p.exec(xe))?I(Te[1],Te[2],Te[3],Te[4]):(Te=v.exec(xe))?I(255*Te[1]/100,255*Te[2]/100,255*Te[3]/100,Te[4]):(Te=w.exec(xe))?U(Te[1],Te[2]/100,Te[3]/100,1):(Te=C.exec(xe))?U(Te[1],Te[2]/100,Te[3]/100,Te[4]):A.hasOwnProperty(xe)?E(A[xe]):xe==="transparent"?new S(NaN,NaN,NaN,0):null}function E(xe){return new S(xe>>16&255,xe>>8&255,255&xe,1)}function I(xe,Te,Ae,Ee){return Ee<=0&&(xe=Te=Ae=NaN),new S(xe,Te,Ae,Ee)}function M(xe,Te,Ae,Ee){return arguments.length===1?((Pe=xe)instanceof a||(Pe=P(Pe)),Pe?new S((Pe=Pe.rgb()).r,Pe.g,Pe.b,Pe.opacity):new S):new S(xe,Te,Ae,Ee??1);var Pe}function S(xe,Te,Ae,Ee){this.r=+xe,this.g=+Te,this.b=+Ae,this.opacity=+Ee}function L(){return"#".concat(V(this.r)).concat(V(this.g)).concat(V(this.b))}function k(){var xe=z(this.opacity);return"".concat(xe===1?"rgb(":"rgba(").concat(N(this.r),", ").concat(N(this.g),", ").concat(N(this.b)).concat(xe===1?")":", ".concat(xe,")"))}function z(xe){return isNaN(xe)?1:Math.max(0,Math.min(1,xe))}function N(xe){return Math.max(0,Math.min(255,Math.round(xe)||0))}function V(xe){return((xe=N(xe))<16?"0":"")+xe.toString(16)}function U(xe,Te,Ae,Ee){return Ee<=0?xe=Te=Ae=NaN:Ae<=0||Ae>=1?xe=Te=NaN:Te<=0&&(xe=NaN),new H(xe,Te,Ae,Ee)}function G(xe){if(xe instanceof H)return new H(xe.h,xe.s,xe.l,xe.opacity);if(xe instanceof a||(xe=P(xe)),!xe)return new H;if(xe instanceof H)return xe;var Te=(xe=xe.rgb()).r/255,Ae=xe.g/255,Ee=xe.b/255,Pe=Math.min(Te,Ae,Ee),Oe=Math.max(Te,Ae,Ee),Ue=NaN,Ie=Oe-Pe,De=(Oe+Pe)/2;return Ie?(Ue=Te===Oe?(Ae-Ee)/Ie+6*(Ae<Ee):Ae===Oe?(Ee-Te)/Ie+2:(Te-Ae)/Ie+4,Ie/=De<.5?Oe+Pe:2-Oe-Pe,Ue*=60):Ie=De>0&&De<1?0:Ue,new H(Ue,Ie,De,xe.opacity)}function H(xe,Te,Ae,Ee){this.h=+xe,this.s=+Te,this.l=+Ae,this.opacity=+Ee}function J(xe){return(xe=(xe||0)%360)<0?xe+360:xe}function ne(xe){return Math.max(0,Math.min(1,xe||0))}function W(xe,Te,Ae){return 255*(xe<60?Te+(Ae-Te)*xe/60:xe<180?Ae:xe<240?Te+(Ae-Te)*(240-xe)/60:Te)}x(a,P,{copy:function(xe){return Object.assign(new this.constructor,this,xe)},displayable:function(){return this.rgb().displayable()},hex:T,formatHex:T,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return G(this).formatHsl()},formatRgb:B,toString:B}),x(S,M,d(a,{brighter:function(xe){return xe=xe==null?b:Math.pow(b,xe),new S(this.r*xe,this.g*xe,this.b*xe,this.opacity)},darker:function(xe){return xe=xe==null?_:Math.pow(_,xe),new S(this.r*xe,this.g*xe,this.b*xe,this.opacity)},rgb:function(){return this},clamp:function(){return new S(N(this.r),N(this.g),N(this.b),z(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:L,formatHex:L,formatHex8:function(){return"#".concat(V(this.r)).concat(V(this.g)).concat(V(this.b)).concat(V(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:k,toString:k})),x(H,function(xe,Te,Ae,Ee){return arguments.length===1?G(xe):new H(xe,Te,Ae,Ee??1)},d(a,{brighter:function(xe){return xe=xe==null?b:Math.pow(b,xe),new H(this.h,this.s,this.l*xe,this.opacity)},darker:function(xe){return xe=xe==null?_:Math.pow(_,xe),new H(this.h,this.s,this.l*xe,this.opacity)},rgb:function(){var xe=this.h%360+360*(this.h<0),Te=isNaN(xe)||isNaN(this.s)?0:this.s,Ae=this.l,Ee=Ae+(Ae<.5?Ae:1-Ae)*Te,Pe=2*Ae-Ee;return new S(W(xe>=240?xe-240:xe+120,Pe,Ee),W(xe,Pe,Ee),W(xe<120?xe+240:xe-120,Pe,Ee),this.opacity)},clamp:function(){return new H(J(this.h),ne(this.s),ne(this.l),z(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var xe=z(this.opacity);return"".concat(xe===1?"hsl(":"hsla(").concat(J(this.h),", ").concat(100*ne(this.s),"%, ").concat(100*ne(this.l),"%").concat(xe===1?")":", ".concat(xe,")"))}}));var Q=function(xe){return function(){return xe}};function ae(xe,Te){var Ae=Te-xe;return Ae?function(Ee,Pe){return function(Oe){return Ee+Oe*Pe}}(xe,Ae):Q(isNaN(xe)?Te:xe)}var X=function xe(Te){var Ae=function(Pe){return(Pe=+Pe)==1?ae:function(Oe,Ue){return Ue-Oe?function(Ie,De,Be){return Ie=Math.pow(Ie,Be),De=Math.pow(De,Be)-Ie,Be=1/Be,function(ye){return Math.pow(Ie+ye*De,Be)}}(Oe,Ue,Pe):Q(isNaN(Oe)?Ue:Oe)}}(Te);function Ee(Pe,Oe){var Ue=Ae((Pe=M(Pe)).r,(Oe=M(Oe)).r),Ie=Ae(Pe.g,Oe.g),De=Ae(Pe.b,Oe.b),Be=ae(Pe.opacity,Oe.opacity);return function(ye){return Pe.r=Ue(ye),Pe.g=Ie(ye),Pe.b=De(ye),Pe.opacity=Be(ye),Pe+""}}return Ee.gamma=xe,Ee}(1);function ee(xe,Te){var Ae,Ee=Te?Te.length:0,Pe=xe?Math.min(Ee,xe.length):0,Oe=new Array(Pe),Ue=new Array(Ee);for(Ae=0;Ae<Pe;++Ae)Oe[Ae]=me(xe[Ae],Te[Ae]);for(;Ae<Ee;++Ae)Ue[Ae]=Te[Ae];return function(Ie){for(Ae=0;Ae<Pe;++Ae)Ue[Ae]=Oe[Ae](Ie);return Ue}}function ue(xe,Te){var Ae=new Date;return xe=+xe,Te=+Te,function(Ee){return Ae.setTime(xe*(1-Ee)+Te*Ee),Ae}}function de(xe,Te){return xe=+xe,Te=+Te,function(Ae){return xe*(1-Ae)+Te*Ae}}function pe(xe){return pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Te){return typeof Te}:function(Te){return Te&&typeof Symbol=="function"&&Te.constructor===Symbol&&Te!==Symbol.prototype?"symbol":typeof Te},pe(xe)}function fe(xe,Te){var Ae,Ee={},Pe={};for(Ae in xe!==null&&pe(xe)==="object"||(xe={}),Te!==null&&pe(Te)==="object"||(Te={}),Te)Ae in xe?Ee[Ae]=me(xe[Ae],Te[Ae]):Pe[Ae]=Te[Ae];return function(Oe){for(Ae in Ee)Pe[Ae]=Ee[Ae](Oe);return Pe}}var re=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,le=new RegExp(re.source,"g");function se(xe,Te){var Ae,Ee,Pe,Oe=re.lastIndex=le.lastIndex=0,Ue=-1,Ie=[],De=[];for(xe+="",Te+="";(Ae=re.exec(xe))&&(Ee=le.exec(Te));)(Pe=Ee.index)>Oe&&(Pe=Te.slice(Oe,Pe),Ie[Ue]?Ie[Ue]+=Pe:Ie[++Ue]=Pe),(Ae=Ae[0])===(Ee=Ee[0])?Ie[Ue]?Ie[Ue]+=Ee:Ie[++Ue]=Ee:(Ie[++Ue]=null,De.push({i:Ue,x:de(Ae,Ee)})),Oe=le.lastIndex;return Oe<Te.length&&(Pe=Te.slice(Oe),Ie[Ue]?Ie[Ue]+=Pe:Ie[++Ue]=Pe),Ie.length<2?De[0]?function(Be){return function(ye){return Be(ye)+""}}(De[0].x):function(Be){return function(){return Be}}(Te):(Te=De.length,function(Be){for(var ye,Me=0;Me<Te;++Me)Ie[(ye=De[Me]).i]=ye.x(Be);return Ie.join("")})}function ge(xe,Te){Te||(Te=[]);var Ae,Ee=xe?Math.min(Te.length,xe.length):0,Pe=Te.slice();return function(Oe){for(Ae=0;Ae<Ee;++Ae)Pe[Ae]=xe[Ae]*(1-Oe)+Te[Ae]*Oe;return Pe}}function ve(xe){return ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Te){return typeof Te}:function(Te){return Te&&typeof Symbol=="function"&&Te.constructor===Symbol&&Te!==Symbol.prototype?"symbol":typeof Te},ve(xe)}function me(xe,Te){var Ae,Ee,Pe=ve(Te);return Te==null||Pe==="boolean"?Q(Te):(Pe==="number"?de:Pe==="string"?(Ae=P(Te))?(Te=Ae,X):se:Te instanceof P?X:Te instanceof Date?ue:(Ee=Te,!ArrayBuffer.isView(Ee)||Ee instanceof DataView?Array.isArray(Te)?ee:typeof Te.valueOf!="function"&&typeof Te.toString!="function"||isNaN(Te)?fe:de:ge))(xe,Te)}},23648:function(l){l.exports=JSON.parse('["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]')},2362:function(l){l.exports=JSON.parse('["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]')},87486:function(l){l.exports=JSON.parse('["normal","italic","oblique"]')},99803:function(l){l.exports=JSON.parse('["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]')},54324:function(l){l.exports=JSON.parse('["inherit","initial","unset"]')},94316:function(l){l.exports=JSON.parse('["caption","icon","menu","message-box","small-caption","status-bar"]')},37071:function(l){l.exports=JSON.parse(`{"version":8,"name":"orto","metadata":{"maputnik:renderer":"mlgljs"},"center":[1.537786,41.837539],"zoom":12,"bearing":0,"pitch":0,"light":{"anchor":"viewport","color":"white","intensity":0.4,"position":[1.15,45,30]},"sources":{"ortoEsri":{"type":"raster","tiles":["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],"tileSize":256,"maxzoom":18,"attribution":"ESRI &copy; <a href='http://www.esri.com'>ESRI</a>"},"ortoInstaMaps":{"type":"raster","tiles":["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],"tileSize":256,"maxzoom":13},"ortoICGC":{"type":"raster","tiles":["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],"tileSize":256,"minzoom":13.1,"maxzoom":20},"openmaptiles":{"type":"vector","url":"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},"sprite":"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1","glyphs":"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf","layers":[{"id":"background","type":"background","paint":{"background-color":"#F4F9F4"}},{"id":"ortoEsri","type":"raster","source":"ortoEsri","maxzoom":16,"layout":{"visibility":"visible"}},{"id":"ortoICGC","type":"raster","source":"ortoICGC","minzoom":13.1,"maxzoom":19,"layout":{"visibility":"visible"}},{"id":"ortoInstaMaps","type":"raster","source":"ortoInstaMaps","maxzoom":13,"layout":{"visibility":"visible"}},{"id":"waterway_tunnel","type":"line","source":"openmaptiles","source-layer":"waterway","minzoom":14,"filter":["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],"layout":{"line-cap":"round"},"paint":{"line-color":"#a0c8f0","line-width":{"base":1.3,"stops":[[13,0.5],[20,6]]},"line-dasharray":[2,4]}},{"id":"waterway-other","type":"line","metadata":{"mapbox:group":"1444849382550.77"},"source":"openmaptiles","source-layer":"waterway","filter":["!in","class","canal","river","stream"],"layout":{"line-cap":"round"},"paint":{"line-color":"#a0c8f0","line-width":{"base":1.3,"stops":[[13,0.5],[20,2]]}}},{"id":"waterway-stream-canal","type":"line","metadata":{"mapbox:group":"1444849382550.77"},"source":"openmaptiles","source-layer":"waterway","filter":["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],"layout":{"line-cap":"round"},"paint":{"line-color":"#a0c8f0","line-width":{"base":1.3,"stops":[[13,0.5],[20,6]]}}},{"id":"waterway-river","type":"line","metadata":{"mapbox:group":"1444849382550.77"},"source":"openmaptiles","source-layer":"waterway","filter":["all",["==","class","river"],["!=","brunnel","tunnel"]],"layout":{"line-cap":"round"},"paint":{"line-color":"#a0c8f0","line-width":{"base":1.2,"stops":[[10,0.8],[20,4]]},"line-opacity":0.5}},{"id":"water-offset","type":"fill","metadata":{"mapbox:group":"1444849382550.77"},"source":"openmaptiles","source-layer":"water","maxzoom":8,"filter":["==","$type","Polygon"],"layout":{"visibility":"visible"},"paint":{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{"base":1,"stops":[[6,[2,0]],[8,[0,0]]]}}},{"id":"water","type":"fill","metadata":{"mapbox:group":"1444849382550.77"},"source":"openmaptiles","source-layer":"water","layout":{"visibility":"visible"},"paint":{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{"id":"water-pattern","type":"fill","metadata":{"mapbox:group":"1444849382550.77"},"source":"openmaptiles","source-layer":"water","layout":{"visibility":"visible"},"paint":{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{"id":"landcover-ice-shelf","type":"fill","metadata":{"mapbox:group":"1444849382550.77"},"source":"openmaptiles","source-layer":"landcover","filter":["==","subclass","ice_shelf"],"layout":{"visibility":"visible"},"paint":{"fill-color":"#fff","fill-opacity":{"base":1,"stops":[[0,0.9],[10,0.3]]}}},{"id":"tunnel-service-track-casing","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["in","class","service","track"]],"layout":{"line-join":"round"},"paint":{"line-color":"#cfcdca","line-dasharray":[0.5,0.25],"line-width":{"base":1.2,"stops":[[15,1],[16,4],[20,11]]}}},{"id":"tunnel-minor-casing","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["==","class","minor"]],"layout":{"line-join":"round"},"paint":{"line-color":"#cfcdca","line-opacity":{"stops":[[12,0],[12.5,1]]},"line-width":{"base":1.2,"stops":[[12,0.5],[13,1],[14,4],[20,15]]}}},{"id":"tunnel-secondary-tertiary-casing","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],"layout":{"line-join":"round"},"paint":{"line-color":"#e9ac77","line-opacity":1,"line-width":{"base":1.2,"stops":[[8,1.5],[20,17]]}}},{"id":"tunnel-trunk-primary-casing","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],"layout":{"line-join":"round"},"paint":{"line-color":"#e9ac77","line-width":{"base":1.2,"stops":[[5,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.7}},{"id":"tunnel-motorway-casing","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["==","class","motorway"]],"layout":{"line-join":"round","visibility":"visible"},"paint":{"line-color":"#e9ac77","line-dasharray":[0.5,0.25],"line-width":{"base":1.2,"stops":[[5,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.5}},{"id":"tunnel-path","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],"paint":{"line-color":"#cba","line-dasharray":[1.5,0.75],"line-width":{"base":1.2,"stops":[[15,1.2],[20,4]]}}},{"id":"tunnel-service-track","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["in","class","service","track"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fff","line-width":{"base":1.2,"stops":[[15.5,0],[16,2],[20,7.5]]}}},{"id":"tunnel-minor","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["==","class","minor_road"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fff","line-opacity":1,"line-width":{"base":1.2,"stops":[[13.5,0],[14,2.5],[20,11.5]]}}},{"id":"tunnel-secondary-tertiary","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fff4c6","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,10]]}}},{"id":"tunnel-trunk-primary","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fff4c6","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,18]]},"line-opacity":0.5}},{"id":"tunnel-motorway","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["==","class","motorway"]],"layout":{"line-join":"round","visibility":"visible"},"paint":{"line-color":"#ffdaa6","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,18]]},"line-opacity":0.5}},{"id":"tunnel-railway","type":"line","metadata":{"mapbox:group":"1444849354174.1904"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","tunnel"],["==","class","rail"]],"paint":{"line-color":"#bbb","line-width":{"base":1.4,"stops":[[14,0.4],[15,0.75],[20,2]]},"line-dasharray":[2,2]}},{"id":"ferry","type":"line","source":"openmaptiles","source-layer":"transportation","filter":["all",["in","class","ferry"]],"layout":{"line-join":"round","visibility":"visible"},"paint":{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{"id":"aeroway-taxiway-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"aeroway","minzoom":12,"filter":["all",["in","class","taxiway"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"rgba(153, 153, 153, 1)","line-width":{"base":1.5,"stops":[[11,2],[17,12]]},"line-opacity":1}},{"id":"aeroway-runway-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"aeroway","minzoom":12,"filter":["all",["in","class","runway"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"rgba(153, 153, 153, 1)","line-width":{"base":1.5,"stops":[[11,5],[17,55]]},"line-opacity":1}},{"id":"aeroway-taxiway","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"aeroway","minzoom":4,"filter":["all",["in","class","taxiway"],["==","$type","LineString"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"rgba(255, 255, 255, 1)","line-width":{"base":1.5,"stops":[[11,1],[17,10]]},"line-opacity":{"base":1,"stops":[[11,0],[12,1]]}}},{"id":"aeroway-runway","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"aeroway","minzoom":4,"filter":["all",["in","class","runway"],["==","$type","LineString"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"rgba(255, 255, 255, 1)","line-width":{"base":1.5,"stops":[[11,4],[17,50]]},"line-opacity":{"base":1,"stops":[[11,0],[12,1]]}}},{"id":"highway-motorway-link-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":12,"filter":["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],"layout":{"line-cap":"round","line-join":"round"},"paint":{"line-color":"#e9ac77","line-opacity":1,"line-width":{"base":1.2,"stops":[[12,1],[13,3],[14,4],[20,15]]}}},{"id":"highway-link-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":13,"filter":["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"#e9ac77","line-opacity":1,"line-width":{"base":1.2,"stops":[[12,1],[13,3],[14,4],[20,15]]}}},{"id":"highway-minor-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],"layout":{"line-cap":"round","line-join":"round"},"paint":{"line-color":"#cfcdca","line-opacity":{"stops":[[12,0],[12.5,0]]},"line-width":{"base":1.2,"stops":[[12,0.5],[13,1],[14,4],[20,15]]}}},{"id":"highway-secondary-tertiary-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],"layout":{"line-cap":"butt","line-join":"round","visibility":"visible"},"paint":{"line-color":"#e9ac77","line-opacity":0.5,"line-width":{"base":1.2,"stops":[[8,1.5],[20,17]]}}},{"id":"highway-primary-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":5,"filter":["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],"layout":{"line-cap":"butt","line-join":"round","visibility":"visible"},"paint":{"line-color":"#e9ac77","line-opacity":{"stops":[[7,0],[8,0.6]]},"line-width":{"base":1.2,"stops":[[7,0],[8,0.6],[9,1.5],[20,22]]}}},{"id":"highway-trunk-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":5,"filter":["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],"layout":{"line-cap":"butt","line-join":"round","visibility":"visible"},"paint":{"line-color":"#e9ac77","line-opacity":{"stops":[[5,0],[6,0.5]]},"line-width":{"base":1.2,"stops":[[5,0],[6,0.6],[7,1.5],[20,22]]}}},{"id":"highway-motorway-casing","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":4,"filter":["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],"layout":{"line-cap":"butt","line-join":"round","visibility":"visible"},"paint":{"line-color":"#e9ac77","line-width":{"base":1.2,"stops":[[4,0],[5,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":{"stops":[[4,0],[5,0.5]]}}},{"id":"highway-path","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],"paint":{"line-color":"#cba","line-dasharray":[1.5,0.75],"line-width":{"base":1.2,"stops":[[15,1.2],[20,4]]}}},{"id":"highway-motorway-link","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":12,"filter":["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],"layout":{"line-cap":"round","line-join":"round"},"paint":{"line-color":"#fc8","line-width":{"base":1.2,"stops":[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{"id":"highway-link","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":13,"filter":["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"#fea","line-width":{"base":1.2,"stops":[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{"id":"highway-minor","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],"layout":{"line-cap":"round","line-join":"round"},"paint":{"line-color":"#fff","line-opacity":0.5,"line-width":{"base":1.2,"stops":[[13.5,0],[14,2.5],[20,11.5]]}}},{"id":"highway-secondary-tertiary","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"#fea","line-width":{"base":1.2,"stops":[[6.5,0],[8,0.5],[20,13]]},"line-opacity":0.5}},{"id":"highway-primary","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"#fea","line-width":{"base":1.2,"stops":[[8.5,0],[9,0.5],[20,18]]},"line-opacity":0}},{"id":"highway-trunk","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"#fea","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,18]]},"line-opacity":0.5}},{"id":"highway-motorway","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","minzoom":5,"filter":["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],"layout":{"line-cap":"round","line-join":"round","visibility":"visible"},"paint":{"line-color":"#fc8","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,18]]},"line-opacity":0.5}},{"id":"railway-transit","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],"layout":{"visibility":"visible"},"paint":{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{"base":1.4,"stops":[[14,0.4],[20,1]]}}},{"id":"railway-transit-hatching","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],"layout":{"visibility":"visible"},"paint":{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[0.2,8],"line-width":{"base":1.4,"stops":[[14.5,0],[15,2],[20,6]]}}},{"id":"railway-service","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],"paint":{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{"base":1.4,"stops":[[14,0.4],[20,1]]}}},{"id":"railway-service-hatching","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],"layout":{"visibility":"visible"},"paint":{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[0.2,8],"line-width":{"base":1.4,"stops":[[14.5,0],[15,2],[20,6]]}}},{"id":"railway","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],"paint":{"line-color":"#bbb","line-width":{"base":1.4,"stops":[[14,0.4],[15,0.75],[20,2]]}}},{"id":"railway-hatching","type":"line","metadata":{"mapbox:group":"1444849345966.4436"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],"paint":{"line-color":"#bbb","line-dasharray":[0.2,8],"line-width":{"base":1.4,"stops":[[14.5,0],[15,3],[20,8]]}}},{"id":"bridge-motorway-link-casing","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["==","class","motorway_link"]],"layout":{"line-join":"round"},"paint":{"line-color":"#e9ac77","line-opacity":1,"line-width":{"base":1.2,"stops":[[12,1],[13,3],[14,4],[20,15]]}}},{"id":"bridge-link-casing","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],"layout":{"line-join":"round"},"paint":{"line-color":"#e9ac77","line-opacity":1,"line-width":{"base":1.2,"stops":[[12,1],[13,3],[14,4],[20,15]]}}},{"id":"bridge-secondary-tertiary-casing","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],"layout":{"line-join":"round"},"paint":{"line-color":"#e9ac77","line-opacity":1,"line-width":{"base":1.2,"stops":[[8,1.5],[20,28]]}}},{"id":"bridge-trunk-primary-casing","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],"layout":{"line-join":"round"},"paint":{"line-color":"hsl(28, 76%, 67%)","line-width":{"base":1.2,"stops":[[5,0.4],[6,0.6],[7,1.5],[20,26]]}}},{"id":"bridge-motorway-casing","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["==","class","motorway"]],"layout":{"line-join":"round"},"paint":{"line-color":"#e9ac77","line-width":{"base":1.2,"stops":[[5,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.5}},{"id":"bridge-path-casing","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],"paint":{"line-color":"#f8f4f0","line-width":{"base":1.2,"stops":[[15,1.2],[20,18]]}}},{"id":"bridge-path","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],"paint":{"line-color":"#cba","line-width":{"base":1.2,"stops":[[15,1.2],[20,4]]},"line-dasharray":[1.5,0.75]}},{"id":"bridge-motorway-link","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["==","class","motorway_link"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fc8","line-width":{"base":1.2,"stops":[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{"id":"bridge-link","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fea","line-width":{"base":1.2,"stops":[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{"id":"bridge-secondary-tertiary","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fea","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,20]]}}},{"id":"bridge-trunk-primary","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fea","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,18]]}}},{"id":"bridge-motorway","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["==","class","motorway"]],"layout":{"line-join":"round"},"paint":{"line-color":"#fc8","line-width":{"base":1.2,"stops":[[6.5,0],[7,0.5],[20,18]]},"line-opacity":0.5}},{"id":"bridge-railway","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["==","class","rail"]],"paint":{"line-color":"#bbb","line-width":{"base":1.4,"stops":[[14,0.4],[15,0.75],[20,2]]}}},{"id":"bridge-railway-hatching","type":"line","metadata":{"mapbox:group":"1444849334699.1902"},"source":"openmaptiles","source-layer":"transportation","filter":["all",["==","brunnel","bridge"],["==","class","rail"]],"paint":{"line-color":"#bbb","line-dasharray":[0.2,8],"line-width":{"base":1.4,"stops":[[14.5,0],[15,3],[20,8]]}}},{"id":"cablecar","type":"line","source":"openmaptiles","source-layer":"transportation","minzoom":13,"filter":["==","class","cable_car"],"layout":{"visibility":"visible","line-cap":"round"},"paint":{"line-color":"hsl(0, 0%, 70%)","line-width":{"base":1,"stops":[[11,1],[19,2.5]]}}},{"id":"cablecar-dash","type":"line","source":"openmaptiles","source-layer":"transportation","minzoom":13,"filter":["==","class","cable_car"],"layout":{"visibility":"visible","line-cap":"round"},"paint":{"line-color":"hsl(0, 0%, 70%)","line-width":{"base":1,"stops":[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{"id":"boundary-land-level-4","type":"line","source":"openmaptiles","source-layer":"boundary","filter":["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],"layout":{"line-join":"round"},"paint":{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{"base":1.4,"stops":[[4,0.4],[5,1],[12,3]]},"line-opacity":0.6}},{"id":"boundary-land-level-2","type":"line","source":"openmaptiles","source-layer":"boundary","filter":["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],"layout":{"line-cap":"round","line-join":"round"},"paint":{"line-color":"hsl(248, 7%, 66%)","line-width":{"base":1,"stops":[[0,0.6],[4,1.4],[5,2],[12,2]]}}},{"id":"boundary-land-disputed","type":"line","source":"openmaptiles","source-layer":"boundary","filter":["all",["!=","maritime",1],["==","disputed",1]],"layout":{"line-cap":"round","line-join":"round"},"paint":{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{"base":1,"stops":[[0,0.6],[4,1.4],[5,2],[12,8]]}}},{"id":"boundary-water","type":"line","source":"openmaptiles","source-layer":"boundary","filter":["all",["in","admin_level",2,4],["==","maritime",1]],"layout":{"line-cap":"round","line-join":"round"},"paint":{"line-color":"rgba(154, 189, 214, 1)","line-width":{"base":1,"stops":[[0,0.6],[4,1],[5,1],[12,1]]},"line-opacity":{"stops":[[6,0],[10,0]]}}},{"id":"waterway-name","type":"symbol","source":"openmaptiles","source-layer":"waterway","minzoom":13,"filter":["all",["==","$type","LineString"],["has","name"]],"layout":{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":0.2,"symbol-spacing":350},"paint":{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{"id":"water-name-lakeline","type":"symbol","source":"openmaptiles","source-layer":"water_name","filter":["==","$type","LineString"],"layout":{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":0.2},"paint":{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{"id":"water-name-ocean","type":"symbol","source":"openmaptiles","source-layer":"water_name","filter":["all",["==","$type","Point"],["==","class","ocean"]],"layout":{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":0.2},"paint":{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{"id":"water-name-other","type":"symbol","source":"openmaptiles","source-layer":"water_name","filter":["all",["==","$type","Point"],["!in","class","ocean"]],"layout":{"text-font":["Noto Sans Italic"],"text-size":{"stops":[[0,10],[6,14]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":0.2,"visibility":"visible"},"paint":{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{"id":"poi-level-3","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":16,"filter":["all",["==","$type","Point"],[">=","rank",25]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":12,"text-max-width":9},"paint":{"text-halo-blur":0.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{"id":"poi-level-2","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":15,"filter":["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":12,"text-max-width":9},"paint":{"text-halo-blur":0.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{"id":"poi-level-1","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":14,"filter":["all",["==","$type","Point"],["<=","rank",14],["has","name"]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":11,"text-max-width":9},"paint":{"text-halo-blur":0.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{"id":"poi-railway","type":"symbol","source":"openmaptiles","source-layer":"poi","minzoom":13,"filter":["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],"layout":{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\\n{name:nonlatin}","text-offset":[0,0.6],"text-size":12,"text-max-width":9,"icon-optional":false,"icon-ignore-placement":false,"icon-allow-overlap":false,"text-ignore-placement":false,"text-allow-overlap":false,"text-optional":true},"paint":{"text-halo-blur":0.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{"id":"road_oneway","type":"symbol","source":"openmaptiles","source-layer":"transportation","minzoom":15,"filter":["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],"layout":{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{"stops":[[15,0.5],[19,1]]}},"paint":{"icon-opacity":0.5}},{"id":"road_oneway_opposite","type":"symbol","source":"openmaptiles","source-layer":"transportation","minzoom":15,"filter":["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],"layout":{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{"stops":[[15,0.5],[19,1]]}},"paint":{"icon-opacity":0.5}},{"id":"highway-name-path","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":15.5,"filter":["==","class","path"],"layout":{"text-size":{"base":1,"stops":[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},"paint":{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":0.5}},{"id":"highway-name-minor","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":15,"filter":["all",["==","$type","LineString"],["in","class","minor","service","track"]],"layout":{"text-size":{"base":1,"stops":[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},"paint":{"text-halo-blur":0.5,"text-color":"#765","text-halo-width":1}},{"id":"highway-name-major","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":12.2,"filter":["in","class","primary","secondary","tertiary","trunk"],"layout":{"text-size":{"base":1,"stops":[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},"paint":{"text-halo-blur":0.5,"text-color":"#765","text-halo-width":1}},{"id":"highway-shield","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":8,"filter":["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],"layout":{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{"base":1,"stops":[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},"paint":{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":0.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{"id":"highway-shield-us-interstate","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":7,"filter":["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],"layout":{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{"base":1,"stops":[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},"paint":{"text-color":"rgba(0, 0, 0, 1)"}},{"id":"highway-shield-us-other","type":"symbol","source":"openmaptiles","source-layer":"transportation_name","minzoom":9,"filter":["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],"layout":{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{"base":1,"stops":[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},"paint":{"text-color":"rgba(0, 0, 0, 1)"}},{"id":"place-other","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","minzoom":12,"filter":["!in","class","city","town","village","country","continent"],"layout":{"text-letter-spacing":0.1,"text-size":{"base":1.2,"stops":[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":"{name:latin}\\n{name:nonlatin}","text-transform":"uppercase","text-max-width":9,"visibility":"visible"},"paint":{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{"id":"place-village","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","minzoom":10,"filter":["==","class","village"],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[10,12],[15,16]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"visibility":"visible"},"paint":{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{"id":"place-town","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["==","class","town"],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[10,14],[15,24]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"visibility":"visible"},"paint":{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{"id":"place-city","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["!=","capital",2],["==","class","city"]],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[7,14],[11,24]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"visibility":"visible"},"paint":{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-city-capital","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","capital",2],["==","class","city"]],"layout":{"text-font":["Noto Sans Regular"],"text-size":{"base":1.2,"stops":[[7,14],[11,24]]},"text-field":"{name:latin}\\n{name:nonlatin}","text-max-width":8,"icon-image":"star_11","text-offset":[0.4,0],"icon-size":0.8,"text-anchor":"left","visibility":"visible"},"paint":{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-other","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],"layout":{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{"stops":[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-3","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{"stops":[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-2","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{"stops":[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-country-1","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","filter":["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{"stops":[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,"visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{"id":"place-continent","type":"symbol","metadata":{"mapbox:group":"1444849242106.713"},"source":"openmaptiles","source-layer":"place","maxzoom":1,"filter":["==","class","continent"],"layout":{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase","visibility":"visible"},"paint":{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],"id":"qebnlkra6"}`)},51962:function(l){l.exports=JSON.parse(`{"version":8,"name":"orto","metadata":{},"center":[1.537786,41.837539],"zoom":12,"bearing":0,"pitch":0,"light":{"anchor":"viewport","color":"white","intensity":0.4,"position":[1.15,45,30]},"sources":{"ortoEsri":{"type":"raster","tiles":["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],"tileSize":256,"maxzoom":18,"attribution":"ESRI &copy; <a href='http://www.esri.com'>ESRI</a>"},"ortoInstaMaps":{"type":"raster","tiles":["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],"tileSize":256,"maxzoom":13},"ortoICGC":{"type":"raster","tiles":["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],"tileSize":256,"minzoom":13.1,"maxzoom":20},"openmaptiles":{"type":"vector","url":"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},"sprite":"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1","glyphs":"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf","layers":[{"id":"background","type":"background","paint":{"background-color":"#F4F9F4"}},{"id":"ortoEsri","type":"raster","source":"ortoEsri","maxzoom":16,"layout":{"visibility":"visible"}},{"id":"ortoICGC","type":"raster","source":"ortoICGC","minzoom":13.1,"maxzoom":19,"layout":{"visibility":"visible"}},{"id":"ortoInstaMaps","type":"raster","source":"ortoInstaMaps","maxzoom":13,"layout":{"visibility":"visible"}}]}`)}},O={};function R(l){var g=O[l];if(g!==void 0)return g.exports;var n=O[l]={id:l,exports:{}};return i[l].call(n.exports,n,n.exports,R),n.exports}return R.m=i,R.n=function(l){var g=l&&l.__esModule?function(){return l.default}:function(){return l};return R.d(g,{a:g}),g},R.d=function(l,g){for(var n in g)R.o(g,n)&&!R.o(l,n)&&Object.defineProperty(l,n,{enumerable:!0,get:g[n]})},R.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),R.o=function(l,g){return Object.prototype.hasOwnProperty.call(l,g)},R.r=function(l){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})},R.b=document.baseURI||self.location.href,R.nc=void 0,R(20260)}()})})(WY);var ooa=WY.exports;const ZY=ioa(ooa),soa={id:"main-container"},loa={id:"surface-container"},YY=39,mb=76,coa=0,XY=2,JY=4,KY=5,QY=6,eX=7,uoa=8,doa=9,tX=10,aX=11,nX=13,hoa=14,poa=15,foa=18,L1=19,moa=800,rX=300,iX=.1208,oX=5,goa=2,yoa=3,voa=4,_oa=7,boa=-46,sX=100,lX=-14,xoa={__name:"CardField",props:{selected_category:{type:Number,default:31},selected_team:{type:[Array,Number],default:()=>[]},showBallPosition:{type:Boolean,default:!0},showPlayersPosition:{type:Boolean,default:!0},widthContainer:{type:Number,default:1280},dataPaintInfo:{type:Object,default:()=>{}},showTracks:{type:Boolean,default:!1},touches:{type:Number,default:1},showPlayersEndPosition:{type:Boolean,default:!1},secondStart:{type:Number,default:0},operationStart:{type:Number,default:0},secondEnd:{type:Number,default:1},operationEnd:{type:Number,default:1},inFavor:{type:Boolean,default:!0}},emits:["changelateralidad"],setup(e,{emit:r}){var i;let O=.75,R=t.ref("left");const l=r,g=t.ref(null),n=t.ref(null),x=t.ref(0),d=t.ref(null),a=new Set([583,585,587,589]),_=new Set([584,586,588,590]),b=new Set([122,128,136,142]),y=new Set([125,131,139,145]),c=new Set([124,130,138,144]),o=new Set([123,129,137,143]),s=e;let f=null;t.watch(()=>x.value,V=>{p(V),n.value&&(n.value.style.height=`${v(V)}px`),d.value&&(d.value.style.top=`${w(v(V))}px`)}),t.watch(()=>s.selected_category,V=>{V==32?R.value="right":R.value="left"});function h(){f=new ResizeObserver(V=>{for(const U of V)x.value=U.contentRect.width}),f.observe(g.value)}function p(V){ZY.relayout(g.value,{width:V,height:v(V)})}function v(V){return Math.round(rX/moa*V,0)}function w(V){return lX+(V-sX)/(rX-sX)*(boa-lX)}t.watch(()=>s.dataPaintInfo,V=>{k(V)},{deep:!0}),t.watch(()=>s.selected_team,V=>{V.data.length>0&&k(V)}),t.watch(()=>s.secondStart,V=>{k(V)});function C(V,U){let G=.01321,H=.00929,J=0,ne=0,W=[];const Q=U.length;let ae=Math.floor(Q/10);for(;J<mb;)ne=U.filter(X=>X[0]>=J*G&&X[0]<=(J+1)*G&&X[1]>=V*H&&X[1]<=(V+1)*H).map(X=>X[1]).length,ae=ae===0?1:ae,W.push(parseFloat((ne/ae).toFixed(4))),J++;return W.reverse()}function A(V){let U=[T(mb),T(mb)],G=[],H=YY;for(;H>0&&H<=YY;)G=C(H,V),U.push(G),H--;return U.push(T(mb),T(mb)),U}function T(V){return Array.from({length:V},()=>0)}function B(V,U,G){const H=[];let J=0,ne=0;H.push(V[0]);for(let W=1;W<G-1;W++){const Q=[];Q.push(V[W][0]);for(let ae=1;ae<U-1;ae++)J=V[W][ae-1],ne=V[W][ae+1],Q.push(J+.5*(V[W][ae]+ne-J));Q.push(V[W][U-1]),H.push(Q)}H.push(V[G-1]);for(let W=1;W<U-1;W++)for(let Q=1;Q<G-1;Q++)J=H[Q-1][W],ne=H[Q+1][W],H[Q][W]=J+.5*(H[Q][W]+ne-J);return H}function P(V){for(var U=[],G=0;G<V.length;G++)if(V[G][L1]==0&&V[G][JY]===s.selected_category){let H=V[G][aX];U.push([V[G][tX],H])}return U}function E(V,U,G=1){let H=[],J=[];return V.forEach(ne=>{if(ne[JY]===s.selected_category){let W=V.filter(Q=>ne[0]===Q[foa]&&Q[L1]<=G).sort((Q,ae)=>Q[L1]-ae[L1]);W.length>0&&H.push(W),ne[L1]===0&&J.push([ne[coa],ne[nX],ne[hoa],ne[poa]])}}),{sequences:H,main_plays:J}}function I(V,U,G,H,J){let ne=.1,W=H*4,Q=H*3,ae=[],X=[],ee=[],ue=[],de=[],pe=[],fe=[],re=[],le=[],se=[],ge=[],ve=[],me=[];const xe=.7,Te="rgba(253, 101, 36, 1)",Ae="rgba(249, 189, 50, 1)",Ee="rgba(255, 255, 255, 1)",Pe="rgba(203, 238, 107, 1)",Oe="rgba(55, 181, 252, 1)",Ue="rgba(55, 252, 217, 1)",Ie="rgba(195, 198, 201, 1)",De=new Map([[a,{color:Pe,symbol:"circle"}],[_,{color:Oe,symbol:"circle"}],[b,{color:Ue,symbol:"circle"}],[y,{color:Ie,symbol:"x"}],[c,{color:Te,symbol:"square"}],[o,{color:Ae,symbol:"triangle-up"}]]);return V.forEach(Be=>{if(Be.length===1){if(Be[0][L1]===0)return;let ye=Be[0][QY]*G,Me=Be[0][eX]*W-Q,Se=H*iX,He=H*ne,Ne=Me+Se+He;if(Ne=Ne>=H?H-1:Ne,X.push(ye),ee.push(Ne-xe),ue.push(ye),de.push(Ne),J===1){let je=Be[0][KY].split(","),qe=!1;je=je.map(Number);for(const[Xe,we]of De)if(je.some(Fe=>Xe.has(Fe))){pe.push(we.color),fe.push(we.symbol),qe=!0;break}qe||(pe.push(Ee),fe.push("circle"))}else Be[0][XY]===U?pe.push(Ee):pe.push(Te)}else Be.forEach((ye,Me)=>{if(ye[L1]===0)return;let Se=ye[QY]*G,He=ye[eX]*W-Q,Ne=H*iX,je=H*ne,qe=He+Ne+je;if(qe=qe>=H?H-1:qe,X.push(Se),ee.push(qe-xe),ue.push(Se),de.push(qe),J===1){let Xe=Be[0][KY].split(","),we=!1;Xe=Xe.map(Number);for(const[Fe,Re]of De)if(Xe.some(Ge=>Fe.has(Ge))){pe.push(Re.color),fe.push(Re.symbol),we=!0;break}we||(pe.push(Ee),fe.push("circle"))}else{let Xe=ye[uoa]*G,we=ye[doa]*W-Q+Ne+je;we=we>=H?H-1:we;let Fe=ye[tX]*G,Re=ye[aX]*W-Q+Ne+je;Re=Re>=H?H-1:Re,ye[XY]===U?pe.push(Ee):pe.push(Te),se.push(Se,Xe,null),ge.push(qe,we,null),re.push(Se,Xe),le.push(qe,we),Be.length-1===Me&&(re.push(Fe,null),le.push(Re,null),ve.push(Fe),me.push(Re))}})}),ae.shadowXPoints=X,ae.shadowYPoints=ee,ae.playerXPoints=ue,ae.playerYPoints=de,ae.playerColorPoints=pe,ae.trackX=re,ae.trackY=le,ae.sprintX=se,ae.sprintY=ge,ae.arrowX=ve,ae.arrowY=me,ae.symbols=fe,ae}function M(V,U){return V.map((G,H)=>G.map((J,ne)=>{if(ne===U){let[W,Q,ae]=J.split(/[:.]/);return parseInt(W)*60+parseInt(Q)}else return J}))}function S(V,U,G,H,J=0,ne){let W=[];return H.forEach(Q=>{let ae=J===0?parseInt(Q[1])-parseInt(G):parseInt(Q[1])+parseInt(G);V.filter(X=>Q[0]===X[_oa]&&ae===X[oX]&&U===X[goa]).forEach(X=>{let ee=X[yoa],ue=X[voa];ue<=ne&&W.push([ee,ue])})}),W}function L(V){return V.flat().every(U=>U===0)}function k(V){V.data=M(V.data,nX),V.field_positions=M(V.field_positions,oX);let U=E(V.data,O,s.touches),G=P(V.data),H=S(V.field_positions,s.selected_team,s.secondStart,U.main_plays,s.operationStart,O),J=S(V.field_positions,s.selected_team,s.secondEnd,U.main_plays,s.operationEnd,O),ne=A(G),W=A(H),Q=A(J),ae=ne[0].length,X=ne.length;ne=B(B(ne,ae,X),ae,X),W=B(B(W,ae,X),ae,X),Q=B(B(Q,ae,X),ae,X),ae=ne[0].length,X=ne.length;let ee=I(U.sequences,s.selected_team,ae,X,s.touches);var ue=[[0,"rgba(12,31,82,0)"],[.2,"rgba(14, 55, 115, 0.8)"],[.4,"rgba(33, 85, 160, 0.8)"],[.6,"rgba(16, 124, 170, 0.8)"],[.8,"rgba(32, 154, 207, 0.8)"],[1,"rgba(32, 174, 207, 0.8)"]],de=[[0,"rgba(12,31,82,0)"],[.2,"rgba(73, 13, 67, 0.8)"],[.4,"rgba(98, 32, 91, 0.8)"],[.6,"rgba(121, 52, 114, 0.8)"],[.8,"rgba(176, 36, 121, 0.8)"],[1,"rgba(230, 49, 158, 0.8)"]],pe=[[0,"rgba(12,31,82,0)"],[.2,"rgba(94, 111, 79, 1)"],[.4,"rgba(111, 142, 28, 1)"],[.6,"rgba(142, 177, 50, 1)"],[.8,"rgba(169, 211, 57, 1)"],[1,"rgba(195, 229, 105, 1)"]],fe=[{z:ne,type:"heatmap",connectgaps:!0,opacity:1,colorscale:pe,autoscale:!1,showscale:!1,zsmooth:"best",showgrid:!1,showline:!1}],re=[{z:W,type:"heatmap",connectgaps:!0,opacity:1,colorscale:ue,autoscale:!1,showscale:!1,zsmooth:"best",showgrid:!1,showline:!1}],le=[{z:Q,type:"heatmap",connectgaps:!0,opacity:1,colorscale:de,autoscale:!1,showscale:!1,zsmooth:"best",showgrid:!1,showline:!1}],se={x:ee.shadowXPoints,y:ee.shadowYPoints,mode:"markers",marker:{symbol:ee.symbols,color:"rgba(0, 0, 0, 0.5)",size:9}},ge={x:ee.playerXPoints,y:ee.playerYPoints,mode:"markers",marker:{symbol:ee.symbols,color:ee.playerColorPoints,size:8}},ve={x:ee.trackX,y:ee.trackY,mode:"lines",line:{color:"rgba(255, 255, 255, 1)",width:1,dash:"2px 2px",arrowhead:"end"}},me={x:ee.sprintX,y:ee.sprintY,mode:"lines",line:{color:"rgba(255, 255, 255, 1)",width:1}},xe={x:ee.arrowX,y:ee.arrowY,mode:"markers",marker:{symbol:"triangle-up",size:10,color:"rgba(255, 255, 255, 1)",angle:120}},Te=[];s.showTracks&&s.touches>1&&Te.push(me,ve,xe),s.showTracks&&Te.push(se,ge),s.showPlayersEndPosition&&!L(Q)&&Te.push(...le),s.showPlayersPosition&&!L(W)&&Te.push(...re),s.showBallPosition&&!L(ne)&&Te.push(...fe);const Ae=[0,ae],Ee=[0,X];i={showlegend:!1,width:x.value,height:v(x.value),xaxis:{title:"",showgrid:!1,showline:!1,zeroline:!1,showticklabels:!1,ticks:"",showbackground:!1,backgroundcolor:"transparent",range:Ae},yaxis:{title:"",showgrid:!1,showline:!1,zeroline:!1,showticklabels:!1,ticks:"",showbackground:!1,backgroundcolor:"transparent",range:Ee},margin:{l:0,r:0,b:0,t:5}},ZY.newPlot("surface-plot-heatmap",Te,i,{displayModeBar:!1,staticPlot:!0},{responsive:!0})}const z=()=>{};function N(V){R.value=V,l("changelateralidad",R.value)}return t.onBeforeUnmount(()=>{window.removeEventListener("resize",z)}),t.onMounted(()=>{g.value&&(g.value.style.pointerEvents="none"),window.addEventListener("resize",z),h()}),(V,U)=>(t.openBlock(),t.createElementBlock("div",soa,[t.createElementVNode("div",loa,[s.dataPaintInfo.data.length==0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(e.widthContainer<768?"class-not-result-field-movil":"class-not-result-field")},[e.widthContainer<768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[U[2]||(U[2]=t.createTextVNode("No se muestran resultados debido")),U[3]||(U[3]=t.createElementVNode("br",null,null,-1)),U[4]||(U[4]=t.createTextVNode(" a los filtros aplicados."))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("No se muestran resultados debido a los filtros aplicados.")],64))],2)):t.createCommentVNode("",!0),t.createElementVNode("div",{id:"label-left-zone",style:t.normalizeStyle(t.unref(R)=="left"?"":"opacity: 0.6"),onClick:U[0]||(U[0]=G=>N("left"))},null,4),t.createElementVNode("div",{id:"label-right-zone",style:t.normalizeStyle(t.unref(R)=="right"?"":"opacity: 0.6"),onClick:U[1]||(U[1]=G=>N("right"))},null,4),t.createElementVNode("div",{ref_key:"surfacePlot",ref:g,id:"surface-plot-heatmap",class:t.normalizeClass(e.inFavor?"":"against")},null,2)])]))}},cX="/arrowbtn.png",woa={components:{GSCTrendMenuBall:Bra,GSCCheckbox:Yv,GSCTrendPosition:roa,CardField:xoa},props:{acronymHome:{type:String,default:""},acronymAway:{type:String,default:""},typePlay:{type:String,default:"A favor"},tournamentSelected:{type:Object,default:()=>({})},widthContainer:{type:Number,default:1280},touchAllData:{type:Array,default:()=>[]},playersData:{type:Object,default:()=>{}},homeTeam:{type:Number,default:0},awayTeam:{type:Number,default:0},selected_category:{type:Number,default:31},team:{type:Number,default:0},forGame:{type:Boolean,required:!1},teamsData:{type:Object,default:()=>{}},fieldPositionsAll:{type:Array,default:()=>[]},inFavor:{type:Boolean,required:!1},isTacticVisible:{type:Boolean,required:!1}},data(){return{type:"ball",show:!1,game:62276,trajectories:[],rival:3014,totalCorners:0,typepositioning:"Posición",BallOnOff:"OFF",numberTouches:1,playersList:{},timepositioning:-1,checkedBallGo:!0,checkedHeatMap:!0,filterFieldPositions:[],timepositioningFinal:-1,arrayPlayers:{},season:1325,timepositioningend:1,zonesFilter:[],touchFilter:{},token:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"}},watch:{touchAllData:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},zonesFilter:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},typepositioning:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},timepositioning:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0},timepositioningend:{handler(){this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},deep:!0}},computed:{firstTeam(){return this.homeTeam===this.team?this.acronymHome:this.acronymAway},secondTeam(){return this.homeTeam===this.team?this.acronymAway:this.acronymHome},firstTeam1Touch(){return this.inFavor?this.homeTeam===this.team?this.acronymHome:this.acronymAway:this.homeTeam===this.team?this.acronymAway:this.acronymHome},secondTeam1Touch(){return this.inFavor?this.homeTeam===this.team?this.acronymAway:this.acronymHome:this.homeTeam===this.team?this.acronymHome:this.acronymAway},reftrendteamsTouches(){const e=this.widthContainer;return e<=480?"ref-trend-teams-touches480":e<=768?"ref-trend-teams-touches768":"ref-trend-teams-touches"},reftrendteamslocal(){const e=this.widthContainer;return e<=480?"ref-trend-teams-local480":e<=768?"ref-trend-teams-local768":"ref-trend-teams-local"},reftrendteamsrival(){return this.widthContainer<=768?"ref-trend-teams-rival768":"ref-trend-teams-rival"},reftrendteamsall(){const e=this.widthContainer;return e<=480?"ref-trend-teams-all480":e<=768?"ref-trend-teams-all768":"ref-trend-teams-all"},refpointlebeltext(){const e=this.widthContainer;return e<=480?"ref-point-lebel-text480":e<=768?"ref-point-lebel-text768":e<=860?"ref-point-lebel-text870":"ref-point-lebel-text"},trendcontentcontrols(){return this.widthContainer<=768?"trend-content-controls768":["trend-content-controls","to-right"]},trendtitle(){return this.widthContainer<=768?"trend-title768":"trend-title"},trendtitlecontainer(){return this.widthContainer<=768?"trend-titlecontainer768":"trend-titlecontainer"},trendcontentcontrolscontainer(){const e=this.widthContainer;return e<=400?"trend-content-controls-container400":e<=860?"trend-content-controls-container860":"trend-content-controls-container"},trendcontentcontrolsleyendcheckscontent(){const e=this.widthContainer;return e<=400?"trend-content-controls-leyend-checkscontent400":e<=768?"trend-content-controls-leyend-checkscontent768":e<=1e3?"trend-content-controls-leyend-checkscontent1000":"trend-content-controls-leyend-checkscontent"},trendcontentcontrolsleyend(){const e=this.widthContainer;return e<=768?"trend-content-controls-leyend768":e<=1e3?"trend-content-controls-leyend1000":"trend-content-controls-leyend"},contDataClass(){return this.widthContainer<=768?"cont-data768":"cont-data"},contDataClass2(){return this.widthContainer<=768?"cont-data-ref768":"cont-data-ref"},contCollectorsClass(){const e=this.widthContainer;return e<=768?"cont-collectors768":e<=900?"cont-collectors900":"cont-collectors"},contCollectorsClass2(){const e=this.widthContainer;return e<=768?"cont-collectors-ref768":e<=900?"cont-collectors-ref900":"cont-collectors-ref"},contWhoCnnectedClass(){const e=this.widthContainer;return e<=768?"cont-who-connected768":e<=900?"cont-who-connected900":"cont-who-connected"},contWhoCnnectedClass2(){const e=this.widthContainer;return e<=768?"cont-who-connected-ref768":e<=900?"cont-who-connected-ref900":"cont-who-connected-ref"}},methods:{changelateralidad(e){this.$emit("changelateralidad",e)},changeTouchesnum(e){this.numberTouches=e},checkBallGo(){this.checkedBallGo=!this.checkedBallGo},checkHeatMap(){this.checkedHeatMap=!this.checkedHeatMap},changeBallOnOff(e){typeof e=="string"&&(this.BallOnOff=e)},getDataPosition(){if(this.touchAllData.length>0){const r=this.touchAllData.filter(a=>a[19]===0).map(a=>this.tiempoASegundosEnteros(a[13]));let i=[];this.timepositioning>=0?i=r.map(a=>a+this.timepositioning):i=r.map(a=>a-this.timepositioning);const O=this.fieldPositionsAll.filter(a=>i.includes(this.tiempoASegundosEnteros(a[5]))&&a[2]===this.team),R=this.contarYAgruparPorPosicion(O);let l=[];this.zonesFilter.length!=35?l=this.fieldPositionsAll.filter(a=>this.zonesFilter.includes(a[6])&&a[2]===this.team):l=this.fieldPositionsAll.filter(a=>this.zonesFilter.includes(a[6])&&a[2]===this.team),this.filterFieldPositions=l;let g=[],n=[];for(var e in this.arrayPlayers)this.arrayPlayers[e].selected&&g.push(this.arrayPlayers[e].id),n.push(this.arrayPlayers[e].id);g.length>0&&(this.filterFieldPositions=this.filterFieldPositions.filter(a=>g.includes(a[1])));const x=l.filter(a=>i.includes(this.tiempoASegundosEnteros(a[5]))&&a[2]===this.team),d=this.contarYAgruparPorPosicion(x);this.arrayPlayers={};for(let a=0;a<R.length;a++){const _=d.filter(function(b){return b.id_player==R[a].id_player});this.arrayPlayers[R[a].id_player]={id:R[a].id_player,corners:R[a].corners,cornersfilter:_[0]?_[0].corners:0,data:this.playersData[R[a].id_player]?this.playersData[R[a].id_player]:{name:"-",img:"-",position:11,id:"-",team:"-",nationality_id:"-",nationality_flag:"https://az755631.vo.msecnd.net/flags/undefined.jpg",jersey:"-"},selected:Object.keys(this.arrayPlayers).length>0&&n.includes(R[a].id_player)?!!g.includes(R[a].id_player):!0}}}else this.arrayPlayers={},this.filterFieldPositions=[]},getDataTrajectory(){if(this.touchAllData.length>0){const r=this.touchAllData.filter(y=>y[19]===0).map(y=>this.tiempoASegundosEnteros(y[13]));let i=[];this.timepositioning>=0?i=r.map(y=>y+Math.abs(this.timepositioning)):i=r.map(y=>y-Math.abs(this.timepositioning));let O=[];this.timepositioningend>=0?O=r.map(y=>y+Math.abs(this.timepositioningend)):O=r.map(y=>y-Math.abs(this.timepositioningend));const R=this.fieldPositionsAll.filter(y=>this.zonesFilter.includes(y[6])&&y[2]===this.team);this.filterFieldPositions=R;let l=[],g=[];for(var e in this.arrayPlayers)this.arrayPlayers[e].selected&&l.push(this.arrayPlayers[e].id),g.push(this.arrayPlayers[e].id);l.length>0&&(this.filterFieldPositions=this.filterFieldPositions.filter(y=>l.includes(y[1])));const n=this.fieldPositionsAll.filter(y=>r.includes(this.tiempoASegundosEnteros(y[5]))&&y[2]===this.team),x=R.filter(y=>i.includes(this.tiempoASegundosEnteros(y[5]))&&y[2]===this.team),d=R.filter(y=>O.includes(this.tiempoASegundosEnteros(y[5]))&&y[2]===this.team),a=this.contarYAgruparPorPosicion(n),_=this.contarYAgruparPorPosicion(x),b=this.contarYAgruparPorPosicion(d);for(let y=0;y<a.length;y++){const c=_.filter(function(s){return s.id_player==a[y].id_player}),o=b.filter(function(s){return s.id_player==a[y].id_player});this.arrayPlayers[a[y].id_player]={id:a[y].id_player,corners:a[y].corners,cornersfilter:c[0]?c[0].corners:0,cornersfilterfinal:o[0]?o[0].corners:0,data:this.playersData[a[y].id_player]?this.playersData[a[y].id_player]:{name:"-",img:"-",position:11,id:"-",team:"-",nationality_id:"-",nationality_flag:"https://az755631.vo.msecnd.net/flags/undefined.jpg",jersey:"-"},selected:Object.keys(this.arrayPlayers).length>0&&g.includes(a[y].id_player)?!!l.includes(a[y].id_player):!0}}}else this.arrayPlayers={},this.filterFieldPositions=[]},contarYAgruparPorPosicion(e){const r=e.reduce((i,O)=>{const R=O[1];return i[R]?i[R]+=1:i[R]=1,i},{});return Object.keys(r).map(i=>({id_player:parseInt(i,10),corners:r[i]}))},tiempoASegundosEnteros(e){let r=e.split(":"),i=parseInt(r[0],10),O=parseFloat(r[1]);return i*60+Math.floor(O)},getTimePositioning(e){this.timepositioning=e},getTimePositioningEnd(e){this.timepositioningend=e},getTypePositioning(e){this.typepositioning=e},getArrayZonesField(e){this.zonesFilter=e},selectcheckplayerall(e){for(let r in this.arrayPlayers)this.arrayPlayers[r].selected=e;this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},selectcheckplayer(e){this.arrayPlayers[e].selected=!this.arrayPlayers[e].selected,this.typepositioning=="Posición"?this.getDataPosition():this.getDataTrajectory()},clickTypeButton(e){this.type=e},clickAdvanced(){this.show=!this.show},async getData(){}},mounted(){}},koa={class:"text-diferent"},Soa={key:0,class:"btnAdvance",src:cX},Coa={key:1,class:"btnAdvanceHide",src:cX},Toa={class:"menu-advanced-container"},Aoa={class:"container-buttons-menu"},Eoa={key:1,class:"position-only"},Moa={class:"buttons-menu-select-data"},Ioa={key:0,class:"ref-trend-ball-player-container"},Boa={class:"ref-trend-ball-player"},Poa={class:"ref-trend-ball-player-label"},Ooa={key:1,class:"ref-trend-ball-player-container-route"},Loa={class:"ref-trend-teams-rival-container-table"},zoa={class:"ref-trend-teams-rival-container-row1"},Noa={class:"ref-trend-teams-rival-container-row2"},Foa={class:"ref-trend-teams-rival-container-table"},Doa={class:"ref-trend-teams-rival-container-row1"},Roa={class:"ref-trend-teams-rival-container-row2"};function Voa(e,r,i,O,R,l){const g=t.resolveComponent("GSCCheckbox"),n=t.resolveComponent("GSCTrendMenuBall"),x=t.resolveComponent("GSCTrendPosition"),d=t.resolveComponent("CardField");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(i.widthContainer<=768?"gsc-trend-movil":"gsc-trend-plays")},[t.createElementVNode("div",{class:t.normalizeClass(l.trendtitlecontainer)},[t.createElementVNode("div",{class:t.normalizeClass(l.trendtitle)},[r[5]||(r[5]=t.createTextVNode(" Tendencia General ")),t.createElementVNode("span",koa,"("+t.toDisplayString(i.inFavor?"A favor":"En contra")+")",1)],2),t.createElementVNode("div",{class:t.normalizeClass(l.trendcontentcontrols)},[t.createElementVNode("div",{class:t.normalizeClass(l.trendcontentcontrolsleyend)},[i.widthContainer>1e3||i.widthContainer<=768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Elige que quieres ver: ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[r[6]||(r[6]=t.createTextVNode("Elige que ")),r[7]||(r[7]=t.createElementVNode("br",null,null,-1)),r[8]||(r[8]=t.createTextVNode("quieres ver:"))],64))],2),t.createElementVNode("div",{class:t.normalizeClass(l.trendcontentcontrolsleyendcheckscontent)},[t.createElementVNode("div",{class:t.normalizeClass(l.trendcontentcontrolscontainer)},[t.createVNode(g,{label:"¿A dónde fue el balón?",fontFamily:"Poppins-Regular",labelFontSize:i.widthContainer>=870?"13px":"12px","label-color":"#FFF","model-value":R.checkedBallGo,"onUpdate:modelValue":r[0]||(r[0]=a=>l.checkBallGo())},null,8,["labelFontSize","model-value"])],2),t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(l.trendcontentcontrolscontainer)},[t.createVNode(g,{label:i.tournamentSelected.is_female==1?"Jugadoras ofensivas":"Jugadores ofensivos",fontFamily:"Poppins-Regular",labelFontSize:i.widthContainer>=870?"13px":"12px","label-color":"#FFF",boxBackgroundColor:"#15a9e0","model-value":R.checkedHeatMap,"onUpdate:modelValue":r[1]||(r[1]=a=>l.checkHeatMap())},null,8,["label","labelFontSize","model-value"])],2),[[t.vShow,i.isTacticVisible]])],2)],2)],2),t.createElementVNode("div",{class:t.normalizeClass(l.contDataClass)},[t.createElementVNode("div",{class:t.normalizeClass(l.contCollectorsClass)},[t.createElementVNode("div",{class:t.normalizeClass(i.widthContainer<=768?"button-avanced-movil":"button-avanced"),onClick:r[2]||(r[2]=(...a)=>l.clickAdvanced&&l.clickAdvanced(...a))},[R.show?(t.openBlock(),t.createElementBlock("img",Soa)):t.createCommentVNode("",!0),r[9]||(r[9]=t.createTextVNode("Avanzado")),R.show?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("img",Coa))],2),t.withDirectives(t.createElementVNode("div",Toa,[t.createElementVNode("div",Aoa,[i.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",{class:t.normalizeClass(["buttons-menu",R.type=="ball"?"active":""]),onClick:r[3]||(r[3]=a=>l.clickTypeButton("ball"))}," A dónde fue el balón ",2),t.createElementVNode("div",{class:t.normalizeClass(["buttons-menu",R.type=="position"?"active":""]),onClick:r[4]||(r[4]=a=>l.clickTypeButton("position"))}," Posicionamiento ",2)],64)):(t.openBlock(),t.createElementBlock("div",Eoa,"Posicionamiento"))]),t.createElementVNode("div",Moa,[t.withDirectives(t.createVNode(n,{"Ball-on-off":R.BallOnOff,onChangeBallOnOff:l.changeBallOnOff,onTouchesnum:l.changeTouchesnum},null,8,["Ball-on-off","onChangeBallOnOff","onTouchesnum"]),[[t.vShow,R.type=="ball"]]),t.withDirectives(t.createVNode(x,{onSelectcheckplayer:l.selectcheckplayer,onSelectcheckplayerall:l.selectcheckplayerall,data:R.arrayPlayers,onShowfield:l.getArrayZonesField,onTypepositioning:l.getTypePositioning,"width-container":i.widthContainer,onTimepositioning:l.getTimePositioning,onTimepositioningend:l.getTimePositioningEnd},null,8,["onSelectcheckplayer","onSelectcheckplayerall","data","onShowfield","onTypepositioning","width-container","onTimepositioning","onTimepositioningend"]),[[t.vShow,i.isTacticVisible&&R.type==="position"]])])],512),[[t.vShow,R.show]])],2),t.createElementVNode("div",{class:t.normalizeClass(l.contWhoCnnectedClass)},[t.createVNode(d,{"width-container":i.widthContainer,selected_team:i.team,"show-ball-position":R.checkedBallGo,"show-players-position":R.checkedHeatMap,selected_category:i.selected_category,"show-tracks":R.BallOnOff=="ON",touches:R.numberTouches,"operation-start":R.timepositioning>0?1:0,"second-start":Math.abs(R.timepositioning),"second-end":R.timepositioningend>0?1:0,"operation-end":Math.abs(R.timepositioningend),onChangelateralidad:l.changelateralidad,"show-players-end-position":R.typepositioning=="Recorrido","in-favor":i.inFavor,"data-paint-info":{data:i.touchAllData,field_positions:R.filterFieldPositions,home_atk_direction:1}},null,8,["width-container","selected_team","show-ball-position","show-players-position","selected_category","show-tracks","touches","operation-start","second-start","second-end","operation-end","onChangelateralidad","show-players-end-position","in-favor","data-paint-info"])],2)],2),t.createElementVNode("div",{class:t.normalizeClass(l.contDataClass2)},[t.createElementVNode("div",{class:t.normalizeClass(l.contCollectorsClass2)},[R.typepositioning==="Posición"?(t.openBlock(),t.createElementBlock("div",Ioa,[r[11]||(r[11]=t.createElementVNode("div",{class:"ref-trend-ball-ball"},[t.createElementVNode("div",{class:"ref-trend-ball-ball-point"}),t.createElementVNode("div",{class:"ref-trend-ball-ball-label"},"BALÓN")],-1)),t.createElementVNode("div",Boa,[r[10]||(r[10]=t.createElementVNode("div",{class:"ref-trend-ball-playe-point"},null,-1)),t.createElementVNode("div",Poa,[i.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("JUGADORAS OFENSIVAS")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("JUGADORES OFENSIVOS")],64))])])])):(t.openBlock(),t.createElementBlock("div",Ooa,r[12]||(r[12]=[t.createStaticVNode('<div class="ref-trend-ball-ball" data-v-a81b154d><div class="ref-trend-ball-ball-point" data-v-a81b154d></div><div class="ref-trend-ball-ball-label" data-v-a81b154d>BALÓN</div></div><div class="ref-trend-ball-player-route" data-v-a81b154d><div class="ref-trend-ball-player-label" data-v-a81b154d>RECORRIDOS:    </div><div class="ref-trend-ball-playe-point" data-v-a81b154d></div><div class="ref-trend-ball-player-label" data-v-a81b154d>INICIO   </div><div class="ref-trend-ball-playe-point-end" data-v-a81b154d></div><div class="ref-trend-ball-player-label" data-v-a81b154d>FINAL</div></div>',2)])))],2),R.BallOnOff=="ON"?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(l.contWhoCnnectedClass2),style:t.normalizeStyle(R.numberTouches>1?"margin-left: 0%; display: flex; justify-content: center;":"")},[R.numberTouches>1?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(l.reftrendteamsTouches)},[t.createElementVNode("div",{class:"ref-trend-teams-rival-label-title",style:t.normalizeStyle(i.widthContainer<=768?"justify-content: center !important;":"")}," COORDENADAS: ",4),t.createElementVNode("div",Loa,[t.createElementVNode("div",zoa,[r[13]||(r[13]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(/circle-my-team.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext),style:{"font-size":"9px"}},[i.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(l.firstTeam),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(i.teamsData[i.team].acronym),1)],64))],2)]),t.createElementVNode("div",Noa,[r[14]||(r[14]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(/circle-other-team.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext),style:{"font-size":"9px"}},[i.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(l.secondTeam),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Rival")],64))],2)])])],2)):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(l.reftrendteamsall)},[t.createElementVNode("div",{class:t.normalizeClass(l.reftrendteamslocal)},[t.createElementVNode("div",{class:"ref-trend-teams-local-label-title",style:t.normalizeStyle(i.widthContainer<=768?"justify-content: center !important;":"")},[i.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(l.firstTeam1Touch),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(i.inFavor?i.teamsData[i.team].acronym:"Rival"),1)],64))],4),t.createElementVNode("div",{class:t.normalizeClass(i.widthContainer<=480?"ref-trend-teams-local-container-table-movil":"ref-trend-teams-local-container-table")},[t.createElementVNode("div",{class:"ref-trend-teams-local-container-row1",style:t.normalizeStyle(i.widthContainer<=480?"display: inline-block !important;":"")},[r[16]||(r[16]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/rematado-gol.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext)},r[15]||(r[15]=[t.createTextVNode("Remata destino "),t.createElementVNode("br",null,null,-1),t.createTextVNode("portería fue gol")]),2)],4),t.createElementVNode("div",{class:"ref-trend-teams-local-container-row2",style:t.normalizeStyle(i.widthContainer<=480?"display: inline-block !important;":"")},[r[18]||(r[18]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/rematado-con-destino.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext)},r[17]||(r[17]=[t.createTextVNode("Rematado destino "),t.createElementVNode("br",null,null,-1),t.createTextVNode("a portería no fue gol")]),2)],4),t.createElementVNode("div",{class:"ref-trend-teams-local-container-row3",style:t.normalizeStyle(i.widthContainer<=480?"display: inline-block !important;":"")},[r[20]||(r[20]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/rematado-sin-destino.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext)},r[19]||(r[19]=[t.createTextVNode("Rematado sin "),t.createElementVNode("br",null,null,-1),t.createTextVNode("destino a portería")]),2)],4),t.createElementVNode("div",{class:"ref-trend-teams-local-container-row4",style:t.normalizeStyle(i.widthContainer<=480?"display: inline-block !important;":"")},[r[21]||(r[21]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/sin-destino.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext)},"Sin destino",2)],4)],2)],2),t.createElementVNode("div",{class:t.normalizeClass(l.reftrendteamsrival)},[t.createElementVNode("div",{class:"ref-trend-teams-rival-label-title",style:t.normalizeStyle(i.widthContainer<=768?"justify-content: center;":"")},[i.forGame?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(l.secondTeam1Touch),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(i.inFavor?"Rival":i.teamsData[i.team].acronym),1)],64))],4),t.createElementVNode("div",Foa,[t.createElementVNode("div",Doa,[r[30]||(r[30]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/ganados-jugador-rival.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext)},[i.widthContainer<=768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[i.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[r[22]||(r[22]=t.createTextVNode("Ganados ")),i.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Jugadora ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Jugador ")],64)),r[23]||(r[23]=t.createTextVNode("rival"))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Ganados por defensivo")],64))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[i.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[r[27]||(r[27]=t.createTextVNode("Ganados ")),r[28]||(r[28]=t.createElementVNode("br",null,null,-1)),i.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Jugadora ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Jugador ")],64)),r[29]||(r[29]=t.createTextVNode(" rival"))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[r[24]||(r[24]=t.createTextVNode("Ganados por")),r[25]||(r[25]=t.createElementVNode("br",null,null,-1)),r[26]||(r[26]=t.createTextVNode("defensivo"))],64))],64))],2)]),t.createElementVNode("div",Roa,[r[40]||(r[40]=t.createElementVNode("div",{class:"ref-point-view",style:{backgroundImage:"url(http://golstatsimages.blob.core.windows.net/content/ganados-portero.png)"}},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(l.refpointlebeltext)},[i.widthContainer<=768?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[i.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[r[32]||(r[32]=t.createTextVNode("Ganados ")),i.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Portera ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Portero ")],64)),r[33]||(r[33]=t.createTextVNode("rival"))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[r[31]||(r[31]=t.createTextVNode("Ganados por ")),i.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("portera")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("portero")],64))],64))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[i.inFavor?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[r[37]||(r[37]=t.createTextVNode("Ganados ")),r[38]||(r[38]=t.createElementVNode("br",null,null,-1)),i.tournamentSelected.is_female==1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Portera ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Portero ")],64)),r[39]||(r[39]=t.createTextVNode("rival"))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[r[34]||(r[34]=t.createTextVNode("Ganados por")),r[35]||(r[35]=t.createElementVNode("br",null,null,-1)),r[36]||(r[36]=t.createTextVNode("portero"))],64))],64))],2)])])],2)],2))],6)):t.createCommentVNode("",!0)],2)],2)}const joa=yu(woa,[["render",Voa],["__scopeId","data-v-a81b154d"]]),eM={components:{GSCConnectionsSetPiece:hVt,GSCHeaderSetPiece:DQt,GSCDataToHighlight:Cea,GSCModalBreakdown:xta,GSCSpecificPlays:wra,GSCTrend:joa},props:{game:{type:Object,required:!0},forSeason:{type:Boolean,default:!1},forTeam:{type:Boolean,default:!1},tournamentSelected:{type:Object,default:()=>({})},forGame:{type:Boolean,default:!1},team:{type:Number,default:0},isTacticVisible:{type:Boolean,default:!0},isSynchronization:{type:Boolean,default:!1},canPlayVideos:{type:Boolean,default:!0},clientPrivilegesBySeasons:{type:Object,default:()=>null},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])}},data(){return{isSpecificPlaysVisible:!1,token:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE",touchAllDataHome:[],touchAllDataAway:[],regularflag:null,filters:{isMoment:!1,final:[1,2,3],moment:[1,2,3],playingAs:[1,2],sections:[1,2,3,4,5,6],games:[],players:[],cornertype:31,howWas:[120,126,327,133],zona:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],whathappened:[583,585,587,589,584,586,588,590,122,128,136,142,123,129,137,143,124,130,138,144,125,131,139,14,146,147,327,133],isWhatHappenedFull:!0,isZoneFull:!0},containerWidth:0,openModal:!1,playersData:{},teamsData:{},teamCorners:{corners:0,cornersAgainst:0},gamesAllHome:[],gamesAllAway:[],teamSelected:0,touchDataSelected:[],auxChangeFilterPlayer:!0,auxChangeFilterGames:!0,positionsDataSelected:[],copyLastFilters:{},seasonId:0,totalDataCollection:{},seasonsByGame:{},matchesByGame:{},rivalsByGame:{},updateConnections:0,showCorners:0,filterPlayersAvailable:[],filterGamesAvailable:[],updateTrend:0,lateralidad:"left",updateFilter:0,copyplayers:[],infavoragainst:!0,typePlay:"A favor",modalInitialData:{},areFiltersOpen:!1,heightFilters:"123px",isLoading:!1}},watch:{isLoading(e){this.isSpecificPlaysVisible=!e},game:{immediate:!0,handler(e){this.getDataCorners(e),this.createStorageGame()}},teamSelected:{immediate:!0,handler(){this.fillFilterGamesReset(),this.fillFilterPlayersReset(),this.updateConnections+=1}},infavoragainst:{immediate:!0,handler(){this.fillFilterGamesReset(),this.fillFilterPlayersReset(),this.updateConnections+=1}},calculationTouchesData:{immediate:!0,handler(){this.showCorners=this.calculationTouchesData.filter(e=>e[19]==0).length}}},computed:{isGameOnly(){return this.forGame&&!this.forSeason&&!this.forTeam},calculateTotal(){return this.touchDataSelected.filter(e=>e[19]==0).length},calculationPositionsData(){return this.positionsDataSelected},calculationTouchesData(){let e=[],r=[];if(this.touchDataSelected.length>0){this.updateCopyfilter(),this.filters.isMoment?r=this.touchDataSelected.filter(O=>this.filters.moment.includes(O[17])&&this.filters.playingAs.includes(O[14])&&this.filters.sections.includes(O[20])&&O[19]==0):r=this.touchDataSelected.filter(O=>this.filters.final.includes(O[16])&&this.filters.playingAs.includes(O[14])&&this.filters.sections.includes(O[20])&&O[19]==0),this.updateGamesListFilter({corners:r}),this.filters.games.length>0&&(r=r.filter(O=>this.filters.games.includes(O[3]))),this.infavoragainst&&(this.updatePlayerListFilter({corners:r,players:this.filters.players}),this.filters.players.length>0&&(r=r.filter(O=>this.filters.players.includes(O[1])))),r=r.filter(O=>this.filters.cornertype==O[4]),this.filters.zona.length!=35&&(r=r.filter(O=>this.filters.zona.includes(O[12]))),r=r.filter(O=>O[5].split(",").map(R=>parseInt(R)).some(R=>this.filters.howWas.includes(R))),this.filters.whathappened.length!=24&&(r=r.filter(O=>O[5].split(",").map(R=>parseInt(R)).some(R=>this.filters.whathappened.includes(R))));const i=r.map(O=>O[18]);e=this.touchDataSelected.filter(O=>i.includes(O[18]))}return e},cornersInFavor(){return"-"},cornersAgainst(){return"-"},isMovil(){return this.containerWidth<=768}},methods:{setHeaderStickyListener(){const e=this.$refs.header.getBoundingClientRect().top-1+(window.scrollY||window.pageYOffset);window.onscroll=()=>{(window.scrollY||window.pageYOffset)>e?(this.$refs.header.classList.add("sticky"),this.areFiltersOpen?this.heightFilters="282px":this.isMovil?this.forTeam?this.heightFilters="170px":this.heightFilters="222px":this.heightFilters="123px"):this.$refs.header.classList.remove("sticky")}},setCornersSide(e){this.lateralidad=e},onChangeShowFilters(e){this.areFiltersOpen=e},fillFilterPlayersReset(){setTimeout(()=>{if(this.infavoragainst){const e=this.forGame?this.infavoragainst?this.teamSelected:this.teamSelected==this.game.home_team?this.game.away_team:this.game.home_team:this.teamSelected,r=this.touchDataSelected.filter(O=>O[19]==0&&e).map(O=>O[1]),i=[...new Set(r)];this.getFilterTakenCorners({players:i})}},100)},fillFilterGamesReset(){setTimeout(()=>{const e=this.touchDataSelected.filter(i=>i[19]==0).map(i=>i[3]),r=[...new Set(e)];this.getFilterGames({games:r})},100)},updateCopyfilter(){this.copyLastFilters=this.filters},fillGameDataTeam(e){return{teamsIds:[e.home_team,e.visiting_team],label:`${e.matchday_abbreviation.replace("M","J")} ${this.teamsData[this.game.home_team].acronym} vs ${this.game.home_team==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym}`,id:e.game_id,isSelected:!0,dateTimeMillis:Date.parse(e.date_time_utc),rivalTeam:{logo:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,team_id:this.game.home_team==e.home_team?e.visiting_team:e.home_team,provisional_logo:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,colloquial_name:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,acronym:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,team_name:this.game.home_team==e.home_team?this.teamsData[e.visiting_team].name:this.teamsData[e.home_team].name},roundAbbreviation:e.matchday_abbreviation.replace("M","J")}},fillGameData(e){return{teamsIds:[e.home_team,e.visiting_team],label:`${e.matchday_abbreviation.replace("M","J")} ${this.teamsData[this.teamSelected].acronym} vs ${this.teamSelected==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym}`,id:e.game_id,isSelected:!0,dateTimeMillis:Date.parse(e.date_time_utc),rivalTeam:{logo:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,team_id:this.teamSelected==e.home_team?e.visiting_team:e.home_team,provisional_logo:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].img:this.teamsData[e.home_team].img,colloquial_name:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,acronym:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].acronym:this.teamsData[e.home_team].acronym,team_name:this.teamSelected==e.home_team?this.teamsData[e.visiting_team].name:this.teamsData[e.home_team].name},roundAbbreviation:e.matchday_abbreviation.replace("M","J")}},updatePlayerListFilter(e){if(this.infavoragainst){let r={},i=[];for(let O=0;O<e.corners.length;O++){const R=e.corners[O];if(R[19]===0&&R[2]===this.teamSelected){const l=R[1],g=this.playersData[l];l in r||(r[l]=g,i.push(g))}}if(this.filterPlayersAvailable=i,e.players.length>0&&this.filterPlayersAvailable.length>0)for(let O=0;O<this.filterPlayersAvailable.length;O++)e.players.includes(this.filterPlayersAvailable[O].id)?this.filterPlayersAvailable[O].isSelected=!0:this.filterPlayersAvailable[O].isSelected=!1}},updateGamesListFilter(e){if(!this.forGame){this.filterGamesAvailable=[];const r=this.obtenerIDsGames(e.corners);this.forSeason?this.teamSelected==this.game.home_team?this.filterGamesAvailable=r.map(i=>{let O=this.gamesAllHome.find(R=>R.game_id===i);if(O)return this.fillGameData(O)}):this.filterGamesAvailable=r.map(i=>{let O=this.gamesAllAway.find(R=>R.game_id===i);if(O)return this.fillGameData(O)}):this.filterGamesAvailable=r.map(i=>{let O=this.gamesAllHome.find(R=>R.game_id===i);if(O)return this.fillGameDataTeam(O)})}if(this.filters.games.length>0&&this.filterGamesAvailable.length>0)for(let r=0;r<this.filterGamesAvailable.length;r++)this.filters.games.includes(this.filterGamesAvailable[r].id)?this.filterGamesAvailable[r].isSelected=!0:this.filterGamesAvailable[r].isSelected=!1},getResetPlayers(){for(let e in this.playersData)this.playersData[e].isSelected=!0},getFilterZone(e){this.filters.zona=e,this.filters.isZoneFull=e.length===35},getFilterHowWasCorner(e){e.cornertype==31&&(this.lateralidad="left"),e.cornertype==32&&(this.lateralidad="right"),this.filters.cornertype=e.cornertype,this.filters.howWas=e.howWas},getFilterTakenCorners(e){this.arraysAreEqual(this.filters.players,e.players)||(this.filters.players=e.players)},arraysAreEqual(e,r){if(e.length!==r.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==r[i])return!1;return!0},getFilterGames(e){this.areGamesIdsArraysContentEqual(this.filters.games,e.games)||(this.filters.games=e.games,this.fillFilterPlayersReset())},areGamesIdsArraysContentEqual(e,r){return e.length===r.length&&e.every((i,O)=>i===r[O])},getFilterDetails(e){this.filters.playingAs=e.playingAs,this.filters.sections=e.sections,this.fillFilterGamesReset(),this.fillFilterPlayersReset()},getFilterResultsByTime(e){this.filters.final=e.final,this.filters.isMoment=e.isMoment,this.filters.moment=e.moment,this.fillFilterGamesReset(),this.fillFilterPlayersReset()},getFilterWhatHappened(e){this.filters.whathappened=e,this.filters.isWhatHappenedFull=e.length===24},obtenerIDsGames(e){return[...new Set(e.map(r=>r[3]))]},async getInFavorAgainstTeam(e){this.updateTrend+=1,this.infavoragainst=e,this.validateDataLocalStorage({team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})&&(this.teamSelected==this.game.home_team?await this.requestOrchestrator({games:this.gamesAllHome,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game}):await this.requestOrchestrator({games:this.gamesAllAway,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game}))},async getTeamSelected(e){this.teamSelected!=e&&(this.updateConnections+=1,this.updateTrend+=1,this.teamSelected=e,this.touchDataSelected=[],this.gamesAllHome.length!=0&&this.gamesAllAway.length!=0&&(this.teamSelected==this.game.home_team?this.validateDataLocalStorage({team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game}):this.validateDataLocalStorage({team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllAway,team:this.teamSelected,inFavor:this.infavoragainst,game:this.game})))},async requestOrchestrator(e){let r=[];const i=_u.create({headers:{Authorization:`${this.token}`}});for(let n=0;n<e.games.length;n++)this.seasonId=e.games[n].season_id,r.push(e.inFavor?"https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/"+e.games[n].season_id+"/corners/trends/teams/"+e.team+"/"+e.games[n].game_id:"https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/"+e.games[n].season_id+"/corners/trends/teams/"+e.team+"/"+e.games[n].game_id+"?isR=1");const O=async n=>{this.isLoading=!0,document.body.classList.add("no-scroll");try{return(await i.get(n)).data}catch(x){throw console.error("Error al obtener datos:",x),x}};var R=[],l=[];const g=r.map(n=>O(n));Promise.all(g).then(n=>{for(let x=0;x<n.length;x++)n[x].data=this.changeLateralityCoordenatesPlays(n[x].data,!1),n[x].field_positions=this.changeLateralityCoordenatesPlays(n[x].field_positions,!0),R=R.concat(n[x].data),l=l.concat(n[x].field_positions),this.getDataPlayers(n[x].players),this.getDataPlayers(n[x].rival_players),this.getDataTeams(n[x].teams),this.getSeasonByGame({season:n[x]&&n[x].hasOwnProperty("season_name")?n[x].season_name:"",game:n[x].data[0]?n[x].data[0][3]:0}),this.getMatchByGame({match:n[x]&&n[x].hasOwnProperty("matchday_abbreviation")?n[x].matchday_abbreviation:"",game:n[x].data[0]?n[x].data[0][3]:0}),this.getRivalsByGame({rival:this.infavoragainst?this.teamSelected==n[x].teams[0].team_id?n[x].teams[1].name:n[x].teams[0].name:this.teamSelected==n[x].teams[0].team_id?n[x].teams[0].name:n[x].teams[1].name,game:n[x].data[0]?n[x].data[0][3]:0,team:this.teamSelected,favor:this.infavoragainst});this.touchDataSelected=R,this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].touch=R,this.positionsDataSelected=l,this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].positions=l}).then(()=>{this.isLoading=!1,document.body.classList.remove("no-scroll")}).catch(n=>{console.error("Error al obtener datos:",n),this.isLoading=!1,document.body.classList.remove("no-scroll")})},getRowMatrix(e,r){let i=.01351,O=.02439,R=0,l=0,g=[];const n=r.length;let x=Math.floor(n/10);for(;R<74;)l=r.filter(d=>d[0]>=R*i&&d[0]<=(R+1)*i&&d[1]>=e*O&&d[1]<=(e+1)*O).map(d=>d[1]).length,x=x===0?1:x,g.push(parseFloat((l/x).toFixed(4))),R++;return g.reverse()},getEmptyArray(e){return Array.from({length:e},()=>0)},getMatrix(e){let r=[this.getEmptyArray(74),this.getEmptyArray(74)],i=[],O=39;for(;O>0&&O<=39;)i=this.getRowMatrix(O,e),r.push(i),O--;return r.push(this.getEmptyArray(74),this.getEmptyArray(74)),r},getSoftData(e,r,i){const O=[];let R=0,l=0;O.push(e[0]);for(let g=1;g<i-1;g++){const n=[];n.push(e[g][0]);for(let x=1;x<r-1;x++)R=e[g][x-1],l=e[g][x+1],n.push(R+.5*(e[g][x]+l-R));n.push(e[g][r-1]),O.push(n)}O.push(e[i-1]);for(let g=1;g<r-1;g++)for(let n=1;n<i-1;n++)R=O[n-1][g],l=O[n+1][g],O[n][g]=R+.5*(O[n][g]+l-R);return O},changeLateralityCoordenatesPlays(e,r){return r?e.forEach((i,O)=>{let R=0,l=0;this.infavoragainst?(R=i[2]===this.teamSelected?1-i[3]:i[3],l=i[2]===this.teamSelected?1-i[4]:i[4]):(R=i[2]===this.teamSelected?i[3]:1-i[3],l=i[2]===this.teamSelected?i[4]:1-i[4]),e[O][3]=R,e[O][4]=l}):e.forEach((i,O)=>{let R=0,l=0,g=0,n=0,x=0,d=0;i[19]!=0?this.infavoragainst?(R=i[2]===this.teamSelected?i[6]:1-i[6],l=i[2]===this.teamSelected?1-i[7]:i[7],g=i[2]===this.teamSelected?i[8]:1-i[8],n=i[2]===this.teamSelected?1-i[9]:i[9],x=i[2]===this.teamSelected?i[10]:1-i[10],d=i[2]===this.teamSelected?1-i[11]:i[11]):(R=i[2]===this.teamSelected?1-i[6]:i[6],l=i[2]===this.teamSelected?i[7]:1-i[7],g=i[2]===this.teamSelected?1-i[8]:i[8],n=i[2]===this.teamSelected?i[9]:1-i[9],x=i[2]===this.teamSelected?1-i[10]:i[10],d=i[2]===this.teamSelected?i[11]:1-i[11]):(R=1-i[6],l=i[7],g=1-i[8],n=i[9],x=1-i[10],d=i[11]),e[O][6]=R,e[O][7]=l,e[O][8]=g,e[O][9]=n,e[O][10]=x,e[O][11]=d}),e},changeLateralityPlays(e){e.field_positions=e.field_positions.map(i=>[...i.slice(0,3),i[4],i[3],...i.slice(5)]);let r=[];return e.data.forEach(i=>{i[19]===0&&r.push([i[0],i[13],i[14],i[15]])}),r.forEach(i=>{e.field_positions.filter(O=>i[0]===O[7]&&this.teamSelected===O[2]).forEach(O=>{let R=O[3],l=O[4];(e.homeTeamAtkDirection===1&&i[3]===1||e.homeTeamAtkDirection===2&&i[3]===2||e.homeTeamAtkDirection===1&&i[3]===3||e.homeTeamAtkDirection===2&&i[3]===4)&&(R=1-R,l=1-l),O[3]=R,O[4]=l})}),e.field_positions},createStorageGame(){this.totalDataCollection[this.game.id]={},this.totalDataCollection[this.game.id][this.game.home_team]={},this.totalDataCollection[this.game.id][this.game.home_team].InFavor={},this.totalDataCollection[this.game.id][this.game.home_team].InFavor.touch=[],this.totalDataCollection[this.game.id][this.game.home_team].InFavor.positions=[],this.totalDataCollection[this.game.id][this.game.home_team].Against={},this.totalDataCollection[this.game.id][this.game.home_team].Against.touch=[],this.totalDataCollection[this.game.id][this.game.home_team].Against.positions=[],(this.forGame||this.forSeason)&&(this.totalDataCollection[this.game.id][this.game.away_team]={},this.totalDataCollection[this.game.id][this.game.away_team].InFavor={},this.totalDataCollection[this.game.id][this.game.away_team].InFavor.touch=[],this.totalDataCollection[this.game.id][this.game.away_team].InFavor.positions=[],this.totalDataCollection[this.game.id][this.game.away_team].Against={},this.totalDataCollection[this.game.id][this.game.away_team].Against.touch=[],this.totalDataCollection[this.game.id][this.game.away_team].Against.positions=[])},validateDataLocalStorage(e){return this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].touch.length>0&&this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].positions.length>0?(this.touchDataSelected=this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].touch,this.positionsDataSelected=this.totalDataCollection[e.game.id][e.team][e.inFavor?"InFavor":"Against"].positions,!1):!0},getGamesByTeam(e){this.forSeason?e.type=="home"?this.gamesAllHome=e.games.filter(function(r){return(r.home_team==e.idTeam||r.visiting_team==e.idTeam)&&r.game_status==1}):this.gamesAllAway=e.games.filter(function(r){return(r.home_team==e.idTeam||r.visiting_team==e.idTeam)&&r.game_status==1}):this.forGame?e.type=="home"?this.gamesAllHome=e.games.filter(function(r){return r.game_id==e.game.id}):this.gamesAllAway=e.games.filter(function(r){return r.game_id==e.game.id}):this.gamesAllHome=e.games.filter(function(r){return(r.home_team==e.idTeam||r.visiting_team==e.idTeam)&&r.game_status==1})},async getDataCorners(e){const r=_u.create({headers:{Authorization:`${this.token}`}});let i=await r.get("https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?seasons="+e.season);i.data.data[0].games.filter(O=>O.game_status===1).length==0?(this.regularflag=!0,i=await r.get("https://qyyibs1w0d.execute-api.us-west-2.amazonaws.com/prod/calendar/gamesBySeason?seasons="+this.game.regularSeasonId)):this.regularflag=!1,this.forSeason?(this.getGamesByTeam({games:i.data.data[0].games,idTeam:e.home_team,type:"home"}),this.getGamesByTeam({games:i.data.data[0].games,idTeam:e.away_team,type:"away"}),this.validateDataLocalStorage({team:this.game.home_team,inFavor:!0,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.game.home_team,inFavor:!0,game:this.game})):this.forGame?(this.getGamesByTeam({games:i.data.data[0].games,idTeam:e.home_team,game:this.game,type:"home"}),this.getGamesByTeam({games:i.data.data[0].games,idTeam:e.away_team,game:this.game,type:"away"}),this.validateDataLocalStorage({team:this.game.home_team,inFavor:!0,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.game.home_team,inFavor:!0,game:this.game})):(this.getGamesByTeam({games:i.data.data[0].games,idTeam:e.home_team,type:"home"}),this.validateDataLocalStorage({team:e.home_team,inFavor:!0,game:this.game})&&await this.requestOrchestrator({games:this.gamesAllHome,team:this.game.home_team,inFavor:!0,game:this.game}))},obtenerNombreAbreviado(e){let r=e.split(", ");if(r.length!==2)return e;let i=r[0],O=r[1],R=i.split(" ")[0];return O.charAt(0).toUpperCase()+". "+R},getDataPlayers(e){for(let r=0;r<e.length;r++)this.playersData.hasOwnProperty(e[r].player_id)||(this.playersData[e[r].player_id]={name:this.obtenerNombreAbreviado(e[r].name),last_name:e[r].name.includes(",")?e[r].name.split(",")[0].trim():"",first_name:e[r].name.includes(",")?e[r].name.split(",")[1].trim():"",img:e[r].photo,photo:e[r].photo,position:e[r].position_id,positions:[e[r].position_id],id:e[r].player_id,player_id:e[r].player_id,team_id:e[r].team_id,team:e[r].team_id,nationality_id:e[r].nationality_id,nationality_flag:"https://az755631.vo.msecnd.net/flags/"+e[r].nationality_id+".jpg",jersey:e[r].jersey,isSelected:!0})},getSeasonByGame(e){e.season!=""?this.seasonsByGame[e.game]=e.season:this.seasonsByGame[e.game]="-"},getMatchByGame(e){e.match!=""?this.matchesByGame[e.game]=e.match.replace("M","J"):this.matchesByGame[e.game]="-"},getRivalsByGame(e){this.rivalsByGame[e.favor?"InFavor":"Against"]?this.rivalsByGame[e.favor?"InFavor":"Against"][e.team]?this.rivalsByGame[e.favor?"InFavor":"Against"][e.team][e.game]=e.rival:(this.rivalsByGame[e.favor?"InFavor":"Against"][e.team]={},this.rivalsByGame[e.favor?"InFavor":"Against"][e.team][e.game]=e.rival):(this.rivalsByGame[e.favor?"InFavor":"Against"]={},this.rivalsByGame[e.favor?"InFavor":"Against"][e.team]={},this.rivalsByGame[e.favor?"InFavor":"Against"][e.team][e.game]=e.rival)},getDataTeams(e){for(let r=0;r<e.length;r++)this.teamsData.hasOwnProperty(e[r].team_id)||(this.teamsData[e[r].team_id]={name:e[r].name,acronym:e[r].acronym,img:"https://az755631.vo.msecnd.net/teams-80/"+e[r].team_id+".png",id:e[r].team_id})},getTypePlay(e){typeof e=="string"&&(this.typePlay=e)},clickOpenModal(){this.openModal=!this.openModal,document.body.classList.add("no-scroll")},clickCloseFinal(){this.openModal=!1,document.body.classList.remove("no-scroll")},onCornersFilled({corners:e,cornersAgainst:r}){this.teamCorners={corners:e,cornersAgainst:r}},onOpenMediaPlayer(e){this.$emit("open-media-player",e)},onOpenMediaPlayerJson(e){let r={seasonId:this.seasonId,mainSectionType:1,playListType:3,categoryIds:[e.id],gameIds:this.forGame?[this.game.id]:null,playerIds:[],goalkeeperIds:[],teamId:this.teamSelected,matchResult:[1,2,3],playData:{},advancedFilter:{playListTitle:""}};this.$emit("open-media-player",r)}},mounted(){this.isLoading=!0,document.body.classList.add("no-scroll"),this.setHeaderStickyListener();const e=()=>{const r=document.querySelector(".gsc-set-piece");r?this.containerWidth=r.clientWidth:setTimeout(()=>{},400)};window.addEventListener("resize",e),this.$nextTick(e)}},uX=()=>{t.useCssVars(e=>({"7c49192c":e.heightFilters}))},dX=eM.setup;eM.setup=dX?(e,r)=>(uX(),dX(e,r)):uX;const $oa={class:"gsc-set-piece"},Uoa={key:0,class:"overlay-loading"},Hoa={ref:"header",class:"gsc-set-piece__header"};function Goa(e,r,i,O,R,l){const g=t.resolveComponent("GSCHeaderSetPiece"),n=t.resolveComponent("GSCDataToHighlight"),x=t.resolveComponent("GSCTrend"),d=t.resolveComponent("GSCConnectionsSetPiece"),a=t.resolveComponent("GSCModalBreakdown"),_=t.resolveComponent("GSCSpecificPlays");return t.openBlock(),t.createElementBlock("div",$oa,[R.isLoading?(t.openBlock(),t.createElementBlock("div",Uoa,r[0]||(r[0]=[t.createElementVNode("div",{class:"overlay-loading__spinner"},[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/images-library/balon_liga.png",alt:""})],-1),t.createElementVNode("div",{class:"overlay-loading__text"},"Loading...",-1)]))):t.createCommentVNode("",!0),t.createElementVNode("div",Hoa,[(t.openBlock(),t.createBlock(g,{"width-container":R.containerWidth,type:i.forTeam?0:3,"teams-data":R.teamsData,"tournament-selected":i.tournamentSelected,"game-info":i.game,"total-corners":l.calculateTotal,"show-corners":R.showCorners,"in-favor":R.infavoragainst,"corners-in-favor":R.teamCorners.corners,"corners-against":R.teamCorners.cornersAgainst,"for-game":i.forGame,key:R.updateFilter,lateralidad:R.lateralidad,"available-players":R.filterPlayersAvailable,"available-games":R.filterGamesAvailable,"is-synchronization":i.isSynchronization,onChangeShowFilters:l.onChangeShowFilters,onChangetypePlay:l.getTypePlay,onOpenModal:l.clickOpenModal,onTeamselected:l.getTeamSelected,onInfavoragainstteam:l.getInFavorAgainstTeam,onFilter_results_by_time:l.getFilterResultsByTime,onFilter_details:l.getFilterDetails,onFilter_games:l.getFilterGames,onFilter_takencorners:l.getFilterTakenCorners,onFilter_howwascorner:l.getFilterHowWasCorner,onFilter_zone:l.getFilterZone,onFilter_whathappened:l.getFilterWhatHappened},null,8,["width-container","type","teams-data","tournament-selected","game-info","total-corners","show-corners","in-favor","corners-in-favor","corners-against","for-game","lateralidad","available-players","available-games","is-synchronization","onChangeShowFilters","onChangetypePlay","onOpenModal","onTeamselected","onInfavoragainstteam","onFilter_results_by_time","onFilter_details","onFilter_games","onFilter_takencorners","onFilter_howwascorner","onFilter_zone","onFilter_whathappened"]))],512),!i.isSynchronization&&R.teamSelected>0&&R.regularflag!==null?(t.openBlock(),t.createBlock(n,{key:1,team:R.teamSelected,season:i.game.season,game:i.game,"flag-regular":R.regularflag,"in-favor":R.infavoragainst,"width-container":R.containerWidth},null,8,["team","season","game","flag-regular","in-favor","width-container"])):t.createCommentVNode("",!0),i.isSynchronization?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(x,{"players-data":R.playersData,"teams-data":R.teamsData,"tournament-selected":i.tournamentSelected,"touch-all-data":l.calculationTouchesData,"field-positions-all":l.calculationPositionsData,"width-container":R.containerWidth,"in-favor":R.infavoragainst,"for-game":i.forGame,"home-team":i.game.home_team,"away-team":i.game.away_team,"acronym-home":i.game.home_acronym,"acronym-away":i.game.away_acronym,team:R.teamSelected,"type-play":R.typePlay,selected_category:R.filters.cornertype,"is-tactic-visible":i.isTacticVisible,key:R.updateTrend,onChangelateralidad:l.setCornersSide},null,8,["players-data","teams-data","tournament-selected","touch-all-data","field-positions-all","width-container","in-favor","for-game","home-team","away-team","acronym-home","acronym-away","team","type-play","selected_category","is-tactic-visible","onChangelateralidad"])),!i.isSynchronization&&R.teamSelected>0?(t.openBlock(),t.createBlock(d,{"seasons-by-game":R.seasonsByGame,"matches-by-game":R.matchesByGame,"rivals-by-game":R.rivalsByGame,"width-container":R.containerWidth,selected_category:R.filters.cornertype,"players-data":R.playersData,"tournament-selected":i.tournamentSelected,"teams-data":R.teamsData,onChangelateralidad:l.setCornersSide,"touch-all-data":l.calculationTouchesData,"team-id":i.forGame?R.infavoragainst?R.teamSelected:R.teamSelected==i.game.home_team?i.game.away_team:i.game.home_team:R.teamSelected,"in-favor":R.infavoragainst,"for-game":i.forGame,key:R.updateConnections},null,8,["seasons-by-game","matches-by-game","rivals-by-game","width-container","selected_category","players-data","tournament-selected","teams-data","onChangelateralidad","touch-all-data","team-id","in-favor","for-game"])):t.createCommentVNode("",!0),R.openModal?(t.openBlock(),t.createBlock(a,{key:4,"component-width":R.containerWidth,onClickClose:l.clickCloseFinal,"show-modal-prop":R.openModal,id:R.teamSelected,"season-id":i.game.season,game:i.game.id,onClickPlay:l.onOpenMediaPlayerJson,prematch:!!i.forGame},null,8,["component-width","onClickClose","show-modal-prop","id","season-id","game","onClickPlay","prematch"])):t.createCommentVNode("",!0),R.isSpecificPlaysVisible&&R.teamSelected&&i.game.season?(t.openBlock(),t.createBlock(_,{key:5,"team-id-for-analysis":R.teamSelected,"season-id-for-analysis":i.game?i.game.season:R.seasonId,"width-container":R.containerWidth,filters:R.filters,"is-game-only":l.isGameOnly,"tournament-selected":i.tournamentSelected,selected_category:R.filters.cornertype,onChangelateralidad:l.setCornersSide,game:i.game,"is-against-mode":!R.infavoragainst,"are-filters-open":R.areFiltersOpen,"is-tactic-visible":i.isTacticVisible,"is-synchronization":i.isSynchronization,"can-play-videos":i.canPlayVideos,"video-privileges-playing-as":i.videoPrivilegesPlayingAs,onOpenMediaPlayer:l.onOpenMediaPlayer,onCornersFilled:l.onCornersFilled},null,8,["team-id-for-analysis","season-id-for-analysis","width-container","filters","is-game-only","tournament-selected","selected_category","onChangelateralidad","game","is-against-mode","are-filters-open","is-tactic-visible","is-synchronization","can-play-videos","video-privileges-playing-as","onOpenMediaPlayer","onCornersFilled"])):t.createCommentVNode("",!0)])}const qoa=yu(eM,[["render",Goa],["__scopeId","data-v-ad5445e6"]]),$2a="",U2a="",Woa={class:"datagame-container"},Zoa=eo({__name:"GSCTacticaFijaMain",props:{game:{type:Object,default:()=>({})},isTacticVisible:{type:Boolean,default:!0},isSynchronization:{type:Boolean,default:!1},tournamentSelected:{type:Object,default:()=>({})},canPlayVideos:{type:Boolean,default:!0},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])}},emits:["open-media-player"],setup(e,{emit:r}){function i(O){r("open-media-player",O)}return(O,R)=>(t.openBlock(),t.createElementBlock("div",Woa,[t.createVNode(t.unref(qoa),{game:{id:e.game.gameId,home_team:e.game.homeTeam.team_id,away_team:e.game.awayTeam.team_id,season:e.game.seasonId,regularSeasonId:e.game.regularSeasonId,game_status:e.game.game_status,home_acronym:e.game.homeTeam.acronym,away_acronym:e.game.awayTeam.acronym,logo_home:"https://az755631.vo.msecnd.net/teams-80/"+e.game.homeTeam.team_id+".png",logo_away:"https://az755631.vo.msecnd.net/teams-80/"+e.game.awayTeam.team_id+".png"},"tournament-selected":e.tournamentSelected,"for-season":e.game.game_status===4,"for-team":!1,"for-game":e.game.game_status!==4,"is-tactic-visible":e.isTacticVisible,"is-synchronization":e.isSynchronization,"can-play-videos":e.canPlayVideos,"video-privileges-playing-as":e.videoPrivilegesPlayingAs,onOpenMediaPlayer:i},null,8,["game","tournament-selected","for-season","for-game","is-tactic-visible","is-synchronization","can-play-videos","video-privileges-playing-as"])]))}},[["__scopeId","data-v-d1bc575d"]]),gb=(e,r)=>{const i=e.__vccOpts||e;for(const[O,R]of r)i[O]=R;return i},Yoa={__name:"ButtonCustom",props:{text:{type:String,default:""},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},padding:{type:String,default:"0px"},borderRadius:{type:String,default:"0px"},borderWidth:{type:String,default:"1px"},borderColor:{type:String,default:"#d9d9d9"},backgroundColor:{type:String,default:"#FFFFFF"},activeBackgroundColor:{type:String,default:""},activeBorderColor:{type:String,default:""},activeBorderWidth:{type:String,default:"1px"},activeFontColor:{type:String,default:""},fontColor:{type:String,default:"#000000"},fontSize:{type:String,default:"16px"},fontFamily:{type:String,default:"Poppins-Regular, sans-serif"},isActive:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:r}){const i=e,O=t.computed(()=>({"--height":i.height,"--width":i.width,"--padding":i.padding,"--border-radius":i.borderRadius,"--border":`solid ${i.borderWidth} ${i.borderColor}`,"--background-color":i.backgroundColor,"--font-color":i.fontColor,"--font-size":i.fontSize,"--font-family":i.fontFamily,"--active-background-color":i.activeBackgroundColor||i.backgroundColor,"--active-border-color":i.activeBorderColor||i.borderColor,"--active-font-color":i.activeFontColor||i.fontColor}));function R(){r("click")}return(l,g)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["button",{active:e.isActive}]),style:t.normalizeStyle(O.value),onClick:R},t.toDisplayString(e.text),7))}},Xoa=gb(Yoa,[["__scopeId","data-v-ea76c1c1"]]);function hX(e,r){return function(){return e.apply(r,arguments)}}const{toString:Joa}=Object.prototype,{getPrototypeOf:tM}=Object,o6=(e=>r=>{const i=Joa.call(r);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Qm=e=>(e=e.toLowerCase(),r=>o6(r)===e),s6=e=>r=>typeof r===e,{isArray:Xv}=Array,yb=s6("undefined");function Koa(e){return e!==null&&!yb(e)&&e.constructor!==null&&!yb(e.constructor)&&hf(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const pX=Qm("ArrayBuffer");function Qoa(e){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(e):r=e&&e.buffer&&pX(e.buffer),r}const esa=s6("string"),hf=s6("function"),fX=s6("number"),l6=e=>e!==null&&typeof e=="object",tsa=e=>e===!0||e===!1,c6=e=>{if(o6(e)!=="object")return!1;const r=tM(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},asa=Qm("Date"),nsa=Qm("File"),rsa=Qm("Blob"),isa=Qm("FileList"),osa=e=>l6(e)&&hf(e.pipe),ssa=e=>{let r;return e&&(typeof FormData=="function"&&e instanceof FormData||hf(e.append)&&((r=o6(e))==="formdata"||r==="object"&&hf(e.toString)&&e.toString()==="[object FormData]"))},lsa=Qm("URLSearchParams"),csa=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function vb(e,r,{allOwnKeys:i=!1}={}){if(e===null||typeof e>"u")return;let O,R;if(typeof e!="object"&&(e=[e]),Xv(e))for(O=0,R=e.length;O<R;O++)r.call(null,e[O],O,e);else{const l=i?Object.getOwnPropertyNames(e):Object.keys(e),g=l.length;let n;for(O=0;O<g;O++)n=l[O],r.call(null,e[n],n,e)}}function mX(e,r){r=r.toLowerCase();const i=Object.keys(e);let O=i.length,R;for(;O-- >0;)if(R=i[O],r===R.toLowerCase())return R;return null}const gX=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),yX=e=>!yb(e)&&e!==gX;function aM(){const{caseless:e}=yX(this)&&this||{},r={},i=(O,R)=>{const l=e&&mX(r,R)||R;c6(r[l])&&c6(O)?r[l]=aM(r[l],O):c6(O)?r[l]=aM({},O):Xv(O)?r[l]=O.slice():r[l]=O};for(let O=0,R=arguments.length;O<R;O++)arguments[O]&&vb(arguments[O],i);return r}const usa=(e,r,i,{allOwnKeys:O}={})=>(vb(r,(R,l)=>{i&&hf(R)?e[l]=hX(R,i):e[l]=R},{allOwnKeys:O}),e),dsa=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),hsa=(e,r,i,O)=>{e.prototype=Object.create(r.prototype,O),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:r.prototype}),i&&Object.assign(e.prototype,i)},psa=(e,r,i,O)=>{let R,l,g;const n={};if(r=r||{},e==null)return r;do{for(R=Object.getOwnPropertyNames(e),l=R.length;l-- >0;)g=R[l],(!O||O(g,e,r))&&!n[g]&&(r[g]=e[g],n[g]=!0);e=i!==!1&&tM(e)}while(e&&(!i||i(e,r))&&e!==Object.prototype);return r},fsa=(e,r,i)=>{e=String(e),(i===void 0||i>e.length)&&(i=e.length),i-=r.length;const O=e.indexOf(r,i);return O!==-1&&O===i},msa=e=>{if(!e)return null;if(Xv(e))return e;let r=e.length;if(!fX(r))return null;const i=new Array(r);for(;r-- >0;)i[r]=e[r];return i},gsa=(e=>r=>e&&r instanceof e)(typeof Uint8Array<"u"&&tM(Uint8Array)),ysa=(e,r)=>{const i=(e&&e[Symbol.iterator]).call(e);let O;for(;(O=i.next())&&!O.done;){const R=O.value;r.call(e,R[0],R[1])}},vsa=(e,r)=>{let i;const O=[];for(;(i=e.exec(r))!==null;)O.push(i);return O},_sa=Qm("HTMLFormElement"),bsa=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,O){return i.toUpperCase()+O}),vX=(({hasOwnProperty:e})=>(r,i)=>e.call(r,i))(Object.prototype),xsa=Qm("RegExp"),_X=(e,r)=>{const i=Object.getOwnPropertyDescriptors(e),O={};vb(i,(R,l)=>{let g;(g=r(R,l,e))!==!1&&(O[l]=g||R)}),Object.defineProperties(e,O)},wsa=e=>{_X(e,(r,i)=>{if(hf(e)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const O=e[i];if(hf(O)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},ksa=(e,r)=>{const i={},O=R=>{R.forEach(l=>{i[l]=!0})};return Xv(e)?O(e):O(String(e).split(r)),i},Ssa=()=>{},Csa=(e,r)=>(e=+e,Number.isFinite(e)?e:r),nM="abcdefghijklmnopqrstuvwxyz",bX="0123456789",xX={DIGIT:bX,ALPHA:nM,ALPHA_DIGIT:nM+nM.toUpperCase()+bX},Tsa=(e=16,r=xX.ALPHA_DIGIT)=>{let i="";const{length:O}=r;for(;e--;)i+=r[Math.random()*O|0];return i};function Asa(e){return!!(e&&hf(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Esa=e=>{const r=new Array(10),i=(O,R)=>{if(l6(O)){if(r.indexOf(O)>=0)return;if(!("toJSON"in O)){r[R]=O;const l=Xv(O)?[]:{};return vb(O,(g,n)=>{const x=i(g,R+1);!yb(x)&&(l[n]=x)}),r[R]=void 0,l}}return O};return i(e,0)},Msa=Qm("AsyncFunction"),Isa=e=>e&&(l6(e)||hf(e))&&hf(e.then)&&hf(e.catch),Kr={isArray:Xv,isArrayBuffer:pX,isBuffer:Koa,isFormData:ssa,isArrayBufferView:Qoa,isString:esa,isNumber:fX,isBoolean:tsa,isObject:l6,isPlainObject:c6,isUndefined:yb,isDate:asa,isFile:nsa,isBlob:rsa,isRegExp:xsa,isFunction:hf,isStream:osa,isURLSearchParams:lsa,isTypedArray:gsa,isFileList:isa,forEach:vb,merge:aM,extend:usa,trim:csa,stripBOM:dsa,inherits:hsa,toFlatObject:psa,kindOf:o6,kindOfTest:Qm,endsWith:fsa,toArray:msa,forEachEntry:ysa,matchAll:vsa,isHTMLForm:_sa,hasOwnProperty:vX,hasOwnProp:vX,reduceDescriptors:_X,freezeMethods:wsa,toObjectSet:ksa,toCamelCase:bsa,noop:Ssa,toFiniteNumber:Csa,findKey:mX,global:gX,isContextDefined:yX,ALPHABET:xX,generateString:Tsa,isSpecCompliantForm:Asa,toJSONObject:Esa,isAsyncFn:Msa,isThenable:Isa};function Fc(e,r,i,O,R){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",r&&(this.code=r),i&&(this.config=i),O&&(this.request=O),R&&(this.response=R)}Kr.inherits(Fc,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Kr.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const wX=Fc.prototype,kX={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{kX[e]={value:e}}),Object.defineProperties(Fc,kX),Object.defineProperty(wX,"isAxiosError",{value:!0}),Fc.from=(e,r,i,O,R,l)=>{const g=Object.create(wX);return Kr.toFlatObject(e,g,function(n){return n!==Error.prototype},n=>n!=="isAxiosError"),Fc.call(g,e.message,r,i,O,R),g.cause=e,g.name=e.name,l&&Object.assign(g,l),g};const Bsa=null;function rM(e){return Kr.isPlainObject(e)||Kr.isArray(e)}function SX(e){return Kr.endsWith(e,"[]")?e.slice(0,-2):e}function CX(e,r,i){return e?e.concat(r).map(function(O,R){return O=SX(O),!i&&R?"["+O+"]":O}).join(i?".":""):r}function Psa(e){return Kr.isArray(e)&&!e.some(rM)}const Osa=Kr.toFlatObject(Kr,{},null,function(e){return/^is[A-Z]/.test(e)});function u6(e,r,i){if(!Kr.isObject(e))throw new TypeError("target must be an object");r=r||new FormData,i=Kr.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,c){return!Kr.isUndefined(c[y])});const O=i.metaTokens,R=i.visitor||d,l=i.dots,g=i.indexes,n=(i.Blob||typeof Blob<"u"&&Blob)&&Kr.isSpecCompliantForm(r);if(!Kr.isFunction(R))throw new TypeError("visitor must be a function");function x(y){if(y===null)return"";if(Kr.isDate(y))return y.toISOString();if(!n&&Kr.isBlob(y))throw new Fc("Blob is not supported. Use a Buffer instead.");return Kr.isArrayBuffer(y)||Kr.isTypedArray(y)?n&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function d(y,c,o){let s=y;if(y&&!o&&typeof y=="object"){if(Kr.endsWith(c,"{}"))c=O?c:c.slice(0,-2),y=JSON.stringify(y);else if(Kr.isArray(y)&&Psa(y)||(Kr.isFileList(y)||Kr.endsWith(c,"[]"))&&(s=Kr.toArray(y)))return c=SX(c),s.forEach(function(f,h){!(Kr.isUndefined(f)||f===null)&&r.append(g===!0?CX([c],h,l):g===null?c:c+"[]",x(f))}),!1}return rM(y)?!0:(r.append(CX(o,c,l),x(y)),!1)}const a=[],_=Object.assign(Osa,{defaultVisitor:d,convertValue:x,isVisitable:rM});function b(y,c){if(!Kr.isUndefined(y)){if(a.indexOf(y)!==-1)throw Error("Circular reference detected in "+c.join("."));a.push(y),Kr.forEach(y,function(o,s){(!(Kr.isUndefined(o)||o===null)&&R.call(r,o,Kr.isString(s)?s.trim():s,c,_))===!0&&b(o,c?c.concat(s):[s])}),a.pop()}}if(!Kr.isObject(e))throw new TypeError("data must be an object");return b(e),r}function TX(e){const r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return r[i]})}function iM(e,r){this._pairs=[],e&&u6(e,this,r)}const AX=iM.prototype;AX.append=function(e,r){this._pairs.push([e,r])},AX.toString=function(e){const r=e?function(i){return e.call(this,i,TX)}:TX;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function Lsa(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function EX(e,r,i){if(!r)return e;const O=i&&i.encode||Lsa,R=i&&i.serialize;let l;if(R?l=R(r,i):l=Kr.isURLSearchParams(r)?r.toString():new iM(r,i).toString(O),l){const g=e.indexOf("#");g!==-1&&(e=e.slice(0,g)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class zsa{constructor(){this.handlers=[]}use(r,i,O){return this.handlers.push({fulfilled:r,rejected:i,synchronous:O?O.synchronous:!1,runWhen:O?O.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){Kr.forEach(this.handlers,function(i){i!==null&&r(i)})}}const MX=zsa,IX={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Nsa=typeof URLSearchParams<"u"?URLSearchParams:iM,Fsa=typeof FormData<"u"?FormData:null,Dsa=typeof Blob<"u"?Blob:null,Rsa={isBrowser:!0,classes:{URLSearchParams:Nsa,FormData:Fsa,Blob:Dsa},protocols:["http","https","file","blob","url","data"]},BX=typeof window<"u"&&typeof document<"u",Vsa=(e=>BX&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),jsa=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),$sa=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:BX,hasStandardBrowserEnv:Vsa,hasStandardBrowserWebWorkerEnv:jsa},Symbol.toStringTag,{value:"Module"})),e0={...$sa,...Rsa};function Usa(e,r){return u6(e,new e0.classes.URLSearchParams,Object.assign({visitor:function(i,O,R,l){return e0.isNode&&Kr.isBuffer(i)?(this.append(O,i.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)}},r))}function Hsa(e){return Kr.matchAll(/\w+|\[(\w*)]/g,e).map(r=>r[0]==="[]"?"":r[1]||r[0])}function Gsa(e){const r={},i=Object.keys(e);let O;const R=i.length;let l;for(O=0;O<R;O++)l=i[O],r[l]=e[l];return r}function PX(e){function r(i,O,R,l){let g=i[l++];if(g==="__proto__")return!0;const n=Number.isFinite(+g),x=l>=i.length;return g=!g&&Kr.isArray(R)?R.length:g,x?(Kr.hasOwnProp(R,g)?R[g]=[R[g],O]:R[g]=O,!n):((!R[g]||!Kr.isObject(R[g]))&&(R[g]=[]),r(i,O,R[g],l)&&Kr.isArray(R[g])&&(R[g]=Gsa(R[g])),!n)}if(Kr.isFormData(e)&&Kr.isFunction(e.entries)){const i={};return Kr.forEachEntry(e,(O,R)=>{r(Hsa(O),R,i,0)}),i}return null}function qsa(e,r,i){if(Kr.isString(e))try{return(r||JSON.parse)(e),Kr.trim(e)}catch(O){if(O.name!=="SyntaxError")throw O}return(i||JSON.stringify)(e)}const oM={transitional:IX,adapter:["xhr","http"],transformRequest:[function(e,r){const i=r.getContentType()||"",O=i.indexOf("application/json")>-1,R=Kr.isObject(e);if(R&&Kr.isHTMLForm(e)&&(e=new FormData(e)),Kr.isFormData(e))return O?JSON.stringify(PX(e)):e;if(Kr.isArrayBuffer(e)||Kr.isBuffer(e)||Kr.isStream(e)||Kr.isFile(e)||Kr.isBlob(e))return e;if(Kr.isArrayBufferView(e))return e.buffer;if(Kr.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(R){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Usa(e,this.formSerializer).toString();if((l=Kr.isFileList(e))||i.indexOf("multipart/form-data")>-1){const g=this.env&&this.env.FormData;return u6(l?{"files[]":e}:e,g&&new g,this.formSerializer)}}return R||O?(r.setContentType("application/json",!1),qsa(e)):e}],transformResponse:[function(e){const r=this.transitional||oM.transitional,i=r&&r.forcedJSONParsing,O=this.responseType==="json";if(e&&Kr.isString(e)&&(i&&!this.responseType||O)){const R=!(r&&r.silentJSONParsing)&&O;try{return JSON.parse(e)}catch(l){if(R)throw l.name==="SyntaxError"?Fc.from(l,Fc.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:e0.classes.FormData,Blob:e0.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Kr.forEach(["delete","get","head","post","put","patch"],e=>{oM.headers[e]={}});const sM=oM,Wsa=Kr.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Zsa=e=>{const r={};let i,O,R;return e&&e.split(`
8202
8202
  `).forEach(function(l){R=l.indexOf(":"),i=l.substring(0,R).trim().toLowerCase(),O=l.substring(R+1).trim(),!(!i||r[i]&&Wsa[i])&&(i==="set-cookie"?r[i]?r[i].push(O):r[i]=[O]:r[i]=r[i]?r[i]+", "+O:O)}),r},OX=Symbol("internals");function _b(e){return e&&String(e).trim().toLowerCase()}function d6(e){return e===!1||e==null?e:Kr.isArray(e)?e.map(d6):String(e)}function Ysa(e){const r=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let O;for(;O=i.exec(e);)r[O[1]]=O[2];return r}const Xsa=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function lM(e,r,i,O,R){if(Kr.isFunction(O))return O.call(this,r,i);if(R&&(r=i),!!Kr.isString(r)){if(Kr.isString(O))return r.indexOf(O)!==-1;if(Kr.isRegExp(O))return O.test(r)}}function Jsa(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(r,i,O)=>i.toUpperCase()+O)}function Ksa(e,r){const i=Kr.toCamelCase(" "+r);["get","set","has"].forEach(O=>{Object.defineProperty(e,O+i,{value:function(R,l,g){return this[O].call(this,r,R,l,g)},configurable:!0})})}class h6{constructor(r){r&&this.set(r)}set(r,i,O){const R=this;function l(n,x,d){const a=_b(x);if(!a)throw new Error("header name must be a non-empty string");const _=Kr.findKey(R,a);(!_||R[_]===void 0||d===!0||d===void 0&&R[_]!==!1)&&(R[_||x]=d6(n))}const g=(n,x)=>Kr.forEach(n,(d,a)=>l(d,a,x));return Kr.isPlainObject(r)||r instanceof this.constructor?g(r,i):Kr.isString(r)&&(r=r.trim())&&!Xsa(r)?g(Zsa(r),i):r!=null&&l(i,r,O),this}get(r,i){if(r=_b(r),r){const O=Kr.findKey(this,r);if(O){const R=this[O];if(!i)return R;if(i===!0)return Ysa(R);if(Kr.isFunction(i))return i.call(this,R,O);if(Kr.isRegExp(i))return i.exec(R);throw new TypeError("parser must be boolean|regexp|function")}}}has(r,i){if(r=_b(r),r){const O=Kr.findKey(this,r);return!!(O&&this[O]!==void 0&&(!i||lM(this,this[O],O,i)))}return!1}delete(r,i){const O=this;let R=!1;function l(g){if(g=_b(g),g){const n=Kr.findKey(O,g);n&&(!i||lM(O,O[n],n,i))&&(delete O[n],R=!0)}}return Kr.isArray(r)?r.forEach(l):l(r),R}clear(r){const i=Object.keys(this);let O=i.length,R=!1;for(;O--;){const l=i[O];(!r||lM(this,this[l],l,r,!0))&&(delete this[l],R=!0)}return R}normalize(r){const i=this,O={};return Kr.forEach(this,(R,l)=>{const g=Kr.findKey(O,l);if(g){i[g]=d6(R),delete i[l];return}const n=r?Jsa(l):String(l).trim();n!==l&&delete i[l],i[n]=d6(R),O[n]=!0}),this}concat(...r){return this.constructor.concat(this,...r)}toJSON(r){const i=Object.create(null);return Kr.forEach(this,(O,R)=>{O!=null&&O!==!1&&(i[R]=r&&Kr.isArray(O)?O.join(", "):O)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([r,i])=>r+": "+i).join(`
8203
8203
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...i){const O=new this(r);return i.forEach(R=>O.set(R)),O}static accessor(r){const i=(this[OX]=this[OX]={accessors:{}}).accessors,O=this.prototype;function R(l){const g=_b(l);i[g]||(Ksa(O,l),i[g]=!0)}return Kr.isArray(r)?r.forEach(R):R(r),this}}h6.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Kr.reduceDescriptors(h6.prototype,({value:e},r)=>{let i=r[0].toUpperCase()+r.slice(1);return{get:()=>e,set(O){this[i]=O}}}),Kr.freezeMethods(h6);const c0=h6;function cM(e,r){const i=this||sM,O=r||i,R=c0.from(O.headers);let l=O.data;return Kr.forEach(e,function(g){l=g.call(i,l,R.normalize(),r?r.status:void 0)}),R.normalize(),l}function LX(e){return!!(e&&e.__CANCEL__)}function bb(e,r,i){Fc.call(this,e??"canceled",Fc.ERR_CANCELED,r,i),this.name="CanceledError"}Kr.inherits(bb,Fc,{__CANCEL__:!0});function Qsa(e,r,i){const O=i.config.validateStatus;!i.status||!O||O(i.status)?e(i):r(new Fc("Request failed with status code "+i.status,[Fc.ERR_BAD_REQUEST,Fc.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}const ela=e0.hasStandardBrowserEnv?{write(e,r,i,O,R,l){const g=[e+"="+encodeURIComponent(r)];Kr.isNumber(i)&&g.push("expires="+new Date(i).toGMTString()),Kr.isString(O)&&g.push("path="+O),Kr.isString(R)&&g.push("domain="+R),l===!0&&g.push("secure"),document.cookie=g.join("; ")},read(e){const r=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function tla(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ala(e,r){return r?e.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):e}function zX(e,r){return e&&!tla(r)?ala(e,r):r}const nla=e0.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let i;function O(R){let l=R;return e&&(r.setAttribute("href",l),l=r.href),r.setAttribute("href",l),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return i=O(window.location.href),function(R){const l=Kr.isString(R)?O(R):R;return l.protocol===i.protocol&&l.host===i.host}}():function(){return function(){return!0}}();function rla(e){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return r&&r[1]||""}function ila(e,r){e=e||10;const i=new Array(e),O=new Array(e);let R=0,l=0,g;return r=r!==void 0?r:1e3,function(n){const x=Date.now(),d=O[l];g||(g=x),i[R]=n,O[R]=x;let a=l,_=0;for(;a!==R;)_+=i[a++],a=a%e;if(R=(R+1)%e,R===l&&(l=(l+1)%e),x-g<r)return;const b=d&&x-d;return b?Math.round(_*1e3/b):void 0}}function NX(e,r){let i=0;const O=ila(50,250);return R=>{const l=R.loaded,g=R.lengthComputable?R.total:void 0,n=l-i,x=O(n),d=l<=g;i=l;const a={loaded:l,total:g,progress:g?l/g:void 0,bytes:n,rate:x||void 0,estimated:x&&g&&d?(g-l)/x:void 0,event:R};a[r?"download":"upload"]=!0,e(a)}}const ola=typeof XMLHttpRequest<"u",sla=ola&&function(e){return new Promise(function(r,i){let O=e.data;const R=c0.from(e.headers).normalize();let{responseType:l,withXSRFToken:g}=e,n;function x(){e.cancelToken&&e.cancelToken.unsubscribe(n),e.signal&&e.signal.removeEventListener("abort",n)}let d;if(Kr.isFormData(O)){if(e0.hasStandardBrowserEnv||e0.hasStandardBrowserWebWorkerEnv)R.setContentType(!1);else if((d=R.getContentType())!==!1){const[c,...o]=d?d.split(";").map(s=>s.trim()).filter(Boolean):[];R.setContentType([c||"multipart/form-data",...o].join("; "))}}let a=new XMLHttpRequest;if(e.auth){const c=e.auth.username||"",o=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";R.set("Authorization","Basic "+btoa(c+":"+o))}const _=zX(e.baseURL,e.url);a.open(e.method.toUpperCase(),EX(_,e.params,e.paramsSerializer),!0),a.timeout=e.timeout;function b(){if(!a)return;const c=c0.from("getAllResponseHeaders"in a&&a.getAllResponseHeaders()),o={data:!l||l==="text"||l==="json"?a.responseText:a.response,status:a.status,statusText:a.statusText,headers:c,config:e,request:a};Qsa(function(s){r(s),x()},function(s){i(s),x()},o),a=null}if("onloadend"in a?a.onloadend=b:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(b)},a.onabort=function(){a&&(i(new Fc("Request aborted",Fc.ECONNABORTED,e,a)),a=null)},a.onerror=function(){i(new Fc("Network Error",Fc.ERR_NETWORK,e,a)),a=null},a.ontimeout=function(){let c=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const o=e.transitional||IX;e.timeoutErrorMessage&&(c=e.timeoutErrorMessage),i(new Fc(c,o.clarifyTimeoutError?Fc.ETIMEDOUT:Fc.ECONNABORTED,e,a)),a=null},e0.hasStandardBrowserEnv&&(g&&Kr.isFunction(g)&&(g=g(e)),g||g!==!1&&nla(_))){const c=e.xsrfHeaderName&&e.xsrfCookieName&&ela.read(e.xsrfCookieName);c&&R.set(e.xsrfHeaderName,c)}O===void 0&&R.setContentType(null),"setRequestHeader"in a&&Kr.forEach(R.toJSON(),function(c,o){a.setRequestHeader(o,c)}),Kr.isUndefined(e.withCredentials)||(a.withCredentials=!!e.withCredentials),l&&l!=="json"&&(a.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&a.addEventListener("progress",NX(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",NX(e.onUploadProgress)),(e.cancelToken||e.signal)&&(n=c=>{a&&(i(!c||c.type?new bb(null,e,a):c),a.abort(),a=null)},e.cancelToken&&e.cancelToken.subscribe(n),e.signal&&(e.signal.aborted?n():e.signal.addEventListener("abort",n)));const y=rla(_);if(y&&e0.protocols.indexOf(y)===-1){i(new Fc("Unsupported protocol "+y+":",Fc.ERR_BAD_REQUEST,e));return}a.send(O||null)})},uM={http:Bsa,xhr:sla};Kr.forEach(uM,(e,r)=>{if(e){try{Object.defineProperty(e,"name",{value:r})}catch{}Object.defineProperty(e,"adapterName",{value:r})}});const FX=e=>`- ${e}`,lla=e=>Kr.isFunction(e)||e===null||e===!1,DX={getAdapter:e=>{e=Kr.isArray(e)?e:[e];const{length:r}=e;let i,O;const R={};for(let l=0;l<r;l++){i=e[l];let g;if(O=i,!lla(i)&&(O=uM[(g=String(i)).toLowerCase()],O===void 0))throw new Fc(`Unknown adapter '${g}'`);if(O)break;R[g||"#"+l]=O}if(!O){const l=Object.entries(R).map(([n,x])=>`adapter ${n} `+(x===!1?"is not supported by the environment":"is not available in the build"));let g=r?l.length>1?`since :
8204
8204
  `+l.map(FX).join(`