MCPcopy Index your code
hub / github.com/plotly/plotly.py / useObject

Method useObject

plotly/package_data/plotly.min.js:3803–3803  ·  view source on GitHub ↗
(w)

Source from the content-addressed store, hash-verified

3801`}),staticAttributes:Q,staticUniforms:Fe}}class Sr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(w,B,Q,ee,le,Fe,Ze,ut,Mt){this.context=w;let Jt=this.boundPaintVertexBuffers.length!==ee.length;for(let $t=0;!Jt&&$t<ee.length;$t++)this.boundPaintVertexBuffers[$t]!==ee[$t]&&(Jt=!0);!this.vao||this.boundProgram!==B||this.boundLayoutVertexBuffer!==Q||Jt||this.boundIndexBuffer!==le||this.boundVertexOffset!==Fe||this.boundDynamicVertexBuffer!==Ze||this.boundDynamicVertexBuffer2!==ut||this.boundDynamicVertexBuffer3!==Mt?this.freshBind(B,Q,ee,le,Fe,Ze,ut,Mt):(w.bindVertexArray.set(this.vao),Ze&&Ze.bind(),le&&le.dynamicDraw&&le.bind(),ut&&ut.bind(),Mt&&Mt.bind())}freshBind(w,B,Q,ee,le,Fe,Ze,ut){let Mt=w.numAttributes,Jt=this.context,$t=Jt.gl;this.vao&&this.destroy(),this.vao=Jt.createVertexArray(),Jt.bindVertexArray.set(this.vao),this.boundProgram=w,this.boundLayoutVertexBuffer=B,this.boundPaintVertexBuffers=Q,this.boundIndexBuffer=ee,this.boundVertexOffset=le,this.boundDynamicVertexBuffer=Fe,this.boundDynamicVertexBuffer2=Ze,this.boundDynamicVertexBuffer3=ut,B.enableAttributes($t,w);for(let yr of Q)yr.enableAttributes($t,w);Fe&&Fe.enableAttributes($t,w),Ze&&Ze.enableAttributes($t,w),ut&&ut.enableAttributes($t,w),B.bind(),B.setVertexAttribPointers($t,w,le);for(let yr of Q)yr.bind(),yr.setVertexAttribPointers($t,w,le);Fe&&(Fe.bind(),Fe.setVertexAttribPointers($t,w,le)),ee&&ee.bind(),Ze&&(Ze.bind(),Ze.setVertexAttribPointers($t,w,le)),ut&&(ut.bind(),ut.setVertexAttribPointers($t,w,le)),Jt.currentNumAttributes=Mt}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let Jr=(ue,w,B,Q,ee)=>({u_matrix:ue,u_texture:0,u_ele_delta:w,u_fog_matrix:B,u_fog_color:Q?Q.properties.get("fog-color"):a.aM.white,u_fog_ground_blend:Q?Q.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:Q?Q.calculateFogBlendOpacity(ee):0,u_horizon_color:Q?Q.properties.get("horizon-color"):a.aM.white,u_horizon_fog_blend:Q?Q.properties.get("horizon-fog-blend"):1});function hi(ue){let w=[];for(let B=0;B<ue.length;B++){if(ue[B]===null)continue;let Q=ue[B].split(" ");w.push(Q.pop())}return w}class hn{constructor(w,B,Q,ee,le,Fe){let Ze=w.gl;this.program=Ze.createProgram();let ut=hi(B.staticAttributes),Mt=Q?Q.getBinderAttributes():[],Jt=ut.concat(Mt),$t=Gn.prelude.staticUniforms?hi(Gn.prelude.staticUniforms):[],yr=B.staticUniforms?hi(B.staticUniforms):[],Cr=Q?Q.getBinderUniforms():[],ve=$t.concat(yr).concat(Cr),xe=[];for(let Wt of ve)xe.indexOf(Wt)<0&&xe.push(Wt);let Ie=Q?Q.defines():[];le&&Ie.push("#define OVERDRAW_INSPECTOR;"),Fe&&Ie.push("#define TERRAIN3D;");let ze=Ie.concat(Gn.prelude.fragmentSource,B.fragmentSource).join(`
3802`),Qe=Ie.concat(Gn.prelude.vertexSource,B.vertexSource).join(`
3803`),Xe=Ze.createShader(Ze.FRAGMENT_SHADER);if(Ze.isContextLost())return void(this.failedToCreate=!0);if(Ze.shaderSource(Xe,ze),Ze.compileShader(Xe),!Ze.getShaderParameter(Xe,Ze.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${Ze.getShaderInfoLog(Xe)}`);Ze.attachShader(this.program,Xe);let nt=Ze.createShader(Ze.VERTEX_SHADER);if(Ze.isContextLost())return void(this.failedToCreate=!0);if(Ze.shaderSource(nt,Qe),Ze.compileShader(nt),!Ze.getShaderParameter(nt,Ze.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${Ze.getShaderInfoLog(nt)}`);Ze.attachShader(this.program,nt),this.attributes={};let qt={};this.numAttributes=Jt.length;for(let Wt=0;Wt<this.numAttributes;Wt++)Jt[Wt]&&(Ze.bindAttribLocation(this.program,Wt,Jt[Wt]),this.attributes[Jt[Wt]]=Wt);if(Ze.linkProgram(this.program),!Ze.getProgramParameter(this.program,Ze.LINK_STATUS))throw new Error(`Program failed to link: ${Ze.getProgramInfoLog(this.program)}`);Ze.deleteShader(nt),Ze.deleteShader(Xe);for(let Wt=0;Wt<xe.length;Wt++){let nr=xe[Wt];if(nr&&!qt[nr]){let fr=Ze.getUniformLocation(this.program,nr);fr&&(qt[nr]=fr)}}this.fixedUniforms=ee(w,qt),this.terrainUniforms=((Wt,nr)=>({u_depth:new a.aH(Wt,nr.u_depth),u_terrain:new a.aH(Wt,nr.u_terrain),u_terrain_dim:new a.aI(Wt,nr.u_terrain_dim),u_terrain_matrix:new a.aJ(Wt,nr.u_terrain_matrix),u_terrain_unpack:new a.aK(Wt,nr.u_terrain_unpack),u_terrain_exaggeration:new a.aI(Wt,nr.u_terrain_exaggeration)}))(w,qt),this.binderUniforms=Q?Q.getUniforms(w,qt):[]}draw(w,B,Q,ee,le,Fe,Ze,ut,Mt,Jt,$t,yr,Cr,ve,xe,Ie,ze,Qe){let Xe=w.gl;if(this.failedToCreate)return;if(w.program.set(this.program),w.setDepthMode(Q),w.setStencilMode(ee),w.setColorMode(le),w.setCullFace(Fe),ut){w.activeTexture.set(Xe.TEXTURE2),Xe.bindTexture(Xe.TEXTURE_2D,ut.depthTexture),w.activeTexture.set(Xe.TEXTURE3),Xe.bindTexture(Xe.TEXTURE_2D,ut.texture);for(let qt in this.terrainUniforms)this.terrainUniforms[qt].set(ut[qt])}for(let qt in this.fixedUniforms)this.fixedUniforms[qt].set(Ze[qt]);xe&&xe.setUniforms(w,this.binderUniforms,Cr,{zoom:ve});let nt=0;switch(B){case Xe.LINES:nt=2;break;case Xe.TRIANGLES:nt=3;break;case Xe.LINE_STRIP:nt=1}for(let qt of yr.get()){let Wt=qt.vaos||(qt.vaos={});(Wt[Mt]||(Wt[Mt]=new Sr)).bind(w,this,Jt,xe?xe.getPaintVertexBuffers():[],$t,qt.vertexOffset,Ie,ze,Qe),Xe.drawElements(B,qt.primitiveLength*nt,Xe.UNSIGNED_SHORT,qt.primitiveOffset*nt*2)}}}function Sn(ue,w,B){let Q=1/Fn(B,1,w.transform.tileZoom),ee=Math.pow(2,B.tileID.overscaledZ),le=B.tileSize*Math.pow(2,w.transform.tileZoom)/ee,Fe=le*(B.tileID.canonical.x+B.tileID.wrap*ee),Ze=le*B.tileID.canonical.y;return{u_image:0,u_texsize:B.imageAtlasTexture.size,u_scale:[Q,ue.fromScale,ue.toScale],u_fade:ue.t,u_pixel_coord_upper:[Fe>>16,Ze>>16],u_pixel_coord_lower:[65535&Fe,65535&Ze]}}let En=(ue,w,B,Q)=>{let ee=w.style.light,le=ee.properties.get("position"),Fe=[le.x,le.y,le.z],Ze=function(){var Mt=new a.A(9);return a.A!=Float32Array&&(Mt[1]=0,Mt[2]=0,Mt[3]=0,Mt[5]=0,Mt[6]=0,Mt[7]=0),Mt[0]=1,Mt[4]=1,Mt[8]=1,Mt}();ee.properties.get("anchor")==="viewport"&&function(Mt,Jt){var $t=Math.sin(Jt),yr=Math.cos(Jt);Mt[0]=yr,Mt[1]=$t,Mt[2]=0,Mt[3]=-$t,Mt[4]=yr,Mt[5]=0,Mt[6]=0,Mt[7]=0,Mt[8]=1}(Ze,-w.transform.angle),function(Mt,Jt,$t){var yr=Jt[0],Cr=Jt[1],ve=Jt[2];Mt[0]=yr*$t[0]+Cr*$t[3]+ve*$t[6],Mt[1]=yr*$t[1]+Cr*$t[4]+ve*$t[7],Mt[2]=yr*$t[2]+Cr*$t[5]+ve*$t[8]}(Fe,Fe,Ze);let ut=ee.properties.get("color");return{u_matrix:ue,u_lightpos:Fe,u_lightintensity:ee.properties.get("intensity"),u_lightcolor:[ut.r,ut.g,ut.b],u_vertical_gradient:+B,u_opacity:Q}},ki=(ue,w,B,Q,ee,le,Fe)=>a.e(En(ue,w,B,Q),Sn(le,w,Fe),{u_height_factor:-Math.pow(2,ee.overscaledZ)/Fe.tileSize/8}),_n=ue=>({u_matrix:ue}),ya=(ue,w,B,Q)=>a.e(_n(ue),Sn(B,w,Q)),ea=(ue,w)=>({u_matrix:ue,u_world:w}),Ma=(ue,w,B,Q,ee)=>a.e(ya(ue,w,B,Q),{u_world:ee}),_o=(ue,w,B,Q)=>{let ee=ue.transform,le,Fe;if(Q.paint.get("circle-pitch-alignment")==="map"){let Ze=Fn(B,1,ee.zoom);le=!0,Fe=[Ze,Ze]}else le=!1,Fe=ee.pixelsToGLUnits;return{u_camera_to_center_distance:ee.cameraToCenterDistance,u_scale_with_map:+(Q.paint.get("circle-pitch-scale")==="map"),u_matrix:ue.translatePosMatrix(w.posMatrix,B,Q.paint.get("circle-translate"),Q.paint.get("circle-translate-anchor")),u_pitch_with_map:+le,u_device_pixel_ratio:ue.pixelRatio,u_extrude_scale:Fe}},No=(ue,w,B)=>({u_matrix:ue,u_inv_matrix:w,u_camera_to_center_distance:B.cameraToCenterDistance,u_viewport_size:[B.width,B.height]}),po=(ue,w,B=1)=>({u_matrix:ue,u_color:w,u_overlay:0,u_overlay_scale:B}),Lo=ue=>({u_matrix:ue}),ko=(ue,w,B,Q)=>({u_matrix:ue,u_extrude_scale:Fn(w,1,B),u_intensity:Q}),Ds=(ue,w,B,Q)=>{let ee=a.H();a.aP(ee,0,ue.width,ue.height,0,0,1);let le=ue.context.gl;return{u_matrix:ee,u_world:[le.drawingBufferWidth,le.drawingBufferHeight],u_image:B,u_color_ramp:Q,u_opacity:w.paint.get("heatmap-opacity")}};function Fs(ue,w){let B=Math.pow(2,w.canonical.z),Q=w.canonical.y;return[new a.Z(0,Q/B).toLngLat().lat,new a.Z(0,(Q+1)/B).toLngLat().lat]}let ll=(ue,w,B,Q)=>{let ee=ue.transform;return{u_matrix:As(ue,w,B,Q),u_ratio:1/Fn(w,1,ee.zoom),u_device_pixel_ratio:ue.pixelRatio,u_units_to_pixels:[1/ee.pixelsToGLUnits[0],1/ee.pixelsToGLUnits[1]]}},ul=(ue,w,B,Q,ee)=>a.e(ll(ue,w,B,ee),{u_image:0,u_image_height:Q}),zl=(ue,w,B,Q,ee)=>{let le=ue.transform,Fe=il(w,le);return{u_matrix:As(ue,w,B,ee),u_texsize:w.imageAtlasTexture.size,u_ratio:1/Fn(w,1,le.zoom),u_device_pixel_ratio:ue.pixelRatio,u_image:0,u_scale:[Fe,Q.fromScale,Q.toScale],u_fade:Q.t,u_units_to_pixels:[1/le.pixelsToGLUnits[0],1/le.pixelsToGLUnits[1]]}},us=(ue,w,B,Q,ee,le)=>{let Fe=ue.lineAtlas,Ze=il(w,ue.transform),ut=B.layout.get("line-cap")==="round",Mt=Fe.getDash(Q.from,ut),Jt=Fe.getDash(Q.to,ut),$t=Mt.width*ee.fromScale,yr=Jt.width*ee.toScale;return a.e(ll(ue,w,B,le),{u_patternscale_a:[Ze/$t,-Mt.height/2],u_patternscale_b:[Ze/yr,-Jt.height/2],u_sdfgamma:Fe.width/(256*Math.min($t,yr)*ue.pixelRatio)/2,u_image:0,u_tex_y_a:Mt.y,u_tex_y_b:Jt.y,u_mix:ee.t})};function il(ue,w){return 1/Fn(ue,1,w.tileZoom)}function As(ue,w,B,Q){return ue.translatePosMatrix(Q?Q.posMatrix:w.tileID.posMatrix,w,B.paint.get("line-translate"),B.paint.get("line-translate-anchor"))}let cl=(ue,w,B,Q,ee)=>{return{u_matrix:ue,u_tl_parent:w,u_scale_parent:B,u_buffer_scale:1,u_fade_t:Q.mix,u_opacity:Q.opacity*ee.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:ee.paint.get("raster-brightness-min"),u_brightness_high:ee.paint.get("raster-brightness-max"),u_saturation_factor:(Fe=ee.paint.get("raster-saturation"),Fe>0?1-1/(1.001-Fe):-Fe),u_contrast_factor:(le=ee.paint.get("raster-contrast"),le>0?1/(1-le):1+le),u_spin_weights:Ks(ee.paint.get("raster-hue-rotate"))};var le,Fe};function Ks(ue){ue*=Math.PI/180;let w=Math.sin(ue),B=Math.cos(ue);return[(2*B+1)/3,(-Math.sqrt(3)*w-B+1)/3,(Math.sqrt(3)*w-B+1)/3]}let zs=(ue,w,B,Q,ee,le,Fe,Ze,ut,Mt,Jt,$t,yr,Cr)=>{let ve=Fe.transform;return{u_is_size_zoom_constant:+(ue==="constant"||ue==="source"),u_is_size_feature_constant:+(ue==="constant"||ue==="camera"),u_size_t:w?w.uSizeT:0,u_size:w?w.uSize:0,u_camera_to_center_distance:ve.cameraToCenterDistance,u_pitch:ve.pitch/360*2*Math.PI,u_rotate_symbol:+B,u_aspect_ratio:ve.width/ve.height,u_fade_change:Fe.options.fadeDuration?Fe.symbolFadeChange:1,u_matrix:Ze,u_label_plane_matrix:ut,u_coord_matrix:Mt,u_is_text:+$t,u_pitch_with_map:+Q,u_is_along_line:ee,u_is_variable_anchor:le,u_texsize:yr,u_texture:0,u_translation:Jt,u_pitched_scale:Cr}},Io=(ue,w,B,Q,ee,le,Fe,Ze,ut,Mt,Jt,$t,yr,Cr,ve)=>{let xe=Fe.transform;return a.e(zs(ue,w,B,Q,ee,le,Fe,Ze,ut,Mt,Jt,$t,yr,ve),{u_gamma_scale:Q?Math.cos(xe._pitch)*xe.cameraToCenterDistance:1,u_device_pixel_ratio:Fe.pixelRatio,u_is_halo:+Cr})},ls=(ue,w,B,Q,ee,le,Fe,Ze,ut,Mt,Jt,$t,yr,Cr)=>a.e(Io(ue,w,B,Q,ee,le,Fe,Ze,ut,Mt,Jt,!0,$t,!0,Cr),{u_texsize_icon:yr,u_texture_icon:1}),Yl=(ue,w,B)=>({u_matrix:ue,u_opacity:w,u_color:B}),Su=(ue,w,B,Q,ee,le)=>a.e(function(Fe,Ze,ut,Mt){let Jt=ut.imageManager.getPattern(Fe.from.toString()),$t=ut.imageManager.getPattern(Fe.to.toString()),{width:yr,height:Cr}=ut.imageManager.getPixelSize(),ve=Math.pow(2,Mt.tileID.overscaledZ),xe=Mt.tileSize*Math.pow(2,ut.transform.tileZoom)/ve,Ie=xe*(Mt.tileID.canonical.x+Mt.tileID.wrap*ve),ze=xe*Mt.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Jt.tl,u_pattern_br_a:Jt.br,u_pattern_tl_b:$t.tl,u_pattern_br_b:$t.br,u_texsize:[yr,Cr],u_mix:Ze.t,u_pattern_size_a:Jt.displaySize,u_pattern_size_b:$t.displaySize,u_scale_a:Ze.fromScale,u_scale_b:Ze.toScale,u_tile_units_to_pixels:1/Fn(Mt,1,ut.transform.tileZoom),u_pixel_coord_upper:[Ie>>16,ze>>16],u_pixel_coord_lower:[65535&Ie,65535&ze]}}(Q,le,B,ee),{u_matrix:ue,u_opacity:w}),nc={fillExtrusion:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_lightpos:new a.aN(ue,w.u_lightpos),u_lightintensity:new a.aI(ue,w.u_lightintensity),u_lightcolor:new a.aN(ue,w.u_lightcolor),u_vertical_gradient:new a.aI(ue,w.u_vertical_gradient),u_opacity:new a.aI(ue,w.u_opacity)}),fillExtrusionPattern:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_lightpos:new a.aN(ue,w.u_lightpos),u_lightintensity:new a.aI(ue,w.u_lightintensity),u_lightcolor:new a.aN(ue,w.u_lightcolor),u_vertical_gradient:new a.aI(ue,w.u_vertical_gradient),u_height_factor:new a.aI(ue,w.u_height_factor),u_image:new a.aH(ue,w.u_image),u_texsize:new a.aO(ue,w.u_texsize),u_pixel_coord_upper:new a.aO(ue,w.u_pixel_coord_upper),u_pixel_coord_lower:new a.aO(ue,w.u_pixel_coord_lower),u_scale:new a.aN(ue,w.u_scale),u_fade:new a.aI(ue,w.u_fade),u_opacity:new a.aI(ue,w.u_opacity)}),fill:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix)}),fillPattern:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_image:new a.aH(ue,w.u_image),u_texsize:new a.aO(ue,w.u_texsize),u_pixel_coord_upper:new a.aO(ue,w.u_pixel_coord_upper),u_pixel_coord_lower:new a.aO(ue,w.u_pixel_coord_lower),u_scale:new a.aN(ue,w.u_scale),u_fade:new a.aI(ue,w.u_fade)}),fillOutline:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_world:new a.aO(ue,w.u_world)}),fillOutlinePattern:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_world:new a.aO(ue,w.u_world),u_image:new a.aH(ue,w.u_image),u_texsize:new a.aO(ue,w.u_texsize),u_pixel_coord_upper:new a.aO(ue,w.u_pixel_coord_upper),u_pixel_coord_lower:new a.aO(ue,w.u_pixel_coord_lower),u_scale:new a.aN(ue,w.u_scale),u_fade:new a.aI(ue,w.u_fade)}),circle:(ue,w)=>({u_camera_to_center_distance:new a.aI(ue,w.u_camera_to_center_distance),u_scale_with_map:new a.aH(ue,w.u_scale_with_map),u_pitch_with_map:new a.aH(ue,w.u_pitch_with_map),u_extrude_scale:new a.aO(ue,w.u_extrude_scale),u_device_pixel_ratio:new a.aI(ue,w.u_device_pixel_ratio),u_matrix:new a.aJ(ue,w.u_matrix)}),collisionBox:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_pixel_extrude_scale:new a.aO(ue,w.u_pixel_extrude_scale)}),collisionCircle:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_inv_matrix:new a.aJ(ue,w.u_inv_matrix),u_camera_to_center_distance:new a.aI(ue,w.u_camera_to_center_distance),u_viewport_size:new a.aO(ue,w.u_viewport_size)}),debug:(ue,w)=>({u_color:new a.aL(ue,w.u_color),u_matrix:new a.aJ(ue,w.u_matrix),u_overlay:new a.aH(ue,w.u_overlay),u_overlay_scale:new a.aI(ue,w.u_overlay_scale)}),clippingMask:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix)}),heatmap:(ue,w)=>({u_extrude_scale:new a.aI(ue,w.u_extrude_scale),u_intensity:new a.aI(ue,w.u_intensity),u_matrix:new a.aJ(ue,w.u_matrix)}),heatmapTexture:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_world:new a.aO(ue,w.u_world),u_image:new a.aH(ue,w.u_image),u_color_ramp:new a.aH(ue,w.u_color_ramp),u_opacity:new a.aI(ue,w.u_opacity)}),hillshade:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_image:new a.aH(ue,w.u_image),u_latrange:new a.aO(ue,w.u_latrange),u_light:new a.aO(ue,w.u_light),u_shadow:new a.aL(ue,w.u_shadow),u_highlight:new a.aL(ue,w.u_highlight),u_accent:new a.aL(ue,w.u_accent)}),hillshadePrepare:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_image:new a.aH(ue,w.u_image),u_dimension:new a.aO(ue,w.u_dimension),u_zoom:new a.aI(ue,w.u_zoom),u_unpack:new a.aK(ue,w.u_unpack)}),line:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_ratio:new a.aI(ue,w.u_ratio),u_device_pixel_ratio:new a.aI(ue,w.u_device_pixel_ratio),u_units_to_pixels:new a.aO(ue,w.u_units_to_pixels)}),lineGradient:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_ratio:new a.aI(ue,w.u_ratio),u_device_pixel_ratio:new a.aI(ue,w.u_device_pixel_ratio),u_units_to_pixels:new a.aO(ue,w.u_units_to_pixels),u_image:new a.aH(ue,w.u_image),u_image_height:new a.aI(ue,w.u_image_height)}),linePattern:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_texsize:new a.aO(ue,w.u_texsize),u_ratio:new a.aI(ue,w.u_ratio),u_device_pixel_ratio:new a.aI(ue,w.u_device_pixel_ratio),u_image:new a.aH(ue,w.u_image),u_units_to_pixels:new a.aO(ue,w.u_units_to_pixels),u_scale:new a.aN(ue,w.u_scale),u_fade:new a.aI(ue,w.u_fade)}),lineSDF:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_ratio:new a.aI(ue,w.u_ratio),u_device_pixel_ratio:new a.aI(ue,w.u_device_pixel_ratio),u_units_to_pixels:new a.aO(ue,w.u_units_to_pixels),u_patternscale_a:new a.aO(ue,w.u_patternscale_a),u_patternscale_b:new a.aO(ue,w.u_patternscale_b),u_sdfgamma:new a.aI(ue,w.u_sdfgamma),u_image:new a.aH(ue,w.u_image),u_tex_y_a:new a.aI(ue,w.u_tex_y_a),u_tex_y_b:new a.aI(ue,w.u_tex_y_b),u_mix:new a.aI(ue,w.u_mix)}),raster:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_tl_parent:new a.aO(ue,w.u_tl_parent),u_scale_parent:new a.aI(ue,w.u_scale_parent),u_buffer_scale:new a.aI(ue,w.u_buffer_scale),u_fade_t:new a.aI(ue,w.u_fade_t),u_opacity:new a.aI(ue,w.u_opacity),u_image0:new a.aH(ue,w.u_image0),u_image1:new a.aH(ue,w.u_image1),u_brightness_low:new a.aI(ue,w.u_brightness_low),u_brightness_high:new a.aI(ue,w.u_brightness_high),u_saturation_factor:new a.aI(ue,w.u_saturation_factor),u_contrast_factor:new a.aI(ue,w.u_contrast_factor),u_spin_weights:new a.aN(ue,w.u_spin_weights)}),symbolIcon:(ue,w)=>({u_is_size_zoom_constant:new a.aH(ue,w.u_is_size_zoom_constant),u_is_size_feature_constant:new a.aH(ue,w.u_is_size_feature_constant),u_size_t:new a.aI(ue,w.u_size_t),u_size:new a.aI(ue,w.u_size),u_camera_to_center_distance:new a.aI(ue,w.u_camera_to_center_distance),u_pitch:new a.aI(ue,w.u_pitch),u_rotate_symbol:new a.aH(ue,w.u_rotate_symbol),u_aspect_ratio:new a.aI(ue,w.u_aspect_ratio),u_fade_change:new a.aI(ue,w.u_fade_change),u_matrix:new a.aJ(ue,w.u_matrix),u_label_plane_matrix:new a.aJ(ue,w.u_label_plane_matrix),u_coord_matrix:new a.aJ(ue,w.u_coord_matrix),u_is_text:new a.aH(ue,w.u_is_text),u_pitch_with_map:new a.aH(ue,w.u_pitch_with_map),u_is_along_line:new a.aH(ue,w.u_is_along_line),u_is_variable_anchor:new a.aH(ue,w.u_is_variable_anchor),u_texsize:new a.aO(ue,w.u_texsize),u_texture:new a.aH(ue,w.u_texture),u_translation:new a.aO(ue,w.u_translation),u_pitched_scale:new a.aI(ue,w.u_pitched_scale)}),symbolSDF:(ue,w)=>({u_is_size_zoom_constant:new a.aH(ue,w.u_is_size_zoom_constant),u_is_size_feature_constant:new a.aH(ue,w.u_is_size_feature_constant),u_size_t:new a.aI(ue,w.u_size_t),u_size:new a.aI(ue,w.u_size),u_camera_to_center_distance:new a.aI(ue,w.u_camera_to_center_distance),u_pitch:new a.aI(ue,w.u_pitch),u_rotate_symbol:new a.aH(ue,w.u_rotate_symbol),u_aspect_ratio:new a.aI(ue,w.u_aspect_ratio),u_fade_change:new a.aI(ue,w.u_fade_change),u_matrix:new a.aJ(ue,w.u_matrix),u_label_plane_matrix:new a.aJ(ue,w.u_label_plane_matrix),u_coord_matrix:new a.aJ(ue,w.u_coord_matrix),u_is_text:new a.aH(ue,w.u_is_text),u_pitch_with_map:new a.aH(ue,w.u_pitch_with_map),u_is_along_line:new a.aH(ue,w.u_is_along_line),u_is_variable_anchor:new a.aH(ue,w.u_is_variable_anchor),u_texsize:new a.aO(ue,w.u_texsize),u_texture:new a.aH(ue,w.u_texture),u_gamma_scale:new a.aI(ue,w.u_gamma_scale),u_device_pixel_ratio:new a.aI(ue,w.u_device_pixel_ratio),u_is_halo:new a.aH(ue,w.u_is_halo),u_translation:new a.aO(ue,w.u_translation),u_pitched_scale:new a.aI(ue,w.u_pitched_scale)}),symbolTextAndIcon:(ue,w)=>({u_is_size_zoom_constant:new a.aH(ue,w.u_is_size_zoom_constant),u_is_size_feature_constant:new a.aH(ue,w.u_is_size_feature_constant),u_size_t:new a.aI(ue,w.u_size_t),u_size:new a.aI(ue,w.u_size),u_camera_to_center_distance:new a.aI(ue,w.u_camera_to_center_distance),u_pitch:new a.aI(ue,w.u_pitch),u_rotate_symbol:new a.aH(ue,w.u_rotate_symbol),u_aspect_ratio:new a.aI(ue,w.u_aspect_ratio),u_fade_change:new a.aI(ue,w.u_fade_change),u_matrix:new a.aJ(ue,w.u_matrix),u_label_plane_matrix:new a.aJ(ue,w.u_label_plane_matrix),u_coord_matrix:new a.aJ(ue,w.u_coord_matrix),u_is_text:new a.aH(ue,w.u_is_text),u_pitch_with_map:new a.aH(ue,w.u_pitch_with_map),u_is_along_line:new a.aH(ue,w.u_is_along_line),u_is_variable_anchor:new a.aH(ue,w.u_is_variable_anchor),u_texsize:new a.aO(ue,w.u_texsize),u_texsize_icon:new a.aO(ue,w.u_texsize_icon),u_texture:new a.aH(ue,w.u_texture),u_texture_icon:new a.aH(ue,w.u_texture_icon),u_gamma_scale:new a.aI(ue,w.u_gamma_scale),u_device_pixel_ratio:new a.aI(ue,w.u_device_pixel_ratio),u_is_halo:new a.aH(ue,w.u_is_halo),u_translation:new a.aO(ue,w.u_translation),u_pitched_scale:new a.aI(ue,w.u_pitched_scale)}),background:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_opacity:new a.aI(ue,w.u_opacity),u_color:new a.aL(ue,w.u_color)}),backgroundPattern:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_opacity:new a.aI(ue,w.u_opacity),u_image:new a.aH(ue,w.u_image),u_pattern_tl_a:new a.aO(ue,w.u_pattern_tl_a),u_pattern_br_a:new a.aO(ue,w.u_pattern_br_a),u_pattern_tl_b:new a.aO(ue,w.u_pattern_tl_b),u_pattern_br_b:new a.aO(ue,w.u_pattern_br_b),u_texsize:new a.aO(ue,w.u_texsize),u_mix:new a.aI(ue,w.u_mix),u_pattern_size_a:new a.aO(ue,w.u_pattern_size_a),u_pattern_size_b:new a.aO(ue,w.u_pattern_size_b),u_scale_a:new a.aI(ue,w.u_scale_a),u_scale_b:new a.aI(ue,w.u_scale_b),u_pixel_coord_upper:new a.aO(ue,w.u_pixel_coord_upper),u_pixel_coord_lower:new a.aO(ue,w.u_pixel_coord_lower),u_tile_units_to_pixels:new a.aI(ue,w.u_tile_units_to_pixels)}),terrain:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_texture:new a.aH(ue,w.u_texture),u_ele_delta:new a.aI(ue,w.u_ele_delta),u_fog_matrix:new a.aJ(ue,w.u_fog_matrix),u_fog_color:new a.aL(ue,w.u_fog_color),u_fog_ground_blend:new a.aI(ue,w.u_fog_ground_blend),u_fog_ground_blend_opacity:new a.aI(ue,w.u_fog_ground_blend_opacity),u_horizon_color:new a.aL(ue,w.u_horizon_color),u_horizon_fog_blend:new a.aI(ue,w.u_horizon_fog_blend)}),terrainDepth:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_ele_delta:new a.aI(ue,w.u_ele_delta)}),terrainCoords:(ue,w)=>({u_matrix:new a.aJ(ue,w.u_matrix),u_texture:new a.aH(ue,w.u_texture),u_terrain_coords_id:new a.aI(ue,w.u_terrain_coords_id),u_ele_delta:new a.aI(ue,w.u_ele_delta)}),sky:(ue,w)=>({u_sky_color:new a.aL(ue,w.u_sky_color),u_horizon_color:new a.aL(ue,w.u_horizon_color),u_horizon:new a.aI(ue,w.u_horizon),u_sky_horizon_blend:new a.aI(ue,w.u_sky_horizon_blend)})};class bs{constructor(w,B,Q){this.context=w;let ee=w.gl;this.buffer=ee.createBuffer(),this.dynamicDraw=!!Q,this.context.unbindVAO(),w.bindElementBuffer.set(this.buffer),ee.bufferData(ee.ELEMENT_ARRAY_BUFFER,B.arrayBuffer,this.dynamicDraw?ee.DYNAMIC_DRAW:ee.STATIC_DRAW),this.dynamicDraw||delete B.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(w){let B=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),B.bufferSubData(B.ELEMENT_ARRAY_BUFFER,0,w.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Rn={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class _a{constructor(w,B,Q,ee){this.length=B.length,this.attributes=Q,this.itemSize=B.bytesPerElement,this.dynamicDraw=ee,this.context=w;let le=w.gl;this.buffer=le.createBuffer(),w.bindVertexBuffer.set(this.buffer),le.bufferData(le.ARRAY_BUFFER,B.arrayBuffer,this.dynamicDraw?le.DYNAMIC_DRAW:le.STATIC_DRAW),this.dynamicDraw||delete B.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(w){if(w.length!==this.length)throw new Error(`Length of new data is ${w.length}, which doesn't match current length of ${this.length}`);let B=this.context.gl;this.bind(),B.bufferSubData(B.ARRAY_BUFFER,0,w.arrayBuffer)}enableAttributes(w,B){for(let Q=0;Q<this.attributes.length;Q++){let ee=B.attributes[this.attributes[Q].name];ee!==void 0&&w.enableVertexAttribArray(ee)}}setVertexAttribPointers(w,B,Q){for(let ee=0;ee<this.attributes.length;ee++){let le=this.attributes[ee],Fe=B.attributes[le.name];Fe!==void 0&&w.vertexAttribPointer(Fe,le.components,w[Rn[le.type]],!1,this.itemSize,le.offset+this.itemSize*(Q||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Vu=new WeakMap;function ql(ue){var w;if(Vu.has(ue))return Vu.get(ue);{let B=(w=ue.getParameter(ue.VERSION))===null||w===void 0?void 0:w.startsWith("WebGL 2.0");return Vu.set(ue,B),B}}class xo{constructor(w){this.gl=w.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(w){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Kl extends xo{getDefault(){return a.aM.transparent}set(w){let B=this.current;(w.r!==B.r||w.g!==B.g||w.b!==B.b||w.a!==B.a||this.dirty)&&(this.gl.clearColor(w.r,w.g,w.b,w.a),this.current=w,this.dirty=!1)}}class Ns extends xo{getDefault(){return 1}set(w){(w!==this.current||this.dirty)&&(this.gl.clearDepth(w),this.current=w,this.dirty=!1)}}class Hl extends xo{getDefault(){return 0}set(w){(w!==this.current||this.dirty)&&(this.gl.clearStencil(w),this.current=w,this.dirty=!1)}}class ac extends xo{getDefault(){return[!0,!0,!0,!0]}set(w){let B=this.current;(w[0]!==B[0]||w[1]!==B[1]||w[2]!==B[2]||w[3]!==B[3]||this.dirty)&&(this.gl.colorMask(w[0],w[1],w[2],w[3]),this.current=w,this.dirty=!1)}}class oa extends xo{getDefault(){return!0}set(w){(w!==this.current||this.dirty)&&(this.gl.depthMask(w),this.current=w,this.dirty=!1)}}class qo extends xo{getDefault(){return 255}set(w){(w!==this.current||this.dirty)&&(this.gl.stencilMask(w),this.current=w,this.dirty=!1)}}class Oo extends xo{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(w){let B=this.current;(w.func!==B.func||w.ref!==B.ref||w.mask!==B.mask||this.dirty)&&(this.gl.stencilFunc(w.func,w.ref,w.mask),this.current=w,this.dirty=!1)}}class Ol extends xo{getDefault(){let w=this.gl;return[w.KEEP,w.KEEP,w.KEEP]}set(w){let B=this.current;(w[0]!==B[0]||w[1]!==B[1]||w[2]!==B[2]||this.dirty)&&(this.gl.stencilOp(w[0],w[1],w[2]),this.current=w,this.dirty=!1)}}class Pc extends xo{getDefault(){return!1}set(w){if(w===this.current&&!this.dirty)return;let B=this.gl;w?B.enable(B.STENCIL_TEST):B.disable(B.STENCIL_TEST),this.current=w,this.dirty=!1}}class Do extends xo{getDefault(){return[0,1]}set(w){let B=this.current;(w[0]!==B[0]||w[1]!==B[1]||this.dirty)&&(this.gl.depthRange(w[0],w[1]),this.current=w,this.dirty=!1)}}class nf extends xo{getDefault(){return!1}set(w){if(w===this.current&&!this.dirty)return;let B=this.gl;w?B.enable(B.DEPTH_TEST):B.disable(B.DEPTH_TEST),this.current=w,this.dirty=!1}}class Vf extends xo{getDefault(){return this.gl.LESS}set(w){(w!==this.current||this.dirty)&&(this.gl.depthFunc(w),this.current=w,this.dirty=!1)}}class pl extends xo{getDefault(){return!1}set(w){if(w===this.current&&!this.dirty)return;let B=this.gl;w?B.enable(B.BLEND):B.disable(B.BLEND),this.current=w,this.dirty=!1}}class Zc extends xo{getDefault(){let w=this.gl;return[w.ONE,w.ZERO]}set(w){let B=this.current;(w[0]!==B[0]||w[1]!==B[1]||this.dirty)&&(this.gl.blendFunc(w[0],w[1]),this.current=w,this.dirty=!1)}}class Jl extends xo{getDefault(){return a.aM.transparent}set(w){let B=this.current;(w.r!==B.r||w.g!==B.g||w.b!==B.b||w.a!==B.a||this.dirty)&&(this.gl.blendColor(w.r,w.g,w.b,w.a),this.current=w,this.dirty=!1)}}class qs extends xo{getDefault(){return this.gl.FUNC_ADD}set(w){(w!==this.current||this.dirty)&&(this.gl.blendEquation(w),this.current=w,this.dirty=!1)}}class yu extends xo{getDefault(){return!1}set(w){if(w===this.current&&!this.dirty)return;let B=this.gl;w?B.enable(B.CULL_FACE):B.disable(B.CULL_FACE),this.current=w,this.dirty=!1}}class oc extends xo{getDefault(){return this.gl.BACK}set(w){(w!==this.current||this.dirty)&&(this.gl.cullFace(w),this.current=w,this.dirty=!1)}}class Cf extends xo{getDefault(){return this.gl.CCW}set(w){(w!==this.current||this.dirty)&&(this.gl.frontFace(w),this.current=w,this.dirty=!1)}}class sc extends xo{getDefault(){return null}set(w){(w!==this.current||this.dirty)&&(this.gl.useProgram(w),this.current=w,this.dirty=!1)}}class jh extends xo{getDefault(){return this.gl.TEXTURE0}set(w){(w!==this.current||this.dirty)&&(this.gl.activeTexture(w),this.current=w,this.dirty=!1)}}class Lf extends xo{getDefault(){let w=this.gl;return[0,0,w.drawingBufferWidth,w.drawingBufferHeight]}set(w){let B=this.current;(w[0]!==B[0]||w[1]!==B[1]||w[2]!==B[2]||w[3]!==B[3]||this.dirty)&&(this.gl.viewport(w[0],w[1],w[2],w[3]),this.current=w,this.dirty=!1)}}class cs extends xo{getDefault(){return null}set(w){if(w===this.current&&!this.dirty)return;let B=this.gl;B.bindFramebuffer(B.FRAMEBUFFER,w),this.current=w,this.dirty=!1}}class af extends xo{getDefault(){return null}set(w){if(w===this.current&&!this.dirty)return;let B=this.gl;B.bindRenderbuffer(B.RENDERBUFFER,w),this.current=w,this.dirty=!1}}class Gf extends xo{getDefault(){return null}set(w){if(w===this.current&&!this.dirty)return;let B=this.gl;B.bindTexture(B.TEXTURE_2D,w),this.current=w,this.dirty=!1}}class $l extends xo{getDefault(){return null}set(w){if(w===this.current&&!this.dirty)return;let B=this.gl;B.bindBuffer(B.ARRAY_BUFFER,w),this.current=w,this.dirty=!1}}class fl extends xo{getDefault(){return null}set(w){let B=this.gl;B.bindBuffer(B.ELEMENT_ARRAY_BUFFER,w),this.current=w,this.dirty=!1}}class lc extends xo{getDefault(){return null}set(w){var B;if(w===this.current&&!this.dirty)return;let Q=this.gl;ql(Q)?Q.bindVertexArray(w):(B=Q.getExtension("OES_vertex_array_object"))===null||B===void 0||B.bindVertexArrayOES(w),this.current=w,this.dirty=!1}}class Fu extends xo{getDefault(){return 4}set(w){if(w===this.current&&!this.dirty)return;let B=this.gl;B.pixelStorei(B.UNPACK_ALIGNMENT,w),this.current=w,this.dirty=!1}}class Es extends xo{getDefault(){return!1}set(w){if(w===this.current&&!this.dirty)return;let B=this.gl;B.pixelStorei(B.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w),this.current=w,this.dirty=!1}}class Hs extends xo{getDefault(){return!1}set(w){if(w===this.current&&!this.dirty)return;let B=this.gl;B.pixelStorei(B.UNPACK_FLIP_Y_WEBGL,w),this.current=w,this.dirty=!1}}class Go extends xo{constructor(w,B){super(w),this.context=w,this.parent=B}getDefault(){return null}}class ps extends Go{setDirty(){this.dirty=!0}set(w){if(w===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let B=this.gl;B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.TEXTURE_2D,w,0),this.current=w,this.dirty=!1}}class uc extends Go{set(w){if(w===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let B=this.gl;B.framebufferRenderbuffer(B.FRAMEBUFFER,B.DEPTH_ATTACHMENT,B.RENDERBUFFER,w),this.current=w,this.dirty=!1}}class xl extends Go{set(w){if(w===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let B=this.gl;B.framebufferRenderbuffer(B.FRAMEBUFFER,B.DEPTH_STENCIL_ATTACHMENT,B.RENDERBUFFER,w),this.current=w,this.dirty=!1}}class Gu{constructor(w,B,Q,ee,le){this.context=w,this.width=B,this.height=Q;let Fe=w.gl,Ze=this.framebuffer=Fe.createFramebuffer();if(this.colorAttachment=new ps(w,Ze),ee)this.depthAttachment=le?new xl(w,Ze):new uc(w,Ze);else if(le)throw new Error("Stencil cannot be set without depth");if(Fe.checkFramebufferStatus(Fe.FRAMEBUFFER)!==Fe.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){let w=this.context.gl,B=this.colorAttachment.get();if(B&&w.deleteTexture(B),this.depthAttachment){let Q=this.depthAttachment.get();Q&&w.deleteRenderbuffer(Q)}w.deleteFramebuffer(this.framebuffer)}}class Os{constructor(w,B,Q){this.blendFunction=w,this.blendColor=B,this.mask=Q}}Os.Replace=[1,0],Os.disabled=new Os(Os.Replace,a.aM.transparent,[!1,!1,!1,!1]),Os.unblended=new Os(Os.Replace,a.aM.transparent,[!0,!0,!0,!0]),Os.alphaBlended=new Os([1,771],a.aM.transparent,[!0,!0,!0,!0]);class od{constructor(w){var B,Q;if(this.gl=w,this.clearColor=new Kl(this),this.clearDepth=new Ns(this),this.clearStencil=new Hl(this),this.colorMask=new ac(this),this.depthMask=new oa(this),this.stencilMask=new qo(this),this.stencilFunc=new Oo(this),this.stencilOp=new Ol(this),this.stencilTest=new Pc(this),this.depthRange=new Do(this),this.depthTest=new nf(this),this.depthFunc=new Vf(this),this.blend=new pl(this),this.blendFunc=new Zc(this),this.blendColor=new Jl(this),this.blendEquation=new qs(this),this.cullFace=new yu(this),this.cullFaceSide=new oc(this),this.frontFace=new Cf(this),this.program=new sc(this),this.activeTexture=new jh(this),this.viewport=new Lf(this),this.bindFramebuffer=new cs(this),this.bindRenderbuffer=new af(this),this.bindTexture=new Gf(this),this.bindVertexBuffer=new $l(this),this.bindElementBuffer=new fl(this),this.bindVertexArray=new lc(this),this.pixelStoreUnpack=new Fu(this),this.pixelStoreUnpackPremultiplyAlpha=new Es(this),this.pixelStoreUnpackFlipY=new Hs(this),this.extTextureFilterAnisotropic=w.getExtension("EXT_texture_filter_anisotropic")||w.getExtension("MOZ_EXT_texture_filter_anisotropic")||w.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=w.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=w.getParameter(w.MAX_TEXTURE_SIZE),ql(w)){this.HALF_FLOAT=w.HALF_FLOAT;let ee=w.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(B=w.RGBA16F)!==null&&B!==void 0?B:ee==null?void 0:ee.RGBA16F_EXT,this.RGB16F=(Q=w.RGB16F)!==null&&Q!==void 0?Q:ee==null?void 0:ee.RGB16F_EXT,w.getExtension("EXT_color_buffer_float")}else{w.getExtension("EXT_color_buffer_half_float"),w.getExtension("OES_texture_half_float_linear");let ee=w.getExtension("OES_texture_half_float");this.HALF_FLOAT=ee==null?void 0:ee.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(w,B){return new bs(this,w,B)}createVertexBuffer(w,B,Q){return new _a(this,w,B,Q)}createRenderbuffer(w,B,Q){let ee=this.gl,le=ee.createRenderbuffer();return this.bindRenderbuffer.set(le),ee.renderbufferStorage(ee.RENDERBUFFER,w,B,Q),this.bindRenderbuffer.set(null),le}createFramebuffer(w,B,Q,ee){return new Gu(this,w,B,Q,ee)}clear({color:w,depth:B,stencil:Q}){let ee=this.gl,le=0;w&&(le|=ee.COLOR_BUFFER_BIT,this.clearColor.set(w),this.colorMask.set([!0,!0,!0,!0])),B!==void 0&&(le|=ee.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(B),this.depthMask.set(!0)),Q!==void 0&&(le|=ee.STENCIL_BUFFER_BIT,this.clearStencil.set(Q),this.stencilMask.set(255)),ee.clear(le)}setCullFace(w){w.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(w.mode),this.frontFace.set(w.frontFace))}setDepthMode(w){w.func!==this.gl.ALWAYS||w.mask?(this.depthTest.set(!0),this.depthFunc.set(w.func),this.depthMask.set(w.mask),this.depthRange.set(w.range)):this.depthTest.set(!1)}setStencilMode(w){w.test.func!==this.gl.ALWAYS||w.mask?(this.stencilTest.set(!0),this.stencilMask.set(w.mask),this.stencilOp.set([w.fail,w.depthFail,w.pass]),this.stencilFunc.set({func:w.test.func,ref:w.ref,mask:w.test.mask})):this.stencilTest.set(!1)}setColorMode(w){a.aE(w.blendFunction,Os.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(w.blendFunction),this.blendColor.set(w.blendColor)),this.colorMask.set(w.mask)}createVertexArray(){var w;return ql(this.gl)?this.gl.createVertexArray():(w=this.gl.getExtension("OES_vertex_array_object"))===null||w===void 0?void 0:w.createVertexArrayOES()}deleteVertexArray(w){var B;return ql(this.gl)?this.gl.deleteVertexArray(w):(B=this.gl.getExtension("OES_vertex_array_object"))===null||B===void 0?void 0:B.deleteVertexArrayOES(w)}unbindVAO(){this.bindVertexArray.set(null)}}class Po{constructor(w,B,Q){this.func=w,this.mask=B,this.range=Q}}Po.ReadOnly=!1,Po.ReadWrite=!0,Po.disabled=new Po(519,Po.ReadOnly,[0,1]);let sd=7680;class Ko{constructor(w,B,Q,ee,le,Fe){this.test=w,this.ref=B,this.mask=Q,this.fail=ee,this.depthFail=le,this.pass=Fe}}Ko.disabled=new Ko({func:519,mask:0},0,0,sd,sd,sd);class Pa{constructor(w,B,Q){this.enable=w,this.mode=B,this.frontFace=Q}}let of;function Hu(ue,w,B,Q,ee){let le=ue.context,Fe=le.gl,Ze=ue.useProgram("collisionBox"),ut=[],Mt=0,Jt=0;for(let ze=0;ze<Q.length;ze++){let Qe=Q[ze],Xe=w.getTile(Qe).getBucket(B);if(!Xe)continue;let nt=ee?Xe.textCollisionBox:Xe.iconCollisionBox,qt=Xe.collisionCircleArray;if(qt.length>0){let Wt=a.H();a.aQ(Wt,Xe.placementInvProjMatrix,ue.transform.glCoordMatrix),a.aQ(Wt,Wt,Xe.placementViewportMatrix),ut.push({circleArray:qt,circleOffset:Jt,transform:Qe.posMatrix,invTransform:Wt,coord:Qe}),Mt+=qt.length/4,Jt=Mt}nt&&Ze.draw(le,Fe.LINES,Po.disabled,Ko.disabled,ue.colorModeForRenderPass(),Pa.disabled,{u_matrix:Qe.posMatrix,u_pixel_extrude_scale:[1/($t=ue.transform).width,1/$t.height]},ue.style.map.terrain&&ue.style.map.terrain.getTerrainData(Qe),B.id,nt.layoutVertexBuffer,nt.indexBuffer,nt.segments,null,ue.transform.zoom,null,null,nt.collisionVertexBuffer)}var $t;if(!ee||!ut.length)return;let yr=ue.useProgram("collisionCircle"),Cr=new a.aR;Cr.resize(4*Mt),Cr._trim();let ve=0;for(let ze of ut)for(let Qe=0;Qe<ze.circleArray.length/4;Qe++){let Xe=4*Qe,nt=ze.circleArray[Xe+0],qt=ze.circleArray[Xe+1],Wt=ze.circleArray[Xe+2],nr=ze.circleArray[Xe+3];Cr.emplace(ve++,nt,qt,Wt,nr,0),Cr.emplace(ve++,nt,qt,Wt,nr,1),Cr.emplace(ve++,nt,qt,Wt,nr,2),Cr.emplace(ve++,nt,qt,Wt,nr,3)}(!of||of.length<2*Mt)&&(of=function(ze){let Qe=2*ze,Xe=new a.aT;Xe.resize(Qe),Xe._trim();for(let nt=0;nt<Qe;nt++){let qt=6*nt;Xe.uint16[qt+0]=4*nt+0,Xe.uint16[qt+1]=4*nt+1,Xe.uint16[qt+2]=4*nt+2,Xe.uint16[qt+3]=4*nt+2,Xe.uint16[qt+4]=4*nt+3,Xe.uint16[qt+5]=4*nt+0}return Xe}(Mt));let xe=le.createIndexBuffer(of,!0),Ie=le.createVertexBuffer(Cr,a.aS.members,!0);for(let ze of ut){let Qe=No(ze.transform,ze.invTransform,ue.transform);yr.draw(le,Fe.TRIANGLES,Po.disabled,Ko.disabled,ue.colorModeForRenderPass(),Pa.disabled,Qe,ue.style.map.terrain&&ue.style.map.terrain.getTerrainData(ze.coord),B.id,Ie,xe,a.a0.simpleSegment(0,2*ze.circleOffset,ze.circleArray.length,ze.circleArray.length/2),null,ue.transform.zoom,null,null,null)}Ie.destroy(),xe.destroy()}Pa.disabled=new Pa(!1,1029,2305),Pa.backCCW=new Pa(!0,1029,2305);let bl=a.an(new Float32Array(16));function Hf(ue,w,B,Q,ee,le){let{horizontalAlign:Fe,verticalAlign:Ze}=a.au(ue);return new a.P((-(Fe-.5)*w/ee+Q[0])*le,(-(Ze-.5)*B/ee+Q[1])*le)}function Ic(ue,w,B,Q,ee,le){let Fe=w.tileAnchorPoint.add(new a.P(w.translation[0],w.translation[1]));if(w.pitchWithMap){let Ze=Q.mult(le);B||(Ze=Ze.rotate(-ee));let ut=Fe.add(Ze);return gt(ut.x,ut.y,w.labelPlaneMatrix,w.getElevation).point}if(B){let Ze=Mr(w.tileAnchorPoint.x+1,w.tileAnchorPoint.y,w).point.sub(ue),ut=Math.atan(Ze.y/Ze.x)+(Ze.x<0?Math.PI:0);return ue.add(Q.rotate(ut))}return ue.add(Q)}function yf(ue,w,B,Q,ee,le,Fe,Ze,ut,Mt,Jt,$t,yr,Cr){let ve=ue.text.placedSymbolArray,xe=ue.text.dynamicLayoutVertexArray,Ie=ue.icon.dynamicLayoutVertexArray,ze={};xe.clear();for(let Qe=0;Qe<ve.length;Qe++){let Xe=ve.get(Qe),nt=Xe.hidden||!Xe.crossTileID||ue.allowVerticalPlacement&&!Xe.placedOrientation?null:Q[Xe.crossTileID];if(nt){let qt=new a.P(Xe.anchorX,Xe.anchorY),Wt={getElevation:Cr,width:ee.width,height:ee.height,labelPlaneMatrix:le,lineVertexArray:null,pitchWithMap:B,projection:Jt,projectionCache:null,tileAnchorPoint:qt,translation:$t,unwrappedTileID:yr},nr=B?gt(qt.x,qt.y,Fe,Cr):Mr(qt.x,qt.y,Wt),fr=Ge(ee.cameraToCenterDistance,nr.signedDistanceFromCamera),br=a.ai(ue.textSizeData,ut,Xe)*fr/a.ap;B&&(br*=ue.tilePixelRatio/Ze);let{width:Fr,height:Hr,anchor:ri,textOffset:Ci,textBoxScale:cn}=nt,sn=Hf(ri,Fr,Hr,Ci,cn,br),Ln=Jt.getPitchedTextCorrection(ee,qt.add(new a.P($t[0],$t[1])),yr),Yn=Ic(nr.point,Wt,w,sn,ee.angle,Ln),Aa=ue.allowVerticalPlacement&&Xe.placedOrientation===a.ah.vertical?Math.PI/2:0;for(let fa=0;fa<Xe.numGlyphs;fa++)a.aj(xe,Yn,Aa);Mt&&Xe.associatedIconIndex>=0&&(ze[Xe.associatedIconIndex]={shiftedAnchor:Yn,angle:Aa})}else Pi(Xe.numGlyphs,xe)}if(Mt){Ie.clear();let Qe=ue.icon.placedSymbolArray;for(let Xe=0;Xe<Qe.length;Xe++){let nt=Qe.get(Xe);if(nt.hidden)Pi(nt.numGlyphs,Ie);else{let qt=ze[Xe];if(qt)for(let Wt=0;Wt<nt.numGlyphs;Wt++)a.aj(Ie,qt.shiftedAnchor,qt.angle);else Pi(nt.numGlyphs,Ie)}}ue.icon.dynamicLayoutVertexBuffer.updateData(Ie)}ue.text.dynamicLayoutVertexBuffer.updateData(xe)}function Bl(ue,w,B){return B.iconsInText&&w?"symbolTextAndIcon":ue?"symbolSDF":"symbolIcon"}function Ah(ue,w,B,Q,ee,le,Fe,Ze,ut,Mt,Jt,$t){let yr=ue.context,Cr=yr.gl,ve=ue.transform,xe=yn(),Ie=Ze==="map",ze=ut==="map",Qe=Ze!=="viewport"&&B.layout.get("symbol-placement")!=="point",Xe=Ie&&!ze&&!Qe,nt=!ze&&Qe,qt=!B.layout.get("symbol-sort-key").isConstant(),Wt=!1,nr=ue.depthModeForSublayer(0,Po.ReadOnly),fr=B._unevaluatedLayout.hasValue("text-variable-anchor")||B._unevaluatedLayout.hasValue("text-variable-anchor-offset"),br=[],Fr=xe.getCircleRadiusCorrection(ve);for(let Hr of Q){let ri=w.getTile(Hr),Ci=ri.getBucket(B);if(!Ci)continue;let cn=ee?Ci.text:Ci.icon;if(!cn||!cn.segments.get().length||!cn.hasVisibleVertices)continue;let sn=cn.programConfigurations.get(B.id),Ln=ee||Ci.sdfIcons,Yn=ee?Ci.textSizeData:Ci.iconSizeData,Aa=ze||ve.pitch!==0,fa=ue.useProgram(Bl(Ln,ee,Ci),sn),$a=a.ag(Yn,ve.zoom),Co=ue.style.map.terrain&&ue.style.map.terrain.getTerrainData(Hr),Qa,mo,Bo,Ps,Ts=[0,0],wo=null;if(ee)mo=ri.glyphAtlasTexture,Bo=Cr.LINEAR,Qa=ri.glyphAtlasTexture.size,Ci.iconsInText&&(Ts=ri.imageAtlasTexture.size,wo=ri.imageAtlasTexture,Ps=Aa||ue.options.rotating||ue.options.zooming||Yn.kind==="composite"||Yn.kind==="camera"?Cr.LINEAR:Cr.NEAREST);else{let Ye=B.layout.get("icon-size").constantOr(0)!==1||Ci.iconsNeedLinear;mo=ri.imageAtlasTexture,Bo=Ln||ue.options.rotating||ue.options.zooming||Ye||Aa?Cr.LINEAR:Cr.NEAREST,Qa=ri.imageAtlasTexture.size}let To=Fn(ri,1,ue.transform.zoom),hl=nt?Hr.posMatrix:bl,Ul=qr(hl,ze,Ie,ue.transform,To),Lu=jr(hl,ze,Ie,ue.transform,To),au=jr(Hr.posMatrix,ze,Ie,ue.transform,To),Js=xe.translatePosition(ue.transform,ri,le,Fe),eu=fr&&Ci.hasTextData(),dc=B.layout.get("icon-text-fit")!=="none"&&eu&&Ci.hasIconData();if(Qe){let Ye=ue.style.map.terrain?(ot,Xt)=>ue.style.map.terrain.getElevation(Hr,ot,Xt):null,Pt=B.layout.get("text-rotation-alignment")==="map";We(Ci,Hr.posMatrix,ue,ee,Ul,au,ze,Mt,Pt,xe,Hr.toUnwrapped(),ve.width,ve.height,Js,Ye)}let Tl=Hr.posMatrix,Al=ee&&fr||dc,X=Qe||Al?bl:Ul,se=Lu,Te=Ln&&B.paint.get(ee?"text-halo-width":"icon-halo-width").constantOr(1)!==0,qe;qe=Ln?Ci.iconsInText?ls(Yn.kind,$a,Xe,ze,Qe,Al,ue,Tl,X,se,Js,Qa,Ts,Fr):Io(Yn.kind,$a,Xe,ze,Qe,Al,ue,Tl,X,se,Js,ee,Qa,!0,Fr):zs(Yn.kind,$a,Xe,ze,Qe,Al,ue,Tl,X,se,Js,ee,Qa,Fr);let Ve={program:fa,buffers:cn,uniformValues:qe,atlasTexture:mo,atlasTextureIcon:wo,atlasInterpolation:Bo,atlasInterpolationIcon:Ps,isSDF:Ln,hasHalo:Te};if(qt&&Ci.canOverlap){Wt=!0;let Ye=cn.segments.get();for(let Pt of Ye)br.push({segments:new a.a0([Pt]),sortKey:Pt.sortKey,state:Ve,terrainData:Co})}else br.push({segments:cn.segments,sortKey:0,state:Ve,terrainData:Co})}Wt&&br.sort((Hr,ri)=>Hr.sortKey-ri.sortKey);for(let Hr of br){let ri=Hr.state;if(yr.activeTexture.set(Cr.TEXTURE0),ri.atlasTexture.bind(ri.atlasInterpolation,Cr.CLAMP_TO_EDGE),ri.atlasTextureIcon&&(yr.activeTexture.set(Cr.TEXTURE1),ri.atlasTextureIcon&&ri.atlasTextureIcon.bind(ri.atlasInterpolationIcon,Cr.CLAMP_TO_EDGE)),ri.isSDF){let Ci=ri.uniformValues;ri.hasHalo&&(Ci.u_is_halo=1,Qf(ri.buffers,Hr.segments,B,ue,ri.program,nr,Jt,$t,Ci,Hr.terrainData)),Ci.u_is_halo=0}Qf(ri.buffers,Hr.segments,B,ue,ri.program,nr,Jt,$t,ri.uniformValues,Hr.terrainData)}}function Qf(ue,w,B,Q,ee,le,Fe,Ze,ut,Mt){let Jt=Q.context;ee.draw(Jt,Jt.gl.TRIANGLES,le,Fe,Ze,Pa.disabled,ut,Mt,B.id,ue.layoutVertexBuffer,ue.indexBuffer,w,B.paint,Q.transform.zoom,ue.programConfigurations.get(B.id),ue.dynamicLayoutVertexBuffer,ue.opacityVertexBuffer)}function _f(ue,w,B,Q){let ee=ue.context,le=ee.gl,Fe=Ko.disabled,Ze=new Os([le.ONE,le.ONE],a.aM.transparent,[!0,!0,!0,!0]),ut=w.getBucket(B);if(!ut)return;let Mt=Q.key,Jt=B.heatmapFbos.get(Mt);Jt||(Jt=eh(ee,w.tileSize,w.tileSize),B.heatmapFbos.set(Mt,Jt)),ee.bindFramebuffer.set(Jt.framebuffer),ee.viewport.set([0,0,w.tileSize,w.tileSize]),ee.clear({color:a.aM.transparent});let $t=ut.programConfigurations.get(B.id),yr=ue.useProgram("heatmap",$t),Cr=ue.style.map.terrain.getTerrainData(Q);yr.draw(ee,le.TRIANGLES,Po.disabled,Fe,Ze,Pa.disabled,ko(Q.posMatrix,w,ue.transform.zoom,B.paint.get("heatmap-intensity")),Cr,B.id,ut.layoutVertexBuffer,ut.indexBuffer,ut.segments,B.paint,ue.transform.zoom,$t)}function Yc(ue,w,B){let Q=ue.context,ee=Q.gl;Q.setColorMode(ue.colorModeForRenderPass());let le=th(Q,w),Fe=B.key,Ze=w.heatmapFbos.get(Fe);Ze&&(Q.activeTexture.set(ee.TEXTURE0),ee.bindTexture(ee.TEXTURE_2D,Ze.colorAttachment.get()),Q.activeTexture.set(ee.TEXTURE1),le.bind(ee.LINEAR,ee.CLAMP_TO_EDGE),ue.useProgram("heatmapTexture").draw(Q,ee.TRIANGLES,Po.disabled,Ko.disabled,ue.colorModeForRenderPass(),Pa.disabled,Ds(ue,w,0,1),null,w.id,ue.rasterBoundsBuffer,ue.quadTriangleIndexBuffer,ue.rasterBoundsSegments,w.paint,ue.transform.zoom),Ze.destroy(),w.heatmapFbos.delete(Fe))}function eh(ue,w,B){var Q,ee;let le=ue.gl,Fe=le.createTexture();le.bindTexture(le.TEXTURE_2D,Fe),le.texParameteri(le.TEXTURE_2D,le.TEXTURE_WRAP_S,le.CLAMP_TO_EDGE),le.texParameteri(le.TEXTURE_2D,le.TEXTURE_WRAP_T,le.CLAMP_TO_EDGE),le.texParameteri(le.TEXTURE_2D,le.TEXTURE_MIN_FILTER,le.LINEAR),le.texParameteri(le.TEXTURE_2D,le.TEXTURE_MAG_FILTER,le.LINEAR);let Ze=(Q=ue.HALF_FLOAT)!==null&&Q!==void 0?Q:le.UNSIGNED_BYTE,ut=(ee=ue.RGBA16F)!==null&&ee!==void 0?ee:le.RGBA;le.texImage2D(le.TEXTURE_2D,0,ut,w,B,0,le.RGBA,Ze,null);let Mt=ue.createFramebuffer(w,B,!1,!1);return Mt.colorAttachment.set(Fe),Mt}function th(ue,w){return w.colorRampTexture||(w.colorRampTexture=new g(ue,w.colorRamp,ue.gl.RGBA)),w.colorRampTexture}function ju(ue,w,B,Q,ee){if(!B||!Q||!Q.imageAtlas)return;let le=Q.imageAtlas.patternPositions,Fe=le[B.to.toString()],Ze=le[B.from.toString()];if(!Fe&&Ze&&(Fe=Ze),!Ze&&Fe&&(Ze=Fe),!Fe||!Ze){let ut=ee.getPaintProperty(w);Fe=le[ut],Ze=le[ut]}Fe&&Ze&&ue.setConstantPatternPositions(Fe,Ze)}function jf(ue,w,B,Q,ee,le,Fe){let Ze=ue.context.gl,ut="fill-pattern",Mt=B.paint.get(ut),Jt=Mt&&Mt.constantOr(1),$t=B.getCrossfadeParameters(),yr,Cr,ve,xe,Ie;Fe?(Cr=Jt&&!B.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",yr=Ze.LINES):(Cr=Jt?"fillPattern":"fill",yr=Ze.TRIANGLES);let ze=Mt.constantOr(null);for(let Qe of Q){let Xe=w.getTile(Qe);if(Jt&&!Xe.patternsLoaded())continue;let nt=Xe.getBucket(B);if(!nt)continue;let qt=nt.programConfigurations.get(B.id),Wt=ue.useProgram(Cr,qt),nr=ue.style.map.terrain&&ue.style.map.terrain.getTerrainData(Qe);Jt&&(ue.context.activeTexture.set(Ze.TEXTURE0),Xe.imageAtlasTexture.bind(Ze.LINEAR,Ze.CLAMP_TO_EDGE),qt.updatePaintBuffers($t)),ju(qt,ut,ze,Xe,B);let fr=nr?Qe:null,br=ue.translatePosMatrix(fr?fr.posMatrix:Qe.posMatrix,Xe,B.paint.get("fill-translate"),B.paint.get("fill-translate-anchor"));if(Fe){xe=nt.indexBuffer2,Ie=nt.segments2;let Fr=[Ze.drawingBufferWidth,Ze.drawingBufferHeight];ve=Cr==="fillOutlinePattern"&&Jt?Ma(br,ue,$t,Xe,Fr):ea(br,Fr)}else xe=nt.indexBuffer,Ie=nt.segments,ve=Jt?ya(br,ue,$t,Xe):_n(br);Wt.draw(ue.context,yr,ee,ue.stencilModeForClipping(Qe),le,Pa.disabled,ve,nr,B.id,nt.layoutVertexBuffer,xe,Ie,B.paint,ue.transform.zoom,qt)}}function cc(ue,w,B,Q,ee,le,Fe){let Ze=ue.context,ut=Ze.gl,Mt="fill-extrusion-pattern",Jt=B.paint.get(Mt),$t=Jt.constantOr(1),yr=B.getCrossfadeParameters(),Cr=B.paint.get("fill-extrusion-opacity"),ve=Jt.constantOr(null);for(let xe of Q){let Ie=w.getTile(xe),ze=Ie.getBucket(B);if(!ze)continue;let Qe=ue.style.map.terrain&&ue.style.map.terrain.getTerrainData(xe),Xe=ze.programConfigurations.get(B.id),nt=ue.useProgram($t?"fillExtrusionPattern":"fillExtrusion",Xe);$t&&(ue.context.activeTexture.set(ut.TEXTURE0),Ie.imageAtlasTexture.bind(ut.LINEAR,ut.CLAMP_TO_EDGE),Xe.updatePaintBuffers(yr)),ju(Xe,Mt,ve,Ie,B);let qt=ue.translatePosMatrix(xe.posMatrix,Ie,B.paint.get("fill-extrusion-translate"),B.paint.get("fill-extrusion-translate-anchor")),Wt=B.paint.get("fill-extrusion-vertical-gradient"),nr=$t?ki(qt,ue,Wt,Cr,xe,yr,Ie):En(qt,ue,Wt,Cr);nt.draw(Ze,Ze.gl.TRIANGLES,ee,le,Fe,Pa.backCCW,nr,Qe,B.id,ze.layoutVertexBuffer,ze.indexBuffer,ze.segments,B.paint,ue.transform.zoom,Xe,ue.style.map.terrain&&ze.centroidVertexBuffer)}}function sf(ue,w,B,Q,ee,le,Fe){let Ze=ue.context,ut=Ze.gl,Mt=B.fbo;if(!Mt)return;let Jt=ue.useProgram("hillshade"),$t=ue.style.map.terrain&&ue.style.map.terrain.getTerrainData(w);Ze.activeTexture.set(ut.TEXTURE0),ut.bindTexture(ut.TEXTURE_2D,Mt.colorAttachment.get()),Jt.draw(Ze,ut.TRIANGLES,ee,le,Fe,Pa.disabled,((yr,Cr,ve,xe)=>{let Ie=ve.paint.get("hillshade-shadow-color"),ze=ve.paint.get("hillshade-highlight-color"),Qe=ve.paint.get("hillshade-accent-color"),Xe=ve.paint.get("hillshade-illumination-direction")*(Math.PI/180);ve.paint.get("hillshade-illumination-anchor")==="viewport"&&(Xe-=yr.transform.angle);let nt=!yr.options.moving;return{u_matrix:xe?xe.posMatrix:yr.transform.calculatePosMatrix(Cr.tileID.toUnwrapped(),nt),u_image:0,u_latrange:Fs(0,Cr.tileID),u_light:[ve.paint.get("hillshade-exaggeration"),Xe],u_shadow:Ie,u_highlight:ze,u_accent:Qe}})(ue,B,Q,$t?w:null),$t,Q.id,ue.rasterBoundsBuffer,ue.quadTriangleIndexBuffer,ue.rasterBoundsSegments)}function Nl(ue,w,B,Q,ee,le){let Fe=ue.context,Ze=Fe.gl,ut=w.dem;if(ut&&ut.data){let Mt=ut.dim,Jt=ut.stride,$t=ut.getPixels();if(Fe.activeTexture.set(Ze.TEXTURE1),Fe.pixelStoreUnpackPremultiplyAlpha.set(!1),w.demTexture=w.demTexture||ue.getTileTexture(Jt),w.demTexture){let Cr=w.demTexture;Cr.update($t,{premultiply:!1}),Cr.bind(Ze.NEAREST,Ze.CLAMP_TO_EDGE)}else w.demTexture=new g(Fe,$t,Ze.RGBA,{premultiply:!1}),w.demTexture.bind(Ze.NEAREST,Ze.CLAMP_TO_EDGE);Fe.activeTexture.set(Ze.TEXTURE0);let yr=w.fbo;if(!yr){let Cr=new g(Fe,{width:Mt,height:Mt,data:null},Ze.RGBA);Cr.bind(Ze.LINEAR,Ze.CLAMP_TO_EDGE),yr=w.fbo=Fe.createFramebuffer(Mt,Mt,!0,!1),yr.colorAttachment.set(Cr.texture)}Fe.bindFramebuffer.set(yr.framebuffer),Fe.viewport.set([0,0,Mt,Mt]),ue.useProgram("hillshadePrepare").draw(Fe,Ze.TRIANGLES,Q,ee,le,Pa.disabled,((Cr,ve)=>{let xe=ve.stride,Ie=a.H();return a.aP(Ie,0,a.X,-a.X,0,0,1),a.J(Ie,Ie,[0,-a.X,0]),{u_matrix:Ie,u_image:1,u_dimension:[xe,xe],u_zoom:Cr.overscaledZ,u_unpack:ve.getUnpackVector()}})(w.tileID,ut),null,B.id,ue.rasterBoundsBuffer,ue.quadTriangleIndexBuffer,ue.rasterBoundsSegments),w.needsHillshadePrepare=!1}}function Kc(ue,w,B,Q,ee,le){let Fe=Q.paint.get("raster-fade-duration");if(!le&&Fe>0){let Ze=u.now(),ut=(Ze-ue.timeAdded)/Fe,Mt=w?(Ze-w.timeAdded)/Fe:-1,Jt=B.getSource(),$t=ee.coveringZoomLevel({tileSize:Jt.tileSize,roundZoom:Jt.roundZoom}),yr=!w||Math.abs(w.tileID.overscaledZ-$t)>Math.abs(ue.tileID.overscaledZ-$t),Cr=yr&&ue.refreshedUponExpiration?1:a.ac(yr?ut:1-Mt,0,1);return ue.refreshedUponExpiration&&ut>=1&&(ue.refreshedUponExpiration=!1),w?{opacity:1,mix:1-Cr}:{opacity:Cr,mix:0}}return{opacity:1,mix:0}}let Rc=new a.aM(1,0,0,1),gs=new a.aM(0,1,0,1),Wf=new a.aM(0,0,1,1),Wh=new a.aM(1,0,1,1),rh=new a.aM(0,1,1,1);function lf(ue,w,B,Q){Mu(ue,0,w+B/2,ue.transform.width,B,Q)}function Sh(ue,w,B,Q){Mu(ue,w-B/2,0,B,ue.transform.height,Q)}function Mu(ue,w,B,Q,ee,le){let Fe=ue.context,Ze=Fe.gl;Ze.enable(Ze.SCISSOR_TEST),Ze.scissor(w*ue.pixelRatio,B*ue.pixelRatio,Q*ue.pixelRatio,ee*ue.pixelRatio),Fe.clear({color:le}),Ze.disable(Ze.SCISSOR_TEST)}function ih(ue,w,B){let Q=ue.context,ee=Q.gl,le=B.posMatrix,Fe=ue.useProgram("debug"),Ze=Po.disabled,ut=Ko.disabled,Mt=ue.colorModeForRenderPass(),Jt="$debug",$t=ue.style.map.terrain&&ue.style.map.terrain.getTerrainData(B);Q.activeTexture.set(ee.TEXTURE0);let yr=w.getTileByID(B.key).latestRawTileData,Cr=Math.floor((yr&&yr.byteLength||0)/1024),ve=w.getTile(B).tileSize,xe=512/Math.min(ve,512)*(B.overscaledZ/ue.transform.zoom)*.5,Ie=B.canonical.toString();B.overscaledZ!==B.canonical.z&&(Ie+=` => ${B.overscaledZ}`),function(ze,Qe){ze.initDebugOverlayCanvas();let Xe=ze.debugOverlayCanvas,nt=ze.context.gl,qt=ze.debugOverlayCanvas.getContext("2d");qt.clearRect(0,0,Xe.width,Xe.height),qt.shadowColor="white",qt.shadowBlur=2,qt.lineWidth=1.5,qt.strokeStyle="white",qt.textBaseline="top",qt.font="bold 36px Open Sans, sans-serif",qt.fillText(Qe,5,5),qt.strokeText(Qe,5,5),ze.debugOverlayTexture.update(Xe),ze.debugOverlayTexture.bind(nt.LINEAR,nt.CLAMP_TO_EDGE)}(ue,`${Ie} ${Cr}kB`),Fe.draw(Q,ee.TRIANGLES,Ze,ut,Os.alphaBlended,Pa.disabled,po(le,a.aM.transparent,xe),null,Jt,ue.debugBuffer,ue.quadTriangleIndexBuffer,ue.debugSegments),Fe.draw(Q,ee.LINE_STRIP,Ze,ut,Mt,Pa.disabled,po(le,a.aM.red),$t,Jt,ue.debugBuffer,ue.tileBorderIndexBuffer,ue.debugSegments)}function js(ue,w,B){let Q=ue.context,ee=Q.gl,le=ue.colorModeForRenderPass(),Fe=new Po(ee.LEQUAL,Po.ReadWrite,ue.depthRangeFor3D),Ze=ue.useProgram("terrain"),ut=w.getTerrainMesh();Q.bindFramebuffer.set(null),Q.viewport.set([0,0,ue.width,ue.height]);for(let Mt of B){let Jt=ue.renderToTexture.getTexture(Mt),$t=w.getTerrainData(Mt.tileID);Q.activeTexture.set(ee.TEXTURE0),ee.bindTexture(ee.TEXTURE_2D,Jt.texture);let yr=ue.transform.calculatePosMatrix(Mt.tileID.toUnwrapped()),Cr=w.getMeshFrameDelta(ue.transform.zoom),ve=ue.transform.calculateFogMatrix(Mt.tileID.toUnwrapped()),xe=Jr(yr,Cr,ve,ue.style.sky,ue.transform.pitch);Ze.draw(Q,ee.TRIANGLES,Fe,Ko.disabled,le,Pa.backCCW,xe,$t,"terrain",ut.vertexBuffer,ut.indexBuffer,ut.segments)}}class Eu{constructor(w,B,Q){this.vertexBuffer=w,this.indexBuffer=B,this.segments=Q}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Dc{constructor(w,B){this.context=new od(w),this.transform=B,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:a.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=pt.maxUnderzooming+pt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Xo}resize(w,B,Q){if(this.width=Math.floor(w*Q),this.height=Math.floor(B*Q),this.pixelRatio=Q,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let ee of this.style._order)this.style._layers[ee].resize()}setup(){let w=this.context,B=new a.aX;B.emplaceBack(0,0),B.emplaceBack(a.X,0),B.emplaceBack(0,a.X),B.emplaceBack(a.X,a.X),this.tileExtentBuffer=w.createVertexBuffer(B,vo.members),this.tileExtentSegments=a.a0.simpleSegment(0,0,4,2);let Q=new a.aX;Q.emplaceBack(0,0),Q.emplaceBack(a.X,0),Q.emplaceBack(0,a.X),Q.emplaceBack(a.X,a.X),this.debugBuffer=w.createVertexBuffer(Q,vo.members),this.debugSegments=a.a0.simpleSegment(0,0,4,5);let ee=new a.$;ee.emplaceBack(0,0,0,0),ee.emplaceBack(a.X,0,a.X,0),ee.emplaceBack(0,a.X,0,a.X),ee.emplaceBack(a.X,a.X,a.X,a.X),this.rasterBoundsBuffer=w.createVertexBuffer(ee,ct.members),this.rasterBoundsSegments=a.a0.simpleSegment(0,0,4,2);let le=new a.aX;le.emplaceBack(0,0),le.emplaceBack(1,0),le.emplaceBack(0,1),le.emplaceBack(1,1),this.viewportBuffer=w.createVertexBuffer(le,vo.members),this.viewportSegments=a.a0.simpleSegment(0,0,4,2);let Fe=new a.aZ;Fe.emplaceBack(0),Fe.emplaceBack(1),Fe.emplaceBack(3),Fe.emplaceBack(2),Fe.emplaceBack(0),this.tileBorderIndexBuffer=w.createIndexBuffer(Fe);let Ze=new a.aY;Ze.emplaceBack(0,1,2),Ze.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=w.createIndexBuffer(Ze);let ut=this.context.gl;this.stencilClearMode=new Ko({func:ut.ALWAYS,mask:0},0,255,ut.ZERO,ut.ZERO,ut.ZERO)}clearStencil(){let w=this.context,B=w.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let Q=a.H();a.aP(Q,0,this.width,this.height,0,0,1),a.K(Q,Q,[B.drawingBufferWidth,B.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(w,B.TRIANGLES,Po.disabled,this.stencilClearMode,Os.disabled,Pa.disabled,Lo(Q),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(w,B){if(this.currentStencilSource===w.source||!w.isTileClipped()||!B||!B.length)return;this.currentStencilSource=w.source;let Q=this.context,ee=Q.gl;this.nextStencilID+B.length>256&&this.clearStencil(),Q.setColorMode(Os.disabled),Q.setDepthMode(Po.disabled);let le=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let Fe of B){let Ze=this._tileClippingMaskIDs[Fe.key]=this.nextStencilID++,ut=this.style.map.terrain&&this.style.map.terrain.getTerrainData(Fe);le.draw(Q,ee.TRIANGLES,Po.disabled,new Ko({func:ee.ALWAYS,mask:0},Ze,255,ee.KEEP,ee.KEEP,ee.REPLACE),Os.disabled,Pa.disabled,Lo(Fe.posMatrix),ut,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let w=this.nextStencilID++,B=this.context.gl;return new Ko({func:B.NOTEQUAL,mask:255},w,255,B.KEEP,B.KEEP,B.REPLACE)}stencilModeForClipping(w){let B=this.context.gl;return new Ko({func:B.EQUAL,mask:255},this._tileClippingMaskIDs[w.key],0,B.KEEP,B.KEEP,B.REPLACE)}stencilConfigForOverlap(w){let B=this.context.gl,Q=w.sort((Fe,Ze)=>Ze.overscaledZ-Fe.overscaledZ),ee=Q[Q.length-1].overscaledZ,le=Q[0].overscaledZ-ee+1;if(le>1){this.currentStencilSource=void 0,this.nextStencilID+le>256&&this.clearStencil();let Fe={};for(let Ze=0;Ze<le;Ze++)Fe[Ze+ee]=new Ko({func:B.GEQUAL,mask:255},Ze+this.nextStencilID,255,B.KEEP,B.KEEP,B.REPLACE);return this.nextStencilID+=le,[Fe,Q]}return[{[ee]:Ko.disabled},Q]}colorModeForRenderPass(){let w=this.context.gl;return this._showOverdrawInspector?new Os([w.CONSTANT_COLOR,w.ONE],new a.aM(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Os.unblended:Os.alphaBlended}depthModeForSublayer(w,B,Q){if(!this.opaquePassEnabledForLayer())return Po.disabled;let ee=1-((1+this.currentLayer)*this.numSublayers+w)*this.depthEpsilon;return new Po(Q||this.context.gl.LEQUAL,B,[ee,ee])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(w,B){this.style=w,this.options=B,this.lineAtlas=w.lineAtlas,this.imageManager=w.imageManager,this.glyphManager=w.glyphManager,this.symbolFadeChange=w.placement.symbolFadeChange(u.now()),this.imageManager.beginFrame();let Q=this.style._order,ee=this.style.sourceCaches,le={},Fe={},Ze={};for(let ut in ee){let Mt=ee[ut];Mt.used&&Mt.prepare(this.context),le[ut]=Mt.getVisibleCoordinates(),Fe[ut]=le[ut].slice().reverse(),Ze[ut]=Mt.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let ut=0;ut<Q.length;ut++)if(this.style._layers[Q[ut]].is3D()){this.opaquePassCutoff=ut;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(let ut of Q){let Mt=this.style._layers[ut];if(!Mt.hasOffscreenPass()||Mt.isHidden(this.transform.zoom))continue;let Jt=Fe[Mt.source];(Mt.type==="custom"||Jt.length)&&this.renderLayer(this,ee[Mt.source],Mt,Jt)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:B.showOverdrawInspector?a.aM.black:a.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(ut,Mt){let Jt=ut.context,$t=Jt.gl,yr=((ze,Qe,Xe)=>({u_sky_color:ze.properties.get("sky-color"),u_horizon_color:ze.properties.get("horizon-color"),u_horizon:(Qe.height/2+Qe.getHorizon())*Xe,u_sky_horizon_blend:ze.properties.get("sky-horizon-blend")*Qe.height/2*Xe}))(Mt,ut.style.map.transform,ut.pixelRatio),Cr=new Po($t.LEQUAL,Po.ReadWrite,[0,1]),ve=Ko.disabled,xe=ut.colorModeForRenderPass(),Ie=ut.useProgram("sky");if(!Mt.mesh){let ze=new a.aX;ze.emplaceBack(-1,-1),ze.emplaceBack(1,-1),ze.emplaceBack(1,1),ze.emplaceBack(-1,1);let Qe=new a.aY;Qe.emplaceBack(0,1,2),Qe.emplaceBack(0,2,3),Mt.mesh=new Eu(Jt.createVertexBuffer(ze,vo.members),Jt.createIndexBuffer(Qe),a.a0.simpleSegment(0,0,ze.length,Qe.length))}Ie.draw(Jt,$t.TRIANGLES,Cr,ve,xe,Pa.disabled,yr,void 0,"sky",Mt.mesh.vertexBuffer,Mt.mesh.indexBuffer,Mt.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=B.showOverdrawInspector,this.depthRangeFor3D=[0,1-(w._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=Q.length-1;this.currentLayer>=0;this.currentLayer--){let ut=this.style._layers[Q[this.currentLayer]],Mt=ee[ut.source],Jt=le[ut.source];this._renderTileClippingMasks(ut,Jt),this.renderLayer(this,Mt,ut,Jt)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<Q.length;this.currentLayer++){let ut=this.style._layers[Q[this.currentLayer]],Mt=ee[ut.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(ut))continue;let Jt=(ut.type==="symbol"?Ze:Fe)[ut.source];this._renderTileClippingMasks(ut,le[ut.source]),this.renderLayer(this,Mt,ut,Jt)}if(this.options.showTileBoundaries){let ut=function(Mt,Jt){let $t=null,yr=Object.values(Mt._layers).flatMap(Ie=>Ie.source&&!Ie.isHidden(Jt)?[Mt.sourceCaches[Ie.source]]:[]),Cr=yr.filter(Ie=>Ie.getSource().type==="vector"),ve=yr.filter(Ie=>Ie.getSource().type!=="vector"),xe=Ie=>{(!$t||$t.getSource().maxzoom<Ie.getSource().maxzoom)&&($t=Ie)};return Cr.forEach(Ie=>xe(Ie)),$t||ve.forEach(Ie=>xe(Ie)),$t}(this.style,this.transform.zoom);ut&&function(Mt,Jt,$t){for(let yr=0;yr<$t.length;yr++)ih(Mt,Jt,$t[yr])}(this,ut,ut.getVisibleCoordinates())}this.options.showPadding&&function(ut){let Mt=ut.transform.padding;lf(ut,ut.transform.height-(Mt.top||0),3,Rc),lf(ut,Mt.bottom||0,3,gs),Sh(ut,Mt.left||0,3,Wf),Sh(ut,ut.transform.width-(Mt.right||0),3,Wh);let Jt=ut.transform.centerPoint;(function($t,yr,Cr,ve){Mu($t,yr-1,Cr-10,2,20,ve),Mu($t,yr-10,Cr-1,20,2,ve)})(ut,Jt.x,ut.transform.height-Jt.y,rh)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(w){if(!this.style||!this.style.map||!this.style.map.terrain)return;let B=this.terrainFacilitator.matrix,Q=this.transform.modelViewProjectionMatrix,ee=this.terrainFacilitator.dirty;ee||(ee=w?!a.a_(B,Q):!a.a$(B,Q)),ee||(ee=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),ee&&(a.b0(B,Q),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(le,Fe){let Ze=le.context,ut=Ze.gl,Mt=Os.unblended,Jt=new Po(ut.LEQUAL,Po.ReadWrite,[0,1]),$t=Fe.getTerrainMesh(),yr=Fe.sourceCache.getRenderableTiles(),Cr=le.useProgram("terrainDepth");Ze.bindFramebuffer.set(Fe.getFramebuffer("depth").framebuffer),Ze.viewport.set([0,0,le.width/devicePixelRatio,le.height/devicePixelRatio]),Ze.clear({color:a.aM.transparent,depth:1});for(let ve of yr){let xe=Fe.getTerrainData(ve.tileID),Ie={u_matrix:le.transform.calculatePosMatrix(ve.tileID.toUnwrapped()),u_ele_delta:Fe.getMeshFrameDelta(le.transform.zoom)};Cr.draw(Ze,ut.TRIANGLES,Jt,Ko.disabled,Mt,Pa.backCCW,Ie,xe,"terrain",$t.vertexBuffer,$t.indexBuffer,$t.segments)}Ze.bindFramebuffer.set(null),Ze.viewport.set([0,0,le.width,le.height])}(this,this.style.map.terrain),function(le,Fe){let Ze=le.context,ut=Ze.gl,Mt=Os.unblended,Jt=new Po(ut.LEQUAL,Po.ReadWrite,[0,1]),$t=Fe.getTerrainMesh(),yr=Fe.getCoordsTexture(),Cr=Fe.sourceCache.getRenderableTiles(),ve=le.useProgram("terrainCoords");Ze.bindFramebuffer.set(Fe.getFramebuffer("coords").framebuffer),Ze.viewport.set([0,0,le.width/devicePixelRatio,le.height/devicePixelRatio]),Ze.clear({color:a.aM.transparent,depth:1}),Fe.coordsIndex=[];for(let xe of Cr){let Ie=Fe.getTerrainData(xe.tileID);Ze.activeTexture.set(ut.TEXTURE0),ut.bindTexture(ut.TEXTURE_2D,yr.texture);let ze={u_matrix:le.transform.calculatePosMatrix(xe.tileID.toUnwrapped()),u_terrain_coords_id:(255-Fe.coordsIndex.length)/255,u_texture:0,u_ele_delta:Fe.getMeshFrameDelta(le.transform.zoom)};ve.draw(Ze,ut.TRIANGLES,Jt,Ko.disabled,Mt,Pa.backCCW,ze,Ie,"terrain",$t.vertexBuffer,$t.indexBuffer,$t.segments),Fe.coordsIndex.push(xe.tileID.key)}Ze.bindFramebuffer.set(null),Ze.viewport.set([0,0,le.width,le.height])}(this,this.style.map.terrain))}renderLayer(w,B,Q,ee){if(!Q.isHidden(this.transform.zoom)&&(Q.type==="background"||Q.type==="custom"||(ee||[]).length))switch(this.id=Q.id,Q.type){case"symbol":(function(le,Fe,Ze,ut,Mt){if(le.renderPass!=="translucent")return;let Jt=Ko.disabled,$t=le.colorModeForRenderPass();(Ze._unevaluatedLayout.hasValue("text-variable-anchor")||Ze._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(yr,Cr,ve,xe,Ie,ze,Qe,Xe,nt){let qt=Cr.transform,Wt=yn(),nr=Ie==="map",fr=ze==="map";for(let br of yr){let Fr=xe.getTile(br),Hr=Fr.getBucket(ve);if(!Hr||!Hr.text||!Hr.text.segments.get().length)continue;let ri=a.ag(Hr.textSizeData,qt.zoom),Ci=Fn(Fr,1,Cr.transform.zoom),cn=qr(br.posMatrix,fr,nr,Cr.transform,Ci),sn=ve.layout.get("icon-text-fit")!=="none"&&Hr.hasIconData();if(ri){let Ln=Math.pow(2,qt.zoom-Fr.tileID.overscaledZ),Yn=Cr.style.map.terrain?(fa,$a)=>Cr.style.map.terrain.getElevation(br,fa,$a):null,Aa=Wt.translatePosition(qt,Fr,Qe,Xe);yf(Hr,nr,fr,nt,qt,cn,br.posMatrix,Ln,ri,sn,Wt,Aa,br.toUnwrapped(),Yn)}}}(ut,le,Ze,Fe,Ze.layout.get("text-rotation-alignment"),Ze.layout.get("text-pitch-alignment"),Ze.paint.get("text-translate"),Ze.paint.get("text-translate-anchor"),Mt),Ze.paint.get("icon-opacity").constantOr(1)!==0&&Ah(le,Fe,Ze,ut,!1,Ze.paint.get("icon-translate"),Ze.paint.get("icon-translate-anchor"),Ze.layout.get("icon-rotation-alignment"),Ze.layout.get("icon-pitch-alignment"),Ze.layout.get("icon-keep-upright"),Jt,$t),Ze.paint.get("text-opacity").constantOr(1)!==0&&Ah(le,Fe,Ze,ut,!0,Ze.paint.get("text-translate"),Ze.paint.get("text-translate-anchor"),Ze.layout.get("text-rotation-alignment"),Ze.layout.get("text-pitch-alignment"),Ze.layout.get("text-keep-upright"),Jt,$t),Fe.map.showCollisionBoxes&&(Hu(le,Fe,Ze,ut,!0),Hu(le,Fe,Ze,ut,!1))})(w,B,Q,ee,this.style.placement.variableOffsets);break;case"circle":(function(le,Fe,Ze,ut){if(le.renderPass!=="translucent")return;let Mt=Ze.paint.get("circle-opacity"),Jt=Ze.paint.get("circle-stroke-width"),$t=Ze.paint.get("circle-stroke-opacity"),yr=!Ze.layout.get("circle-sort-key").isConstant();if(Mt.constantOr(1)===0&&(Jt.constantOr(1)===0||$t.constantOr(1)===0))return;let Cr=le.context,ve=Cr.gl,xe=le.depthModeForSublayer(0,Po.ReadOnly),Ie=Ko.disabled,ze=le.colorModeForRenderPass(),Qe=[];for(let Xe=0;Xe<ut.length;Xe++){let nt=ut[Xe],qt=Fe.getTile(nt),Wt=qt.getBucket(Ze);if(!Wt)continue;let nr=Wt.programConfigurations.get(Ze.id),fr=le.useProgram("circle",nr),br=Wt.layoutVertexBuffer,Fr=Wt.indexBuffer,Hr=le.style.map.terrain&&le.style.map.terrain.getTerrainData(nt),ri={programConfiguration:nr,program:fr,layoutVertexBuffer:br,indexBuffer:Fr,uniformValues:_o(le,nt,qt,Ze),terrainData:Hr};if(yr){let Ci=Wt.segments.get();for(let cn of Ci)Qe.push({segments:new a.a0([cn]),sortKey:cn.sortKey,state:ri})}else Qe.push({segments:Wt.segments,sortKey:0,state:ri})}yr&&Qe.sort((Xe,nt)=>Xe.sortKey-nt.sortKey);for(let Xe of Qe){let{programConfiguration:nt,program:qt,layoutVertexBuffer:Wt,indexBuffer:nr,uniformValues:fr,terrainData:br}=Xe.state;qt.draw(Cr,ve.TRIANGLES,xe,Ie,ze,Pa.disabled,fr,br,Ze.id,Wt,nr,Xe.segments,Ze.paint,le.transform.zoom,nt)}})(w,B,Q,ee);break;case"heatmap":(function(le,Fe,Ze,ut){if(Ze.paint.get("heatmap-opacity")===0)return;let Mt=le.context;if(le.style.map.terrain){for(let Jt of ut){let $t=Fe.getTile(Jt);Fe.hasRenderableParent(Jt)||(le.renderPass==="offscreen"?_f(le,$t,Ze,Jt):le.renderPass==="translucent"&&Yc(le,Ze,Jt))}Mt.viewport.set([0,0,le.width,le.height])}else le.renderPass==="offscreen"?function(Jt,$t,yr,Cr){let ve=Jt.context,xe=ve.gl,Ie=Ko.disabled,ze=new Os([xe.ONE,xe.ONE],a.aM.transparent,[!0,!0,!0,!0]);(function(Qe,Xe,nt){let qt=Qe.gl;Qe.activeTexture.set(qt.TEXTURE1),Qe.viewport.set([0,0,Xe.width/4,Xe.height/4]);let Wt=nt.heatmapFbos.get(a.aU);Wt?(qt.bindTexture(qt.TEXTURE_2D,Wt.colorAttachment.get()),Qe.bindFramebuffer.set(Wt.framebuffer)):(Wt=eh(Qe,Xe.width/4,Xe.height/4),nt.heatmapFbos.set(a.aU,Wt))})(ve,Jt,yr),ve.clear({color:a.aM.transparent});for(let Qe=0;Qe<Cr.length;Qe++){let Xe=Cr[Qe];if($t.hasRenderableParent(Xe))continue;let nt=$t.getTile(Xe),qt=nt.getBucket(yr);if(!qt)continue;let Wt=qt.programConfigurations.get(yr.id),nr=Jt.useProgram("heatmap",Wt),{zoom:fr}=Jt.transform;nr.draw(ve,xe.TRIANGLES,Po.disabled,Ie,ze,Pa.disabled,ko(Xe.posMatrix,nt,fr,yr.paint.get("heatmap-intensity")),null,yr.id,qt.layoutVertexBuffer,qt.indexBuffer,qt.segments,yr.paint,Jt.transform.zoom,Wt)}ve.viewport.set([0,0,Jt.width,Jt.height])}(le,Fe,Ze,ut):le.renderPass==="translucent"&&function(Jt,$t){let yr=Jt.context,Cr=yr.gl;yr.setColorMode(Jt.colorModeForRenderPass());let ve=$t.heatmapFbos.get(a.aU);ve&&(yr.activeTexture.set(Cr.TEXTURE0),Cr.bindTexture(Cr.TEXTURE_2D,ve.colorAttachment.get()),yr.activeTexture.set(Cr.TEXTURE1),th(yr,$t).bind(Cr.LINEAR,Cr.CLAMP_TO_EDGE),Jt.useProgram("heatmapTexture").draw(yr,Cr.TRIANGLES,Po.disabled,Ko.disabled,Jt.colorModeForRenderPass(),Pa.disabled,Ds(Jt,$t,0,1),null,$t.id,Jt.viewportBuffer,Jt.quadTriangleIndexBuffer,Jt.viewportSegments,$t.paint,Jt.transform.zoom))}(le,Ze)})(w,B,Q,ee);break;case"line":(function(le,Fe,Ze,ut){if(le.renderPass!=="translucent")return;let Mt=Ze.paint.get("line-opacity"),Jt=Ze.paint.get("line-width");if(Mt.constantOr(1)===0||Jt.constantOr(1)===0)return;let $t=le.depthModeForSublayer(0,Po.ReadOnly),yr=le.colorModeForRenderPass(),Cr=Ze.paint.get("line-dasharray"),ve=Ze.paint.get("line-pattern"),xe=ve.constantOr(1),Ie=Ze.paint.get("line-gradient"),ze=Ze.getCrossfadeParameters(),Qe=xe?"linePattern":Cr?"lineSDF":Ie?"lineGradient":"line",Xe=le.context,nt=Xe.gl,qt=!0;for(let Wt of ut){let nr=Fe.getTile(Wt);if(xe&&!nr.patternsLoaded())continue;let fr=nr.getBucket(Ze);if(!fr)continue;let br=fr.programConfigurations.get(Ze.id),Fr=le.context.program.get(),Hr=le.useProgram(Qe,br),ri=qt||Hr.program!==Fr,Ci=le.style.map.terrain&&le.style.map.terrain.getTerrainData(Wt),cn=ve.constantOr(null);if(cn&&nr.imageAtlas){let Yn=nr.imageAtlas,Aa=Yn.patternPositions[cn.to.toString()],fa=Yn.patternPositions[cn.from.toString()];Aa&&fa&&br.setConstantPatternPositions(Aa,fa)}let sn=Ci?Wt:null,Ln=xe?zl(le,nr,Ze,ze,sn):Cr?us(le,nr,Ze,Cr,ze,sn):Ie?ul(le,nr,Ze,fr.lineClipsArray.length,sn):ll(le,nr,Ze,sn);if(xe)Xe.activeTexture.set(nt.TEXTURE0),nr.imageAtlasTexture.bind(nt.LINEAR,nt.CLAMP_TO_EDGE),br.updatePaintBuffers(ze);else if(Cr&&(ri||le.lineAtlas.dirty))Xe.activeTexture.set(nt.TEXTURE0),le.lineAtlas.bind(Xe);else if(Ie){let Yn=fr.gradients[Ze.id],Aa=Yn.texture;if(Ze.gradientVersion!==Yn.version){let fa=256;if(Ze.stepInterpolant){let $a=Fe.getSource().maxzoom,Co=Wt.canonical.z===$a?Math.ceil(1<<le.transform.maxZoom-Wt.canonical.z):1;fa=a.ac(a.aV(fr.maxLineLength/a.X*1024*Co),256,Xe.maxTextureSize)}Yn.gradient=a.aW({expression:Ze.gradientExpression(),evaluationKey:"lineProgress",resolution:fa,image:Yn.gradient||void 0,clips:fr.lineClipsArray}),Yn.texture?Yn.texture.update(Yn.gradient):Yn.texture=new g(Xe,Yn.gradient,nt.RGBA),Yn.version=Ze.gradientVersion,Aa=Yn.texture}Xe.activeTexture.set(nt.TEXTURE0),Aa.bind(Ze.stepInterpolant?nt.NEAREST:nt.LINEAR,nt.CLAMP_TO_EDGE)}Hr.draw(Xe,nt.TRIANGLES,$t,le.stencilModeForClipping(Wt),yr,Pa.disabled,Ln,Ci,Ze.id,fr.layoutVertexBuffer,fr.indexBuffer,fr.segments,Ze.paint,le.transform.zoom,br,fr.layoutVertexBuffer2),qt=!1}})(w,B,Q,ee);break;case"fill":(function(le,Fe,Ze,ut){let Mt=Ze.paint.get("fill-color"),Jt=Ze.paint.get("fill-opacity");if(Jt.constantOr(1)===0)return;let $t=le.colorModeForRenderPass(),yr=Ze.paint.get("fill-pattern"),Cr=le.opaquePassEnabledForLayer()&&!yr.constantOr(1)&&Mt.constantOr(a.aM.transparent).a===1&&Jt.constantOr(0)===1?"opaque":"translucent";if(le.renderPass===Cr){let ve=le.depthModeForSublayer(1,le.renderPass==="opaque"?Po.ReadWrite:Po.ReadOnly);jf(le,Fe,Ze,ut,ve,$t,!1)}if(le.renderPass==="translucent"&&Ze.paint.get("fill-antialias")){let ve=le.depthModeForSublayer(Ze.getPaintProperty("fill-outline-color")?2:0,Po.ReadOnly);jf(le,Fe,Ze,ut,ve,$t,!0)}})(w,B,Q,ee);break;case"fill-extrusion":(function(le,Fe,Ze,ut){let Mt=Ze.paint.get("fill-extrusion-opacity");if(Mt!==0&&le.renderPass==="translucent"){let Jt=new Po(le.context.gl.LEQUAL,Po.ReadWrite,le.depthRangeFor3D);if(Mt!==1||Ze.paint.get("fill-extrusion-pattern").constantOr(1))cc(le,Fe,Ze,ut,Jt,Ko.disabled,Os.disabled),cc(le,Fe,Ze,ut,Jt,le.stencilModeFor3D(),le.colorModeForRenderPass());else{let $t=le.colorModeForRenderPass();cc(le,Fe,Ze,ut,Jt,Ko.disabled,$t)}}})(w,B,Q,ee);break;case"hillshade":(function(le,Fe,Ze,ut){if(le.renderPass!=="offscreen"&&le.renderPass!=="translucent")return;let Mt=le.context,Jt=le.depthModeForSublayer(0,Po.ReadOnly),$t=le.colorModeForRenderPass(),[yr,Cr]=le.renderPass==="translucent"?le.stencilConfigForOverlap(ut):[{},ut];for(let ve of Cr){let xe=Fe.getTile(ve);xe.needsHillshadePrepare!==void 0&&xe.needsHillshadePrepare&&le.renderPass==="offscreen"?Nl(le,xe,Ze,Jt,Ko.disabled,$t):le.renderPass==="translucent"&&sf(le,ve,xe,Ze,Jt,yr[ve.overscaledZ],$t)}Mt.viewport.set([0,0,le.width,le.height])})(w,B,Q,ee);break;case"raster":(function(le,Fe,Ze,ut){if(le.renderPass!=="translucent"||Ze.paint.get("raster-opacity")===0||!ut.length)return;let Mt=le.context,Jt=Mt.gl,$t=Fe.getSource(),yr=le.useProgram("raster"),Cr=le.colorModeForRenderPass(),[ve,xe]=$t instanceof ar?[{},ut]:le.stencilConfigForOverlap(ut),Ie=xe[xe.length-1].overscaledZ,ze=!le.options.moving;for(let Qe of xe){let Xe=le.depthModeForSublayer(Qe.overscaledZ-Ie,Ze.paint.get("raster-opacity")===1?Po.ReadWrite:Po.ReadOnly,Jt.LESS),nt=Fe.getTile(Qe);nt.registerFadeDuration(Ze.paint.get("raster-fade-duration"));let qt=Fe.findLoadedParent(Qe,0),Wt=Fe.findLoadedSibling(Qe),nr=Kc(nt,qt||Wt||null,Fe,Ze,le.transform,le.style.map.terrain),fr,br,Fr=Ze.paint.get("raster-resampling")==="nearest"?Jt.NEAREST:Jt.LINEAR;Mt.activeTexture.set(Jt.TEXTURE0),nt.texture.bind(Fr,Jt.CLAMP_TO_EDGE,Jt.LINEAR_MIPMAP_NEAREST),Mt.activeTexture.set(Jt.TEXTURE1),qt?(qt.texture.bind(Fr,Jt.CLAMP_TO_EDGE,Jt.LINEAR_MIPMAP_NEAREST),fr=Math.pow(2,qt.tileID.overscaledZ-nt.tileID.overscaledZ),br=[nt.tileID.canonical.x*fr%1,nt.tileID.canonical.y*fr%1]):nt.texture.bind(Fr,Jt.CLAMP_TO_EDGE,Jt.LINEAR_MIPMAP_NEAREST),nt.texture.useMipmap&&Mt.extTextureFilterAnisotropic&&le.transform.pitch>20&&Jt.texParameterf(Jt.TEXTURE_2D,Mt.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Mt.extTextureFilterAnisotropicMax);let Hr=le.style.map.terrain&&le.style.map.terrain.getTerrainData(Qe),ri=Hr?Qe:null,Ci=ri?ri.posMatrix:le.transform.calculatePosMatrix(Qe.toUnwrapped(),ze),cn=cl(Ci,br||[0,0],fr||1,nr,Ze);$t instanceof ar?yr.draw(Mt,Jt.TRIANGLES,Xe,Ko.disabled,Cr,Pa.disabled,cn,Hr,Ze.id,$t.boundsBuffer,le.quadTriangleIndexBuffer,$t.boundsSegments):yr.draw(Mt,Jt.TRIANGLES,Xe,ve[Qe.overscaledZ],Cr,Pa.disabled,cn,Hr,Ze.id,le.rasterBoundsBuffer,le.quadTriangleIndexBuffer,le.rasterBoundsSegments)}})(w,B,Q,ee);break;case"background":(function(le,Fe,Ze,ut){let Mt=Ze.paint.get("background-color"),Jt=Ze.paint.get("background-opacity");if(Jt===0)return;let $t=le.context,yr=$t.gl,Cr=le.transform,ve=Cr.tileSize,xe=Ze.paint.get("background-pattern");if(le.isPatternMissing(xe))return;let Ie=!xe&&Mt.a===1&&Jt===1&&le.opaquePassEnabledForLayer()?"opaque":"translucent";if(le.renderPass!==Ie)return;let ze=Ko.disabled,Qe=le.depthModeForSublayer(0,Ie==="opaque"?Po.ReadWrite:Po.ReadOnly),Xe=le.colorModeForRenderPass(),nt=le.useProgram(xe?"backgroundPattern":"background"),qt=ut||Cr.coveringTiles({tileSize:ve,terrain:le.style.map.terrain});xe&&($t.activeTexture.set(yr.TEXTURE0),le.imageManager.bind(le.context));let Wt=Ze.getCrossfadeParameters();for(let nr of qt){let fr=ut?nr.posMatrix:le.transform.calculatePosMatrix(nr.toUnwrapped()),br=xe?Su(fr,Jt,le,xe,{tileID:nr,tileSize:ve},Wt):Yl(fr,Jt,Mt),Fr=le.style.map.terrain&&le.style.map.terrain.getTerrainData(nr);nt.draw($t,yr.TRIANGLES,Qe,ze,Xe,Pa.disabled,br,Fr,Ze.id,le.tileExtentBuffer,le.quadTriangleIndexBuffer,le.tileExtentSegments)}})(w,0,Q,ee);break;case"custom":(function(le,Fe,Ze){let ut=le.context,Mt=Ze.implementation;if(le.renderPass==="offscreen"){let Jt=Mt.prerender;Jt&&(le.setCustomLayerDefaults(),ut.setColorMode(le.colorModeForRenderPass()),Jt.call(Mt,ut.gl,le.transform.customLayerMatrix()),ut.setDirty(),le.setBaseState())}else if(le.renderPass==="translucent"){le.setCustomLayerDefaults(),ut.setColorMode(le.colorModeForRenderPass()),ut.setStencilMode(Ko.disabled);let Jt=Mt.renderingMode==="3d"?new Po(le.context.gl.LEQUAL,Po.ReadWrite,le.depthRangeFor3D):le.depthModeForSublayer(0,Po.ReadOnly);ut.setDepthMode(Jt),Mt.render(ut.gl,le.transform.customLayerMatrix(),{farZ:le.transform.farZ,nearZ:le.transform.nearZ,fov:le.transform._fov,modelViewProjectionMatrix:le.transform.modelViewProjectionMatrix,projectionMatrix:le.transform.projectionMatrix}),ut.setDirty(),le.setBaseState(),ut.bindFramebuffer.set(null)}})(w,0,Q)}}translatePosMatrix(w,B,Q,ee,le){if(!Q[0]&&!Q[1])return w;let Fe=le?ee==="map"?this.transform.angle:0:ee==="viewport"?-this.transform.angle:0;if(Fe){let Mt=Math.sin(Fe),Jt=Math.cos(Fe);Q=[Q[0]*Jt-Q[1]*Mt,Q[0]*Mt+Q[1]*Jt]}let Ze=[le?Q[0]:Fn(B,Q[0],this.transform.zoom),le?Q[1]:Fn(B,Q[1],this.transform.zoom),0],ut=new Float32Array(16);return a.J(ut,w,Ze),ut}saveTileTexture(w){let B=this._tileTextures[w.size[0]];B?B.push(w):this._tileTextures[w.size[0]]=[w]}getTileTexture(w){let B=this._tileTextures[w];return B&&B.length>0?B.pop():null}isPatternMissing(w){if(!w)return!1;if(!w.from||!w.to)return!0;let B=this.imageManager.getPattern(w.from.toString()),Q=this.imageManager.getPattern(w.to.toString());return!B||!Q}useProgram(w,B){this.cache=this.cache||{};let Q=w+(B?B.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[Q]||(this.cache[Q]=new hn(this.context,Gn[w],B,nc[w],this._showOverdrawInspector,this.style.map.terrain)),this.cache[Q]}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(){let w=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(w.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new g(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:w,drawingBufferHeight:B}=this.context.gl;return this.width!==w||this.height!==B}}class ks{constructor(w,B){this.points=w,this.planes=B}static fromInvProjectionMatrix(w,B,Q){let ee=Math.pow(2,Q),le=[[-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(Ze=>{let ut=1/(Ze=a.af([],Ze,w))[3]/B*ee;return a.b1(Ze,Ze,[ut,ut,1/Ze[3],ut])}),Fe=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(Ze=>{let ut=function(yr,Cr){var ve=Cr[0],xe=Cr[1],Ie=Cr[2],ze=ve*ve+xe*xe+Ie*Ie;return ze>0&&(ze=1/Math.sqrt(ze)),yr[0]=Cr[0]*ze,yr[1]=Cr[1]*ze,yr[2]=Cr[2]*ze,yr}([],function(yr,Cr,ve){var xe=Cr[0],Ie=Cr[1],ze=Cr[2],Qe=ve[0],Xe=ve[1],nt=ve[2];return yr[0]=Ie*nt-ze*Xe,yr[1]=ze*Qe-xe*nt,yr[2]=xe*Xe-Ie*Qe,yr}([],L([],le[Ze[0]],le[Ze[1]]),L([],le[Ze[2]],le[Ze[1]]))),Mt=-((Jt=ut)[0]*($t=le[Ze[1]])[0]+Jt[1]*$t[1]+Jt[2]*$t[2]);var Jt,$t;return ut.concat(Mt)});return new ks(le,Fe)}}class bc{constructor(w,B){this.min=w,this.max=B,this.center=function(Q,ee,le){return Q[0]=.5*ee[0],Q[1]=.5*ee[1],Q[2]=.5*ee[2],Q}([],function(Q,ee,le){return Q[0]=ee[0]+le[0],Q[1]=ee[1]+le[1],Q[2]=ee[2]+le[2],Q}([],this.min,this.max))}quadrant(w){let B=[w%2==0,w<2],Q=M(this.min),ee=M(this.max);for(let le=0;le<B.length;le++)Q[le]=B[le]?this.min[le]:this.center[le],ee[le]=B[le]?this.center[le]:this.max[le];return ee[2]=this.max[2],new bc(Q,ee)}distanceX(w){return Math.max(Math.min(this.max[0],w[0]),this.min[0])-w[0]}distanceY(w){return Math.max(Math.min(this.max[1],w[1]),this.min[1])-w[1]}intersects(w){let B=[[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]],Q=!0;for(let ee=0;ee<w.planes.length;ee++){let le=w.planes[ee],Fe=0;for(let Ze=0;Ze<B.length;Ze++)a.b2(le,B[Ze])>=0&&Fe++;if(Fe===0)return 0;Fe!==B.length&&(Q=!1)}if(Q)return 2;for(let ee=0;ee<3;ee++){let le=Number.MAX_VALUE,Fe=-Number.MAX_VALUE;for(let Ze=0;Ze<w.points.length;Ze++){let ut=w.points[Ze][ee]-this.min[ee];le=Math.min(le,ut),Fe=Math.max(Fe,ut)}if(Fe<0||le>this.max[ee]-this.min[ee])return 0}return 1}}class hu{constructor(w=0,B=0,Q=0,ee=0){if(isNaN(w)||w<0||isNaN(B)||B<0||isNaN(Q)||Q<0||isNaN(ee)||ee<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=w,this.bottom=B,this.left=Q,this.right=ee}interpolate(w,B,Q){return B.top!=null&&w.top!=null&&(this.top=a.y.number(w.top,B.top,Q)),B.bottom!=null&&w.bottom!=null&&(this.bottom=a.y.number(w.bottom,B.bottom,Q)),B.left!=null&&w.left!=null&&(this.left=a.y.number(w.left,B.left,Q)),B.right!=null&&w.right!=null&&(this.right=a.y.number(w.right,B.right,Q)),this}getCenter(w,B){let Q=a.ac((this.left+w-this.right)/2,0,w),ee=a.ac((this.top+B-this.bottom)/2,0,B);return new a.P(Q,ee)}equals(w){return this.top===w.top&&this.bottom===w.bottom&&this.left===w.left&&this.right===w.right}clone(){return new hu(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let _u=85.051129;class nl{constructor(w,B,Q,ee,le){this.tileSize=512,this._renderWorldCopies=le===void 0||!!le,this._minZoom=w||0,this._maxZoom=B||22,this._minPitch=Q==null?0:Q,this._maxPitch=ee==null?60:ee,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 hu,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let w=new nl(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return w.apply(this),w}apply(w){this.tileSize=w.tileSize,this.latRange=w.latRange,this.lngRange=w.lngRange,this.width=w.width,this.height=w.height,this._center=w._center,this._elevation=w._elevation,this.minElevationForCurrentTile=w.minElevationForCurrentTile,this.zoom=w.zoom,this.angle=w.angle,this._fov=w._fov,this._pitch=w._pitch,this._unmodified=w._unmodified,this._edgeInsets=w._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(w){this._minZoom!==w&&(this._minZoom=w,this.zoom=Math.max(this.zoom,w))}get maxZoom(){return this._maxZoom}set maxZoom(w){this._maxZoom!==w&&(this._maxZoom=w,this.zoom=Math.min(this.zoom,w))}get minPitch(){return this._minPitch}set minPitch(w){this._minPitch!==w&&(this._minPitch=w,this.pitch=Math.max(this.pitch,w))}get maxPitch(){return this._maxPitch}set maxPitch(w){this._maxPitch!==w&&(this._maxPitch=w,this.pitch=Math.min(this.pitch,w))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(w){w===void 0?w=!0:w===null&&(w=!1),this._renderWorldCopies=w}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(w){let B=-a.b3(w,-180,180)*Math.PI/180;this.angle!==B&&(this._unmodified=!1,this.angle=B,this._calcMatrices(),this.rotationMatrix=function(){var Q=new a.A(4);return a.A!=Float32Array&&(Q[1]=0,Q[2]=0),Q[0]=1,Q[3]=1,Q}(),function(Q,ee,le){var Fe=ee[0],Ze=ee[1],ut=ee[2],Mt=ee[3],Jt=Math.sin(le),$t=Math.cos(le);Q[0]=Fe*$t+ut*Jt,Q[1]=Ze*$t+Mt*Jt,Q[2]=Fe*-Jt+ut*$t,Q[3]=Ze*-Jt+Mt*$t}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(w){let B=a.ac(w,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==B&&(this._unmodified=!1,this._pitch=B,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(w){w=Math.max(.01,Math.min(60,w)),this._fov!==w&&(this._unmodified=!1,this._fov=w/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(w){let B=Math.min(Math.max(w,this.minZoom),this.maxZoom);this._zoom!==B&&(this._unmodified=!1,this._zoom=B,this.tileZoom=Math.max(0,Math.floor(B)),this.scale=this.zoomScale(B),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(w){w.lat===this._center.lat&&w.lng===this._center.lng||(this._unmodified=!1,this._center=w,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(w){w!==this._elevation&&(this._elevation=w,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(w){this._edgeInsets.equals(w)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,w,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(w){return this._edgeInsets.equals(w)}interpolatePadding(w,B,Q){this._unmodified=!1,this._edgeInsets.interpolate(w,B,Q),this._constrain(),this._calcMatrices()}coveringZoomLevel(w){let B=(w.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/w.tileSize));return Math.max(0,B)}getVisibleUnwrappedCoordinates(w){let B=[new a.b4(0,w)];if(this._renderWorldCopies){let Q=this.pointCoordinate(new a.P(0,0)),ee=this.pointCoordinate(new a.P(this.width,0)),le=this.pointCoordinate(new a.P(this.width,this.height)),Fe=this.pointCoordinate(new a.P(0,this.height)),Ze=Math.floor(Math.min(Q.x,ee.x,le.x,Fe.x)),ut=Math.floor(Math.max(Q.x,ee.x,le.x,Fe.x)),Mt=1;for(let Jt=Ze-Mt;Jt<=ut+Mt;Jt++)Jt!==0&&B.push(new a.b4(Jt,w))}return B}coveringTiles(w){var B,Q;let ee=this.coveringZoomLevel(w),le=ee;if(w.minzoom!==void 0&&ee<w.minzoom)return[];w.maxzoom!==void 0&&ee>w.maxzoom&&(ee=w.maxzoom);let Fe=this.pointCoordinate(this.getCameraPoint()),Ze=a.Z.fromLngLat(this.center),ut=Math.pow(2,ee),Mt=[ut*Fe.x,ut*Fe.y,0],Jt=[ut*Ze.x,ut*Ze.y,0],$t=ks.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,ee),yr=w.minzoom||0;!w.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(yr=ee);let Cr=w.terrain?2/Math.min(this.tileSize,w.tileSize)*this.tileSize:3,ve=Xe=>({aabb:new bc([Xe*ut,0,0],[(Xe+1)*ut,ut,0]),zoom:0,x:0,y:0,wrap:Xe,fullyVisible:!1}),xe=[],Ie=[],ze=ee,Qe=w.reparseOverscaled?le:ee;if(this._renderWorldCopies)for(let Xe=1;Xe<=3;Xe++)xe.push(ve(-Xe)),xe.push(ve(Xe));for(xe.push(ve(0));xe.length>0;){let Xe=xe.pop(),nt=Xe.x,qt=Xe.y,Wt=Xe.fullyVisible;if(!Wt){let Hr=Xe.aabb.intersects($t);if(Hr===0)continue;Wt=Hr===2}let nr=w.terrain?Mt:Jt,fr=Xe.aabb.distanceX(nr),br=Xe.aabb.distanceY(nr),Fr=Math.max(Math.abs(fr),Math.abs(br));if(Xe.zoom===ze||Fr>Cr+(1<<ze-Xe.zoom)-2&&Xe.zoom>=yr){let Hr=ze-Xe.zoom,ri=Mt[0]-.5-(nt<<Hr),Ci=Mt[1]-.5-(qt<<Hr);Ie.push({tileID:new a.S(Xe.zoom===ze?Qe:Xe.zoom,Xe.wrap,Xe.zoom,nt,qt),distanceSq:x([Jt[0]-.5-nt,Jt[1]-.5-qt]),tileDistanceToCamera:Math.sqrt(ri*ri+Ci*Ci)})}else for(let Hr=0;Hr<4;Hr++){let ri=(nt<<1)+Hr%2,Ci=(qt<<1)+(Hr>>1),cn=Xe.zoom+1,sn=Xe.aabb.quadrant(Hr);if(w.terrain){let Ln=new a.S(cn,Xe.wrap,cn,ri,Ci),Yn=w.terrain.getMinMaxElevation(Ln),Aa=(B=Yn.minElevation)!==null&&B!==void 0?B:this.elevation,fa=(Q=Yn.maxElevation)!==null&&Q!==void 0?Q:this.elevation;sn=new bc([sn.min[0],sn.min[1],Aa],[sn.max[0],sn.max[1],fa])}xe.push({aabb:sn,zoom:cn,x:ri,y:Ci,wrap:Xe.wrap,fullyVisible:Wt})}}return Ie.sort((Xe,nt)=>Xe.distanceSq-nt.distanceSq).map(Xe=>Xe.tileID)}resize(w,B){this.width=w,this.height=B,this.pixelsToGLUnits=[2/w,-2/B],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(w){return Math.pow(2,w)}scaleZoom(w){return Math.log(w)/Math.LN2}project(w){let B=a.ac(w.lat,-85.051129,_u);return new a.P(a.O(w.lng)*this.worldSize,a.Q(B)*this.worldSize)}unproject(w){return new a.Z(w.x/this.worldSize,w.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(w){let B=this.elevation,Q=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,ee=this.pointLocation(this.centerPoint,w),le=w.getElevationForLngLatZoom(ee,this.tileZoom);if(!(this.elevation-le))return;let Fe=Q+B-le,Ze=Math.cos(this._pitch)*this.cameraToCenterDistance/Fe/a.b5(1,ee.lat),ut=this.scaleZoom(Ze/this.tileSize);this._elevation=le,this._center=ee,this.zoom=ut}setLocationAtPoint(w,B){let Q=this.pointCoordinate(B),ee=this.pointCoordinate(this.centerPoint),le=this.locationCoordinate(w),Fe=new a.Z(le.x-(Q.x-ee.x),le.y-(Q.y-ee.y));this.center=this.coordinateLocation(Fe),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(w,B){return B?this.coordinatePoint(this.locationCoordinate(w),B.getElevationForLngLatZoom(w,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(w))}pointLocation(w,B){return this.coordinateLocation(this.pointCoordinate(w,B))}locationCoordinate(w){return a.Z.fromLngLat(w)}coordinateLocation(w){return w&&w.toLngLat()}pointCoordinate(w,B){if(B){let yr=B.pointCoordinate(w);if(yr!=null)return yr}let Q=[w.x,w.y,0,1],ee=[w.x,w.y,1,1];a.af(Q,Q,this.pixelMatrixInverse),a.af(ee,ee,this.pixelMatrixInverse);let le=Q[3],Fe=ee[3],Ze=Q[1]/le,ut=ee[1]/Fe,Mt=Q[2]/le,Jt=ee[2]/Fe,$t=Mt===Jt?0:(0-Mt)/(Jt-Mt);return new a.Z(a.y.number(Q[0]/le,ee[0]/Fe,$t)/this.worldSize,a.y.number(Ze,ut,$t)/this.worldSize)}coordinatePoint(w,B=0,Q=this.pixelMatrix){let ee=[w.x*this.worldSize,w.y*this.worldSize,B,1];return a.af(ee,ee,Q),new a.P(ee[0]/ee[3],ee[1]/ee[3])}getBounds(){let w=Math.max(0,this.height/2-this.getHorizon());return new ce().extend(this.pointLocation(new a.P(0,w))).extend(this.pointLocation(new a.P(this.width,w))).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 ce([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(w){w?(this.lngRange=[w.getWest(),w.getEast()],this.latRange=[w.getSouth(),w.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,_u])}calculateTileMatrix(w){let B=w.canonical,Q=this.worldSize/this.zoomScale(B.z),ee=B.x+Math.pow(2,B.z)*w.wrap,le=a.an(new Float64Array(16));return a.J(le,le,[ee*Q,B.y*Q,0]),a.K(le,le,[Q/a.X,Q/a.X,1]),le}calculatePosMatrix(w,B=!1){let Q=w.key,ee=B?this._alignedPosMatrixCache:this._posMatrixCache;if(ee[Q])return ee[Q];let le=this.calculateTileMatrix(w);return a.L(le,B?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,le),ee[Q]=new Float32Array(le),ee[Q]}calculateFogMatrix(w){let B=w.key,Q=this._fogMatrixCache;if(Q[B])return Q[B];let ee=this.calculateTileMatrix(w);return a.L(ee,this.fogMatrix,ee),Q[B]=new Float32Array(ee),Q[B]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(w,B){B=a.ac(+B,this.minZoom,this.maxZoom);let Q={center:new a.N(w.lng,w.lat),zoom:B},ee=this.lngRange;if(!this._renderWorldCopies&&ee===null){let Xe=179.9999999999;ee=[-Xe,Xe]}let le=this.tileSize*this.zoomScale(Q.zoom),Fe=0,Ze=le,ut=0,Mt=le,Jt=0,$t=0,{x:yr,y:Cr}=this.size;if(this.latRange){let Xe=this.latRange;Fe=a.Q(Xe[1])*le,Ze=a.Q(Xe[0])*le,Ze-Fe<Cr&&(Jt=Cr/(Ze-Fe))}ee&&(ut=a.b3(a.O(ee[0])*le,0,le),Mt=a.b3(a.O(ee[1])*le,0,le),Mt<ut&&(Mt+=le),Mt-ut<yr&&($t=yr/(Mt-ut)));let{x:ve,y:xe}=this.project.call({worldSize:le},w),Ie,ze,Qe=Math.max($t||0,Jt||0);if(Qe){let Xe=new a.P($t?(Mt+ut)/2:ve,Jt?(Ze+Fe)/2:xe);return Q.center=this.unproject.call({worldSize:le},Xe).wrap(),Q.zoom+=this.scaleZoom(Qe),Q}if(this.latRange){let Xe=Cr/2;xe-Xe<Fe&&(ze=Fe+Xe),xe+Xe>Ze&&(ze=Ze-Xe)}if(ee){let Xe=(ut+Mt)/2,nt=ve;this._renderWorldCopies&&(nt=a.b3(ve,Xe-le/2,Xe+le/2));let qt=yr/2;nt-qt<ut&&(Ie=ut+qt),nt+qt>Mt&&(Ie=Mt-qt)}if(Ie!==void 0||ze!==void 0){let Xe=new a.P(Ie!=null?Ie:ve,ze!=null?ze:xe);Q.center=this.unproject.call({worldSize:le},Xe).wrap()}return Q}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let w=this._unmodified,{center:B,zoom:Q}=this.getConstrained(this.center,this.zoom);this.center=B,this.zoom=Q,this._unmodified=w,this._constraining=!1}_calcMatrices(){if(!this.height)return;let w=this.centerOffset,B=this.point.x,Q=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=a.b5(1,this.center.lat)*this.worldSize;let ee=a.an(new Float64Array(16));a.K(ee,ee,[this.width/2,-this.height/2,1]),a.J(ee,ee,[1,-1,0]),this.labelPlaneMatrix=ee,ee=a.an(new Float64Array(16)),a.K(ee,ee,[1,-1,1]),a.J(ee,ee,[-1,-1,0]),a.K(ee,ee,[2/this.width,2/this.height,1]),this.glCoordMatrix=ee;let le=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),Fe=Math.min(this.elevation,this.minElevationForCurrentTile),Ze=le-Fe*this._pixelPerMeter/Math.cos(this._pitch),ut=Fe<0?Ze:le,Mt=Math.PI/2+this._pitch,Jt=this._fov*(.5+w.y/this.height),$t=Math.sin(Jt)*ut/Math.sin(a.ac(Math.PI-Mt-Jt,.01,Math.PI-.01)),yr=this.getHorizon(),Cr=2*Math.atan(yr/this.cameraToCenterDistance)*(.5+w.y/(2*yr)),ve=Math.sin(Cr)*ut/Math.sin(a.ac(Math.PI-Mt-Cr,.01,Math.PI-.01)),xe=Math.min($t,ve);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*xe+ut),this.nearZ=this.height/50,ee=new Float64Array(16),a.b6(ee,this._fov,this.width/this.height,this.nearZ,this.farZ),ee[8]=2*-w.x/this.width,ee[9]=2*w.y/this.height,this.projectionMatrix=a.ae(ee),a.K(ee,ee,[1,-1,1]),a.J(ee,ee,[0,0,-this.cameraToCenterDistance]),a.b7(ee,ee,this._pitch),a.ad(ee,ee,this.angle),a.J(ee,ee,[-B,-Q,0]),this.mercatorMatrix=a.K([],ee,[this.worldSize,this.worldSize,this.worldSize]),a.K(ee,ee,[1,1,this._pixelPerMeter]),this.pixelMatrix=a.L(new Float64Array(16),this.labelPlaneMatrix,ee),a.J(ee,ee,[0,0,-this.elevation]),this.modelViewProjectionMatrix=ee,this.invModelViewProjectionMatrix=a.as([],ee),this.fogMatrix=new Float64Array(16),a.b6(this.fogMatrix,this._fov,this.width/this.height,le,this.farZ),this.fogMatrix[8]=2*-w.x/this.width,this.fogMatrix[9]=2*w.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.ad(this.fogMatrix,this.fogMatrix,this.angle),a.J(this.fogMatrix,this.fogMatrix,[-B,-Q,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,ee);let Ie=this.width%2/2,ze=this.height%2/2,Qe=Math.cos(this.angle),Xe=Math.sin(this.angle),nt=B-Math.round(B)+Qe*Ie+Xe*ze,qt=Q-Math.round(Q)+Qe*ze+Xe*Ie,Wt=new Float64Array(ee);if(a.J(Wt,Wt,[nt>.5?nt-1:nt,qt>.5?qt-1:qt,0]),this.alignedModelViewProjectionMatrix=Wt,ee=a.as(new Float64Array(16),this.pixelMatrix),!ee)throw new Error("failed to invert matrix");this.pixelMatrixInverse=ee,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let w=this.pointCoordinate(new a.P(0,0)),B=[w.x*this.worldSize,w.y*this.worldSize,0,1];return a.af(B,B,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let w=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new a.P(0,w))}getCameraQueryGeometry(w){let B=this.getCameraPoint();if(w.length===1)return[w[0],B];{let Q=B.x,ee=B.y,le=B.x,Fe=B.y;for(let Ze of w)Q=Math.min(Q,Ze.x),ee=Math.min(ee,Ze.y),le=Math.max(le,Ze.x),Fe=Math.max(Fe,Ze.y);return[new a.P(Q,ee),new a.P(le,ee),new a.P(le,Fe),new a.P(Q,Fe),new a.P(Q,ee)]}}lngLatToCameraDepth(w,B){let Q=this.locationCoordinate(w),ee=[Q.x*this.worldSize,Q.y*this.worldSize,B,1];return a.af(ee,ee,this.modelViewProjectionMatrix),ee[2]/ee[3]}}function nh(ue,w){let B,Q=!1,ee=null,le=null,Fe=()=>{ee=null,Q&&(ue.apply(le,B),ee=setTimeout(Fe,w),Q=!1)};return(...Ze)=>(Q=!0,le=this,B=Ze,ee||Fe(),ee)}class Mh{constructor(w){this._getCurrentHash=()=>{let B=window.location.hash.replace("#","");if(this._hashName){let Q;return B.split("&").map(ee=>ee.split("=")).forEach(ee=>{ee[0]===this._hashName&&(Q=ee)}),(Q&&Q[1]||"").split("/")}return B.split("/")},this._onHashChange=()=>{let B=this._getCurrentHash();if(B.length>=3&&!B.some(Q=>isNaN(Q))){let Q=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(B[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+B[2],+B[1]],zoom:+B[0],bearing:Q,pitch:+(B[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let B=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,B)},this._removeHash=()=>{let B=this._getCurrentHash();if(B.length===0)return;let Q=B.join("/"),ee=Q;ee.split("&").length>0&&(ee=ee.split("&")[0]),this._hashName&&(ee=`${this._hashName}=${Q}`);let le=window.location.hash.replace(ee,"");le.startsWith("#&")?le=le.slice(0,1)+le.slice(2):le==="#"&&(le="");let Fe=window.location.href.replace(/(#.+)?$/,le);Fe=Fe.replace("&&","&"),window.history.replaceState(window.history.state,null,Fe)},this._updateHash=nh(this._updateHashUnthrottled,300),this._hashName=w&&encodeURIComponent(w)}addTo(w){return this._map=w,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(w){let B=this._map.getCenter(),Q=Math.round(100*this._map.getZoom())/100,ee=Math.ceil((Q*Math.LN2+Math.log(512/360/.5))/Math.LN10),le=Math.pow(10,ee),Fe=Math.round(B.lng*le)/le,Ze=Math.round(B.lat*le)/le,ut=this._map.getBearing(),Mt=this._map.getPitch(),Jt="";if(Jt+=w?`/${Fe}/${Ze}/${Q}`:`${Q}/${Ze}/${Fe}`,(ut||Mt)&&(Jt+="/"+Math.round(10*ut)/10),Mt&&(Jt+=`/${Math.round(Mt)}`),this._hashName){let $t=this._hashName,yr=!1,Cr=window.location.hash.slice(1).split("&").map(ve=>{let xe=ve.split("=")[0];return xe===$t?(yr=!0,`${xe}=${Jt}`):ve}).filter(ve=>ve);return yr||Cr.push(`${$t}=${Jt}`),`#${Cr.join("&")}`}return`#${Jt}`}}let zu={linearity:.3,easing:a.b8(0,0,.3,1)},Fc=a.e({deceleration:2500,maxSpeed:1400},zu),wc=a.e({deceleration:20,maxSpeed:1400},zu),bd=a.e({deceleration:1e3,maxSpeed:360},zu),xf=a.e({deceleration:1e3,maxSpeed:90},zu);class Pf{constructor(w){this._map=w,this.clear()}clear(){this._inertiaBuffer=[]}record(w){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.now(),settings:w})}_drainInertiaBuffer(){let w=this._inertiaBuffer,B=u.now();for(;w.length>0&&B-w[0].time>160;)w.shift()}_onMoveEnd(w){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let B={zoom:0,bearing:0,pitch:0,pan:new a.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:le}of this._inertiaBuffer)B.zoom+=le.zoomDelta||0,B.bearing+=le.bearingDelta||0,B.pitch+=le.pitchDelta||0,le.panDelta&&B.pan._add(le.panDelta),le.around&&(B.around=le.around),le.pinchAround&&(B.pinchAround=le.pinchAround);let Q=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,ee={};if(B.pan.mag()){let le=bf(B.pan.mag(),Q,a.e({},Fc,w||{}));ee.offset=B.pan.mult(le.amount/B.pan.mag()),ee.center=this._map.transform.center,qu(ee,le)}if(B.zoom){let le=bf(B.zoom,Q,wc);ee.zoom=this._map.transform.zoom+le.amount,qu(ee,le)}if(B.bearing){let le=bf(B.bearing,Q,bd);ee.bearing=this._map.transform.bearing+a.ac(le.amount,-179,179),qu(ee,le)}if(B.pitch){let le=bf(B.pitch,Q,xf);ee.pitch=this._map.transform.pitch+le.amount,qu(ee,le)}if(ee.zoom||ee.bearing){let le=B.pinchAround===void 0?B.around:B.pinchAround;ee.around=le?this._map.unproject(le):this._map.getCenter()}return this.clear(),a.e(ee,{noMoveStart:!0})}}function qu(ue,w){(!ue.duration||ue.duration<w.duration)&&(ue.duration=w.duration,ue.easing=w.easing)}function bf(ue,w,B){let{maxSpeed:Q,linearity:ee,deceleration:le}=B,Fe=a.ac(ue*ee/(w/1e3),-Q,Q),Ze=Math.abs(Fe)/(le*ee);return{easing:B.easing,duration:1e3*Ze,amount:Fe*(Ze/2)}}class jl extends a.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(w,B,Q,ee={}){let le=c.mousePos(B.getCanvas(),Q),Fe=B.unproject(le);super(w,a.e({point:le,lngLat:Fe,originalEvent:Q},ee)),this._defaultPrevented=!1,this.target=B}}class uf extends a.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(w,B,Q){let ee=w==="touchend"?Q.changedTouches:Q.touches,le=c.touchPos(B.getCanvasContainer(),ee),Fe=le.map(ut=>B.unproject(ut)),Ze=le.reduce((ut,Mt,Jt,$t)=>ut.add(Mt.div($t.length)),new a.P(0,0));super(w,{points:le,point:Ze,lngLats:Fe,lngLat:B.unproject(Ze),originalEvent:Q}),this._defaultPrevented=!1}}class Xh extends a.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(w,B,Q){super(w,{originalEvent:Q}),this._defaultPrevented=!1}}class If{constructor(w,B){this._map=w,this._clickTolerance=B.clickTolerance}reset(){delete this._mousedownPos}wheel(w){return this._firePreventable(new Xh(w.type,this._map,w))}mousedown(w,B){return this._mousedownPos=B,this._firePreventable(new jl(w.type,this._map,w))}mouseup(w){this._map.fire(new jl(w.type,this._map,w))}click(w,B){this._mousedownPos&&this._mousedownPos.dist(B)>=this._clickTolerance||this._map.fire(new jl(w.type,this._map,w))}dblclick(w){return this._firePreventable(new jl(w.type,this._map,w))}mouseover(w){this._map.fire(new jl(w.type,this._map,w))}mouseout(w){this._map.fire(new jl(w.type,this._map,w))}touchstart(w){return this._firePreventable(new uf(w.type,this._map,w))}touchmove(w){this._map.fire(new uf(w.type,this._map,w))}touchend(w){this._map.fire(new uf(w.type,this._map,w))}touchcancel(w){this._map.fire(new uf(w.type,this._map,w))}_firePreventable(w){if(this._map.fire(w),w.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Cs{constructor(w){this._map=w}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(w){this._map.fire(new jl(w.type,this._map,w))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new jl("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(w){this._delayContextMenu?this._contextMenuEvent=w:this._ignoreContextMenu||this._map.fire(new jl(w.type,this._map,w)),this._map.listens("contextmenu")&&w.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class du{constructor(w){this._map=w}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(w){return this.transform.pointLocation(a.P.convert(w),this._map.terrain)}}class ku{constructor(w,B){this._map=w,this._tr=new du(w),this._el=w.getCanvasContainer(),this._container=w.getContainer(),this._clickTolerance=B.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(w,B){this.isEnabled()&&w.shiftKey&&w.button===0&&(c.disableDrag(),this._startPos=this._lastPos=B,this._active=!0)}mousemoveWindow(w,B){if(!this._active)return;let Q=B;if(this._lastPos.equals(Q)||!this._box&&Q.dist(this._startPos)<this._clickTolerance)return;let ee=this._startPos;this._lastPos=Q,this._box||(this._box=c.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",w));let le=Math.min(ee.x,Q.x),Fe=Math.max(ee.x,Q.x),Ze=Math.min(ee.y,Q.y),ut=Math.max(ee.y,Q.y);c.setTransform(this._box,`translate(${le}px,${Ze}px)`),this._box.style.width=Fe-le+"px",this._box.style.height=ut-Ze+"px"}mouseupWindow(w,B){if(!this._active||w.button!==0)return;let Q=this._startPos,ee=B;if(this.reset(),c.suppressClick(),Q.x!==ee.x||Q.y!==ee.y)return this._map.fire(new a.k("boxzoomend",{originalEvent:w})),{cameraAnimation:le=>le.fitScreenCoordinates(Q,ee,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",w)}keydown(w){this._active&&w.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",w))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(c.remove(this._box),this._box=null),c.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(w,B){return this._map.fire(new a.k(w,{originalEvent:B}))}}function Xf(ue,w){if(ue.length!==w.length)throw new Error(`The number of touches and points are not equal - touches ${ue.length}, points ${w.length}`);let B={};for(let Q=0;Q<ue.length;Q++)B[ue[Q].identifier]=w[Q];return B}class Us{constructor(w){this.reset(),this.numTouches=w.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(w,B,Q){(this.centroid||Q.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=w.timeStamp),Q.length===this.numTouches&&(this.centroid=function(ee){let le=new a.P(0,0);for(let Fe of ee)le._add(Fe);return le.div(ee.length)}(B),this.touches=Xf(Q,B)))}touchmove(w,B,Q){if(this.aborted||!this.centroid)return;let ee=Xf(Q,B);for(let le in this.touches){let Fe=ee[le];(!Fe||Fe.dist(this.touches[le])>30)&&(this.aborted=!0)}}touchend(w,B,Q){if((!this.centroid||w.timeStamp-this.startTime>500)&&(this.aborted=!0),Q.length===0){let ee=!this.aborted&&this.centroid;if(this.reset(),ee)return ee}}}class wf{constructor(w){this.singleTap=new Us(w),this.numTaps=w.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(w,B,Q){this.singleTap.touchstart(w,B,Q)}touchmove(w,B,Q){this.singleTap.touchmove(w,B,Q)}touchend(w,B,Q){let ee=this.singleTap.touchend(w,B,Q);if(ee){let le=w.timeStamp-this.lastTime<500,Fe=!this.lastTap||this.lastTap.dist(ee)<30;if(le&&Fe||this.reset(),this.count++,this.lastTime=w.timeStamp,this.lastTap=ee,this.count===this.numTaps)return this.reset(),ee}}}class zc{constructor(w){this._tr=new du(w),this._zoomIn=new wf({numTouches:1,numTaps:2}),this._zoomOut=new wf({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(w,B,Q){this._zoomIn.touchstart(w,B,Q),this._zoomOut.touchstart(w,B,Q)}touchmove(w,B,Q){this._zoomIn.touchmove(w,B,Q),this._zoomOut.touchmove(w,B,Q)}touchend(w,B,Q){let ee=this._zoomIn.touchend(w,B,Q),le=this._zoomOut.touchend(w,B,Q),Fe=this._tr;return ee?(this._active=!0,w.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:Ze=>Ze.easeTo({duration:300,zoom:Fe.zoom+1,around:Fe.unproject(ee)},{originalEvent:w})}):le?(this._active=!0,w.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:Ze=>Ze.easeTo({duration:300,zoom:Fe.zoom-1,around:Fe.unproject(le)},{originalEvent:w})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Wu{constructor(w){this._enabled=!!w.enable,this._moveStateManager=w.moveStateManager,this._clickTolerance=w.clickTolerance||1,this._moveFunction=w.move,this._activateOnStart=!!w.activateOnStart,w.assignEvents(this),this.reset()}reset(w){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(w)}_move(...w){let B=this._moveFunction(...w);if(B.bearingDelta||B.pitchDelta||B.around||B.panDelta)return this._active=!0,B}dragStart(w,B){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(w)&&(this._moveStateManager.startMove(w),this._lastPoint=B.length?B[0]:B,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(w,B){if(!this.isEnabled())return;let Q=this._lastPoint;if(!Q)return;if(w.preventDefault(),!this._moveStateManager.isValidMoveEvent(w))return void this.reset(w);let ee=B.length?B[0]:B;return!this._moved&&ee.dist(Q)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=ee,this._move(Q,ee))}dragEnd(w){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(w)&&(this._moved&&c.suppressClick(),this.reset(w))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let Rf={0:1,2:2};class Xu{constructor(w){this._correctEvent=w.checkCorrectEvent}startMove(w){let B=c.mouseButton(w);this._eventButton=B}endMove(w){delete this._eventButton}isValidStartEvent(w){return this._correctEvent(w)}isValidMoveEvent(w){return!function(B,Q){let ee=Rf[Q];return B.buttons===void 0||(B.buttons&ee)!==ee}(w,this._eventButton)}isValidEndEvent(w){return c.mouseButton(w)===this._eventButton}}class cf{constructor(){this._firstTouch=void 0}_isOneFingerTouch(w){return w.targetTouches.length===1}_isSameTouchEvent(w){return w.targetTouches[0].identifier===this._firstTouch}startMove(w){this._firstTouch=w.targetTouches[0].identifier}endMove(w){delete this._firstTouch}isValidStartEvent(w){return this._isOneFingerTouch(w)}isValidMoveEvent(w){return this._isOneFingerTouch(w)&&this._isSameTouchEvent(w)}isValidEndEvent(w){return this._isOneFingerTouch(w)&&this._isSameTouchEvent(w)}}let Zf=ue=>{ue.mousedown=ue.dragStart,ue.mousemoveWindow=ue.dragMove,ue.mouseup=ue.dragEnd,ue.contextmenu=w=>{w.preventDefault()}},Wl=({enable:ue,clickTolerance:w,bearingDegreesPerPixelMoved:B=.8})=>{let Q=new Xu({checkCorrectEvent:ee=>c.mouseButton(ee)===0&&ee.ctrlKey||c.mouseButton(ee)===2});return new Wu({clickTolerance:w,move:(ee,le)=>({bearingDelta:(le.x-ee.x)*B}),moveStateManager:Q,enable:ue,assignEvents:Zf})},ah=({enable:ue,clickTolerance:w,pitchDegreesPerPixelMoved:B=-.5})=>{let Q=new Xu({checkCorrectEvent:ee=>c.mouseButton(ee)===0&&ee.ctrlKey||c.mouseButton(ee)===2});return new Wu({clickTolerance:w,move:(ee,le)=>({pitchDelta:(le.y-ee.y)*B}),moveStateManager:Q,enable:ue,assignEvents:Zf})};class Zu{constructor(w,B){this._clickTolerance=w.clickTolerance||1,this._map=B,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new a.P(0,0)}_shouldBePrevented(w){return w<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(w,B,Q){return this._calculateTransform(w,B,Q)}touchmove(w,B,Q){if(this._active){if(!this._shouldBePrevented(Q.length))return w.preventDefault(),this._calculateTransform(w,B,Q);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",w)}}touchend(w,B,Q){this._calculateTransform(w,B,Q),this._active&&this._shouldBePrevented(Q.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(w,B,Q){Q.length>0&&(this._active=!0);let ee=Xf(Q,B),le=new a.P(0,0),Fe=new a.P(0,0),Ze=0;for(let Mt in ee){let Jt=ee[Mt],$t=this._touches[Mt];$t&&(le._add(Jt),Fe._add(Jt.sub($t)),Ze++,ee[Mt]=Jt)}if(this._touches=ee,this._shouldBePrevented(Ze)||!Fe.mag())return;let ut=Fe.div(Ze);return this._sum._add(ut),this._sum.mag()<this._clickTolerance?void 0:{around:le.div(Ze),panDelta:ut}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class qc{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(w,B,Q){this._firstTwoTouches||Q.length<2||(this._firstTwoTouches=[Q[0].identifier,Q[1].identifier],this._start([B[0],B[1]]))}touchmove(w,B,Q){if(!this._firstTwoTouches)return;w.preventDefault();let[ee,le]=this._firstTwoTouches,Fe=Tc(Q,B,ee),Ze=Tc(Q,B,le);if(!Fe||!Ze)return;let ut=this._aroundCenter?null:Fe.add(Ze).div(2);return this._move([Fe,Ze],ut,w)}touchend(w,B,Q){if(!this._firstTwoTouches)return;let[ee,le]=this._firstTwoTouches,Fe=Tc(Q,B,ee),Ze=Tc(Q,B,le);Fe&&Ze||(this._active&&c.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(w){this._enabled=!0,this._aroundCenter=!!w&&w.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function Tc(ue,w,B){for(let Q=0;Q<ue.length;Q++)if(ue[Q].identifier===B)return w[Q]}function wl(ue,w){return Math.log(ue/w)/Math.LN2}class vu extends qc{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(w){this._startDistance=this._distance=w[0].dist(w[1])}_move(w,B){let Q=this._distance;if(this._distance=w[0].dist(w[1]),this._active||!(Math.abs(wl(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:wl(this._distance,Q),pinchAround:B}}}function Oc(ue,w){return 180*ue.angleWith(w)/Math.PI}class ff extends qc{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(w){this._startVector=this._vector=w[0].sub(w[1]),this._minDiameter=w[0].dist(w[1])}_move(w,B,Q){let ee=this._vector;if(this._vector=w[0].sub(w[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Oc(this._vector,ee),pinchAround:B}}_isBelowThreshold(w){this._minDiameter=Math.min(this._minDiameter,w.mag());let B=25/(Math.PI*this._minDiameter)*360,Q=Oc(w,this._startVector);return Math.abs(Q)<B}}function fc(ue){return Math.abs(ue.y)>Math.abs(ue.x)}class Bc extends qc{constructor(w){super(),this._currentTouchCount=0,this._map=w}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(w,B,Q){super.touchstart(w,B,Q),this._currentTouchCount=Q.length}_start(w){this._lastPoints=w,fc(w[0].sub(w[1]))&&(this._valid=!1)}_move(w,B,Q){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let ee=w[0].sub(this._lastPoints[0]),le=w[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(ee,le,Q.timeStamp),this._valid?(this._lastPoints=w,this._active=!0,{pitchDelta:(ee.y+le.y)/2*-.5}):void 0}gestureBeginsVertically(w,B,Q){if(this._valid!==void 0)return this._valid;let ee=w.mag()>=2,le=B.mag()>=2;if(!ee&&!le)return;if(!ee||!le)return this._firstMove===void 0&&(this._firstMove=Q),Q-this._firstMove<100&&void 0;let Fe=w.y>0==B.y>0;return fc(w)&&fc(B)&&Fe}}let kt={panStep:100,bearingStep:15,pitchStep:10};class Zt{constructor(w){this._tr=new du(w);let B=kt;this._panStep=B.panStep,this._bearingStep=B.bearingStep,this._pitchStep=B.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(w){if(w.altKey||w.ctrlKey||w.metaKey)return;let B=0,Q=0,ee=0,le=0,Fe=0;switch(w.keyCode){case 61:case 107:case 171:case 187:B=1;break;case 189:case 109:case 173:B=-1;break;case 37:w.shiftKey?Q=-1:(w.preventDefault(),le=-1);break;case 39:w.shiftKey?Q=1:(w.preventDefault(),le=1);break;case 38:w.shiftKey?ee=1:(w.preventDefault(),Fe=-1);break;case 40:w.shiftKey?ee=-1:(w.preventDefault(),Fe=1);break;default:return}return this._rotationDisabled&&(Q=0,ee=0),{cameraAnimation:Ze=>{let ut=this._tr;Ze.easeTo({duration:300,easeId:"keyboardHandler",easing:Er,zoom:B?Math.round(ut.zoom)+B*(w.shiftKey?2:1):ut.zoom,bearing:ut.bearing+Q*this._bearingStep,pitch:ut.pitch+ee*this._pitchStep,offset:[-le*this._panStep,-Fe*this._panStep],center:ut.center},{originalEvent:w})}}}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 Er(ue){return ue*(2-ue)}let xr=4.000244140625;class Kr{constructor(w,B){this._onTimeout=Q=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Q)},this._map=w,this._tr=new du(w),this._triggerRenderFrame=B,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(w){this._defaultZoomRate=w}setWheelZoomRate(w){this._wheelZoomRate=w}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(w){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!w&&w.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(w){return!!this._map.cooperativeGestures.isEnabled()&&!(w.ctrlKey||this._map.cooperativeGestures.isBypassed(w))}wheel(w){if(!this.isEnabled())return;if(this._shouldBePrevented(w))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",w);let B=w.deltaMode===WheelEvent.DOM_DELTA_LINE?40*w.deltaY:w.deltaY,Q=u.now(),ee=Q-(this._lastWheelEventTime||0);this._lastWheelEventTime=Q,B!==0&&B%xr==0?this._type="wheel":B!==0&&Math.abs(B)<4?this._type="trackpad":ee>400?(this._type=null,this._lastValue=B,this._timeout=setTimeout(this._onTimeout,40,w)):this._type||(this._type=Math.abs(ee*B)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,B+=this._lastValue)),w.shiftKey&&B&&(B/=4),this._type&&(this._lastWheelEvent=w,this._delta-=B,this._active||this._start(w)),w.preventDefault()}_start(w){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);let B=c.mousePos(this._map.getCanvas(),w),Q=this._tr;this._around=B.y>Q.transform.height/2-Q.transform.getHorizon()?a.N.convert(this._aroundCenter?Q.center:Q.unproject(B)):a.N.convert(Q.center),this._aroundPoint=Q.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let w=this._tr.transform;if(this._delta!==0){let ut=this._type==="wheel"&&Math.abs(this._delta)>xr?this._wheelZoomRate:this._defaultZoomRate,Mt=2/(1+Math.exp(-Math.abs(this._delta*ut)));this._delta<0&&Mt!==0&&(Mt=1/Mt);let Jt=typeof this._targetZoom=="number"?w.zoomScale(this._targetZoom):w.scale;this._targetZoom=Math.min(w.maxZoom,Math.max(w.minZoom,w.scaleZoom(Jt*Mt))),this._type==="wheel"&&(this._startZoom=w.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let B=typeof this._targetZoom=="number"?this._targetZoom:w.zoom,Q=this._startZoom,ee=this._easing,le,Fe=!1,Ze=u.now()-this._lastWheelEventTime;if(this._type==="wheel"&&Q&&ee&&Ze){let ut=Math.min(Ze/200,1),Mt=ee(ut);le=a.y.number(Q,B,Mt),ut<1?this._frameId||(this._frameId=!0):Fe=!0}else le=B,Fe=!0;return this._active=!0,Fe&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!Fe,zoomDelta:le-w.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(w){let B=a.b9;if(this._prevEase){let Q=this._prevEase,ee=(u.now()-Q.start)/Q.duration,le=Q.easing(ee+.01)-Q.easing(ee),Fe=.27/Math.sqrt(le*le+1e-4)*.01,Ze=Math.sqrt(.0729-Fe*Fe);B=a.b8(Fe,Ze,.25,1)}return this._prevEase={start:u.now(),duration:w,easing:B},B}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Mi{constructor(w,B){this._clickZoom=w,this._tapZoom=B}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 Wi{constructor(w){this._tr=new du(w),this.reset()}reset(){this._active=!1}dblclick(w,B){return w.preventDefault(),{cameraAnimation:Q=>{Q.easeTo({duration:300,zoom:this._tr.zoom+(w.shiftKey?-1:1),around:this._tr.unproject(B)},{originalEvent:w})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class dn{constructor(){this._tap=new wf({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(w,B,Q){if(!this._swipePoint)if(this._tapTime){let ee=B[0],le=w.timeStamp-this._tapTime<500,Fe=this._tapPoint.dist(ee)<30;le&&Fe?Q.length>0&&(this._swipePoint=ee,this._swipeTouch=Q[0].identifier):this.reset()}else this._tap.touchstart(w,B,Q)}touchmove(w,B,Q){if(this._tapTime){if(this._swipePoint){if(Q[0].identifier!==this._swipeTouch)return;let ee=B[0],le=ee.y-this._swipePoint.y;return this._swipePoint=ee,w.preventDefault(),this._active=!0,{zoomDelta:le/128}}}else this._tap.touchmove(w,B,Q)}touchend(w,B,Q){if(this._tapTime)this._swipePoint&&Q.length===0&&this.reset();else{let ee=this._tap.touchend(w,B,Q);ee&&(this._tapTime=w.timeStamp,this._tapPoint=ee)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class wn{constructor(w,B,Q){this._el=w,this._mousePan=B,this._touchPan=Q}enable(w){this._inertiaOptions=w||{},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 On{constructor(w,B,Q){this._pitchWithRotate=w.pitchWithRotate,this._mouseRotate=B,this._mousePitch=Q}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 Yi{constructor(w,B,Q,ee){this._el=w,this._touchZoom=B,this._touchRotate=Q,this._tapDragZoom=ee,this._rotationDisabled=!1,this._enabled=!0}enable(w){this._touchZoom.enable(w),this._rotationDisabled||this._touchRotate.enable(w),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 $i{constructor(w,B){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=w,this._options=B,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let w=this._map.getCanvasContainer();w.classList.add("maplibregl-cooperative-gestures"),this._container=c.create("div","maplibregl-cooperative-gesture-screen",w);let B=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(B=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let Q=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),ee=document.createElement("div");ee.className="maplibregl-desktop-message",ee.textContent=B,this._container.appendChild(ee);let le=document.createElement("div");le.className="maplibregl-mobile-message",le.textContent=Q,this._container.appendChild(le),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(c.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(w){return w[this._bypassKey]}notifyGestureBlocked(w,B){this._enabled&&(this._map.fire(new a.k("cooperativegestureprevented",{gestureType:w,originalEvent:B})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let an=ue=>ue.zoom||ue.drag||ue.pitch||ue.rotate;class Fi extends a.k{}function ta(ue){return ue.panDelta&&ue.panDelta.mag()||ue.zoomDelta||ue.bearingDelta||ue.pitchDelta}class Ca{constructor(w,B){this.handleWindowEvent=ee=>{this.handleEvent(ee,`${ee.type}Window`)},this.handleEvent=(ee,le)=>{if(ee.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let Fe=ee.type==="renderFrame"?void 0:ee,Ze={needsRenderFrame:!1},ut={},Mt={},Jt=ee.touches,$t=Jt?this._getMapTouches(Jt):void 0,yr=$t?c.touchPos(this._map.getCanvas(),$t):c.mousePos(this._map.getCanvas(),ee);for(let{handlerName:xe,handler:Ie,allowed:ze}of this._handlers){if(!Ie.isEnabled())continue;let Qe;this._blockedByActive(Mt,ze,xe)?Ie.reset():Ie[le||ee.type]&&(Qe=Ie[le||ee.type](ee,yr,$t),this.mergeHandlerResult(Ze,ut,Qe,xe,Fe),Qe&&Qe.needsRenderFrame&&this._triggerRenderFrame()),(Qe||Ie.isActive())&&(Mt[xe]=Ie)}let Cr={};for(let xe in this._previousActiveHandlers)Mt[xe]||(Cr[xe]=Fe);this._previousActiveHandlers=Mt,(Object.keys(Cr).length||ta(Ze))&&(this._changes.push([Ze,ut,Cr]),this._triggerRenderFrame()),(Object.keys(Mt).length||ta(Ze))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:ve}=Ze;ve&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ve(this._map))},this._map=w,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Pf(w),this._bearingSnap=B.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(B);let Q=this._el;this._listeners=[[Q,"touchstart",{passive:!0}],[Q,"touchmove",{passive:!1}],[Q,"touchend",void 0],[Q,"touchcancel",void 0],[Q,"mousedown",void 0],[Q,"mousemove",void 0],[Q,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[Q,"mouseover",void 0],[Q,"mouseout",void 0],[Q,"dblclick",void 0],[Q,"click",void 0],[Q,"keydown",{capture:!1}],[Q,"keyup",void 0],[Q,"wheel",{passive:!1}],[Q,"contextmenu",void 0],[window,"blur",void 0]];for(let[ee,le,Fe]of this._listeners)c.addEventListener(ee,le,ee===document?this.handleWindowEvent:this.handleEvent,Fe)}destroy(){for(let[w,B,Q]of this._listeners)c.removeEventListener(w,B,w===document?this.handleWindowEvent:this.handleEvent,Q)}_addDefaultHandlers(w){let B=this._map,Q=B.getCanvasContainer();this._add("mapEvent",new If(B,w));let ee=B.boxZoom=new ku(B,w);this._add("boxZoom",ee),w.interactive&&w.boxZoom&&ee.enable();let le=B.cooperativeGestures=new $i(B,w.cooperativeGestures);this._add("cooperativeGestures",le),w.cooperativeGestures&&le.enable();let Fe=new zc(B),Ze=new Wi(B);B.doubleClickZoom=new Mi(Ze,Fe),this._add("tapZoom",Fe),this._add("clickZoom",Ze),w.interactive&&w.doubleClickZoom&&B.doubleClickZoom.enable();let ut=new dn;this._add("tapDragZoom",ut);let Mt=B.touchPitch=new Bc(B);this._add("touchPitch",Mt),w.interactive&&w.touchPitch&&B.touchPitch.enable(w.touchPitch);let Jt=Wl(w),$t=ah(w);B.dragRotate=new On(w,Jt,$t),this._add("mouseRotate",Jt,["mousePitch"]),this._add("mousePitch",$t,["mouseRotate"]),w.interactive&&w.dragRotate&&B.dragRotate.enable();let yr=(({enable:Qe,clickTolerance:Xe})=>{let nt=new Xu({checkCorrectEvent:qt=>c.mouseButton(qt)===0&&!qt.ctrlKey});return new Wu({clickTolerance:Xe,move:(qt,Wt)=>({around:Wt,panDelta:Wt.sub(qt)}),activateOnStart:!0,moveStateManager:nt,enable:Qe,assignEvents:Zf})})(w),Cr=new Zu(w,B);B.dragPan=new wn(Q,yr,Cr),this._add("mousePan",yr),this._add("touchPan",Cr,["touchZoom","touchRotate"]),w.interactive&&w.dragPan&&B.dragPan.enable(w.dragPan);let ve=new ff,xe=new vu;B.touchZoomRotate=new Yi(Q,xe,ve,ut),this._add("touchRotate",ve,["touchPan","touchZoom"]),this._add("touchZoom",xe,["touchPan","touchRotate"]),w.interactive&&w.touchZoomRotate&&B.touchZoomRotate.enable(w.touchZoomRotate);let Ie=B.scrollZoom=new Kr(B,()=>this._triggerRenderFrame());this._add("scrollZoom",Ie,["mousePan"]),w.interactive&&w.scrollZoom&&B.scrollZoom.enable(w.scrollZoom);let ze=B.keyboard=new Zt(B);this._add("keyboard",ze),w.interactive&&w.keyboard&&B.keyboard.enable(),this._add("blockableMapEvent",new Cs(B))}_add(w,B,Q){this._handlers.push({handlerName:w,handler:B,allowed:Q}),this._handlersById[w]=B}stop(w){if(!this._updatingCamera){for(let{handler:B}of this._handlers)B.reset();this._inertia.clear(),this._fireEvents({},{},w),this._changes=[]}}isActive(){for(let{handler:w}of this._handlers)if(w.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!an(this._eventsInProgress)||this.isZooming()}_blockedByActive(w,B,Q){for(let ee in w)if(ee!==Q&&(!B||B.indexOf(ee)<0))return!0;return!1}_getMapTouches(w){let B=[];for(let Q of w)this._el.contains(Q.target)&&B.push(Q);return B}mergeHandlerResult(w,B,Q,ee,le){if(!Q)return;a.e(w,Q);let Fe={handlerName:ee,originalEvent:Q.originalEvent||le};Q.zoomDelta!==void 0&&(B.zoom=Fe),Q.panDelta!==void 0&&(B.drag=Fe),Q.pitchDelta!==void 0&&(B.pitch=Fe),Q.bearingDelta!==void 0&&(B.rotate=Fe)}_applyChanges(){let w={},B={},Q={};for(let[ee,le,Fe]of this._changes)ee.panDelta&&(w.panDelta=(w.panDelta||new a.P(0,0))._add(ee.panDelta)),ee.zoomDelta&&(w.zoomDelta=(w.zoomDelta||0)+ee.zoomDelta),ee.bearingDelta&&(w.bearingDelta=(w.bearingDelta||0)+ee.bearingDelta),ee.pitchDelta&&(w.pitchDelta=(w.pitchDelta||0)+ee.pitchDelta),ee.around!==void 0&&(w.around=ee.around),ee.pinchAround!==void 0&&(w.pinchAround=ee.pinchAround),ee.noInertia&&(w.noInertia=ee.noInertia),a.e(B,le),a.e(Q,Fe);this._updateMapTransform(w,B,Q),this._changes=[]}_updateMapTransform(w,B,Q){let ee=this._map,le=ee._getTransformForUpdate(),Fe=ee.terrain;if(!(ta(w)||Fe&&this._terrainMovement))return this._fireEvents(B,Q,!0);let{panDelta:Ze,zoomDelta:ut,bearingDelta:Mt,pitchDelta:Jt,around:$t,pinchAround:yr}=w;yr!==void 0&&($t=yr),ee._stop(!0),$t=$t||ee.transform.centerPoint;let Cr=le.pointLocation(Ze?$t.sub(Ze):$t);Mt&&(le.bearing+=Mt),Jt&&(le.pitch+=Jt),ut&&(le.zoom+=ut),Fe?this._terrainMovement||!B.drag&&!B.zoom?B.drag&&this._terrainMovement?le.center=le.pointLocation(le.centerPoint.sub(Ze)):le.setLocationAtPoint(Cr,$t):(this._terrainMovement=!0,this._map._elevationFreeze=!0,le.setLocationAtPoint(Cr,$t)):le.setLocationAtPoint(Cr,$t),ee._applyUpdatedTransform(le),this._map._update(),w.noInertia||this._inertia.record(w),this._fireEvents(B,Q,!0)}_fireEvents(w,B,Q){let ee=an(this._eventsInProgress),le=an(w),Fe={};for(let $t in w){let{originalEvent:yr}=w[$t];this._eventsInProgress[$t]||(Fe[`${$t}start`]=yr),this._eventsInProgress[$t]=w[$t]}!ee&&le&&this._fireEvent("movestart",le.originalEvent);for(let $t in Fe)this._fireEvent($t,Fe[$t]);le&&this._fireEvent("move",le.originalEvent);for(let $t in w){let{originalEvent:yr}=w[$t];this._fireEvent($t,yr)}let Ze={},ut;for(let $t in this._eventsInProgress){let{handlerName:yr,originalEvent:Cr}=this._eventsInProgress[$t];this._handlersById[yr].isActive()||(delete this._eventsInProgress[$t],ut=B[yr]||Cr,Ze[`${$t}end`]=ut)}for(let $t in Ze)this._fireEvent($t,Ze[$t]);let Mt=an(this._eventsInProgress),Jt=(ee||le)&&!Mt;if(Jt&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let $t=this._map._getTransformForUpdate();$t.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform($t)}if(Q&&Jt){this._updatingCamera=!0;let $t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),yr=Cr=>Cr!==0&&-this._bearingSnap<Cr&&Cr<this._bearingSnap;!$t||!$t.essential&&u.prefersReducedMotion?(this._map.fire(new a.k("moveend",{originalEvent:ut})),yr(this._map.getBearing())&&this._map.resetNorth()):(yr($t.bearing||this._map.getBearing())&&($t.bearing=0),$t.freezeElevation=!0,this._map.easeTo($t,{originalEvent:ut})),this._updatingCamera=!1}}_fireEvent(w,B){this._map.fire(new a.k(w,B?{originalEvent:B}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(w=>{delete this._frameId,this.handleEvent(new Fi("renderFrame",{timeStamp:w})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Ra extends a.E{constructor(w,B){super(),this._renderFrameCallback=()=>{let Q=Math.min((u.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Q)),Q<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=w,this._bearingSnap=B.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new a.N(this.transform.center.lng,this.transform.center.lat)}setCenter(w,B){return this.jumpTo({center:w},B)}panBy(w,B,Q){return w=a.P.convert(w).mult(-1),this.panTo(this.transform.center,a.e({offset:w},B),Q)}panTo(w,B,Q){return this.easeTo(a.e({center:w},B),Q)}getZoom(){return this.transform.zoom}setZoom(w,B){return this.jumpTo({zoom:w},B),this}zoomTo(w,B,Q){return this.easeTo(a.e({zoom:w},B),Q)}zoomIn(w,B){return this.zoomTo(this.getZoom()+1,w,B),this}zoomOut(w,B){return this.zoomTo(this.getZoom()-1,w,B),this}getBearing(){return this.transform.bearing}setBearing(w,B){return this.jumpTo({bearing:w},B),this}getPadding(){return this.transform.padding}setPadding(w,B){return this.jumpTo({padding:w},B),this}rotateTo(w,B,Q){return this.easeTo(a.e({bearing:w},B),Q)}resetNorth(w,B){return this.rotateTo(0,a.e({duration:1e3},w),B),this}resetNorthPitch(w,B){return this.easeTo(a.e({bearing:0,pitch:0,duration:1e3},w),B),this}snapToNorth(w,B){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(w,B):this}getPitch(){return this.transform.pitch}setPitch(w,B){return this.jumpTo({pitch:w},B),this}cameraForBounds(w,B){w=ce.convert(w).adjustAntiMeridian();let Q=B&&B.bearing||0;return this._cameraForBoxAndBearing(w.getNorthWest(),w.getSouthEast(),Q,B)}_cameraForBoxAndBearing(w,B,Q,ee){let le={top:0,bottom:0,right:0,left:0};if(typeof(ee=a.e({padding:le,offset:[0,0],maxZoom:this.transform.maxZoom},ee)).padding=="number"){let Hr=ee.padding;ee.padding={top:Hr,bottom:Hr,right:Hr,left:Hr}}ee.padding=a.e(le,ee.padding);let Fe=this.transform,Ze=Fe.padding,ut=new ce(w,B),Mt=Fe.project(ut.getNorthWest()),Jt=Fe.project(ut.getNorthEast()),$t=Fe.project(ut.getSouthEast()),yr=Fe.project(ut.getSouthWest()),Cr=a.ba(-Q),ve=Mt.rotate(Cr),xe=Jt.rotate(Cr),Ie=$t.rotate(Cr),ze=yr.rotate(Cr),Qe=new a.P(Math.max(ve.x,xe.x,ze.x,Ie.x),Math.max(ve.y,xe.y,ze.y,Ie.y)),Xe=new a.P(Math.min(ve.x,xe.x,ze.x,Ie.x),Math.min(ve.y,xe.y,ze.y,Ie.y)),nt=Qe.sub(Xe),qt=(Fe.width-(Ze.left+Ze.right+ee.padding.left+ee.padding.right))/nt.x,Wt=(Fe.height-(Ze.top+Ze.bottom+ee.padding.top+ee.padding.bottom))/nt.y;if(Wt<0||qt<0)return void a.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let nr=Math.min(Fe.scaleZoom(Fe.scale*Math.min(qt,Wt)),ee.maxZoom),fr=a.P.convert(ee.offset),br=new a.P((ee.padding.left-ee.padding.right)/2,(ee.padding.top-ee.padding.bottom)/2).rotate(a.ba(Q)),Fr=fr.add(br).mult(Fe.scale/Fe.zoomScale(nr));return{center:Fe.unproject(Mt.add($t).div(2).sub(Fr)),zoom:nr,bearing:Q}}fitBounds(w,B,Q){return this._fitInternal(this.cameraForBounds(w,B),B,Q)}fitScreenCoordinates(w,B,Q,ee,le){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(a.P.convert(w)),this.transform.pointLocation(a.P.convert(B)),Q,ee),ee,le)}_fitInternal(w,B,Q){return w?(delete(B=a.e(w,B)).padding,B.linear?this.easeTo(B,Q):this.flyTo(B,Q)):this}jumpTo(w,B){this.stop();let Q=this._getTransformForUpdate(),ee=!1,le=!1,Fe=!1;return"zoom"in w&&Q.zoom!==+w.zoom&&(ee=!0,Q.zoom=+w.zoom),w.center!==void 0&&(Q.center=a.N.convert(w.center)),"bearing"in w&&Q.bearing!==+w.bearing&&(le=!0,Q.bearing=+w.bearing),"pitch"in w&&Q.pitch!==+w.pitch&&(Fe=!0,Q.pitch=+w.pitch),w.padding==null||Q.isPaddingEqual(w.padding)||(Q.padding=w.padding),this._applyUpdatedTransform(Q),this.fire(new a.k("movestart",B)).fire(new a.k("move",B)),ee&&this.fire(new a.k("zoomstart",B)).fire(new a.k("zoom",B)).fire(new a.k("zoomend",B)),le&&this.fire(new a.k("rotatestart",B)).fire(new a.k("rotate",B)).fire(new a.k("rotateend",B)),Fe&&this.fire(new a.k("pitchstart",B)).fire(new a.k("pitch",B)).fire(new a.k("pitchend",B)),this.fire(new a.k("moveend",B))}calculateCameraOptionsFromTo(w,B,Q,ee=0){let le=a.Z.fromLngLat(w,B),Fe=a.Z.fromLngLat(Q,ee),Ze=Fe.x-le.x,ut=Fe.y-le.y,Mt=Fe.z-le.z,Jt=Math.hypot(Ze,ut,Mt);if(Jt===0)throw new Error("Can't calculate camera options with same From and To");let $t=Math.hypot(Ze,ut),yr=this.transform.scaleZoom(this.transform.cameraToCenterDistance/Jt/this.transform.tileSize),Cr=180*Math.atan2(Ze,-ut)/Math.PI,ve=180*Math.acos($t/Jt)/Math.PI;return ve=Mt<0?90-ve:90+ve,{center:Fe.toLngLat(),zoom:yr,pitch:ve,bearing:Cr}}easeTo(w,B){var Q;this._stop(!1,w.easeId),((w=a.e({offset:[0,0],duration:500,easing:a.b9},w)).animate===!1||!w.essential&&u.prefersReducedMotion)&&(w.duration=0);let ee=this._getTransformForUpdate(),le=ee.zoom,Fe=ee.bearing,Ze=ee.pitch,ut=ee.padding,Mt="bearing"in w?this._normalizeBearing(w.bearing,Fe):Fe,Jt="pitch"in w?+w.pitch:Ze,$t="padding"in w?w.padding:ee.padding,yr=a.P.convert(w.offset),Cr=ee.centerPoint.add(yr),ve=ee.pointLocation(Cr),{center:xe,zoom:Ie}=ee.getConstrained(a.N.convert(w.center||ve),(Q=w.zoom)!==null&&Q!==void 0?Q:le);this._normalizeCenter(xe,ee);let ze=ee.project(ve),Qe=ee.project(xe).sub(ze),Xe=ee.zoomScale(Ie-le),nt,qt;w.around&&(nt=a.N.convert(w.around),qt=ee.locationPoint(nt));let Wt={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||Ie!==le,this._rotating=this._rotating||Fe!==Mt,this._pitching=this._pitching||Jt!==Ze,this._padding=!ee.isPaddingEqual($t),this._easeId=w.easeId,this._prepareEase(B,w.noMoveStart,Wt),this.terrain&&this._prepareElevation(xe),this._ease(nr=>{if(this._zooming&&(ee.zoom=a.y.number(le,Ie,nr)),this._rotating&&(ee.bearing=a.y.number(Fe,Mt,nr)),this._pitching&&(ee.pitch=a.y.number(Ze,Jt,nr)),this._padding&&(ee.interpolatePadding(ut,$t,nr),Cr=ee.centerPoint.add(yr)),this.terrain&&!w.freezeElevation&&this._updateElevation(nr),nt)ee.setLocationAtPoint(nt,qt);else{let fr=ee.zoomScale(ee.zoom-le),br=Ie>le?Math.min(2,Xe):Math.max(.5,Xe),Fr=Math.pow(br,1-nr),Hr=ee.unproject(ze.add(Qe.mult(nr*Fr)).mult(fr));ee.setLocationAtPoint(ee.renderWorldCopies?Hr.wrap():Hr,Cr)}this._applyUpdatedTransform(ee),this._fireMoveEvents(B)},nr=>{this.terrain&&w.freezeElevation&&this._finalizeElevation(),this._afterEase(B,nr)},w),this}_prepareEase(w,B,Q={}){this._moving=!0,B||Q.moving||this.fire(new a.k("movestart",w)),this._zooming&&!Q.zooming&&this.fire(new a.k("zoomstart",w)),this._rotating&&!Q.rotating&&this.fire(new a.k("rotatestart",w)),this._pitching&&!Q.pitching&&this.fire(new a.k("pitchstart",w))}_prepareElevation(w){this._elevationCenter=w,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(w,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(w){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let B=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(w<1&&B!==this._elevationTarget){let Q=this._elevationTarget-this._elevationStart;this._elevationStart+=w*(Q-(B-(Q*w+this._elevationStart))/(1-w)),this._elevationTarget=B}this.transform.elevation=a.y.number(this._elevationStart,this._elevationTarget,w)}_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(w){let B=w.getCameraPosition(),Q=this.terrain.getElevationForLngLatZoom(B.lngLat,w.zoom);if(B.altitude<Q){let ee=this.calculateCameraOptionsFromTo(B.lngLat,Q,w.center,w.elevation);return{pitch:ee.pitch,zoom:ee.zoom}}return{}}_applyUpdatedTransform(w){let B=[];if(this.terrain&&B.push(ee=>this._elevateCameraIfInsideTerrain(ee)),this.transformCameraUpdate&&B.push(ee=>this.transformCameraUpdate(ee)),!B.length)return;let Q=w.clone();for(let ee of B){let le=Q.clone(),{center:Fe,zoom:Ze,pitch:ut,bearing:Mt,elevation:Jt}=ee(le);Fe&&(le.center=Fe),Ze!==void 0&&(le.zoom=Ze),ut!==void 0&&(le.pitch=ut),Mt!==void 0&&(le.bearing=Mt),Jt!==void 0&&(le.elevation=Jt),Q.apply(le)}this.transform.apply(Q)}_fireMoveEvents(w){this.fire(new a.k("move",w)),this._zooming&&this.fire(new a.k("zoom",w)),this._rotating&&this.fire(new a.k("rotate",w)),this._pitching&&this.fire(new a.k("pitch",w))}_afterEase(w,B){if(this._easeId&&B&&this._easeId===B)return;delete this._easeId;let Q=this._zooming,ee=this._rotating,le=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Q&&this.fire(new a.k("zoomend",w)),ee&&this.fire(new a.k("rotateend",w)),le&&this.fire(new a.k("pitchend",w)),this.fire(new a.k("moveend",w))}flyTo(w,B){var Q;if(!w.essential&&u.prefersReducedMotion){let Ln=a.M(w,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Ln,B)}this.stop(),w=a.e({offset:[0,0],speed:1.2,curve:1.42,easing:a.b9},w);let ee=this._getTransformForUpdate(),le=ee.zoom,Fe=ee.bearing,Ze=ee.pitch,ut=ee.padding,Mt="bearing"in w?this._normalizeBearing(w.bearing,Fe):Fe,Jt="pitch"in w?+w.pitch:Ze,$t="padding"in w?w.padding:ee.padding,yr=a.P.convert(w.offset),Cr=ee.centerPoint.add(yr),ve=ee.pointLocation(Cr),{center:xe,zoom:Ie}=ee.getConstrained(a.N.convert(w.center||ve),(Q=w.zoom)!==null&&Q!==void 0?Q:le);this._normalizeCenter(xe,ee);let ze=ee.zoomScale(Ie-le),Qe=ee.project(ve),Xe=ee.project(xe).sub(Qe),nt=w.curve,qt=Math.max(ee.width,ee.height),Wt=qt/ze,nr=Xe.mag();if("minZoom"in w){let Ln=a.ac(Math.min(w.minZoom,le,Ie),ee.minZoom,ee.maxZoom),Yn=qt/ee.zoomScale(Ln-le);nt=Math.sqrt(Yn/nr*2)}let fr=nt*nt;function br(Ln){let Yn=(Wt*Wt-qt*qt+(Ln?-1:1)*fr*fr*nr*nr)/(2*(Ln?Wt:qt)*fr*nr);return Math.log(Math.sqrt(Yn*Yn+1)-Yn)}function Fr(Ln){return(Math.exp(Ln)-Math.exp(-Ln))/2}function Hr(Ln){return(Math.exp(Ln)+Math.exp(-Ln))/2}let ri=br(!1),Ci=function(Ln){return Hr(ri)/Hr(ri+nt*Ln)},cn=function(Ln){return qt*((Hr(ri)*(Fr(Yn=ri+nt*Ln)/Hr(Yn))-Fr(ri))/fr)/nr;var Yn},sn=(br(!0)-ri)/nt;if(Math.abs(nr)<1e-6||!isFinite(sn)){if(Math.abs(qt-Wt)<1e-6)return this.easeTo(w,B);let Ln=Wt<qt?-1:1;sn=Math.abs(Math.log(Wt/qt))/nt,cn=()=>0,Ci=Yn=>Math.exp(Ln*nt*Yn)}return w.duration="duration"in w?+w.duration:1e3*sn/("screenSpeed"in w?+w.screenSpeed/nt:+w.speed),w.maxDuration&&w.duration>w.maxDuration&&(w.duration=0),this._zooming=!0,this._rotating=Fe!==Mt,this._pitching=Jt!==Ze,this._padding=!ee.isPaddingEqual($t),this._prepareEase(B,!1),this.terrain&&this._prepareElevation(xe),this._ease(Ln=>{let Yn=Ln*sn,Aa=1/Ci(Yn);ee.zoom=Ln===1?Ie:le+ee.scaleZoom(Aa),this._rotating&&(ee.bearing=a.y.number(Fe,Mt,Ln)),this._pitching&&(ee.pitch=a.y.number(Ze,Jt,Ln)),this._padding&&(ee.interpolatePadding(ut,$t,Ln),Cr=ee.centerPoint.add(yr)),this.terrain&&!w.freezeElevation&&this._updateElevation(Ln);let fa=Ln===1?xe:ee.unproject(Qe.add(Xe.mult(cn(Yn))).mult(Aa));ee.setLocationAtPoint(ee.renderWorldCopies?fa.wrap():fa,Cr),this._applyUpdatedTransform(ee),this._fireMoveEvents(B)},()=>{this.terrain&&w.freezeElevation&&this._finalizeElevation(),this._afterEase(B)},w),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(w,B){var Q;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let ee=this._onEaseEnd;delete this._onEaseEnd,ee.call(this,B)}return w||(Q=this.handlers)===null||Q===void 0||Q.stop(!1),this}_ease(w,B,Q){Q.animate===!1||Q.duration===0?(w(1),B()):(this._easeStart=u.now(),this._easeOptions=Q,this._onEaseFrame=w,this._onEaseEnd=B,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(w,B){w=a.b3(w,-180,180);let Q=Math.abs(w-B);return Math.abs(w-360-B)<Q&&(w-=360),Math.abs(w+360-B)<Q&&(w+=360),w}_normalizeCenter(w,B){if(!B.renderWorldCopies||B.lngRange)return;let Q=w.lng-B.center.lng;w.lng+=Q>180?-360:Q<-180?360:0}queryTerrainElevation(w){return this.terrain?this.terrain.getElevationForLngLatZoom(a.N.convert(w),this.transform.tileZoom)-this.transform.elevation:null}}let La={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Ua{constructor(w=La){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=B=>{!B||B.sourceDataType!=="metadata"&&B.sourceDataType!=="visibility"&&B.dataType!=="style"&&B.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=w}getDefaultPosition(){return"bottom-right"}onAdd(w){return this._map=w,this._compact=this.options.compact,this._container=c.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=c.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=c.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(){c.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(w,B){let Q=this._map._getUIString(`AttributionControl.${B}`);w.title=Q,w.setAttribute("aria-label",Q)}_updateAttributions(){if(!this._map.style)return;let w=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?w=w.concat(this.options.customAttribution.map(ee=>typeof ee!="string"?"":ee)):typeof this.options.customAttribution=="string"&&w.push(this.options.customAttribution)),this._map.style.stylesheet){let ee=this._map.style.stylesheet;this.styleOwner=ee.owner,this.styleId=ee.id}let B=this._map.style.sourceCaches;for(let ee in B){let le=B[ee];if(le.used||le.usedForTerrain){let Fe=le.getSource();Fe.attribution&&w.indexOf(Fe.attribution)<0&&w.push(Fe.attribution)}}w=w.filter(ee=>String(ee).trim()),w.sort((ee,le)=>ee.length-le.length),w=w.filter((ee,le)=>{for(let Fe=le+1;Fe<w.length;Fe++)if(w[Fe].indexOf(ee)>=0)return!1;return!0});let Q=w.join(" | ");Q!==this._attribHTML&&(this._attribHTML=Q,w.length?(this._innerContainer.innerHTML=Q,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Zn{constructor(w={}){this._updateCompact=()=>{let B=this._container.children;if(B.length){let Q=B[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&Q.classList.add("maplibregl-compact"):Q.classList.remove("maplibregl-compact")}},this.options=w}getDefaultPosition(){return"bottom-left"}onAdd(w){this._map=w,this._compact=this.options&&this.options.compact,this._container=c.create("div","maplibregl-ctrl");let B=c.create("a","maplibregl-ctrl-logo");return B.target="_blank",B.rel="noopener nofollow",B.href="https://maplibre.org/",B.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),B.setAttribute("rel","noopener nofollow"),this._container.appendChild(B),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){c.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Dn{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(w){let B=++this._id;return this._queue.push({callback:w,id:B,cancelled:!1}),B}remove(w){let B=this._currentlyRunning,Q=B?this._queue.concat(B):this._queue;for(let ee of Q)if(ee.id===w)return void(ee.cancelled=!0)}run(w=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let B=this._currentlyRunning=this._queue;this._queue=[];for(let Q of B)if(!Q.cancelled&&(Q.callback(w),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ka=a.Y([{name:"a_pos3d",type:"Int16",components:3}]);class bo extends a.E{constructor(w){super(),this.sourceCache=w,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,w.usedForTerrain=!0,w.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(w,B){this.sourceCache.update(w,B),this._renderableTilesKeys=[];let Q={};for(let ee of w.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:B}))Q[ee.key]=!0,this._renderableTilesKeys.push(ee.key),this._tiles[ee.key]||(ee.posMatrix=new Float64Array(16),a.aP(ee.posMatrix,0,a.X,0,a.X,0,1),this._tiles[ee.key]=new Tt(ee,this.tileSize));for(let ee in this._tiles)Q[ee]||delete this._tiles[ee]}freeRtt(w){for(let B in this._tiles){let Q=this._tiles[B];(!w||Q.tileID.equals(w)||Q.tileID.isChildOf(w)||w.isChildOf(Q.tileID))&&(Q.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(w=>this.getTileByID(w))}getTileByID(w){return this._tiles[w]}getTerrainCoords(w){let B={};for(let Q of this._renderableTilesKeys){let ee=this._tiles[Q].tileID;if(ee.canonical.equals(w.canonical)){let le=w.clone();le.posMatrix=new Float64Array(16),a.aP(le.posMatrix,0,a.X,0,a.X,0,1),B[Q]=le}else if(ee.canonical.isChildOf(w.canonical)){let le=w.clone();le.posMatrix=new Float64Array(16);let Fe=ee.canonical.z-w.canonical.z,Ze=ee.canonical.x-(ee.canonical.x>>Fe<<Fe),ut=ee.canonical.y-(ee.canonical.y>>Fe<<Fe),Mt=a.X>>Fe;a.aP(le.posMatrix,0,Mt,0,Mt,0,1),a.J(le.posMatrix,le.posMatrix,[-Ze*Mt,-ut*Mt,0]),B[Q]=le}else if(w.canonical.isChildOf(ee.canonical)){let le=w.clone();le.posMatrix=new Float64Array(16);let Fe=w.canonical.z-ee.canonical.z,Ze=w.canonical.x-(w.canonical.x>>Fe<<Fe),ut=w.canonical.y-(w.canonical.y>>Fe<<Fe),Mt=a.X>>Fe;a.aP(le.posMatrix,0,a.X,0,a.X,0,1),a.J(le.posMatrix,le.posMatrix,[Ze*Mt,ut*Mt,0]),a.K(le.posMatrix,le.posMatrix,[1/2**Fe,1/2**Fe,0]),B[Q]=le}}return B}getSourceTile(w,B){let Q=this.sourceCache._source,ee=w.overscaledZ-this.deltaZoom;if(ee>Q.maxzoom&&(ee=Q.maxzoom),ee<Q.minzoom)return null;this._sourceTileCache[w.key]||(this._sourceTileCache[w.key]=w.scaledTo(ee).key);let le=this.sourceCache.getTileByID(this._sourceTileCache[w.key]);if((!le||!le.dem)&&B)for(;ee>=Q.minzoom&&(!le||!le.dem);)le=this.sourceCache.getTileByID(w.scaledTo(ee--).key);return le}tilesAfterTime(w=Date.now()){return Object.values(this._tiles).filter(B=>B.timeAdded>=w)}}class Zo{constructor(w,B,Q){this.painter=w,this.sourceCache=new bo(B),this.options=Q,this.exaggeration=typeof Q.exaggeration=="number"?Q.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(w,B,Q,ee=a.X){var le;if(!(B>=0&&B<ee&&Q>=0&&Q<ee))return 0;let Fe=this.getTerrainData(w),Ze=(le=Fe.tile)===null||le===void 0?void 0:le.dem;if(!Ze)return 0;let ut=function(ve,xe,Ie){var ze=xe[0],Qe=xe[1];return ve[0]=Ie[0]*ze+Ie[4]*Qe+Ie[12],ve[1]=Ie[1]*ze+Ie[5]*Qe+Ie[13],ve}([],[B/ee*a.X,Q/ee*a.X],Fe.u_terrain_matrix),Mt=[ut[0]*Ze.dim,ut[1]*Ze.dim],Jt=Math.floor(Mt[0]),$t=Math.floor(Mt[1]),yr=Mt[0]-Jt,Cr=Mt[1]-$t;return Ze.get(Jt,$t)*(1-yr)*(1-Cr)+Ze.get(Jt+1,$t)*yr*(1-Cr)+Ze.get(Jt,$t+1)*(1-yr)*Cr+Ze.get(Jt+1,$t+1)*yr*Cr}getElevationForLngLatZoom(w,B){if(!a.bb(B,w.wrap()))return 0;let{tileID:Q,mercatorX:ee,mercatorY:le}=this._getOverscaledTileIDFromLngLatZoom(w,B);return this.getElevation(Q,ee%a.X,le%a.X,a.X)}getElevation(w,B,Q,ee=a.X){return this.getDEMElevation(w,B,Q,ee)*this.exaggeration}getTerrainData(w){if(!this._emptyDemTexture){let ee=this.painter.context,le=new a.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new g(ee,le,ee.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new g(ee,new a.R({width:1,height:1}),ee.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(ee.gl.NEAREST,ee.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=a.an([])}let B=this.sourceCache.getSourceTile(w,!0);if(B&&B.dem&&(!B.demTexture||B.needsTerrainPrepare)){let ee=this.painter.context;B.demTexture=this.painter.getTileTexture(B.dem.stride),B.demTexture?B.demTexture.update(B.dem.getPixels(),{premultiply:!1}):B.demTexture=new g(ee,B.dem.getPixels(),ee.gl.RGBA,{premultiply:!1}),B.demTexture.bind(ee.gl.NEAREST,ee.gl.CLAMP_TO_EDGE),B.needsTerrainPrepare=!1}let Q=B&&B+B.tileID.key+w.key;if(Q&&!this._demMatrixCache[Q]){let ee=this.sourceCache.sourceCache._source.maxzoom,le=w.canonical.z-B.tileID.canonical.z;w.overscaledZ>w.canonical.z&&(w.canonical.z>=ee?le=w.canonical.z-ee:a.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let Fe=w.canonical.x-(w.canonical.x>>le<<le),Ze=w.canonical.y-(w.canonical.y>>le<<le),ut=a.bc(new Float64Array(16),[1/(a.X<<le),1/(a.X<<le),0]);a.J(ut,ut,[Fe*a.X,Ze*a.X,0]),this._demMatrixCache[w.key]={matrix:ut,coord:w}}return{u_depth:2,u_terrain:3,u_terrain_dim:B&&B.dem&&B.dem.dim||1,u_terrain_matrix:Q?this._demMatrixCache[w.key].matrix:this._emptyDemMatrix,u_terrain_unpack:B&&B.dem&&B.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(B&&B.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:B}}getFramebuffer(w){let B=this.painter,Q=B.width/devicePixelRatio,ee=B.height/devicePixelRatio;return!this._fbo||this._fbo.width===Q&&this._fbo.height===ee||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new g(B.context,{width:Q,height:ee,data:null},B.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(B.context.gl.NEAREST,B.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new g(B.context,{width:Q,height:ee,data:null},B.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(B.context.gl.NEAREST,B.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=B.context.createFramebuffer(Q,ee,!0,!1),this._fbo.depthAttachment.set(B.context.createRenderbuffer(B.context.gl.DEPTH_COMPONENT16,Q,ee))),this._fbo.colorAttachment.set(w==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let w=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let B=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let le=0,Fe=0;le<this._coordsTextureSize;le++)for(let Ze=0;Ze<this._coordsTextureSize;Ze++,Fe+=4)B[Fe+0]=255&Ze,B[Fe+1]=255&le,B[Fe+2]=Ze>>8<<4|le>>8,B[Fe+3]=0;let Q=new a.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(B.buffer)),ee=new g(w,Q,w.gl.RGBA,{premultiply:!1});return ee.bind(w.gl.NEAREST,w.gl.CLAMP_TO_EDGE),this._coordsTexture=ee,ee}pointCoordinate(w){this.painter.maybeDrawDepthAndCoords(!0);let B=new Uint8Array(4),Q=this.painter.context,ee=Q.gl,le=Math.round(w.x*this.painter.pixelRatio/devicePixelRatio),Fe=Math.round(w.y*this.painter.pixelRatio/devicePixelRatio),Ze=Math.round(this.painter.height/devicePixelRatio);Q.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),ee.readPixels(le,Ze-Fe-1,1,1,ee.RGBA,ee.UNSIGNED_BYTE,B),Q.bindFramebuffer.set(null);let ut=B[0]+(B[2]>>4<<8),Mt=B[1]+((15&B[2])<<8),Jt=this.coordsIndex[255-B[3]],$t=Jt&&this.sourceCache.getTileByID(Jt);if(!$t)return null;let yr=this._coordsTextureSize,Cr=(1<<$t.tileID.canonical.z)*yr;return new a.Z(($t.tileID.canonical.x*yr+ut)/Cr+$t.tileID.wrap,($t.tileID.canonical.y*yr+Mt)/Cr,this.getElevation($t.tileID,ut,Mt,yr))}depthAtPoint(w){let B=new Uint8Array(4),Q=this.painter.context,ee=Q.gl;return Q.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),ee.readPixels(w.x,this.painter.height/devicePixelRatio-w.y-1,1,1,ee.RGBA,ee.UNSIGNED_BYTE,B),Q.bindFramebuffer.set(null),(B[0]/16777216+B[1]/65536+B[2]/256+B[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;let w=this.painter.context,B=new a.bd,Q=new a.aY,ee=this.meshSize,le=a.X/ee,Fe=ee*ee;for(let $t=0;$t<=ee;$t++)for(let yr=0;yr<=ee;yr++)B.emplaceBack(yr*le,$t*le,0);for(let $t=0;$t<Fe;$t+=ee+1)for(let yr=0;yr<ee;yr++)Q.emplaceBack(yr+$t,ee+yr+$t+1,ee+yr+$t+2),Q.emplaceBack(yr+$t,ee+yr+$t+2,yr+$t+1);let Ze=B.length,ut=Ze+2*(ee+1);for(let $t of[0,1])for(let yr=0;yr<=ee;yr++)for(let Cr of[0,1])B.emplaceBack(yr*le,$t*a.X,Cr);for(let $t=0;$t<2*ee;$t+=2)Q.emplaceBack(ut+$t,ut+$t+1,ut+$t+3),Q.emplaceBack(ut+$t,ut+$t+3,ut+$t+2),Q.emplaceBack(Ze+$t,Ze+$t+3,Ze+$t+1),Q.emplaceBack(Ze+$t,Ze+$t+2,Ze+$t+3);let Mt=B.length,Jt=Mt+2*(ee+1);for(let $t of[0,1])for(let yr=0;yr<=ee;yr++)for(let Cr of[0,1])B.emplaceBack($t*a.X,yr*le,Cr);for(let $t=0;$t<2*ee;$t+=2)Q.emplaceBack(Mt+$t,Mt+$t+1,Mt+$t+3),Q.emplaceBack(Mt+$t,Mt+$t+3,Mt+$t+2),Q.emplaceBack(Jt+$t,Jt+$t+3,Jt+$t+1),Q.emplaceBack(Jt+$t,Jt+$t+2,Jt+$t+3);return this._mesh=new Eu(w.createVertexBuffer(B,Ka.members),w.createIndexBuffer(Q),a.a0.simpleSegment(0,0,B.length,Q.length)),this._mesh}getMeshFrameDelta(w){return 2*Math.PI*a.be/Math.pow(2,w)/5}getMinTileElevationForLngLatZoom(w,B){var Q;let{tileID:ee}=this._getOverscaledTileIDFromLngLatZoom(w,B);return(Q=this.getMinMaxElevation(ee).minElevation)!==null&&Q!==void 0?Q:0}getMinMaxElevation(w){let B=this.getTerrainData(w).tile,Q={minElevation:null,maxElevation:null};return B&&B.dem&&(Q.minElevation=B.dem.min*this.exaggeration,Q.maxElevation=B.dem.max*this.exaggeration),Q}_getOverscaledTileIDFromLngLatZoom(w,B){let Q=a.Z.fromLngLat(w.wrap()),ee=(1<<B)*a.X,le=Q.x*ee,Fe=Q.y*ee,Ze=Math.floor(le/a.X),ut=Math.floor(Fe/a.X);return{tileID:new a.S(B,0,B,Ze,ut),mercatorX:le,mercatorY:Fe}}}class Ss{constructor(w,B,Q){this._context=w,this._size=B,this._tileSize=Q,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let w of this._objects)w.texture.destroy(),w.fbo.destroy()}_createObject(w){let B=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),Q=new g(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return Q.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),B.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),B.colorAttachment.set(Q.texture),{id:w,fbo:B,texture:Q,stamp:-1,inUse:!1}}getObjectForId(w){return this._objects[w]}useObject(w){w.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(B=>w.id!==B),this._recentlyUsed.push(w.id)}stampObject(w){w.stamp=++this._stamp}getOrCreateFreeObject(){for(let B of this._recentlyUsed)if(!this._objects[B].inUse)return this._objects[B];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let w=this._createObject(this._objects.length);return this._objects.push(w),w}freeObject(w){w.inUse=!1}freeAllObjects(){for(let w of this._objects)this.freeObject(w)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(w=>!w.inUse)===!1}}let as={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class ws{constructor(w,B){this.painter=w,this.terrain=B,this.pool=new Ss(w.context,30,B.sourceCache.tileSize*B.qualityFactor)}destruct(){this.pool.destruct()}getTexture(w){return this.pool.getObjectForId(w.rtt[this._stacks.length-1].id).texture}prepareForRender(w,B){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=w._order.filter(Q=>!w._layers[Q].isHidden(B)),this._coordsDescendingInv={};for(let Q in w.sourceCaches){this._coordsDescendingInv[Q]={};let ee=w.sourceCaches[Q].getVisibleCoordinates();for(let le of ee){let Fe=this.terrain.sourceCache.getTerrainCoords(le);for(let Ze in Fe)this._coordsDescendingInv[Q][Ze]||(this._coordsDescendingInv[Q][Ze]=[]),this._coordsDescendingInv[Q][Ze].push(Fe[Ze])}}this._coordsDescendingInvStr={};for(let Q of w._order){let ee=w._layers[Q],le=ee.source;if(as[ee.type]&&!this._coordsDescendingInvStr[le]){this._coordsDescendingInvStr[le]={};for(let Fe in this._coordsDescendingInv[le])this._coordsDescendingInvStr[le][Fe]=this._coordsDescendingInv[le][Fe].map(Ze=>Ze.key).sort().join()}}for(let Q of this._renderableTiles)for(let ee in this._coordsDescendingInvStr){let le=this._coordsDescendingInvStr[ee][Q.tileID.key];le&&le!==Q.rttCoords[ee]&&(Q.rtt=[])}}renderLayer(w){if(w.isHidden(this.painter.transform.zoom))return!1;let B=w.type,Q=this.painter,ee=this._renderableLayerIds[this._renderableLayerIds.length-1]===w.id;if(as[B]&&(this._prevType&&as[this._prevType]||this._stacks.push([]),this._prevType=B,this._stacks[this._stacks.length-1].push(w.id),!ee))return!0;if(as[this._prevType]||as[B]&&ee){this._prevType=B;let le=this._stacks.length-1,Fe=this._stacks[le]||[];for(let Ze of this._renderableTiles){if(this.pool.isFull()&&(js(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(Ze),Ze.rtt[le]){let Mt=this.pool.getObjectForId(Ze.rtt[le].id);if(Mt.stamp===Ze.rtt[le].stamp){this.pool.useObject(Mt);continue}}let ut=this.pool.getOrCreateFreeObject();this.pool.useObject(ut),this.pool.stampObject(ut),Ze.rtt[le]={id:ut.id,stamp:ut.stamp},Q.context.bindFramebuffer.set(ut.fbo.framebuffer),Q.context.clear({color:a.aM.transparent,stencil:0}),Q.currentStencilSource=void 0;for(let Mt=0;Mt<Fe.length;Mt++){let Jt=Q.style._layers[Fe[Mt]],$t=Jt.source?this._coordsDescendingInv[Jt.source][Ze.tileID.key]:[Ze.tileID];Q.context.viewport.set([0,0,ut.fbo.width,ut.fbo.height]),Q._renderTileClippingMasks(Jt,$t),Q.renderLayer(Q,Q.style.sourceCaches[Jt.source],Jt,$t),Jt.source&&(Ze.rttCoords[Jt.source]=this._coordsDescendingInvStr[Jt.source][Ze.tileID.key])}}return js(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),as[B]}return!1}}let Ho={"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 \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},ml=o,Ws={hash:!1,interactive:!0,bearingSnap:7,attributionControl:La,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},Ls=ue=>{ue.touchstart=ue.dragStart,ue.touchmoveWindow=ue.dragMove,ue.touchend=ue.dragEnd},va={showCompass:!0,showZoom:!0,visualizePitch:!1};class no{constructor(w,B,Q=!1){this.mousedown=Fe=>{this.startMouse(a.e({},Fe,{ctrlKey:!0,preventDefault:()=>Fe.preventDefault()}),c.mousePos(this.element,Fe)),c.addEventListener(window,"mousemove",this.mousemove),c.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=Fe=>{this.moveMouse(Fe,c.mousePos(this.element,Fe))},this.mouseup=Fe=>{this.mouseRotate.dragEnd(Fe),this.mousePitch&&this.mousePitch.dragEnd(Fe),this.offTemp()},this.touchstart=Fe=>{Fe.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=c.touchPos(this.element,Fe.targetTouches)[0],this.startTouch(Fe,this._startPos),c.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),c.addEventListener(window,"touchend",this.touchend))},this.touchmove=Fe=>{Fe.targetTouches.length!==1?this.reset():(this._lastPos=c.touchPos(this.element,Fe.targetTouches)[0],this.moveTouch(Fe,this._lastPos))},this.touchend=Fe=>{Fe.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;let ee=w.dragRotate._mouseRotate.getClickTolerance(),le=w.dragRotate._mousePitch.getClickTolerance();this.element=B,this.mouseRotate=Wl({clickTolerance:ee,enable:!0}),this.touchRotate=(({enable:Fe,clickTolerance:Ze,bearingDegreesPerPixelMoved:ut=.8})=>{let Mt=new cf;return new Wu({clickTolerance:Ze,move:(Jt,$t)=>({bearingDelta:($t.x-Jt.x)*ut}),moveStateManager:Mt,enable:Fe,assignEvents:Ls})})({clickTolerance:ee,enable:!0}),this.map=w,Q&&(this.mousePitch=ah({clickTolerance:le,enable:!0}),this.touchPitch=(({enable:Fe,clickTolerance:Ze,pitchDegreesPerPixelMoved:ut=-.5})=>{let Mt=new cf;return new Wu({clickTolerance:Ze,move:(Jt,$t)=>({pitchDelta:($t.y-Jt.y)*ut}),moveStateManager:Mt,enable:Fe,assignEvents:Ls})})({clickTolerance:le,enable:!0})),c.addEventListener(B,"mousedown",this.mousedown),c.addEventListener(B,"touchstart",this.touchstart,{passive:!1}),c.addEventListener(B,"touchcancel",this.reset)}startMouse(w,B){this.mouseRotate.dragStart(w,B),this.mousePitch&&this.mousePitch.dragStart(w,B),c.disableDrag()}startTouch(w,B){this.touchRotate.dragStart(w,B),this.touchPitch&&this.touchPitch.dragStart(w,B),c.disableDrag()}moveMouse(w,B){let Q=this.map,{bearingDelta:ee}=this.mouseRotate.dragMove(w,B)||{};if(ee&&Q.setBearing(Q.getBearing()+ee),this.mousePitch){let{pitchDelta:le}=this.mousePitch.dragMove(w,B)||{};le&&Q.setPitch(Q.getPitch()+le)}}moveTouch(w,B){let Q=this.map,{bearingDelta:ee}=this.touchRotate.dragMove(w,B)||{};if(ee&&Q.setBearing(Q.getBearing()+ee),this.touchPitch){let{pitchDelta:le}=this.touchPitch.dragMove(w,B)||{};le&&Q.setPitch(Q.getPitch()+le)}}off(){let w=this.element;c.removeEventListener(w,"mousedown",this.mousedown),c.removeEventListener(w,"touchstart",this.touchstart,{passive:!1}),c.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),c.removeEventListener(window,"touchend",this.touchend),c.removeEventListener(w,"touchcancel",this.reset),this.offTemp()}offTemp(){c.enableDrag(),c.removeEventListener(window,"mousemove",this.mousemove),c.removeEventListener(window,"mouseup",this.mouseup),c.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),c.removeEventListener(window,"touchend",this.touchend)}}let ys;function rs(ue,w,B){let Q=new a.N(ue.lng,ue.lat);if(ue=new a.N(ue.lng,ue.lat),w){let ee=new a.N(ue.lng-360,ue.lat),le=new a.N(ue.lng+360,ue.lat),Fe=B.locationPoint(ue).distSqr(w);B.locationPoint(ee).distSqr(w)<Fe?ue=ee:B.locationPoint(le).distSqr(w)<Fe&&(ue=le)}for(;Math.abs(ue.lng-B.center.lng)>180;){let ee=B.locationPoint(ue);if(ee.x>=0&&ee.y>=0&&ee.x<=B.width&&ee.y<=B.height)break;ue.lng>B.center.lng?ue.lng-=360:ue.lng+=360}return ue.lng!==Q.lng&&B.locationPoint(ue).y>B.height/2-B.getHorizon()?ue:Q}let Ql={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 Cu(ue,w,B){let Q=ue.classList;for(let ee in Ql)Q.remove(`maplibregl-${B}-anchor-${ee}`);Q.add(`maplibregl-${B}-anchor-${w}`)}class Yu extends a.E{constructor(w){if(super(),this._onKeyPress=B=>{let Q=B.code,ee=B.charCode||B.keyCode;Q!=="Space"&&Q!=="Enter"&&ee!==32&&ee!==13||this.togglePopup()},this._onMapClick=B=>{let Q=B.originalEvent.target,ee=this._element;this._popup&&(Q===ee||ee.contains(Q))&&this.togglePopup()},this._update=B=>{var Q;if(!this._map)return;let ee=this._map.loaded()&&!this._map.isMoving();((B==null?void 0:B.type)==="terrain"||(B==null?void 0:B.type)==="render"&&!ee)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?rs(this._lngLat,this._flatPos,this._map.transform):(Q=this._lngLat)===null||Q===void 0?void 0:Q.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 le="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?le=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(le=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let Fe="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?Fe="rotateX(0deg)":this._pitchAlignment==="map"&&(Fe=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||B&&B.type!=="moveend"||(this._pos=this._pos.round()),c.setTransform(this._element,`${Ql[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${Fe} ${le}`),u.frameAsync(new AbortController).then(()=>{this._updateOpacity(B&&B.type==="moveend")}).catch(()=>{})},this._onMove=B=>{if(!this._isDragging){let Q=this._clickTolerance||this._map._clickTolerance;this._isDragging=B.point.dist(this._pointerdownPos)>=Q}this._isDragging&&(this._pos=B.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=B=>{this._element.contains(B.originalEvent.target)&&(B.preventDefault(),this._positionDelta=B.point.sub(this._pos).add(this._offset),this._pointerdownPos=B.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=w&&w.anchor||"center",this._color=w&&w.color||"#3FB1CE",this._scale=w&&w.scale||1,this._draggable=w&&w.draggable||!1,this._clickTolerance=w&&w.clickTolerance||0,this._subpixelPositioning=w&&w.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=w&&w.rotation||0,this._rotationAlignment=w&&w.rotationAlignment||"auto",this._pitchAlignment=w&&w.pitchAlignment&&w.pitchAlignment!=="auto"?w.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(w==null?void 0:w.opacity,w==null?void 0:w.opacityWhenCovered),w&&w.element)this._element=w.element,this._offset=a.P.convert(w&&w.offset||[0,0]);else{this._defaultMarker=!0,this._element=c.create("div");let B=c.createNS("http://www.w3.org/2000/svg","svg"),Q=41,ee=27;B.setAttributeNS(null,"display","block"),B.setAttributeNS(null,"height",`${Q}px`),B.setAttributeNS(null,"width",`${ee}px`),B.setAttributeNS(null,"viewBox",`0 0 ${ee} ${Q}`);let le=c.createNS("http://www.w3.org/2000/svg","g");le.setAttributeNS(null,"stroke","none"),le.setAttributeNS(null,"stroke-width","1"),le.setAttributeNS(null,"fill","none"),le.setAttributeNS(null,"fill-rule","evenodd");let Fe=c.createNS("http://www.w3.org/2000/svg","g");Fe.setAttributeNS(null,"fill-rule","nonzero");let Ze=c.createNS("http://www.w3.org/2000/svg","g");Ze.setAttributeNS(null,"transform","translate(3.0, 29.0)"),Ze.setAttributeNS(null,"fill","#000000");let ut=[{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(let ze of ut){let Qe=c.createNS("http://www.w3.org/2000/svg","ellipse");Qe.setAttributeNS(null,"opacity","0.04"),Qe.setAttributeNS(null,"cx","10.5"),Qe.setAttributeNS(null,"cy","5.80029008"),Qe.setAttributeNS(null,"rx",ze.rx),Qe.setAttributeNS(null,"ry",ze.ry),Ze.appendChild(Qe)}let Mt=c.createNS("http://www.w3.org/2000/svg","g");Mt.setAttributeNS(null,"fill",this._color);let Jt=c.createNS("http://www.w3.org/2000/svg","path");Jt.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"),Mt.appendChild(Jt);let $t=c.createNS("http://www.w3.org/2000/svg","g");$t.setAttributeNS(null,"opacity","0.25"),$t.setAttributeNS(null,"fill","#000000");let yr=c.createNS("http://www.w3.org/2000/svg","path");yr.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"),$t.appendChild(yr);let Cr=c.createNS("http://www.w3.org/2000/svg","g");Cr.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Cr.setAttributeNS(null,"fill","#FFFFFF");let ve=c.createNS("http://www.w3.org/2000/svg","g");ve.setAttributeNS(null,"transform","translate(8.0, 8.0)");let xe=c.createNS("http://www.w3.org/2000/svg","circle");xe.setAttributeNS(null,"fill","#000000"),xe.setAttributeNS(null,"opacity","0.25"),xe.setAttributeNS(null,"cx","5.5"),xe.setAttributeNS(null,"cy","5.5"),xe.setAttributeNS(null,"r","5.4999962");let Ie=c.createNS("http://www.w3.org/2000/svg","circle");Ie.setAttributeNS(null,"fill","#FFFFFF"),Ie.setAttributeNS(null,"cx","5.5"),Ie.setAttributeNS(null,"cy","5.5"),Ie.setAttributeNS(null,"r","5.4999962"),ve.appendChild(xe),ve.appendChild(Ie),Fe.appendChild(Ze),Fe.appendChild(Mt),Fe.appendChild($t),Fe.appendChild(Cr),Fe.appendChild(ve),B.appendChild(Fe),B.setAttributeNS(null,"height",Q*this._scale+"px"),B.setAttributeNS(null,"width",ee*this._scale+"px"),this._element.appendChild(B),this._offset=a.P.convert(w&&w.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",B=>{B.preventDefault()}),this._element.addEventListener("mousedown",B=>{B.preventDefault()}),Cu(this._element,this._anchor,"marker"),w&&w.className)for(let B of w.className.split(" "))this._element.classList.add(B);this._popup=null}addTo(w){return this.remove(),this._map=w,this._element.setAttribute("aria-label",w._getUIString("Marker.Title")),w.getCanvasContainer().appendChild(this._element),w.on("move",this._update),w.on("moveend",this._update),w.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),c.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(w){return this._lngLat=a.N.convert(w),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(w){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),w){if(!("offset"in w.options)){let ee=Math.abs(13.5)/Math.SQRT2;w.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[ee,-1*(38.1-13.5+ee)],"bottom-right":[-ee,-1*(38.1-13.5+ee)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=w,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(w){return this._subpixelPositioning=w,this}getPopup(){return this._popup}togglePopup(){let w=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:w?(w.isOpen()?w.remove():(w.setLngLat(this._lngLat),w.addTo(this._map)),this):this}_updateOpacity(w=!1){var B,Q;if(!(!((B=this._map)===null||B===void 0)&&B.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(w)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let ee=this._map,le=ee.terrain.depthAtPoint(this._pos),Fe=ee.terrain.getElevationForLngLatZoom(this._lngLat,ee.transform.tileZoom);if(ee.transform.lngLatToCameraDepth(this._lngLat,Fe)-le<.006)return void(this._element.style.opacity=this._opacity);let Ze=-this._offset.y/ee.transform._pixelPerMeter,ut=Math.sin(ee.getPitch()*Math.PI/180)*Ze,Mt=ee.terrain.depthAtPoint(new a.P(this._pos.x,this._pos.y-this._offset.y)),Jt=ee.transform.lngLatToCameraDepth(this._lngLat,Fe+ut)-Mt>.006;!((Q=this._popup)===null||Q===void 0)&&Q.isOpen()&&Jt&&this._popup.remove(),this._element.style.opacity=Jt?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(w){return this._offset=a.P.convert(w),this._update(),this}addClassName(w){this._element.classList.add(w)}removeClassName(w){this._element.classList.remove(w)}toggleClassName(w){return this._element.classList.toggle(w)}setDraggable(w){return this._draggable=!!w,this._map&&(w?(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(w){return this._rotation=w||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(w){return this._rotationAlignment=w||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(w){return this._pitchAlignment=w&&w!=="auto"?w:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(w,B){return w===void 0&&B===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),w!==void 0&&(this._opacity=w),B!==void 0&&(this._opacityWhenCovered=B),this._map&&this._updateOpacity(!0),this}}let Nc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},pu=0,Uc=!1,xu={maxWidth:100,unit:"metric"};function Ac(ue,w,B){let Q=B&&B.maxWidth||100,ee=ue._container.clientHeight/2,le=ue.unproject([0,ee]),Fe=ue.unproject([Q,ee]),Ze=le.distanceTo(Fe);if(B&&B.unit==="imperial"){let ut=3.2808*Ze;ut>5280?Va(w,Q,ut/5280,ue._getUIString("ScaleControl.Miles")):Va(w,Q,ut,ue._getUIString("ScaleControl.Feet"))}else B&&B.unit==="nautical"?Va(w,Q,Ze/1852,ue._getUIString("ScaleControl.NauticalMiles")):Ze>=1e3?Va(w,Q,Ze/1e3,ue._getUIString("ScaleControl.Kilometers")):Va(w,Q,Ze,ue._getUIString("ScaleControl.Meters"))}function Va(ue,w,B,Q){let ee=function(le){let Fe=Math.pow(10,`${Math.floor(le)}`.length-1),Ze=le/Fe;return Ze=Ze>=10?10:Ze>=5?5:Ze>=3?3:Ze>=2?2:Ze>=1?1:function(ut){let Mt=Math.pow(10,Math.ceil(-Math.log(ut)/Math.LN10));return Math.round(ut*Mt)/Mt}(Ze),Fe*Ze}(B);ue.style.width=w*(ee/B)+"px",ue.innerHTML=`${ee}&nbsp;${Q}`}let oo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Vc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function hc(ue){if(ue){if(typeof ue=="number"){let w=Math.round(Math.abs(ue)/Math.SQRT2);return{center:new a.P(0,0),top:new a.P(0,ue),"top-left":new a.P(w,w),"top-right":new a.P(-w,w),bottom:new a.P(0,-ue),"bottom-left":new a.P(w,-w),"bottom-right":new a.P(-w,-w),left:new a.P(ue,0),right:new a.P(-ue,0)}}if(ue instanceof a.P||Array.isArray(ue)){let w=a.P.convert(ue);return{center:w,top:w,"top-left":w,"top-right":w,bottom:w,"bottom-left":w,"bottom-right":w,left:w,right:w}}return{center:a.P.convert(ue.center||[0,0]),top:a.P.convert(ue.top||[0,0]),"top-left":a.P.convert(ue["top-left"]||[0,0]),"top-right":a.P.convert(ue["top-right"]||[0,0]),bottom:a.P.convert(ue.bottom||[0,0]),"bottom-left":a.P.convert(ue["bottom-left"]||[0,0]),"bottom-right":a.P.convert(ue["bottom-right"]||[0,0]),left:a.P.convert(ue.left||[0,0]),right:a.P.convert(ue.right||[0,0])}}return hc(new a.P(0,0))}let Ku=o;i.AJAXError=a.bh,i.Evented=a.E,i.LngLat=a.N,i.MercatorCoordinate=a.Z,i.Point=a.P,i.addProtocol=a.bi,i.config=a.a,i.removeProtocol=a.bj,i.AttributionControl=Ua,i.BoxZoomHandler=ku,i.CanvasSource=rr,i.CooperativeGesturesHandler=$i,i.DoubleClickZoomHandler=Mi,i.DragPanHandler=wn,i.DragRotateHandler=On,i.EdgeInsets=hu,i.FullscreenControl=class extends a.E{constructor(ue={}){super(),this._onFullscreenChange=()=>{var w;let B=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((w=B==null?void 0:B.shadowRoot)===null||w===void 0)&&w.fullscreenElement;)B=B.shadowRoot.fullscreenElement;B===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,ue&&ue.container&&(ue.container instanceof HTMLElement?this._container=ue.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(ue){return this._map=ue,this._container||(this._container=this._map.getContainer()),this._controlContainer=c.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){c.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let ue=this._fullscreenButton=c.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);c.create("span","maplibregl-ctrl-icon",ue).setAttribute("aria-hidden","true"),ue.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let ue=this._getTitle();this._fullscreenButton.setAttribute("aria-label",ue),this._fullscreenButton.title=ue}_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()}},i.GeoJSONSource=at,i.GeolocateControl=class extends a.E{constructor(ue){super(),this._onSuccess=w=>{if(this._map){if(this._isOutOfMapMaxBounds(w))return this._setErrorState(),this.fire(new a.k("outofmaxbounds",w)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=w,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(w),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(w),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new a.k("geolocate",w)),this._finish()}},this._updateCamera=w=>{let B=new a.N(w.coords.longitude,w.coords.latitude),Q=w.coords.accuracy,ee=this._map.getBearing(),le=a.e({bearing:ee},this.options.fitBoundsOptions),Fe=ce.fromLngLat(B,Q);this._map.fitBounds(Fe,le,{geolocateSource:!0})},this._updateMarker=w=>{if(w){let B=new a.N(w.coords.longitude,w.coords.latitude);this._accuracyCircleMarker.setLngLat(B).addTo(this._map),this._userLocationDotMarker.setLngLat(B).addTo(this._map),this._accuracy=w.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=w=>{if(this._map){if(this.options.trackUserLocation)if(w.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;let B=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=B,this._geolocateButton.setAttribute("aria-label",B),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(w.code===3&&Uc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new a.k("error",w)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",w=>w.preventDefault()),this._geolocateButton=c.create("button","maplibregl-ctrl-geolocate",this._container),c.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=w=>{if(this._map){if(w===!1){a.w("Geolocation support is not available so the GeolocateControl will be disabled.");let B=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=B,this._geolocateButton.setAttribute("aria-label",B)}else{let B=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=B,this._geolocateButton.setAttribute("aria-label",B)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=c.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Yu({element:this._dotElement}),this._circleElement=c.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Yu({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",B=>{B.geolocateSource||this._watchState!=="ACTIVE_LOCK"||B.originalEvent&&B.originalEvent.type==="resize"||(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({},Nc,ue)}onAdd(ue){return this._map=ue,this._container=c.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return a._(this,arguments,void 0,function*(w=!1){if(ys!==void 0&&!w)return ys;if(window.navigator.permissions===void 0)return ys=!!window.navigator.geolocation,ys;try{ys=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch(B){ys=!!window.navigator.geolocation}return ys})}().then(w=>this._finishSetupUI(w)),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(),c.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,pu=0,Uc=!1}_isOutOfMapMaxBounds(ue){let w=this._map.getMaxBounds(),B=ue.coords;return w&&(B.longitude<w.getWest()||B.longitude>w.getEast()||B.latitude<w.getSouth()||B.latitude>w.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(){let ue=this._map.getBounds(),w=ue.getSouthEast(),B=ue.getNorthEast(),Q=w.distanceTo(B),ee=Math.ceil(this._accuracy/(Q/this._map._container.clientHeight)*2);this._circleElement.style.width=`${ee}px`,this._circleElement.style.height=`${ee}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":pu--,Uc=!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 ue;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),pu++,pu>1?(ue={maximumAge:6e5,timeout:0},Uc=!0):(ue=this.options.positionOptions,Uc=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,ue)}}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)}},i.Hash=Mh,i.ImageSource=ar,i.KeyboardHandler=Zt,i.LngLatBounds=ce,i.LogoControl=Zn,i.Map=class extends Ra{constructor(ue){a.bf.mark(a.bg.create);let w=Object.assign(Object.assign({},Ws),ue);if(w.minZoom!=null&&w.maxZoom!=null&&w.minZoom>w.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(w.minPitch!=null&&w.maxPitch!=null&&w.minPitch>w.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(w.minPitch!=null&&w.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(w.maxPitch!=null&&w.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new nl(w.minZoom,w.maxZoom,w.minPitch,w.maxPitch,w.renderWorldCopies),{bearingSnap:w.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Dn,this._controls=[],this._mapId=a.a4(),this._contextLost=B=>{B.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new a.k("webglcontextlost",{originalEvent:B}))},this._contextRestored=B=>{this._setupPainter(),this.resize(),this._update(),this.fire(new a.k("webglcontextrestored",{originalEvent:B}))},this._onMapScroll=B=>{if(B.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=w.interactive,this._maxTileCacheSize=w.maxTileCacheSize,this._maxTileCacheZoomLevels=w.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=w.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=w.preserveDrawingBuffer===!0,this._antialias=w.antialias===!0,this._trackResize=w.trackResize===!0,this._bearingSnap=w.bearingSnap,this._refreshExpiredTiles=w.refreshExpiredTiles===!0,this._fadeDuration=w.fadeDuration,this._crossSourceCollisions=w.crossSourceCollisions===!0,this._collectResourceTiming=w.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},Ho),w.locale),this._clickTolerance=w.clickTolerance,this._overridePixelRatio=w.pixelRatio,this._maxCanvasSize=w.maxCanvasSize,this.transformCameraUpdate=w.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=w.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=p.addThrottleControl(()=>this.isMoving()),this._requestManager=new k(w.transformRequest),typeof w.container=="string"){if(this._container=document.getElementById(w.container),!this._container)throw new Error(`Container '${w.container}' not found.`)}else{if(!(w.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=w.container}if(w.maxBounds&&this.setMaxBounds(w.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!="undefined"){addEventListener("online",this._onWindowOnline,!1);let B=!1,Q=nh(ee=>{this._trackResize&&!this._removed&&(this.resize(ee),this.redraw())},50);this._resizeObserver=new ResizeObserver(ee=>{B?Q(ee):B=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Ca(this,w),this._hash=w.hash&&new Mh(typeof w.hash=="string"&&w.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:w.center,zoom:w.zoom,bearing:w.bearing,pitch:w.pitch}),w.bounds&&(this.resize(),this.fitBounds(w.bounds,a.e({},w.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=w.localIdeographFontFamily,this._validateStyle=w.validateStyle,w.style&&this.setStyle(w.style,{localIdeographFontFamily:w.localIdeographFontFamily}),w.attributionControl&&this.addControl(new Ua(typeof w.attributionControl=="boolean"?void 0:w.attributionControl)),w.maplibreLogo&&this.addControl(new Zn,w.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",B=>{this._update(B.dataType==="style"),this.fire(new a.k(`${B.dataType}data`,B))}),this.on("dataloading",B=>{this.fire(new a.k(`${B.dataType}dataloading`,B))}),this.on("dataabort",B=>{this.fire(new a.k("sourcedataabort",B))})}_getMapId(){return this._mapId}addControl(ue,w){if(w===void 0&&(w=ue.getDefaultPosition?ue.getDefaultPosition():"top-right"),!ue||!ue.onAdd)return this.fire(new a.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let B=ue.onAdd(this);this._controls.push(ue);let Q=this._controlPositions[w];return w.indexOf("bottom")!==-1?Q.insertBefore(B,Q.firstChild):Q.appendChild(B),this}removeControl(ue){if(!ue||!ue.onRemove)return this.fire(new a.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let w=this._controls.indexOf(ue);return w>-1&&this._controls.splice(w,1),ue.onRemove(this),this}hasControl(ue){return this._controls.indexOf(ue)>-1}calculateCameraOptionsFromTo(ue,w,B,Q){return Q==null&&this.terrain&&(Q=this.terrain.getElevationForLngLatZoom(B,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(ue,w,B,Q)}resize(ue){var w;let B=this._containerDimensions(),Q=B[0],ee=B[1],le=this._getClampedPixelRatio(Q,ee);if(this._resizeCanvas(Q,ee,le),this.painter.resize(Q,ee,le),this.painter.overLimit()){let Ze=this.painter.context.gl;this._maxCanvasSize=[Ze.drawingBufferWidth,Ze.drawingBufferHeight];let ut=this._getClampedPixelRatio(Q,ee);this._resizeCanvas(Q,ee,ut),this.painter.resize(Q,ee,ut)}this.transform.resize(Q,ee),(w=this._requestedCameraState)===null||w===void 0||w.resize(Q,ee);let Fe=!this._moving;return Fe&&(this.stop(),this.fire(new a.k("movestart",ue)).fire(new a.k("move",ue))),this.fire(new a.k("resize",ue)),Fe&&this.fire(new a.k("moveend",ue)),this}_getClampedPixelRatio(ue,w){let{0:B,1:Q}=this._maxCanvasSize,ee=this.getPixelRatio(),le=ue*ee,Fe=w*ee;return Math.min(le>B?B/le:1,Fe>Q?Q/Fe:1)*ee}getPixelRatio(){var ue;return(ue=this._overridePixelRatio)!==null&&ue!==void 0?ue:devicePixelRatio}setPixelRatio(ue){this._overridePixelRatio=ue,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(ue){return this.transform.setMaxBounds(ce.convert(ue)),this._update()}setMinZoom(ue){if((ue=ue==null?-2:ue)>=-2&&ue<=this.transform.maxZoom)return this.transform.minZoom=ue,this._update(),this.getZoom()<ue&&this.setZoom(ue),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(ue){if((ue=ue==null?22:ue)>=this.transform.minZoom)return this.transform.maxZoom=ue,this._update(),this.getZoom()>ue&&this.setZoom(ue),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(ue){if((ue=ue==null?0:ue)<0)throw new Error("minPitch must be greater than or equal to 0");if(ue>=0&&ue<=this.transform.maxPitch)return this.transform.minPitch=ue,this._update(),this.getPitch()<ue&&this.setPitch(ue),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(ue){if((ue=ue==null?60:ue)>85)throw new Error("maxPitch must be less than or equal to 85");if(ue>=this.transform.minPitch)return this.transform.maxPitch=ue,this._update(),this.getPitch()>ue&&this.setPitch(ue),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(ue){return this.transform.renderWorldCopies=ue,this._update()}project(ue){return this.transform.locationPoint(a.N.convert(ue),this.style&&this.terrain)}unproject(ue){return this.transform.pointLocation(a.P.convert(ue),this.terrain)}isMoving(){var ue;return this._moving||((ue=this.handlers)===null||ue===void 0?void 0:ue.isMoving())}isZooming(){var ue;return this._zooming||((ue=this.handlers)===null||ue===void 0?void 0:ue.isZooming())}isRotating(){var ue;return this._rotating||((ue=this.handlers)===null||ue===void 0?void 0:ue.isRotating())}_createDelegatedListener(ue,w,B){if(ue==="mouseenter"||ue==="mouseover"){let Q=!1;return{layers:w,listener:B,delegates:{mousemove:le=>{let Fe=w.filter(ut=>this.getLayer(ut)),Ze=Fe.length!==0?this.queryRenderedFeatures(le.point,{layers:Fe}):[];Ze.length?Q||(Q=!0,B.call(this,new jl(ue,this,le.originalEvent,{features:Ze}))):Q=!1},mouseout:()=>{Q=!1}}}}if(ue==="mouseleave"||ue==="mouseout"){let Q=!1;return{layers:w,listener:B,delegates:{mousemove:Fe=>{let Ze=w.filter(ut=>this.getLayer(ut));(Ze.length!==0?this.queryRenderedFeatures(Fe.point,{layers:Ze}):[]).length?Q=!0:Q&&(Q=!1,B.call(this,new jl(ue,this,Fe.originalEvent)))},mouseout:Fe=>{Q&&(Q=!1,B.call(this,new jl(ue,this,Fe.originalEvent)))}}}}{let Q=ee=>{let le=w.filter(Ze=>this.getLayer(Ze)),Fe=le.length!==0?this.queryRenderedFeatures(ee.point,{layers:le}):[];Fe.length&&(ee.features=Fe,B.call(this,ee),delete ee.features)};return{layers:w,listener:B,delegates:{[ue]:Q}}}}_saveDelegatedListener(ue,w){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[ue]=this._delegatedListeners[ue]||[],this._delegatedListeners[ue].push(w)}_removeDelegatedListener(ue,w,B){if(!this._delegatedListeners||!this._delegatedListeners[ue])return;let Q=this._delegatedListeners[ue];for(let ee=0;ee<Q.length;ee++){let le=Q[ee];if(le.listener===B&&le.layers.length===w.length&&le.layers.every(Fe=>w.includes(Fe))){for(let Fe in le.delegates)this.off(Fe,le.delegates[Fe]);return void Q.splice(ee,1)}}}on(ue,w,B){if(B===void 0)return super.on(ue,w);let Q=this._createDelegatedListener(ue,typeof w=="string"?[w]:w,B);this._saveDelegatedListener(ue,Q);for(let ee in Q.delegates)this.on(ee,Q.delegates[ee]);return this}once(ue,w,B){if(B===void 0)return super.once(ue,w);let Q=typeof w=="string"?[w]:w,ee=this._createDelegatedListener(ue,Q,B);for(let le in ee.delegates){let Fe=ee.delegates[le];ee.delegates[le]=(...Ze)=>{this._removeDelegatedListener(ue,Q,B),Fe(...Ze)}}this._saveDelegatedListener(ue,ee);for(let le in ee.delegates)this.once(le,ee.delegates[le]);return this}off(ue,w,B){return B===void 0?super.off(ue,w):(this._removeDelegatedListener(ue,typeof w=="string"?[w]:w,B),this)}queryRenderedFeatures(ue,w){if(!this.style)return[];let B,Q=ue instanceof a.P||Array.isArray(ue),ee=Q?ue:[[0,0],[this.transform.width,this.transform.height]];if(w=w||(Q?{}:ue)||{},ee instanceof a.P||typeof ee[0]=="number")B=[a.P.convert(ee)];else{let le=a.P.convert(ee[0]),Fe=a.P.convert(ee[1]);B=[le,new a.P(Fe.x,le.y),Fe,new a.P(le.x,Fe.y),le]}return this.style.queryRenderedFeatures(B,w,this.transform)}querySourceFeatures(ue,w){return this.style.querySourceFeatures(ue,w)}setStyle(ue,w){return(w=a.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},w)).diff!==!1&&w.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&ue?(this._diffStyle(ue,w),this):(this._localIdeographFontFamily=w.localIdeographFontFamily,this._updateStyle(ue,w))}setTransformRequest(ue){return this._requestManager.setTransformRequest(ue),this}_getUIString(ue){let w=this._locale[ue];if(w==null)throw new Error(`Missing UI string '${ue}'`);return w}_updateStyle(ue,w){if(w.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(ue,w));let B=this.style&&w.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!ue)),ue?(this.style=new Ha(this,w||{}),this.style.setEventedParent(this,{style:this.style}),typeof ue=="string"?this.style.loadURL(ue,w,B):this.style.loadJSON(ue,w,B),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ha(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(ue,w){if(typeof ue=="string"){let B=this._requestManager.transformRequest(ue,"Style");a.h(B,new AbortController).then(Q=>{this._updateDiff(Q.data,w)}).catch(Q=>{Q&&this.fire(new a.j(Q))})}else typeof ue=="object"&&this._updateDiff(ue,w)}_updateDiff(ue,w){try{this.style.setState(ue,w)&&this._update(!0)}catch(B){a.w(`Unable to perform style diff: ${B.message||B.error||B}. Rebuilding the style from scratch.`),this._updateStyle(ue,w)}}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(ue,w){return this._lazyInitEmptyStyle(),this.style.addSource(ue,w),this._update(!0)}isSourceLoaded(ue){let w=this.style&&this.style.sourceCaches[ue];if(w!==void 0)return w.loaded();this.fire(new a.j(new Error(`There is no source with ID '${ue}'`)))}setTerrain(ue){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),ue){let w=this.style.sourceCaches[ue.source];if(!w)throw new Error(`cannot load terrain, because there exists no source with ID: ${ue.source}`);this.terrain===null&&w.reload();for(let B in this.style._layers){let Q=this.style._layers[B];Q.type==="hillshade"&&Q.source===ue.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 Zo(this.painter,w,ue),this.painter.renderToTexture=new ws(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=B=>{B.dataType==="style"?this.terrain.sourceCache.freeRtt():B.dataType==="source"&&B.tile&&(B.sourceId!==ue.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(B.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:ue})),this}getTerrain(){var ue,w;return(w=(ue=this.terrain)===null||ue===void 0?void 0:ue.options)!==null&&w!==void 0?w:null}areTilesLoaded(){let ue=this.style&&this.style.sourceCaches;for(let w in ue){let B=ue[w]._tiles;for(let Q in B){let ee=B[Q];if(ee.state!=="loaded"&&ee.state!=="errored")return!1}}return!0}removeSource(ue){return this.style.removeSource(ue),this._update(!0)}getSource(ue){return this.style.getSource(ue)}addImage(ue,w,B={}){let{pixelRatio:Q=1,sdf:ee=!1,stretchX:le,stretchY:Fe,content:Ze,textFitWidth:ut,textFitHeight:Mt}=B;if(this._lazyInitEmptyStyle(),!(w instanceof HTMLImageElement||a.b(w))){if(w.width===void 0||w.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`")));{let{width:Jt,height:$t,data:yr}=w,Cr=w;return this.style.addImage(ue,{data:new a.R({width:Jt,height:$t},new Uint8Array(yr)),pixelRatio:Q,stretchX:le,stretchY:Fe,content:Ze,textFitWidth:ut,textFitHeight:Mt,sdf:ee,version:0,userImage:Cr}),Cr.onAdd&&Cr.onAdd(this,ue),this}}{let{width:Jt,height:$t,data:yr}=u.getImageData(w);this.style.addImage(ue,{data:new a.R({width:Jt,height:$t},yr),pixelRatio:Q,stretchX:le,stretchY:Fe,content:Ze,textFitWidth:ut,textFitHeight:Mt,sdf:ee,version:0})}}updateImage(ue,w){let B=this.style.getImage(ue);if(!B)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.")));let Q=w instanceof HTMLImageElement||a.b(w)?u.getImageData(w):w,{width:ee,height:le,data:Fe}=Q;if(ee===void 0||le===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(ee!==B.data.width||le!==B.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")));let Ze=!(w instanceof HTMLImageElement||a.b(w));return B.data.replace(Fe,Ze),this.style.updateImage(ue,B),this}getImage(ue){return this.style.getImage(ue)}hasImage(ue){return ue?!!this.style.getImage(ue):(this.fire(new a.j(new Error("Missing required image id"))),!1)}removeImage(ue){this.style.removeImage(ue)}loadImage(ue){return p.getImage(this._requestManager.transformRequest(ue,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(ue,w){return this._lazyInitEmptyStyle(),this.style.addLayer(ue,w),this._update(!0)}moveLayer(ue,w){return this.style.moveLayer(ue,w),this._update(!0)}removeLayer(ue){return this.style.removeLayer(ue),this._update(!0)}getLayer(ue){return this.style.getLayer(ue)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(ue,w,B){return this.style.setLayerZoomRange(ue,w,B),this._update(!0)}setFilter(ue,w,B={}){return this.style.setFilter(ue,w,B),this._update(!0)}getFilter(ue){return this.style.getFilter(ue)}setPaintProperty(ue,w,B,Q={}){return this.style.setPaintProperty(ue,w,B,Q),this._update(!0)}getPaintProperty(ue,w){return this.style.getPaintProperty(ue,w)}setLayoutProperty(ue,w,B,Q={}){return this.style.setLayoutProperty(ue,w,B,Q),this._update(!0)}getLayoutProperty(ue,w){return this.style.getLayoutProperty(ue,w)}setGlyphs(ue,w={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(ue,w),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(ue,w,B={}){return this._lazyInitEmptyStyle(),this.style.addSprite(ue,w,B,Q=>{Q||this._update(!0)}),this}removeSprite(ue){return this._lazyInitEmptyStyle(),this.style.removeSprite(ue),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(ue,w={}){return this._lazyInitEmptyStyle(),this.style.setSprite(ue,w,B=>{B||this._update(!0)}),this}setLight(ue,w={}){return this._lazyInitEmptyStyle(),this.style.setLight(ue,w),this._update(!0)}getLight(){return this.style.getLight()}setSky(ue){return this._lazyInitEmptyStyle(),this.style.setSky(ue),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(ue,w){return this.style.setFeatureState(ue,w),this._update()}removeFeatureState(ue,w){return this.style.removeFeatureState(ue,w),this._update()}getFeatureState(ue){return this.style.getFeatureState(ue)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let ue=0,w=0;return this._container&&(ue=this._container.clientWidth||400,w=this._container.clientHeight||300),[ue,w]}_setupContainer(){let ue=this._container;ue.classList.add("maplibregl-map");let w=this._canvasContainer=c.create("div","maplibregl-canvas-container",ue);this._interactive&&w.classList.add("maplibregl-interactive"),this._canvas=c.create("canvas","maplibregl-canvas",w),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");let B=this._containerDimensions(),Q=this._getClampedPixelRatio(B[0],B[1]);this._resizeCanvas(B[0],B[1],Q);let ee=this._controlContainer=c.create("div","maplibregl-control-container",ue),le=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(Fe=>{le[Fe]=c.create("div",`maplibregl-ctrl-${Fe} `,ee)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(ue,w,B){this._canvas.width=Math.floor(B*ue),this._canvas.height=Math.floor(B*w),this._canvas.style.width=`${ue}px`,this._canvas.style.height=`${w}px`}_setupPainter(){let ue={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},w=null;this._canvas.addEventListener("webglcontextcreationerror",Q=>{w={requestedAttributes:ue},Q&&(w.statusMessage=Q.statusMessage,w.type=Q.type)},{once:!0});let B=this._canvas.getContext("webgl2",ue)||this._canvas.getContext("webgl",ue);if(!B){let Q="Failed to initialize WebGL";throw w?(w.message=Q,new Error(JSON.stringify(w))):new Error(Q)}this.painter=new Dc(B,this.transform),f.testSupport(B)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(ue){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||ue,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(ue){return this._update(),this._renderTaskQueue.add(ue)}_cancelRenderFrame(ue){this._renderTaskQueue.remove(ue)}_render(ue){let w=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(ue),this._removed)return;let B=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let ee=this.transform.zoom,le=u.now();this.style.zoomHistory.update(ee,le);let Fe=new a.z(ee,{now:le,fadeDuration:w,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),Ze=Fe.crossFadingFactor();Ze===1&&Ze===this._crossFadingFactor||(B=!0,this._crossFadingFactor=Ze),this.style.update(Fe)}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,w,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:w,showPadding:this.showPadding}),this.fire(new a.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,a.bf.mark(a.bg.load),this.fire(new a.k("load"))),this.style&&(this.style.hasTransitions()||B)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let Q=this._sourcesDirty||this._styleDirty||this._placementDirty;return Q||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new a.k("idle")),!this._loaded||this._fullyLoaded||Q||(this._fullyLoaded=!0,a.bf.mark(a.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var ue;this._hash&&this._hash.remove();for(let B of this._controls)B.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!="undefined"&&removeEventListener("online",this._onWindowOnline,!1),p.removeThrottleControl(this._imageQueueHandle),(ue=this._resizeObserver)===null||ue===void 0||ue.disconnect();let w=this.painter.context.gl.getExtension("WEBGL_lose_context");w!=null&&w.loseContext&&w.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),c.remove(this._canvasContainer),c.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),a.bf.clearMetrics(),this._removed=!0,this.fire(new a.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,u.frameAsync(this._frameRequest).then(ue=>{a.bf.frame(ue),this._frameRequest=null,this._render(ue)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(ue){this._showTileBoundaries!==ue&&(this._showTileBoundaries=ue,this._update())}get showPadding(){return!!this._showPadding}set showPadding(ue){this._showPadding!==ue&&(this._showPadding=ue,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(ue){this._showCollisionBoxes!==ue&&(this._showCollisionBoxes=ue,ue?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(ue){this._showOverdrawInspector!==ue&&(this._showOverdrawInspector=ue,this._update())}get repaint(){return!!this._repaint}set repaint(ue){this._repaint!==ue&&(this._repaint=ue,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(ue){this._vertices=ue,this._update()}get version(){return ml}getCameraTargetElevation(){return this.transform.elevation}},i.MapMouseEvent=jl,i.MapTouchEvent=uf,i.MapWheelEvent=Xh,i.Marker=Yu,i.NavigationControl=class{constructor(ue){this._updateZoomButtons=()=>{let w=this._map.getZoom(),B=w===this._map.getMaxZoom(),Q=w===this._map.getMinZoom();this._zoomInButton.disabled=B,this._zoomOutButton.disabled=Q,this._zoomInButton.setAttribute("aria-disabled",B.toString()),this._zoomOutButton.setAttribute("aria-disabled",Q.toString())},this._rotateCompassArrow=()=>{let w=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=w},this._setButtonTitle=(w,B)=>{let Q=this._map._getUIString(`NavigationControl.${B}`);w.title=Q,w.setAttribute("aria-label",Q)},this.options=a.e({},va,ue),this._container=c.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",w=>w.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",w=>this._map.zoomIn({},{originalEvent:w})),c.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",w=>this._map.zoomOut({},{originalEvent:w})),c.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",w=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:w}):this._map.resetNorth({},{originalEvent:w})}),this._compassIcon=c.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(ue){return this._map=ue,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 no(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){c.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(ue,w){let B=c.create("button",ue,this._container);return B.type="button",B.addEventListener("click",w),B}},i.Popup=class extends a.E{constructor(ue){super(),this.remove=()=>(this._content&&c.remove(this._content),this._container&&(c.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=w=>{this._update(w.point)},this._onMouseMove=w=>{this._update(w.point)},this._onDrag=w=>{this._update(w.point)},this._update=w=>{var B;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=c.create("div","maplibregl-popup",this._map.getContainer()),this._tip=c.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let Ze of this.options.className.split(" "))this._container.classList.add(Ze);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._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?rs(this._lngLat,this._flatPos,this._map.transform):(B=this._lngLat)===null||B===void 0?void 0:B.wrap(),this._trackPointer&&!w)return;let Q=this._flatPos=this._pos=this._trackPointer&&w?w:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&w?w:this._map.transform.locationPoint(this._lngLat));let ee=this.options.anchor,le=hc(this.options.offset);if(!ee){let Ze=this._container.offsetWidth,ut=this._container.offsetHeight,Mt;Mt=Q.y+le.bottom.y<ut?["top"]:Q.y>this._map.transform.height-ut?["bottom"]:[],Q.x<Ze/2?Mt.push("left"):Q.x>this._map.transform.width-Ze/2&&Mt.push("right"),ee=Mt.length===0?"bottom":Mt.join("-")}let Fe=Q.add(le[ee]);this.options.subpixelPositioning||(Fe=Fe.round()),c.setTransform(this._container,`${Ql[ee]} translate(${Fe.x}px,${Fe.y}px)`),Cu(this._container,ee,"popup")},this._onClose=()=>{this.remove()},this.options=a.e(Object.create(oo),ue)}addTo(ue){return this._map&&this.remove(),this._map=ue,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(ue){return this._lngLat=a.N.convert(ue),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(ue){return this.setDOMContent(document.createTextNode(ue))}setHTML(ue){let w=document.createDocumentFragment(),B=document.createElement("body"),Q;for(B.innerHTML=ue;Q=B.firstChild,Q;)w.appendChild(Q);return this.setDOMContent(w)}getMaxWidth(){var ue;return(ue=this._container)===null||ue===void 0?void 0:ue.style.maxWidth}setMaxWidth(ue){return this.options.maxWidth=ue,this._update(),this}setDOMContent(ue){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=c.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(ue),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(ue){return this._container&&this._container.classList.add(ue),this}removeClassName(ue){return this._container&&this._container.classList.remove(ue),this}setOffset(ue){return this.options.offset=ue,this._update(),this}toggleClassName(ue){if(this._container)return this._container.classList.toggle(ue)}setSubpixelPositioning(ue){this.options.subpixelPositioning=ue}_createCloseButton(){this.options.closeButton&&(this._closeButton=c.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;let ue=this._container.querySelector(Vc);ue&&ue.focus()}},i.RasterDEMTileSource=Ht,i.RasterTileSource=mt,i.ScaleControl=class{constructor(ue){this._onMove=()=>{Ac(this._map,this._container,this.options)},this.setUnit=w=>{this.options.unit=w,Ac(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},xu),ue)}getDefaultPosition(){return"bottom-left"}onAdd(ue){return this._map=ue,this._container=c.create("div","maplibregl-ctrl maplibregl-ctrl-scale",ue.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){c.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},i.ScrollZoomHandler=Kr,i.Style=Ha,i.TerrainControl=class{constructor(ue){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=ue}onAdd(ue){return this._map=ue,this._container=c.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=c.create("button","maplibregl-ctrl-terrain",this._container),c.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(){c.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},i.TwoFingersTouchPitchHandler=Bc,i.TwoFingersTouchRotateHandler=ff,i.TwoFingersTouchZoomHandler=vu,i.TwoFingersTouchZoomRotateHandler=Yi,i.VectorTileSource=lt,i.VideoSource=Vt,i.addSourceType=(ue,w)=>a._(void 0,void 0,void 0,function*(){if(je(ue))throw new Error(`A source type called "${ue}" already exists.`);((B,Q)=>{tt[B]=Q})(ue,w)}),i.clearPrewarmedResources=function(){let ue=ge;ue&&(ue.isPreloaded()&&ue.numActive()===1?(ue.release(_e),ge=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()"))},i.getMaxParallelImageRequests=function(){return a.a.MAX_PARALLEL_IMAGE_REQUESTS},i.getRTLTextPluginStatus=function(){return St().getRTLTextPluginStatus()},i.getVersion=function(){return Ku},i.getWorkerCount=function(){return Ee.workerCount},i.getWorkerUrl=function(){return a.a.WORKER_URL},i.importScriptInWorkers=function(ue){return be().broadcast("IS",ue)},i.prewarm=function(){Se().acquire(_e)},i.setMaxParallelImageRequests=function(ue){a.a.MAX_PARALLEL_IMAGE_REQUESTS=ue},i.setRTLTextPlugin=function(ue,w){return St().setRTLTextPlugin(ue,w)},i.setWorkerCount=function(ue){Ee.workerCount=ue},i.setWorkerUrl=function(ue){a.a.WORKER_URL=ue}});var n=e;return n})});var wje=ye((Kbr,bje)=>{"use strict";var gw=Pr(),jXt=Zl().sanitizeHTML,WXt=RJ(),yje=Ix();function _je(e,t){this.subplot=e,this.uid=e.uid+"-"+t,this.index=t,this.idSource="source-"+this.uid,this.idLayer=yje.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var sg=_je.prototype;sg.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=g7(t)};sg.needsNewImage=function(e){var t=this.subplot.map;return t.getSource(this.idSource)&&this.sourceType==="image"&&e.sourcetype==="image"&&(this.source!==e.source||JSON.stringify(this.coordinates)!==JSON.stringify(e.coordinates))};sg.needsNewSource=function(e){return this.sourceType!==e.sourcetype||JSON.stringify(this.source)!==JSON.stringify(e.source)||this.layerType!==e.type};sg.needsNewLayer=function(e){return this.layerType!==e.type||this.below!==this.subplot.belowLookup["layout-"+this.index]};sg.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]};sg.updateImage=function(e){var t=this.subplot.map;t.getSource(this.idSource).updateImage({url:e.source,coordinates:e.coordinates});var r=this.findFollowingMapLayerId(this.lookupBelow());r!==null&&this.subplot.map.moveLayer(this.idLayer,r)};sg.updateSource=function(e){var t=this.subplot.map;if(t.getSource(this.idSource)&&t.removeSource(this.idSource),this.sourceType=e.sourcetype,this.source=e.source,!!g7(e)){var r=XXt(e);t.addSource(this.idSource,r)}};sg.findFollowingMapLayerId=function(e){if(e==="traces")for(var t=this.subplot.getMapLayers(),r=0;r<t.length;r++){var n=t[r].id;if(typeof n=="string"&&n.indexOf(yje.traceLayerPrefix)===0){e=n;break}}return e};sg.updateLayer=function(e){var t=this.subplot,r=xje(e),n=this.lookupBelow(),i=this.findFollowingMapLayerId(n);this.removeLayer(),g7(e)&&t.addLayer({id:this.idLayer,source:this.idSource,"source-layer":e.sourcelayer||"",type:e.type,minzoom:e.minzoom,maxzoom:e.maxzoom,layout:r.layout,paint:r.paint},i),this.layerType=e.type,this.below=n};sg.updateStyle=function(e){if(g7(e)){var t=xje(e);this.subplot.setOptions(this.idLayer,"setLayoutProperty",t.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",t.paint)}};sg.removeLayer=function(){var e=this.subplot.map;e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer)};sg.dispose=function(){var e=this.subplot.map;e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),e.getSource(this.idSource)&&e.removeSource(this.idSource)};function g7(e){if(!e.visible)return!1;var t=e.source;if(Array.isArray(t)&&t.length>0){for(var r=0;r<t.length;r++)if(typeof t[r]!="string"||t[r].length===0)return!1;return!0}return gw.isPlainObject(t)||typeof t=="string"&&t.length>0}function xje(e){var t={},r={};switch(e.type){case"circle":gw.extendFlat(r,{"circle-radius":e.circle.radius,"circle-color":e.color,"circle-opacity":e.opacity});break;case"line":gw.extendFlat(r,{"line-width":e.line.width,"line-color":e.color,"line-opacity":e.opacity,"line-dasharray":e.line.dash});break;case"fill":gw.extendFlat(r,{"fill-color":e.color,"fill-outline-color":e.fill.outlinecolor,"fill-opacity":e.opacity});break;case"symbol":var n=e.symbol,i=WXt(n.textposition,n.iconsize);gw.extendFlat(t,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset,"symbol-placement":n.placement}),gw.extendFlat(r,{"icon-color":e.color,"text-color":n.textfont.color,"text-opacity":e.opacity});break;case"raster":gw.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":e.opacity});break}return{layout:t,paint:r}}function XXt(e){var t=e.sourcetype,r=e.source,n={type:t},i;return t==="geojson"?i="data":t==="vector"?i=typeof r=="string"?"url":"tiles":t==="raster"?(i="tiles",n.tileSize=256):t==="image"&&(i="url",n.coordinates=e.coordinates),n[i]=r,e.sourceattribution&&(n.attribution=jXt(e.sourceattribution)),n}bje.exports=function(t,r,n){var i=new _je(t,r);return i.update(n),i}});var Lje=ye((Jbr,Cje)=>{"use strict";var BJ=mje(),NJ=Pr(),Sje=dx(),Tje=Oa(),ZXt=ho(),YXt=yv(),m7=ef(),Mje=Cg(),KXt=Mje.drawMode,JXt=Mje.selectMode,$Xt=qf().prepSelect,QXt=qf().clearOutline,eZt=qf().clearSelectionsCache,tZt=qf().selectOnClick,mw=Ix(),rZt=wje();function Eje(e,t){this.id=t,this.gd=e;var r=e._fullLayout,n=e._context;this.container=r._glcontainer.node(),this.isStatic=n.staticPlot,this.uid=r._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(r),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var Hh=Eje.prototype;Hh.plot=function(e,t,r){var n=this,i;n.map?i=new Promise(function(a,o){n.updateMap(e,t,a,o)}):i=new Promise(function(a,o){n.createMap(e,t,a,o)}),r.push(i)};Hh.createMap=function(e,t,r,n){var i=this,a=t[i.id],o=i.styleObj=kje(a.style),s=a.bounds,l=s?[[s.west,s.south],[s.east,s.north]]:null,u=i.map=new BJ.Map({container:i.div,style:o.style,center:UJ(a.center),zoom:a.zoom,bearing:a.bearing,pitch:a.pitch,maxBounds:l,interactive:!i.isStatic,preserveDrawingBuffer:i.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new BJ.AttributionControl({compact:!0})),c={};u.on("styleimagemissing",function(h){var d=h.id;if(!c[d]&&d.includes("-15")){c[d]=!0;var v=new Image(15,15);v.onload=function(){u.addImage(d,v)},v.crossOrigin="Anonymous",v.src="https://unpkg.com/maki@2.1.0/icons/"+d+".svg"}}),u.setTransformRequest(function(h){return h=h.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),h=h.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),h=h.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:h}}),u._canvas.style.left="0px",u._canvas.style.top="0px",i.rejectOnError(n),i.isStatic||i.initFx(e,t);var f=[];f.push(new Promise(function(h){u.once("load",h)})),f=f.concat(Sje.fetchTraceGeoData(e)),Promise.all(f).then(function(){i.fillBelowLookup(e,t),i.updateData(e),i.updateLayout(t),i.resolveOnRender(r)}).catch(n)};Hh.updateMap=function(e,t,r,n){var i=this,a=i.map,o=t[this.id];i.rejectOnError(n);var s=[],l=kje(o.style);JSON.stringify(i.styleObj)!==JSON.stringify(l)&&(i.styleObj=l,a.setStyle(l.style),i.traceHash={},s.push(new Promise(function(u){a.once("styledata",u)}))),s=s.concat(Sje.fetchTraceGeoData(e)),Promise.all(s).then(function(){i.fillBelowLookup(e,t),i.updateData(e),i.updateLayout(t),i.resolveOnRender(r)}).catch(n)};Hh.fillBelowLookup=function(e,t){var r=t[this.id],n=r.layers,i,a,o=this.belowLookup={},s=!1;for(i=0;i<e.length;i++){var l=e[i][0].trace,u=l._module;typeof l.below=="string"?a=l.below:u.getBelow&&(a=u.getBelow(l,this)),a===""&&(s=!0),o["trace-"+l.uid]=a||""}for(i=0;i<n.length;i++){var c=n[i];typeof c.below=="string"?a=c.below:s?a="traces":a="",o["layout-"+i]=a}var f={},h,d;for(h in o)a=o[h],f[a]?f[a].push(h):f[a]=[h];for(a in f){var v=f[a];if(v.length>1)for(i=0;i<v.length;i++)h=v[i],h.indexOf("trace-")===0?(d=h.split("trace-")[1],this.traceHash[d]&&(this.traceHash[d].below=null)):h.indexOf("layout-")===0&&(d=h.split("layout-")[1],this.layerList[d]&&(this.layerList[d].below=null))}};var Aje={choroplethmap:0,densitymap:1,scattermap:2};Hh.updateData=function(e){var t=this.traceHash,r,n,i,a,o=e.slice().sort(function(f,h){return Aje[f[0].trace.type]-Aje[h[0].trace.type]});for(i=0;i<o.length;i++){var s=o[i];n=s[0].trace,r=t[n.uid];var l=!1;r&&(r.type===n.type?(r.update(s),l=!0):r.dispose()),!l&&n._module&&(t[n.uid]=n._module.plot(this,s))}var u=Object.keys(t);e:for(i=0;i<u.length;i++){var c=u[i];for(a=0;a<e.length;a++)if(n=e[a][0].trace,c===n.uid)continue e;r=t[c],r.dispose(),delete t[c]}};Hh.updateLayout=function(e){var t=this.map,r=e[this.id];!this.dragging&&!this.wheeling&&(t.setCenter(UJ(r.center)),t.setZoom(r.zoom),t.setBearing(r.bearing),t.setPitch(r.pitch)),this.updateLayers(e),this.updateFramework(e),this.updateFx(e),this.map.resize(),this.gd._context._scrollZoom.map?t.scrollZoom.enable():t.scrollZoom.disable()};Hh.resolveOnRender=function(e){var t=this.map;t.on("render",function r(){t.loaded()&&(t.off("render",r),setTimeout(e,10))})};Hh.rejectOnError=function(e){var t=this.map;function r(){e(new Error(mw.mapOnErrorMsg))}t.once("error",r),t.once("style.error",r),t.once("source.error",r),t.once("tile.error",r),t.once("layer.error",r)};Hh.createFramework=function(e){var t=this,r=t.div=document.createElement("div");r.id=t.uid,r.style.position="absolute",t.container.appendChild(r),t.xaxis={_id:"x",c2p:function(n){return t.project(n).x}},t.yaxis={_id:"y",c2p:function(n){return t.project(n).y}},t.updateFramework(e),t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},ZXt.setConvert(t.mockAxis,e)};Hh.initFx=function(e,t){var r=this,n=r.gd,i=r.map;i.on("moveend",function(s){if(r.map){var l=n._fullLayout;if(s.originalEvent||r.wheeling){var u=l[r.id];Tje.call("_storeDirectGUIEdit",n.layout,l._preGUI,r.getViewEdits(u));var c=r.getView();u._input.center=u.center=c.center,u._input.zoom=u.zoom=c.zoom,u._input.bearing=u.bearing=c.bearing,u._input.pitch=u.pitch=c.pitch,n.emit("plotly_relayout",r.getViewEditsWithDerived(c))}s.originalEvent&&s.originalEvent.type==="mouseup"?r.dragging=!1:r.wheeling&&(r.wheeling=!1),l&&l._rehover&&l._rehover()}}),i.on("wheel",function(){r.wheeling=!0}),i.on("mousemove",function(s){var l=r.div.getBoundingClientRect(),u=[s.originalEvent.offsetX,s.originalEvent.offsetY];s.target.getBoundingClientRect=function(){return l},r.xaxis.p2c=function(){return i.unproject(u).lng},r.yaxis.p2c=function(){return i.unproject(u).lat},n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===r.id&&n._fullLayout[r.id]&&m7.hover(n,s,r.id)},m7.hover(n,s,r.id),n._fullLayout._hoversubplot=r.id});function a(){m7.loneUnhover(t._hoverlayer)}i.on("dragstart",function(){r.dragging=!0,a()}),i.on("zoomstart",a),i.on("mouseout",function(){n._fullLayout._hoversubplot=null});function o(){var s=r.getView();n.emit("plotly_relayouting",r.getViewEditsWithDerived(s))}i.on("drag",o),i.on("zoom",o),i.on("dblclick",function(){var s=n._fullLayout[r.id];Tje.call("_storeDirectGUIEdit",n.layout,n._fullLayout._preGUI,r.getViewEdits(s));var l=r.viewInitial;i.setCenter(UJ(l.center)),i.setZoom(l.zoom),i.setBearing(l.bearing),i.setPitch(l.pitch);var u=r.getView();s._input.center=s.center=u.center,s._input.zoom=s.zoom=u.zoom,s._input.bearing=s.bearing=u.bearing,s._input.pitch=s.pitch=u.pitch,n.emit("plotly_doubleclick",null),n.emit("plotly_relayout",r.getViewEditsWithDerived(u))}),r.clearOutline=function(){eZt(r.dragOptions),QXt(r.dragOptions.gd)},r.onClickInPanFn=function(s){return function(l){var u=n._fullLayout.clickmode;u.indexOf("select")>-1&&tZt(l.originalEvent,n,[r.xaxis],[r.yaxis],r.id,s),u.indexOf("event")>-1&&m7.click(n,l.originalEvent)}}};Hh.updateFx=function(e){var t=this,r=t.map,n=t.gd;if(t.isStatic)return;function i(l){var u=t.map.unproject(l);return[u.lng,u.lat]}var a=e.dragmode,o;o=function(l,u){if(u.isRect){var c=l.range={};c[t.id]=[i([u.xmin,u.ymin]),i([u.xmax,u.ymax])]}else{var f=l.lassoPoints={};f[t.id]=u.map(i)}};var s=t.dragOptions;t.dragOptions=NJ.extendDeep(s||{},{dragmode:e.dragmode,element:t.div,gd:n,plotinfo:{id:t.id,domain:e[t.id].domain,xaxis:t.xaxis,yaxis:t.yaxis,fillRangeItems:o},xaxes:[t.xaxis],yaxes:[t.yaxis],subplot:t.id}),r.off("click",t.onClickInPanHandler),JXt(a)||KXt(a)?(r.dragPan.disable(),r.on("zoomstart",t.clearOutline),t.dragOptions.prepFn=function(l,u,c){$Xt(l,u,c,t.dragOptions,a)},YXt.init(t.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",t.clearOutline),t.div.onmousedown=null,t.div.ontouchstart=null,t.div.removeEventListener("touchstart",t.div._ontouchstart),t.onClickInPanHandler=t.onClickInPanFn(t.dragOptions),r.on("click",t.onClickInPanHandler))};Hh.updateFramework=function(e){var t=e[this.id].domain,r=e._size,n=this.div.style;n.width=r.w*(t.x[1]-t.x[0])+"px",n.height=r.h*(t.y[1]-t.y[0])+"px",n.left=r.l+t.x[0]*r.w+"px",n.top=r.t+(1-t.y[1])*r.h+"px",this.xaxis._offset=r.l+t.x[0]*r.w,this.xaxis._length=r.w*(t.x[1]-t.x[0]),this.yaxis._offset=r.t+(1-t.y[1])*r.h,this.yaxis._length=r.h*(t.y[1]-t.y[0])};Hh.updateLayers=function(e){var t=e[this.id],r=t.layers,n=this.layerList,i;if(r.length!==n.length){for(i=0;i<n.length;i++)n[i].dispose();for(n=this.layerList=[],i=0;i<r.length;i++)n.push(rZt(this,i,r[i]))}else for(i=0;i<r.length;i++)n[i].update(r[i])};Hh.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))};Hh.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()};Hh.setOptions=function(e,t,r){for(var n in r)this.map[t](e,n,r[n])};Hh.getMapLayers=function(){return this.map.getStyle().layers};Hh.addLayer=function(e,t){var r=this.map;if(typeof t=="string"){if(t===""){r.addLayer(e,t);return}for(var n=this.getMapLayers(),i=0;i<n.length;i++)if(t===n[i].id){r.addLayer(e,t);return}NJ.warn(["Trying to add layer with *below* value",t,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}r.addLayer(e)};Hh.project=function(e){return this.map.project(new BJ.LngLat(e[0],e[1]))};Hh.getView=function(){var e=this.map,t=e.getCenter(),r=t.lng,n=t.lat,i={lon:r,lat:n},a=e.getCanvas(),o=parseInt(a.style.width),s=parseInt(a.style.height);return{center:i,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch(),_derived:{coordinates:[e.unproject([0,0]).toArray(),e.unproject([o,0]).toArray(),e.unproject([o,s]).toArray(),e.unproject([0,s]).toArray()]}}};Hh.getViewEdits=function(e){for(var t=this.id,r=["center","zoom","bearing","pitch"],n={},i=0;i<r.length;i++){var a=r[i];n[t+"."+a]=e[a]}return n};Hh.getViewEditsWithDerived=function(e){var t=this.id,r=this.getViewEdits(e);return r[t+"._derived"]=e._derived,r};function kje(e){var t={};return NJ.isPlainObject(e)?(t.id=e.id,t.style=e):typeof e=="string"?(t.id=e,mw.stylesMap[e]?t.style=mw.stylesMap[e]:t.style=e):(t.id=mw.styleValueDflt,t.style=iZt(mw.styleValueDflt)),t.transition={duration:0,delay:0},t}function iZt(e){return mw.styleUrlPrefix+e+"-"+mw.styleUrlSuffix}function UJ(e){return[e.lon,e.lat]}Cje.exports=Eje});var Rje=ye(($br,Ije)=>{"use strict";var VJ=Pr(),nZt=q_(),aZt=Kd(),Pje=eC();Ije.exports=function(t,r,n){nZt(t,r,n,{type:"map",attributes:Pje,handleDefaults:oZt,partition:"y"})};function oZt(e,t,r){r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch");var n=r("bounds.west"),i=r("bounds.east"),a=r("bounds.south"),o=r("bounds.north");(n===void 0||i===void 0||a===void 0||o===void 0)&&delete t.bounds,aZt(e,t,{name:"layers",handleItemDefaults:sZt}),t._input=e}function sZt(e,t){function r(l,u){return VJ.coerce(e,t,Pje.layers,l,u)}var n=r("visible");if(n){var i=r("sourcetype"),a=i==="raster"||i==="image";r("source"),r("sourceattribution"),i==="vector"&&r("sourcelayer"),i==="image"&&r("coordinates");var o;a&&(o="raster");var s=r("type",o);a&&s!=="raster"&&(s=t.type="raster",VJ.log("Source types *raster* and *image* must drawn *raster* layer type.")),r("below"),r("color"),r("opacity"),r("minzoom"),r("maxzoom"),s==="circle"&&r("circle.radius"),s==="line"&&(r("line.width"),r("line.dash")),s==="fill"&&r("fill.outlinecolor"),s==="symbol"&&(r("symbol.icon"),r("symbol.iconsize"),r("symbol.text"),VJ.coerceFont(r,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),r("symbol.textposition"),r("symbol.placement"))}}});var _7=ye(u0=>{"use strict";var y7=Pr(),Dje=y7.strTranslate,lZt=y7.strScale,uZt=Id().getSubplotCalcData,cZt=Wp(),fZt=qa(),Fje=So(),hZt=Zl(),dZt=Lje(),Rx="map";u0.name=Rx;u0.attr="subplot";u0.idRoot=Rx;u0.idRegex=u0.attrRegex=y7.counterRegex(Rx);u0.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}};u0.layoutAttributes=eC();u0.supplyLayoutDefaults=Rje();u0.plot=function(t){for(var r=t._fullLayout,n=t.calcdata,i=r._subplots[Rx],a=0;a<i.length;a++){var o=i[a],s=uZt(n,Rx,o),l=r[o],u=l._subplot;u||(u=new dZt(t,o),r[o]._subplot=u),u.viewInitial||(u.viewInitial={center:y7.extendFlat({},l.center),zoom:l.zoom,bearing:l.bearing,pitch:l.pitch}),u.plot(s,r,t._promises)}};u0.clean=function(e,t,r,n){for(var i=n._subplots[Rx]||[],a=0;a<i.length;a++){var o=i[a];!t[o]&&n[o]._subplot&&n[o]._subplot.destroy()}};u0.toSVG=function(e){for(var t=e._fullLayout,r=t._subplots[Rx],n=t._size,i=0;i<r.length;i++){var a=t[r[i]],o=a.domain,s=a._subplot,l=s.toImage("png"),u=t._glimages.append("svg:image");u.attr({xmlns:cZt.svg,"xlink:href":l,x:n.l+n.w*o.x[0],y:n.t+n.h*(1-o.y[1]),width:n.w*(o.x[1]-o.x[0]),height:n.h*(o.y[1]-o.y[0]),preserveAspectRatio:"none"});var c=fZt.select(a._subplot.div),f=c.select(".maplibregl-ctrl-attrib").text().replace("Improve this map",""),h=t._glimages.append("g"),d=h.append("text");d.text(f).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":f});var v=Fje.bBox(d.node()),m=n.w*(o.x[1]-o.x[0]);if(v.width>m/2){var b=f.split("|").join("<br>");d.text(b).attr("data-unformatted",b).call(hZt.convertToTspans,e),v=Fje.bBox(d.node())}d.attr("transform",Dje(-3,-v.height+8)),h.insert("rect",".static-attribution").attr({x:-v.width-6,y:-v.height-3,width:v.width+6,height:v.height+3,fill:"rgba(255, 255, 255, 0.75)"});var p=1;v.width+6>m&&(p=m/(v.width+6));var k=[n.l+n.w*o.x[1],n.t+n.h*(1-o.y[0])];h.attr("transform",Dje(k[0],k[1])+lZt(p))}};u0.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots[Rx],n=0;n<r.length;n++){var i=t[r[n]]._subplot;i.updateFx(t)}}});var qje=ye((e2r,zje)=>{"use strict";zje.exports={attributes:c7(),supplyDefaults:YHe(),colorbar:Qd(),formatLabels:IJ(),calc:bF(),plot:uje(),hoverPoints:p7().hoverPoints,eventData:dje(),selectPoints:pje(),styleOnSelect:function(e,t){if(t){var r=t[0].trace;r._glTrace.update(t)}},moduleType:"trace",name:"scattermap",basePlotModule:_7(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}});var Bje=ye((t2r,Oje)=>{"use strict";Oje.exports=qje()});var GJ=ye((r2r,Nje)=>{"use strict";var x1=o5(),vZt=Tu(),{hovertemplateAttrs:pZt,templatefallbackAttrs:gZt}=Ll(),mZt=Gl(),Dx=Ao().extendFlat;Nje.exports=Dx({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:Dx({},x1.featureidkey,{}),below:{valType:"string",editType:"plot"},text:x1.text,hovertext:x1.hovertext,marker:{line:{color:Dx({},x1.marker.line.color,{editType:"plot"}),width:Dx({},x1.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:Dx({},x1.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:Dx({},x1.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:Dx({},x1.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:x1.hoverinfo,hovertemplate:pZt({},{keys:["properties"]}),hovertemplatefallback:gZt(),showlegend:Dx({},mZt.showlegend,{dflt:!1})},vZt("",{cLetter:"z",editTypeOverride:"calc"}))});var Vje=ye((i2r,Uje)=>{"use strict";var nC=Pr(),yZt=td(),_Zt=GJ();Uje.exports=function(t,r,n,i){function a(c,f){return nC.coerce(t,r,_Zt,c,f)}var o=a("locations"),s=a("z"),l=a("geojson");if(!nC.isArrayOrTypedArray(o)||!o.length||!nC.isArrayOrTypedArray(s)||!s.length||!(typeof l=="string"&&l!==""||nC.isPlainObject(l))){r.visible=!1;return}a("featureidkey"),r._length=Math.min(o.length,s.length),a("below"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback");var u=a("marker.line.width");u&&a("marker.line.color"),a("marker.opacity"),yZt(t,r,i,a,{prefix:"",cLetter:"z"}),nC.coerceSelectionMarkerOpacity(r,a)}});var HJ=ye((n2r,jje)=>{"use strict";var xZt=Eo(),b1=Pr(),bZt=tc(),wZt=So(),TZt=fx().makeBlank,Gje=dx();function AZt(e){var t=e[0].trace,r=t.visible===!0&&t._length!==0,n={layout:{visibility:"none"},paint:{}},i={layout:{visibility:"none"},paint:{}},a=t._opts={fill:n,line:i,geojson:TZt()};if(!r)return a;var o=Gje.extractTraceFeature(e);if(!o)return a;var s=bZt.makeColorScaleFuncFromTrace(t),l=t.marker,u=l.line||{},c;b1.isArrayOrTypedArray(l.opacity)&&(c=function(k){var M=k.mo;return xZt(M)?+b1.constrain(M,0,1):0});var f;b1.isArrayOrTypedArray(u.color)&&(f=function(k){return k.mlc});var h;b1.isArrayOrTypedArray(u.width)&&(h=function(k){return k.mlw});for(var d=0;d<e.length;d++){var v=e[d],m=v.fOut;if(m){var b=m.properties;b.fc=s(v.z),c&&(b.mo=c(v)),f&&(b.mlc=f(v)),h&&(b.mlw=h(v)),v.ct=b.ct,v._polygons=Gje.feature2polygons(m)}}var p=c?{type:"identity",property:"mo"}:l.opacity;return b1.extendFlat(n.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":p}),b1.extendFlat(i.paint,{"line-color":f?{type:"identity",property:"mlc"}:u.color,"line-width":h?{type:"identity",property:"mlw"}:u.width,"line-opacity":p}),n.layout.visibility="visible",i.layout.visibility="visible",a.geojson={type:"FeatureCollection",features:o},Hje(e),a}function Hje(e){var t=e[0].trace,r=t._opts,n;if(t.selectedpoints){for(var i=wZt.makeSelectedPointStyleFns(t),a=0;a<e.length;a++){var o=e[a];o.fOut&&(o.fOut.properties.mo2=i.selectedOpacityFn(o))}n={type:"identity",property:"mo2"}}else n=b1.isArrayOrTypedArray(t.marker.opacity)?{type:"identity",property:"mo"}:t.marker.opacity;return b1.extendFlat(r.fill.paint,{"fill-opacity":n}),b1.extendFlat(r.line.paint,{"line-opacity":n}),r}jje.exports={convert:AZt,convertOnSelect:Hje}});var Kje=ye((a2r,Yje)=>{"use strict";var Xje=HJ().convert,SZt=HJ().convertOnSelect,Wje=Ix().traceLayerPrefix;function Zje(e,t){this.type="choroplethmap",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["fill",Wje+t+"-fill"],["line",Wje+t+"-line"]],this.below=null}var F5=Zje.prototype;F5.update=function(e){this._update(Xje(e)),e[0].trace._glTrace=this};F5.updateOnSelect=function(e){this._update(SZt(e))};F5._update=function(e){var t=this.subplot,r=this.layerList,n=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(e.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(e,n),this.below=n);for(var i=0;i<r.length;i++){var a=r[i],o=a[0],s=a[1],l=e[o];t.setOptions(s,"setLayoutProperty",l.layout),l.layout.visibility==="visible"&&t.setOptions(s,"setPaintProperty",l.paint)}};F5._addLayers=function(e,t){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=e[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},t)}};F5._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=0;r--)e.removeLayer(t[r][1])};F5.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)};Yje.exports=function(t,r){var n=r[0].trace,i=new Zje(t,n.uid),a=i.sourceId,o=Xje(r),s=i.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(a,{type:"geojson",data:o.geojson}),i._addLayers(o,s),r[0].trace._glTrace=i,i}});var $je=ye((o2r,Jje)=>{"use strict";Jje.exports={attributes:GJ(),supplyDefaults:Vje(),colorbar:D_(),calc:VF(),plot:Kje(),hoverPoints:HF(),eventData:jF(),selectPoints:WF(),styleOnSelect:function(e,t){if(t){var r=t[0].trace;r._glTrace.updateOnSelect(t)}},getBelow:function(e,t){for(var r=t.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if(typeof i=="string"&&i.indexOf("water")===0){for(var a=n+1;a<r.length;a++)if(i=r[a].id,typeof i=="string"&&i.indexOf("plotly-")===-1)return i}}},moduleType:"trace",name:"choroplethmap",basePlotModule:_7(),categories:["map","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_map"}}});var eWe=ye((s2r,Qje)=>{"use strict";Qje.exports=$je()});var WJ=ye((l2r,rWe)=>{"use strict";var MZt=Tu(),{hovertemplateAttrs:EZt,templatefallbackAttrs:kZt}=Ll(),tWe=Gl(),x7=c7(),jJ=Ao().extendFlat;rWe.exports=jJ({lon:x7.lon,lat:x7.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:x7.text,hovertext:x7.hovertext,hoverinfo:jJ({},tWe.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:EZt(),hovertemplatefallback:kZt(),showlegend:jJ({},tWe.showlegend,{dflt:!1})},MZt("",{cLetter:"z",editTypeOverride:"calc"}))});var nWe=ye((u2r,iWe)=>{"use strict";var CZt=Pr(),LZt=td(),PZt=WJ();iWe.exports=function(t,r,n,i){function a(u,c){return CZt.coerce(t,r,PZt,u,c)}var o=a("lon")||[],s=a("lat")||[],l=Math.min(o.length,s.length);if(!l){r.visible=!1;return}r._length=l,a("z"),a("radius"),a("below"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),LZt(t,r,i,a,{prefix:"",cLetter:"z"})}});var sWe=ye((c2r,oWe)=>{"use strict";var XJ=Eo(),IZt=Pr().isArrayOrTypedArray,ZJ=fs().BADNUM,RZt=gv(),aWe=Pr()._;oWe.exports=function(t,r){for(var n=r._length,i=new Array(n),a=r.z,o=IZt(a)&&a.length,s=0;s<n;s++){var l=i[s]={},u=r.lon[s],c=r.lat[s];if(l.lonlat=XJ(u)&&XJ(c)?[+u,+c]:[ZJ,ZJ],o){var f=a[s];l.z=XJ(f)?f:ZJ}}return RZt(t,r,{vals:o?a:[0,1],containerStr:"",cLetter:"z"}),n&&(i[0].t={labels:{lat:aWe(t,"lat:")+" ",lon:aWe(t,"lon:")+" "}}),i}});var hWe=ye((f2r,fWe)=>{"use strict";var DZt=Eo(),YJ=Pr(),lWe=ka(),uWe=tc(),cWe=fs().BADNUM,FZt=fx().makeBlank;fWe.exports=function(t){var r=t[0].trace,n=r.visible===!0&&r._length!==0,i={layout:{visibility:"none"},paint:{}},a=r._opts={heatmap:i,geojson:FZt()};if(!n)return a;var o=[],s,l=r.z,u=r.radius,c=YJ.isArrayOrTypedArray(l)&&l.length,f=YJ.isArrayOrTypedArray(u);for(s=0;s<t.length;s++){var h=t[s],d=h.lonlat;if(d[0]!==cWe){var v={};if(c){var m=h.z;v.z=m!==cWe?m:0}f&&(v.r=DZt(u[s])&&u[s]>0?+u[s]:0),o.push({type:"Feature",geometry:{type:"Point",coordinates:d},properties:v})}}var b=uWe.extractOpts(r),p=b.reversescale?uWe.flipScale(b.colorscale):b.colorscale,k=p[0][1],M=lWe.opacity(k)<1?k:lWe.addOpacity(k,0),T=["interpolate",["linear"],["heatmap-density"],0,M];for(s=1;s<p.length;s++)T.push(p[s][0],p[s][1]);var L=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return YJ.extendFlat(a.heatmap.paint,{"heatmap-weight":c?L:1/(b.max-b.min),"heatmap-color":T,"heatmap-radius":f?{type:"identity",property:"r"}:r.radius,"heatmap-opacity":r.opacity}),a.geojson={type:"FeatureCollection",features:o},a.heatmap.layout.visibility="visible",a}});var gWe=ye((h2r,pWe)=>{"use strict";var dWe=hWe(),zZt=Ix().traceLayerPrefix;function vWe(e,t){this.type="densitymap",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["heatmap",zZt+t+"-heatmap"]],this.below=null}var b7=vWe.prototype;b7.update=function(e){var t=this.subplot,r=this.layerList,n=dWe(e),i=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(n.geojson),i!==this.below&&(this._removeLayers(),this._addLayers(n,i),this.below=i);for(var a=0;a<r.length;a++){var o=r[a],s=o[0],l=o[1],u=n[s];t.setOptions(l,"setLayoutProperty",u.layout),u.layout.visibility==="visible"&&t.setOptions(l,"setPaintProperty",u.paint)}};b7._addLayers=function(e,t){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=e[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},t)}};b7._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=0;r--)e.removeLayer(t[r][1])};b7.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)};pWe.exports=function(t,r){var n=r[0].trace,i=new vWe(t,n.uid),a=i.sourceId,o=dWe(r),s=i.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(a,{type:"geojson",data:o.geojson}),i._addLayers(o,s),i}});var yWe=ye((d2r,mWe)=>{"use strict";var qZt=ho(),OZt=p7().hoverPoints,BZt=p7().getExtraText;mWe.exports=function(t,r,n){var i=OZt(t,r,n);if(i){var a=i[0],o=a.cd,s=o[0].trace,l=o[a.index];if(delete a.color,"z"in l){var u=a.subplot.mockAxis;a.z=l.z,a.zLabel=qZt.tickText(u,u.c2l(l.z),"hover").text}return a.extraText=BZt(s,l,o[0].t.labels),[a]}}});var xWe=ye((v2r,_We)=>{"use strict";_We.exports=function(t,r){return t.lon=r.lon,t.lat=r.lat,t.z=r.z,t}});var wWe=ye((p2r,bWe)=>{"use strict";bWe.exports={attributes:WJ(),supplyDefaults:nWe(),colorbar:D_(),formatLabels:IJ(),calc:sWe(),plot:gWe(),hoverPoints:yWe(),eventData:xWe(),getBelow:function(e,t){for(var r=t.getMapLayers(),n=0;n<r.length;n++){var i=r[n],a=i.id;if(i.type==="symbol"&&typeof a=="string"&&a.indexOf("plotly-")===-1)return a}},moduleType:"trace",name:"densitymap",basePlotModule:_7(),categories:["map","gl","showLegend"],meta:{hr_name:"density_map"}}});var AWe=ye((g2r,TWe)=>{"use strict";TWe.exports=wWe()});var JJ=ye((y2r,CWe)=>{"use strict";var NZt=ec(),UZt=Gl(),SWe=Ih(),KJ=g3(),VZt=Cc().attributes,{hovertemplateAttrs:MWe,templatefallbackAttrs:EWe}=Ll(),GZt=Tu(),HZt=vl().templatedArray,jZt=vf().descriptionOnlyNumbers,kWe=Ao().extendFlat,WZt=mc().overrideAll,m2r=CWe.exports=WZt({hoverinfo:kWe({},UZt.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:KJ.hoverlabel,domain:VZt({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:jZt("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:NZt({autoShadowDflt:!0}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:SWe.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:KJ.hoverlabel,hovertemplate:MWe({},{keys:["value","label"]}),hovertemplatefallback:EWe(),align:{valType:"enumerated",values:["justify","left","right","center"],dflt:"justify"}},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},hovercolor:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:SWe.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:KJ.hoverlabel,hovertemplate:MWe({},{keys:["value","label"]}),hovertemplatefallback:EWe(),colorscales:HZt("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:kWe(GZt().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")});var DWe=ye((_2r,RWe)=>{"use strict";var z5=Pr(),w7=JJ(),XZt=ka(),LWe=fd(),ZZt=Cc().defaults,PWe=xM(),IWe=vl(),YZt=Kd();RWe.exports=function(t,r,n,i){function a(T,L){return z5.coerce(t,r,w7,T,L)}var o=z5.extendDeep(i.hoverlabel,t.hoverlabel),s=t.node,l=IWe.newContainer(r,"node");function u(T,L){return z5.coerce(s,l,w7.node,T,L)}u("label"),u("groups"),u("x"),u("y"),u("pad"),u("thickness"),u("line.color"),u("line.width"),u("hoverinfo",t.hoverinfo),PWe(s,l,u,o),u("hovertemplate"),u("align");var c=i.colorway,f=function(T){return c[T%c.length]};u("color",l.label.map(function(T,L){return XZt.addOpacity(f(L),.8)})),u("customdata");var h=t.link||{},d=IWe.newContainer(r,"link");function v(T,L){return z5.coerce(h,d,w7.link,T,L)}v("label"),v("arrowlen"),v("source"),v("target"),v("value"),v("line.color"),v("line.width"),v("hoverinfo",t.hoverinfo),PWe(h,d,v,o),v("hovertemplate");var m=LWe(i.paper_bgcolor).getLuminance()<.333,b=m?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)",p=v("color",b);function k(T){var L=LWe(T);if(!L.isValid())return T;var x=L.getAlpha();return x<=.8?L.setAlpha(x+.2):L=m?L.brighten():L.darken(),L.toRgbString()}v("hovercolor",Array.isArray(p)?p.map(k):k(p)),v("customdata"),YZt(h,d,{name:"colorscales",handleItemDefaults:KZt}),ZZt(r,i,a),a("orientation"),a("valueformat"),a("valuesuffix");var M;l.x.length&&l.y.length&&(M="freeform"),a("arrangement",M),z5.coerceFont(a,"textfont",i.font,{autoShadowDflt:!0}),r._length=null};function KZt(e,t){function r(n,i){return z5.coerce(e,t,w7.link.colorscales,n,i)}r("label"),r("cmin"),r("cmax"),r("colorscale")}});var $J=ye((x2r,FWe)=>{"use strict";FWe.exports=JZt;function JZt(e){for(var t=e.length,r=new Array(t),n=new Array(t),i=new Array(t),a=new Array(t),o=new Array(t),s=new Array(t),l=0;l<t;++l)r[l]=-1,n[l]=0,i[l]=!1,a[l]=0,o[l]=-1,s[l]=[];var u=0,c=[],f=[];function h(b){var p=[b],k=[b];for(r[b]=n[b]=u,i[b]=!0,u+=1;k.length>0;){b=k[k.length-1];var M=e[b];if(a[b]<M.length){for(var T=a[b];T<M.length;++T){var L=M[T];if(r[L]<0){r[L]=n[L]=u,i[L]=!0,u+=1,p.push(L),k.push(L);break}else i[L]&&(n[b]=Math.min(n[b],n[L])|0);o[L]>=0&&s[b].push(o[L])}a[b]=T}else{if(n[b]===r[b]){for(var x=[],C=[],S=0,T=p.length-1;T>=0;--T){var g=p[T];if(i[g]=!1,x.push(g),C.push(s[g]),S+=s[g].length,o[g]=c.length,g===b){p.length=T;break}}c.push(x);for(var P=new Array(S),T=0;T<C.length;T++)for(var E=0;E<C[T].length;E++)P[--S]=C[T][E];f.push(P)}k.pop()}}}for(var l=0;l<t;++l)r[l]<0&&h(l);for(var d,l=0;l<f.length;l++){var v=f[l];if(v.length!==0){v.sort(function(p,k){return p-k}),d=[v[0]];for(var m=1;m<v.length;m++)v[m]!==v[m-1]&&d.push(v[m]);f[l]=d}}return{components:c,adjacencyList:f}}});var BWe=ye((b2r,OWe)=>{"use strict";var $Zt=$J(),q5=Pr(),QZt=ny().wrap,aC=q5.isArrayOrTypedArray,zWe=q5.isIndex,qWe=tc();function eYt(e){var t=e.node,r=e.link,n=[],i=aC(r.color),a=aC(r.hovercolor),o=aC(r.customdata),s={},l={},u=r.colorscales.length,c;for(c=0;c<u;c++){var f=r.colorscales[c],h=qWe.extractScale(f,{cLetter:"c"}),d=qWe.makeColorScaleFunc(h);l[f.label]=d}var v=0;for(c=0;c<r.value.length;c++)r.source[c]>v&&(v=r.source[c]),r.target[c]>v&&(v=r.target[c]);var m=v+1;e.node._count=m;var b,p=e.node.groups,k={};for(c=0;c<p.length;c++){var M=p[c];for(b=0;b<M.length;b++){var T=M[b],L=m+c;k.hasOwnProperty(T)?q5.warn("Node "+T+" is already part of a group."):k[T]=L}}var x={source:[],target:[]};for(c=0;c<r.value.length;c++){var C=r.value[c],S=r.source[c],g=r.target[c];if(C>0&&zWe(S,m)&&zWe(g,m)&&!(k.hasOwnProperty(S)&&k.hasOwnProperty(g)&&k[S]===k[g])){k.hasOwnProperty(g)&&(g=k[g]),k.hasOwnProperty(S)&&(S=k[S]),S=+S,g=+g,s[S]=s[g]=!0;var P="";r.label&&r.label[c]&&(P=r.label[c]);var E=null;P&&l.hasOwnProperty(P)&&(E=l[P]),n.push({pointNumber:c,label:P,color:i?r.color[c]:r.color,hovercolor:a?r.hovercolor[c]:r.hovercolor,customdata:o?r.customdata[c]:r.customdata,concentrationscale:E,source:S,target:g,value:+C}),x.source.push(S),x.target.push(g)}}var z=m+p.length,q=aC(t.color),V=aC(t.customdata),G=[];for(c=0;c<z;c++)if(s[c]){var Z=t.label[c];G.push({group:c>m-1,childrenNodes:[],pointNumber:c,label:Z,color:q?t.color[c]:t.color,customdata:V?t.customdata[c]:t.customdata})}var j=!1;return tYt(z,x.source,x.target)&&(j=!0),{circular:j,links:n,nodes:G,groups:p,groupLookup:k}}function tYt(e,t,r){for(var n=q5.init2dArray(e,0),i=0;i<Math.min(t.length,r.length);i++)if(q5.isIndex(t[i],e)&&q5.isIndex(r[i],e)){if(t[i]===r[i])return!0;n[t[i]].push(r[i])}var a=$Zt(n);return a.components.some(function(o){return o.length>1})}OWe.exports=function(t,r){var n=eYt(r);return QZt({circular:n.circular,_nodes:n.nodes,_links:n.links,_groups:n.groups,_groupLookup:n.groupLookup})}});var UWe=ye((T7,NWe)=>{(function(e,t){typeof T7=="object"&&typeof NWe!="undefined"?t(T7):(e=e||self,t(e.d3=e.d3||{}))})(T7,function(e){"use strict";function t(C){var S=+this._x.call(null,C),g=+this._y.call(null,C);return r(this.cover(S,g),S,g,C)}function r(C,S,g,P){if(isNaN(S)||isNaN(g))return C;var E,z=C._root,q={data:P},V=C._x0,G=C._y0,Z=C._x1,j=C._y1,N,H,ie,ae,_e,Ee,Ce,ge;if(!z)return C._root=q,C;for(;z.length;)if((_e=S>=(N=(V+Z)/2))?V=N:Z=N,(Ee=g>=(H=(G+j)/2))?G=H:j=H,E=z,!(z=z[Ce=Ee<<1|_e]))return E[Ce]=q,C;if(ie=+C._x.call(null,z.data),ae=+C._y.call(null,z.data),S===ie&&g===ae)return q.next=z,E?E[Ce]=q:C._root=q,C;do E=E?E[Ce]=new Array(4):C._root=new Array(4),(_e=S>=(N=(V+Z)/2))?V=N:Z=N,(Ee=g>=(H=(G+j)/2))?G=H:j=H;while((Ce=Ee<<1|_e)===(ge=(ae>=H)<<1|ie>=N));return E[ge]=z,E[Ce]=q,C}function n(C){var S,g,P=C.length,E,z,q=new Array(P),V=new Array(P),G=1/0,Z=1/0,j=-1/0,N=-1/0;for(g=0;g<P;++g)isNaN(E=+this._x.call(null,S=C[g]))||isNaN(z=+this._y.call(null,S))||(q[g]=E,V[g]=z,E<G&&(G=E),E>j&&(j=E),z<Z&&(Z=z),z>N&&(N=z));if(G>j||Z>N)return this;for(this.cover(G,Z).cover(j,N),g=0;g<P;++g)r(this,q[g],V[g],C[g]);return this}function i(C,S){if(isNaN(C=+C)||isNaN(S=+S))return this;var g=this._x0,P=this._y0,E=this._x1,z=this._y1;if(isNaN(g))E=(g=Math.floor(C))+1,z=(P=Math.floor(S))+1;else{for(var q=E-g,V=this._root,G,Z;g>C||C>=E||P>S||S>=z;)switch(Z=(S<P)<<1|C<g,G=new Array(4),G[Z]=V,V=G,q*=2,Z){case 0:E=g+q,z=P+q;break;case 1:g=E-q,z=P+q;break;case 2:E=g+q,P=z-q;break;case 3:g=E-q,P=z-q;break}this._root&&this._root.length&&(this._root=V)}return this._x0=g,this._y0=P,this._x1=E,this._y1=z,this}function a(){var C=[];return this.visit(function(S){if(!S.length)do C.push(S.data);while(S=S.next)}),C}function o(C){return arguments.length?this.cover(+C[0][0],+C[0][1]).cover(+C[1][0],+C[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function s(C,S,g,P,E){this.node=C,this.x0=S,this.y0=g,this.x1=P,this.y1=E}function l(C,S,g){var P,E=this._x0,z=this._y0,q,V,G,Z,j=this._x1,N=this._y1,H=[],ie=this._root,ae,_e;for(ie&&H.push(new s(ie,E,z,j,N)),g==null?g=1/0:(E=C-g,z=S-g,j=C+g,N=S+g,g*=g);ae=H.pop();)if(!(!(ie=ae.node)||(q=ae.x0)>j||(V=ae.y0)>N||(G=ae.x1)<E||(Z=ae.y1)<z))if(ie.length){var Ee=(q+G)/2,Ce=(V+Z)/2;H.push(new s(ie[3],Ee,Ce,G,Z),new s(ie[2],q,Ce,Ee,Z),new s(ie[1],Ee,V,G,Ce),new s(ie[0],q,V,Ee,Ce)),(_e=(S>=Ce)<<1|C>=Ee)&&(ae=H[H.length-1],H[H.length-1]=H[H.length-1-_e],H[H.length-1-_e]=ae)}else{var ge=C-+this._x.call(null,ie.data),re=S-+this._y.call(null,ie.data),Se=ge*ge+re*re;if(Se<g){var ke=Math.sqrt(g=Se);E=C-ke,z=S-ke,j=C+ke,N=S+ke,P=ie.data}}return P}function u(C){if(isNaN(j=+this._x.call(null,C))||isNaN(N=+this._y.call(null,C)))return this;var S,g=this._root,P,E,z,q=this._x0,V=this._y0,G=this._x1,Z=this._y1,j,N,H,ie,ae,_e,Ee,Ce;if(!g)return this;if(g.length)for(;;){if((ae=j>=(H=(q+G)/2))?q=H:G=H,(_e=N>=(ie=(V+Z)/2))?V=ie:Z=ie,S=g,!(g=g[Ee=_e<<1|ae]))return this;if(!g.length)break;(S[Ee+1&3]||S[Ee+2&3]||S[Ee+3&3])&&(P=S,Ce=Ee)}for(;g.data!==C;)if(E=g,!(g=g.next))return this;return(z=g.next)&&delete g.next,E?(z?E.next=z:delete E.next,this):S?(z?S[Ee]=z:delete S[Ee],(g=S[0]||S[1]||S[2]||S[3])&&g===(S[3]||S[2]||S[1]||S[0])&&!g.length&&(P?P[Ce]=g:this._root=g),this):(this._root=z,this)}function c(C){for(var S=0,g=C.length;S<g;++S)this.remove(C[S]);return this}function f(){return this._root}function h(){var C=0;return this.visit(function(S){if(!S.length)do++C;while(S=S.next)}),C}function d(C){var S=[],g,P=this._root,E,z,q,V,G;for(P&&S.push(new s(P,this._x0,this._y0,this._x1,this._y1));g=S.pop();)if(!C(P=g.node,z=g.x0,q=g.y0,V=g.x1,G=g.y1)&&P.length){var Z=(z+V)/2,j=(q+G)/2;(E=P[3])&&S.push(new s(E,Z,j,V,G)),(E=P[2])&&S.push(new s(E,z,j,Z,G)),(E=P[1])&&S.push(new s(E,Z,q,V,j)),(E=P[0])&&S.push(new s(E,z,q,Z,j))}return this}function v(C){var S=[],g=[],P;for(this._root&&S.push(new s(this._root,this._x0,this._y0,this._x1,this._y1));P=S.pop();){var E=P.node;if(E.length){var z,q=P.x0,V=P.y0,G=P.x1,Z=P.y1,j=(q+G)/2,N=(V+Z)/2;(z=E[0])&&S.push(new s(z,q,V,j,N)),(z=E[1])&&S.push(new s(z,j,V,G,N)),(z=E[2])&&S.push(new s(z,q,N,j,Z)),(z=E[3])&&S.push(new s(z,j,N,G,Z))}g.push(P)}for(;P=g.pop();)C(P.node,P.x0,P.y0,P.x1,P.y1);return this}function m(C){return C[0]}function b(C){return arguments.length?(this._x=C,this):this._x}function p(C){return C[1]}function k(C){return arguments.length?(this._y=C,this):this._y}function M(C,S,g){var P=new T(S==null?m:S,g==null?p:g,NaN,NaN,NaN,NaN);return C==null?P:P.addAll(C)}function T(C,S,g,P,E,z){this._x=C,this._y=S,this._x0=g,this._y0=P,this._x1=E,this._y1=z,this._root=void 0}function L(C){for(var S={data:C.data},g=S;C=C.next;)g=g.next={data:C.data};return S}var x=M.prototype=T.prototype;x.copy=function(){var C=new T(this._x,this._y,this._x0,this._y0,this._x1,this._y1),S=this._root,g,P;if(!S)return C;if(!S.length)return C._root=L(S),C;for(g=[{source:S,target:C._root=new Array(4)}];S=g.pop();)for(var E=0;E<4;++E)(P=S.source[E])&&(P.length?g.push({source:P,target:S.target[E]=new Array(4)}):S.target[E]=L(P));return C},x.add=t,x.addAll=n,x.cover=i,x.data=a,x.extent=o,x.find=l,x.remove=u,x.removeAll=c,x.root=f,x.size=h,x.visit=d,x.visitAfter=v,x.x=b,x.y=k,e.quadtree=M,Object.defineProperty(e,"__esModule",{value:!0})})});var S7=ye((A7,VWe)=>{(function(e,t){t(typeof A7=="object"&&typeof VWe!="undefined"?A7:e.d3=e.d3||{})})(A7,function(e){"use strict";var t="$";function r(){}r.prototype=n.prototype={constructor:r,has:function(m){return t+m in this},get:function(m){return this[t+m]},set:function(m,b){return this[t+m]=b,this},remove:function(m){var b=t+m;return b in this&&delete this[b]},clear:function(){for(var m in this)m[0]===t&&delete this[m]},keys:function(){var m=[];for(var b in this)b[0]===t&&m.push(b.slice(1));return m},values:function(){var m=[];for(var b in this)b[0]===t&&m.push(this[b]);return m},entries:function(){var m=[];for(var b in this)b[0]===t&&m.push({key:b.slice(1),value:this[b]});return m},size:function(){var m=0;for(var b in this)b[0]===t&&++m;return m},empty:function(){for(var m in this)if(m[0]===t)return!1;return!0},each:function(m){for(var b in this)b[0]===t&&m(this[b],b.slice(1),this)}};function n(m,b){var p=new r;if(m instanceof r)m.each(function(x,C){p.set(C,x)});else if(Array.isArray(m)){var k=-1,M=m.length,T;if(b==null)for(;++k<M;)p.set(k,m[k]);else for(;++k<M;)p.set(b(T=m[k],k,m),T)}else if(m)for(var L in m)p.set(L,m[L]);return p}function i(){var m=[],b=[],p,k,M;function T(x,C,S,g){if(C>=m.length)return p!=null&&x.sort(p),k!=null?k(x):x;for(var P=-1,E=x.length,z=m[C++],q,V,G=n(),Z,j=S();++P<E;)(Z=G.get(q=z(V=x[P])+""))?Z.push(V):G.set(q,[V]);return G.each(function(N,H){g(j,H,T(N,C,S,g))}),j}function L(x,C){if(++C>m.length)return x;var S,g=b[C-1];return k!=null&&C>=m.length?S=x.entries():(S=[],x.each(function(P,E){S.push({key:E,values:L(P,C)})})),g!=null?S.sort(function(P,E){return g(P.key,E.key)}):S}return M={object:function(x){return T(x,0,a,o)},map:function(x){return T(x,0,s,l)},entries:function(x){return L(T(x,0,s,l),0)},key:function(x){return m.push(x),M},sortKeys:function(x){return b[m.length-1]=x,M},sortValues:function(x){return p=x,M},rollup:function(x){return k=x,M}}}function a(){return{}}function o(m,b,p){m[b]=p}function s(){return n()}function l(m,b,p){m.set(b,p)}function u(){}var c=n.prototype;u.prototype=f.prototype={constructor:u,has:c.has,add:function(m){return m+="",this[t+m]=m,this},remove:c.remove,clear:c.clear,values:c.keys,size:c.size,empty:c.empty,each:c.each};function f(m,b){var p=new u;if(m instanceof u)m.each(function(T){p.add(T)});else if(m){var k=-1,M=m.length;if(b==null)for(;++k<M;)p.add(m[k]);else for(;++k<M;)p.add(b(m[k],k,m))}return p}function h(m){var b=[];for(var p in m)b.push(p);return b}function d(m){var b=[];for(var p in m)b.push(m[p]);return b}function v(m){var b=[];for(var p in m)b.push({key:p,value:m[p]});return b}e.nest=i,e.set=f,e.map=n,e.keys=h,e.values=d,e.entries=v,Object.defineProperty(e,"__esModule",{value:!0})})});var HWe=ye((M7,GWe)=>{(function(e,t){typeof M7=="object"&&typeof GWe!="undefined"?t(M7):(e=e||self,t(e.d3=e.d3||{}))})(M7,function(e){"use strict";var t={value:function(){}};function r(){for(var s=0,l=arguments.length,u={},c;s<l;++s){if(!(c=arguments[s]+"")||c in u||/[\s.]/.test(c))throw new Error("illegal type: "+c);u[c]=[]}return new n(u)}function n(s){this._=s}function i(s,l){return s.trim().split(/^|\s+/).map(function(u){var c="",f=u.indexOf(".");if(f>=0&&(c=u.slice(f+1),u=u.slice(0,f)),u&&!l.hasOwnProperty(u))throw new Error("unknown type: "+u);return{type:u,name:c}})}n.prototype=r.prototype={constructor:n,on:function(s,l){var u=this._,c=i(s+"",u),f,h=-1,d=c.length;if(arguments.length<2){for(;++h<d;)if((f=(s=c[h]).type)&&(f=a(u[f],s.name)))return f;return}if(l!=null&&typeof l!="function")throw new Error("invalid callback: "+l);for(;++h<d;)if(f=(s=c[h]).type)u[f]=o(u[f],s.name,l);else if(l==null)for(f in u)u[f]=o(u[f],s.name,null);return this},copy:function(){var s={},l=this._;for(var u in l)s[u]=l[u].slice();return new n(s)},call:function(s,l){if((f=arguments.length-2)>0)for(var u=new Array(f),c=0,f,h;c<f;++c)u[c]=arguments[c+2];if(!this._.hasOwnProperty(s))throw new Error("unknown type: "+s);for(h=this._[s],c=0,f=h.length;c<f;++c)h[c].value.apply(l,u)},apply:function(s,l,u){if(!this._.hasOwnProperty(s))throw new Error("unknown type: "+s);for(var c=this._[s],f=0,h=c.length;f<h;++f)c[f].value.apply(l,u)}};function a(s,l){for(var u=0,c=s.length,f;u<c;++u)if((f=s[u]).name===l)return f.value}function o(s,l,u){for(var c=0,f=s.length;c<f;++c)if(s[c].name===l){s[c]=t,s=s.slice(0,c).concat(s.slice(c+1));break}return u!=null&&s.push({name:l,value:u}),s}e.dispatch=r,Object.defineProperty(e,"__esModule",{value:!0})})});var WWe=ye((E7,jWe)=>{(function(e,t){typeof E7=="object"&&typeof jWe!="undefined"?t(E7):(e=e||self,t(e.d3=e.d3||{}))})(E7,function(e){"use strict";var t=0,r=0,n=0,i=1e3,a,o,s=0,l=0,u=0,c=typeof performance=="object"&&performance.now?performance:Date,f=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(C){setTimeout(C,17)};function h(){return l||(f(d),l=c.now()+u)}function d(){l=0}function v(){this._call=this._time=this._next=null}v.prototype=m.prototype={constructor:v,restart:function(C,S,g){if(typeof C!="function")throw new TypeError("callback is not a function");g=(g==null?h():+g)+(S==null?0:+S),!this._next&&o!==this&&(o?o._next=this:a=this,o=this),this._call=C,this._time=g,T()},stop:function(){this._call&&(this._call=null,this._time=1/0,T())}};function m(C,S,g){var P=new v;return P.restart(C,S,g),P}function b(){h(),++t;for(var C=a,S;C;)(S=l-C._time)>=0&&C._call.call(null,S),C=C._next;--t}function p(){l=(s=c.now())+u,t=r=0;try{b()}finally{t=0,M(),l=0}}function k(){var C=c.now(),S=C-s;S>i&&(u-=S,s=C)}function M(){for(var C,S=a,g,P=1/0;S;)S._call?(P>S._time&&(P=S._time),C=S,S=S._next):(g=S._next,S._next=null,S=C?C._next=g:a=g);o=C,T(P)}function T(C){if(!t){r&&(r=clearTimeout(r));var S=C-l;S>24?(C<1/0&&(r=setTimeout(p,C-c.now()-u)),n&&(n=clearInterval(n))):(n||(s=c.now(),n=setInterval(k,i)),t=1,f(p))}}function L(C,S,g){var P=new v;return S=S==null?0:+S,P.restart(function(E){P.stop(),C(E+S)},S,g),P}function x(C,S,g){var P=new v,E=S;return S==null?(P.restart(C,S,g),P):(S=+S,g=g==null?h():+g,P.restart(function z(q){q+=E,P.restart(z,E+=S,g),C(q)},S,g),P)}e.interval=x,e.now=h,e.timeout=L,e.timer=m,e.timerFlush=b,Object.defineProperty(e,"__esModule",{value:!0})})});var ZWe=ye((k7,XWe)=>{(function(e,t){typeof k7=="object"&&typeof XWe!="undefined"?t(k7,UWe(),S7(),HWe(),WWe()):t(e.d3=e.d3||{},e.d3,e.d3,e.d3,e.d3)})(k7,function(e,t,r,n,i){"use strict";function a(C,S){var g;C==null&&(C=0),S==null&&(S=0);function P(){var E,z=g.length,q,V=0,G=0;for(E=0;E<z;++E)q=g[E],V+=q.x,G+=q.y;for(V=V/z-C,G=G/z-S,E=0;E<z;++E)q=g[E],q.x-=V,q.y-=G}return P.initialize=function(E){g=E},P.x=function(E){return arguments.length?(C=+E,P):C},P.y=function(E){return arguments.length?(S=+E,P):S},P}function o(C){return function(){return C}}function s(){return(Math.random()-.5)*1e-6}function l(C){return C.x+C.vx}function u(C){return C.y+C.vy}function c(C){var S,g,P=1,E=1;typeof C!="function"&&(C=o(C==null?1:+C));function z(){for(var G,Z=S.length,j,N,H,ie,ae,_e,Ee=0;Ee<E;++Ee)for(j=t.quadtree(S,l,u).visitAfter(q),G=0;G<Z;++G)N=S[G],ae=g[N.index],_e=ae*ae,H=N.x+N.vx,ie=N.y+N.vy,j.visit(Ce);function Ce(ge,re,Se,ke,be){var Be=ge.data,Le=ge.r,me=ae+Le;if(Be){if(Be.index>N.index){var Pe=H-Be.x-Be.vx,ce=ie-Be.y-Be.vy,He=Pe*Pe+ce*ce;He<me*me&&(Pe===0&&(Pe=s(),He+=Pe*Pe),ce===0&&(ce=s(),He+=ce*ce),He=(me-(He=Math.sqrt(He)))/He*P,N.vx+=(Pe*=He)*(me=(Le*=Le)/(_e+Le)),N.vy+=(ce*=He)*me,Be.vx-=Pe*(me=1-me),Be.vy-=ce*me)}return}return re>H+me||ke<H-me||Se>ie+me||be<ie-me}}function q(G){if(G.data)return G.r=g[G.data.index];for(var Z=G.r=0;Z<4;++Z)G[Z]&&G[Z].r>G.r&&(G.r=G[Z].r)}function V(){if(S){var G,Z=S.length,j;for(g=new Array(Z),G=0;G<Z;++G)j=S[G],g[j.index]=+C(j,G,S)}}return z.initialize=function(G){S=G,V()},z.iterations=function(G){return arguments.length?(E=+G,z):E},z.strength=function(G){return arguments.length?(P=+G,z):P},z.radius=function(G){return arguments.length?(C=typeof G=="function"?G:o(+G),V(),z):C},z}function f(C){return C.index}function h(C,S){var g=C.get(S);if(!g)throw new Error("missing: "+S);return g}function d(C){var S=f,g=j,P,E=o(30),z,q,V,G,Z=1;C==null&&(C=[]);function j(_e){return 1/Math.min(V[_e.source.index],V[_e.target.index])}function N(_e){for(var Ee=0,Ce=C.length;Ee<Z;++Ee)for(var ge=0,re,Se,ke,be,Be,Le,me;ge<Ce;++ge)re=C[ge],Se=re.source,ke=re.target,be=ke.x+ke.vx-Se.x-Se.vx||s(),Be=ke.y+ke.vy-Se.y-Se.vy||s(),Le=Math.sqrt(be*be+Be*Be),Le=(Le-z[ge])/Le*_e*P[ge],be*=Le,Be*=Le,ke.vx-=be*(me=G[ge]),ke.vy-=Be*me,Se.vx+=be*(me=1-me),Se.vy+=Be*me}function H(){if(q){var _e,Ee=q.length,Ce=C.length,ge=r.map(q,S),re;for(_e=0,V=new Array(Ee);_e<Ce;++_e)re=C[_e],re.index=_e,typeof re.source!="object"&&(re.source=h(ge,re.source)),typeof re.target!="object"&&(re.target=h(ge,re.target)),V[re.source.index]=(V[re.source.index]||0)+1,V[re.target.index]=(V[re.target.index]||0)+1;for(_e=0,G=new Array(Ce);_e<Ce;++_e)re=C[_e],G[_e]=V[re.source.index]/(V[re.source.index]+V[re.target.index]);P=new Array(Ce),ie(),z=new Array(Ce),ae()}}function ie(){if(q)for(var _e=0,Ee=C.length;_e<Ee;++_e)P[_e]=+g(C[_e],_e,C)}function ae(){if(q)for(var _e=0,Ee=C.length;_e<Ee;++_e)z[_e]=+E(C[_e],_e,C)}return N.initialize=function(_e){q=_e,H()},N.links=function(_e){return arguments.length?(C=_e,H(),N):C},N.id=function(_e){return arguments.length?(S=_e,N):S},N.iterations=function(_e){return arguments.length?(Z=+_e,N):Z},N.strength=function(_e){return arguments.length?(g=typeof _e=="function"?_e:o(+_e),ie(),N):g},N.distance=function(_e){return arguments.length?(E=typeof _e=="function"?_e:o(+_e),ae(),N):E},N}function v(C){return C.x}function m(C){return C.y}var b=10,p=Math.PI*(3-Math.sqrt(5));function k(C){var S,g=1,P=.001,E=1-Math.pow(P,1/300),z=0,q=.6,V=r.map(),G=i.timer(j),Z=n.dispatch("tick","end");C==null&&(C=[]);function j(){N(),Z.call("tick",S),g<P&&(G.stop(),Z.call("end",S))}function N(ae){var _e,Ee=C.length,Ce;ae===void 0&&(ae=1);for(var ge=0;ge<ae;++ge)for(g+=(z-g)*E,V.each(function(re){re(g)}),_e=0;_e<Ee;++_e)Ce=C[_e],Ce.fx==null?Ce.x+=Ce.vx*=q:(Ce.x=Ce.fx,Ce.vx=0),Ce.fy==null?Ce.y+=Ce.vy*=q:(Ce.y=Ce.fy,Ce.vy=0);return S}function H(){for(var ae=0,_e=C.length,Ee;ae<_e;++ae){if(Ee=C[ae],Ee.index=ae,Ee.fx!=null&&(Ee.x=Ee.fx),Ee.fy!=null&&(Ee.y=Ee.fy),isNaN(Ee.x)||isNaN(Ee.y)){var Ce=b*Math.sqrt(ae),ge=ae*p;Ee.x=Ce*Math.cos(ge),Ee.y=Ce*Math.sin(ge)}(isNaN(Ee.vx)||isNaN(Ee.vy))&&(Ee.vx=Ee.vy=0)}}function ie(ae){return ae.initialize&&ae.initialize(C),ae}return H(),S={tick:N,restart:function(){return G.restart(j),S},stop:function(){return G.stop(),S},nodes:function(ae){return arguments.length?(C=ae,H(),V.each(ie),S):C},alpha:function(ae){return arguments.length?(g=+ae,S):g},alphaMin:function(ae){return arguments.length?(P=+ae,S):P},alphaDecay:function(ae){return arguments.length?(E=+ae,S):+E},alphaTarget:function(ae){return arguments.length?(z=+ae,S):z},velocityDecay:function(ae){return arguments.length?(q=1-ae,S):1-q},force:function(ae,_e){return arguments.length>1?(_e==null?V.remove(ae):V.set(ae,ie(_e)),S):V.get(ae)},find:function(ae,_e,Ee){var Ce=0,ge=C.length,re,Se,ke,be,Be;for(Ee==null?Ee=1/0:Ee*=Ee,Ce=0;Ce<ge;++Ce)be=C[Ce],re=ae-be.x,Se=_e-be.y,ke=re*re+Se*Se,ke<Ee&&(Be=be,Ee=ke);return Be},on:function(ae,_e){return arguments.length>1?(Z.on(ae,_e),S):Z.on(ae)}}}function M(){var C,S,g,P=o(-30),E,z=1,q=1/0,V=.81;function G(H){var ie,ae=C.length,_e=t.quadtree(C,v,m).visitAfter(j);for(g=H,ie=0;ie<ae;++ie)S=C[ie],_e.visit(N)}function Z(){if(C){var H,ie=C.length,ae;for(E=new Array(ie),H=0;H<ie;++H)ae=C[H],E[ae.index]=+P(ae,H,C)}}function j(H){var ie=0,ae,_e,Ee=0,Ce,ge,re;if(H.length){for(Ce=ge=re=0;re<4;++re)(ae=H[re])&&(_e=Math.abs(ae.value))&&(ie+=ae.value,Ee+=_e,Ce+=_e*ae.x,ge+=_e*ae.y);H.x=Ce/Ee,H.y=ge/Ee}else{ae=H,ae.x=ae.data.x,ae.y=ae.data.y;do ie+=E[ae.data.index];while(ae=ae.next)}H.value=ie}function N(H,ie,ae,_e){if(!H.value)return!0;var Ee=H.x-S.x,Ce=H.y-S.y,ge=_e-ie,re=Ee*Ee+Ce*Ce;if(ge*ge/V<re)return re<q&&(Ee===0&&(Ee=s(),re+=Ee*Ee),Ce===0&&(Ce=s(),re+=Ce*Ce),re<z&&(re=Math.sqrt(z*re)),S.vx+=Ee*H.value*g/re,S.vy+=Ce*H.value*g/re),!0;if(H.length||re>=q)return;(H.data!==S||H.next)&&(Ee===0&&(Ee=s(),re+=Ee*Ee),Ce===0&&(Ce=s(),re+=Ce*Ce),re<z&&(re=Math.sqrt(z*re)));do H.data!==S&&(ge=E[H.data.index]*g/re,S.vx+=Ee*ge,S.vy+=Ce*ge);while(H=H.next)}return G.initialize=function(H){C=H,Z()},G.strength=function(H){return arguments.length?(P=typeof H=="function"?H:o(+H),Z(),G):P},G.distanceMin=function(H){return arguments.length?(z=H*H,G):Math.sqrt(z)},G.distanceMax=function(H){return arguments.length?(q=H*H,G):Math.sqrt(q)},G.theta=function(H){return arguments.length?(V=H*H,G):Math.sqrt(V)},G}function T(C,S,g){var P,E=o(.1),z,q;typeof C!="function"&&(C=o(+C)),S==null&&(S=0),g==null&&(g=0);function V(Z){for(var j=0,N=P.length;j<N;++j){var H=P[j],ie=H.x-S||1e-6,ae=H.y-g||1e-6,_e=Math.sqrt(ie*ie+ae*ae),Ee=(q[j]-_e)*z[j]*Z/_e;H.vx+=ie*Ee,H.vy+=ae*Ee}}function G(){if(P){var Z,j=P.length;for(z=new Array(j),q=new Array(j),Z=0;Z<j;++Z)q[Z]=+C(P[Z],Z,P),z[Z]=isNaN(q[Z])?0:+E(P[Z],Z,P)}}return V.initialize=function(Z){P=Z,G()},V.strength=function(Z){return arguments.length?(E=typeof Z=="function"?Z:o(+Z),G(),V):E},V.radius=function(Z){return arguments.length?(C=typeof Z=="function"?Z:o(+Z),G(),V):C},V.x=function(Z){return arguments.length?(S=+Z,V):S},V.y=function(Z){return arguments.length?(g=+Z,V):g},V}function L(C){var S=o(.1),g,P,E;typeof C!="function"&&(C=o(C==null?0:+C));function z(V){for(var G=0,Z=g.length,j;G<Z;++G)j=g[G],j.vx+=(E[G]-j.x)*P[G]*V}function q(){if(g){var V,G=g.length;for(P=new Array(G),E=new Array(G),V=0;V<G;++V)P[V]=isNaN(E[V]=+C(g[V],V,g))?0:+S(g[V],V,g)}}return z.initialize=function(V){g=V,q()},z.strength=function(V){return arguments.length?(S=typeof V=="function"?V:o(+V),q(),z):S},z.x=function(V){return arguments.length?(C=typeof V=="function"?V:o(+V),q(),z):C},z}function x(C){var S=o(.1),g,P,E;typeof C!="function"&&(C=o(C==null?0:+C));function z(V){for(var G=0,Z=g.length,j;G<Z;++G)j=g[G],j.vy+=(E[G]-j.y)*P[G]*V}function q(){if(g){var V,G=g.length;for(P=new Array(G),E=new Array(G),V=0;V<G;++V)P[V]=isNaN(E[V]=+C(g[V],V,g))?0:+S(g[V],V,g)}}return z.initialize=function(V){g=V,q()},z.strength=function(V){return arguments.length?(S=typeof V=="function"?V:o(+V),q(),z):S},z.y=function(V){return arguments.length?(C=typeof V=="function"?V:o(+V),q(),z):C},z}e.forceCenter=a,e.forceCollide=c,e.forceLink=d,e.forceManyBody=M,e.forceRadial=T,e.forceSimulation=k,e.forceX=L,e.forceY=x,Object.defineProperty(e,"__esModule",{value:!0})})});var KWe=ye((C7,YWe)=>{(function(e,t){typeof C7=="object"&&typeof YWe!="undefined"?t(C7):(e=e||self,t(e.d3=e.d3||{}))})(C7,function(e){"use strict";var t=Math.PI,r=2*t,n=1e-6,i=r-n;function a(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function o(){return new a}a.prototype=o.prototype={constructor:a,moveTo:function(s,l){this._+="M"+(this._x0=this._x1=+s)+","+(this._y0=this._y1=+l)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(s,l){this._+="L"+(this._x1=+s)+","+(this._y1=+l)},quadraticCurveTo:function(s,l,u,c){this._+="Q"+ +s+","+ +l+","+(this._x1=+u)+","+(this._y1=+c)},bezierCurveTo:function(s,l,u,c,f,h){this._+="C"+ +s+","+ +l+","+ +u+","+ +c+","+(this._x1=+f)+","+(this._y1=+h)},arcTo:function(s,l,u,c,f){s=+s,l=+l,u=+u,c=+c,f=+f;var h=this._x1,d=this._y1,v=u-s,m=c-l,b=h-s,p=d-l,k=b*b+p*p;if(f<0)throw new Error("negative radius: "+f);if(this._x1===null)this._+="M"+(this._x1=s)+","+(this._y1=l);else if(k>n)if(!(Math.abs(p*v-m*b)>n)||!f)this._+="L"+(this._x1=s)+","+(this._y1=l);else{var M=u-h,T=c-d,L=v*v+m*m,x=M*M+T*T,C=Math.sqrt(L),S=Math.sqrt(k),g=f*Math.tan((t-Math.acos((L+k-x)/(2*C*S)))/2),P=g/S,E=g/C;Math.abs(P-1)>n&&(this._+="L"+(s+P*b)+","+(l+P*p)),this._+="A"+f+","+f+",0,0,"+ +(p*M>b*T)+","+(this._x1=s+E*v)+","+(this._y1=l+E*m)}},arc:function(s,l,u,c,f,h){s=+s,l=+l,u=+u,h=!!h;var d=u*Math.cos(c),v=u*Math.sin(c),m=s+d,b=l+v,p=1^h,k=h?c-f:f-c;if(u<0)throw new Error("negative radius: "+u);this._x1===null?this._+="M"+m+","+b:(Math.abs(this._x1-m)>n||Math.abs(this._y1-b)>n)&&(this._+="L"+m+","+b),u&&(k<0&&(k=k%r+r),k>i?this._+="A"+u+","+u+",0,1,"+p+","+(s-d)+","+(l-v)+"A"+u+","+u+",0,1,"+p+","+(this._x1=m)+","+(this._y1=b):k>n&&(this._+="A"+u+","+u+",0,"+ +(k>=t)+","+p+","+(this._x1=s+u*Math.cos(f))+","+(this._y1=l+u*Math.sin(f))))},rect:function(s,l,u,c){this._+="M"+(this._x0=this._x1=+s)+","+(this._y0=this._y1=+l)+"h"+ +u+"v"+ +c+"h"+-u+"Z"},toString:function(){return this._}},e.path=o,Object.defineProperty(e,"__esModule",{value:!0})})});var QJ=ye((L7,JWe)=>{(function(e,t){typeof L7=="object"&&typeof JWe!="undefined"?t(L7,KWe()):(e=e||self,t(e.d3=e.d3||{},e.d3))})(L7,function(e,t){"use strict";function r(Ct){return function(){return Ct}}var n=Math.abs,i=Math.atan2,a=Math.cos,o=Math.max,s=Math.min,l=Math.sin,u=Math.sqrt,c=1e-12,f=Math.PI,h=f/2,d=2*f;function v(Ct){return Ct>1?0:Ct<-1?f:Math.acos(Ct)}function m(Ct){return Ct>=1?h:Ct<=-1?-h:Math.asin(Ct)}function b(Ct){return Ct.innerRadius}function p(Ct){return Ct.outerRadius}function k(Ct){return Ct.startAngle}function M(Ct){return Ct.endAngle}function T(Ct){return Ct&&Ct.padAngle}function L(Ct,Sr,Jr,hi,hn,Sn,En,ki){var _n=Jr-Ct,ya=hi-Sr,ea=En-hn,Ma=ki-Sn,_o=Ma*_n-ea*ya;if(!(_o*_o<c))return _o=(ea*(Sr-Sn)-Ma*(Ct-hn))/_o,[Ct+_o*_n,Sr+_o*ya]}function x(Ct,Sr,Jr,hi,hn,Sn,En){var ki=Ct-Jr,_n=Sr-hi,ya=(En?Sn:-Sn)/u(ki*ki+_n*_n),ea=ya*_n,Ma=-ya*ki,_o=Ct+ea,No=Sr+Ma,po=Jr+ea,Lo=hi+Ma,ko=(_o+po)/2,Ds=(No+Lo)/2,Fs=po-_o,ll=Lo-No,ul=Fs*Fs+ll*ll,zl=hn-Sn,us=_o*Lo-po*No,il=(ll<0?-1:1)*u(o(0,zl*zl*ul-us*us)),As=(us*ll-Fs*il)/ul,cl=(-us*Fs-ll*il)/ul,Ks=(us*ll+Fs*il)/ul,zs=(-us*Fs+ll*il)/ul,Io=As-ko,ls=cl-Ds,Yl=Ks-ko,Su=zs-Ds;return Io*Io+ls*ls>Yl*Yl+Su*Su&&(As=Ks,cl=zs),{cx:As,cy:cl,x01:-ea,y01:-Ma,x11:As*(hn/zl-1),y11:cl*(hn/zl-1)}}function C(){var Ct=b,Sr=p,Jr=r(0),hi=null,hn=k,Sn=M,En=T,ki=null;function _n(){var ya,ea,Ma=+Ct.apply(this,arguments),_o=+Sr.apply(this,arguments),No=hn.apply(this,arguments)-h,po=Sn.apply(this,arguments)-h,Lo=n(po-No),ko=po>No;if(ki||(ki=ya=t.path()),_o<Ma&&(ea=_o,_o=Ma,Ma=ea),!(_o>c))ki.moveTo(0,0);else if(Lo>d-c)ki.moveTo(_o*a(No),_o*l(No)),ki.arc(0,0,_o,No,po,!ko),Ma>c&&(ki.moveTo(Ma*a(po),Ma*l(po)),ki.arc(0,0,Ma,po,No,ko));else{var Ds=No,Fs=po,ll=No,ul=po,zl=Lo,us=Lo,il=En.apply(this,arguments)/2,As=il>c&&(hi?+hi.apply(this,arguments):u(Ma*Ma+_o*_o)),cl=s(n(_o-Ma)/2,+Jr.apply(this,arguments)),Ks=cl,zs=cl,Io,ls;if(As>c){var Yl=m(As/Ma*l(il)),Su=m(As/_o*l(il));(zl-=Yl*2)>c?(Yl*=ko?1:-1,ll+=Yl,ul-=Yl):(zl=0,ll=ul=(No+po)/2),(us-=Su*2)>c?(Su*=ko?1:-1,Ds+=Su,Fs-=Su):(us=0,Ds=Fs=(No+po)/2)}var nc=_o*a(Ds),bs=_o*l(Ds),Rn=Ma*a(ul),_a=Ma*l(ul);if(cl>c){var Vu=_o*a(Fs),ql=_o*l(Fs),xo=Ma*a(ll),Kl=Ma*l(ll),Ns;if(Lo<f&&(Ns=L(nc,bs,xo,Kl,Vu,ql,Rn,_a))){var Hl=nc-Ns[0],ac=bs-Ns[1],oa=Vu-Ns[0],qo=ql-Ns[1],Oo=1/l(v((Hl*oa+ac*qo)/(u(Hl*Hl+ac*ac)*u(oa*oa+qo*qo)))/2),Ol=u(Ns[0]*Ns[0]+Ns[1]*Ns[1]);Ks=s(cl,(Ma-Ol)/(Oo-1)),zs=s(cl,(_o-Ol)/(Oo+1))}}us>c?zs>c?(Io=x(xo,Kl,nc,bs,_o,zs,ko),ls=x(Vu,ql,Rn,_a,_o,zs,ko),ki.moveTo(Io.cx+Io.x01,Io.cy+Io.y01),zs<cl?ki.arc(Io.cx,Io.cy,zs,i(Io.y01,Io.x01),i(ls.y01,ls.x01),!ko):(ki.arc(Io.cx,Io.cy,zs,i(Io.y01,Io.x01),i(Io.y11,Io.x11),!ko),ki.arc(0,0,_o,i(Io.cy+Io.y11,Io.cx+Io.x11),i(ls.cy+ls.y11,ls.cx+ls.x11),!ko),ki.arc(ls.cx,ls.cy,zs,i(ls.y11,ls.x11),i(ls.y01,ls.x01),!ko))):(ki.moveTo(nc,bs),ki.arc(0,0,_o,Ds,Fs,!ko)):ki.moveTo(nc,bs),!(Ma>c)||!(zl>c)?ki.lineTo(Rn,_a):Ks>c?(Io=x(Rn,_a,Vu,ql,Ma,-Ks,ko),ls=x(nc,bs,xo,Kl,Ma,-Ks,ko),ki.lineTo(Io.cx+Io.x01,Io.cy+Io.y01),Ks<cl?ki.arc(Io.cx,Io.cy,Ks,i(Io.y01,Io.x01),i(ls.y01,ls.x01),!ko):(ki.arc(Io.cx,Io.cy,Ks,i(Io.y01,Io.x01),i(Io.y11,Io.x11),!ko),ki.arc(0,0,Ma,i(Io.cy+Io.y11,Io.cx+Io.x11),i(ls.cy+ls.y11,ls.cx+ls.x11),ko),ki.arc(ls.cx,ls.cy,Ks,i(ls.y11,ls.x11),i(ls.y01,ls.x01),!ko))):ki.arc(0,0,Ma,ul,ll,ko)}if(ki.closePath(),ya)return ki=null,ya+""||null}return _n.centroid=function(){var ya=(+Ct.apply(this,arguments)+ +Sr.apply(this,arguments))/2,ea=(+hn.apply(this,arguments)+ +Sn.apply(this,arguments))/2-f/2;return[a(ea)*ya,l(ea)*ya]},_n.innerRadius=function(ya){return arguments.length?(Ct=typeof ya=="function"?ya:r(+ya),_n):Ct},_n.outerRadius=function(ya){return arguments.length?(Sr=typeof ya=="function"?ya:r(+ya),_n):Sr},_n.cornerRadius=function(ya){return arguments.length?(Jr=typeof ya=="function"?ya:r(+ya),_n):Jr},_n.padRadius=function(ya){return arguments.length?(hi=ya==null?null:typeof ya=="function"?ya:r(+ya),_n):hi},_n.startAngle=function(ya){return arguments.length?(hn=typeof ya=="function"?ya:r(+ya),_n):hn},_n.endAngle=function(ya){return arguments.length?(Sn=typeof ya=="function"?ya:r(+ya),_n):Sn},_n.padAngle=function(ya){return arguments.length?(En=typeof ya=="function"?ya:r(+ya),_n):En},_n.context=function(ya){return arguments.length?(ki=ya==null?null:ya,_n):ki},_n}function S(Ct){this._context=Ct}S.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Ct,Sr){switch(Ct=+Ct,Sr=+Sr,this._point){case 0:this._point=1,this._line?this._context.lineTo(Ct,Sr):this._context.moveTo(Ct,Sr);break;case 1:this._point=2;default:this._context.lineTo(Ct,Sr);break}}};function g(Ct){return new S(Ct)}function P(Ct){return Ct[0]}function E(Ct){return Ct[1]}function z(){var Ct=P,Sr=E,Jr=r(!0),hi=null,hn=g,Sn=null;function En(ki){var _n,ya=ki.length,ea,Ma=!1,_o;for(hi==null&&(Sn=hn(_o=t.path())),_n=0;_n<=ya;++_n)!(_n<ya&&Jr(ea=ki[_n],_n,ki))===Ma&&((Ma=!Ma)?Sn.lineStart():Sn.lineEnd()),Ma&&Sn.point(+Ct(ea,_n,ki),+Sr(ea,_n,ki));if(_o)return Sn=null,_o+""||null}return En.x=function(ki){return arguments.length?(Ct=typeof ki=="function"?ki:r(+ki),En):Ct},En.y=function(ki){return arguments.length?(Sr=typeof ki=="function"?ki:r(+ki),En):Sr},En.defined=function(ki){return arguments.length?(Jr=typeof ki=="function"?ki:r(!!ki),En):Jr},En.curve=function(ki){return arguments.length?(hn=ki,hi!=null&&(Sn=hn(hi)),En):hn},En.context=function(ki){return arguments.length?(ki==null?hi=Sn=null:Sn=hn(hi=ki),En):hi},En}function q(){var Ct=P,Sr=null,Jr=r(0),hi=E,hn=r(!0),Sn=null,En=g,ki=null;function _n(ea){var Ma,_o,No,po=ea.length,Lo,ko=!1,Ds,Fs=new Array(po),ll=new Array(po);for(Sn==null&&(ki=En(Ds=t.path())),Ma=0;Ma<=po;++Ma){if(!(Ma<po&&hn(Lo=ea[Ma],Ma,ea))===ko)if(ko=!ko)_o=Ma,ki.areaStart(),ki.lineStart();else{for(ki.lineEnd(),ki.lineStart(),No=Ma-1;No>=_o;--No)ki.point(Fs[No],ll[No]);ki.lineEnd(),ki.areaEnd()}ko&&(Fs[Ma]=+Ct(Lo,Ma,ea),ll[Ma]=+Jr(Lo,Ma,ea),ki.point(Sr?+Sr(Lo,Ma,ea):Fs[Ma],hi?+hi(Lo,Ma,ea):ll[Ma]))}if(Ds)return ki=null,Ds+""||null}function ya(){return z().defined(hn).curve(En).context(Sn)}return _n.x=function(ea){return arguments.length?(Ct=typeof ea=="function"?ea:r(+ea),Sr=null,_n):Ct},_n.x0=function(ea){return arguments.length?(Ct=typeof ea=="function"?ea:r(+ea),_n):Ct},_n.x1=function(ea){return arguments.length?(Sr=ea==null?null:typeof ea=="function"?ea:r(+ea),_n):Sr},_n.y=function(ea){return arguments.length?(Jr=typeof ea=="function"?ea:r(+ea),hi=null,_n):Jr},_n.y0=function(ea){return arguments.length?(Jr=typeof ea=="function"?ea:r(+ea),_n):Jr},_n.y1=function(ea){return arguments.length?(hi=ea==null?null:typeof ea=="function"?ea:r(+ea),_n):hi},_n.lineX0=_n.lineY0=function(){return ya().x(Ct).y(Jr)},_n.lineY1=function(){return ya().x(Ct).y(hi)},_n.lineX1=function(){return ya().x(Sr).y(Jr)},_n.defined=function(ea){return arguments.length?(hn=typeof ea=="function"?ea:r(!!ea),_n):hn},_n.curve=function(ea){return arguments.length?(En=ea,Sn!=null&&(ki=En(Sn)),_n):En},_n.context=function(ea){return arguments.length?(ea==null?Sn=ki=null:ki=En(Sn=ea),_n):Sn},_n}function V(Ct,Sr){return Sr<Ct?-1:Sr>Ct?1:Sr>=Ct?0:NaN}function G(Ct){return Ct}function Z(){var Ct=G,Sr=V,Jr=null,hi=r(0),hn=r(d),Sn=r(0);function En(ki){var _n,ya=ki.length,ea,Ma,_o=0,No=new Array(ya),po=new Array(ya),Lo=+hi.apply(this,arguments),ko=Math.min(d,Math.max(-d,hn.apply(this,arguments)-Lo)),Ds,Fs=Math.min(Math.abs(ko)/ya,Sn.apply(this,arguments)),ll=Fs*(ko<0?-1:1),ul;for(_n=0;_n<ya;++_n)(ul=po[No[_n]=_n]=+Ct(ki[_n],_n,ki))>0&&(_o+=ul);for(Sr!=null?No.sort(function(zl,us){return Sr(po[zl],po[us])}):Jr!=null&&No.sort(function(zl,us){return Jr(ki[zl],ki[us])}),_n=0,Ma=_o?(ko-ya*ll)/_o:0;_n<ya;++_n,Lo=Ds)ea=No[_n],ul=po[ea],Ds=Lo+(ul>0?ul*Ma:0)+ll,po[ea]={data:ki[ea],index:_n,value:ul,startAngle:Lo,endAngle:Ds,padAngle:Fs};return po}return En.value=function(ki){return arguments.length?(Ct=typeof ki=="function"?ki:r(+ki),En):Ct},En.sortValues=function(ki){return arguments.length?(Sr=ki,Jr=null,En):Sr},En.sort=function(ki){return arguments.length?(Jr=ki,Sr=null,En):Jr},En.startAngle=function(ki){return arguments.length?(hi=typeof ki=="function"?ki:r(+ki),En):hi},En.endAngle=function(ki){return arguments.length?(hn=typeof ki=="function"?ki:r(+ki),En):hn},En.padAngle=function(ki){return arguments.length?(Sn=typeof ki=="function"?ki:r(+ki),En):Sn},En}var j=H(g);function N(Ct){this._curve=Ct}N.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(Ct,Sr){this._curve.point(Sr*Math.sin(Ct),Sr*-Math.cos(Ct))}};function H(Ct){function Sr(Jr){return new N(Ct(Jr))}return Sr._curve=Ct,Sr}function ie(Ct){var Sr=Ct.curve;return Ct.angle=Ct.x,delete Ct.x,Ct.radius=Ct.y,delete Ct.y,Ct.curve=function(Jr){return arguments.length?Sr(H(Jr)):Sr()._curve},Ct}function ae(){return ie(z().curve(j))}function _e(){var Ct=q().curve(j),Sr=Ct.curve,Jr=Ct.lineX0,hi=Ct.lineX1,hn=Ct.lineY0,Sn=Ct.lineY1;return Ct.angle=Ct.x,delete Ct.x,Ct.startAngle=Ct.x0,delete Ct.x0,Ct.endAngle=Ct.x1,delete Ct.x1,Ct.radius=Ct.y,delete Ct.y,Ct.innerRadius=Ct.y0,delete Ct.y0,Ct.outerRadius=Ct.y1,delete Ct.y1,Ct.lineStartAngle=function(){return ie(Jr())},delete Ct.lineX0,Ct.lineEndAngle=function(){return ie(hi())},delete Ct.lineX1,Ct.lineInnerRadius=function(){return ie(hn())},delete Ct.lineY0,Ct.lineOuterRadius=function(){return ie(Sn())},delete Ct.lineY1,Ct.curve=function(En){return arguments.length?Sr(H(En)):Sr()._curve},Ct}function Ee(Ct,Sr){return[(Sr=+Sr)*Math.cos(Ct-=Math.PI/2),Sr*Math.sin(Ct)]}var Ce=Array.prototype.slice;function ge(Ct){return Ct.source}function re(Ct){return Ct.target}function Se(Ct){var Sr=ge,Jr=re,hi=P,hn=E,Sn=null;function En(){var ki,_n=Ce.call(arguments),ya=Sr.apply(this,_n),ea=Jr.apply(this,_n);if(Sn||(Sn=ki=t.path()),Ct(Sn,+hi.apply(this,(_n[0]=ya,_n)),+hn.apply(this,_n),+hi.apply(this,(_n[0]=ea,_n)),+hn.apply(this,_n)),ki)return Sn=null,ki+""||null}return En.source=function(ki){return arguments.length?(Sr=ki,En):Sr},En.target=function(ki){return arguments.length?(Jr=ki,En):Jr},En.x=function(ki){return arguments.length?(hi=typeof ki=="function"?ki:r(+ki),En):hi},En.y=function(ki){return arguments.length?(hn=typeof ki=="function"?ki:r(+ki),En):hn},En.context=function(ki){return arguments.length?(Sn=ki==null?null:ki,En):Sn},En}function ke(Ct,Sr,Jr,hi,hn){Ct.moveTo(Sr,Jr),Ct.bezierCurveTo(Sr=(Sr+hi)/2,Jr,Sr,hn,hi,hn)}function be(Ct,Sr,Jr,hi,hn){Ct.moveTo(Sr,Jr),Ct.bezierCurveTo(Sr,Jr=(Jr+hn)/2,hi,Jr,hi,hn)}function Be(Ct,Sr,Jr,hi,hn){var Sn=Ee(Sr,Jr),En=Ee(Sr,Jr=(Jr+hn)/2),ki=Ee(hi,Jr),_n=Ee(hi,hn);Ct.moveTo(Sn[0],Sn[1]),Ct.bezierCurveTo(En[0],En[1],ki[0],ki[1],_n[0],_n[1])}function Le(){return Se(ke)}function me(){return Se(be)}function Pe(){var Ct=Se(Be);return Ct.angle=Ct.x,delete Ct.x,Ct.radius=Ct.y,delete Ct.y,Ct}var ce={draw:function(Ct,Sr){var Jr=Math.sqrt(Sr/f);Ct.moveTo(Jr,0),Ct.arc(0,0,Jr,0,d)}},He={draw:function(Ct,Sr){var Jr=Math.sqrt(Sr/5)/2;Ct.moveTo(-3*Jr,-Jr),Ct.lineTo(-Jr,-Jr),Ct.lineTo(-Jr,-3*Jr),Ct.lineTo(Jr,-3*Jr),Ct.lineTo(Jr,-Jr),Ct.lineTo(3*Jr,-Jr),Ct.lineTo(3*Jr,Jr),Ct.lineTo(Jr,Jr),Ct.lineTo(Jr,3*Jr),Ct.lineTo(-Jr,3*Jr),Ct.lineTo(-Jr,Jr),Ct.lineTo(-3*Jr,Jr),Ct.closePath()}},lt=Math.sqrt(1/3),mt=lt*2,Ht={draw:function(Ct,Sr){var Jr=Math.sqrt(Sr/mt),hi=Jr*lt;Ct.moveTo(0,-Jr),Ct.lineTo(hi,0),Ct.lineTo(0,Jr),Ct.lineTo(-hi,0),Ct.closePath()}},at=.8908130915292852,ct=Math.sin(f/10)/Math.sin(7*f/10),ar=Math.sin(d/10)*ct,Vt=-Math.cos(d/10)*ct,rr={draw:function(Ct,Sr){var Jr=Math.sqrt(Sr*at),hi=ar*Jr,hn=Vt*Jr;Ct.moveTo(0,-Jr),Ct.lineTo(hi,hn);for(var Sn=1;Sn<5;++Sn){var En=d*Sn/5,ki=Math.cos(En),_n=Math.sin(En);Ct.lineTo(_n*Jr,-ki*Jr),Ct.lineTo(ki*hi-_n*hn,_n*hi+ki*hn)}Ct.closePath()}},tt={draw:function(Ct,Sr){var Jr=Math.sqrt(Sr),hi=-Jr/2;Ct.rect(hi,hi,Jr,Jr)}},je=Math.sqrt(3),Ue={draw:function(Ct,Sr){var Jr=-Math.sqrt(Sr/(je*3));Ct.moveTo(0,Jr*2),Ct.lineTo(-je*Jr,-Jr),Ct.lineTo(je*Jr,-Jr),Ct.closePath()}},Ae=-.5,rt=Math.sqrt(3)/2,St=1/Math.sqrt(12),Tt=(St/2+1)*3,dt={draw:function(Ct,Sr){var Jr=Math.sqrt(Sr/Tt),hi=Jr/2,hn=Jr*St,Sn=hi,En=Jr*St+Jr,ki=-Sn,_n=En;Ct.moveTo(hi,hn),Ct.lineTo(Sn,En),Ct.lineTo(ki,_n),Ct.lineTo(Ae*hi-rt*hn,rt*hi+Ae*hn),Ct.lineTo(Ae*Sn-rt*En,rt*Sn+Ae*En),Ct.lineTo(Ae*ki-rt*_n,rt*ki+Ae*_n),Ct.lineTo(Ae*hi+rt*hn,Ae*hn-rt*hi),Ct.lineTo(Ae*Sn+rt*En,Ae*En-rt*Sn),Ct.lineTo(Ae*ki+rt*_n,Ae*_n-rt*ki),Ct.closePath()}},Et=[ce,He,Ht,tt,rr,Ue,dt];function pt(){var Ct=r(ce),Sr=r(64),Jr=null;function hi(){var hn;if(Jr||(Jr=hn=t.path()),Ct.apply(this,arguments).draw(Jr,+Sr.apply(this,arguments)),hn)return Jr=null,hn+""||null}return hi.type=function(hn){return arguments.length?(Ct=typeof hn=="function"?hn:r(hn),hi):Ct},hi.size=function(hn){return arguments.length?(Sr=typeof hn=="function"?hn:r(+hn),hi):Sr},hi.context=function(hn){return arguments.length?(Jr=hn==null?null:hn,hi):Jr},hi}function jt(){}function or(Ct,Sr,Jr){Ct._context.bezierCurveTo((2*Ct._x0+Ct._x1)/3,(2*Ct._y0+Ct._y1)/3,(Ct._x0+2*Ct._x1)/3,(Ct._y0+2*Ct._y1)/3,(Ct._x0+4*Ct._x1+Sr)/6,(Ct._y0+4*Ct._y1+Jr)/6)}function mr(Ct){this._context=Ct}mr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:or(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Ct,Sr){switch(Ct=+Ct,Sr=+Sr,this._point){case 0:this._point=1,this._line?this._context.lineTo(Ct,Sr):this._context.moveTo(Ct,Sr);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:or(this,Ct,Sr);break}this._x0=this._x1,this._x1=Ct,this._y0=this._y1,this._y1=Sr}};function Ar(Ct){return new mr(Ct)}function ei(Ct){this._context=Ct}ei.prototype={areaStart:jt,areaEnd:jt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(Ct,Sr){switch(Ct=+Ct,Sr=+Sr,this._point){case 0:this._point=1,this._x2=Ct,this._y2=Sr;break;case 1:this._point=2,this._x3=Ct,this._y3=Sr;break;case 2:this._point=3,this._x4=Ct,this._y4=Sr,this._context.moveTo((this._x0+4*this._x1+Ct)/6,(this._y0+4*this._y1+Sr)/6);break;default:or(this,Ct,Sr);break}this._x0=this._x1,this._x1=Ct,this._y0=this._y1,this._y1=Sr}};function qr(Ct){return new ei(Ct)}function jr(Ct){this._context=Ct}jr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(Ct,Sr){switch(Ct=+Ct,Sr=+Sr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var Jr=(this._x0+4*this._x1+Ct)/6,hi=(this._y0+4*this._y1+Sr)/6;this._line?this._context.lineTo(Jr,hi):this._context.moveTo(Jr,hi);break;case 3:this._point=4;default:or(this,Ct,Sr);break}this._x0=this._x1,this._x1=Ct,this._y0=this._y1,this._y1=Sr}};function gt(Ct){return new jr(Ct)}function Ge(Ct,Sr){this._basis=new mr(Ct),this._beta=Sr}Ge.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var Ct=this._x,Sr=this._y,Jr=Ct.length-1;if(Jr>0)for(var hi=Ct[0],hn=Sr[0],Sn=Ct[Jr]-hi,En=Sr[Jr]-hn,ki=-1,_n;++ki<=Jr;)_n=ki/Jr,this._basis.point(this._beta*Ct[ki]+(1-this._beta)*(hi+_n*Sn),this._beta*Sr[ki]+(1-this._beta)*(hn+_n*En));this._x=this._y=null,this._basis.lineEnd()},point:function(Ct,Sr){this._x.push(+Ct),this._y.push(+Sr)}};var Je=function Ct(Sr){function Jr(hi){return Sr===1?new mr(hi):new Ge(hi,Sr)}return Jr.beta=function(hi){return Ct(+hi)},Jr}(.85);function We(Ct,Sr,Jr){Ct._context.bezierCurveTo(Ct._x1+Ct._k*(Ct._x2-Ct._x0),Ct._y1+Ct._k*(Ct._y2-Ct._y0),Ct._x2+Ct._k*(Ct._x1-Sr),Ct._y2+Ct._k*(Ct._y1-Jr),Ct._x2,Ct._y2)}function et(Ct,Sr){this._context=Ct,this._k=(1-Sr)/6}et.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:We(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Ct,Sr){switch(Ct=+Ct,Sr=+Sr,this._point){case 0:this._point=1,this._line?this._context.lineTo(Ct,Sr):this._context.moveTo(Ct,Sr);break;case 1:this._point=2,this._x1=Ct,this._y1=Sr;break;case 2:this._point=3;default:We(this,Ct,Sr);break}this._x0=this._x1,this._x1=this._x2,this._x2=Ct,this._y0=this._y1,this._y1=this._y2,this._y2=Sr}};var xt=function Ct(Sr){function Jr(hi){return new et(hi,Sr)}return Jr.tension=function(hi){return Ct(+hi)},Jr}(0);function At(Ct,Sr){this._context=Ct,this._k=(1-Sr)/6}At.prototype={areaStart:jt,areaEnd:jt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(Ct,Sr){switch(Ct=+Ct,Sr=+Sr,this._point){case 0:this._point=1,this._x3=Ct,this._y3=Sr;break;case 1:this._point=2,this._context.moveTo(this._x4=Ct,this._y4=Sr);break;case 2:this._point=3,this._x5=Ct,this._y5=Sr;break;default:We(this,Ct,Sr);break}this._x0=this._x1,this._x1=this._x2,this._x2=Ct,this._y0=this._y1,this._y1=this._y2,this._y2=Sr}};var Kt=function Ct(Sr){function Jr(hi){return new At(hi,Sr)}return Jr.tension=function(hi){return Ct(+hi)},Jr}(0);function Qt(Ct,Sr){this._context=Ct,this._k=(1-Sr)/6}Qt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(Ct,Sr){switch(Ct=+Ct,Sr=+Sr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:We(this,Ct,Sr);break}this._x0=this._x1,this._x1=this._x2,this._x2=Ct,this._y0=this._y1,this._y1=this._y2,this._y2=Sr}};var Mr=function Ct(Sr){function Jr(hi){return new Qt(hi,Sr)}return Jr.tension=function(hi){return Ct(+hi)},Jr}(0);function Gr(Ct,Sr,Jr){var hi=Ct._x1,hn=Ct._y1,Sn=Ct._x2,En=Ct._y2;if(Ct._l01_a>c){var ki=2*Ct._l01_2a+3*Ct._l01_a*Ct._l12_a+Ct._l12_2a,_n=3*Ct._l01_a*(Ct._l01_a+Ct._l12_a);hi=(hi*ki-Ct._x0*Ct._l12_2a+Ct._x2*Ct._l01_2a)/_n,hn=(hn*ki-Ct._y0*Ct._l12_2a+Ct._y2*Ct._l01_2a)/_n}if(Ct._l23_a>c){var ya=2*Ct._l23_2a+3*Ct._l23_a*Ct._l12_a+Ct._l12_2a,ea=3*Ct._l23_a*(Ct._l23_a+Ct._l12_a);Sn=(Sn*ya+Ct._x1*Ct._l23_2a-Sr*Ct._l12_2a)/ea,En=(En*ya+Ct._y1*Ct._l23_2a-Jr*Ct._l12_2a)/ea}Ct._context.bezierCurveTo(hi,hn,Sn,En,Ct._x2,Ct._y2)}function Ir(Ct,Sr){this._context=Ct,this._alpha=Sr}Ir.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Ct,Sr){if(Ct=+Ct,Sr=+Sr,this._point){var Jr=this._x2-Ct,hi=this._y2-Sr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Jr*Jr+hi*hi,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(Ct,Sr):this._context.moveTo(Ct,Sr);break;case 1:this._point=2;break;case 2:this._point=3;default:Gr(this,Ct,Sr);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=Ct,this._y0=this._y1,this._y1=this._y2,this._y2=Sr}};var Yr=function Ct(Sr){function Jr(hi){return Sr?new Ir(hi,Sr):new et(hi,0)}return Jr.alpha=function(hi){return Ct(+hi)},Jr}(.5);function _i(Ct,Sr){this._context=Ct,this._alpha=Sr}_i.prototype={areaStart:jt,areaEnd:jt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(Ct,Sr){if(Ct=+Ct,Sr=+Sr,this._point){var Jr=this._x2-Ct,hi=this._y2-Sr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Jr*Jr+hi*hi,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=Ct,this._y3=Sr;break;case 1:this._point=2,this._context.moveTo(this._x4=Ct,this._y4=Sr);break;case 2:this._point=3,this._x5=Ct,this._y5=Sr;break;default:Gr(this,Ct,Sr);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=Ct,this._y0=this._y1,this._y1=this._y2,this._y2=Sr}};var Pi=function Ct(Sr){function Jr(hi){return Sr?new _i(hi,Sr):new At(hi,0)}return Jr.alpha=function(hi){return Ct(+hi)},Jr}(.5);function ai(Ct,Sr){this._context=Ct,this._alpha=Sr}ai.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(Ct,Sr){if(Ct=+Ct,Sr=+Sr,this._point){var Jr=this._x2-Ct,hi=this._y2-Sr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Jr*Jr+hi*hi,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Gr(this,Ct,Sr);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=Ct,this._y0=this._y1,this._y1=this._y2,this._y2=Sr}};var mi=function Ct(Sr){function Jr(hi){return Sr?new ai(hi,Sr):new Qt(hi,0)}return Jr.alpha=function(hi){return Ct(+hi)},Jr}(.5);function un(Ct){this._context=Ct}un.prototype={areaStart:jt,areaEnd:jt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(Ct,Sr){Ct=+Ct,Sr=+Sr,this._point?this._context.lineTo(Ct,Sr):(this._point=1,this._context.moveTo(Ct,Sr))}};function Fn(Ct){return new un(Ct)}function An(Ct){return Ct<0?-1:1}function Hn(Ct,Sr,Jr){var hi=Ct._x1-Ct._x0,hn=Sr-Ct._x1,Sn=(Ct._y1-Ct._y0)/(hi||hn<0&&-0),En=(Jr-Ct._y1)/(hn||hi<0&&-0),ki=(Sn*hn+En*hi)/(hi+hn);return(An(Sn)+An(En))*Math.min(Math.abs(Sn),Math.abs(En),.5*Math.abs(ki))||0}function Qn(Ct,Sr){var Jr=Ct._x1-Ct._x0;return Jr?(3*(Ct._y1-Ct._y0)/Jr-Sr)/2:Sr}function Vi(Ct,Sr,Jr){var hi=Ct._x0,hn=Ct._y0,Sn=Ct._x1,En=Ct._y1,ki=(Sn-hi)/3;Ct._context.bezierCurveTo(hi+ki,hn+ki*Sr,Sn-ki,En-ki*Jr,Sn,En)}function Kn(Ct){this._context=Ct}Kn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Vi(this,this._t0,Qn(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Ct,Sr){var Jr=NaN;if(Ct=+Ct,Sr=+Sr,!(Ct===this._x1&&Sr===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(Ct,Sr):this._context.moveTo(Ct,Sr);break;case 1:this._point=2;break;case 2:this._point=3,Vi(this,Qn(this,Jr=Hn(this,Ct,Sr)),Jr);break;default:Vi(this,this._t0,Jr=Hn(this,Ct,Sr));break}this._x0=this._x1,this._x1=Ct,this._y0=this._y1,this._y1=Sr,this._t0=Jr}}};function Jn(Ct){this._context=new Gt(Ct)}(Jn.prototype=Object.create(Kn.prototype)).point=function(Ct,Sr){Kn.prototype.point.call(this,Sr,Ct)};function Gt(Ct){this._context=Ct}Gt.prototype={moveTo:function(Ct,Sr){this._context.moveTo(Sr,Ct)},closePath:function(){this._context.closePath()},lineTo:function(Ct,Sr){this._context.lineTo(Sr,Ct)},bezierCurveTo:function(Ct,Sr,Jr,hi,hn,Sn){this._context.bezierCurveTo(Sr,Ct,hi,Jr,Sn,hn)}};function wt(Ct){return new Kn(Ct)}function tr(Ct){return new Jn(Ct)}function ir(Ct){this._context=Ct}ir.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var Ct=this._x,Sr=this._y,Jr=Ct.length;if(Jr)if(this._line?this._context.lineTo(Ct[0],Sr[0]):this._context.moveTo(Ct[0],Sr[0]),Jr===2)this._context.lineTo(Ct[1],Sr[1]);else for(var hi=wr(Ct),hn=wr(Sr),Sn=0,En=1;En<Jr;++Sn,++En)this._context.bezierCurveTo(hi[0][Sn],hn[0][Sn],hi[1][Sn],hn[1][Sn],Ct[En],Sr[En]);(this._line||this._line!==0&&Jr===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(Ct,Sr){this._x.push(+Ct),this._y.push(+Sr)}};function wr(Ct){var Sr,Jr=Ct.length-1,hi,hn=new Array(Jr),Sn=new Array(Jr),En=new Array(Jr);for(hn[0]=0,Sn[0]=2,En[0]=Ct[0]+2*Ct[1],Sr=1;Sr<Jr-1;++Sr)hn[Sr]=1,Sn[Sr]=4,En[Sr]=4*Ct[Sr]+2*Ct[Sr+1];for(hn[Jr-1]=2,Sn[Jr-1]=7,En[Jr-1]=8*Ct[Jr-1]+Ct[Jr],Sr=1;Sr<Jr;++Sr)hi=hn[Sr]/Sn[Sr-1],Sn[Sr]-=hi,En[Sr]-=hi*En[Sr-1];for(hn[Jr-1]=En[Jr-1]/Sn[Jr-1],Sr=Jr-2;Sr>=0;--Sr)hn[Sr]=(En[Sr]-hn[Sr+1])/Sn[Sr];for(Sn[Jr-1]=(Ct[Jr]+hn[Jr-1])/2,Sr=0;Sr<Jr-1;++Sr)Sn[Sr]=2*Ct[Sr+1]-hn[Sr+1];return[hn,Sn]}function Xr(Ct){return new ir(Ct)}function ti(Ct,Sr){this._context=Ct,this._t=Sr}ti.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(Ct,Sr){switch(Ct=+Ct,Sr=+Sr,this._point){case 0:this._point=1,this._line?this._context.lineTo(Ct,Sr):this._context.moveTo(Ct,Sr);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,Sr),this._context.lineTo(Ct,Sr);else{var Jr=this._x*(1-this._t)+Ct*this._t;this._context.lineTo(Jr,this._y),this._context.lineTo(Jr,Sr)}break}}this._x=Ct,this._y=Sr}};function $r(Ct){return new ti(Ct,.5)}function Ri(Ct){return new ti(Ct,0)}function Zi(Ct){return new ti(Ct,1)}function en(Ct,Sr){if((En=Ct.length)>1)for(var Jr=1,hi,hn,Sn=Ct[Sr[0]],En,ki=Sn.length;Jr<En;++Jr)for(hn=Sn,Sn=Ct[Sr[Jr]],hi=0;hi<ki;++hi)Sn[hi][1]+=Sn[hi][0]=isNaN(hn[hi][1])?hn[hi][0]:hn[hi][1]}function fn(Ct){for(var Sr=Ct.length,Jr=new Array(Sr);--Sr>=0;)Jr[Sr]=Sr;return Jr}function yn(Ct,Sr){return Ct[Sr]}function Mn(){var Ct=r([]),Sr=fn,Jr=en,hi=yn;function hn(Sn){var En=Ct.apply(this,arguments),ki,_n=Sn.length,ya=En.length,ea=new Array(ya),Ma;for(ki=0;ki<ya;++ki){for(var _o=En[ki],No=ea[ki]=new Array(_n),po=0,Lo;po<_n;++po)No[po]=Lo=[0,+hi(Sn[po],_o,po,Sn)],Lo.data=Sn[po];No.key=_o}for(ki=0,Ma=Sr(ea);ki<ya;++ki)ea[Ma[ki]].index=ki;return Jr(ea,Ma),ea}return hn.keys=function(Sn){return arguments.length?(Ct=typeof Sn=="function"?Sn:r(Ce.call(Sn)),hn):Ct},hn.value=function(Sn){return arguments.length?(hi=typeof Sn=="function"?Sn:r(+Sn),hn):hi},hn.order=function(Sn){return arguments.length?(Sr=Sn==null?fn:typeof Sn=="function"?Sn:r(Ce.call(Sn)),hn):Sr},hn.offset=function(Sn){return arguments.length?(Jr=Sn==null?en:Sn,hn):Jr},hn}function Ba(Ct,Sr){if((hi=Ct.length)>0){for(var Jr,hi,hn=0,Sn=Ct[0].length,En;hn<Sn;++hn){for(En=Jr=0;Jr<hi;++Jr)En+=Ct[Jr][hn][1]||0;if(En)for(Jr=0;Jr<hi;++Jr)Ct[Jr][hn][1]/=En}en(Ct,Sr)}}function ua(Ct,Sr){if((_n=Ct.length)>0)for(var Jr,hi=0,hn,Sn,En,ki,_n,ya=Ct[Sr[0]].length;hi<ya;++hi)for(En=ki=0,Jr=0;Jr<_n;++Jr)(Sn=(hn=Ct[Sr[Jr]][hi])[1]-hn[0])>0?(hn[0]=En,hn[1]=En+=Sn):Sn<0?(hn[1]=ki,hn[0]=ki+=Sn):(hn[0]=0,hn[1]=Sn)}function ma(Ct,Sr){if((hn=Ct.length)>0){for(var Jr=0,hi=Ct[Sr[0]],hn,Sn=hi.length;Jr<Sn;++Jr){for(var En=0,ki=0;En<hn;++En)ki+=Ct[En][Jr][1]||0;hi[Jr][1]+=hi[Jr][0]=-ki/2}en(Ct,Sr)}}function Wa(Ct,Sr){if(!(!((En=Ct.length)>0)||!((Sn=(hn=Ct[Sr[0]]).length)>0))){for(var Jr=0,hi=1,hn,Sn,En;hi<Sn;++hi){for(var ki=0,_n=0,ya=0;ki<En;++ki){for(var ea=Ct[Sr[ki]],Ma=ea[hi][1]||0,_o=ea[hi-1][1]||0,No=(Ma-_o)/2,po=0;po<ki;++po){var Lo=Ct[Sr[po]],ko=Lo[hi][1]||0,Ds=Lo[hi-1][1]||0;No+=ko-Ds}_n+=Ma,ya+=No*Ma}hn[hi-1][1]+=hn[hi-1][0]=Jr,_n&&(Jr-=ya/_n)}hn[hi-1][1]+=hn[hi-1][0]=Jr,en(Ct,Sr)}}function Fa(Ct){var Sr=Ct.map(Xo);return fn(Ct).sort(function(Jr,hi){return Sr[Jr]-Sr[hi]})}function Xo(Ct){for(var Sr=-1,Jr=0,hi=Ct.length,hn,Sn=-1/0;++Sr<hi;)(hn=+Ct[Sr][1])>Sn&&(Sn=hn,Jr=Sr);return Jr}function da(Ct){var Sr=Ct.map(jn);return fn(Ct).sort(function(Jr,hi){return Sr[Jr]-Sr[hi]})}function jn(Ct){for(var Sr=0,Jr=-1,hi=Ct.length,hn;++Jr<hi;)(hn=+Ct[Jr][1])&&(Sr+=hn);return Sr}function Ha(Ct){return da(Ct).reverse()}function vo(Ct){var Sr=Ct.length,Jr,hi,hn=Ct.map(jn),Sn=Fa(Ct),En=0,ki=0,_n=[],ya=[];for(Jr=0;Jr<Sr;++Jr)hi=Sn[Jr],En<ki?(En+=hn[hi],_n.push(hi)):(ki+=hn[hi],ya.push(hi));return ya.reverse().concat(_n)}function Gn(Ct){return fn(Ct).reverse()}e.arc=C,e.area=q,e.areaRadial=_e,e.curveBasis=Ar,e.curveBasisClosed=qr,e.curveBasisOpen=gt,e.curveBundle=Je,e.curveCardinal=xt,e.curveCardinalClosed=Kt,e.curveCardinalOpen=Mr,e.curveCatmullRom=Yr,e.curveCatmullRomClosed=Pi,e.curveCatmullRomOpen=mi,e.curveLinear=g,e.curveLinearClosed=Fn,e.curveMonotoneX=wt,e.curveMonotoneY=tr,e.curveNatural=Xr,e.curveStep=$r,e.curveStepAfter=Zi,e.curveStepBefore=Ri,e.line=z,e.lineRadial=ae,e.linkHorizontal=Le,e.linkRadial=Pe,e.linkVertical=me,e.pie=Z,e.pointRadial=Ee,e.radialArea=_e,e.radialLine=ae,e.stack=Mn,e.stackOffsetDiverging=ua,e.stackOffsetExpand=Ba,e.stackOffsetNone=en,e.stackOffsetSilhouette=ma,e.stackOffsetWiggle=Wa,e.stackOrderAppearance=Fa,e.stackOrderAscending=da,e.stackOrderDescending=Ha,e.stackOrderInsideOut=vo,e.stackOrderNone=fn,e.stackOrderReverse=Gn,e.symbol=pt,e.symbolCircle=ce,e.symbolCross=He,e.symbolDiamond=Ht,e.symbolSquare=tt,e.symbolStar=rr,e.symbolTriangle=Ue,e.symbolWye=dt,e.symbols=Et,Object.defineProperty(e,"__esModule",{value:!0})})});var QWe=ye((P7,$We)=>{(function(e,t){typeof P7=="object"&&typeof $We!="undefined"?t(P7,dk(),S7(),QJ()):t(e.d3=e.d3||{},e.d3,e.d3,e.d3)})(P7,function(e,t,r,n){"use strict";function i(g){return g.target.depth}function a(g){return g.depth}function o(g,P){return P-1-g.height}function s(g,P){return g.sourceLinks.length?g.depth:P-1}function l(g){return g.targetLinks.length?g.depth:g.sourceLinks.length?t.min(g.sourceLinks,i)-1:0}function u(g){return function(){return g}}function c(g,P){return h(g.source,P.source)||g.index-P.index}function f(g,P){return h(g.target,P.target)||g.index-P.index}function h(g,P){return g.y0-P.y0}function d(g){return g.value}function v(g){return(g.y0+g.y1)/2}function m(g){return v(g.source)*g.value}function b(g){return v(g.target)*g.value}function p(g){return g.index}function k(g){return g.nodes}function M(g){return g.links}function T(g,P){var E=g.get(P);if(!E)throw new Error("missing: "+P);return E}var L=function(){var g=0,P=0,E=1,z=1,q=24,V=8,G=p,Z=s,j=k,N=M,H=32,ie=2/3;function ae(){var Se={nodes:j.apply(null,arguments),links:N.apply(null,arguments)};return _e(Se),Ee(Se),Ce(Se),ge(Se,H),re(Se),Se}ae.update=function(Se){return re(Se),Se},ae.nodeId=function(Se){return arguments.length?(G=typeof Se=="function"?Se:u(Se),ae):G},ae.nodeAlign=function(Se){return arguments.length?(Z=typeof Se=="function"?Se:u(Se),ae):Z},ae.nodeWidth=function(Se){return arguments.length?(q=+Se,ae):q},ae.nodePadding=function(Se){return arguments.length?(V=+Se,ae):V},ae.nodes=function(Se){return arguments.length?(j=typeof Se=="function"?Se:u(Se),ae):j},ae.links=function(Se){return arguments.length?(N=typeof Se=="function"?Se:u(Se),ae):N},ae.size=function(Se){return arguments.length?(g=P=0,E=+Se[0],z=+Se[1],ae):[E-g,z-P]},ae.extent=function(Se){return arguments.length?(g=+Se[0][0],E=+Se[1][0],P=+Se[0][1],z=+Se[1][1],ae):[[g,P],[E,z]]},ae.iterations=function(Se){return arguments.length?(H=+Se,ae):H};function _e(Se){Se.nodes.forEach(function(be,Be){be.index=Be,be.sourceLinks=[],be.targetLinks=[]});var ke=r.map(Se.nodes,G);Se.links.forEach(function(be,Be){be.index=Be;var Le=be.source,me=be.target;typeof Le!="object"&&(Le=be.source=T(ke,Le)),typeof me!="object"&&(me=be.target=T(ke,me)),Le.sourceLinks.push(be),me.targetLinks.push(be)})}function Ee(Se){Se.nodes.forEach(function(ke){ke.value=Math.max(t.sum(ke.sourceLinks,d),t.sum(ke.targetLinks,d))})}function Ce(Se){var ke,be,Be;for(ke=Se.nodes,be=[],Be=0;ke.length;++Be,ke=be,be=[])ke.forEach(function(me){me.depth=Be,me.sourceLinks.forEach(function(Pe){be.indexOf(Pe.target)<0&&be.push(Pe.target)})});for(ke=Se.nodes,be=[],Be=0;ke.length;++Be,ke=be,be=[])ke.forEach(function(me){me.height=Be,me.targetLinks.forEach(function(Pe){be.indexOf(Pe.source)<0&&be.push(Pe.source)})});var Le=(E-g-q)/(Be-1);Se.nodes.forEach(function(me){me.x1=(me.x0=g+Math.max(0,Math.min(Be-1,Math.floor(Z.call(null,me,Be))))*Le)+q})}function ge(Se){var ke=r.nest().key(function(He){return He.x0}).sortKeys(t.ascending).entries(Se.nodes).map(function(He){return He.values});Le(),ce();for(var be=1,Be=H;Be>0;--Be)Pe(be*=.99),ce(),me(be),ce();function Le(){var He=t.max(ke,function(Ht){return Ht.length}),lt=ie*(z-P)/(He-1);V>lt&&(V=lt);var mt=t.min(ke,function(Ht){return(z-P-(Ht.length-1)*V)/t.sum(Ht,d)});ke.forEach(function(Ht){Ht.forEach(function(at,ct){at.y1=(at.y0=ct)+at.value*mt})}),Se.links.forEach(function(Ht){Ht.width=Ht.value*mt})}function me(He){ke.forEach(function(lt){lt.forEach(function(mt){if(mt.targetLinks.length){var Ht=(t.sum(mt.targetLinks,m)/t.sum(mt.targetLinks,d)-v(mt))*He;mt.y0+=Ht,mt.y1+=Ht}})})}function Pe(He){ke.slice().reverse().forEach(function(lt){lt.forEach(function(mt){if(mt.sourceLinks.length){var Ht=(t.sum(mt.sourceLinks,b)/t.sum(mt.sourceLinks,d)-v(mt))*He;mt.y0+=Ht,mt.y1+=Ht}})})}function ce(){ke.forEach(function(He){var lt,mt,Ht=P,at=He.length,ct;for(He.sort(h),ct=0;ct<at;++ct)lt=He[ct],mt=Ht-lt.y0,mt>0&&(lt.y0+=mt,lt.y1+=mt),Ht=lt.y1+V;if(mt=Ht-V-z,mt>0)for(Ht=lt.y0-=mt,lt.y1-=mt,ct=at-2;ct>=0;--ct)lt=He[ct],mt=lt.y1+V-Ht,mt>0&&(lt.y0-=mt,lt.y1-=mt),Ht=lt.y0})}}function re(Se){Se.nodes.forEach(function(ke){ke.sourceLinks.sort(f),ke.targetLinks.sort(c)}),Se.nodes.forEach(function(ke){var be=ke.y0,Be=be;ke.sourceLinks.forEach(function(Le){Le.y0=be+Le.width/2,be+=Le.width}),ke.targetLinks.forEach(function(Le){Le.y1=Be+Le.width/2,Be+=Le.width})})}return ae};function x(g){return[g.source.x1,g.y0]}function C(g){return[g.target.x0,g.y1]}var S=function(){return n.linkHorizontal().source(x).target(C)};e.sankey=L,e.sankeyCenter=l,e.sankeyLeft=a,e.sankeyRight=o,e.sankeyJustify=s,e.sankeyLinkHorizontal=S,Object.defineProperty(e,"__esModule",{value:!0})})});var tXe=ye((w2r,eXe)=>{var rYt=$J();eXe.exports=function(t,r){var n=[],i=[],a=[],o={},s=[],l;function u(M){a[M]=!1,o.hasOwnProperty(M)&&Object.keys(o[M]).forEach(function(T){delete o[M][T],a[T]&&u(T)})}function c(M){var T=!1;i.push(M),a[M]=!0;var L,x;for(L=0;L<s[M].length;L++)x=s[M][L],x===l?(f(l,i),T=!0):a[x]||(T=c(x));if(T)u(M);else for(L=0;L<s[M].length;L++){x=s[M][L];var C=o[x];C||(C={},o[x]=C),C[x]=!0}return i.pop(),T}function f(M,T){var L=[].concat(T).concat(M);r?r(c):n.push(L)}function h(M){for(var T=0;T<t.length;T++)T<M&&(t[T]=[]),t[T]=t[T].filter(function(L){return L>=M})}function d(M){h(M);for(var T=t,L=rYt(T),x=L.components.filter(function(q){return q.length>1}),C=1/0,S,g=0;g<x.length;g++)for(var P=0;P<x[g].length;P++)x[g][P]<C&&(C=x[g][P],S=g);var E=x[S];if(!E)return!1;var z=t.map(function(q,V){return E.indexOf(V)===-1?[]:q.filter(function(G){return E.indexOf(G)!==-1})});return{leastVertex:C,adjList:z}}l=0;for(var v=t.length;l<v;){var m=d(l);if(l=m.leastVertex,s=m.adjList,s){for(var b=0;b<s.length;b++)for(var p=0;p<s[b].length;p++){var k=s[b][p];a[+k]=!1,o[k]={}}c(l),l=l+1}else l=v}if(!r)return n}});var iXe=ye((I7,rXe)=>{(function(e,t){typeof I7=="object"&&typeof rXe!="undefined"?t(I7,dk(),S7(),QJ(),tXe()):t(e.d3=e.d3||{},e.d3,e.d3,e.d3,null)})(I7,function(e,t,r,n,i){"use strict";i=i&&i.hasOwnProperty("default")?i.default:i;function a(at){return at.target.depth}function o(at){return at.depth}function s(at,ct){return ct-1-at.height}function l(at,ct){return at.sourceLinks.length?at.depth:ct-1}function u(at){return at.targetLinks.length?at.depth:at.sourceLinks.length?t.min(at.sourceLinks,a)-1:0}function c(at){return function(){return at}}var f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(at){return typeof at}:function(at){return at&&typeof Symbol=="function"&&at.constructor===Symbol&&at!==Symbol.prototype?"symbol":typeof at};function h(at,ct){return v(at.source,ct.source)||at.index-ct.index}function d(at,ct){return v(at.target,ct.target)||at.index-ct.index}function v(at,ct){return at.partOfCycle===ct.partOfCycle?at.y0-ct.y0:at.circularLinkType==="top"||ct.circularLinkType==="bottom"?-1:1}function m(at){return at.value}function b(at){return(at.y0+at.y1)/2}function p(at){return b(at.source)}function k(at){return b(at.target)}function M(at){return at.index}function T(at){return at.nodes}function L(at){return at.links}function x(at,ct){var ar=at.get(ct);if(!ar)throw new Error("missing: "+ct);return ar}function C(at,ct){return ct(at)}var S=25,g=10,P=.3;function E(){var at=0,ct=0,ar=1,Vt=1,rr=24,tt,je=M,Ue=l,Ae=T,rt=L,St=32,Tt=2,dt,Et=null;function pt(){var gt={nodes:Ae.apply(null,arguments),links:rt.apply(null,arguments)};jt(gt),z(gt,je,Et),or(gt),ei(gt),q(gt,je),qr(gt,St,je),jr(gt);for(var Ge=4,Je=0;Je<Ge;Je++)Pe(gt,Vt,je),ce(gt,Vt,je),Be(gt,ct,Vt,je),Pe(gt,Vt,je),ce(gt,Vt,je);return Ht(gt,ct,Vt),H(gt,Tt,Vt,je),gt}pt.nodeId=function(gt){return arguments.length?(je=typeof gt=="function"?gt:c(gt),pt):je},pt.nodeAlign=function(gt){return arguments.length?(Ue=typeof gt=="function"?gt:c(gt),pt):Ue},pt.nodeWidth=function(gt){return arguments.length?(rr=+gt,pt):rr},pt.nodePadding=function(gt){return arguments.length?(tt=+gt,pt):tt},pt.nodes=function(gt){return arguments.length?(Ae=typeof gt=="function"?gt:c(gt),pt):Ae},pt.links=function(gt){return arguments.length?(rt=typeof gt=="function"?gt:c(gt),pt):rt},pt.size=function(gt){return arguments.length?(at=ct=0,ar=+gt[0],Vt=+gt[1],pt):[ar-at,Vt-ct]},pt.extent=function(gt){return arguments.length?(at=+gt[0][0],ar=+gt[1][0],ct=+gt[0][1],Vt=+gt[1][1],pt):[[at,ct],[ar,Vt]]},pt.iterations=function(gt){return arguments.length?(St=+gt,pt):St},pt.circularLinkGap=function(gt){return arguments.length?(Tt=+gt,pt):Tt},pt.nodePaddingRatio=function(gt){return arguments.length?(dt=+gt,pt):dt},pt.sortNodes=function(gt){return arguments.length?(Et=gt,pt):Et},pt.update=function(gt){return q(gt,je),jr(gt),gt.links.forEach(function(Ge){Ge.circular&&(Ge.circularLinkType=Ge.y0+Ge.y1<Vt?"top":"bottom",Ge.source.circularLinkType=Ge.circularLinkType,Ge.target.circularLinkType=Ge.circularLinkType)}),Pe(gt,Vt,je,!1),ce(gt,Vt,je),H(gt,Tt,Vt,je),gt};function jt(gt){gt.nodes.forEach(function(Je,We){Je.index=We,Je.sourceLinks=[],Je.targetLinks=[]});var Ge=r.map(gt.nodes,je);return gt.links.forEach(function(Je,We){Je.index=We;var et=Je.source,xt=Je.target;(typeof et=="undefined"?"undefined":f(et))!=="object"&&(et=Je.source=x(Ge,et)),(typeof xt=="undefined"?"undefined":f(xt))!=="object"&&(xt=Je.target=x(Ge,xt)),et.sourceLinks.push(Je),xt.targetLinks.push(Je)}),gt}function or(gt){gt.nodes.forEach(function(Ge){Ge.partOfCycle=!1,Ge.value=Math.max(t.sum(Ge.sourceLinks,m),t.sum(Ge.targetLinks,m)),Ge.sourceLinks.forEach(function(Je){Je.circular&&(Ge.partOfCycle=!0,Ge.circularLinkType=Je.circularLinkType)}),Ge.targetLinks.forEach(function(Je){Je.circular&&(Ge.partOfCycle=!0,Ge.circularLinkType=Je.circularLinkType)})})}function mr(gt){var Ge=0,Je=0,We=0,et=0,xt=t.max(gt.nodes,function(At){return At.column});return gt.links.forEach(function(At){At.circular&&(At.circularLinkType=="top"?Ge=Ge+At.width:Je=Je+At.width,At.target.column==0&&(et=et+At.width),At.source.column==xt&&(We=We+At.width))}),Ge=Ge>0?Ge+S+g:Ge,Je=Je>0?Je+S+g:Je,We=We>0?We+S+g:We,et=et>0?et+S+g:et,{top:Ge,bottom:Je,left:et,right:We}}function Ar(gt,Ge){var Je=t.max(gt.nodes,function(Mr){return Mr.column}),We=ar-at,et=Vt-ct,xt=We+Ge.right+Ge.left,At=et+Ge.top+Ge.bottom,Kt=We/xt,Qt=et/At;return at=at*Kt+Ge.left,ar=Ge.right==0?ar:ar*Kt,ct=ct*Qt+Ge.top,Vt=Vt*Qt,gt.nodes.forEach(function(Mr){Mr.x0=at+Mr.column*((ar-at-rr)/Je),Mr.x1=Mr.x0+rr}),Qt}function ei(gt){var Ge,Je,We;for(Ge=gt.nodes,Je=[],We=0;Ge.length;++We,Ge=Je,Je=[])Ge.forEach(function(et){et.depth=We,et.sourceLinks.forEach(function(xt){Je.indexOf(xt.target)<0&&!xt.circular&&Je.push(xt.target)})});for(Ge=gt.nodes,Je=[],We=0;Ge.length;++We,Ge=Je,Je=[])Ge.forEach(function(et){et.height=We,et.targetLinks.forEach(function(xt){Je.indexOf(xt.source)<0&&!xt.circular&&Je.push(xt.source)})});gt.nodes.forEach(function(et){et.column=Math.floor(Ue.call(null,et,We))})}function qr(gt,Ge,Je){var We=r.nest().key(function(Mr){return Mr.column}).sortKeys(t.ascending).entries(gt.nodes).map(function(Mr){return Mr.values});At(Je),Qt();for(var et=1,xt=Ge;xt>0;--xt)Kt(et*=.99,Je),Qt();function At(Mr){if(dt){var Gr=1/0;We.forEach(function(Pi){var ai=Vt*dt/(Pi.length+1);Gr=ai<Gr?ai:Gr}),tt=Gr}var Ir=t.min(We,function(Pi){return(Vt-ct-(Pi.length-1)*tt)/t.sum(Pi,m)});Ir=Ir*P,gt.links.forEach(function(Pi){Pi.width=Pi.value*Ir});var Yr=mr(gt),_i=Ar(gt,Yr);Ir=Ir*_i,gt.links.forEach(function(Pi){Pi.width=Pi.value*Ir}),We.forEach(function(Pi){var ai=Pi.length;Pi.forEach(function(mi,un){mi.depth==We.length-1&&ai==1||mi.depth==0&&ai==1?(mi.y0=Vt/2-mi.value*Ir,mi.y1=mi.y0+mi.value*Ir):mi.partOfCycle?Z(mi,Mr)==0?(mi.y0=Vt/2+un,mi.y1=mi.y0+mi.value*Ir):mi.circularLinkType=="top"?(mi.y0=ct+un,mi.y1=mi.y0+mi.value*Ir):(mi.y0=Vt-mi.value*Ir-un,mi.y1=mi.y0+mi.value*Ir):Yr.top==0||Yr.bottom==0?(mi.y0=(Vt-ct)/ai*un,mi.y1=mi.y0+mi.value*Ir):(mi.y0=(Vt-ct)/2-ai/2+un,mi.y1=mi.y0+mi.value*Ir)})})}function Kt(Mr,Gr){var Ir=We.length;We.forEach(function(Yr){var _i=Yr.length,Pi=Yr[0].depth;Yr.forEach(function(ai){var mi;if((ai.sourceLinks.length||ai.targetLinks.length)&&!(ai.partOfCycle&&Z(ai,Gr)>0))if(Pi==0&&_i==1)mi=ai.y1-ai.y0,ai.y0=Vt/2-mi/2,ai.y1=Vt/2+mi/2;else if(Pi==Ir-1&&_i==1)mi=ai.y1-ai.y0,ai.y0=Vt/2-mi/2,ai.y1=Vt/2+mi/2;else{var un=0,Fn=t.mean(ai.sourceLinks,k),An=t.mean(ai.targetLinks,p);Fn&&An?un=(Fn+An)/2:un=Fn||An;var Hn=(un-b(ai))*Mr;ai.y0+=Hn,ai.y1+=Hn}})})}function Qt(){We.forEach(function(Mr){var Gr,Ir,Yr=ct,_i=Mr.length,Pi;for(Mr.sort(v),Pi=0;Pi<_i;++Pi)Gr=Mr[Pi],Ir=Yr-Gr.y0,Ir>0&&(Gr.y0+=Ir,Gr.y1+=Ir),Yr=Gr.y1+tt;if(Ir=Yr-tt-Vt,Ir>0)for(Yr=Gr.y0-=Ir,Gr.y1-=Ir,Pi=_i-2;Pi>=0;--Pi)Gr=Mr[Pi],Ir=Gr.y1+tt-Yr,Ir>0&&(Gr.y0-=Ir,Gr.y1-=Ir),Yr=Gr.y0})}}function jr(gt){gt.nodes.forEach(function(Ge){Ge.sourceLinks.sort(d),Ge.targetLinks.sort(h)}),gt.nodes.forEach(function(Ge){var Je=Ge.y0,We=Je,et=Ge.y1,xt=et;Ge.sourceLinks.forEach(function(At){At.circular?(At.y0=et-At.width/2,et=et-At.width):(At.y0=Je+At.width/2,Je+=At.width)}),Ge.targetLinks.forEach(function(At){At.circular?(At.y1=xt-At.width/2,xt=xt-At.width):(At.y1=We+At.width/2,We+=At.width)})})}return pt}function z(at,ct,ar){var Vt=0;if(ar===null){for(var rr=[],tt=0;tt<at.links.length;tt++){var je=at.links[tt],Ue=je.source.index,Ae=je.target.index;rr[Ue]||(rr[Ue]=[]),rr[Ae]||(rr[Ae]=[]),rr[Ue].indexOf(Ae)===-1&&rr[Ue].push(Ae)}var rt=i(rr);rt.sort(function(Et,pt){return Et.length-pt.length});var St={};for(tt=0;tt<rt.length;tt++){var Tt=rt[tt],dt=Tt.slice(-2);St[dt[0]]||(St[dt[0]]={}),St[dt[0]][dt[1]]=!0}at.links.forEach(function(Et){var pt=Et.target.index,jt=Et.source.index;pt===jt||St[jt]&&St[jt][pt]?(Et.circular=!0,Et.circularLinkID=Vt,Vt=Vt+1):Et.circular=!1})}else at.links.forEach(function(Et){Et.source[ar]<Et.target[ar]?Et.circular=!1:(Et.circular=!0,Et.circularLinkID=Vt,Vt=Vt+1)})}function q(at,ct){var ar=0,Vt=0;at.links.forEach(function(rr){rr.circular&&(rr.source.circularLinkType||rr.target.circularLinkType?rr.circularLinkType=rr.source.circularLinkType?rr.source.circularLinkType:rr.target.circularLinkType:rr.circularLinkType=ar<Vt?"top":"bottom",rr.circularLinkType=="top"?ar=ar+1:Vt=Vt+1,at.nodes.forEach(function(tt){(C(tt,ct)==C(rr.source,ct)||C(tt,ct)==C(rr.target,ct))&&(tt.circularLinkType=rr.circularLinkType)}))}),at.links.forEach(function(rr){rr.circular&&(rr.source.circularLinkType==rr.target.circularLinkType&&(rr.circularLinkType=rr.source.circularLinkType),mt(rr,ct)&&(rr.circularLinkType=rr.source.circularLinkType))})}function V(at){var ct=Math.abs(at.y1-at.y0),ar=Math.abs(at.target.x0-at.source.x1);return Math.atan(ar/ct)}function G(at,ct){return at.source.column<ct.target.column?!1:!(at.target.column>ct.source.column)}function Z(at,ct){var ar=0;at.sourceLinks.forEach(function(rr){ar=rr.circular&&!mt(rr,ct)?ar+1:ar});var Vt=0;return at.targetLinks.forEach(function(rr){Vt=rr.circular&&!mt(rr,ct)?Vt+1:Vt}),ar+Vt}function j(at){var ct=at.source.sourceLinks,ar=0;ct.forEach(function(tt){ar=tt.circular?ar+1:ar});var Vt=at.target.targetLinks,rr=0;return Vt.forEach(function(tt){rr=tt.circular?rr+1:rr}),!(ar>1||rr>1)}function N(at,ct,ar){return at.sort(ae),at.forEach(function(Vt,rr){var tt=0;if(mt(Vt,ar)&&j(Vt))Vt.circularPathData.verticalBuffer=tt+Vt.width/2;else{var je=0;for(je;je<rr;je++)if(G(at[rr],at[je])){var Ue=at[je].circularPathData.verticalBuffer+at[je].width/2+ct;tt=Ue>tt?Ue:tt}Vt.circularPathData.verticalBuffer=tt+Vt.width/2}}),at}function H(at,ct,ar,Vt){var rr=5,tt=t.min(at.links,function(Ae){return Ae.source.y0});at.links.forEach(function(Ae){Ae.circular&&(Ae.circularPathData={})});var je=at.links.filter(function(Ae){return Ae.circularLinkType=="top"});N(je,ct,Vt);var Ue=at.links.filter(function(Ae){return Ae.circularLinkType=="bottom"});N(Ue,ct,Vt),at.links.forEach(function(Ae){if(Ae.circular){if(Ae.circularPathData.arcRadius=Ae.width+g,Ae.circularPathData.leftNodeBuffer=rr,Ae.circularPathData.rightNodeBuffer=rr,Ae.circularPathData.sourceWidth=Ae.source.x1-Ae.source.x0,Ae.circularPathData.sourceX=Ae.source.x0+Ae.circularPathData.sourceWidth,Ae.circularPathData.targetX=Ae.target.x0,Ae.circularPathData.sourceY=Ae.y0,Ae.circularPathData.targetY=Ae.y1,mt(Ae,Vt)&&j(Ae))Ae.circularPathData.leftSmallArcRadius=g+Ae.width/2,Ae.circularPathData.leftLargeArcRadius=g+Ae.width/2,Ae.circularPathData.rightSmallArcRadius=g+Ae.width/2,Ae.circularPathData.rightLargeArcRadius=g+Ae.width/2,Ae.circularLinkType=="bottom"?(Ae.circularPathData.verticalFullExtent=Ae.source.y1+S+Ae.circularPathData.verticalBuffer,Ae.circularPathData.verticalLeftInnerExtent=Ae.circularPathData.verticalFullExtent-Ae.circularPathData.leftLargeArcRadius,Ae.circularPathData.verticalRightInnerExtent=Ae.circularPathData.verticalFullExtent-Ae.circularPathData.rightLargeArcRadius):(Ae.circularPathData.verticalFullExtent=Ae.source.y0-S-Ae.circularPathData.verticalBuffer,Ae.circularPathData.verticalLeftInnerExtent=Ae.circularPathData.verticalFullExtent+Ae.circularPathData.leftLargeArcRadius,Ae.circularPathData.verticalRightInnerExtent=Ae.circularPathData.verticalFullExtent+Ae.circularPathData.rightLargeArcRadius);else{var rt=Ae.source.column,St=Ae.circularLinkType,Tt=at.links.filter(function(pt){return pt.source.column==rt&&pt.circularLinkType==St});Ae.circularLinkType=="bottom"?Tt.sort(Ee):Tt.sort(_e);var dt=0;Tt.forEach(function(pt,jt){pt.circularLinkID==Ae.circularLinkID&&(Ae.circularPathData.leftSmallArcRadius=g+Ae.width/2+dt,Ae.circularPathData.leftLargeArcRadius=g+Ae.width/2+jt*ct+dt),dt=dt+pt.width}),rt=Ae.target.column,Tt=at.links.filter(function(pt){return pt.target.column==rt&&pt.circularLinkType==St}),Ae.circularLinkType=="bottom"?Tt.sort(ge):Tt.sort(Ce),dt=0,Tt.forEach(function(pt,jt){pt.circularLinkID==Ae.circularLinkID&&(Ae.circularPathData.rightSmallArcRadius=g+Ae.width/2+dt,Ae.circularPathData.rightLargeArcRadius=g+Ae.width/2+jt*ct+dt),dt=dt+pt.width}),Ae.circularLinkType=="bottom"?(Ae.circularPathData.verticalFullExtent=Math.max(ar,Ae.source.y1,Ae.target.y1)+S+Ae.circularPathData.verticalBuffer,Ae.circularPathData.verticalLeftInnerExtent=Ae.circularPathData.verticalFullExtent-Ae.circularPathData.leftLargeArcRadius,Ae.circularPathData.verticalRightInnerExtent=Ae.circularPathData.verticalFullExtent-Ae.circularPathData.rightLargeArcRadius):(Ae.circularPathData.verticalFullExtent=tt-S-Ae.circularPathData.verticalBuffer,Ae.circularPathData.verticalLeftInnerExtent=Ae.circularPathData.verticalFullExtent+Ae.circularPathData.leftLargeArcRadius,Ae.circularPathData.verticalRightInnerExtent=Ae.circularPathData.verticalFullExtent+Ae.circularPathData.rightLargeArcRadius)}Ae.circularPathData.leftInnerExtent=Ae.circularPathData.sourceX+Ae.circularPathData.leftNodeBuffer,Ae.circularPathData.rightInnerExtent=Ae.circularPathData.targetX-Ae.circularPathData.rightNodeBuffer,Ae.circularPathData.leftFullExtent=Ae.circularPathData.sourceX+Ae.circularPathData.leftLargeArcRadius+Ae.circularPathData.leftNodeBuffer,Ae.circularPathData.rightFullExtent=Ae.circularPathData.targetX-Ae.circularPathData.rightLargeArcRadius-Ae.circularPathData.rightNodeBuffer}if(Ae.circular)Ae.path=ie(Ae);else{var Et=n.linkHorizontal().source(function(pt){var jt=pt.source.x0+(pt.source.x1-pt.source.x0),or=pt.y0;return[jt,or]}).target(function(pt){var jt=pt.target.x0,or=pt.y1;return[jt,or]});Ae.path=Et(Ae)}})}function ie(at){var ct="";return at.circularLinkType=="top"?ct="M"+at.circularPathData.sourceX+" "+at.circularPathData.sourceY+" L"+at.circularPathData.leftInnerExtent+" "+at.circularPathData.sourceY+" A"+at.circularPathData.leftLargeArcRadius+" "+at.circularPathData.leftSmallArcRadius+" 0 0 0 "+at.circularPathData.leftFullExtent+" "+(at.circularPathData.sourceY-at.circularPathData.leftSmallArcRadius)+" L"+at.circularPathData.leftFullExtent+" "+at.circularPathData.verticalLeftInnerExtent+" A"+at.circularPathData.leftLargeArcRadius+" "+at.circularPathData.leftLargeArcRadius+" 0 0 0 "+at.circularPathData.leftInnerExtent+" "+at.circularPathData.verticalFullExtent+" L"+at.circularPathData.rightInnerExtent+" "+at.circularPathData.verticalFullExtent+" A"+at.circularPathData.rightLargeArcRadius+" "+at.circularPathData.rightLargeArcRadius+" 0 0 0 "+at.circularPathData.rightFullExtent+" "+at.circularPathData.verticalRightInnerExtent+" L"+at.circularPathData.rightFullExtent+" "+(at.circularPathData.targetY-at.circularPathData.rightSmallArcRadius)+" A"+at.circularPathData.rightLargeArcRadius+" "+at.circularPathData.rightSmallArcRadius+" 0 0 0 "+at.circularPathData.rightInnerExtent+" "+at.circularPathData.targetY+" L"+at.circularPathData.targetX+" "+at.circularPathData.targetY:ct="M"+at.circularPathData.sourceX+" "+at.circularPathData.sourceY+" L"+at.circularPathData.leftInnerExtent+" "+at.circularPathData.sourceY+" A"+at.circularPathData.leftLargeArcRadius+" "+at.circularPathData.leftSmallArcRadius+" 0 0 1 "+at.circularPathData.leftFullExtent+" "+(at.circularPathData.sourceY+at.circularPathData.leftSmallArcRadius)+" L"+at.circularPathData.leftFullExtent+" "+at.circularPathData.verticalLeftInnerExtent+" A"+at.circularPathData.leftLargeArcRadius+" "+at.circularPathData.leftLargeArcRadius+" 0 0 1 "+at.circularPathData.leftInnerExtent+" "+at.circularPathData.verticalFullExtent+" L"+at.circularPathData.rightInnerExtent+" "+at.circularPathData.verticalFullExtent+" A"+at.circularPathData.rightLargeArcRadius+" "+at.circularPathData.rightLargeArcRadius+" 0 0 1 "+at.circularPathData.rightFullExtent+" "+at.circularPathData.verticalRightInnerExtent+" L"+at.circularPathData.rightFullExtent+" "+(at.circularPathData.targetY+at.circularPathData.rightSmallArcRadius)+" A"+at.circularPathData.rightLargeArcRadius+" "+at.circularPathData.rightSmallArcRadius+" 0 0 1 "+at.circularPathData.rightInnerExtent+" "+at.circularPathData.targetY+" L"+at.circularPathData.targetX+" "+at.circularPathData.targetY,ct}function ae(at,ct){return re(at)==re(ct)?at.circularLinkType=="bottom"?Ee(at,ct):_e(at,ct):re(ct)-re(at)}function _e(at,ct){return at.y0-ct.y0}function Ee(at,ct){return ct.y0-at.y0}function Ce(at,ct){return at.y1-ct.y1}function ge(at,ct){return ct.y1-at.y1}function re(at){return at.target.column-at.source.column}function Se(at){return at.target.x0-at.source.x1}function ke(at,ct){var ar=V(at),Vt=Se(ct)/Math.tan(ar),rr=lt(at)=="up"?at.y1+Vt:at.y1-Vt;return rr}function be(at,ct){var ar=V(at),Vt=Se(ct)/Math.tan(ar),rr=lt(at)=="up"?at.y1-Vt:at.y1+Vt;return rr}function Be(at,ct,ar,Vt){at.links.forEach(function(rr){if(!rr.circular&&rr.target.column-rr.source.column>1){var tt=rr.source.column+1,je=rr.target.column-1,Ue=1,Ae=je-tt+1;for(Ue=1;tt<=je;tt++,Ue++)at.nodes.forEach(function(rt){if(rt.column==tt){var St=Ue/(Ae+1),Tt=Math.pow(1-St,3),dt=3*St*Math.pow(1-St,2),Et=3*Math.pow(St,2)*(1-St),pt=Math.pow(St,3),jt=Tt*rr.y0+dt*rr.y0+Et*rr.y1+pt*rr.y1,or=jt-rr.width/2,mr=jt+rr.width/2,Ar;or>rt.y0&&or<rt.y1?(Ar=rt.y1-or+10,Ar=rt.circularLinkType=="bottom"?Ar:-Ar,rt=me(rt,Ar,ct,ar),at.nodes.forEach(function(ei){C(ei,Vt)==C(rt,Vt)||ei.column!=rt.column||Le(rt,ei)&&me(ei,Ar,ct,ar)})):mr>rt.y0&&mr<rt.y1?(Ar=mr-rt.y0+10,rt=me(rt,Ar,ct,ar),at.nodes.forEach(function(ei){C(ei,Vt)==C(rt,Vt)||ei.column!=rt.column||ei.y0<rt.y1&&ei.y1>rt.y1&&me(ei,Ar,ct,ar)})):or<rt.y0&&mr>rt.y1&&(Ar=mr-rt.y0+10,rt=me(rt,Ar,ct,ar),at.nodes.forEach(function(ei){C(ei,Vt)==C(rt,Vt)||ei.column!=rt.column||ei.y0<rt.y1&&ei.y1>rt.y1&&me(ei,Ar,ct,ar)}))}})}})}function Le(at,ct){return at.y0>ct.y0&&at.y0<ct.y1||at.y1>ct.y0&&at.y1<ct.y1?!0:at.y0<ct.y0&&at.y1>ct.y1}function me(at,ct,ar,Vt){return at.y0+ct>=ar&&at.y1+ct<=Vt&&(at.y0=at.y0+ct,at.y1=at.y1+ct,at.targetLinks.forEach(function(rr){rr.y1=rr.y1+ct}),at.sourceLinks.forEach(function(rr){rr.y0=rr.y0+ct})),at}function Pe(at,ct,ar,Vt){at.nodes.forEach(function(rr){Vt&&rr.y+(rr.y1-rr.y0)>ct&&(rr.y=rr.y-(rr.y+(rr.y1-rr.y0)-ct));var tt=at.links.filter(function(Ae){return C(Ae.source,ar)==C(rr,ar)}),je=tt.length;je>1&&tt.sort(function(Ae,rt){if(!Ae.circular&&!rt.circular){if(Ae.target.column==rt.target.column)return Ae.y1-rt.y1;if(He(Ae,rt)){if(Ae.target.column>rt.target.column){var St=be(rt,Ae);return Ae.y1-St}if(rt.target.column>Ae.target.column){var Tt=be(Ae,rt);return Tt-rt.y1}}else return Ae.y1-rt.y1}if(Ae.circular&&!rt.circular)return Ae.circularLinkType=="top"?-1:1;if(rt.circular&&!Ae.circular)return rt.circularLinkType=="top"?1:-1;if(Ae.circular&&rt.circular)return Ae.circularLinkType===rt.circularLinkType&&Ae.circularLinkType=="top"?Ae.target.column===rt.target.column?Ae.target.y1-rt.target.y1:rt.target.column-Ae.target.column:Ae.circularLinkType===rt.circularLinkType&&Ae.circularLinkType=="bottom"?Ae.target.column===rt.target.column?rt.target.y1-Ae.target.y1:Ae.target.column-rt.target.column:Ae.circularLinkType=="top"?-1:1});var Ue=rr.y0;tt.forEach(function(Ae){Ae.y0=Ue+Ae.width/2,Ue=Ue+Ae.width}),tt.forEach(function(Ae,rt){if(Ae.circularLinkType=="bottom"){var St=rt+1,Tt=0;for(St;St<je;St++)Tt=Tt+tt[St].width;Ae.y0=rr.y1-Tt-Ae.width/2}})})}function ce(at,ct,ar){at.nodes.forEach(function(Vt){var rr=at.links.filter(function(Ue){return C(Ue.target,ar)==C(Vt,ar)}),tt=rr.length;tt>1&&rr.sort(function(Ue,Ae){if(!Ue.circular&&!Ae.circular){if(Ue.source.column==Ae.source.column)return Ue.y0-Ae.y0;if(He(Ue,Ae)){if(Ae.source.column<Ue.source.column){var rt=ke(Ae,Ue);return Ue.y0-rt}if(Ue.source.column<Ae.source.column){var St=ke(Ue,Ae);return St-Ae.y0}}else return Ue.y0-Ae.y0}if(Ue.circular&&!Ae.circular)return Ue.circularLinkType=="top"?-1:1;if(Ae.circular&&!Ue.circular)return Ae.circularLinkType=="top"?1:-1;if(Ue.circular&&Ae.circular)return Ue.circularLinkType===Ae.circularLinkType&&Ue.circularLinkType=="top"?Ue.source.column===Ae.source.column?Ue.source.y1-Ae.source.y1:Ue.source.column-Ae.source.column:Ue.circularLinkType===Ae.circularLinkType&&Ue.circularLinkType=="bottom"?Ue.source.column===Ae.source.column?Ue.source.y1-Ae.source.y1:Ae.source.column-Ue.source.column:Ue.circularLinkType=="top"?-1:1});var je=Vt.y0;rr.forEach(function(Ue){Ue.y1=je+Ue.width/2,je=je+Ue.width}),rr.forEach(function(Ue,Ae){if(Ue.circularLinkType=="bottom"){var rt=Ae+1,St=0;for(rt;rt<tt;rt++)St=St+rr[rt].width;Ue.y1=Vt.y1-St-Ue.width/2}})})}function He(at,ct){return lt(at)==lt(ct)}function lt(at){return at.y0-at.y1>0?"up":"down"}function mt(at,ct){return C(at.source,ct)==C(at.target,ct)}function Ht(at,ct,ar){var Vt=at.nodes,rr=at.links,tt=!1,je=!1;if(rr.forEach(function(dt){dt.circularLinkType=="top"?tt=!0:dt.circularLinkType=="bottom"&&(je=!0)}),tt==!1||je==!1){var Ue=t.min(Vt,function(dt){return dt.y0}),Ae=t.max(Vt,function(dt){return dt.y1}),rt=Ae-Ue,St=ar-ct,Tt=St/rt;Vt.forEach(function(dt){var Et=(dt.y1-dt.y0)*Tt;dt.y0=(dt.y0-Ue)*Tt,dt.y1=dt.y0+Et}),rr.forEach(function(dt){dt.y0=(dt.y0-Ue)*Tt,dt.y1=(dt.y1-Ue)*Tt,dt.width=dt.width*Tt})}}e.sankeyCircular=E,e.sankeyCenter=u,e.sankeyLeft=o,e.sankeyRight=s,e.sankeyJustify=l,Object.defineProperty(e,"__esModule",{value:!0})})});var e$=ye((T2r,nXe)=>{"use strict";nXe.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}});var mXe=ye((A2r,gXe)=>{"use strict";var aXe=ZWe(),iYt=(j2(),gb(H2)).interpolateNumber,O5=qa(),oC=QWe(),nYt=iXe(),Nu=e$(),B5=fd(),yw=ka(),aYt=So(),w1=Pr(),i$=w1.strTranslate,oYt=w1.strRotate,n$=ny(),sC=n$.keyFun,R7=n$.repeat,fXe=n$.unwrap,oXe=Zl(),sYt=Oa(),hXe=Dh(),lYt=hXe.CAP_SHIFT,uYt=hXe.LINE_SPACING,cYt=3;function fYt(e,t,r){var n=fXe(t),i=n.trace,a=i.domain,o=i.orientation==="h",s=i.node.pad,l=i.node.thickness,u={justify:oC.sankeyJustify,left:oC.sankeyLeft,right:oC.sankeyRight,center:oC.sankeyCenter}[i.node.align],c=e.width*(a.x[1]-a.x[0]),f=e.height*(a.y[1]-a.y[0]),h=n._nodes,d=n._links,v=n.circular,m;v?m=nYt.sankeyCircular().circularLinkGap(0):m=oC.sankey(),m.iterations(Nu.sankeyIterations).size(o?[c,f]:[f,c]).nodeWidth(l).nodePadding(s).nodeId(function(V){return V.pointNumber}).nodeAlign(u).nodes(h).links(d);var b=m();m.nodePadding()<s&&w1.warn("node.pad was reduced to ",m.nodePadding()," to fit within the figure.");var p,k,M;for(var T in n._groupLookup){var L=parseInt(n._groupLookup[T]),x;for(p=0;p<b.nodes.length;p++)if(b.nodes[p].pointNumber===L){x=b.nodes[p];break}if(x){var C={pointNumber:parseInt(T),x0:x.x0,x1:x.x1,y0:x.y0,y1:x.y1,partOfGroup:!0,sourceLinks:[],targetLinks:[]};b.nodes.unshift(C),x.childrenNodes.unshift(C)}}function S(){for(p=0;p<b.nodes.length;p++){var V=b.nodes[p],G={},Z,j;for(k=0;k<V.targetLinks.length;k++)j=V.targetLinks[k],Z=j.source.pointNumber+":"+j.target.pointNumber,G.hasOwnProperty(Z)||(G[Z]=[]),G[Z].push(j);var N=Object.keys(G);for(k=0;k<N.length;k++){Z=N[k];var H=G[Z],ie=0,ae={};for(M=0;M<H.length;M++)j=H[M],ae[j.label]||(ae[j.label]=0),ae[j.label]+=j.value,ie+=j.value;for(M=0;M<H.length;M++)j=H[M],j.flow={value:ie,labelConcentration:ae[j.label]/ie,concentration:j.value/ie,links:H},j.concentrationscale&&(j.color=B5(j.concentrationscale(j.flow.labelConcentration)))}var _e=0;for(k=0;k<V.sourceLinks.length;k++)_e+=V.sourceLinks[k].value;for(k=0;k<V.sourceLinks.length;k++)j=V.sourceLinks[k],j.concentrationOut=j.value/_e;var Ee=0;for(k=0;k<V.targetLinks.length;k++)Ee+=V.targetLinks[k].value;for(k=0;k<V.targetLinks.length;k++)j=V.targetLinks[k],j.concenrationIn=j.value/Ee}}S();function g(V){V.forEach(function(G){var Z,j,N=0,H=G.length,ie;for(G.sort(function(ae,_e){return ae.y0-_e.y0}),ie=0;ie<H;++ie)Z=G[ie],Z.y0>=N||(j=N-Z.y0,j>1e-6&&(Z.y0+=j,Z.y1+=j)),N=Z.y1+s})}function P(V){var G=V.map(function(_e,Ee){return{x0:_e.x0,index:Ee}}).sort(function(_e,Ee){return _e.x0-Ee.x0}),Z=[],j=-1,N,H=-1/0,ie;for(p=0;p<G.length;p++){var ae=V[G[p].index];ae.x0>H+l&&(j+=1,N=ae.x0),H=ae.x0,Z[j]||(Z[j]=[]),Z[j].push(ae),ie=N-ae.x0,ae.x0+=ie,ae.x1+=ie}return Z}if(i.node.x.length&&i.node.y.length){for(p=0;p<Math.min(i.node.x.length,i.node.y.length,b.nodes.length);p++)if(i.node.x[p]&&i.node.y[p]){var E=[i.node.x[p]*c,i.node.y[p]*f];b.nodes[p].x0=E[0]-l/2,b.nodes[p].x1=E[0]+l/2;var z=b.nodes[p].y1-b.nodes[p].y0;b.nodes[p].y0=E[1]-z/2,b.nodes[p].y1=E[1]+z/2}if(i.arrangement==="snap"){h=b.nodes;var q=P(h);g(q)}m.update(b)}return{circular:v,key:r,trace:i,guid:w1.randstr(),horizontal:o,width:c,height:f,nodePad:i.node.pad,nodeLineColor:i.node.line.color,nodeLineWidth:i.node.line.width,linkLineColor:i.link.line.color,linkLineWidth:i.link.line.width,linkArrowLength:i.link.arrowlen,valueFormat:i.valueformat,valueSuffix:i.valuesuffix,textFont:i.textfont,translateX:a.x[0]*e.width+e.margin.l,translateY:e.height-a.y[1]*e.height+e.margin.t,dragParallel:o?f:c,dragPerpendicular:o?c:f,arrangement:i.arrangement,sankey:m,graph:b,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function hYt(e,t,r){var n=B5(t.color),i=B5(t.hovercolor),a=t.source.label+"|"+t.target.label,o=a+"__"+r;return t.trace=e.trace,t.curveNumber=e.trace.index,{circular:e.circular,key:o,traceId:e.key,pointNumber:t.pointNumber,link:t,tinyColorHue:yw.tinyRGB(n),tinyColorAlpha:n.getAlpha(),tinyColorHoverHue:yw.tinyRGB(i),tinyColorHoverAlpha:i.getAlpha(),linkPath:a$,linkLineColor:e.linkLineColor,linkLineWidth:e.linkLineWidth,linkArrowLength:e.linkArrowLength,valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,parent:e,interactionState:e.interactionState,flow:t.flow}}function dYt(e,t){var r="",n=e.width/2,i=e.circularPathData,a=i.sourceX+i.verticalBuffer<i.targetX,o=i.rightFullExtent-i.rightLargeArcRadius-t<=i.leftFullExtent-n,s=Math.abs(i.rightFullExtent-i.leftFullExtent-n)<n;return e.circularLinkType==="top"?(r="M "+(i.targetX-t)+" "+(i.targetY+n)+" L "+(i.rightInnerExtent-t)+" "+(i.targetY+n)+"A "+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 1 "+(i.rightFullExtent-n-t)+" "+(i.targetY-i.rightSmallArcRadius)+"L "+(i.rightFullExtent-n-t)+" "+i.verticalRightInnerExtent,a&&o?r+=" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 1 "+(i.rightFullExtent+n-t-(i.rightLargeArcRadius-n))+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius+n))+" L "+(i.rightFullExtent+n-(i.rightLargeArcRadius-n)-t)+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius+n))+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalRightInnerExtent:a?r+=" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 0 "+(i.rightFullExtent-n-t-(i.rightLargeArcRadius-n))+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius-n))+" L "+(i.leftFullExtent+n+(i.rightLargeArcRadius-n))+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius-n))+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:r+=" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 1 "+(i.rightInnerExtent-t)+" "+(i.verticalFullExtent-n)+" L "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent,r+=" L "+(i.leftFullExtent+n)+" "+(i.sourceY-i.leftSmallArcRadius)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.sourceY+n)+" L "+i.sourceX+" "+(i.sourceY+n)+" L "+i.sourceX+" "+(i.sourceY-n)+" L "+i.leftInnerExtent+" "+(i.sourceY-n)+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 0 "+(i.leftFullExtent-n)+" "+(i.sourceY-i.leftSmallArcRadius)+" L "+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent,a&&o?r+=" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+(i.leftFullExtent-n)+" "+(i.verticalFullExtent+n)+"L"+(i.rightFullExtent+n-t)+" "+(i.verticalFullExtent+n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent:a?r+=" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+(i.verticalFullExtent-n)+" L "+(i.rightFullExtent-n-t)+" "+(i.verticalFullExtent-n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent:r+=" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+" L "+(i.rightInnerExtent-t)+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 0 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent,r+=" L "+(i.rightFullExtent+n-t)+" "+(i.targetY-i.rightSmallArcRadius)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 0 "+(i.rightInnerExtent-t)+" "+(i.targetY-n)+" L "+(i.targetX-t)+" "+(i.targetY-n)+(t>0?" L "+i.targetX+" "+i.targetY:"")+"Z"):(r="M "+(i.targetX-t)+" "+(i.targetY-n)+" L "+(i.rightInnerExtent-t)+" "+(i.targetY-n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent-n-t)+" "+(i.targetY+i.rightSmallArcRadius)+" L "+(i.rightFullExtent-n-t)+" "+i.verticalRightInnerExtent,a&&o?r+=" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-n-t)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent+n-t-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:a?r+=" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent-t-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.leftFullExtent+n+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:r+=" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-t)+" "+(i.verticalFullExtent+n)+" L "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent,r+=" L "+(i.leftFullExtent+n)+" "+(i.sourceY+i.leftSmallArcRadius)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY+n)+" L "+i.leftInnerExtent+" "+(i.sourceY+n)+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n)+" "+(i.sourceY+i.leftSmallArcRadius)+" L "+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent,a&&o?r+=" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.rightFullExtent+n-t+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent:a?r+=" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent-t-n)+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent:r+=" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+" L "+(i.rightInnerExtent-t)+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent,r+=" L "+(i.rightFullExtent+n-t)+" "+(i.targetY+i.rightSmallArcRadius)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightInnerExtent-t)+" "+(i.targetY+n)+" L "+(i.targetX-t)+" "+(i.targetY+n)+(t>0?" L "+i.targetX+" "+i.targetY:"")+"Z"),r}function a$(){var e=.5;function t(r){var n=r.linkArrowLength;if(r.link.circular)return dYt(r.link,n);var i=Math.abs((r.link.target.x0-r.link.source.x1)/2);n>i&&(n=i);var a=r.link.source.x1,o=r.link.target.x0-n,s=iYt(a,o),l=s(e),u=s(1-e),c=r.link.y0-r.link.width/2,f=r.link.y0+r.link.width/2,h=r.link.y1-r.link.width/2,d=r.link.y1+r.link.width/2,v="M"+a+","+c,m="C"+l+","+c+" "+u+","+h+" "+o+","+h,b="C"+u+","+d+" "+l+","+f+" "+a+","+f,p=n>0?"L"+(o+n)+","+(h+r.link.width/2):"";return p+="L"+o+","+d,v+m+p+b+"Z"}return t}function vYt(e,t){var r=B5(t.color),n=Nu.nodePadAcross,i=e.nodePad/2;t.dx=t.x1-t.x0,t.dy=t.y1-t.y0;var a=t.dx,o=Math.max(.5,t.dy),s="node_"+t.pointNumber;return t.group&&(s=w1.randstr()),t.trace=e.trace,t.curveNumber=e.trace.index,{index:t.pointNumber,key:s,partOfGroup:t.partOfGroup||!1,group:t.group,traceId:e.key,trace:e.trace,node:t,nodePad:e.nodePad,nodeLineColor:e.nodeLineColor,nodeLineWidth:e.nodeLineWidth,textFont:e.textFont,size:e.horizontal?e.height:e.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:e.horizontal?t.dy/2+1:t.dx/2+1,left:t.originalLayer===1,sizeAcross:e.width,forceLayouts:e.forceLayouts,horizontal:e.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:yw.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,graph:e.graph,arrangement:e.arrangement,uniqueNodeLabelPathId:[e.guid,e.key,s].join("_"),interactionState:e.interactionState,figure:e}}function r$(e){e.attr("transform",function(t){return i$(t.node.x0.toFixed(3),t.node.y0.toFixed(3))})}function pYt(e){e.call(r$)}function dXe(e,t){e.call(pYt),t.attr("d",a$())}function sXe(e){e.attr("width",function(t){return t.node.x1-t.node.x0}).attr("height",function(t){return t.visibleHeight})}function t$(e){return e.link.width>1||e.linkLineWidth>0}function lXe(e){var t=i$(e.translateX,e.translateY);return t+(e.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function uXe(e,t,r){e.on(".basic",null).on("mouseover.basic",function(n){!n.interactionState.dragInProgress&&!n.partOfGroup&&(r.hover(this,n,t),n.interactionState.hovered=[this,n])}).on("mousemove.basic",function(n){!n.interactionState.dragInProgress&&!n.partOfGroup&&(r.follow(this,n),n.interactionState.hovered=[this,n])}).on("mouseout.basic",function(n){!n.interactionState.dragInProgress&&!n.partOfGroup&&(r.unhover(this,n,t),n.interactionState.hovered=!1)}).on("click.basic",function(n){n.interactionState.hovered&&(r.unhover(this,n,t),n.interactionState.hovered=!1),!n.interactionState.dragInProgress&&!n.partOfGroup&&r.select(this,n,t)})}function gYt(e,t,r,n){var i=O5.behavior.drag().origin(function(a){return{x:a.node.x0+a.visibleWidth/2,y:a.node.y0+a.visibleHeight/2}}).on("dragstart",function(a){if(a.arrangement!=="fixed"&&(w1.ensureSingle(n._fullLayout._infolayer,"g","dragcover",function(s){n._fullLayout._dragCover=s}),w1.raiseToTop(this),a.interactionState.dragInProgress=a.node,cXe(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),a.arrangement==="snap")){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):mYt(e,o,a,n),yYt(e,t,a,o,n)}}).on("drag",function(a){if(a.arrangement!=="fixed"){var o=O5.event.x,s=O5.event.y;a.arrangement==="snap"?(a.node.x0=o-a.visibleWidth/2,a.node.x1=o+a.visibleWidth/2,a.node.y0=s-a.visibleHeight/2,a.node.y1=s+a.visibleHeight/2):(a.arrangement==="freeform"&&(a.node.x0=o-a.visibleWidth/2,a.node.x1=o+a.visibleWidth/2),s=Math.max(0,Math.min(a.size-a.visibleHeight/2,s)),a.node.y0=s-a.visibleHeight/2,a.node.y1=s+a.visibleHeight/2),cXe(a.node),a.arrangement!=="snap"&&(a.sankey.update(a.graph),dXe(e.filter(pXe(a)),t))}}).on("dragend",function(a){if(a.arrangement!=="fixed"){a.interactionState.dragInProgress=!1;for(var o=0;o<a.node.childrenNodes.length;o++)a.node.childrenNodes[o].x=a.node.x,a.node.childrenNodes[o].y=a.node.y;a.arrangement!=="snap"&&vXe(a,n)}});e.on(".drag",null).call(i)}function mYt(e,t,r,n){bYt(r.graph.nodes);var i=r.graph.nodes.filter(function(a){return a.originalX===r.node.originalX}).filter(function(a){return!a.partOfGroup});r.forceLayouts[t]=aXe.forceSimulation(i).alphaDecay(0).force("collide",aXe.forceCollide().radius(function(a){return a.dy/2+r.nodePad/2}).strength(1).iterations(Nu.forceIterations)).force("constrain",_Yt(e,t,i,r,n)).stop()}function yYt(e,t,r,n,i){window.requestAnimationFrame(function a(){var o;for(o=0;o<Nu.forceTicksPerFrame;o++)r.forceLayouts[n].tick();var s=r.graph.nodes;if(wYt(s),r.sankey.update(r.graph),dXe(e.filter(pXe(r)),t),r.forceLayouts[n].alpha()>0)window.requestAnimationFrame(a);else{var l=r.node.originalX;r.node.x0=l-r.visibleWidth/2,r.node.x1=l+r.visibleWidth/2,vXe(r,i)}})}function _Yt(e,t,r,n){return function(){for(var a=0,o=0;o<r.length;o++){var s=r[o];s===n.interactionState.dragInProgress?(s.x=s.lastDraggedX,s.y=s.lastDraggedY):(s.vx=(s.originalX-s.x)/Nu.forceTicksPerFrame,s.y=Math.min(n.size-s.dy/2,Math.max(s.dy/2,s.y))),a=Math.max(a,Math.abs(s.vx),Math.abs(s.vy))}!n.interactionState.dragInProgress&&a<.1&&n.forceLayouts[t].alpha()>0&&n.forceLayouts[t].alpha(0)}}function vXe(e,t){for(var r=[],n=[],i=0;i<e.graph.nodes.length;i++){var a=(e.graph.nodes[i].x0+e.graph.nodes[i].x1)/2,o=(e.graph.nodes[i].y0+e.graph.nodes[i].y1)/2;r.push(a/e.figure.width),n.push(o/e.figure.height)}sYt.call("_guiRestyle",t,{"node.x":[r],"node.y":[n]},e.trace.index).then(function(){t._fullLayout._dragCover&&t._fullLayout._dragCover.remove()})}function xYt(e){var t=[],r;for(r=0;r<e.length;r++)e[r].originalX=(e[r].x0+e[r].x1)/2,e[r].originalY=(e[r].y0+e[r].y1)/2,t.indexOf(e[r].originalX)===-1&&t.push(e[r].originalX);for(t.sort(function(n,i){return n-i}),r=0;r<e.length;r++)e[r].originalLayerIndex=t.indexOf(e[r].originalX),e[r].originalLayer=e[r].originalLayerIndex/(t.length-1)}function cXe(e){e.lastDraggedX=e.x0+e.dx/2,e.lastDraggedY=e.y0+e.dy/2}function pXe(e){return function(t){return t.node.originalX===e.node.originalX}}function bYt(e){for(var t=0;t<e.length;t++)e[t].y=(e[t].y0+e[t].y1)/2,e[t].x=(e[t].x0+e[t].x1)/2}function wYt(e){for(var t=0;t<e.length;t++)e[t].y0=e[t].y-e[t].dy/2,e[t].y1=e[t].y0+e[t].dy,e[t].x0=e[t].x-e[t].dx/2,e[t].x1=e[t].x0+e[t].dx}gXe.exports=function(e,t,r,n,i){var a=e._context.staticPlot,o=!1;w1.ensureSingle(e._fullLayout._infolayer,"g","first-render",function(){o=!0});var s=e._fullLayout._dragCover,l=r.filter(function(b){return fXe(b).trace.visible}).map(fYt.bind(null,n)),u=t.selectAll("."+Nu.cn.sankey).data(l,sC);u.exit().remove(),u.enter().append("g").classed(Nu.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events",a?"none":"auto").attr("transform",lXe),u.each(function(b,p){e._fullData[p]._sankey=b;var k="bgsankey-"+b.trace.uid+"-"+p;w1.ensureSingle(e._fullLayout._draggers,"rect",k),e._fullData[p]._bgRect=O5.select("."+k),e._fullData[p]._bgRect.style("pointer-events",a?"none":"all").attr("width",b.width).attr("height",b.height).attr("x",b.translateX).attr("y",b.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})}),u.transition().ease(Nu.ease).duration(Nu.duration).attr("transform",lXe);var c=u.selectAll("."+Nu.cn.sankeyLinks).data(R7,sC);c.enter().append("g").classed(Nu.cn.sankeyLinks,!0).style("fill","none");var f=c.selectAll("."+Nu.cn.sankeyLink).data(function(b){var p=b.graph.links;return p.filter(function(k){return k.value}).map(hYt.bind(null,b))},sC);f.enter().append("path").classed(Nu.cn.sankeyLink,!0).call(uXe,u,i.linkEvents),f.style("stroke",function(b){return t$(b)?yw.tinyRGB(B5(b.linkLineColor)):b.tinyColorHue}).style("stroke-opacity",function(b){return t$(b)?yw.opacity(b.linkLineColor):b.tinyColorAlpha}).style("fill",function(b){return b.tinyColorHue}).style("fill-opacity",function(b){return b.tinyColorAlpha}).style("stroke-width",function(b){return t$(b)?b.linkLineWidth:1}).attr("d",a$()),f.style("opacity",function(){return e._context.staticPlot||o||s?1:0}).transition().ease(Nu.ease).duration(Nu.duration).style("opacity",1),f.exit().transition().ease(Nu.ease).duration(Nu.duration).style("opacity",0).remove();var h=u.selectAll("."+Nu.cn.sankeyNodeSet).data(R7,sC);h.enter().append("g").classed(Nu.cn.sankeyNodeSet,!0),h.style("cursor",function(b){switch(b.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var d=h.selectAll("."+Nu.cn.sankeyNode).data(function(b){var p=b.graph.nodes;return xYt(p),p.map(vYt.bind(null,b))},sC);d.enter().append("g").classed(Nu.cn.sankeyNode,!0).call(r$).style("opacity",function(b){return(e._context.staticPlot||o)&&!b.partOfGroup?1:0}),d.call(uXe,u,i.nodeEvents).call(gYt,f,i,e),d.transition().ease(Nu.ease).duration(Nu.duration).call(r$).style("opacity",function(b){return b.partOfGroup?0:1}),d.exit().transition().ease(Nu.ease).duration(Nu.duration).style("opacity",0).remove();var v=d.selectAll("."+Nu.cn.nodeRect).data(R7);v.enter().append("rect").classed(Nu.cn.nodeRect,!0).call(sXe),v.style("stroke-width",function(b){return b.nodeLineWidth}).style("stroke",function(b){return yw.tinyRGB(B5(b.nodeLineColor))}).style("stroke-opacity",function(b){return yw.opacity(b.nodeLineColor)}).style("fill",function(b){return b.tinyColorHue}).style("fill-opacity",function(b){return b.tinyColorAlpha}),v.transition().ease(Nu.ease).duration(Nu.duration).call(sXe);var m=d.selectAll("."+Nu.cn.nodeLabel).data(R7);m.enter().append("text").classed(Nu.cn.nodeLabel,!0).style("cursor","default"),m.attr("data-notex",1).text(function(b){return b.node.label}).each(function(b){var p=O5.select(this);aYt.font(p,b.textFont),oXe.convertToTspans(p,e)}).attr("text-anchor",function(b){return b.horizontal&&b.left?"end":"start"}).attr("transform",function(b){var p=O5.select(this),k=oXe.lineCount(p),M=b.textFont.size*((k-1)*uYt-lYt),T=b.nodeLineWidth/2+cYt,L=((b.horizontal?b.visibleHeight:b.visibleWidth)-M)/2;b.horizontal&&(b.left?T=-T:T+=b.visibleWidth);var x=b.horizontal?"":"scale(-1,1)"+oYt(90);return i$(b.horizontal?T:L,b.horizontal?L:T)+x}),m.transition().ease(Nu.ease).duration(Nu.duration)}});var l$=ye((S2r,MXe)=>{"use strict";var Zv=qa(),s$=Pr(),D7=s$.numberFormat,TYt=mXe(),N5=ef(),AYt=ka(),Fx=e$().cn,lC=s$._;function yXe(e){return e!==""}function U5(e,t){return e.filter(function(r){return r.key===t.traceId})}function _Xe(e,t){Zv.select(e).select("path").style("fill-opacity",t),Zv.select(e).select("rect").style("fill-opacity",t)}function xXe(e){Zv.select(e).select("text.name").style("fill","black")}function bXe(e){return function(t){return e.node.sourceLinks.indexOf(t.link)!==-1||e.node.targetLinks.indexOf(t.link)!==-1}}function wXe(e){return function(t){return t.node.sourceLinks.indexOf(e.link)!==-1||t.node.targetLinks.indexOf(e.link)!==-1}}function TXe(e,t,r){t&&r&&U5(r,t).selectAll("."+Fx.sankeyLink).filter(bXe(t)).call(AXe.bind(0,t,r,!1))}function o$(e,t,r){t&&r&&U5(r,t).selectAll("."+Fx.sankeyLink).filter(bXe(t)).call(SXe.bind(0,t,r,!1))}function AXe(e,t,r,n){n.style("fill",function(i){if(!i.link.concentrationscale)return i.tinyColorHoverHue}).style("fill-opacity",function(i){if(!i.link.concentrationscale)return i.tinyColorHoverAlpha}),n.each(function(i){var a=i.link.label;a!==""&&U5(t,e).selectAll("."+Fx.sankeyLink).filter(function(o){return o.link.label===a}).style("fill",function(o){if(!o.link.concentrationscale)return o.tinyColorHoverHue}).style("fill-opacity",function(o){if(!o.link.concentrationscale)return o.tinyColorHoverAlpha})}),r&&U5(t,e).selectAll("."+Fx.sankeyNode).filter(wXe(e)).call(TXe)}function SXe(e,t,r,n){n.style("fill",function(i){return i.tinyColorHue}).style("fill-opacity",function(i){return i.tinyColorAlpha}),n.each(function(i){var a=i.link.label;a!==""&&U5(t,e).selectAll("."+Fx.sankeyLink).filter(function(o){return o.link.label===a}).style("fill",function(o){return o.tinyColorHue}).style("fill-opacity",function(o){return o.tinyColorAlpha})}),r&&U5(t,e).selectAll(Fx.sankeyNode).filter(wXe(e)).call(o$)}function kf(e,t){var r=e.hoverlabel||{},n=s$.nestedProperty(r,t).get();return Array.isArray(n)?!1:n}MXe.exports=function(t,r){for(var n=t._fullLayout,i=n._paper,a=n._size,o=0;o<t._fullData.length;o++)if(t._fullData[o].visible&&t._fullData[o].type===Fx.sankey&&!t._fullData[o]._viewInitial){var s=t._fullData[o].node;t._fullData[o]._viewInitial={node:{groups:s.groups.slice(),x:s.x.slice(),y:s.y.slice()}}}var l=function(L,x){var C=x.link;C.originalEvent=Zv.event,t._hoverdata=[C],N5.click(t,{target:!0})},u=function(L,x,C){t._fullLayout.hovermode!==!1&&(Zv.select(L).call(AXe.bind(0,x,C,!0)),x.link.trace.link.hoverinfo!=="skip"&&(x.link.fullData=x.link.trace,t.emit("plotly_hover",{event:Zv.event,points:[x.link]})))},c=lC(t,"source:")+" ",f=lC(t,"target:")+" ",h=lC(t,"concentration:")+" ",d=lC(t,"incoming flow count:")+" ",v=lC(t,"outgoing flow count:")+" ",m=function(L,x){if(t._fullLayout.hovermode===!1)return;var C=x.link.trace.link;if(C.hoverinfo==="none"||C.hoverinfo==="skip")return;var S=[];function g(Z){var j,N;Z.circular?(j=(Z.circularPathData.leftInnerExtent+Z.circularPathData.rightInnerExtent)/2,N=Z.circularPathData.verticalFullExtent):(j=(Z.source.x1+Z.target.x0)/2,N=(Z.y0+Z.y1)/2);var H=[j,N];return Z.trace.orientation==="v"&&H.reverse(),H[0]+=x.parent.translateX,H[1]+=x.parent.translateY,H}for(var P=0,E=0;E<x.flow.links.length;E++){var z=x.flow.links[E];if(!(t._fullLayout.hovermode==="closest"&&x.link.pointNumber!==z.pointNumber)){x.link.pointNumber===z.pointNumber&&(P=E),z.fullData=z.trace,C=x.link.trace.link;var q=g(z),V={valueLabel:D7(x.valueFormat)(z.value)+x.valueSuffix};S.push({x:q[0],y:q[1],name:V.valueLabel,text:[z.label||"",c+z.source.label,f+z.target.label,z.concentrationscale?h+D7("%0.2f")(z.flow.labelConcentration):""].filter(yXe).join("<br>"),color:kf(C,"bgcolor")||AYt.addOpacity(z.color,1),borderColor:kf(C,"bordercolor"),fontFamily:kf(C,"font.family"),fontSize:kf(C,"font.size"),fontColor:kf(C,"font.color"),fontWeight:kf(C,"font.weight"),fontStyle:kf(C,"font.style"),fontVariant:kf(C,"font.variant"),fontTextcase:kf(C,"font.textcase"),fontLineposition:kf(C,"font.lineposition"),fontShadow:kf(C,"font.shadow"),nameLength:kf(C,"namelength"),textAlign:kf(C,"align"),idealAlign:Zv.event.x<q[0]?"right":"left",hovertemplate:C.hovertemplate,hovertemplateLabels:V,eventData:[z]})}}var G=N5.loneHover(S,{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t,anchorIndex:P});G.each(function(){var Z=this;x.link.concentrationscale||_Xe(Z,.65),xXe(Z)})},b=function(L,x,C){t._fullLayout.hovermode!==!1&&(Zv.select(L).call(SXe.bind(0,x,C,!0)),x.link.trace.link.hoverinfo!=="skip"&&(x.link.fullData=x.link.trace,t.emit("plotly_unhover",{event:Zv.event,points:[x.link]})),N5.loneUnhover(n._hoverlayer.node()))},p=function(L,x,C){var S=x.node;S.originalEvent=Zv.event,t._hoverdata=[S],Zv.select(L).call(o$,x,C),N5.click(t,{target:!0})},k=function(L,x,C){t._fullLayout.hovermode!==!1&&(Zv.select(L).call(TXe,x,C),x.node.trace.node.hoverinfo!=="skip"&&(x.node.fullData=x.node.trace,t.emit("plotly_hover",{event:Zv.event,points:[x.node]})))},M=function(L,x){if(t._fullLayout.hovermode!==!1){var C=x.node.trace.node;if(!(C.hoverinfo==="none"||C.hoverinfo==="skip")){var S=Zv.select(L).select("."+Fx.nodeRect),g=t._fullLayout._paperdiv.node().getBoundingClientRect(),P=S.node().getBoundingClientRect(),E=P.left-2-g.left,z=P.right+2-g.left,q=P.top+P.height/4-g.top,V={valueLabel:D7(x.valueFormat)(x.node.value)+x.valueSuffix};x.node.fullData=x.node.trace,t._fullLayout._calcInverseTransform(t);var G=t._fullLayout._invScaleX,Z=t._fullLayout._invScaleY,j=N5.loneHover({x0:G*E,x1:G*z,y:Z*q,name:D7(x.valueFormat)(x.node.value)+x.valueSuffix,text:[x.node.label,d+x.node.targetLinks.length,v+x.node.sourceLinks.length].filter(yXe).join("<br>"),color:kf(C,"bgcolor")||x.tinyColorHue,borderColor:kf(C,"bordercolor"),fontFamily:kf(C,"font.family"),fontSize:kf(C,"font.size"),fontColor:kf(C,"font.color"),fontWeight:kf(C,"font.weight"),fontStyle:kf(C,"font.style"),fontVariant:kf(C,"font.variant"),fontTextcase:kf(C,"font.textcase"),fontLineposition:kf(C,"font.lineposition"),fontShadow:kf(C,"font.shadow"),nameLength:kf(C,"namelength"),textAlign:kf(C,"align"),idealAlign:"left",hovertemplate:C.hovertemplate,hovertemplateLabels:V,eventData:[x.node]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t});_Xe(j,.85),xXe(j)}}},T=function(L,x,C){t._fullLayout.hovermode!==!1&&(Zv.select(L).call(o$,x,C),x.node.trace.node.hoverinfo!=="skip"&&(x.node.fullData=x.node.trace,t.emit("plotly_unhover",{event:Zv.event,points:[x.node]})),N5.loneUnhover(n._hoverlayer.node()))};TYt(t,i,r,{width:a.w,height:a.h,margin:{t:a.t,r:a.r,b:a.b,l:a.l}},{linkEvents:{hover:u,follow:m,unhover:b,select:l},nodeEvents:{hover:k,follow:M,unhover:T,select:p}})}});var EXe=ye(_w=>{"use strict";var SYt=mc().overrideAll,MYt=Id().getModuleCalcData,EYt=l$(),kYt=W1(),CYt=Eg(),LYt=yv(),PYt=qf().prepSelect,u$=Pr(),IYt=Oa(),F7="sankey";_w.name=F7;_w.baseLayoutAttrOverrides=SYt({hoverlabel:kYt.hoverlabel},"plot","nested");_w.plot=function(e){var t=MYt(e.calcdata,F7)[0];EYt(e,t),_w.updateFx(e)};_w.clean=function(e,t,r,n){var i=n._has&&n._has(F7),a=t._has&&t._has(F7);i&&!a&&(n._paperdiv.selectAll(".sankey").remove(),n._paperdiv.selectAll(".bgsankey").remove())};_w.updateFx=function(e){for(var t=0;t<e._fullData.length;t++)RYt(e,t)};function RYt(e,t){var r=e._fullData[t],n=e._fullLayout,i=n.dragmode,a=n.dragmode==="pan"?"move":"crosshair",o=r._bgRect;if(o&&!(i==="pan"||i==="zoom")){CYt(o,a);var s={_id:"x",c2p:u$.identity,_offset:r._sankey.translateX,_length:r._sankey.width},l={_id:"y",c2p:u$.identity,_offset:r._sankey.translateY,_length:r._sankey.height},u={gd:e,element:o.node(),plotinfo:{id:t,xaxis:s,yaxis:l,fillRangeItems:u$.noop},subplot:t,xaxes:[s],yaxes:[l],doneFnCompleted:function(c){var f=e._fullData[t],h,d=f.node.groups.slice(),v=[];function m(M){for(var T=f._sankey.graph.nodes,L=0;L<T.length;L++)if(T[L].pointNumber===M)return T[L]}for(var b=0;b<c.length;b++){var p=m(c[b].pointNumber);if(p)if(p.group){for(var k=0;k<p.childrenNodes.length;k++)v.push(p.childrenNodes[k].pointNumber);d[p.pointNumber-f.node._count]=!1}else v.push(p.pointNumber)}h=d.filter(Boolean).concat([v]),IYt.call("_guiRestyle",e,{"node.groups":[h]},t)}};u.prepFn=function(c,f,h){PYt(c,f,h,u,i)},LYt.init(u)}}});var CXe=ye((E2r,kXe)=>{"use strict";kXe.exports=function(t,r){for(var n=t.cd,i=[],a=n[0].trace,o=a._sankey.graph.nodes,s=0;s<o.length;s++){var l=o[s];if(!l.partOfGroup){var u=[(l.x0+l.x1)/2,(l.y0+l.y1)/2];a.orientation==="v"&&u.reverse(),r&&r.contains(u,!1,s,t)&&i.push({pointNumber:l.pointNumber})}}return i}});var PXe=ye((k2r,LXe)=>{"use strict";LXe.exports={attributes:JJ(),supplyDefaults:DWe(),calc:BWe(),plot:l$(),moduleType:"trace",name:"sankey",basePlotModule:EXe(),selectPoints:CXe(),categories:["noOpacity"],meta:{}}});var RXe=ye((C2r,IXe)=>{"use strict";IXe.exports=PXe()});var FXe=ye(V5=>{"use strict";var DXe=Mc();V5.name="indicator";V5.plot=function(e,t,r,n){DXe.plotBasePlot(V5.name,e,t,r,n)};V5.clean=function(e,t,r,n){DXe.cleanBasePlot(V5.name,e,t,r,n)}});var f$=ye((P2r,UXe)=>{"use strict";var zx=Ao().extendFlat,qXe=Ao().extendDeep,DYt=mc().overrideAll,OXe=ec(),BXe=Ih(),FYt=Cc().attributes,Nf=Rd(),zYt=vl().templatedArray,z7=QT(),zXe=vf().descriptionOnlyNumbers,c$=OXe({editType:"plot",colorEditType:"plot"}),uC={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:BXe.defaultLine,editType:"plot"},width:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},thickness:{valType:"number",min:0,max:1,dflt:1,editType:"plot"},editType:"calc"},NXe={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},qYt=zYt("step",qXe({},uC,{range:NXe}));UXe.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:FYt({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:zx({},c$,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:zXe("value")},font:zx({},c$,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot",description:zXe("value")},increasing:{symbol:{valType:"string",dflt:z7.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:z7.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:z7.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:z7.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:zx({},c$,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:qXe({},uC,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:BXe.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:DYt({range:NXe,visible:zx({},Nf.visible,{dflt:!0}),tickmode:Nf.minor.tickmode,nticks:Nf.nticks,tick0:Nf.tick0,dtick:Nf.dtick,tickvals:Nf.tickvals,ticktext:Nf.ticktext,ticks:zx({},Nf.ticks,{dflt:"outside"}),ticklen:Nf.ticklen,tickwidth:Nf.tickwidth,tickcolor:Nf.tickcolor,ticklabelstep:Nf.ticklabelstep,showticklabels:Nf.showticklabels,labelalias:Nf.labelalias,tickfont:OXe({}),tickangle:Nf.tickangle,tickformat:Nf.tickformat,tickformatstops:Nf.tickformatstops,tickprefix:Nf.tickprefix,showtickprefix:Nf.showtickprefix,ticksuffix:Nf.ticksuffix,showticksuffix:Nf.showticksuffix,separatethousands:Nf.separatethousands,exponentformat:Nf.exponentformat,minexponent:Nf.minexponent,showexponent:Nf.showexponent,editType:"plot"},"plot"),steps:qYt,threshold:{line:{color:zx({},uC.line.color,{}),width:zx({},uC.line.width,{dflt:1}),editType:"plot"},thickness:zx({},uC.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}});var h$=ye((I2r,VXe)=>{"use strict";VXe.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}});var jXe=ye((R2r,HXe)=>{"use strict";var ly=Pr(),O7=f$(),OYt=Cc().defaults,GXe=vl(),BYt=Kd(),q7=h$(),NYt=Pb(),UYt=q3(),VYt=s_(),GYt=l_();function HYt(e,t,r,n){function i(x,C){return ly.coerce(e,t,O7,x,C)}OYt(t,n,i),i("mode"),t._hasNumber=t.mode.indexOf("number")!==-1,t._hasDelta=t.mode.indexOf("delta")!==-1,t._hasGauge=t.mode.indexOf("gauge")!==-1;var a=i("value");t._range=[0,typeof a=="number"?1.5*a:1];var o=new Array(2),s;if(t._hasNumber){i("number.valueformat");var l=ly.extendFlat({},n.font);l.size=void 0,ly.coerceFont(i,"number.font",l),t.number.font.size===void 0&&(t.number.font.size=q7.defaultNumberFontSize,o[0]=!0),i("number.prefix"),i("number.suffix"),s=t.number.font.size}var u;if(t._hasDelta){var c=ly.extendFlat({},n.font);c.size=void 0,ly.coerceFont(i,"delta.font",c),t.delta.font.size===void 0&&(t.delta.font.size=(t._hasNumber?.5:1)*(s||q7.defaultNumberFontSize),o[1]=!0),i("delta.reference",t.value),i("delta.relative"),i("delta.valueformat",t.delta.relative?"2%":""),i("delta.increasing.symbol"),i("delta.increasing.color"),i("delta.decreasing.symbol"),i("delta.decreasing.color"),i("delta.position"),i("delta.prefix"),i("delta.suffix"),u=t.delta.font.size}t._scaleNumbers=(!t._hasNumber||o[0])&&(!t._hasDelta||o[1])||!1;var f=ly.extendFlat({},n.font);f.size=.25*(s||u||q7.defaultNumberFontSize),ly.coerceFont(i,"title.font",f),i("title.text");var h,d,v,m;function b(x,C){return ly.coerce(h,d,O7.gauge,x,C)}function p(x,C){return ly.coerce(v,m,O7.gauge.axis,x,C)}if(t._hasGauge){h=e.gauge,h||(h={}),d=GXe.newContainer(t,"gauge"),b("shape");var k=t._isBullet=t.gauge.shape==="bullet";k||i("title.align","center");var M=t._isAngular=t.gauge.shape==="angular";M||i("align","center"),b("bgcolor",n.paper_bgcolor),b("borderwidth"),b("bordercolor"),b("bar.color"),b("bar.line.color"),b("bar.line.width");var T=q7.valueThickness*(t.gauge.shape==="bullet"?.5:1);b("bar.thickness",T),BYt(h,d,{name:"steps",handleItemDefaults:jYt}),b("threshold.value"),b("threshold.thickness"),b("threshold.line.width"),b("threshold.line.color"),v={},h&&(v=h.axis||{}),m=GXe.newContainer(d,"axis"),p("visible"),t._range=p("range",t._range);var L={font:n.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};NYt(v,m,p,"linear"),GYt(v,m,p,"linear",L),VYt(v,m,p,"linear",L),UYt(v,m,p,L)}else i("title.align","center"),i("align","center"),t._isAngular=t._isBullet=!1;t._length=null}function jYt(e,t){function r(n,i){return ly.coerce(e,t,O7.gauge.steps,n,i)}r("color"),r("line.color"),r("line.width"),r("range"),r("thickness")}HXe.exports={supplyDefaults:HYt}});var XXe=ye((D2r,WXe)=>{"use strict";function WYt(e,t){var r=[],n=t.value;typeof t._lastValue!="number"&&(t._lastValue=t.value);var i=t._lastValue,a=i;return t._hasDelta&&typeof t.delta.reference=="number"&&(a=t.delta.reference),r[0]={y:n,lastY:i,delta:n-a,relativeDelta:(n-a)/a},r}WXe.exports={calc:WYt}});var QXe=ye((F2r,$Xe)=>{"use strict";var Aw=qa(),XYt=(j2(),gb(H2)).interpolate,ZXe=(j2(),gb(H2)).interpolateNumber,qx=Pr(),ZYt=qx.strScale,fC=qx.strTranslate,YYt=qx.rad2deg,KYt=Dh().MID_SHIFT,Tw=So(),xw=h$(),N7=Zl(),lv=ho(),JYt=h4(),$Yt=vI(),QYt=Rd(),G5=ka(),d$={left:"start",center:"middle",right:"end"},bw={left:0,center:.5,right:1},YXe=/[yzafpnµmkMGTPEZY]/;function hC(e){return e&&e.duration>0}$Xe.exports=function(t,r,n,i){var a=t._fullLayout,o;hC(n)&&i&&(o=i()),qx.makeTraceGroups(a._indicatorlayer,r,"trace").each(function(s){var l=s[0],u=l.trace,c=Aw.select(this),f=u._hasGauge,h=u._isAngular,d=u._isBullet,v=u.domain,m={w:a._size.w*(v.x[1]-v.x[0]),h:a._size.h*(v.y[1]-v.y[0]),l:a._size.l+a._size.w*v.x[0],r:a._size.r+a._size.w*(1-v.x[1]),t:a._size.t+a._size.h*(1-v.y[1]),b:a._size.b+a._size.h*v.y[0]},b=m.l+m.w/2,p=m.t+m.h/2,k=Math.min(m.w/2,m.h),M=xw.innerRadius*k,T,L,x,C=u.align||"center";if(L=p,!f)T=m.l+bw[C]*m.w,x=function(j){return KXe(j,m.w,m.h)};else if(h&&(T=b,L=p+k/2,x=function(j){return nKt(j,.9*M)}),d){var S=xw.bulletPadding,g=1-xw.bulletNumberDomainSize+S;T=m.l+(g+(1-g)*bw[C])*m.w,x=function(j){return KXe(j,(xw.bulletNumberDomainSize-S)*m.w,m.h)}}rKt(t,c,s,{numbersX:T,numbersY:L,numbersScaler:x,transitionOpts:n,onComplete:o});var P,E;f&&(P={range:u.gauge.axis.range,color:u.gauge.bgcolor,line:{color:u.gauge.bordercolor,width:0},thickness:1},E={range:u.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:u.gauge.bordercolor,width:u.gauge.borderwidth},thickness:1});var z=c.selectAll("g.angular").data(h?s:[]);z.exit().remove();var q=c.selectAll("g.angularaxis").data(h?s:[]);q.exit().remove(),h&&tKt(t,c,s,{radius:k,innerRadius:M,gauge:z,layer:q,size:m,gaugeBg:P,gaugeOutline:E,transitionOpts:n,onComplete:o});var V=c.selectAll("g.bullet").data(d?s:[]);V.exit().remove();var G=c.selectAll("g.bulletaxis").data(d?s:[]);G.exit().remove(),d&&eKt(t,c,s,{gauge:V,layer:G,size:m,gaugeBg:P,gaugeOutline:E,transitionOpts:n,onComplete:o});var Z=c.selectAll("text.title").data(s);Z.exit().remove(),Z.enter().append("text").classed("title",!0),Z.attr("text-anchor",function(){return d?d$.right:d$[u.title.align]}).text(u.title.text).call(Tw.font,u.title.font).call(N7.convertToTspans,t),Z.attr("transform",function(){var j=m.l+m.w*bw[u.title.align],N,H=xw.titlePadding,ie=Tw.bBox(Z.node());if(f){if(h)if(u.gauge.axis.visible){var ae=Tw.bBox(q.node());N=ae.top-H-ie.bottom}else N=m.t+m.h/2-k/2-ie.bottom-H;d&&(N=L-(ie.top+ie.bottom)/2,j=m.l-xw.bulletPadding*m.w)}else N=u._numbersTop-H-ie.bottom;return fC(j,N)})})};function eKt(e,t,r,n){var i=r[0].trace,a=n.gauge,o=n.layer,s=n.gaugeBg,l=n.gaugeOutline,u=n.size,c=i.domain,f=n.transitionOpts,h=n.onComplete,d,v,m,b,p;a.enter().append("g").classed("bullet",!0),a.attr("transform",fC(u.l,u.t)),o.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),o.selectAll("g.xbulletaxistick,path,text").remove();var k=u.h,M=i.gauge.bar.thickness*k,T=c.x[0],L=c.x[0]+(c.x[1]-c.x[0])*(i._hasNumber||i._hasDelta?1-xw.bulletNumberDomainSize:1);d=cC(e,i.gauge.axis),d._id="xbulletaxis",d.domain=[T,L],d.setScale(),v=lv.calcTicks(d),m=lv.makeTransTickFn(d),b=lv.getTickSigns(d)[2],p=u.t+u.h,d.visible&&(lv.drawTicks(e,d,{vals:d.ticks==="inside"?lv.clipEnds(d,v):v,layer:o,path:lv.makeTickPath(d,p,b),transFn:m}),lv.drawLabels(e,d,{vals:v,layer:o,transFn:m,labelFns:lv.makeLabelFns(d,p)}));function x(q){q.attr("width",function(V){return Math.max(0,d.c2p(V.range[1])-d.c2p(V.range[0]))}).attr("x",function(V){return d.c2p(V.range[0])}).attr("y",function(V){return .5*(1-V.thickness)*k}).attr("height",function(V){return V.thickness*k})}var C=[s].concat(i.gauge.steps),S=a.selectAll("g.bg-bullet").data(C);S.enter().append("g").classed("bg-bullet",!0).append("rect"),S.select("rect").call(x).call(ww),S.exit().remove();var g=a.selectAll("g.value-bullet").data([i.gauge.bar]);g.enter().append("g").classed("value-bullet",!0).append("rect"),g.select("rect").attr("height",M).attr("y",(k-M)/2).call(ww),hC(f)?g.select("rect").transition().duration(f.duration).ease(f.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).attr("width",Math.max(0,d.c2p(Math.min(i.gauge.axis.range[1],r[0].y)))):g.select("rect").attr("width",typeof r[0].y=="number"?Math.max(0,d.c2p(Math.min(i.gauge.axis.range[1],r[0].y))):0),g.exit().remove();var P=r.filter(function(){return i.gauge.threshold.value||i.gauge.threshold.value===0}),E=a.selectAll("g.threshold-bullet").data(P);E.enter().append("g").classed("threshold-bullet",!0).append("line"),E.select("line").attr("x1",d.c2p(i.gauge.threshold.value)).attr("x2",d.c2p(i.gauge.threshold.value)).attr("y1",(1-i.gauge.threshold.thickness)/2*k).attr("y2",(1-(1-i.gauge.threshold.thickness)/2)*k).call(G5.stroke,i.gauge.threshold.line.color).style("stroke-width",i.gauge.threshold.line.width),E.exit().remove();var z=a.selectAll("g.gauge-outline").data([l]);z.enter().append("g").classed("gauge-outline",!0).append("rect"),z.select("rect").call(x).call(ww),z.exit().remove()}function tKt(e,t,r,n){var i=r[0].trace,a=n.size,o=n.radius,s=n.innerRadius,l=n.gaugeBg,u=n.gaugeOutline,c=[a.l+a.w/2,a.t+a.h/2+o/2],f=n.gauge,h=n.layer,d=n.transitionOpts,v=n.onComplete,m=Math.PI/2;function b(_e){var Ee=i.gauge.axis.range[0],Ce=i.gauge.axis.range[1],ge=(_e-Ee)/(Ce-Ee)*Math.PI-m;return ge<-m?-m:ge>m?m:ge}function p(_e){return Aw.svg.arc().innerRadius((s+o)/2-_e/2*(o-s)).outerRadius((s+o)/2+_e/2*(o-s)).startAngle(-m)}function k(_e){_e.attr("d",function(Ee){return p(Ee.thickness).startAngle(b(Ee.range[0])).endAngle(b(Ee.range[1]))()})}var M,T,L,x;f.enter().append("g").classed("angular",!0),f.attr("transform",fC(c[0],c[1])),h.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),h.selectAll("g.xangularaxistick,path,text").remove(),M=cC(e,i.gauge.axis),M.type="linear",M.range=i.gauge.axis.range,M._id="xangularaxis",M.ticklabeloverflow="allow",M.setScale();var C=function(_e){return(M.range[0]-_e.x)/(M.range[1]-M.range[0])*Math.PI+Math.PI},S={},g=lv.makeLabelFns(M,0),P=g.labelStandoff;S.xFn=function(_e){var Ee=C(_e);return Math.cos(Ee)*P},S.yFn=function(_e){var Ee=C(_e),Ce=Math.sin(Ee)>0?.2:1;return-Math.sin(Ee)*(P+_e.fontSize*Ce)+Math.abs(Math.cos(Ee))*(_e.fontSize*KYt)},S.anchorFn=function(_e){var Ee=C(_e),Ce=Math.cos(Ee);return Math.abs(Ce)<.1?"middle":Ce>0?"start":"end"},S.heightFn=function(_e,Ee,Ce){var ge=C(_e);return-.5*(1+Math.sin(ge))*Ce};var E=function(_e){return fC(c[0]+o*Math.cos(_e),c[1]-o*Math.sin(_e))};L=function(_e){return E(C(_e))};var z=function(_e){var Ee=C(_e);return E(Ee)+"rotate("+-YYt(Ee)+")"};if(T=lv.calcTicks(M),x=lv.getTickSigns(M)[2],M.visible){x=M.ticks==="inside"?-1:1;var q=(M.linewidth||1)/2;lv.drawTicks(e,M,{vals:T,layer:h,path:"M"+x*q+",0h"+x*M.ticklen,transFn:z}),lv.drawLabels(e,M,{vals:T,layer:h,transFn:L,labelFns:S})}var V=[l].concat(i.gauge.steps),G=f.selectAll("g.bg-arc").data(V);G.enter().append("g").classed("bg-arc",!0).append("path"),G.select("path").call(k).call(ww),G.exit().remove();var Z=p(i.gauge.bar.thickness),j=f.selectAll("g.value-arc").data([i.gauge.bar]);j.enter().append("g").classed("value-arc",!0).append("path");var N=j.select("path");hC(d)?(N.transition().duration(d.duration).ease(d.easing).each("end",function(){v&&v()}).each("interrupt",function(){v&&v()}).attrTween("d",iKt(Z,b(r[0].lastY),b(r[0].y))),i._lastValue=r[0].y):N.attr("d",typeof r[0].y=="number"?Z.endAngle(b(r[0].y)):"M0,0Z"),N.call(ww),j.exit().remove(),V=[];var H=i.gauge.threshold.value;(H||H===0)&&V.push({range:[H,H],color:i.gauge.threshold.color,line:{color:i.gauge.threshold.line.color,width:i.gauge.threshold.line.width},thickness:i.gauge.threshold.thickness});var ie=f.selectAll("g.threshold-arc").data(V);ie.enter().append("g").classed("threshold-arc",!0).append("path"),ie.select("path").call(k).call(ww),ie.exit().remove();var ae=f.selectAll("g.gauge-outline").data([u]);ae.enter().append("g").classed("gauge-outline",!0).append("path"),ae.select("path").call(k).call(ww),ae.exit().remove()}function rKt(e,t,r,n){var i=r[0].trace,a=n.numbersX,o=n.numbersY,s=i.align||"center",l=d$[s],u=n.transitionOpts,c=n.onComplete,f=qx.ensureSingle(t,"g","numbers"),h,d,v,m=[];i._hasNumber&&m.push("number"),i._hasDelta&&(m.push("delta"),i.delta.position==="left"&&m.reverse());var b=f.selectAll("text").data(m);b.enter().append("text"),b.attr("text-anchor",function(){return l}).attr("class",function(E){return E}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),b.exit().remove();function p(E,z,q,V){if(E.match("s")&&q>=0!=V>=0&&!z(q).slice(-1).match(YXe)&&!z(V).slice(-1).match(YXe)){var G=E.slice().replace("s","f").replace(/\d+/,function(j){return parseInt(j)-1}),Z=cC(e,{tickformat:G});return function(j){return Math.abs(j)<1?lv.tickText(Z,j).text:z(j)}}else return z}function k(){var E=cC(e,{tickformat:i.number.valueformat},i._range);E.setScale(),lv.prepTicks(E);var z=function(j){return lv.tickText(E,j).text},q=i.number.suffix,V=i.number.prefix,G=f.select("text.number");function Z(){var j=typeof r[0].y=="number"?V+z(r[0].y)+q:"-";G.text(j).call(Tw.font,i.number.font).call(N7.convertToTspans,e)}return hC(u)?G.transition().duration(u.duration).ease(u.easing).each("end",function(){Z(),c&&c()}).each("interrupt",function(){Z(),c&&c()}).attrTween("text",function(){var j=Aw.select(this),N=ZXe(r[0].lastY,r[0].y);i._lastValue=r[0].y;var H=p(i.number.valueformat,z,r[0].lastY,r[0].y);return function(ie){j.text(V+H(N(ie))+q)}}):Z(),h=JXe(V+z(r[0].y)+q,i.number.font,l,e),G}function M(){var E=cC(e,{tickformat:i.delta.valueformat},i._range);E.setScale(),lv.prepTicks(E);var z=function(ie){return lv.tickText(E,ie).text},q=i.delta.suffix,V=i.delta.prefix,G=function(ie){var ae=i.delta.relative?ie.relativeDelta:ie.delta;return ae},Z=function(ie,ae){return ie===0||typeof ie!="number"||isNaN(ie)?"-":(ie>0?i.delta.increasing.symbol:i.delta.decreasing.symbol)+V+ae(ie)+q},j=function(ie){return ie.delta>=0?i.delta.increasing.color:i.delta.decreasing.color};i._deltaLastValue===void 0&&(i._deltaLastValue=G(r[0]));var N=f.select("text.delta");N.call(Tw.font,i.delta.font).call(G5.fill,j({delta:i._deltaLastValue}));function H(){N.text(Z(G(r[0]),z)).call(G5.fill,j(r[0])).call(N7.convertToTspans,e)}return hC(u)?N.transition().duration(u.duration).ease(u.easing).tween("text",function(){var ie=Aw.select(this),ae=G(r[0]),_e=i._deltaLastValue,Ee=p(i.delta.valueformat,z,_e,ae),Ce=ZXe(_e,ae);return i._deltaLastValue=ae,function(ge){ie.text(Z(Ce(ge),Ee)),ie.call(G5.fill,j({delta:Ce(ge)}))}}).each("end",function(){H(),c&&c()}).each("interrupt",function(){H(),c&&c()}):H(),d=JXe(Z(G(r[0]),z),i.delta.font,l,e),N}var T=i.mode+i.align,L;if(i._hasDelta&&(L=M(),T+=i.delta.position+i.delta.font.size+i.delta.font.family+i.delta.valueformat,T+=i.delta.increasing.symbol+i.delta.decreasing.symbol,v=d),i._hasNumber&&(k(),T+=i.number.font.size+i.number.font.family+i.number.valueformat+i.number.suffix+i.number.prefix,v=h),i._hasDelta&&i._hasNumber){var x=[(h.left+h.right)/2,(h.top+h.bottom)/2],C=[(d.left+d.right)/2,(d.top+d.bottom)/2],S,g,P=.75*i.delta.font.size;i.delta.position==="left"&&(S=B7(i,"deltaPos",0,-1*(h.width*bw[i.align]+d.width*(1-bw[i.align])+P),T,Math.min),g=x[1]-C[1],v={width:h.width+d.width+P,height:Math.max(h.height,d.height),left:d.left+S,right:h.right,top:Math.min(h.top,d.top+g),bottom:Math.max(h.bottom,d.bottom+g)}),i.delta.position==="right"&&(S=B7(i,"deltaPos",0,h.width*(1-bw[i.align])+d.width*bw[i.align]+P,T,Math.max),g=x[1]-C[1],v={width:h.width+d.width+P,height:Math.max(h.height,d.height),left:h.left,right:d.right+S,top:Math.min(h.top,d.top+g),bottom:Math.max(h.bottom,d.bottom+g)}),i.delta.position==="bottom"&&(S=null,g=d.height,v={width:Math.max(h.width,d.width),height:h.height+d.height,left:Math.min(h.left,d.left),right:Math.max(h.right,d.right),top:h.bottom-h.height,bottom:h.bottom+d.height}),i.delta.position==="top"&&(S=null,g=h.top,v={width:Math.max(h.width,d.width),height:h.height+d.height,left:Math.min(h.left,d.left),right:Math.max(h.right,d.right),top:h.bottom-h.height-d.height,bottom:h.bottom}),L.attr({dx:S,dy:g})}(i._hasNumber||i._hasDelta)&&f.attr("transform",function(){var E=n.numbersScaler(v);T+=E[2];var z=B7(i,"numbersScale",1,E[0],T,Math.min),q;i._scaleNumbers||(z=1),i._isAngular?q=o-z*v.bottom:q=o-z*(v.top+v.bottom)/2,i._numbersTop=z*v.top+q;var V=v[s];s==="center"&&(V=(v.left+v.right)/2);var G=a-z*V;return G=B7(i,"numbersTranslate",0,G,T,Math.max),fC(G,q)+ZYt(z)})}function ww(e){e.each(function(t){G5.stroke(Aw.select(this),t.line.color)}).each(function(t){G5.fill(Aw.select(this),t.color)}).style("stroke-width",function(t){return t.line.width})}function iKt(e,t,r){return function(){var n=XYt(t,r);return function(i){return e.endAngle(n(i))()}}}function cC(e,t,r){var n=e._fullLayout,i=qx.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),a={type:"linear",_id:"x"+t._id},o={letter:"x",font:n.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function s(l,u){return qx.coerce(i,a,QYt,l,u)}return JYt(i,a,s,o,n),$Yt(i,a,s,o),a}function KXe(e,t,r){var n=Math.min(t/e.width,r/e.height);return[n,e,t+"x"+r]}function nKt(e,t){var r=Math.sqrt(e.width/2*(e.width/2)+e.height*e.height),n=t/r;return[n,e,t]}function JXe(e,t,r,n){var i=document.createElementNS("http://www.w3.org/2000/svg","text"),a=Aw.select(i);return a.text(e).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",e).call(N7.convertToTspans,n).call(Tw.font,t),Tw.bBox(a.node())}function B7(e,t,r,n,i,a){var o="_cache"+t;e[o]&&e[o].key===i||(e[o]={key:i,value:r});var s=qx.aggNums(a,null,[e[o].value,n],2);return e[o].value=s,s}});var tZe=ye((z2r,eZe)=>{"use strict";eZe.exports={moduleType:"trace",name:"indicator",basePlotModule:FXe(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:f$(),supplyDefaults:jXe().supplyDefaults,calc:XXe().calc,plot:QXe(),meta:{}}});var iZe=ye((q2r,rZe)=>{"use strict";rZe.exports=tZe()});var v$=ye((B2r,sZe)=>{"use strict";var nZe=Qb(),U7=Ao().extendFlat,aKt=mc().overrideAll,aZe=ec(),oKt=Cc().attributes,oZe=vf().descriptionOnlyNumbers,O2r=sZe.exports=aKt({domain:oKt({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:oZe("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:U7({},nZe.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:U7({},aZe({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:oZe("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:U7({},nZe.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:U7({},aZe({arrayOk:!0}))}},"calc","from-root")});var uZe=ye((N2r,lZe)=>{"use strict";var p$=Pr(),sKt=v$(),lKt=Cc().defaults;function uKt(e,t){for(var r=e.columnorder||[],n=e.header.values.length,i=r.slice(0,n),a=i.slice().sort(function(l,u){return l-u}),o=i.map(function(l){return a.indexOf(l)}),s=o.length;s<n;s++)o.push(s);t("columnorder",o)}lZe.exports=function(t,r,n,i){function a(o,s){return p$.coerce(t,r,sKt,o,s)}lKt(r,i,a),a("columnwidth"),a("header.values"),a("header.format"),a("header.align"),a("header.prefix"),a("header.suffix"),a("header.height"),a("header.line.width"),a("header.line.color"),a("header.fill.color"),p$.coerceFont(a,"header.font",i.font),uKt(r,a),a("cells.values"),a("cells.format"),a("cells.align"),a("cells.prefix"),a("cells.suffix"),a("cells.height"),a("cells.line.width"),a("cells.line.color"),a("cells.fill.color"),p$.coerceFont(a,"cells.font",i.font),r._length=null}});var fZe=ye((U2r,cZe)=>{"use strict";var cKt=ny().wrap;cZe.exports=function(){return cKt({})}});var g$=ye((V2r,hZe)=>{"use strict";hZe.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"<br>",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}});var bZe=ye((G2r,xZe)=>{"use strict";var dZe=g$(),y$=Ao().extendFlat,fKt=Eo(),hKt=Yd().isTypedArray,V7=Yd().isArrayOrTypedArray;xZe.exports=function(t,r){var n=m$(r.cells.values),i=function(g){return g.slice(r.header.values.length,g.length)},a=m$(r.header.values);a.length&&!a[0].length&&(a[0]=[""],a=m$(a));var o=a.concat(i(n).map(function(){return _Ze((a[0]||[""]).length)})),s=r.domain,l=Math.floor(t._fullLayout._size.w*(s.x[1]-s.x[0])),u=Math.floor(t._fullLayout._size.h*(s.y[1]-s.y[0])),c=r.header.values.length?o[0].map(function(){return r.header.height}):[dZe.emptyHeaderHeight],f=n.length?n[0].map(function(){return r.cells.height}):[],h=c.reduce(vZe,0),d=u-h,v=d+dZe.uplift,m=mZe(f,v),b=mZe(c,h),p=gZe(b,[]),k=gZe(m,p),M={},T=r._fullInput.columnorder;V7(T)&&(T=Array.from(T)),T=T.concat(i(n.map(function(g,P){return P})));var L=o.map(function(g,P){var E=V7(r.columnwidth)?r.columnwidth[Math.min(P,r.columnwidth.length-1)]:r.columnwidth;return fKt(E)?Number(E):1}),x=L.reduce(vZe,0);L=L.map(function(g){return g/x*l});var C=Math.max(_$(r.header.line.width),_$(r.cells.line.width)),S={key:r.uid+t._context.staticPlot,translateX:s.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-s.y[1]),size:t._fullLayout._size,width:l,maxLineWidth:C,height:u,columnOrder:T,groupHeight:u,rowBlocks:k,headerRowBlocks:p,scrollY:0,cells:y$({},r.cells,{values:n}),headerCells:y$({},r.header,{values:o}),gdColumns:o.map(function(g){return g[0]}),gdColumnsOriginalOrder:o.map(function(g){return g[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:o.map(function(g,P){var E=M[g];M[g]=(E||0)+1;var z=g+"__"+M[g];return{key:z,label:g,specIndex:P,xIndex:T[P],xScale:pZe,x:void 0,calcdata:void 0,columnWidth:L[P]}})};return S.columns.forEach(function(g){g.calcdata=S,g.x=pZe(g)}),S};function _$(e){if(V7(e)){for(var t=0,r=0;r<e.length;r++)t=Math.max(t,_$(e[r]));return t}return e}function vZe(e,t){return e+t}function m$(e){var t=e.slice(),r=1/0,n=0,i;for(i=0;i<t.length;i++)hKt(t[i])?t[i]=Array.from(t[i]):V7(t[i])||(t[i]=[t[i]]),r=Math.min(r,t[i].length),n=Math.max(n,t[i].length);if(r!==n)for(i=0;i<t.length;i++){var a=n-t[i].length;a&&(t[i]=t[i].concat(_Ze(a)))}return t}function _Ze(e){for(var t=new Array(e),r=0;r<e;r++)t[r]="";return t}function pZe(e){return e.calcdata.columns.reduce(function(t,r){return r.xIndex<e.xIndex?t+r.columnWidth:t},0)}function gZe(e,t){var r=Object.keys(e);return r.map(function(n){return y$({},e[n],{auxiliaryBlocks:t})})}function mZe(e,t){for(var r={},n,i=0,a=0,o=yZe(),s=0,l=0,u=0;u<e.length;u++)n=e[u],o.rows.push({rowIndex:u,rowHeight:n}),a+=n,(a>=t||u===e.length-1)&&(r[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=u,o=yZe(),i+=a,s=u+1,a=0);return r}function yZe(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}});var wZe=ye(x$=>{"use strict";var G7=Ao().extendFlat;x$.splitToPanels=function(e){var t=[0,0],r=G7({},e,{key:"header",type:"header",page:0,prevPages:t,currentRepaint:[null,null],dragHandle:!0,values:e.calcdata.headerCells.values[e.specIndex],rowBlocks:e.calcdata.headerRowBlocks,calcdata:G7({},e.calcdata,{cells:e.calcdata.headerCells})}),n=G7({},e,{key:"cells1",type:"cells",page:0,prevPages:t,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),i=G7({},e,{key:"cells2",type:"cells",page:1,prevPages:t,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks});return[n,i,r]};x$.splitToCells=function(e){var t=dKt(e);return(e.values||[]).slice(t[0],t[1]).map(function(r,n){var i=typeof r=="string"&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:n+i,key:t[0]+n,column:e,calcdata:e.calcdata,page:e.page,rowBlocks:e.rowBlocks,value:r}})};function dKt(e){var t=e.rowBlocks[e.page],r=t?t.rows[0].rowIndex:0,n=t?r+t.rows.length:0;return[r,n]}});var L$=ye((j2r,RZe)=>{"use strict";var Ya=g$(),rf=qa(),b$=Pr(),vKt=b$.numberFormat,Uu=ny(),w$=So(),pKt=Zl(),gKt=Pr().raiseToTop,lg=Pr().strTranslate,mKt=Pr().cancelTransition,yKt=bZe(),CZe=wZe(),TZe=ka();RZe.exports=function(t,r){var n=!t._context.staticPlot,i=t._fullLayout._paper.selectAll("."+Ya.cn.table).data(r.map(function(k){var M=Uu.unwrap(k),T=M.trace;return yKt(t,T)}),Uu.keyFun);i.exit().remove(),i.enter().append("g").classed(Ya.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),i.attr("width",function(k){return k.width+k.size.l+k.size.r}).attr("height",function(k){return k.height+k.size.t+k.size.b}).attr("transform",function(k){return lg(k.translateX,k.translateY)});var a=i.selectAll("."+Ya.cn.tableControlView).data(Uu.repeat,Uu.keyFun),o=a.enter().append("g").classed(Ya.cn.tableControlView,!0).style("box-sizing","content-box");if(n){var s="onwheel"in document?"wheel":"mousewheel";o.on("mousemove",function(k){a.filter(function(M){return k===M}).call(dC,t)}).on(s,function(k){if(!k.scrollbarState.wheeling){k.scrollbarState.wheeling=!0;var M=k.scrollY+rf.event.deltaY,T=j7(t,a,null,M)(k);T||(rf.event.stopPropagation(),rf.event.preventDefault()),k.scrollbarState.wheeling=!1}}).call(dC,t,!0)}a.attr("transform",function(k){return lg(k.size.l,k.size.t)});var l=a.selectAll("."+Ya.cn.scrollBackground).data(Uu.repeat,Uu.keyFun);l.enter().append("rect").classed(Ya.cn.scrollBackground,!0).attr("fill","none"),l.attr("width",function(k){return k.width}).attr("height",function(k){return k.height}),a.each(function(k){w$.setClipUrl(rf.select(this),AZe(t,k),t)});var u=a.selectAll("."+Ya.cn.yColumn).data(function(k){return k.columns},Uu.keyFun);u.enter().append("g").classed(Ya.cn.yColumn,!0),u.exit().remove(),u.attr("transform",function(k){return lg(k.x,0)}),n&&u.call(rf.behavior.drag().origin(function(k){var M=rf.select(this);return EZe(M,k,-Ya.uplift),gKt(this),k.calcdata.columnDragInProgress=!0,dC(a.filter(function(T){return k.calcdata.key===T.key}),t),k}).on("drag",function(k){var M=rf.select(this),T=function(C){return(k===C?rf.event.x:C.x)+C.columnWidth/2};k.x=Math.max(-Ya.overdrag,Math.min(k.calcdata.width+Ya.overdrag-k.columnWidth,rf.event.x));var L=LZe(u).filter(function(C){return C.calcdata.key===k.calcdata.key}),x=L.sort(function(C,S){return T(C)-T(S)});x.forEach(function(C,S){C.xIndex=S,C.x=k===C?C.x:C.xScale(C)}),u.filter(function(C){return k!==C}).transition().ease(Ya.transitionEase).duration(Ya.transitionDuration).attr("transform",function(C){return lg(C.x,0)}),M.call(mKt).attr("transform",lg(k.x,-Ya.uplift))}).on("dragend",function(k){var M=rf.select(this),T=k.calcdata;k.x=k.xScale(k),k.calcdata.columnDragInProgress=!1,EZe(M,k,0),kKt(t,T,T.columns.map(function(L){return L.xIndex}))})),u.each(function(k){w$.setClipUrl(rf.select(this),SZe(t,k),t)});var c=u.selectAll("."+Ya.cn.columnBlock).data(CZe.splitToPanels,Uu.keyFun);c.enter().append("g").classed(Ya.cn.columnBlock,!0).attr("id",function(k){return k.key}),c.style("cursor",function(k){return k.dragHandle?"ew-resize":k.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var f=c.filter(CKt),h=c.filter(E$);n&&h.call(rf.behavior.drag().origin(function(k){return rf.event.stopPropagation(),k}).on("drag",j7(t,a,-1)).on("dragend",function(){})),T$(t,a,f,c),T$(t,a,h,c);var d=a.selectAll("."+Ya.cn.scrollAreaClip).data(Uu.repeat,Uu.keyFun);d.enter().append("clipPath").classed(Ya.cn.scrollAreaClip,!0).attr("id",function(k){return AZe(t,k)});var v=d.selectAll("."+Ya.cn.scrollAreaClipRect).data(Uu.repeat,Uu.keyFun);v.enter().append("rect").classed(Ya.cn.scrollAreaClipRect,!0).attr("x",-Ya.overdrag).attr("y",-Ya.uplift).attr("fill","none"),v.attr("width",function(k){return k.width+2*Ya.overdrag}).attr("height",function(k){return k.height+Ya.uplift});var m=u.selectAll("."+Ya.cn.columnBoundary).data(Uu.repeat,Uu.keyFun);m.enter().append("g").classed(Ya.cn.columnBoundary,!0);var b=u.selectAll("."+Ya.cn.columnBoundaryClippath).data(Uu.repeat,Uu.keyFun);b.enter().append("clipPath").classed(Ya.cn.columnBoundaryClippath,!0),b.attr("id",function(k){return SZe(t,k)});var p=b.selectAll("."+Ya.cn.columnBoundaryRect).data(Uu.repeat,Uu.keyFun);p.enter().append("rect").classed(Ya.cn.columnBoundaryRect,!0).attr("fill","none"),p.attr("width",function(k){return k.columnWidth+2*H7(k)}).attr("height",function(k){return k.calcdata.height+2*H7(k)+Ya.uplift}).attr("x",function(k){return-H7(k)}).attr("y",function(k){return-H7(k)}),k$(null,h,a)};function H7(e){return Math.ceil(e.calcdata.maxLineWidth/2)}function AZe(e,t){return"clip"+e._fullLayout._uid+"_scrollAreaBottomClip_"+t.key}function SZe(e,t){return"clip"+e._fullLayout._uid+"_columnBoundaryClippath_"+t.calcdata.key+"_"+t.specIndex}function LZe(e){return[].concat.apply([],e.map(function(t){return t})).map(function(t){return t.__data__})}function dC(e,t,r){function n(u){var c=u.rowBlocks;return S$(c,c.length-1)+(c.length?W7(c[c.length-1],1/0):1)}var i=e.selectAll("."+Ya.cn.scrollbarKit).data(Uu.repeat,Uu.keyFun);i.enter().append("g").classed(Ya.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),i.each(function(u){var c=u.scrollbarState;c.totalHeight=n(u),c.scrollableAreaHeight=u.groupHeight-A$(u),c.currentlyVisibleHeight=Math.min(c.totalHeight,c.scrollableAreaHeight),c.ratio=c.currentlyVisibleHeight/c.totalHeight,c.barLength=Math.max(c.ratio*c.currentlyVisibleHeight,Ya.goldenRatio*Ya.scrollbarWidth),c.barWiggleRoom=c.currentlyVisibleHeight-c.barLength,c.wiggleRoom=Math.max(0,c.totalHeight-c.scrollableAreaHeight),c.topY=c.barWiggleRoom===0?0:u.scrollY/c.wiggleRoom*c.barWiggleRoom,c.bottomY=c.topY+c.barLength,c.dragMultiplier=c.wiggleRoom/c.barWiggleRoom}).attr("transform",function(u){var c=u.width+Ya.scrollbarWidth/2+Ya.scrollbarOffset;return lg(c,A$(u))});var a=i.selectAll("."+Ya.cn.scrollbar).data(Uu.repeat,Uu.keyFun);a.enter().append("g").classed(Ya.cn.scrollbar,!0);var o=a.selectAll("."+Ya.cn.scrollbarSlider).data(Uu.repeat,Uu.keyFun);o.enter().append("g").classed(Ya.cn.scrollbarSlider,!0),o.attr("transform",function(u){return lg(0,u.scrollbarState.topY||0)});var s=o.selectAll("."+Ya.cn.scrollbarGlyph).data(Uu.repeat,Uu.keyFun);s.enter().append("line").classed(Ya.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",Ya.scrollbarWidth).attr("stroke-linecap","round").attr("y1",Ya.scrollbarWidth/2),s.attr("y2",function(u){return u.scrollbarState.barLength-Ya.scrollbarWidth/2}).attr("stroke-opacity",function(u){return u.columnDragInProgress||!u.scrollbarState.barWiggleRoom||r?0:.4}),s.transition().delay(0).duration(0),s.transition().delay(Ya.scrollbarHideDelay).duration(Ya.scrollbarHideDuration).attr("stroke-opacity",0);var l=a.selectAll("."+Ya.cn.scrollbarCaptureZone).data(Uu.repeat,Uu.keyFun);l.enter().append("line").classed(Ya.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",Ya.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(u){var c=rf.event.y,f=this.getBoundingClientRect(),h=u.scrollbarState,d=c-f.top,v=rf.scale.linear().domain([0,h.scrollableAreaHeight]).range([0,h.totalHeight]).clamp(!0);h.topY<=d&&d<=h.bottomY||j7(t,e,null,v(d-h.barLength/2))(u)}).call(rf.behavior.drag().origin(function(u){return rf.event.stopPropagation(),u.scrollbarState.scrollbarScrollInProgress=!0,u}).on("drag",j7(t,e)).on("dragend",function(){})),l.attr("y2",function(u){return u.scrollbarState.scrollableAreaHeight}),t._context.staticPlot&&(s.remove(),l.remove())}function T$(e,t,r,n){var i=_Kt(r),a=xKt(i);AKt(a);var o=bKt(a);MKt(o);var s=TKt(a),l=wKt(s);SKt(l),PZe(l,t,n,e),C$(a)}function _Kt(e){var t=e.selectAll("."+Ya.cn.columnCells).data(Uu.repeat,Uu.keyFun);return t.enter().append("g").classed(Ya.cn.columnCells,!0),t.exit().remove(),t}function xKt(e){var t=e.selectAll("."+Ya.cn.columnCell).data(CZe.splitToCells,function(r){return r.keyWithinBlock});return t.enter().append("g").classed(Ya.cn.columnCell,!0),t.exit().remove(),t}function bKt(e){var t=e.selectAll("."+Ya.cn.cellRect).data(Uu.repeat,function(r){return r.keyWithinBlock});return t.enter().append("rect").classed(Ya.cn.cellRect,!0),t}function wKt(e){var t=e.selectAll("."+Ya.cn.cellText).data(Uu.repeat,function(r){return r.keyWithinBlock});return t.enter().append("text").classed(Ya.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){rf.event.stopPropagation()}),t}function TKt(e){var t=e.selectAll("."+Ya.cn.cellTextHolder).data(Uu.repeat,function(r){return r.keyWithinBlock});return t.enter().append("g").classed(Ya.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),t}function AKt(e){e.each(function(t,r){var n=t.calcdata.cells.font,i=t.column.specIndex,a={size:Yv(n.size,i,r),color:Yv(n.color,i,r),family:Yv(n.family,i,r),weight:Yv(n.weight,i,r),style:Yv(n.style,i,r),variant:Yv(n.variant,i,r),textcase:Yv(n.textcase,i,r),lineposition:Yv(n.lineposition,i,r),shadow:Yv(n.shadow,i,r)};t.rowNumber=t.key,t.align=Yv(t.calcdata.cells.align,i,r),t.cellBorderWidth=Yv(t.calcdata.cells.line.width,i,r),t.font=a})}function SKt(e){e.each(function(t){w$.font(rf.select(this),t.font)})}function MKt(e){e.attr("width",function(t){return t.column.columnWidth}).attr("stroke-width",function(t){return t.cellBorderWidth}).each(function(t){var r=rf.select(this);TZe.stroke(r,Yv(t.calcdata.cells.line.color,t.column.specIndex,t.rowNumber)),TZe.fill(r,Yv(t.calcdata.cells.fill.color,t.column.specIndex,t.rowNumber))})}function PZe(e,t,r,n){e.text(function(i){var a=i.column.specIndex,o=i.rowNumber,s=i.value,l=typeof s=="string",u=l&&s.match(/<br>/i),c=!l||u;i.mayHaveMarkup=l&&s.match(/[<&>]/);var f=EKt(s);i.latex=f;var h=f?"":Yv(i.calcdata.cells.prefix,a,o)||"",d=f?"":Yv(i.calcdata.cells.suffix,a,o)||"",v=f?null:Yv(i.calcdata.cells.format,a,o)||null,m=h+(v?vKt(v)(i.value):i.value)+d,b;i.wrappingNeeded=!i.wrapped&&!c&&!f&&(b=MZe(m)),i.cellHeightMayIncrease=u||f||i.mayHaveMarkup||(b===void 0?MZe(m):b),i.needsConvertToTspans=i.mayHaveMarkup||i.wrappingNeeded||i.latex;var p;if(i.wrappingNeeded){var k=Ya.wrapSplitCharacter===" "?m.replace(/<a href=/ig,"<a_href="):m,M=k.split(Ya.wrapSplitCharacter),T=Ya.wrapSplitCharacter===" "?M.map(function(L){return L.replace(/<a_href=/ig,"<a href=")}):M;i.fragments=T.map(function(L){return{text:L,width:null}}),i.fragments.push({fragment:Ya.wrapSpacer,width:null}),p=T.join(Ya.lineBreaker)+Ya.lineBreaker+Ya.wrapSpacer}else delete i.fragments,p=m;return p}).attr("dy",function(i){return i.needsConvertToTspans?0:"0.75em"}).each(function(i){var a=this,o=rf.select(a),s=i.wrappingNeeded?PKt:IKt;i.needsConvertToTspans?pKt.convertToTspans(o,n,s(r,a,t,n,i)):rf.select(a.parentNode).attr("transform",function(l){return lg(IZe(l),Ya.cellPad)}).attr("text-anchor",function(l){return{left:"start",center:"middle",right:"end"}[l.align]})})}function EKt(e){return typeof e=="string"&&e.match(Ya.latexCheck)}function MZe(e){return e.indexOf(Ya.wrapSplitCharacter)!==-1}function kKt(e,t,r){var n=t.gdColumnsOriginalOrder;t.gdColumns.sort(function(i,a){return r[n.indexOf(i)]-r[n.indexOf(a)]}),t.columnorder=r,e.emit("plotly_restyle")}function Yv(e,t,r){if(b$.isArrayOrTypedArray(e)){var n=e[Math.min(t,e.length-1)];return b$.isArrayOrTypedArray(n)?n[Math.min(r,n.length-1)]:n}else return e}function EZe(e,t,r){e.transition().ease(Ya.releaseTransitionEase).duration(Ya.releaseTransitionDuration).attr("transform",lg(t.x,r))}function E$(e){return e.type==="cells"}function CKt(e){return e.type==="header"}function A$(e){var t=e.rowBlocks.length?e.rowBlocks[0].auxiliaryBlocks:[];return t.reduce(function(r,n){return r+W7(n,1/0)},0)}function LKt(e,t,r){for(var n=[],i=0,a=0;a<e.length;a++){for(var o=e[a],s=o.rows,l=0,u=0;u<s.length;u++)l+=s[u].rowHeight;o.allRowsHeight=l;var c=i+l,f=t,h=f+r;f<c&&h>i&&n.push(a),i+=l}return n}function k$(e,t,r){var n=LZe(t)[0];if(n!==void 0){var i=n.rowBlocks,a=n.calcdata,o=S$(i,i.length),s=n.calcdata.groupHeight-A$(n),l=a.scrollY=Math.max(0,Math.min(o-s,a.scrollY)),u=LKt(i,l,s);u.length===1&&(u[0]===i.length-1?u.unshift(u[0]-1):u.push(u[0]+1)),u[0]%2&&u.reverse(),t.each(function(c,f){c.page=u[f],c.scrollY=l}),t.attr("transform",function(c){var f=S$(c.rowBlocks,c.page)-c.scrollY;return lg(0,f)}),e&&(kZe(e,r,t,u,n.prevPages,n,0),kZe(e,r,t,u,n.prevPages,n,1),dC(r,e))}}function j7(e,t,r,n){return function(a){var o=a.calcdata?a.calcdata:a,s=t.filter(function(f){return o.key===f.key}),l=r||o.scrollbarState.dragMultiplier,u=o.scrollY;o.scrollY=n===void 0?o.scrollY+l*rf.event.dy:n;var c=s.selectAll("."+Ya.cn.yColumn).selectAll("."+Ya.cn.columnBlock).filter(E$);return k$(e,c,s),o.scrollY===u}}function kZe(e,t,r,n,i,a,o){var s=n[o]!==i[o];s&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var l=r.filter(function(u,c){return c===o&&n[c]!==i[c]});T$(e,t,l,r),i[o]=n[o]}))}function PKt(e,t,r,n){return function(){var a=rf.select(t.parentNode);a.each(function(o){var s=o.fragments;a.selectAll("tspan.line").each(function(m,b){s[b].width=this.getComputedTextLength()});var l=s[s.length-1].width,u=s.slice(0,-1),c=[],f,h,d=0,v=o.column.columnWidth-2*Ya.cellPad;for(o.value="";u.length;)f=u.shift(),h=f.width+l,d+h>v&&(o.value+=c.join(Ya.wrapSpacer)+Ya.lineBreaker,c=[],d=0),c.push(f.text),d+=h;d&&(o.value+=c.join(Ya.wrapSpacer)),o.wrapped=!0}),a.selectAll("tspan.line").remove(),PZe(a.select("."+Ya.cn.cellText),r,e,n),rf.select(t.parentNode.parentNode).call(C$)}}function IKt(e,t,r,n,i){return function(){if(!i.settledY){var o=rf.select(t.parentNode),s=M$(i),l=i.key-s.firstRowIndex,u=s.rows[l].rowHeight,c=i.cellHeightMayIncrease?t.parentNode.getBoundingClientRect().height+2*Ya.cellPad:u,f=Math.max(c,u),h=f-s.rows[l].rowHeight;h&&(s.rows[l].rowHeight=f,e.selectAll("."+Ya.cn.columnCell).call(C$),k$(null,e.filter(E$),0),dC(r,n,!0)),o.attr("transform",function(){var d=this,v=d.parentNode,m=v.getBoundingClientRect(),b=rf.select(d.parentNode).select("."+Ya.cn.cellRect).node().getBoundingClientRect(),p=d.transform.baseVal.consolidate(),k=b.top-m.top+(p?p.matrix.f:Ya.cellPad);return lg(IZe(i,rf.select(d.parentNode).select("."+Ya.cn.cellTextHolder).node().getBoundingClientRect().width),k)}),i.settledY=!0}}}function IZe(e,t){switch(e.align){case"left":return Ya.cellPad;case"right":return e.column.columnWidth-(t||0)-Ya.cellPad;case"center":return(e.column.columnWidth-(t||0))/2;default:return Ya.cellPad}}function C$(e){e.attr("transform",function(t){var r=t.rowBlocks[0].auxiliaryBlocks.reduce(function(o,s){return o+W7(s,1/0)},0),n=M$(t),i=W7(n,t.key),a=i+r;return lg(0,a)}).selectAll("."+Ya.cn.cellRect).attr("height",function(t){return DKt(M$(t),t.key).rowHeight})}function S$(e,t){for(var r=0,n=t-1;n>=0;n--)r+=RKt(e[n]);return r}function W7(e,t){for(var r=0,n=0;n<e.rows.length&&e.rows[n].rowIndex<t;n++)r+=e.rows[n].rowHeight;return r}function RKt(e){var t=e.allRowsHeight;if(t!==void 0)return t;for(var r=0,n=0;n<e.rows.length;n++)r+=e.rows[n].rowHeight;return e.allRowsHeight=r,r}function M$(e){return e.rowBlocks[e.page]}function DKt(e,t){return e.rows[t-e.firstRowIndex]}});var DZe=ye(Z7=>{"use strict";var FKt=Id().getModuleCalcData,zKt=L$(),X7="table";Z7.name=X7;Z7.plot=function(e){var t=FKt(e.calcdata,X7)[0];t.length&&zKt(e,t)};Z7.clean=function(e,t,r,n){var i=n._has&&n._has(X7),a=t._has&&t._has(X7);i&&!a&&n._paperdiv.selectAll(".table").remove()}});var zZe=ye((X2r,FZe)=>{"use strict";FZe.exports={attributes:v$(),supplyDefaults:uZe(),calc:fZe(),plot:L$(),moduleType:"trace",name:"table",basePlotModule:DZe(),categories:["noOpacity"],meta:{}}});var OZe=ye((Z2r,qZe)=>{"use strict";qZe.exports=zZe()});var GZe=ye((Y2r,VZe)=>{"use strict";var BZe=ec(),NZe=Ih(),P$=Rd(),qKt=vf().descriptionWithDates,OKt=mc().overrideAll,UZe=Pd().dash,I$=Ao().extendFlat;VZe.exports={color:{valType:"color",editType:"calc"},smoothing:{valType:"number",dflt:1,min:0,max:1.3,editType:"calc"},title:{text:{valType:"string",dflt:"",editType:"calc"},font:BZe({editType:"calc"}),offset:{valType:"number",dflt:10,editType:"calc"},editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autotypenumbers:P$.autotypenumbers,autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",editType:"calc",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}]},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},cheatertype:{valType:"enumerated",values:["index","value"],dflt:"value",editType:"calc"},tickmode:{valType:"enumerated",values:["linear","array"],dflt:"array",editType:"calc"},nticks:{valType:"integer",min:0,dflt:0,editType:"calc"},tickvals:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},showticklabels:{valType:"enumerated",values:["start","end","both","none"],dflt:"start",editType:"calc"},labelalias:I$({},P$.labelalias,{editType:"calc"}),tickfont:BZe({editType:"calc"}),tickangle:{valType:"angle",dflt:"auto",editType:"calc"},tickprefix:{valType:"string",dflt:"",editType:"calc"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},ticksuffix:{valType:"string",dflt:"",editType:"calc"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B","SI extended"],dflt:"B",editType:"calc"},minexponent:{valType:"number",dflt:3,min:0,editType:"calc"},separatethousands:{valType:"boolean",dflt:!1,editType:"calc"},tickformat:{valType:"string",dflt:"",editType:"calc",description:qKt("tick label")},tickformatstops:OKt(P$.tickformatstops,"calc","from-root"),categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},labelpadding:{valType:"integer",dflt:10,editType:"calc"},labelprefix:{valType:"string",editType:"calc"},labelsuffix:{valType:"string",dflt:"",editType:"calc"},showline:{valType:"boolean",dflt:!1,editType:"calc"},linecolor:{valType:"color",dflt:NZe.defaultLine,editType:"calc"},linewidth:{valType:"number",min:0,dflt:1,editType:"calc"},gridcolor:{valType:"color",editType:"calc"},gridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},griddash:I$({},UZe,{editType:"calc"}),showgrid:{valType:"boolean",dflt:!0,editType:"calc"},minorgridcount:{valType:"integer",min:0,dflt:0,editType:"calc"},minorgridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},minorgriddash:I$({},UZe,{editType:"calc"}),minorgridcolor:{valType:"color",dflt:NZe.lightLine,editType:"calc"},startline:{valType:"boolean",editType:"calc"},startlinecolor:{valType:"color",editType:"calc"},startlinewidth:{valType:"number",dflt:1,editType:"calc"},endline:{valType:"boolean",editType:"calc"},endlinewidth:{valType:"number",dflt:1,editType:"calc"},endlinecolor:{valType:"color",editType:"calc"},tick0:{valType:"number",min:0,dflt:0,editType:"calc"},dtick:{valType:"number",min:0,dflt:1,editType:"calc"},arraytick0:{valType:"integer",min:0,dflt:0,editType:"calc"},arraydtick:{valType:"integer",min:1,dflt:1,editType:"calc"},editType:"calc"}});var K7=ye((K2r,WZe)=>{"use strict";var BKt=ec(),HZe=GZe(),jZe=Ih(),Y7=BKt({editType:"calc"}),NKt=pf().zorder;Y7.family.dflt='"Open Sans", verdana, arial, sans-serif';Y7.size.dflt=12;Y7.color.dflt=jZe.defaultLine;WZe.exports={carpet:{valType:"string",editType:"calc"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},a:{valType:"data_array",editType:"calc"},a0:{valType:"number",dflt:0,editType:"calc"},da:{valType:"number",dflt:1,editType:"calc"},b:{valType:"data_array",editType:"calc"},b0:{valType:"number",dflt:0,editType:"calc"},db:{valType:"number",dflt:1,editType:"calc"},cheaterslope:{valType:"number",dflt:1,editType:"calc"},aaxis:HZe,baxis:HZe,font:Y7,color:{valType:"color",dflt:jZe.defaultLine,editType:"plot"},zorder:NKt}});var YZe=ye((J2r,ZZe)=>{"use strict";var XZe=Pr().isArray1D;ZZe.exports=function(t,r,n){var i=n("x"),a=i&&i.length,o=n("y"),s=o&&o.length;if(!a&&!s)return!1;if(r._cheater=!i,(!a||XZe(i))&&(!s||XZe(o))){var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),r.a&&r.a.length&&(l=Math.min(l,r.a.length)),r.b&&r.b.length&&(l=Math.min(l,r.b.length)),r._length=l}else r._length=null;return!0}});var $Ze=ye(($2r,JZe)=>{"use strict";var UKt=K7(),KZe=ka().addOpacity,VKt=Oa(),vC=Pr(),GKt=Pb(),HKt=s_(),jKt=l_(),WKt=fI(),XKt=xm(),ZKt=H3();JZe.exports=function(t,r,n){var i=n.letter,a=n.font||{},o=UKt[i+"axis"];function s(g,P){return vC.coerce(t,r,o,g,P)}function l(g,P){return vC.coerce2(t,r,o,g,P)}n.name&&(r._name=n.name,r._id=n.name),s("autotypenumbers",n.autotypenumbersDflt);var u=s("type");if(u==="-"&&(n.data&&YKt(r,n.data),r.type==="-"?r.type="linear":u=t.type=r.type),s("smoothing"),s("cheatertype"),s("showticklabels"),s("labelprefix",i+" = "),s("labelsuffix"),s("showtickprefix"),s("showticksuffix"),s("separatethousands"),s("tickformat"),s("exponentformat"),s("minexponent"),s("showexponent"),s("categoryorder"),s("tickmode"),s("tickvals"),s("ticktext"),s("tick0"),s("dtick"),r.tickmode==="array"&&(s("arraytick0"),s("arraydtick")),s("labelpadding"),r._hovertitle=i,u==="date"){var c=VKt.getComponentMethod("calendars","handleDefaults");c(t,r,"calendar",n.calendar)}XKt(r,n.fullLayout),r.c2p=vC.identity;var f=s("color",n.dfltColor),h=f===t.color?f:a.color,d=s("title.text");d&&(vC.coerceFont(s,"title.font",a,{overrideDflt:{size:vC.bigFont(a.size),color:h}}),s("title.offset")),s("tickangle");var v=s("autorange",!r.isValidRange(t.range));v&&s("rangemode"),s("range"),r.cleanRange(),s("fixedrange"),GKt(t,r,s,u),jKt(t,r,s,u,n),HKt(t,r,s,u,n),WKt(t,r,s,{data:n.data,dataAttr:i});var m=l("gridcolor",KZe(f,.3)),b=l("gridwidth"),p=l("griddash"),k=s("showgrid");k||(delete r.gridcolor,delete r.gridwidth,delete r.griddash);var M=l("startlinecolor",f),T=l("startlinewidth",b),L=s("startline",r.showgrid||!!M||!!T);L||(delete r.startlinecolor,delete r.startlinewidth);var x=l("endlinecolor",f),C=l("endlinewidth",b),S=s("endline",r.showgrid||!!x||!!C);return S||(delete r.endlinecolor,delete r.endlinewidth),k?(s("minorgridcount"),s("minorgridwidth",b),s("minorgriddash",p),s("minorgridcolor",KZe(m,.06)),r.minorgridcount||(delete r.minorgridwidth,delete r.minorgriddash,delete r.minorgridcolor)):(delete r.gridcolor,delete r.gridwidth,delete r.griddash),r.showticklabels==="none"&&(delete r.tickfont,delete r.tickangle,delete r.showexponent,delete r.exponentformat,delete r.minexponent,delete r.tickformat,delete r.showticksuffix,delete r.showtickprefix),r.showticksuffix||delete r.ticksuffix,r.showtickprefix||delete r.tickprefix,s("tickmode"),r};function YKt(e,t){if(e.type==="-"){var r=e._id,n=r.charAt(0),i=n+"calendar",a=e[i];e.type=ZKt(t,a,{autotypenumbers:e.autotypenumbers})}}});var eYe=ye((Q2r,QZe)=>{"use strict";var KKt=$Ze(),JKt=vl();QZe.exports=function(t,r,n,i,a){var o=i("a");o||(i("da"),i("a0"));var s=i("b");s||(i("db"),i("b0")),$Kt(t,r,n,a)};function $Kt(e,t,r,n){var i=["aaxis","baxis"];i.forEach(function(a){var o=a.charAt(0),s=e[a]||{},l=JKt.newContainer(t,a),u={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,tickfont:"x",id:o+"axis",letter:o,font:t.font,name:a,data:e[o],calendar:t.calendar,dfltColor:n,bgColor:r.paper_bgcolor,autotypenumbersDflt:r.autotypenumbers,fullLayout:r};KKt(s,l,u),l._categories=l._categories||[],!e[a]&&s.type!=="-"&&(e[a]={type:s.type})})}});var iYe=ye((ewr,rYe)=>{"use strict";var tYe=Pr(),QKt=YZe(),eJt=eYe(),tJt=K7(),rJt=Ih();rYe.exports=function(t,r,n,i){function a(l,u){return tYe.coerce(t,r,tJt,l,u)}r._clipPathId="clip"+r.uid+"carpet";var o=a("color",rJt.defaultLine);if(tYe.coerceFont(a,"font",i.font),a("carpet"),eJt(t,r,i,a,o),!r.a||!r.b){r.visible=!1;return}r.a.length<3&&(r.aaxis.smoothing=0),r.b.length<3&&(r.baxis.smoothing=0);var s=QKt(t,r,a);s||(r.visible=!1),r._cheater&&a("cheaterslope"),a("zorder")}});var R$=ye((twr,nYe)=>{"use strict";var iJt=Pr().isArrayOrTypedArray;nYe.exports=function(t,r,n){var i;for(iJt(t)?t.length>r.length&&(t=t.slice(0,r.length)):t=[],i=0;i<r.length;i++)t[i]=n(r[i]);return t}});var D$=ye((rwr,aYe)=>{"use strict";aYe.exports=function(t,r,n){if(t.length===0)return"";var i,a=[],o=n?3:1;for(i=0;i<t.length;i+=o)a.push(t[i]+","+r[i]),n&&i<t.length-o&&(a.push("C"),a.push([t[i+1]+","+r[i+1],t[i+2]+","+r[i+2]+" "].join(" ")));return a.join(n?"":"L")}});var sYe=ye((iwr,oYe)=>{"use strict";oYe.exports=function(t,r,n,i,a,o){var s=a[0]*t.dpdx(r),l=a[1]*t.dpdy(n),u=1,c=1;if(o){var f=Math.sqrt(a[0]*a[0]+a[1]*a[1]),h=Math.sqrt(o[0]*o[0]+o[1]*o[1]),d=(a[0]*o[0]+a[1]*o[1])/f/h;c=Math.max(0,d)}var v=Math.atan2(l,s)*180/Math.PI;return v<-90?(v+=180,u=-u):v>90&&(v-=180,u=-u),{angle:v,flip:u,p:t.c2p(i,r,n),offsetMultplier:c}}});var pYe=ye((nwr,vYe)=>{"use strict";var e9=qa(),J7=So(),$7=R$(),cYe=D$(),pC=sYe(),F$=Zl(),Up=Pr(),fYe=Up.strRotate,Q7=Up.strTranslate,hYe=Dh();vYe.exports=function(t,r,n,i){var a=t._context.staticPlot,o=r.xaxis,s=r.yaxis,l=t._fullLayout,u=l._clips;Up.makeTraceGroups(i,n,"trace").each(function(c){var f=e9.select(this),h=c[0],d=h.trace,v=d.aaxis,m=d.baxis,b=Up.ensureSingle(f,"g","minorlayer"),p=Up.ensureSingle(f,"g","majorlayer"),k=Up.ensureSingle(f,"g","boundarylayer"),M=Up.ensureSingle(f,"g","labellayer");f.style("opacity",d.opacity),H5(o,s,p,v,"a",v._gridlines,!0,a),H5(o,s,p,m,"b",m._gridlines,!0,a),H5(o,s,b,v,"a",v._minorgridlines,!0,a),H5(o,s,b,m,"b",m._minorgridlines,!0,a),H5(o,s,k,v,"a-boundary",v._boundarylines,a),H5(o,s,k,m,"b-boundary",m._boundarylines,a);var T=lYe(t,o,s,d,h,M,v._labels,"a-label"),L=lYe(t,o,s,d,h,M,m._labels,"b-label");aJt(t,M,d,h,o,s,T,L),nJt(d,h,u,o,s)})};function nJt(e,t,r,n,i){var a,o,s,l,u=r.select("#"+e._clipPathId);u.size()||(u=r.append("clipPath").classed("carpetclip",!0));var c=Up.ensureSingle(u,"path","carpetboundary"),f=t.clipsegments,h=[];for(l=0;l<f.length;l++)a=f[l],o=$7([],a.x,n.c2p),s=$7([],a.y,i.c2p),h.push(cYe(o,s,a.bicubic));var d="M"+h.join("L")+"Z";u.attr("id",e._clipPathId),c.attr("d",d)}function H5(e,t,r,n,i,a,o){var s="const-"+i+"-lines",l=r.selectAll("."+s).data(a);l.enter().append("path").classed(s,!0).style("vector-effect",o?"none":"non-scaling-stroke"),l.each(function(u){var c=u,f=c.x,h=c.y,d=$7([],f,e.c2p),v=$7([],h,t.c2p),m="M"+cYe(d,v,c.smoothing),b=e9.select(this);b.attr("d",m).style("stroke-width",c.width).style("stroke",c.color).style("stroke-dasharray",J7.dashStyle(c.dash,c.width)).style("fill","none")}),l.exit().remove()}function lYe(e,t,r,n,i,a,o,s){var l=a.selectAll("text."+s).data(o);l.enter().append("text").classed(s,!0);var u=0,c={};return l.each(function(f,h){var d;if(f.axis.tickangle==="auto")d=pC(n,t,r,f.xy,f.dxy);else{var v=(f.axis.tickangle+180)*Math.PI/180;d=pC(n,t,r,f.xy,[Math.cos(v),Math.sin(v)])}h||(c={angle:d.angle,flip:d.flip});var m=(f.endAnchor?-1:1)*d.flip,b=e9.select(this).attr({"text-anchor":m>0?"start":"end","data-notex":1}).call(J7.font,f.font).text(f.text).call(F$.convertToTspans,e),p=J7.bBox(this);b.attr("transform",Q7(d.p[0],d.p[1])+fYe(d.angle)+Q7(f.axis.labelpadding*m,p.height*.3)),u=Math.max(u,p.width+f.axis.labelpadding)}),l.exit().remove(),c.maxExtent=u,c}function aJt(e,t,r,n,i,a,o,s){var l,u,c,f,h=Up.aggNums(Math.min,null,r.a),d=Up.aggNums(Math.max,null,r.a),v=Up.aggNums(Math.min,null,r.b),m=Up.aggNums(Math.max,null,r.b);l=.5*(h+d),u=v,c=r.ab2xy(l,u,!0),f=r.dxyda_rough(l,u),o.angle===void 0&&Up.extendFlat(o,pC(r,i,a,c,r.dxydb_rough(l,u))),uYe(e,t,r,n,c,f,r.aaxis,i,a,o,"a-title"),l=h,u=.5*(v+m),c=r.ab2xy(l,u,!0),f=r.dxydb_rough(l,u),s.angle===void 0&&Up.extendFlat(s,pC(r,i,a,c,r.dxyda_rough(l,u))),uYe(e,t,r,n,c,f,r.baxis,i,a,s,"b-title")}var dYe=hYe.LINE_SPACING,oJt=(1-hYe.MID_SHIFT)/dYe+1;function uYe(e,t,r,n,i,a,o,s,l,u,c){var f=[];o.title.text&&f.push(o.title.text);var h=t.selectAll("text."+c).data(f),d=u.maxExtent;h.enter().append("text").classed(c,!0),h.each(function(){var v=pC(r,s,l,i,a);["start","both"].indexOf(o.showticklabels)===-1&&(d=0);var m=o.title.font.size;d+=m+o.title.offset;var b=u.angle+(u.flip<0?180:0),p=(b-v.angle+450)%360,k=p>90&&p<270,M=e9.select(this);M.text(o.title.text).call(F$.convertToTspans,e),k&&(d=(-F$.lineCount(M)+oJt)*dYe*m-d),M.attr("transform",Q7(v.p[0],v.p[1])+fYe(v.angle)+Q7(0,d)).attr("text-anchor","middle").call(J7.font,o.title.font)}),h.exit().remove()}});var mYe=ye((awr,gYe)=>{"use strict";var t9=Pr().isArrayOrTypedArray;gYe.exports=function(e,t,r){var n,i,a,o,s,l,u=[],c=t9(e)?e.length:e,f=t9(t)?t.length:t,h=t9(e)?e:null,d=t9(t)?t:null;h&&(a=(h.length-1)/(h[h.length-1]-h[0])/(c-1)),d&&(o=(d.length-1)/(d[d.length-1]-d[0])/(f-1));var v,m=1/0,b=-1/0;for(i=0;i<f;i++)for(u[i]=[],l=d?(d[i]-d[0])*o:i/(f-1),n=0;n<c;n++)s=h?(h[n]-h[0])*a:n/(c-1),v=s-l*r,m=Math.min(v,m),b=Math.max(v,b),u[i][n]=v;var p=1/(b-m),k=-m*p;for(i=0;i<f;i++)for(n=0;n<c;n++)u[i][n]=p*u[i][n]+k;return u}});var bYe=ye((owr,xYe)=>{"use strict";var yYe=Pr().isArrayOrTypedArray;xYe.exports=function(e){return _Ye(e,0)};function _Ye(e,t){if(!yYe(e)||t>=10)return null;for(var r=1/0,n=-1/0,i=e.length,a=0;a<i;a++){var o=e[a];if(yYe(o)){var s=_Ye(o,t+1);s&&(r=Math.min(s[0],r),n=Math.max(s[1],n))}else r=Math.min(o,r),n=Math.max(o,n)}return[r,n]}});var TYe=ye((swr,wYe)=>{"use strict";var sJt=ho(),Ox=Ao().extendFlat;wYe.exports=function(t,r,n){var i,a,o,s,l,u,c,f,h,d,v,m,b,p,k=t["_"+r],M=t[r+"axis"],T=M._gridlines=[],L=M._minorgridlines=[],x=M._boundarylines=[],C=t["_"+n],S=t[n+"axis"];M.tickmode==="array"&&(M.tickvals=k.slice());var g=t._xctrl,P=t._yctrl,E=g[0].length,z=g.length,q=t._a.length,V=t._b.length;sJt.prepTicks(M),M.tickmode==="array"&&delete M.tickvals;var G=M.smoothing?3:1;function Z(N){var H,ie,ae,_e,Ee,Ce,ge,re,Se,ke,be,Be,Le=[],me=[],Pe={};if(r==="b")for(ie=t.b2j(N),ae=Math.floor(Math.max(0,Math.min(V-2,ie))),_e=ie-ae,Pe.length=V,Pe.crossLength=q,Pe.xy=function(ce){return t.evalxy([],ce,ie)},Pe.dxy=function(ce,He){return t.dxydi([],ce,ae,He,_e)},H=0;H<q;H++)Ce=Math.min(q-2,H),ge=H-Ce,re=t.evalxy([],H,ie),S.smoothing&&H>0&&(Se=t.dxydi([],H-1,ae,0,_e),Le.push(Ee[0]+Se[0]/3),me.push(Ee[1]+Se[1]/3),ke=t.dxydi([],H-1,ae,1,_e),Le.push(re[0]-ke[0]/3),me.push(re[1]-ke[1]/3)),Le.push(re[0]),me.push(re[1]),Ee=re;else for(H=t.a2i(N),Ce=Math.floor(Math.max(0,Math.min(q-2,H))),ge=H-Ce,Pe.length=q,Pe.crossLength=V,Pe.xy=function(ce){return t.evalxy([],H,ce)},Pe.dxy=function(ce,He){return t.dxydj([],Ce,ce,ge,He)},ie=0;ie<V;ie++)ae=Math.min(V-2,ie),_e=ie-ae,re=t.evalxy([],H,ie),S.smoothing&&ie>0&&(be=t.dxydj([],Ce,ie-1,ge,0),Le.push(Ee[0]+be[0]/3),me.push(Ee[1]+be[1]/3),Be=t.dxydj([],Ce,ie-1,ge,1),Le.push(re[0]-Be[0]/3),me.push(re[1]-Be[1]/3)),Le.push(re[0]),me.push(re[1]),Ee=re;return Pe.axisLetter=r,Pe.axis=M,Pe.crossAxis=S,Pe.value=N,Pe.constvar=n,Pe.index=f,Pe.x=Le,Pe.y=me,Pe.smoothing=S.smoothing,Pe}function j(N){var H,ie,ae,_e,Ee,Ce=[],ge=[],re={};if(re.length=k.length,re.crossLength=C.length,r==="b")for(ae=Math.max(0,Math.min(V-2,N)),Ee=Math.min(1,Math.max(0,N-ae)),re.xy=function(Se){return t.evalxy([],Se,N)},re.dxy=function(Se,ke){return t.dxydi([],Se,ae,ke,Ee)},H=0;H<E;H++)Ce[H]=g[N*G][H],ge[H]=P[N*G][H];else for(ie=Math.max(0,Math.min(q-2,N)),_e=Math.min(1,Math.max(0,N-ie)),re.xy=function(Se){return t.evalxy([],N,Se)},re.dxy=function(Se,ke){return t.dxydj([],ie,Se,_e,ke)},H=0;H<z;H++)Ce[H]=g[H][N*G],ge[H]=P[H][N*G];return re.axisLetter=r,re.axis=M,re.crossAxis=S,re.value=k[N],re.constvar=n,re.index=N,re.x=Ce,re.y=ge,re.smoothing=S.smoothing,re}if(M.tickmode==="array"){for(s=5e-15,l=[Math.floor((k.length-1-M.arraytick0)/M.arraydtick*(1+s)),Math.ceil(-M.arraytick0/M.arraydtick/(1+s))].sort(function(N,H){return N-H}),u=l[0]-1,c=l[1]+1,f=u;f<c;f++)a=M.arraytick0+M.arraydtick*f,!(a<0||a>k.length-1)&&T.push(Ox(j(a),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(f=u;f<c;f++)if(o=M.arraytick0+M.arraydtick*f,v=Math.min(o+M.arraydtick,k.length-1),!(o<0||o>k.length-1)&&!(v<0||v>k.length-1))for(m=k[o],b=k[v],i=0;i<M.minorgridcount;i++)p=v-o,!(p<=0)&&(d=m+(b-m)*(i+1)/(M.minorgridcount+1)*(M.arraydtick/p),!(d<k[0]||d>k[k.length-1])&&L.push(Ox(Z(d),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash})));M.startline&&x.push(Ox(j(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&x.push(Ox(j(k.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(s=5e-15,l=[Math.floor((k[k.length-1]-M.tick0)/M.dtick*(1+s)),Math.ceil((k[0]-M.tick0)/M.dtick/(1+s))].sort(function(N,H){return N-H}),u=l[0],c=l[1],f=u;f<=c;f++)h=M.tick0+M.dtick*f,T.push(Ox(Z(h),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(f=u-1;f<c+1;f++)for(h=M.tick0+M.dtick*f,i=0;i<M.minorgridcount;i++)d=h+M.dtick*(i+1)/(M.minorgridcount+1),!(d<k[0]||d>k[k.length-1])&&L.push(Ox(Z(d),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash}));M.startline&&x.push(Ox(Z(k[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&x.push(Ox(Z(k[k.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}});var EYe=ye((lwr,MYe)=>{"use strict";var AYe=ho(),SYe=Ao().extendFlat;MYe.exports=function(t,r){var n,i,a,o,s,l=r._labels=[],u=r._gridlines;for(n=0;n<u.length;n++)s=u[n],["start","both"].indexOf(r.showticklabels)!==-1&&(i=AYe.tickText(r,s.value),SYe(i,{prefix:a,suffix:o,endAnchor:!0,xy:s.xy(0),dxy:s.dxy(0,0),axis:s.axis,length:s.crossAxis.length,font:s.axis.tickfont,isFirst:n===0,isLast:n===u.length-1}),l.push(i)),["end","both"].indexOf(r.showticklabels)!==-1&&(i=AYe.tickText(r,s.value),SYe(i,{endAnchor:!1,xy:s.xy(s.crossLength-1),dxy:s.dxy(s.crossLength-2,1),axis:s.axis,length:s.crossAxis.length,font:s.axis.tickfont,isFirst:n===0,isLast:n===u.length-1}),l.push(i))}});var CYe=ye((uwr,kYe)=>{"use strict";kYe.exports=function(t,r,n,i){var a,o,s,l=[],u=!!n.smoothing,c=!!i.smoothing,f=t[0].length-1,h=t.length-1;for(a=0,o=[],s=[];a<=f;a++)o[a]=t[0][a],s[a]=r[0][a];for(l.push({x:o,y:s,bicubic:u}),a=0,o=[],s=[];a<=h;a++)o[a]=t[a][f],s[a]=r[a][f];for(l.push({x:o,y:s,bicubic:c}),a=f,o=[],s=[];a>=0;a--)o[f-a]=t[h][a],s[f-a]=r[h][a];for(l.push({x:o,y:s,bicubic:u}),a=h,o=[],s=[];a>=0;a--)o[h-a]=t[a][0],s[h-a]=r[a][0];return l.push({x:o,y:s,bicubic:c}),l}});var PYe=ye((cwr,LYe)=>{"use strict";var lJt=Pr();LYe.exports=function(t,r,n){var i,a,o,s=[],l=[],u=t[0].length,c=t.length;function f(ae,_e){var Ee=0,Ce,ge=0;return ae>0&&(Ce=t[_e][ae-1])!==void 0&&(ge++,Ee+=Ce),ae<u-1&&(Ce=t[_e][ae+1])!==void 0&&(ge++,Ee+=Ce),_e>0&&(Ce=t[_e-1][ae])!==void 0&&(ge++,Ee+=Ce),_e<c-1&&(Ce=t[_e+1][ae])!==void 0&&(ge++,Ee+=Ce),Ee/Math.max(1,ge)}var h=0;for(i=0;i<u;i++)for(a=0;a<c;a++)t[a][i]===void 0&&(s.push(i),l.push(a),t[a][i]=f(i,a)),h=Math.max(h,Math.abs(t[a][i]));if(!s.length)return t;var d,v,m,b,p,k,M,T,L,x,C,S=1e-5,g=0,P=100,E=0,z=s.length;do{for(g=0,o=0;o<z;o++){i=s[o],a=l[o];var q=0,V=0,G,Z,j,N,H,ie;i===0?(H=Math.min(u-1,2),j=r[H],N=r[1],G=t[a][H],Z=t[a][1],V+=Z+(Z-G)*(r[0]-N)/(N-j),q++):i===u-1&&(H=Math.max(0,u-3),j=r[H],N=r[u-2],G=t[a][H],Z=t[a][u-2],V+=Z+(Z-G)*(r[u-1]-N)/(N-j),q++),(i===0||i===u-1)&&a>0&&a<c-1&&(d=n[a+1]-n[a],v=n[a]-n[a-1],V+=(v*t[a+1][i]+d*t[a-1][i])/(v+d),q++),a===0?(ie=Math.min(c-1,2),j=n[ie],N=n[1],G=t[ie][i],Z=t[1][i],V+=Z+(Z-G)*(n[0]-N)/(N-j),q++):a===c-1&&(ie=Math.max(0,c-3),j=n[ie],N=n[c-2],G=t[ie][i],Z=t[c-2][i],V+=Z+(Z-G)*(n[c-1]-N)/(N-j),q++),(a===0||a===c-1)&&i>0&&i<u-1&&(d=r[i+1]-r[i],v=r[i]-r[i-1],V+=(v*t[a][i+1]+d*t[a][i-1])/(v+d),q++),q?V/=q:(m=r[i+1]-r[i],b=r[i]-r[i-1],p=n[a+1]-n[a],k=n[a]-n[a-1],M=m*b*(m+b),T=p*k*(p+k),V=(M*(k*t[a+1][i]+p*t[a-1][i])+T*(b*t[a][i+1]+m*t[a][i-1]))/(T*(b+m)+M*(k+p))),L=V-t[a][i],x=L/h,g+=x*x,C=q?0:.85,t[a][i]+=L*(1+C)}g=Math.sqrt(g)}while(E++<P&&g>S);return lJt.log("Smoother converged to",g,"after",E,"iterations"),t}});var RYe=ye((fwr,IYe)=>{"use strict";IYe.exports={RELATIVE_CULL_TOLERANCE:1e-6}});var zYe=ye((hwr,FYe)=>{"use strict";var DYe=.5;FYe.exports=function(t,r,n,i){var a=t[0]-r[0],o=t[1]-r[1],s=n[0]-r[0],l=n[1]-r[1],u=Math.pow(a*a+o*o,DYe/2),c=Math.pow(s*s+l*l,DYe/2),f=(c*c*a-u*u*s)*i,h=(c*c*o-u*u*l)*i,d=c*(u+c)*3,v=u*(u+c)*3;return[[r[0]+(d&&f/d),r[1]+(d&&h/d)],[r[0]-(v&&f/v),r[1]-(v&&h/v)]]}});var OYe=ye((dwr,qYe)=>{"use strict";var z$=zYe(),r9=Pr().ensureArray;function j5(e,t,r){var n=-.5*r[0]+1.5*t[0],i=-.5*r[1]+1.5*t[1];return[(2*n+e[0])/3,(2*i+e[1])/3]}qYe.exports=function(t,r,n,i,a,o){var s,l,u,c,f,h,d,v,m,b,p=n[0].length,k=n.length,M=a?3*p-2:p,T=o?3*k-2:k;for(t=r9(t,T),r=r9(r,T),u=0;u<T;u++)t[u]=r9(t[u],M),r[u]=r9(r[u],M);for(l=0,c=0;l<k;l++,c+=o?3:1)for(f=t[c],h=r[c],d=n[l],v=i[l],s=0,u=0;s<p;s++,u+=a?3:1)f[u]=d[s],h[u]=v[s];if(a)for(l=0,c=0;l<k;l++,c+=o?3:1){for(s=1,u=3;s<p-1;s++,u+=3)m=z$([n[l][s-1],i[l][s-1]],[n[l][s],i[l][s]],[n[l][s+1],i[l][s+1]],a),t[c][u-1]=m[0][0],r[c][u-1]=m[0][1],t[c][u+1]=m[1][0],r[c][u+1]=m[1][1];b=j5([t[c][0],r[c][0]],[t[c][2],r[c][2]],[t[c][3],r[c][3]]),t[c][1]=b[0],r[c][1]=b[1],b=j5([t[c][M-1],r[c][M-1]],[t[c][M-3],r[c][M-3]],[t[c][M-4],r[c][M-4]]),t[c][M-2]=b[0],r[c][M-2]=b[1]}if(o)for(u=0;u<M;u++){for(c=3;c<T-3;c+=3)m=z$([t[c-3][u],r[c-3][u]],[t[c][u],r[c][u]],[t[c+3][u],r[c+3][u]],o),t[c-1][u]=m[0][0],r[c-1][u]=m[0][1],t[c+1][u]=m[1][0],r[c+1][u]=m[1][1];b=j5([t[0][u],r[0][u]],[t[2][u],r[2][u]],[t[3][u],r[3][u]]),t[1][u]=b[0],r[1][u]=b[1],b=j5([t[T-1][u],r[T-1][u]],[t[T-3][u],r[T-3][u]],[t[T-4][u],r[T-4][u]]),t[T-2][u]=b[0],r[T-2][u]=b[1]}if(a&&o)for(c=1;c<T;c+=(c+1)%3===0?2:1){for(u=3;u<M-3;u+=3)m=z$([t[c][u-3],r[c][u-3]],[t[c][u],r[c][u]],[t[c][u+3],r[c][u+3]],a),t[c][u-1]=.5*(t[c][u-1]+m[0][0]),r[c][u-1]=.5*(r[c][u-1]+m[0][1]),t[c][u+1]=.5*(t[c][u+1]+m[1][0]),r[c][u+1]=.5*(r[c][u+1]+m[1][1]);b=j5([t[c][0],r[c][0]],[t[c][2],r[c][2]],[t[c][3],r[c][3]]),t[c][1]=.5*(t[c][1]+b[0]),r[c][1]=.5*(r[c][1]+b[1]),b=j5([t[c][M-1],r[c][M-1]],[t[c][M-3],r[c][M-3]],[t[c][M-4],r[c][M-4]]),t[c][M-2]=.5*(t[c][M-2]+b[0]),r[c][M-2]=.5*(r[c][M-2]+b[1])}return[t,r]}});var NYe=ye((vwr,BYe)=>{"use strict";BYe.exports=function(e,t,r,n,i){var a=t-2,o=r-2;return n&&i?function(s,l,u){s||(s=[]);var c,f,h,d,v,m,b=Math.max(0,Math.min(Math.floor(l),a)),p=Math.max(0,Math.min(Math.floor(u),o)),k=Math.max(0,Math.min(1,l-b)),M=Math.max(0,Math.min(1,u-p));b*=3,p*=3;var T=k*k,L=T*k,x=1-k,C=x*x,S=C*x,g=M*M,P=g*M,E=1-M,z=E*E,q=z*E;for(m=0;m<e.length;m++)v=e[m],c=S*v[p][b]+3*(C*k*v[p][b+1]+x*T*v[p][b+2])+L*v[p][b+3],f=S*v[p+1][b]+3*(C*k*v[p+1][b+1]+x*T*v[p+1][b+2])+L*v[p+1][b+3],h=S*v[p+2][b]+3*(C*k*v[p+2][b+1]+x*T*v[p+2][b+2])+L*v[p+2][b+3],d=S*v[p+3][b]+3*(C*k*v[p+3][b+1]+x*T*v[p+3][b+2])+L*v[p+3][b+3],s[m]=q*c+3*(z*M*f+E*g*h)+P*d;return s}:n?function(s,l,u){s||(s=[]);var c=Math.max(0,Math.min(Math.floor(l),a)),f=Math.max(0,Math.min(Math.floor(u),o)),h=Math.max(0,Math.min(1,l-c)),d=Math.max(0,Math.min(1,u-f)),v,m,b,p,k,M;c*=3;var T=h*h,L=T*h,x=1-h,C=x*x,S=C*x,g=1-d;for(k=0;k<e.length;k++)M=e[k],v=g*M[f][c]+d*M[f+1][c],m=g*M[f][c+1]+d*M[f+1][c+1],b=g*M[f][c+2]+d*M[f+1][c+1],p=g*M[f][c+3]+d*M[f+1][c+1],s[k]=S*v+3*(C*h*m+x*T*b)+L*p;return s}:i?function(s,l,u){s||(s=[]);var c=Math.max(0,Math.min(Math.floor(l),a)),f=Math.max(0,Math.min(Math.floor(u),o)),h=Math.max(0,Math.min(1,l-c)),d=Math.max(0,Math.min(1,u-f)),v,m,b,p,k,M;f*=3;var T=d*d,L=T*d,x=1-d,C=x*x,S=C*x,g=1-h;for(k=0;k<e.length;k++)M=e[k],v=g*M[f][c]+h*M[f][c+1],m=g*M[f+1][c]+h*M[f+1][c+1],b=g*M[f+2][c]+h*M[f+2][c+1],p=g*M[f+3][c]+h*M[f+3][c+1],s[k]=S*v+3*(C*d*m+x*T*b)+L*p;return s}:function(s,l,u){s||(s=[]);var c=Math.max(0,Math.min(Math.floor(l),a)),f=Math.max(0,Math.min(Math.floor(u),o)),h=Math.max(0,Math.min(1,l-c)),d=Math.max(0,Math.min(1,u-f)),v,m,b,p,k=1-d,M=1-h;for(b=0;b<e.length;b++)p=e[b],v=M*p[f][c]+h*p[f][c+1],m=M*p[f+1][c]+h*p[f+1][c+1],s[b]=k*v+d*m;return s}}});var VYe=ye((pwr,UYe)=>{"use strict";UYe.exports=function(e,t,r){return t&&r?function(n,i,a,o,s){n||(n=[]);var l,u,c,f,h,d;i*=3,a*=3;var v=o*o,m=1-o,b=m*m,p=m*o*2,k=-3*b,M=3*(b-p),T=3*(p-v),L=3*v,x=s*s,C=x*s,S=1-s,g=S*S,P=g*S;for(d=0;d<e.length;d++)h=e[d],l=k*h[a][i]+M*h[a][i+1]+T*h[a][i+2]+L*h[a][i+3],u=k*h[a+1][i]+M*h[a+1][i+1]+T*h[a+1][i+2]+L*h[a+1][i+3],c=k*h[a+2][i]+M*h[a+2][i+1]+T*h[a+2][i+2]+L*h[a+2][i+3],f=k*h[a+3][i]+M*h[a+3][i+1]+T*h[a+3][i+2]+L*h[a+3][i+3],n[d]=P*l+3*(g*s*u+S*x*c)+C*f;return n}:t?function(n,i,a,o,s){n||(n=[]);var l,u,c,f;i*=3;var h=o*o,d=1-o,v=d*d,m=d*o*2,b=-3*v,p=3*(v-m),k=3*(m-h),M=3*h,T=1-s;for(c=0;c<e.length;c++)f=e[c],l=b*f[a][i]+p*f[a][i+1]+k*f[a][i+2]+M*f[a][i+3],u=b*f[a+1][i]+p*f[a+1][i+1]+k*f[a+1][i+2]+M*f[a+1][i+3],n[c]=T*l+s*u;return n}:r?function(n,i,a,o,s){n||(n=[]);var l,u,c,f,h,d;a*=3;var v=s*s,m=v*s,b=1-s,p=b*b,k=p*b;for(h=0;h<e.length;h++)d=e[h],l=d[a][i+1]-d[a][i],u=d[a+1][i+1]-d[a+1][i],c=d[a+2][i+1]-d[a+2][i],f=d[a+3][i+1]-d[a+3][i],n[h]=k*l+3*(p*s*u+b*v*c)+m*f;return n}:function(n,i,a,o,s){n||(n=[]);var l,u,c,f,h=1-s;for(c=0;c<e.length;c++)f=e[c],l=f[a][i+1]-f[a][i],u=f[a+1][i+1]-f[a+1][i],n[c]=h*l+s*u;return n}}});var HYe=ye((gwr,GYe)=>{"use strict";GYe.exports=function(e,t,r){return t&&r?function(n,i,a,o,s){n||(n=[]);var l,u,c,f,h,d;i*=3,a*=3;var v=o*o,m=v*o,b=1-o,p=b*b,k=p*b,M=s*s,T=1-s,L=T*T,x=T*s*2,C=-3*L,S=3*(L-x),g=3*(x-M),P=3*M;for(d=0;d<e.length;d++)h=e[d],l=C*h[a][i]+S*h[a+1][i]+g*h[a+2][i]+P*h[a+3][i],u=C*h[a][i+1]+S*h[a+1][i+1]+g*h[a+2][i+1]+P*h[a+3][i+1],c=C*h[a][i+2]+S*h[a+1][i+2]+g*h[a+2][i+2]+P*h[a+3][i+2],f=C*h[a][i+3]+S*h[a+1][i+3]+g*h[a+2][i+3]+P*h[a+3][i+3],n[d]=k*l+3*(p*o*u+b*v*c)+m*f;return n}:t?function(n,i,a,o,s){n||(n=[]);var l,u,c,f,h,d;i*=3;var v=s*s,m=v*s,b=1-s,p=b*b,k=p*b;for(h=0;h<e.length;h++)d=e[h],l=d[a+1][i]-d[a][i],u=d[a+1][i+1]-d[a][i+1],c=d[a+1][i+2]-d[a][i+2],f=d[a+1][i+3]-d[a][i+3],n[h]=k*l+3*(p*s*u+b*v*c)+m*f;return n}:r?function(n,i,a,o,s){n||(n=[]);var l,u,c,f;a*=3;var h=1-o,d=s*s,v=1-s,m=v*v,b=v*s*2,p=-3*m,k=3*(m-b),M=3*(b-d),T=3*d;for(c=0;c<e.length;c++)f=e[c],l=p*f[a][i]+k*f[a+1][i]+M*f[a+2][i]+T*f[a+3][i],u=p*f[a][i+1]+k*f[a+1][i+1]+M*f[a+2][i+1]+T*f[a+3][i+1],n[c]=h*l+o*u;return n}:function(n,i,a,o,s){n||(n=[]);var l,u,c,f,h=1-o;for(c=0;c<e.length;c++)f=e[c],l=f[a+1][i]-f[a][i],u=f[a+1][i+1]-f[a][i+1],n[c]=h*l+o*u;return n}}});var ZYe=ye((mwr,XYe)=>{"use strict";var jYe=RYe(),WYe=V6().findBin,uJt=OYe(),cJt=NYe(),fJt=VYe(),hJt=HYe();XYe.exports=function(t){var r=t._a,n=t._b,i=r.length,a=n.length,o=t.aaxis,s=t.baxis,l=r[0],u=r[i-1],c=n[0],f=n[a-1],h=r[r.length-1]-r[0],d=n[n.length-1]-n[0],v=h*jYe.RELATIVE_CULL_TOLERANCE,m=d*jYe.RELATIVE_CULL_TOLERANCE;l-=v,u+=v,c-=m,f+=m,t.isVisible=function(b,p){return b>l&&b<u&&p>c&&p<f},t.isOccluded=function(b,p){return b<l||b>u||p<c||p>f},t.setScale=function(){var b=t._x,p=t._y,k=uJt(t._xctrl,t._yctrl,b,p,o.smoothing,s.smoothing);t._xctrl=k[0],t._yctrl=k[1],t.evalxy=cJt([t._xctrl,t._yctrl],i,a,o.smoothing,s.smoothing),t.dxydi=fJt([t._xctrl,t._yctrl],o.smoothing,s.smoothing),t.dxydj=hJt([t._xctrl,t._yctrl],o.smoothing,s.smoothing)},t.i2a=function(b){var p=Math.max(0,Math.floor(b[0]),i-2),k=b[0]-p;return(1-k)*r[p]+k*r[p+1]},t.j2b=function(b){var p=Math.max(0,Math.floor(b[1]),i-2),k=b[1]-p;return(1-k)*n[p]+k*n[p+1]},t.ij2ab=function(b){return[t.i2a(b[0]),t.j2b(b[1])]},t.a2i=function(b){var p=Math.max(0,Math.min(WYe(b,r),i-2)),k=r[p],M=r[p+1];return Math.max(0,Math.min(i-1,p+(b-k)/(M-k)))},t.b2j=function(b){var p=Math.max(0,Math.min(WYe(b,n),a-2)),k=n[p],M=n[p+1];return Math.max(0,Math.min(a-1,p+(b-k)/(M-k)))},t.ab2ij=function(b){return[t.a2i(b[0]),t.b2j(b[1])]},t.i2c=function(b,p){return t.evalxy([],b,p)},t.ab2xy=function(b,p,k){if(!k&&(b<r[0]||b>r[i-1]|p<n[0]||p>n[a-1]))return[!1,!1];var M=t.a2i(b),T=t.b2j(p),L=t.evalxy([],M,T);if(k){var x=0,C=0,S=[],g,P,E,z;b<r[0]?(g=0,P=0,x=(b-r[0])/(r[1]-r[0])):b>r[i-1]?(g=i-2,P=1,x=(b-r[i-1])/(r[i-1]-r[i-2])):(g=Math.max(0,Math.min(i-2,Math.floor(M))),P=M-g),p<n[0]?(E=0,z=0,C=(p-n[0])/(n[1]-n[0])):p>n[a-1]?(E=a-2,z=1,C=(p-n[a-1])/(n[a-1]-n[a-2])):(E=Math.max(0,Math.min(a-2,Math.floor(T))),z=T-E),x&&(t.dxydi(S,g,E,P,z),L[0]+=S[0]*x,L[1]+=S[1]*x),C&&(t.dxydj(S,g,E,P,z),L[0]+=S[0]*C,L[1]+=S[1]*C)}return L},t.c2p=function(b,p,k){return[p.c2p(b[0]),k.c2p(b[1])]},t.p2x=function(b,p,k){return[p.p2c(b[0]),k.p2c(b[1])]},t.dadi=function(b){var p=Math.max(0,Math.min(r.length-2,b));return r[p+1]-r[p]},t.dbdj=function(b){var p=Math.max(0,Math.min(n.length-2,b));return n[p+1]-n[p]},t.dxyda=function(b,p,k,M){var T=t.dxydi(null,b,p,k,M),L=t.dadi(b,k);return[T[0]/L,T[1]/L]},t.dxydb=function(b,p,k,M){var T=t.dxydj(null,b,p,k,M),L=t.dbdj(p,M);return[T[0]/L,T[1]/L]},t.dxyda_rough=function(b,p,k){var M=h*(k||.1),T=t.ab2xy(b+M,p,!0),L=t.ab2xy(b-M,p,!0);return[(T[0]-L[0])*.5/M,(T[1]-L[1])*.5/M]},t.dxydb_rough=function(b,p,k){var M=d*(k||.1),T=t.ab2xy(b,p+M,!0),L=t.ab2xy(b,p-M,!0);return[(T[0]-L[0])*.5/M,(T[1]-L[1])*.5/M]},t.dpdx=function(b){return b._m},t.dpdy=function(b){return b._m}}});var rKe=ye((ywr,tKe)=>{"use strict";var i9=ho(),YYe=Pr().isArray1D,dJt=mYe(),KYe=bYe(),JYe=TYe(),$Ye=EYe(),vJt=CYe(),QYe=c8(),eKe=PYe(),pJt=l8(),gJt=ZYe();tKe.exports=function(t,r){var n=i9.getFromId(t,r.xaxis),i=i9.getFromId(t,r.yaxis),a=r.aaxis,o=r.baxis,s=r.x,l=r.y,u=[];s&&YYe(s)&&u.push("x"),l&&YYe(l)&&u.push("y"),u.length&&pJt(r,a,o,"a","b",u);var c=r._a=r._a||r.a,f=r._b=r._b||r.b;s=r._x||r.x,l=r._y||r.y;var h={};if(r._cheater){var d=a.cheatertype==="index"?c.length:c,v=o.cheatertype==="index"?f.length:f;s=dJt(d,v,r.cheaterslope)}r._x=s=QYe(s),r._y=l=QYe(l),eKe(s,c,f),eKe(l,c,f),gJt(r),r.setScale();var m=KYe(s),b=KYe(l),p=.5*(m[1]-m[0]),k=.5*(m[1]+m[0]),M=.5*(b[1]-b[0]),T=.5*(b[1]+b[0]),L=1.3;return m=[k-p*L,k+p*L],b=[T-M*L,T+M*L],r._extremes[n._id]=i9.findExtremes(n,m,{padded:!0}),r._extremes[i._id]=i9.findExtremes(i,b,{padded:!0}),JYe(r,"a","b"),JYe(r,"b","a"),$Ye(r,a),$Ye(r,o),h.clipsegments=vJt(r._xctrl,r._yctrl,a,o),h.x=s,h.y=l,h.a=c,h.b=f,[h]}});var nKe=ye((_wr,iKe)=>{"use strict";iKe.exports={attributes:K7(),supplyDefaults:iYe(),plot:pYe(),calc:rKe(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:mh(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}});var oKe=ye((xwr,aKe)=>{"use strict";aKe.exports=nKe()});var q$=ye((bwr,cKe)=>{"use strict";var mJt=Pg(),c0=pf(),yJt=Gl(),{hovertemplateAttrs:_Jt,texttemplateAttrs:xJt,templatefallbackAttrs:sKe}=Ll(),lKe=Tu(),Bx=Ao().extendFlat,ug=c0.marker,W5=c0.line,uKe=ug.line;cKe.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:Bx({},c0.mode,{dflt:"markers"}),text:Bx({},c0.text,{}),texttemplate:xJt({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:sKe({editType:"plot"}),hovertext:Bx({},c0.hovertext,{}),line:{color:W5.color,width:W5.width,dash:W5.dash,backoff:W5.backoff,shape:Bx({},W5.shape,{values:["linear","spline"]}),smoothing:W5.smoothing,editType:"calc"},connectgaps:c0.connectgaps,fill:Bx({},c0.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:mJt(),marker:Bx({symbol:ug.symbol,opacity:ug.opacity,maxdisplayed:ug.maxdisplayed,angle:ug.angle,angleref:ug.angleref,standoff:ug.standoff,size:ug.size,sizeref:ug.sizeref,sizemin:ug.sizemin,sizemode:ug.sizemode,line:Bx({width:uKe.width,dash:uKe.dash,editType:"calc"},lKe("marker.line")),gradient:ug.gradient,editType:"calc"},lKe("marker")),textfont:c0.textfont,textposition:c0.textposition,selected:c0.selected,unselected:c0.unselected,hoverinfo:Bx({},yJt.hoverinfo,{flags:["a","b","text","name"]}),hoveron:c0.hoveron,hovertemplate:_Jt(),hovertemplatefallback:sKe(),zorder:c0.zorder}});var vKe=ye((wwr,dKe)=>{"use strict";var fKe=Pr(),bJt=Pm(),X5=Ru(),wJt=$p(),TJt=D0(),hKe=uT(),AJt=F0(),SJt=Fg(),MJt=q$();dKe.exports=function(t,r,n,i){function a(h,d){return fKe.coerce(t,r,MJt,h,d)}a("carpet"),r.xaxis="x",r.yaxis="y";var o=a("a"),s=a("b"),l=Math.min(o.length,s.length);if(!l){r.visible=!1;return}r._length=l,a("text"),a("texttemplate"),a("texttemplatefallback"),a("hovertext");var u=l<bJt.PTS_LINESONLY?"lines+markers":"lines";a("mode",u),X5.hasMarkers(r)&&wJt(t,r,n,i,a,{gradient:!0}),X5.hasLines(r)&&(TJt(t,r,n,i,a,{backoff:!0}),hKe(t,r,a),a("connectgaps")),X5.hasText(r)&&AJt(t,r,i,a);var c=[];(X5.hasMarkers(r)||X5.hasText(r))&&(a("marker.maxdisplayed"),c.push("points")),a("fill"),r.fill!=="none"&&(SJt(t,r,n,a),X5.hasLines(r)||hKe(t,r,a)),(r.fill==="tonext"||r.fill==="toself")&&c.push("fills");var f=a("hoveron",c.join("+")||"points");f!=="fills"&&(a("hovertemplate"),a("hovertemplatefallback")),a("zorder"),fKe.coerceSelectionMarkerOpacity(r,a)}});var gKe=ye((Twr,pKe)=>{"use strict";pKe.exports=function(t,r){var n={},i=r._carpet,a=i.ab2ij([t.a,t.b]),o=Math.floor(a[0]),s=a[0]-o,l=Math.floor(a[1]),u=a[1]-l,c=i.evalxy([],o,l,s,u);return n.yLabel=c[1].toFixed(3),n}});var n9=ye((Awr,mKe)=>{"use strict";mKe.exports=function(e,t){for(var r=e._fullData.length,n,i=0;i<r;i++){var a=e._fullData[i];if(a.index!==t.index&&a.type==="carpet"&&(n||(n=a),a.carpet===t.carpet))return a}return n}});var xKe=ye((Swr,_Ke)=>{"use strict";var yKe=Eo(),EJt=z0(),kJt=Dm(),CJt=q0(),LJt=O0().calcMarkerSize,PJt=n9();_Ke.exports=function(t,r){var n=r._carpetTrace=PJt(t,r);if(!(!n||!n.visible||n.visible==="legendonly")){var i;r.xaxis=n.xaxis,r.yaxis=n.yaxis;var a=r._length,o=new Array(a),s,l,u=!1;for(i=0;i<a;i++)if(s=r.a[i],l=r.b[i],yKe(s)&&yKe(l)){var c=n.ab2xy(+s,+l,!0),f=n.isVisible(+s,+l);f||(u=!0),o[i]={x:c[0],y:c[1],a:s,b:l,vis:f}}else o[i]={x:!1,y:!1};return r._needsCull=u,o[0].carpet=n,o[0].trace=r,LJt(r,a),EJt(t,r),kJt(o,r),CJt(o,r),o}}});var TKe=ye((Mwr,wKe)=>{"use strict";var IJt=pT(),bKe=ho(),RJt=So();wKe.exports=function(t,r,n,i){var a,o,s,l=n[0][0].carpet,u=bKe.getFromId(t,l.xaxis||"x"),c=bKe.getFromId(t,l.yaxis||"y"),f={xaxis:u,yaxis:c,plot:r.plot};for(a=0;a<n.length;a++)o=n[a][0].trace,o._xA=u,o._yA=c;for(IJt(t,f,n,i),a=0;a<n.length;a++)o=n[a][0].trace,s=i.selectAll("g.trace"+o.uid+" .js-line"),RJt.setClipUrl(s,n[a][0].carpet._clipPathId,t)}});var SKe=ye((Ewr,AKe)=>{"use strict";var DJt=_T(),FJt=Pr().fillText;AKe.exports=function(t,r,n,i){var a=DJt(t,r,n,i);if(!a||a[0].index===!1)return;var o=a[0];if(o.index===void 0){var s=1-o.y0/t.ya._length,l=t.xa._length,u=l*s/2,c=l-u;return o.x0=Math.max(Math.min(o.x0,c),u),o.x1=Math.max(Math.min(o.x1,c),u),a}var f=o.cd[o.index];o.a=f.a,o.b=f.b,o.xLabelVal=void 0,o.yLabelVal=void 0;var h=o.trace,d=h._carpet,v=h._module.formatLabels(f,h);o.yLabel=v.yLabel,delete o.text;var m=[];function b(M,T){var L;M.labelprefix&&M.labelprefix.length>0?L=M.labelprefix.replace(/ = $/,""):L=M._hovertitle,m.push(L+": "+T.toFixed(3)+M.labelsuffix)}if(!h.hovertemplate){var p=f.hi||h.hoverinfo,k=p.split("+");k.indexOf("all")!==-1&&(k=["a","b","text"]),k.indexOf("a")!==-1&&b(d.aaxis,f.a),k.indexOf("b")!==-1&&b(d.baxis,f.b),m.push("y: "+o.yLabel),k.indexOf("text")!==-1&&FJt(f,h,m),o.extraText=m.join("<br>")}return a}});var EKe=ye((kwr,MKe)=>{"use strict";MKe.exports=function(t,r,n,i,a){var o=i[a];return t.a=o.a,t.b=o.b,t.y=o.y,t}});var CKe=ye((Cwr,kKe)=>{"use strict";kKe.exports={attributes:q$(),supplyDefaults:vKe(),colorbar:Qd(),formatLabels:gKe(),calc:xKe(),plot:TKe(),style:sp().style,styleOnSelect:sp().styleOnSelect,hoverPoints:SKe(),selectPoints:xT(),eventData:EKe(),moduleType:"trace",name:"scattercarpet",basePlotModule:mh(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}});var PKe=ye((Lwr,LKe)=>{"use strict";LKe.exports=CKe()});var O$=ye((Pwr,IKe)=>{"use strict";var cg=qT(),T1=O4(),zJt=Tu(),qJt=Ao().extendFlat,uy=T1.contours;IKe.exports=qJt({carpet:{valType:"string",editType:"calc"},z:cg.z,a:cg.x,a0:cg.x0,da:cg.dx,b:cg.y,b0:cg.y0,db:cg.dy,text:cg.text,hovertext:cg.hovertext,transpose:cg.transpose,atype:cg.xtype,btype:cg.ytype,fillcolor:T1.fillcolor,autocontour:T1.autocontour,ncontours:T1.ncontours,contours:{type:uy.type,start:uy.start,end:uy.end,size:uy.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:uy.showlines,showlabels:uy.showlabels,labelfont:uy.labelfont,labelformat:uy.labelformat,operation:uy.operation,value:uy.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:T1.line.color,width:T1.line.width,dash:T1.line.dash,smoothing:T1.line.smoothing,editType:"plot"},zorder:T1.zorder},zJt("",{cLetter:"z",autoColorDflt:!1}))});var B$=ye((Iwr,FKe)=>{"use strict";var RKe=Pr(),OJt=a8(),DKe=O$(),BJt=FG(),NJt=C8(),UJt=L8();FKe.exports=function(t,r,n,i){function a(u,c){return RKe.coerce(t,r,DKe,u,c)}function o(u){return RKe.coerce2(t,r,DKe,u)}if(a("carpet"),t.a&&t.b){var s=OJt(t,r,a,i,"a","b");if(!s){r.visible=!1;return}a("text");var l=a("contours.type")==="constraint";l?BJt(t,r,a,i,n,{hasHover:!1}):(NJt(t,r,a,o),UJt(t,r,a,i,{hasHover:!1}))}else r._defaultColor=n,r._length=null;a("zorder")}});var BKe=ye((Rwr,OKe)=>{"use strict";var VJt=gv(),zKe=Pr(),GJt=l8(),HJt=c8(),jJt=f8(),WJt=h8(),qKe=nG(),XJt=B$(),ZJt=n9(),YJt=TG();OKe.exports=function(t,r){var n=r._carpetTrace=ZJt(t,r);if(!(!n||!n.visible||n.visible==="legendonly")){if(!r.a||!r.b){var i=t.data[n.index],a=t.data[r.index];a.a||(a.a=i.a),a.b||(a.b=i.b),XJt(a,r,r._defaultColor,t._fullLayout)}var o=KJt(t,r);return YJt(r,r._z),o}};function KJt(e,t){var r=t._carpetTrace,n=r.aaxis,i=r.baxis,a,o,s,l,u,c,f;n._minDtick=0,i._minDtick=0,zKe.isArray1D(t.z)&&GJt(t,n,i,"a","b",["z"]),a=t._a=t._a||t.a,l=t._b=t._b||t.b,a=a?n.makeCalcdata(t,"_a"):[],l=l?i.makeCalcdata(t,"_b"):[],o=t.a0||0,s=t.da||1,u=t.b0||0,c=t.db||1,f=t._z=HJt(t._z||t.z,t.transpose),t._emptypoints=WJt(f),jJt(f,t._emptypoints);var h=zKe.maxRowLength(f),d=t.xtype==="scaled"?"":a,v=qKe(t,d,o,s,h,n),m=t.ytype==="scaled"?"":l,b=qKe(t,m,u,c,f.length,i),p={a:v,b,z:f};return t.contours.type==="levels"&&t.contours.coloring!=="none"&&VJt(e,t,{vals:f,containerStr:"",cLetter:"z"}),[p]}});var UKe=ye((Dwr,NKe)=>{"use strict";var JJt=Pr().isArrayOrTypedArray;NKe.exports=function(e,t,r,n){var i,a,o,s,l,u,c,f,h,d,v,m,b,p=JJt(r)?"a":"b",k=p==="a"?e.aaxis:e.baxis,M=k.smoothing,T=p==="a"?e.a2i:e.b2j,L=p==="a"?r:n,x=p==="a"?n:r,C=p==="a"?t.a.length:t.b.length,S=p==="a"?t.b.length:t.a.length,g=Math.floor(p==="a"?e.b2j(x):e.a2i(x)),P=p==="a"?function(_e){return e.evalxy([],_e,g)}:function(_e){return e.evalxy([],g,_e)};M&&(o=Math.max(0,Math.min(S-2,g)),s=g-o,a=p==="a"?function(_e,Ee){return e.dxydi([],_e,o,Ee,s)}:function(_e,Ee){return e.dxydj([],o,_e,s,Ee)});var E=T(L[0]),z=T(L[1]),q=E<z?1:-1,V=(z-E)*1e-8,G=q>0?Math.floor:Math.ceil,Z=q>0?Math.ceil:Math.floor,j=q>0?Math.min:Math.max,N=q>0?Math.max:Math.min,H=G(E+V),ie=Z(z-V);c=P(E);var ae=[[c]];for(i=H;i*q<ie*q;i+=q)l=[],v=N(E,i),m=j(z,i+q),b=m-v,u=Math.max(0,Math.min(C-2,Math.floor(.5*(v+m)))),f=P(m),M&&(h=a(u,v-u),d=a(u,m-u),l.push([c[0]+h[0]/3*b,c[1]+h[1]/3*b]),l.push([f[0]-d[0]/3*b,f[1]-d[1]/3*b])),l.push(f),ae.push(l),c=f;return ae}});var ZKe=ye((Fwr,XKe)=>{"use strict";var o9=qa(),s9=R$(),WKe=D$(),gC=So(),A1=Pr(),$Jt=SG(),QJt=MG(),Sw=R8(),a9=N4(),e$t=LG(),t$t=CG(),r$t=PG(),i$t=n9(),VKe=UKe();XKe.exports=function(t,r,n,i){var a=r.xaxis,o=r.yaxis;A1.makeTraceGroups(i,n,"contour").each(function(s){var l=o9.select(this),u=s[0],c=u.trace,f=c._carpetTrace=i$t(t,c),h=t.calcdata[f.index][0];if(!f.visible||f.visible==="legendonly")return;var d=u.a,v=u.b,m=c.contours,b=t$t(m,r,u),p=m.type==="constraint",k=m._operation,M=p?k==="="?"lines":"fill":m.coloring;function T(G){var Z=f.ab2xy(G[0],G[1],!0);return[a.c2p(Z[0]),o.c2p(Z[1])]}var L=[[d[0],v[v.length-1]],[d[d.length-1],v[v.length-1]],[d[d.length-1],v[0]],[d[0],v[0]]];$Jt(b);var x=(d[d.length-1]-d[0])*1e-8,C=(v[v.length-1]-v[0])*1e-8;QJt(b,x,C);var S=b;m.type==="constraint"&&(S=e$t(b,k)),n$t(b,T);var g,P,E,z,q=[];for(z=h.clipsegments.length-1;z>=0;z--)g=h.clipsegments[z],P=s9([],g.x,a.c2p),E=s9([],g.y,o.c2p),P.reverse(),E.reverse(),q.push(WKe(P,E,g.bicubic));var V="M"+q.join("L")+"Z";s$t(l,h.clipsegments,a,o,p,M),l$t(c,l,a,o,S,L,T,f,h,M,V),a$t(l,b,t,u,m,r,f),gC.setClipUrl(l,f._clipPathId,t)})};function n$t(e,t){var r,n,i,a,o,s,l,u,c;for(r=0;r<e.length;r++){for(a=e[r],o=a.pedgepaths=[],s=a.ppaths=[],n=0;n<a.edgepaths.length;n++){for(c=a.edgepaths[n],l=[],i=0;i<c.length;i++)l[i]=t(c[i]);o.push(l)}for(n=0;n<a.paths.length;n++){for(c=a.paths[n],u=[],i=0;i<c.length;i++)u[i]=t(c[i]);s.push(u)}}}function a$t(e,t,r,n,i,a,o){var s=r._context.staticPlot,l=A1.ensureSingle(e,"g","contourlines"),u=i.showlines!==!1,c=i.showlabels,f=u&&c,h=Sw.createLines(l,u||c,t,s),d=Sw.createLineClip(l,f,r,n.trace.uid),v=e.selectAll("g.contourlabels").data(c?[0]:[]);if(v.exit().remove(),v.enter().append("g").classed("contourlabels",!0),c){var m=a.xaxis,b=a.yaxis,p=m._length,k=b._length,M=[[[0,0],[p,0],[p,k],[0,k]]],T=[];A1.clearLocationCache();var L=Sw.labelFormatter(r,n),x=gC.tester.append("text").attr("data-notex",1).call(gC.font,i.labelfont),C={left:0,right:p,center:p/2,top:0,bottom:k,middle:k/2},S=Math.sqrt(p*p+k*k),g=a9.LABELDISTANCE*S/Math.max(1,t.length/a9.LABELINCREASE);h.each(function(P){var E=Sw.calcTextOpts(P.level,L,x,r);o9.select(this).selectAll("path").each(function(z){var q=this,V=A1.getVisibleSegment(q,C,E.height/2);if(V&&(o$t(q,z,P,V,o,E.height),!(V.len<(E.width+E.height)*a9.LABELMIN)))for(var G=Math.min(Math.ceil(V.len/g),a9.LABELMAX),Z=0;Z<G;Z++){var j=Sw.findBestTextLocation(q,V,E,T,C);if(!j)break;Sw.addLabelData(j,E,T,M)}})}),x.remove(),Sw.drawLabels(v,T,r,d,f?M:null)}c&&!u&&h.remove()}function o$t(e,t,r,n,i,a){for(var o,s=0;s<r.pedgepaths.length;s++)t===r.pedgepaths[s]&&(o=r.edgepaths[s]);if(!o)return;var l=i.a[0],u=i.a[i.a.length-1],c=i.b[0],f=i.b[i.b.length-1];function h(p,k){var M=0,T,L=.1;return(Math.abs(p[0]-l)<L||Math.abs(p[0]-u)<L)&&(T=HKe(i.dxydb_rough(p[0],p[1],L)),M=Math.max(M,a*jKe(k,T)/2)),(Math.abs(p[1]-c)<L||Math.abs(p[1]-f)<L)&&(T=HKe(i.dxyda_rough(p[0],p[1],L)),M=Math.max(M,a*jKe(k,T)/2)),M}var d=GKe(e,0,1),v=GKe(e,n.total,n.total-1),m=h(o[0],d),b=n.total-h(o[o.length-1],v);n.min<m&&(n.min=m),n.max>b&&(n.max=b),n.len=n.max-n.min}function GKe(e,t,r){var n=e.getPointAtLength(t),i=e.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function HKe(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]}function jKe(e,t){var r=Math.abs(e[0]*t[0]+e[1]*t[1]),n=Math.sqrt(1-r*r);return n/r}function s$t(e,t,r,n,i,a){var o,s,l,u,c=A1.ensureSingle(e,"g","contourbg"),f=c.selectAll("path").data(a==="fill"&&!i?[0]:[]);f.enter().append("path"),f.exit().remove();var h=[];for(u=0;u<t.length;u++)o=t[u],s=s9([],o.x,r.c2p),l=s9([],o.y,n.c2p),h.push(WKe(s,l,o.bicubic));f.attr("d","M"+h.join("L")+"Z").style("stroke","none")}function l$t(e,t,r,n,i,a,o,s,l,u,c){var f=u==="fill";f&&r$t(i,e.contours);var h=A1.ensureSingle(t,"g","contourfill"),d=h.selectAll("path").data(f?i:[]);d.enter().append("path"),d.exit().remove(),d.each(function(v){var m=(v.prefixBoundary?c:"")+u$t(e,v,a,o,s,l,r,n);m?o9.select(this).attr("d",m).style("stroke","none"):o9.select(this).remove()})}function u$t(e,t,r,n,i,a,o,s){var l,u="",c=t.edgepaths.map(function(E,z){return z}),f=!0,h,d,v,m,b,p,k=Math.abs(r[0][0]-r[2][0])*1e-4,M=Math.abs(r[0][1]-r[2][1])*1e-4;function T(E){return Math.abs(E[1]-r[0][1])<M}function L(E){return Math.abs(E[1]-r[2][1])<M}function x(E){return Math.abs(E[0]-r[0][0])<k}function C(E){return Math.abs(E[0]-r[2][0])<k}function S(E,z){var q,V,G,Z,j="";for(T(E)&&!C(E)||L(E)&&!x(E)?(Z=i.aaxis,G=VKe(i,a,[E[0],z[0]],.5*(E[1]+z[1]))):(Z=i.baxis,G=VKe(i,a,.5*(E[0]+z[0]),[E[1],z[1]])),q=1;q<G.length;q++)for(j+=Z.smoothing?"C":"L",V=0;V<G[q].length;V++){var N=G[q][V];j+=[o.c2p(N[0]),s.c2p(N[1])]+" "}return j}for(l=0,h=null;c.length;){var g=t.edgepaths[l][0];for(h&&(u+=S(h,g)),p=gC.smoothopen(t.edgepaths[l].map(n),t.smoothing),u+=f?p:p.replace(/^M/,"L"),c.splice(c.indexOf(l),1),h=t.edgepaths[l][t.edgepaths[l].length-1],m=-1,v=0;v<4;v++){if(!h){A1.log("Missing end?",l,t);break}for(T(h)&&!C(h)?d=r[1]:x(h)?d=r[0]:L(h)?d=r[3]:C(h)&&(d=r[2]),b=0;b<t.edgepaths.length;b++){var P=t.edgepaths[b][0];Math.abs(h[0]-d[0])<k?Math.abs(h[0]-P[0])<k&&(P[1]-h[1])*(d[1]-P[1])>=0&&(d=P,m=b):Math.abs(h[1]-d[1])<M?Math.abs(h[1]-P[1])<M&&(P[0]-h[0])*(d[0]-P[0])>=0&&(d=P,m=b):A1.log("endpt to newendpt is not vert. or horz.",h,d,P)}if(m>=0)break;u+=S(h,d),h=d}if(m===t.edgepaths.length){A1.log("unclosed perimeter path");break}l=m,f=c.indexOf(l)===-1,f&&(l=c[0],u+=S(h,d)+"Z",h=null)}for(l=0;l<t.paths.length;l++)u+=gC.smoothclosed(t.paths[l].map(n),t.smoothing);return u}});var KKe=ye((zwr,YKe)=>{"use strict";YKe.exports={attributes:O$(),supplyDefaults:B$(),colorbar:z8(),calc:BKe(),plot:ZKe(),style:F8(),moduleType:"trace",name:"contourcarpet",basePlotModule:mh(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}});var $Ke=ye((qwr,JKe)=>{"use strict";JKe.exports=KKe()});var u9=ye((Owr,iJe)=>{"use strict";var l9=Pr().extendFlat,mC=pf(),QKe=vf().axisHoverFormat,{hovertemplateAttrs:c$t,templatefallbackAttrs:f$t}=Ll(),tJe=Pd().dash,h$t=g3(),rJe=QT(),d$t=rJe.INCREASING.COLOR,v$t=rJe.DECREASING.COLOR,N$=mC.line;function eJe(e){return{line:{color:l9({},N$.color,{dflt:e}),width:N$.width,dash:tJe,editType:"style"},editType:"style"}}iJe.exports={xperiod:mC.xperiod,xperiod0:mC.xperiod0,xperiodalignment:mC.xperiodalignment,xhoverformat:QKe("x"),yhoverformat:QKe("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:l9({},N$.width,{}),dash:l9({},tJe,{}),editType:"style"},increasing:eJe(d$t),decreasing:eJe(v$t),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:c$t({},{keys:["open","high","low","close"]}),hovertemplatefallback:f$t(),tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:l9({},h$t.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:mC.zorder}});var U$=ye((Bwr,nJe)=>{"use strict";var p$t=Oa(),g$t=Pr();nJe.exports=function(t,r,n,i){var a=n("x"),o=n("open"),s=n("high"),l=n("low"),u=n("close");n("hoverlabel.split");var c=p$t.getComponentMethod("calendars","handleTraceDefaults");if(c(t,r,["x"],i),!!(o&&s&&l&&u)){var f=Math.min(o.length,s.length,l.length,u.length);return a&&(f=Math.min(f,g$t.minRowLength(a))),r._length=f,f}}});var sJe=ye((Nwr,oJe)=>{"use strict";var m$t=Pr(),y$t=U$(),_$t=Dg(),x$t=u9();oJe.exports=function(t,r,n,i){function a(s,l){return m$t.coerce(t,r,x$t,s,l)}var o=y$t(t,r,a,i);if(!o){r.visible=!1;return}_$t(t,r,i,a,{x:!0}),a("xhoverformat"),a("yhoverformat"),a("line.width"),a("line.dash"),aJe(t,r,a,"increasing"),aJe(t,r,a,"decreasing"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),a("tickwidth"),i._requestRangeslider[r.xaxis]=!0,a("zorder")};function aJe(e,t,r,n){r(n+".line.color"),r(n+".line.width",t.line.width),r(n+".line.dash",t.line.dash)}});var V$=ye((Uwr,uJe)=>{"use strict";var Z5=Pr(),c9=Z5._,f9=ho(),b$t=zg(),yC=fs().BADNUM;function w$t(e,t){var r=f9.getFromId(e,t.xaxis),n=f9.getFromId(e,t.yaxis),i=A$t(e,r,t),a=t._minDiff;t._minDiff=null;var o=t._origX;t._origX=null;var s=t._xcalc;t._xcalc=null;var l=lJe(e,t,o,s,n,T$t);return t._extremes[r._id]=f9.findExtremes(r,s,{vpad:a/2}),l.length?(Z5.extendFlat(l[0].t,{wHover:a/2,tickLen:i}),l):[{t:{empty:!0}}]}function T$t(e,t,r,n){return{o:e,h:t,l:r,c:n}}function lJe(e,t,r,n,i,a){for(var o=i.makeCalcdata(t,"open"),s=i.makeCalcdata(t,"high"),l=i.makeCalcdata(t,"low"),u=i.makeCalcdata(t,"close"),c=Z5.isArrayOrTypedArray(t.text),f=Z5.isArrayOrTypedArray(t.hovertext),h=!0,d=null,v=!!t.xperiodalignment,m=[],b=0;b<n.length;b++){var p=n[b],k=o[b],M=s[b],T=l[b],L=u[b];if(p!==yC&&k!==yC&&M!==yC&&T!==yC&&L!==yC){L===k?d!==null&&L!==d&&(h=L>d):h=L>k,d=L;var x=a(k,M,T,L);x.pos=p,x.yc=(k+L)/2,x.i=b,x.dir=h?"increasing":"decreasing",x.x=x.pos,x.y=[T,M],v&&(x.orig_p=r[b]),c&&(x.tx=t.text[b]),f&&(x.htx=t.hovertext[b]),m.push(x)}else m.push({pos:p,empty:!0})}return t._extremes[i._id]=f9.findExtremes(i,Z5.concat(l,s),{padded:!0}),m.length&&(m[0].t={labels:{open:c9(e,"open:")+" ",high:c9(e,"high:")+" ",low:c9(e,"low:")+" ",close:c9(e,"close:")+" "}}),m}function A$t(e,t,r){var n=r._minDiff;if(!n){var i=e._fullData,a=[];n=1/0;var o;for(o=0;o<i.length;o++){var s=i[o];if(s.type==="ohlc"&&s.visible===!0&&s.xaxis===t._id){a.push(s);var l=t.makeCalcdata(s,"x");s._origX=l;var u=b$t(r,t,"x",l).vals;s._xcalc=u;var c=Z5.distinctVals(u).minDiff;c&&isFinite(c)&&(n=Math.min(n,c))}}for(n===1/0&&(n=1),o=0;o<a.length;o++)a[o]._minDiff=n}return n*r.tickwidth}uJe.exports={calc:w$t,calcCommon:lJe}});var hJe=ye((Vwr,fJe)=>{"use strict";var S$t=qa(),cJe=Pr();fJe.exports=function(t,r,n,i){var a=r.yaxis,o=r.xaxis,s=!!o.rangebreaks;cJe.makeTraceGroups(i,n,"trace ohlc").each(function(l){var u=S$t.select(this),c=l[0],f=c.t,h=c.trace;if(h.visible!==!0||f.empty){u.remove();return}var d=f.tickLen,v=u.selectAll("path").data(cJe.identity);v.enter().append("path"),v.exit().remove(),v.attr("d",function(m){if(m.empty)return"M0,0Z";var b=o.c2p(m.pos-d,!0),p=o.c2p(m.pos+d,!0),k=s?(b+p)/2:o.c2p(m.pos,!0),M=a.c2p(m.o,!0),T=a.c2p(m.h,!0),L=a.c2p(m.l,!0),x=a.c2p(m.c,!0);return"M"+b+","+M+"H"+k+"M"+k+","+T+"V"+L+"M"+p+","+x+"H"+k})})}});var vJe=ye((Gwr,dJe)=>{"use strict";var G$=qa(),M$t=So(),E$t=ka();dJe.exports=function(t,r,n){var i=n||G$.select(t).selectAll("g.ohlclayer").selectAll("g.trace");i.style("opacity",function(a){return a[0].trace.opacity}),i.each(function(a){var o=a[0].trace;G$.select(this).selectAll("path").each(function(s){if(!s.empty){var l=o[s.dir].line;G$.select(this).style("fill","none").call(E$t.stroke,l.color).call(M$t.dashLine,l.dash,l.width).style("opacity",o.selectedpoints&&!s.selected?.3:1)}})})}});var j$=ye((Hwr,_Je)=>{"use strict";var H$=ho(),k$t=Pr(),h9=ef(),C$t=ka(),L$t=Pr().fillText,pJe=QT(),P$t={increasing:pJe.INCREASING.SYMBOL,decreasing:pJe.DECREASING.SYMBOL};function I$t(e,t,r,n){var i=e.cd,a=i[0].trace;return a.hoverlabel.split?mJe(e,t,r,n):yJe(e,t,r,n)}function gJe(e,t,r,n){var i=e.cd,a=e.xa,o=i[0].trace,s=i[0].t,l=o.type,u=l==="ohlc"?"l":"min",c=l==="ohlc"?"h":"max",f,h,d=s.bPos||0,v=function(P){return P.pos+d-t},m=s.bdPos||s.tickLen,b=s.wHover,p=Math.min(1,m/Math.abs(a.r2c(a.range[1])-a.r2c(a.range[0])));f=e.maxHoverDistance-p,h=e.maxSpikeDistance-p;function k(P){var E=v(P);return h9.inbox(E-b,E+b,f)}function M(P){var E=P[u],z=P[c];return E===z||h9.inbox(E-r,z-r,f)}function T(P){return(k(P)+M(P))/2}var L=h9.getDistanceFunction(n,k,M,T);if(h9.getClosest(i,L,e),e.index===!1)return null;var x=i[e.index];if(x.empty)return null;var C=x.dir,S=o[C],g=S.line.color;return C$t.opacity(g)&&S.line.width?e.color=g:e.color=S.fillcolor,e.x0=a.c2p(x.pos+d-m,!0),e.x1=a.c2p(x.pos+d+m,!0),e.xLabelVal=x.orig_p!==void 0?x.orig_p:x.pos,e.spikeDistance=T(x)*h/f,e.xSpike=a.c2p(x.pos,!0),e}function mJe(e,t,r,n){var i=e.cd,a=e.ya,o=i[0].trace,s=i[0].t,l=[],u=gJe(e,t,r,n);if(!u)return[];var c=i[u.index],f=c.hi||o.hoverinfo||"";if(f==="none"||f==="skip")return[];for(var h=["high","open","close","low"],d={},v=0;v<h.length;v++){var m=h[v],b=o[m][u.index],p=a.c2p(b,!0),k;b in d?(k=d[b],k.yLabel+="<br>"+s.labels[m]+H$.hoverLabelText(a,b,o.yhoverformat)):(k=k$t.extendFlat({},u),k.y0=k.y1=p,k.yLabelVal=b,k.yLabel=s.labels[m]+H$.hoverLabelText(a,b,o.yhoverformat),k.name="",l.push(k),d[b]=k)}return l}function yJe(e,t,r,n){var i=e.cd,a=e.ya,o=i[0].trace,s=i[0].t,l=gJe(e,t,r,n);if(!l)return[];var u=l.index,c=i[u],f=l.index=c.i,h=c.dir;function d(T){return s.labels[T]+H$.hoverLabelText(a,o[T][f],o.yhoverformat)}var v=c.hi||o.hoverinfo||"",m=v.split("+"),b=v==="all",p=b||m.indexOf("y")!==-1,k=b||m.indexOf("text")!==-1,M=p?[d("open"),d("high"),d("low"),d("close")+" "+P$t[h]]:[];return k&&L$t(c,o,M),l.extraText=M.join("<br>"),l.y0=l.y1=a.c2p(c.yc,!0),[l]}_Je.exports={hoverPoints:I$t,hoverSplit:mJe,hoverOnPoints:yJe}});var W$=ye((jwr,xJe)=>{"use strict";xJe.exports=function(t,r){var n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s,l=n[0].t.bPos||0;if(r===!1)for(s=0;s<n.length;s++)n[s].selected=0;else for(s=0;s<n.length;s++){var u=n[s];r.contains([i.c2p(u.pos+l),a.c2p(u.yc)],null,u.i,t)?(o.push({pointNumber:u.i,x:i.c2d(u.pos),y:a.c2d(u.yc)}),u.selected=1):u.selected=0}return o}});var wJe=ye((Wwr,bJe)=>{"use strict";bJe.exports={moduleType:"trace",name:"ohlc",basePlotModule:mh(),categories:["cartesian","svg","showLegend"],meta:{},attributes:u9(),supplyDefaults:sJe(),calc:V$().calc,plot:hJe(),style:vJe(),hoverPoints:j$().hoverPoints,selectPoints:W$()}});var AJe=ye((Xwr,TJe)=>{"use strict";TJe.exports=wJe()});var Z$=ye((Zwr,EJe)=>{"use strict";var X$=Pr().extendFlat,SJe=vf().axisHoverFormat,vp=u9(),Y5=C4();function MJe(e){return{line:{color:X$({},Y5.line.color,{dflt:e}),width:Y5.line.width,editType:"style"},fillcolor:Y5.fillcolor,editType:"style"}}EJe.exports={xperiod:vp.xperiod,xperiod0:vp.xperiod0,xperiodalignment:vp.xperiodalignment,xhoverformat:SJe("x"),yhoverformat:SJe("y"),x:vp.x,open:vp.open,high:vp.high,low:vp.low,close:vp.close,line:{width:X$({},Y5.line.width,{}),editType:"style"},increasing:MJe(vp.increasing.line.color.dflt),decreasing:MJe(vp.decreasing.line.color.dflt),text:vp.text,hovertext:vp.hovertext,hovertemplate:vp.hovertemplate,hovertemplatefallback:vp.hovertemplatefallback,whiskerwidth:X$({},Y5.whiskerwidth,{dflt:0}),hoverlabel:vp.hoverlabel,zorder:Y5.zorder}});var LJe=ye((Ywr,CJe)=>{"use strict";var R$t=Pr(),D$t=ka(),F$t=U$(),z$t=Dg(),q$t=Z$();CJe.exports=function(t,r,n,i){function a(s,l){return R$t.coerce(t,r,q$t,s,l)}var o=F$t(t,r,a,i);if(!o){r.visible=!1;return}z$t(t,r,i,a,{x:!0}),a("xhoverformat"),a("yhoverformat"),a("line.width"),kJe(t,r,a,"increasing"),kJe(t,r,a,"decreasing"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),a("whiskerwidth"),i._requestRangeslider[r.xaxis]=!0,a("zorder")};function kJe(e,t,r,n){var i=r(n+".line.color");r(n+".line.width",t.line.width),r(n+".fillcolor",D$t.addOpacity(i,.5))}});var DJe=ye((Kwr,RJe)=>{"use strict";var PJe=Pr(),IJe=ho(),O$t=zg(),B$t=V$().calcCommon;RJe.exports=function(e,t){var r=e._fullLayout,n=IJe.getFromId(e,t.xaxis),i=IJe.getFromId(e,t.yaxis),a=n.makeCalcdata(t,"x"),o=O$t(t,n,"x",a).vals,s=B$t(e,t,a,o,i,N$t);return s.length?(PJe.extendFlat(s[0].t,{num:r._numBoxes,dPos:PJe.distinctVals(o).minDiff/2,posLetter:"x",valLetter:"y"}),r._numBoxes++,s):[{t:{empty:!0}}]};function N$t(e,t,r,n){return{min:r,q1:Math.min(e,n),med:n,q3:Math.max(e,n),max:t}}});var zJe=ye((Jwr,FJe)=>{"use strict";FJe.exports={moduleType:"trace",name:"candlestick",basePlotModule:mh(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:Z$(),layoutAttributes:L4(),supplyLayoutDefaults:QI().supplyLayoutDefaults,crossTraceCalc:t8().crossTraceCalc,supplyDefaults:LJe(),calc:DJe(),plot:r8().plot,layerName:"boxlayer",style:i8().style,hoverPoints:j$().hoverPoints,selectPoints:W$()}});var OJe=ye(($wr,qJe)=>{"use strict";qJe.exports=zJe()});var K$=ye((Qwr,BJe)=>{"use strict";var v9=Pr(),U$t=xm(),d9=v9.deg2rad,Y$=v9.rad2deg;BJe.exports=function(t,r,n){switch(U$t(t,n),t._id){case"x":case"radialaxis":V$t(t,r);break;case"angularaxis":j$t(t,r);break}};function V$t(e,t){var r=t._subplot;e.setGeometry=function(){var n=e._rl[0],i=e._rl[1],a=r.innerRadius,o=(r.radius-a)/(i-n),s=a/o,l=n>i?function(u){return u<=0}:function(u){return u>=0};e.c2g=function(u){var c=e.c2l(u)-n;return(l(c)?c:0)+s},e.g2c=function(u){return e.l2c(u+n-s)},e.g2p=function(u){return u*o},e.c2p=function(u){return e.g2p(e.c2g(u))}}}function G$t(e,t){return t==="degrees"?d9(e):e}function H$t(e,t){return t==="degrees"?Y$(e):e}function j$t(e,t){var r=e.type;if(r==="linear"){var n=e.d2c,i=e.c2d;e.d2c=function(a,o){return G$t(n(a),o)},e.c2d=function(a,o){return i(H$t(a,o))}}e.makeCalcdata=function(a,o){var s=a[o],l=a._length,u,c,f=function(b){return e.d2c(b,a.thetaunit)};if(s)for(u=new Array(l),c=0;c<l;c++)u[c]=f(s[c]);else{var h=o+"0",d="d"+o,v=h in a?f(a[h]):0,m=a[d]?f(a[d]):(e.period||2*Math.PI)/l;for(u=new Array(l),c=0;c<l;c++)u[c]=v+c*m}return u},e.setGeometry=function(){var a=t.sector,o=a.map(d9),s={clockwise:-1,counterclockwise:1}[e.direction],l=d9(e.rotation),u=function(p){return s*p+l},c=function(p){return(p-l)/s},f,h,d,v;switch(r){case"linear":h=f=v9.identity,v=d9,d=Y$,e.range=v9.isFullCircle(o)?[a[0],a[0]+360]:o.map(c).map(Y$);break;case"category":var m=e._categories.length,b=e.period?Math.max(e.period,m):m;b===0&&(b=1),h=v=function(p){return p*2*Math.PI/b},f=d=function(p){return p*b/Math.PI/2},e.range=[0,b];break}e.c2g=function(p){return u(h(p))},e.g2c=function(p){return f(c(p))},e.t2g=function(p){return u(v(p))},e.g2t=function(p){return d(c(p))}}}});var p9=ye((e3r,NJe)=>{"use strict";NJe.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-line","radial-line","angular-axis","radial-axis"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}});var m9=ye((t3r,jJe)=>{"use strict";var Mw=Pr(),UJe=zM().tester,J$=Mw.findIndexOfMin,GJe=Mw.isAngleInsideSector,W$t=Mw.angleDelta,VJe=Mw.angleDist;function X$t(e,t,r,n,i){if(!GJe(t,n))return!1;var a,o;r[0]<r[1]?(a=r[0],o=r[1]):(a=r[1],o=r[0]);var s=UJe(K5(a,n[0],n[1],i)),l=UJe(K5(o,n[0],n[1],i)),u=[e*Math.cos(t),e*Math.sin(t)];return l.contains(u)&&!s.contains(u)}function HJe(e,t,r,n){var i,a,o=n[0],s=n[1],l=g9(Math.sin(t)-Math.sin(e)),u=g9(Math.cos(t)-Math.cos(e)),c=Math.tan(r),f=g9(1/c),h=l/u,d=s-h*o;return f?l&&u?(i=d/(c-h),a=c*i):u?(i=s*f,a=s):(i=o,a=o*c):l&&u?(i=0,a=d):u?(i=0,a=s):i=a=NaN,[i,a]}function Z$t(e,t,r,n){var i=-t*r,a=t*t+1,o=2*(t*i-r),s=i*i+r*r-e*e,l=Math.sqrt(o*o-4*a*s),u=(-o+l)/(2*a),c=(-o-l)/(2*a);return[[u,t*u+i+n],[c,t*c+i+n]]}function Y$t(e,t){var r=t.length,n=new Array(r+1),i;for(i=0;i<r;i++){var a=t[i];n[i]=[e*Math.cos(a),e*Math.sin(a)]}return n[i]=n[0].slice(),n}function K$t(e,t,r,n){var i=n.length,a=[],o,s;function l(p){return[e*Math.cos(p),e*Math.sin(p)]}function u(p,k,M){return HJe(p,k,M,l(p))}function c(p){return Mw.mod(p,i)}function f(p){return GJe(p,[t,r])}var h=J$(n,function(p){return f(p)?VJe(p,t):1/0}),d=u(n[h],n[c(h-1)],t);for(a.push(d),o=h,s=0;s<i;o++,s++){var v=n[c(o)];if(!f(v))break;a.push(l(v))}var m=J$(n,function(p){return f(p)?VJe(p,r):1/0}),b=u(n[m],n[c(m+1)],r);return a.push(b),a.push([0,0]),a.push(a[0].slice()),a}function K5(e,t,r,n){return Mw.isFullCircle([t,r])?Y$t(e,n):K$t(e,t,r,n)}function J$t(e,t,r,n){for(var i=1/0,a=1/0,o=K5(e,t,r,n),s=0;s<o.length;s++){var l=o[s];i=Math.min(i,l[0]),a=Math.min(a,-l[1])}return[i,a]}function $$t(e,t){var r=function(a){var o=W$t(a,e);return o>0?o:1/0},n=J$(t,r),i=Mw.mod(n+1,t.length);return[t[n],t[i]]}function g9(e){return Math.abs(e)>1e-10?e:0}function $$(e,t,r){t=t||0,r=r||0;for(var n=e.length,i=new Array(n),a=0;a<n;a++){var o=e[a];i[a]=[t+o[0],r-o[1]]}return i}function Q$t(e,t,r,n,i,a){var o=K5(e,t,r,n);return"M"+$$(o,i,a).join("L")}function eQt(e,t,r,n,i,a,o){var s,l;e<t?(s=e,l=t):(s=t,l=e);var u=$$(K5(s,r,n,i),a,o),c=$$(K5(l,r,n,i),a,o);return"M"+c.reverse().join("L")+"M"+u.join("L")}jJe.exports={isPtInsidePolygon:X$t,findPolygonOffset:J$t,findEnclosingVertexAngles:$$t,findIntersectionXY:HJe,findXYatLength:Z$t,clampTiny:g9,pathPolygon:Q$t,pathPolygonAnnulus:eQt}});var Q$=ye((r3r,ZJe)=>{"use strict";function WJe(e){return e<0?-1:e>0?1:0}function J5(e){var t=e[0],r=e[1];if(!isFinite(t)||!isFinite(r))return[1,0];var n=(t+1)*(t+1)+r*r;return[(t*t+r*r-1)/n,2*r/n]}function $5(e,t){var r=t[0],n=t[1];return[r*e.radius+e.cx,-n*e.radius+e.cy]}function XJe(e,t){return t*e.radius}function tQt(e,t,r,n){var i=$5(e,J5([r,t])),a=i[0],o=i[1],s=$5(e,J5([n,t])),l=s[0],u=s[1];if(t===0)return["M"+a+","+o,"L"+l+","+u].join(" ");var c=XJe(e,1/Math.abs(t));return["M"+a+","+o,"A"+c+","+c+" 0 0,"+(t<0?1:0)+" "+l+","+u].join(" ")}function rQt(e,t,r,n){var i=XJe(e,1/(t+1)),a=$5(e,J5([t,r])),o=a[0],s=a[1],l=$5(e,J5([t,n])),u=l[0],c=l[1];if(WJe(r)!==WJe(n)){var f=$5(e,J5([t,0])),h=f[0],d=f[1];return["M"+o+","+s,"A"+i+","+i+" 0 0,"+(0<r?0:1)+" "+h+","+d,"A"+i+","+i+" 0 0,"+(n<0?0:1)+u+","+c].join(" ")}return["M"+o+","+s,"A"+i+","+i+" 0 0,"+(n<r?0:1)+" "+u+","+c].join(" ")}ZJe.exports={smith:J5,reactanceArc:tQt,resistanceArc:rQt,smithTransform:$5}});var rQ=ye((i3r,i$e)=>{"use strict";var Ew=qa(),iQt=fd(),Cw=Oa(),Xc=Pr(),cy=Xc.strRotate,xd=Xc.strTranslate,eQ=ka(),_C=So(),nQt=Mc(),pp=ho(),aQt=xm(),oQt=K$(),sQt=Mg().doAutoRange,S1=XN(),x9=yv(),YJe=ef(),lQt=qb(),uQt=qf().prepSelect,cQt=qf().selectOnClick,tQ=qf().clearOutline,KJe=Eg(),JJe=wM(),$Je=LM().redrawReglTraces,fQt=Dh().MID_SHIFT,Nx=p9(),M1=m9(),b9=Q$(),y9=b9.smith,hQt=b9.reactanceArc,dQt=b9.resistanceArc,_9=b9.smithTransform,vQt=Xc._,QJe=Xc.mod,Ux=Xc.deg2rad,kw=Xc.rad2deg;function e$e(e,t,r){this.isSmith=r||!1,this.id=t,this.gd=e,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var n=e._fullLayout,i="clip"+n._uid+t;this.clipIds.forTraces=i+"-for-traces",this.clipPaths.forTraces=n._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=n["_"+(r?"smith":"polar")+"layer"].append("g").attr("class",t),this.getHole=function(a){return this.isSmith?0:a.hole},this.getSector=function(a){return this.isSmith?[0,360]:a.sector},this.getRadial=function(a){return this.isSmith?a.realaxis:a.radialaxis},this.getAngular=function(a){return this.isSmith?a.imaginaryaxis:a.angularaxis},r||(this.radialTickLayout=null,this.angularTickLayout=null)}var Nd=e$e.prototype;i$e.exports=function(t,r,n){return new e$e(t,r,n)};Nd.plot=function(e,t){for(var r=this,n=t[r.id],i=!1,a=0;a<e.length;a++){var o=e[a][0].trace;if(o.cliponaxis===!1){i=!0;break}}r._hasClipOnAxisFalse=i,r.updateLayers(t,n),r.updateLayout(t,n),nQt.generalUpdatePerTraceModule(r.gd,r,e,n),r.updateFx(t,n),r.isSmith&&(delete n.realaxis.range,delete n.imaginaryaxis.range)};Nd.updateLayers=function(e,t){var r=this,n=r.isSmith,i=r.layers,a=r.getRadial(t),o=r.getAngular(t),s=Nx.layerNames,l=s.indexOf("frontplot"),u=s.slice(0,l),c=o.layer==="below traces",f=a.layer==="below traces";c&&u.push("angular-line"),f&&u.push("radial-line"),c&&u.push("angular-axis"),f&&u.push("radial-axis"),u.push("frontplot"),c||u.push("angular-line"),f||u.push("radial-line"),c||u.push("angular-axis"),f||u.push("radial-axis");var h=(n?"smith":"polar")+"sublayer",d=r.framework.selectAll("."+h).data(u,String);d.enter().append("g").attr("class",function(v){return h+" "+v}).each(function(v){var m=i[v]=Ew.select(this);switch(v){case"frontplot":n||m.append("g").classed("barlayer",!0),m.append("g").classed("scatterlayer",!0);break;case"backplot":m.append("g").classed("maplayer",!0);break;case"plotbg":i.bg=m.append("path");break;case"radial-grid":m.style("fill","none");break;case"angular-grid":m.style("fill","none");break;case"radial-line":m.append("line").style("fill","none");break;case"angular-line":m.append("path").style("fill","none");break}}),d.order()};Nd.updateLayout=function(e,t){var r=this,n=r.layers,i=e._size,a=r.getRadial(t),o=r.getAngular(t),s=t.domain.x,l=t.domain.y;r.xOffset=i.l+i.w*s[0],r.yOffset=i.t+i.h*(1-l[1]);var u=r.xLength=i.w*(s[1]-s[0]),c=r.yLength=i.h*(l[1]-l[0]),f=r.getSector(t);r.sectorInRad=f.map(Ux);var h=r.sectorBBox=pQt(f),d=h[2]-h[0],v=h[3]-h[1],m=c/u,b=Math.abs(v/d),p,k,M,T,L;m>b?(p=u,k=u*b,L=(c-k)/i.h/2,M=[s[0],s[1]],T=[l[0]+L,l[1]-L]):(p=c/b,k=c,L=(u-p)/i.w/2,M=[s[0]+L,s[1]-L],T=[l[0],l[1]]),r.xLength2=p,r.yLength2=k,r.xDomain2=M,r.yDomain2=T;var x=r.xOffset2=i.l+i.w*M[0],C=r.yOffset2=i.t+i.h*(1-T[1]),S=r.radius=p/d,g=r.innerRadius=r.getHole(t)*S,P=r.cx=x-S*h[0],E=r.cy=C+S*h[3],z=r.cxx=P-x,q=r.cyy=E-C,V=a.side,G;V==="counterclockwise"?(G=V,V="top"):V==="clockwise"&&(G=V,V="bottom"),r.radialAxis=r.mockAxis(e,t,a,{_id:"x",side:V,_trueSide:G,domain:[g/i.w,S/i.w]}),r.angularAxis=r.mockAxis(e,t,o,{side:"right",domain:[0,Math.PI],autorange:!1}),r.doAutoRange(e,t),r.updateAngularAxis(e,t),r.updateRadialAxis(e,t),r.updateRadialAxisTitle(e,t),r.xaxis=r.mockCartesianAxis(e,t,{_id:"x",domain:M}),r.yaxis=r.mockCartesianAxis(e,t,{_id:"y",domain:T});var Z=r.pathSubplot();r.clipPaths.forTraces.select("path").attr("d",Z).attr("transform",xd(z,q)),n.frontplot.attr("transform",xd(x,C)).call(_C.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces,r.gd),n.bg.attr("d",Z).attr("transform",xd(P,E)).call(eQ.fill,t.bgcolor)};Nd.mockAxis=function(e,t,r,n){var i=Xc.extendFlat({},r,n);return oQt(i,t,e),i};Nd.mockCartesianAxis=function(e,t,r){var n=this,i=n.isSmith,a=r._id,o=Xc.extendFlat({type:"linear"},r);aQt(o,e);var s={x:[0,2],y:[1,3]};return o.setRange=function(){var l=n.sectorBBox,u=s[a],c=n.radialAxis._rl,f=(c[1]-c[0])/(1-n.getHole(t));o.range=[l[u[0]]*f,l[u[1]]*f]},o.isPtWithinRange=a==="x"&&!i?function(l){return n.isPtInside(l)}:function(){return!0},o.setRange(),o.setScale(),o};Nd.doAutoRange=function(e,t){var r=this,n=r.gd,i=r.radialAxis,a=r.getRadial(t);sQt(n,i);var o=i.range;if(a.range=o.slice(),a._input.range=o.slice(),i._rl=[i.r2l(o[0],null,"gregorian"),i.r2l(o[1],null,"gregorian")],i.minallowed!==void 0){var s=i.r2l(i.minallowed);i._rl[0]>i._rl[1]?i._rl[1]=Math.max(i._rl[1],s):i._rl[0]=Math.max(i._rl[0],s)}if(i.maxallowed!==void 0){var l=i.r2l(i.maxallowed);i._rl[0]<i._rl[1]?i._rl[1]=Math.min(i._rl[1],l):i._rl[0]=Math.min(i._rl[0],l)}};Nd.updateRadialAxis=function(e,t){var r=this,n=r.gd,i=r.layers,a=r.radius,o=r.innerRadius,s=r.cx,l=r.cy,u=r.getRadial(t),c=QJe(r.getSector(t)[0],360),f=r.radialAxis,h=o<a,d=r.isSmith;d||(r.fillViewInitialKey("radialaxis.angle",u.angle),r.fillViewInitialKey("radialaxis.range",f.range.slice()),f.setGeometry()),f.tickangle==="auto"&&c>90&&c<=270&&(f.tickangle=180);var v=d?function(S){var g=_9(r,y9([S.x,0]));return xd(g[0]-s,g[1]-l)}:function(S){return xd(f.l2p(S.x)+o,0)},m=d?function(S){return dQt(r,S.x,-1/0,1/0)}:function(S){return r.pathArc(f.r2p(S.x)+o)},b=t$e(u);if(r.radialTickLayout!==b&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=b),h){f.setScale();var p=0,k=d?(f.tickvals||[]).filter(function(S){return S>=0}).map(function(S){return pp.tickText(f,S,!0,!1)}):pp.calcTicks(f),M=d?k:pp.clipEnds(f,k),T=pp.getTickSigns(f)[2];d&&((f.ticks==="top"&&f.side==="bottom"||f.ticks==="bottom"&&f.side==="top")&&(T=-T),f.ticks==="top"&&f.side==="top"&&(p=-f.ticklen),f.ticks==="bottom"&&f.side==="bottom"&&(p=f.ticklen)),pp.drawTicks(n,f,{vals:k,layer:i["radial-axis"],path:pp.makeTickPath(f,0,T),transFn:v,crisp:!1}),pp.drawGrid(n,f,{vals:M,layer:i["radial-grid"],path:m,transFn:Xc.noop,crisp:!1}),pp.drawLabels(n,f,{vals:k,layer:i["radial-axis"],transFn:v,labelFns:pp.makeLabelFns(f,p)})}var L=r.radialAxisAngle=r.vangles?kw(r$e(Ux(u.angle),r.vangles)):u.angle,x=xd(s,l),C=x+cy(-L);xC(i["radial-axis"],h&&(u.showticklabels||u.ticks),{transform:C}),xC(i["radial-grid"],h&&u.showgrid,{transform:d?"":x}),xC(i["radial-line"].select("line"),h&&u.showline,{x1:d?-a:o,y1:0,x2:a,y2:0,transform:C}).attr("stroke-width",u.linewidth).call(eQ.stroke,u.linecolor)};Nd.updateRadialAxisTitle=function(e,t,r){if(!this.isSmith){var n=this,i=n.gd,a=n.radius,o=n.cx,s=n.cy,l=n.getRadial(t),u=n.id+"title",c=0;if(l.title){var f=_C.bBox(n.layers["radial-axis"].node()).height,h=l.title.font.size,d=l.side;c=d==="top"?h:d==="counterclockwise"?-(f+h*.4):f+h*.8}var v=r!==void 0?r:n.radialAxisAngle,m=Ux(v),b=Math.cos(m),p=Math.sin(m),k=o+a/2*b+c*p,M=s-a/2*p+c*b;n.layers["radial-axis-title"]=lQt.draw(i,u,{propContainer:l,propName:n.id+".radialaxis.title.text",placeholder:vQt(i,"Click to enter radial axis title"),attributes:{x:k,y:M,"text-anchor":"middle"},transform:{rotate:-v}})}};Nd.updateAngularAxis=function(e,t){var r=this,n=r.gd,i=r.layers,a=r.radius,o=r.innerRadius,s=r.cx,l=r.cy,u=r.getAngular(t),c=r.angularAxis,f=r.isSmith;f||(r.fillViewInitialKey("angularaxis.rotation",u.rotation),c.setGeometry(),c.setScale());var h=f?function(g){var P=_9(r,y9([0,g.x]));return Math.atan2(P[0]-s,P[1]-l)-Math.PI/2}:function(g){return c.t2g(g.x)};c.type==="linear"&&c.thetaunit==="radians"&&(c.tick0=kw(c.tick0),c.dtick=kw(c.dtick));var d=function(g){return xd(s+a*Math.cos(g),l-a*Math.sin(g))},v=f?function(g){var P=_9(r,y9([0,g.x]));return xd(P[0],P[1])}:function(g){return d(h(g))},m=f?function(g){var P=_9(r,y9([0,g.x])),E=Math.atan2(P[0]-s,P[1]-l)-Math.PI/2;return xd(P[0],P[1])+cy(-kw(E))}:function(g){var P=h(g);return d(P)+cy(-kw(P))},b=f?function(g){return hQt(r,g.x,0,1/0)}:function(g){var P=h(g),E=Math.cos(P),z=Math.sin(P);return"M"+[s+o*E,l-o*z]+"L"+[s+a*E,l-a*z]},p=pp.makeLabelFns(c,0),k=p.labelStandoff,M={};M.xFn=function(g){var P=h(g);return Math.cos(P)*k},M.yFn=function(g){var P=h(g),E=Math.sin(P)>0?.2:1;return-Math.sin(P)*(k+g.fontSize*E)+Math.abs(Math.cos(P))*(g.fontSize*fQt)},M.anchorFn=function(g){var P=h(g),E=Math.cos(P);return Math.abs(E)<.1?"middle":E>0?"start":"end"},M.heightFn=function(g,P,E){var z=h(g);return-.5*(1+Math.sin(z))*E};var T=t$e(u);r.angularTickLayout!==T&&(i["angular-axis"].selectAll("."+c._id+"tick").remove(),r.angularTickLayout=T);var L=f?[1/0].concat(c.tickvals||[]).map(function(g){return pp.tickText(c,g,!0,!1)}):pp.calcTicks(c);f&&(L[0].text="\u221E",L[0].fontSize*=1.75);var x;if(t.gridshape==="linear"?(x=L.map(h),Xc.angleDelta(x[0],x[1])<0&&(x=x.slice().reverse())):x=null,r.vangles=x,c.type==="category"&&(L=L.filter(function(g){return Xc.isAngleInsideSector(h(g),r.sectorInRad)})),c.visible){var C=c.ticks==="inside"?-1:1,S=(c.linewidth||1)/2;pp.drawTicks(n,c,{vals:L,layer:i["angular-axis"],path:"M"+C*S+",0h"+C*c.ticklen,transFn:m,crisp:!1}),pp.drawGrid(n,c,{vals:L,layer:i["angular-grid"],path:b,transFn:Xc.noop,crisp:!1}),pp.drawLabels(n,c,{vals:L,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:v,labelFns:M})}xC(i["angular-line"].select("path"),u.showline,{d:r.pathSubplot(),transform:xd(s,l)}).attr("stroke-width",u.linewidth).call(eQ.stroke,u.linecolor)};Nd.updateFx=function(e,t){if(!this.gd._context.staticPlot){var r=!this.isSmith;r&&(this.updateAngularDrag(e),this.updateRadialDrag(e,t,0),this.updateRadialDrag(e,t,1)),this.updateHoverAndMainDrag(e)}};Nd.updateHoverAndMainDrag=function(e){var t=this,r=t.isSmith,n=t.gd,i=t.layers,a=e._zoomlayer,o=Nx.MINZOOM,s=Nx.OFFEDGE,l=t.radius,u=t.innerRadius,c=t.cx,f=t.cy,h=t.cxx,d=t.cyy,v=t.sectorInRad,m=t.vangles,b=t.radialAxis,p=M1.clampTiny,k=M1.findXYatLength,M=M1.findEnclosingVertexAngles,T=Nx.cornerHalfWidth,L=Nx.cornerLen/2,x,C,S=S1.makeDragger(i,"path","maindrag",e.dragmode===!1?"none":"crosshair");Ew.select(S).attr("d",t.pathSubplot()).attr("transform",xd(c,f)),S.onmousemove=function(ce){YJe.hover(n,ce,t.id),n._fullLayout._lasthover=S,n._fullLayout._hoversubplot=t.id},S.onmouseout=function(ce){n._dragging||x9.unhover(n,ce)};var g={element:S,gd:n,subplot:t.id,plotinfo:{id:t.id,xaxis:t.xaxis,yaxis:t.yaxis},xaxes:[t.xaxis],yaxes:[t.yaxis]},P,E,z,q,V,G,Z,j,N;function H(ce,He){return Math.sqrt(ce*ce+He*He)}function ie(ce,He){return H(ce-h,He-d)}function ae(ce,He){return Math.atan2(d-He,ce-h)}function _e(ce,He){return[ce*Math.cos(He),ce*Math.sin(-He)]}function Ee(ce,He){if(ce===0)return t.pathSector(2*T);var lt=L/ce,mt=He-lt,Ht=He+lt,at=Math.max(0,Math.min(ce,l)),ct=at-T,ar=at+T;return"M"+_e(ct,mt)+"A"+[ct,ct]+" 0,0,0 "+_e(ct,Ht)+"L"+_e(ar,Ht)+"A"+[ar,ar]+" 0,0,1 "+_e(ar,mt)+"Z"}function Ce(ce,He,lt){if(ce===0)return t.pathSector(2*T);var mt=_e(ce,He),Ht=_e(ce,lt),at=p((mt[0]+Ht[0])/2),ct=p((mt[1]+Ht[1])/2),ar,Vt;if(at&&ct){var rr=ct/at,tt=-1/rr,je=k(T,rr,at,ct);ar=k(L,tt,je[0][0],je[0][1]),Vt=k(L,tt,je[1][0],je[1][1])}else{var Ue,Ae;ct?(Ue=L,Ae=T):(Ue=T,Ae=L),ar=[[at-Ue,ct-Ae],[at+Ue,ct-Ae]],Vt=[[at-Ue,ct+Ae],[at+Ue,ct+Ae]]}return"M"+ar.join("L")+"L"+Vt.reverse().join("L")+"Z"}function ge(){z=null,q=null,V=t.pathSubplot(),G=!1;var ce=n._fullLayout[t.id];Z=iQt(ce.bgcolor).getLuminance(),j=S1.makeZoombox(a,Z,c,f,V),j.attr("fill-rule","evenodd"),N=S1.makeCorners(a,c,f),tQ(n)}function re(ce,He){return He=Math.max(Math.min(He,l),u),ce<s?ce=0:l-ce<s?ce=l:He<s?He=0:l-He<s&&(He=l),Math.abs(He-ce)>o?(ce<He?(z=ce,q=He):(z=He,q=ce),!0):(z=null,q=null,!1)}function Se(ce,He){ce=ce||V,He=He||"M0,0Z",j.attr("d",ce),N.attr("d",He),S1.transitionZoombox(j,N,G,Z),G=!0;var lt={};me(lt),n.emit("plotly_relayouting",lt)}function ke(ce,He){ce=ce*x,He=He*C;var lt=P+ce,mt=E+He,Ht=ie(P,E),at=Math.min(ie(lt,mt),l),ct=ae(P,E),ar,Vt;re(Ht,at)&&(ar=V+t.pathSector(q),z&&(ar+=t.pathSector(z)),Vt=Ee(z,ct)+Ee(q,ct)),Se(ar,Vt)}function be(ce,He,lt,mt){var Ht=M1.findIntersectionXY(lt,mt,lt,[ce-h,d-He]);return H(Ht[0],Ht[1])}function Be(ce,He){var lt=P+ce,mt=E+He,Ht=ae(P,E),at=ae(lt,mt),ct=M(Ht,m),ar=M(at,m),Vt=be(P,E,ct[0],ct[1]),rr=Math.min(be(lt,mt,ar[0],ar[1]),l),tt,je;re(Vt,rr)&&(tt=V+t.pathSector(q),z&&(tt+=t.pathSector(z)),je=[Ce(z,ct[0],ct[1]),Ce(q,ct[0],ct[1])].join(" ")),Se(tt,je)}function Le(){if(S1.removeZoombox(n),!(z===null||q===null)){var ce={};me(ce),S1.showDoubleClickNotifier(n),Cw.call("_guiRelayout",n,ce)}}function me(ce){var He=b._rl,lt=(He[1]-He[0])/(1-u/l)/l,mt=[He[0]+(z-u)*lt,He[0]+(q-u)*lt];ce[t.id+".radialaxis.range"]=mt}function Pe(ce,He){var lt=n._fullLayout.clickmode;if(S1.removeZoombox(n),ce===2){var mt={};for(var Ht in t.viewInitial)mt[t.id+"."+Ht]=t.viewInitial[Ht];n.emit("plotly_doubleclick",null),Cw.call("_guiRelayout",n,mt)}lt.indexOf("select")>-1&&ce===1&&cQt(He,n,[t.xaxis],[t.yaxis],t.id,g),lt.indexOf("event")>-1&&YJe.click(n,He,t.id)}g.prepFn=function(ce,He,lt){var mt=n._fullLayout.dragmode,Ht=S.getBoundingClientRect();n._fullLayout._calcInverseTransform(n);var at=n._fullLayout._invTransform;x=n._fullLayout._invScaleX,C=n._fullLayout._invScaleY;var ct=Xc.apply3DTransform(at)(He-Ht.left,lt-Ht.top);if(P=ct[0],E=ct[1],m){var ar=M1.findPolygonOffset(l,v[0],v[1],m);P+=h+ar[0],E+=d+ar[1]}switch(mt){case"zoom":g.clickFn=Pe,r||(m?g.moveFn=Be:g.moveFn=ke,g.doneFn=Le,ge(ce,He,lt));break;case"select":case"lasso":uQt(ce,He,lt,g,mt);break}},x9.init(g)};Nd.updateRadialDrag=function(e,t,r){var n=this,i=n.gd,a=n.layers,o=n.radius,s=n.innerRadius,l=n.cx,u=n.cy,c=n.radialAxis,f=Nx.radialDragBoxSize,h=f/2;if(!c.visible)return;var d=Ux(n.radialAxisAngle),v=c._rl,m=v[0],b=v[1],p=v[r],k=.75*(v[1]-v[0])/(1-n.getHole(t))/o,M,T,L;r?(M=l+(o+h)*Math.cos(d),T=u-(o+h)*Math.sin(d),L="radialdrag"):(M=l+(s-h)*Math.cos(d),T=u-(s-h)*Math.sin(d),L="radialdrag-inner");var x=S1.makeRectDragger(a,L,"crosshair",-h,-h,f,f),C={element:x,gd:i};e.dragmode===!1&&(C.dragmode=!1),xC(Ew.select(x),c.visible&&s<o,{transform:xd(M,T)});var S,g,P;function E(Z,j){if(S)S(Z,j);else{var N=[Z,-j],H=[Math.cos(d),Math.sin(d)],ie=Math.abs(Xc.dot(N,H)/Math.sqrt(Xc.dot(N,N)));isNaN(ie)||(S=ie<.5?V:G)}var ae={};z(ae),i.emit("plotly_relayouting",ae)}function z(Z){g!==null?Z[n.id+".radialaxis.angle"]=g:P!==null&&(Z[n.id+".radialaxis.range["+r+"]"]=P)}function q(){g!==null?Cw.call("_guiRelayout",i,n.id+".radialaxis.angle",g):P!==null&&Cw.call("_guiRelayout",i,n.id+".radialaxis.range["+r+"]",P)}function V(Z,j){if(r!==0){var N=M+Z,H=T+j;g=Math.atan2(u-H,N-l),n.vangles&&(g=r$e(g,n.vangles)),g=kw(g);var ie=xd(l,u)+cy(-g);a["radial-axis"].attr("transform",ie),a["radial-line"].select("line").attr("transform",ie);var ae=n.gd._fullLayout,_e=ae[n.id];n.updateRadialAxisTitle(ae,_e,g)}}function G(Z,j){var N=Xc.dot([Z,-j],[Math.cos(d),Math.sin(d)]);if(P=p-k*N,k>0!=(r?P>m:P<b)){P=null;return}var H=i._fullLayout,ie=H[n.id];c.range[r]=P,c._rl[r]=P,n.updateRadialAxis(H,ie),n.xaxis.setRange(),n.xaxis.setScale(),n.yaxis.setRange(),n.yaxis.setScale();var ae=!1;for(var _e in n.traceHash){var Ee=n.traceHash[_e],Ce=Xc.filterVisible(Ee),ge=Ee[0][0].trace._module;ge.plot(i,n,Ce,ie),Cw.traceIs(_e,"gl")&&Ce.length&&(ae=!0)}ae&&(JJe(i),$Je(i))}C.prepFn=function(){S=null,g=null,P=null,C.moveFn=E,C.doneFn=q,tQ(i)},C.clampFn=function(Z,j){return Math.sqrt(Z*Z+j*j)<Nx.MINDRAG&&(Z=0,j=0),[Z,j]},x9.init(C)};Nd.updateAngularDrag=function(e){var t=this,r=t.gd,n=t.layers,i=t.radius,a=t.angularAxis,o=t.cx,s=t.cy,l=t.cxx,u=t.cyy,c=Nx.angularDragBoxSize,f=S1.makeDragger(n,"path","angulardrag",e.dragmode===!1?"none":"move"),h={element:f,gd:r};e.dragmode===!1?h.dragmode=!1:Ew.select(f).attr("d",t.pathAnnulus(i,i+c)).attr("transform",xd(o,s)).call(KJe,"move");function d(P,E){return Math.atan2(u+c-E,P-l-c)}var v=n.frontplot.select(".scatterlayer").selectAll(".trace"),m=v.selectAll(".point"),b=v.selectAll(".textpoint"),p,k,M,T,L,x;function C(P,E){var z=t.gd._fullLayout,q=z[t.id],V=p+P*e._invScaleX,G=k+E*e._invScaleY,Z=d(V,G),j=kw(Z-x);if(T=M+j,n.frontplot.attr("transform",xd(t.xOffset2,t.yOffset2)+cy([-j,l,u])),t.vangles){L=t.radialAxisAngle+j;var N=xd(o,s)+cy(-j),H=xd(o,s)+cy(-L);n.bg.attr("transform",N),n["radial-grid"].attr("transform",N),n["radial-axis"].attr("transform",H),n["radial-line"].select("line").attr("transform",H),t.updateRadialAxisTitle(z,q,L)}else t.clipPaths.forTraces.select("path").attr("transform",xd(l,u)+cy(j));m.each(function(){var re=Ew.select(this),Se=_C.getTranslate(re);re.attr("transform",xd(Se.x,Se.y)+cy([j]))}),b.each(function(){var re=Ew.select(this),Se=re.select("text"),ke=_C.getTranslate(re);re.attr("transform",cy([j,Se.attr("x"),Se.attr("y")])+xd(ke.x,ke.y))}),a.rotation=Xc.modHalf(T,360),t.updateAngularAxis(z,q),t._hasClipOnAxisFalse&&!Xc.isFullCircle(t.sectorInRad)&&v.call(_C.hideOutsideRangePoints,t);var ie=!1;for(var ae in t.traceHash)if(Cw.traceIs(ae,"gl")){var _e=t.traceHash[ae],Ee=Xc.filterVisible(_e),Ce=_e[0][0].trace._module;Ce.plot(r,t,Ee,q),Ee.length&&(ie=!0)}ie&&(JJe(r),$Je(r));var ge={};S(ge),r.emit("plotly_relayouting",ge)}function S(P){P[t.id+".angularaxis.rotation"]=T,t.vangles&&(P[t.id+".radialaxis.angle"]=L)}function g(){b.select("text").attr("transform",null);var P={};S(P),Cw.call("_guiRelayout",r,P)}h.prepFn=function(P,E,z){var q=e[t.id];M=q.angularaxis.rotation;var V=f.getBoundingClientRect();p=E-V.left,k=z-V.top,r._fullLayout._calcInverseTransform(r);var G=Xc.apply3DTransform(e._invTransform)(p,k);p=G[0],k=G[1],x=d(p,k),h.moveFn=C,h.doneFn=g,tQ(r)},t.vangles&&!Xc.isFullCircle(t.sectorInRad)&&(h.prepFn=Xc.noop,KJe(Ew.select(f),null)),x9.init(h)};Nd.isPtInside=function(e){if(this.isSmith)return!0;var t=this.sectorInRad,r=this.vangles,n=this.angularAxis.c2g(e.theta),i=this.radialAxis,a=i.c2l(e.r),o=i._rl,s=r?M1.isPtInsidePolygon:Xc.isPtInsideSector;return s(a,n,o,t,r)};Nd.pathArc=function(e){var t=this.sectorInRad,r=this.vangles,n=r?M1.pathPolygon:Xc.pathArc;return n(e,t[0],t[1],r)};Nd.pathSector=function(e){var t=this.sectorInRad,r=this.vangles,n=r?M1.pathPolygon:Xc.pathSector;return n(e,t[0],t[1],r)};Nd.pathAnnulus=function(e,t){var r=this.sectorInRad,n=this.vangles,i=n?M1.pathPolygonAnnulus:Xc.pathAnnulus;return i(e,t,r[0],r[1],n)};Nd.pathSubplot=function(){var e=this.innerRadius,t=this.radius;return e?this.pathAnnulus(e,t):this.pathSector(t)};Nd.fillViewInitialKey=function(e,t){e in this.viewInitial||(this.viewInitial[e]=t)};function t$e(e){var t=e.ticks+String(e.ticklen)+String(e.showticklabels);return"side"in e&&(t+=e.side),t}function pQt(e){var t=e[0],r=e[1],n=r-t,i=QJe(t,360),a=i+n,o=Math.cos(Ux(i)),s=Math.sin(Ux(i)),l=Math.cos(Ux(a)),u=Math.sin(Ux(a)),c,f,h,d;return i<=90&&a>=90||i>90&&a>=450?d=1:s<=0&&u<=0?d=0:d=Math.max(s,u),i<=180&&a>=180||i>180&&a>=540?c=-1:o>=0&&l>=0?c=0:c=Math.min(o,l),i<=270&&a>=270||i>270&&a>=630?f=-1:s>=0&&u>=0?f=0:f=Math.min(s,u),a>=360?h=1:o<=0&&l<=0?h=0:h=Math.max(o,l),[c,f,h,d]}function r$e(e,t){var r=function(i){return Xc.angleDist(e,i)},n=Xc.findIndexOfMin(t,r);return t[n]}function xC(e,t,r){return t?(e.attr("display",null),e.attr(r)):e&&e.attr("display","none"),e}});var iQ=ye((n3r,u$e)=>{"use strict";var gQt=Ih(),os=Rd(),mQt=Cc().attributes,f0=Pr().extendFlat,n$e=mc().overrideAll,a$e=n$e({color:os.color,showline:f0({},os.showline,{dflt:!0}),linecolor:os.linecolor,linewidth:os.linewidth,showgrid:f0({},os.showgrid,{dflt:!0}),gridcolor:os.gridcolor,gridwidth:os.gridwidth,griddash:os.griddash},"plot","from-root"),o$e=n$e({tickmode:os.minor.tickmode,nticks:os.nticks,tick0:os.tick0,dtick:os.dtick,tickvals:os.tickvals,ticktext:os.ticktext,ticks:os.ticks,ticklen:os.ticklen,tickwidth:os.tickwidth,tickcolor:os.tickcolor,ticklabelstep:os.ticklabelstep,showticklabels:os.showticklabels,labelalias:os.labelalias,minorloglabels:os.minorloglabels,showtickprefix:os.showtickprefix,tickprefix:os.tickprefix,showticksuffix:os.showticksuffix,ticksuffix:os.ticksuffix,showexponent:os.showexponent,exponentformat:os.exponentformat,minexponent:os.minexponent,separatethousands:os.separatethousands,tickfont:os.tickfont,tickangle:os.tickangle,tickformat:os.tickformat,tickformatstops:os.tickformatstops,layer:os.layer},"plot","from-root"),s$e={visible:f0({},os.visible,{dflt:!0}),type:f0({},os.type,{values:["-","linear","log","date","category"]}),autotypenumbers:os.autotypenumbers,autorangeoptions:{minallowed:os.autorangeoptions.minallowed,maxallowed:os.autorangeoptions.maxallowed,clipmin:os.autorangeoptions.clipmin,clipmax:os.autorangeoptions.clipmax,include:os.autorangeoptions.include,editType:"plot"},autorange:f0({},os.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:f0({},os.minallowed,{editType:"plot"}),maxallowed:f0({},os.maxallowed,{editType:"plot"}),range:f0({},os.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:os.categoryorder,categoryarray:os.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:os.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:f0({},os.title.text,{editType:"plot",dflt:""}),font:f0({},os.title.font,{editType:"plot"}),editType:"plot"},hoverformat:os.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};f0(s$e,a$e,o$e);var l$e={visible:f0({},os.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:os.autotypenumbers,categoryorder:os.categoryorder,categoryarray:os.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:os.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};f0(l$e,a$e,o$e);u$e.exports={domain:mQt({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:gQt.background},radialaxis:s$e,angularaxis:l$e,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}});var d$e=ye((a3r,h$e)=>{"use strict";var w9=Pr(),yQt=ka(),_Qt=vl(),xQt=q_(),bQt=Id().getSubplotData,wQt=Pb(),TQt=q3(),AQt=s_(),SQt=l_(),MQt=fI(),EQt=c4(),kQt=SB(),CQt=H3(),f$e=iQ(),LQt=K$(),T9=p9(),c$e=T9.axisNames;function PQt(e,t,r,n){var i=r("bgcolor");n.bgColor=yQt.combine(i,n.paper_bgcolor);var a=r("sector");r("hole");var o=bQt(n.fullData,T9.name,n.id),s=n.layoutOut,l;function u(j,N){return r(l+"."+j,N)}for(var c=0;c<c$e.length;c++){l=c$e[c],w9.isPlainObject(e[l])||(e[l]={});var f=e[l],h=_Qt.newContainer(t,l);h._id=h._name=l,h._attr=n.id+"."+l,h._traceIndices=o.map(function(j){return j.index});var d=T9.axisName2dataArray[l],v=IQt(f,h,u,o,d,n);MQt(f,h,u,{axData:o,dataAttr:d});var m=u("visible");switch(LQt(h,t,s),u("uirevision",t.uirevision),h._m=1,l){case"radialaxis":u("minallowed"),u("maxallowed");var b=u("range"),p=h.getAutorangeDflt(b),k=u("autorange",p),M;b&&(b[0]===null&&b[1]===null||(b[0]===null||b[1]===null)&&(k==="reversed"||k===!0)||b[0]!==null&&(k==="min"||k==="max reversed")||b[1]!==null&&(k==="max"||k==="min reversed"))&&(b=void 0,delete h.range,h.autorange=!0,M=!0),M||(p=h.getAutorangeDflt(b),k=u("autorange",p)),f.autorange=k,k&&(kQt(u,k,b),(v==="linear"||v==="-")&&u("rangemode"),h.isReversed()&&(h._m=-1)),h.cleanRange("range",{dfltRange:[0,1]});break;case"angularaxis":if(v==="date"){w9.log("Polar plots do not support date angular axes yet.");for(var T=0;T<o.length;T++)o[T].visible=!1;v=f.type=h.type="linear"}u(v==="linear"?"thetaunit":"period");var L=u("direction");u("rotation",{counterclockwise:0,clockwise:90}[L]);break}if(SQt(f,h,u,h.type,{tickSuffixDflt:h.thetaunit==="degrees"?"\xB0":void 0}),m){var x,C,S,g,P,E,z,q,V,G,Z=n.font||{};x=u("color"),C=x===f.color?x:Z.color,S=Z.size,g=Z.family,P=Z.weight,E=Z.style,z=Z.variant,q=Z.textcase,V=Z.lineposition,G=Z.shadow,wQt(f,h,u,h.type),AQt(f,h,u,h.type,{font:{weight:P,style:E,variant:z,textcase:q,lineposition:V,shadow:G,color:C,size:S,family:g},noAutotickangles:l==="angularaxis",noTicklabelshift:!0,noTicklabelstandoff:!0}),TQt(f,h,u,{outerTicks:!0}),EQt(f,h,u,{dfltColor:x,bgColor:n.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:f$e[l]}),u("layer"),l==="radialaxis"&&(u("side"),u("angle",a[0]),u("title.text"),w9.coerceFont(u,"title.font",{weight:P,style:E,variant:z,textcase:q,lineposition:V,shadow:G,color:C,size:w9.bigFont(S),family:g}))}v!=="category"&&u("hoverformat"),h._input=f}t.angularaxis.type==="category"&&r("gridshape")}function IQt(e,t,r,n,i,a){var o=r("autotypenumbers",a.autotypenumbersDflt),s=r("type");if(s==="-"){for(var l,u=0;u<n.length;u++)if(n[u].visible){l=n[u];break}l&&l[i]&&(t.type=CQt(l[i],"gregorian",{noMultiCategory:!0,autotypenumbers:o})),t.type==="-"?t.type="linear":e.type=t.type}return t.type}h$e.exports=function(t,r,n){xQt(t,r,n,{type:T9.name,attributes:f$e,handleDefaults:PQt,font:r.font,autotypenumbersDflt:r.autotypenumbers,paper_bgcolor:r.paper_bgcolor,fullData:n,layoutOut:r})}});var A9=ye((o3r,y$e)=>{"use strict";var RQt=Id().getSubplotCalcData,DQt=Pr().counterRegex,FQt=rQ(),p$e=p9(),g$e=p$e.attr,Lw=p$e.name,v$e=DQt(Lw),m$e={};m$e[g$e]={valType:"subplotid",dflt:Lw,editType:"calc"};function zQt(e){for(var t=e._fullLayout,r=e.calcdata,n=t._subplots[Lw],i=0;i<n.length;i++){var a=n[i],o=RQt(r,Lw,a),s=t[a]._subplot;s||(s=FQt(e,a),t[a]._subplot=s),s.plot(o,t,e._promises)}}function qQt(e,t,r,n){for(var i=n._subplots[Lw]||[],a=n._has&&n._has("gl"),o=t._has&&t._has("gl"),s=a&&!o,l=0;l<i.length;l++){var u=i[l],c=n[u]._subplot;if(!t[u]&&c){c.framework.remove(),c.layers["radial-axis-title"].remove();for(var f in c.clipPaths)c.clipPaths[f].remove()}s&&c._scene&&(c._scene.destroy(),c._scene=null)}}y$e.exports={attr:g$e,name:Lw,idRoot:Lw,idRegex:v$e,attrRegex:v$e,attributes:m$e,layoutAttributes:iQ(),supplyLayoutDefaults:d$e(),plot:zQt,clean:qQt,toSVG:mh().toSVG}});var bC=ye((s3r,x$e)=>{"use strict";var{hovertemplateAttrs:OQt,texttemplateAttrs:BQt,templatefallbackAttrs:_$e}=Ll(),S9=Ao().extendFlat,NQt=Pg(),h0=pf(),UQt=Gl(),Q5=h0.line;x$e.exports={mode:h0.mode,r:{valType:"data_array",editType:"calc+clearAxisTypes"},theta:{valType:"data_array",editType:"calc+clearAxisTypes"},r0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dr:{valType:"number",dflt:1,editType:"calc"},theta0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dtheta:{valType:"number",editType:"calc"},thetaunit:{valType:"enumerated",values:["radians","degrees","gradians"],dflt:"degrees",editType:"calc+clearAxisTypes"},text:h0.text,texttemplate:BQt({editType:"plot"},{keys:["r","theta","text"]}),texttemplatefallback:_$e({editType:"plot"}),hovertext:h0.hovertext,line:{color:Q5.color,width:Q5.width,dash:Q5.dash,backoff:Q5.backoff,shape:S9({},Q5.shape,{values:["linear","spline"]}),smoothing:Q5.smoothing,editType:"calc"},connectgaps:h0.connectgaps,marker:h0.marker,cliponaxis:S9({},h0.cliponaxis,{dflt:!1}),textposition:h0.textposition,textfont:h0.textfont,fill:S9({},h0.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:NQt(),hoverinfo:S9({},UQt.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:h0.hoveron,hovertemplate:OQt(),hovertemplatefallback:_$e(),selected:h0.selected,unselected:h0.unselected}});var E9=ye((l3r,T$e)=>{"use strict";var M9=Pr(),eS=Ru(),VQt=$p(),GQt=D0(),b$e=uT(),HQt=F0(),jQt=Fg(),WQt=Pm().PTS_LINESONLY,XQt=bC();function ZQt(e,t,r,n){function i(s,l){return M9.coerce(e,t,XQt,s,l)}var a=w$e(e,t,n,i);if(!a){t.visible=!1;return}i("thetaunit"),i("mode",a<WQt?"lines+markers":"lines"),i("text"),i("hovertext"),t.hoveron!=="fills"&&(i("hovertemplate"),i("hovertemplatefallback")),eS.hasMarkers(t)&&VQt(e,t,r,n,i,{gradient:!0}),eS.hasLines(t)&&(GQt(e,t,r,n,i,{backoff:!0}),b$e(e,t,i),i("connectgaps")),eS.hasText(t)&&(i("texttemplate"),i("texttemplatefallback"),HQt(e,t,n,i));var o=[];(eS.hasMarkers(t)||eS.hasText(t))&&(i("cliponaxis"),i("marker.maxdisplayed"),o.push("points")),i("fill"),t.fill!=="none"&&(jQt(e,t,r,i),eS.hasLines(t)||b$e(e,t,i)),(t.fill==="tonext"||t.fill==="toself")&&o.push("fills"),i("hoveron",o.join("+")||"points"),M9.coerceSelectionMarkerOpacity(t,i)}function w$e(e,t,r,n){var i=n("r"),a=n("theta");M9.isTypedArray(i)&&(t.r=i=Array.from(i)),M9.isTypedArray(a)&&(t.theta=a=Array.from(a));var o;if(i)a?o=Math.min(i.length,a.length):(o=i.length,n("theta0"),n("dtheta"));else{if(!a)return 0;o=t.theta.length,n("r0"),n("dr")}return t._length=o,o}T$e.exports={handleRThetaDefaults:w$e,supplyDefaults:ZQt}});var k9=ye((u3r,S$e)=>{"use strict";var YQt=Pr(),A$e=ho();S$e.exports=function(t,r,n){var i={},a=n[r.subplot]._subplot,o,s;a?(o=a.radialAxis,s=a.angularAxis):(a=n[r.subplot],o=a.radialaxis,s=a.angularaxis);var l=o.c2l(t.r);i.rLabel=A$e.tickText(o,l,!0).text;var u=s.thetaunit==="degrees"?YQt.rad2deg(t.theta):t.theta;return i.thetaLabel=A$e.tickText(s,u,!0).text,i}});var k$e=ye((c3r,E$e)=>{"use strict";var M$e=Eo(),KQt=fs().BADNUM,JQt=ho(),$Qt=z0(),QQt=Dm(),eer=q0(),ter=O0().calcMarkerSize;E$e.exports=function(t,r){for(var n=t._fullLayout,i=r.subplot,a=n[i].radialaxis,o=n[i].angularaxis,s=a.makeCalcdata(r,"r"),l=o.makeCalcdata(r,"theta"),u=r._length,c=new Array(u),f=0;f<u;f++){var h=s[f],d=l[f],v=c[f]={};M$e(h)&&M$e(d)?(v.r=h,v.theta=d):v.r=KQt}var m=ter(r,u);return r._extremes.x=JQt.findExtremes(a,s,{ppad:m}),$Qt(t,r),QQt(c,r),eer(c,r),c}});var P$e=ye((f3r,L$e)=>{"use strict";var rer=pT(),C$e=fs().BADNUM;L$e.exports=function(t,r,n){for(var i=r.layers.frontplot.select("g.scatterlayer"),a=r.xaxis,o=r.yaxis,s={xaxis:a,yaxis:o,plot:r.framework,layerClipId:r._hasClipOnAxisFalse?r.clipIds.forTraces:null},l=r.radialAxis,u=r.angularAxis,c=0;c<n.length;c++)for(var f=n[c],h=0;h<f.length;h++){h===0&&(f[0].trace._xA=a,f[0].trace._yA=o);var d=f[h],v=d.r;if(v===C$e)d.x=d.y=C$e;else{var m=l.c2g(v),b=u.c2g(d.theta);d.x=m*Math.cos(b),d.y=m*Math.sin(b)}}rer(t,s,n,i)}});var C9=ye((h3r,R$e)=>{"use strict";var ier=_T();function ner(e,t,r,n){var i=ier(e,t,r,n);if(!(!i||i[0].index===!1)){var a=i[0];if(a.index===void 0)return i;var o=e.subplot,s=a.cd[a.index],l=a.trace;if(o.isPtInside(s))return a.xLabelVal=void 0,a.yLabelVal=void 0,I$e(s,l,o,a),a.hovertemplate=l.hovertemplate,i}}function I$e(e,t,r,n){var i=r.radialAxis,a=r.angularAxis;i._hovertitle="r",a._hovertitle="\u03B8";var o={};o[t.subplot]={_subplot:r};var s=t._module.formatLabels(e,t,o);n.rLabel=s.rLabel,n.thetaLabel=s.thetaLabel;var l=e.hi||t.hoverinfo,u=[];function c(h,d){u.push(h._hovertitle+": "+d)}if(!t.hovertemplate){var f=l.split("+");f.indexOf("all")!==-1&&(f=["r","theta","text"]),f.indexOf("r")!==-1&&c(i,n.rLabel),f.indexOf("theta")!==-1&&c(a,n.thetaLabel),f.indexOf("text")!==-1&&n.text&&(u.push(n.text),delete n.text),n.extraText=u.join("<br>")}}R$e.exports={hoverPoints:ner,makeHoverPointText:I$e}});var F$e=ye((d3r,D$e)=>{"use strict";D$e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:A9(),categories:["polar","symbols","showLegend","scatter-like"],attributes:bC(),supplyDefaults:E9().supplyDefaults,colorbar:Qd(),formatLabels:k9(),calc:k$e(),plot:P$e(),style:sp().style,styleOnSelect:sp().styleOnSelect,hoverPoints:C9().hoverPoints,selectPoints:xT(),meta:{}}});var q$e=ye((v3r,z$e)=>{"use strict";z$e.exports=F$e()});var nQ=ye((m3r,B$e)=>{"use strict";var O$e=bC(),{cliponaxis:p3r,hoveron:g3r}=O$e,aer=mee(O$e,["cliponaxis","hoveron"]),{connectgaps:oer,line:{color:ser,dash:ler,width:uer},fill:cer,fillcolor:fer,marker:her,textfont:der,textposition:ver}=mk();B$e.exports=j1(_g({},aer),{connectgaps:oer,fill:cer,fillcolor:fer,line:{color:ser,dash:ler,editType:"calc",width:uer},marker:her,textfont:der,textposition:ver})});var V$e=ye((_3r,U$e)=>{"use strict";var N$e=Pr(),aQ=Ru(),per=E9().handleRThetaDefaults,ger=$p(),mer=D0(),yer=F0(),_er=Fg(),xer=Pm().PTS_LINESONLY,ber=nQ();U$e.exports=function(t,r,n,i){function a(s,l){return N$e.coerce(t,r,ber,s,l)}var o=per(t,r,i,a);if(!o){r.visible=!1;return}a("thetaunit"),a("mode",o<xer?"lines+markers":"lines"),a("text"),a("hovertext"),r.hoveron!=="fills"&&(a("hovertemplate"),a("hovertemplatefallback")),aQ.hasMarkers(r)&&ger(t,r,n,i,a,{noAngleRef:!0,noLineDash:!0,noStandOff:!0}),aQ.hasLines(r)&&(mer(t,r,n,i,a),a("connectgaps")),aQ.hasText(r)&&(a("texttemplate"),a("texttemplatefallback"),yer(t,r,i,a,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0})),a("fill"),r.fill!=="none"&&_er(t,r,n,a),N$e.coerceSelectionMarkerOpacity(r,a)}});var H$e=ye((x3r,G$e)=>{"use strict";var wer=k9();G$e.exports=function(t,r,n){var i=t.i;return"r"in t||(t.r=r._r[i]),"theta"in t||(t.theta=r._theta[i]),wer(t,r,n)}});var W$e=ye((b3r,j$e)=>{"use strict";var Ter=z0(),Aer=O0().calcMarkerSize,Ser=lw(),Mer=ho(),Eer=gx().TOO_MANY_POINTS;j$e.exports=function(t,r){var n=t._fullLayout,i=r.subplot,a=n[i].radialaxis,o=n[i].angularaxis,s=r._r=a.makeCalcdata(r,"r"),l=r._theta=o.makeCalcdata(r,"theta"),u=r._length,c={};u<s.length&&(s=s.slice(0,u)),u<l.length&&(l=l.slice(0,u)),c.r=s,c.theta=l,Ter(t,r);var f=c.opts=Ser.style(t,r),h;return u<Eer?h=Aer(r,u):f.marker&&(h=2*(f.marker.sizeAvg||Math.max(f.marker.size,3))),r._extremes.x=Mer.findExtremes(a,s,{ppad:h}),[{x:!1,y:!1,t:c,trace:r}]}});var Z$e=ye((w3r,X$e)=>{"use strict";var ker=XF(),Cer=C9().makeHoverPointText;function Ler(e,t,r,n){var i=e.cd,a=i[0].t,o=a.r,s=a.theta,l=ker.hoverPoints(e,t,r,n);if(!(!l||l[0].index===!1)){var u=l[0];if(u.index===void 0)return l;var c=e.subplot,f=u.cd[u.index],h=u.trace;if(f.r=o[u.index],f.theta=s[u.index],!!c.isPtInside(f))return u.xLabelVal=void 0,u.yLabelVal=void 0,Cer(f,h,c,u),l}}X$e.exports={hoverPoints:Ler}});var K$e=ye((T3r,Y$e)=>{"use strict";Y$e.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:A9(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:nQ(),supplyDefaults:V$e(),colorbar:Qd(),formatLabels:H$e(),calc:W$e(),hoverPoints:Z$e().hoverPoints,selectPoints:mY(),meta:{}}});var J$e=ye((A3r,oQ)=>{"use strict";var Per=KF(),Ier=Eo(),Rer=bK(),Der=vY(),L9=lw(),P9=Pr(),Fer=gx().TOO_MANY_POINTS,zer={};oQ.exports=function(t,r,n){if(n.length){var i=r.radialAxis,a=r.angularAxis,o=Der(t,r);return n.forEach(function(s){if(!(!s||!s[0]||!s[0].trace)){var l=s[0],u=l.trace,c=l.t,f=u._length,h=c.r,d=c.theta,v=c.opts,m,b=h.slice(),p=d.slice();for(m=0;m<h.length;m++)r.isPtInside({r:h[m],theta:d[m]})||(b[m]=NaN,p[m]=NaN);var k=new Array(f*2),M=Array(f),T=Array(f);for(m=0;m<f;m++){var L=b[m],x,C;if(Ier(L)){var S=i.c2g(L),g=a.c2g(p[m],u.thetaunit);x=S*Math.cos(g),C=S*Math.sin(g)}else x=C=NaN;M[m]=k[m*2]=x,T[m]=k[m*2+1]=C}c.tree=Per(k),v.marker&&f>=Fer&&(v.marker.cluster=c.tree),v.marker&&(v.markerSel.positions=v.markerUnsel.positions=v.marker.positions=k),v.line&&k.length>1&&P9.extendFlat(v.line,L9.linePositions(t,u,k)),v.text&&(P9.extendFlat(v.text,{positions:k},L9.textPosition(t,u,v.text,v.marker)),P9.extendFlat(v.textSel,{positions:k},L9.textPosition(t,u,v.text,v.markerSel)),P9.extendFlat(v.textUnsel,{positions:k},L9.textPosition(t,u,v.text,v.markerUnsel))),v.fill&&!o.fill2d&&(o.fill2d=!0),v.marker&&!o.scatter2d&&(o.scatter2d=!0),v.line&&!o.line2d&&(o.line2d=!0),v.text&&!o.glText&&(o.glText=!0),o.lineOptions.push(v.line),o.fillOptions.push(v.fill),o.markerOptions.push(v.marker),o.markerSelectedOptions.push(v.markerSel),o.markerUnselectedOptions.push(v.markerUnsel),o.textOptions.push(v.text),o.textSelectedOptions.push(v.textSel),o.textUnselectedOptions.push(v.textUnsel),o.selectBatch.push([]),o.unselectBatch.push([]),c.x=M,c.y=T,c.rawx=M,c.rawy=T,c.r=h,c.theta=d,c.positions=k,c._scene=o,c.index=o.count,o.count++}}),Rer(t,r,n)}};oQ.exports.reglPrecompiled=zer});var eQe=ye((S3r,Q$e)=>{"use strict";var $$e=K$e();$$e.plot=J$e();Q$e.exports=$$e});var rQe=ye((M3r,tQe)=>{"use strict";tQe.exports=eQe()});var sQ=ye((E3r,iQe)=>{"use strict";var{hovertemplateAttrs:qer,templatefallbackAttrs:Oer}=Ll(),tS=Ao().extendFlat,Vx=bC(),Gx=qm();iQe.exports={r:Vx.r,theta:Vx.theta,r0:Vx.r0,dr:Vx.dr,theta0:Vx.theta0,dtheta:Vx.dtheta,thetaunit:Vx.thetaunit,base:tS({},Gx.base,{}),offset:tS({},Gx.offset,{}),width:tS({},Gx.width,{}),text:tS({},Gx.text,{}),hovertext:tS({},Gx.hovertext,{}),marker:Ber(),hoverinfo:Vx.hoverinfo,hovertemplate:qer(),hovertemplatefallback:Oer(),selected:Gx.selected,unselected:Gx.unselected};function Ber(){var e=tS({},Gx.marker);return delete e.cornerradius,e}});var lQ=ye((k3r,nQe)=>{"use strict";nQe.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}});var sQe=ye((C3r,oQe)=>{"use strict";var aQe=Pr(),Ner=E9().handleRThetaDefaults,Uer=XI(),Ver=sQ();oQe.exports=function(t,r,n,i){function a(s,l){return aQe.coerce(t,r,Ver,s,l)}var o=Ner(t,r,i,a);if(!o){r.visible=!1;return}a("thetaunit"),a("base"),a("offset"),a("width"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),Uer(t,r,a,n,i),aQe.coerceSelectionMarkerOpacity(r,a)}});var uQe=ye((L3r,lQe)=>{"use strict";var Ger=Pr(),Her=lQ();lQe.exports=function(e,t,r){var n={},i;function a(l,u){return Ger.coerce(e[i]||{},t[i],Her,l,u)}for(var o=0;o<r.length;o++){var s=r[o];s.type==="barpolar"&&s.visible===!0&&(i=s.subplot,n[i]||(a("barmode"),a("bargap"),n[i]=1))}}});var uQ=ye((P3r,hQe)=>{"use strict";var cQe=pv().hasColorscale,fQe=gv(),jer=Pr().isArrayOrTypedArray,Wer=S4(),Xer=i2().setGroupPositions,Zer=q0(),Yer=Oa().traceIs,Ker=Pr().extendFlat;function Jer(e,t){for(var r=e._fullLayout,n=t.subplot,i=r[n].radialaxis,a=r[n].angularaxis,o=i.makeCalcdata(t,"r"),s=a.makeCalcdata(t,"theta"),l=t._length,u=new Array(l),c=o,f=s,h=0;h<l;h++)u[h]={p:f[h],s:c[h]};function d(v){var m=t[v];m!==void 0&&(t["_"+v]=jer(m)?a.makeCalcdata(t,v):a.d2c(m,t.thetaunit))}return a.type==="linear"&&(d("width"),d("offset")),cQe(t,"marker")&&fQe(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),cQe(t,"marker.line")&&fQe(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}),Wer(u,t),Zer(u,t),u}function $er(e,t,r){for(var n=e.calcdata,i=[],a=0;a<n.length;a++){var o=n[a],s=o[0].trace;s.visible===!0&&Yer(s,"bar")&&s.subplot===r&&i.push(o)}var l=Ker({},t.radialaxis,{_id:"x"}),u=t.angularaxis;Xer(e,u,l,i,{mode:t.barmode,norm:t.barnorm,gap:t.bargap,groupgap:t.bargroupgap})}hQe.exports={calc:Jer,crossTraceCalc:$er}});var pQe=ye((I3r,vQe)=>{"use strict";var dQe=qa(),I9=Eo(),rS=Pr(),Qer=So(),cQ=m9();vQe.exports=function(t,r,n){var i=t._context.staticPlot,a=r.xaxis,o=r.yaxis,s=r.radialAxis,l=r.angularAxis,u=etr(r),c=r.layers.frontplot.select("g.barlayer");rS.makeTraceGroups(c,n,"trace bars").each(function(){var f=dQe.select(this),h=rS.ensureSingle(f,"g","points"),d=h.selectAll("g.point").data(rS.identity);d.enter().append("g").style("vector-effect",i?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),d.exit().remove(),d.each(function(v){var m=dQe.select(this),b=v.rp0=s.c2p(v.s0),p=v.rp1=s.c2p(v.s1),k=v.thetag0=l.c2g(v.p0),M=v.thetag1=l.c2g(v.p1),T;if(!I9(b)||!I9(p)||!I9(k)||!I9(M)||b===p||k===M)T="M0,0Z";else{var L=s.c2g(v.s1),x=(k+M)/2;v.ct=[a.c2p(L*Math.cos(x)),o.c2p(L*Math.sin(x))],T=u(b,p,k,M)}rS.ensureSingle(m,"path").attr("d",T)}),Qer.setClipUrl(f,r._hasClipOnAxisFalse?r.clipIds.forTraces:null,t)})};function etr(e){var t=e.cxx,r=e.cyy;return e.vangles?function(n,i,a,o){var s,l;rS.angleDelta(a,o)>0?(s=a,l=o):(s=o,l=a);var u=cQ.findEnclosingVertexAngles(s,e.vangles)[0],c=cQ.findEnclosingVertexAngles(l,e.vangles)[1],f=[u,(s+l)/2,c];return cQ.pathPolygonAnnulus(n,i,s,l,f,t,r)}:function(n,i,a,o){return rS.pathAnnulus(n,i,a,o,t,r)}}});var mQe=ye((R3r,gQe)=>{"use strict";var ttr=ef(),fQ=Pr(),rtr=RT().getTraceColor,itr=fQ.fillText,ntr=C9().makeHoverPointText,atr=m9().isPtInsidePolygon;gQe.exports=function(t,r,n){var i=t.cd,a=i[0].trace,o=t.subplot,s=o.radialAxis,l=o.angularAxis,u=o.vangles,c=u?atr:fQ.isPtInsideSector,f=t.maxHoverDistance,h=l._period||2*Math.PI,d=Math.abs(s.g2p(Math.sqrt(r*r+n*n))),v=Math.atan2(n,r);s.range[0]>s.range[1]&&(v+=Math.PI);var m=function(M){return c(d,v,[M.rp0,M.rp1],[M.thetag0,M.thetag1],u)?f+Math.min(1,Math.abs(M.thetag1-M.thetag0)/h)-1+(M.rp1-d)/(M.rp1-M.rp0)-1:1/0};if(ttr.getClosest(i,m,t),t.index!==!1){var b=t.index,p=i[b];t.x0=t.x1=p.ct[0],t.y0=t.y1=p.ct[1];var k=fQ.extendFlat({},p,{r:p.s,theta:p.p});return itr(p,a,t),ntr(k,a,o,t),t.hovertemplate=a.hovertemplate,t.color=rtr(a,p),t.xLabelVal=t.yLabelVal=void 0,p.s<0&&(t.idealAlign="left"),[t]}}});var _Qe=ye((D3r,yQe)=>{"use strict";yQe.exports={moduleType:"trace",name:"barpolar",basePlotModule:A9(),categories:["polar","bar","showLegend"],attributes:sQ(),layoutAttributes:lQ(),supplyDefaults:sQe(),supplyLayoutDefaults:uQe(),calc:uQ().calc,crossTraceCalc:uQ().crossTraceCalc,plot:pQe(),colorbar:Qd(),formatLabels:k9(),style:V0().style,styleOnSelect:V0().styleOnSelect,hoverPoints:mQe(),selectPoints:DT(),meta:{}}});var bQe=ye((F3r,xQe)=>{"use strict";xQe.exports=_Qe()});var hQ=ye((z3r,wQe)=>{"use strict";wQe.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}});var dQ=ye((q3r,MQe)=>{"use strict";var otr=Ih(),Uf=Rd(),str=Cc().attributes,Hx=Pr().extendFlat,TQe=mc().overrideAll,AQe=TQe({color:Uf.color,showline:Hx({},Uf.showline,{dflt:!0}),linecolor:Uf.linecolor,linewidth:Uf.linewidth,showgrid:Hx({},Uf.showgrid,{dflt:!0}),gridcolor:Uf.gridcolor,gridwidth:Uf.gridwidth,griddash:Uf.griddash},"plot","from-root"),SQe=TQe({ticklen:Uf.ticklen,tickwidth:Hx({},Uf.tickwidth,{dflt:2}),tickcolor:Uf.tickcolor,showticklabels:Uf.showticklabels,labelalias:Uf.labelalias,showtickprefix:Uf.showtickprefix,tickprefix:Uf.tickprefix,showticksuffix:Uf.showticksuffix,ticksuffix:Uf.ticksuffix,tickfont:Uf.tickfont,tickformat:Uf.tickformat,hoverformat:Uf.hoverformat,layer:Uf.layer},"plot","from-root"),ltr=Hx({visible:Hx({},Uf.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:Hx({},Uf.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},AQe,SQe),utr=Hx({visible:Hx({},Uf.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:Uf.ticks,editType:"calc"},AQe,SQe);MQe.exports={domain:str({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:otr.background},realaxis:ltr,imaginaryaxis:utr,editType:"calc"}});var CQe=ye((O3r,kQe)=>{"use strict";var iS=Pr(),ctr=ka(),ftr=vl(),htr=q_(),dtr=Id().getSubplotData,vtr=l_(),ptr=s_(),gtr=c4(),mtr=xm(),nS=dQ(),vQ=hQ(),EQe=vQ.axisNames,ytr=xtr(function(e){return iS.isTypedArray(e)&&(e=Array.from(e)),e.slice().reverse().map(function(t){return-t}).concat([0]).concat(e)},String);function _tr(e,t,r,n){var i=r("bgcolor");n.bgColor=ctr.combine(i,n.paper_bgcolor);var a=dtr(n.fullData,vQ.name,n.id),o=n.layoutOut,s;function l(L,x){return r(s+"."+L,x)}for(var u=0;u<EQe.length;u++){s=EQe[u],iS.isPlainObject(e[s])||(e[s]={});var c=e[s],f=ftr.newContainer(t,s);f._id=f._name=s,f._attr=n.id+"."+s,f._traceIndices=a.map(function(L){return L.index});var h=l("visible");if(f.type="linear",mtr(f,o),vtr(c,f,l,f.type),h){var d=s==="realaxis";if(d&&l("side"),d)l("tickvals");else{var v=ytr(t.realaxis.tickvals||nS.realaxis.tickvals.dflt);l("tickvals",v)}iS.isTypedArray(f.tickvals)&&(f.tickvals=Array.from(f.tickvals));var m,b,p,k,M=n.font||{};h&&(m=l("color"),b=m===c.color?m:M.color,p=M.size,k=M.family),ptr(c,f,l,f.type,{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noAng:!d,noExp:!0,font:{color:b,size:p,family:k}}),iS.coerce2(e,t,nS,s+".ticklen"),iS.coerce2(e,t,nS,s+".tickwidth"),iS.coerce2(e,t,nS,s+".tickcolor",t.color);var T=l("ticks");T||(delete t[s].ticklen,delete t[s].tickwidth,delete t[s].tickcolor),gtr(c,f,l,{dfltColor:m,bgColor:n.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:nS[s]}),l("layer")}l("hoverformat"),delete f.type,f._input=c}}kQe.exports=function(t,r,n){htr(t,r,n,{noUirevision:!0,type:vQ.name,attributes:nS,handleDefaults:_tr,font:r.font,paper_bgcolor:r.paper_bgcolor,fullData:n,layoutOut:r})};function xtr(e,t){var r={};return function(n){var i=t?t(n):n;if(i in r)return r[i];var a=e(n);return r[i]=a,a}}});var FQe=ye((B3r,DQe)=>{"use strict";var btr=Id().getSubplotCalcData,wtr=Pr().counterRegex,Ttr=rQ(),PQe=hQ(),IQe=PQe.attr,Pw=PQe.name,LQe=wtr(Pw),RQe={};RQe[IQe]={valType:"subplotid",dflt:Pw,editType:"calc"};function Atr(e){for(var t=e._fullLayout,r=e.calcdata,n=t._subplots[Pw],i=0;i<n.length;i++){var a=n[i],o=btr(r,Pw,a),s=t[a]._subplot;s||(s=Ttr(e,a,!0),t[a]._subplot=s),s.plot(o,t,e._promises)}}function Str(e,t,r,n){for(var i=n._subplots[Pw]||[],a=0;a<i.length;a++){var o=i[a],s=n[o]._subplot;if(!t[o]&&s){s.framework.remove();for(var l in s.clipPaths)s.clipPaths[l].remove()}}}DQe.exports={attr:IQe,name:Pw,idRoot:Pw,idRegex:LQe,attrRegex:LQe,attributes:RQe,layoutAttributes:dQ(),supplyLayoutDefaults:CQe(),plot:Atr,clean:Str,toSVG:mh().toSVG}});var pQ=ye((N3r,qQe)=>{"use strict";var{hovertemplateAttrs:Mtr,texttemplateAttrs:Etr,templatefallbackAttrs:zQe}=Ll(),R9=Ao().extendFlat,ktr=Pg(),d0=pf(),Ctr=Gl(),aS=d0.line;qQe.exports={mode:d0.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:d0.text,texttemplate:Etr({editType:"plot"},{keys:["real","imag","text"]}),texttemplatefallback:zQe({editType:"plot"}),hovertext:d0.hovertext,line:{color:aS.color,width:aS.width,dash:aS.dash,backoff:aS.backoff,shape:R9({},aS.shape,{values:["linear","spline"]}),smoothing:aS.smoothing,editType:"calc"},connectgaps:d0.connectgaps,marker:d0.marker,cliponaxis:R9({},d0.cliponaxis,{dflt:!1}),textposition:d0.textposition,textfont:d0.textfont,fill:R9({},d0.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:ktr(),hoverinfo:R9({},Ctr.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:d0.hoveron,hovertemplate:Mtr(),hovertemplatefallback:zQe(),selected:d0.selected,unselected:d0.unselected}});var NQe=ye((U3r,BQe)=>{"use strict";var D9=Pr(),oS=Ru(),Ltr=$p(),Ptr=D0(),OQe=uT(),Itr=F0(),Rtr=Fg(),Dtr=Pm().PTS_LINESONLY,Ftr=pQ();BQe.exports=function(t,r,n,i){function a(l,u){return D9.coerce(t,r,Ftr,l,u)}var o=ztr(t,r,i,a);if(!o){r.visible=!1;return}a("mode",o<Dtr?"lines+markers":"lines"),a("text"),a("hovertext"),r.hoveron!=="fills"&&(a("hovertemplate"),a("hovertemplatefallback")),oS.hasMarkers(r)&&Ltr(t,r,n,i,a,{gradient:!0}),oS.hasLines(r)&&(Ptr(t,r,n,i,a,{backoff:!0}),OQe(t,r,a),a("connectgaps")),oS.hasText(r)&&(a("texttemplate"),a("texttemplatefallback"),Itr(t,r,i,a));var s=[];(oS.hasMarkers(r)||oS.hasText(r))&&(a("cliponaxis"),a("marker.maxdisplayed"),s.push("points")),a("fill"),r.fill!=="none"&&(Rtr(t,r,n,a),oS.hasLines(r)||OQe(t,r,a)),(r.fill==="tonext"||r.fill==="toself")&&s.push("fills"),a("hoveron",s.join("+")||"points"),D9.coerceSelectionMarkerOpacity(r,a)};function ztr(e,t,r,n){var i=n("real"),a=n("imag"),o;return i&&a&&(o=Math.min(i.length,a.length)),D9.isTypedArray(i)&&(t.real=i=Array.from(i)),D9.isTypedArray(a)&&(t.imag=a=Array.from(a)),t._length=o,o}});var GQe=ye((V3r,VQe)=>{"use strict";var UQe=ho();VQe.exports=function(t,r,n){var i={},a=n[r.subplot]._subplot;return i.realLabel=UQe.tickText(a.radialAxis,t.real,!0).text,i.imagLabel=UQe.tickText(a.angularAxis,t.imag,!0).text,i}});var WQe=ye((G3r,jQe)=>{"use strict";var HQe=Eo(),qtr=fs().BADNUM,Otr=z0(),Btr=Dm(),Ntr=q0(),Utr=O0().calcMarkerSize;jQe.exports=function(t,r){for(var n=t._fullLayout,i=r.subplot,a=n[i].realaxis,o=n[i].imaginaryaxis,s=a.makeCalcdata(r,"real"),l=o.makeCalcdata(r,"imag"),u=r._length,c=new Array(u),f=0;f<u;f++){var h=s[f],d=l[f],v=c[f]={};HQe(h)&&HQe(d)?(v.real=h,v.imag=d):v.real=qtr}return Utr(r,u),Otr(t,r),Btr(c,r),Ntr(c,r),c}});var YQe=ye((H3r,ZQe)=>{"use strict";var Vtr=pT(),XQe=fs().BADNUM,Gtr=Q$(),Htr=Gtr.smith;ZQe.exports=function(t,r,n){for(var i=r.layers.frontplot.select("g.scatterlayer"),a=r.xaxis,o=r.yaxis,s={xaxis:a,yaxis:o,plot:r.framework,layerClipId:r._hasClipOnAxisFalse?r.clipIds.forTraces:null},l=0;l<n.length;l++)for(var u=n[l],c=0;c<u.length;c++){c===0&&(u[0].trace._xA=a,u[0].trace._yA=o);var f=u[c],h=f.real;if(h===XQe)f.x=f.y=XQe;else{var d=Htr([h,f.imag]);f.x=d[0],f.y=d[1]}}Vtr(t,s,n,i)}});var $Qe=ye((j3r,JQe)=>{"use strict";var jtr=_T();function Wtr(e,t,r,n){var i=jtr(e,t,r,n);if(!(!i||i[0].index===!1)){var a=i[0];if(a.index===void 0)return i;var o=e.subplot,s=a.cd[a.index],l=a.trace;if(o.isPtInside(s))return a.xLabelVal=void 0,a.yLabelVal=void 0,KQe(s,l,o,a),a.hovertemplate=l.hovertemplate,i}}function KQe(e,t,r,n){var i=r.radialAxis,a=r.angularAxis;i._hovertitle="real",a._hovertitle="imag";var o={};o[t.subplot]={_subplot:r};var s=t._module.formatLabels(e,t,o);n.realLabel=s.realLabel,n.imagLabel=s.imagLabel;var l=e.hi||t.hoverinfo,u=[];function c(h,d){u.push(h._hovertitle+": "+d)}if(!t.hovertemplate){var f=l.split("+");f.indexOf("all")!==-1&&(f=["real","imag","text"]),f.indexOf("real")!==-1&&c(i,n.realLabel),f.indexOf("imag")!==-1&&c(a,n.imagLabel),f.indexOf("text")!==-1&&n.text&&(u.push(n.text),delete n.text),n.extraText=u.join("<br>")}}JQe.exports={hoverPoints:Wtr,makeHoverPointText:KQe}});var eet=ye((W3r,QQe)=>{"use strict";QQe.exports={moduleType:"trace",name:"scattersmith",basePlotModule:FQe(),categories:["smith","symbols","showLegend","scatter-like"],attributes:pQ(),supplyDefaults:NQe(),colorbar:Qd(),formatLabels:GQe(),calc:WQe(),plot:YQe(),style:sp().style,styleOnSelect:sp().styleOnSelect,hoverPoints:$Qe().hoverPoints,selectPoints:xT(),meta:{}}});var ret=ye((X3r,tet)=>{"use strict";tet.exports=eet()});var kv=ye((Z3r,net)=>{var z9=Nh();function iet(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}z9(iet.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,i){return n=(e!=null&&e.year?e.calendar():typeof n=="string"?this.instance(n,i):n)||this.instance(),n.newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,function(r){return e[r]})}},substituteChineseDigits:function(e,t){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(a===0?"":e[a]+t[i])+n,i++,r=Math.floor(r/10)}return n.indexOf(e[1]+t[1])===0&&(n=n.substr(1)),n||e[0]}}});function gQ(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(Gs.local.invalidDate||Gs.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function F9(e,t){return e=""+e,"000000".substring(0,t-e.length)+e}z9(gQ.prototype,{newDate:function(e,t,r){return this._calendar.newDate(e==null?this:e,t,r)},year:function(e){return arguments.length===0?this._year:this.set(e,"y")},month:function(e){return arguments.length===0?this._month:this.set(e,"m")},day:function(e){return arguments.length===0?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(Gs.local.invalidDate||Gs.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(Gs.local.differentCalendars||Gs.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return t===0?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+F9(Math.abs(this.year()),4)+"-"+F9(this.month(),2)+"-"+F9(this.day(),2)}});function mQ(){this.shortYearCutoff="+10"}z9(mQ.prototype,{_validateLevel:0,newDate:function(e,t,r){return e==null?this.today():(e.year&&(this._validate(e,t,r,Gs.local.invalidDate||Gs.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new gQ(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){var t=this._validate(e,this.minMonth,this.minDay,Gs.local.invalidYear||Gs.regionalOptions[""].invalidYear);return t.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,Gs.local.invalidYear||Gs.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+F9(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,Gs.local.invalidYear||Gs.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,Gs.local.invalidMonth||Gs.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,Gs.local.invalidMonth||Gs.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,Gs.local.invalidYear||Gs.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,Gs.local.invalidDate||Gs.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,Gs.local.invalidDate||Gs.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,Gs.local.invalidDate||Gs.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,Gs.local.invalidDate||Gs.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,r==="d"||r==="w"){var n=e.toJD()+t*(r==="w"?this.daysInWeek():1),i=e.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=e.year()+(r==="y"?t:0),o=e.monthOfYear()+(r==="m"?t:0),i=e.day(),s=function(c){for(;o<c.minMonth;)a--,o+=c.monthsInYear(a);for(var f=c.monthsInYear(a);o>f-1+c.minMonth;)a++,o-=f,f=c.monthsInYear(a)};r==="y"?(e.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):r==="m"&&(s(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var l=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,l}catch(u){throw this._validateLevel--,u}},_correctAdd:function(e,t,r,n){if(!this.hasYearZero&&(n==="y"||n==="m")&&(t[0]===0||e.year()>0!=t[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;t=this._add(e,r*i[0]+a*i[1],i[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,Gs.local.invalidDate||Gs.regionalOptions[""].invalidDate);var n=r==="y"?t:e.year(),i=r==="m"?t:e.month(),a=r==="d"?t:e.day();return(r==="y"||r==="m")&&(a=Math.min(a,this.daysInMonth(n,i))),e.date(n,i,a)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||e!==0;if(n){var i=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth<this.monthsInYear(i)&&r>=this.minDay&&r-this.minDay<this.daysInMonth(i)}return this._validateLevel--,n},toJSDate:function(e,t,r){var n=this._validate(e,t,r,Gs.local.invalidDate||Gs.regionalOptions[""].invalidDate);return Gs.instance().fromJD(this.toJD(n)).toJSDate()},fromJSDate:function(e){return this.fromJD(Gs.instance().fromJSDate(e).toJD())},_validate:function(e,t,r,n){if(e.year){if(this._validateLevel===0&&this.name!==e.calendar().name)throw(Gs.local.differentCalendars||Gs.regionalOptions[""].differentCalendars).replace(/\{0\}/,this.local.name).replace(/\{1\}/,e.calendar().local.name);return e}try{if(this._validateLevel++,this._validateLevel===1&&!this.isValid(e,t,r))throw n.replace(/\{0\}/,this.local.name);var i=this.newDate(e,t,r);return this._validateLevel--,i}catch(a){throw this._validateLevel--,a}}});function yQ(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}yQ.prototype=new mQ;z9(yQ.prototype,{name:"Gregorian",jdEpoch:17214255e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Gregorian",epochs:["BCE","CE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(r){var t=this._validate(r,this.minMonth,this.minDay,Gs.local.invalidYear||Gs.regionalOptions[""].invalidYear),r=t.year()+(t.year()<0?1:0);return r%4===0&&(r%100!==0||r%400===0)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,Gs.local.invalidMonth||Gs.regionalOptions[""].invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===2&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var n=this._validate(e,t,r,Gs.local.invalidDate||Gs.regionalOptions[""].invalidDate);e=n.year(),t=n.month(),r=n.day(),e<0&&e++,t<3&&(t+=12,e--);var i=Math.floor(e/100),a=2-i+Math.floor(i/4);return Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r+a-1524.5},fromJD:function(e){var t=Math.floor(e+.5),r=Math.floor((t-186721625e-2)/36524.25);r=t+1+r-Math.floor(r/4);var n=r+1524,i=Math.floor((n-122.1)/365.25),a=Math.floor(365.25*i),o=Math.floor((n-a)/30.6001),s=n-a-Math.floor(o*30.6001),l=o-(o>13.5?13:1),u=i-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,Gs.local.invalidDate||Gs.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var Gs=net.exports=new iet;Gs.cdate=gQ;Gs.baseCalendar=mQ;Gs.calendars.gregorian=yQ});var aet=ye(()=>{var _Q=Nh(),Ud=kv();_Q(Ud.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"});Ud.local=Ud.regionalOptions[""];_Q(Ud.cdate.prototype,{formatDate:function(e,t){return typeof e!="string"&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}});_Q(Ud.baseCalendar.prototype,{UNIX_EPOCH:Ud.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:24*60*60,TICKS_EPOCH:Ud.instance().jdEpoch,TICKS_PER_DAY:24*60*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,t,r){if(typeof e!="string"&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw Ud.local.invalidFormat||Ud.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat,r=r||{};for(var n=r.dayNamesShort||this.local.dayNamesShort,i=r.dayNames||this.local.dayNames,a=r.monthNumbers||this.local.monthNumbers,o=r.monthNamesShort||this.local.monthNamesShort,s=r.monthNames||this.local.monthNames,l=r.calculateWeek||this.local.calculateWeek,u=function(T,L){for(var x=1;M+x<e.length&&e.charAt(M+x)===T;)x++;return M+=x-1,Math.floor(x/(L||1))>1},c=function(T,L,x,C){var S=""+L;if(u(T,C))for(;S.length<x;)S="0"+S;return S},f=function(T,L,x,C){return u(T)?C[L]:x[L]},h=this,d=function(T){return typeof a=="function"?a.call(h,T,u("m")):b(c("m",T.month(),2))},v=function(T,L){return L?typeof s=="function"?s.call(h,T):s[T.month()-h.minMonth]:typeof o=="function"?o.call(h,T):o[T.month()-h.minMonth]},m=this.local.digits,b=function(T){return r.localNumbers&&m?m(T):T},p="",k=!1,M=0;M<e.length;M++)if(k)e.charAt(M)==="'"&&!u("'")?k=!1:p+=e.charAt(M);else switch(e.charAt(M)){case"d":p+=b(c("d",t.day(),2));break;case"D":p+=f("D",t.dayOfWeek(),n,i);break;case"o":p+=c("o",t.dayOfYear(),3);break;case"w":p+=c("w",t.weekOfYear(),2);break;case"m":p+=d(t);break;case"M":p+=v(t,u("M"));break;case"y":p+=u("y",2)?t.year():(t.year()%100<10?"0":"")+t.year()%100;break;case"Y":u("Y",2),p+=t.formatYear();break;case"J":p+=t.toJD();break;case"@":p+=(t.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":p+=(t.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":u("'")?p+="'":k=!0;break;default:p+=e.charAt(M)}return p},parseDate:function(e,t,r){if(t==null)throw Ud.local.invalidArguments||Ud.regionalOptions[""].invalidArguments;if(t=typeof t=="object"?t.toString():t+"",t==="")return null;e=e||this.local.dateFormat,r=r||{};var n=r.shortYearCutoff||this.shortYearCutoff;n=typeof n!="string"?n:this.today().year()%100+parseInt(n,10);for(var i=r.dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.parseMonth||this.local.parseMonth,s=r.monthNumbers||this.local.monthNumbers,l=r.monthNamesShort||this.local.monthNamesShort,u=r.monthNames||this.local.monthNames,c=-1,f=-1,h=-1,d=-1,v=-1,m=!1,b=!1,p=function(z,q){for(var V=1;g+V<e.length&&e.charAt(g+V)===z;)V++;return g+=V-1,Math.floor(V/(q||1))>1},k=function(z,q){var V=p(z,q),G=[2,3,V?4:2,V?4:2,10,11,20]["oyYJ@!".indexOf(z)+1],Z=new RegExp("^-?\\d{1,"+G+"}"),j=t.substring(S).match(Z);if(!j)throw(Ud.local.missingNumberAt||Ud.regionalOptions[""].missingNumberAt).replace(/\{0\}/,S);return S+=j[0].length,parseInt(j[0],10)},M=this,T=function(){if(typeof s=="function"){p("m");var z=s.call(M,t.substring(S));return S+=z.length,z}return k("m")},L=function(z,q,V,G){for(var Z=p(z,G)?V:q,j=0;j<Z.length;j++)if(t.substr(S,Z[j].length).toLowerCase()===Z[j].toLowerCase())return S+=Z[j].length,j+M.minMonth;throw(Ud.local.unknownNameAt||Ud.regionalOptions[""].unknownNameAt).replace(/\{0\}/,S)},x=function(){if(typeof u=="function"){var z=p("M")?u.call(M,t.substring(S)):l.call(M,t.substring(S));return S+=z.length,z}return L("M",l,u)},C=function(){if(t.charAt(S)!==e.charAt(g))throw(Ud.local.unexpectedLiteralAt||Ud.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,S);S++},S=0,g=0;g<e.length;g++)if(b)e.charAt(g)==="'"&&!p("'")?b=!1:C();else switch(e.charAt(g)){case"d":d=k("d");break;case"D":L("D",i,a);break;case"o":v=k("o");break;case"w":k("w");break;case"m":h=T();break;case"M":h=x();break;case"y":var P=g;m=!p("y",2),g=P,f=k("y",2);break;case"Y":f=k("Y",2);break;case"J":c=k("J")+.5,t.charAt(S)==="."&&(S++,k("J"));break;case"@":c=k("@")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case"!":c=k("!")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case"*":S=t.length;break;case"'":p("'")?C():b=!0;break;default:C()}if(S<t.length)throw Ud.local.unexpectedText||Ud.regionalOptions[""].unexpectedText;if(f===-1?f=this.today().year():f<100&&m&&(f+=n===-1?1900:this.today().year()-this.today().year()%100-(f<=n?0:100)),typeof h=="string"&&(h=o.call(this,f,h)),v>-1){h=1,d=v;for(var E=this.daysInMonth(f,h);d>E;E=this.daysInMonth(f,h))h++,d-=E}return c>-1?this.fromJD(c):this.newDate(f,h,d)},determineDate:function(e,t,r,n,i){r&&typeof r!="object"&&(i=n,n=r,r=null),typeof n!="string"&&(i=n,n="");var a=this,o=function(s){try{return a.parseDate(n,s,i)}catch(f){}s=s.toLowerCase();for(var l=(s.match(/^c/)&&r?r.newDate():null)||a.today(),u=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,c=u.exec(s);c;)l.add(parseInt(c[1],10),c[2]||"d"),c=u.exec(s);return l};return t=t?t.newDate():null,e=e==null?t:typeof e=="string"?o(e):typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?t:a.today().add(e,"d"):a.newDate(e),e}})});var oet=ye(()=>{var jx=kv(),Xtr=Nh(),xQ=jx.instance();function q9(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}q9.prototype=new jx.baseCalendar;Xtr(q9.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if(typeof e=="string"){var r=e.match(Ytr);return r?r[0]:""}var n=this._validateYear(e),i=e.month(),a=""+this.toChineseMonth(n,i);return t&&a.length<2&&(a="0"+a),this.isIntercalaryMonth(n,i)&&(a+="i"),a},monthNames:function(e){if(typeof e=="string"){var t=e.match(Ktr);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),i=this.toChineseMonth(r,n),a=["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"][i-1];return this.isIntercalaryMonth(r,n)&&(a="\u95F0"+a),a},monthNamesShort:function(e){if(typeof e=="string"){var t=e.match(Jtr);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),i=this.toChineseMonth(r,n),a=["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"][i-1];return this.isIntercalaryMonth(r,n)&&(a="\u95F0"+a),a},parseMonth:function(e,t){e=this._validateYear(e);var r=parseInt(t),n;if(isNaN(r))t[0]==="\u95F0"&&(n=!0,t=t.substring(1)),t[t.length-1]==="\u6708"&&(t=t.substring(0,t.length-1)),r=1+["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"].indexOf(t);else{var i=t[t.length-1];n=i==="i"||i==="I"}var a=this.toMonthIndex(e,r,n);return a},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(e,t){if(e.year&&(e=e.year()),typeof e!="number"||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var n=this.intercalaryMonth(e),i=r&&t!==n;if(i||t<1||t>12)throw jx.local.invalidMonth.replace(/\{0\}/,this.local.name);var a;return n?!r&&t<=n?a=t-1:a=t:a=t-1,a},toChineseMonth:function(e,t){e.year&&(e=e.year(),t=e.month());var r=this.intercalaryMonth(e),n=r?12:11;if(t<0||t>n)throw jx.local.invalidMonth.replace(/\{0\}/,this.local.name);var i;return r?t<r?i=t+1:i=t:i=t+1,i},intercalaryMonth:function(e){e=this._validateYear(e);var t=Wx[e-Wx[0]],r=t>>13;return r},isIntercalaryMonth:function(e,t){e.year&&(e=e.year(),t=e.month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return this.intercalaryMonth(e)!==0},weekOfYear:function(e,t,r){var n=this._validateYear(e,jx.local.invalidyear),i=Xx[n-Xx[0]],a=i>>9&4095,o=i>>5&15,s=i&31,l;l=xQ.newDate(a,o,s),l.add(4-(l.dayOfWeek()||7),"d");var u=this.toJD(e,t,r)-l.toJD();return 1+Math.floor(u/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=Wx[e-Wx[0]],n=r>>13,i=n?12:11;if(t>i)throw jx.local.invalidMonth.replace(/\{0\}/,this.local.name);var a=r&1<<12-t?30:29;return a},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var n=this._validate(e,a,r,jx.local.invalidDate);e=this._validateYear(n.year()),t=n.month(),r=n.day();var i=this.isIntercalaryMonth(e,t),a=this.toChineseMonth(e,t),o=Qtr(e,a,r,i);return xQ.toJD(o.year,o.month,o.day)},fromJD:function(e){var t=xQ.fromJD(e),r=$tr(t.year(),t.month(),t.day()),n=this.toMonthIndex(r.year,r.month,r.isIntercalary);return this.newDate(r.year,n,r.day)},fromString:function(e){var t=e.match(Ztr),r=this._validateYear(+t[1]),n=+t[2],i=!!t[3],a=this.toMonthIndex(r,n,i),o=+t[4];return this.newDate(r,a,o)},add:function(e,t,r){var n=e.year(),i=e.month(),a=this.isIntercalaryMonth(n,i),o=this.toChineseMonth(n,i),s=Object.getPrototypeOf(q9.prototype).add.call(this,e,t,r);if(r==="y"){var l=s.year(),u=s.month(),c=this.isIntercalaryMonth(l,o),f=a&&c?this.toMonthIndex(l,o,!0):this.toMonthIndex(l,o,!1);f!==u&&s.month(f)}return s}});var Ztr=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,Ytr=/^\d?\d[iI]?/m,Ktr=/^闰?十?[一二三四五六七八九]?月/m,Jtr=/^闰?十?[一二三四五六七八九]?/m;jx.calendars.chinese=q9;var Wx=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],Xx=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function $tr(e,t,r,n){var i,a;if(typeof e=="object")i=e,a=t||{};else{var o=typeof e=="number"&&e>=1888&&e<=2111;if(!o)throw new Error("Solar year outside range 1888-2111");var s=typeof t=="number"&&t>=1&&t<=12;if(!s)throw new Error("Solar month outside range 1 - 12");var l=typeof r=="number"&&r>=1&&r<=31;if(!l)throw new Error("Solar day outside range 1 - 31");i={year:e,month:t,day:r},a=n||{}}var u=Xx[i.year-Xx[0]],c=i.year<<9|i.month<<5|i.day;a.year=c>=u?i.year:i.year-1,u=Xx[a.year-Xx[0]];var f=u>>9&4095,h=u>>5&15,d=u&31,v,m=new Date(f,h-1,d),b=new Date(i.year,i.month-1,i.day);v=Math.round((b-m)/(24*3600*1e3));var p=Wx[a.year-Wx[0]],k;for(k=0;k<13;k++){var M=p&1<<12-k?30:29;if(v<M)break;v-=M}var T=p>>13;return!T||k<T?(a.isIntercalary=!1,a.month=1+k):k===T?(a.isIntercalary=!0,a.month=k):(a.isIntercalary=!1,a.month=k),a.day=1+v,a}function Qtr(e,t,r,n,i){var a,o;if(typeof e=="object")o=e,a=t||{};else{var s=typeof e=="number"&&e>=1888&&e<=2111;if(!s)throw new Error("Lunar year outside range 1888-2111");var l=typeof t=="number"&&t>=1&&t<=12;if(!l)throw new Error("Lunar month outside range 1 - 12");var u=typeof r=="number"&&r>=1&&r<=30;if(!u)throw new Error("Lunar day outside range 1 - 30");var c;typeof n=="object"?(c=!1,a=n):(c=!!n,a=i||{}),o={year:e,month:t,day:r,isIntercalary:c}}var f;f=o.day-1;var h=Wx[o.year-Wx[0]],d=h>>13,v;d&&(o.month>d||o.isIntercalary)?v=o.month:v=o.month-1;for(var m=0;m<v;m++){var b=h&1<<12-m?30:29;f+=b}var p=Xx[o.year-Xx[0]],k=p>>9&4095,M=p>>5&15,T=p&31,L=new Date(k,M-1,T+f);return a.year=L.getFullYear(),a.month=1+L.getMonth(),a.day=L.getDate(),a}});var set=ye(()=>{var Iw=kv(),err=Nh();function bQ(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}bQ.prototype=new Iw.baseCalendar;err(bQ.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(r){var t=this._validate(r,this.minMonth,this.minDay,Iw.local.invalidYear),r=t.year()+(t.year()<0?1:0);return r%4===3||r%4===-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,Iw.local.invalidYear||Iw.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,Iw.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===13&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var n=this._validate(e,t,r,Iw.local.invalidDate);return e=n.year(),e<0&&e++,n.day()+(n.month()-1)*30+(e-1)*365+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,i=t-(n-1)*30+1;return this.newDate(r,n,i)}});Iw.calendars.coptic=bQ});var uet=ye(()=>{var E1=kv(),trr=Nh();function wQ(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}wQ.prototype=new E1.baseCalendar;trr(wQ.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,E1.local.invalidYear),!1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,E1.local.invalidYear),13},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,E1.local.invalidYear),400},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,E1.local.invalidMonth);return this.daysPerMonth[r.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,E1.local.invalidDate);return(n.day()+1)%8},weekDay:function(e,t,r){var n=this.dayOfWeek(e,t,r);return n>=2&&n<=6},extraInfo:function(e,t,r){var n=this._validate(e,t,r,E1.local.invalidDate);return{century:rrr[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(e,t,r){var n=this._validate(e,t,r,E1.local.invalidDate);return e=n.year()+(n.year()<0?1:0),t=n.month(),r=n.day(),r+(t>1?16:0)+(t>2?(t-2)*32:0)+(e-1)*400+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=(t-1)*400,e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-(r-1)*32+1;return this.newDate(t<=0?t-1:t,r,n)}});var rrr={20:"Fruitbat",21:"Anchovy"};E1.calendars.discworld=wQ});var cet=ye(()=>{var Rw=kv(),irr=Nh();function TQ(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}TQ.prototype=new Rw.baseCalendar;irr(TQ.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(r){var t=this._validate(r,this.minMonth,this.minDay,Rw.local.invalidYear),r=t.year()+(t.year()<0?1:0);return r%4===3||r%4===-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,Rw.local.invalidYear||Rw.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,Rw.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===13&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var n=this._validate(e,t,r,Rw.local.invalidDate);return e=n.year(),e<0&&e++,n.day()+(n.month()-1)*30+(e-1)*365+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,i=t-(n-1)*30+1;return this.newDate(r,n,i)}});Rw.calendars.ethiopian=TQ});var fet=ye(()=>{var Zx=kv(),nrr=Nh();function AQ(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}AQ.prototype=new Zx.baseCalendar;nrr(AQ.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,Zx.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return e=e<0?e+1:e,O9(e*7+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,Zx.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,Zx.local.invalidYear);return e=t.year(),this.toJD(e===-1?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,Zx.local.invalidMonth),t===12&&this.leapYear(e)||t===8&&O9(this.daysInYear(e),10)===5?30:t===9&&O9(this.daysInYear(e),10)===3?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return this.dayOfWeek(e,t,r)!==6},extraInfo:function(e,t,r){var n=this._validate(e,t,r,Zx.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(e,t,r){var n=this._validate(e,t,r,Zx.local.invalidDate);e=n.year(),t=n.month(),r=n.day();var i=e<=0?e+1:e,a=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var o=7;o<=this.monthsInYear(e);o++)a+=this.daysInMonth(e,o);for(var o=1;o<t;o++)a+=this.daysInMonth(e,o)}else for(var o=7;o<t;o++)a+=this.daysInMonth(e,o);return a},_delay1:function(e){var t=Math.floor((235*e-234)/19),r=12084+13753*t,n=t*29+Math.floor(r/25920);return O9(3*(n+1),7)<3&&n++,n},_delay2:function(e){var t=this._delay1(e-1),r=this._delay1(e),n=this._delay1(e+1);return n-r===356?2:r-t===382?1:0},fromJD:function(e){e=Math.floor(e)+.5;for(var t=Math.floor((e-this.jdEpoch)*98496/35975351)-1;e>=this.toJD(t===-1?1:t+1,7,1);)t++;for(var r=e<this.toJD(t,1,1)?7:1;e>this.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}});function O9(e,t){return e-t*Math.floor(e/t)}Zx.calendars.hebrew=AQ});var het=ye(()=>{var wC=kv(),arr=Nh();function SQ(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}SQ.prototype=new wC.baseCalendar;arr(SQ.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012Bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,wC.local.invalidYear);return(t.year()*11+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,wC.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===12&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return this.dayOfWeek(e,t,r)!==5},toJD:function(e,t,r){var n=this._validate(e,t,r,wC.local.invalidDate);return e=n.year(),t=n.month(),r=n.day(),e=e<=0?e+1:e,r+Math.ceil(29.5*(t-1))+(e-1)*354+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}});wC.calendars.islamic=SQ});var det=ye(()=>{var TC=kv(),orr=Nh();function MQ(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}MQ.prototype=new TC.baseCalendar;orr(MQ.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(r){var t=this._validate(r,this.minMonth,this.minDay,TC.local.invalidYear),r=t.year()<0?t.year()+1:t.year();return r%4===0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,TC.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===2&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var n=this._validate(e,t,r,TC.local.invalidDate);return e=n.year(),t=n.month(),r=n.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5),r=t+1524,n=Math.floor((r-122.1)/365.25),i=Math.floor(365.25*n),a=Math.floor((r-i)/30.6001),o=a-Math.floor(a<14?1:13),s=n-Math.floor(o>2?4716:4715),l=r-i-Math.floor(30.6001*a);return s<=0&&s--,this.newDate(s,o,l)}});TC.calendars.julian=MQ});var pet=ye(()=>{var fg=kv(),srr=Nh();function kQ(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}kQ.prototype=new fg.baseCalendar;srr(kQ.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,fg.local.invalidYear),!1},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,fg.local.invalidYear);e=t.year();var r=Math.floor(e/400);e=e%400,e+=e<0?400:0;var n=Math.floor(e/20);return r+"."+n+"."+e%20},forYear:function(e){if(e=e.split("."),e.length<3)throw"Invalid Mayan year";for(var t=0,r=0;r<e.length;r++){var n=parseInt(e[r],10);if(Math.abs(n)>19||r>0&&n<0)throw"Invalid Mayan year";t=t*20+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,fg.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,fg.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,fg.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,fg.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,fg.local.invalidDate);return n.day()},weekDay:function(e,t,r){return this._validate(e,t,r,fg.local.invalidDate),!0},extraInfo:function(e,t,r){var n=this._validate(e,t,r,fg.local.invalidDate),i=n.toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){e-=this.jdEpoch;var t=EQ(e+8+17*20,365);return[Math.floor(t/20)+1,EQ(t,20)]},_toTzolkin:function(e){return e-=this.jdEpoch,[vet(e+20,20),vet(e+4,13)]},toJD:function(e,t,r){var n=this._validate(e,t,r,fg.local.invalidDate);return n.day()+n.month()*20+n.year()*360+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e=e%360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}});function EQ(e,t){return e-t*Math.floor(e/t)}function vet(e,t){return EQ(e-1,t)+1}fg.calendars.mayan=kQ});var met=ye(()=>{var Dw=kv(),lrr=Nh();function CQ(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}CQ.prototype=new Dw.baseCalendar;var get=Dw.instance("gregorian");lrr(CQ.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,Dw.local.invalidYear||Dw.regionalOptions[""].invalidYear);return get.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,Dw.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===12&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(i,t,r){var n=this._validate(i,t,r,Dw.local.invalidMonth),i=n.year();i<0&&i++;for(var a=n.day(),o=1;o<n.month();o++)a+=this.daysPerMonth[o-1];return a+get.toJD(i+1468,3,13)},fromJD:function(e){e=Math.floor(e+.5);for(var t=Math.floor((e-(this.jdEpoch-1))/366);e>=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}});Dw.calendars.nanakshahi=CQ});var yet=ye(()=>{var Fw=kv(),urr=Nh();function LQ(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}LQ.prototype=new Fw.baseCalendar;urr(LQ.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,Fw.local.invalidYear);if(e=t.year(),typeof this.NEPALI_CALENDAR_DATA[e]=="undefined")return this.daysPerYear;for(var r=0,n=this.minMonth;n<=12;n++)r+=this.NEPALI_CALENDAR_DATA[e][n];return r},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,Fw.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[e]=="undefined"?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return this.dayOfWeek(e,t,r)!==6},toJD:function(e,t,r){var n=this._validate(e,t,r,Fw.local.invalidDate);e=n.year(),t=n.month(),r=n.day();var i=Fw.instance(),a=0,o=t,s=e;this._createMissingCalendarData(e);var l=e-(o>9||o===9&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(t!==9&&(a=r,o--);o!==9;)o<=0&&(o=12,s--),a+=this.NEPALI_CALENDAR_DATA[s][o],o--;return t===9?(a+=r-this.NEPALI_CALENDAR_DATA[s][0],a<0&&(a+=i.daysInYear(l))):a+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(l,1,1).add(a,"d").toJD()},fromJD:function(e){var t=Fw.instance(),r=t.fromJD(e),n=r.year(),i=r.dayOfYear(),a=n+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)o++,o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var u=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,u)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r<e+2;r++)typeof this.NEPALI_CALENDAR_DATA[r]=="undefined"&&(this.NEPALI_CALENDAR_DATA[r]=t)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}});Fw.calendars.nepali=LQ});var _et=ye(()=>{var sS=kv(),crr=Nh();function N9(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function B9(e){var t=e-475;e<0&&t++;var r=.242197,n=r*t,i=r*(t+1),a=n-Math.floor(n),o=i-Math.floor(i);return a>o}N9.prototype=new sS.baseCalendar;crr(N9.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chah\u0101rshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,sS.local.invalidYear);return B9(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-((n.dayOfWeek()+1)%7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,sS.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===12&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return this.dayOfWeek(e,t,r)!==5},toJD:function(e,t,r){var n=this._validate(e,t,r,sS.local.invalidDate);e=n.year(),t=n.month(),r=n.day();var i=0;if(e>0)for(var a=1;a<e;a++)B9(a)&&i++;else if(e<0)for(var a=e;a<0;a++)B9(a)&&i--;return r+(t<=7?(t-1)*31:(t-1)*30+6)+(e>0?e-1:e)*365+i+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=475+(e-this.toJD(475,1,1))/365.242197,r=Math.floor(t);r<=0&&r--,e>this.toJD(r,12,B9(r)?30:29)&&(r++,r===0&&r++);var n=e-this.toJD(r,1,1)+1,i=n<=186?Math.ceil(n/31):Math.ceil((n-6)/30),a=e-this.toJD(r,i,1)+1;return this.newDate(r,i,a)}});sS.calendars.persian=N9;sS.calendars.jalali=N9});var xet=ye(()=>{var zw=kv(),frr=Nh(),U9=zw.instance();function PQ(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}PQ.prototype=new zw.baseCalendar;frr(PQ.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(r){var t=this._validate(r,this.minMonth,this.minDay,zw.local.invalidYear),r=this._t2gYear(t.year());return U9.leapYear(r)},weekOfYear:function(i,t,r){var n=this._validate(i,this.minMonth,this.minDay,zw.local.invalidYear),i=this._t2gYear(n.year());return U9.weekOfYear(i,n.month(),n.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,zw.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===2&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(i,t,r){var n=this._validate(i,t,r,zw.local.invalidDate),i=this._t2gYear(n.year());return U9.toJD(i,n.month(),n.day())},fromJD:function(e){var t=U9.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}});zw.calendars.taiwan=PQ});var bet=ye(()=>{var qw=kv(),hrr=Nh(),V9=qw.instance();function IQ(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}IQ.prototype=new qw.baseCalendar;hrr(IQ.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(r){var t=this._validate(r,this.minMonth,this.minDay,qw.local.invalidYear),r=this._t2gYear(t.year());return V9.leapYear(r)},weekOfYear:function(i,t,r){var n=this._validate(i,this.minMonth,this.minDay,qw.local.invalidYear),i=this._t2gYear(n.year());return V9.weekOfYear(i,n.month(),n.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,qw.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(r.month()===2&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(i,t,r){var n=this._validate(i,t,r,qw.local.invalidDate),i=this._t2gYear(n.year());return V9.toJD(i,n.month(),n.day())},fromJD:function(e){var t=V9.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}});qw.calendars.thai=IQ});var wet=ye(()=>{var Ow=kv(),drr=Nh();function RQ(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}RQ.prototype=new Ow.baseCalendar;drr(RQ.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012Bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,Ow.local.invalidYear);return this.daysInYear(t.year())===355},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,Ow.local.invalidMonth),n=r.toJD()-24e5+.5,i=0,a=0;a<Yx.length;a++){if(Yx[a]>n)return Yx[i]-Yx[i-1];i++}return 30},weekDay:function(e,t,r){return this.dayOfWeek(e,t,r)!==5},toJD:function(e,t,r){var n=this._validate(e,t,r,Ow.local.invalidDate),i=12*(n.year()-1)+n.month()-15292,a=n.day()+Yx[i-1]-1;return a+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;n<Yx.length&&!(Yx[n]>t);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),o=a+1,s=i-12*a,l=t-Yx[r-1]+1;return this.newDate(o,s,l)},isValid:function(e,t,r){var n=Ow.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(e=e.year!=null?e.year:e,n=e>=1276&&e<=1500),n},_validate:function(e,t,r,n){var i=Ow.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw n.replace(/\{0\}/,this.local.name);return i}});Ow.calendars.ummalqura=RQ;var Yx=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]});var Aet=ye((STr,Tet)=>{"use strict";Tet.exports=kv();aet();oet();set();uet();cet();fet();het();det();pet();met();yet();_et();xet();bet();wet()});var Iet=ye((MTr,Pet)=>{"use strict";var Eet=Aet(),AC=Pr(),ket=fs(),vrr=ket.EPOCHJD,prr=ket.ONEDAY,zQ={valType:"enumerated",values:AC.sortObjectKeys(Eet.calendars),editType:"calc",dflt:"gregorian"},Cet=function(e,t,r,n){var i={};return i[r]=zQ,AC.coerce(e,t,i,r,n)},grr=function(e,t,r,n){for(var i=0;i<r.length;i++)Cet(e,t,r[i]+"calendar",n.calendar)},mrr={chinese:"2000-01-01",coptic:"2000-01-01",discworld:"2000-01-01",ethiopian:"2000-01-01",hebrew:"5000-01-01",islamic:"1000-01-01",julian:"2000-01-01",mayan:"5000-01-01",nanakshahi:"1000-01-01",nepali:"2000-01-01",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-01",thai:"2000-01-01",ummalqura:"1400-01-01"},yrr={chinese:"2000-01-02",coptic:"2000-01-03",discworld:"2000-01-03",ethiopian:"2000-01-05",hebrew:"5000-01-01",islamic:"1000-01-02",julian:"2000-01-03",mayan:"5000-01-01",nanakshahi:"1000-01-05",nepali:"2000-01-05",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-04",thai:"2000-01-04",ummalqura:"1400-01-06"},_rr={chinese:["2000-01-01","2001-01-01"],coptic:["1700-01-01","1701-01-01"],discworld:["1800-01-01","1801-01-01"],ethiopian:["2000-01-01","2001-01-01"],hebrew:["5700-01-01","5701-01-01"],islamic:["1400-01-01","1401-01-01"],julian:["2000-01-01","2001-01-01"],mayan:["5200-01-01","5201-01-01"],nanakshahi:["0500-01-01","0501-01-01"],nepali:["2000-01-01","2001-01-01"],persian:["1400-01-01","1401-01-01"],jalali:["1400-01-01","1401-01-01"],taiwan:["0100-01-01","0101-01-01"],thai:["2500-01-01","2501-01-01"],ummalqura:["1400-01-01","1401-01-01"]},G9="##",xrr={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:G9,w:G9,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}};function brr(e,t,r){for(var n=Math.floor((t+.05)/prr)+vrr,i=Let(r).fromJD(n),a=0,o,s,l,u,c;(a=e.indexOf("%",a))!==-1;)o=e.charAt(a+1),o==="0"||o==="-"||o==="_"?(l=3,s=e.charAt(a+2),o==="_"&&(o="-")):(s=o,o="0",l=2),u=xrr[s],u?(u===G9?c=G9:c=i.formatDate(u[o]),e=e.slice(0,a)+c+e.slice(a+l),a+=c.length):a+=l;return e}var Met={};function Let(e){var t=Met[e];return t||(t=Met[e]=Eet.instance(e),t)}function SC(e){return AC.extendFlat({},zQ,{description:e})}function qQ(e){return"Sets the calendar system to use with `"+e+"` date data."}var FQ={xcalendar:SC(qQ("x"))},fy=AC.extendFlat({},FQ,{ycalendar:SC(qQ("y"))}),DQ=AC.extendFlat({},fy,{zcalendar:SC(qQ("z"))}),lS=SC(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" "));Pet.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:fy,bar:fy,box:fy,heatmap:fy,contour:fy,histogram:fy,histogram2d:fy,histogram2dcontour:fy,scatter3d:DQ,surface:DQ,mesh3d:DQ,scattergl:fy,ohlc:FQ,candlestick:FQ},layout:{calendar:SC(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:lS},yaxis:{calendar:lS},scene:{xaxis:{calendar:lS},yaxis:{calendar:lS},zaxis:{calendar:lS}},polar:{radialaxis:{calendar:lS}}}},layoutAttributes:zQ,handleDefaults:Cet,handleTraceDefaults:grr,CANONICAL_SUNDAY:yrr,CANONICAL_TICK:mrr,DFLTRANGE:_rr,getCal:Let,worldCalFmt:brr}});var Det=ye((ETr,Ret)=>{"use strict";Ret.exports=Iet()});var wrr=ye((kTr,zet)=>{var Fet=fye();Fet.register([d1e(),e_e(),vxe(),Fxe(),Yxe(),jbe(),n2e(),W2e(),bwe(),i3e(),H3e(),rke(),jke(),z6e(),ALe(),tPe(),SPe(),KIe(),p8e(),R8e(),j8e(),aRe(),xRe(),zRe(),dFe(),RFe(),KBe(),KNe(),oVe(),IVe(),VGe(),iHe(),EHe(),Bje(),eWe(),AWe(),RXe(),iZe(),OZe(),oKe(),PKe(),$Ke(),AJe(),OJe(),q$e(),rQe(),bQe(),ret(),Det()]);zet.exports=Fet});return wrr();})();
3804/*!
3805 * The buffer module from node.js, for the browser.
3806 *

Callers 1

renderLayerMethod · 0.45

Calls 2

filterMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected