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

Method get

js/lib/mimeExtension.js:3789–3789  ·  view source on GitHub ↗
(Se)

Source from the content-addressed store, hash-verified

3787`}),staticAttributes:xe,staticUniforms:ht}}class Xt{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(P,ae,xe,Te,Oe,ht,Tt,Ot,Qt){this.context=P;let Ar=this.boundPaintVertexBuffers.length!==Te.length;for(let Sr=0;!Ar&&Sr<Te.length;Sr++)this.boundPaintVertexBuffers[Sr]!==Te[Sr]&&(Ar=!0);!this.vao||this.boundProgram!==ae||this.boundLayoutVertexBuffer!==xe||Ar||this.boundIndexBuffer!==Oe||this.boundVertexOffset!==ht||this.boundDynamicVertexBuffer!==Tt||this.boundDynamicVertexBuffer2!==Ot||this.boundDynamicVertexBuffer3!==Qt?this.freshBind(ae,xe,Te,Oe,ht,Tt,Ot,Qt):(P.bindVertexArray.set(this.vao),Tt&&Tt.bind(),Oe&&Oe.dynamicDraw&&Oe.bind(),Ot&&Ot.bind(),Qt&&Qt.bind())}freshBind(P,ae,xe,Te,Oe,ht,Tt,Ot){let Qt=P.numAttributes,Ar=this.context,Sr=Ar.gl;this.vao&&this.destroy(),this.vao=Ar.createVertexArray(),Ar.bindVertexArray.set(this.vao),this.boundProgram=P,this.boundLayoutVertexBuffer=ae,this.boundPaintVertexBuffers=xe,this.boundIndexBuffer=Te,this.boundVertexOffset=Oe,this.boundDynamicVertexBuffer=ht,this.boundDynamicVertexBuffer2=Tt,this.boundDynamicVertexBuffer3=Ot,ae.enableAttributes(Sr,P);for(let Kr of xe)Kr.enableAttributes(Sr,P);ht&&ht.enableAttributes(Sr,P),Tt&&Tt.enableAttributes(Sr,P),Ot&&Ot.enableAttributes(Sr,P),ae.bind(),ae.setVertexAttribPointers(Sr,P,Oe);for(let Kr of xe)Kr.bind(),Kr.setVertexAttribPointers(Sr,P,Oe);ht&&(ht.bind(),ht.setVertexAttribPointers(Sr,P,Oe)),Te&&Te.bind(),Tt&&(Tt.bind(),Tt.setVertexAttribPointers(Sr,P,Oe)),Ot&&(Ot.bind(),Ot.setVertexAttribPointers(Sr,P,Oe)),Ar.currentNumAttributes=Qt}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let mr=(Ue,P,ae,xe,Te)=>({u_matrix:Ue,u_texture:0,u_ele_delta:P,u_fog_matrix:ae,u_fog_color:xe?xe.properties.get("fog-color"):t.aM.white,u_fog_ground_blend:xe?xe.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:xe?xe.calculateFogBlendOpacity(Te):0,u_horizon_color:xe?xe.properties.get("horizon-color"):t.aM.white,u_horizon_fog_blend:xe?xe.properties.get("horizon-fog-blend"):1});function Or(Ue){let P=[];for(let ae=0;ae<Ue.length;ae++){if(Ue[ae]===null)continue;let xe=Ue[ae].split(" ");P.push(xe.pop())}return P}class ki{constructor(P,ae,xe,Te,Oe,ht){let Tt=P.gl;this.program=Tt.createProgram();let Ot=Or(ae.staticAttributes),Qt=xe?xe.getBinderAttributes():[],Ar=Ot.concat(Qt),Sr=Wr.prelude.staticUniforms?Or(Wr.prelude.staticUniforms):[],Kr=ae.staticUniforms?Or(ae.staticUniforms):[],oi=xe?xe.getBinderUniforms():[],Ge=Sr.concat(Kr).concat(oi),Ze=[];for(let _r of Ge)Ze.indexOf(_r)<0&&Ze.push(_r);let ot=xe?xe.defines():[];Oe&&ot.push("#define OVERDRAW_INSPECTOR;"),ht&&ot.push("#define TERRAIN3D;");let dt=ot.concat(Wr.prelude.fragmentSource,ae.fragmentSource).join(`
3788`),Ct=ot.concat(Wr.prelude.vertexSource,ae.vertexSource).join(`
3789`),wt=Tt.createShader(Tt.FRAGMENT_SHADER);if(Tt.isContextLost())return void(this.failedToCreate=!0);if(Tt.shaderSource(wt,dt),Tt.compileShader(wt),!Tt.getShaderParameter(wt,Tt.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${Tt.getShaderInfoLog(wt)}`);Tt.attachShader(this.program,wt);let Dt=Tt.createShader(Tt.VERTEX_SHADER);if(Tt.isContextLost())return void(this.failedToCreate=!0);if(Tt.shaderSource(Dt,Ct),Tt.compileShader(Dt),!Tt.getShaderParameter(Dt,Tt.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${Tt.getShaderInfoLog(Dt)}`);Tt.attachShader(this.program,Dt),this.attributes={};let fr={};this.numAttributes=Ar.length;for(let _r=0;_r<this.numAttributes;_r++)Ar[_r]&&(Tt.bindAttribLocation(this.program,_r,Ar[_r]),this.attributes[Ar[_r]]=_r);if(Tt.linkProgram(this.program),!Tt.getProgramParameter(this.program,Tt.LINK_STATUS))throw new Error(`Program failed to link: ${Tt.getProgramInfoLog(this.program)}`);Tt.deleteShader(Dt),Tt.deleteShader(wt);for(let _r=0;_r<Ze.length;_r++){let kr=Ze[_r];if(kr&&!fr[kr]){let Vr=Tt.getUniformLocation(this.program,kr);Vr&&(fr[kr]=Vr)}}this.fixedUniforms=Te(P,fr),this.terrainUniforms=((_r,kr)=>({u_depth:new t.aH(_r,kr.u_depth),u_terrain:new t.aH(_r,kr.u_terrain),u_terrain_dim:new t.aI(_r,kr.u_terrain_dim),u_terrain_matrix:new t.aJ(_r,kr.u_terrain_matrix),u_terrain_unpack:new t.aK(_r,kr.u_terrain_unpack),u_terrain_exaggeration:new t.aI(_r,kr.u_terrain_exaggeration)}))(P,fr),this.binderUniforms=xe?xe.getUniforms(P,fr):[]}draw(P,ae,xe,Te,Oe,ht,Tt,Ot,Qt,Ar,Sr,Kr,oi,Ge,Ze,ot,dt,Ct){let wt=P.gl;if(this.failedToCreate)return;if(P.program.set(this.program),P.setDepthMode(xe),P.setStencilMode(Te),P.setColorMode(Oe),P.setCullFace(ht),Ot){P.activeTexture.set(wt.TEXTURE2),wt.bindTexture(wt.TEXTURE_2D,Ot.depthTexture),P.activeTexture.set(wt.TEXTURE3),wt.bindTexture(wt.TEXTURE_2D,Ot.texture);for(let fr in this.terrainUniforms)this.terrainUniforms[fr].set(Ot[fr])}for(let fr in this.fixedUniforms)this.fixedUniforms[fr].set(Tt[fr]);Ze&&Ze.setUniforms(P,this.binderUniforms,oi,{zoom:Ge});let Dt=0;switch(ae){case wt.LINES:Dt=2;break;case wt.TRIANGLES:Dt=3;break;case wt.LINE_STRIP:Dt=1}for(let fr of Kr.get()){let _r=fr.vaos||(fr.vaos={});(_r[Qt]||(_r[Qt]=new Xt)).bind(P,this,Ar,Ze?Ze.getPaintVertexBuffers():[],Sr,fr.vertexOffset,ot,dt,Ct),wt.drawElements(ae,fr.primitiveLength*Dt,wt.UNSIGNED_SHORT,fr.primitiveOffset*Dt*2)}}}function Ni(Ue,P,ae){let xe=1/Vi(ae,1,P.transform.tileZoom),Te=Math.pow(2,ae.tileID.overscaledZ),Oe=ae.tileSize*Math.pow(2,P.transform.tileZoom)/Te,ht=Oe*(ae.tileID.canonical.x+ae.tileID.wrap*Te),Tt=Oe*ae.tileID.canonical.y;return{u_image:0,u_texsize:ae.imageAtlasTexture.size,u_scale:[xe,Ue.fromScale,Ue.toScale],u_fade:Ue.t,u_pixel_coord_upper:[ht>>16,Tt>>16],u_pixel_coord_lower:[65535&ht,65535&Tt]}}let Si=(Ue,P,ae,xe)=>{let Te=P.style.light,Oe=Te.properties.get("position"),ht=[Oe.x,Oe.y,Oe.z],Tt=function(){var Qt=new t.A(9);return t.A!=Float32Array&&(Qt[1]=0,Qt[2]=0,Qt[3]=0,Qt[5]=0,Qt[6]=0,Qt[7]=0),Qt[0]=1,Qt[4]=1,Qt[8]=1,Qt}();Te.properties.get("anchor")==="viewport"&&function(Qt,Ar){var Sr=Math.sin(Ar),Kr=Math.cos(Ar);Qt[0]=Kr,Qt[1]=Sr,Qt[2]=0,Qt[3]=-Sr,Qt[4]=Kr,Qt[5]=0,Qt[6]=0,Qt[7]=0,Qt[8]=1}(Tt,-P.transform.angle),function(Qt,Ar,Sr){var Kr=Ar[0],oi=Ar[1],Ge=Ar[2];Qt[0]=Kr*Sr[0]+oi*Sr[3]+Ge*Sr[6],Qt[1]=Kr*Sr[1]+oi*Sr[4]+Ge*Sr[7],Qt[2]=Kr*Sr[2]+oi*Sr[5]+Ge*Sr[8]}(ht,ht,Tt);let Ot=Te.properties.get("color");return{u_matrix:Ue,u_lightpos:ht,u_lightintensity:Te.properties.get("intensity"),u_lightcolor:[Ot.r,Ot.g,Ot.b],u_vertical_gradient:+ae,u_opacity:xe}},fi=(Ue,P,ae,xe,Te,Oe,ht)=>t.e(Si(Ue,P,ae,xe),Ni(Oe,P,ht),{u_height_factor:-Math.pow(2,Te.overscaledZ)/ht.tileSize/8}),Li=Ue=>({u_matrix:Ue}),Ia=(Ue,P,ae,xe)=>t.e(Li(Ue),Ni(ae,P,xe)),Fa=(Ue,P)=>({u_matrix:Ue,u_world:P}),un=(Ue,P,ae,xe,Te)=>t.e(Ia(Ue,P,ae,xe),{u_world:Te}),Bn=(Ue,P,ae,xe)=>{let Te=Ue.transform,Oe,ht;if(xe.paint.get("circle-pitch-alignment")==="map"){let Tt=Vi(ae,1,Te.zoom);Oe=!0,ht=[Tt,Tt]}else Oe=!1,ht=Te.pixelsToGLUnits;return{u_camera_to_center_distance:Te.cameraToCenterDistance,u_scale_with_map:+(xe.paint.get("circle-pitch-scale")==="map"),u_matrix:Ue.translatePosMatrix(P.posMatrix,ae,xe.paint.get("circle-translate"),xe.paint.get("circle-translate-anchor")),u_pitch_with_map:+Oe,u_device_pixel_ratio:Ue.pixelRatio,u_extrude_scale:ht}},Kn=(Ue,P,ae)=>({u_matrix:Ue,u_inv_matrix:P,u_camera_to_center_distance:ae.cameraToCenterDistance,u_viewport_size:[ae.width,ae.height]}),Gn=(Ue,P,ae=1)=>({u_matrix:Ue,u_color:P,u_overlay:0,u_overlay_scale:ae}),eo=Ue=>({u_matrix:Ue}),Ao=(Ue,P,ae,xe)=>({u_matrix:Ue,u_extrude_scale:Vi(P,1,ae),u_intensity:xe}),An=(Ue,P,ae,xe)=>{let Te=t.H();t.aP(Te,0,Ue.width,Ue.height,0,0,1);let Oe=Ue.context.gl;return{u_matrix:Te,u_world:[Oe.drawingBufferWidth,Oe.drawingBufferHeight],u_image:ae,u_color_ramp:xe,u_opacity:P.paint.get("heatmap-opacity")}};function Eo(Ue,P){let ae=Math.pow(2,P.canonical.z),xe=P.canonical.y;return[new t.Z(0,xe/ae).toLngLat().lat,new t.Z(0,(xe+1)/ae).toLngLat().lat]}let fs=(Ue,P,ae,xe)=>{let Te=Ue.transform;return{u_matrix:xs(Ue,P,ae,xe),u_ratio:1/Vi(P,1,Te.zoom),u_device_pixel_ratio:Ue.pixelRatio,u_units_to_pixels:[1/Te.pixelsToGLUnits[0],1/Te.pixelsToGLUnits[1]]}},Ls=(Ue,P,ae,xe,Te)=>t.e(fs(Ue,P,ae,Te),{u_image:0,u_image_height:xe}),ns=(Ue,P,ae,xe,Te)=>{let Oe=Ue.transform,ht=ss(P,Oe);return{u_matrix:xs(Ue,P,ae,Te),u_texsize:P.imageAtlasTexture.size,u_ratio:1/Vi(P,1,Oe.zoom),u_device_pixel_ratio:Ue.pixelRatio,u_image:0,u_scale:[ht,xe.fromScale,xe.toScale],u_fade:xe.t,u_units_to_pixels:[1/Oe.pixelsToGLUnits[0],1/Oe.pixelsToGLUnits[1]]}},uo=(Ue,P,ae,xe,Te,Oe)=>{let ht=Ue.lineAtlas,Tt=ss(P,Ue.transform),Ot=ae.layout.get("line-cap")==="round",Qt=ht.getDash(xe.from,Ot),Ar=ht.getDash(xe.to,Ot),Sr=Qt.width*Te.fromScale,Kr=Ar.width*Te.toScale;return t.e(fs(Ue,P,ae,Oe),{u_patternscale_a:[Tt/Sr,-Qt.height/2],u_patternscale_b:[Tt/Kr,-Ar.height/2],u_sdfgamma:ht.width/(256*Math.min(Sr,Kr)*Ue.pixelRatio)/2,u_image:0,u_tex_y_a:Qt.y,u_tex_y_b:Ar.y,u_mix:Te.t})};function ss(Ue,P){return 1/Vi(Ue,1,P.tileZoom)}function xs(Ue,P,ae,xe){return Ue.translatePosMatrix(xe?xe.posMatrix:P.tileID.posMatrix,P,ae.paint.get("line-translate"),ae.paint.get("line-translate-anchor"))}let el=(Ue,P,ae,xe,Te)=>{return{u_matrix:Ue,u_tl_parent:P,u_scale_parent:ae,u_buffer_scale:1,u_fade_t:xe.mix,u_opacity:xe.opacity*Te.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Te.paint.get("raster-brightness-min"),u_brightness_high:Te.paint.get("raster-brightness-max"),u_saturation_factor:(ht=Te.paint.get("raster-saturation"),ht>0?1-1/(1.001-ht):-ht),u_contrast_factor:(Oe=Te.paint.get("raster-contrast"),Oe>0?1/(1-Oe):1+Oe),u_spin_weights:Ss(Te.paint.get("raster-hue-rotate"))};var Oe,ht};function Ss(Ue){Ue*=Math.PI/180;let P=Math.sin(Ue),ae=Math.cos(Ue);return[(2*ae+1)/3,(-Math.sqrt(3)*P-ae+1)/3,(Math.sqrt(3)*P-ae+1)/3]}let Co=(Ue,P,ae,xe,Te,Oe,ht,Tt,Ot,Qt,Ar,Sr,Kr,oi)=>{let Ge=ht.transform;return{u_is_size_zoom_constant:+(Ue==="constant"||Ue==="source"),u_is_size_feature_constant:+(Ue==="constant"||Ue==="camera"),u_size_t:P?P.uSizeT:0,u_size:P?P.uSize:0,u_camera_to_center_distance:Ge.cameraToCenterDistance,u_pitch:Ge.pitch/360*2*Math.PI,u_rotate_symbol:+ae,u_aspect_ratio:Ge.width/Ge.height,u_fade_change:ht.options.fadeDuration?ht.symbolFadeChange:1,u_matrix:Tt,u_label_plane_matrix:Ot,u_coord_matrix:Qt,u_is_text:+Sr,u_pitch_with_map:+xe,u_is_along_line:Te,u_is_variable_anchor:Oe,u_texsize:Kr,u_texture:0,u_translation:Ar,u_pitched_scale:oi}},ao=(Ue,P,ae,xe,Te,Oe,ht,Tt,Ot,Qt,Ar,Sr,Kr,oi,Ge)=>{let Ze=ht.transform;return t.e(Co(Ue,P,ae,xe,Te,Oe,ht,Tt,Ot,Qt,Ar,Sr,Kr,Ge),{u_gamma_scale:xe?Math.cos(Ze._pitch)*Ze.cameraToCenterDistance:1,u_device_pixel_ratio:ht.pixelRatio,u_is_halo:+oi})},co=(Ue,P,ae,xe,Te,Oe,ht,Tt,Ot,Qt,Ar,Sr,Kr,oi)=>t.e(ao(Ue,P,ae,xe,Te,Oe,ht,Tt,Ot,Qt,Ar,!0,Sr,!0,oi),{u_texsize_icon:Kr,u_texture_icon:1}),Ms=(Ue,P,ae)=>({u_matrix:Ue,u_opacity:P,u_color:ae}),Gs=(Ue,P,ae,xe,Te,Oe)=>t.e(function(ht,Tt,Ot,Qt){let Ar=Ot.imageManager.getPattern(ht.from.toString()),Sr=Ot.imageManager.getPattern(ht.to.toString()),{width:Kr,height:oi}=Ot.imageManager.getPixelSize(),Ge=Math.pow(2,Qt.tileID.overscaledZ),Ze=Qt.tileSize*Math.pow(2,Ot.transform.tileZoom)/Ge,ot=Ze*(Qt.tileID.canonical.x+Qt.tileID.wrap*Ge),dt=Ze*Qt.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Ar.tl,u_pattern_br_a:Ar.br,u_pattern_tl_b:Sr.tl,u_pattern_br_b:Sr.br,u_texsize:[Kr,oi],u_mix:Tt.t,u_pattern_size_a:Ar.displaySize,u_pattern_size_b:Sr.displaySize,u_scale_a:Tt.fromScale,u_scale_b:Tt.toScale,u_tile_units_to_pixels:1/Vi(Qt,1,Ot.transform.tileZoom),u_pixel_coord_upper:[ot>>16,dt>>16],u_pixel_coord_lower:[65535&ot,65535&dt]}}(xe,Oe,ae,Te),{u_matrix:Ue,u_opacity:P}),ul={fillExtrusion:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_lightpos:new t.aN(Ue,P.u_lightpos),u_lightintensity:new t.aI(Ue,P.u_lightintensity),u_lightcolor:new t.aN(Ue,P.u_lightcolor),u_vertical_gradient:new t.aI(Ue,P.u_vertical_gradient),u_opacity:new t.aI(Ue,P.u_opacity)}),fillExtrusionPattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_lightpos:new t.aN(Ue,P.u_lightpos),u_lightintensity:new t.aI(Ue,P.u_lightintensity),u_lightcolor:new t.aN(Ue,P.u_lightcolor),u_vertical_gradient:new t.aI(Ue,P.u_vertical_gradient),u_height_factor:new t.aI(Ue,P.u_height_factor),u_image:new t.aH(Ue,P.u_image),u_texsize:new t.aO(Ue,P.u_texsize),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade),u_opacity:new t.aI(Ue,P.u_opacity)}),fill:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix)}),fillPattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_image:new t.aH(Ue,P.u_image),u_texsize:new t.aO(Ue,P.u_texsize),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade)}),fillOutline:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_world:new t.aO(Ue,P.u_world)}),fillOutlinePattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_world:new t.aO(Ue,P.u_world),u_image:new t.aH(Ue,P.u_image),u_texsize:new t.aO(Ue,P.u_texsize),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade)}),circle:(Ue,P)=>({u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_scale_with_map:new t.aH(Ue,P.u_scale_with_map),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_extrude_scale:new t.aO(Ue,P.u_extrude_scale),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_matrix:new t.aJ(Ue,P.u_matrix)}),collisionBox:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_pixel_extrude_scale:new t.aO(Ue,P.u_pixel_extrude_scale)}),collisionCircle:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_inv_matrix:new t.aJ(Ue,P.u_inv_matrix),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_viewport_size:new t.aO(Ue,P.u_viewport_size)}),debug:(Ue,P)=>({u_color:new t.aL(Ue,P.u_color),u_matrix:new t.aJ(Ue,P.u_matrix),u_overlay:new t.aH(Ue,P.u_overlay),u_overlay_scale:new t.aI(Ue,P.u_overlay_scale)}),clippingMask:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix)}),heatmap:(Ue,P)=>({u_extrude_scale:new t.aI(Ue,P.u_extrude_scale),u_intensity:new t.aI(Ue,P.u_intensity),u_matrix:new t.aJ(Ue,P.u_matrix)}),heatmapTexture:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_world:new t.aO(Ue,P.u_world),u_image:new t.aH(Ue,P.u_image),u_color_ramp:new t.aH(Ue,P.u_color_ramp),u_opacity:new t.aI(Ue,P.u_opacity)}),hillshade:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_image:new t.aH(Ue,P.u_image),u_latrange:new t.aO(Ue,P.u_latrange),u_light:new t.aO(Ue,P.u_light),u_shadow:new t.aL(Ue,P.u_shadow),u_highlight:new t.aL(Ue,P.u_highlight),u_accent:new t.aL(Ue,P.u_accent)}),hillshadePrepare:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_image:new t.aH(Ue,P.u_image),u_dimension:new t.aO(Ue,P.u_dimension),u_zoom:new t.aI(Ue,P.u_zoom),u_unpack:new t.aK(Ue,P.u_unpack)}),line:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels)}),lineGradient:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels),u_image:new t.aH(Ue,P.u_image),u_image_height:new t.aI(Ue,P.u_image_height)}),linePattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_texsize:new t.aO(Ue,P.u_texsize),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_image:new t.aH(Ue,P.u_image),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade)}),lineSDF:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels),u_patternscale_a:new t.aO(Ue,P.u_patternscale_a),u_patternscale_b:new t.aO(Ue,P.u_patternscale_b),u_sdfgamma:new t.aI(Ue,P.u_sdfgamma),u_image:new t.aH(Ue,P.u_image),u_tex_y_a:new t.aI(Ue,P.u_tex_y_a),u_tex_y_b:new t.aI(Ue,P.u_tex_y_b),u_mix:new t.aI(Ue,P.u_mix)}),raster:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_tl_parent:new t.aO(Ue,P.u_tl_parent),u_scale_parent:new t.aI(Ue,P.u_scale_parent),u_buffer_scale:new t.aI(Ue,P.u_buffer_scale),u_fade_t:new t.aI(Ue,P.u_fade_t),u_opacity:new t.aI(Ue,P.u_opacity),u_image0:new t.aH(Ue,P.u_image0),u_image1:new t.aH(Ue,P.u_image1),u_brightness_low:new t.aI(Ue,P.u_brightness_low),u_brightness_high:new t.aI(Ue,P.u_brightness_high),u_saturation_factor:new t.aI(Ue,P.u_saturation_factor),u_contrast_factor:new t.aI(Ue,P.u_contrast_factor),u_spin_weights:new t.aN(Ue,P.u_spin_weights)}),symbolIcon:(Ue,P)=>({u_is_size_zoom_constant:new t.aH(Ue,P.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Ue,P.u_is_size_feature_constant),u_size_t:new t.aI(Ue,P.u_size_t),u_size:new t.aI(Ue,P.u_size),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_pitch:new t.aI(Ue,P.u_pitch),u_rotate_symbol:new t.aH(Ue,P.u_rotate_symbol),u_aspect_ratio:new t.aI(Ue,P.u_aspect_ratio),u_fade_change:new t.aI(Ue,P.u_fade_change),u_matrix:new t.aJ(Ue,P.u_matrix),u_label_plane_matrix:new t.aJ(Ue,P.u_label_plane_matrix),u_coord_matrix:new t.aJ(Ue,P.u_coord_matrix),u_is_text:new t.aH(Ue,P.u_is_text),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_is_along_line:new t.aH(Ue,P.u_is_along_line),u_is_variable_anchor:new t.aH(Ue,P.u_is_variable_anchor),u_texsize:new t.aO(Ue,P.u_texsize),u_texture:new t.aH(Ue,P.u_texture),u_translation:new t.aO(Ue,P.u_translation),u_pitched_scale:new t.aI(Ue,P.u_pitched_scale)}),symbolSDF:(Ue,P)=>({u_is_size_zoom_constant:new t.aH(Ue,P.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Ue,P.u_is_size_feature_constant),u_size_t:new t.aI(Ue,P.u_size_t),u_size:new t.aI(Ue,P.u_size),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_pitch:new t.aI(Ue,P.u_pitch),u_rotate_symbol:new t.aH(Ue,P.u_rotate_symbol),u_aspect_ratio:new t.aI(Ue,P.u_aspect_ratio),u_fade_change:new t.aI(Ue,P.u_fade_change),u_matrix:new t.aJ(Ue,P.u_matrix),u_label_plane_matrix:new t.aJ(Ue,P.u_label_plane_matrix),u_coord_matrix:new t.aJ(Ue,P.u_coord_matrix),u_is_text:new t.aH(Ue,P.u_is_text),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_is_along_line:new t.aH(Ue,P.u_is_along_line),u_is_variable_anchor:new t.aH(Ue,P.u_is_variable_anchor),u_texsize:new t.aO(Ue,P.u_texsize),u_texture:new t.aH(Ue,P.u_texture),u_gamma_scale:new t.aI(Ue,P.u_gamma_scale),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_is_halo:new t.aH(Ue,P.u_is_halo),u_translation:new t.aO(Ue,P.u_translation),u_pitched_scale:new t.aI(Ue,P.u_pitched_scale)}),symbolTextAndIcon:(Ue,P)=>({u_is_size_zoom_constant:new t.aH(Ue,P.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Ue,P.u_is_size_feature_constant),u_size_t:new t.aI(Ue,P.u_size_t),u_size:new t.aI(Ue,P.u_size),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_pitch:new t.aI(Ue,P.u_pitch),u_rotate_symbol:new t.aH(Ue,P.u_rotate_symbol),u_aspect_ratio:new t.aI(Ue,P.u_aspect_ratio),u_fade_change:new t.aI(Ue,P.u_fade_change),u_matrix:new t.aJ(Ue,P.u_matrix),u_label_plane_matrix:new t.aJ(Ue,P.u_label_plane_matrix),u_coord_matrix:new t.aJ(Ue,P.u_coord_matrix),u_is_text:new t.aH(Ue,P.u_is_text),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_is_along_line:new t.aH(Ue,P.u_is_along_line),u_is_variable_anchor:new t.aH(Ue,P.u_is_variable_anchor),u_texsize:new t.aO(Ue,P.u_texsize),u_texsize_icon:new t.aO(Ue,P.u_texsize_icon),u_texture:new t.aH(Ue,P.u_texture),u_texture_icon:new t.aH(Ue,P.u_texture_icon),u_gamma_scale:new t.aI(Ue,P.u_gamma_scale),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_is_halo:new t.aH(Ue,P.u_is_halo),u_translation:new t.aO(Ue,P.u_translation),u_pitched_scale:new t.aI(Ue,P.u_pitched_scale)}),background:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_opacity:new t.aI(Ue,P.u_opacity),u_color:new t.aL(Ue,P.u_color)}),backgroundPattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_opacity:new t.aI(Ue,P.u_opacity),u_image:new t.aH(Ue,P.u_image),u_pattern_tl_a:new t.aO(Ue,P.u_pattern_tl_a),u_pattern_br_a:new t.aO(Ue,P.u_pattern_br_a),u_pattern_tl_b:new t.aO(Ue,P.u_pattern_tl_b),u_pattern_br_b:new t.aO(Ue,P.u_pattern_br_b),u_texsize:new t.aO(Ue,P.u_texsize),u_mix:new t.aI(Ue,P.u_mix),u_pattern_size_a:new t.aO(Ue,P.u_pattern_size_a),u_pattern_size_b:new t.aO(Ue,P.u_pattern_size_b),u_scale_a:new t.aI(Ue,P.u_scale_a),u_scale_b:new t.aI(Ue,P.u_scale_b),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(Ue,P.u_tile_units_to_pixels)}),terrain:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_texture:new t.aH(Ue,P.u_texture),u_ele_delta:new t.aI(Ue,P.u_ele_delta),u_fog_matrix:new t.aJ(Ue,P.u_fog_matrix),u_fog_color:new t.aL(Ue,P.u_fog_color),u_fog_ground_blend:new t.aI(Ue,P.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(Ue,P.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(Ue,P.u_horizon_color),u_horizon_fog_blend:new t.aI(Ue,P.u_horizon_fog_blend)}),terrainDepth:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ele_delta:new t.aI(Ue,P.u_ele_delta)}),terrainCoords:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_texture:new t.aH(Ue,P.u_texture),u_terrain_coords_id:new t.aI(Ue,P.u_terrain_coords_id),u_ele_delta:new t.aI(Ue,P.u_ele_delta)}),sky:(Ue,P)=>({u_sky_color:new t.aL(Ue,P.u_sky_color),u_horizon_color:new t.aL(Ue,P.u_horizon_color),u_horizon:new t.aI(Ue,P.u_horizon),u_sky_horizon_blend:new t.aI(Ue,P.u_sky_horizon_blend)})};class hs{constructor(P,ae,xe){this.context=P;let Te=P.gl;this.buffer=Te.createBuffer(),this.dynamicDraw=!!xe,this.context.unbindVAO(),P.bindElementBuffer.set(this.buffer),Te.bufferData(Te.ELEMENT_ARRAY_BUFFER,ae.arrayBuffer,this.dynamicDraw?Te.DYNAMIC_DRAW:Te.STATIC_DRAW),this.dynamicDraw||delete ae.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(P){let ae=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),ae.bufferSubData(ae.ELEMENT_ARRAY_BUFFER,0,P.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 Xn{constructor(P,ae,xe,Te){this.length=ae.length,this.attributes=xe,this.itemSize=ae.bytesPerElement,this.dynamicDraw=Te,this.context=P;let Oe=P.gl;this.buffer=Oe.createBuffer(),P.bindVertexBuffer.set(this.buffer),Oe.bufferData(Oe.ARRAY_BUFFER,ae.arrayBuffer,this.dynamicDraw?Oe.DYNAMIC_DRAW:Oe.STATIC_DRAW),this.dynamicDraw||delete ae.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(P){if(P.length!==this.length)throw new Error(`Length of new data is ${P.length}, which doesn't match current length of ${this.length}`);let ae=this.context.gl;this.bind(),ae.bufferSubData(ae.ARRAY_BUFFER,0,P.arrayBuffer)}enableAttributes(P,ae){for(let xe=0;xe<this.attributes.length;xe++){let Te=ae.attributes[this.attributes[xe].name];Te!==void 0&&P.enableVertexAttribArray(Te)}}setVertexAttribPointers(P,ae,xe){for(let Te=0;Te<this.attributes.length;Te++){let Oe=this.attributes[Te],ht=ae.attributes[Oe.name];ht!==void 0&&P.vertexAttribPointer(ht,Oe.components,P[rn[Oe.type]],!1,this.itemSize,Oe.offset+this.itemSize*(xe||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let tl=new WeakMap;function zs(Ue){var P;if(tl.has(Ue))return tl.get(Ue);{let ae=(P=Ue.getParameter(Ue.VERSION))===null||P===void 0?void 0:P.startsWith("WebGL 2.0");return tl.set(Ue,ae),ae}}class so{constructor(P){this.gl=P.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(P){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class $s extends so{getDefault(){return t.aM.transparent}set(P){let ae=this.current;(P.r!==ae.r||P.g!==ae.g||P.b!==ae.b||P.a!==ae.a||this.dirty)&&(this.gl.clearColor(P.r,P.g,P.b,P.a),this.current=P,this.dirty=!1)}}class Ps extends so{getDefault(){return 1}set(P){(P!==this.current||this.dirty)&&(this.gl.clearDepth(P),this.current=P,this.dirty=!1)}}class nl extends so{getDefault(){return 0}set(P){(P!==this.current||this.dirty)&&(this.gl.clearStencil(P),this.current=P,this.dirty=!1)}}class yl extends so{getDefault(){return[!0,!0,!0,!0]}set(P){let ae=this.current;(P[0]!==ae[0]||P[1]!==ae[1]||P[2]!==ae[2]||P[3]!==ae[3]||this.dirty)&&(this.gl.colorMask(P[0],P[1],P[2],P[3]),this.current=P,this.dirty=!1)}}class On extends so{getDefault(){return!0}set(P){(P!==this.current||this.dirty)&&(this.gl.depthMask(P),this.current=P,this.dirty=!1)}}class Ko extends so{getDefault(){return 255}set(P){(P!==this.current||this.dirty)&&(this.gl.stencilMask(P),this.current=P,this.dirty=!1)}}class jo extends so{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(P){let ae=this.current;(P.func!==ae.func||P.ref!==ae.ref||P.mask!==ae.mask||this.dirty)&&(this.gl.stencilFunc(P.func,P.ref,P.mask),this.current=P,this.dirty=!1)}}class Ys extends so{getDefault(){let P=this.gl;return[P.KEEP,P.KEEP,P.KEEP]}set(P){let ae=this.current;(P[0]!==ae[0]||P[1]!==ae[1]||P[2]!==ae[2]||this.dirty)&&(this.gl.stencilOp(P[0],P[1],P[2]),this.current=P,this.dirty=!1)}}class Tu extends so{getDefault(){return!1}set(P){if(P===this.current&&!this.dirty)return;let ae=this.gl;P?ae.enable(ae.STENCIL_TEST):ae.disable(ae.STENCIL_TEST),this.current=P,this.dirty=!1}}class Lo extends so{getDefault(){return[0,1]}set(P){let ae=this.current;(P[0]!==ae[0]||P[1]!==ae[1]||this.dirty)&&(this.gl.depthRange(P[0],P[1]),this.current=P,this.dirty=!1)}}class al extends so{getDefault(){return!1}set(P){if(P===this.current&&!this.dirty)return;let ae=this.gl;P?ae.enable(ae.DEPTH_TEST):ae.disable(ae.DEPTH_TEST),this.current=P,this.dirty=!1}}class kl extends so{getDefault(){return this.gl.LESS}set(P){(P!==this.current||this.dirty)&&(this.gl.depthFunc(P),this.current=P,this.dirty=!1)}}class Ns extends so{getDefault(){return!1}set(P){if(P===this.current&&!this.dirty)return;let ae=this.gl;P?ae.enable(ae.BLEND):ae.disable(ae.BLEND),this.current=P,this.dirty=!1}}class rl extends so{getDefault(){let P=this.gl;return[P.ONE,P.ZERO]}set(P){let ae=this.current;(P[0]!==ae[0]||P[1]!==ae[1]||this.dirty)&&(this.gl.blendFunc(P[0],P[1]),this.current=P,this.dirty=!1)}}class Es extends so{getDefault(){return t.aM.transparent}set(P){let ae=this.current;(P.r!==ae.r||P.g!==ae.g||P.b!==ae.b||P.a!==ae.a||this.dirty)&&(this.gl.blendColor(P.r,P.g,P.b,P.a),this.current=P,this.dirty=!1)}}class Us extends so{getDefault(){return this.gl.FUNC_ADD}set(P){(P!==this.current||this.dirty)&&(this.gl.blendEquation(P),this.current=P,this.dirty=!1)}}class Zl extends so{getDefault(){return!1}set(P){if(P===this.current&&!this.dirty)return;let ae=this.gl;P?ae.enable(ae.CULL_FACE):ae.disable(ae.CULL_FACE),this.current=P,this.dirty=!1}}class pu extends so{getDefault(){return this.gl.BACK}set(P){(P!==this.current||this.dirty)&&(this.gl.cullFace(P),this.current=P,this.dirty=!1)}}class kc extends so{getDefault(){return this.gl.CCW}set(P){(P!==this.current||this.dirty)&&(this.gl.frontFace(P),this.current=P,this.dirty=!1)}}class Au extends so{getDefault(){return null}set(P){(P!==this.current||this.dirty)&&(this.gl.useProgram(P),this.current=P,this.dirty=!1)}}class Sf extends so{getDefault(){return this.gl.TEXTURE0}set(P){(P!==this.current||this.dirty)&&(this.gl.activeTexture(P),this.current=P,this.dirty=!1)}}class Gc extends so{getDefault(){let P=this.gl;return[0,0,P.drawingBufferWidth,P.drawingBufferHeight]}set(P){let ae=this.current;(P[0]!==ae[0]||P[1]!==ae[1]||P[2]!==ae[2]||P[3]!==ae[3]||this.dirty)&&(this.gl.viewport(P[0],P[1],P[2],P[3]),this.current=P,this.dirty=!1)}}class Js extends so{getDefault(){return null}set(P){if(P===this.current&&!this.dirty)return;let ae=this.gl;ae.bindFramebuffer(ae.FRAMEBUFFER,P),this.current=P,this.dirty=!1}}class yc extends so{getDefault(){return null}set(P){if(P===this.current&&!this.dirty)return;let ae=this.gl;ae.bindRenderbuffer(ae.RENDERBUFFER,P),this.current=P,this.dirty=!1}}class Zc extends so{getDefault(){return null}set(P){if(P===this.current&&!this.dirty)return;let ae=this.gl;ae.bindTexture(ae.TEXTURE_2D,P),this.current=P,this.dirty=!1}}class mu extends so{getDefault(){return null}set(P){if(P===this.current&&!this.dirty)return;let ae=this.gl;ae.bindBuffer(ae.ARRAY_BUFFER,P),this.current=P,this.dirty=!1}}class Vl extends so{getDefault(){return null}set(P){let ae=this.gl;ae.bindBuffer(ae.ELEMENT_ARRAY_BUFFER,P),this.current=P,this.dirty=!1}}class lc extends so{getDefault(){return null}set(P){var ae;if(P===this.current&&!this.dirty)return;let xe=this.gl;zs(xe)?xe.bindVertexArray(P):(ae=xe.getExtension("OES_vertex_array_object"))===null||ae===void 0||ae.bindVertexArrayOES(P),this.current=P,this.dirty=!1}}class Gu extends so{getDefault(){return 4}set(P){if(P===this.current&&!this.dirty)return;let ae=this.gl;ae.pixelStorei(ae.UNPACK_ALIGNMENT,P),this.current=P,this.dirty=!1}}class _l extends so{getDefault(){return!1}set(P){if(P===this.current&&!this.dirty)return;let ae=this.gl;ae.pixelStorei(ae.UNPACK_PREMULTIPLY_ALPHA_WEBGL,P),this.current=P,this.dirty=!1}}class Cl extends so{getDefault(){return!1}set(P){if(P===this.current&&!this.dirty)return;let ae=this.gl;ae.pixelStorei(ae.UNPACK_FLIP_Y_WEBGL,P),this.current=P,this.dirty=!1}}class Fs extends so{constructor(P,ae){super(P),this.context=P,this.parent=ae}getDefault(){return null}}class ol extends Fs{setDirty(){this.dirty=!0}set(P){if(P===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let ae=this.gl;ae.framebufferTexture2D(ae.FRAMEBUFFER,ae.COLOR_ATTACHMENT0,ae.TEXTURE_2D,P,0),this.current=P,this.dirty=!1}}class uc extends Fs{set(P){if(P===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let ae=this.gl;ae.framebufferRenderbuffer(ae.FRAMEBUFFER,ae.DEPTH_ATTACHMENT,ae.RENDERBUFFER,P),this.current=P,this.dirty=!1}}class Kl extends Fs{set(P){if(P===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let ae=this.gl;ae.framebufferRenderbuffer(ae.FRAMEBUFFER,ae.DEPTH_STENCIL_ATTACHMENT,ae.RENDERBUFFER,P),this.current=P,this.dirty=!1}}class Zu{constructor(P,ae,xe,Te,Oe){this.context=P,this.width=ae,this.height=xe;let ht=P.gl,Tt=this.framebuffer=ht.createFramebuffer();if(this.colorAttachment=new ol(P,Tt),Te)this.depthAttachment=Oe?new Kl(P,Tt):new uc(P,Tt);else if(Oe)throw new Error("Stencil cannot be set without depth");if(ht.checkFramebufferStatus(ht.FRAMEBUFFER)!==ht.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){let P=this.context.gl,ae=this.colorAttachment.get();if(ae&&P.deleteTexture(ae),this.depthAttachment){let xe=this.depthAttachment.get();xe&&P.deleteRenderbuffer(xe)}P.deleteFramebuffer(this.framebuffer)}}class Sl{constructor(P,ae,xe){this.blendFunction=P,this.blendColor=ae,this.mask=xe}}Sl.Replace=[1,0],Sl.disabled=new Sl(Sl.Replace,t.aM.transparent,[!1,!1,!1,!1]),Sl.unblended=new Sl(Sl.Replace,t.aM.transparent,[!0,!0,!0,!0]),Sl.alphaBlended=new Sl([1,771],t.aM.transparent,[!0,!0,!0,!0]);class vh{constructor(P){var ae,xe;if(this.gl=P,this.clearColor=new $s(this),this.clearDepth=new Ps(this),this.clearStencil=new nl(this),this.colorMask=new yl(this),this.depthMask=new On(this),this.stencilMask=new Ko(this),this.stencilFunc=new jo(this),this.stencilOp=new Ys(this),this.stencilTest=new Tu(this),this.depthRange=new Lo(this),this.depthTest=new al(this),this.depthFunc=new kl(this),this.blend=new Ns(this),this.blendFunc=new rl(this),this.blendColor=new Es(this),this.blendEquation=new Us(this),this.cullFace=new Zl(this),this.cullFaceSide=new pu(this),this.frontFace=new kc(this),this.program=new Au(this),this.activeTexture=new Sf(this),this.viewport=new Gc(this),this.bindFramebuffer=new Js(this),this.bindRenderbuffer=new yc(this),this.bindTexture=new Zc(this),this.bindVertexBuffer=new mu(this),this.bindElementBuffer=new Vl(this),this.bindVertexArray=new lc(this),this.pixelStoreUnpack=new Gu(this),this.pixelStoreUnpackPremultiplyAlpha=new _l(this),this.pixelStoreUnpackFlipY=new Cl(this),this.extTextureFilterAnisotropic=P.getExtension("EXT_texture_filter_anisotropic")||P.getExtension("MOZ_EXT_texture_filter_anisotropic")||P.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=P.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=P.getParameter(P.MAX_TEXTURE_SIZE),zs(P)){this.HALF_FLOAT=P.HALF_FLOAT;let Te=P.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(ae=P.RGBA16F)!==null&&ae!==void 0?ae:Te?.RGBA16F_EXT,this.RGB16F=(xe=P.RGB16F)!==null&&xe!==void 0?xe:Te?.RGB16F_EXT,P.getExtension("EXT_color_buffer_float")}else{P.getExtension("EXT_color_buffer_half_float"),P.getExtension("OES_texture_half_float_linear");let Te=P.getExtension("OES_texture_half_float");this.HALF_FLOAT=Te?.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(P,ae){return new hs(this,P,ae)}createVertexBuffer(P,ae,xe){return new Xn(this,P,ae,xe)}createRenderbuffer(P,ae,xe){let Te=this.gl,Oe=Te.createRenderbuffer();return this.bindRenderbuffer.set(Oe),Te.renderbufferStorage(Te.RENDERBUFFER,P,ae,xe),this.bindRenderbuffer.set(null),Oe}createFramebuffer(P,ae,xe,Te){return new Zu(this,P,ae,xe,Te)}clear({color:P,depth:ae,stencil:xe}){let Te=this.gl,Oe=0;P&&(Oe|=Te.COLOR_BUFFER_BIT,this.clearColor.set(P),this.colorMask.set([!0,!0,!0,!0])),ae!==void 0&&(Oe|=Te.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(ae),this.depthMask.set(!0)),xe!==void 0&&(Oe|=Te.STENCIL_BUFFER_BIT,this.clearStencil.set(xe),this.stencilMask.set(255)),Te.clear(Oe)}setCullFace(P){P.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(P.mode),this.frontFace.set(P.frontFace))}setDepthMode(P){P.func!==this.gl.ALWAYS||P.mask?(this.depthTest.set(!0),this.depthFunc.set(P.func),this.depthMask.set(P.mask),this.depthRange.set(P.range)):this.depthTest.set(!1)}setStencilMode(P){P.test.func!==this.gl.ALWAYS||P.mask?(this.stencilTest.set(!0),this.stencilMask.set(P.mask),this.stencilOp.set([P.fail,P.depthFail,P.pass]),this.stencilFunc.set({func:P.test.func,ref:P.ref,mask:P.test.mask})):this.stencilTest.set(!1)}setColorMode(P){t.aE(P.blendFunction,Sl.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(P.blendFunction),this.blendColor.set(P.blendColor)),this.colorMask.set(P.mask)}createVertexArray(){var P;return zs(this.gl)?this.gl.createVertexArray():(P=this.gl.getExtension("OES_vertex_array_object"))===null||P===void 0?void 0:P.createVertexArrayOES()}deleteVertexArray(P){var ae;return zs(this.gl)?this.gl.deleteVertexArray(P):(ae=this.gl.getExtension("OES_vertex_array_object"))===null||ae===void 0?void 0:ae.deleteVertexArrayOES(P)}unbindVAO(){this.bindVertexArray.set(null)}}class ws{constructor(P,ae,xe){this.func=P,this.mask=ae,this.range=xe}}ws.ReadOnly=!1,ws.ReadWrite=!0,ws.disabled=new ws(519,ws.ReadOnly,[0,1]);let ph=7680;class qs{constructor(P,ae,xe,Te,Oe,ht){this.test=P,this.ref=ae,this.mask=xe,this.fail=Te,this.depthFail=Oe,this.pass=ht}}qs.disabled=new qs({func:519,mask:0},0,0,ph,ph,ph);class xo{constructor(P,ae,xe){this.enable=P,this.mode=ae,this.frontFace=xe}}let Kc;function Ku(Ue,P,ae,xe,Te){let Oe=Ue.context,ht=Oe.gl,Tt=Ue.useProgram("collisionBox"),Ot=[],Qt=0,Ar=0;for(let dt=0;dt<xe.length;dt++){let Ct=xe[dt],wt=P.getTile(Ct).getBucket(ae);if(!wt)continue;let Dt=Te?wt.textCollisionBox:wt.iconCollisionBox,fr=wt.collisionCircleArray;if(fr.length>0){let _r=t.H();t.aQ(_r,wt.placementInvProjMatrix,Ue.transform.glCoordMatrix),t.aQ(_r,_r,wt.placementViewportMatrix),Ot.push({circleArray:fr,circleOffset:Ar,transform:Ct.posMatrix,invTransform:_r,coord:Ct}),Qt+=fr.length/4,Ar=Qt}Dt&&Tt.draw(Oe,ht.LINES,ws.disabled,qs.disabled,Ue.colorModeForRenderPass(),xo.disabled,{u_matrix:Ct.posMatrix,u_pixel_extrude_scale:[1/(Sr=Ue.transform).width,1/Sr.height]},Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(Ct),ae.id,Dt.layoutVertexBuffer,Dt.indexBuffer,Dt.segments,null,Ue.transform.zoom,null,null,Dt.collisionVertexBuffer)}var Sr;if(!Te||!Ot.length)return;let Kr=Ue.useProgram("collisionCircle"),oi=new t.aR;oi.resize(4*Qt),oi._trim();let Ge=0;for(let dt of Ot)for(let Ct=0;Ct<dt.circleArray.length/4;Ct++){let wt=4*Ct,Dt=dt.circleArray[wt+0],fr=dt.circleArray[wt+1],_r=dt.circleArray[wt+2],kr=dt.circleArray[wt+3];oi.emplace(Ge++,Dt,fr,_r,kr,0),oi.emplace(Ge++,Dt,fr,_r,kr,1),oi.emplace(Ge++,Dt,fr,_r,kr,2),oi.emplace(Ge++,Dt,fr,_r,kr,3)}(!Kc||Kc.length<2*Qt)&&(Kc=function(dt){let Ct=2*dt,wt=new t.aT;wt.resize(Ct),wt._trim();for(let Dt=0;Dt<Ct;Dt++){let fr=6*Dt;wt.uint16[fr+0]=4*Dt+0,wt.uint16[fr+1]=4*Dt+1,wt.uint16[fr+2]=4*Dt+2,wt.uint16[fr+3]=4*Dt+2,wt.uint16[fr+4]=4*Dt+3,wt.uint16[fr+5]=4*Dt+0}return wt}(Qt));let Ze=Oe.createIndexBuffer(Kc,!0),ot=Oe.createVertexBuffer(oi,t.aS.members,!0);for(let dt of Ot){let Ct=Kn(dt.transform,dt.invTransform,Ue.transform);Kr.draw(Oe,ht.TRIANGLES,ws.disabled,qs.disabled,Ue.colorModeForRenderPass(),xo.disabled,Ct,Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(dt.coord),ae.id,ot,Ze,t.a0.simpleSegment(0,2*dt.circleOffset,dt.circleArray.length,dt.circleArray.length/2),null,Ue.transform.zoom,null,null,null)}ot.destroy(),Ze.destroy()}xo.disabled=new xo(!1,1029,2305),xo.backCCW=new xo(!0,1029,2305);let $l=t.an(new Float32Array(16));function Mf(Ue,P,ae,xe,Te,Oe){let{horizontalAlign:ht,verticalAlign:Tt}=t.au(Ue);return new t.P((-(ht-.5)*P/Te+xe[0])*Oe,(-(Tt-.5)*ae/Te+xe[1])*Oe)}function Cc(Ue,P,ae,xe,Te,Oe){let ht=P.tileAnchorPoint.add(new t.P(P.translation[0],P.translation[1]));if(P.pitchWithMap){let Tt=xe.mult(Oe);ae||(Tt=Tt.rotate(-Te));let Ot=ht.add(Tt);return xt(Ot.x,Ot.y,P.labelPlaneMatrix,P.getElevation).point}if(ae){let Tt=ut(P.tileAnchorPoint.x+1,P.tileAnchorPoint.y,P).point.sub(Ue),Ot=Math.atan(Tt.y/Tt.x)+(Tt.x<0?Math.PI:0);return Ue.add(xe.rotate(Ot))}return Ue.add(xe)}function uf(Ue,P,ae,xe,Te,Oe,ht,Tt,Ot,Qt,Ar,Sr,Kr,oi){let Ge=Ue.text.placedSymbolArray,Ze=Ue.text.dynamicLayoutVertexArray,ot=Ue.icon.dynamicLayoutVertexArray,dt={};Ze.clear();for(let Ct=0;Ct<Ge.length;Ct++){let wt=Ge.get(Ct),Dt=wt.hidden||!wt.crossTileID||Ue.allowVerticalPlacement&&!wt.placedOrientation?null:xe[wt.crossTileID];if(Dt){let fr=new t.P(wt.anchorX,wt.anchorY),_r={getElevation:oi,width:Te.width,height:Te.height,labelPlaneMatrix:Oe,lineVertexArray:null,pitchWithMap:ae,projection:Ar,projectionCache:null,tileAnchorPoint:fr,translation:Sr,unwrappedTileID:Kr},kr=ae?xt(fr.x,fr.y,ht,oi):ut(fr.x,fr.y,_r),Vr=Ne(Te.cameraToCenterDistance,kr.signedDistanceFromCamera),Qr=t.ai(Ue.textSizeData,Ot,wt)*Vr/t.ap;ae&&(Qr*=Ue.tilePixelRatio/Tt);let{width:_i,height:Pi,anchor:qi,textOffset:ga,textBoxScale:Qa}=Dt,$a=Mf(qi,_i,Pi,ga,Qa,Qr),yn=Ar.getPitchedTextCorrection(Te,fr.add(new t.P(Sr[0],Sr[1])),Kr),qn=Cc(kr.point,_r,P,$a,Te.angle,yn),po=Ue.allowVerticalPlacement&&wt.placedOrientation===t.ah.vertical?Math.PI/2:0;for(let to=0;to<wt.numGlyphs;to++)t.aj(Ze,qn,po);Qt&&wt.associatedIconIndex>=0&&(dt[wt.associatedIconIndex]={shiftedAnchor:qn,angle:po})}else ir(wt.numGlyphs,Ze)}if(Qt){ot.clear();let Ct=Ue.icon.placedSymbolArray;for(let wt=0;wt<Ct.length;wt++){let Dt=Ct.get(wt);if(Dt.hidden)ir(Dt.numGlyphs,ot);else{let fr=dt[wt];if(fr)for(let _r=0;_r<Dt.numGlyphs;_r++)t.aj(ot,fr.shiftedAnchor,fr.angle);else ir(Dt.numGlyphs,ot)}}Ue.icon.dynamicLayoutVertexBuffer.updateData(ot)}Ue.text.dynamicLayoutVertexBuffer.updateData(Ze)}function su(Ue,P,ae){return ae.iconsInText&&P?"symbolTextAndIcon":Ue?"symbolSDF":"symbolIcon"}function Wf(Ue,P,ae,xe,Te,Oe,ht,Tt,Ot,Qt,Ar,Sr){let Kr=Ue.context,oi=Kr.gl,Ge=Ue.transform,Ze=xa(),ot=Tt==="map",dt=Ot==="map",Ct=Tt!=="viewport"&&ae.layout.get("symbol-placement")!=="point",wt=ot&&!dt&&!Ct,Dt=!dt&&Ct,fr=!ae.layout.get("symbol-sort-key").isConstant(),_r=!1,kr=Ue.depthModeForSublayer(0,ws.ReadOnly),Vr=ae._unevaluatedLayout.hasValue("text-variable-anchor")||ae._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Qr=[],_i=Ze.getCircleRadiusCorrection(Ge);for(let Pi of xe){let qi=P.getTile(Pi),ga=qi.getBucket(ae);if(!ga)continue;let Qa=Te?ga.text:ga.icon;if(!Qa||!Qa.segments.get().length||!Qa.hasVisibleVertices)continue;let $a=Qa.programConfigurations.get(ae.id),yn=Te||ga.sdfIcons,qn=Te?ga.textSizeData:ga.iconSizeData,po=dt||Ge.pitch!==0,to=Ue.useProgram(su(yn,Te,ga),$a),Vo=t.ag(qn,Ge.zoom),bs=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(Pi),Ho,ds,Is,Tl,dl=[0,0],ms=null;if(Te)ds=qi.glyphAtlasTexture,Is=oi.LINEAR,Ho=qi.glyphAtlasTexture.size,ga.iconsInText&&(dl=qi.imageAtlasTexture.size,ms=qi.imageAtlasTexture,Tl=po||Ue.options.rotating||Ue.options.zooming||qn.kind==="composite"||qn.kind==="camera"?oi.LINEAR:oi.NEAREST);else{let At=ae.layout.get("icon-size").constantOr(0)!==1||ga.iconsNeedLinear;ds=qi.imageAtlasTexture,Is=yn||Ue.options.rotating||Ue.options.zooming||At||po?oi.LINEAR:oi.NEAREST,Ho=qi.imageAtlasTexture.size}let gs=Vi(qi,1,Ue.transform.zoom),ql=Dt?Pi.posMatrix:$l,uu=Mr(ql,dt,ot,Ue.transform,gs),Uu=Dr(ql,dt,ot,Ue.transform,gs),Su=Dr(Pi.posMatrix,dt,ot,Ue.transform,gs),Fl=Ze.translatePosition(Ue.transform,qi,Oe,ht),yu=Vr&&ga.hasTextData(),dc=ae.layout.get("icon-text-fit")!=="none"&&yu&&ga.hasIconData();if(Ct){let At=Ue.style.map.terrain?(Ft,xr)=>Ue.style.map.terrain.getElevation(Pi,Ft,xr):null,ar=ae.layout.get("text-rotation-alignment")==="map";be(ga,Pi.posMatrix,Ue,Te,uu,Su,dt,Qt,ar,Ze,Pi.toUnwrapped(),Ge.width,Ge.height,Fl,At)}let Ql=Pi.posMatrix,eu=Te&&Vr||dc,de=Ct||eu?$l:uu,Fe=Uu,Je=yn&&ae.paint.get(Te?"text-halo-width":"icon-halo-width").constantOr(1)!==0,vt;vt=yn?ga.iconsInText?co(qn.kind,Vo,wt,dt,Ct,eu,Ue,Ql,de,Fe,Fl,Ho,dl,_i):ao(qn.kind,Vo,wt,dt,Ct,eu,Ue,Ql,de,Fe,Fl,Te,Ho,!0,_i):Co(qn.kind,Vo,wt,dt,Ct,eu,Ue,Ql,de,Fe,Fl,Te,Ho,_i);let _t={program:to,buffers:Qa,uniformValues:vt,atlasTexture:ds,atlasTextureIcon:ms,atlasInterpolation:Is,atlasInterpolationIcon:Tl,isSDF:yn,hasHalo:Je};if(fr&&ga.canOverlap){_r=!0;let At=Qa.segments.get();for(let ar of At)Qr.push({segments:new t.a0([ar]),sortKey:ar.sortKey,state:_t,terrainData:bs})}else Qr.push({segments:Qa.segments,sortKey:0,state:_t,terrainData:bs})}_r&&Qr.sort((Pi,qi)=>Pi.sortKey-qi.sortKey);for(let Pi of Qr){let qi=Pi.state;if(Kr.activeTexture.set(oi.TEXTURE0),qi.atlasTexture.bind(qi.atlasInterpolation,oi.CLAMP_TO_EDGE),qi.atlasTextureIcon&&(Kr.activeTexture.set(oi.TEXTURE1),qi.atlasTextureIcon&&qi.atlasTextureIcon.bind(qi.atlasInterpolationIcon,oi.CLAMP_TO_EDGE)),qi.isSDF){let ga=qi.uniformValues;qi.hasHalo&&(ga.u_is_halo=1,Rf(qi.buffers,Pi.segments,ae,Ue,qi.program,kr,Ar,Sr,ga,Pi.terrainData)),ga.u_is_halo=0}Rf(qi.buffers,Pi.segments,ae,Ue,qi.program,kr,Ar,Sr,qi.uniformValues,Pi.terrainData)}}function Rf(Ue,P,ae,xe,Te,Oe,ht,Tt,Ot,Qt){let Ar=xe.context;Te.draw(Ar,Ar.gl.TRIANGLES,Oe,ht,Tt,xo.disabled,Ot,Qt,ae.id,Ue.layoutVertexBuffer,Ue.indexBuffer,P,ae.paint,xe.transform.zoom,Ue.programConfigurations.get(ae.id),Ue.dynamicLayoutVertexBuffer,Ue.opacityVertexBuffer)}function cf(Ue,P,ae,xe){let Te=Ue.context,Oe=Te.gl,ht=qs.disabled,Tt=new Sl([Oe.ONE,Oe.ONE],t.aM.transparent,[!0,!0,!0,!0]),Ot=P.getBucket(ae);if(!Ot)return;let Qt=xe.key,Ar=ae.heatmapFbos.get(Qt);Ar||(Ar=Df(Te,P.tileSize,P.tileSize),ae.heatmapFbos.set(Qt,Ar)),Te.bindFramebuffer.set(Ar.framebuffer),Te.viewport.set([0,0,P.tileSize,P.tileSize]),Te.clear({color:t.aM.transparent});let Sr=Ot.programConfigurations.get(ae.id),Kr=Ue.useProgram("heatmap",Sr),oi=Ue.style.map.terrain.getTerrainData(xe);Kr.draw(Te,Oe.TRIANGLES,ws.disabled,ht,Tt,xo.disabled,Ao(xe.posMatrix,P,Ue.transform.zoom,ae.paint.get("heatmap-intensity")),oi,ae.id,Ot.layoutVertexBuffer,Ot.indexBuffer,Ot.segments,ae.paint,Ue.transform.zoom,Sr)}function Wc(Ue,P,ae){let xe=Ue.context,Te=xe.gl;xe.setColorMode(Ue.colorModeForRenderPass());let Oe=zf(xe,P),ht=ae.key,Tt=P.heatmapFbos.get(ht);Tt&&(xe.activeTexture.set(Te.TEXTURE0),Te.bindTexture(Te.TEXTURE_2D,Tt.colorAttachment.get()),xe.activeTexture.set(Te.TEXTURE1),Oe.bind(Te.LINEAR,Te.CLAMP_TO_EDGE),Ue.useProgram("heatmapTexture").draw(xe,Te.TRIANGLES,ws.disabled,qs.disabled,Ue.colorModeForRenderPass(),xo.disabled,An(Ue,P,0,1),null,P.id,Ue.rasterBoundsBuffer,Ue.quadTriangleIndexBuffer,Ue.rasterBoundsSegments,P.paint,Ue.transform.zoom),Tt.destroy(),P.heatmapFbos.delete(ht))}function Df(Ue,P,ae){var xe,Te;let Oe=Ue.gl,ht=Oe.createTexture();Oe.bindTexture(Oe.TEXTURE_2D,ht),Oe.texParameteri(Oe.TEXTURE_2D,Oe.TEXTURE_WRAP_S,Oe.CLAMP_TO_EDGE),Oe.texParameteri(Oe.TEXTURE_2D,Oe.TEXTURE_WRAP_T,Oe.CLAMP_TO_EDGE),Oe.texParameteri(Oe.TEXTURE_2D,Oe.TEXTURE_MIN_FILTER,Oe.LINEAR),Oe.texParameteri(Oe.TEXTURE_2D,Oe.TEXTURE_MAG_FILTER,Oe.LINEAR);let Tt=(xe=Ue.HALF_FLOAT)!==null&&xe!==void 0?xe:Oe.UNSIGNED_BYTE,Ot=(Te=Ue.RGBA16F)!==null&&Te!==void 0?Te:Oe.RGBA;Oe.texImage2D(Oe.TEXTURE_2D,0,Ot,P,ae,0,Oe.RGBA,Tt,null);let Qt=Ue.createFramebuffer(P,ae,!1,!1);return Qt.colorAttachment.set(ht),Qt}function zf(Ue,P){return P.colorRampTexture||(P.colorRampTexture=new u(Ue,P.colorRamp,Ue.gl.RGBA)),P.colorRampTexture}function $u(Ue,P,ae,xe,Te){if(!ae||!xe||!xe.imageAtlas)return;let Oe=xe.imageAtlas.patternPositions,ht=Oe[ae.to.toString()],Tt=Oe[ae.from.toString()];if(!ht&&Tt&&(ht=Tt),!Tt&&ht&&(Tt=ht),!ht||!Tt){let Ot=Te.getPaintProperty(P);ht=Oe[Ot],Tt=Oe[Ot]}ht&&Tt&&Ue.setConstantPatternPositions(ht,Tt)}function Ef(Ue,P,ae,xe,Te,Oe,ht){let Tt=Ue.context.gl,Ot="fill-pattern",Qt=ae.paint.get(Ot),Ar=Qt&&Qt.constantOr(1),Sr=ae.getCrossfadeParameters(),Kr,oi,Ge,Ze,ot;ht?(oi=Ar&&!ae.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Kr=Tt.LINES):(oi=Ar?"fillPattern":"fill",Kr=Tt.TRIANGLES);let dt=Qt.constantOr(null);for(let Ct of xe){let wt=P.getTile(Ct);if(Ar&&!wt.patternsLoaded())continue;let Dt=wt.getBucket(ae);if(!Dt)continue;let fr=Dt.programConfigurations.get(ae.id),_r=Ue.useProgram(oi,fr),kr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(Ct);Ar&&(Ue.context.activeTexture.set(Tt.TEXTURE0),wt.imageAtlasTexture.bind(Tt.LINEAR,Tt.CLAMP_TO_EDGE),fr.updatePaintBuffers(Sr)),$u(fr,Ot,dt,wt,ae);let Vr=kr?Ct:null,Qr=Ue.translatePosMatrix(Vr?Vr.posMatrix:Ct.posMatrix,wt,ae.paint.get("fill-translate"),ae.paint.get("fill-translate-anchor"));if(ht){Ze=Dt.indexBuffer2,ot=Dt.segments2;let _i=[Tt.drawingBufferWidth,Tt.drawingBufferHeight];Ge=oi==="fillOutlinePattern"&&Ar?un(Qr,Ue,Sr,wt,_i):Fa(Qr,_i)}else Ze=Dt.indexBuffer,ot=Dt.segments,Ge=Ar?Ia(Qr,Ue,Sr,wt):Li(Qr);_r.draw(Ue.context,Kr,Te,Ue.stencilModeForClipping(Ct),Oe,xo.disabled,Ge,kr,ae.id,Dt.layoutVertexBuffer,Ze,ot,ae.paint,Ue.transform.zoom,fr)}}function cc(Ue,P,ae,xe,Te,Oe,ht){let Tt=Ue.context,Ot=Tt.gl,Qt="fill-extrusion-pattern",Ar=ae.paint.get(Qt),Sr=Ar.constantOr(1),Kr=ae.getCrossfadeParameters(),oi=ae.paint.get("fill-extrusion-opacity"),Ge=Ar.constantOr(null);for(let Ze of xe){let ot=P.getTile(Ze),dt=ot.getBucket(ae);if(!dt)continue;let Ct=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(Ze),wt=dt.programConfigurations.get(ae.id),Dt=Ue.useProgram(Sr?"fillExtrusionPattern":"fillExtrusion",wt);Sr&&(Ue.context.activeTexture.set(Ot.TEXTURE0),ot.imageAtlasTexture.bind(Ot.LINEAR,Ot.CLAMP_TO_EDGE),wt.updatePaintBuffers(Kr)),$u(wt,Qt,Ge,ot,ae);let fr=Ue.translatePosMatrix(Ze.posMatrix,ot,ae.paint.get("fill-extrusion-translate"),ae.paint.get("fill-extrusion-translate-anchor")),_r=ae.paint.get("fill-extrusion-vertical-gradient"),kr=Sr?fi(fr,Ue,_r,oi,Ze,Kr,ot):Si(fr,Ue,_r,oi);Dt.draw(Tt,Tt.gl.TRIANGLES,Te,Oe,ht,xo.backCCW,kr,Ct,ae.id,dt.layoutVertexBuffer,dt.indexBuffer,dt.segments,ae.paint,Ue.transform.zoom,wt,Ue.style.map.terrain&&dt.centroidVertexBuffer)}}function $c(Ue,P,ae,xe,Te,Oe,ht){let Tt=Ue.context,Ot=Tt.gl,Qt=ae.fbo;if(!Qt)return;let Ar=Ue.useProgram("hillshade"),Sr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(P);Tt.activeTexture.set(Ot.TEXTURE0),Ot.bindTexture(Ot.TEXTURE_2D,Qt.colorAttachment.get()),Ar.draw(Tt,Ot.TRIANGLES,Te,Oe,ht,xo.disabled,((Kr,oi,Ge,Ze)=>{let ot=Ge.paint.get("hillshade-shadow-color"),dt=Ge.paint.get("hillshade-highlight-color"),Ct=Ge.paint.get("hillshade-accent-color"),wt=Ge.paint.get("hillshade-illumination-direction")*(Math.PI/180);Ge.paint.get("hillshade-illumination-anchor")==="viewport"&&(wt-=Kr.transform.angle);let Dt=!Kr.options.moving;return{u_matrix:Ze?Ze.posMatrix:Kr.transform.calculatePosMatrix(oi.tileID.toUnwrapped(),Dt),u_image:0,u_latrange:Eo(0,oi.tileID),u_light:[Ge.paint.get("hillshade-exaggeration"),wt],u_shadow:ot,u_highlight:dt,u_accent:Ct}})(Ue,ae,xe,Sr?P:null),Sr,xe.id,Ue.rasterBoundsBuffer,Ue.quadTriangleIndexBuffer,Ue.rasterBoundsSegments)}function lu(Ue,P,ae,xe,Te,Oe){let ht=Ue.context,Tt=ht.gl,Ot=P.dem;if(Ot&&Ot.data){let Qt=Ot.dim,Ar=Ot.stride,Sr=Ot.getPixels();if(ht.activeTexture.set(Tt.TEXTURE1),ht.pixelStoreUnpackPremultiplyAlpha.set(!1),P.demTexture=P.demTexture||Ue.getTileTexture(Ar),P.demTexture){let oi=P.demTexture;oi.update(Sr,{premultiply:!1}),oi.bind(Tt.NEAREST,Tt.CLAMP_TO_EDGE)}else P.demTexture=new u(ht,Sr,Tt.RGBA,{premultiply:!1}),P.demTexture.bind(Tt.NEAREST,Tt.CLAMP_TO_EDGE);ht.activeTexture.set(Tt.TEXTURE0);let Kr=P.fbo;if(!Kr){let oi=new u(ht,{width:Qt,height:Qt,data:null},Tt.RGBA);oi.bind(Tt.LINEAR,Tt.CLAMP_TO_EDGE),Kr=P.fbo=ht.createFramebuffer(Qt,Qt,!0,!1),Kr.colorAttachment.set(oi.texture)}ht.bindFramebuffer.set(Kr.framebuffer),ht.viewport.set([0,0,Qt,Qt]),Ue.useProgram("hillshadePrepare").draw(ht,Tt.TRIANGLES,xe,Te,Oe,xo.disabled,((oi,Ge)=>{let Ze=Ge.stride,ot=t.H();return t.aP(ot,0,t.X,-t.X,0,0,1),t.J(ot,ot,[0,-t.X,0]),{u_matrix:ot,u_image:1,u_dimension:[Ze,Ze],u_zoom:oi.overscaledZ,u_unpack:Ge.getUnpackVector()}})(P.tileID,Ot),null,ae.id,Ue.rasterBoundsBuffer,Ue.quadTriangleIndexBuffer,Ue.rasterBoundsSegments),P.needsHillshadePrepare=!1}}function Xc(Ue,P,ae,xe,Te,Oe){let ht=xe.paint.get("raster-fade-duration");if(!Oe&&ht>0){let Tt=n.now(),Ot=(Tt-Ue.timeAdded)/ht,Qt=P?(Tt-P.timeAdded)/ht:-1,Ar=ae.getSource(),Sr=Te.coveringZoomLevel({tileSize:Ar.tileSize,roundZoom:Ar.roundZoom}),Kr=!P||Math.abs(P.tileID.overscaledZ-Sr)>Math.abs(Ue.tileID.overscaledZ-Sr),oi=Kr&&Ue.refreshedUponExpiration?1:t.ac(Kr?Ot:1-Qt,0,1);return Ue.refreshedUponExpiration&&Ot>=1&&(Ue.refreshedUponExpiration=!1),P?{opacity:1,mix:1-oi}:{opacity:oi,mix:0}}return{opacity:1,mix:0}}let Lc=new t.aM(1,0,0,1),sl=new t.aM(0,1,0,1),kf=new t.aM(0,0,1,1),ah=new t.aM(1,0,1,1),Ff=new t.aM(0,1,1,1);function Jc(Ue,P,ae,xe){Fu(Ue,0,P+ae/2,Ue.transform.width,ae,xe)}function Xf(Ue,P,ae,xe){Fu(Ue,P-ae/2,0,ae,Ue.transform.height,xe)}function Fu(Ue,P,ae,xe,Te,Oe){let ht=Ue.context,Tt=ht.gl;Tt.enable(Tt.SCISSOR_TEST),Tt.scissor(P*Ue.pixelRatio,ae*Ue.pixelRatio,xe*Ue.pixelRatio,Te*Ue.pixelRatio),ht.clear({color:Oe}),Tt.disable(Tt.SCISSOR_TEST)}function Bf(Ue,P,ae){let xe=Ue.context,Te=xe.gl,Oe=ae.posMatrix,ht=Ue.useProgram("debug"),Tt=ws.disabled,Ot=qs.disabled,Qt=Ue.colorModeForRenderPass(),Ar="$debug",Sr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(ae);xe.activeTexture.set(Te.TEXTURE0);let Kr=P.getTileByID(ae.key).latestRawTileData,oi=Math.floor((Kr&&Kr.byteLength||0)/1024),Ge=P.getTile(ae).tileSize,Ze=512/Math.min(Ge,512)*(ae.overscaledZ/Ue.transform.zoom)*.5,ot=ae.canonical.toString();ae.overscaledZ!==ae.canonical.z&&(ot+=` => ${ae.overscaledZ}`),function(dt,Ct){dt.initDebugOverlayCanvas();let wt=dt.debugOverlayCanvas,Dt=dt.context.gl,fr=dt.debugOverlayCanvas.getContext("2d");fr.clearRect(0,0,wt.width,wt.height),fr.shadowColor="white",fr.shadowBlur=2,fr.lineWidth=1.5,fr.strokeStyle="white",fr.textBaseline="top",fr.font="bold 36px Open Sans, sans-serif",fr.fillText(Ct,5,5),fr.strokeText(Ct,5,5),dt.debugOverlayTexture.update(wt),dt.debugOverlayTexture.bind(Dt.LINEAR,Dt.CLAMP_TO_EDGE)}(Ue,`${ot} ${oi}kB`),ht.draw(xe,Te.TRIANGLES,Tt,Ot,Sl.alphaBlended,xo.disabled,Gn(Oe,t.aM.transparent,Ze),null,Ar,Ue.debugBuffer,Ue.quadTriangleIndexBuffer,Ue.debugSegments),ht.draw(xe,Te.LINE_STRIP,Tt,Ot,Qt,xo.disabled,Gn(Oe,t.aM.red),Sr,Ar,Ue.debugBuffer,Ue.tileBorderIndexBuffer,Ue.debugSegments)}function Ll(Ue,P,ae){let xe=Ue.context,Te=xe.gl,Oe=Ue.colorModeForRenderPass(),ht=new ws(Te.LEQUAL,ws.ReadWrite,Ue.depthRangeFor3D),Tt=Ue.useProgram("terrain"),Ot=P.getTerrainMesh();xe.bindFramebuffer.set(null),xe.viewport.set([0,0,Ue.width,Ue.height]);for(let Qt of ae){let Ar=Ue.renderToTexture.getTexture(Qt),Sr=P.getTerrainData(Qt.tileID);xe.activeTexture.set(Te.TEXTURE0),Te.bindTexture(Te.TEXTURE_2D,Ar.texture);let Kr=Ue.transform.calculatePosMatrix(Qt.tileID.toUnwrapped()),oi=P.getMeshFrameDelta(Ue.transform.zoom),Ge=Ue.transform.calculateFogMatrix(Qt.tileID.toUnwrapped()),Ze=mr(Kr,oi,Ge,Ue.style.sky,Ue.transform.pitch);Tt.draw(xe,Te.TRIANGLES,ht,qs.disabled,Oe,xo.backCCW,Ze,Sr,"terrain",Ot.vertexBuffer,Ot.indexBuffer,Ot.segments)}}class Bu{constructor(P,ae,xe){this.vertexBuffer=P,this.indexBuffer=ae,this.segments=xe}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Ic{constructor(P,ae){this.context=new vh(P),this.transform=ae,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.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 Nr}resize(P,ae,xe){if(this.width=Math.floor(P*xe),this.height=Math.floor(ae*xe),this.pixelRatio=xe,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let Te of this.style._order)this.style._layers[Te].resize()}setup(){let P=this.context,ae=new t.aX;ae.emplaceBack(0,0),ae.emplaceBack(t.X,0),ae.emplaceBack(0,t.X),ae.emplaceBack(t.X,t.X),this.tileExtentBuffer=P.createVertexBuffer(ae,jr.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);let xe=new t.aX;xe.emplaceBack(0,0),xe.emplaceBack(t.X,0),xe.emplaceBack(0,t.X),xe.emplaceBack(t.X,t.X),this.debugBuffer=P.createVertexBuffer(xe,jr.members),this.debugSegments=t.a0.simpleSegment(0,0,4,5);let Te=new t.$;Te.emplaceBack(0,0,0,0),Te.emplaceBack(t.X,0,t.X,0),Te.emplaceBack(0,t.X,0,t.X),Te.emplaceBack(t.X,t.X,t.X,t.X),this.rasterBoundsBuffer=P.createVertexBuffer(Te,Xe.members),this.rasterBoundsSegments=t.a0.simpleSegment(0,0,4,2);let Oe=new t.aX;Oe.emplaceBack(0,0),Oe.emplaceBack(1,0),Oe.emplaceBack(0,1),Oe.emplaceBack(1,1),this.viewportBuffer=P.createVertexBuffer(Oe,jr.members),this.viewportSegments=t.a0.simpleSegment(0,0,4,2);let ht=new t.aZ;ht.emplaceBack(0),ht.emplaceBack(1),ht.emplaceBack(3),ht.emplaceBack(2),ht.emplaceBack(0),this.tileBorderIndexBuffer=P.createIndexBuffer(ht);let Tt=new t.aY;Tt.emplaceBack(0,1,2),Tt.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=P.createIndexBuffer(Tt);let Ot=this.context.gl;this.stencilClearMode=new qs({func:Ot.ALWAYS,mask:0},0,255,Ot.ZERO,Ot.ZERO,Ot.ZERO)}clearStencil(){let P=this.context,ae=P.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let xe=t.H();t.aP(xe,0,this.width,this.height,0,0,1),t.K(xe,xe,[ae.drawingBufferWidth,ae.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(P,ae.TRIANGLES,ws.disabled,this.stencilClearMode,Sl.disabled,xo.disabled,eo(xe),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(P,ae){if(this.currentStencilSource===P.source||!P.isTileClipped()||!ae||!ae.length)return;this.currentStencilSource=P.source;let xe=this.context,Te=xe.gl;this.nextStencilID+ae.length>256&&this.clearStencil(),xe.setColorMode(Sl.disabled),xe.setDepthMode(ws.disabled);let Oe=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let ht of ae){let Tt=this._tileClippingMaskIDs[ht.key]=this.nextStencilID++,Ot=this.style.map.terrain&&this.style.map.terrain.getTerrainData(ht);Oe.draw(xe,Te.TRIANGLES,ws.disabled,new qs({func:Te.ALWAYS,mask:0},Tt,255,Te.KEEP,Te.KEEP,Te.REPLACE),Sl.disabled,xo.disabled,eo(ht.posMatrix),Ot,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let P=this.nextStencilID++,ae=this.context.gl;return new qs({func:ae.NOTEQUAL,mask:255},P,255,ae.KEEP,ae.KEEP,ae.REPLACE)}stencilModeForClipping(P){let ae=this.context.gl;return new qs({func:ae.EQUAL,mask:255},this._tileClippingMaskIDs[P.key],0,ae.KEEP,ae.KEEP,ae.REPLACE)}stencilConfigForOverlap(P){let ae=this.context.gl,xe=P.sort((ht,Tt)=>Tt.overscaledZ-ht.overscaledZ),Te=xe[xe.length-1].overscaledZ,Oe=xe[0].overscaledZ-Te+1;if(Oe>1){this.currentStencilSource=void 0,this.nextStencilID+Oe>256&&this.clearStencil();let ht={};for(let Tt=0;Tt<Oe;Tt++)ht[Tt+Te]=new qs({func:ae.GEQUAL,mask:255},Tt+this.nextStencilID,255,ae.KEEP,ae.KEEP,ae.REPLACE);return this.nextStencilID+=Oe,[ht,xe]}return[{[Te]:qs.disabled},xe]}colorModeForRenderPass(){let P=this.context.gl;return this._showOverdrawInspector?new Sl([P.CONSTANT_COLOR,P.ONE],new t.aM(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Sl.unblended:Sl.alphaBlended}depthModeForSublayer(P,ae,xe){if(!this.opaquePassEnabledForLayer())return ws.disabled;let Te=1-((1+this.currentLayer)*this.numSublayers+P)*this.depthEpsilon;return new ws(xe||this.context.gl.LEQUAL,ae,[Te,Te])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(P,ae){this.style=P,this.options=ae,this.lineAtlas=P.lineAtlas,this.imageManager=P.imageManager,this.glyphManager=P.glyphManager,this.symbolFadeChange=P.placement.symbolFadeChange(n.now()),this.imageManager.beginFrame();let xe=this.style._order,Te=this.style.sourceCaches,Oe={},ht={},Tt={};for(let Ot in Te){let Qt=Te[Ot];Qt.used&&Qt.prepare(this.context),Oe[Ot]=Qt.getVisibleCoordinates(),ht[Ot]=Oe[Ot].slice().reverse(),Tt[Ot]=Qt.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let Ot=0;Ot<xe.length;Ot++)if(this.style._layers[xe[Ot]].is3D()){this.opaquePassCutoff=Ot;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(let Ot of xe){let Qt=this.style._layers[Ot];if(!Qt.hasOffscreenPass()||Qt.isHidden(this.transform.zoom))continue;let Ar=ht[Qt.source];(Qt.type==="custom"||Ar.length)&&this.renderLayer(this,Te[Qt.source],Qt,Ar)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:ae.showOverdrawInspector?t.aM.black:t.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(Ot,Qt){let Ar=Ot.context,Sr=Ar.gl,Kr=((dt,Ct,wt)=>({u_sky_color:dt.properties.get("sky-color"),u_horizon_color:dt.properties.get("horizon-color"),u_horizon:(Ct.height/2+Ct.getHorizon())*wt,u_sky_horizon_blend:dt.properties.get("sky-horizon-blend")*Ct.height/2*wt}))(Qt,Ot.style.map.transform,Ot.pixelRatio),oi=new ws(Sr.LEQUAL,ws.ReadWrite,[0,1]),Ge=qs.disabled,Ze=Ot.colorModeForRenderPass(),ot=Ot.useProgram("sky");if(!Qt.mesh){let dt=new t.aX;dt.emplaceBack(-1,-1),dt.emplaceBack(1,-1),dt.emplaceBack(1,1),dt.emplaceBack(-1,1);let Ct=new t.aY;Ct.emplaceBack(0,1,2),Ct.emplaceBack(0,2,3),Qt.mesh=new Bu(Ar.createVertexBuffer(dt,jr.members),Ar.createIndexBuffer(Ct),t.a0.simpleSegment(0,0,dt.length,Ct.length))}ot.draw(Ar,Sr.TRIANGLES,oi,Ge,Ze,xo.disabled,Kr,void 0,"sky",Qt.mesh.vertexBuffer,Qt.mesh.indexBuffer,Qt.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=ae.showOverdrawInspector,this.depthRangeFor3D=[0,1-(P._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=xe.length-1;this.currentLayer>=0;this.currentLayer--){let Ot=this.style._layers[xe[this.currentLayer]],Qt=Te[Ot.source],Ar=Oe[Ot.source];this._renderTileClippingMasks(Ot,Ar),this.renderLayer(this,Qt,Ot,Ar)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<xe.length;this.currentLayer++){let Ot=this.style._layers[xe[this.currentLayer]],Qt=Te[Ot.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(Ot))continue;let Ar=(Ot.type==="symbol"?Tt:ht)[Ot.source];this._renderTileClippingMasks(Ot,Oe[Ot.source]),this.renderLayer(this,Qt,Ot,Ar)}if(this.options.showTileBoundaries){let Ot=function(Qt,Ar){let Sr=null,Kr=Object.values(Qt._layers).flatMap(ot=>ot.source&&!ot.isHidden(Ar)?[Qt.sourceCaches[ot.source]]:[]),oi=Kr.filter(ot=>ot.getSource().type==="vector"),Ge=Kr.filter(ot=>ot.getSource().type!=="vector"),Ze=ot=>{(!Sr||Sr.getSource().maxzoom<ot.getSource().maxzoom)&&(Sr=ot)};return oi.forEach(ot=>Ze(ot)),Sr||Ge.forEach(ot=>Ze(ot)),Sr}(this.style,this.transform.zoom);Ot&&function(Qt,Ar,Sr){for(let Kr=0;Kr<Sr.length;Kr++)Bf(Qt,Ar,Sr[Kr])}(this,Ot,Ot.getVisibleCoordinates())}this.options.showPadding&&function(Ot){let Qt=Ot.transform.padding;Jc(Ot,Ot.transform.height-(Qt.top||0),3,Lc),Jc(Ot,Qt.bottom||0,3,sl),Xf(Ot,Qt.left||0,3,kf),Xf(Ot,Ot.transform.width-(Qt.right||0),3,ah);let Ar=Ot.transform.centerPoint;(function(Sr,Kr,oi,Ge){Fu(Sr,Kr-1,oi-10,2,20,Ge),Fu(Sr,Kr-10,oi-1,20,2,Ge)})(Ot,Ar.x,Ot.transform.height-Ar.y,Ff)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(P){if(!this.style||!this.style.map||!this.style.map.terrain)return;let ae=this.terrainFacilitator.matrix,xe=this.transform.modelViewProjectionMatrix,Te=this.terrainFacilitator.dirty;Te||(Te=P?!t.a_(ae,xe):!t.a$(ae,xe)),Te||(Te=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),Te&&(t.b0(ae,xe),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(Oe,ht){let Tt=Oe.context,Ot=Tt.gl,Qt=Sl.unblended,Ar=new ws(Ot.LEQUAL,ws.ReadWrite,[0,1]),Sr=ht.getTerrainMesh(),Kr=ht.sourceCache.getRenderableTiles(),oi=Oe.useProgram("terrainDepth");Tt.bindFramebuffer.set(ht.getFramebuffer("depth").framebuffer),Tt.viewport.set([0,0,Oe.width/devicePixelRatio,Oe.height/devicePixelRatio]),Tt.clear({color:t.aM.transparent,depth:1});for(let Ge of Kr){let Ze=ht.getTerrainData(Ge.tileID),ot={u_matrix:Oe.transform.calculatePosMatrix(Ge.tileID.toUnwrapped()),u_ele_delta:ht.getMeshFrameDelta(Oe.transform.zoom)};oi.draw(Tt,Ot.TRIANGLES,Ar,qs.disabled,Qt,xo.backCCW,ot,Ze,"terrain",Sr.vertexBuffer,Sr.indexBuffer,Sr.segments)}Tt.bindFramebuffer.set(null),Tt.viewport.set([0,0,Oe.width,Oe.height])}(this,this.style.map.terrain),function(Oe,ht){let Tt=Oe.context,Ot=Tt.gl,Qt=Sl.unblended,Ar=new ws(Ot.LEQUAL,ws.ReadWrite,[0,1]),Sr=ht.getTerrainMesh(),Kr=ht.getCoordsTexture(),oi=ht.sourceCache.getRenderableTiles(),Ge=Oe.useProgram("terrainCoords");Tt.bindFramebuffer.set(ht.getFramebuffer("coords").framebuffer),Tt.viewport.set([0,0,Oe.width/devicePixelRatio,Oe.height/devicePixelRatio]),Tt.clear({color:t.aM.transparent,depth:1}),ht.coordsIndex=[];for(let Ze of oi){let ot=ht.getTerrainData(Ze.tileID);Tt.activeTexture.set(Ot.TEXTURE0),Ot.bindTexture(Ot.TEXTURE_2D,Kr.texture);let dt={u_matrix:Oe.transform.calculatePosMatrix(Ze.tileID.toUnwrapped()),u_terrain_coords_id:(255-ht.coordsIndex.length)/255,u_texture:0,u_ele_delta:ht.getMeshFrameDelta(Oe.transform.zoom)};Ge.draw(Tt,Ot.TRIANGLES,Ar,qs.disabled,Qt,xo.backCCW,dt,ot,"terrain",Sr.vertexBuffer,Sr.indexBuffer,Sr.segments),ht.coordsIndex.push(Ze.tileID.key)}Tt.bindFramebuffer.set(null),Tt.viewport.set([0,0,Oe.width,Oe.height])}(this,this.style.map.terrain))}renderLayer(P,ae,xe,Te){if(!xe.isHidden(this.transform.zoom)&&(xe.type==="background"||xe.type==="custom"||(Te||[]).length))switch(this.id=xe.id,xe.type){case"symbol":(function(Oe,ht,Tt,Ot,Qt){if(Oe.renderPass!=="translucent")return;let Ar=qs.disabled,Sr=Oe.colorModeForRenderPass();(Tt._unevaluatedLayout.hasValue("text-variable-anchor")||Tt._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(Kr,oi,Ge,Ze,ot,dt,Ct,wt,Dt){let fr=oi.transform,_r=xa(),kr=ot==="map",Vr=dt==="map";for(let Qr of Kr){let _i=Ze.getTile(Qr),Pi=_i.getBucket(Ge);if(!Pi||!Pi.text||!Pi.text.segments.get().length)continue;let qi=t.ag(Pi.textSizeData,fr.zoom),ga=Vi(_i,1,oi.transform.zoom),Qa=Mr(Qr.posMatrix,Vr,kr,oi.transform,ga),$a=Ge.layout.get("icon-text-fit")!=="none"&&Pi.hasIconData();if(qi){let yn=Math.pow(2,fr.zoom-_i.tileID.overscaledZ),qn=oi.style.map.terrain?(to,Vo)=>oi.style.map.terrain.getElevation(Qr,to,Vo):null,po=_r.translatePosition(fr,_i,Ct,wt);uf(Pi,kr,Vr,Dt,fr,Qa,Qr.posMatrix,yn,qi,$a,_r,po,Qr.toUnwrapped(),qn)}}}(Ot,Oe,Tt,ht,Tt.layout.get("text-rotation-alignment"),Tt.layout.get("text-pitch-alignment"),Tt.paint.get("text-translate"),Tt.paint.get("text-translate-anchor"),Qt),Tt.paint.get("icon-opacity").constantOr(1)!==0&&Wf(Oe,ht,Tt,Ot,!1,Tt.paint.get("icon-translate"),Tt.paint.get("icon-translate-anchor"),Tt.layout.get("icon-rotation-alignment"),Tt.layout.get("icon-pitch-alignment"),Tt.layout.get("icon-keep-upright"),Ar,Sr),Tt.paint.get("text-opacity").constantOr(1)!==0&&Wf(Oe,ht,Tt,Ot,!0,Tt.paint.get("text-translate"),Tt.paint.get("text-translate-anchor"),Tt.layout.get("text-rotation-alignment"),Tt.layout.get("text-pitch-alignment"),Tt.layout.get("text-keep-upright"),Ar,Sr),ht.map.showCollisionBoxes&&(Ku(Oe,ht,Tt,Ot,!0),Ku(Oe,ht,Tt,Ot,!1))})(P,ae,xe,Te,this.style.placement.variableOffsets);break;case"circle":(function(Oe,ht,Tt,Ot){if(Oe.renderPass!=="translucent")return;let Qt=Tt.paint.get("circle-opacity"),Ar=Tt.paint.get("circle-stroke-width"),Sr=Tt.paint.get("circle-stroke-opacity"),Kr=!Tt.layout.get("circle-sort-key").isConstant();if(Qt.constantOr(1)===0&&(Ar.constantOr(1)===0||Sr.constantOr(1)===0))return;let oi=Oe.context,Ge=oi.gl,Ze=Oe.depthModeForSublayer(0,ws.ReadOnly),ot=qs.disabled,dt=Oe.colorModeForRenderPass(),Ct=[];for(let wt=0;wt<Ot.length;wt++){let Dt=Ot[wt],fr=ht.getTile(Dt),_r=fr.getBucket(Tt);if(!_r)continue;let kr=_r.programConfigurations.get(Tt.id),Vr=Oe.useProgram("circle",kr),Qr=_r.layoutVertexBuffer,_i=_r.indexBuffer,Pi=Oe.style.map.terrain&&Oe.style.map.terrain.getTerrainData(Dt),qi={programConfiguration:kr,program:Vr,layoutVertexBuffer:Qr,indexBuffer:_i,uniformValues:Bn(Oe,Dt,fr,Tt),terrainData:Pi};if(Kr){let ga=_r.segments.get();for(let Qa of ga)Ct.push({segments:new t.a0([Qa]),sortKey:Qa.sortKey,state:qi})}else Ct.push({segments:_r.segments,sortKey:0,state:qi})}Kr&&Ct.sort((wt,Dt)=>wt.sortKey-Dt.sortKey);for(let wt of Ct){let{programConfiguration:Dt,program:fr,layoutVertexBuffer:_r,indexBuffer:kr,uniformValues:Vr,terrainData:Qr}=wt.state;fr.draw(oi,Ge.TRIANGLES,Ze,ot,dt,xo.disabled,Vr,Qr,Tt.id,_r,kr,wt.segments,Tt.paint,Oe.transform.zoom,Dt)}})(P,ae,xe,Te);break;case"heatmap":(function(Oe,ht,Tt,Ot){if(Tt.paint.get("heatmap-opacity")===0)return;let Qt=Oe.context;if(Oe.style.map.terrain){for(let Ar of Ot){let Sr=ht.getTile(Ar);ht.hasRenderableParent(Ar)||(Oe.renderPass==="offscreen"?cf(Oe,Sr,Tt,Ar):Oe.renderPass==="translucent"&&Wc(Oe,Tt,Ar))}Qt.viewport.set([0,0,Oe.width,Oe.height])}else Oe.renderPass==="offscreen"?function(Ar,Sr,Kr,oi){let Ge=Ar.context,Ze=Ge.gl,ot=qs.disabled,dt=new Sl([Ze.ONE,Ze.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(Ct,wt,Dt){let fr=Ct.gl;Ct.activeTexture.set(fr.TEXTURE1),Ct.viewport.set([0,0,wt.width/4,wt.height/4]);let _r=Dt.heatmapFbos.get(t.aU);_r?(fr.bindTexture(fr.TEXTURE_2D,_r.colorAttachment.get()),Ct.bindFramebuffer.set(_r.framebuffer)):(_r=Df(Ct,wt.width/4,wt.height/4),Dt.heatmapFbos.set(t.aU,_r))})(Ge,Ar,Kr),Ge.clear({color:t.aM.transparent});for(let Ct=0;Ct<oi.length;Ct++){let wt=oi[Ct];if(Sr.hasRenderableParent(wt))continue;let Dt=Sr.getTile(wt),fr=Dt.getBucket(Kr);if(!fr)continue;let _r=fr.programConfigurations.get(Kr.id),kr=Ar.useProgram("heatmap",_r),{zoom:Vr}=Ar.transform;kr.draw(Ge,Ze.TRIANGLES,ws.disabled,ot,dt,xo.disabled,Ao(wt.posMatrix,Dt,Vr,Kr.paint.get("heatmap-intensity")),null,Kr.id,fr.layoutVertexBuffer,fr.indexBuffer,fr.segments,Kr.paint,Ar.transform.zoom,_r)}Ge.viewport.set([0,0,Ar.width,Ar.height])}(Oe,ht,Tt,Ot):Oe.renderPass==="translucent"&&function(Ar,Sr){let Kr=Ar.context,oi=Kr.gl;Kr.setColorMode(Ar.colorModeForRenderPass());let Ge=Sr.heatmapFbos.get(t.aU);Ge&&(Kr.activeTexture.set(oi.TEXTURE0),oi.bindTexture(oi.TEXTURE_2D,Ge.colorAttachment.get()),Kr.activeTexture.set(oi.TEXTURE1),zf(Kr,Sr).bind(oi.LINEAR,oi.CLAMP_TO_EDGE),Ar.useProgram("heatmapTexture").draw(Kr,oi.TRIANGLES,ws.disabled,qs.disabled,Ar.colorModeForRenderPass(),xo.disabled,An(Ar,Sr,0,1),null,Sr.id,Ar.viewportBuffer,Ar.quadTriangleIndexBuffer,Ar.viewportSegments,Sr.paint,Ar.transform.zoom))}(Oe,Tt)})(P,ae,xe,Te);break;case"line":(function(Oe,ht,Tt,Ot){if(Oe.renderPass!=="translucent")return;let Qt=Tt.paint.get("line-opacity"),Ar=Tt.paint.get("line-width");if(Qt.constantOr(1)===0||Ar.constantOr(1)===0)return;let Sr=Oe.depthModeForSublayer(0,ws.ReadOnly),Kr=Oe.colorModeForRenderPass(),oi=Tt.paint.get("line-dasharray"),Ge=Tt.paint.get("line-pattern"),Ze=Ge.constantOr(1),ot=Tt.paint.get("line-gradient"),dt=Tt.getCrossfadeParameters(),Ct=Ze?"linePattern":oi?"lineSDF":ot?"lineGradient":"line",wt=Oe.context,Dt=wt.gl,fr=!0;for(let _r of Ot){let kr=ht.getTile(_r);if(Ze&&!kr.patternsLoaded())continue;let Vr=kr.getBucket(Tt);if(!Vr)continue;let Qr=Vr.programConfigurations.get(Tt.id),_i=Oe.context.program.get(),Pi=Oe.useProgram(Ct,Qr),qi=fr||Pi.program!==_i,ga=Oe.style.map.terrain&&Oe.style.map.terrain.getTerrainData(_r),Qa=Ge.constantOr(null);if(Qa&&kr.imageAtlas){let qn=kr.imageAtlas,po=qn.patternPositions[Qa.to.toString()],to=qn.patternPositions[Qa.from.toString()];po&&to&&Qr.setConstantPatternPositions(po,to)}let $a=ga?_r:null,yn=Ze?ns(Oe,kr,Tt,dt,$a):oi?uo(Oe,kr,Tt,oi,dt,$a):ot?Ls(Oe,kr,Tt,Vr.lineClipsArray.length,$a):fs(Oe,kr,Tt,$a);if(Ze)wt.activeTexture.set(Dt.TEXTURE0),kr.imageAtlasTexture.bind(Dt.LINEAR,Dt.CLAMP_TO_EDGE),Qr.updatePaintBuffers(dt);else if(oi&&(qi||Oe.lineAtlas.dirty))wt.activeTexture.set(Dt.TEXTURE0),Oe.lineAtlas.bind(wt);else if(ot){let qn=Vr.gradients[Tt.id],po=qn.texture;if(Tt.gradientVersion!==qn.version){let to=256;if(Tt.stepInterpolant){let Vo=ht.getSource().maxzoom,bs=_r.canonical.z===Vo?Math.ceil(1<<Oe.transform.maxZoom-_r.canonical.z):1;to=t.ac(t.aV(Vr.maxLineLength/t.X*1024*bs),256,wt.maxTextureSize)}qn.gradient=t.aW({expression:Tt.gradientExpression(),evaluationKey:"lineProgress",resolution:to,image:qn.gradient||void 0,clips:Vr.lineClipsArray}),qn.texture?qn.texture.update(qn.gradient):qn.texture=new u(wt,qn.gradient,Dt.RGBA),qn.version=Tt.gradientVersion,po=qn.texture}wt.activeTexture.set(Dt.TEXTURE0),po.bind(Tt.stepInterpolant?Dt.NEAREST:Dt.LINEAR,Dt.CLAMP_TO_EDGE)}Pi.draw(wt,Dt.TRIANGLES,Sr,Oe.stencilModeForClipping(_r),Kr,xo.disabled,yn,ga,Tt.id,Vr.layoutVertexBuffer,Vr.indexBuffer,Vr.segments,Tt.paint,Oe.transform.zoom,Qr,Vr.layoutVertexBuffer2),fr=!1}})(P,ae,xe,Te);break;case"fill":(function(Oe,ht,Tt,Ot){let Qt=Tt.paint.get("fill-color"),Ar=Tt.paint.get("fill-opacity");if(Ar.constantOr(1)===0)return;let Sr=Oe.colorModeForRenderPass(),Kr=Tt.paint.get("fill-pattern"),oi=Oe.opaquePassEnabledForLayer()&&!Kr.constantOr(1)&&Qt.constantOr(t.aM.transparent).a===1&&Ar.constantOr(0)===1?"opaque":"translucent";if(Oe.renderPass===oi){let Ge=Oe.depthModeForSublayer(1,Oe.renderPass==="opaque"?ws.ReadWrite:ws.ReadOnly);Ef(Oe,ht,Tt,Ot,Ge,Sr,!1)}if(Oe.renderPass==="translucent"&&Tt.paint.get("fill-antialias")){let Ge=Oe.depthModeForSublayer(Tt.getPaintProperty("fill-outline-color")?2:0,ws.ReadOnly);Ef(Oe,ht,Tt,Ot,Ge,Sr,!0)}})(P,ae,xe,Te);break;case"fill-extrusion":(function(Oe,ht,Tt,Ot){let Qt=Tt.paint.get("fill-extrusion-opacity");if(Qt!==0&&Oe.renderPass==="translucent"){let Ar=new ws(Oe.context.gl.LEQUAL,ws.ReadWrite,Oe.depthRangeFor3D);if(Qt!==1||Tt.paint.get("fill-extrusion-pattern").constantOr(1))cc(Oe,ht,Tt,Ot,Ar,qs.disabled,Sl.disabled),cc(Oe,ht,Tt,Ot,Ar,Oe.stencilModeFor3D(),Oe.colorModeForRenderPass());else{let Sr=Oe.colorModeForRenderPass();cc(Oe,ht,Tt,Ot,Ar,qs.disabled,Sr)}}})(P,ae,xe,Te);break;case"hillshade":(function(Oe,ht,Tt,Ot){if(Oe.renderPass!=="offscreen"&&Oe.renderPass!=="translucent")return;let Qt=Oe.context,Ar=Oe.depthModeForSublayer(0,ws.ReadOnly),Sr=Oe.colorModeForRenderPass(),[Kr,oi]=Oe.renderPass==="translucent"?Oe.stencilConfigForOverlap(Ot):[{},Ot];for(let Ge of oi){let Ze=ht.getTile(Ge);Ze.needsHillshadePrepare!==void 0&&Ze.needsHillshadePrepare&&Oe.renderPass==="offscreen"?lu(Oe,Ze,Tt,Ar,qs.disabled,Sr):Oe.renderPass==="translucent"&&$c(Oe,Ge,Ze,Tt,Ar,Kr[Ge.overscaledZ],Sr)}Qt.viewport.set([0,0,Oe.width,Oe.height])})(P,ae,xe,Te);break;case"raster":(function(Oe,ht,Tt,Ot){if(Oe.renderPass!=="translucent"||Tt.paint.get("raster-opacity")===0||!Ot.length)return;let Qt=Oe.context,Ar=Qt.gl,Sr=ht.getSource(),Kr=Oe.useProgram("raster"),oi=Oe.colorModeForRenderPass(),[Ge,Ze]=Sr instanceof tt?[{},Ot]:Oe.stencilConfigForOverlap(Ot),ot=Ze[Ze.length-1].overscaledZ,dt=!Oe.options.moving;for(let Ct of Ze){let wt=Oe.depthModeForSublayer(Ct.overscaledZ-ot,Tt.paint.get("raster-opacity")===1?ws.ReadWrite:ws.ReadOnly,Ar.LESS),Dt=ht.getTile(Ct);Dt.registerFadeDuration(Tt.paint.get("raster-fade-duration"));let fr=ht.findLoadedParent(Ct,0),_r=ht.findLoadedSibling(Ct),kr=Xc(Dt,fr||_r||null,ht,Tt,Oe.transform,Oe.style.map.terrain),Vr,Qr,_i=Tt.paint.get("raster-resampling")==="nearest"?Ar.NEAREST:Ar.LINEAR;Qt.activeTexture.set(Ar.TEXTURE0),Dt.texture.bind(_i,Ar.CLAMP_TO_EDGE,Ar.LINEAR_MIPMAP_NEAREST),Qt.activeTexture.set(Ar.TEXTURE1),fr?(fr.texture.bind(_i,Ar.CLAMP_TO_EDGE,Ar.LINEAR_MIPMAP_NEAREST),Vr=Math.pow(2,fr.tileID.overscaledZ-Dt.tileID.overscaledZ),Qr=[Dt.tileID.canonical.x*Vr%1,Dt.tileID.canonical.y*Vr%1]):Dt.texture.bind(_i,Ar.CLAMP_TO_EDGE,Ar.LINEAR_MIPMAP_NEAREST),Dt.texture.useMipmap&&Qt.extTextureFilterAnisotropic&&Oe.transform.pitch>20&&Ar.texParameterf(Ar.TEXTURE_2D,Qt.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Qt.extTextureFilterAnisotropicMax);let Pi=Oe.style.map.terrain&&Oe.style.map.terrain.getTerrainData(Ct),qi=Pi?Ct:null,ga=qi?qi.posMatrix:Oe.transform.calculatePosMatrix(Ct.toUnwrapped(),dt),Qa=el(ga,Qr||[0,0],Vr||1,kr,Tt);Sr instanceof tt?Kr.draw(Qt,Ar.TRIANGLES,wt,qs.disabled,oi,xo.disabled,Qa,Pi,Tt.id,Sr.boundsBuffer,Oe.quadTriangleIndexBuffer,Sr.boundsSegments):Kr.draw(Qt,Ar.TRIANGLES,wt,Ge[Ct.overscaledZ],oi,xo.disabled,Qa,Pi,Tt.id,Oe.rasterBoundsBuffer,Oe.quadTriangleIndexBuffer,Oe.rasterBoundsSegments)}})(P,ae,xe,Te);break;case"background":(function(Oe,ht,Tt,Ot){let Qt=Tt.paint.get("background-color"),Ar=Tt.paint.get("background-opacity");if(Ar===0)return;let Sr=Oe.context,Kr=Sr.gl,oi=Oe.transform,Ge=oi.tileSize,Ze=Tt.paint.get("background-pattern");if(Oe.isPatternMissing(Ze))return;let ot=!Ze&&Qt.a===1&&Ar===1&&Oe.opaquePassEnabledForLayer()?"opaque":"translucent";if(Oe.renderPass!==ot)return;let dt=qs.disabled,Ct=Oe.depthModeForSublayer(0,ot==="opaque"?ws.ReadWrite:ws.ReadOnly),wt=Oe.colorModeForRenderPass(),Dt=Oe.useProgram(Ze?"backgroundPattern":"background"),fr=Ot||oi.coveringTiles({tileSize:Ge,terrain:Oe.style.map.terrain});Ze&&(Sr.activeTexture.set(Kr.TEXTURE0),Oe.imageManager.bind(Oe.context));let _r=Tt.getCrossfadeParameters();for(let kr of fr){let Vr=Ot?kr.posMatrix:Oe.transform.calculatePosMatrix(kr.toUnwrapped()),Qr=Ze?Gs(Vr,Ar,Oe,Ze,{tileID:kr,tileSize:Ge},_r):Ms(Vr,Ar,Qt),_i=Oe.style.map.terrain&&Oe.style.map.terrain.getTerrainData(kr);Dt.draw(Sr,Kr.TRIANGLES,Ct,dt,wt,xo.disabled,Qr,_i,Tt.id,Oe.tileExtentBuffer,Oe.quadTriangleIndexBuffer,Oe.tileExtentSegments)}})(P,0,xe,Te);break;case"custom":(function(Oe,ht,Tt){let Ot=Oe.context,Qt=Tt.implementation;if(Oe.renderPass==="offscreen"){let Ar=Qt.prerender;Ar&&(Oe.setCustomLayerDefaults(),Ot.setColorMode(Oe.colorModeForRenderPass()),Ar.call(Qt,Ot.gl,Oe.transform.customLayerMatrix()),Ot.setDirty(),Oe.setBaseState())}else if(Oe.renderPass==="translucent"){Oe.setCustomLayerDefaults(),Ot.setColorMode(Oe.colorModeForRenderPass()),Ot.setStencilMode(qs.disabled);let Ar=Qt.renderingMode==="3d"?new ws(Oe.context.gl.LEQUAL,ws.ReadWrite,Oe.depthRangeFor3D):Oe.depthModeForSublayer(0,ws.ReadOnly);Ot.setDepthMode(Ar),Qt.render(Ot.gl,Oe.transform.customLayerMatrix(),{farZ:Oe.transform.farZ,nearZ:Oe.transform.nearZ,fov:Oe.transform._fov,modelViewProjectionMatrix:Oe.transform.modelViewProjectionMatrix,projectionMatrix:Oe.transform.projectionMatrix}),Ot.setDirty(),Oe.setBaseState(),Ot.bindFramebuffer.set(null)}})(P,0,xe)}}translatePosMatrix(P,ae,xe,Te,Oe){if(!xe[0]&&!xe[1])return P;let ht=Oe?Te==="map"?this.transform.angle:0:Te==="viewport"?-this.transform.angle:0;if(ht){let Qt=Math.sin(ht),Ar=Math.cos(ht);xe=[xe[0]*Ar-xe[1]*Qt,xe[0]*Qt+xe[1]*Ar]}let Tt=[Oe?xe[0]:Vi(ae,xe[0],this.transform.zoom),Oe?xe[1]:Vi(ae,xe[1],this.transform.zoom),0],Ot=new Float32Array(16);return t.J(Ot,P,Tt),Ot}saveTileTexture(P){let ae=this._tileTextures[P.size[0]];ae?ae.push(P):this._tileTextures[P.size[0]]=[P]}getTileTexture(P){let ae=this._tileTextures[P];return ae&&ae.length>0?ae.pop():null}isPatternMissing(P){if(!P)return!1;if(!P.from||!P.to)return!0;let ae=this.imageManager.getPattern(P.from.toString()),xe=this.imageManager.getPattern(P.to.toString());return!ae||!xe}useProgram(P,ae){this.cache=this.cache||{};let xe=P+(ae?ae.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[xe]||(this.cache[xe]=new ki(this.context,Wr[P],ae,ul[P],this._showOverdrawInspector,this.style.map.terrain)),this.cache[xe]}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 P=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(P.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new u(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:P,drawingBufferHeight:ae}=this.context.gl;return this.width!==P||this.height!==ae}}class xl{constructor(P,ae){this.points=P,this.planes=ae}static fromInvProjectionMatrix(P,ae,xe){let Te=Math.pow(2,xe),Oe=[[-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(Tt=>{let Ot=1/(Tt=t.af([],Tt,P))[3]/ae*Te;return t.b1(Tt,Tt,[Ot,Ot,1/Tt[3],Ot])}),ht=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(Tt=>{let Ot=function(Kr,oi){var Ge=oi[0],Ze=oi[1],ot=oi[2],dt=Ge*Ge+Ze*Ze+ot*ot;return dt>0&&(dt=1/Math.sqrt(dt)),Kr[0]=oi[0]*dt,Kr[1]=oi[1]*dt,Kr[2]=oi[2]*dt,Kr}([],function(Kr,oi,Ge){var Ze=oi[0],ot=oi[1],dt=oi[2],Ct=Ge[0],wt=Ge[1],Dt=Ge[2];return Kr[0]=ot*Dt-dt*wt,Kr[1]=dt*Ct-Ze*Dt,Kr[2]=Ze*wt-ot*Ct,Kr}([],M([],Oe[Tt[0]],Oe[Tt[1]]),M([],Oe[Tt[2]],Oe[Tt[1]]))),Qt=-((Ar=Ot)[0]*(Sr=Oe[Tt[1]])[0]+Ar[1]*Sr[1]+Ar[2]*Sr[2]);var Ar,Sr;return Ot.concat(Qt)});return new xl(Oe,ht)}}class _c{constructor(P,ae){this.min=P,this.max=ae,this.center=function(xe,Te,Oe){return xe[0]=.5*Te[0],xe[1]=.5*Te[1],xe[2]=.5*Te[2],xe}([],function(xe,Te,Oe){return xe[0]=Te[0]+Oe[0],xe[1]=Te[1]+Oe[1],xe[2]=Te[2]+Oe[2],xe}([],this.min,this.max))}quadrant(P){let ae=[P%2==0,P<2],xe=w(this.min),Te=w(this.max);for(let Oe=0;Oe<ae.length;Oe++)xe[Oe]=ae[Oe]?this.min[Oe]:this.center[Oe],Te[Oe]=ae[Oe]?this.center[Oe]:this.max[Oe];return Te[2]=this.max[2],new _c(xe,Te)}distanceX(P){return Math.max(Math.min(this.max[0],P[0]),this.min[0])-P[0]}distanceY(P){return Math.max(Math.min(this.max[1],P[1]),this.min[1])-P[1]}intersects(P){let ae=[[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]],xe=!0;for(let Te=0;Te<P.planes.length;Te++){let Oe=P.planes[Te],ht=0;for(let Tt=0;Tt<ae.length;Tt++)t.b2(Oe,ae[Tt])>=0&&ht++;if(ht===0)return 0;ht!==ae.length&&(xe=!1)}if(xe)return 2;for(let Te=0;Te<3;Te++){let Oe=Number.MAX_VALUE,ht=-Number.MAX_VALUE;for(let Tt=0;Tt<P.points.length;Tt++){let Ot=P.points[Tt][Te]-this.min[Te];Oe=Math.min(Oe,Ot),ht=Math.max(ht,Ot)}if(ht<0||Oe>this.max[Te]-this.min[Te])return 0}return 1}}class Eu{constructor(P=0,ae=0,xe=0,Te=0){if(isNaN(P)||P<0||isNaN(ae)||ae<0||isNaN(xe)||xe<0||isNaN(Te)||Te<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=P,this.bottom=ae,this.left=xe,this.right=Te}interpolate(P,ae,xe){return ae.top!=null&&P.top!=null&&(this.top=t.y.number(P.top,ae.top,xe)),ae.bottom!=null&&P.bottom!=null&&(this.bottom=t.y.number(P.bottom,ae.bottom,xe)),ae.left!=null&&P.left!=null&&(this.left=t.y.number(P.left,ae.left,xe)),ae.right!=null&&P.right!=null&&(this.right=t.y.number(P.right,ae.right,xe)),this}getCenter(P,ae){let xe=t.ac((this.left+P-this.right)/2,0,P),Te=t.ac((this.top+ae-this.bottom)/2,0,ae);return new t.P(xe,Te)}equals(P){return this.top===P.top&&this.bottom===P.bottom&&this.left===P.left&&this.right===P.right}clone(){return new Eu(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let Iu=85.051129;class Nl{constructor(P,ae,xe,Te,Oe){this.tileSize=512,this._renderWorldCopies=Oe===void 0||!!Oe,this._minZoom=P||0,this._maxZoom=ae||22,this._minPitch=xe??0,this._maxPitch=Te??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Eu,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let P=new Nl(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return P.apply(this),P}apply(P){this.tileSize=P.tileSize,this.latRange=P.latRange,this.lngRange=P.lngRange,this.width=P.width,this.height=P.height,this._center=P._center,this._elevation=P._elevation,this.minElevationForCurrentTile=P.minElevationForCurrentTile,this.zoom=P.zoom,this.angle=P.angle,this._fov=P._fov,this._pitch=P._pitch,this._unmodified=P._unmodified,this._edgeInsets=P._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(P){this._minZoom!==P&&(this._minZoom=P,this.zoom=Math.max(this.zoom,P))}get maxZoom(){return this._maxZoom}set maxZoom(P){this._maxZoom!==P&&(this._maxZoom=P,this.zoom=Math.min(this.zoom,P))}get minPitch(){return this._minPitch}set minPitch(P){this._minPitch!==P&&(this._minPitch=P,this.pitch=Math.max(this.pitch,P))}get maxPitch(){return this._maxPitch}set maxPitch(P){this._maxPitch!==P&&(this._maxPitch=P,this.pitch=Math.min(this.pitch,P))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(P){P===void 0?P=!0:P===null&&(P=!1),this._renderWorldCopies=P}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(P){let ae=-t.b3(P,-180,180)*Math.PI/180;this.angle!==ae&&(this._unmodified=!1,this.angle=ae,this._calcMatrices(),this.rotationMatrix=function(){var xe=new t.A(4);return t.A!=Float32Array&&(xe[1]=0,xe[2]=0),xe[0]=1,xe[3]=1,xe}(),function(xe,Te,Oe){var ht=Te[0],Tt=Te[1],Ot=Te[2],Qt=Te[3],Ar=Math.sin(Oe),Sr=Math.cos(Oe);xe[0]=ht*Sr+Ot*Ar,xe[1]=Tt*Sr+Qt*Ar,xe[2]=ht*-Ar+Ot*Sr,xe[3]=Tt*-Ar+Qt*Sr}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(P){let ae=t.ac(P,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==ae&&(this._unmodified=!1,this._pitch=ae,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(P){P=Math.max(.01,Math.min(60,P)),this._fov!==P&&(this._unmodified=!1,this._fov=P/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(P){let ae=Math.min(Math.max(P,this.minZoom),this.maxZoom);this._zoom!==ae&&(this._unmodified=!1,this._zoom=ae,this.tileZoom=Math.max(0,Math.floor(ae)),this.scale=this.zoomScale(ae),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(P){P.lat===this._center.lat&&P.lng===this._center.lng||(this._unmodified=!1,this._center=P,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(P){P!==this._elevation&&(this._elevation=P,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(P){this._edgeInsets.equals(P)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,P,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(P){return this._edgeInsets.equals(P)}interpolatePadding(P,ae,xe){this._unmodified=!1,this._edgeInsets.interpolate(P,ae,xe),this._constrain(),this._calcMatrices()}coveringZoomLevel(P){let ae=(P.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/P.tileSize));return Math.max(0,ae)}getVisibleUnwrappedCoordinates(P){let ae=[new t.b4(0,P)];if(this._renderWorldCopies){let xe=this.pointCoordinate(new t.P(0,0)),Te=this.pointCoordinate(new t.P(this.width,0)),Oe=this.pointCoordinate(new t.P(this.width,this.height)),ht=this.pointCoordinate(new t.P(0,this.height)),Tt=Math.floor(Math.min(xe.x,Te.x,Oe.x,ht.x)),Ot=Math.floor(Math.max(xe.x,Te.x,Oe.x,ht.x)),Qt=1;for(let Ar=Tt-Qt;Ar<=Ot+Qt;Ar++)Ar!==0&&ae.push(new t.b4(Ar,P))}return ae}coveringTiles(P){var ae,xe;let Te=this.coveringZoomLevel(P),Oe=Te;if(P.minzoom!==void 0&&Te<P.minzoom)return[];P.maxzoom!==void 0&&Te>P.maxzoom&&(Te=P.maxzoom);let ht=this.pointCoordinate(this.getCameraPoint()),Tt=t.Z.fromLngLat(this.center),Ot=Math.pow(2,Te),Qt=[Ot*ht.x,Ot*ht.y,0],Ar=[Ot*Tt.x,Ot*Tt.y,0],Sr=xl.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,Te),Kr=P.minzoom||0;!P.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Kr=Te);let oi=P.terrain?2/Math.min(this.tileSize,P.tileSize)*this.tileSize:3,Ge=wt=>({aabb:new _c([wt*Ot,0,0],[(wt+1)*Ot,Ot,0]),zoom:0,x:0,y:0,wrap:wt,fullyVisible:!1}),Ze=[],ot=[],dt=Te,Ct=P.reparseOverscaled?Oe:Te;if(this._renderWorldCopies)for(let wt=1;wt<=3;wt++)Ze.push(Ge(-wt)),Ze.push(Ge(wt));for(Ze.push(Ge(0));Ze.length>0;){let wt=Ze.pop(),Dt=wt.x,fr=wt.y,_r=wt.fullyVisible;if(!_r){let Pi=wt.aabb.intersects(Sr);if(Pi===0)continue;_r=Pi===2}let kr=P.terrain?Qt:Ar,Vr=wt.aabb.distanceX(kr),Qr=wt.aabb.distanceY(kr),_i=Math.max(Math.abs(Vr),Math.abs(Qr));if(wt.zoom===dt||_i>oi+(1<<dt-wt.zoom)-2&&wt.zoom>=Kr){let Pi=dt-wt.zoom,qi=Qt[0]-.5-(Dt<<Pi),ga=Qt[1]-.5-(fr<<Pi);ot.push({tileID:new t.S(wt.zoom===dt?Ct:wt.zoom,wt.wrap,wt.zoom,Dt,fr),distanceSq:g([Ar[0]-.5-Dt,Ar[1]-.5-fr]),tileDistanceToCamera:Math.sqrt(qi*qi+ga*ga)})}else for(let Pi=0;Pi<4;Pi++){let qi=(Dt<<1)+Pi%2,ga=(fr<<1)+(Pi>>1),Qa=wt.zoom+1,$a=wt.aabb.quadrant(Pi);if(P.terrain){let yn=new t.S(Qa,wt.wrap,Qa,qi,ga),qn=P.terrain.getMinMaxElevation(yn),po=(ae=qn.minElevation)!==null&&ae!==void 0?ae:this.elevation,to=(xe=qn.maxElevation)!==null&&xe!==void 0?xe:this.elevation;$a=new _c([$a.min[0],$a.min[1],po],[$a.max[0],$a.max[1],to])}Ze.push({aabb:$a,zoom:Qa,x:qi,y:ga,wrap:wt.wrap,fullyVisible:_r})}}return ot.sort((wt,Dt)=>wt.distanceSq-Dt.distanceSq).map(wt=>wt.tileID)}resize(P,ae){this.width=P,this.height=ae,this.pixelsToGLUnits=[2/P,-2/ae],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(P){return Math.pow(2,P)}scaleZoom(P){return Math.log(P)/Math.LN2}project(P){let ae=t.ac(P.lat,-85.051129,Iu);return new t.P(t.O(P.lng)*this.worldSize,t.Q(ae)*this.worldSize)}unproject(P){return new t.Z(P.x/this.worldSize,P.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(P){let ae=this.elevation,xe=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,Te=this.pointLocation(this.centerPoint,P),Oe=P.getElevationForLngLatZoom(Te,this.tileZoom);if(!(this.elevation-Oe))return;let ht=xe+ae-Oe,Tt=Math.cos(this._pitch)*this.cameraToCenterDistance/ht/t.b5(1,Te.lat),Ot=this.scaleZoom(Tt/this.tileSize);this._elevation=Oe,this._center=Te,this.zoom=Ot}setLocationAtPoint(P,ae){let xe=this.pointCoordinate(ae),Te=this.pointCoordinate(this.centerPoint),Oe=this.locationCoordinate(P),ht=new t.Z(Oe.x-(xe.x-Te.x),Oe.y-(xe.y-Te.y));this.center=this.coordinateLocation(ht),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(P,ae){return ae?this.coordinatePoint(this.locationCoordinate(P),ae.getElevationForLngLatZoom(P,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(P))}pointLocation(P,ae){return this.coordinateLocation(this.pointCoordinate(P,ae))}locationCoordinate(P){return t.Z.fromLngLat(P)}coordinateLocation(P){return P&&P.toLngLat()}pointCoordinate(P,ae){if(ae){let Kr=ae.pointCoordinate(P);if(Kr!=null)return Kr}let xe=[P.x,P.y,0,1],Te=[P.x,P.y,1,1];t.af(xe,xe,this.pixelMatrixInverse),t.af(Te,Te,this.pixelMatrixInverse);let Oe=xe[3],ht=Te[3],Tt=xe[1]/Oe,Ot=Te[1]/ht,Qt=xe[2]/Oe,Ar=Te[2]/ht,Sr=Qt===Ar?0:(0-Qt)/(Ar-Qt);return new t.Z(t.y.number(xe[0]/Oe,Te[0]/ht,Sr)/this.worldSize,t.y.number(Tt,Ot,Sr)/this.worldSize)}coordinatePoint(P,ae=0,xe=this.pixelMatrix){let Te=[P.x*this.worldSize,P.y*this.worldSize,ae,1];return t.af(Te,Te,xe),new t.P(Te[0]/Te[3],Te[1]/Te[3])}getBounds(){let P=Math.max(0,this.height/2-this.getHorizon());return new re().extend(this.pointLocation(new t.P(0,P))).extend(this.pointLocation(new t.P(this.width,P))).extend(this.pointLocation(new t.P(this.width,this.height))).extend(this.pointLocation(new t.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new re([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(P){P?(this.lngRange=[P.getWest(),P.getEast()],this.latRange=[P.getSouth(),P.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Iu])}calculateTileMatrix(P){let ae=P.canonical,xe=this.worldSize/this.zoomScale(ae.z),Te=ae.x+Math.pow(2,ae.z)*P.wrap,Oe=t.an(new Float64Array(16));return t.J(Oe,Oe,[Te*xe,ae.y*xe,0]),t.K(Oe,Oe,[xe/t.X,xe/t.X,1]),Oe}calculatePosMatrix(P,ae=!1){let xe=P.key,Te=ae?this._alignedPosMatrixCache:this._posMatrixCache;if(Te[xe])return Te[xe];let Oe=this.calculateTileMatrix(P);return t.L(Oe,ae?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Oe),Te[xe]=new Float32Array(Oe),Te[xe]}calculateFogMatrix(P){let ae=P.key,xe=this._fogMatrixCache;if(xe[ae])return xe[ae];let Te=this.calculateTileMatrix(P);return t.L(Te,this.fogMatrix,Te),xe[ae]=new Float32Array(Te),xe[ae]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(P,ae){ae=t.ac(+ae,this.minZoom,this.maxZoom);let xe={center:new t.N(P.lng,P.lat),zoom:ae},Te=this.lngRange;if(!this._renderWorldCopies&&Te===null){let wt=179.9999999999;Te=[-wt,wt]}let Oe=this.tileSize*this.zoomScale(xe.zoom),ht=0,Tt=Oe,Ot=0,Qt=Oe,Ar=0,Sr=0,{x:Kr,y:oi}=this.size;if(this.latRange){let wt=this.latRange;ht=t.Q(wt[1])*Oe,Tt=t.Q(wt[0])*Oe,Tt-ht<oi&&(Ar=oi/(Tt-ht))}Te&&(Ot=t.b3(t.O(Te[0])*Oe,0,Oe),Qt=t.b3(t.O(Te[1])*Oe,0,Oe),Qt<Ot&&(Qt+=Oe),Qt-Ot<Kr&&(Sr=Kr/(Qt-Ot)));let{x:Ge,y:Ze}=this.project.call({worldSize:Oe},P),ot,dt,Ct=Math.max(Sr||0,Ar||0);if(Ct){let wt=new t.P(Sr?(Qt+Ot)/2:Ge,Ar?(Tt+ht)/2:Ze);return xe.center=this.unproject.call({worldSize:Oe},wt).wrap(),xe.zoom+=this.scaleZoom(Ct),xe}if(this.latRange){let wt=oi/2;Ze-wt<ht&&(dt=ht+wt),Ze+wt>Tt&&(dt=Tt-wt)}if(Te){let wt=(Ot+Qt)/2,Dt=Ge;this._renderWorldCopies&&(Dt=t.b3(Ge,wt-Oe/2,wt+Oe/2));let fr=Kr/2;Dt-fr<Ot&&(ot=Ot+fr),Dt+fr>Qt&&(ot=Qt-fr)}if(ot!==void 0||dt!==void 0){let wt=new t.P(ot??Ge,dt??Ze);xe.center=this.unproject.call({worldSize:Oe},wt).wrap()}return xe}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let P=this._unmodified,{center:ae,zoom:xe}=this.getConstrained(this.center,this.zoom);this.center=ae,this.zoom=xe,this._unmodified=P,this._constraining=!1}_calcMatrices(){if(!this.height)return;let P=this.centerOffset,ae=this.point.x,xe=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b5(1,this.center.lat)*this.worldSize;let Te=t.an(new Float64Array(16));t.K(Te,Te,[this.width/2,-this.height/2,1]),t.J(Te,Te,[1,-1,0]),this.labelPlaneMatrix=Te,Te=t.an(new Float64Array(16)),t.K(Te,Te,[1,-1,1]),t.J(Te,Te,[-1,-1,0]),t.K(Te,Te,[2/this.width,2/this.height,1]),this.glCoordMatrix=Te;let Oe=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),ht=Math.min(this.elevation,this.minElevationForCurrentTile),Tt=Oe-ht*this._pixelPerMeter/Math.cos(this._pitch),Ot=ht<0?Tt:Oe,Qt=Math.PI/2+this._pitch,Ar=this._fov*(.5+P.y/this.height),Sr=Math.sin(Ar)*Ot/Math.sin(t.ac(Math.PI-Qt-Ar,.01,Math.PI-.01)),Kr=this.getHorizon(),oi=2*Math.atan(Kr/this.cameraToCenterDistance)*(.5+P.y/(2*Kr)),Ge=Math.sin(oi)*Ot/Math.sin(t.ac(Math.PI-Qt-oi,.01,Math.PI-.01)),Ze=Math.min(Sr,Ge);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Ze+Ot),this.nearZ=this.height/50,Te=new Float64Array(16),t.b6(Te,this._fov,this.width/this.height,this.nearZ,this.farZ),Te[8]=2*-P.x/this.width,Te[9]=2*P.y/this.height,this.projectionMatrix=t.ae(Te),t.K(Te,Te,[1,-1,1]),t.J(Te,Te,[0,0,-this.cameraToCenterDistance]),t.b7(Te,Te,this._pitch),t.ad(Te,Te,this.angle),t.J(Te,Te,[-ae,-xe,0]),this.mercatorMatrix=t.K([],Te,[this.worldSize,this.worldSize,this.worldSize]),t.K(Te,Te,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.L(new Float64Array(16),this.labelPlaneMatrix,Te),t.J(Te,Te,[0,0,-this.elevation]),this.modelViewProjectionMatrix=Te,this.invModelViewProjectionMatrix=t.as([],Te),this.fogMatrix=new Float64Array(16),t.b6(this.fogMatrix,this._fov,this.width/this.height,Oe,this.farZ),this.fogMatrix[8]=2*-P.x/this.width,this.fogMatrix[9]=2*P.y/this.height,t.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),t.b7(this.fogMatrix,this.fogMatrix,this._pitch),t.ad(this.fogMatrix,this.fogMatrix,this.angle),t.J(this.fogMatrix,this.fogMatrix,[-ae,-xe,0]),t.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=t.L(new Float64Array(16),this.labelPlaneMatrix,Te);let ot=this.width%2/2,dt=this.height%2/2,Ct=Math.cos(this.angle),wt=Math.sin(this.angle),Dt=ae-Math.round(ae)+Ct*ot+wt*dt,fr=xe-Math.round(xe)+Ct*dt+wt*ot,_r=new Float64Array(Te);if(t.J(_r,_r,[Dt>.5?Dt-1:Dt,fr>.5?fr-1:fr,0]),this.alignedModelViewProjectionMatrix=_r,Te=t.as(new Float64Array(16),this.pixelMatrix),!Te)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Te,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let P=this.pointCoordinate(new t.P(0,0)),ae=[P.x*this.worldSize,P.y*this.worldSize,0,1];return t.af(ae,ae,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let P=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,P))}getCameraQueryGeometry(P){let ae=this.getCameraPoint();if(P.length===1)return[P[0],ae];{let xe=ae.x,Te=ae.y,Oe=ae.x,ht=ae.y;for(let Tt of P)xe=Math.min(xe,Tt.x),Te=Math.min(Te,Tt.y),Oe=Math.max(Oe,Tt.x),ht=Math.max(ht,Tt.y);return[new t.P(xe,Te),new t.P(Oe,Te),new t.P(Oe,ht),new t.P(xe,ht),new t.P(xe,Te)]}}lngLatToCameraDepth(P,ae){let xe=this.locationCoordinate(P),Te=[xe.x*this.worldSize,xe.y*this.worldSize,ae,1];return t.af(Te,Te,this.modelViewProjectionMatrix),Te[2]/Te[3]}}function Of(Ue,P){let ae,xe=!1,Te=null,Oe=null,ht=()=>{Te=null,xe&&(Ue.apply(Oe,ae),Te=setTimeout(ht,P),xe=!1)};return(...Tt)=>(xe=!0,Oe=this,ae=Tt,Te||ht(),Te)}class Yf{constructor(P){this._getCurrentHash=()=>{let ae=window.location.hash.replace("#","");if(this._hashName){let xe;return ae.split("&").map(Te=>Te.split("=")).forEach(Te=>{Te[0]===this._hashName&&(xe=Te)}),(xe&&xe[1]||"").split("/")}return ae.split("/")},this._onHashChange=()=>{let ae=this._getCurrentHash();if(ae.length>=3&&!ae.some(xe=>isNaN(xe))){let xe=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(ae[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+ae[2],+ae[1]],zoom:+ae[0],bearing:xe,pitch:+(ae[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let ae=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,ae)},this._removeHash=()=>{let ae=this._getCurrentHash();if(ae.length===0)return;let xe=ae.join("/"),Te=xe;Te.split("&").length>0&&(Te=Te.split("&")[0]),this._hashName&&(Te=`${this._hashName}=${xe}`);let Oe=window.location.hash.replace(Te,"");Oe.startsWith("#&")?Oe=Oe.slice(0,1)+Oe.slice(2):Oe==="#"&&(Oe="");let ht=window.location.href.replace(/(#.+)?$/,Oe);ht=ht.replace("&&","&"),window.history.replaceState(window.history.state,null,ht)},this._updateHash=Of(this._updateHashUnthrottled,300),this._hashName=P&&encodeURIComponent(P)}addTo(P){return this._map=P,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(P){let ae=this._map.getCenter(),xe=Math.round(100*this._map.getZoom())/100,Te=Math.ceil((xe*Math.LN2+Math.log(512/360/.5))/Math.LN10),Oe=Math.pow(10,Te),ht=Math.round(ae.lng*Oe)/Oe,Tt=Math.round(ae.lat*Oe)/Oe,Ot=this._map.getBearing(),Qt=this._map.getPitch(),Ar="";if(Ar+=P?`/${ht}/${Tt}/${xe}`:`${xe}/${Tt}/${ht}`,(Ot||Qt)&&(Ar+="/"+Math.round(10*Ot)/10),Qt&&(Ar+=`/${Math.round(Qt)}`),this._hashName){let Sr=this._hashName,Kr=!1,oi=window.location.hash.slice(1).split("&").map(Ge=>{let Ze=Ge.split("=")[0];return Ze===Sr?(Kr=!0,`${Ze}=${Ar}`):Ge}).filter(Ge=>Ge);return Kr||oi.push(`${Sr}=${Ar}`),`#${oi.join("&")}`}return`#${Ar}`}}let Wu={linearity:.3,easing:t.b8(0,0,.3,1)},Pc=t.e({deceleration:2500,maxSpeed:1400},Wu),xc=t.e({deceleration:20,maxSpeed:1400},Wu),_h=t.e({deceleration:1e3,maxSpeed:360},Wu),ff=t.e({deceleration:1e3,maxSpeed:90},Wu);class yf{constructor(P){this._map=P,this.clear()}clear(){this._inertiaBuffer=[]}record(P){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:n.now(),settings:P})}_drainInertiaBuffer(){let P=this._inertiaBuffer,ae=n.now();for(;P.length>0&&ae-P[0].time>160;)P.shift()}_onMoveEnd(P){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let ae={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:Oe}of this._inertiaBuffer)ae.zoom+=Oe.zoomDelta||0,ae.bearing+=Oe.bearingDelta||0,ae.pitch+=Oe.pitchDelta||0,Oe.panDelta&&ae.pan._add(Oe.panDelta),Oe.around&&(ae.around=Oe.around),Oe.pinchAround&&(ae.pinchAround=Oe.pinchAround);let xe=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,Te={};if(ae.pan.mag()){let Oe=hf(ae.pan.mag(),xe,t.e({},Pc,P||{}));Te.offset=ae.pan.mult(Oe.amount/ae.pan.mag()),Te.center=this._map.transform.center,Xu(Te,Oe)}if(ae.zoom){let Oe=hf(ae.zoom,xe,xc);Te.zoom=this._map.transform.zoom+Oe.amount,Xu(Te,Oe)}if(ae.bearing){let Oe=hf(ae.bearing,xe,_h);Te.bearing=this._map.transform.bearing+t.ac(Oe.amount,-179,179),Xu(Te,Oe)}if(ae.pitch){let Oe=hf(ae.pitch,xe,ff);Te.pitch=this._map.transform.pitch+Oe.amount,Xu(Te,Oe)}if(Te.zoom||Te.bearing){let Oe=ae.pinchAround===void 0?ae.around:ae.pinchAround;Te.around=Oe?this._map.unproject(Oe):this._map.getCenter()}return this.clear(),t.e(Te,{noMoveStart:!0})}}function Xu(Ue,P){(!Ue.duration||Ue.duration<P.duration)&&(Ue.duration=P.duration,Ue.easing=P.easing)}function hf(Ue,P,ae){let{maxSpeed:xe,linearity:Te,deceleration:Oe}=ae,ht=t.ac(Ue*Te/(P/1e3),-xe,xe),Tt=Math.abs(ht)/(Oe*Te);return{easing:ae.easing,duration:1e3*Tt,amount:ht*(Tt/2)}}class hu extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(P,ae,xe,Te={}){let Oe=a.mousePos(ae.getCanvas(),xe),ht=ae.unproject(Oe);super(P,t.e({point:Oe,lngLat:ht,originalEvent:xe},Te)),this._defaultPrevented=!1,this.target=ae}}class Qc extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(P,ae,xe){let Te=P==="touchend"?xe.changedTouches:xe.touches,Oe=a.touchPos(ae.getCanvasContainer(),Te),ht=Oe.map(Ot=>ae.unproject(Ot)),Tt=Oe.reduce((Ot,Qt,Ar,Sr)=>Ot.add(Qt.div(Sr.length)),new t.P(0,0));super(P,{points:Oe,point:Tt,lngLats:ht,lngLat:ae.unproject(Tt),originalEvent:xe}),this._defaultPrevented=!1}}class nh extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(P,ae,xe){super(P,{originalEvent:xe}),this._defaultPrevented=!1}}class _f{constructor(P,ae){this._map=P,this._clickTolerance=ae.clickTolerance}reset(){delete this._mousedownPos}wheel(P){return this._firePreventable(new nh(P.type,this._map,P))}mousedown(P,ae){return this._mousedownPos=ae,this._firePreventable(new hu(P.type,this._map,P))}mouseup(P){this._map.fire(new hu(P.type,this._map,P))}click(P,ae){this._mousedownPos&&this._mousedownPos.dist(ae)>=this._clickTolerance||this._map.fire(new hu(P.type,this._map,P))}dblclick(P){return this._firePreventable(new hu(P.type,this._map,P))}mouseover(P){this._map.fire(new hu(P.type,this._map,P))}mouseout(P){this._map.fire(new hu(P.type,this._map,P))}touchstart(P){return this._firePreventable(new Qc(P.type,this._map,P))}touchmove(P){this._map.fire(new Qc(P.type,this._map,P))}touchend(P){this._map.fire(new Qc(P.type,this._map,P))}touchcancel(P){this._map.fire(new Qc(P.type,this._map,P))}_firePreventable(P){if(this._map.fire(P),P.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class bl{constructor(P){this._map=P}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(P){this._map.fire(new hu(P.type,this._map,P))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new hu("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(P){this._delayContextMenu?this._contextMenuEvent=P:this._ignoreContextMenu||this._map.fire(new hu(P.type,this._map,P)),this._map.listens("contextmenu")&&P.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ku{constructor(P){this._map=P}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(P){return this.transform.pointLocation(t.P.convert(P),this._map.terrain)}}class Ou{constructor(P,ae){this._map=P,this._tr=new ku(P),this._el=P.getCanvasContainer(),this._container=P.getContainer(),this._clickTolerance=ae.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(P,ae){this.isEnabled()&&P.shiftKey&&P.button===0&&(a.disableDrag(),this._startPos=this._lastPos=ae,this._active=!0)}mousemoveWindow(P,ae){if(!this._active)return;let xe=ae;if(this._lastPos.equals(xe)||!this._box&&xe.dist(this._startPos)<this._clickTolerance)return;let Te=this._startPos;this._lastPos=xe,this._box||(this._box=a.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",P));let Oe=Math.min(Te.x,xe.x),ht=Math.max(Te.x,xe.x),Tt=Math.min(Te.y,xe.y),Ot=Math.max(Te.y,xe.y);a.setTransform(this._box,`translate(${Oe}px,${Tt}px)`),this._box.style.width=ht-Oe+"px",this._box.style.height=Ot-Tt+"px"}mouseupWindow(P,ae){if(!this._active||P.button!==0)return;let xe=this._startPos,Te=ae;if(this.reset(),a.suppressClick(),xe.x!==Te.x||xe.y!==Te.y)return this._map.fire(new t.k("boxzoomend",{originalEvent:P})),{cameraAnimation:Oe=>Oe.fitScreenCoordinates(xe,Te,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",P)}keydown(P){this._active&&P.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",P))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(a.remove(this._box),this._box=null),a.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(P,ae){return this._map.fire(new t.k(P,{originalEvent:ae}))}}function Cf(Ue,P){if(Ue.length!==P.length)throw new Error(`The number of touches and points are not equal - touches ${Ue.length}, points ${P.length}`);let ae={};for(let xe=0;xe<Ue.length;xe++)ae[Ue[xe].identifier]=P[xe];return ae}class Ml{constructor(P){this.reset(),this.numTouches=P.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(P,ae,xe){(this.centroid||xe.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=P.timeStamp),xe.length===this.numTouches&&(this.centroid=function(Te){let Oe=new t.P(0,0);for(let ht of Te)Oe._add(ht);return Oe.div(Te.length)}(ae),this.touches=Cf(xe,ae)))}touchmove(P,ae,xe){if(this.aborted||!this.centroid)return;let Te=Cf(xe,ae);for(let Oe in this.touches){let ht=Te[Oe];(!ht||ht.dist(this.touches[Oe])>30)&&(this.aborted=!0)}}touchend(P,ae,xe){if((!this.centroid||P.timeStamp-this.startTime>500)&&(this.aborted=!0),xe.length===0){let Te=!this.aborted&&this.centroid;if(this.reset(),Te)return Te}}}class df{constructor(P){this.singleTap=new Ml(P),this.numTaps=P.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(P,ae,xe){this.singleTap.touchstart(P,ae,xe)}touchmove(P,ae,xe){this.singleTap.touchmove(P,ae,xe)}touchend(P,ae,xe){let Te=this.singleTap.touchend(P,ae,xe);if(Te){let Oe=P.timeStamp-this.lastTime<500,ht=!this.lastTap||this.lastTap.dist(Te)<30;if(Oe&&ht||this.reset(),this.count++,this.lastTime=P.timeStamp,this.lastTap=Te,this.count===this.numTaps)return this.reset(),Te}}}class Rc{constructor(P){this._tr=new ku(P),this._zoomIn=new df({numTouches:1,numTaps:2}),this._zoomOut=new df({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(P,ae,xe){this._zoomIn.touchstart(P,ae,xe),this._zoomOut.touchstart(P,ae,xe)}touchmove(P,ae,xe){this._zoomIn.touchmove(P,ae,xe),this._zoomOut.touchmove(P,ae,xe)}touchend(P,ae,xe){let Te=this._zoomIn.touchend(P,ae,xe),Oe=this._zoomOut.touchend(P,ae,xe),ht=this._tr;return Te?(this._active=!0,P.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:Tt=>Tt.easeTo({duration:300,zoom:ht.zoom+1,around:ht.unproject(Te)},{originalEvent:P})}):Oe?(this._active=!0,P.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:Tt=>Tt.easeTo({duration:300,zoom:ht.zoom-1,around:ht.unproject(Oe)},{originalEvent:P})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ju{constructor(P){this._enabled=!!P.enable,this._moveStateManager=P.moveStateManager,this._clickTolerance=P.clickTolerance||1,this._moveFunction=P.move,this._activateOnStart=!!P.activateOnStart,P.assignEvents(this),this.reset()}reset(P){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(P)}_move(...P){let ae=this._moveFunction(...P);if(ae.bearingDelta||ae.pitchDelta||ae.around||ae.panDelta)return this._active=!0,ae}dragStart(P,ae){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(P)&&(this._moveStateManager.startMove(P),this._lastPoint=ae.length?ae[0]:ae,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(P,ae){if(!this.isEnabled())return;let xe=this._lastPoint;if(!xe)return;if(P.preventDefault(),!this._moveStateManager.isValidMoveEvent(P))return void this.reset(P);let Te=ae.length?ae[0]:ae;return!this._moved&&Te.dist(xe)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=Te,this._move(xe,Te))}dragEnd(P){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(P)&&(this._moved&&a.suppressClick(),this.reset(P))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let xf={0:1,2:2};class Qu{constructor(P){this._correctEvent=P.checkCorrectEvent}startMove(P){let ae=a.mouseButton(P);this._eventButton=ae}endMove(P){delete this._eventButton}isValidStartEvent(P){return this._correctEvent(P)}isValidMoveEvent(P){return!function(ae,xe){let Te=xf[xe];return ae.buttons===void 0||(ae.buttons&Te)!==Te}(P,this._eventButton)}isValidEndEvent(P){return a.mouseButton(P)===this._eventButton}}class ef{constructor(){this._firstTouch=void 0}_isOneFingerTouch(P){return P.targetTouches.length===1}_isSameTouchEvent(P){return P.targetTouches[0].identifier===this._firstTouch}startMove(P){this._firstTouch=P.targetTouches[0].identifier}endMove(P){delete this._firstTouch}isValidStartEvent(P){return this._isOneFingerTouch(P)}isValidMoveEvent(P){return this._isOneFingerTouch(P)&&this._isSameTouchEvent(P)}isValidEndEvent(P){return this._isOneFingerTouch(P)&&this._isSameTouchEvent(P)}}let Lf=Ue=>{Ue.mousedown=Ue.dragStart,Ue.mousemoveWindow=Ue.dragMove,Ue.mouseup=Ue.dragEnd,Ue.contextmenu=P=>{P.preventDefault()}},du=({enable:Ue,clickTolerance:P,bearingDegreesPerPixelMoved:ae=.8})=>{let xe=new Qu({checkCorrectEvent:Te=>a.mouseButton(Te)===0&&Te.ctrlKey||a.mouseButton(Te)===2});return new Ju({clickTolerance:P,move:(Te,Oe)=>({bearingDelta:(Oe.x-Te.x)*ae}),moveStateManager:xe,enable:Ue,assignEvents:Lf})},Nf=({enable:Ue,clickTolerance:P,pitchDegreesPerPixelMoved:ae=-.5})=>{let xe=new Qu({checkCorrectEvent:Te=>a.mouseButton(Te)===0&&Te.ctrlKey||a.mouseButton(Te)===2});return new Ju({clickTolerance:P,move:(Te,Oe)=>({pitchDelta:(Oe.y-Te.y)*ae}),moveStateManager:xe,enable:Ue,assignEvents:Lf})};class ec{constructor(P,ae){this._clickTolerance=P.clickTolerance||1,this._map=ae,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(P){return P<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(P,ae,xe){return this._calculateTransform(P,ae,xe)}touchmove(P,ae,xe){if(this._active){if(!this._shouldBePrevented(xe.length))return P.preventDefault(),this._calculateTransform(P,ae,xe);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",P)}}touchend(P,ae,xe){this._calculateTransform(P,ae,xe),this._active&&this._shouldBePrevented(xe.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(P,ae,xe){xe.length>0&&(this._active=!0);let Te=Cf(xe,ae),Oe=new t.P(0,0),ht=new t.P(0,0),Tt=0;for(let Qt in Te){let Ar=Te[Qt],Sr=this._touches[Qt];Sr&&(Oe._add(Ar),ht._add(Ar.sub(Sr)),Tt++,Te[Qt]=Ar)}if(this._touches=Te,this._shouldBePrevented(Tt)||!ht.mag())return;let Ot=ht.div(Tt);return this._sum._add(Ot),this._sum.mag()<this._clickTolerance?void 0:{around:Oe.div(Tt),panDelta:Ot}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Dc{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(P,ae,xe){this._firstTwoTouches||xe.length<2||(this._firstTwoTouches=[xe[0].identifier,xe[1].identifier],this._start([ae[0],ae[1]]))}touchmove(P,ae,xe){if(!this._firstTwoTouches)return;P.preventDefault();let[Te,Oe]=this._firstTwoTouches,ht=bc(xe,ae,Te),Tt=bc(xe,ae,Oe);if(!ht||!Tt)return;let Ot=this._aroundCenter?null:ht.add(Tt).div(2);return this._move([ht,Tt],Ot,P)}touchend(P,ae,xe){if(!this._firstTwoTouches)return;let[Te,Oe]=this._firstTwoTouches,ht=bc(xe,ae,Te),Tt=bc(xe,ae,Oe);ht&&Tt||(this._active&&a.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(P){this._enabled=!0,this._aroundCenter=!!P&&P.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function bc(Ue,P,ae){for(let xe=0;xe<Ue.length;xe++)if(Ue[xe].identifier===ae)return P[xe]}function Jl(Ue,P){return Math.log(Ue/P)/Math.LN2}class Cu extends Dc{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(P){this._startDistance=this._distance=P[0].dist(P[1])}_move(P,ae){let xe=this._distance;if(this._distance=P[0].dist(P[1]),this._active||!(Math.abs(Jl(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Jl(this._distance,xe),pinchAround:ae}}}function zc(Ue,P){return 180*Ue.angleWith(P)/Math.PI}class tf extends Dc{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(P){this._startVector=this._vector=P[0].sub(P[1]),this._minDiameter=P[0].dist(P[1])}_move(P,ae,xe){let Te=this._vector;if(this._vector=P[0].sub(P[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:zc(this._vector,Te),pinchAround:ae}}_isBelowThreshold(P){this._minDiameter=Math.min(this._minDiameter,P.mag());let ae=25/(Math.PI*this._minDiameter)*360,xe=zc(P,this._startVector);return Math.abs(xe)<ae}}function fc(Ue){return Math.abs(Ue.y)>Math.abs(Ue.x)}class Fc extends Dc{constructor(P){super(),this._currentTouchCount=0,this._map=P}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(P,ae,xe){super.touchstart(P,ae,xe),this._currentTouchCount=xe.length}_start(P){this._lastPoints=P,fc(P[0].sub(P[1]))&&(this._valid=!1)}_move(P,ae,xe){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let Te=P[0].sub(this._lastPoints[0]),Oe=P[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(Te,Oe,xe.timeStamp),this._valid?(this._lastPoints=P,this._active=!0,{pitchDelta:(Te.y+Oe.y)/2*-.5}):void 0}gestureBeginsVertically(P,ae,xe){if(this._valid!==void 0)return this._valid;let Te=P.mag()>=2,Oe=ae.mag()>=2;if(!Te&&!Oe)return;if(!Te||!Oe)return this._firstMove===void 0&&(this._firstMove=xe),xe-this._firstMove<100&&void 0;let ht=P.y>0==ae.y>0;return fc(P)&&fc(ae)&&ht}}let er={panStep:100,bearingStep:15,pitchStep:10};class wr{constructor(P){this._tr=new ku(P);let ae=er;this._panStep=ae.panStep,this._bearingStep=ae.bearingStep,this._pitchStep=ae.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(P){if(P.altKey||P.ctrlKey||P.metaKey)return;let ae=0,xe=0,Te=0,Oe=0,ht=0;switch(P.keyCode){case 61:case 107:case 171:case 187:ae=1;break;case 189:case 109:case 173:ae=-1;break;case 37:P.shiftKey?xe=-1:(P.preventDefault(),Oe=-1);break;case 39:P.shiftKey?xe=1:(P.preventDefault(),Oe=1);break;case 38:P.shiftKey?Te=1:(P.preventDefault(),ht=-1);break;case 40:P.shiftKey?Te=-1:(P.preventDefault(),ht=1);break;default:return}return this._rotationDisabled&&(xe=0,Te=0),{cameraAnimation:Tt=>{let Ot=this._tr;Tt.easeTo({duration:300,easeId:"keyboardHandler",easing:ai,zoom:ae?Math.round(Ot.zoom)+ae*(P.shiftKey?2:1):Ot.zoom,bearing:Ot.bearing+xe*this._bearingStep,pitch:Ot.pitch+Te*this._pitchStep,offset:[-Oe*this._panStep,-ht*this._panStep],center:Ot.center},{originalEvent:P})}}}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 ai(Ue){return Ue*(2-Ue)}let Jr=4.000244140625;class Fi{constructor(P,ae){this._onTimeout=xe=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(xe)},this._map=P,this._tr=new ku(P),this._triggerRenderFrame=ae,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(P){this._defaultZoomRate=P}setWheelZoomRate(P){this._wheelZoomRate=P}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(P){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!P&&P.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(P){return!!this._map.cooperativeGestures.isEnabled()&&!(P.ctrlKey||this._map.cooperativeGestures.isBypassed(P))}wheel(P){if(!this.isEnabled())return;if(this._shouldBePrevented(P))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",P);let ae=P.deltaMode===WheelEvent.DOM_DELTA_LINE?40*P.deltaY:P.deltaY,xe=n.now(),Te=xe-(this._lastWheelEventTime||0);this._lastWheelEventTime=xe,ae!==0&&ae%Jr==0?this._type="wheel":ae!==0&&Math.abs(ae)<4?this._type="trackpad":Te>400?(this._type=null,this._lastValue=ae,this._timeout=setTimeout(this._onTimeout,40,P)):this._type||(this._type=Math.abs(Te*ae)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,ae+=this._lastValue)),P.shiftKey&&ae&&(ae/=4),this._type&&(this._lastWheelEvent=P,this._delta-=ae,this._active||this._start(P)),P.preventDefault()}_start(P){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 ae=a.mousePos(this._map.getCanvas(),P),xe=this._tr;this._around=ae.y>xe.transform.height/2-xe.transform.getHorizon()?t.N.convert(this._aroundCenter?xe.center:xe.unproject(ae)):t.N.convert(xe.center),this._aroundPoint=xe.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let P=this._tr.transform;if(this._delta!==0){let Ot=this._type==="wheel"&&Math.abs(this._delta)>Jr?this._wheelZoomRate:this._defaultZoomRate,Qt=2/(1+Math.exp(-Math.abs(this._delta*Ot)));this._delta<0&&Qt!==0&&(Qt=1/Qt);let Ar=typeof this._targetZoom=="number"?P.zoomScale(this._targetZoom):P.scale;this._targetZoom=Math.min(P.maxZoom,Math.max(P.minZoom,P.scaleZoom(Ar*Qt))),this._type==="wheel"&&(this._startZoom=P.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let ae=typeof this._targetZoom=="number"?this._targetZoom:P.zoom,xe=this._startZoom,Te=this._easing,Oe,ht=!1,Tt=n.now()-this._lastWheelEventTime;if(this._type==="wheel"&&xe&&Te&&Tt){let Ot=Math.min(Tt/200,1),Qt=Te(Ot);Oe=t.y.number(xe,ae,Qt),Ot<1?this._frameId||(this._frameId=!0):ht=!0}else Oe=ae,ht=!0;return this._active=!0,ht&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ht,zoomDelta:Oe-P.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(P){let ae=t.b9;if(this._prevEase){let xe=this._prevEase,Te=(n.now()-xe.start)/xe.duration,Oe=xe.easing(Te+.01)-xe.easing(Te),ht=.27/Math.sqrt(Oe*Oe+1e-4)*.01,Tt=Math.sqrt(.0729-ht*ht);ae=t.b8(ht,Tt,.25,1)}return this._prevEase={start:n.now(),duration:P,easing:ae},ae}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class pa{constructor(P,ae){this._clickZoom=P,this._tapZoom=ae}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 Ba{constructor(P){this._tr=new ku(P),this.reset()}reset(){this._active=!1}dblclick(P,ae){return P.preventDefault(),{cameraAnimation:xe=>{xe.easeTo({duration:300,zoom:this._tr.zoom+(P.shiftKey?-1:1),around:this._tr.unproject(ae)},{originalEvent:P})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class an{constructor(){this._tap=new df({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(P,ae,xe){if(!this._swipePoint)if(this._tapTime){let Te=ae[0],Oe=P.timeStamp-this._tapTime<500,ht=this._tapPoint.dist(Te)<30;Oe&&ht?xe.length>0&&(this._swipePoint=Te,this._swipeTouch=xe[0].identifier):this.reset()}else this._tap.touchstart(P,ae,xe)}touchmove(P,ae,xe){if(this._tapTime){if(this._swipePoint){if(xe[0].identifier!==this._swipeTouch)return;let Te=ae[0],Oe=Te.y-this._swipePoint.y;return this._swipePoint=Te,P.preventDefault(),this._active=!0,{zoomDelta:Oe/128}}}else this._tap.touchmove(P,ae,xe)}touchend(P,ae,xe){if(this._tapTime)this._swipePoint&&xe.length===0&&this.reset();else{let Te=this._tap.touchend(P,ae,xe);Te&&(this._tapTime=P.timeStamp,this._tapPoint=Te)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class hn{constructor(P,ae,xe){this._el=P,this._mousePan=ae,this._touchPan=xe}enable(P){this._inertiaOptions=P||{},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 Ln{constructor(P,ae,xe){this._pitchWithRotate=P.pitchWithRotate,this._mouseRotate=ae,this._mousePitch=xe}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 Na{constructor(P,ae,xe,Te){this._el=P,this._touchZoom=ae,this._touchRotate=xe,this._tapDragZoom=Te,this._rotationDisabled=!1,this._enabled=!0}enable(P){this._touchZoom.enable(P),this._rotationDisabled||this._touchRotate.enable(P),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 qa{constructor(P,ae){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=P,this._options=ae,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let P=this._map.getCanvasContainer();P.classList.add("maplibregl-cooperative-gestures"),this._container=a.create("div","maplibregl-cooperative-gesture-screen",P);let ae=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(ae=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let xe=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),Te=document.createElement("div");Te.className="maplibregl-desktop-message",Te.textContent=ae,this._container.appendChild(Te);let Oe=document.createElement("div");Oe.className="maplibregl-mobile-message",Oe.textContent=xe,this._container.appendChild(Oe),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(a.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(P){return P[this._bypassKey]}notifyGestureBlocked(P,ae){this._enabled&&(this._map.fire(new t.k("cooperativegestureprevented",{gestureType:P,originalEvent:ae})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let Za=Ue=>Ue.zoom||Ue.drag||Ue.pitch||Ue.rotate;class Ta extends t.k{}function Hn(Ue){return Ue.panDelta&&Ue.panDelta.mag()||Ue.zoomDelta||Ue.bearingDelta||Ue.pitchDelta}class go{constructor(P,ae){this.handleWindowEvent=Te=>{this.handleEvent(Te,`${Te.type}Window`)},this.handleEvent=(Te,Oe)=>{if(Te.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let ht=Te.type==="renderFrame"?void 0:Te,Tt={needsRenderFrame:!1},Ot={},Qt={},Ar=Te.touches,Sr=Ar?this._getMapTouches(Ar):void 0,Kr=Sr?a.touchPos(this._map.getCanvas(),Sr):a.mousePos(this._map.getCanvas(),Te);for(let{handlerName:Ze,handler:ot,allowed:dt}of this._handlers){if(!ot.isEnabled())continue;let Ct;this._blockedByActive(Qt,dt,Ze)?ot.reset():ot[Oe||Te.type]&&(Ct=ot[Oe||Te.type](Te,Kr,Sr),this.mergeHandlerResult(Tt,Ot,Ct,Ze,ht),Ct&&Ct.needsRenderFrame&&this._triggerRenderFrame()),(Ct||ot.isActive())&&(Qt[Ze]=ot)}let oi={};for(let Ze in this._previousActiveHandlers)Qt[Ze]||(oi[Ze]=ht);this._previousActiveHandlers=Qt,(Object.keys(oi).length||Hn(Tt))&&(this._changes.push([Tt,Ot,oi]),this._triggerRenderFrame()),(Object.keys(Qt).length||Hn(Tt))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:Ge}=Tt;Ge&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Ge(this._map))},this._map=P,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new yf(P),this._bearingSnap=ae.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(ae);let xe=this._el;this._listeners=[[xe,"touchstart",{passive:!0}],[xe,"touchmove",{passive:!1}],[xe,"touchend",void 0],[xe,"touchcancel",void 0],[xe,"mousedown",void 0],[xe,"mousemove",void 0],[xe,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[xe,"mouseover",void 0],[xe,"mouseout",void 0],[xe,"dblclick",void 0],[xe,"click",void 0],[xe,"keydown",{capture:!1}],[xe,"keyup",void 0],[xe,"wheel",{passive:!1}],[xe,"contextmenu",void 0],[window,"blur",void 0]];for(let[Te,Oe,ht]of this._listeners)a.addEventListener(Te,Oe,Te===document?this.handleWindowEvent:this.handleEvent,ht)}destroy(){for(let[P,ae,xe]of this._listeners)a.removeEventListener(P,ae,P===document?this.handleWindowEvent:this.handleEvent,xe)}_addDefaultHandlers(P){let ae=this._map,xe=ae.getCanvasContainer();this._add("mapEvent",new _f(ae,P));let Te=ae.boxZoom=new Ou(ae,P);this._add("boxZoom",Te),P.interactive&&P.boxZoom&&Te.enable();let Oe=ae.cooperativeGestures=new qa(ae,P.cooperativeGestures);this._add("cooperativeGestures",Oe),P.cooperativeGestures&&Oe.enable();let ht=new Rc(ae),Tt=new Ba(ae);ae.doubleClickZoom=new pa(Tt,ht),this._add("tapZoom",ht),this._add("clickZoom",Tt),P.interactive&&P.doubleClickZoom&&ae.doubleClickZoom.enable();let Ot=new an;this._add("tapDragZoom",Ot);let Qt=ae.touchPitch=new Fc(ae);this._add("touchPitch",Qt),P.interactive&&P.touchPitch&&ae.touchPitch.enable(P.touchPitch);let Ar=du(P),Sr=Nf(P);ae.dragRotate=new Ln(P,Ar,Sr),this._add("mouseRotate",Ar,["mousePitch"]),this._add("mousePitch",Sr,["mouseRotate"]),P.interactive&&P.dragRotate&&ae.dragRotate.enable();let Kr=(({enable:Ct,clickTolerance:wt})=>{let Dt=new Qu({checkCorrectEvent:fr=>a.mouseButton(fr)===0&&!fr.ctrlKey});return new Ju({clickTolerance:wt,move:(fr,_r)=>({around:_r,panDelta:_r.sub(fr)}),activateOnStart:!0,moveStateManager:Dt,enable:Ct,assignEvents:Lf})})(P),oi=new ec(P,ae);ae.dragPan=new hn(xe,Kr,oi),this._add("mousePan",Kr),this._add("touchPan",oi,["touchZoom","touchRotate"]),P.interactive&&P.dragPan&&ae.dragPan.enable(P.dragPan);let Ge=new tf,Ze=new Cu;ae.touchZoomRotate=new Na(xe,Ze,Ge,Ot),this._add("touchRotate",Ge,["touchPan","touchZoom"]),this._add("touchZoom",Ze,["touchPan","touchRotate"]),P.interactive&&P.touchZoomRotate&&ae.touchZoomRotate.enable(P.touchZoomRotate);let ot=ae.scrollZoom=new Fi(ae,()=>this._triggerRenderFrame());this._add("scrollZoom",ot,["mousePan"]),P.interactive&&P.scrollZoom&&ae.scrollZoom.enable(P.scrollZoom);let dt=ae.keyboard=new wr(ae);this._add("keyboard",dt),P.interactive&&P.keyboard&&ae.keyboard.enable(),this._add("blockableMapEvent",new bl(ae))}_add(P,ae,xe){this._handlers.push({handlerName:P,handler:ae,allowed:xe}),this._handlersById[P]=ae}stop(P){if(!this._updatingCamera){for(let{handler:ae}of this._handlers)ae.reset();this._inertia.clear(),this._fireEvents({},{},P),this._changes=[]}}isActive(){for(let{handler:P}of this._handlers)if(P.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Za(this._eventsInProgress)||this.isZooming()}_blockedByActive(P,ae,xe){for(let Te in P)if(Te!==xe&&(!ae||ae.indexOf(Te)<0))return!0;return!1}_getMapTouches(P){let ae=[];for(let xe of P)this._el.contains(xe.target)&&ae.push(xe);return ae}mergeHandlerResult(P,ae,xe,Te,Oe){if(!xe)return;t.e(P,xe);let ht={handlerName:Te,originalEvent:xe.originalEvent||Oe};xe.zoomDelta!==void 0&&(ae.zoom=ht),xe.panDelta!==void 0&&(ae.drag=ht),xe.pitchDelta!==void 0&&(ae.pitch=ht),xe.bearingDelta!==void 0&&(ae.rotate=ht)}_applyChanges(){let P={},ae={},xe={};for(let[Te,Oe,ht]of this._changes)Te.panDelta&&(P.panDelta=(P.panDelta||new t.P(0,0))._add(Te.panDelta)),Te.zoomDelta&&(P.zoomDelta=(P.zoomDelta||0)+Te.zoomDelta),Te.bearingDelta&&(P.bearingDelta=(P.bearingDelta||0)+Te.bearingDelta),Te.pitchDelta&&(P.pitchDelta=(P.pitchDelta||0)+Te.pitchDelta),Te.around!==void 0&&(P.around=Te.around),Te.pinchAround!==void 0&&(P.pinchAround=Te.pinchAround),Te.noInertia&&(P.noInertia=Te.noInertia),t.e(ae,Oe),t.e(xe,ht);this._updateMapTransform(P,ae,xe),this._changes=[]}_updateMapTransform(P,ae,xe){let Te=this._map,Oe=Te._getTransformForUpdate(),ht=Te.terrain;if(!(Hn(P)||ht&&this._terrainMovement))return this._fireEvents(ae,xe,!0);let{panDelta:Tt,zoomDelta:Ot,bearingDelta:Qt,pitchDelta:Ar,around:Sr,pinchAround:Kr}=P;Kr!==void 0&&(Sr=Kr),Te._stop(!0),Sr=Sr||Te.transform.centerPoint;let oi=Oe.pointLocation(Tt?Sr.sub(Tt):Sr);Qt&&(Oe.bearing+=Qt),Ar&&(Oe.pitch+=Ar),Ot&&(Oe.zoom+=Ot),ht?this._terrainMovement||!ae.drag&&!ae.zoom?ae.drag&&this._terrainMovement?Oe.center=Oe.pointLocation(Oe.centerPoint.sub(Tt)):Oe.setLocationAtPoint(oi,Sr):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Oe.setLocationAtPoint(oi,Sr)):Oe.setLocationAtPoint(oi,Sr),Te._applyUpdatedTransform(Oe),this._map._update(),P.noInertia||this._inertia.record(P),this._fireEvents(ae,xe,!0)}_fireEvents(P,ae,xe){let Te=Za(this._eventsInProgress),Oe=Za(P),ht={};for(let Sr in P){let{originalEvent:Kr}=P[Sr];this._eventsInProgress[Sr]||(ht[`${Sr}start`]=Kr),this._eventsInProgress[Sr]=P[Sr]}!Te&&Oe&&this._fireEvent("movestart",Oe.originalEvent);for(let Sr in ht)this._fireEvent(Sr,ht[Sr]);Oe&&this._fireEvent("move",Oe.originalEvent);for(let Sr in P){let{originalEvent:Kr}=P[Sr];this._fireEvent(Sr,Kr)}let Tt={},Ot;for(let Sr in this._eventsInProgress){let{handlerName:Kr,originalEvent:oi}=this._eventsInProgress[Sr];this._handlersById[Kr].isActive()||(delete this._eventsInProgress[Sr],Ot=ae[Kr]||oi,Tt[`${Sr}end`]=Ot)}for(let Sr in Tt)this._fireEvent(Sr,Tt[Sr]);let Qt=Za(this._eventsInProgress),Ar=(Te||Oe)&&!Qt;if(Ar&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let Sr=this._map._getTransformForUpdate();Sr.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(Sr)}if(xe&&Ar){this._updatingCamera=!0;let Sr=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Kr=oi=>oi!==0&&-this._bearingSnap<oi&&oi<this._bearingSnap;!Sr||!Sr.essential&&n.prefersReducedMotion?(this._map.fire(new t.k("moveend",{originalEvent:Ot})),Kr(this._map.getBearing())&&this._map.resetNorth()):(Kr(Sr.bearing||this._map.getBearing())&&(Sr.bearing=0),Sr.freezeElevation=!0,this._map.easeTo(Sr,{originalEvent:Ot})),this._updatingCamera=!1}}_fireEvent(P,ae){this._map.fire(new t.k(P,ae?{originalEvent:ae}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(P=>{delete this._frameId,this.handleEvent(new Ta("renderFrame",{timeStamp:P})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class wo extends t.E{constructor(P,ae){super(),this._renderFrameCallback=()=>{let xe=Math.min((n.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(xe)),xe<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=P,this._bearingSnap=ae.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new t.N(this.transform.center.lng,this.transform.center.lat)}setCenter(P,ae){return this.jumpTo({center:P},ae)}panBy(P,ae,xe){return P=t.P.convert(P).mult(-1),this.panTo(this.transform.center,t.e({offset:P},ae),xe)}panTo(P,ae,xe){return this.easeTo(t.e({center:P},ae),xe)}getZoom(){return this.transform.zoom}setZoom(P,ae){return this.jumpTo({zoom:P},ae),this}zoomTo(P,ae,xe){return this.easeTo(t.e({zoom:P},ae),xe)}zoomIn(P,ae){return this.zoomTo(this.getZoom()+1,P,ae),this}zoomOut(P,ae){return this.zoomTo(this.getZoom()-1,P,ae),this}getBearing(){return this.transform.bearing}setBearing(P,ae){return this.jumpTo({bearing:P},ae),this}getPadding(){return this.transform.padding}setPadding(P,ae){return this.jumpTo({padding:P},ae),this}rotateTo(P,ae,xe){return this.easeTo(t.e({bearing:P},ae),xe)}resetNorth(P,ae){return this.rotateTo(0,t.e({duration:1e3},P),ae),this}resetNorthPitch(P,ae){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},P),ae),this}snapToNorth(P,ae){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(P,ae):this}getPitch(){return this.transform.pitch}setPitch(P,ae){return this.jumpTo({pitch:P},ae),this}cameraForBounds(P,ae){P=re.convert(P).adjustAntiMeridian();let xe=ae&&ae.bearing||0;return this._cameraForBoxAndBearing(P.getNorthWest(),P.getSouthEast(),xe,ae)}_cameraForBoxAndBearing(P,ae,xe,Te){let Oe={top:0,bottom:0,right:0,left:0};if(typeof(Te=t.e({padding:Oe,offset:[0,0],maxZoom:this.transform.maxZoom},Te)).padding=="number"){let Pi=Te.padding;Te.padding={top:Pi,bottom:Pi,right:Pi,left:Pi}}Te.padding=t.e(Oe,Te.padding);let ht=this.transform,Tt=ht.padding,Ot=new re(P,ae),Qt=ht.project(Ot.getNorthWest()),Ar=ht.project(Ot.getNorthEast()),Sr=ht.project(Ot.getSouthEast()),Kr=ht.project(Ot.getSouthWest()),oi=t.ba(-xe),Ge=Qt.rotate(oi),Ze=Ar.rotate(oi),ot=Sr.rotate(oi),dt=Kr.rotate(oi),Ct=new t.P(Math.max(Ge.x,Ze.x,dt.x,ot.x),Math.max(Ge.y,Ze.y,dt.y,ot.y)),wt=new t.P(Math.min(Ge.x,Ze.x,dt.x,ot.x),Math.min(Ge.y,Ze.y,dt.y,ot.y)),Dt=Ct.sub(wt),fr=(ht.width-(Tt.left+Tt.right+Te.padding.left+Te.padding.right))/Dt.x,_r=(ht.height-(Tt.top+Tt.bottom+Te.padding.top+Te.padding.bottom))/Dt.y;if(_r<0||fr<0)return void t.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let kr=Math.min(ht.scaleZoom(ht.scale*Math.min(fr,_r)),Te.maxZoom),Vr=t.P.convert(Te.offset),Qr=new t.P((Te.padding.left-Te.padding.right)/2,(Te.padding.top-Te.padding.bottom)/2).rotate(t.ba(xe)),_i=Vr.add(Qr).mult(ht.scale/ht.zoomScale(kr));return{center:ht.unproject(Qt.add(Sr).div(2).sub(_i)),zoom:kr,bearing:xe}}fitBounds(P,ae,xe){return this._fitInternal(this.cameraForBounds(P,ae),ae,xe)}fitScreenCoordinates(P,ae,xe,Te,Oe){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.P.convert(P)),this.transform.pointLocation(t.P.convert(ae)),xe,Te),Te,Oe)}_fitInternal(P,ae,xe){return P?(delete(ae=t.e(P,ae)).padding,ae.linear?this.easeTo(ae,xe):this.flyTo(ae,xe)):this}jumpTo(P,ae){this.stop();let xe=this._getTransformForUpdate(),Te=!1,Oe=!1,ht=!1;return"zoom"in P&&xe.zoom!==+P.zoom&&(Te=!0,xe.zoom=+P.zoom),P.center!==void 0&&(xe.center=t.N.convert(P.center)),"bearing"in P&&xe.bearing!==+P.bearing&&(Oe=!0,xe.bearing=+P.bearing),"pitch"in P&&xe.pitch!==+P.pitch&&(ht=!0,xe.pitch=+P.pitch),P.padding==null||xe.isPaddingEqual(P.padding)||(xe.padding=P.padding),this._applyUpdatedTransform(xe),this.fire(new t.k("movestart",ae)).fire(new t.k("move",ae)),Te&&this.fire(new t.k("zoomstart",ae)).fire(new t.k("zoom",ae)).fire(new t.k("zoomend",ae)),Oe&&this.fire(new t.k("rotatestart",ae)).fire(new t.k("rotate",ae)).fire(new t.k("rotateend",ae)),ht&&this.fire(new t.k("pitchstart",ae)).fire(new t.k("pitch",ae)).fire(new t.k("pitchend",ae)),this.fire(new t.k("moveend",ae))}calculateCameraOptionsFromTo(P,ae,xe,Te=0){let Oe=t.Z.fromLngLat(P,ae),ht=t.Z.fromLngLat(xe,Te),Tt=ht.x-Oe.x,Ot=ht.y-Oe.y,Qt=ht.z-Oe.z,Ar=Math.hypot(Tt,Ot,Qt);if(Ar===0)throw new Error("Can't calculate camera options with same From and To");let Sr=Math.hypot(Tt,Ot),Kr=this.transform.scaleZoom(this.transform.cameraToCenterDistance/Ar/this.transform.tileSize),oi=180*Math.atan2(Tt,-Ot)/Math.PI,Ge=180*Math.acos(Sr/Ar)/Math.PI;return Ge=Qt<0?90-Ge:90+Ge,{center:ht.toLngLat(),zoom:Kr,pitch:Ge,bearing:oi}}easeTo(P,ae){var xe;this._stop(!1,P.easeId),((P=t.e({offset:[0,0],duration:500,easing:t.b9},P)).animate===!1||!P.essential&&n.prefersReducedMotion)&&(P.duration=0);let Te=this._getTransformForUpdate(),Oe=Te.zoom,ht=Te.bearing,Tt=Te.pitch,Ot=Te.padding,Qt="bearing"in P?this._normalizeBearing(P.bearing,ht):ht,Ar="pitch"in P?+P.pitch:Tt,Sr="padding"in P?P.padding:Te.padding,Kr=t.P.convert(P.offset),oi=Te.centerPoint.add(Kr),Ge=Te.pointLocation(oi),{center:Ze,zoom:ot}=Te.getConstrained(t.N.convert(P.center||Ge),(xe=P.zoom)!==null&&xe!==void 0?xe:Oe);this._normalizeCenter(Ze,Te);let dt=Te.project(Ge),Ct=Te.project(Ze).sub(dt),wt=Te.zoomScale(ot-Oe),Dt,fr;P.around&&(Dt=t.N.convert(P.around),fr=Te.locationPoint(Dt));let _r={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||ot!==Oe,this._rotating=this._rotating||ht!==Qt,this._pitching=this._pitching||Ar!==Tt,this._padding=!Te.isPaddingEqual(Sr),this._easeId=P.easeId,this._prepareEase(ae,P.noMoveStart,_r),this.terrain&&this._prepareElevation(Ze),this._ease(kr=>{if(this._zooming&&(Te.zoom=t.y.number(Oe,ot,kr)),this._rotating&&(Te.bearing=t.y.number(ht,Qt,kr)),this._pitching&&(Te.pitch=t.y.number(Tt,Ar,kr)),this._padding&&(Te.interpolatePadding(Ot,Sr,kr),oi=Te.centerPoint.add(Kr)),this.terrain&&!P.freezeElevation&&this._updateElevation(kr),Dt)Te.setLocationAtPoint(Dt,fr);else{let Vr=Te.zoomScale(Te.zoom-Oe),Qr=ot>Oe?Math.min(2,wt):Math.max(.5,wt),_i=Math.pow(Qr,1-kr),Pi=Te.unproject(dt.add(Ct.mult(kr*_i)).mult(Vr));Te.setLocationAtPoint(Te.renderWorldCopies?Pi.wrap():Pi,oi)}this._applyUpdatedTransform(Te),this._fireMoveEvents(ae)},kr=>{this.terrain&&P.freezeElevation&&this._finalizeElevation(),this._afterEase(ae,kr)},P),this}_prepareEase(P,ae,xe={}){this._moving=!0,ae||xe.moving||this.fire(new t.k("movestart",P)),this._zooming&&!xe.zooming&&this.fire(new t.k("zoomstart",P)),this._rotating&&!xe.rotating&&this.fire(new t.k("rotatestart",P)),this._pitching&&!xe.pitching&&this.fire(new t.k("pitchstart",P))}_prepareElevation(P){this._elevationCenter=P,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(P,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(P){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let ae=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(P<1&&ae!==this._elevationTarget){let xe=this._elevationTarget-this._elevationStart;this._elevationStart+=P*(xe-(ae-(xe*P+this._elevationStart))/(1-P)),this._elevationTarget=ae}this.transform.elevation=t.y.number(this._elevationStart,this._elevationTarget,P)}_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(P){let ae=P.getCameraPosition(),xe=this.terrain.getElevationForLngLatZoom(ae.lngLat,P.zoom);if(ae.altitude<xe){let Te=this.calculateCameraOptionsFromTo(ae.lngLat,xe,P.center,P.elevation);return{pitch:Te.pitch,zoom:Te.zoom}}return{}}_applyUpdatedTransform(P){let ae=[];if(this.terrain&&ae.push(Te=>this._elevateCameraIfInsideTerrain(Te)),this.transformCameraUpdate&&ae.push(Te=>this.transformCameraUpdate(Te)),!ae.length)return;let xe=P.clone();for(let Te of ae){let Oe=xe.clone(),{center:ht,zoom:Tt,pitch:Ot,bearing:Qt,elevation:Ar}=Te(Oe);ht&&(Oe.center=ht),Tt!==void 0&&(Oe.zoom=Tt),Ot!==void 0&&(Oe.pitch=Ot),Qt!==void 0&&(Oe.bearing=Qt),Ar!==void 0&&(Oe.elevation=Ar),xe.apply(Oe)}this.transform.apply(xe)}_fireMoveEvents(P){this.fire(new t.k("move",P)),this._zooming&&this.fire(new t.k("zoom",P)),this._rotating&&this.fire(new t.k("rotate",P)),this._pitching&&this.fire(new t.k("pitch",P))}_afterEase(P,ae){if(this._easeId&&ae&&this._easeId===ae)return;delete this._easeId;let xe=this._zooming,Te=this._rotating,Oe=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,xe&&this.fire(new t.k("zoomend",P)),Te&&this.fire(new t.k("rotateend",P)),Oe&&this.fire(new t.k("pitchend",P)),this.fire(new t.k("moveend",P))}flyTo(P,ae){var xe;if(!P.essential&&n.prefersReducedMotion){let yn=t.M(P,["center","zoom","bearing","pitch","around"]);return this.jumpTo(yn,ae)}this.stop(),P=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},P);let Te=this._getTransformForUpdate(),Oe=Te.zoom,ht=Te.bearing,Tt=Te.pitch,Ot=Te.padding,Qt="bearing"in P?this._normalizeBearing(P.bearing,ht):ht,Ar="pitch"in P?+P.pitch:Tt,Sr="padding"in P?P.padding:Te.padding,Kr=t.P.convert(P.offset),oi=Te.centerPoint.add(Kr),Ge=Te.pointLocation(oi),{center:Ze,zoom:ot}=Te.getConstrained(t.N.convert(P.center||Ge),(xe=P.zoom)!==null&&xe!==void 0?xe:Oe);this._normalizeCenter(Ze,Te);let dt=Te.zoomScale(ot-Oe),Ct=Te.project(Ge),wt=Te.project(Ze).sub(Ct),Dt=P.curve,fr=Math.max(Te.width,Te.height),_r=fr/dt,kr=wt.mag();if("minZoom"in P){let yn=t.ac(Math.min(P.minZoom,Oe,ot),Te.minZoom,Te.maxZoom),qn=fr/Te.zoomScale(yn-Oe);Dt=Math.sqrt(qn/kr*2)}let Vr=Dt*Dt;function Qr(yn){let qn=(_r*_r-fr*fr+(yn?-1:1)*Vr*Vr*kr*kr)/(2*(yn?_r:fr)*Vr*kr);return Math.log(Math.sqrt(qn*qn+1)-qn)}function _i(yn){return(Math.exp(yn)-Math.exp(-yn))/2}function Pi(yn){return(Math.exp(yn)+Math.exp(-yn))/2}let qi=Qr(!1),ga=function(yn){return Pi(qi)/Pi(qi+Dt*yn)},Qa=function(yn){return fr*((Pi(qi)*(_i(qn=qi+Dt*yn)/Pi(qn))-_i(qi))/Vr)/kr;var qn},$a=(Qr(!0)-qi)/Dt;if(Math.abs(kr)<1e-6||!isFinite($a)){if(Math.abs(fr-_r)<1e-6)return this.easeTo(P,ae);let yn=_r<fr?-1:1;$a=Math.abs(Math.log(_r/fr))/Dt,Qa=()=>0,ga=qn=>Math.exp(yn*Dt*qn)}return P.duration="duration"in P?+P.duration:1e3*$a/("screenSpeed"in P?+P.screenSpeed/Dt:+P.speed),P.maxDuration&&P.duration>P.maxDuration&&(P.duration=0),this._zooming=!0,this._rotating=ht!==Qt,this._pitching=Ar!==Tt,this._padding=!Te.isPaddingEqual(Sr),this._prepareEase(ae,!1),this.terrain&&this._prepareElevation(Ze),this._ease(yn=>{let qn=yn*$a,po=1/ga(qn);Te.zoom=yn===1?ot:Oe+Te.scaleZoom(po),this._rotating&&(Te.bearing=t.y.number(ht,Qt,yn)),this._pitching&&(Te.pitch=t.y.number(Tt,Ar,yn)),this._padding&&(Te.interpolatePadding(Ot,Sr,yn),oi=Te.centerPoint.add(Kr)),this.terrain&&!P.freezeElevation&&this._updateElevation(yn);let to=yn===1?Ze:Te.unproject(Ct.add(wt.mult(Qa(qn))).mult(po));Te.setLocationAtPoint(Te.renderWorldCopies?to.wrap():to,oi),this._applyUpdatedTransform(Te),this._fireMoveEvents(ae)},()=>{this.terrain&&P.freezeElevation&&this._finalizeElevation(),this._afterEase(ae)},P),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(P,ae){var xe;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let Te=this._onEaseEnd;delete this._onEaseEnd,Te.call(this,ae)}return P||(xe=this.handlers)===null||xe===void 0||xe.stop(!1),this}_ease(P,ae,xe){xe.animate===!1||xe.duration===0?(P(1),ae()):(this._easeStart=n.now(),this._easeOptions=xe,this._onEaseFrame=P,this._onEaseEnd=ae,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(P,ae){P=t.b3(P,-180,180);let xe=Math.abs(P-ae);return Math.abs(P-360-ae)<xe&&(P-=360),Math.abs(P+360-ae)<xe&&(P+=360),P}_normalizeCenter(P,ae){if(!ae.renderWorldCopies||ae.lngRange)return;let xe=P.lng-ae.center.lng;P.lng+=xe>180?-360:xe<-180?360:0}queryTerrainElevation(P){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(P),this.transform.tileZoom)-this.transform.elevation:null}}let yo={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Io{constructor(P=yo){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=ae=>{!ae||ae.sourceDataType!=="metadata"&&ae.sourceDataType!=="visibility"&&ae.dataType!=="style"&&ae.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=P}getDefaultPosition(){return"bottom-right"}onAdd(P){return this._map=P,this._compact=this.options.compact,this._container=a.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=a.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.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(){a.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(P,ae){let xe=this._map._getUIString(`AttributionControl.${ae}`);P.title=xe,P.setAttribute("aria-label",xe)}_updateAttributions(){if(!this._map.style)return;let P=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?P=P.concat(this.options.customAttribution.map(Te=>typeof Te!="string"?"":Te)):typeof this.options.customAttribution=="string"&&P.push(this.options.customAttribution)),this._map.style.stylesheet){let Te=this._map.style.stylesheet;this.styleOwner=Te.owner,this.styleId=Te.id}let ae=this._map.style.sourceCaches;for(let Te in ae){let Oe=ae[Te];if(Oe.used||Oe.usedForTerrain){let ht=Oe.getSource();ht.attribution&&P.indexOf(ht.attribution)<0&&P.push(ht.attribution)}}P=P.filter(Te=>String(Te).trim()),P.sort((Te,Oe)=>Te.length-Oe.length),P=P.filter((Te,Oe)=>{for(let ht=Oe+1;ht<P.length;ht++)if(P[ht].indexOf(Te)>=0)return!1;return!0});let xe=P.join(" | ");xe!==this._attribHTML&&(this._attribHTML=xe,P.length?(this._innerContainer.innerHTML=xe,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Vn{constructor(P={}){this._updateCompact=()=>{let ae=this._container.children;if(ae.length){let xe=ae[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&xe.classList.add("maplibregl-compact"):xe.classList.remove("maplibregl-compact")}},this.options=P}getDefaultPosition(){return"bottom-left"}onAdd(P){this._map=P,this._compact=this.options&&this.options.compact,this._container=a.create("div","maplibregl-ctrl");let ae=a.create("a","maplibregl-ctrl-logo");return ae.target="_blank",ae.rel="noopener nofollow",ae.href="https://maplibre.org/",ae.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),ae.setAttribute("rel","noopener nofollow"),this._container.appendChild(ae),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){a.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class wn{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(P){let ae=++this._id;return this._queue.push({callback:P,id:ae,cancelled:!1}),ae}remove(P){let ae=this._currentlyRunning,xe=ae?this._queue.concat(ae):this._queue;for(let Te of xe)if(Te.id===P)return void(Te.cancelled=!0)}run(P=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let ae=this._currentlyRunning=this._queue;this._queue=[];for(let xe of ae)if(!xe.cancelled&&(xe.callback(P),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Oo=t.Y([{name:"a_pos3d",type:"Int16",components:3}]);class ps extends t.E{constructor(P){super(),this.sourceCache=P,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,P.usedForTerrain=!0,P.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(P,ae){this.sourceCache.update(P,ae),this._renderableTilesKeys=[];let xe={};for(let Te of P.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:ae}))xe[Te.key]=!0,this._renderableTilesKeys.push(Te.key),this._tiles[Te.key]||(Te.posMatrix=new Float64Array(16),t.aP(Te.posMatrix,0,t.X,0,t.X,0,1),this._tiles[Te.key]=new at(Te,this.tileSize));for(let Te in this._tiles)xe[Te]||delete this._tiles[Te]}freeRtt(P){for(let ae in this._tiles){let xe=this._tiles[ae];(!P||xe.tileID.equals(P)||xe.tileID.isChildOf(P)||P.isChildOf(xe.tileID))&&(xe.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(P=>this.getTileByID(P))}getTileByID(P){return this._tiles[P]}getTerrainCoords(P){let ae={};for(let xe of this._renderableTilesKeys){let Te=this._tiles[xe].tileID;if(Te.canonical.equals(P.canonical)){let Oe=P.clone();Oe.posMatrix=new Float64Array(16),t.aP(Oe.posMatrix,0,t.X,0,t.X,0,1),ae[xe]=Oe}else if(Te.canonical.isChildOf(P.canonical)){let Oe=P.clone();Oe.posMatrix=new Float64Array(16);let ht=Te.canonical.z-P.canonical.z,Tt=Te.canonical.x-(Te.canonical.x>>ht<<ht),Ot=Te.canonical.y-(Te.canonical.y>>ht<<ht),Qt=t.X>>ht;t.aP(Oe.posMatrix,0,Qt,0,Qt,0,1),t.J(Oe.posMatrix,Oe.posMatrix,[-Tt*Qt,-Ot*Qt,0]),ae[xe]=Oe}else if(P.canonical.isChildOf(Te.canonical)){let Oe=P.clone();Oe.posMatrix=new Float64Array(16);let ht=P.canonical.z-Te.canonical.z,Tt=P.canonical.x-(P.canonical.x>>ht<<ht),Ot=P.canonical.y-(P.canonical.y>>ht<<ht),Qt=t.X>>ht;t.aP(Oe.posMatrix,0,t.X,0,t.X,0,1),t.J(Oe.posMatrix,Oe.posMatrix,[Tt*Qt,Ot*Qt,0]),t.K(Oe.posMatrix,Oe.posMatrix,[1/2**ht,1/2**ht,0]),ae[xe]=Oe}}return ae}getSourceTile(P,ae){let xe=this.sourceCache._source,Te=P.overscaledZ-this.deltaZoom;if(Te>xe.maxzoom&&(Te=xe.maxzoom),Te<xe.minzoom)return null;this._sourceTileCache[P.key]||(this._sourceTileCache[P.key]=P.scaledTo(Te).key);let Oe=this.sourceCache.getTileByID(this._sourceTileCache[P.key]);if((!Oe||!Oe.dem)&&ae)for(;Te>=xe.minzoom&&(!Oe||!Oe.dem);)Oe=this.sourceCache.getTileByID(P.scaledTo(Te--).key);return Oe}tilesAfterTime(P=Date.now()){return Object.values(this._tiles).filter(ae=>ae.timeAdded>=P)}}class js{constructor(P,ae,xe){this.painter=P,this.sourceCache=new ps(ae),this.options=xe,this.exaggeration=typeof xe.exaggeration=="number"?xe.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(P,ae,xe,Te=t.X){var Oe;if(!(ae>=0&&ae<Te&&xe>=0&&xe<Te))return 0;let ht=this.getTerrainData(P),Tt=(Oe=ht.tile)===null||Oe===void 0?void 0:Oe.dem;if(!Tt)return 0;let Ot=function(Ge,Ze,ot){var dt=Ze[0],Ct=Ze[1];return Ge[0]=ot[0]*dt+ot[4]*Ct+ot[12],Ge[1]=ot[1]*dt+ot[5]*Ct+ot[13],Ge}([],[ae/Te*t.X,xe/Te*t.X],ht.u_terrain_matrix),Qt=[Ot[0]*Tt.dim,Ot[1]*Tt.dim],Ar=Math.floor(Qt[0]),Sr=Math.floor(Qt[1]),Kr=Qt[0]-Ar,oi=Qt[1]-Sr;return Tt.get(Ar,Sr)*(1-Kr)*(1-oi)+Tt.get(Ar+1,Sr)*Kr*(1-oi)+Tt.get(Ar,Sr+1)*(1-Kr)*oi+Tt.get(Ar+1,Sr+1)*Kr*oi}getElevationForLngLatZoom(P,ae){if(!t.bb(ae,P.wrap()))return 0;let{tileID:xe,mercatorX:Te,mercatorY:Oe}=this._getOverscaledTileIDFromLngLatZoom(P,ae);return this.getElevation(xe,Te%t.X,Oe%t.X,t.X)}getElevation(P,ae,xe,Te=t.X){return this.getDEMElevation(P,ae,xe,Te)*this.exaggeration}getTerrainData(P){if(!this._emptyDemTexture){let Te=this.painter.context,Oe=new t.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new u(Te,Oe,Te.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new u(Te,new t.R({width:1,height:1}),Te.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(Te.gl.NEAREST,Te.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=t.an([])}let ae=this.sourceCache.getSourceTile(P,!0);if(ae&&ae.dem&&(!ae.demTexture||ae.needsTerrainPrepare)){let Te=this.painter.context;ae.demTexture=this.painter.getTileTexture(ae.dem.stride),ae.demTexture?ae.demTexture.update(ae.dem.getPixels(),{premultiply:!1}):ae.demTexture=new u(Te,ae.dem.getPixels(),Te.gl.RGBA,{premultiply:!1}),ae.demTexture.bind(Te.gl.NEAREST,Te.gl.CLAMP_TO_EDGE),ae.needsTerrainPrepare=!1}let xe=ae&&ae+ae.tileID.key+P.key;if(xe&&!this._demMatrixCache[xe]){let Te=this.sourceCache.sourceCache._source.maxzoom,Oe=P.canonical.z-ae.tileID.canonical.z;P.overscaledZ>P.canonical.z&&(P.canonical.z>=Te?Oe=P.canonical.z-Te:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let ht=P.canonical.x-(P.canonical.x>>Oe<<Oe),Tt=P.canonical.y-(P.canonical.y>>Oe<<Oe),Ot=t.bc(new Float64Array(16),[1/(t.X<<Oe),1/(t.X<<Oe),0]);t.J(Ot,Ot,[ht*t.X,Tt*t.X,0]),this._demMatrixCache[P.key]={matrix:Ot,coord:P}}return{u_depth:2,u_terrain:3,u_terrain_dim:ae&&ae.dem&&ae.dem.dim||1,u_terrain_matrix:xe?this._demMatrixCache[P.key].matrix:this._emptyDemMatrix,u_terrain_unpack:ae&&ae.dem&&ae.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(ae&&ae.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:ae}}getFramebuffer(P){let ae=this.painter,xe=ae.width/devicePixelRatio,Te=ae.height/devicePixelRatio;return!this._fbo||this._fbo.width===xe&&this._fbo.height===Te||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new u(ae.context,{width:xe,height:Te,data:null},ae.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(ae.context.gl.NEAREST,ae.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new u(ae.context,{width:xe,height:Te,data:null},ae.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(ae.context.gl.NEAREST,ae.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=ae.context.createFramebuffer(xe,Te,!0,!1),this._fbo.depthAttachment.set(ae.context.createRenderbuffer(ae.context.gl.DEPTH_COMPONENT16,xe,Te))),this._fbo.colorAttachment.set(P==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let P=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let ae=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let Oe=0,ht=0;Oe<this._coordsTextureSize;Oe++)for(let Tt=0;Tt<this._coordsTextureSize;Tt++,ht+=4)ae[ht+0]=255&Tt,ae[ht+1]=255&Oe,ae[ht+2]=Tt>>8<<4|Oe>>8,ae[ht+3]=0;let xe=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(ae.buffer)),Te=new u(P,xe,P.gl.RGBA,{premultiply:!1});return Te.bind(P.gl.NEAREST,P.gl.CLAMP_TO_EDGE),this._coordsTexture=Te,Te}pointCoordinate(P){this.painter.maybeDrawDepthAndCoords(!0);let ae=new Uint8Array(4),xe=this.painter.context,Te=xe.gl,Oe=Math.round(P.x*this.painter.pixelRatio/devicePixelRatio),ht=Math.round(P.y*this.painter.pixelRatio/devicePixelRatio),Tt=Math.round(this.painter.height/devicePixelRatio);xe.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),Te.readPixels(Oe,Tt-ht-1,1,1,Te.RGBA,Te.UNSIGNED_BYTE,ae),xe.bindFramebuffer.set(null);let Ot=ae[0]+(ae[2]>>4<<8),Qt=ae[1]+((15&ae[2])<<8),Ar=this.coordsIndex[255-ae[3]],Sr=Ar&&this.sourceCache.getTileByID(Ar);if(!Sr)return null;let Kr=this._coordsTextureSize,oi=(1<<Sr.tileID.canonical.z)*Kr;return new t.Z((Sr.tileID.canonical.x*Kr+Ot)/oi+Sr.tileID.wrap,(Sr.tileID.canonical.y*Kr+Qt)/oi,this.getElevation(Sr.tileID,Ot,Qt,Kr))}depthAtPoint(P){let ae=new Uint8Array(4),xe=this.painter.context,Te=xe.gl;return xe.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),Te.readPixels(P.x,this.painter.height/devicePixelRatio-P.y-1,1,1,Te.RGBA,Te.UNSIGNED_BYTE,ae),xe.bindFramebuffer.set(null),(ae[0]/16777216+ae[1]/65536+ae[2]/256+ae[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;let P=this.painter.context,ae=new t.bd,xe=new t.aY,Te=this.meshSize,Oe=t.X/Te,ht=Te*Te;for(let Sr=0;Sr<=Te;Sr++)for(let Kr=0;Kr<=Te;Kr++)ae.emplaceBack(Kr*Oe,Sr*Oe,0);for(let Sr=0;Sr<ht;Sr+=Te+1)for(let Kr=0;Kr<Te;Kr++)xe.emplaceBack(Kr+Sr,Te+Kr+Sr+1,Te+Kr+Sr+2),xe.emplaceBack(Kr+Sr,Te+Kr+Sr+2,Kr+Sr+1);let Tt=ae.length,Ot=Tt+2*(Te+1);for(let Sr of[0,1])for(let Kr=0;Kr<=Te;Kr++)for(let oi of[0,1])ae.emplaceBack(Kr*Oe,Sr*t.X,oi);for(let Sr=0;Sr<2*Te;Sr+=2)xe.emplaceBack(Ot+Sr,Ot+Sr+1,Ot+Sr+3),xe.emplaceBack(Ot+Sr,Ot+Sr+3,Ot+Sr+2),xe.emplaceBack(Tt+Sr,Tt+Sr+3,Tt+Sr+1),xe.emplaceBack(Tt+Sr,Tt+Sr+2,Tt+Sr+3);let Qt=ae.length,Ar=Qt+2*(Te+1);for(let Sr of[0,1])for(let Kr=0;Kr<=Te;Kr++)for(let oi of[0,1])ae.emplaceBack(Sr*t.X,Kr*Oe,oi);for(let Sr=0;Sr<2*Te;Sr+=2)xe.emplaceBack(Qt+Sr,Qt+Sr+1,Qt+Sr+3),xe.emplaceBack(Qt+Sr,Qt+Sr+3,Qt+Sr+2),xe.emplaceBack(Ar+Sr,Ar+Sr+3,Ar+Sr+1),xe.emplaceBack(Ar+Sr,Ar+Sr+2,Ar+Sr+3);return this._mesh=new Bu(P.createVertexBuffer(ae,Oo.members),P.createIndexBuffer(xe),t.a0.simpleSegment(0,0,ae.length,xe.length)),this._mesh}getMeshFrameDelta(P){return 2*Math.PI*t.be/Math.pow(2,P)/5}getMinTileElevationForLngLatZoom(P,ae){var xe;let{tileID:Te}=this._getOverscaledTileIDFromLngLatZoom(P,ae);return(xe=this.getMinMaxElevation(Te).minElevation)!==null&&xe!==void 0?xe:0}getMinMaxElevation(P){let ae=this.getTerrainData(P).tile,xe={minElevation:null,maxElevation:null};return ae&&ae.dem&&(xe.minElevation=ae.dem.min*this.exaggeration,xe.maxElevation=ae.dem.max*this.exaggeration),xe}_getOverscaledTileIDFromLngLatZoom(P,ae){let xe=t.Z.fromLngLat(P.wrap()),Te=(1<<ae)*t.X,Oe=xe.x*Te,ht=xe.y*Te,Tt=Math.floor(Oe/t.X),Ot=Math.floor(ht/t.X);return{tileID:new t.S(ae,0,ae,Tt,Ot),mercatorX:Oe,mercatorY:ht}}}class pl{constructor(P,ae,xe){this._context=P,this._size=ae,this._tileSize=xe,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let P of this._objects)P.texture.destroy(),P.fbo.destroy()}_createObject(P){let ae=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),xe=new u(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return xe.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),ae.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),ae.colorAttachment.set(xe.texture),{id:P,fbo:ae,texture:xe,stamp:-1,inUse:!1}}getObjectForId(P){return this._objects[P]}useObject(P){P.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(ae=>P.id!==ae),this._recentlyUsed.push(P.id)}stampObject(P){P.stamp=++this._stamp}getOrCreateFreeObject(){for(let ae of this._recentlyUsed)if(!this._objects[ae].inUse)return this._objects[ae];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let P=this._createObject(this._objects.length);return this._objects.push(P),P}freeObject(P){P.inUse=!1}freeAllObjects(){for(let P of this._objects)this.freeObject(P)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(P=>!P.inUse)===!1}}let Qs={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class hl{constructor(P,ae){this.painter=P,this.terrain=ae,this.pool=new pl(P.context,30,ae.sourceCache.tileSize*ae.qualityFactor)}destruct(){this.pool.destruct()}getTexture(P){return this.pool.getObjectForId(P.rtt[this._stacks.length-1].id).texture}prepareForRender(P,ae){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=P._order.filter(xe=>!P._layers[xe].isHidden(ae)),this._coordsDescendingInv={};for(let xe in P.sourceCaches){this._coordsDescendingInv[xe]={};let Te=P.sourceCaches[xe].getVisibleCoordinates();for(let Oe of Te){let ht=this.terrain.sourceCache.getTerrainCoords(Oe);for(let Tt in ht)this._coordsDescendingInv[xe][Tt]||(this._coordsDescendingInv[xe][Tt]=[]),this._coordsDescendingInv[xe][Tt].push(ht[Tt])}}this._coordsDescendingInvStr={};for(let xe of P._order){let Te=P._layers[xe],Oe=Te.source;if(Qs[Te.type]&&!this._coordsDescendingInvStr[Oe]){this._coordsDescendingInvStr[Oe]={};for(let ht in this._coordsDescendingInv[Oe])this._coordsDescendingInvStr[Oe][ht]=this._coordsDescendingInv[Oe][ht].map(Tt=>Tt.key).sort().join()}}for(let xe of this._renderableTiles)for(let Te in this._coordsDescendingInvStr){let Oe=this._coordsDescendingInvStr[Te][xe.tileID.key];Oe&&Oe!==xe.rttCoords[Te]&&(xe.rtt=[])}}renderLayer(P){if(P.isHidden(this.painter.transform.zoom))return!1;let ae=P.type,xe=this.painter,Te=this._renderableLayerIds[this._renderableLayerIds.length-1]===P.id;if(Qs[ae]&&(this._prevType&&Qs[this._prevType]||this._stacks.push([]),this._prevType=ae,this._stacks[this._stacks.length-1].push(P.id),!Te))return!0;if(Qs[this._prevType]||Qs[ae]&&Te){this._prevType=ae;let Oe=this._stacks.length-1,ht=this._stacks[Oe]||[];for(let Tt of this._renderableTiles){if(this.pool.isFull()&&(Ll(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(Tt),Tt.rtt[Oe]){let Qt=this.pool.getObjectForId(Tt.rtt[Oe].id);if(Qt.stamp===Tt.rtt[Oe].stamp){this.pool.useObject(Qt);continue}}let Ot=this.pool.getOrCreateFreeObject();this.pool.useObject(Ot),this.pool.stampObject(Ot),Tt.rtt[Oe]={id:Ot.id,stamp:Ot.stamp},xe.context.bindFramebuffer.set(Ot.fbo.framebuffer),xe.context.clear({color:t.aM.transparent,stencil:0}),xe.currentStencilSource=void 0;for(let Qt=0;Qt<ht.length;Qt++){let Ar=xe.style._layers[ht[Qt]],Sr=Ar.source?this._coordsDescendingInv[Ar.source][Tt.tileID.key]:[Tt.tileID];xe.context.viewport.set([0,0,Ot.fbo.width,Ot.fbo.height]),xe._renderTileClippingMasks(Ar,Sr),xe.renderLayer(xe,xe.style.sourceCaches[Ar.source],Ar,Sr),Ar.source&&(Tt.rttCoords[Ar.source]=this._coordsDescendingInvStr[Ar.source][Tt.tileID.key])}}return Ll(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),Qs[ae]}return!1}}let Bs={"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"},Wl=r,Il={hash:!1,interactive:!0,bearingSnap:7,attributionControl:yo,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:t.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},wl=Ue=>{Ue.touchstart=Ue.dragStart,Ue.touchmoveWindow=Ue.dragMove,Ue.touchend=Ue.dragEnd},io={showCompass:!0,showZoom:!0,visualizePitch:!1};class Jo{constructor(P,ae,xe=!1){this.mousedown=ht=>{this.startMouse(t.e({},ht,{ctrlKey:!0,preventDefault:()=>ht.preventDefault()}),a.mousePos(this.element,ht)),a.addEventListener(window,"mousemove",this.mousemove),a.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=ht=>{this.moveMouse(ht,a.mousePos(this.element,ht))},this.mouseup=ht=>{this.mouseRotate.dragEnd(ht),this.mousePitch&&this.mousePitch.dragEnd(ht),this.offTemp()},this.touchstart=ht=>{ht.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=a.touchPos(this.element,ht.targetTouches)[0],this.startTouch(ht,this._startPos),a.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.addEventListener(window,"touchend",this.touchend))},this.touchmove=ht=>{ht.targetTouches.length!==1?this.reset():(this._lastPos=a.touchPos(this.element,ht.targetTouches)[0],this.moveTouch(ht,this._lastPos))},this.touchend=ht=>{ht.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 Te=P.dragRotate._mouseRotate.getClickTolerance(),Oe=P.dragRotate._mousePitch.getClickTolerance();this.element=ae,this.mouseRotate=du({clickTolerance:Te,enable:!0}),this.touchRotate=(({enable:ht,clickTolerance:Tt,bearingDegreesPerPixelMoved:Ot=.8})=>{let Qt=new ef;return new Ju({clickTolerance:Tt,move:(Ar,Sr)=>({bearingDelta:(Sr.x-Ar.x)*Ot}),moveStateManager:Qt,enable:ht,assignEvents:wl})})({clickTolerance:Te,enable:!0}),this.map=P,xe&&(this.mousePitch=Nf({clickTolerance:Oe,enable:!0}),this.touchPitch=(({enable:ht,clickTolerance:Tt,pitchDegreesPerPixelMoved:Ot=-.5})=>{let Qt=new ef;return new Ju({clickTolerance:Tt,move:(Ar,Sr)=>({pitchDelta:(Sr.y-Ar.y)*Ot}),moveStateManager:Qt,enable:ht,assignEvents:wl})})({clickTolerance:Oe,enable:!0})),a.addEventListener(ae,"mousedown",this.mousedown),a.addEventListener(ae,"touchstart",this.touchstart,{passive:!1}),a.addEventListener(ae,"touchcancel",this.reset)}startMouse(P,ae){this.mouseRotate.dragStart(P,ae),this.mousePitch&&this.mousePitch.dragStart(P,ae),a.disableDrag()}startTouch(P,ae){this.touchRotate.dragStart(P,ae),this.touchPitch&&this.touchPitch.dragStart(P,ae),a.disableDrag()}moveMouse(P,ae){let xe=this.map,{bearingDelta:Te}=this.mouseRotate.dragMove(P,ae)||{};if(Te&&xe.setBearing(xe.getBearing()+Te),this.mousePitch){let{pitchDelta:Oe}=this.mousePitch.dragMove(P,ae)||{};Oe&&xe.setPitch(xe.getPitch()+Oe)}}moveTouch(P,ae){let xe=this.map,{bearingDelta:Te}=this.touchRotate.dragMove(P,ae)||{};if(Te&&xe.setBearing(xe.getBearing()+Te),this.touchPitch){let{pitchDelta:Oe}=this.touchPitch.dragMove(P,ae)||{};Oe&&xe.setPitch(xe.getPitch()+Oe)}}off(){let P=this.element;a.removeEventListener(P,"mousedown",this.mousedown),a.removeEventListener(P,"touchstart",this.touchstart,{passive:!1}),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend),a.removeEventListener(P,"touchcancel",this.reset),this.offTemp()}offTemp(){a.enableDrag(),a.removeEventListener(window,"mousemove",this.mousemove),a.removeEventListener(window,"mouseup",this.mouseup),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend)}}let cl;function Zs(Ue,P,ae){let xe=new t.N(Ue.lng,Ue.lat);if(Ue=new t.N(Ue.lng,Ue.lat),P){let Te=new t.N(Ue.lng-360,Ue.lat),Oe=new t.N(Ue.lng+360,Ue.lat),ht=ae.locationPoint(Ue).distSqr(P);ae.locationPoint(Te).distSqr(P)<ht?Ue=Te:ae.locationPoint(Oe).distSqr(P)<ht&&(Ue=Oe)}for(;Math.abs(Ue.lng-ae.center.lng)>180;){let Te=ae.locationPoint(Ue);if(Te.x>=0&&Te.y>=0&&Te.x<=ae.width&&Te.y<=ae.height)break;Ue.lng>ae.center.lng?Ue.lng-=360:Ue.lng+=360}return Ue.lng!==xe.lng&&ae.locationPoint(Ue).y>ae.height/2-ae.getHorizon()?Ue:xe}let gu={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 Nu(Ue,P,ae){let xe=Ue.classList;for(let Te in gu)xe.remove(`maplibregl-${ae}-anchor-${Te}`);xe.add(`maplibregl-${ae}-anchor-${P}`)}class tc extends t.E{constructor(P){if(super(),this._onKeyPress=ae=>{let xe=ae.code,Te=ae.charCode||ae.keyCode;xe!=="Space"&&xe!=="Enter"&&Te!==32&&Te!==13||this.togglePopup()},this._onMapClick=ae=>{let xe=ae.originalEvent.target,Te=this._element;this._popup&&(xe===Te||Te.contains(xe))&&this.togglePopup()},this._update=ae=>{var xe;if(!this._map)return;let Te=this._map.loaded()&&!this._map.isMoving();(ae?.type==="terrain"||ae?.type==="render"&&!Te)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Zs(this._lngLat,this._flatPos,this._map.transform):(xe=this._lngLat)===null||xe===void 0?void 0:xe.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 Oe="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Oe=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Oe=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let ht="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?ht="rotateX(0deg)":this._pitchAlignment==="map"&&(ht=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||ae&&ae.type!=="moveend"||(this._pos=this._pos.round()),a.setTransform(this._element,`${gu[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${ht} ${Oe}`),n.frameAsync(new AbortController).then(()=>{this._updateOpacity(ae&&ae.type==="moveend")}).catch(()=>{})},this._onMove=ae=>{if(!this._isDragging){let xe=this._clickTolerance||this._map._clickTolerance;this._isDragging=ae.point.dist(this._pointerdownPos)>=xe}this._isDragging&&(this._pos=ae.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new t.k("dragstart"))),this.fire(new t.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 t.k("dragend")),this._state="inactive"},this._addDragHandler=ae=>{this._element.contains(ae.originalEvent.target)&&(ae.preventDefault(),this._positionDelta=ae.point.sub(this._pos).add(this._offset),this._pointerdownPos=ae.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=P&&P.anchor||"center",this._color=P&&P.color||"#3FB1CE",this._scale=P&&P.scale||1,this._draggable=P&&P.draggable||!1,this._clickTolerance=P&&P.clickTolerance||0,this._subpixelPositioning=P&&P.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=P&&P.rotation||0,this._rotationAlignment=P&&P.rotationAlignment||"auto",this._pitchAlignment=P&&P.pitchAlignment&&P.pitchAlignment!=="auto"?P.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(P?.opacity,P?.opacityWhenCovered),P&&P.element)this._element=P.element,this._offset=t.P.convert(P&&P.offset||[0,0]);else{this._defaultMarker=!0,this._element=a.create("div");let ae=a.createNS("http://www.w3.org/2000/svg","svg"),xe=41,Te=27;ae.setAttributeNS(null,"display","block"),ae.setAttributeNS(null,"height",`${xe}px`),ae.setAttributeNS(null,"width",`${Te}px`),ae.setAttributeNS(null,"viewBox",`0 0 ${Te} ${xe}`);let Oe=a.createNS("http://www.w3.org/2000/svg","g");Oe.setAttributeNS(null,"stroke","none"),Oe.setAttributeNS(null,"stroke-width","1"),Oe.setAttributeNS(null,"fill","none"),Oe.setAttributeNS(null,"fill-rule","evenodd");let ht=a.createNS("http://www.w3.org/2000/svg","g");ht.setAttributeNS(null,"fill-rule","nonzero");let Tt=a.createNS("http://www.w3.org/2000/svg","g");Tt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),Tt.setAttributeNS(null,"fill","#000000");let Ot=[{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 dt of Ot){let Ct=a.createNS("http://www.w3.org/2000/svg","ellipse");Ct.setAttributeNS(null,"opacity","0.04"),Ct.setAttributeNS(null,"cx","10.5"),Ct.setAttributeNS(null,"cy","5.80029008"),Ct.setAttributeNS(null,"rx",dt.rx),Ct.setAttributeNS(null,"ry",dt.ry),Tt.appendChild(Ct)}let Qt=a.createNS("http://www.w3.org/2000/svg","g");Qt.setAttributeNS(null,"fill",this._color);let Ar=a.createNS("http://www.w3.org/2000/svg","path");Ar.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"),Qt.appendChild(Ar);let Sr=a.createNS("http://www.w3.org/2000/svg","g");Sr.setAttributeNS(null,"opacity","0.25"),Sr.setAttributeNS(null,"fill","#000000");let Kr=a.createNS("http://www.w3.org/2000/svg","path");Kr.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"),Sr.appendChild(Kr);let oi=a.createNS("http://www.w3.org/2000/svg","g");oi.setAttributeNS(null,"transform","translate(6.0, 7.0)"),oi.setAttributeNS(null,"fill","#FFFFFF");let Ge=a.createNS("http://www.w3.org/2000/svg","g");Ge.setAttributeNS(null,"transform","translate(8.0, 8.0)");let Ze=a.createNS("http://www.w3.org/2000/svg","circle");Ze.setAttributeNS(null,"fill","#000000"),Ze.setAttributeNS(null,"opacity","0.25"),Ze.setAttributeNS(null,"cx","5.5"),Ze.setAttributeNS(null,"cy","5.5"),Ze.setAttributeNS(null,"r","5.4999962");let ot=a.createNS("http://www.w3.org/2000/svg","circle");ot.setAttributeNS(null,"fill","#FFFFFF"),ot.setAttributeNS(null,"cx","5.5"),ot.setAttributeNS(null,"cy","5.5"),ot.setAttributeNS(null,"r","5.4999962"),Ge.appendChild(Ze),Ge.appendChild(ot),ht.appendChild(Tt),ht.appendChild(Qt),ht.appendChild(Sr),ht.appendChild(oi),ht.appendChild(Ge),ae.appendChild(ht),ae.setAttributeNS(null,"height",xe*this._scale+"px"),ae.setAttributeNS(null,"width",Te*this._scale+"px"),this._element.appendChild(ae),this._offset=t.P.convert(P&&P.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",ae=>{ae.preventDefault()}),this._element.addEventListener("mousedown",ae=>{ae.preventDefault()}),Nu(this._element,this._anchor,"marker"),P&&P.className)for(let ae of P.className.split(" "))this._element.classList.add(ae);this._popup=null}addTo(P){return this.remove(),this._map=P,this._element.setAttribute("aria-label",P._getUIString("Marker.Title")),P.getCanvasContainer().appendChild(this._element),P.on("move",this._update),P.on("moveend",this._update),P.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),a.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(P){return this._lngLat=t.N.convert(P),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(P){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),P){if(!("offset"in P.options)){let Te=Math.abs(13.5)/Math.SQRT2;P.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[Te,-1*(38.1-13.5+Te)],"bottom-right":[-Te,-1*(38.1-13.5+Te)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=P,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(P){return this._subpixelPositioning=P,this}getPopup(){return this._popup}togglePopup(){let P=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:P?(P.isOpen()?P.remove():(P.setLngLat(this._lngLat),P.addTo(this._map)),this):this}_updateOpacity(P=!1){var ae,xe;if(!(!((ae=this._map)===null||ae===void 0)&&ae.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(P)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let Te=this._map,Oe=Te.terrain.depthAtPoint(this._pos),ht=Te.terrain.getElevationForLngLatZoom(this._lngLat,Te.transform.tileZoom);if(Te.transform.lngLatToCameraDepth(this._lngLat,ht)-Oe<.006)return void(this._element.style.opacity=this._opacity);let Tt=-this._offset.y/Te.transform._pixelPerMeter,Ot=Math.sin(Te.getPitch()*Math.PI/180)*Tt,Qt=Te.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),Ar=Te.transform.lngLatToCameraDepth(this._lngLat,ht+Ot)-Qt>.006;!((xe=this._popup)===null||xe===void 0)&&xe.isOpen()&&Ar&&this._popup.remove(),this._element.style.opacity=Ar?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(P){return this._offset=t.P.convert(P),this._update(),this}addClassName(P){this._element.classList.add(P)}removeClassName(P){this._element.classList.remove(P)}toggleClassName(P){return this._element.classList.toggle(P)}setDraggable(P){return this._draggable=!!P,this._map&&(P?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(P){return this._rotation=P||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(P){return this._rotationAlignment=P||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(P){return this._pitchAlignment=P&&P!=="auto"?P:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(P,ae){return P===void 0&&ae===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),P!==void 0&&(this._opacity=P),ae!==void 0&&(this._opacityWhenCovered=ae),this._map&&this._updateOpacity(!0),this}}let Bc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Lu=0,Oc=!1,Pu={maxWidth:100,unit:"metric"};function wc(Ue,P,ae){let xe=ae&&ae.maxWidth||100,Te=Ue._container.clientHeight/2,Oe=Ue.unproject([0,Te]),ht=Ue.unproject([xe,Te]),Tt=Oe.distanceTo(ht);if(ae&&ae.unit==="imperial"){let Ot=3.2808*Tt;Ot>5280?Po(P,xe,Ot/5280,Ue._getUIString("ScaleControl.Miles")):Po(P,xe,Ot,Ue._getUIString("ScaleControl.Feet"))}else ae&&ae.unit==="nautical"?Po(P,xe,Tt/1852,Ue._getUIString("ScaleControl.NauticalMiles")):Tt>=1e3?Po(P,xe,Tt/1e3,Ue._getUIString("ScaleControl.Kilometers")):Po(P,xe,Tt,Ue._getUIString("ScaleControl.Meters"))}function Po(Ue,P,ae,xe){let Te=function(Oe){let ht=Math.pow(10,`${Math.floor(Oe)}`.length-1),Tt=Oe/ht;return Tt=Tt>=10?10:Tt>=5?5:Tt>=3?3:Tt>=2?2:Tt>=1?1:function(Ot){let Qt=Math.pow(10,Math.ceil(-Math.log(Ot)/Math.LN10));return Math.round(Ot*Qt)/Qt}(Tt),ht*Tt}(ae);Ue.style.width=P*(Te/ae)+"px",Ue.innerHTML=`${Te}&nbsp;${xe}`}let es={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Nc=["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 P=Math.round(Math.abs(Ue)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,Ue),"top-left":new t.P(P,P),"top-right":new t.P(-P,P),bottom:new t.P(0,-Ue),"bottom-left":new t.P(P,-P),"bottom-right":new t.P(-P,-P),left:new t.P(Ue,0),right:new t.P(-Ue,0)}}if(Ue instanceof t.P||Array.isArray(Ue)){let P=t.P.convert(Ue);return{center:P,top:P,"top-left":P,"top-right":P,bottom:P,"bottom-left":P,"bottom-right":P,left:P,right:P}}return{center:t.P.convert(Ue.center||[0,0]),top:t.P.convert(Ue.top||[0,0]),"top-left":t.P.convert(Ue["top-left"]||[0,0]),"top-right":t.P.convert(Ue["top-right"]||[0,0]),bottom:t.P.convert(Ue.bottom||[0,0]),"bottom-left":t.P.convert(Ue["bottom-left"]||[0,0]),"bottom-right":t.P.convert(Ue["bottom-right"]||[0,0]),left:t.P.convert(Ue.left||[0,0]),right:t.P.convert(Ue.right||[0,0])}}return hc(new t.P(0,0))}let rc=r;e.AJAXError=t.bh,e.Evented=t.E,e.LngLat=t.N,e.MercatorCoordinate=t.Z,e.Point=t.P,e.addProtocol=t.bi,e.config=t.a,e.removeProtocol=t.bj,e.AttributionControl=Io,e.BoxZoomHandler=Ou,e.CanvasSource=et,e.CooperativeGesturesHandler=qa,e.DoubleClickZoomHandler=pa,e.DragPanHandler=hn,e.DragRotateHandler=Ln,e.EdgeInsets=Eu,e.FullscreenControl=class extends t.E{constructor(Ue={}){super(),this._onFullscreenChange=()=>{var P;let ae=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((P=ae?.shadowRoot)===null||P===void 0)&&P.fullscreenElement;)ae=ae.shadowRoot.fullscreenElement;ae===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:t.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=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){a.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let Ue=this._fullscreenButton=a.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);a.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 t.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.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()}},e.GeoJSONSource=ze,e.GeolocateControl=class extends t.E{constructor(Ue){super(),this._onSuccess=P=>{if(this._map){if(this._isOutOfMapMaxBounds(P))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",P)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=P,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("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(P),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(P),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",P)),this._finish()}},this._updateCamera=P=>{let ae=new t.N(P.coords.longitude,P.coords.latitude),xe=P.coords.accuracy,Te=this._map.getBearing(),Oe=t.e({bearing:Te},this.options.fitBoundsOptions),ht=re.fromLngLat(ae,xe);this._map.fitBounds(ht,Oe,{geolocateSource:!0})},this._updateMarker=P=>{if(P){let ae=new t.N(P.coords.longitude,P.coords.latitude);this._accuracyCircleMarker.setLngLat(ae).addTo(this._map),this._userLocationDotMarker.setLngLat(ae).addTo(this._map),this._accuracy=P.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=P=>{if(this._map){if(this.options.trackUserLocation)if(P.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 ae=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=ae,this._geolocateButton.setAttribute("aria-label",ae),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(P.code===3&&Oc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",P)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",P=>P.preventDefault()),this._geolocateButton=a.create("button","maplibregl-ctrl-geolocate",this._container),a.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=P=>{if(this._map){if(P===!1){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");let ae=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=ae,this._geolocateButton.setAttribute("aria-label",ae)}else{let ae=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=ae,this._geolocateButton.setAttribute("aria-label",ae)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new tc({element:this._dotElement}),this._circleElement=a.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new tc({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",ae=>{ae.geolocateSource||this._watchState!=="ACTIVE_LOCK"||ae.originalEvent&&ae.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 t.k("trackuserlocationend")),this.fire(new t.k("userlocationlostfocus")))})}},this.options=t.e({},Bc,Ue)}onAdd(Ue){return this._map=Ue,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return t._(this,arguments,void 0,function*(P=!1){if(cl!==void 0&&!P)return cl;if(window.navigator.permissions===void 0)return cl=!!window.navigator.geolocation,cl;try{cl=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{cl=!!window.navigator.geolocation}return cl})}().then(P=>this._finishSetupUI(P)),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(),a.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Lu=0,Oc=!1}_isOutOfMapMaxBounds(Ue){let P=this._map.getMaxBounds(),ae=Ue.coords;return P&&(ae.longitude<P.getWest()||ae.longitude>P.getEast()||ae.latitude<P.getSouth()||ae.latitude>P.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(),P=Ue.getSouthEast(),ae=Ue.getNorthEast(),xe=P.distanceTo(ae),Te=Math.ceil(this._accuracy/(xe/this._map._container.clientHeight)*2);this._circleElement.style.width=`${Te}px`,this._circleElement.style.height=`${Te}px`}trigger(){if(!this._setup)return t.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 t.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Lu--,Oc=!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 t.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 t.k("trackuserlocationstart")),this.fire(new t.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"),Lu++,Lu>1?(Ue={maximumAge:6e5,timeout:0},Oc=!0):(Ue=this.options.positionOptions,Oc=!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)}},e.Hash=Yf,e.ImageSource=tt,e.KeyboardHandler=wr,e.LngLatBounds=re,e.LogoControl=Vn,e.Map=class extends wo{constructor(Ue){t.bf.mark(t.bg.create);let P=Object.assign(Object.assign({},Il),Ue);if(P.minZoom!=null&&P.maxZoom!=null&&P.minZoom>P.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(P.minPitch!=null&&P.maxPitch!=null&&P.minPitch>P.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(P.minPitch!=null&&P.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(P.maxPitch!=null&&P.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Nl(P.minZoom,P.maxZoom,P.minPitch,P.maxPitch,P.renderWorldCopies),{bearingSnap:P.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new wn,this._controls=[],this._mapId=t.a4(),this._contextLost=ae=>{ae.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:ae}))},this._contextRestored=ae=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:ae}))},this._onMapScroll=ae=>{if(ae.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=P.interactive,this._maxTileCacheSize=P.maxTileCacheSize,this._maxTileCacheZoomLevels=P.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=P.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=P.preserveDrawingBuffer===!0,this._antialias=P.antialias===!0,this._trackResize=P.trackResize===!0,this._bearingSnap=P.bearingSnap,this._refreshExpiredTiles=P.refreshExpiredTiles===!0,this._fadeDuration=P.fadeDuration,this._crossSourceCollisions=P.crossSourceCollisions===!0,this._collectResourceTiming=P.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},Bs),P.locale),this._clickTolerance=P.clickTolerance,this._overridePixelRatio=P.pixelRatio,this._maxCanvasSize=P.maxCanvasSize,this.transformCameraUpdate=P.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=P.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=l.addThrottleControl(()=>this.isMoving()),this._requestManager=new _(P.transformRequest),typeof P.container=="string"){if(this._container=document.getElementById(P.container),!this._container)throw new Error(`Container '${P.container}' not found.`)}else{if(!(P.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=P.container}if(P.maxBounds&&this.setMaxBounds(P.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let ae=!1,xe=Of(Te=>{this._trackResize&&!this._removed&&(this.resize(Te),this.redraw())},50);this._resizeObserver=new ResizeObserver(Te=>{ae?xe(Te):ae=!0}),this._resizeObserver.observe(this._container)}this.handlers=new go(this,P),this._hash=P.hash&&new Yf(typeof P.hash=="string"&&P.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:P.center,zoom:P.zoom,bearing:P.bearing,pitch:P.pitch}),P.bounds&&(this.resize(),this.fitBounds(P.bounds,t.e({},P.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=P.localIdeographFontFamily,this._validateStyle=P.validateStyle,P.style&&this.setStyle(P.style,{localIdeographFontFamily:P.localIdeographFontFamily}),P.attributionControl&&this.addControl(new Io(typeof P.attributionControl=="boolean"?void 0:P.attributionControl)),P.maplibreLogo&&this.addControl(new Vn,P.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",ae=>{this._update(ae.dataType==="style"),this.fire(new t.k(`${ae.dataType}data`,ae))}),this.on("dataloading",ae=>{this.fire(new t.k(`${ae.dataType}dataloading`,ae))}),this.on("dataabort",ae=>{this.fire(new t.k("sourcedataabort",ae))})}_getMapId(){return this._mapId}addControl(Ue,P){if(P===void 0&&(P=Ue.getDefaultPosition?Ue.getDefaultPosition():"top-right"),!Ue||!Ue.onAdd)return this.fire(new t.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let ae=Ue.onAdd(this);this._controls.push(Ue);let xe=this._controlPositions[P];return P.indexOf("bottom")!==-1?xe.insertBefore(ae,xe.firstChild):xe.appendChild(ae),this}removeControl(Ue){if(!Ue||!Ue.onRemove)return this.fire(new t.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let P=this._controls.indexOf(Ue);return P>-1&&this._controls.splice(P,1),Ue.onRemove(this),this}hasControl(Ue){return this._controls.indexOf(Ue)>-1}calculateCameraOptionsFromTo(Ue,P,ae,xe){return xe==null&&this.terrain&&(xe=this.terrain.getElevationForLngLatZoom(ae,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(Ue,P,ae,xe)}resize(Ue){var P;let ae=this._containerDimensions(),xe=ae[0],Te=ae[1],Oe=this._getClampedPixelRatio(xe,Te);if(this._resizeCanvas(xe,Te,Oe),this.painter.resize(xe,Te,Oe),this.painter.overLimit()){let Tt=this.painter.context.gl;this._maxCanvasSize=[Tt.drawingBufferWidth,Tt.drawingBufferHeight];let Ot=this._getClampedPixelRatio(xe,Te);this._resizeCanvas(xe,Te,Ot),this.painter.resize(xe,Te,Ot)}this.transform.resize(xe,Te),(P=this._requestedCameraState)===null||P===void 0||P.resize(xe,Te);let ht=!this._moving;return ht&&(this.stop(),this.fire(new t.k("movestart",Ue)).fire(new t.k("move",Ue))),this.fire(new t.k("resize",Ue)),ht&&this.fire(new t.k("moveend",Ue)),this}_getClampedPixelRatio(Ue,P){let{0:ae,1:xe}=this._maxCanvasSize,Te=this.getPixelRatio(),Oe=Ue*Te,ht=P*Te;return Math.min(Oe>ae?ae/Oe:1,ht>xe?xe/ht:1)*Te}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(re.convert(Ue)),this._update()}setMinZoom(Ue){if((Ue=Ue??-2)>=-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??22)>=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??0)<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??60)>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(t.N.convert(Ue),this.style&&this.terrain)}unproject(Ue){return this.transform.pointLocation(t.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,P,ae){if(Ue==="mouseenter"||Ue==="mouseover"){let xe=!1;return{layers:P,listener:ae,delegates:{mousemove:Oe=>{let ht=P.filter(Ot=>this.getLayer(Ot)),Tt=ht.length!==0?this.queryRenderedFeatures(Oe.point,{layers:ht}):[];Tt.length?xe||(xe=!0,ae.call(this,new hu(Ue,this,Oe.originalEvent,{features:Tt}))):xe=!1},mouseout:()=>{xe=!1}}}}if(Ue==="mouseleave"||Ue==="mouseout"){let xe=!1;return{layers:P,listener:ae,delegates:{mousemove:ht=>{let Tt=P.filter(Ot=>this.getLayer(Ot));(Tt.length!==0?this.queryRenderedFeatures(ht.point,{layers:Tt}):[]).length?xe=!0:xe&&(xe=!1,ae.call(this,new hu(Ue,this,ht.originalEvent)))},mouseout:ht=>{xe&&(xe=!1,ae.call(this,new hu(Ue,this,ht.originalEvent)))}}}}{let xe=Te=>{let Oe=P.filter(Tt=>this.getLayer(Tt)),ht=Oe.length!==0?this.queryRenderedFeatures(Te.point,{layers:Oe}):[];ht.length&&(Te.features=ht,ae.call(this,Te),delete Te.features)};return{layers:P,listener:ae,delegates:{[Ue]:xe}}}}_saveDelegatedListener(Ue,P){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Ue]=this._delegatedListeners[Ue]||[],this._delegatedListeners[Ue].push(P)}_removeDelegatedListener(Ue,P,ae){if(!this._delegatedListeners||!this._delegatedListeners[Ue])return;let xe=this._delegatedListeners[Ue];for(let Te=0;Te<xe.length;Te++){let Oe=xe[Te];if(Oe.listener===ae&&Oe.layers.length===P.length&&Oe.layers.every(ht=>P.includes(ht))){for(let ht in Oe.delegates)this.off(ht,Oe.delegates[ht]);return void xe.splice(Te,1)}}}on(Ue,P,ae){if(ae===void 0)return super.on(Ue,P);let xe=this._createDelegatedListener(Ue,typeof P=="string"?[P]:P,ae);this._saveDelegatedListener(Ue,xe);for(let Te in xe.delegates)this.on(Te,xe.delegates[Te]);return this}once(Ue,P,ae){if(ae===void 0)return super.once(Ue,P);let xe=typeof P=="string"?[P]:P,Te=this._createDelegatedListener(Ue,xe,ae);for(let Oe in Te.delegates){let ht=Te.delegates[Oe];Te.delegates[Oe]=(...Tt)=>{this._removeDelegatedListener(Ue,xe,ae),ht(...Tt)}}this._saveDelegatedListener(Ue,Te);for(let Oe in Te.delegates)this.once(Oe,Te.delegates[Oe]);return this}off(Ue,P,ae){return ae===void 0?super.off(Ue,P):(this._removeDelegatedListener(Ue,typeof P=="string"?[P]:P,ae),this)}queryRenderedFeatures(Ue,P){if(!this.style)return[];let ae,xe=Ue instanceof t.P||Array.isArray(Ue),Te=xe?Ue:[[0,0],[this.transform.width,this.transform.height]];if(P=P||(xe?{}:Ue)||{},Te instanceof t.P||typeof Te[0]=="number")ae=[t.P.convert(Te)];else{let Oe=t.P.convert(Te[0]),ht=t.P.convert(Te[1]);ae=[Oe,new t.P(ht.x,Oe.y),ht,new t.P(Oe.x,ht.y),Oe]}return this.style.queryRenderedFeatures(ae,P,this.transform)}querySourceFeatures(Ue,P){return this.style.querySourceFeatures(Ue,P)}setStyle(Ue,P){return(P=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},P)).diff!==!1&&P.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&Ue?(this._diffStyle(Ue,P),this):(this._localIdeographFontFamily=P.localIdeographFontFamily,this._updateStyle(Ue,P))}setTransformRequest(Ue){return this._requestManager.setTransformRequest(Ue),this}_getUIString(Ue){let P=this._locale[Ue];if(P==null)throw new Error(`Missing UI string '${Ue}'`);return P}_updateStyle(Ue,P){if(P.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(Ue,P));let ae=this.style&&P.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!Ue)),Ue?(this.style=new Rr(this,P||{}),this.style.setEventedParent(this,{style:this.style}),typeof Ue=="string"?this.style.loadURL(Ue,P,ae):this.style.loadJSON(Ue,P,ae),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Rr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(Ue,P){if(typeof Ue=="string"){let ae=this._requestManager.transformRequest(Ue,"Style");t.h(ae,new AbortController).then(xe=>{this._updateDiff(xe.data,P)}).catch(xe=>{xe&&this.fire(new t.j(xe))})}else typeof Ue=="object"&&this._updateDiff(Ue,P)}_updateDiff(Ue,P){try{this.style.setState(Ue,P)&&this._update(!0)}catch(ae){t.w(`Unable to perform style diff: ${ae.message||ae.error||ae}. Rebuilding the style from scratch.`),this._updateStyle(Ue,P)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w("There is no style added to the map.")}addSource(Ue,P){return this._lazyInitEmptyStyle(),this.style.addSource(Ue,P),this._update(!0)}isSourceLoaded(Ue){let P=this.style&&this.style.sourceCaches[Ue];if(P!==void 0)return P.loaded();this.fire(new t.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 P=this.style.sourceCaches[Ue.source];if(!P)throw new Error(`cannot load terrain, because there exists no source with ID: ${Ue.source}`);this.terrain===null&&P.reload();for(let ae in this.style._layers){let xe=this.style._layers[ae];xe.type==="hillshade"&&xe.source===Ue.source&&t.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 js(this.painter,P,Ue),this.painter.renderToTexture=new hl(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=ae=>{ae.dataType==="style"?this.terrain.sourceCache.freeRtt():ae.dataType==="source"&&ae.tile&&(ae.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(ae.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 t.k("terrain",{terrain:Ue})),this}getTerrain(){var Ue,P;return(P=(Ue=this.terrain)===null||Ue===void 0?void 0:Ue.options)!==null&&P!==void 0?P:null}areTilesLoaded(){let Ue=this.style&&this.style.sourceCaches;for(let P in Ue){let ae=Ue[P]._tiles;for(let xe in ae){let Te=ae[xe];if(Te.state!=="loaded"&&Te.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,P,ae={}){let{pixelRatio:xe=1,sdf:Te=!1,stretchX:Oe,stretchY:ht,content:Tt,textFitWidth:Ot,textFitHeight:Qt}=ae;if(this._lazyInitEmptyStyle(),!(P instanceof HTMLImageElement||t.b(P))){if(P.width===void 0||P.height===void 0)return this.fire(new t.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:Ar,height:Sr,data:Kr}=P,oi=P;return this.style.addImage(Ue,{data:new t.R({width:Ar,height:Sr},new Uint8Array(Kr)),pixelRatio:xe,stretchX:Oe,stretchY:ht,content:Tt,textFitWidth:Ot,textFitHeight:Qt,sdf:Te,version:0,userImage:oi}),oi.onAdd&&oi.onAdd(this,Ue),this}}{let{width:Ar,height:Sr,data:Kr}=n.getImageData(P);this.style.addImage(Ue,{data:new t.R({width:Ar,height:Sr},Kr),pixelRatio:xe,stretchX:Oe,stretchY:ht,content:Tt,textFitWidth:Ot,textFitHeight:Qt,sdf:Te,version:0})}}updateImage(Ue,P){let ae=this.style.getImage(Ue);if(!ae)return this.fire(new t.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let xe=P instanceof HTMLImageElement||t.b(P)?n.getImageData(P):P,{width:Te,height:Oe,data:ht}=xe;if(Te===void 0||Oe===void 0)return this.fire(new t.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(Te!==ae.data.width||Oe!==ae.data.height)return this.fire(new t.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));let Tt=!(P instanceof HTMLImageElement||t.b(P));return ae.data.replace(ht,Tt),this.style.updateImage(Ue,ae),this}getImage(Ue){return this.style.getImage(Ue)}hasImage(Ue){return Ue?!!this.style.getImage(Ue):(this.fire(new t.j(new Error("Missing required image id"))),!1)}removeImage(Ue){this.style.removeImage(Ue)}loadImage(Ue){return l.getImage(this._requestManager.transformRequest(Ue,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(Ue,P){return this._lazyInitEmptyStyle(),this.style.addLayer(Ue,P),this._update(!0)}moveLayer(Ue,P){return this.style.moveLayer(Ue,P),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,P,ae){return this.style.setLayerZoomRange(Ue,P,ae),this._update(!0)}setFilter(Ue,P,ae={}){return this.style.setFilter(Ue,P,ae),this._update(!0)}getFilter(Ue){return this.style.getFilter(Ue)}setPaintProperty(Ue,P,ae,xe={}){return this.style.setPaintProperty(Ue,P,ae,xe),this._update(!0)}getPaintProperty(Ue,P){return this.style.getPaintProperty(Ue,P)}setLayoutProperty(Ue,P,ae,xe={}){return this.style.setLayoutProperty(Ue,P,ae,xe),this._update(!0)}getLayoutProperty(Ue,P){return this.style.getLayoutProperty(Ue,P)}setGlyphs(Ue,P={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(Ue,P),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(Ue,P,ae={}){return this._lazyInitEmptyStyle(),this.style.addSprite(Ue,P,ae,xe=>{xe||this._update(!0)}),this}removeSprite(Ue){return this._lazyInitEmptyStyle(),this.style.removeSprite(Ue),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(Ue,P={}){return this._lazyInitEmptyStyle(),this.style.setSprite(Ue,P,ae=>{ae||this._update(!0)}),this}setLight(Ue,P={}){return this._lazyInitEmptyStyle(),this.style.setLight(Ue,P),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,P){return this.style.setFeatureState(Ue,P),this._update()}removeFeatureState(Ue,P){return this.style.removeFeatureState(Ue,P),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,P=0;return this._container&&(Ue=this._container.clientWidth||400,P=this._container.clientHeight||300),[Ue,P]}_setupContainer(){let Ue=this._container;Ue.classList.add("maplibregl-map");let P=this._canvasContainer=a.create("div","maplibregl-canvas-container",Ue);this._interactive&&P.classList.add("maplibregl-interactive"),this._canvas=a.create("canvas","maplibregl-canvas",P),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 ae=this._containerDimensions(),xe=this._getClampedPixelRatio(ae[0],ae[1]);this._resizeCanvas(ae[0],ae[1],xe);let Te=this._controlContainer=a.create("div","maplibregl-control-container",Ue),Oe=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(ht=>{Oe[ht]=a.create("div",`maplibregl-ctrl-${ht} `,Te)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(Ue,P,ae){this._canvas.width=Math.floor(ae*Ue),this._canvas.height=Math.floor(ae*P),this._canvas.style.width=`${Ue}px`,this._canvas.style.height=`${P}px`}_setupPainter(){let Ue={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},P=null;this._canvas.addEventListener("webglcontextcreationerror",xe=>{P={requestedAttributes:Ue},xe&&(P.statusMessage=xe.statusMessage,P.type=xe.type)},{once:!0});let ae=this._canvas.getContext("webgl2",Ue)||this._canvas.getContext("webgl",Ue);if(!ae){let xe="Failed to initialize WebGL";throw P?(P.message=xe,new Error(JSON.stringify(P))):new Error(xe)}this.painter=new Ic(ae,this.transform),s.testSupport(ae)}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 P=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(Ue),this._removed)return;let ae=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let Te=this.transform.zoom,Oe=n.now();this.style.zoomHistory.update(Te,Oe);let ht=new t.z(Te,{now:Oe,fadeDuration:P,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),Tt=ht.crossFadingFactor();Tt===1&&Tt===this._crossFadingFactor||(ae=!0,this._crossFadingFactor=Tt),this.style.update(ht)}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,P,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:P,showPadding:this.showPadding}),this.fire(new t.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,t.bf.mark(t.bg.load),this.fire(new t.k("load"))),this.style&&(this.style.hasTransitions()||ae)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let xe=this._sourcesDirty||this._styleDirty||this._placementDirty;return xe||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||xe||(this._fullyLoaded=!0,t.bf.mark(t.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 ae of this._controls)ae.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),l.removeThrottleControl(this._imageQueueHandle),(Ue=this._resizeObserver)===null||Ue===void 0||Ue.disconnect();let P=this.painter.context.gl.getExtension("WEBGL_lose_context");P?.loseContext&&P.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),a.remove(this._canvasContainer),a.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),t.bf.clearMetrics(),this._removed=!0,this.fire(new t.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,n.frameAsync(this._frameRequest).then(Ue=>{t.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 Wl}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=hu,e.MapTouchEvent=Qc,e.MapWheelEvent=nh,e.Marker=tc,e.NavigationControl=class{constructor(Ue){this._updateZoomButtons=()=>{let P=this._map.getZoom(),ae=P===this._map.getMaxZoom(),xe=P===this._map.getMinZoom();this._zoomInButton.disabled=ae,this._zoomOutButton.disabled=xe,this._zoomInButton.setAttribute("aria-disabled",ae.toString()),this._zoomOutButton.setAttribute("aria-disabled",xe.toString())},this._rotateCompassArrow=()=>{let P=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=P},this._setButtonTitle=(P,ae)=>{let xe=this._map._getUIString(`NavigationControl.${ae}`);P.title=xe,P.setAttribute("aria-label",xe)},this.options=t.e({},io,Ue),this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",P=>P.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",P=>this._map.zoomIn({},{originalEvent:P})),a.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",P=>this._map.zoomOut({},{originalEvent:P})),a.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",P=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:P}):this._map.resetNorth({},{originalEvent:P})}),this._compassIcon=a.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 Jo(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){a.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,P){let ae=a.create("button",Ue,this._container);return ae.type="button",ae.addEventListener("click",P),ae}},e.Popup=class extends t.E{constructor(Ue){super(),this.remove=()=>(this._content&&a.remove(this._content),this._container&&(a.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 t.k("close"))),this),this._onMouseUp=P=>{this._update(P.point)},this._onMouseMove=P=>{this._update(P.point)},this._onDrag=P=>{this._update(P.point)},this._update=P=>{var ae;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=a.create("div","maplibregl-popup",this._map.getContainer()),this._tip=a.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let Tt of this.options.className.split(" "))this._container.classList.add(Tt);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?Zs(this._lngLat,this._flatPos,this._map.transform):(ae=this._lngLat)===null||ae===void 0?void 0:ae.wrap(),this._trackPointer&&!P)return;let xe=this._flatPos=this._pos=this._trackPointer&&P?P:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&P?P:this._map.transform.locationPoint(this._lngLat));let Te=this.options.anchor,Oe=hc(this.options.offset);if(!Te){let Tt=this._container.offsetWidth,Ot=this._container.offsetHeight,Qt;Qt=xe.y+Oe.bottom.y<Ot?["top"]:xe.y>this._map.transform.height-Ot?["bottom"]:[],xe.x<Tt/2?Qt.push("left"):xe.x>this._map.transform.width-Tt/2&&Qt.push("right"),Te=Qt.length===0?"bottom":Qt.join("-")}let ht=xe.add(Oe[Te]);this.options.subpixelPositioning||(ht=ht.round()),a.setTransform(this._container,`${gu[Te]} translate(${ht.x}px,${ht.y}px)`),Nu(this._container,Te,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(es),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 t.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(Ue){return this._lngLat=t.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 P=document.createDocumentFragment(),ae=document.createElement("body"),xe;for(ae.innerHTML=Ue;xe=ae.firstChild,xe;)P.appendChild(xe);return this.setDOMContent(P)}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=a.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=a.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(Nc);Ue&&Ue.focus()}},e.RasterDEMTileSource=Re,e.RasterTileSource=we,e.ScaleControl=class{constructor(Ue){this._onMove=()=>{wc(this._map,this._container,this.options)},this.setUnit=P=>{this.options.unit=P,wc(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Pu),Ue)}getDefaultPosition(){return"bottom-left"}onAdd(Ue){return this._map=Ue,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Ue.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){a.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},e.ScrollZoomHandler=Fi,e.Style=Rr,e.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=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=a.create("button","maplibregl-ctrl-terrain",this._container),a.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(){a.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=Fc,e.TwoFingersTouchRotateHandler=tf,e.TwoFingersTouchZoomHandler=Cu,e.TwoFingersTouchZoomRotateHandler=Na,e.VectorTileSource=_e,e.VideoSource=it,e.addSourceType=(Ue,P)=>t._(void 0,void 0,void 0,function*(){if(Ae(Ue))throw new Error(`A source type called "${Ue}" already exists.`);((ae,xe)=>{nt[ae]=xe})(Ue,P)}),e.clearPrewarmedResources=function(){let Ue=ce;Ue&&(Ue.isPreloaded()&&Ue.numActive()===1?(Ue.release(J),ce=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()"))},e.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return Qe().getRTLTextPluginStatus()},e.getVersion=function(){return rc},e.getWorkerCount=function(){return se.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(Ue){return V().broadcast("IS",Ue)},e.prewarm=function(){Z().acquire(J)},e.setMaxParallelImageRequests=function(Ue){t.a.MAX_PARALLEL_IMAGE_REQUESTS=Ue},e.setRTLTextPlugin=function(Ue,P){return Qe().setRTLTextPlugin(Ue,P)},e.setWorkerCount=function(Ue){se.workerCount=Ue},e.setWorkerUrl=function(Ue){t.a.WORKER_URL=Ue}});var E=p;return E})}}),dD=De({"src/plots/map/layers.js"(Y,H){"use strict";var p=ui(),x=vu().sanitizeHTML,S=pA(),E=f0();function e(n,a){this.subplot=n,this.uid=n.uid+"-"+a,this.index=a,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(a){this.visible?this.needsNewImage(a)?this.updateImage(a):this.needsNewSource(a)?(this.removeLayer(),this.updateSource(a),this.updateLayer(a)):this.needsNewLayer(a)?this.updateLayer(a):this.updateStyle(a):(this.updateSource(a),this.updateLayer(a)),this.visible=r(a)},t.needsNewImage=function(n){var a=this.subplot.map;return a.getSource(this.idSource)&&this.sourceType==="image"&&n.sourcetype==="image"&&(this.source!==n.source||JSON.stringify(this.coordinates)!==JSON.stringify(n.coordinates))},t.needsNewSource=function(n){return this.sourceType!==n.sourcetype||JSON.stringify(this.source)!==JSON.stringify(n.source)||this.layerType!==n.type},t.needsNewLayer=function(n){return this.layerType!==n.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(n){var a=this.subplot.map;a.getSource(this.idSource).updateImage({url:n.source,coordinates:n.coordinates});var s=this.findFollowingMapLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(n){var a=this.subplot.map;if(a.getSource(this.idSource)&&a.removeSource(this.idSource),this.sourceType=n.sourcetype,this.source=n.source,!!r(n)){var s=i(n);a.addSource(this.idSource,s)}},t.findFollowingMapLayerId=function(n){if(n==="traces")for(var a=this.subplot.getMapLayers(),s=0;s<a.length;s++){var h=a[s].id;if(typeof h=="string"&&h.indexOf(E.traceLayerPrefix)===0){n=h;break}}return n},t.updateLayer=function(n){var a=this.subplot,s=o(n),h=this.lookupBelow(),c=this.findFollowingMapLayerId(h);this.removeLayer(),r(n)&&a.addLayer({id:this.idLayer,source:this.idSource,"source-layer":n.sourcelayer||"",type:n.type,minzoom:n.minzoom,maxzoom:n.maxzoom,layout:s.layout,paint:s.paint},c),this.layerType=n.type,this.below=h},t.updateStyle=function(n){if(r(n)){var a=o(n);this.subplot.setOptions(this.idLayer,"setLayoutProperty",a.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",a.paint)}},t.removeLayer=function(){var n=this.subplot.map;n.getLayer(this.idLayer)&&n.removeLayer(this.idLayer)},t.dispose=function(){var n=this.subplot.map;n.getLayer(this.idLayer)&&n.removeLayer(this.idLayer),n.getSource(this.idSource)&&n.removeSource(this.idSource)};function r(n){if(!n.visible)return!1;var a=n.source;if(Array.isArray(a)&&a.length>0){for(var s=0;s<a.length;s++)if(typeof a[s]!="string"||a[s].length===0)return!1;return!0}return p.isPlainObject(a)||typeof a=="string"&&a.length>0}function o(n){var a={},s={};switch(n.type){case"circle":p.extendFlat(s,{"circle-radius":n.circle.radius,"circle-color":n.color,"circle-opacity":n.opacity});break;case"line":p.extendFlat(s,{"line-width":n.line.width,"line-color":n.color,"line-opacity":n.opacity,"line-dasharray":n.line.dash});break;case"fill":p.extendFlat(s,{"fill-color":n.color,"fill-outline-color":n.fill.outlinecolor,"fill-opacity":n.opacity});break;case"symbol":var h=n.symbol,c=S(h.textposition,h.iconsize);p.extendFlat(a,{"icon-image":h.icon+"-15","icon-size":h.iconsize/10,"text-field":h.text,"text-size":h.textfont.size,"text-anchor":c.anchor,"text-offset":c.offset,"symbol-placement":h.placement}),p.extendFlat(s,{"icon-color":n.color,"text-color":h.textfont.color,"text-opacity":n.opacity});break;case"raster":p.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":n.opacity});break}return{layout:a,paint:s}}function i(n){var a=n.sourcetype,s=n.source,h={type:a},c;return a==="geojson"?c="data":a==="vector"?c=typeof s=="string"?"url":"tiles":a==="raster"?(c="tiles",h.tileSize=256):a==="image"&&(c="url",h.coordinates=n.coordinates),h[c]=s,n.sourceattribution&&(h.attribution=x(n.sourceattribution)),h}H.exports=function(a,s,h){var c=new e(a,s);return c.update(h),c}}}),vD=De({"src/plots/map/map.js"(Y,H){"use strict";var p=hD(),x=ui(),S=s0(),E=Mo(),e=us(),t=Qh(),r=sf(),o=dv(),i=o.drawMode,n=o.selectMode,a=Af().prepSelect,s=Af().clearOutline,h=Af().clearSelectionsCache,c=Af().selectOnClick,m=f0(),d=dD();function T(g,b){this.id=b,this.gd=g;var v=g._fullLayout,u=g._context;this.container=v._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=v._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(v),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(g,b,v){var u=this,y;u.map?y=new Promise(function(f,R){u.updateMap(g,b,f,R)}):y=new Promise(function(f,R){u.createMap(g,b,f,R)}),v.push(y)},l.createMap=function(g,b,v,u){var y=this,f=b[y.id],R=y.styleObj=w(f.style),L=f.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=y.map=new p.Map({container:y.div,style:R.style,center:M(f.center),zoom:f.zoom,bearing:f.bearing,pitch:f.pitch,maxBounds:z,interactive:!y.isStatic,preserveDrawingBuffer:y.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new p.AttributionControl({compact:!0})),N={};F.on("styleimagemissing",function(I){var U=I.id;if(!N[U]&&U.includes("-15")){N[U]=!0;var O=new Image(15,15);O.onload=function(){F.addImage(U,O)},O.crossOrigin="Anonymous",O.src="https://unpkg.com/maki@2.1.0/icons/"+U+".svg"}}),F.setTransformRequest(function(I){return I=I.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),I=I.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),I=I.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:I}}),F._canvas.style.left="0px",F._canvas.style.top="0px",y.rejectOnError(u),y.isStatic||y.initFx(g,b);var B=[];B.push(new Promise(function(I){F.once("load",I)})),B=B.concat(S.fetchTraceGeoData(g)),Promise.all(B).then(function(){y.fillBelowLookup(g,b),y.updateData(g),y.updateLayout(b),y.resolveOnRender(v)}).catch(u)},l.updateMap=function(g,b,v,u){var y=this,f=y.map,R=b[this.id];y.rejectOnError(u);var L=[],z=w(R.style);JSON.stringify(y.styleObj)!==JSON.stringify(z)&&(y.styleObj=z,f.setStyle(z.style),y.traceHash={},L.push(new Promise(function(F){f.once("styledata",F)}))),L=L.concat(S.fetchTraceGeoData(g)),Promise.all(L).then(function(){y.fillBelowLookup(g,b),y.updateData(g),y.updateLayout(b),y.resolveOnRender(v)}).catch(u)},l.fillBelowLookup=function(g,b){var v=b[this.id],u=v.layers,y,f,R=this.belowLookup={},L=!1;for(y=0;y<g.length;y++){var z=g[y][0].trace,F=z._module;typeof z.below=="string"?f=z.below:F.getBelow&&(f=F.getBelow(z,this)),f===""&&(L=!0),R["trace-"+z.uid]=f||""}for(y=0;y<u.length;y++){var N=u[y];typeof N.below=="string"?f=N.below:L?f="traces":f="",R["layout-"+y]=f}var B={},I,U;for(I in R)f=R[I],B[f]?B[f].push(I):B[f]=[I];for(f in B){var O=B[f];if(O.length>1)for(y=0;y<O.length;y++)I=O[y],I.indexOf("trace-")===0?(U=I.split("trace-")[1],this.traceHash[U]&&(this.traceHash[U].below=null)):I.indexOf("layout-")===0&&(U=I.split("layout-")[1],this.layerList[U]&&(this.layerList[U].below=null))}};var _={choroplethmap:0,densitymap:1,scattermap:2};l.updateData=function(g){var b=this.traceHash,v,u,y,f,R=g.slice().sort(function(B,I){return _[B[0].trace.type]-_[I[0].trace.type]});for(y=0;y<R.length;y++){var L=R[y];u=L[0].trace,v=b[u.uid];var z=!1;v&&(v.type===u.type?(v.update(L),z=!0):v.dispose()),!z&&u._module&&(b[u.uid]=u._module.plot(this,L))}var F=Object.keys(b);e:for(y=0;y<F.length;y++){var N=F[y];for(f=0;f<g.length;f++)if(u=g[f][0].trace,N===u.uid)continue e;v=b[N],v.dispose(),delete b[N]}},l.updateLayout=function(g){var b=this.map,v=g[this.id];!this.dragging&&!this.wheeling&&(b.setCenter(M(v.center)),b.setZoom(v.zoom),b.setBearing(v.bearing),b.setPitch(v.pitch)),this.updateLayers(g),this.updateFramework(g),this.updateFx(g),this.map.resize(),this.gd._context._scrollZoom.map?b.scrollZoom.enable():b.scrollZoom.disable()},l.resolveOnRender=function(g){var b=this.map;b.on("render",function v(){b.loaded()&&(b.off("render",v),setTimeout(g,10))})},l.rejectOnError=function(g){var b=this.map;function v(){g(new Error(m.mapOnErrorMsg))}b.once("error",v),b.once("style.error",v),b.once("source.error",v),b.once("tile.error",v),b.once("layer.error",v)},l.createFramework=function(g){var b=this,v=b.div=document.createElement("div");v.id=b.uid,v.style.position="absolute",b.container.appendChild(v),b.xaxis={_id:"x",c2p:function(u){return b.project(u).x}},b.yaxis={_id:"y",c2p:function(u){return b.project(u).y}},b.updateFramework(g),b.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},e.setConvert(b.mockAxis,g)},l.initFx=function(g,b){var v=this,u=v.gd,y=v.map;y.on("moveend",function(L){if(v.map){var z=u._fullLayout;if(L.originalEvent||v.wheeling){var F=z[v.id];E.call("_storeDirectGUIEdit",u.layout,z._preGUI,v.getViewEdits(F));var N=v.getView();F._input.center=F.center=N.center,F._input.zoom=F.zoom=N.zoom,F._input.bearing=F.bearing=N.bearing,F._input.pitch=F.pitch=N.pitch,u.emit("plotly_relayout",v.getViewEditsWithDerived(N))}L.originalEvent&&L.originalEvent.type==="mouseup"?v.dragging=!1:v.wheeling&&(v.wheeling=!1),z&&z._rehover&&z._rehover()}}),y.on("wheel",function(){v.wheeling=!0}),y.on("mousemove",function(L){var z=v.div.getBoundingClientRect(),F=[L.originalEvent.offsetX,L.originalEvent.offsetY];L.target.getBoundingClientRect=function(){return z},v.xaxis.p2c=function(){return y.unproject(F).lng},v.yaxis.p2c=function(){return y.unproject(F).lat},u._fullLayout._rehover=function(){u._fullLayout._hoversubplot===v.id&&u._fullLayout[v.id]&&r.hover(u,L,v.id)},r.hover(u,L,v.id),u._fullLayout._hoversubplot=v.id});function f(){r.loneUnhover(b._hoverlayer)}y.on("dragstart",function(){v.dragging=!0,f()}),y.on("zoomstart",f),y.on("mouseout",function(){u._fullLayout._hoversubplot=null});function R(){var L=v.getView();u.emit("plotly_relayouting",v.getViewEditsWithDerived(L))}y.on("drag",R),y.on("zoom",R),y.on("dblclick",function(){var L=u._fullLayout[v.id];E.call("_storeDirectGUIEdit",u.layout,u._fullLayout._preGUI,v.getViewEdits(L));var z=v.viewInitial;y.setCenter(M(z.center)),y.setZoom(z.zoom),y.setBearing(z.bearing),y.setPitch(z.pitch);var F=v.getView();L._input.center=L.center=F.center,L._input.zoom=L.zoom=F.zoom,L._input.bearing=L.bearing=F.bearing,L._input.pitch=L.pitch=F.pitch,u.emit("plotly_doubleclick",null),u.emit("plotly_relayout",v.getViewEditsWithDerived(F))}),v.clearOutline=function(){h(v.dragOptions),s(v.dragOptions.gd)},v.onClickInPanFn=function(L){return function(z){var F=u._fullLayout.clickmode;F.indexOf("select")>-1&&c(z.originalEvent,u,[v.xaxis],[v.yaxis],v.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(g){var b=this,v=b.map,u=b.gd;if(b.isStatic)return;function y(z){var F=b.map.unproject(z);return[F.lng,F.lat]}var f=g.dragmode,R;R=function(z,F){if(F.isRect){var N=z.range={};N[b.id]=[y([F.xmin,F.ymin]),y([F.xmax,F.ymax])]}else{var B=z.lassoPoints={};B[b.id]=F.map(y)}};var L=b.dragOptions;b.dragOptions=x.extendDeep(L||{},{dragmode:g.dragmode,element:b.div,gd:u,plotinfo:{id:b.id,domain:g[b.id].domain,xaxis:b.xaxis,yaxis:b.yaxis,fillRangeItems:R},xaxes:[b.xaxis],yaxes:[b.yaxis],subplot:b.id}),v.off("click",b.onClickInPanHandler),n(f)||i(f)?(v.dragPan.disable(),v.on("zoomstart",b.clearOutline),b.dragOptions.prepFn=function(z,F,N){a(z,F,N,b.dragOptions,f)},t.init(b.dragOptions)):(v.dragPan.enable(),v.off("zoomstart",b.clearOutline),b.div.onmousedown=null,b.div.ontouchstart=null,b.div.removeEventListener("touchstart",b.div._ontouchstart),b.onClickInPanHandler=b.onClickInPanFn(b.dragOptions),v.on("click",b.onClickInPanHandler))},l.updateFramework=function(g){var b=g[this.id].domain,v=g._size,u=this.div.style;u.width=v.w*(b.x[1]-b.x[0])+"px",u.height=v.h*(b.y[1]-b.y[0])+"px",u.left=v.l+b.x[0]*v.w+"px",u.top=v.t+(1-b.y[1])*v.h+"px",this.xaxis._offset=v.l+b.x[0]*v.w,this.xaxis._length=v.w*(b.x[1]-b.x[0]),this.yaxis._offset=v.t+(1-b.y[1])*v.h,this.yaxis._length=v.h*(b.y[1]-b.y[0])},l.updateLayers=function(g){var b=g[this.id],v=b.layers,u=this.layerList,y;if(v.length!==u.length){for(y=0;y<u.length;y++)u[y].dispose();for(u=this.layerList=[],y=0;y<v.length;y++)u.push(d(this,y,v[y]))}else for(y=0;y<v.length;y++)u[y].update(v[y])},l.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},l.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},l.setOptions=function(g,b,v){for(var u in v)this.map[b](g,u,v[u])},l.getMapLayers=function(){return this.map.getStyle().layers},l.addLayer=function(g,b){var v=this.map;if(typeof b=="string"){if(b===""){v.addLayer(g,b);return}for(var u=this.getMapLayers(),y=0;y<u.length;y++)if(b===u[y].id){v.addLayer(g,b);return}x.warn(["Trying to add layer with *below* value",b,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}v.addLayer(g)},l.project=function(g){return this.map.project(new p.LngLat(g[0],g[1]))},l.getView=function(){var g=this.map,b=g.getCenter(),v=b.lng,u=b.lat,y={lon:v,lat:u},f=g.getCanvas(),R=parseInt(f.style.width),L=parseInt(f.style.height);return{center:y,zoom:g.getZoom(),bearing:g.getBearing(),pitch:g.getPitch(),_derived:{coordinates:[g.unproject([0,0]).toArray(),g.unproject([R,0]).toArray(),g.unproject([R,L]).toArray(),g.unproject([0,L]).toArray()]}}},l.getViewEdits=function(g){for(var b=this.id,v=["center","zoom","bearing","pitch"],u={},y=0;y<v.length;y++){var f=v[y];u[b+"."+f]=g[f]}return u},l.getViewEditsWithDerived=function(g){var b=this.id,v=this.getViewEdits(g);return v[b+"._derived"]=g._derived,v};function w(g){var b={};return x.isPlainObject(g)?(b.id=g.id,b.style=g):typeof g=="string"?(b.id=g,m.stylesMap[g]?b.style=m.stylesMap[g]:b.style=g):(b.id=m.styleValueDflt,b.style=A(m.styleValueDflt)),b.transition={duration:0,delay:0},b}function A(g){return m.styleUrlPrefix+g+"-"+m.styleUrlSuffix}function M(g){return[g.lon,g.lat]}H.exports=T}}),pD=De({"src/plots/map/layout_defaults.js"(Y,H){"use strict";var p=ui(),x=Kp(),S=Vh(),E=c1();H.exports=function(o,i,n){x(o,i,n,{type:"map",attributes:E,handleDefaults:e,partition:"y"})};function e(r,o,i){i("style"),i("center.lon"),i("center.lat"),i("zoom"),i("bearing"),i("pitch");var n=i("bounds.west"),a=i("bounds.east"),s=i("bounds.south"),h=i("bounds.north");(n===void 0||a===void 0||s===void 0||h===void 0)&&delete o.bounds,S(r,o,{name:"layers",handleItemDefaults:t}),o._input=r}function t(r,o){function i(m,d){return p.coerce(r,o,E.layers,m,d)}var n=i("visible");if(n){var a=i("sourcetype"),s=a==="raster"||a==="image";i("source"),i("sourceattribution"),a==="vector"&&i("sourcelayer"),a==="image"&&i("coordinates");var h;s&&(h="raster");var c=i("type",h);s&&c!=="raster"&&(c=o.type="raster",p.log("Source types *raster* and *image* must drawn *raster* layer type.")),i("below"),i("color"),i("opacity"),i("minzoom"),i("maxzoom"),c==="circle"&&i("circle.radius"),c==="line"&&(i("line.width"),i("line.dash")),c==="fill"&&i("fill.outlinecolor"),c==="symbol"&&(i("symbol.icon"),i("symbol.iconsize"),i("symbol.text"),p.coerceFont(i,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),i("symbol.textposition"),i("symbol.placement"))}}}}),Ib=De({"src/plots/map/index.js"(Y){"use strict";var H=ui(),p=H.strTranslate,x=H.strScale,S=Lh().getSubplotCalcData,E=Bd(),e=za(),t=ys(),r=vu(),o=vD(),i="map";Y.name=i,Y.attr="subplot",Y.idRoot=i,Y.idRegex=Y.attrRegex=H.counterRegex(i),Y.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},Y.layoutAttributes=c1(),Y.supplyLayoutDefaults=pD(),Y.plot=function(a){for(var s=a._fullLayout,h=a.calcdata,c=s._subplots[i],m=0;m<c.length;m++){var d=c[m],T=S(h,i,d),l=s[d],_=l._subplot;_||(_=new o(a,d),s[d]._subplot=_),_.viewInitial||(_.viewInitial={center:H.extendFlat({},l.center),zoom:l.zoom,bearing:l.bearing,pitch:l.pitch}),_.plot(T,s,a._promises)}},Y.clean=function(n,a,s,h){for(var c=h._subplots[i]||[],m=0;m<c.length;m++){var d=c[m];!a[d]&&h[d]._subplot&&h[d]._subplot.destroy()}},Y.toSVG=function(n){for(var a=n._fullLayout,s=a._subplots[i],h=a._size,c=0;c<s.length;c++){var m=a[s[c]],d=m.domain,T=m._subplot,l=T.toImage("png"),_=a._glimages.append("svg:image");_.attr({xmlns:E.svg,"xlink:href":l,x:h.l+h.w*d.x[0],y:h.t+h.h*(1-d.y[1]),width:h.w*(d.x[1]-d.x[0]),height:h.h*(d.y[1]-d.y[0]),preserveAspectRatio:"none"});var w=e.select(m._subplot.div),A=w.select(".maplibregl-ctrl-attrib").text().replace("Improve this map",""),M=a._glimages.append("g"),g=M.append("text");g.text(A).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":A});var b=t.bBox(g.node()),v=h.w*(d.x[1]-d.x[0]);if(b.width>v/2){var u=A.split("|").join("<br>");g.text(u).attr("data-unformatted",u).call(r.convertToTspans,n),b=t.bBox(g.node())}g.attr("transform",p(-3,-b.height+8)),M.insert("rect",".static-attribution").attr({x:-b.width-6,y:-b.height-3,width:b.width+6,height:b.height+3,fill:"rgba(255, 255, 255, 0.75)"});var y=1;b.width+6>v&&(y=v/(b.width+6));var f=[h.l+h.w*d.x[1],h.t+h.h*(1-d.y[0])];M.attr("transform",p(f[0],f[1])+x(y))}},Y.updateFx=function(n){for(var a=n._fullLayout,s=a._subplots[i],h=0;h<s.length;h++){var c=a[s[h]]._subplot;c.updateFx(a)}}}}),mD=De({"src/traces/scattermap/index.js"(Y,H){"use strict";H.exports={attributes:Cb(),supplyDefaults:sD(),colorbar:qh(),formatLabels:vA(),calc:ob(),plot:uD(),hoverPoints:Lb().hoverPoints,eventData:cD(),selectPoints:fD(),styleOnSelect:function(p,x){if(x){var S=x[0].trace;S._glTrace.update(x)}},moduleType:"trace",name:"scattermap",basePlotModule:Ib(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}}}),gD=De({"lib/scattermap.js"(Y,H){"use strict";H.exports=mD()}}),mA=De({"src/traces/choroplethmap/attributes.js"(Y,H){"use strict";var p=wg(),x=zu(),{hovertemplateAttrs:S,templatefallbackAttrs:E}=ou(),e=Yl(),t=Xo().extendFlat;H.exports=t({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:t({},p.featureidkey,{}),below:{valType:"string",editType:"plot"},text:p.text,hovertext:p.hovertext,marker:{line:{color:t({},p.marker.line.color,{editType:"plot"}),width:t({},p.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:t({},p.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:t({},p.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:t({},p.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:p.hoverinfo,hovertemplate:S({},{keys:["properties"]}),hovertemplatefallback:E(),showlegend:t({},e.showlegend,{dflt:!1})},x("",{cLetter:"z",editTypeOverride:"calc"}))}}),yD=De({"src/traces/choroplethmap/defaults.js"(Y,H){"use strict";var p=ui(),x=dh(),S=mA();H.exports=function(e,t,r,o){function i(c,m){return p.coerce(e,t,S,c,m)}var n=i("locations"),a=i("z"),s=i("geojson");if(!p.isArrayOrTypedArray(n)||!n.length||!p.isArrayOrTypedArray(a)||!a.length||!(typeof s=="string"&&s!==""||p.isPlainObject(s))){t.visible=!1;return}i("featureidkey"),t._length=Math.min(n.length,a.length),i("below"),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback");var h=i("marker.line.width");h&&i("marker.line.color"),i("marker.opacity"),x(e,t,o,i,{prefix:"",cLetter:"z"}),p.coerceSelectionMarkerOpacity(t,i)}}}),gA=De({"src/traces/choroplethmap/convert.js"(Y,H){"use strict";var p=vn(),x=ui(),S=oc(),E=ys(),e=o0().makeBlank,t=s0();function r(i){var n=i[0].trace,a=n.visible===!0&&n._length!==0,s={layout:{visibility:"none"},paint:{}},h={layout:{visibility:"none"},paint:{}},c=n._opts={fill:s,line:h,geojson:e()};if(!a)return c;var m=t.extractTraceFeature(i);if(!m)return c;var d=S.makeColorScaleFuncFromTrace(n),T=n.marker,l=T.line||{},_;x.isArrayOrTypedArray(T.opacity)&&(_=function(y){var f=y.mo;return p(f)?+x.constrain(f,0,1):0});var w;x.isArrayOrTypedArray(l.color)&&(w=function(y){return y.mlc});var A;x.isArrayOrTypedArray(l.width)&&(A=function(y){return y.mlw});for(var M=0;M<i.length;M++){var g=i[M],b=g.fOut;if(b){var v=b.properties;v.fc=d(g.z),_&&(v.mo=_(g)),w&&(v.mlc=w(g)),A&&(v.mlw=A(g)),g.ct=v.ct,g._polygons=t.feature2polygons(b)}}var u=_?{type:"identity",property:"mo"}:T.opacity;return x.extendFlat(s.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":u}),x.extendFlat(h.paint,{"line-color":w?{type:"identity",property:"mlc"}:l.color,"line-width":A?{type:"identity",property:"mlw"}:l.width,"line-opacity":u}),s.layout.visibility="visible",h.layout.visibility="visible",c.geojson={type:"FeatureCollection",features:m},o(i),c}function o(i){var n=i[0].trace,a=n._opts,s;if(n.selectedpoints){for(var h=E.makeSelectedPointStyleFns(n),c=0;c<i.length;c++){var m=i[c];m.fOut&&(m.fOut.properties.mo2=h.selectedOpacityFn(m))}s={type:"identity",property:"mo2"}}else s=x.isArrayOrTypedArray(n.marker.opacity)?{type:"identity",property:"mo"}:n.marker.opacity;return x.extendFlat(a.fill.paint,{"fill-opacity":s}),x.extendFlat(a.line.paint,{"line-opacity":s}),a}H.exports={convert:r,convertOnSelect:o}}}),_D=De({"src/traces/choroplethmap/plot.js"(Y,H){"use strict";var p=gA().convert,x=gA().convertOnSelect,S=f0().traceLayerPrefix;function E(t,r){this.type="choroplethmap",this.subplot=t,this.uid=r,this.sourceId="source-"+r,this.layerList=[["fill",S+r+"-fill"],["line",S+r+"-line"]],this.below=null}var e=E.prototype;e.update=function(t){this._update(p(t)),t[0].trace._glTrace=this},e.updateOnSelect=function(t){this._update(x(t))},e._update=function(t){var r=this.subplot,o=this.layerList,i=r.belowLookup["trace-"+this.uid];r.map.getSource(this.sourceId).setData(t.geojson),i!==this.below&&(this._removeLayers(),this._addLayers(t,i),this.below=i);for(var n=0;n<o.length;n++){var a=o[n],s=a[0],h=a[1],c=t[s];r.setOptions(h,"setLayoutProperty",c.layout),c.layout.visibility==="visible"&&r.setOptions(h,"setPaintProperty",c.paint)}},e._addLayers=function(t,r){for(var o=this.subplot,i=this.layerList,n=this.sourceId,a=0;a<i.length;a++){var s=i[a],h=s[0],c=t[h];o.addLayer({type:h,id:s[1],source:n,layout:c.layout,paint:c.paint},r)}},e._removeLayers=function(){for(var t=this.subplot.map,r=this.layerList,o=r.length-1;o>=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},H.exports=function(r,o){var i=o[0].trace,n=new E(r,i.uid),a=n.sourceId,s=p(o),h=n.below=r.belowLookup["trace-"+i.uid];return r.map.addSource(a,{type:"geojson",data:s.geojson}),n._addLayers(s,h),o[0].trace._glTrace=n,n}}}),xD=De({"src/traces/choroplethmap/index.js"(Y,H){"use strict";H.exports={attributes:mA(),supplyDefaults:yD(),colorbar:Zp(),calc:cb(),plot:_D(),hoverPoints:hb(),eventData:db(),selectPoints:vb(),styleOnSelect:function(p,x){if(x){var S=x[0].trace;S._glTrace.updateOnSelect(x)}},getBelow:function(p,x){for(var S=x.getMapLayers(),E=S.length-2;E>=0;E--){var e=S[E].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=E+1;t<S.length;t++)if(e=S[t].id,typeof e=="string"&&e.indexOf("plotly-")===-1)return e}}},moduleType:"trace",name:"choroplethmap",basePlotModule:Ib(),categories:["map","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_map"}}}}),bD=De({"lib/choroplethmap.js"(Y,H){"use strict";H.exports=xD()}}),yA=De({"src/traces/densitymap/attributes.js"(Y,H){"use strict";var p=zu(),{hovertemplateAttrs:x,templatefallbackAttrs:S}=ou(),E=Yl(),e=Cb(),t=Xo().extendFlat;H.exports=t({lon:e.lon,lat:e.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:e.text,hovertext:e.hovertext,hoverinfo:t({},E.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:x(),hovertemplatefallback:S(),showlegend:t({},E.showlegend,{dflt:!1})},p("",{cLetter:"z",editTypeOverride:"calc"}))}}),wD=De({"src/traces/densitymap/defaults.js"(Y,H){"use strict";var p=ui(),x=dh(),S=yA();H.exports=function(e,t,r,o){function i(h,c){return p.coerce(e,t,S,h,c)}var n=i("lon")||[],a=i("lat")||[],s=Math.min(n.length,a.length);if(!s){t.visible=!1;return}t._length=s,i("z"),i("radius"),i("below"),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),x(e,t,o,i,{prefix:"",cLetter:"z"})}}}),TD=De({"src/traces/densitymap/calc.js"(Y,H){"use strict";var p=vn(),x=ui().isArrayOrTypedArray,S=zn().BADNUM,E=Jh(),e=ui()._;H.exports=function(r,o){for(var i=o._length,n=new Array(i),a=o.z,s=x(a)&&a.length,h=0;h<i;h++){var c=n[h]={},m=o.lon[h],d=o.lat[h];if(c.lonlat=p(m)&&p(d)?[+m,+d]:[S,S],s){var T=a[h];c.z=p(T)?T:S}}return E(r,o,{vals:s?a:[0,1],containerStr:"",cLetter:"z"}),i&&(n[0].t={labels:{lat:e(r,"lat:")+" ",lon:e(r,"lon:")+" "}}),n}}}),AD=De({"src/traces/densitymap/convert.js"(Y,H){"use strict";var p=vn(),x=ui(),S=vo(),E=oc(),e=zn().BADNUM,t=o0().makeBlank;H.exports=function(o){var i=o[0].trace,n=i.visible===!0&&i._length!==0,a={layout:{visibility:"none"},paint:{}},s=i._opts={heatmap:a,geojson:t()};if(!n)return s;var h=[],c,m=i.z,d=i.radius,T=x.isArrayOrTypedArray(m)&&m.length,l=x.isArrayOrTypedArray(d);for(c=0;c<o.length;c++){var _=o[c],w=_.lonlat;if(w[0]!==e){var A={};if(T){var M=_.z;A.z=M!==e?M:0}l&&(A.r=p(d[c])&&d[c]>0?+d[c]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:w},properties:A})}}var g=E.extractOpts(i),b=g.reversescale?E.flipScale(g.colorscale):g.colorscale,v=b[0][1],u=S.opacity(v)<1?v:S.addOpacity(v,0),y=["interpolate",["linear"],["heatmap-density"],0,u];for(c=1;c<b.length;c++)y.push(b[c][0],b[c][1]);var f=["interpolate",["linear"],["get","z"],g.min,0,g.max,1];return x.extendFlat(s.heatmap.paint,{"heatmap-weight":T?f:1/(g.max-g.min),"heatmap-color":y,"heatmap-radius":l?{type:"identity",property:"r"}:i.radius,"heatmap-opacity":i.opacity}),s.geojson={type:"FeatureCollection",features:h},s.heatmap.layout.visibility="visible",s}}}),SD=De({"src/traces/densitymap/plot.js"(Y,H){"use strict";var p=AD(),x=f0().traceLayerPrefix;function S(e,t){this.type="densitymap",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["heatmap",x+t+"-heatmap"]],this.below=null}var E=S.prototype;E.update=function(e){var t=this.subplot,r=this.layerList,o=p(e),i=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(o.geojson),i!==this.below&&(this._removeLayers(),this._addLayers(o,i),this.below=i);for(var n=0;n<r.length;n++){var a=r[n],s=a[0],h=a[1],c=o[s];t.setOptions(h,"setLayoutProperty",c.layout),c.layout.visibility==="visible"&&t.setOptions(h,"setPaintProperty",c.paint)}},E._addLayers=function(e,t){for(var r=this.subplot,o=this.layerList,i=this.sourceId,n=0;n<o.length;n++){var a=o[n],s=a[0],h=e[s];r.addLayer({type:s,id:a[1],source:i,layout:h.layout,paint:h.paint},t)}},E._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},H.exports=function(t,r){var o=r[0].trace,i=new S(t,o.uid),n=i.sourceId,a=p(r),s=i.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(n,{type:"geojson",data:a.geojson}),i._addLayers(a,s),i}}}),MD=De({"src/traces/densitymap/hover.js"(Y,H){"use strict";var p=us(),x=Lb().hoverPoints,S=Lb().getExtraText;H.exports=function(e,t,r){var o=x(e,t,r);if(o){var i=o[0],n=i.cd,a=n[0].trace,s=n[i.index];if(delete i.color,"z"in s){var h=i.subplot.mockAxis;i.z=s.z,i.zLabel=p.tickText(h,h.c2l(s.z),"hover").text}return i.extraText=S(a,s,n[0].t.labels),[i]}}}}),ED=De({"src/traces/densitymap/event_data.js"(Y,H){"use strict";H.exports=function(x,S){return x.lon=S.lon,x.lat=S.lat,x.z=S.z,x}}}),kD=De({"src/traces/densitymap/index.js"(Y,H){"use strict";H.exports={attributes:yA(),supplyDefaults:wD(),colorbar:Zp(),formatLabels:vA(),calc:TD(),plot:SD(),hoverPoints:MD(),eventData:ED(),getBelow:function(p,x){for(var S=x.getMapLayers(),E=0;E<S.length;E++){var e=S[E],t=e.id;if(e.type==="symbol"&&typeof t=="string"&&t.indexOf("plotly-")===-1)return t}},moduleType:"trace",name:"densitymap",basePlotModule:Ib(),categories:["map","gl","showLegend"],meta:{hr_name:"density_map"}}}}),CD=De({"lib/densitymap.js"(Y,H){"use strict";H.exports=kD()}}),_A=De({"src/traces/sankey/attributes.js"(Y,H){"use strict";var p=qu(),x=Yl(),S=Pf(),E=Np(),e=Ec().attributes,{hovertemplateAttrs:t,templatefallbackAttrs:r}=ou(),o=zu(),i=Gl().templatedArray,n=of().descriptionOnlyNumbers,a=Xo().extendFlat,s=gc().overrideAll,h=H.exports=s({hoverinfo:a({},x.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:E.hoverlabel,domain:e({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:n("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:p({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:S.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:E.hoverlabel,hovertemplate:t({},{keys:["value","label"]}),hovertemplatefallback:r(),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:S.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:E.hoverlabel,hovertemplate:t({},{keys:["value","label"]}),hovertemplatefallback:r(),colorscales:i("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:a(o().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")}}),LD=De({"src/traces/sankey/defaults.js"(Y,H){"use strict";var p=ui(),x=_A(),S=vo(),E=wu(),e=Ec().defaults,t=cy(),r=Gl(),o=Vh();H.exports=function(a,s,h,c){function m(L,z){return p.coerce(a,s,x,L,z)}var d=p.extendDeep(c.hoverlabel,a.hoverlabel),T=a.node,l=r.newContainer(s,"node");function _(L,z){return p.coerce(T,l,x.node,L,z)}_("label"),_("groups"),_("x"),_("y"),_("pad"),_("thickness"),_("line.color"),_("line.width"),_("hoverinfo",a.hoverinfo),t(T,l,_,d),_("hovertemplate"),_("align");var w=c.colorway,A=function(L){return w[L%w.length]};_("color",l.label.map(function(L,z){return S.addOpacity(A(z),.8)})),_("customdata");var M=a.link||{},g=r.newContainer(s,"link");function b(L,z){return p.coerce(M,g,x.link,L,z)}b("label"),b("arrowlen"),b("source"),b("target"),b("value"),b("line.color"),b("line.width"),b("hoverinfo",a.hoverinfo),t(M,g,b,d),b("hovertemplate");var v=E(c.paper_bgcolor).getLuminance()<.333,u=v?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)",y=b("color",u);function f(L){var z=E(L);if(!z.isValid())return L;var F=z.getAlpha();return F<=.8?z.setAlpha(F+.2):z=v?z.brighten():z.darken(),z.toRgbString()}b("hovercolor",Array.isArray(y)?y.map(f):f(y)),b("customdata"),o(M,g,{name:"colorscales",handleItemDefaults:i}),e(s,c,m),m("orientation"),m("valueformat"),m("valuesuffix");var R;l.x.length&&l.y.length&&(R="freeform"),m("arrangement",R),p.coerceFont(m,"textfont",c.font,{autoShadowDflt:!0}),s._length=null};function i(n,a){function s(h,c){return p.coerce(n,a,x.link.colorscales,h,c)}s("label"),s("cmin"),s("cmax"),s("colorscale")}}}),xA=De({"node_modules/strongly-connected-components/scc.js"(Y,H){"use strict";H.exports=p;function p(x){for(var S=x.length,E=new Array(S),e=new Array(S),t=new Array(S),r=new Array(S),o=new Array(S),i=new Array(S),n=0;n<S;++n)E[n]=-1,e[n]=0,t[n]=!1,r[n]=0,o[n]=-1,i[n]=[];var a=0,s=[],h=[];function c(l){var _=[l],w=[l];for(E[l]=e[l]=a,t[l]=!0,a+=1;w.length>0;){l=w[w.length-1];var A=x[l];if(r[l]<A.length){for(var M=r[l];M<A.length;++M){var g=A[M];if(E[g]<0){E[g]=e[g]=a,t[g]=!0,a+=1,_.push(g),w.push(g);break}else t[g]&&(e[l]=Math.min(e[l],e[g])|0);o[g]>=0&&i[l].push(o[g])}r[l]=M}else{if(e[l]===E[l]){for(var b=[],v=[],u=0,M=_.length-1;M>=0;--M){var y=_[M];if(t[y]=!1,b.push(y),v.push(i[y]),u+=i[y].length,o[y]=s.length,y===l){_.length=M;break}}s.push(b);for(var f=new Array(u),M=0;M<v.length;M++)for(var R=0;R<v[M].length;R++)f[--u]=v[M][R];h.push(f)}w.pop()}}}for(var n=0;n<S;++n)E[n]<0&&c(n);for(var m,n=0;n<h.length;n++){var d=h[n];if(d.length!==0){d.sort(function(_,w){return _-w}),m=[d[0]];for(var T=1;T<d.length;T++)d[T]!==d[T-1]&&m.push(d[T]);h[n]=m}}return{components:s,adjacencyList:h}}}}),ID=De({"src/traces/sankey/calc.js"(Y,H){"use strict";var p=xA(),x=ui(),S=Uv().wrap,E=x.isArrayOrTypedArray,e=x.isIndex,t=oc();function r(i){var n=i.node,a=i.link,s=[],h=E(a.color),c=E(a.hovercolor),m=E(a.customdata),d={},T={},l=a.colorscales.length,_;for(_=0;_<l;_++){var w=a.colorscales[_],A=t.extractScale(w,{cLetter:"c"}),M=t.makeColorScaleFunc(A);T[w.label]=M}var g=0;for(_=0;_<a.value.length;_++)a.source[_]>g&&(g=a.source[_]),a.target[_]>g&&(g=a.target[_]);var b=g+1;i.node._count=b;var v,u=i.node.groups,y={};for(_=0;_<u.length;_++){var f=u[_];for(v=0;v<f.length;v++){var R=f[v],L=b+_;y.hasOwnProperty(R)?x.warn("Node "+R+" is already part of a group."):y[R]=L}}var z={source:[],target:[]};for(_=0;_<a.value.length;_++){var F=a.value[_],N=a.source[_],B=a.target[_];if(F>0&&e(N,b)&&e(B,b)&&!(y.hasOwnProperty(N)&&y.hasOwnProperty(B)&&y[N]===y[B])){y.hasOwnProperty(B)&&(B=y[B]),y.hasOwnProperty(N)&&(N=y[N]),N=+N,B=+B,d[N]=d[B]=!0;var I="";a.label&&a.label[_]&&(I=a.label[_]);var U=null;I&&T.hasOwnProperty(I)&&(U=T[I]),s.push({pointNumber:_,label:I,color:h?a.color[_]:a.color,hovercolor:c?a.hovercolor[_]:a.hovercolor,customdata:m?a.customdata[_]:a.customdata,concentrationscale:U,source:N,target:B,value:+F}),z.source.push(N),z.target.push(B)}}var O=b+u.length,X=E(n.color),J=E(n.customdata),se=[];for(_=0;_<O;_++)if(d[_]){var le=n.label[_];se.push({group:_>b-1,childrenNodes:[],pointNumber:_,label:le,color:X?n.color[_]:n.color,customdata:J?n.customdata[_]:n.customdata})}var ce=!1;return o(O,z.source,z.target)&&(ce=!0),{circular:ce,links:s,nodes:se,groups:u,groupLookup:y}}function o(i,n,a){for(var s=x.init2dArray(i,0),h=0;h<Math.min(n.length,a.length);h++)if(x.isIndex(n[h],i)&&x.isIndex(a[h],i)){if(n[h]===a[h])return!0;s[n[h]].push(a[h])}var c=p(s);return c.components.some(function(m){return m.length>1})}H.exports=function(n,a){var s=r(a);return S({circular:s.circular,_nodes:s.nodes,_links:s.links,_groups:s.groups,_groupLookup:s.groupLookup})}}}),PD=De({"node_modules/d3-quadtree/dist/d3-quadtree.js"(Y,H){(function(p,x){typeof Y=="object"&&typeof H<"u"?x(Y):(p=p||self,x(p.d3=p.d3||{}))})(Y,function(p){"use strict";function x(b){var v=+this._x.call(null,b),u=+this._y.call(null,b);return S(this.cover(v,u),v,u,b)}function S(b,v,u,y){if(isNaN(v)||isNaN(u))return b;var f,R=b._root,L={data:y},z=b._x0,F=b._y0,N=b._x1,B=b._y1,I,U,O,X,J,se,le,ce;if(!R)return b._root=L,b;for(;R.length;)if((J=v>=(I=(z+N)/2))?z=I:N=I,(se=u>=(U=(F+B)/2))?F=U:B=U,f=R,!(R=R[le=se<<1|J]))return f[le]=L,b;if(O=+b._x.call(null,R.data),X=+b._y.call(null,R.data),v===O&&u===X)return L.next=R,f?f[le]=L:b._root=L,b;do f=f?f[le]=new Array(4):b._root=new Array(4),(J=v>=(I=(z+N)/2))?z=I:N=I,(se=u>=(U=(F+B)/2))?F=U:B=U;while((le=se<<1|J)===(ce=(X>=U)<<1|O>=I));return f[ce]=R,f[le]=L,b}function E(b){var v,u,y=b.length,f,R,L=new Array(y),z=new Array(y),F=1/0,N=1/0,B=-1/0,I=-1/0;for(u=0;u<y;++u)isNaN(f=+this._x.call(null,v=b[u]))||isNaN(R=+this._y.call(null,v))||(L[u]=f,z[u]=R,f<F&&(F=f),f>B&&(B=f),R<N&&(N=R),R>I&&(I=R));if(F>B||N>I)return this;for(this.cover(F,N).cover(B,I),u=0;u<y;++u)S(this,L[u],z[u],b[u]);return this}function e(b,v){if(isNaN(b=+b)||isNaN(v=+v))return this;var u=this._x0,y=this._y0,f=this._x1,R=this._y1;if(isNaN(u))f=(u=Math.floor(b))+1,R=(y=Math.floor(v))+1;else{for(var L=f-u,z=this._root,F,N;u>b||b>=f||y>v||v>=R;)switch(N=(v<y)<<1|b<u,F=new Array(4),F[N]=z,z=F,L*=2,N){case 0:f=u+L,R=y+L;break;case 1:u=f-L,R=y+L;break;case 2:f=u+L,y=R-L;break;case 3:u=f-L,y=R-L;break}this._root&&this._root.length&&(this._root=z)}return this._x0=u,this._y0=y,this._x1=f,this._y1=R,this}function t(){var b=[];return this.visit(function(v){if(!v.length)do b.push(v.data);while(v=v.next)}),b}function r(b){return arguments.length?this.cover(+b[0][0],+b[0][1]).cover(+b[1][0],+b[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function o(b,v,u,y,f){this.node=b,this.x0=v,this.y0=u,this.x1=y,this.y1=f}function i(b,v,u){var y,f=this._x0,R=this._y0,L,z,F,N,B=this._x1,I=this._y1,U=[],O=this._root,X,J;for(O&&U.push(new o(O,f,R,B,I)),u==null?u=1/0:(f=b-u,R=v-u,B=b+u,I=v+u,u*=u);X=U.pop();)if(!(!(O=X.node)||(L=X.x0)>B||(z=X.y0)>I||(F=X.x1)<f||(N=X.y1)<R))if(O.length){var se=(L+F)/2,le=(z+N)/2;U.push(new o(O[3],se,le,F,N),new o(O[2],L,le,se,N),new o(O[1],se,z,F,le),new o(O[0],L,z,se,le)),(J=(v>=le)<<1|b>=se)&&(X=U[U.length-1],U[U.length-1]=U[U.length-1-J],U[U.length-1-J]=X)}else{var ce=b-+this._x.call(null,O.data),q=v-+this._y.call(null,O.data),Z=ce*ce+q*q;if(Z<u){var ee=Math.sqrt(u=Z);f=b-ee,R=v-ee,B=b+ee,I=v+ee,y=O.data}}return y}function n(b){if(isNaN(B=+this._x.call(null,b))||isNaN(I=+this._y.call(null,b)))return this;var v,u=this._root,y,f,R,L=this._x0,z=this._y0,F=this._x1,N=this._y1,B,I,U,O,X,J,se,le;if(!u)return this;if(u.length)for(;;){if((X=B>=(U=(L+F)/2))?L=U:F=U,(J=I>=(O=(z+N)/2))?z=O:N=O,v=u,!(u=u[se=J<<1|X]))return this;if(!u.length)break;(v[se+1&3]||v[se+2&3]||v[se+3&3])&&(y=v,le=se)}for(;u.data!==b;)if(f=u,!(u=u.next))return this;return(R=u.next)&&delete u.next,f?(R?f.next=R:delete f.next,this):v?(R?v[se]=R:delete v[se],(u=v[0]||v[1]||v[2]||v[3])&&u===(v[3]||v[2]||v[1]||v[0])&&!u.length&&(y?y[le]=u:this._root=u),this):(this._root=R,this)}function a(b){for(var v=0,u=b.length;v<u;++v)this.remove(b[v]);return this}function s(){return this._root}function h(){var b=0;return this.visit(function(v){if(!v.length)do++b;while(v=v.next)}),b}function c(b){var v=[],u,y=this._root,f,R,L,z,F;for(y&&v.push(new o(y,this._x0,this._y0,this._x1,this._y1));u=v.pop();)if(!b(y=u.node,R=u.x0,L=u.y0,z=u.x1,F=u.y1)&&y.length){var N=(R+z)/2,B=(L+F)/2;(f=y[3])&&v.push(new o(f,N,B,z,F)),(f=y[2])&&v.push(new o(f,R,B,N,F)),(f=y[1])&&v.push(new o(f,N,L,z,B)),(f=y[0])&&v.push(new o(f,R,L,N,B))}return this}function m(b){var v=[],u=[],y;for(this._root&&v.push(new o(this._root,this._x0,this._y0,this._x1,this._y1));y=v.pop();){var f=y.node;if(f.length){var R,L=y.x0,z=y.y0,F=y.x1,N=y.y1,B=(L+F)/2,I=(z+N)/2;(R=f[0])&&v.push(new o(R,L,z,B,I)),(R=f[1])&&v.push(new o(R,B,z,F,I)),(R=f[2])&&v.push(new o(R,L,I,B,N)),(R=f[3])&&v.push(new o(R,B,I,F,N))}u.push(y)}for(;y=u.pop();)b(y.node,y.x0,y.y0,y.x1,y.y1);return this}function d(b){return b[0]}function T(b){return arguments.length?(this._x=b,this):this._x}function l(b){return b[1]}function _(b){return arguments.length?(this._y=b,this):this._y}function w(b,v,u){var y=new A(v??d,u??l,NaN,NaN,NaN,NaN);return b==null?y:y.addAll(b)}function A(b,v,u,y,f,R){this._x=b,this._y=v,this._x0=u,this._y0=y,this._x1=f,this._y1=R,this._root=void 0}function M(b){for(var v={data:b.data},u=v;b=b.next;)u=u.next={data:b.data};return v}var g=w.prototype=A.prototype;g.copy=function(){var b=new A(this._x,this._y,this._x0,this._y0,this._x1,this._y1),v=this._root,u,y;if(!v)return b;if(!v.length)return b._root=M(v),b;for(u=[{source:v,target:b._root=new Array(4)}];v=u.pop();)for(var f=0;f<4;++f)(y=v.source[f])&&(y.length?u.push({source:y,target:v.target[f]=new Array(4)}):v.target[f]=M(y));return b},g.add=x,g.addAll=E,g.cover=e,g.data=t,g.extent=r,g.find=i,g.remove=n,g.removeAll=a,g.root=s,g.size=h,g.visit=c,g.visitAfter=m,g.x=T,g.y=_,p.quadtree=w,Object.defineProperty(p,"__esModule",{value:!0})})}}),Pb=De({"node_modules/d3-collection/dist/d3-collection.js"(Y,H){(function(p,x){x(typeof Y=="object"&&typeof H<"u"?Y:p.d3=p.d3||{})})(Y,function(p){"use strict";var x="$";function S(){}S.prototype=E.prototype={constructor:S,has:function(d){return x+d in this},get:function(d){return this[x+d]},set:function(d,T){return this[x+d]=T,this},remove:function(d){var T=x+d;return T in this&&delete this[T]},clear:function(){for(var d in this)d[0]===x&&delete this[d]},keys:function(){var d=[];for(var T in this)T[0]===x&&d.push(T.slice(1));return d},values:function(){var d=[];for(var T in this)T[0]===x&&d.push(this[T]);return d},entries:function(){var d=[];for(var T in this)T[0]===x&&d.push({key:T.slice(1),value:this[T]});return d},size:function(){var d=0;for(var T in this)T[0]===x&&++d;return d},empty:function(){for(var d in this)if(d[0]===x)return!1;return!0},each:function(d){for(var T in this)T[0]===x&&d(this[T],T.slice(1),this)}};function E(d,T){var l=new S;if(d instanceof S)d.each(function(g,b){l.set(b,g)});else if(Array.isArray(d)){var _=-1,w=d.length,A;if(T==null)for(;++_<w;)l.set(_,d[_]);else for(;++_<w;)l.set(T(A=d[_],_,d),A)}else if(d)for(var M in d)l.set(M,d[M]);return l}function e(){var d=[],T=[],l,_,w;function A(g,b,v,u){if(b>=d.length)return l!=null&&g.sort(l),_!=null?_(g):g;for(var y=-1,f=g.length,R=d[b++],L,z,F=E(),N,B=v();++y<f;)(N=F.get(L=R(z=g[y])+""))?N.push(z):F.set(L,[z]);return F.each(function(I,U){u(B,U,A(I,b,v,u))}),B}function M(g,b){if(++b>d.length)return g;var v,u=T[b-1];return _!=null&&b>=d.length?v=g.entries():(v=[],g.each(function(y,f){v.push({key:f,values:M(y,b)})})),u!=null?v.sort(function(y,f){return u(y.key,f.key)}):v}return w={object:function(g){return A(g,0,t,r)},map:function(g){return A(g,0,o,i)},entries:function(g){return M(A(g,0,o,i),0)},key:function(g){return d.push(g),w},sortKeys:function(g){return T[d.length-1]=g,w},sortValues:function(g){return l=g,w},rollup:function(g){return _=g,w}}}function t(){return{}}function r(d,T,l){d[T]=l}function o(){return E()}function i(d,T,l){d.set(T,l)}function n(){}var a=E.prototype;n.prototype=s.prototype={constructor:n,has:a.has,add:function(d){return d+="",this[x+d]=d,this},remove:a.remove,clear:a.clear,values:a.keys,size:a.size,empty:a.empty,each:a.each};function s(d,T){var l=new n;if(d instanceof n)d.each(function(A){l.add(A)});else if(d){var _=-1,w=d.length;if(T==null)for(;++_<w;)l.add(d[_]);else for(;++_<w;)l.add(T(d[_],_,d))}return l}function h(d){var T=[];for(var l in d)T.push(l);return T}function c(d){var T=[];for(var l in d)T.push(d[l]);return T}function m(d){var T=[];for(var l in d)T.push({key:l,value:d[l]});return T}p.nest=e,p.set=s,p.map=E,p.keys=h,p.values=c,p.entries=m,Object.defineProperty(p,"__esModule",{value:!0})})}}),RD=De({"node_modules/d3-dispatch/dist/d3-dispatch.js"(Y,H){(function(p,x){typeof Y=="object"&&typeof H<"u"?x(Y):(p=p||self,x(p.d3=p.d3||{}))})(Y,function(p){"use strict";var x={value:function(){}};function S(){for(var o=0,i=arguments.length,n={},a;o<i;++o){if(!(a=arguments[o]+"")||a in n||/[\s.]/.test(a))throw new Error("illegal type: "+a);n[a]=[]}return new E(n)}function E(o){this._=o}function e(o,i){return o.trim().split(/^|\s+/).map(function(n){var a="",s=n.indexOf(".");if(s>=0&&(a=n.slice(s+1),n=n.slice(0,s)),n&&!i.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:a}})}E.prototype=S.prototype={constructor:E,on:function(o,i){var n=this._,a=e(o+"",n),s,h=-1,c=a.length;if(arguments.length<2){for(;++h<c;)if((s=(o=a[h]).type)&&(s=t(n[s],o.name)))return s;return}if(i!=null&&typeof i!="function")throw new Error("invalid callback: "+i);for(;++h<c;)if(s=(o=a[h]).type)n[s]=r(n[s],o.name,i);else if(i==null)for(s in n)n[s]=r(n[s],o.name,null);return this},copy:function(){var o={},i=this._;for(var n in i)o[n]=i[n].slice();return new E(o)},call:function(o,i){if((s=arguments.length-2)>0)for(var n=new Array(s),a=0,s,h;a<s;++a)n[a]=arguments[a+2];if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(h=this._[o],a=0,s=h.length;a<s;++a)h[a].value.apply(i,n)},apply:function(o,i,n){if(!this._.hasOwnProperty(o))throw new Error("unknown type: "+o);for(var a=this._[o],s=0,h=a.length;s<h;++s)a[s].value.apply(i,n)}};function t(o,i){for(var n=0,a=o.length,s;n<a;++n)if((s=o[n]).name===i)return s.value}function r(o,i,n){for(var a=0,s=o.length;a<s;++a)if(o[a].name===i){o[a]=x,o=o.slice(0,a).concat(o.slice(a+1));break}return n!=null&&o.push({name:i,value:n}),o}p.dispatch=S,Object.defineProperty(p,"__esModule",{value:!0})})}}),DD=De({"node_modules/d3-timer/dist/d3-timer.js"(Y,H){(function(p,x){typeof Y=="object"&&typeof H<"u"?x(Y):(p=p||self,x(p.d3=p.d3||{}))})(Y,function(p){"use strict";var x=0,S=0,E=0,e=1e3,t,r,o=0,i=0,n=0,a=typeof performance=="object"&&performance.now?performance:Date,s=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(b){setTimeout(b,17)};function h(){return i||(s(c),i=a.now()+n)}function c(){i=0}function m(){this._call=this._time=this._next=null}m.prototype=d.prototype={constructor:m,restart:function(b,v,u){if(typeof b!="function")throw new TypeError("callback is not a function");u=(u==null?h():+u)+(v==null?0:+v),!this._next&&r!==this&&(r?r._next=this:t=this,r=this),this._call=b,this._time=u,A()},stop:function(){this._call&&(this._call=null,this._time=1/0,A())}};function d(b,v,u){var y=new m;return y.restart(b,v,u),y}function T(){h(),++x;for(var b=t,v;b;)(v=i-b._time)>=0&&b._call.call(null,v),b=b._next;--x}function l(){i=(o=a.now())+n,x=S=0;try{T()}finally{x=0,w(),i=0}}function _(){var b=a.now(),v=b-o;v>e&&(n-=v,o=b)}function w(){for(var b,v=t,u,y=1/0;v;)v._call?(y>v._time&&(y=v._time),b=v,v=v._next):(u=v._next,v._next=null,v=b?b._next=u:t=u);r=b,A(y)}function A(b){if(!x){S&&(S=clearTimeout(S));var v=b-i;v>24?(b<1/0&&(S=setTimeout(l,b-a.now()-n)),E&&(E=clearInterval(E))):(E||(o=a.now(),E=setInterval(_,e)),x=1,s(l))}}function M(b,v,u){var y=new m;return v=v==null?0:+v,y.restart(function(f){y.stop(),b(f+v)},v,u),y}function g(b,v,u){var y=new m,f=v;return v==null?(y.restart(b,v,u),y):(v=+v,u=u==null?h():+u,y.restart(function R(L){L+=f,y.restart(R,f+=v,u),b(L)},v,u),y)}p.interval=g,p.now=h,p.timeout=M,p.timer=d,p.timerFlush=T,Object.defineProperty(p,"__esModule",{value:!0})})}}),zD=De({"node_modules/d3-force/dist/d3-force.js"(Y,H){(function(p,x){typeof Y=="object"&&typeof H<"u"?x(Y,PD(),Pb(),RD(),DD()):x(p.d3=p.d3||{},p.d3,p.d3,p.d3,p.d3)})(Y,function(p,x,S,E,e){"use strict";function t(b,v){var u;b==null&&(b=0),v==null&&(v=0);function y(){var f,R=u.length,L,z=0,F=0;for(f=0;f<R;++f)L=u[f],z+=L.x,F+=L.y;for(z=z/R-b,F=F/R-v,f=0;f<R;++f)L=u[f],L.x-=z,L.y-=F}return y.initialize=function(f){u=f},y.x=function(f){return arguments.length?(b=+f,y):b},y.y=function(f){return arguments.length?(v=+f,y):v},y}function r(b){return function(){return b}}function o(){return(Math.random()-.5)*1e-6}function i(b){return b.x+b.vx}function n(b){return b.y+b.vy}function a(b){var v,u,y=1,f=1;typeof b!="function"&&(b=r(b==null?1:+b));function R(){for(var F,N=v.length,B,I,U,O,X,J,se=0;se<f;++se)for(B=x.quadtree(v,i,n).visitAfter(L),F=0;F<N;++F)I=v[F],X=u[I.index],J=X*X,U=I.x+I.vx,O=I.y+I.vy,B.visit(le);function le(ce,q,Z,ee,V){var oe=ce.data,ie=ce.r,j=X+ie;if(oe){if(oe.index>I.index){var Q=U-oe.x-oe.vx,re=O-oe.y-oe.vy,ue=Q*Q+re*re;ue<j*j&&(Q===0&&(Q=o(),ue+=Q*Q),re===0&&(re=o(),ue+=re*re),ue=(j-(ue=Math.sqrt(ue)))/ue*y,I.vx+=(Q*=ue)*(j=(ie*=ie)/(J+ie)),I.vy+=(re*=ue)*j,oe.vx-=Q*(j=1-j),oe.vy-=re*j)}return}return q>U+j||ee<U-j||Z>O+j||V<O-j}}function L(F){if(F.data)return F.r=u[F.data.index];for(var N=F.r=0;N<4;++N)F[N]&&F[N].r>F.r&&(F.r=F[N].r)}function z(){if(v){var F,N=v.length,B;for(u=new Array(N),F=0;F<N;++F)B=v[F],u[B.index]=+b(B,F,v)}}return R.initialize=function(F){v=F,z()},R.iterations=function(F){return arguments.length?(f=+F,R):f},R.strength=function(F){return arguments.length?(y=+F,R):y},R.radius=function(F){return arguments.length?(b=typeof F=="function"?F:r(+F),z(),R):b},R}function s(b){return b.index}function h(b,v){var u=b.get(v);if(!u)throw new Error("missing: "+v);return u}function c(b){var v=s,u=B,y,f=r(30),R,L,z,F,N=1;b==null&&(b=[]);function B(J){return 1/Math.min(z[J.source.index],z[J.target.index])}function I(J){for(var se=0,le=b.length;se<N;++se)for(var ce=0,q,Z,ee,V,oe,ie,j;ce<le;++ce)q=b[ce],Z=q.source,ee=q.target,V=ee.x+ee.vx-Z.x-Z.vx||o(),oe=ee.y+ee.vy-Z.y-Z.vy||o(),ie=Math.sqrt(V*V+oe*oe),ie=(ie-R[ce])/ie*J*y[ce],V*=ie,oe*=ie,ee.vx-=V*(j=F[ce]),ee.vy-=oe*j,Z.vx+=V*(j=1-j),Z.vy+=oe*j}function U(){if(L){var J,se=L.length,le=b.length,ce=S.map(L,v),q;for(J=0,z=new Array(se);J<le;++J)q=b[J],q.index=J,typeof q.source!="object"&&(q.source=h(ce,q.source)),typeof q.target!="object"&&(q.target=h(ce,q.target)),z[q.source.index]=(z[q.source.index]||0)+1,z[q.target.index]=(z[q.target.index]||0)+1;for(J=0,F=new Array(le);J<le;++J)q=b[J],F[J]=z[q.source.index]/(z[q.source.index]+z[q.target.index]);y=new Array(le),O(),R=new Array(le),X()}}function O(){if(L)for(var J=0,se=b.length;J<se;++J)y[J]=+u(b[J],J,b)}function X(){if(L)for(var J=0,se=b.length;J<se;++J)R[J]=+f(b[J],J,b)}return I.initialize=function(J){L=J,U()},I.links=function(J){return arguments.length?(b=J,U(),I):b},I.id=function(J){return arguments.length?(v=J,I):v},I.iterations=function(J){return arguments.length?(N=+J,I):N},I.strength=function(J){return arguments.length?(u=typeof J=="function"?J:r(+J),O(),I):u},I.distance=function(J){return arguments.length?(f=typeof J=="function"?J:r(+J),X(),I):f},I}function m(b){return b.x}function d(b){return b.y}var T=10,l=Math.PI*(3-Math.sqrt(5));function _(b){var v,u=1,y=.001,f=1-Math.pow(y,1/300),R=0,L=.6,z=S.map(),F=e.timer(B),N=E.dispatch("tick","end");b==null&&(b=[]);function B(){I(),N.call("tick",v),u<y&&(F.stop(),N.call("end",v))}function I(X){var J,se=b.length,le;X===void 0&&(X=1);for(var ce=0;ce<X;++ce)for(u+=(R-u)*f,z.each(function(q){q(u)}),J=0;J<se;++J)le=b[J],le.fx==null?le.x+=le.vx*=L:(le.x=le.fx,le.vx=0),le.fy==null?le.y+=le.vy*=L:(le.y=le.fy,le.vy=0);return v}function U(){for(var X=0,J=b.length,se;X<J;++X){if(se=b[X],se.index=X,se.fx!=null&&(se.x=se.fx),se.fy!=null&&(se.y=se.fy),isNaN(se.x)||isNaN(se.y)){var le=T*Math.sqrt(X),ce=X*l;se.x=le*Math.cos(ce),se.y=le*Math.sin(ce)}(isNaN(se.vx)||isNaN(se.vy))&&(se.vx=se.vy=0)}}function O(X){return X.initialize&&X.initialize(b),X}return U(),v={tick:I,restart:function(){return F.restart(B),v},stop:function(){return F.stop(),v},nodes:function(X){return arguments.length?(b=X,U(),z.each(O),v):b},alpha:function(X){return arguments.length?(u=+X,v):u},alphaMin:function(X){return arguments.length?(y=+X,v):y},alphaDecay:function(X){return arguments.length?(f=+X,v):+f},alphaTarget:function(X){return arguments.length?(R=+X,v):R},velocityDecay:function(X){return arguments.length?(L=1-X,v):1-L},force:function(X,J){return arguments.length>1?(J==null?z.remove(X):z.set(X,O(J)),v):z.get(X)},find:function(X,J,se){var le=0,ce=b.length,q,Z,ee,V,oe;for(se==null?se=1/0:se*=se,le=0;le<ce;++le)V=b[le],q=X-V.x,Z=J-V.y,ee=q*q+Z*Z,ee<se&&(oe=V,se=ee);return oe},on:function(X,J){return arguments.length>1?(N.on(X,J),v):N.on(X)}}}function w(){var b,v,u,y=r(-30),f,R=1,L=1/0,z=.81;function F(U){var O,X=b.length,J=x.quadtree(b,m,d).visitAfter(B);for(u=U,O=0;O<X;++O)v=b[O],J.visit(I)}function N(){if(b){var U,O=b.length,X;for(f=new Array(O),U=0;U<O;++U)X=b[U],f[X.index]=+y(X,U,b)}}function B(U){var O=0,X,J,se=0,le,ce,q;if(U.length){for(le=ce=q=0;q<4;++q)(X=U[q])&&(J=Math.abs(X.value))&&(O+=X.value,se+=J,le+=J*X.x,ce+=J*X.y);U.x=le/se,U.y=ce/se}else{X=U,X.x=X.data.x,X.y=X.data.y;do O+=f[X.data.index];while(X=X.next)}U.value=O}function I(U,O,X,J){if(!U.value)return!0;var se=U.x-v.x,le=U.y-v.y,ce=J-O,q=se*se+le*le;if(ce*ce/z<q)return q<L&&(se===0&&(se=o(),q+=se*se),le===0&&(le=o(),q+=le*le),q<R&&(q=Math.sqrt(R*q)),v.vx+=se*U.value*u/q,v.vy+=le*U.value*u/q),!0;if(U.length||q>=L)return;(U.data!==v||U.next)&&(se===0&&(se=o(),q+=se*se),le===0&&(le=o(),q+=le*le),q<R&&(q=Math.sqrt(R*q)));do U.data!==v&&(ce=f[U.data.index]*u/q,v.vx+=se*ce,v.vy+=le*ce);while(U=U.next)}return F.initialize=function(U){b=U,N()},F.strength=function(U){return arguments.length?(y=typeof U=="function"?U:r(+U),N(),F):y},F.distanceMin=function(U){return arguments.length?(R=U*U,F):Math.sqrt(R)},F.distanceMax=function(U){return arguments.length?(L=U*U,F):Math.sqrt(L)},F.theta=function(U){return arguments.length?(z=U*U,F):Math.sqrt(z)},F}function A(b,v,u){var y,f=r(.1),R,L;typeof b!="function"&&(b=r(+b)),v==null&&(v=0),u==null&&(u=0);function z(N){for(var B=0,I=y.length;B<I;++B){var U=y[B],O=U.x-v||1e-6,X=U.y-u||1e-6,J=Math.sqrt(O*O+X*X),se=(L[B]-J)*R[B]*N/J;U.vx+=O*se,U.vy+=X*se}}function F(){if(y){var N,B=y.length;for(R=new Array(B),L=new Array(B),N=0;N<B;++N)L[N]=+b(y[N],N,y),R[N]=isNaN(L[N])?0:+f(y[N],N,y)}}return z.initialize=function(N){y=N,F()},z.strength=function(N){return arguments.length?(f=typeof N=="function"?N:r(+N),F(),z):f},z.radius=function(N){return arguments.length?(b=typeof N=="function"?N:r(+N),F(),z):b},z.x=function(N){return arguments.length?(v=+N,z):v},z.y=function(N){return arguments.length?(u=+N,z):u},z}function M(b){var v=r(.1),u,y,f;typeof b!="function"&&(b=r(b==null?0:+b));function R(z){for(var F=0,N=u.length,B;F<N;++F)B=u[F],B.vx+=(f[F]-B.x)*y[F]*z}function L(){if(u){var z,F=u.length;for(y=new Array(F),f=new Array(F),z=0;z<F;++z)y[z]=isNaN(f[z]=+b(u[z],z,u))?0:+v(u[z],z,u)}}return R.initialize=function(z){u=z,L()},R.strength=function(z){return arguments.length?(v=typeof z=="function"?z:r(+z),L(),R):v},R.x=function(z){return arguments.length?(b=typeof z=="function"?z:r(+z),L(),R):b},R}function g(b){var v=r(.1),u,y,f;typeof b!="function"&&(b=r(b==null?0:+b));function R(z){for(var F=0,N=u.length,B;F<N;++F)B=u[F],B.vy+=(f[F]-B.y)*y[F]*z}function L(){if(u){var z,F=u.length;for(y=new Array(F),f=new Array(F),z=0;z<F;++z)y[z]=isNaN(f[z]=+b(u[z],z,u))?0:+v(u[z],z,u)}}return R.initialize=function(z){u=z,L()},R.strength=function(z){return arguments.length?(v=typeof z=="function"?z:r(+z),L(),R):v},R.y=function(z){return arguments.length?(b=typeof z=="function"?z:r(+z),L(),R):b},R}p.forceCenter=t,p.forceCollide=a,p.forceLink=c,p.forceManyBody=w,p.forceRadial=A,p.forceSimulation=_,p.forceX=M,p.forceY=g,Object.defineProperty(p,"__esModule",{value:!0})})}}),FD=De({"node_modules/d3-path/dist/d3-path.js"(Y,H){(function(p,x){typeof Y=="object"&&typeof H<"u"?x(Y):(p=p||self,x(p.d3=p.d3||{}))})(Y,function(p){"use strict";var x=Math.PI,S=2*x,E=1e-6,e=S-E;function t(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function r(){return new t}t.prototype=r.prototype={constructor:t,moveTo:function(o,i){this._+="M"+(this._x0=this._x1=+o)+","+(this._y0=this._y1=+i)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(o,i){this._+="L"+(this._x1=+o)+","+(this._y1=+i)},quadraticCurveTo:function(o,i,n,a){this._+="Q"+ +o+","+ +i+","+(this._x1=+n)+","+(this._y1=+a)},bezierCurveTo:function(o,i,n,a,s,h){this._+="C"+ +o+","+ +i+","+ +n+","+ +a+","+(this._x1=+s)+","+(this._y1=+h)},arcTo:function(o,i,n,a,s){o=+o,i=+i,n=+n,a=+a,s=+s;var h=this._x1,c=this._y1,m=n-o,d=a-i,T=h-o,l=c-i,_=T*T+l*l;if(s<0)throw new Error("negative radius: "+s);if(this._x1===null)this._+="M"+(this._x1=o)+","+(this._y1=i);else if(_>E)if(!(Math.abs(l*m-d*T)>E)||!s)this._+="L"+(this._x1=o)+","+(this._y1=i);else{var w=n-h,A=a-c,M=m*m+d*d,g=w*w+A*A,b=Math.sqrt(M),v=Math.sqrt(_),u=s*Math.tan((x-Math.acos((M+_-g)/(2*b*v)))/2),y=u/v,f=u/b;Math.abs(y-1)>E&&(this._+="L"+(o+y*T)+","+(i+y*l)),this._+="A"+s+","+s+",0,0,"+ +(l*w>T*A)+","+(this._x1=o+f*m)+","+(this._y1=i+f*d)}},arc:function(o,i,n,a,s,h){o=+o,i=+i,n=+n,h=!!h;var c=n*Math.cos(a),m=n*Math.sin(a),d=o+c,T=i+m,l=1^h,_=h?a-s:s-a;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+d+","+T:(Math.abs(this._x1-d)>E||Math.abs(this._y1-T)>E)&&(this._+="L"+d+","+T),n&&(_<0&&(_=_%S+S),_>e?this._+="A"+n+","+n+",0,1,"+l+","+(o-c)+","+(i-m)+"A"+n+","+n+",0,1,"+l+","+(this._x1=d)+","+(this._y1=T):_>E&&(this._+="A"+n+","+n+",0,"+ +(_>=x)+","+l+","+(this._x1=o+n*Math.cos(s))+","+(this._y1=i+n*Math.sin(s))))},rect:function(o,i,n,a){this._+="M"+(this._x0=this._x1=+o)+","+(this._y0=this._y1=+i)+"h"+ +n+"v"+ +a+"h"+-n+"Z"},toString:function(){return this._}},p.path=r,Object.defineProperty(p,"__esModule",{value:!0})})}}),bA=De({"node_modules/d3-shape/dist/d3-shape.js"(Y,H){(function(p,x){typeof Y=="object"&&typeof H<"u"?x(Y,FD()):(p=p||self,x(p.d3=p.d3||{},p.d3))})(Y,function(p,x){"use strict";function S(yt){return function(){return yt}}var E=Math.abs,e=Math.atan2,t=Math.cos,r=Math.max,o=Math.min,i=Math.sin,n=Math.sqrt,a=1e-12,s=Math.PI,h=s/2,c=2*s;function m(yt){return yt>1?0:yt<-1?s:Math.acos(yt)}function d(yt){return yt>=1?h:yt<=-1?-h:Math.asin(yt)}function T(yt){return yt.innerRadius}function l(yt){return yt.outerRadius}function _(yt){return yt.startAngle}function w(yt){return yt.endAngle}function A(yt){return yt&&yt.padAngle}function M(yt,Xt,mr,Or,ki,Ni,Si,fi){var Li=mr-yt,Ia=Or-Xt,Fa=Si-ki,un=fi-Ni,Bn=un*Li-Fa*Ia;if(!(Bn*Bn<a))return Bn=(Fa*(Xt-Ni)-un*(yt-ki))/Bn,[yt+Bn*Li,Xt+Bn*Ia]}function g(yt,Xt,mr,Or,ki,Ni,Si){var fi=yt-mr,Li=Xt-Or,Ia=(Si?Ni:-Ni)/n(fi*fi+Li*Li),Fa=Ia*Li,un=-Ia*fi,Bn=yt+Fa,Kn=Xt+un,Gn=mr+Fa,eo=Or+un,Ao=(Bn+Gn)/2,An=(Kn+eo)/2,Eo=Gn-Bn,fs=eo-Kn,Ls=Eo*Eo+fs*fs,ns=ki-Ni,uo=Bn*eo-Gn*Kn,ss=(fs<0?-1:1)*n(r(0,ns*ns*Ls-uo*uo)),xs=(uo*fs-Eo*ss)/Ls,el=(-uo*Eo-fs*ss)/Ls,Ss=(uo*fs+Eo*ss)/Ls,Co=(-uo*Eo+fs*ss)/Ls,ao=xs-Ao,co=el-An,Ms=Ss-Ao,Gs=Co-An;return ao*ao+co*co>Ms*Ms+Gs*Gs&&(xs=Ss,el=Co),{cx:xs,cy:el,x01:-Fa,y01:-un,x11:xs*(ki/ns-1),y11:el*(ki/ns-1)}}function b(){var yt=T,Xt=l,mr=S(0),Or=null,ki=_,Ni=w,Si=A,fi=null;function Li(){var Ia,Fa,un=+yt.apply(this,arguments),Bn=+Xt.apply(this,arguments),Kn=ki.apply(this,arguments)-h,Gn=Ni.apply(this,arguments)-h,eo=E(Gn-Kn),Ao=Gn>Kn;if(fi||(fi=Ia=x.path()),Bn<un&&(Fa=Bn,Bn=un,un=Fa),!(Bn>a))fi.moveTo(0,0);else if(eo>c-a)fi.moveTo(Bn*t(Kn),Bn*i(Kn)),fi.arc(0,0,Bn,Kn,Gn,!Ao),un>a&&(fi.moveTo(un*t(Gn),un*i(Gn)),fi.arc(0,0,un,Gn,Kn,Ao));else{var An=Kn,Eo=Gn,fs=Kn,Ls=Gn,ns=eo,uo=eo,ss=Si.apply(this,arguments)/2,xs=ss>a&&(Or?+Or.apply(this,arguments):n(un*un+Bn*Bn)),el=o(E(Bn-un)/2,+mr.apply(this,arguments)),Ss=el,Co=el,ao,co;if(xs>a){var Ms=d(xs/un*i(ss)),Gs=d(xs/Bn*i(ss));(ns-=Ms*2)>a?(Ms*=Ao?1:-1,fs+=Ms,Ls-=Ms):(ns=0,fs=Ls=(Kn+Gn)/2),(uo-=Gs*2)>a?(Gs*=Ao?1:-1,An+=Gs,Eo-=Gs):(uo=0,An=Eo=(Kn+Gn)/2)}var ul=Bn*t(An),hs=Bn*i(An),rn=un*t(Ls),Xn=un*i(Ls);if(el>a){var tl=Bn*t(Eo),zs=Bn*i(Eo),so=un*t(fs),$s=un*i(fs),Ps;if(eo<s&&(Ps=M(ul,hs,so,$s,tl,zs,rn,Xn))){var nl=ul-Ps[0],yl=hs-Ps[1],On=tl-Ps[0],Ko=zs-Ps[1],jo=1/i(m((nl*On+yl*Ko)/(n(nl*nl+yl*yl)*n(On*On+Ko*Ko)))/2),Ys=n(Ps[0]*Ps[0]+Ps[1]*Ps[1]);Ss=o(el,(un-Ys)/(jo-1)),Co=o(el,(Bn-Ys)/(jo+1))}}uo>a?Co>a?(ao=g(so,$s,ul,hs,Bn,Co,Ao),co=g(tl,zs,rn,Xn,Bn,Co,Ao),fi.moveTo(ao.cx+ao.x01,ao.cy+ao.y01),Co<el?fi.arc(ao.cx,ao.cy,Co,e(ao.y01,ao.x01),e(co.y01,co.x01),!Ao):(fi.arc(ao.cx,ao.cy,Co,e(ao.y01,ao.x01),e(ao.y11,ao.x11),!Ao),fi.arc(0,0,Bn,e(ao.cy+ao.y11,ao.cx+ao.x11),e(co.cy+co.y11,co.cx+co.x11),!Ao),fi.arc(co.cx,co.cy,Co,e(co.y11,co.x11),e(co.y01,co.x01),!Ao))):(fi.moveTo(ul,hs),fi.arc(0,0,Bn,An,Eo,!Ao)):fi.moveTo(ul,hs),!(un>a)||!(ns>a)?fi.lineTo(rn,Xn):Ss>a?(ao=g(rn,Xn,tl,zs,un,-Ss,Ao),co=g(ul,hs,so,$s,un,-Ss,Ao),fi.lineTo(ao.cx+ao.x01,ao.cy+ao.y01),Ss<el?fi.arc(ao.cx,ao.cy,Ss,e(ao.y01,ao.x01),e(co.y01,co.x01),!Ao):(fi.arc(ao.cx,ao.cy,Ss,e(ao.y01,ao.x01),e(ao.y11,ao.x11),!Ao),fi.arc(0,0,un,e(ao.cy+ao.y11,ao.cx+ao.x11),e(co.cy+co.y11,co.cx+co.x11),Ao),fi.arc(co.cx,co.cy,Ss,e(co.y11,co.x11),e(co.y01,co.x01),!Ao))):fi.arc(0,0,un,Ls,fs,Ao)}if(fi.closePath(),Ia)return fi=null,Ia+""||null}return Li.centroid=function(){var Ia=(+yt.apply(this,arguments)+ +Xt.apply(this,arguments))/2,Fa=(+ki.apply(this,arguments)+ +Ni.apply(this,arguments))/2-s/2;return[t(Fa)*Ia,i(Fa)*Ia]},Li.innerRadius=function(Ia){return arguments.length?(yt=typeof Ia=="function"?Ia:S(+Ia),Li):yt},Li.outerRadius=function(Ia){return arguments.length?(Xt=typeof Ia=="function"?Ia:S(+Ia),Li):Xt},Li.cornerRadius=function(Ia){return arguments.length?(mr=typeof Ia=="function"?Ia:S(+Ia),Li):mr},Li.padRadius=function(Ia){return arguments.length?(Or=Ia==null?null:typeof Ia=="function"?Ia:S(+Ia),Li):Or},Li.startAngle=function(Ia){return arguments.length?(ki=typeof Ia=="function"?Ia:S(+Ia),Li):ki},Li.endAngle=function(Ia){return arguments.length?(Ni=typeof Ia=="function"?Ia:S(+Ia),Li):Ni},Li.padAngle=function(Ia){return arguments.length?(Si=typeof Ia=="function"?Ia:S(+Ia),Li):Si},Li.context=function(Ia){return arguments.length?(fi=Ia??null,Li):fi},Li}function v(yt){this._context=yt}v.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(yt,Xt){switch(yt=+yt,Xt=+Xt,this._point){case 0:this._point=1,this._line?this._context.lineTo(yt,Xt):this._context.moveTo(yt,Xt);break;case 1:this._point=2;default:this._context.lineTo(yt,Xt);break}}};function u(yt){return new v(yt)}function y(yt){return yt[0]}function f(yt){return yt[1]}function R(){var yt=y,Xt=f,mr=S(!0),Or=null,ki=u,Ni=null;function Si(fi){var Li,Ia=fi.length,Fa,un=!1,Bn;for(Or==null&&(Ni=ki(Bn=x.path())),Li=0;Li<=Ia;++Li)!(Li<Ia&&mr(Fa=fi[Li],Li,fi))===un&&((un=!un)?Ni.lineStart():Ni.lineEnd()),un&&Ni.point(+yt(Fa,Li,fi),+Xt(Fa,Li,fi));if(Bn)return Ni=null,Bn+""||null}return Si.x=function(fi){return arguments.length?(yt=typeof fi=="function"?fi:S(+fi),Si):yt},Si.y=function(fi){return arguments.length?(Xt=typeof fi=="function"?fi:S(+fi),Si):Xt},Si.defined=function(fi){return arguments.length?(mr=typeof fi=="function"?fi:S(!!fi),Si):mr},Si.curve=function(fi){return arguments.length?(ki=fi,Or!=null&&(Ni=ki(Or)),Si):ki},Si.context=function(fi){return arguments.length?(fi==null?Or=Ni=null:Ni=ki(Or=fi),Si):Or},Si}function L(){var yt=y,Xt=null,mr=S(0),Or=f,ki=S(!0),Ni=null,Si=u,fi=null;function Li(Fa){var un,Bn,Kn,Gn=Fa.length,eo,Ao=!1,An,Eo=new Array(Gn),fs=new Array(Gn);for(Ni==null&&(fi=Si(An=x.path())),un=0;un<=Gn;++un){if(!(un<Gn&&ki(eo=Fa[un],un,Fa))===Ao)if(Ao=!Ao)Bn=un,fi.areaStart(),fi.lineStart();else{for(fi.lineEnd(),fi.lineStart(),Kn=un-1;Kn>=Bn;--Kn)fi.point(Eo[Kn],fs[Kn]);fi.lineEnd(),fi.areaEnd()}Ao&&(Eo[un]=+yt(eo,un,Fa),fs[un]=+mr(eo,un,Fa),fi.point(Xt?+Xt(eo,un,Fa):Eo[un],Or?+Or(eo,un,Fa):fs[un]))}if(An)return fi=null,An+""||null}function Ia(){return R().defined(ki).curve(Si).context(Ni)}return Li.x=function(Fa){return arguments.length?(yt=typeof Fa=="function"?Fa:S(+Fa),Xt=null,Li):yt},Li.x0=function(Fa){return arguments.length?(yt=typeof Fa=="function"?Fa:S(+Fa),Li):yt},Li.x1=function(Fa){return arguments.length?(Xt=Fa==null?null:typeof Fa=="function"?Fa:S(+Fa),Li):Xt},Li.y=function(Fa){return arguments.length?(mr=typeof Fa=="function"?Fa:S(+Fa),Or=null,Li):mr},Li.y0=function(Fa){return arguments.length?(mr=typeof Fa=="function"?Fa:S(+Fa),Li):mr},Li.y1=function(Fa){return arguments.length?(Or=Fa==null?null:typeof Fa=="function"?Fa:S(+Fa),Li):Or},Li.lineX0=Li.lineY0=function(){return Ia().x(yt).y(mr)},Li.lineY1=function(){return Ia().x(yt).y(Or)},Li.lineX1=function(){return Ia().x(Xt).y(mr)},Li.defined=function(Fa){return arguments.length?(ki=typeof Fa=="function"?Fa:S(!!Fa),Li):ki},Li.curve=function(Fa){return arguments.length?(Si=Fa,Ni!=null&&(fi=Si(Ni)),Li):Si},Li.context=function(Fa){return arguments.length?(Fa==null?Ni=fi=null:fi=Si(Ni=Fa),Li):Ni},Li}function z(yt,Xt){return Xt<yt?-1:Xt>yt?1:Xt>=yt?0:NaN}function F(yt){return yt}function N(){var yt=F,Xt=z,mr=null,Or=S(0),ki=S(c),Ni=S(0);function Si(fi){var Li,Ia=fi.length,Fa,un,Bn=0,Kn=new Array(Ia),Gn=new Array(Ia),eo=+Or.apply(this,arguments),Ao=Math.min(c,Math.max(-c,ki.apply(this,arguments)-eo)),An,Eo=Math.min(Math.abs(Ao)/Ia,Ni.apply(this,arguments)),fs=Eo*(Ao<0?-1:1),Ls;for(Li=0;Li<Ia;++Li)(Ls=Gn[Kn[Li]=Li]=+yt(fi[Li],Li,fi))>0&&(Bn+=Ls);for(Xt!=null?Kn.sort(function(ns,uo){return Xt(Gn[ns],Gn[uo])}):mr!=null&&Kn.sort(function(ns,uo){return mr(fi[ns],fi[uo])}),Li=0,un=Bn?(Ao-Ia*fs)/Bn:0;Li<Ia;++Li,eo=An)Fa=Kn[Li],Ls=Gn[Fa],An=eo+(Ls>0?Ls*un:0)+fs,Gn[Fa]={data:fi[Fa],index:Li,value:Ls,startAngle:eo,endAngle:An,padAngle:Eo};return Gn}return Si.value=function(fi){return arguments.length?(yt=typeof fi=="function"?fi:S(+fi),Si):yt},Si.sortValues=function(fi){return arguments.length?(Xt=fi,mr=null,Si):Xt},Si.sort=function(fi){return arguments.length?(mr=fi,Xt=null,Si):mr},Si.startAngle=function(fi){return arguments.length?(Or=typeof fi=="function"?fi:S(+fi),Si):Or},Si.endAngle=function(fi){return arguments.length?(ki=typeof fi=="function"?fi:S(+fi),Si):ki},Si.padAngle=function(fi){return arguments.length?(Ni=typeof fi=="function"?fi:S(+fi),Si):Ni},Si}var B=U(u);function I(yt){this._curve=yt}I.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(yt,Xt){this._curve.point(Xt*Math.sin(yt),Xt*-Math.cos(yt))}};function U(yt){function Xt(mr){return new I(yt(mr))}return Xt._curve=yt,Xt}function O(yt){var Xt=yt.curve;return yt.angle=yt.x,delete yt.x,yt.radius=yt.y,delete yt.y,yt.curve=function(mr){return arguments.length?Xt(U(mr)):Xt()._curve},yt}function X(){return O(R().curve(B))}function J(){var yt=L().curve(B),Xt=yt.curve,mr=yt.lineX0,Or=yt.lineX1,ki=yt.lineY0,Ni=yt.lineY1;return yt.angle=yt.x,delete yt.x,yt.startAngle=yt.x0,delete yt.x0,yt.endAngle=yt.x1,delete yt.x1,yt.radius=yt.y,delete yt.y,yt.innerRadius=yt.y0,delete yt.y0,yt.outerRadius=yt.y1,delete yt.y1,yt.lineStartAngle=function(){return O(mr())},delete yt.lineX0,yt.lineEndAngle=function(){return O(Or())},delete yt.lineX1,yt.lineInnerRadius=function(){return O(ki())},delete yt.lineY0,yt.lineOuterRadius=function(){return O(Ni())},delete yt.lineY1,yt.curve=function(Si){return arguments.length?Xt(U(Si)):Xt()._curve},yt}function se(yt,Xt){return[(Xt=+Xt)*Math.cos(yt-=Math.PI/2),Xt*Math.sin(yt)]}var le=Array.prototype.slice;function ce(yt){return yt.source}function q(yt){return yt.target}function Z(yt){var Xt=ce,mr=q,Or=y,ki=f,Ni=null;function Si(){var fi,Li=le.call(arguments),Ia=Xt.apply(this,Li),Fa=mr.apply(this,Li);if(Ni||(Ni=fi=x.path()),yt(Ni,+Or.apply(this,(Li[0]=Ia,Li)),+ki.apply(this,Li),+Or.apply(this,(Li[0]=Fa,Li)),+ki.apply(this,Li)),fi)return Ni=null,fi+""||null}return Si.source=function(fi){return arguments.length?(Xt=fi,Si):Xt},Si.target=function(fi){return arguments.length?(mr=fi,Si):mr},Si.x=function(fi){return arguments.length?(Or=typeof fi=="function"?fi:S(+fi),Si):Or},Si.y=function(fi){return arguments.length?(ki=typeof fi=="function"?fi:S(+fi),Si):ki},Si.context=function(fi){return arguments.length?(Ni=fi??null,Si):Ni},Si}function ee(yt,Xt,mr,Or,ki){yt.moveTo(Xt,mr),yt.bezierCurveTo(Xt=(Xt+Or)/2,mr,Xt,ki,Or,ki)}function V(yt,Xt,mr,Or,ki){yt.moveTo(Xt,mr),yt.bezierCurveTo(Xt,mr=(mr+ki)/2,Or,mr,Or,ki)}function oe(yt,Xt,mr,Or,ki){var Ni=se(Xt,mr),Si=se(Xt,mr=(mr+ki)/2),fi=se(Or,mr),Li=se(Or,ki);yt.moveTo(Ni[0],Ni[1]),yt.bezierCurveTo(Si[0],Si[1],fi[0],fi[1],Li[0],Li[1])}function ie(){return Z(ee)}function j(){return Z(V)}function Q(){var yt=Z(oe);return yt.angle=yt.x,delete yt.x,yt.radius=yt.y,delete yt.y,yt}var re={draw:function(yt,Xt){var mr=Math.sqrt(Xt/s);yt.moveTo(mr,0),yt.arc(0,0,mr,0,c)}},ue={draw:function(yt,Xt){var mr=Math.sqrt(Xt/5)/2;yt.moveTo(-3*mr,-mr),yt.lineTo(-mr,-mr),yt.lineTo(-mr,-3*mr),yt.lineTo(mr,-3*mr),yt.lineTo(mr,-mr),yt.lineTo(3*mr,-mr),yt.lineTo(3*mr,mr),yt.lineTo(mr,mr),yt.lineTo(mr,3*mr),yt.lineTo(-mr,3*mr),yt.lineTo(-mr,mr),yt.lineTo(-3*mr,mr),yt.closePath()}},_e=Math.sqrt(1/3),we=_e*2,Re={draw:function(yt,Xt){var mr=Math.sqrt(Xt/we),Or=mr*_e;yt.moveTo(0,-mr),yt.lineTo(Or,0),yt.lineTo(0,mr),yt.lineTo(-Or,0),yt.closePath()}},ze=.8908130915292852,Xe=Math.sin(s/10)/Math.sin(7*s/10),tt=Math.sin(c/10)*Xe,it=-Math.cos(c/10)*Xe,et={draw:function(yt,Xt){var mr=Math.sqrt(Xt*ze),Or=tt*mr,ki=it*mr;yt.moveTo(0,-mr),yt.lineTo(Or,ki);for(var Ni=1;Ni<5;++Ni){var Si=c*Ni/5,fi=Math.cos(Si),Li=Math.sin(Si);yt.lineTo(Li*mr,-fi*mr),yt.lineTo(fi*Or-Li*ki,Li*Or+fi*ki)}yt.closePath()}},nt={draw:function(yt,Xt){var mr=Math.sqrt(Xt),Or=-mr/2;yt.rect(Or,Or,mr,mr)}},Ae=Math.sqrt(3),me={draw:function(yt,Xt){var mr=-Math.sqrt(Xt/(Ae*3));yt.moveTo(0,mr*2),yt.lineTo(-Ae*mr,-mr),yt.lineTo(Ae*mr,-mr),yt.closePath()}},fe=-.5,Be=Math.sqrt(3)/2,Qe=1/Math.sqrt(12),at=(Qe/2+1)*3,$e={draw:function(yt,Xt){var mr=Math.sqrt(Xt/at),Or=mr/2,ki=mr*Qe,Ni=Or,Si=mr*Qe+mr,fi=-Ni,Li=Si;yt.moveTo(Or,ki),yt.lineTo(Ni,Si),yt.lineTo(fi,Li),yt.lineTo(fe*Or-Be*ki,Be*Or+fe*ki),yt.lineTo(fe*Ni-Be*Si,Be*Ni+fe*Si),yt.lineTo(fe*fi-Be*Li,Be*fi+fe*Li),yt.lineTo(fe*Or+Be*ki,fe*ki-Be*Or),yt.lineTo(fe*Ni+Be*Si,fe*Si-Be*Ni),yt.lineTo(fe*fi+Be*Li,fe*Li-Be*fi),yt.closePath()}},It=[re,ue,Re,nt,et,me,$e];function Pt(){var yt=S(re),Xt=S(64),mr=null;function Or(){var ki;if(mr||(mr=ki=x.path()),yt.apply(this,arguments).draw(mr,+Xt.apply(this,arguments)),ki)return mr=null,ki+""||null}return Or.type=function(ki){return arguments.length?(yt=typeof ki=="function"?ki:S(ki),Or):yt},Or.size=function(ki){return arguments.length?(Xt=typeof ki=="function"?ki:S(+ki),Or):Xt},Or.context=function(ki){return arguments.length?(mr=ki??null,Or):mr},Or}function Vt(){}function Wt(yt,Xt,mr){yt._context.bezierCurveTo((2*yt._x0+yt._x1)/3,(2*yt._y0+yt._y1)/3,(yt._x0+2*yt._x1)/3,(yt._y0+2*yt._y1)/3,(yt._x0+4*yt._x1+Xt)/6,(yt._y0+4*yt._y1+mr)/6)}function Cr(yt){this._context=yt}Cr.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:Wt(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(yt,Xt){switch(yt=+yt,Xt=+Xt,this._point){case 0:this._point=1,this._line?this._context.lineTo(yt,Xt):this._context.moveTo(yt,Xt);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:Wt(this,yt,Xt);break}this._x0=this._x1,this._x1=yt,this._y0=this._y1,this._y1=Xt}};function yr(yt){return new Cr(yt)}function qr(yt){this._context=yt}qr.prototype={areaStart:Vt,areaEnd:Vt,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(yt,Xt){switch(yt=+yt,Xt=+Xt,this._point){case 0:this._point=1,this._x2=yt,this._y2=Xt;break;case 1:this._point=2,this._x3=yt,this._y3=Xt;break;case 2:this._point=3,this._x4=yt,this._y4=Xt,this._context.moveTo((this._x0+4*this._x1+yt)/6,(this._y0+4*this._y1+Xt)/6);break;default:Wt(this,yt,Xt);break}this._x0=this._x1,this._x1=yt,this._y0=this._y1,this._y1=Xt}};function Mr(yt){return new qr(yt)}function Dr(yt){this._context=yt}Dr.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(yt,Xt){switch(yt=+yt,Xt=+Xt,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var mr=(this._x0+4*this._x1+yt)/6,Or=(this._y0+4*this._y1+Xt)/6;this._line?this._context.lineTo(mr,Or):this._context.moveTo(mr,Or);break;case 3:this._point=4;default:Wt(this,yt,Xt);break}this._x0=this._x1,this._x1=yt,this._y0=this._y1,this._y1=Xt}};function xt(yt){return new Dr(yt)}function Ne(yt,Xt){this._basis=new Cr(yt),this._beta=Xt}Ne.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var yt=this._x,Xt=this._y,mr=yt.length-1;if(mr>0)for(var Or=yt[0],ki=Xt[0],Ni=yt[mr]-Or,Si=Xt[mr]-ki,fi=-1,Li;++fi<=mr;)Li=fi/mr,this._basis.point(this._beta*yt[fi]+(1-this._beta)*(Or+Li*Ni),this._beta*Xt[fi]+(1-this._beta)*(ki+Li*Si));this._x=this._y=null,this._basis.lineEnd()},point:function(yt,Xt){this._x.push(+yt),this._y.push(+Xt)}};var Ye=function yt(Xt){function mr(Or){return Xt===1?new Cr(Or):new Ne(Or,Xt)}return mr.beta=function(Or){return yt(+Or)},mr}(.85);function be(yt,Xt,mr){yt._context.bezierCurveTo(yt._x1+yt._k*(yt._x2-yt._x0),yt._y1+yt._k*(yt._y2-yt._y0),yt._x2+yt._k*(yt._x1-Xt),yt._y2+yt._k*(yt._y1-mr),yt._x2,yt._y2)}function Ie(yt,Xt){this._context=yt,this._k=(1-Xt)/6}Ie.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:be(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(yt,Xt){switch(yt=+yt,Xt=+Xt,this._point){case 0:this._point=1,this._line?this._context.lineTo(yt,Xt):this._context.moveTo(yt,Xt);break;case 1:this._point=2,this._x1=yt,this._y1=Xt;break;case 2:this._point=3;default:be(this,yt,Xt);break}this._x0=this._x1,this._x1=this._x2,this._x2=yt,this._y0=this._y1,this._y1=this._y2,this._y2=Xt}};var qe=function yt(Xt){function mr(Or){return new Ie(Or,Xt)}return mr.tension=function(Or){return yt(+Or)},mr}(0);function ke(yt,Xt){this._context=yt,this._k=(1-Xt)/6}ke.prototype={areaStart:Vt,areaEnd:Vt,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(yt,Xt){switch(yt=+yt,Xt=+Xt,this._point){case 0:this._point=1,this._x3=yt,this._y3=Xt;break;case 1:this._point=2,this._context.moveTo(this._x4=yt,this._y4=Xt);break;case 2:this._point=3,this._x5=yt,this._y5=Xt;break;default:be(this,yt,Xt);break}this._x0=this._x1,this._x1=this._x2,this._x2=yt,this._y0=this._y1,this._y1=this._y2,this._y2=Xt}};var Me=function yt(Xt){function mr(Or){return new ke(Or,Xt)}return mr.tension=function(Or){return yt(+Or)},mr}(0);function Le(yt,Xt){this._context=yt,this._k=(1-Xt)/6}Le.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(yt,Xt){switch(yt=+yt,Xt=+Xt,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:be(this,yt,Xt);break}this._x0=this._x1,this._x1=this._x2,this._x2=yt,this._y0=this._y1,this._y1=this._y2,this._y2=Xt}};var ut=function yt(Xt){function mr(Or){return new Le(Or,Xt)}return mr.tension=function(Or){return yt(+Or)},mr}(0);function lt(yt,Xt,mr){var Or=yt._x1,ki=yt._y1,Ni=yt._x2,Si=yt._y2;if(yt._l01_a>a){var fi=2*yt._l01_2a+3*yt._l01_a*yt._l12_a+yt._l12_2a,Li=3*yt._l01_a*(yt._l01_a+yt._l12_a);Or=(Or*fi-yt._x0*yt._l12_2a+yt._x2*yt._l01_2a)/Li,ki=(ki*fi-yt._y0*yt._l12_2a+yt._y2*yt._l01_2a)/Li}if(yt._l23_a>a){var Ia=2*yt._l23_2a+3*yt._l23_a*yt._l12_a+yt._l12_2a,Fa=3*yt._l23_a*(yt._l23_a+yt._l12_a);Ni=(Ni*Ia+yt._x1*yt._l23_2a-Xt*yt._l12_2a)/Fa,Si=(Si*Ia+yt._y1*yt._l23_2a-mr*yt._l12_2a)/Fa}yt._context.bezierCurveTo(Or,ki,Ni,Si,yt._x2,yt._y2)}function gt(yt,Xt){this._context=yt,this._alpha=Xt}gt.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(yt,Xt){if(yt=+yt,Xt=+Xt,this._point){var mr=this._x2-yt,Or=this._y2-Xt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(mr*mr+Or*Or,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(yt,Xt):this._context.moveTo(yt,Xt);break;case 1:this._point=2;break;case 2:this._point=3;default:lt(this,yt,Xt);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=yt,this._y0=this._y1,this._y1=this._y2,this._y2=Xt}};var kt=function yt(Xt){function mr(Or){return Xt?new gt(Or,Xt):new Ie(Or,0)}return mr.alpha=function(Or){return yt(+Or)},mr}(.5);function nr(yt,Xt){this._context=yt,this._alpha=Xt}nr.prototype={areaStart:Vt,areaEnd:Vt,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(yt,Xt){if(yt=+yt,Xt=+Xt,this._point){var mr=this._x2-yt,Or=this._y2-Xt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(mr*mr+Or*Or,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=yt,this._y3=Xt;break;case 1:this._point=2,this._context.moveTo(this._x4=yt,this._y4=Xt);break;case 2:this._point=3,this._x5=yt,this._y5=Xt;break;default:lt(this,yt,Xt);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=yt,this._y0=this._y1,this._y1=this._y2,this._y2=Xt}};var ir=function yt(Xt){function mr(Or){return Xt?new nr(Or,Xt):new ke(Or,0)}return mr.alpha=function(Or){return yt(+Or)},mr}(.5);function tr(yt,Xt){this._context=yt,this._alpha=Xt}tr.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(yt,Xt){if(yt=+yt,Xt=+Xt,this._point){var mr=this._x2-yt,Or=this._y2-Xt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(mr*mr+Or*Or,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:lt(this,yt,Xt);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=yt,this._y0=this._y1,this._y1=this._y2,this._y2=Xt}};var Ir=function yt(Xt){function mr(Or){return Xt?new tr(Or,Xt):new Le(Or,0)}return mr.alpha=function(Or){return yt(+Or)},mr}(.5);function vi(yt){this._context=yt}vi.prototype={areaStart:Vt,areaEnd:Vt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(yt,Xt){yt=+yt,Xt=+Xt,this._point?this._context.lineTo(yt,Xt):(this._point=1,this._context.moveTo(yt,Xt))}};function Vi(yt){return new vi(yt)}function Ui(yt){return yt<0?-1:1}function Ki(yt,Xt,mr){var Or=yt._x1-yt._x0,ki=Xt-yt._x1,Ni=(yt._y1-yt._y0)/(Or||ki<0&&-0),Si=(mr-yt._y1)/(ki||Or<0&&-0),fi=(Ni*ki+Si*Or)/(Or+ki);return(Ui(Ni)+Ui(Si))*Math.min(Math.abs(Ni),Math.abs(Si),.5*Math.abs(fi))||0}function ea(yt,Xt){var mr=yt._x1-yt._x0;return mr?(3*(yt._y1-yt._y0)/mr-Xt)/2:Xt}function Bi(yt,Xt,mr){var Or=yt._x0,ki=yt._y0,Ni=yt._x1,Si=yt._y1,fi=(Ni-Or)/3;yt._context.bezierCurveTo(Or+fi,ki+fi*Xt,Ni-fi,Si-fi*mr,Ni,Si)}function _a(yt){this._context=yt}_a.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:Bi(this,this._t0,ea(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(yt,Xt){var mr=NaN;if(yt=+yt,Xt=+Xt,!(yt===this._x1&&Xt===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(yt,Xt):this._context.moveTo(yt,Xt);break;case 1:this._point=2;break;case 2:this._point=3,Bi(this,ea(this,mr=Ki(this,yt,Xt)),mr);break;default:Bi(this,this._t0,mr=Ki(this,yt,Xt));break}this._x0=this._x1,this._x1=yt,this._y0=this._y1,this._y1=Xt,this._t0=mr}}};function Ca(yt){this._context=new Kt(yt)}(Ca.prototype=Object.create(_a.prototype)).point=function(yt,Xt){_a.prototype.point.call(this,Xt,yt)};function Kt(yt){this._context=yt}Kt.prototype={moveTo:function(yt,Xt){this._context.moveTo(Xt,yt)},closePath:function(){this._context.closePath()},lineTo:function(yt,Xt){this._context.lineTo(Xt,yt)},bezierCurveTo:function(yt,Xt,mr,Or,ki,Ni){this._context.bezierCurveTo(Xt,yt,Or,mr,Ni,ki)}};function zt(yt){return new _a(yt)}function Zt(yt){return new Ca(yt)}function Jt(yt){this._context=yt}Jt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var yt=this._x,Xt=this._y,mr=yt.length;if(mr)if(this._line?this._context.lineTo(yt[0],Xt[0]):this._context.moveTo(yt[0],Xt[0]),mr===2)this._context.lineTo(yt[1],Xt[1]);else for(var Or=Br(yt),ki=Br(Xt),Ni=0,Si=1;Si<mr;++Ni,++Si)this._context.bezierCurveTo(Or[0][Ni],ki[0][Ni],Or[1][Ni],ki[1][Ni],yt[Si],Xt[Si]);(this._line||this._line!==0&&mr===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(yt,Xt){this._x.push(+yt),this._y.push(+Xt)}};function Br(yt){var Xt,mr=yt.length-1,Or,ki=new Array(mr),Ni=new Array(mr),Si=new Array(mr);for(ki[0]=0,Ni[0]=2,Si[0]=yt[0]+2*yt[1],Xt=1;Xt<mr-1;++Xt)ki[Xt]=1,Ni[Xt]=4,Si[Xt]=4*yt[Xt]+2*yt[Xt+1];for(ki[mr-1]=2,Ni[mr-1]=7,Si[mr-1]=8*yt[mr-1]+yt[mr],Xt=1;Xt<mr;++Xt)Or=ki[Xt]/Ni[Xt-1],Ni[Xt]-=Or,Si[Xt]-=Or*Si[Xt-1];for(ki[mr-1]=Si[mr-1]/Ni[mr-1],Xt=mr-2;Xt>=0;--Xt)ki[Xt]=(Si[Xt]-ki[Xt+1])/Ni[Xt];for(Ni[mr-1]=(yt[mr]+ki[mr-1])/2,Xt=0;Xt<mr-1;++Xt)Ni[Xt]=2*yt[Xt+1]-ki[Xt+1];return[ki,Ni]}function ri(yt){return new Jt(yt)}function ii(yt,Xt){this._context=yt,this._t=Xt}ii.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(yt,Xt){switch(yt=+yt,Xt=+Xt,this._point){case 0:this._point=1,this._line?this._context.lineTo(yt,Xt):this._context.moveTo(yt,Xt);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,Xt),this._context.lineTo(yt,Xt);else{var mr=this._x*(1-this._t)+yt*this._t;this._context.lineTo(mr,this._y),this._context.lineTo(mr,Xt)}break}}this._x=yt,this._y=Xt}};function di(yt){return new ii(yt,.5)}function Wi(yt){return new ii(yt,0)}function oa(yt){return new ii(yt,1)}function ra(yt,Xt){if((Si=yt.length)>1)for(var mr=1,Or,ki,Ni=yt[Xt[0]],Si,fi=Ni.length;mr<Si;++mr)for(ki=Ni,Ni=yt[Xt[mr]],Or=0;Or<fi;++Or)Ni[Or][1]+=Ni[Or][0]=isNaN(ki[Or][1])?ki[Or][0]:ki[Or][1]}function ca(yt){for(var Xt=yt.length,mr=new Array(Xt);--Xt>=0;)mr[Xt]=Xt;return mr}function xa(yt,Xt){return yt[Xt]}function ji(){var yt=S([]),Xt=ca,mr=ra,Or=xa;function ki(Ni){var Si=yt.apply(this,arguments),fi,Li=Ni.length,Ia=Si.length,Fa=new Array(Ia),un;for(fi=0;fi<Ia;++fi){for(var Bn=Si[fi],Kn=Fa[fi]=new Array(Li),Gn=0,eo;Gn<Li;++Gn)Kn[Gn]=eo=[0,+Or(Ni[Gn],Bn,Gn,Ni)],eo.data=Ni[Gn];Kn.key=Bn}for(fi=0,un=Xt(Fa);fi<Ia;++fi)Fa[un[fi]].index=fi;return mr(Fa,un),Fa}return ki.keys=function(Ni){return arguments.length?(yt=typeof Ni=="function"?Ni:S(le.call(Ni)),ki):yt},ki.value=function(Ni){return arguments.length?(Or=typeof Ni=="function"?Ni:S(+Ni),ki):Or},ki.order=function(Ni){return arguments.length?(Xt=Ni==null?ca:typeof Ni=="function"?Ni:S(le.call(Ni)),ki):Xt},ki.offset=function(Ni){return arguments.length?(mr=Ni??ra,ki):mr},ki}function pn(yt,Xt){if((Or=yt.length)>0){for(var mr,Or,ki=0,Ni=yt[0].length,Si;ki<Ni;++ki){for(Si=mr=0;mr<Or;++mr)Si+=yt[mr][ki][1]||0;if(Si)for(mr=0;mr<Or;++mr)yt[mr][ki][1]/=Si}ra(yt,Xt)}}function _n(yt,Xt){if((Li=yt.length)>0)for(var mr,Or=0,ki,Ni,Si,fi,Li,Ia=yt[Xt[0]].length;Or<Ia;++Or)for(Si=fi=0,mr=0;mr<Li;++mr)(Ni=(ki=yt[Xt[mr]][Or])[1]-ki[0])>0?(ki[0]=Si,ki[1]=Si+=Ni):Ni<0?(ki[1]=fi,ki[0]=fi+=Ni):(ki[0]=0,ki[1]=Ni)}function En(yt,Xt){if((ki=yt.length)>0){for(var mr=0,Or=yt[Xt[0]],ki,Ni=Or.length;mr<Ni;++mr){for(var Si=0,fi=0;Si<ki;++Si)fi+=yt[Si][mr][1]||0;Or[mr][1]+=Or[mr][0]=-fi/2}ra(yt,Xt)}}function bt(yt,Xt){if(!(!((Si=yt.length)>0)||!((Ni=(ki=yt[Xt[0]]).length)>0))){for(var mr=0,Or=1,ki,Ni,Si;Or<Ni;++Or){for(var fi=0,Li=0,Ia=0;fi<Si;++fi){for(var Fa=yt[Xt[fi]],un=Fa[Or][1]||0,Bn=Fa[Or-1][1]||0,Kn=(un-Bn)/2,Gn=0;Gn<fi;++Gn){var eo=yt[Xt[Gn]],Ao=eo[Or][1]||0,An=eo[Or-1][1]||0;Kn+=Ao-An}Li+=un,Ia+=Kn*un}ki[Or-1][1]+=ki[Or-1][0]=mr,Li&&(mr-=Ia/Li)}ki[Or-1][1]+=ki[Or-1][0]=mr,ra(yt,Xt)}}function st(yt){var Xt=yt.map(Nr);return ca(yt).sort(function(mr,Or){return Xt[mr]-Xt[Or]})}function Nr(yt){for(var Xt=-1,mr=0,Or=yt.length,ki,Ni=-1/0;++Xt<Or;)(ki=+yt[Xt][1])>Ni&&(Ni=ki,mr=Xt);return mr}function Lr(yt){var Xt=yt.map(br);return ca(yt).sort(function(mr,Or){return Xt[mr]-Xt[Or]})}function br(yt){for(var Xt=0,mr=-1,Or=yt.length,ki;++mr<Or;)(ki=+yt[mr][1])&&(Xt+=ki);return Xt}function Rr(yt){return Lr(yt).reverse()}function jr(yt){var Xt=yt.length,mr,Or,ki=yt.map(br),Ni=st(yt),Si=0,fi=0,Li=[],Ia=[];for(mr=0;mr<Xt;++mr)Or=Ni[mr],Si<fi?(Si+=ki[Or],Li.push(Or)):(fi+=ki[Or],Ia.push(Or));return Ia.reverse().concat(Li)}function Wr(yt){return ca(yt).reverse()}p.arc=b,p.area=L,p.areaRadial=J,p.curveBasis=yr,p.curveBasisClosed=Mr,p.curveBasisOpen=xt,p.curveBundle=Ye,p.curveCardinal=qe,p.curveCardinalClosed=Me,p.curveCardinalOpen=ut,p.curveCatmullRom=kt,p.curveCatmullRomClosed=ir,p.curveCatmullRomOpen=Ir,p.curveLinear=u,p.curveLinearClosed=Vi,p.curveMonotoneX=zt,p.curveMonotoneY=Zt,p.curveNatural=ri,p.curveStep=di,p.curveStepAfter=oa,p.curveStepBefore=Wi,p.line=R,p.lineRadial=X,p.linkHorizontal=ie,p.linkRadial=Q,p.linkVertical=j,p.pie=N,p.pointRadial=se,p.radialArea=J,p.radialLine=X,p.stack=ji,p.stackOffsetDiverging=_n,p.stackOffsetExpand=pn,p.stackOffsetNone=ra,p.stackOffsetSilhouette=En,p.stackOffsetWiggle=bt,p.stackOrderAppearance=st,p.stackOrderAscending=Lr,p.stackOrderDescending=Rr,p.stackOrderInsideOut=jr,p.stackOrderNone=ca,p.stackOrderReverse=Wr,p.symbol=Pt,p.symbolCircle=re,p.symbolCross=ue,p.symbolDiamond=Re,p.symbolSquare=nt,p.symbolStar=et,p.symbolTriangle=me,p.symbolWye=$e,p.symbols=It,Object.defineProperty(p,"__esModule",{value:!0})})}}),BD=De({"node_modules/@plotly/d3-sankey/build/d3-sankey.js"(Y,H){(function(p,x){typeof Y=="object"&&typeof H<"u"?x(Y,t1(),Pb(),bA()):x(p.d3=p.d3||{},p.d3,p.d3,p.d3)})(Y,function(p,x,S,E){"use strict";function e(u){return u.target.depth}function t(u){return u.depth}function r(u,y){return y-1-u.height}function o(u,y){return u.sourceLinks.length?u.depth:y-1}function i(u){return u.targetLinks.length?u.depth:u.sourceLinks.length?x.min(u.sourceLinks,e)-1:0}function n(u){return function(){return u}}function a(u,y){return h(u.source,y.source)||u.index-y.index}function s(u,y){return h(u.target,y.target)||u.index-y.index}function h(u,y){return u.y0-y.y0}function c(u){return u.value}function m(u){return(u.y0+u.y1)/2}function d(u){return m(u.source)*u.value}function T(u){return m(u.target)*u.value}function l(u){return u.index}function _(u){return u.nodes}function w(u){return u.links}function A(u,y){var f=u.get(y);if(!f)throw new Error("missing: "+y);return f}var M=function(){var u=0,y=0,f=1,R=1,L=24,z=8,F=l,N=o,B=_,I=w,U=32,O=2/3;function X(){var Z={nodes:B.apply(null,arguments),links:I.apply(null,arguments)};return J(Z),se(Z),le(Z),ce(Z,U),q(Z),Z}X.update=function(Z){return q(Z),Z},X.nodeId=function(Z){return arguments.length?(F=typeof Z=="function"?Z:n(Z),X):F},X.nodeAlign=function(Z){return arguments.length?(N=typeof Z=="function"?Z:n(Z),X):N},X.nodeWidth=function(Z){return arguments.length?(L=+Z,X):L},X.nodePadding=function(Z){return arguments.length?(z=+Z,X):z},X.nodes=function(Z){return arguments.length?(B=typeof Z=="function"?Z:n(Z),X):B},X.links=function(Z){return arguments.length?(I=typeof Z=="function"?Z:n(Z),X):I},X.size=function(Z){return arguments.length?(u=y=0,f=+Z[0],R=+Z[1],X):[f-u,R-y]},X.extent=function(Z){return arguments.length?(u=+Z[0][0],f=+Z[1][0],y=+Z[0][1],R=+Z[1][1],X):[[u,y],[f,R]]},X.iterations=function(Z){return arguments.length?(U=+Z,X):U};function J(Z){Z.nodes.forEach(function(V,oe){V.index=oe,V.sourceLinks=[],V.targetLinks=[]});var ee=S.map(Z.nodes,F);Z.links.forEach(function(V,oe){V.index=oe;var ie=V.source,j=V.target;typeof ie!="object"&&(ie=V.source=A(ee,ie)),typeof j!="object"&&(j=V.target=A(ee,j)),ie.sourceLinks.push(V),j.targetLinks.push(V)})}function se(Z){Z.nodes.forEach(function(ee){ee.value=Math.max(x.sum(ee.sourceLinks,c),x.sum(ee.targetLinks,c))})}function le(Z){var ee,V,oe;for(ee=Z.nodes,V=[],oe=0;ee.length;++oe,ee=V,V=[])ee.forEach(function(j){j.depth=oe,j.sourceLinks.forEach(function(Q){V.indexOf(Q.target)<0&&V.push(Q.target)})});for(ee=Z.nodes,V=[],oe=0;ee.length;++oe,ee=V,V=[])ee.forEach(function(j){j.height=oe,j.targetLinks.forEach(function(Q){V.indexOf(Q.source)<0&&V.push(Q.source)})});var ie=(f-u-L)/(oe-1);Z.nodes.forEach(function(j){j.x1=(j.x0=u+Math.max(0,Math.min(oe-1,Math.floor(N.call(null,j,oe))))*ie)+L})}function ce(Z){var ee=S.nest().key(function(ue){return ue.x0}).sortKeys(x.ascending).entries(Z.nodes).map(function(ue){return ue.values});ie(),re();for(var V=1,oe=U;oe>0;--oe)Q(V*=.99),re(),j(V),re();function ie(){var ue=x.max(ee,function(Re){return Re.length}),_e=O*(R-y)/(ue-1);z>_e&&(z=_e);var we=x.min(ee,function(Re){return(R-y-(Re.length-1)*z)/x.sum(Re,c)});ee.forEach(function(Re){Re.forEach(function(ze,Xe){ze.y1=(ze.y0=Xe)+ze.value*we})}),Z.links.forEach(function(Re){Re.width=Re.value*we})}function j(ue){ee.forEach(function(_e){_e.forEach(function(we){if(we.targetLinks.length){var Re=(x.sum(we.targetLinks,d)/x.sum(we.targetLinks,c)-m(we))*ue;we.y0+=Re,we.y1+=Re}})})}function Q(ue){ee.slice().reverse().forEach(function(_e){_e.forEach(function(we){if(we.sourceLinks.length){var Re=(x.sum(we.sourceLinks,T)/x.sum(we.sourceLinks,c)-m(we))*ue;we.y0+=Re,we.y1+=Re}})})}function re(){ee.forEach(function(ue){var _e,we,Re=y,ze=ue.length,Xe;for(ue.sort(h),Xe=0;Xe<ze;++Xe)_e=ue[Xe],we=Re-_e.y0,we>0&&(_e.y0+=we,_e.y1+=we),Re=_e.y1+z;if(we=Re-z-R,we>0)for(Re=_e.y0-=we,_e.y1-=we,Xe=ze-2;Xe>=0;--Xe)_e=ue[Xe],we=_e.y1+z-Re,we>0&&(_e.y0-=we,_e.y1-=we),Re=_e.y0})}}function q(Z){Z.nodes.forEach(function(ee){ee.sourceLinks.sort(s),ee.targetLinks.sort(a)}),Z.nodes.forEach(function(ee){var V=ee.y0,oe=V;ee.sourceLinks.forEach(function(ie){ie.y0=V+ie.width/2,V+=ie.width}),ee.targetLinks.forEach(function(ie){ie.y1=oe+ie.width/2,oe+=ie.width})})}return X};function g(u){return[u.source.x1,u.y0]}function b(u){return[u.target.x0,u.y1]}var v=function(){return E.linkHorizontal().source(g).target(b)};p.sankey=M,p.sankeyCenter=i,p.sankeyLeft=t,p.sankeyRight=r,p.sankeyJustify=o,p.sankeyLinkHorizontal=v,Object.defineProperty(p,"__esModule",{value:!0})})}}),OD=De({"node_modules/elementary-circuits-directed-graph/johnson.js"(Y,H){var p=xA();H.exports=function(S,E){var e=[],t=[],r=[],o={},i=[],n;function a(A){r[A]=!1,o.hasOwnProperty(A)&&Object.keys(o[A]).forEach(function(M){delete o[A][M],r[M]&&a(M)})}function s(A){var M=!1;t.push(A),r[A]=!0;var g,b;for(g=0;g<i[A].length;g++)b=i[A][g],b===n?(h(n,t),M=!0):r[b]||(M=s(b));if(M)a(A);else for(g=0;g<i[A].length;g++){b=i[A][g];var v=o[b];v||(v={},o[b]=v),v[b]=!0}return t.pop(),M}function h(A,M){var g=[].concat(M).concat(A);E?E(s):e.push(g)}function c(A){for(var M=0;M<S.length;M++)M<A&&(S[M]=[]),S[M]=S[M].filter(function(g){return g>=A})}function m(A){c(A);for(var M=S,g=p(M),b=g.components.filter(function(z){return z.length>1}),v=1/0,u,y=0;y<b.length;y++)for(var f=0;f<b[y].length;f++)b[y][f]<v&&(v=b[y][f],u=y);var R=b[u];if(!R)return!1;var L=S.map(function(z,F){return R.indexOf(F)===-1?[]:z.filter(function(N){return R.indexOf(N)!==-1})});return{leastVertex:v,adjList:L}}n=0;for(var d=S.length;n<d;){var T=m(n);if(n=T.leastVertex,i=T.adjList,i){for(var l=0;l<i.length;l++)for(var _=0;_<i[l].length;_++){var w=i[l][_];r[+w]=!1,o[w]={}}s(n),n=n+1}else n=d}if(!E)return e}}}),ND=De({"node_modules/@plotly/d3-sankey-circular/dist/d3-sankey-circular.js"(Y,H){(function(p,x){typeof Y=="object"&&typeof H<"u"?x(Y,t1(),Pb(),bA(),OD()):x(p.d3=p.d3||{},p.d3,p.d3,p.d3,null)})(Y,function(p,x,S,E,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;function t(ze){return ze.target.depth}function r(ze){return ze.depth}function o(ze,Xe){return Xe-1-ze.height}function i(ze,Xe){return ze.sourceLinks.length?ze.depth:Xe-1}function n(ze){return ze.targetLinks.length?ze.depth:ze.sourceLinks.length?x.min(ze.sourceLinks,t)-1:0}function a(ze){return function(){return ze}}var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ze){return typeof ze}:function(ze){return ze&&typeof Symbol=="function"&&ze.constructor===Symbol&&ze!==Symbol.prototype?"symbol":typeof ze};function h(ze,Xe){return m(ze.source,Xe.source)||ze.index-Xe.index}function c(ze,Xe){return m(ze.target,Xe.target)||ze.index-Xe.index}function m(ze,Xe){return ze.partOfCycle===Xe.partOfCycle?ze.y0-Xe.y0:ze.circularLinkType==="top"||Xe.circularLinkType==="bottom"?-1:1}function d(ze){return ze.value}function T(ze){return(ze.y0+ze.y1)/2}function l(ze){return T(ze.source)}function _(ze){return T(ze.target)}function w(ze){return ze.index}function A(ze){return ze.nodes}function M(ze){return ze.links}function g(ze,Xe){var tt=ze.get(Xe);if(!tt)throw new Error("missing: "+Xe);return tt}function b(ze,Xe){return Xe(ze)}var v=25,u=10,y=.3;function f(){var ze=0,Xe=0,tt=1,it=1,et=24,nt,Ae=w,me=i,fe=A,Be=M,Qe=32,at=2,$e,It=null;function Pt(){var xt={nodes:fe.apply(null,arguments),links:Be.apply(null,arguments)};Vt(xt),R(xt,Ae,It),Wt(xt),qr(xt),L(xt,Ae),Mr(xt,Qe,Ae),Dr(xt);for(var Ne=4,Ye=0;Ye<Ne;Ye++)Q(xt,it,Ae),re(xt,it,Ae),oe(xt,Xe,it,Ae),Q(xt,it,Ae),re(xt,it,Ae);return Re(xt,Xe,it),U(xt,at,it,Ae),xt}Pt.nodeId=function(xt){return arguments.length?(Ae=typeof xt=="function"?xt:a(xt),Pt):Ae},Pt.nodeAlign=function(xt){return arguments.length?(me=typeof xt=="function"?xt:a(xt),Pt):me},Pt.nodeWidth=function(xt){return arguments.length?(et=+xt,Pt):et},Pt.nodePadding=function(xt){return arguments.length?(nt=+xt,Pt):nt},Pt.nodes=function(xt){return arguments.length?(fe=typeof xt=="function"?xt:a(xt),Pt):fe},Pt.links=function(xt){return arguments.length?(Be=typeof xt=="function"?xt:a(xt),Pt):Be},Pt.size=function(xt){return arguments.length?(ze=Xe=0,tt=+xt[0],it=+xt[1],Pt):[tt-ze,it-Xe]},Pt.extent=function(xt){return arguments.length?(ze=+xt[0][0],tt=+xt[1][0],Xe=+xt[0][1],it=+xt[1][1],Pt):[[ze,Xe],[tt,it]]},Pt.iterations=function(xt){return arguments.length?(Qe=+xt,Pt):Qe},Pt.circularLinkGap=function(xt){return arguments.length?(at=+xt,Pt):at},Pt.nodePaddingRatio=function(xt){return arguments.length?($e=+xt,Pt):$e},Pt.sortNodes=function(xt){return arguments.length?(It=xt,Pt):It},Pt.update=function(xt){return L(xt,Ae),Dr(xt),xt.links.forEach(function(Ne){Ne.circular&&(Ne.circularLinkType=Ne.y0+Ne.y1<it?"top":"bottom",Ne.source.circularLinkType=Ne.circularLinkType,Ne.target.circularLinkType=Ne.circularLinkType)}),Q(xt,it,Ae,!1),re(xt,it,Ae),U(xt,at,it,Ae),xt};function Vt(xt){xt.nodes.forEach(function(Ye,be){Ye.index=be,Ye.sourceLinks=[],Ye.targetLinks=[]});var Ne=S.map(xt.nodes,Ae);return xt.links.forEach(function(Ye,be){Ye.index=be;var Ie=Ye.source,qe=Ye.target;(typeof Ie>"u"?"undefined":s(Ie))!=="object"&&(Ie=Ye.source=g(Ne,Ie)),(typeof qe>"u"?"undefined":s(qe))!=="object"&&(qe=Ye.target=g(Ne,qe)),Ie.sourceLinks.push(Ye),qe.targetLinks.push(Ye)}),xt}function Wt(xt){xt.nodes.forEach(function(Ne){Ne.partOfCycle=!1,Ne.value=Math.max(x.sum(Ne.sourceLinks,d),x.sum(Ne.targetLinks,d)),Ne.sourceLinks.forEach(function(Ye){Ye.circular&&(Ne.partOfCycle=!0,Ne.circularLinkType=Ye.circularLinkType)}),Ne.targetLinks.forEach(function(Ye){Ye.circular&&(Ne.partOfCycle=!0,Ne.circularLinkType=Ye.circularLinkType)})})}function Cr(xt){var Ne=0,Ye=0,be=0,Ie=0,qe=x.max(xt.nodes,function(ke){return ke.column});return xt.links.forEach(function(ke){ke.circular&&(ke.circularLinkType=="top"?Ne=Ne+ke.width:Ye=Ye+ke.width,ke.target.column==0&&(Ie=Ie+ke.width),ke.source.column==qe&&(be=be+ke.width))}),Ne=Ne>0?Ne+v+u:Ne,Ye=Ye>0?Ye+v+u:Ye,be=be>0?be+v+u:be,Ie=Ie>0?Ie+v+u:Ie,{top:Ne,bottom:Ye,left:Ie,right:be}}function yr(xt,Ne){var Ye=x.max(xt.nodes,function(ut){return ut.column}),be=tt-ze,Ie=it-Xe,qe=be+Ne.right+Ne.left,ke=Ie+Ne.top+Ne.bottom,Me=be/qe,Le=Ie/ke;return ze=ze*Me+Ne.left,tt=Ne.right==0?tt:tt*Me,Xe=Xe*Le+Ne.top,it=it*Le,xt.nodes.forEach(function(ut){ut.x0=ze+ut.column*((tt-ze-et)/Ye),ut.x1=ut.x0+et}),Le}function qr(xt){var Ne,Ye,be;for(Ne=xt.nodes,Ye=[],be=0;Ne.length;++be,Ne=Ye,Ye=[])Ne.forEach(function(Ie){Ie.depth=be,Ie.sourceLinks.forEach(function(qe){Ye.indexOf(qe.target)<0&&!qe.circular&&Ye.push(qe.target)})});for(Ne=xt.nodes,Ye=[],be=0;Ne.length;++be,Ne=Ye,Ye=[])Ne.forEach(function(Ie){Ie.height=be,Ie.targetLinks.forEach(function(qe){Ye.indexOf(qe.source)<0&&!qe.circular&&Ye.push(qe.source)})});xt.nodes.forEach(function(Ie){Ie.column=Math.floor(me.call(null,Ie,be))})}function Mr(xt,Ne,Ye){var be=S.nest().key(function(ut){return ut.column}).sortKeys(x.ascending).entries(xt.nodes).map(function(ut){return ut.values});ke(Ye),Le();for(var Ie=1,qe=Ne;qe>0;--qe)Me(Ie*=.99,Ye),Le();function ke(ut){if($e){var lt=1/0;be.forEach(function(ir){var tr=it*$e/(ir.length+1);lt=tr<lt?tr:lt}),nt=lt}var gt=x.min(be,function(ir){return(it-Xe-(ir.length-1)*nt)/x.sum(ir,d)});gt=gt*y,xt.links.forEach(function(ir){ir.width=ir.value*gt});var kt=Cr(xt),nr=yr(xt,kt);gt=gt*nr,xt.links.forEach(function(ir){ir.width=ir.value*gt}),be.forEach(function(ir){var tr=ir.length;ir.forEach(function(Ir,vi){Ir.depth==be.length-1&&tr==1||Ir.depth==0&&tr==1?(Ir.y0=it/2-Ir.value*gt,Ir.y1=Ir.y0+Ir.value*gt):Ir.partOfCycle?N(Ir,ut)==0?(Ir.y0=it/2+vi,Ir.y1=Ir.y0+Ir.value*gt):Ir.circularLinkType=="top"?(Ir.y0=Xe+vi,Ir.y1=Ir.y0+Ir.value*gt):(Ir.y0=it-Ir.value*gt-vi,Ir.y1=Ir.y0+Ir.value*gt):kt.top==0||kt.bottom==0?(Ir.y0=(it-Xe)/tr*vi,Ir.y1=Ir.y0+Ir.value*gt):(Ir.y0=(it-Xe)/2-tr/2+vi,Ir.y1=Ir.y0+Ir.value*gt)})})}function Me(ut,lt){var gt=be.length;be.forEach(function(kt){var nr=kt.length,ir=kt[0].depth;kt.forEach(function(tr){var Ir;if((tr.sourceLinks.length||tr.targetLinks.length)&&!(tr.partOfCycle&&N(tr,lt)>0))if(ir==0&&nr==1)Ir=tr.y1-tr.y0,tr.y0=it/2-Ir/2,tr.y1=it/2+Ir/2;else if(ir==gt-1&&nr==1)Ir=tr.y1-tr.y0,tr.y0=it/2-Ir/2,tr.y1=it/2+Ir/2;else{var vi=0,Vi=x.mean(tr.sourceLinks,_),Ui=x.mean(tr.targetLinks,l);Vi&&Ui?vi=(Vi+Ui)/2:vi=Vi||Ui;var Ki=(vi-T(tr))*ut;tr.y0+=Ki,tr.y1+=Ki}})})}function Le(){be.forEach(function(ut){var lt,gt,kt=Xe,nr=ut.length,ir;for(ut.sort(m),ir=0;ir<nr;++ir)lt=ut[ir],gt=kt-lt.y0,gt>0&&(lt.y0+=gt,lt.y1+=gt),kt=lt.y1+nt;if(gt=kt-nt-it,gt>0)for(kt=lt.y0-=gt,lt.y1-=gt,ir=nr-2;ir>=0;--ir)lt=ut[ir],gt=lt.y1+nt-kt,gt>0&&(lt.y0-=gt,lt.y1-=gt),kt=lt.y0})}}function Dr(xt){xt.nodes.forEach(function(Ne){Ne.sourceLinks.sort(c),Ne.targetLinks.sort(h)}),xt.nodes.forEach(function(Ne){var Ye=Ne.y0,be=Ye,Ie=Ne.y1,qe=Ie;Ne.sourceLinks.forEach(function(ke){ke.circular?(ke.y0=Ie-ke.width/2,Ie=Ie-ke.width):(ke.y0=Ye+ke.width/2,Ye+=ke.width)}),Ne.targetLinks.forEach(function(ke){ke.circular?(ke.y1=qe-ke.width/2,qe=qe-ke.width):(ke.y1=be+ke.width/2,be+=ke.width)})})}return Pt}function R(ze,Xe,tt){var it=0;if(tt===null){for(var et=[],nt=0;nt<ze.links.length;nt++){var Ae=ze.links[nt],me=Ae.source.index,fe=Ae.target.index;et[me]||(et[me]=[]),et[fe]||(et[fe]=[]),et[me].indexOf(fe)===-1&&et[me].push(fe)}var Be=e(et);Be.sort(function(It,Pt){return It.length-Pt.length});var Qe={};for(nt=0;nt<Be.length;nt++){var at=Be[nt],$e=at.slice(-2);Qe[$e[0]]||(Qe[$e[0]]={}),Qe[$e[0]][$e[1]]=!0}ze.links.forEach(function(It){var Pt=It.target.index,Vt=It.source.index;Pt===Vt||Qe[Vt]&&Qe[Vt][Pt]?(It.circular=!0,It.circularLinkID=it,it=it+1):It.circular=!1})}else ze.links.forEach(function(It){It.source[tt]<It.target[tt]?It.circular=!1:(It.circular=!0,It.circularLinkID=it,it=it+1)})}function L(ze,Xe){var tt=0,it=0;ze.links.forEach(function(et){et.circular&&(et.source.circularLinkType||et.target.circularLinkType?et.circularLinkType=et.source.circularLinkType?et.source.circularLinkType:et.target.circularLinkType:et.circularLinkType=tt<it?"top":"bottom",et.circularLinkType=="top"?tt=tt+1:it=it+1,ze.nodes.forEach(function(nt){(b(nt,Xe)==b(et.source,Xe)||b(nt,Xe)==b(et.target,Xe))&&(nt.circularLinkType=et.circularLinkType)}))}),ze.links.forEach(function(et){et.circular&&(et.source.circularLinkType==et.target.circularLinkType&&(et.circularLinkType=et.source.circularLinkType),we(et,Xe)&&(et.circularLinkType=et.source.circularLinkType))})}function z(ze){var Xe=Math.abs(ze.y1-ze.y0),tt=Math.abs(ze.target.x0-ze.source.x1);return Math.atan(tt/Xe)}function F(ze,Xe){return ze.source.column<Xe.target.column?!1:!(ze.target.column>Xe.source.column)}function N(ze,Xe){var tt=0;ze.sourceLinks.forEach(function(et){tt=et.circular&&!we(et,Xe)?tt+1:tt});var it=0;return ze.targetLinks.forEach(function(et){it=et.circular&&!we(et,Xe)?it+1:it}),tt+it}function B(ze){var Xe=ze.source.sourceLinks,tt=0;Xe.forEach(function(nt){tt=nt.circular?tt+1:tt});var it=ze.target.targetLinks,et=0;return it.forEach(function(nt){et=nt.circular?et+1:et}),!(tt>1||et>1)}function I(ze,Xe,tt){return ze.sort(X),ze.forEach(function(it,et){var nt=0;if(we(it,tt)&&B(it))it.circularPathData.verticalBuffer=nt+it.width/2;else{var Ae=0;for(Ae;Ae<et;Ae++)if(F(ze[et],ze[Ae])){var me=ze[Ae].circularPathData.verticalBuffer+ze[Ae].width/2+Xe;nt=me>nt?me:nt}it.circularPathData.verticalBuffer=nt+it.width/2}}),ze}function U(ze,Xe,tt,it){var et=5,nt=x.min(ze.links,function(fe){return fe.source.y0});ze.links.forEach(function(fe){fe.circular&&(fe.circularPathData={})});var Ae=ze.links.filter(function(fe){return fe.circularLinkType=="top"});I(Ae,Xe,it);var me=ze.links.filter(function(fe){return fe.circularLinkType=="bottom"});I(me,Xe,it),ze.links.forEach(function(fe){if(fe.circular){if(fe.circularPathData.arcRadius=fe.width+u,fe.circularPathData.leftNodeBuffer=et,fe.circularPathData.rightNodeBuffer=et,fe.circularPathData.sourceWidth=fe.source.x1-fe.source.x0,fe.circularPathData.sourceX=fe.source.x0+fe.circularPathData.sourceWidth,fe.circularPathData.targetX=fe.target.x0,fe.circularPathData.sourceY=fe.y0,fe.circularPathData.targetY=fe.y1,we(fe,it)&&B(fe))fe.circularPathData.leftSmallArcRadius=u+fe.width/2,fe.circularPathData.leftLargeArcRadius=u+fe.width/2,fe.circularPathData.rightSmallArcRadius=u+fe.width/2,fe.circularPathData.rightLargeArcRadius=u+fe.width/2,fe.circularLinkType=="bottom"?(fe.circularPathData.verticalFullExtent=fe.source.y1+v+fe.circularPathData.verticalBuffer,fe.circularPathData.verticalLeftInnerExtent=fe.circularPathData.verticalFullExtent-fe.circularPathData.leftLargeArcRadius,fe.circularPathData.verticalRightInnerExtent=fe.circularPathData.verticalFullExtent-fe.circularPathData.rightLargeArcRadius):(fe.circularPathData.verticalFullExtent=fe.source.y0-v-fe.circularPathData.verticalBuffer,fe.circularPathData.verticalLeftInnerExtent=fe.circularPathData.verticalFullExtent+fe.circularPathData.leftLargeArcRadius,fe.circularPathData.verticalRightInnerExtent=fe.circularPathData.verticalFullExtent+fe.circularPathData.rightLargeArcRadius);else{var Be=fe.source.column,Qe=fe.circularLinkType,at=ze.links.filter(function(Pt){return Pt.source.column==Be&&Pt.circularLinkType==Qe});fe.circularLinkType=="bottom"?at.sort(se):at.sort(J);var $e=0;at.forEach(function(Pt,Vt){Pt.circularLinkID==fe.circularLinkID&&(fe.circularPathData.leftSmallArcRadius=u+fe.width/2+$e,fe.circularPathData.leftLargeArcRadius=u+fe.width/2+Vt*Xe+$e),$e=$e+Pt.width}),Be=fe.target.column,at=ze.links.filter(function(Pt){return Pt.target.column==Be&&Pt.circularLinkType==Qe}),fe.circularLinkType=="bottom"?at.sort(ce):at.sort(le),$e=0,at.forEach(function(Pt,Vt){Pt.circularLinkID==fe.circularLinkID&&(fe.circularPathData.rightSmallArcRadius=u+fe.width/2+$e,fe.circularPathData.rightLargeArcRadius=u+fe.width/2+Vt*Xe+$e),$e=$e+Pt.width}),fe.circularLinkType=="bottom"?(fe.circularPathData.verticalFullExtent=Math.max(tt,fe.source.y1,fe.target.y1)+v+fe.circularPathData.verticalBuffer,fe.circularPathData.verticalLeftInnerExtent=fe.circularPathData.verticalFullExtent-fe.circularPathData.leftLargeArcRadius,fe.circularPathData.verticalRightInnerExtent=fe.circularPathData.verticalFullExtent-fe.circularPathData.rightLargeArcRadius):(fe.circularPathData.verticalFullExtent=nt-v-fe.circularPathData.verticalBuffer,fe.circularPathData.verticalLeftInnerExtent=fe.circularPathData.verticalFullExtent+fe.circularPathData.leftLargeArcRadius,fe.circularPathData.verticalRightInnerExtent=fe.circularPathData.verticalFullExtent+fe.circularPathData.rightLargeArcRadius)}fe.circularPathData.leftInnerExtent=fe.circularPathData.sourceX+fe.circularPathData.leftNodeBuffer,fe.circularPathData.rightInnerExtent=fe.circularPathData.targetX-fe.circularPathData.rightNodeBuffer,fe.circularPathData.leftFullExtent=fe.circularPathData.sourceX+fe.circularPathData.leftLargeArcRadius+fe.circularPathData.leftNodeBuffer,fe.circularPathData.rightFullExtent=fe.circularPathData.targetX-fe.circularPathData.rightLargeArcRadius-fe.circularPathData.rightNodeBuffer}if(fe.circular)fe.path=O(fe);else{var It=E.linkHorizontal().source(function(Pt){var Vt=Pt.source.x0+(Pt.source.x1-Pt.source.x0),Wt=Pt.y0;return[Vt,Wt]}).target(function(Pt){var Vt=Pt.target.x0,Wt=Pt.y1;return[Vt,Wt]});fe.path=It(fe)}})}function O(ze){var Xe="";return ze.circularLinkType=="top"?Xe="M"+ze.circularPathData.sourceX+" "+ze.circularPathData.sourceY+" L"+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.sourceY+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftSmallArcRadius+" 0 0 0 "+ze.circularPathData.leftFullExtent+" "+(ze.circularPathData.sourceY-ze.circularPathData.leftSmallArcRadius)+" L"+ze.circularPathData.leftFullExtent+" "+ze.circularPathData.verticalLeftInnerExtent+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftLargeArcRadius+" 0 0 0 "+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.verticalFullExtent+" L"+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.verticalFullExtent+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightLargeArcRadius+" 0 0 0 "+ze.circularPathData.rightFullExtent+" "+ze.circularPathData.verticalRightInnerExtent+" L"+ze.circularPathData.rightFullExtent+" "+(ze.circularPathData.targetY-ze.circularPathData.rightSmallArcRadius)+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightSmallArcRadius+" 0 0 0 "+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.targetY+" L"+ze.circularPathData.targetX+" "+ze.circularPathData.targetY:Xe="M"+ze.circularPathData.sourceX+" "+ze.circularPathData.sourceY+" L"+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.sourceY+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftSmallArcRadius+" 0 0 1 "+ze.circularPathData.leftFullExtent+" "+(ze.circularPathData.sourceY+ze.circularPathData.leftSmallArcRadius)+" L"+ze.circularPathData.leftFullExtent+" "+ze.circularPathData.verticalLeftInnerExtent+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftLargeArcRadius+" 0 0 1 "+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.verticalFullExtent+" L"+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.verticalFullExtent+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightLargeArcRadius+" 0 0 1 "+ze.circularPathData.rightFullExtent+" "+ze.circularPathData.verticalRightInnerExtent+" L"+ze.circularPathData.rightFullExtent+" "+(ze.circularPathData.targetY+ze.circularPathData.rightSmallArcRadius)+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightSmallArcRadius+" 0 0 1 "+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.targetY+" L"+ze.circularPathData.targetX+" "+ze.circularPathData.targetY,Xe}function X(ze,Xe){return q(ze)==q(Xe)?ze.circularLinkType=="bottom"?se(ze,Xe):J(ze,Xe):q(Xe)-q(ze)}function J(ze,Xe){return ze.y0-Xe.y0}function se(ze,Xe){return Xe.y0-ze.y0}function le(ze,Xe){return ze.y1-Xe.y1}function ce(ze,Xe){return Xe.y1-ze.y1}function q(ze){return ze.target.column-ze.source.column}function Z(ze){return ze.target.x0-ze.source.x1}function ee(ze,Xe){var tt=z(ze),it=Z(Xe)/Math.tan(tt),et=_e(ze)=="up"?ze.y1+it:ze.y1-it;return et}function V(ze,Xe){var tt=z(ze),it=Z(Xe)/Math.tan(tt),et=_e(ze)=="up"?ze.y1-it:ze.y1+it;return et}function oe(ze,Xe,tt,it){ze.links.forEach(function(et){if(!et.circular&&et.target.column-et.source.column>1){var nt=et.source.column+1,Ae=et.target.column-1,me=1,fe=Ae-nt+1;for(me=1;nt<=Ae;nt++,me++)ze.nodes.forEach(function(Be){if(Be.column==nt){var Qe=me/(fe+1),at=Math.pow(1-Qe,3),$e=3*Qe*Math.pow(1-Qe,2),It=3*Math.pow(Qe,2)*(1-Qe),Pt=Math.pow(Qe,3),Vt=at*et.y0+$e*et.y0+It*et.y1+Pt*et.y1,Wt=Vt-et.width/2,Cr=Vt+et.width/2,yr;Wt>Be.y0&&Wt<Be.y1?(yr=Be.y1-Wt+10,yr=Be.circularLinkType=="bottom"?yr:-yr,Be=j(Be,yr,Xe,tt),ze.nodes.forEach(function(qr){b(qr,it)==b(Be,it)||qr.column!=Be.column||ie(Be,qr)&&j(qr,yr,Xe,tt)})):Cr>Be.y0&&Cr<Be.y1?(yr=Cr-Be.y0+10,Be=j(Be,yr,Xe,tt),ze.nodes.forEach(function(qr){b(qr,it)==b(Be,it)||qr.column!=Be.column||qr.y0<Be.y1&&qr.y1>Be.y1&&j(qr,yr,Xe,tt)})):Wt<Be.y0&&Cr>Be.y1&&(yr=Cr-Be.y0+10,Be=j(Be,yr,Xe,tt),ze.nodes.forEach(function(qr){b(qr,it)==b(Be,it)||qr.column!=Be.column||qr.y0<Be.y1&&qr.y1>Be.y1&&j(qr,yr,Xe,tt)}))}})}})}function ie(ze,Xe){return ze.y0>Xe.y0&&ze.y0<Xe.y1||ze.y1>Xe.y0&&ze.y1<Xe.y1?!0:ze.y0<Xe.y0&&ze.y1>Xe.y1}function j(ze,Xe,tt,it){return ze.y0+Xe>=tt&&ze.y1+Xe<=it&&(ze.y0=ze.y0+Xe,ze.y1=ze.y1+Xe,ze.targetLinks.forEach(function(et){et.y1=et.y1+Xe}),ze.sourceLinks.forEach(function(et){et.y0=et.y0+Xe})),ze}function Q(ze,Xe,tt,it){ze.nodes.forEach(function(et){it&&et.y+(et.y1-et.y0)>Xe&&(et.y=et.y-(et.y+(et.y1-et.y0)-Xe));var nt=ze.links.filter(function(fe){return b(fe.source,tt)==b(et,tt)}),Ae=nt.length;Ae>1&&nt.sort(function(fe,Be){if(!fe.circular&&!Be.circular){if(fe.target.column==Be.target.column)return fe.y1-Be.y1;if(ue(fe,Be)){if(fe.target.column>Be.target.column){var Qe=V(Be,fe);return fe.y1-Qe}if(Be.target.column>fe.target.column){var at=V(fe,Be);return at-Be.y1}}else return fe.y1-Be.y1}if(fe.circular&&!Be.circular)return fe.circularLinkType=="top"?-1:1;if(Be.circular&&!fe.circular)return Be.circularLinkType=="top"?1:-1;if(fe.circular&&Be.circular)return fe.circularLinkType===Be.circularLinkType&&fe.circularLinkType=="top"?fe.target.column===Be.target.column?fe.target.y1-Be.target.y1:Be.target.column-fe.target.column:fe.circularLinkType===Be.circularLinkType&&fe.circularLinkType=="bottom"?fe.target.column===Be.target.column?Be.target.y1-fe.target.y1:fe.target.column-Be.target.column:fe.circularLinkType=="top"?-1:1});var me=et.y0;nt.forEach(function(fe){fe.y0=me+fe.width/2,me=me+fe.width}),nt.forEach(function(fe,Be){if(fe.circularLinkType=="bottom"){var Qe=Be+1,at=0;for(Qe;Qe<Ae;Qe++)at=at+nt[Qe].width;fe.y0=et.y1-at-fe.width/2}})})}function re(ze,Xe,tt){ze.nodes.forEach(function(it){var et=ze.links.filter(function(me){return b(me.target,tt)==b(it,tt)}),nt=et.length;nt>1&&et.sort(function(me,fe){if(!me.circular&&!fe.circular){if(me.source.column==fe.source.column)return me.y0-fe.y0;if(ue(me,fe)){if(fe.source.column<me.source.column){var Be=ee(fe,me);return me.y0-Be}if(me.source.column<fe.source.column){var Qe=ee(me,fe);return Qe-fe.y0}}else return me.y0-fe.y0}if(me.circular&&!fe.circular)return me.circularLinkType=="top"?-1:1;if(fe.circular&&!me.circular)return fe.circularLinkType=="top"?1:-1;if(me.circular&&fe.circular)return me.circularLinkType===fe.circularLinkType&&me.circularLinkType=="top"?me.source.column===fe.source.column?me.source.y1-fe.source.y1:me.source.column-fe.source.column:me.circularLinkType===fe.circularLinkType&&me.circularLinkType=="bottom"?me.source.column===fe.source.column?me.source.y1-fe.source.y1:fe.source.column-me.source.column:me.circularLinkType=="top"?-1:1});var Ae=it.y0;et.forEach(function(me){me.y1=Ae+me.width/2,Ae=Ae+me.width}),et.forEach(function(me,fe){if(me.circularLinkType=="bottom"){var Be=fe+1,Qe=0;for(Be;Be<nt;Be++)Qe=Qe+et[Be].width;me.y1=it.y1-Qe-me.width/2}})})}function ue(ze,Xe){return _e(ze)==_e(Xe)}function _e(ze){return ze.y0-ze.y1>0?"up":"down"}function we(ze,Xe){return b(ze.source,Xe)==b(ze.target,Xe)}function Re(ze,Xe,tt){var it=ze.nodes,et=ze.links,nt=!1,Ae=!1;if(et.forEach(function($e){$e.circularLinkType=="top"?nt=!0:$e.circularLinkType=="bottom"&&(Ae=!0)}),nt==!1||Ae==!1){var me=x.min(it,function($e){return $e.y0}),fe=x.max(it,function($e){return $e.y1}),Be=fe-me,Qe=tt-Xe,at=Qe/Be;it.forEach(function($e){var It=($e.y1-$e.y0)*at;$e.y0=($e.y0-me)*at,$e.y1=$e.y0+It}),et.forEach(function($e){$e.y0=($e.y0-me)*at,$e.y1=($e.y1-me)*at,$e.width=$e.width*at})}}p.sankeyCircular=f,p.sankeyCenter=n,p.sankeyLeft=r,p.sankeyRight=o,p.sankeyJustify=i,Object.defineProperty(p,"__esModule",{value:!0})})}}),wA=De({"src/traces/sankey/constants.js"(Y,H){"use strict";H.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"}}}}),UD=De({"src/traces/sankey/render.js"(Y,H){"use strict";var p=zD(),x=(am(),Ua(i0)).interpolateNumber,S=za(),E=BD(),e=ND(),t=wA(),r=wu(),o=vo(),i=ys(),n=ui(),a=n.strTranslate,s=n.strRotate,h=Uv(),c=h.keyFun,m=h.repeat,d=h.unwrap,T=vu(),l=Mo(),_=rh(),w=_.CAP_SHIFT,A=_.LINE_SPACING,M=3;function g(ee,V,oe){var ie=d(V),j=ie.trace,Q=j.domain,re=j.orientation==="h",ue=j.node.pad,_e=j.node.thickness,we={justify:E.sankeyJustify,left:E.sankeyLeft,right:E.sankeyRight,center:E.sankeyCenter}[j.node.align],Re=ee.width*(Q.x[1]-Q.x[0]),ze=ee.height*(Q.y[1]-Q.y[0]),Xe=ie._nodes,tt=ie._links,it=ie.circular,et;it?et=e.sankeyCircular().circularLinkGap(0):et=E.sankey(),et.iterations(t.sankeyIterations).size(re?[Re,ze]:[ze,Re]).nodeWidth(_e).nodePadding(ue).nodeId(function(qr){return qr.pointNumber}).nodeAlign(we).nodes(Xe).links(tt);var nt=et();et.nodePadding()<ue&&n.warn("node.pad was reduced to ",et.nodePadding()," to fit within the figure.");var Ae,me,fe;for(var Be in ie._groupLookup){var Qe=parseInt(ie._groupLookup[Be]),at;for(Ae=0;Ae<nt.nodes.length;Ae++)if(nt.nodes[Ae].pointNumber===Qe){at=nt.nodes[Ae];break}if(at){var $e={pointNumber:parseInt(Be),x0:at.x0,x1:at.x1,y0:at.y0,y1:at.y1,partOfGroup:!0,sourceLinks:[],targetLinks:[]};nt.nodes.unshift($e),at.childrenNodes.unshift($e)}}function It(){for(Ae=0;Ae<nt.nodes.length;Ae++){var qr=nt.nodes[Ae],Mr={},Dr,xt;for(me=0;me<qr.targetLinks.length;me++)xt=qr.targetLinks[me],Dr=xt.source.pointNumber+":"+xt.target.pointNumber,Mr.hasOwnProperty(Dr)||(Mr[Dr]=[]),Mr[Dr].push(xt);var Ne=Object.keys(Mr);for(me=0;me<Ne.length;me++){Dr=Ne[me];var Ye=Mr[Dr],be=0,Ie={};for(fe=0;fe<Ye.length;fe++)xt=Ye[fe],Ie[xt.label]||(Ie[xt.label]=0),Ie[xt.label]+=xt.value,be+=xt.value;for(fe=0;fe<Ye.length;fe++)xt=Ye[fe],xt.flow={value:be,labelConcentration:Ie[xt.label]/be,concentration:xt.value/be,links:Ye},xt.concentrationscale&&(xt.color=r(xt.concentrationscale(xt.flow.labelConcentration)))}var qe=0;for(me=0;me<qr.sourceLinks.length;me++)qe+=qr.sourceLinks[me].value;for(me=0;me<qr.sourceLinks.length;me++)xt=qr.sourceLinks[me],xt.concentrationOut=xt.value/qe;var ke=0;for(me=0;me<qr.targetLinks.length;me++)ke+=qr.targetLinks[me].value;for(me=0;me<qr.targetLinks.length;me++)xt=qr.targetLinks[me],xt.concenrationIn=xt.value/ke}}It();function Pt(qr){qr.forEach(function(Mr){var Dr,xt,Ne=0,Ye=Mr.length,be;for(Mr.sort(function(Ie,qe){return Ie.y0-qe.y0}),be=0;be<Ye;++be)Dr=Mr[be],Dr.y0>=Ne||(xt=Ne-Dr.y0,xt>1e-6&&(Dr.y0+=xt,Dr.y1+=xt)),Ne=Dr.y1+ue})}function Vt(qr){var Mr=qr.map(function(qe,ke){return{x0:qe.x0,index:ke}}).sort(function(qe,ke){return qe.x0-ke.x0}),Dr=[],xt=-1,Ne,Ye=-1/0,be;for(Ae=0;Ae<Mr.length;Ae++){var Ie=qr[Mr[Ae].index];Ie.x0>Ye+_e&&(xt+=1,Ne=Ie.x0),Ye=Ie.x0,Dr[xt]||(Dr[xt]=[]),Dr[xt].push(Ie),be=Ne-Ie.x0,Ie.x0+=be,Ie.x1+=be}return Dr}if(j.node.x.length&&j.node.y.length){for(Ae=0;Ae<Math.min(j.node.x.length,j.node.y.length,nt.nodes.length);Ae++)if(j.node.x[Ae]&&j.node.y[Ae]){var Wt=[j.node.x[Ae]*Re,j.node.y[Ae]*ze];nt.nodes[Ae].x0=Wt[0]-_e/2,nt.nodes[Ae].x1=Wt[0]+_e/2;var Cr=nt.nodes[Ae].y1-nt.nodes[Ae].y0;nt.nodes[Ae].y0=Wt[1]-Cr/2,nt.nodes[Ae].y1=Wt[1]+Cr/2}if(j.arrangement==="snap"){Xe=nt.nodes;var yr=Vt(Xe);Pt(yr)}et.update(nt)}return{circular:it,key:oe,trace:j,guid:n.randstr(),horizontal:re,width:Re,height:ze,nodePad:j.node.pad,nodeLineColor:j.node.line.color,nodeLineWidth:j.node.line.width,linkLineColor:j.link.line.color,linkLineWidth:j.link.line.width,linkArrowLength:j.link.arrowlen,valueFormat:j.valueformat,valueSuffix:j.valuesuffix,textFont:j.textfont,translateX:Q.x[0]*ee.width+ee.margin.l,translateY:ee.height-Q.y[1]*ee.height+ee.margin.t,dragParallel:re?ze:Re,dragPerpendicular:re?Re:ze,arrangement:j.arrangement,sankey:et,graph:nt,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function b(ee,V,oe){var ie=r(V.color),j=r(V.hovercolor),Q=V.source.label+"|"+V.target.label,re=Q+"__"+oe;return V.trace=ee.trace,V.curveNumber=ee.trace.index,{circular:ee.circular,key:re,traceId:ee.key,pointNumber:V.pointNumber,link:V,tinyColorHue:o.tinyRGB(ie),tinyColorAlpha:ie.getAlpha(),tinyColorHoverHue:o.tinyRGB(j),tinyColorHoverAlpha:j.getAlpha(),linkPath:u,linkLineColor:ee.linkLineColor,linkLineWidth:ee.linkLineWidth,linkArrowLength:ee.linkArrowLength,valueFormat:ee.valueFormat,valueSuffix:ee.valueSuffix,sankey:ee.sankey,parent:ee,interactionState:ee.interactionState,flow:V.flow}}function v(ee,V){var oe="",ie=ee.width/2,j=ee.circularPathData,Q=j.sourceX+j.verticalBuffer<j.targetX,re=j.rightFullExtent-j.rightLargeArcRadius-V<=j.leftFullExtent-ie,ue=Math.abs(j.rightFullExtent-j.leftFullExtent-ie)<ie;return ee.circularLinkType==="top"?(oe="M "+(j.targetX-V)+" "+(j.targetY+ie)+" L "+(j.rightInnerExtent-V)+" "+(j.targetY+ie)+"A "+(j.rightLargeArcRadius+ie)+" "+(j.rightSmallArcRadius+ie)+" 0 0 1 "+(j.rightFullExtent-ie-V)+" "+(j.targetY-j.rightSmallArcRadius)+"L "+(j.rightFullExtent-ie-V)+" "+j.verticalRightInnerExtent,Q&&re?oe+=" A "+(j.rightLargeArcRadius+ie)+" "+(j.rightLargeArcRadius+ie)+" 0 0 1 "+(j.rightFullExtent+ie-V-(j.rightLargeArcRadius-ie))+" "+(j.verticalRightInnerExtent-(j.rightLargeArcRadius+ie))+" L "+(j.rightFullExtent+ie-(j.rightLargeArcRadius-ie)-V)+" "+(j.verticalRightInnerExtent-(j.rightLargeArcRadius+ie))+" A "+(j.leftLargeArcRadius+ie)+" "+(j.leftLargeArcRadius+ie)+" 0 0 1 "+(j.leftFullExtent+ie)+" "+j.verticalRightInnerExtent:Q?oe+=" A "+(j.rightLargeArcRadius-ie)+" "+(j.rightLargeArcRadius-ie)+" 0 0 0 "+(j.rightFullExtent-ie-V-(j.rightLargeArcRadius-ie))+" "+(j.verticalRightInnerExtent-(j.rightLargeArcRadius-ie))+" L "+(j.leftFullExtent+ie+(j.rightLargeArcRadius-ie))+" "+(j.verticalRightInnerExtent-(j.rightLargeArcRadius-ie))+" A "+(j.leftLargeArcRadius-ie)+" "+(j.leftLargeArcRadius-ie)+" 0 0 0 "+(j.leftFullExtent+ie)+" "+j.verticalLeftInnerExtent:oe+=" A "+(j.rightLargeArcRadius+ie)+" "+(j.rightLargeArcRadius+ie)+" 0 0 1 "+(j.rightInnerExtent-V)+" "+(j.verticalFullExtent-ie)+" L "+j.leftInnerExtent+" "+(j.verticalFullExtent-ie)+" A "+(j.leftLargeArcRadius+ie)+" "+(j.leftLargeArcRadius+ie)+" 0 0 1 "+(j.leftFullExtent+ie)+" "+j.verticalLeftInnerExtent,oe+=" L "+(j.leftFullExtent+ie)+" "+(j.sourceY-j.leftSmallArcRadius)+" A "+(j.leftLargeArcRadius+ie)+" "+(j.leftSmallArcRadius+ie)+" 0 0 1 "+j.leftInnerExtent+" "+(j.sourceY+ie)+" L "+j.sourceX+" "+(j.sourceY+ie)+" L "+j.sourceX+" "+(j.sourceY-ie)+" L "+j.leftInnerExtent+" "+(j.sourceY-ie)+" A "+(j.leftLargeArcRadius-ie)+" "+(j.leftSmallArcRadius-ie)+" 0 0 0 "+(j.leftFullExtent-ie)+" "+(j.sourceY-j.leftSmallArcRadius)+" L "+(j.leftFullExtent-ie)+" "+j.verticalLeftInnerExtent,Q&&re?oe+=" A "+(j.leftLargeArcRadius+ie)+" "+(j.leftSmallArcRadius+ie)+" 0 0 0 "+(j.leftFullExtent-ie)+" "+(j.verticalFullExtent+ie)+"L"+(j.rightFullExtent+ie-V)+" "+(j.verticalFullExtent+ie)+" A "+(j.leftLargeArcRadius+ie)+" "+(j.leftSmallArcRadius+ie)+" 0 0 0 "+(j.rightFullExtent+ie-V)+" "+j.verticalRightInnerExtent:Q?oe+=" A "+(j.leftLargeArcRadius+ie)+" "+(j.leftSmallArcRadius+ie)+" 0 0 1 "+(j.leftFullExtent+ie)+" "+(j.verticalFullExtent-ie)+" L "+(j.rightFullExtent-ie-V)+" "+(j.verticalFullExtent-ie)+" A "+(j.leftLargeArcRadius+ie)+" "+(j.leftSmallArcRadius+ie)+" 0 0 1 "+(j.rightFullExtent+ie-V)+" "+j.verticalRightInnerExtent:oe+=" A "+(j.leftLargeArcRadius-ie)+" "+(j.leftLargeArcRadius-ie)+" 0 0 0 "+j.leftInnerExtent+" "+(j.verticalFullExtent+ie)+" L "+(j.rightInnerExtent-V)+" "+(j.verticalFullExtent+ie)+" A "+(j.rightLargeArcRadius-ie)+" "+(j.rightLargeArcRadius-ie)+" 0 0 0 "+(j.rightFullExtent+ie-V)+" "+j.verticalRightInnerExtent,oe+=" L "+(j.rightFullExtent+ie-V)+" "+(j.targetY-j.rightSmallArcRadius)+" A "+(j.rightLargeArcRadius-ie)+" "+(j.rightSmallArcRadius-ie)+" 0 0 0 "+(j.rightInnerExtent-V)+" "+(j.targetY-ie)+" L "+(j.targetX-V)+" "+(j.targetY-ie)+(V>0?" L "+j.targetX+" "+j.targetY:"")+"Z"):(oe="M "+(j.targetX-V)+" "+(j.targetY-ie)+" L "+(j.rightInnerExtent-V)+" "+(j.targetY-ie)+" A "+(j.rightLargeArcRadius+ie)+" "+(j.rightSmallArcRadius+ie)+" 0 0 0 "+(j.rightFullExtent-ie-V)+" "+(j.targetY+j.rightSmallArcRadius)+" L "+(j.rightFullExtent-ie-V)+" "+j.verticalRightInnerExtent,Q&&re?oe+=" A "+(j.rightLargeArcRadius+ie)+" "+(j.rightLargeArcRadius+ie)+" 0 0 0 "+(j.rightInnerExtent-ie-V)+" "+(j.verticalFullExtent+ie)+" L "+(j.rightFullExtent+ie-V-(j.rightLargeArcRadius-ie))+" "+(j.verticalFullExtent+ie)+" A "+(j.rightLargeArcRadius+ie)+" "+(j.rightLargeArcRadius+ie)+" 0 0 0 "+(j.leftFullExtent+ie)+" "+j.verticalLeftInnerExtent:Q?oe+=" A "+(j.rightLargeArcRadius-ie)+" "+(j.rightSmallArcRadius-ie)+" 0 0 1 "+(j.rightFullExtent-V-ie-(j.rightLargeArcRadius-ie))+" "+(j.verticalFullExtent-ie)+" L "+(j.leftFullExtent+ie+(j.rightLargeArcRadius-ie))+" "+(j.verticalFullExtent-ie)+" A "+(j.rightLargeArcRadius-ie)+" "+(j.rightSmallArcRadius-ie)+" 0 0 1 "+(j.leftFullExtent+ie)+" "+j.verticalLeftInnerExtent:oe+=" A "+(j.rightLargeArcRadius+ie)+" "+(j.rightLargeArcRadius+ie)+" 0 0 0 "+(j.rightInnerExtent-V)+" "+(j.verticalFullExtent+ie)+" L "+j.leftInnerExtent+" "+(j.verticalFullExtent+ie)+" A "+(j.leftLargeArcRadius+ie)+" "+(j.leftLargeArcRadius+ie)+" 0 0 0 "+(j.leftFullExtent+ie)+" "+j.verticalLeftInnerExtent,oe+=" L "+(j.leftFullExtent+ie)+" "+(j.sourceY+j.leftSmallArcRadius)+" A "+(j.leftLargeArcRadius+ie)+" "+(j.leftSmallArcRadius+ie)+" 0 0 0 "+j.leftInnerExtent+" "+(j.sourceY-ie)+" L "+j.sourceX+" "+(j.sourceY-ie)+" L "+j.sourceX+" "+(j.sourceY+ie)+" L "+j.leftInnerExtent+" "+(j.sourceY+ie)+" A "+(j.leftLargeArcRadius-ie)+" "+(j.leftSmallArcRadius-ie)+" 0 0 1 "+(j.leftFullExtent-ie)+" "+(j.sourceY+j.leftSmallArcRadius)+" L "+(j.leftFullExtent-ie)+" "+j.verticalLeftInnerExtent,Q&&re?oe+=" A "+(j.rightLargeArcRadius-ie)+" "+(j.rightSmallArcRadius-ie)+" 0 0 1 "+(j.leftFullExtent-ie-(j.rightLargeArcRadius-ie))+" "+(j.verticalFullExtent-ie)+" L "+(j.rightFullExtent+ie-V+(j.rightLargeArcRadius-ie))+" "+(j.verticalFullExtent-ie)+" A "+(j.rightLargeArcRadius-ie)+" "+(j.rightSmallArcRadius-ie)+" 0 0 1 "+(j.rightFullExtent+ie-V)+" "+j.verticalRightInnerExtent:Q?oe+=" A "+(j.rightLargeArcRadius+ie)+" "+(j.rightLargeArcRadius+ie)+" 0 0 0 "+(j.leftFullExtent+ie)+" "+(j.verticalFullExtent+ie)+" L "+(j.rightFullExtent-V-ie)+" "+(j.verticalFullExtent+ie)+" A "+(j.rightLargeArcRadius+ie)+" "+(j.rightLargeArcRadius+ie)+" 0 0 0 "+(j.rightFullExtent+ie-V)+" "+j.verticalRightInnerExtent:oe+=" A "+(j.leftLargeArcRadius-ie)+" "+(j.leftLargeArcRadius-ie)+" 0 0 1 "+j.leftInnerExtent+" "+(j.verticalFullExtent-ie)+" L "+(j.rightInnerExtent-V)+" "+(j.verticalFullExtent-ie)+" A "+(j.rightLargeArcRadius-ie)+" "+(j.rightLargeArcRadius-ie)+" 0 0 1 "+(j.rightFullExtent+ie-V)+" "+j.verticalRightInnerExtent,oe+=" L "+(j.rightFullExtent+ie-V)+" "+(j.targetY+j.rightSmallArcRadius)+" A "+(j.rightLargeArcRadius-ie)+" "+(j.rightSmallArcRadius-ie)+" 0 0 1 "+(j.rightInnerExtent-V)+" "+(j.targetY+ie)+" L "+(j.targetX-V)+" "+(j.targetY+ie)+(V>0?" L "+j.targetX+" "+j.targetY:"")+"Z"),oe}function u(){var ee=.5;function V(oe){var ie=oe.linkArrowLength;if(oe.link.circular)return v(oe.link,ie);var j=Math.abs((oe.link.target.x0-oe.link.source.x1)/2);ie>j&&(ie=j);var Q=oe.link.source.x1,re=oe.link.target.x0-ie,ue=x(Q,re),_e=ue(ee),we=ue(1-ee),Re=oe.link.y0-oe.link.width/2,ze=oe.link.y0+oe.link.width/2,Xe=oe.link.y1-oe.link.width/2,tt=oe.link.y1+oe.link.width/2,it="M"+Q+","+Re,et="C"+_e+","+Re+" "+we+","+Xe+" "+re+","+Xe,nt="C"+we+","+tt+" "+_e+","+ze+" "+Q+","+ze,Ae=ie>0?"L"+(re+ie)+","+(Xe+oe.link.width/2):"";return Ae+="L"+re+","+tt,it+et+Ae+nt+"Z"}return V}function y(ee,V){var oe=r(V.color),ie=t.nodePadAcross,j=ee.nodePad/2;V.dx=V.x1-V.x0,V.dy=V.y1-V.y0;var Q=V.dx,re=Math.max(.5,V.dy),ue="node_"+V.pointNumber;return V.group&&(ue=n.randstr()),V.trace=ee.trace,V.curveNumber=ee.trace.index,{index:V.pointNumber,key:ue,partOfGroup:V.partOfGroup||!1,group:V.group,traceId:ee.key,trace:ee.trace,node:V,nodePad:ee.nodePad,nodeLineColor:ee.nodeLineColor,nodeLineWidth:ee.nodeLineWidth,textFont:ee.textFont,size:ee.horizontal?ee.height:ee.width,visibleWidth:Math.ceil(Q),visibleHeight:re,zoneX:-ie,zoneY:-j,zoneWidth:Q+2*ie,zoneHeight:re+2*j,labelY:ee.horizontal?V.dy/2+1:V.dx/2+1,left:V.originalLayer===1,sizeAcross:ee.width,forceLayouts:ee.forceLayouts,horizontal:ee.horizontal,darkBackground:oe.getBrightness()<=128,tinyColorHue:o.tinyRGB(oe),tinyColorAlpha:oe.getAlpha(),valueFormat:ee.valueFormat,valueSuffix:ee.valueSuffix,sankey:ee.sankey,graph:ee.graph,arrangement:ee.arrangement,uniqueNodeLabelPathId:[ee.guid,ee.key,ue].join("_"),interactionState:ee.interactionState,figure:ee}}function f(ee){ee.attr("transform",function(V){return a(V.node.x0.toFixed(3),V.node.y0.toFixed(3))})}function R(ee){ee.call(f)}function L(ee,V){ee.call(R),V.attr("d",u())}function z(ee){ee.attr("width",function(V){return V.node.x1-V.node.x0}).attr("height",function(V){return V.visibleHeight})}function F(ee){return ee.link.width>1||ee.linkLineWidth>0}function N(ee){var V=a(ee.translateX,ee.translateY);return V+(ee.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function B(ee,V,oe){ee.on(".basic",null).on("mouseover.basic",function(ie){!ie.interactionState.dragInProgress&&!ie.partOfGroup&&(oe.hover(this,ie,V),ie.interactionState.hovered=[this,ie])}).on("mousemove.basic",function(ie){!ie.interactionState.dragInProgress&&!ie.partOfGroup&&(oe.follow(this,ie),ie.interactionState.hovered=[this,ie])}).on("mouseout.basic",function(ie){!ie.interactionState.dragInProgress&&!ie.partOfGroup&&(oe.unhover(this,ie,V),ie.interactionState.hovered=!1)}).on("click.basic",function(ie){ie.interactionState.hovered&&(oe.unhover(this,ie,V),ie.interactionState.hovered=!1),!ie.interactionState.dragInProgress&&!ie.partOfGroup&&oe.select(this,ie,V)})}function I(ee,V,oe,ie){var j=S.behavior.drag().origin(function(Q){return{x:Q.node.x0+Q.visibleWidth/2,y:Q.node.y0+Q.visibleHeight/2}}).on("dragstart",function(Q){if(Q.arrangement!=="fixed"&&(n.ensureSingle(ie._fullLayout._infolayer,"g","dragcover",function(ue){ie._fullLayout._dragCover=ue}),n.raiseToTop(this),Q.interactionState.dragInProgress=Q.node,le(Q.node),Q.interactionState.hovered&&(oe.nodeEvents.unhover.apply(0,Q.interactionState.hovered),Q.interactionState.hovered=!1),Q.arrangement==="snap")){var re=Q.traceId+"|"+Q.key;Q.forceLayouts[re]?Q.forceLayouts[re].alpha(1):U(ee,re,Q,ie),O(ee,V,Q,re,ie)}}).on("drag",function(Q){if(Q.arrangement!=="fixed"){var re=S.event.x,ue=S.event.y;Q.arrangement==="snap"?(Q.node.x0=re-Q.visibleWidth/2,Q.node.x1=re+Q.visibleWidth/2,Q.node.y0=ue-Q.visibleHeight/2,Q.node.y1=ue+Q.visibleHeight/2):(Q.arrangement==="freeform"&&(Q.node.x0=re-Q.visibleWidth/2,Q.node.x1=re+Q.visibleWidth/2),ue=Math.max(0,Math.min(Q.size-Q.visibleHeight/2,ue)),Q.node.y0=ue-Q.visibleHeight/2,Q.node.y1=ue+Q.visibleHeight/2),le(Q.node),Q.arrangement!=="snap"&&(Q.sankey.update(Q.graph),L(ee.filter(ce(Q)),V))}}).on("dragend",function(Q){if(Q.arrangement!=="fixed"){Q.interactionState.dragInProgress=!1;for(var re=0;re<Q.node.childrenNodes.length;re++)Q.node.childrenNodes[re].x=Q.node.x,Q.node.childrenNodes[re].y=Q.node.y;Q.arrangement!=="snap"&&J(Q,ie)}});ee.on(".drag",null).call(j)}function U(ee,V,oe,ie){q(oe.graph.nodes);var j=oe.graph.nodes.filter(function(Q){return Q.originalX===oe.node.originalX}).filter(function(Q){return!Q.partOfGroup});oe.forceLayouts[V]=p.forceSimulation(j).alphaDecay(0).force("collide",p.forceCollide().radius(function(Q){return Q.dy/2+oe.nodePad/2}).strength(1).iterations(t.forceIterations)).force("constrain",X(ee,V,j,oe,ie)).stop()}function O(ee,V,oe,ie,j){window.requestAnimationFrame(function Q(){var re;for(re=0;re<t.forceTicksPerFrame;re++)oe.forceLayouts[ie].tick();var ue=oe.graph.nodes;if(Z(ue),oe.sankey.update(oe.graph),L(ee.filter(ce(oe)),V),oe.forceLayouts[ie].alpha()>0)window.requestAnimationFrame(Q);else{var _e=oe.node.originalX;oe.node.x0=_e-oe.visibleWidth/2,oe.node.x1=_e+oe.visibleWidth/2,J(oe,j)}})}function X(ee,V,oe,ie){return function(){for(var Q=0,re=0;re<oe.length;re++){var ue=oe[re];ue===ie.interactionState.dragInProgress?(ue.x=ue.lastDraggedX,ue.y=ue.lastDraggedY):(ue.vx=(ue.originalX-ue.x)/t.forceTicksPerFrame,ue.y=Math.min(ie.size-ue.dy/2,Math.max(ue.dy/2,ue.y))),Q=Math.max(Q,Math.abs(ue.vx),Math.abs(ue.vy))}!ie.interactionState.dragInProgress&&Q<.1&&ie.forceLayouts[V].alpha()>0&&ie.forceLayouts[V].alpha(0)}}function J(ee,V){for(var oe=[],ie=[],j=0;j<ee.graph.nodes.length;j++){var Q=(ee.graph.nodes[j].x0+ee.graph.nodes[j].x1)/2,re=(ee.graph.nodes[j].y0+ee.graph.nodes[j].y1)/2;oe.push(Q/ee.figure.width),ie.push(re/ee.figure.height)}l.call("_guiRestyle",V,{"node.x":[oe],"node.y":[ie]},ee.trace.index).then(function(){V._fullLayout._dragCover&&V._fullLayout._dragCover.remove()})}function se(ee){var V=[],oe;for(oe=0;oe<ee.length;oe++)ee[oe].originalX=(ee[oe].x0+ee[oe].x1)/2,ee[oe].originalY=(ee[oe].y0+ee[oe].y1)/2,V.indexOf(ee[oe].originalX)===-1&&V.push(ee[oe].originalX);for(V.sort(function(ie,j){return ie-j}),oe=0;oe<ee.length;oe++)ee[oe].originalLayerIndex=V.indexOf(ee[oe].originalX),ee[oe].originalLayer=ee[oe].originalLayerIndex/(V.length-1)}function le(ee){ee.lastDraggedX=ee.x0+ee.dx/2,ee.lastDraggedY=ee.y0+ee.dy/2}function ce(ee){return function(V){return V.node.originalX===ee.node.originalX}}function q(ee){for(var V=0;V<ee.length;V++)ee[V].y=(ee[V].y0+ee[V].y1)/2,ee[V].x=(ee[V].x0+ee[V].x1)/2}function Z(ee){for(var V=0;V<ee.length;V++)ee[V].y0=ee[V].y-ee[V].dy/2,ee[V].y1=ee[V].y0+ee[V].dy,ee[V].x0=ee[V].x-ee[V].dx/2,ee[V].x1=ee[V].x0+ee[V].dx}H.exports=function(ee,V,oe,ie,j){var Q=ee._context.staticPlot,re=!1;n.ensureSingle(ee._fullLayout._infolayer,"g","first-render",function(){re=!0});var ue=ee._fullLayout._dragCover,_e=oe.filter(function(nt){return d(nt).trace.visible}).map(g.bind(null,ie)),we=V.selectAll("."+t.cn.sankey).data(_e,c);we.exit().remove(),we.enter().append("g").classed(t.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events",Q?"none":"auto").attr("transform",N),we.each(function(nt,Ae){ee._fullData[Ae]._sankey=nt;var me="bgsankey-"+nt.trace.uid+"-"+Ae;n.ensureSingle(ee._fullLayout._draggers,"rect",me),ee._fullData[Ae]._bgRect=S.select("."+me),ee._fullData[Ae]._bgRect.style("pointer-events",Q?"none":"all").attr("width",nt.width).attr("height",nt.height).attr("x",nt.translateX).attr("y",nt.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})}),we.transition().ease(t.ease).duration(t.duration).attr("transform",N);var Re=we.selectAll("."+t.cn.sankeyLinks).data(m,c);Re.enter().append("g").classed(t.cn.sankeyLinks,!0).style("fill","none");var ze=Re.selectAll("."+t.cn.sankeyLink).data(function(nt){var Ae=nt.graph.links;return Ae.filter(function(me){return me.value}).map(b.bind(null,nt))},c);ze.enter().append("path").classed(t.cn.sankeyLink,!0).call(B,we,j.linkEvents),ze.style("stroke",function(nt){return F(nt)?o.tinyRGB(r(nt.linkLineColor)):nt.tinyColorHue}).style("stroke-opacity",function(nt){return F(nt)?o.opacity(nt.linkLineColor):nt.tinyColorAlpha}).style("fill",function(nt){return nt.tinyColorHue}).style("fill-opacity",function(nt){return nt.tinyColorAlpha}).style("stroke-width",function(nt){return F(nt)?nt.linkLineWidth:1}).attr("d",u()),ze.style("opacity",function(){return ee._context.staticPlot||re||ue?1:0}).transition().ease(t.ease).duration(t.duration).style("opacity",1),ze.exit().transition().ease(t.ease).duration(t.duration).style("opacity",0).remove();var Xe=we.selectAll("."+t.cn.sankeyNodeSet).data(m,c);Xe.enter().append("g").classed(t.cn.sankeyNodeSet,!0),Xe.style("cursor",function(nt){switch(nt.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var tt=Xe.selectAll("."+t.cn.sankeyNode).data(function(nt){var Ae=nt.graph.nodes;return se(Ae),Ae.map(y.bind(null,nt))},c);tt.enter().append("g").classed(t.cn.sankeyNode,!0).call(f).style("opacity",function(nt){return(ee._context.staticPlot||re)&&!nt.partOfGroup?1:0}),tt.call(B,we,j.nodeEvents).call(I,ze,j,ee),tt.transition().ease(t.ease).duration(t.duration).call(f).style("opacity",function(nt){return nt.partOfGroup?0:1}),tt.exit().transition().ease(t.ease).duration(t.duration).style("opacity",0).remove();var it=tt.selectAll("."+t.cn.nodeRect).data(m);it.enter().append("rect").classed(t.cn.nodeRect,!0).call(z),it.style("stroke-width",function(nt){return nt.nodeLineWidth}).style("stroke",function(nt){return o.tinyRGB(r(nt.nodeLineColor))}).style("stroke-opacity",function(nt){return o.opacity(nt.nodeLineColor)}).style("fill",function(nt){return nt.tinyColorHue}).style("fill-opacity",function(nt){return nt.tinyColorAlpha}),it.transition().ease(t.ease).duration(t.duration).call(z);var et=tt.selectAll("."+t.cn.nodeLabel).data(m);et.enter().append("text").classed(t.cn.nodeLabel,!0).style("cursor","default"),et.attr("data-notex",1).text(function(nt){return nt.node.label}).each(function(nt){var Ae=S.select(this);i.font(Ae,nt.textFont),T.convertToTspans(Ae,ee)}).attr("text-anchor",function(nt){return nt.horizontal&&nt.left?"end":"start"}).attr("transform",function(nt){var Ae=S.select(this),me=T.lineCount(Ae),fe=nt.textFont.size*((me-1)*A-w),Be=nt.nodeLineWidth/2+M,Qe=((nt.horizontal?nt.visibleHeight:nt.visibleWidth)-fe)/2;nt.horizontal&&(nt.left?Be=-Be:Be+=nt.visibleWidth);var at=nt.horizontal?"":"scale(-1,1)"+s(90);return a(nt.horizontal?Be:Qe,nt.horizontal?Qe:Be)+at}),et.transition().ease(t.ease).duration(t.duration)}}}),TA=De({"src/traces/sankey/plot.js"(Y,H){"use strict";var p=za(),x=ui(),S=x.numberFormat,E=UD(),e=sf(),t=vo(),r=wA().cn,o=x._;function i(w){return w!==""}function n(w,A){return w.filter(function(M){return M.key===A.traceId})}function a(w,A){p.select(w).select("path").style("fill-opacity",A),p.select(w).select("rect").style("fill-opacity",A)}function s(w){p.select(w).select("text.name").style("fill","black")}function h(w){return function(A){return w.node.sourceLinks.indexOf(A.link)!==-1||w.node.targetLinks.indexOf(A.link)!==-1}}function c(w){return function(A){return A.node.sourceLinks.indexOf(w.link)!==-1||A.node.targetLinks.indexOf(w.link)!==-1}}function m(w,A,M){A&&M&&n(M,A).selectAll("."+r.sankeyLink).filter(h(A)).call(T.bind(0,A,M,!1))}function d(w,A,M){A&&M&&n(M,A).selectAll("."+r.sankeyLink).filter(h(A)).call(l.bind(0,A,M,!1))}function T(w,A,M,g){g.style("fill",function(b){if(!b.link.concentrationscale)return b.tinyColorHoverHue}).style("fill-opacity",function(b){if(!b.link.concentrationscale)return b.tinyColorHoverAlpha}),g.each(function(b){var v=b.link.label;v!==""&&n(A,w).selectAll("."+r.sankeyLink).filter(function(u){return u.link.label===v}).style("fill",function(u){if(!u.link.concentrationscale)return u.tinyColorHoverHue}).style("fill-opacity",function(u){if(!u.link.concentrationscale)return u.tinyColorHoverAlpha})}),M&&n(A,w).selectAll("."+r.sankeyNode).filter(c(w)).call(m)}function l(w,A,M,g){g.style("fill",function(b){return b.tinyColorHue}).style("fill-opacity",function(b){return b.tinyColorAlpha}),g.each(function(b){var v=b.link.label;v!==""&&n(A,w).selectAll("."+r.sankeyLink).filter(function(u){return u.link.label===v}).style("fill",function(u){return u.tinyColorHue}).style("fill-opacity",function(u){return u.tinyColorAlpha})}),M&&n(A,w).selectAll(r.sankeyNode).filter(c(w)).call(d)}function _(w,A){var M=w.hoverlabel||{},g=x.nestedProperty(M,A).get();return Array.isArray(g)?!1:g}H.exports=function(A,M){for(var g=A._fullLayout,b=g._paper,v=g._size,u=0;u<A._fullData.length;u++)if(A._fullData[u].visible&&A._fullData[u].type===r.sankey&&!A._fullData[u]._viewInitial){var y=A._fullData[u].node;A._fullData[u]._viewInitial={node:{groups:y.groups.slice(),x:y.x.slice(),y:y.y.slice()}}}var f=function(le,ce){var q=ce.link;q.originalEvent=p.event,A._hoverdata=[q],e.click(A,{target:!0})},R=function(le,ce,q){A._fullLayout.hovermode!==!1&&(p.select(le).call(T.bind(0,ce,q,!0)),ce.link.trace.link.hoverinfo!=="skip"&&(ce.link.fullData=ce.link.trace,A.emit("plotly_hover",{event:p.event,points:[ce.link]})))},L=o(A,"source:")+" ",z=o(A,"target:")+" ",F=o(A,"concentration:")+" ",N=o(A,"incoming flow count:")+" ",B=o(A,"outgoing flow count:")+" ",I=function(le,ce){if(A._fullLayout.hovermode===!1)return;var q=ce.link.trace.link;if(q.hoverinfo==="none"||q.hoverinfo==="skip")return;var Z=[];function ee(ue){var _e,we;ue.circular?(_e=(ue.circularPathData.leftInnerExtent+ue.circularPathData.rightInnerExtent)/2,we=ue.circularPathData.verticalFullExtent):(_e=(ue.source.x1+ue.target.x0)/2,we=(ue.y0+ue.y1)/2);var Re=[_e,we];return ue.trace.orientation==="v"&&Re.reverse(),Re[0]+=ce.parent.translateX,Re[1]+=ce.parent.translateY,Re}for(var V=0,oe=0;oe<ce.flow.links.length;oe++){var ie=ce.flow.links[oe];if(!(A._fullLayout.hovermode==="closest"&&ce.link.pointNumber!==ie.pointNumber)){ce.link.pointNumber===ie.pointNumber&&(V=oe),ie.fullData=ie.trace,q=ce.link.trace.link;var j=ee(ie),Q={valueLabel:S(ce.valueFormat)(ie.value)+ce.valueSuffix};Z.push({x:j[0],y:j[1],name:Q.valueLabel,text:[ie.label||"",L+ie.source.label,z+ie.target.label,ie.concentrationscale?F+S("%0.2f")(ie.flow.labelConcentration):""].filter(i).join("<br>"),color:_(q,"bgcolor")||t.addOpacity(ie.color,1),borderColor:_(q,"bordercolor"),fontFamily:_(q,"font.family"),fontSize:_(q,"font.size"),fontColor:_(q,"font.color"),fontWeight:_(q,"font.weight"),fontStyle:_(q,"font.style"),fontVariant:_(q,"font.variant"),fontTextcase:_(q,"font.textcase"),fontLineposition:_(q,"font.lineposition"),fontShadow:_(q,"font.shadow"),nameLength:_(q,"namelength"),textAlign:_(q,"align"),idealAlign:p.event.x<j[0]?"right":"left",hovertemplate:q.hovertemplate,hovertemplateLabels:Q,eventData:[ie]})}}var re=e.loneHover(Z,{container:g._hoverlayer.node(),outerContainer:g._paper.node(),gd:A,anchorIndex:V});re.each(function(){var ue=this;ce.link.concentrationscale||a(ue,.65),s(ue)})},U=function(le,ce,q){A._fullLayout.hovermode!==!1&&(p.select(le).call(l.bind(0,ce,q,!0)),ce.link.trace.link.hoverinfo!=="skip"&&(ce.link.fullData=ce.link.trace,A.emit("plotly_unhover",{event:p.event,points:[ce.link]})),e.loneUnhover(g._hoverlayer.node()))},O=function(le,ce,q){var Z=ce.node;Z.originalEvent=p.event,A._hoverdata=[Z],p.select(le).call(d,ce,q),e.click(A,{target:!0})},X=function(le,ce,q){A._fullLayout.hovermode!==!1&&(p.select(le).call(m,ce,q),ce.node.trace.node.hoverinfo!=="skip"&&(ce.node.fullData=ce.node.trace,A.emit("plotly_hover",{event:p.event,points:[ce.node]})))},J=function(le,ce){if(A._fullLayout.hovermode!==!1){var q=ce.node.trace.node;if(!(q.hoverinfo==="none"||q.hoverinfo==="skip")){var Z=p.select(le).select("."+r.nodeRect),ee=A._fullLayout._paperdiv.node().getBoundingClientRect(),V=Z.node().getBoundingClientRect(),oe=V.left-2-ee.left,ie=V.right+2-ee.left,j=V.top+V.height/4-ee.top,Q={valueLabel:S(ce.valueFormat)(ce.node.value)+ce.valueSuffix};ce.node.fullData=ce.node.trace,A._fullLayout._calcInverseTransform(A);var re=A._fullLayout._invScaleX,ue=A._fullLayout._invScaleY,_e=e.loneHover({x0:re*oe,x1:re*ie,y:ue*j,name:S(ce.valueFormat)(ce.node.value)+ce.valueSuffix,text:[ce.node.label,N+ce.node.targetLinks.length,B+ce.node.sourceLinks.length].filter(i).join("<br>"),color:_(q,"bgcolor")||ce.tinyColorHue,borderColor:_(q,"bordercolor"),fontFamily:_(q,"font.family"),fontSize:_(q,"font.size"),fontColor:_(q,"font.color"),fontWeight:_(q,"font.weight"),fontStyle:_(q,"font.style"),fontVariant:_(q,"font.variant"),fontTextcase:_(q,"font.textcase"),fontLineposition:_(q,"font.lineposition"),fontShadow:_(q,"font.shadow"),nameLength:_(q,"namelength"),textAlign:_(q,"align"),idealAlign:"left",hovertemplate:q.hovertemplate,hovertemplateLabels:Q,eventData:[ce.node]},{container:g._hoverlayer.node(),outerContainer:g._paper.node(),gd:A});a(_e,.85),s(_e)}}},se=function(le,ce,q){A._fullLayout.hovermode!==!1&&(p.select(le).call(d,ce,q),ce.node.trace.node.hoverinfo!=="skip"&&(ce.node.fullData=ce.node.trace,A.emit("plotly_unhover",{event:p.event,points:[ce.node]})),e.loneUnhover(g._hoverlayer.node()))};E(A,b,M,{width:v.w,height:v.h,margin:{t:v.t,r:v.r,b:v.b,l:v.l}},{linkEvents:{hover:R,follow:I,unhover:U,select:f},nodeEvents:{hover:X,follow:J,unhover:se,select:O}})}}}),jD=De({"src/traces/sankey/base_plot.js"(Y){"use strict";var H=gc().overrideAll,p=Lh().getModuleCalcData,x=TA(),S=Rv(),E=hv(),e=Qh(),t=Af().prepSelect,r=ui(),o=Mo(),i="sankey";Y.name=i,Y.baseLayoutAttrOverrides=H({hoverlabel:S.hoverlabel},"plot","nested"),Y.plot=function(a){var s=p(a.calcdata,i)[0];x(a,s),Y.updateFx(a)},Y.clean=function(a,s,h,c){var m=c._has&&c._has(i),d=s._has&&s._has(i);m&&!d&&(c._paperdiv.selectAll(".sankey").remove(),c._paperdiv.selectAll(".bgsankey").remove())},Y.updateFx=function(a){for(var s=0;s<a._fullData.length;s++)n(a,s)};function n(a,s){var h=a._fullData[s],c=a._fullLayout,m=c.dragmode,d=c.dragmode==="pan"?"move":"crosshair",T=h._bgRect;if(T&&!(m==="pan"||m==="zoom")){E(T,d);var l={_id:"x",c2p:r.identity,_offset:h._sankey.translateX,_length:h._sankey.width},_={_id:"y",c2p:r.identity,_offset:h._sankey.translateY,_length:h._sankey.height},w={gd:a,element:T.node(),plotinfo:{id:s,xaxis:l,yaxis:_,fillRangeItems:r.noop},subplot:s,xaxes:[l],yaxes:[_],doneFnCompleted:function(A){var M=a._fullData[s],g,b=M.node.groups.slice(),v=[];function u(L){for(var z=M._sankey.graph.nodes,F=0;F<z.length;F++)if(z[F].pointNumber===L)return z[F]}for(var y=0;y<A.length;y++){var f=u(A[y].pointNumber);if(f)if(f.group){for(var R=0;R<f.childrenNodes.length;R++)v.push(f.childrenNodes[R].pointNumber);b[f.pointNumber-M.node._count]=!1}else v.push(f.pointNumber)}g=b.filter(Boolean).concat([v]),o.call("_guiRestyle",a,{"node.groups":[g]},s)}};w.prepFn=function(A,M,g){t(A,M,g,w,m)},e.init(w)}}}}),VD=De({"src/traces/sankey/select.js"(Y,H){"use strict";H.exports=function(x,S){for(var E=x.cd,e=[],t=E[0].trace,r=t._sankey.graph.nodes,o=0;o<r.length;o++){var i=r[o];if(!i.partOfGroup){var n=[(i.x0+i.x1)/2,(i.y0+i.y1)/2];t.orientation==="v"&&n.reverse(),S&&S.contains(n,!1,o,x)&&e.push({pointNumber:i.pointNumber})}}return e}}}),qD=De({"src/traces/sankey/index.js"(Y,H){"use strict";H.exports={attributes:_A(),supplyDefaults:LD(),calc:ID(),plot:TA(),moduleType:"trace",name:"sankey",basePlotModule:jD(),selectPoints:VD(),categories:["noOpacity"],meta:{}}}}),HD=De({"lib/sankey.js"(Y,H){"use strict";H.exports=qD()}}),GD=De({"src/traces/indicator/base_plot.js"(Y){"use strict";var H=Mc();Y.name="indicator",Y.plot=function(p,x,S,E){H.plotBasePlot(Y.name,p,x,S,E)},Y.clean=function(p,x,S,E){H.cleanBasePlot(Y.name,p,x,S,E)}}}),AA=De({"src/traces/indicator/attributes.js"(Y,H){"use strict";var p=Xo().extendFlat,x=Xo().extendDeep,S=gc().overrideAll,E=qu(),e=Pf(),t=Ec().attributes,r=Ih(),o=Gl().templatedArray,i=lg(),n=of().descriptionOnlyNumbers,a=E({editType:"plot",colorEditType:"plot"}),s={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:e.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"},h={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},c=o("step",x({},s,{range:h}));H.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:t({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:p({},a,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:n("value")},font:p({},a,{}),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:n("value")},increasing:{symbol:{valType:"string",dflt:i.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:i.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:i.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:i.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:p({},a,{}),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:x({},s,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:e.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:S({range:h,visible:p({},r.visible,{dflt:!0}),tickmode:r.minor.tickmode,nticks:r.nticks,tick0:r.tick0,dtick:r.dtick,tickvals:r.tickvals,ticktext:r.ticktext,ticks:p({},r.ticks,{dflt:"outside"}),ticklen:r.ticklen,tickwidth:r.tickwidth,tickcolor:r.tickcolor,ticklabelstep:r.ticklabelstep,showticklabels:r.showticklabels,labelalias:r.labelalias,tickfont:E({}),tickangle:r.tickangle,tickformat:r.tickformat,tickformatstops:r.tickformatstops,tickprefix:r.tickprefix,showtickprefix:r.showtickprefix,ticksuffix:r.ticksuffix,showticksuffix:r.showticksuffix,separatethousands:r.separatethousands,exponentformat:r.exponentformat,minexponent:r.minexponent,showexponent:r.showexponent,editType:"plot"},"plot"),steps:c,threshold:{line:{color:p({},s.line.color,{}),width:p({},s.line.width,{dflt:1}),editType:"plot"},thickness:p({},s.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}}}),SA=De({"src/traces/indicator/constants.js"(Y,H){"use strict";H.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}}),WD=De({"src/traces/indicator/defaults.js"(Y,H){"use strict";var p=ui(),x=AA(),S=Ec().defaults,E=Gl(),e=Vh(),t=SA(),r=U0(),o=Zm(),i=qp(),n=Hp();function a(h,c,m,d){function T(I,U){return p.coerce(h,c,x,I,U)}S(c,d,T),T("mode"),c._hasNumber=c.mode.indexOf("number")!==-1,c._hasDelta=c.mode.indexOf("delta")!==-1,c._hasGauge=c.mode.indexOf("gauge")!==-1;var l=T("value");c._range=[0,typeof l=="number"?1.5*l:1];var _=new Array(2),w;if(c._hasNumber){T("number.valueformat");var A=p.extendFlat({},d.font);A.size=void 0,p.coerceFont(T,"number.font",A),c.number.font.size===void 0&&(c.number.font.size=t.defaultNumberFontSize,_[0]=!0),T("number.prefix"),T("number.suffix"),w=c.number.font.size}var M;if(c._hasDelta){var g=p.extendFlat({},d.font);g.size=void 0,p.coerceFont(T,"delta.font",g),c.delta.font.size===void 0&&(c.delta.font.size=(c._hasNumber?.5:1)*(w||t.defaultNumberFontSize),_[1]=!0),T("delta.reference",c.value),T("delta.relative"),T("delta.valueformat",c.delta.relative?"2%":""),T("delta.increasing.symbol"),T("delta.increasing.color"),T("delta.decreasing.symbol"),T("delta.decreasing.color"),T("delta.position"),T("delta.prefix"),T("delta.suffix"),M=c.delta.font.size}c._scaleNumbers=(!c._hasNumber||_[0])&&(!c._hasDelta||_[1])||!1;var b=p.extendFlat({},d.font);b.size=.25*(w||M||t.defaultNumberFontSize),p.coerceFont(T,"title.font",b),T("title.text");var v,u,y,f;function R(I,U){return p.coerce(v,u,x.gauge,I,U)}function L(I,U){return p.coerce(y,f,x.gauge.axis,I,U)}if(c._hasGauge){v=h.gauge,v||(v={}),u=E.newContainer(c,"gauge"),R("shape");var z=c._isBullet=c.gauge.shape==="bullet";z||T("title.align","center");var F=c._isAngular=c.gauge.shape==="angular";F||T("align","center"),R("bgcolor",d.paper_bgcolor),R("borderwidth"),R("bordercolor"),R("bar.color"),R("bar.line.color"),R("bar.line.width");var N=t.valueThickness*(c.gauge.shape==="bullet"?.5:1);R("bar.thickness",N),e(v,u,{name:"steps",handleItemDefaults:s}),R("threshold.value"),R("threshold.thickness"),R("threshold.line.width"),R("threshold.line.color"),y={},v&&(y=v.axis||{}),f=E.newContainer(u,"axis"),L("visible"),c._range=L("range",c._range);var B={font:d.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};r(y,f,L,"linear"),n(y,f,L,"linear",B),i(y,f,L,"linear",B),o(y,f,L,B)}else T("title.align","center"),T("align","center"),c._isAngular=c._isBullet=!1;c._length=null}function s(h,c){function m(d,T){return p.coerce(h,c,x.gauge.steps,d,T)}m("color"),m("line.color"),m("line.width"),m("range"),m("thickness")}H.exports={supplyDefaults:a}}}),XD=De({"src/traces/indicator/calc.js"(Y,H){"use strict";function p(x,S){var E=[],e=S.value;typeof S._lastValue!="number"&&(S._lastValue=S.value);var t=S._lastValue,r=t;return S._hasDelta&&typeof S.delta.reference=="number"&&(r=S.delta.reference),E[0]={y:e,lastY:t,delta:e-r,relativeDelta:(e-r)/r},E}H.exports={calc:p}}}),YD=De({"src/traces/indicator/plot.js"(Y,H){"use strict";var p=za(),x=(am(),Ua(i0)).interpolate,S=(am(),Ua(i0)).interpolateNumber,E=ui(),e=E.strScale,t=E.strTranslate,r=E.rad2deg,o=rh().MID_SHIFT,i=ys(),n=SA(),a=vu(),s=us(),h=yy(),c=z_(),m=Ih(),d=vo(),T={left:"start",center:"middle",right:"end"},l={left:0,center:.5,right:1},_=/[yzafpnµmkMGTPEZY]/;function w(z){return z&&z.duration>0}H.exports=function(F,N,B,I){var U=F._fullLayout,O;w(B)&&I&&(O=I()),E.makeTraceGroups(U._indicatorlayer,N,"trace").each(function(X){var J=X[0],se=J.trace,le=p.select(this),ce=se._hasGauge,q=se._isAngular,Z=se._isBullet,ee=se.domain,V={w:U._size.w*(ee.x[1]-ee.x[0]),h:U._size.h*(ee.y[1]-ee.y[0]),l:U._size.l+U._size.w*ee.x[0],r:U._size.r+U._size.w*(1-ee.x[1]),t:U._size.t+U._size.h*(1-ee.y[1]),b:U._size.b+U._size.h*ee.y[0]},oe=V.l+V.w/2,ie=V.t+V.h/2,j=Math.min(V.w/2,V.h),Q=n.innerRadius*j,re,ue,_e,we=se.align||"center";if(ue=ie,!ce)re=V.l+l[we]*V.w,_e=function(fe){return y(fe,V.w,V.h)};else if(q&&(re=oe,ue=ie+j/2,_e=function(fe){return f(fe,.9*Q)}),Z){var Re=n.bulletPadding,ze=1-n.bulletNumberDomainSize+Re;re=V.l+(ze+(1-ze)*l[we])*V.w,_e=function(fe){return y(fe,(n.bulletNumberDomainSize-Re)*V.w,V.h)}}g(F,le,X,{numbersX:re,numbersY:ue,numbersScaler:_e,transitionOpts:B,onComplete:O});var Xe,tt;ce&&(Xe={range:se.gauge.axis.range,color:se.gauge.bgcolor,line:{color:se.gauge.bordercolor,width:0},thickness:1},tt={range:se.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:se.gauge.bordercolor,width:se.gauge.borderwidth},thickness:1});var it=le.selectAll("g.angular").data(q?X:[]);it.exit().remove();var et=le.selectAll("g.angularaxis").data(q?X:[]);et.exit().remove(),q&&M(F,le,X,{radius:j,innerRadius:Q,gauge:it,layer:et,size:V,gaugeBg:Xe,gaugeOutline:tt,transitionOpts:B,onComplete:O});var nt=le.selectAll("g.bullet").data(Z?X:[]);nt.exit().remove();var Ae=le.selectAll("g.bulletaxis").data(Z?X:[]);Ae.exit().remove(),Z&&A(F,le,X,{gauge:nt,layer:Ae,size:V,gaugeBg:Xe,gaugeOutline:tt,transitionOpts:B,onComplete:O});var me=le.selectAll("text.title").data(X);me.exit().remove(),me.enter().append("text").classed("title",!0),me.attr("text-anchor",function(){return Z?T.right:T[se.title.align]}).text(se.title.text).call(i.font,se.title.font).call(a.convertToTspans,F),me.attr("transform",function(){var fe=V.l+V.w*l[se.title.align],Be,Qe=n.titlePadding,at=i.bBox(me.node());if(ce){if(q)if(se.gauge.axis.visible){var $e=i.bBox(et.node());Be=$e.top-Qe-at.bottom}else Be=V.t+V.h/2-j/2-at.bottom-Qe;Z&&(Be=ue-(at.top+at.bottom)/2,fe=V.l-n.bulletPadding*V.w)}else Be=se._numbersTop-Qe-at.bottom;return t(fe,Be)})})};function A(z,F,N,B){var I=N[0].trace,U=B.gauge,O=B.layer,X=B.gaugeBg,J=B.gaugeOutline,se=B.size,le=I.domain,ce=B.transitionOpts,q=B.onComplete,Z,ee,V,oe,ie;U.enter().append("g").classed("bullet",!0),U.attr("transform",t(se.l,se.t)),O.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),O.selectAll("g.xbulletaxistick,path,text").remove();var j=se.h,Q=I.gauge.bar.thickness*j,re=le.x[0],ue=le.x[0]+(le.x[1]-le.x[0])*(I._hasNumber||I._hasDelta?1-n.bulletNumberDomainSize:1);Z=u(z,I.gauge.axis),Z._id="xbulletaxis",Z.domain=[re,ue],Z.setScale(),ee=s.calcTicks(Z),V=s.makeTransTickFn(Z),oe=s.getTickSigns(Z)[2],ie=se.t+se.h,Z.visible&&(s.drawTicks(z,Z,{vals:Z.ticks==="inside"?s.clipEnds(Z,ee):ee,layer:O,path:s.makeTickPath(Z,ie,oe),transFn:V}),s.drawLabels(z,Z,{vals:ee,layer:O,transFn:V,labelFns:s.makeLabelFns(Z,ie)}));function _e(et){et.attr("width",function(nt){return Math.max(0,Z.c2p(nt.range[1])-Z.c2p(nt.range[0]))}).attr("x",function(nt){return Z.c2p(nt.range[0])}).attr("y",function(nt){return .5*(1-nt.thickness)*j}).attr("height",function(nt){return nt.thickness*j})}var we=[X].concat(I.gauge.steps),Re=U.selectAll("g.bg-bullet").data(we);Re.enter().append("g").classed("bg-bullet",!0).append("rect"),Re.select("rect").call(_e).call(b),Re.exit().remove();var ze=U.selectAll("g.value-bullet").data([I.gauge.bar]);ze.enter().append("g").classed("value-bullet",!0).append("rect"),ze.select("rect").attr("height",Q).attr("y",(j-Q)/2).call(b),w(ce)?ze.select("rect").transition().duration(ce.duration).ease(ce.easing).each("end",function(){q&&q()}).each("interrupt",function(){q&&q()}).attr("width",Math.max(0,Z.c2p(Math.min(I.gauge.axis.range[1],N[0].y)))):ze.select("rect").attr("width",typeof N[0].y=="number"?Math.max(0,Z.c2p(Math.min(I.gauge.axis.range[1],N[0].y))):0),ze.exit().remove();var Xe=N.filter(function(){return I.gauge.threshold.value||I.gauge.threshold.value===0}),tt=U.selectAll("g.threshold-bullet").data(Xe);tt.enter().append("g").classed("threshold-bullet",!0).append("line"),tt.select("line").attr("x1",Z.c2p(I.gauge.threshold.value)).attr("x2",Z.c2p(I.gauge.threshold.value)).attr("y1",(1-I.gauge.threshold.thickness)/2*j).attr("y2",(1-(1-I.gauge.threshold.thickness)/2)*j).call(d.stroke,I.gauge.threshold.line.color).style("stroke-width",I.gauge.threshold.line.width),tt.exit().remove();var it=U.selectAll("g.gauge-outline").data([J]);it.enter().append("g").classed("gauge-outline",!0).append("rect"),it.select("rect").call(_e).call(b),it.exit().remove()}function M(z,F,N,B){var I=N[0].trace,U=B.size,O=B.radius,X=B.innerRadius,J=B.gaugeBg,se=B.gaugeOutline,le=[U.l+U.w/2,U.t+U.h/2+O/2],ce=B.gauge,q=B.layer,Z=B.transitionOpts,ee=B.onComplete,V=Math.PI/2;function oe(It){var Pt=I.gauge.axis.range[0],Vt=I.gauge.axis.range[1],Wt=(It-Pt)/(Vt-Pt)*Math.PI-V;return Wt<-V?-V:Wt>V?V:Wt}function ie(It){return p.svg.arc().innerRadius((X+O)/2-It/2*(O-X)).outerRadius((X+O)/2+It/2*(O-X)).startAngle(-V)}function j(It){It.attr("d",function(Pt){return ie(Pt.thickness).startAngle(oe(Pt.range[0])).endAngle(oe(Pt.range[1]))()})}var Q,re,ue,_e;ce.enter().append("g").classed("angular",!0),ce.attr("transform",t(le[0],le[1])),q.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),q.selectAll("g.xangularaxistick,path,text").remove(),Q=u(z,I.gauge.axis),Q.type="linear",Q.range=I.gauge.axis.range,Q._id="xangularaxis",Q.ticklabeloverflow="allow",Q.setScale();var we=function(It){return(Q.range[0]-It.x)/(Q.range[1]-Q.range[0])*Math.PI+Math.PI},Re={},ze=s.makeLabelFns(Q,0),Xe=ze.labelStandoff;Re.xFn=function(It){var Pt=we(It);return Math.cos(Pt)*Xe},Re.yFn=function(It){var Pt=we(It),Vt=Math.sin(Pt)>0?.2:1;return-Math.sin(Pt)*(Xe+It.fontSize*Vt)+Math.abs(Math.cos(Pt))*(It.fontSize*o)},Re.anchorFn=function(It){var Pt=we(It),Vt=Math.cos(Pt);return Math.abs(Vt)<.1?"middle":Vt>0?"start":"end"},Re.heightFn=function(It,Pt,Vt){var Wt=we(It);return-.5*(1+Math.sin(Wt))*Vt};var tt=function(It){return t(le[0]+O*Math.cos(It),le[1]-O*Math.sin(It))};ue=function(It){return tt(we(It))};var it=function(It){var Pt=we(It);return tt(Pt)+"rotate("+-r(Pt)+")"};if(re=s.calcTicks(Q),_e=s.getTickSigns(Q)[2],Q.visible){_e=Q.ticks==="inside"?-1:1;var et=(Q.linewidth||1)/2;s.drawTicks(z,Q,{vals:re,layer:q,path:"M"+_e*et+",0h"+_e*Q.ticklen,transFn:it}),s.drawLabels(z,Q,{vals:re,layer:q,transFn:ue,labelFns:Re})}var nt=[J].concat(I.gauge.steps),Ae=ce.selectAll("g.bg-arc").data(nt);Ae.enter().append("g").classed("bg-arc",!0).append("path"),Ae.select("path").call(j).call(b),Ae.exit().remove();var me=ie(I.gauge.bar.thickness),fe=ce.selectAll("g.value-arc").data([I.gauge.bar]);fe.enter().append("g").classed("value-arc",!0).append("path");var Be=fe.select("path");w(Z)?(Be.transition().duration(Z.duration).ease(Z.easing).each("end",function(){ee&&ee()}).each("interrupt",function(){ee&&ee()}).attrTween("d",v(me,oe(N[0].lastY),oe(N[0].y))),I._lastValue=N[0].y):Be.attr("d",typeof N[0].y=="number"?me.endAngle(oe(N[0].y)):"M0,0Z"),Be.call(b),fe.exit().remove(),nt=[];var Qe=I.gauge.threshold.value;(Qe||Qe===0)&&nt.push({range:[Qe,Qe],color:I.gauge.threshold.color,line:{color:I.gauge.threshold.line.color,width:I.gauge.threshold.line.width},thickness:I.gauge.threshold.thickness});var at=ce.selectAll("g.threshold-arc").data(nt);at.enter().append("g").classed("threshold-arc",!0).append("path"),at.select("path").call(j).call(b),at.exit().remove();var $e=ce.selectAll("g.gauge-outline").data([se]);$e.enter().append("g").classed("gauge-outline",!0).append("path"),$e.select("path").call(j).call(b),$e.exit().remove()}function g(z,F,N,B){var I=N[0].trace,U=B.numbersX,O=B.numbersY,X=I.align||"center",J=T[X],se=B.transitionOpts,le=B.onComplete,ce=E.ensureSingle(F,"g","numbers"),q,Z,ee,V=[];I._hasNumber&&V.push("number"),I._hasDelta&&(V.push("delta"),I.delta.position==="left"&&V.reverse());var oe=ce.selectAll("text").data(V);oe.enter().append("text"),oe.attr("text-anchor",function(){return J}).attr("class",function(tt){return tt}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),oe.exit().remove();function ie(tt,it,et,nt){if(tt.match("s")&&et>=0!=nt>=0&&!it(et).slice(-1).match(_)&&!it(nt).slice(-1).match(_)){var Ae=tt.slice().replace("s","f").replace(/\d+/,function(fe){return parseInt(fe)-1}),me=u(z,{tickformat:Ae});return function(fe){return Math.abs(fe)<1?s.tickText(me,fe).text:it(fe)}}else return it}function j(){var tt=u(z,{tickformat:I.number.valueformat},I._range);tt.setScale(),s.prepTicks(tt);var it=function(fe){return s.tickText(tt,fe).text},et=I.number.suffix,nt=I.number.prefix,Ae=ce.select("text.number");function me(){var fe=typeof N[0].y=="number"?nt+it(N[0].y)+et:"-";Ae.text(fe).call(i.font,I.number.font).call(a.convertToTspans,z)}return w(se)?Ae.transition().duration(se.duration).ease(se.easing).each("end",function(){me(),le&&le()}).each("interrupt",function(){me(),le&&le()}).attrTween("text",function(){var fe=p.select(this),Be=S(N[0].lastY,N[0].y);I._lastValue=N[0].y;var Qe=ie(I.number.valueformat,it,N[0].lastY,N[0].y);return function(at){fe.text(nt+Qe(Be(at))+et)}}):me(),q=R(nt+it(N[0].y)+et,I.number.font,J,z),Ae}function Q(){var tt=u(z,{tickformat:I.delta.valueformat},I._range);tt.setScale(),s.prepTicks(tt);var it=function(at){return s.tickText(tt,at).text},et=I.delta.suffix,nt=I.delta.prefix,Ae=function(at){var $e=I.delta.relative?at.relativeDelta:at.delta;return $e},me=function(at,$e){return at===0||typeof at!="number"||isNaN(at)?"-":(at>0?I.delta.increasing.symbol:I.delta.decreasing.symbol)+nt+$e(at)+et},fe=function(at){return at.delta>=0?I.delta.increasing.color:I.delta.decreasing.color};I._deltaLastValue===void 0&&(I._deltaLastValue=Ae(N[0]));var Be=ce.select("text.delta");Be.call(i.font,I.delta.font).call(d.fill,fe({delta:I._deltaLastValue}));function Qe(){Be.text(me(Ae(N[0]),it)).call(d.fill,fe(N[0])).call(a.convertToTspans,z)}return w(se)?Be.transition().duration(se.duration).ease(se.easing).tween("text",function(){var at=p.select(this),$e=Ae(N[0]),It=I._deltaLastValue,Pt=ie(I.delta.valueformat,it,It,$e),Vt=S(It,$e);return I._deltaLastValue=$e,function(Wt){at.text(me(Vt(Wt),Pt)),at.call(d.fill,fe({delta:Vt(Wt)}))}}).each("end",function(){Qe(),le&&le()}).each("interrupt",function(){Qe(),le&&le()}):Qe(),Z=R(me(Ae(N[0]),it),I.delta.font,J,z),Be}var re=I.mode+I.align,ue;if(I._hasDelta&&(ue=Q(),re+=I.delta.position+I.delta.font.size+I.delta.font.family+I.delta.valueformat,re+=I.delta.increasing.symbol+I.delta.decreasing.symbol,ee=Z),I._hasNumber&&(j(),re+=I.number.font.size+I.number.font.family+I.number.valueformat+I.number.suffix+I.number.prefix,ee=q),I._hasDelta&&I._hasNumber){var _e=[(q.left+q.right)/2,(q.top+q.bottom)/2],we=[(Z.left+Z.right)/2,(Z.top+Z.bottom)/2],Re,ze,Xe=.75*I.delta.font.size;I.delta.position==="left"&&(Re=L(I,"deltaPos",0,-1*(q.width*l[I.align]+Z.width*(1-l[I.align])+Xe),re,Math.min),ze=_e[1]-we[1],ee={width:q.width+Z.width+Xe,height:Math.max(q.height,Z.height),left:Z.left+Re,right:q.right,top:Math.min(q.top,Z.top+ze),bottom:Math.max(q.bottom,Z.bottom+ze)}),I.delta.position==="right"&&(Re=L(I,"deltaPos",0,q.width*(1-l[I.align])+Z.width*l[I.align]+Xe,re,Math.max),ze=_e[1]-we[1],ee={width:q.width+Z.width+Xe,height:Math.max(q.height,Z.height),left:q.left,right:Z.right+Re,top:Math.min(q.top,Z.top+ze),bottom:Math.max(q.bottom,Z.bottom+ze)}),I.delta.position==="bottom"&&(Re=null,ze=Z.height,ee={width:Math.max(q.width,Z.width),height:q.height+Z.height,left:Math.min(q.left,Z.left),right:Math.max(q.right,Z.right),top:q.bottom-q.height,bottom:q.bottom+Z.height}),I.delta.position==="top"&&(Re=null,ze=q.top,ee={width:Math.max(q.width,Z.width),height:q.height+Z.height,left:Math.min(q.left,Z.left),right:Math.max(q.right,Z.right),top:q.bottom-q.height-Z.height,bottom:q.bottom}),ue.attr({dx:Re,dy:ze})}(I._hasNumber||I._hasDelta)&&ce.attr("transform",function(){var tt=B.numbersScaler(ee);re+=tt[2];var it=L(I,"numbersScale",1,tt[0],re,Math.min),et;I._scaleNumbers||(it=1),I._isAngular?et=O-it*ee.bottom:et=O-it*(ee.top+ee.bottom)/2,I._numbersTop=it*ee.top+et;var nt=ee[X];X==="center"&&(nt=(ee.left+ee.right)/2);var Ae=U-it*nt;return Ae=L(I,"numbersTranslate",0,Ae,re,Math.max),t(Ae,et)+e(it)})}function b(z){z.each(function(F){d.stroke(p.select(this),F.line.color)}).each(function(F){d.fill(p.select(this),F.color)}).style("stroke-width",function(F){return F.line.width})}function v(z,F,N){return function(){var B=x(F,N);return function(I){return z.endAngle(B(I))()}}}function u(z,F,N){var B=z._fullLayout,I=E.extendFlat({type:"linear",ticks:"outside",range:N,showline:!0},F),U={type:"linear",_id:"x"+F._id},O={letter:"x",font:B.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function X(J,se){return E.coerce(I,U,m,J,se)}return h(I,U,X,O,B),c(I,U,X,O),U}function y(z,F,N){var B=Math.min(F/z.width,N/z.height);return[B,z,F+"x"+N]}function f(z,F){var N=Math.sqrt(z.width/2*(z.width/2)+z.height*z.height),B=F/N;return[B,z,F]}function R(z,F,N,B){var I=document.createElementNS("http://www.w3.org/2000/svg","text"),U=p.select(I);return U.text(z).attr("x",0).attr("y",0).attr("text-anchor",N).attr("data-unformatted",z).call(a.convertToTspans,B).call(i.font,F),i.bBox(U.node())}function L(z,F,N,B,I,U){var O="_cache"+F;z[O]&&z[O].key===I||(z[O]={key:I,value:N});var X=E.aggNums(U,null,[z[O].value,B],2);return z[O].value=X,X}}}),ZD=De({"src/traces/indicator/index.js"(Y,H){"use strict";H.exports={moduleType:"trace",name:"indicator",basePlotModule:GD(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:AA(),supplyDefaults:WD().supplyDefaults,calc:XD().calc,plot:YD(),meta:{}}}}),KD=De({"lib/indicator.js"(Y,H){"use strict";H.exports=ZD()}}),MA=De({"src/traces/table/attributes.js"(Y,H){"use strict";var p=q0(),x=Xo().extendFlat,S=gc().overrideAll,E=qu(),e=Ec().attributes,t=of().descriptionOnlyNumbers,r=H.exports=S({domain:e({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:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:x({},p.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:x({},E({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:x({},p.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:x({},E({arrayOk:!0}))}},"calc","from-root")}}),$D=De({"src/traces/table/defaults.js"(Y,H){"use strict";var p=ui(),x=MA(),S=Ec().defaults;function E(e,t){for(var r=e.columnorder||[],o=e.header.values.length,i=r.slice(0,o),n=i.slice().sort(function(h,c){return h-c}),a=i.map(function(h){return n.indexOf(h)}),s=a.length;s<o;s++)a.push(s);t("columnorder",a)}H.exports=function(t,r,o,i){function n(a,s){return p.coerce(t,r,x,a,s)}S(r,i,n),n("columnwidth"),n("header.values"),n("header.format"),n("header.align"),n("header.prefix"),n("header.suffix"),n("header.height"),n("header.line.width"),n("header.line.color"),n("header.fill.color"),p.coerceFont(n,"header.font",i.font),E(r,n),n("cells.values"),n("cells.format"),n("cells.align"),n("cells.prefix"),n("cells.suffix"),n("cells.height"),n("cells.line.width"),n("cells.line.color"),n("cells.fill.color"),p.coerceFont(n,"cells.font",i.font),r._length=null}}}),JD=De({"src/traces/table/calc.js"(Y,H){"use strict";var p=Uv().wrap;H.exports=function(){return p({})}}}),EA=De({"src/traces/table/constants.js"(Y,H){"use strict";H.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"}}}}),QD=De({"src/traces/table/data_preparation_helper.js"(Y,H){"use strict";var p=EA(),x=Xo().extendFlat,S=vn(),E=vl().isTypedArray,e=vl().isArrayOrTypedArray;H.exports=function(m,d){var T=o(d.cells.values),l=function(J){return J.slice(d.header.values.length,J.length)},_=o(d.header.values);_.length&&!_[0].length&&(_[0]=[""],_=o(_));var w=_.concat(l(T).map(function(){return i((_[0]||[""]).length)})),A=d.domain,M=Math.floor(m._fullLayout._size.w*(A.x[1]-A.x[0])),g=Math.floor(m._fullLayout._size.h*(A.y[1]-A.y[0])),b=d.header.values.length?w[0].map(function(){return d.header.height}):[p.emptyHeaderHeight],v=T.length?T[0].map(function(){return d.cells.height}):[],u=b.reduce(r,0),y=g-u,f=y+p.uplift,R=s(v,f),L=s(b,u),z=a(L,[]),F=a(R,z),N={},B=d._fullInput.columnorder;e(B)&&(B=Array.from(B)),B=B.concat(l(T.map(function(J,se){return se})));var I=w.map(function(J,se){var le=e(d.columnwidth)?d.columnwidth[Math.min(se,d.columnwidth.length-1)]:d.columnwidth;return S(le)?Number(le):1}),U=I.reduce(r,0);I=I.map(function(J){return J/U*M});var O=Math.max(t(d.header.line.width),t(d.cells.line.width)),X={key:d.uid+m._context.staticPlot,translateX:A.x[0]*m._fullLayout._size.w,translateY:m._fullLayout._size.h*(1-A.y[1]),size:m._fullLayout._size,width:M,maxLineWidth:O,height:g,columnOrder:B,groupHeight:g,rowBlocks:F,headerRowBlocks:z,scrollY:0,cells:x({},d.cells,{values:T}),headerCells:x({},d.header,{values:w}),gdColumns:w.map(function(J){return J[0]}),gdColumnsOriginalOrder:w.map(function(J){return J[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:w.map(function(J,se){var le=N[J];N[J]=(le||0)+1;var ce=J+"__"+N[J];return{key:ce,label:J,specIndex:se,xIndex:B[se],xScale:n,x:void 0,calcdata:void 0,columnWidth:I[se]}})};return X.columns.forEach(function(J){J.calcdata=X,J.x=n(J)}),X};function t(c){if(e(c)){for(var m=0,d=0;d<c.length;d++)m=Math.max(m,t(c[d]));return m}return c}function r(c,m){return c+m}function o(c){var m=c.slice(),d=1/0,T=0,l;for(l=0;l<m.length;l++)E(m[l])?m[l]=Array.from(m[l]):e(m[l])||(m[l]=[m[l]]),d=Math.min(d,m[l].length),T=Math.max(T,m[l].length);if(d!==T)for(l=0;l<m.length;l++){var _=T-m[l].length;_&&(m[l]=m[l].concat(i(_)))}return m}function i(c){for(var m=new Array(c),d=0;d<c;d++)m[d]="";return m}function n(c){return c.calcdata.columns.reduce(function(m,d){return d.xIndex<c.xIndex?m+d.columnWidth:m},0)}function a(c,m){var d=Object.keys(c);return d.map(function(T){return x({},c[T],{auxiliaryBlocks:m})})}function s(c,m){for(var d={},T,l=0,_=0,w=h(),A=0,M=0,g=0;g<c.length;g++)T=c[g],w.rows.push({rowIndex:g,rowHeight:T}),_+=T,(_>=m||g===c.length-1)&&(d[l]=w,w.key=M++,w.firstRowIndex=A,w.lastRowIndex=g,w=h(),l+=_,A=g+1,_=0);return d}function h(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}}),e4=De({"src/traces/table/data_split_helpers.js"(Y){"use strict";var H=Xo().extendFlat;Y.splitToPanels=function(x){var S=[0,0],E=H({},x,{key:"header",type:"header",page:0,prevPages:S,currentRepaint:[null,null],dragHandle:!0,values:x.calcdata.headerCells.values[x.specIndex],rowBlocks:x.calcdata.headerRowBlocks,calcdata:H({},x.calcdata,{cells:x.calcdata.headerCells})}),e=H({},x,{key:"cells1",type:"cells",page:0,prevPages:S,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks}),t=H({},x,{key:"cells2",type:"cells",page:1,prevPages:S,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks});return[e,t,E]},Y.splitToCells=function(x){var S=p(x);return(x.values||[]).slice(S[0],S[1]).map(function(E,e){var t=typeof E=="string"&&E.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:e+t,key:S[0]+e,column:x,calcdata:x.calcdata,page:x.page,rowBlocks:x.rowBlocks,value:E}})};function p(x){var S=x.rowBlocks[x.page],E=S?S.rows[0].rowIndex:0,e=S?E+S.rows.length:0;return[E,e]}}}),kA=De({"src/traces/table/plot.js"(Y,H){"use strict";var p=EA(),x=za(),S=ui(),E=S.numberFormat,e=Uv(),t=ys(),r=vu(),o=ui().raiseToTop,i=ui().strTranslate,n=ui().cancelTransition,a=QD(),s=e4(),h=vo();H.exports=function(re,ue){var _e=!re._context.staticPlot,we=re._fullLayout._paper.selectAll("."+p.cn.table).data(ue.map(function($e){var It=e.unwrap($e),Pt=It.trace;return a(re,Pt)}),e.keyFun);we.exit().remove(),we.enter().append("g").classed(p.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"),we.attr("width",function($e){return $e.width+$e.size.l+$e.size.r}).attr("height",function($e){return $e.height+$e.size.t+$e.size.b}).attr("transform",function($e){return i($e.translateX,$e.translateY)});var Re=we.selectAll("."+p.cn.tableControlView).data(e.repeat,e.keyFun),ze=Re.enter().append("g").classed(p.cn.tableControlView,!0).style("box-sizing","content-box");if(_e){var Xe="onwheel"in document?"wheel":"mousewheel";ze.on("mousemove",function($e){Re.filter(function(It){return $e===It}).call(l,re)}).on(Xe,function($e){if(!$e.scrollbarState.wheeling){$e.scrollbarState.wheeling=!0;var It=$e.scrollY+x.event.deltaY,Pt=J(re,Re,null,It)($e);Pt||(x.event.stopPropagation(),x.event.preventDefault()),$e.scrollbarState.wheeling=!1}}).call(l,re,!0)}Re.attr("transform",function($e){return i($e.size.l,$e.size.t)});var tt=Re.selectAll("."+p.cn.scrollBackground).data(e.repeat,e.keyFun);tt.enter().append("rect").classed(p.cn.scrollBackground,!0).attr("fill","none"),tt.attr("width",function($e){return $e.width}).attr("height",function($e){return $e.height}),Re.each(function($e){t.setClipUrl(x.select(this),m(re,$e),re)});var it=Re.selectAll("."+p.cn.yColumn).data(function($e){return $e.columns},e.keyFun);it.enter().append("g").classed(p.cn.yColumn,!0),it.exit().remove(),it.attr("transform",function($e){return i($e.x,0)}),_e&&it.call(x.behavior.drag().origin(function($e){var It=x.select(this);return N(It,$e,-p.uplift),o(this),$e.calcdata.columnDragInProgress=!0,l(Re.filter(function(Pt){return $e.calcdata.key===Pt.key}),re),$e}).on("drag",function($e){var It=x.select(this),Pt=function(Cr){return($e===Cr?x.event.x:Cr.x)+Cr.columnWidth/2};$e.x=Math.max(-p.overdrag,Math.min($e.calcdata.width+p.overdrag-$e.columnWidth,x.event.x));var Vt=T(it).filter(function(Cr){return Cr.calcdata.key===$e.calcdata.key}),Wt=Vt.sort(function(Cr,yr){return Pt(Cr)-Pt(yr)});Wt.forEach(function(Cr,yr){Cr.xIndex=yr,Cr.x=$e===Cr?Cr.x:Cr.xScale(Cr)}),it.filter(function(Cr){return $e!==Cr}).transition().ease(p.transitionEase).duration(p.transitionDuration).attr("transform",function(Cr){return i(Cr.x,0)}),It.call(n).attr("transform",i($e.x,-p.uplift))}).on("dragend",function($e){var It=x.select(this),Pt=$e.calcdata;$e.x=$e.xScale($e),$e.calcdata.columnDragInProgress=!1,N(It,$e,0),z(re,Pt,Pt.columns.map(function(Vt){return Vt.xIndex}))})),it.each(function($e){t.setClipUrl(x.select(this),d(re,$e),re)});var et=it.selectAll("."+p.cn.columnBlock).data(s.splitToPanels,e.keyFun);et.enter().append("g").classed(p.cn.columnBlock,!0).attr("id",function($e){return $e.key}),et.style("cursor",function($e){return $e.dragHandle?"ew-resize":$e.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var nt=et.filter(I),Ae=et.filter(B);_e&&Ae.call(x.behavior.drag().origin(function($e){return x.event.stopPropagation(),$e}).on("drag",J(re,Re,-1)).on("dragend",function(){})),_(re,Re,nt,et),_(re,Re,Ae,et);var me=Re.selectAll("."+p.cn.scrollAreaClip).data(e.repeat,e.keyFun);me.enter().append("clipPath").classed(p.cn.scrollAreaClip,!0).attr("id",function($e){return m(re,$e)});var fe=me.selectAll("."+p.cn.scrollAreaClipRect).data(e.repeat,e.keyFun);fe.enter().append("rect").classed(p.cn.scrollAreaClipRect,!0).attr("x",-p.overdrag).attr("y",-p.uplift).attr("fill","none"),fe.attr("width",function($e){return $e.width+2*p.overdrag}).attr("height",function($e){return $e.height+p.uplift});var Be=it.selectAll("."+p.cn.columnBoundary).data(e.repeat,e.keyFun);Be.enter().append("g").classed(p.cn.columnBoundary,!0);var Qe=it.selectAll("."+p.cn.columnBoundaryClippath).data(e.repeat,e.keyFun);Qe.enter().append("clipPath").classed(p.cn.columnBoundaryClippath,!0),Qe.attr("id",function($e){return d(re,$e)});var at=Qe.selectAll("."+p.cn.columnBoundaryRect).data(e.repeat,e.keyFun);at.enter().append("rect").classed(p.cn.columnBoundaryRect,!0).attr("fill","none"),at.attr("width",function($e){return $e.columnWidth+2*c($e)}).attr("height",function($e){return $e.calcdata.height+2*c($e)+p.uplift}).attr("x",function($e){return-c($e)}).attr("y",function($e){return-c($e)}),X(null,Ae,Re)};function c(Q){return Math.ceil(Q.calcdata.maxLineWidth/2)}function m(Q,re){return"clip"+Q._fullLayout._uid+"_scrollAreaBottomClip_"+re.key}function d(Q,re){return"clip"+Q._fullLayout._uid+"_columnBoundaryClippath_"+re.calcdata.key+"_"+re.specIndex}function T(Q){return[].concat.apply([],Q.map(function(re){return re})).map(function(re){return re.__data__})}function l(Q,re,ue){function _e(it){var et=it.rowBlocks;return ee(et,et.length-1)+(et.length?V(et[et.length-1],1/0):1)}var we=Q.selectAll("."+p.cn.scrollbarKit).data(e.repeat,e.keyFun);we.enter().append("g").classed(p.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),we.each(function(it){var et=it.scrollbarState;et.totalHeight=_e(it),et.scrollableAreaHeight=it.groupHeight-U(it),et.currentlyVisibleHeight=Math.min(et.totalHeight,et.scrollableAreaHeight),et.ratio=et.currentlyVisibleHeight/et.totalHeight,et.barLength=Math.max(et.ratio*et.currentlyVisibleHeight,p.goldenRatio*p.scrollbarWidth),et.barWiggleRoom=et.currentlyVisibleHeight-et.barLength,et.wiggleRoom=Math.max(0,et.totalHeight-et.scrollableAreaHeight),et.topY=et.barWiggleRoom===0?0:it.scrollY/et.wiggleRoom*et.barWiggleRoom,et.bottomY=et.topY+et.barLength,et.dragMultiplier=et.wiggleRoom/et.barWiggleRoom}).attr("transform",function(it){var et=it.width+p.scrollbarWidth/2+p.scrollbarOffset;return i(et,U(it))});var Re=we.selectAll("."+p.cn.scrollbar).data(e.repeat,e.keyFun);Re.enter().append("g").classed(p.cn.scrollbar,!0);var ze=Re.selectAll("."+p.cn.scrollbarSlider).data(e.repeat,e.keyFun);ze.enter().append("g").classed(p.cn.scrollbarSlider,!0),ze.attr("transform",function(it){return i(0,it.scrollbarState.topY||0)});var Xe=ze.selectAll("."+p.cn.scrollbarGlyph).data(e.repeat,e.keyFun);Xe.enter().append("line").classed(p.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",p.scrollbarWidth).attr("stroke-linecap","round").attr("y1",p.scrollbarWidth/2),Xe.attr("y2",function(it){return it.scrollbarState.barLength-p.scrollbarWidth/2}).attr("stroke-opacity",function(it){return it.columnDragInProgress||!it.scrollbarState.barWiggleRoom||ue?0:.4}),Xe.transition().delay(0).duration(0),Xe.transition().delay(p.scrollbarHideDelay).duration(p.scrollbarHideDuration).attr("stroke-opacity",0);var tt=Re.selectAll("."+p.cn.scrollbarCaptureZone).data(e.repeat,e.keyFun);tt.enter().append("line").classed(p.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",p.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(it){var et=x.event.y,nt=this.getBoundingClientRect(),Ae=it.scrollbarState,me=et-nt.top,fe=x.scale.linear().domain([0,Ae.scrollableAreaHeight]).range([0,Ae.totalHeight]).clamp(!0);Ae.topY<=me&&me<=Ae.bottomY||J(re,Q,null,fe(me-Ae.barLength/2))(it)}).call(x.behavior.drag().origin(function(it){return x.event.stopPropagation(),it.scrollbarState.scrollbarScrollInProgress=!0,it}).on("drag",J(re,Q)).on("dragend",function(){})),tt.attr("y2",function(it){return it.scrollbarState.scrollableAreaHeight}),re._context.staticPlot&&(Xe.remove(),tt.remove())}function _(Q,re,ue,_e){var we=w(ue),Re=A(we);v(Re);var ze=M(Re);y(ze);var Xe=b(Re),tt=g(Xe);u(tt),f(tt,re,_e,Q),Z(Re)}function w(Q){var re=Q.selectAll("."+p.cn.columnCells).data(e.repeat,e.keyFun);return re.enter().append("g").classed(p.cn.columnCells,!0),re.exit().remove(),re}function A(Q){var re=Q.selectAll("."+p.cn.columnCell).data(s.splitToCells,function(ue){return ue.keyWithinBlock});return re.enter().append("g").classed(p.cn.columnCell,!0),re.exit().remove(),re}function M(Q){var re=Q.selectAll("."+p.cn.cellRect).data(e.repeat,function(ue){return ue.keyWithinBlock});return re.enter().append("rect").classed(p.cn.cellRect,!0),re}function g(Q){var re=Q.selectAll("."+p.cn.cellText).data(e.repeat,function(ue){return ue.keyWithinBlock});return re.enter().append("text").classed(p.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){x.event.stopPropagation()}),re}function b(Q){var re=Q.selectAll("."+p.cn.cellTextHolder).data(e.repeat,function(ue){return ue.keyWithinBlock});return re.enter().append("g").classed(p.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),re}function v(Q){Q.each(function(re,ue){var _e=re.calcdata.cells.font,we=re.column.specIndex,Re={size:F(_e.size,we,ue),color:F(_e.color,we,ue),family:F(_e.family,we,ue),weight:F(_e.weight,we,ue),style:F(_e.style,we,ue),variant:F(_e.variant,we,ue),textcase:F(_e.textcase,we,ue),lineposition:F(_e.lineposition,we,ue),shadow:F(_e.shadow,we,ue)};re.rowNumber=re.key,re.align=F(re.calcdata.cells.align,we,ue),re.cellBorderWidth=F(re.calcdata.cells.line.width,we,ue),re.font=Re})}function u(Q){Q.each(function(re){t.font(x.select(this),re.font)})}function y(Q){Q.attr("width",function(re){return re.column.columnWidth}).attr("stroke-width",function(re){return re.cellBorderWidth}).each(function(re){var ue=x.select(this);h.stroke(ue,F(re.calcdata.cells.line.color,re.column.specIndex,re.rowNumber)),h.fill(ue,F(re.calcdata.cells.fill.color,re.column.specIndex,re.rowNumber))})}function f(Q,re,ue,_e){Q.text(function(we){var Re=we.column.specIndex,ze=we.rowNumber,Xe=we.value,tt=typeof Xe=="string",it=tt&&Xe.match(/<br>/i),et=!tt||it;we.mayHaveMarkup=tt&&Xe.match(/[<&>]/);var nt=R(Xe);we.latex=nt;var Ae=nt?"":F(we.calcdata.cells.prefix,Re,ze)||"",me=nt?"":F(we.calcdata.cells.suffix,Re,ze)||"",fe=nt?null:F(we.calcdata.cells.format,Re,ze)||null,Be=Ae+(fe?E(fe)(we.value):we.value)+me,Qe;we.wrappingNeeded=!we.wrapped&&!et&&!nt&&(Qe=L(Be)),we.cellHeightMayIncrease=it||nt||we.mayHaveMarkup||(Qe===void 0?L(Be):Qe),we.needsConvertToTspans=we.mayHaveMarkup||we.wrappingNeeded||we.latex;var at;if(we.wrappingNeeded){var $e=p.wrapSplitCharacter===" "?Be.replace(/<a href=/ig,"<a_href="):Be,It=$e.split(p.wrapSplitCharacter),Pt=p.wrapSplitCharacter===" "?It.map(function(Vt){return Vt.replace(/<a_href=/ig,"<a href=")}):It;we.fragments=Pt.map(function(Vt){return{text:Vt,width:null}}),we.fragments.push({fragment:p.wrapSpacer,width:null}),at=Pt.join(p.lineBreaker)+p.lineBreaker+p.wrapSpacer}else delete we.fragments,at=Be;return at}).attr("dy",function(we){return we.needsConvertToTspans?0:"0.75em"}).each(function(we){var Re=this,ze=x.select(Re),Xe=we.wrappingNeeded?le:ce;we.needsConvertToTspans?r.convertToTspans(ze,_e,Xe(ue,Re,re,_e,we)):x.select(Re.parentNode).attr("transform",function(tt){return i(q(tt),p.cellPad)}).attr("text-anchor",function(tt){return{left:"start",center:"middle",right:"end"}[tt.align]})})}function R(Q){return typeof Q=="string"&&Q.match(p.latexCheck)}function L(Q){return Q.indexOf(p.wrapSplitCharacter)!==-1}function z(Q,re,ue){var _e=re.gdColumnsOriginalOrder;re.gdColumns.sort(function(we,Re){return ue[_e.indexOf(we)]-ue[_e.indexOf(Re)]}),re.columnorder=ue,Q.emit("plotly_restyle")}function F(Q,re,ue){if(S.isArrayOrTypedArray(Q)){var _e=Q[Math.min(re,Q.length-1)];return S.isArrayOrTypedArray(_e)?_e[Math.min(ue,_e.length-1)]:_e}else return Q}function N(Q,re,ue){Q.transition().ease(p.releaseTransitionEase).duration(p.releaseTransitionDuration).attr("transform",i(re.x,ue))}function B(Q){return Q.type==="cells"}function I(Q){return Q.type==="header"}function U(Q){var re=Q.rowBlocks.length?Q.rowBlocks[0].auxiliaryBlocks:[];return re.reduce(function(ue,_e){return ue+V(_e,1/0)},0)}function O(Q,re,ue){for(var _e=[],we=0,Re=0;Re<Q.length;Re++){for(var ze=Q[Re],Xe=ze.rows,tt=0,it=0;it<Xe.length;it++)tt+=Xe[it].rowHeight;ze.allRowsHeight=tt;var et=we+tt,nt=re,Ae=nt+ue;nt<et&&Ae>we&&_e.push(Re),we+=tt}return _e}function X(Q,re,ue){var _e=T(re)[0];if(_e!==void 0){var we=_e.rowBlocks,Re=_e.calcdata,ze=ee(we,we.length),Xe=_e.calcdata.groupHeight-U(_e),tt=Re.scrollY=Math.max(0,Math.min(ze-Xe,Re.scrollY)),it=O(we,tt,Xe);it.length===1&&(it[0]===we.length-1?it.unshift(it[0]-1):it.push(it[0]+1)),it[0]%2&&it.reverse(),re.each(function(et,nt){et.page=it[nt],et.scrollY=tt}),re.attr("transform",function(et){var nt=ee(et.rowBlocks,et.page)-et.scrollY;return i(0,nt)}),Q&&(se(Q,ue,re,it,_e.prevPages,_e,0),se(Q,ue,re,it,_e.prevPages,_e,1),l(ue,Q))}}function J(Q,re,ue,_e){return function(Re){var ze=Re.calcdata?Re.calcdata:Re,Xe=re.filter(function(nt){return ze.key===nt.key}),tt=ue||ze.scrollbarState.dragMultiplier,it=ze.scrollY;ze.scrollY=_e===void 0?ze.scrollY+tt*x.event.dy:_e;var et=Xe.selectAll("."+p.cn.yColumn).selectAll("."+p.cn.columnBlock).filter(B);return X(Q,et,Xe),ze.scrollY===it}}function se(Q,re,ue,_e,we,Re,ze){var Xe=_e[ze]!==we[ze];Xe&&(clearTimeout(Re.currentRepaint[ze]),Re.currentRepaint[ze]=setTimeout(function(){var tt=ue.filter(function(it,et){return et===ze&&_e[et]!==we[et]});_(Q,re,tt,ue),we[ze]=_e[ze]}))}function le(Q,re,ue,_e){return function(){var Re=x.select(re.parentNode);Re.each(function(ze){var Xe=ze.fragments;Re.selectAll("tspan.line").each(function(Be,Qe){Xe[Qe].width=this.getComputedTextLength()});var tt=Xe[Xe.length-1].width,it=Xe.slice(0,-1),et=[],nt,Ae,me=0,fe=ze.column.columnWidth-2*p.cellPad;for(ze.value="";it.length;)nt=it.shift(),Ae=nt.width+tt,me+Ae>fe&&(ze.value+=et.join(p.wrapSpacer)+p.lineBreaker,et=[],me=0),et.push(nt.text),me+=Ae;me&&(ze.value+=et.join(p.wrapSpacer)),ze.wrapped=!0}),Re.selectAll("tspan.line").remove(),f(Re.select("."+p.cn.cellText),ue,Q,_e),x.select(re.parentNode.parentNode).call(Z)}}function ce(Q,re,ue,_e,we){return function(){if(!we.settledY){var ze=x.select(re.parentNode),Xe=ie(we),tt=we.key-Xe.firstRowIndex,it=Xe.rows[tt].rowHeight,et=we.cellHeightMayIncrease?re.parentNode.getBoundingClientRect().height+2*p.cellPad:it,nt=Math.max(et,it),Ae=nt-Xe.rows[tt].rowHeight;Ae&&(Xe.rows[tt].rowHeight=nt,Q.selectAll("."+p.cn.columnCell).call(Z),X(null,Q.filter(B),0),l(ue,_e,!0)),ze.attr("transform",function(){var me=this,fe=me.parentNode,Be=fe.getBoundingClientRect(),Qe=x.select(me.parentNode).select("."+p.cn.cellRect).node().getBoundingClientRect(),at=me.transform.baseVal.consolidate(),$e=Qe.top-Be.top+(at?at.matrix.f:p.cellPad);return i(q(we,x.select(me.parentNode).select("."+p.cn.cellTextHolder).node().getBoundingClientRect().width),$e)}),we.settledY=!0}}}function q(Q,re){switch(Q.align){case"left":return p.cellPad;case"right":return Q.column.columnWidth-(re||0)-p.cellPad;case"center":return(Q.column.columnWidth-(re||0))/2;default:return p.cellPad}}function Z(Q){Q.attr("transform",function(re){var ue=re.rowBlocks[0].auxiliaryBlocks.reduce(function(ze,Xe){return ze+V(Xe,1/0)},0),_e=ie(re),we=V(_e,re.key),Re=we+ue;return i(0,Re)}).selectAll("."+p.cn.cellRect).attr("height",function(re){return j(ie(re),re.key).rowHeight})}function ee(Q,re){for(var ue=0,_e=re-1;_e>=0;_e--)ue+=oe(Q[_e]);return ue}function V(Q,re){for(var ue=0,_e=0;_e<Q.rows.length&&Q.rows[_e].rowIndex<re;_e++)ue+=Q.rows[_e].rowHeight;return ue}function oe(Q){var re=Q.allRowsHeight;if(re!==void 0)return re;for(var ue=0,_e=0;_e<Q.rows.length;_e++)ue+=Q.rows[_e].rowHeight;return Q.allRowsHeight=ue,ue}function ie(Q){return Q.rowBlocks[Q.page]}function j(Q,re){return Q.rows[re-Q.firstRowIndex]}}}),t4=De({"src/traces/table/base_plot.js"(Y){"use strict";var H=Lh().getModuleCalcData,p=kA(),x="table";Y.name=x,Y.plot=function(S){var E=H(S.calcdata,x)[0];E.length&&p(S,E)},Y.clean=function(S,E,e,t){var r=t._has&&t._has(x),o=E._has&&E._has(x);r&&!o&&t._paperdiv.selectAll(".table").remove()}}}),r4=De({"src/traces/table/index.js"(Y,H){"use strict";H.exports={attributes:MA(),supplyDefaults:$D(),calc:JD(),plot:kA(),moduleType:"trace",name:"table",basePlotModule:t4(),categories:["noOpacity"],meta:{}}}}),i4=De({"lib/table.js"(Y,H){"use strict";H.exports=r4()}}),a4=De({"src/traces/carpet/axis_attributes.js"(Y,H){"use strict";var p=qu(),x=Pf(),S=Ih(),E=of().descriptionWithDates,e=gc().overrideAll,t=Ch().dash,r=Xo().extendFlat;H.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:p({editType:"calc"}),offset:{valType:"number",dflt:10,editType:"calc"},editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autotypenumbers:S.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:r({},S.labelalias,{editType:"calc"}),tickfont:p({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:E("tick label")},tickformatstops:e(S.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:x.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:r({},t,{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:r({},t,{editType:"calc"}),minorgridcolor:{valType:"color",dflt:x.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"}}}),Rb=De({"src/traces/carpet/attributes.js"(Y,H){"use strict";var p=qu(),x=a4(),S=Pf(),E=p({editType:"calc"}),e=lf().zorder;E.family.dflt='"Open Sans", verdana, arial, sans-serif',E.size.dflt=12,E.color.dflt=S.defaultLine,H.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:x,baxis:x,font:E,color:{valType:"color",dflt:S.defaultLine,editType:"plot"},zorder:e}}}),n4=De({"src/traces/carpet/xy_defaults.js"(Y,H){"use strict";var p=ui().isArray1D;H.exports=function(S,E,e){var t=e("x"),r=t&&t.length,o=e("y"),i=o&&o.length;if(!r&&!i)return!1;if(E._cheater=!t,(!r||p(t))&&(!i||p(o))){var n=r?t.length:1/0;i&&(n=Math.min(n,o.length)),E.a&&E.a.length&&(n=Math.min(n,E.a.length)),E.b&&E.b.length&&(n=Math.min(n,E.b.length)),E._length=n}else E._length=null;return!0}}}),o4=De({"src/traces/carpet/axis_defaults.js"(Y,H){"use strict";var p=Rb(),x=vo().addOpacity,S=Mo(),E=ui(),e=U0(),t=qp(),r=Hp(),o=D_(),i=Dv(),n=$m();H.exports=function(h,c,m){var d=m.letter,T=m.font||{},l=p[d+"axis"];function _(O,X){return E.coerce(h,c,l,O,X)}function w(O,X){return E.coerce2(h,c,l,O,X)}m.name&&(c._name=m.name,c._id=m.name),_("autotypenumbers",m.autotypenumbersDflt);var A=_("type");if(A==="-"&&(m.data&&a(c,m.data),c.type==="-"?c.type="linear":A=h.type=c.type),_("smoothing"),_("cheatertype"),_("showticklabels"),_("labelprefix",d+" = "),_("labelsuffix"),_("showtickprefix"),_("showticksuffix"),_("separatethousands"),_("tickformat"),_("exponentformat"),_("minexponent"),_("showexponent"),_("categoryorder"),_("tickmode"),_("tickvals"),_("ticktext"),_("tick0"),_("dtick"),c.tickmode==="array"&&(_("arraytick0"),_("arraydtick")),_("labelpadding"),c._hovertitle=d,A==="date"){var M=S.getComponentMethod("calendars","handleDefaults");M(h,c,"calendar",m.calendar)}i(c,m.fullLayout),c.c2p=E.identity;var g=_("color",m.dfltColor),b=g===h.color?g:T.color,v=_("title.text");v&&(E.coerceFont(_,"title.font",T,{overrideDflt:{size:E.bigFont(T.size),color:b}}),_("title.offset")),_("tickangle");var u=_("autorange",!c.isValidRange(h.range));u&&_("rangemode"),_("range"),c.cleanRange(),_("fixedrange"),e(h,c,_,A),r(h,c,_,A,m),t(h,c,_,A,m),o(h,c,_,{data:m.data,dataAttr:d});var y=w("gridcolor",x(g,.3)),f=w("gridwidth"),R=w("griddash"),L=_("showgrid");L||(delete c.gridcolor,delete c.gridwidth,delete c.griddash);var z=w("startlinecolor",g),F=w("startlinewidth",f),N=_("startline",c.showgrid||!!z||!!F);N||(delete c.startlinecolor,delete c.startlinewidth);var B=w("endlinecolor",g),I=w("endlinewidth",f),U=_("endline",c.showgrid||!!B||!!I);return U||(delete c.endlinecolor,delete c.endlinewidth),L?(_("minorgridcount"),_("minorgridwidth",f),_("minorgriddash",R),_("minorgridcolor",x(y,.06)),c.minorgridcount||(delete c.minorgridwidth,delete c.minorgriddash,delete c.minorgridcolor)):(delete c.gridcolor,delete c.gridwidth,delete c.griddash),c.showticklabels==="none"&&(delete c.tickfont,delete c.tickangle,delete c.showexponent,delete c.exponentformat,delete c.minexponent,delete c.tickformat,delete c.showticksuffix,delete c.showtickprefix),c.showticksuffix||delete c.ticksuffix,c.showtickprefix||delete c.tickprefix,_("tickmode"),c};function a(s,h){if(s.type==="-"){var c=s._id,m=c.charAt(0),d=m+"calendar",T=s[d];s.type=n(h,T,{autotypenumbers:s.autotypenumbers})}}}}),s4=De({"src/traces/carpet/ab_defaults.js"(Y,H){"use strict";var p=o4(),x=Gl();H.exports=function(e,t,r,o,i){var n=o("a");n||(o("da"),o("a0"));var a=o("b");a||(o("db"),o("b0")),S(e,t,r,i)};function S(E,e,t,r){var o=["aaxis","baxis"];o.forEach(function(i){var n=i.charAt(0),a=E[i]||{},s=x.newContainer(e,i),h={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,tickfont:"x",id:n+"axis",letter:n,font:e.font,name:i,data:E[n],calendar:e.calendar,dfltColor:r,bgColor:t.paper_bgcolor,autotypenumbersDflt:t.autotypenumbers,fullLayout:t};p(a,s,h),s._categories=s._categories||[],!E[i]&&a.type!=="-"&&(E[i]={type:a.type})})}}}),l4=De({"src/traces/carpet/defaults.js"(Y,H){"use strict";var p=ui(),x=n4(),S=s4(),E=Rb(),e=Pf();H.exports=function(r,o,i,n){function a(c,m){return p.coerce(r,o,E,c,m)}o._clipPathId="clip"+o.uid+"carpet";var s=a("color",e.defaultLine);if(p.coerceFont(a,"font",n.font),a("carpet"),S(r,o,n,a,s),!o.a||!o.b){o.visible=!1;return}o.a.length<3&&(o.aaxis.smoothing=0),o.b.length<3&&(o.baxis.smoothing=0);var h=x(r,o,a);h||(o.visible=!1),o._cheater&&a("cheaterslope"),a("zorder")}}}),CA=De({"src/traces/carpet/map_1d_array.js"(Y,H){"use strict";var p=ui().isArrayOrTypedArray;H.exports=function(S,E,e){var t;for(p(S)?S.length>E.length&&(S=S.slice(0,E.length)):S=[],t=0;t<E.length;t++)S[t]=e(E[t]);return S}}}),LA=De({"src/traces/carpet/makepath.js"(Y,H){"use strict";H.exports=function(x,S,E){if(x.length===0)return"";var e,t=[],r=E?3:1;for(e=0;e<x.length;e+=r)t.push(x[e]+","+S[e]),E&&e<x.length-r&&(t.push("C"),t.push([x[e+1]+","+S[e+1],x[e+2]+","+S[e+2]+" "].join(" ")));return t.join(E?"":"L")}}}),u4=De({"src/traces/carpet/orient_text.js"(Y,H){"use strict";H.exports=function(x,S,E,e,t,r){var o=t[0]*x.dpdx(S),i=t[1]*x.dpdy(E),n=1,a=1;if(r){var s=Math.sqrt(t[0]*t[0]+t[1]*t[1]),h=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=(t[0]*r[0]+t[1]*r[1])/s/h;a=Math.max(0,c)}var m=Math.atan2(i,o)*180/Math.PI;return m<-90?(m+=180,n=-n):m>90&&(m-=180,n=-n),{angle:m,flip:n,p:x.c2p(e,S,E),offsetMultplier:a}}}}),c4=De({"src/traces/carpet/plot.js"(Y,H){"use strict";var p=za(),x=ys(),S=CA(),E=LA(),e=u4(),t=vu(),r=ui(),o=r.strRotate,i=r.strTranslate,n=rh();H.exports=function(_,w,A,M){var g=_._context.staticPlot,b=w.xaxis,v=w.yaxis,u=_._fullLayout,y=u._clips;r.makeTraceGroups(M,A,"trace").each(function(f){var R=p.select(this),L=f[0],z=L.trace,F=z.aaxis,N=z.baxis,B=r.ensureSingle(R,"g","minorlayer"),I=r.ensureSingle(R,"g","majorlayer"),U=r.ensureSingle(R,"g","boundarylayer"),O=r.ensureSingle(R,"g","labellayer");R.style("opacity",z.opacity),s(b,v,I,F,"a",F._gridlines,!0,g),s(b,v,I,N,"b",N._gridlines,!0,g),s(b,v,B,F,"a",F._minorgridlines,!0,g),s(b,v,B,N,"b",N._minorgridlines,!0,g),s(b,v,U,F,"a-boundary",F._boundarylines,g),s(b,v,U,N,"b-boundary",N._boundarylines,g);var X=h(_,b,v,z,L,O,F._labels,"a-label"),J=h(_,b,v,z,L,O,N._labels,"b-label");c(_,O,z,L,b,v,X,J),a(z,L,y,b,v)})};function a(l,_,w,A,M){var g,b,v,u,y=w.select("#"+l._clipPathId);y.size()||(y=w.append("clipPath").classed("carpetclip",!0));var f=r.ensureSingle(y,"path","carpetboundary"),R=_.clipsegments,L=[];for(u=0;u<R.length;u++)g=R[u],b=S([],g.x,A.c2p),v=S([],g.y,M.c2p),L.push(E(b,v,g.bicubic));var z="M"+L.join("L")+"Z";y.attr("id",l._clipPathId),f.attr("d",z)}function s(l,_,w,A,M,g,b){var v="const-"+M+"-lines",u=w.selectAll("."+v).data(g);u.enter().append("path").classed(v,!0).style("vector-effect",b?"none":"non-scaling-stroke"),u.each(function(y){var f=y,R=f.x,L=f.y,z=S([],R,l.c2p),F=S([],L,_.c2p),N="M"+E(z,F,f.smoothing),B=p.select(this);B.attr("d",N).style("stroke-width",f.width).style("stroke",f.color).style("stroke-dasharray",x.dashStyle(f.dash,f.width)).style("fill","none")}),u.exit().remove()}function h(l,_,w,A,M,g,b,v){var u=g.selectAll("text."+v).data(b);u.enter().append("text").classed(v,!0);var y=0,f={};return u.each(function(R,L){var z;if(R.axis.tickangle==="auto")z=e(A,_,w,R.xy,R.dxy);else{var F=(R.axis.tickangle+180)*Math.PI/180;z=e(A,_,w,R.xy,[Math.cos(F),Math.sin(F)])}L||(f={angle:z.angle,flip:z.flip});var N=(R.endAnchor?-1:1)*z.flip,B=p.select(this).attr({"text-anchor":N>0?"start":"end","data-notex":1}).call(x.font,R.font).text(R.text).call(t.convertToTspans,l),I=x.bBox(this);B.attr("transform",i(z.p[0],z.p[1])+o(z.angle)+i(R.axis.labelpadding*N,I.height*.3)),y=Math.max(y,I.width+R.axis.labelpadding)}),u.exit().remove(),f.maxExtent=y,f}function c(l,_,w,A,M,g,b,v){var u,y,f,R,L=r.aggNums(Math.min,null,w.a),z=r.aggNums(Math.max,null,w.a),F=r.aggNums(Math.min,null,w.b),N=r.aggNums(Math.max,null,w.b);u=.5*(L+z),y=F,f=w.ab2xy(u,y,!0),R=w.dxyda_rough(u,y),b.angle===void 0&&r.extendFlat(b,e(w,M,g,f,w.dxydb_rough(u,y))),T(l,_,w,A,f,R,w.aaxis,M,g,b,"a-title"),u=L,y=.5*(F+N),f=w.ab2xy(u,y,!0),R=w.dxydb_rough(u,y),v.angle===void 0&&r.extendFlat(v,e(w,M,g,f,w.dxyda_rough(u,y))),T(l,_,w,A,f,R,w.baxis,M,g,v,"b-title")}var m=n.LINE_SPACING,d=(1-n.MID_SHIFT)/m+1;function T(l,_,w,A,M,g,b,v,u,y,f){var R=[];b.title.text&&R.push(b.title.text);var L=_.selectAll("text."+f).data(R),z=y.maxExtent;L.enter().append("text").classed(f,!0),L.each(function(){var F=e(w,v,u,M,g);["start","both"].indexOf(b.showticklabels)===-1&&(z=0);var N=b.title.font.size;z+=N+b.title.offset;var B=y.angle+(y.flip<0?180:0),I=(B-F.angle+450)%360,U=I>90&&I<270,O=p.select(this);O.text(b.title.text).call(t.convertToTspans,l),U&&(z=(-t.lineCount(O)+d)*m*N-z),O.attr("transform",i(F.p[0],F.p[1])+o(F.angle)+i(0,z)).attr("text-anchor","middle").call(x.font,b.title.font)}),L.exit().remove()}}}),f4=De({"src/traces/carpet/cheater_basis.js"(Y,H){"use strict";var p=ui().isArrayOrTypedArray;H.exports=function(x,S,E){var e,t,r,o,i,n,a=[],s=p(x)?x.length:x,h=p(S)?S.length:S,c=p(x)?x:null,m=p(S)?S:null;c&&(r=(c.length-1)/(c[c.length-1]-c[0])/(s-1)),m&&(o=(m.length-1)/(m[m.length-1]-m[0])/(h-1));var d,T=1/0,l=-1/0;for(t=0;t<h;t++)for(a[t]=[],n=m?(m[t]-m[0])*o:t/(h-1),e=0;e<s;e++)i=c?(c[e]-c[0])*r:e/(s-1),d=i-n*E,T=Math.min(d,T),l=Math.max(d,l),a[t][e]=d;var _=1/(l-T),w=-T*_;for(t=0;t<h;t++)for(e=0;e<s;e++)a[t][e]=_*a[t][e]+w;return a}}}),h4=De({"src/traces/carpet/array_minmax.js"(Y,H){"use strict";var p=ui().isArrayOrTypedArray;H.exports=function(S){return x(S,0)};function x(S,E){if(!p(S)||E>=10)return null;for(var e=1/0,t=-1/0,r=S.length,o=0;o<r;o++){var i=S[o];if(p(i)){var n=x(i,E+1);n&&(e=Math.min(n[0],e),t=Math.max(n[1],t))}else e=Math.min(i,e),t=Math.max(i,t)}return[e,t]}}}),d4=De({"src/traces/carpet/calc_gridlines.js"(Y,H){"use strict";var p=us(),x=Xo().extendFlat;H.exports=function(E,e,t){var r,o,i,n,a,s,h,c,m,d,T,l,_,w,A=E["_"+e],M=E[e+"axis"],g=M._gridlines=[],b=M._minorgridlines=[],v=M._boundarylines=[],u=E["_"+t],y=E[t+"axis"];M.tickmode==="array"&&(M.tickvals=A.slice());var f=E._xctrl,R=E._yctrl,L=f[0].length,z=f.length,F=E._a.length,N=E._b.length;p.prepTicks(M),M.tickmode==="array"&&delete M.tickvals;var B=M.smoothing?3:1;function I(O){var X,J,se,le,ce,q,Z,ee,V,oe,ie,j,Q=[],re=[],ue={};if(e==="b")for(J=E.b2j(O),se=Math.floor(Math.max(0,Math.min(N-2,J))),le=J-se,ue.length=N,ue.crossLength=F,ue.xy=function(_e){return E.evalxy([],_e,J)},ue.dxy=function(_e,we){return E.dxydi([],_e,se,we,le)},X=0;X<F;X++)q=Math.min(F-2,X),Z=X-q,ee=E.evalxy([],X,J),y.smoothing&&X>0&&(V=E.dxydi([],X-1,se,0,le),Q.push(ce[0]+V[0]/3),re.push(ce[1]+V[1]/3),oe=E.dxydi([],X-1,se,1,le),Q.push(ee[0]-oe[0]/3),re.push(ee[1]-oe[1]/3)),Q.push(ee[0]),re.push(ee[1]),ce=ee;else for(X=E.a2i(O),q=Math.floor(Math.max(0,Math.min(F-2,X))),Z=X-q,ue.length=F,ue.crossLength=N,ue.xy=function(_e){return E.evalxy([],X,_e)},ue.dxy=function(_e,we){return E.dxydj([],q,_e,Z,we)},J=0;J<N;J++)se=Math.min(N-2,J),le=J-se,ee=E.evalxy([],X,J),y.smoothing&&J>0&&(ie=E.dxydj([],q,J-1,Z,0),Q.push(ce[0]+ie[0]/3),re.push(ce[1]+ie[1]/3),j=E.dxydj([],q,J-1,Z,1),Q.push(ee[0]-j[0]/3),re.push(ee[1]-j[1]/3)),Q.push(ee[0]),re.push(ee[1]),ce=ee;return ue.axisLetter=e,ue.axis=M,ue.crossAxis=y,ue.value=O,ue.constvar=t,ue.index=c,ue.x=Q,ue.y=re,ue.smoothing=y.smoothing,ue}function U(O){var X,J,se,le,ce,q=[],Z=[],ee={};if(ee.length=A.length,ee.crossLength=u.length,e==="b")for(se=Math.max(0,Math.min(N-2,O)),ce=Math.min(1,Math.max(0,O-se)),ee.xy=function(V){return E.evalxy([],V,O)},ee.dxy=function(V,oe){return E.dxydi([],V,se,oe,ce)},X=0;X<L;X++)q[X]=f[O*B][X],Z[X]=R[O*B][X];else for(J=Math.max(0,Math.min(F-2,O)),le=Math.min(1,Math.max(0,O-J)),ee.xy=function(V){return E.evalxy([],O,V)},ee.dxy=function(V,oe){return E.dxydj([],J,V,le,oe)},X=0;X<z;X++)q[X]=f[X][O*B],Z[X]=R[X][O*B];return ee.axisLetter=e,ee.axis=M,ee.crossAxis=y,ee.value=A[O],ee.constvar=t,ee.index=O,ee.x=q,ee.y=Z,ee.smoothing=y.smoothing,ee}if(M.tickmode==="array"){for(n=5e-15,a=[Math.floor((A.length-1-M.arraytick0)/M.arraydtick*(1+n)),Math.ceil(-M.arraytick0/M.arraydtick/(1+n))].sort(function(O,X){return O-X}),s=a[0]-1,h=a[1]+1,c=s;c<h;c++)o=M.arraytick0+M.arraydtick*c,!(o<0||o>A.length-1)&&g.push(x(U(o),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(c=s;c<h;c++)if(i=M.arraytick0+M.arraydtick*c,T=Math.min(i+M.arraydtick,A.length-1),!(i<0||i>A.length-1)&&!(T<0||T>A.length-1))for(l=A[i],_=A[T],r=0;r<M.minorgridcount;r++)w=T-i,!(w<=0)&&(d=l+(_-l)*(r+1)/(M.minorgridcount+1)*(M.arraydtick/w),!(d<A[0]||d>A[A.length-1])&&b.push(x(I(d),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash})));M.startline&&v.push(x(U(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&v.push(x(U(A.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(n=5e-15,a=[Math.floor((A[A.length-1]-M.tick0)/M.dtick*(1+n)),Math.ceil((A[0]-M.tick0)/M.dtick/(1+n))].sort(function(O,X){return O-X}),s=a[0],h=a[1],c=s;c<=h;c++)m=M.tick0+M.dtick*c,g.push(x(I(m),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(c=s-1;c<h+1;c++)for(m=M.tick0+M.dtick*c,r=0;r<M.minorgridcount;r++)d=m+M.dtick*(r+1)/(M.minorgridcount+1),!(d<A[0]||d>A[A.length-1])&&b.push(x(I(d),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash}));M.startline&&v.push(x(I(A[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&v.push(x(I(A[A.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}}}),v4=De({"src/traces/carpet/calc_labels.js"(Y,H){"use strict";var p=us(),x=Xo().extendFlat;H.exports=function(E,e){var t,r,o,i,n,a=e._labels=[],s=e._gridlines;for(t=0;t<s.length;t++)n=s[t],["start","both"].indexOf(e.showticklabels)!==-1&&(r=p.tickText(e,n.value),x(r,{prefix:o,suffix:i,endAnchor:!0,xy:n.xy(0),dxy:n.dxy(0,0),axis:n.axis,length:n.crossAxis.length,font:n.axis.tickfont,isFirst:t===0,isLast:t===s.length-1}),a.push(r)),["end","both"].indexOf(e.showticklabels)!==-1&&(r=p.tickText(e,n.value),x(r,{endAnchor:!1,xy:n.xy(n.crossLength-1),dxy:n.dxy(n.crossLength-2,1),axis:n.axis,length:n.crossAxis.length,font:n.axis.tickfont,isFirst:t===0,isLast:t===s.length-1}),a.push(r))}}}),p4=De({"src/traces/carpet/calc_clippath.js"(Y,H){"use strict";H.exports=function(x,S,E,e){var t,r,o,i=[],n=!!E.smoothing,a=!!e.smoothing,s=x[0].length-1,h=x.length-1;for(t=0,r=[],o=[];t<=s;t++)r[t]=x[0][t],o[t]=S[0][t];for(i.push({x:r,y:o,bicubic:n}),t=0,r=[],o=[];t<=h;t++)r[t]=x[t][s],o[t]=S[t][s];for(i.push({x:r,y:o,bicubic:a}),t=s,r=[],o=[];t>=0;t--)r[s-t]=x[h][t],o[s-t]=S[h][t];for(i.push({x:r,y:o,bicubic:n}),t=h,r=[],o=[];t>=0;t--)r[h-t]=x[t][0],o[h-t]=S[t][0];return i.push({x:r,y:o,bicubic:a}),i}}}),m4=De({"src/traces/carpet/smooth_fill_2d_array.js"(Y,H){"use strict";var p=ui();H.exports=function(S,E,e){var t,r,o,i=[],n=[],a=S[0].length,s=S.length;function h(J,se){var le=0,ce,q=0;return J>0&&(ce=S[se][J-1])!==void 0&&(q++,le+=ce),J<a-1&&(ce=S[se][J+1])!==void 0&&(q++,le+=ce),se>0&&(ce=S[se-1][J])!==void 0&&(q++,le+=ce),se<s-1&&(ce=S[se+1][J])!==void 0&&(q++,le+=ce),le/Math.max(1,q)}var c=0;for(t=0;t<a;t++)for(r=0;r<s;r++)S[r][t]===void 0&&(i.push(t),n.push(r),S[r][t]=h(t,r)),c=Math.max(c,Math.abs(S[r][t]));if(!i.length)return S;var m,d,T,l,_,w,A,M,g,b,v,u=1e-5,y=0,f=100,R=0,L=i.length;do{for(y=0,o=0;o<L;o++){t=i[o],r=n[o];var z=0,F=0,N,B,I,U,O,X;t===0?(O=Math.min(a-1,2),I=E[O],U=E[1],N=S[r][O],B=S[r][1],F+=B+(B-N)*(E[0]-U)/(U-I),z++):t===a-1&&(O=Math.max(0,a-3),I=E[O],U=E[a-2],N=S[r][O],B=S[r][a-2],F+=B+(B-N)*(E[a-1]-U)/(U-I),z++),(t===0||t===a-1)&&r>0&&r<s-1&&(m=e[r+1]-e[r],d=e[r]-e[r-1],F+=(d*S[r+1][t]+m*S[r-1][t])/(d+m),z++),r===0?(X=Math.min(s-1,2),I=e[X],U=e[1],N=S[X][t],B=S[1][t],F+=B+(B-N)*(e[0]-U)/(U-I),z++):r===s-1&&(X=Math.max(0,s-3),I=e[X],U=e[s-2],N=S[X][t],B=S[s-2][t],F+=B+(B-N)*(e[s-1]-U)/(U-I),z++),(r===0||r===s-1)&&t>0&&t<a-1&&(m=E[t+1]-E[t],d=E[t]-E[t-1],F+=(d*S[r][t+1]+m*S[r][t-1])/(d+m),z++),z?F/=z:(T=E[t+1]-E[t],l=E[t]-E[t-1],_=e[r+1]-e[r],w=e[r]-e[r-1],A=T*l*(T+l),M=_*w*(_+w),F=(A*(w*S[r+1][t]+_*S[r-1][t])+M*(l*S[r][t+1]+T*S[r][t-1]))/(M*(l+T)+A*(w+_))),g=F-S[r][t],b=g/c,y+=b*b,v=z?0:.85,S[r][t]+=g*(1+v)}y=Math.sqrt(y)}while(R++<f&&y>u);return p.log("Smoother converged to",y,"after",R,"iterations"),S}}}),g4=De({"src/traces/carpet/constants.js"(Y,H){"use strict";H.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),y4=De({"src/traces/carpet/catmull_rom.js"(Y,H){"use strict";var p=.5;H.exports=function(S,E,e,t){var r=S[0]-E[0],o=S[1]-E[1],i=e[0]-E[0],n=e[1]-E[1],a=Math.pow(r*r+o*o,p/2),s=Math.pow(i*i+n*n,p/2),h=(s*s*r-a*a*i)*t,c=(s*s*o-a*a*n)*t,m=s*(a+s)*3,d=a*(a+s)*3;return[[E[0]+(m&&h/m),E[1]+(m&&c/m)],[E[0]-(d&&h/d),E[1]-(d&&c/d)]]}}}),_4=De({"src/traces/carpet/compute_control_points.js"(Y,H){"use strict";var p=y4(),x=ui().ensureArray;function S(E,e,t){var r=-.5*t[0]+1.5*e[0],o=-.5*t[1]+1.5*e[1];return[(2*r+E[0])/3,(2*o+E[1])/3]}H.exports=function(e,t,r,o,i,n){var a,s,h,c,m,d,T,l,_,w,A=r[0].length,M=r.length,g=i?3*A-2:A,b=n?3*M-2:M;for(e=x(e,b),t=x(t,b),h=0;h<b;h++)e[h]=x(e[h],g),t[h]=x(t[h],g);for(s=0,c=0;s<M;s++,c+=n?3:1)for(m=e[c],d=t[c],T=r[s],l=o[s],a=0,h=0;a<A;a++,h+=i?3:1)m[h]=T[a],d[h]=l[a];if(i)for(s=0,c=0;s<M;s++,c+=n?3:1){for(a=1,h=3;a<A-1;a++,h+=3)_=p([r[s][a-1],o[s][a-1]],[r[s][a],o[s][a]],[r[s][a+1],o[s][a+1]],i),e[c][h-1]=_[0][0],t[c][h-1]=_[0][1],e[c][h+1]=_[1][0],t[c][h+1]=_[1][1];w=S([e[c][0],t[c][0]],[e[c][2],t[c][2]],[e[c][3],t[c][3]]),e[c][1]=w[0],t[c][1]=w[1],w=S([e[c][g-1],t[c][g-1]],[e[c][g-3],t[c][g-3]],[e[c][g-4],t[c][g-4]]),e[c][g-2]=w[0],t[c][g-2]=w[1]}if(n)for(h=0;h<g;h++){for(c=3;c<b-3;c+=3)_=p([e[c-3][h],t[c-3][h]],[e[c][h],t[c][h]],[e[c+3][h],t[c+3][h]],n),e[c-1][h]=_[0][0],t[c-1][h]=_[0][1],e[c+1][h]=_[1][0],t[c+1][h]=_[1][1];w=S([e[0][h],t[0][h]],[e[2][h],t[2][h]],[e[3][h],t[3][h]]),e[1][h]=w[0],t[1][h]=w[1],w=S([e[b-1][h],t[b-1][h]],[e[b-3][h],t[b-3][h]],[e[b-4][h],t[b-4][h]]),e[b-2][h]=w[0],t[b-2][h]=w[1]}if(i&&n)for(c=1;c<b;c+=(c+1)%3===0?2:1){for(h=3;h<g-3;h+=3)_=p([e[c][h-3],t[c][h-3]],[e[c][h],t[c][h]],[e[c][h+3],t[c][h+3]],i),e[c][h-1]=.5*(e[c][h-1]+_[0][0]),t[c][h-1]=.5*(t[c][h-1]+_[0][1]),e[c][h+1]=.5*(e[c][h+1]+_[1][0]),t[c][h+1]=.5*(t[c][h+1]+_[1][1]);w=S([e[c][0],t[c][0]],[e[c][2],t[c][2]],[e[c][3],t[c][3]]),e[c][1]=.5*(e[c][1]+w[0]),t[c][1]=.5*(t[c][1]+w[1]),w=S([e[c][g-1],t[c][g-1]],[e[c][g-3],t[c][g-3]],[e[c][g-4],t[c][g-4]]),e[c][g-2]=.5*(e[c][g-2]+w[0]),t[c][g-2]=.5*(t[c][g-2]+w[1])}return[e,t]}}}),x4=De({"src/traces/carpet/create_spline_evaluator.js"(Y,H){"use strict";H.exports=function(p,x,S,E,e){var t=x-2,r=S-2;return E&&e?function(o,i,n){o||(o=[]);var a,s,h,c,m,d,T=Math.max(0,Math.min(Math.floor(i),t)),l=Math.max(0,Math.min(Math.floor(n),r)),_=Math.max(0,Math.min(1,i-T)),w=Math.max(0,Math.min(1,n-l));T*=3,l*=3;var A=_*_,M=A*_,g=1-_,b=g*g,v=b*g,u=w*w,y=u*w,f=1-w,R=f*f,L=R*f;for(d=0;d<p.length;d++)m=p[d],a=v*m[l][T]+3*(b*_*m[l][T+1]+g*A*m[l][T+2])+M*m[l][T+3],s=v*m[l+1][T]+3*(b*_*m[l+1][T+1]+g*A*m[l+1][T+2])+M*m[l+1][T+3],h=v*m[l+2][T]+3*(b*_*m[l+2][T+1]+g*A*m[l+2][T+2])+M*m[l+2][T+3],c=v*m[l+3][T]+3*(b*_*m[l+3][T+1]+g*A*m[l+3][T+2])+M*m[l+3][T+3],o[d]=L*a+3*(R*w*s+f*u*h)+y*c;return o}:E?function(o,i,n){o||(o=[]);var a=Math.max(0,Math.min(Math.floor(i),t)),s=Math.max(0,Math.min(Math.floor(n),r)),h=Math.max(0,Math.min(1,i-a)),c=Math.max(0,Math.min(1,n-s)),m,d,T,l,_,w;a*=3;var A=h*h,M=A*h,g=1-h,b=g*g,v=b*g,u=1-c;for(_=0;_<p.length;_++)w=p[_],m=u*w[s][a]+c*w[s+1][a],d=u*w[s][a+1]+c*w[s+1][a+1],T=u*w[s][a+2]+c*w[s+1][a+1],l=u*w[s][a+3]+c*w[s+1][a+1],o[_]=v*m+3*(b*h*d+g*A*T)+M*l;return o}:e?function(o,i,n){o||(o=[]);var a=Math.max(0,Math.min(Math.floor(i),t)),s=Math.max(0,Math.min(Math.floor(n),r)),h=Math.max(0,Math.min(1,i-a)),c=Math.max(0,Math.min(1,n-s)),m,d,T,l,_,w;s*=3;var A=c*c,M=A*c,g=1-c,b=g*g,v=b*g,u=1-h;for(_=0;_<p.length;_++)w=p[_],m=u*w[s][a]+h*w[s][a+1],d=u*w[s+1][a]+h*w[s+1][a+1],T=u*w[s+2][a]+h*w[s+2][a+1],l=u*w[s+3][a]+h*w[s+3][a+1],o[_]=v*m+3*(b*c*d+g*A*T)+M*l;return o}:function(o,i,n){o||(o=[]);var a=Math.max(0,Math.min(Math.floor(i),t)),s=Math.max(0,Math.min(Math.floor(n),r)),h=Math.max(0,Math.min(1,i-a)),c=Math.max(0,Math.min(1,n-s)),m,d,T,l,_=1-c,w=1-h;for(T=0;T<p.length;T++)l=p[T],m=w*l[s][a]+h*l[s][a+1],d=w*l[s+1][a]+h*l[s+1][a+1],o[T]=_*m+c*d;return o}}}}),b4=De({"src/traces/carpet/create_i_derivative_evaluator.js"(Y,H){"use strict";H.exports=function(p,x,S){return x&&S?function(E,e,t,r,o){E||(E=[]);var i,n,a,s,h,c;e*=3,t*=3;var m=r*r,d=1-r,T=d*d,l=d*r*2,_=-3*T,w=3*(T-l),A=3*(l-m),M=3*m,g=o*o,b=g*o,v=1-o,u=v*v,y=u*v;for(c=0;c<p.length;c++)h=p[c],i=_*h[t][e]+w*h[t][e+1]+A*h[t][e+2]+M*h[t][e+3],n=_*h[t+1][e]+w*h[t+1][e+1]+A*h[t+1][e+2]+M*h[t+1][e+3],a=_*h[t+2][e]+w*h[t+2][e+1]+A*h[t+2][e+2]+M*h[t+2][e+3],s=_*h[t+3][e]+w*h[t+3][e+1]+A*h[t+3][e+2]+M*h[t+3][e+3],E[c]=y*i+3*(u*o*n+v*g*a)+b*s;return E}:x?function(E,e,t,r,o){E||(E=[]);var i,n,a,s;e*=3;var h=r*r,c=1-r,m=c*c,d=c*r*2,T=-3*m,l=3*(m-d),_=3*(d-h),w=3*h,A=1-o;for(a=0;a<p.length;a++)s=p[a],i=T*s[t][e]+l*s[t][e+1]+_*s[t][e+2]+w*s[t][e+3],n=T*s[t+1][e]+l*s[t+1][e+1]+_*s[t+1][e+2]+w*s[t+1][e+3],E[a]=A*i+o*n;return E}:S?function(E,e,t,r,o){E||(E=[]);var i,n,a,s,h,c;t*=3;var m=o*o,d=m*o,T=1-o,l=T*T,_=l*T;for(h=0;h<p.length;h++)c=p[h],i=c[t][e+1]-c[t][e],n=c[t+1][e+1]-c[t+1][e],a=c[t+2][e+1]-c[t+2][e],s=c[t+3][e+1]-c[t+3][e],E[h]=_*i+3*(l*o*n+T*m*a)+d*s;return E}:function(E,e,t,r,o){E||(E=[]);var i,n,a,s,h=1-o;for(a=0;a<p.length;a++)s=p[a],i=s[t][e+1]-s[t][e],n=s[t+1][e+1]-s[t+1][e],E[a]=h*i+o*n;return E}}}}),w4=De({"src/traces/carpet/create_j_derivative_evaluator.js"(Y,H){"use strict";H.exports=function(p,x,S){return x&&S?function(E,e,t,r,o){E||(E=[]);var i,n,a,s,h,c;e*=3,t*=3;var m=r*r,d=m*r,T=1-r,l=T*T,_=l*T,w=o*o,A=1-o,M=A*A,g=A*o*2,b=-3*M,v=3*(M-g),u=3*(g-w),y=3*w;for(c=0;c<p.length;c++)h=p[c],i=b*h[t][e]+v*h[t+1][e]+u*h[t+2][e]+y*h[t+3][e],n=b*h[t][e+1]+v*h[t+1][e+1]+u*h[t+2][e+1]+y*h[t+3][e+1],a=b*h[t][e+2]+v*h[t+1][e+2]+u*h[t+2][e+2]+y*h[t+3][e+2],s=b*h[t][e+3]+v*h[t+1][e+3]+u*h[t+2][e+3]+y*h[t+3][e+3],E[c]=_*i+3*(l*r*n+T*m*a)+d*s;return E}:x?function(E,e,t,r,o){E||(E=[]);var i,n,a,s,h,c;e*=3;var m=o*o,d=m*o,T=1-o,l=T*T,_=l*T;for(h=0;h<p.length;h++)c=p[h],i=c[t+1][e]-c[t][e],n=c[t+1][e+1]-c[t][e+1],a=c[t+1][e+2]-c[t][e+2],s=c[t+1][e+3]-c[t][e+3],E[h]=_*i+3*(l*o*n+T*m*a)+d*s;return E}:S?function(E,e,t,r,o){E||(E=[]);var i,n,a,s;t*=3;var h=1-r,c=o*o,m=1-o,d=m*m,T=m*o*2,l=-3*d,_=3*(d-T),w=3*(T-c),A=3*c;for(a=0;a<p.length;a++)s=p[a],i=l*s[t][e]+_*s[t+1][e]+w*s[t+2][e]+A*s[t+3][e],n=l*s[t][e+1]+_*s[t+1][e+1]+w*s[t+2][e+1]+A*s[t+3][e+1],E[a]=h*i+r*n;return E}:function(E,e,t,r,o){E||(E=[]);var i,n,a,s,h=1-r;for(a=0;a<p.length;a++)s=p[a],i=s[t+1][e]-s[t][e],n=s[t+1][e+1]-s[t][e+1],E[a]=h*i+r*n;return E}}}}),T4=De({"src/traces/carpet/set_convert.js"(Y,H){"use strict";var p=g4(),x=__().findBin,S=_4(),E=x4(),e=b4(),t=w4();H.exports=function(o){var i=o._a,n=o._b,a=i.length,s=n.length,h=o.aaxis,c=o.baxis,m=i[0],d=i[a-1],T=n[0],l=n[s-1],_=i[i.length-1]-i[0],w=n[n.length-1]-n[0],A=_*p.RELATIVE_CULL_TOLERANCE,M=w*p.RELATIVE_CULL_TOLERANCE;m-=A,d+=A,T-=M,l+=M,o.isVisible=function(g,b){return g>m&&g<d&&b>T&&b<l},o.isOccluded=function(g,b){return g<m||g>d||b<T||b>l},o.setScale=function(){var g=o._x,b=o._y,v=S(o._xctrl,o._yctrl,g,b,h.smoothing,c.smoothing);o._xctrl=v[0],o._yctrl=v[1],o.evalxy=E([o._xctrl,o._yctrl],a,s,h.smoothing,c.smoothing),o.dxydi=e([o._xctrl,o._yctrl],h.smoothing,c.smoothing),o.dxydj=t([o._xctrl,o._yctrl],h.smoothing,c.smoothing)},o.i2a=function(g){var b=Math.max(0,Math.floor(g[0]),a-2),v=g[0]-b;return(1-v)*i[b]+v*i[b+1]},o.j2b=function(g){var b=Math.max(0,Math.floor(g[1]),a-2),v=g[1]-b;return(1-v)*n[b]+v*n[b+1]},o.ij2ab=function(g){return[o.i2a(g[0]),o.j2b(g[1])]},o.a2i=function(g){var b=Math.max(0,Math.min(x(g,i),a-2)),v=i[b],u=i[b+1];return Math.max(0,Math.min(a-1,b+(g-v)/(u-v)))},o.b2j=function(g){var b=Math.max(0,Math.min(x(g,n),s-2)),v=n[b],u=n[b+1];return Math.max(0,Math.min(s-1,b+(g-v)/(u-v)))},o.ab2ij=function(g){return[o.a2i(g[0]),o.b2j(g[1])]},o.i2c=function(g,b){return o.evalxy([],g,b)},o.ab2xy=function(g,b,v){if(!v&&(g<i[0]||g>i[a-1]|b<n[0]||b>n[s-1]))return[!1,!1];var u=o.a2i(g),y=o.b2j(b),f=o.evalxy([],u,y);if(v){var R=0,L=0,z=[],F,N,B,I;g<i[0]?(F=0,N=0,R=(g-i[0])/(i[1]-i[0])):g>i[a-1]?(F=a-2,N=1,R=(g-i[a-1])/(i[a-1]-i[a-2])):(F=Math.max(0,Math.min(a-2,Math.floor(u))),N=u-F),b<n[0]?(B=0,I=0,L=(b-n[0])/(n[1]-n[0])):b>n[s-1]?(B=s-2,I=1,L=(b-n[s-1])/(n[s-1]-n[s-2])):(B=Math.max(0,Math.min(s-2,Math.floor(y))),I=y-B),R&&(o.dxydi(z,F,B,N,I),f[0]+=z[0]*R,f[1]+=z[1]*R),L&&(o.dxydj(z,F,B,N,I),f[0]+=z[0]*L,f[1]+=z[1]*L)}return f},o.c2p=function(g,b,v){return[b.c2p(g[0]),v.c2p(g[1])]},o.p2x=function(g,b,v){return[b.p2c(g[0]),v.p2c(g[1])]},o.dadi=function(g){var b=Math.max(0,Math.min(i.length-2,g));return i[b+1]-i[b]},o.dbdj=function(g){var b=Math.max(0,Math.min(n.length-2,g));return n[b+1]-n[b]},o.dxyda=function(g,b,v,u){var y=o.dxydi(null,g,b,v,u),f=o.dadi(g,v);return[y[0]/f,y[1]/f]},o.dxydb=function(g,b,v,u){var y=o.dxydj(null,g,b,v,u),f=o.dbdj(b,u);return[y[0]/f,y[1]/f]},o.dxyda_rough=function(g,b,v){var u=_*(v||.1),y=o.ab2xy(g+u,b,!0),f=o.ab2xy(g-u,b,!0);return[(y[0]-f[0])*.5/u,(y[1]-f[1])*.5/u]},o.dxydb_rough=function(g,b,v){var u=w*(v||.1),y=o.ab2xy(g,b+u,!0),f=o.ab2xy(g,b-u,!0);return[(y[0]-f[0])*.5/u,(y[1]-f[1])*.5/u]},o.dpdx=function(g){return g._m},o.dpdy=function(g){return g._m}}}}),A4=De({"src/traces/carpet/calc.js"(Y,H){"use strict";var p=us(),x=ui().isArray1D,S=f4(),E=h4(),e=d4(),t=v4(),r=p4(),o=$_(),i=m4(),n=K_(),a=T4();H.exports=function(h,c){var m=p.getFromId(h,c.xaxis),d=p.getFromId(h,c.yaxis),T=c.aaxis,l=c.baxis,_=c.x,w=c.y,A=[];_&&x(_)&&A.push("x"),w&&x(w)&&A.push("y"),A.length&&n(c,T,l,"a","b",A);var M=c._a=c._a||c.a,g=c._b=c._b||c.b;_=c._x||c.x,w=c._y||c.y;var b={};if(c._cheater){var v=T.cheatertype==="index"?M.length:M,u=l.cheatertype==="index"?g.length:g;_=S(v,u,c.cheaterslope)}c._x=_=o(_),c._y=w=o(w),i(_,M,g),i(w,M,g),a(c),c.setScale();var y=E(_),f=E(w),R=.5*(y[1]-y[0]),L=.5*(y[1]+y[0]),z=.5*(f[1]-f[0]),F=.5*(f[1]+f[0]),N=1.3;return y=[L-R*N,L+R*N],f=[F-z*N,F+z*N],c._extremes[m._id]=p.findExtremes(m,y,{padded:!0}),c._extremes[d._id]=p.findExtremes(d,f,{padded:!0}),e(c,"a","b"),e(c,"b","a"),t(c,T),t(c,l),b.clipsegments=r(c._xctrl,c._yctrl,T,l),b.x=_,b.y=w,b.a=M,b.b=g,[b]}}}),S4=De({"src/traces/carpet/index.js"(Y,H){"use strict";H.exports={attributes:Rb(),supplyDefaults:l4(),plot:c4(),calc:A4(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Gf(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),M4=De({"lib/carpet.js"(Y,H){"use strict";H.exports=S4()}}),IA=De({"src/traces/scattercarpet/attributes.js"(Y,H){"use strict";var p=vv(),x=lf(),S=Yl(),{hovertemplateAttrs:E,texttemplateAttrs:e,templatefallbackAttrs:t}=ou(),r=zu(),o=Xo().extendFlat,i=x.marker,n=x.line,a=i.line;H.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:o({},x.mode,{dflt:"markers"}),text:o({},x.text,{}),texttemplate:e({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:t({editType:"plot"}),hovertext:o({},x.hovertext,{}),line:{color:n.color,width:n.width,dash:n.dash,backoff:n.backoff,shape:o({},n.shape,{values:["linear","spline"]}),smoothing:n.smoothing,editType:"calc"},connectgaps:x.connectgaps,fill:o({},x.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:p(),marker:o({symbol:i.symbol,opacity:i.opacity,maxdisplayed:i.maxdisplayed,angle:i.angle,angleref:i.angleref,standoff:i.standoff,size:i.size,sizeref:i.sizeref,sizemin:i.sizemin,sizemode:i.sizemode,line:o({width:a.width,dash:a.dash,editType:"calc"},r("marker.line")),gradient:i.gradient,editType:"calc"},r("marker")),textfont:x.textfont,textposition:x.textposition,selected:x.selected,unselected:x.unselected,hoverinfo:o({},S.hoverinfo,{flags:["a","b","text","name"]}),hoveron:x.hoveron,hovertemplate:E(),hovertemplatefallback:t(),zorder:x.zorder}}}),E4=De({"src/traces/scattercarpet/defaults.js"(Y,H){"use strict";var p=ui(),x=zv(),S=Hu(),E=Od(),e=Wd(),t=eg(),r=Xd(),o=mv(),i=IA();H.exports=function(a,s,h,c){function m(M,g){return p.coerce(a,s,i,M,g)}m("carpet"),s.xaxis="x",s.yaxis="y";var d=m("a"),T=m("b"),l=Math.min(d.length,T.length);if(!l){s.visible=!1;return}s._length=l,m("text"),m("texttemplate"),m("texttemplatefallback"),m("hovertext");var _=l<x.PTS_LINESONLY?"lines+markers":"lines";m("mode",_),S.hasMarkers(s)&&E(a,s,h,c,m,{gradient:!0}),S.hasLines(s)&&(e(a,s,h,c,m,{backoff:!0}),t(a,s,m),m("connectgaps")),S.hasText(s)&&r(a,s,c,m);var w=[];(S.hasMarkers(s)||S.hasText(s))&&(m("marker.maxdisplayed"),w.push("points")),m("fill"),s.fill!=="none"&&(o(a,s,h,m),S.hasLines(s)||t(a,s,m)),(s.fill==="tonext"||s.fill==="toself")&&w.push("fills");var A=m("hoveron",w.join("+")||"points");A!=="fills"&&(m("hovertemplate"),m("hovertemplatefallback")),m("zorder"),p.coerceSelectionMarkerOpacity(s,m)}}}),k4=De({"src/traces/scattercarpet/format_labels.js"(Y,H){"use strict";H.exports=function(x,S){var E={},e=S._carpet,t=e.ab2ij([x.a,x.b]),r=Math.floor(t[0]),o=t[0]-r,i=Math.floor(t[1]),n=t[1]-i,a=e.evalxy([],r,i,o,n);return E.yLabel=a[1].toFixed(3),E}}}),Db=De({"src/traces/carpet/lookup_carpetid.js"(Y,H){"use strict";H.exports=function(p,x){for(var S=p._fullData.length,E,e=0;e<S;e++){var t=p._fullData[e];if(t.index!==x.index&&t.type==="carpet"&&(E||(E=t),t.carpet===x.carpet))return t}return E}}}),C4=De({"src/traces/scattercarpet/calc.js"(Y,H){"use strict";var p=vn(),x=Yd(),S=Fv(),E=Zd(),e=Kd().calcMarkerSize,t=Db();H.exports=function(o,i){var n=i._carpetTrace=t(o,i);if(!(!n||!n.visible||n.visible==="legendonly")){var a;i.xaxis=n.xaxis,i.yaxis=n.yaxis;var s=i._length,h=new Array(s),c,m,d=!1;for(a=0;a<s;a++)if(c=i.a[a],m=i.b[a],p(c)&&p(m)){var T=n.ab2xy(+c,+m,!0),l=n.isVisible(+c,+m);l||(d=!0),h[a]={x:T[0],y:T[1],a:c,b:m,vis:l}}else h[a]={x:!1,y:!1};return i._needsCull=d,h[0].carpet=n,h[0].trace=i,e(i,s),x(o,i),S(h,i),E(h,i),h}}}}),L4=De({"src/traces/scattercarpet/plot.js"(Y,H){"use strict";var p=tg(),x=us(),S=ys();H.exports=function(e,t,r,o){var i,n,a,s=r[0][0].carpet,h=x.getFromId(e,s.xaxis||"x"),c=x.getFromId(e,s.yaxis||"y"),m={xaxis:h,yaxis:c,plot:t.plot};for(i=0;i<r.length;i++)n=r[i][0].trace,n._xA=h,n._yA=c;for(p(e,m,r,o),i=0;i<r.length;i++)n=r[i][0].trace,a=o.selectAll("g.trace"+n.uid+" .js-line"),S.setClipUrl(a,r[i][0].carpet._clipPathId,e)}}}),I4=De({"src/traces/scattercarpet/hover.js"(Y,H){"use strict";var p=ig(),x=ui().fillText;H.exports=function(E,e,t,r){var o=p(E,e,t,r);if(!o||o[0].index===!1)return;var i=o[0];if(i.index===void 0){var n=1-i.y0/E.ya._length,a=E.xa._length,s=a*n/2,h=a-s;return i.x0=Math.max(Math.min(i.x0,h),s),i.x1=Math.max(Math.min(i.x1,h),s),o}var c=i.cd[i.index];i.a=c.a,i.b=c.b,i.xLabelVal=void 0,i.yLabelVal=void 0;var m=i.trace,d=m._carpet,T=m._module.formatLabels(c,m);i.yLabel=T.yLabel,delete i.text;var l=[];function _(M,g){var b;M.labelprefix&&M.labelprefix.length>0?b=M.labelprefix.replace(/ = $/,""):b=M._hovertitle,l.push(b+": "+g.toFixed(3)+M.labelsuffix)}if(!m.hovertemplate){var w=c.hi||m.hoverinfo,A=w.split("+");A.indexOf("all")!==-1&&(A=["a","b","text"]),A.indexOf("a")!==-1&&_(d.aaxis,c.a),A.indexOf("b")!==-1&&_(d.baxis,c.b),l.push("y: "+i.yLabel),A.indexOf("text")!==-1&&x(c,m,l),i.extraText=l.join("<br>")}return o}}}),P4=De({"src/traces/scattercarpet/event_data.js"(Y,H){"use strict";H.exports=function(x,S,E,e,t){var r=e[t];return x.a=r.a,x.b=r.b,x.y=r.y,x}}}),R4=De({"src/traces/scattercarpet/index.js"(Y,H){"use strict";H.exports={attributes:IA(),supplyDefaults:E4(),colorbar:qh(),formatLabels:k4(),calc:C4(),plot:L4(),style:Sd().style,styleOnSelect:Sd().styleOnSelect,hoverPoints:I4(),selectPoints:ag(),eventData:P4(),moduleType:"trace",name:"scattercarpet",basePlotModule:Gf(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),D4=De({"lib/scattercarpet.js"(Y,H){"use strict";H.exports=R4()}}),PA=De({"src/traces/contourcarpet/attributes.js"(Y,H){"use strict";var p=sg(),x=Sy(),S=zu(),E=Xo().extendFlat,e=x.contours;H.exports=E({carpet:{valType:"string",editType:"calc"},z:p.z,a:p.x,a0:p.x0,da:p.dx,b:p.y,b0:p.y0,db:p.dy,text:p.text,hovertext:p.hovertext,transpose:p.transpose,atype:p.xtype,btype:p.ytype,fillcolor:x.fillcolor,autocontour:x.autocontour,ncontours:x.ncontours,contours:{type:e.type,start:e.start,end:e.end,size:e.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:e.showlines,showlabels:e.showlabels,labelfont:e.labelfont,labelformat:e.labelformat,operation:e.operation,value:e.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:x.line.color,width:x.line.width,dash:x.line.dash,smoothing:x.line.smoothing,editType:"plot"},zorder:x.zorder},S("",{cLetter:"z",autoColorDflt:!1}))}}),RA=De({"src/traces/contourcarpet/defaults.js"(Y,H){"use strict";var p=ui(),x=Z_(),S=PA(),E=a3(),e=ux(),t=cx();H.exports=function(o,i,n,a){function s(d,T){return p.coerce(o,i,S,d,T)}function h(d){return p.coerce2(o,i,S,d)}if(s("carpet"),o.a&&o.b){var c=x(o,i,s,a,"a","b");if(!c){i.visible=!1;return}s("text");var m=s("contours.type")==="constraint";m?E(o,i,s,a,n,{hasHover:!1}):(e(o,i,s,h),t(o,i,s,a,{hasHover:!1}))}else i._defaultColor=n,i._length=null;s("zorder")}}}),z4=De({"src/traces/contourcarpet/calc.js"(Y,H){"use strict";var p=Jh(),x=ui(),S=K_(),E=$_(),e=J_(),t=Q_(),r=V2(),o=RA(),i=Db(),n=Z2();H.exports=function(h,c){var m=c._carpetTrace=i(h,c);if(!(!m||!m.visible||m.visible==="legendonly")){if(!c.a||!c.b){var d=h.data[m.index],T=h.data[c.index];T.a||(T.a=d.a),T.b||(T.b=d.b),o(T,c,c._defaultColor,h._fullLayout)}var l=a(h,c);return n(c,c._z),l}};function a(s,h){var c=h._carpetTrace,m=c.aaxis,d=c.baxis,T,l,_,w,A,M,g;m._minDtick=0,d._minDtick=0,x.isArray1D(h.z)&&S(h,m,d,"a","b",["z"]),T=h._a=h._a||h.a,w=h._b=h._b||h.b,T=T?m.makeCalcdata(h,"_a"):[],w=w?d.makeCalcdata(h,"_b"):[],l=h.a0||0,_=h.da||1,A=h.b0||0,M=h.db||1,g=h._z=E(h._z||h.z,h.transpose),h._emptypoints=t(g),e(g,h._emptypoints);var b=x.maxRowLength(g),v=h.xtype==="scaled"?"":T,u=r(h,v,l,_,b,m),y=h.ytype==="scaled"?"":w,f=r(h,y,A,M,g.length,d),R={a:u,b:f,z:g};return h.contours.type==="levels"&&h.contours.coloring!=="none"&&p(s,h,{vals:g,containerStr:"",cLetter:"z"}),[R]}}}),F4=De({"src/traces/carpet/axis_aligned_line.js"(Y,H){"use strict";var p=ui().isArrayOrTypedArray;H.exports=function(x,S,E,e){var t,r,o,i,n,a,s,h,c,m,d,T,l,_=p(E)?"a":"b",w=_==="a"?x.aaxis:x.baxis,A=w.smoothing,M=_==="a"?x.a2i:x.b2j,g=_==="a"?E:e,b=_==="a"?e:E,v=_==="a"?S.a.length:S.b.length,u=_==="a"?S.b.length:S.a.length,y=Math.floor(_==="a"?x.b2j(b):x.a2i(b)),f=_==="a"?function(se){return x.evalxy([],se,y)}:function(se){return x.evalxy([],y,se)};A&&(o=Math.max(0,Math.min(u-2,y)),i=y-o,r=_==="a"?function(se,le){return x.dxydi([],se,o,le,i)}:function(se,le){return x.dxydj([],o,se,i,le)});var R=M(g[0]),L=M(g[1]),z=R<L?1:-1,F=(L-R)*1e-8,N=z>0?Math.floor:Math.ceil,B=z>0?Math.ceil:Math.floor,I=z>0?Math.min:Math.max,U=z>0?Math.max:Math.min,O=N(R+F),X=B(L-F);s=f(R);var J=[[s]];for(t=O;t*z<X*z;t+=z)n=[],d=U(R,t),T=I(L,t+z),l=T-d,a=Math.max(0,Math.min(v-2,Math.floor(.5*(d+T)))),h=f(T),A&&(c=r(a,d-a),m=r(a,T-a),n.push([s[0]+c[0]/3*l,s[1]+c[1]/3*l]),n.push([h[0]-m[0]/3*l,h[1]-m[1]/3*l])),n.push(h),J.push(n),s=h;return J}}}),B4=De({"src/traces/contourcarpet/plot.js"(Y,H){"use strict";var p=za(),x=CA(),S=LA(),E=ys(),e=ui(),t=$2(),r=J2(),o=fx(),i=Ey(),n=e3(),a=Q2(),s=t3(),h=Db(),c=F4();H.exports=function(v,u,y,f){var R=u.xaxis,L=u.yaxis;e.makeTraceGroups(f,y,"contour").each(function(z){var F=p.select(this),N=z[0],B=N.trace,I=B._carpetTrace=h(v,B),U=v.calcdata[I.index][0];if(!I.visible||I.visible==="legendonly")return;var O=N.a,X=N.b,J=B.contours,se=a(J,u,N),le=J.type==="constraint",ce=J._operation,q=le?ce==="="?"lines":"fill":J.coloring;function Z(Re){var ze=I.ab2xy(Re[0],Re[1],!0);return[R.c2p(ze[0]),L.c2p(ze[1])]}var ee=[[O[0],X[X.length-1]],[O[O.length-1],X[X.length-1]],[O[O.length-1],X[0]],[O[0],X[0]]];t(se);var V=(O[O.length-1]-O[0])*1e-8,oe=(X[X.length-1]-X[0])*1e-8;r(se,V,oe);var ie=se;J.type==="constraint"&&(ie=n(se,ce)),m(se,Z);var j,Q,re,ue,_e=[];for(ue=U.clipsegments.length-1;ue>=0;ue--)j=U.clipsegments[ue],Q=x([],j.x,R.c2p),re=x([],j.y,L.c2p),Q.reverse(),re.reverse(),_e.push(S(Q,re,j.bicubic));var we="M"+_e.join("L")+"Z";A(F,U.clipsegments,R,L,le,q),M(B,F,R,L,ie,ee,Z,I,U,q,we),d(F,se,v,N,J,u,I),E.setClipUrl(F,I._clipPathId,v)})};function m(b,v){var u,y,f,R,L,z,F,N,B;for(u=0;u<b.length;u++){for(R=b[u],L=R.pedgepaths=[],z=R.ppaths=[],y=0;y<R.edgepaths.length;y++){for(B=R.edgepaths[y],F=[],f=0;f<B.length;f++)F[f]=v(B[f]);L.push(F)}for(y=0;y<R.paths.length;y++){for(B=R.paths[y],N=[],f=0;f<B.length;f++)N[f]=v(B[f]);z.push(N)}}}function d(b,v,u,y,f,R,L){var z=u._context.staticPlot,F=e.ensureSingle(b,"g","contourlines"),N=f.showlines!==!1,B=f.showlabels,I=N&&B,U=o.createLines(F,N||B,v,z),O=o.createLineClip(F,I,u,y.trace.uid),X=b.selectAll("g.contourlabels").data(B?[0]:[]);if(X.exit().remove(),X.enter().append("g").classed("contourlabels",!0),B){var J=R.xaxis,se=R.yaxis,le=J._length,ce=se._length,q=[[[0,0],[le,0],[le,ce],[0,ce]]],Z=[];e.clearLocationCache();var ee=o.labelFormatter(u,y),V=E.tester.append("text").attr("data-notex",1).call(E.font,f.labelfont),oe={left:0,right:le,center:le/2,top:0,bottom:ce,middle:ce/2},ie=Math.sqrt(le*le+ce*ce),j=i.LABELDISTANCE*ie/Math.max(1,v.length/i.LABELINCREASE);U.each(function(Q){var re=o.calcTextOpts(Q.level,ee,V,u);p.select(this).selectAll("path").each(function(ue){var _e=this,we=e.getVisibleSegment(_e,oe,re.height/2);if(we&&(T(_e,ue,Q,we,L,re.height),!(we.len<(re.width+re.height)*i.LABELMIN)))for(var Re=Math.min(Math.ceil(we.len/j),i.LABELMAX),ze=0;ze<Re;ze++){var Xe=o.findBestTextLocation(_e,we,re,Z,oe);if(!Xe)break;o.addLabelData(Xe,re,Z,q)}})}),V.remove(),o.drawLabels(X,Z,u,O,I?q:null)}B&&!N&&U.remove()}function T(b,v,u,y,f,R){for(var L,z=0;z<u.pedgepaths.length;z++)v===u.pedgepaths[z]&&(L=u.edgepaths[z]);if(!L)return;var F=f.a[0],N=f.a[f.a.length-1],B=f.b[0],I=f.b[f.b.length-1];function U(le,ce){var q=0,Z,ee=.1;return(Math.abs(le[0]-F)<ee||Math.abs(le[0]-N)<ee)&&(Z=_(f.dxydb_rough(le[0],le[1],ee)),q=Math.max(q,R*w(ce,Z)/2)),(Math.abs(le[1]-B)<ee||Math.abs(le[1]-I)<ee)&&(Z=_(f.dxyda_rough(le[0],le[1],ee)),q=Math.max(q,R*w(ce,Z)/2)),q}var O=l(b,0,1),X=l(b,y.total,y.total-1),J=U(L[0],O),se=y.total-U(L[L.length-1],X);y.min<J&&(y.min=J),y.max>se&&(y.max=se),y.len=y.max-y.min}function l(b,v,u){var y=b.getPointAtLength(v),f=b.getPointAtLength(u),R=f.x-y.x,L=f.y-y.y,z=Math.sqrt(R*R+L*L);return[R/z,L/z]}function _(b){var v=Math.sqrt(b[0]*b[0]+b[1]*b[1]);return[b[0]/v,b[1]/v]}function w(b,v){var u=Math.abs(b[0]*v[0]+b[1]*v[1]),y=Math.sqrt(1-u*u);return y/u}function A(b,v,u,y,f,R){var L,z,F,N,B=e.ensureSingle(b,"g","contourbg"),I=B.selectAll("path").data(R==="fill"&&!f?[0]:[]);I.enter().append("path"),I.exit().remove();var U=[];for(N=0;N<v.length;N++)L=v[N],z=x([],L.x,u.c2p),F=x([],L.y,y.c2p),U.push(S(z,F,L.bicubic));I.attr("d","M"+U.join("L")+"Z").style("stroke","none")}function M(b,v,u,y,f,R,L,z,F,N,B){var I=N==="fill";I&&s(f,b.contours);var U=e.ensureSingle(v,"g","contourfill"),O=U.selectAll("path").data(I?f:[]);O.enter().append("path"),O.exit().remove(),O.each(function(X){var J=(X.prefixBoundary?B:"")+g(b,X,R,L,z,F,u,y);J?p.select(this).attr("d",J).style("stroke","none"):p.select(this).remove()})}function g(b,v,u,y,f,R,L,z){var F,N="",B=v.edgepaths.map(function(re,ue){return ue}),I=!0,U,O,X,J,se,le,ce=Math.abs(u[0][0]-u[2][0])*1e-4,q=Math.abs(u[0][1]-u[2][1])*1e-4;function Z(re){return Math.abs(re[1]-u[0][1])<q}function ee(re){return Math.abs(re[1]-u[2][1])<q}function V(re){return Math.abs(re[0]-u[0][0])<ce}function oe(re){return Math.abs(re[0]-u[2][0])<ce}function ie(re,ue){var _e,we,Re,ze,Xe="";for(Z(re)&&!oe(re)||ee(re)&&!V(re)?(ze=f.aaxis,Re=c(f,R,[re[0],ue[0]],.5*(re[1]+ue[1]))):(ze=f.baxis,Re=c(f,R,.5*(re[0]+ue[0]),[re[1],ue[1]])),_e=1;_e<Re.length;_e++)for(Xe+=ze.smoothing?"C":"L",we=0;we<Re[_e].length;we++){var tt=Re[_e][we];Xe+=[L.c2p(tt[0]),z.c2p(tt[1])]+" "}return Xe}for(F=0,U=null;B.length;){var j=v.edgepaths[F][0];for(U&&(N+=ie(U,j)),le=E.smoothopen(v.edgepaths[F].map(y),v.smoothing),N+=I?le:le.replace(/^M/,"L"),B.splice(B.indexOf(F),1),U=v.edgepaths[F][v.edgepaths[F].length-1],J=-1,X=0;X<4;X++){if(!U){e.log("Missing end?",F,v);break}for(Z(U)&&!oe(U)?O=u[1]:V(U)?O=u[0]:ee(U)?O=u[3]:oe(U)&&(O=u[2]),se=0;se<v.edgepaths.length;se++){var Q=v.edgepaths[se][0];Math.abs(U[0]-O[0])<ce?Math.abs(U[0]-Q[0])<ce&&(Q[1]-U[1])*(O[1]-Q[1])>=0&&(O=Q,J=se):Math.abs(U[1]-O[1])<q?Math.abs(U[1]-Q[1])<q&&(Q[0]-U[0])*(O[0]-Q[0])>=0&&(O=Q,J=se):e.log("endpt to newendpt is not vert. or horz.",U,O,Q)}if(J>=0)break;N+=ie(U,O),U=O}if(J===v.edgepaths.length){e.log("unclosed perimeter path");break}F=J,I=B.indexOf(F)===-1,I&&(F=B[0],N+=ie(U,O)+"Z",U=null)}for(F=0;F<v.paths.length;F++)N+=E.smoothclosed(v.paths[F].map(y),v.smoothing);return N}}}),O4=De({"src/traces/contourcarpet/index.js"(Y,H){"use strict";H.exports={attributes:PA(),supplyDefaults:RA(),colorbar:dx(),calc:z4(),plot:B4(),style:hx(),moduleType:"trace",name:"contourcarpet",basePlotModule:Gf(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}}),N4=De({"lib/contourcarpet.js"(Y,H){"use strict";H.exports=O4()}}),zb=De({"src/traces/ohlc/attributes.js"(Y,H){"use strict";var p=ui().extendFlat,x=lf(),S=of().axisHoverFormat,{hovertemplateAttrs:E,templatefallbackAttrs:e}=ou(),t=Ch().dash,r=Np(),o=lg(),i=o.INCREASING.COLOR,n=o.DECREASING.COLOR,a=x.line;function s(h){return{line:{color:p({},a.color,{dflt:h}),width:a.width,dash:t,editType:"style"},editType:"style"}}H.exports={xperiod:x.xperiod,xperiod0:x.xperiod0,xperiodalignment:x.xperiodalignment,xhoverformat:S("x"),yhoverformat:S("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:p({},a.width,{}),dash:p({},t,{}),editType:"style"},increasing:s(i),decreasing:s(n),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:E({},{keys:["open","high","low","close"]}),hovertemplatefallback:e(),tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:p({},r.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:x.zorder}}}),DA=De({"src/traces/ohlc/ohlc_defaults.js"(Y,H){"use strict";var p=Mo(),x=ui();H.exports=function(E,e,t,r){var o=t("x"),i=t("open"),n=t("high"),a=t("low"),s=t("close");t("hoverlabel.split");var h=p.getComponentMethod("calendars","handleTraceDefaults");if(h(E,e,["x"],r),!!(i&&n&&a&&s)){var c=Math.min(i.length,n.length,a.length,s.length);return o&&(c=Math.min(c,x.minRowLength(o))),e._length=c,c}}}}),U4=De({"src/traces/ohlc/defaults.js"(Y,H){"use strict";var p=ui(),x=DA(),S=pv(),E=zb();H.exports=function(r,o,i,n){function a(h,c){return p.coerce(r,o,E,h,c)}var s=x(r,o,a,n);if(!s){o.visible=!1;return}S(r,o,n,a,{x:!0}),a("xhoverformat"),a("yhoverformat"),a("line.width"),a("line.dash"),e(r,o,a,"increasing"),e(r,o,a,"decreasing"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),a("tickwidth"),n._requestRangeslider[o.xaxis]=!0,a("zorder")};function e(t,r,o,i){o(i+".line.color"),o(i+".line.width",r.line.width),o(i+".line.dash",r.line.dash)}}}),zA=De({"src/traces/ohlc/calc.js"(Y,H){"use strict";var p=ui(),x=p._,S=us(),E=gv(),e=zn().BADNUM;function t(n,a){var s=S.getFromId(n,a.xaxis),h=S.getFromId(n,a.yaxis),c=i(n,s,a),m=a._minDiff;a._minDiff=null;var d=a._origX;a._origX=null;var T=a._xcalc;a._xcalc=null;var l=o(n,a,d,T,h,r);return a._extremes[s._id]=S.findExtremes(s,T,{vpad:m/2}),l.length?(p.extendFlat(l[0].t,{wHover:m/2,tickLen:c}),l):[{t:{empty:!0}}]}function r(n,a,s,h){return{o:n,h:a,l:s,c:h}}function o(n,a,s,h,c,m){for(var d=c.makeCalcdata(a,"open"),T=c.makeCalcdata(a,"high"),l=c.makeCalcdata(a,"low"),_=c.makeCalcdata(a,"close"),w=p.isArrayOrTypedArray(a.text),A=p.isArrayOrTypedArray(a.hovertext),M=!0,g=null,b=!!a.xperiodalignment,v=[],u=0;u<h.length;u++){var y=h[u],f=d[u],R=T[u],L=l[u],z=_[u];if(y!==e&&f!==e&&R!==e&&L!==e&&z!==e){z===f?g!==null&&z!==g&&(M=z>g):M=z>f,g=z;var F=m(f,R,L,z);F.pos=y,F.yc=(f+z)/2,F.i=u,F.dir=M?"increasing":"decreasing",F.x=F.pos,F.y=[L,R],b&&(F.orig_p=s[u]),w&&(F.tx=a.text[u]),A&&(F.htx=a.hovertext[u]),v.push(F)}else v.push({pos:y,empty:!0})}return a._extremes[c._id]=S.findExtremes(c,p.concat(l,T),{padded:!0}),v.length&&(v[0].t={labels:{open:x(n,"open:")+" ",high:x(n,"high:")+" ",low:x(n,"low:")+" ",close:x(n,"close:")+" "}}),v}function i(n,a,s){var h=s._minDiff;if(!h){var c=n._fullData,m=[];h=1/0;var d;for(d=0;d<c.length;d++){var T=c[d];if(T.type==="ohlc"&&T.visible===!0&&T.xaxis===a._id){m.push(T);var l=a.makeCalcdata(T,"x");T._origX=l;var _=E(s,a,"x",l).vals;T._xcalc=_;var w=p.distinctVals(_).minDiff;w&&isFinite(w)&&(h=Math.min(h,w))}}for(h===1/0&&(h=1),d=0;d<m.length;d++)m[d]._minDiff=h}return h*s.tickwidth}H.exports={calc:t,calcCommon:o}}}),j4=De({"src/traces/ohlc/plot.js"(Y,H){"use strict";var p=za(),x=ui();H.exports=function(E,e,t,r){var o=e.yaxis,i=e.xaxis,n=!!i.rangebreaks;x.makeTraceGroups(r,t,"trace ohlc").each(function(a){var s=p.select(this),h=a[0],c=h.t,m=h.trace;if(m.visible!==!0||c.empty){s.remove();return}var d=c.tickLen,T=s.selectAll("path").data(x.identity);T.enter().append("path"),T.exit().remove(),T.attr("d",function(l){if(l.empty)return"M0,0Z";var _=i.c2p(l.pos-d,!0),w=i.c2p(l.pos+d,!0),A=n?(_+w)/2:i.c2p(l.pos,!0),M=o.c2p(l.o,!0),g=o.c2p(l.h,!0),b=o.c2p(l.l,!0),v=o.c2p(l.c,!0);return"M"+_+","+M+"H"+A+"M"+A+","+g+"V"+b+"M"+w+","+v+"H"+A})})}}}),V4=De({"src/traces/ohlc/style.js"(Y,H){"use strict";var p=za(),x=ys(),S=vo();H.exports=function(e,t,r){var o=r||p.select(e).selectAll("g.ohlclayer").selectAll("g.trace");o.style("opacity",function(i){return i[0].trace.opacity}),o.each(function(i){var n=i[0].trace;p.select(this).selectAll("path").each(function(a){if(!a.empty){var s=n[a.dir].line;p.select(this).style("fill","none").call(S.stroke,s.color).call(x.dashLine,s.dash,s.width).style("opacity",n.selectedpoints&&!a.selected?.3:1)}})})}}}),FA=De({"src/traces/ohlc/hover.js"(Y,H){"use strict";var p=us(),x=ui(),S=sf(),E=vo(),e=ui().fillText,t=lg(),r={increasing:t.INCREASING.SYMBOL,decreasing:t.DECREASING.SYMBOL};function o(s,h,c,m){var d=s.cd,T=d[0].trace;return T.hoverlabel.split?n(s,h,c,m):a(s,h,c,m)}function i(s,h,c,m){var d=s.cd,T=s.xa,l=d[0].trace,_=d[0].t,w=l.type,A=w==="ohlc"?"l":"min",M=w==="ohlc"?"h":"max",g,b,v=_.bPos||0,u=function(X){return X.pos+v-h},y=_.bdPos||_.tickLen,f=_.wHover,R=Math.min(1,y/Math.abs(T.r2c(T.range[1])-T.r2c(T.range[0])));g=s.maxHoverDistance-R,b=s.maxSpikeDistance-R;function L(X){var J=u(X);return S.inbox(J-f,J+f,g)}function z(X){var J=X[A],se=X[M];return J===se||S.inbox(J-c,se-c,g)}function F(X){return(L(X)+z(X))/2}var N=S.getDistanceFunction(m,L,z,F);if(S.getClosest(d,N,s),s.index===!1)return null;var B=d[s.index];if(B.empty)return null;var I=B.dir,U=l[I],O=U.line.color;return E.opacity(O)&&U.line.width?s.color=O:s.color=U.fillcolor,s.x0=T.c2p(B.pos+v-y,!0),s.x1=T.c2p(B.pos+v+y,!0),s.xLabelVal=B.orig_p!==void 0?B.orig_p:B.pos,s.spikeDistance=F(B)*b/g,s.xSpike=T.c2p(B.pos,!0),s}function n(s,h,c,m){var d=s.cd,T=s.ya,l=d[0].trace,_=d[0].t,w=[],A=i(s,h,c,m);if(!A)return[];var M=d[A.index],g=M.hi||l.hoverinfo||"";if(g==="none"||g==="skip")return[];for(var b=["high","open","close","low"],v={},u=0;u<b.length;u++){var y=b[u],f=l[y][A.index],R=T.c2p(f,!0),L;f in v?(L=v[f],L.yLabel+="<br>"+_.labels[y]+p.hoverLabelText(T,f,l.yhoverformat)):(L=x.extendFlat({},A),L.y0=L.y1=R,L.yLabelVal=f,L.yLabel=_.labels[y]+p.hoverLabelText(T,f,l.yhoverformat),L.name="",w.push(L),v[f]=L)}return w}function a(s,h,c,m){var d=s.cd,T=s.ya,l=d[0].trace,_=d[0].t,w=i(s,h,c,m);if(!w)return[];var A=w.index,M=d[A],g=w.index=M.i,b=M.dir;function v(F){return _.labels[F]+p.hoverLabelText(T,l[F][g],l.yhoverformat)}var u=M.hi||l.hoverinfo||"",y=u.split("+"),f=u==="all",R=f||y.indexOf("y")!==-1,L=f||y.indexOf("text")!==-1,z=R?[v("open"),v("high"),v("low"),v("close")+" "+r[b]]:[];return L&&e(M,l,z),w.extraText=z.join("<br>"),w.y0=w.y1=T.c2p(M.yc,!0),[w]}H.exports={hoverPoints:o,hoverSplit:n,hoverOnPoints:a}}}),BA=De({"src/traces/ohlc/select.js"(Y,H){"use strict";H.exports=function(x,S){var E=x.cd,e=x.xaxis,t=x.yaxis,r=[],o,i=E[0].t.bPos||0;if(S===!1)for(o=0;o<E.length;o++)E[o].selected=0;else for(o=0;o<E.length;o++){var n=E[o];S.contains([e.c2p(n.pos+i),t.c2p(n.yc)],null,n.i,x)?(r.push({pointNumber:n.i,x:e.c2d(n.pos),y:t.c2d(n.yc)}),n.selected=1):n.selected=0}return r}}}),q4=De({"src/traces/ohlc/index.js"(Y,H){"use strict";H.exports={moduleType:"trace",name:"ohlc",basePlotModule:Gf(),categories:["cartesian","svg","showLegend"],meta:{},attributes:zb(),supplyDefaults:U4(),calc:zA().calc,plot:j4(),style:V4(),hoverPoints:FA().hoverPoints,selectPoints:BA()}}}),H4=De({"lib/ohlc.js"(Y,H){"use strict";H.exports=q4()}}),OA=De({"src/traces/candlestick/attributes.js"(Y,H){"use strict";var p=ui().extendFlat,x=of().axisHoverFormat,S=zb(),E=by();function e(t){return{line:{color:p({},E.line.color,{dflt:t}),width:E.line.width,editType:"style"},fillcolor:E.fillcolor,editType:"style"}}H.exports={xperiod:S.xperiod,xperiod0:S.xperiod0,xperiodalignment:S.xperiodalignment,xhoverformat:x("x"),yhoverformat:x("y"),x:S.x,open:S.open,high:S.high,low:S.low,close:S.close,line:{width:p({},E.line.width,{}),editType:"style"},increasing:e(S.increasing.line.color.dflt),decreasing:e(S.decreasing.line.color.dflt),text:S.text,hovertext:S.hovertext,hovertemplate:S.hovertemplate,hovertemplatefallback:S.hovertemplatefallback,whiskerwidth:p({},E.whiskerwidth,{dflt:0}),hoverlabel:S.hoverlabel,zorder:E.zorder}}}),G4=De({"src/traces/candlestick/defaults.js"(Y,H){"use strict";var p=ui(),x=vo(),S=DA(),E=pv(),e=OA();H.exports=function(o,i,n,a){function s(c,m){return p.coerce(o,i,e,c,m)}var h=S(o,i,s,a);if(!h){i.visible=!1;return}E(o,i,a,s,{x:!0}),s("xhoverformat"),s("yhoverformat"),s("line.width"),t(o,i,s,"increasing"),t(o,i,s,"decreasing"),s("text"),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),s("whiskerwidth"),a._requestRangeslider[i.xaxis]=!0,s("zorder")};function t(r,o,i,n){var a=i(n+".line.color");i(n+".line.width",o.line.width),i(n+".fillcolor",x.addOpacity(a,.5))}}}),W4=De({"src/traces/candlestick/calc.js"(Y,H){"use strict";var p=ui(),x=us(),S=gv(),E=zA().calcCommon;H.exports=function(t,r){var o=t._fullLayout,i=x.getFromId(t,r.xaxis),n=x.getFromId(t,r.yaxis),a=i.makeCalcdata(r,"x"),s=S(r,i,"x",a).vals,h=E(t,r,a,s,n,e);return h.length?(p.extendFlat(h[0].t,{num:o._numBoxes,dPos:p.distinctVals(s).minDiff/2,posLetter:"x",valLetter:"y"}),o._numBoxes++,h):[{t:{empty:!0}}]};function e(t,r,o,i){return{min:o,q1:Math.min(t,i),med:i,q3:Math.max(t,i),max:r}}}}),X4=De({"src/traces/candlestick/index.js"(Y,H){"use strict";H.exports={moduleType:"trace",name:"candlestick",basePlotModule:Gf(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:OA(),layoutAttributes:wy(),supplyLayoutDefaults:G_().supplyLayoutDefaults,crossTraceCalc:W_().crossTraceCalc,supplyDefaults:G4(),calc:W4(),plot:X_().plot,layerName:"boxlayer",style:Y_().style,hoverPoints:FA().hoverPoints,selectPoints:BA()}}}),Y4=De({"lib/candlestick.js"(Y,H){"use strict";H.exports=X4()}}),NA=De({"src/plots/polar/set_convert.js"(Y,H){"use strict";var p=ui(),x=Dv(),S=p.deg2rad,E=p.rad2deg;H.exports=function(n,a,s){switch(x(n,s),n._id){case"x":case"radialaxis":e(n,a);break;case"angularaxis":o(n,a);break}};function e(i,n){var a=n._subplot;i.setGeometry=function(){var s=i._rl[0],h=i._rl[1],c=a.innerRadius,m=(a.radius-c)/(h-s),d=c/m,T=s>h?function(l){return l<=0}:function(l){return l>=0};i.c2g=function(l){var _=i.c2l(l)-s;return(T(_)?_:0)+d},i.g2c=function(l){return i.l2c(l+s-d)},i.g2p=function(l){return l*m},i.c2p=function(l){return i.g2p(i.c2g(l))}}}function t(i,n){return n==="degrees"?S(i):i}function r(i,n){return n==="degrees"?E(i):i}function o(i,n){var a=i.type;if(a==="linear"){var s=i.d2c,h=i.c2d;i.d2c=function(c,m){return t(s(c),m)},i.c2d=function(c,m){return h(r(c,m))}}i.makeCalcdata=function(c,m){var d=c[m],T=c._length,l,_,w=function(v){return i.d2c(v,c.thetaunit)};if(d)for(l=new Array(T),_=0;_<T;_++)l[_]=w(d[_]);else{var A=m+"0",M="d"+m,g=A in c?w(c[A]):0,b=c[M]?w(c[M]):(i.period||2*Math.PI)/T;for(l=new Array(T),_=0;_<T;_++)l[_]=g+_*b}return l},i.setGeometry=function(){var c=n.sector,m=c.map(S),d={clockwise:-1,counterclockwise:1}[i.direction],T=S(i.rotation),l=function(u){return d*u+T},_=function(u){return(u-T)/d},w,A,M,g;switch(a){case"linear":A=w=p.identity,g=S,M=E,i.range=p.isFullCircle(m)?[c[0],c[0]+360]:m.map(_).map(E);break;case"category":var b=i._categories.length,v=i.period?Math.max(i.period,b):b;v===0&&(v=1),A=g=function(u){return u*2*Math.PI/v},w=M=function(u){return u*v/Math.PI/2},i.range=[0,v];break}i.c2g=function(u){return l(A(u))},i.g2c=function(u){return w(_(u))},i.t2g=function(u){return l(g(u))},i.g2t=function(u){return M(_(u))}}}}}),Fb=De({"src/plots/polar/constants.js"(Y,H){"use strict";H.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}}}),Bb=De({"src/plots/polar/helpers.js"(Y,H){"use strict";var p=ui(),x=vy().tester,S=p.findIndexOfMin,E=p.isAngleInsideSector,e=p.angleDelta,t=p.angleDist;function r(_,w,A,M,g){if(!E(w,M))return!1;var b,v;A[0]<A[1]?(b=A[0],v=A[1]):(b=A[1],v=A[0]);var u=x(s(b,M[0],M[1],g)),y=x(s(v,M[0],M[1],g)),f=[_*Math.cos(w),_*Math.sin(w)];return y.contains(f)&&!u.contains(f)}function o(_,w,A,M){var g,b,v=M[0],u=M[1],y=m(Math.sin(w)-Math.sin(_)),f=m(Math.cos(w)-Math.cos(_)),R=Math.tan(A),L=m(1/R),z=y/f,F=u-z*v;return L?y&&f?(g=F/(R-z),b=R*g):f?(g=u*L,b=u):(g=v,b=v*R):y&&f?(g=0,b=F):f?(g=0,b=u):g=b=NaN,[g,b]}function i(_,w,A,M){var g=-w*A,b=w*w+1,v=2*(w*g-A),u=g*g+A*A-_*_,y=Math.sqrt(v*v-4*b*u),f=(-v+y)/(2*b),R=(-v-y)/(2*b);return[[f,w*f+g+M],[R,w*R+g+M]]}function n(_,w){var A=w.length,M=new Array(A+1),g;for(g=0;g<A;g++){var b=w[g];M[g]=[_*Math.cos(b),_*Math.sin(b)]}return M[g]=M[0].slice(),M}function a(_,w,A,M){var g=M.length,b=[],v,u;function y(U){return[_*Math.cos(U),_*Math.sin(U)]}function f(U,O,X){return o(U,O,X,y(U))}function R(U){return p.mod(U,g)}function L(U){return E(U,[w,A])}var z=S(M,function(U){return L(U)?t(U,w):1/0}),F=f(M[z],M[R(z-1)],w);for(b.push(F),v=z,u=0;u<g;v++,u++){var N=M[R(v)];if(!L(N))break;b.push(y(N))}var B=S(M,function(U){return L(U)?t(U,A):1/0}),I=f(M[B],M[R(B+1)],A);return b.push(I),b.push([0,0]),b.push(b[0].slice()),b}function s(_,w,A,M){return p.isFullCircle([w,A])?n(_,M):a(_,w,A,M)}function h(_,w,A,M){for(var g=1/0,b=1/0,v=s(_,w,A,M),u=0;u<v.length;u++){var y=v[u];g=Math.min(g,y[0]),b=Math.min(b,-y[1])}return[g,b]}function c(_,w){var A=function(b){var v=e(b,_);return v>0?v:1/0},M=S(w,A),g=p.mod(M+1,w.length);return[w[M],w[g]]}function m(_){return Math.abs(_)>1e-10?_:0}function d(_,w,A){w=w||0,A=A||0;for(var M=_.length,g=new Array(M),b=0;b<M;b++){var v=_[b];g[b]=[w+v[0],A-v[1]]}return g}function T(_,w,A,M,g,b){var v=s(_,w,A,M);return"M"+d(v,g,b).join("L")}function l(_,w,A,M,g,b,v){var u,y;_<w?(u=_,y=w):(u=w,y=_);var f=d(s(u,A,M,g),b,v),R=d(s(y,A,M,g),b,v);return"M"+R.reverse().join("L")+"M"+f.join("L")}H.exports={isPtInsidePolygon:r,findPolygonOffset:h,findEnclosingVertexAngles:c,findIntersectionXY:o,findXYatLength:i,clampTiny:m,pathPolygon:T,pathPolygonAnnulus:l}}}),UA=De({"src/plots/smith/helpers.js"(Y,H){"use strict";function p(r){return r<0?-1:r>0?1:0}function x(r){var o=r[0],i=r[1];if(!isFinite(o)||!isFinite(i))return[1,0];var n=(o+1)*(o+1)+i*i;return[(o*o+i*i-1)/n,2*i/n]}function S(r,o){var i=o[0],n=o[1];return[i*r.radius+r.cx,-n*r.radius+r.cy]}function E(r,o){return o*r.radius}function e(r,o,i,n){var a=S(r,x([i,o])),s=a[0],h=a[1],c=S(r,x([n,o])),m=c[0],d=c[1];if(o===0)return["M"+s+","+h,"L"+m+","+d].join(" ");var T=E(r,1/Math.abs(o));return["M"+s+","+h,"A"+T+","+T+" 0 0,"+(o<0?1:0)+" "+m+","+d].join(" ")}function t(r,o,i,n){var a=E(r,1/(o+1)),s=S(r,x([o,i])),h=s[0],c=s[1],m=S(r,x([o,n])),d=m[0],T=m[1];if(p(i)!==p(n)){var l=S(r,x([o,0])),_=l[0],w=l[1];return["M"+h+","+c,"A"+a+","+a+" 0 0,"+(0<i?0:1)+" "+_+","+w,"A"+a+","+a+" 0 0,"+(n<0?0:1)+d+","+T].join(" ")}return["M"+h+","+c,"A"+a+","+a+" 0 0,"+(n<i?0:1)+" "+d+","+T].join(" ")}H.exports={smith:x,reactanceArc:e,resistanceArc:t,smithTransform:S}}}),jA=De({"src/plots/polar/polar.js"(Y,H){"use strict";var p=za(),x=wu(),S=Mo(),E=ui(),e=E.strRotate,t=E.strTranslate,r=vo(),o=ys(),i=Mc(),n=us(),a=Dv(),s=NA(),h=fv().doAutoRange,c=h2(),m=Qh(),d=sf(),T=j0(),l=Af().prepSelect,_=Af().selectOnClick,w=Af().clearOutline,A=hv(),M=fy(),g=dy().redrawReglTraces,b=rh().MID_SHIFT,v=Fb(),u=Bb(),y=UA(),f=y.smith,R=y.reactanceArc,L=y.resistanceArc,z=y.smithTransform,F=E._,N=E.mod,B=E.deg2rad,I=E.rad2deg;function U(ce,q,Z){this.isSmith=Z||!1,this.id=q,this.gd=ce,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var ee=ce._fullLayout,V="clip"+ee._uid+q;this.clipIds.forTraces=V+"-for-traces",this.clipPaths.forTraces=ee._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=ee["_"+(Z?"smith":"polar")+"layer"].append("g").attr("class",q),this.getHole=function(oe){return this.isSmith?0:oe.hole},this.getSector=function(oe){return this.isSmith?[0,360]:oe.sector},this.getRadial=function(oe){return this.isSmith?oe.realaxis:oe.radialaxis},this.getAngular=function(oe){return this.isSmith?oe.imaginaryaxis:oe.angularaxis},Z||(this.radialTickLayout=null,this.angularTickLayout=null)}var O=U.prototype;H.exports=function(q,Z,ee){return new U(q,Z,ee)},O.plot=function(ce,q){for(var Z=this,ee=q[Z.id],V=!1,oe=0;oe<ce.length;oe++){var ie=ce[oe][0].trace;if(ie.cliponaxis===!1){V=!0;break}}Z._hasClipOnAxisFalse=V,Z.updateLayers(q,ee),Z.updateLayout(q,ee),i.generalUpdatePerTraceModule(Z.gd,Z,ce,ee),Z.updateFx(q,ee),Z.isSmith&&(delete ee.realaxis.range,delete ee.imaginaryaxis.range)},O.updateLayers=function(ce,q){var Z=this,ee=Z.isSmith,V=Z.layers,oe=Z.getRadial(q),ie=Z.getAngular(q),j=v.layerNames,Q=j.indexOf("frontplot"),re=j.slice(0,Q),ue=ie.layer==="below traces",_e=oe.layer==="below traces";ue&&re.push("angular-line"),_e&&re.push("radial-line"),ue&&re.push("angular-axis"),_e&&re.push("radial-axis"),re.push("frontplot"),ue||re.push("angular-line"),_e||re.push("radial-line"),ue||re.push("angular-axis"),_e||re.push("radial-axis");var we=(ee?"smith":"polar")+"sublayer",Re=Z.framework.selectAll("."+we).data(re,String);Re.enter().append("g").attr("class",function(ze){return we+" "+ze}).each(function(ze){var Xe=V[ze]=p.select(this);switch(ze){case"frontplot":ee||Xe.append("g").classed("barlayer",!0),Xe.append("g").classed("scatterlayer",!0);break;case"backplot":Xe.append("g").classed("maplayer",!0);break;case"plotbg":V.bg=Xe.append("path");break;case"radial-grid":Xe.style("fill","none");break;case"angular-grid":Xe.style("fill","none");break;case"radial-line":Xe.append("line").style("fill","none");break;case"angular-line":Xe.append("path").style("fill","none");break}}),Re.order()},O.updateLayout=function(ce,q){var Z=this,ee=Z.layers,V=ce._size,oe=Z.getRadial(q),ie=Z.getAngular(q),j=q.domain.x,Q=q.domain.y;Z.xOffset=V.l+V.w*j[0],Z.yOffset=V.t+V.h*(1-Q[1]);var re=Z.xLength=V.w*(j[1]-j[0]),ue=Z.yLength=V.h*(Q[1]-Q[0]),_e=Z.getSector(q);Z.sectorInRad=_e.map(B);var we=Z.sectorBBox=J(_e),Re=we[2]-we[0],ze=we[3]-we[1],Xe=ue/re,tt=Math.abs(ze/Re),it,et,nt,Ae,me;Xe>tt?(it=re,et=re*tt,me=(ue-et)/V.h/2,nt=[j[0],j[1]],Ae=[Q[0]+me,Q[1]-me]):(it=ue/tt,et=ue,me=(re-it)/V.w/2,nt=[j[0]+me,j[1]-me],Ae=[Q[0],Q[1]]),Z.xLength2=it,Z.yLength2=et,Z.xDomain2=nt,Z.yDomain2=Ae;var fe=Z.xOffset2=V.l+V.w*nt[0],Be=Z.yOffset2=V.t+V.h*(1-Ae[1]),Qe=Z.radius=it/Re,at=Z.innerRadius=Z.getHole(q)*Qe,$e=Z.cx=fe-Qe*we[0],It=Z.cy=Be+Qe*we[3],Pt=Z.cxx=$e-fe,Vt=Z.cyy=It-Be,Wt=oe.side,Cr;Wt==="counterclockwise"?(Cr=Wt,Wt="top"):Wt==="clockwise"&&(Cr=Wt,Wt="bottom"),Z.radialAxis=Z.mockAxis(ce,q,oe,{_id:"x",side:Wt,_trueSide:Cr,domain:[at/V.w,Qe/V.w]}),Z.angularAxis=Z.mockAxis(ce,q,ie,{side:"right",domain:[0,Math.PI],autorange:!1}),Z.doAutoRange(ce,q),Z.updateAngularAxis(ce,q),Z.updateRadialAxis(ce,q),Z.updateRadialAxisTitle(ce,q),Z.xaxis=Z.mockCartesianAxis(ce,q,{_id:"x",domain:nt}),Z.yaxis=Z.mockCartesianAxis(ce,q,{_id:"y",domain:Ae});var yr=Z.pathSubplot();Z.clipPaths.forTraces.select("path").attr("d",yr).attr("transform",t(Pt,Vt)),ee.frontplot.attr("transform",t(fe,Be)).call(o.setClipUrl,Z._hasClipOnAxisFalse?null:Z.clipIds.forTraces,Z.gd),ee.bg.attr("d",yr).attr("transform",t($e,It)).call(r.fill,q.bgcolor)},O.mockAxis=function(ce,q,Z,ee){var V=E.extendFlat({},Z,ee);return s(V,q,ce),V},O.mockCartesianAxis=function(ce,q,Z){var ee=this,V=ee.isSmith,oe=Z._id,ie=E.extendFlat({type:"linear"},Z);a(ie,ce);var j={x:[0,2],y:[1,3]};return ie.setRange=function(){var Q=ee.sectorBBox,re=j[oe],ue=ee.radialAxis._rl,_e=(ue[1]-ue[0])/(1-ee.getHole(q));ie.range=[Q[re[0]]*_e,Q[re[1]]*_e]},ie.isPtWithinRange=oe==="x"&&!V?function(Q){return ee.isPtInside(Q)}:function(){return!0},ie.setRange(),ie.setScale(),ie},O.doAutoRange=function(ce,q){var Z=this,ee=Z.gd,V=Z.radialAxis,oe=Z.getRadial(q);h(ee,V);var ie=V.range;if(oe.range=ie.slice(),oe._input.range=ie.slice(),V._rl=[V.r2l(ie[0],null,"gregorian"),V.r2l(ie[1],null,"gregorian")],V.minallowed!==void 0){var j=V.r2l(V.minallowed);V._rl[0]>V._rl[1]?V._rl[1]=Math.max(V._rl[1],j):V._rl[0]=Math.max(V._rl[0],j)}if(V.maxallowed!==void 0){var Q=V.r2l(V.maxallowed);V._rl[0]<V._rl[1]?V._rl[1]=Math.min(V._rl[1],Q):V._rl[0]=Math.min(V._rl[0],Q)}},O.updateRadialAxis=function(ce,q){var Z=this,ee=Z.gd,V=Z.layers,oe=Z.radius,ie=Z.innerRadius,j=Z.cx,Q=Z.cy,re=Z.getRadial(q),ue=N(Z.getSector(q)[0],360),_e=Z.radialAxis,we=ie<oe,Re=Z.isSmith;Re||(Z.fillViewInitialKey("radialaxis.angle",re.angle),Z.fillViewInitialKey("radialaxis.range",_e.range.slice()),_e.setGeometry()),_e.tickangle==="auto"&&ue>90&&ue<=270&&(_e.tickangle=180);var ze=Re?function(Qe){var at=z(Z,f([Qe.x,0]));return t(at[0]-j,at[1]-Q)}:function(Qe){return t(_e.l2p(Qe.x)+ie,0)},Xe=Re?function(Qe){return L(Z,Qe.x,-1/0,1/0)}:function(Qe){return Z.pathArc(_e.r2p(Qe.x)+ie)},tt=X(re);if(Z.radialTickLayout!==tt&&(V["radial-axis"].selectAll(".xtick").remove(),Z.radialTickLayout=tt),we){_e.setScale();var it=0,et=Re?(_e.tickvals||[]).filter(function(Qe){return Qe>=0}).map(function(Qe){return n.tickText(_e,Qe,!0,!1)}):n.calcTicks(_e),nt=Re?et:n.clipEnds(_e,et),Ae=n.getTickSigns(_e)[2];Re&&((_e.ticks==="top"&&_e.side==="bottom"||_e.ticks==="bottom"&&_e.side==="top")&&(Ae=-Ae),_e.ticks==="top"&&_e.side==="top"&&(it=-_e.ticklen),_e.ticks==="bottom"&&_e.side==="bottom"&&(it=_e.ticklen)),n.drawTicks(ee,_e,{vals:et,layer:V["radial-axis"],path:n.makeTickPath(_e,0,Ae),transFn:ze,crisp:!1}),n.drawGrid(ee,_e,{vals:nt,layer:V["radial-grid"],path:Xe,transFn:E.noop,crisp:!1}),n.drawLabels(ee,_e,{vals:et,layer:V["radial-axis"],transFn:ze,labelFns:n.makeLabelFns(_e,it)})}var me=Z.radialAxisAngle=Z.vangles?I(se(B(re.angle),Z.vangles)):re.angle,fe=t(j,Q),Be=fe+e(-me);le(V["radial-axis"],we&&(re.showticklabels||re.ticks),{transform:Be}),le(V["radial-grid"],we&&re.showgrid,{transform:Re?"":fe}),le(V["radial-line"].select("line"),we&&re.showline,{x1:Re?-oe:ie,y1:0,x2:oe,y2:0,transform:Be}).attr("stroke-width",re.linewidth).call(r.stroke,re.linecolor)},O.updateRadialAxisTitle=function(ce,q,Z){if(!this.isSmith){var ee=this,V=ee.gd,oe=ee.radius,ie=ee.cx,j=ee.cy,Q=ee.getRadial(q),re=ee.id+"title",ue=0;if(Q.title){var _e=o.bBox(ee.layers["radial-axis"].node()).height,we=Q.title.font.size,Re=Q.side;ue=Re==="top"?we:Re==="counterclockwise"?-(_e+we*.4):_e+we*.8}var ze=Z!==void 0?Z:ee.radialAxisAngle,Xe=B(ze),tt=Math.cos(Xe),it=Math.sin(Xe),et=ie+oe/2*tt+ue*it,nt=j-oe/2*it+ue*tt;ee.layers["radial-axis-title"]=T.draw(V,re,{propContainer:Q,propName:ee.id+".radialaxis.title.text",placeholder:F(V,"Click to enter radial axis title"),attributes:{x:et,y:nt,"text-anchor":"middle"},transform:{rotate:-ze}})}},O.updateAngularAxis=function(ce,q){var Z=this,ee=Z.gd,V=Z.layers,oe=Z.radius,ie=Z.innerRadius,j=Z.cx,Q=Z.cy,re=Z.getAngular(q),ue=Z.angularAxis,_e=Z.isSmith;_e||(Z.fillViewInitialKey("angularaxis.rotation",re.rotation),ue.setGeometry(),ue.setScale());var we=_e?function(at){var $e=z(Z,f([0,at.x]));return Math.atan2($e[0]-j,$e[1]-Q)-Math.PI/2}:function(at){return ue.t2g(at.x)};ue.type==="linear"&&ue.thetaunit==="radians"&&(ue.tick0=I(ue.tick0),ue.dtick=I(ue.dtick));var Re=function(at){return t(j+oe*Math.cos(at),Q-oe*Math.sin(at))},ze=_e?function(at){var $e=z(Z,f([0,at.x]));return t($e[0],$e[1])}:function(at){return Re(we(at))},Xe=_e?function(at){var $e=z(Z,f([0,at.x])),It=Math.atan2($e[0]-j,$e[1]-Q)-Math.PI/2;return t($e[0],$e[1])+e(-I(It))}:function(at){var $e=we(at);return Re($e)+e(-I($e))},tt=_e?function(at){return R(Z,at.x,0,1/0)}:function(at){var $e=we(at),It=Math.cos($e),Pt=Math.sin($e);return"M"+[j+ie*It,Q-ie*Pt]+"L"+[j+oe*It,Q-oe*Pt]},it=n.makeLabelFns(ue,0),et=it.labelStandoff,nt={};nt.xFn=function(at){var $e=we(at);return Math.cos($e)*et},nt.yFn=function(at){var $e=we(at),It=Math.sin($e)>0?.2:1;return-Math.sin($e)*(et+at.fontSize*It)+Math.abs(Math.cos($e))*(at.fontSize*b)},nt.anchorFn=function(at){var $e=we(at),It=Math.cos($e);return Math.abs(It)<.1?"middle":It>0?"start":"end"},nt.heightFn=function(at,$e,It){var Pt=we(at);return-.5*(1+Math.sin(Pt))*It};var Ae=X(re);Z.angularTickLayout!==Ae&&(V["angular-axis"].selectAll("."+ue._id+"tick").remove(),Z.angularTickLayout=Ae);var me=_e?[1/0].concat(ue.tickvals||[]).map(function(at){return n.tickText(ue,at,!0,!1)}):n.calcTicks(ue);_e&&(me[0].text="\u221E",me[0].fontSize*=1.75);var fe;if(q.gridshape==="linear"?(fe=me.map(we),E.angleDelta(fe[0],fe[1])<0&&(fe=fe.slice().reverse())):fe=null,Z.vangles=fe,ue.type==="category"&&(me=me.filter(function(at){return E.isAngleInsideSector(we(at),Z.sectorInRad)})),ue.visible){var Be=ue.ticks==="inside"?-1:1,Qe=(ue.linewidth||1)/2;n.drawTicks(ee,ue,{vals:me,layer:V["angular-axis"],path:"M"+Be*Qe+",0h"+Be*ue.ticklen,transFn:Xe,crisp:!1}),n.drawGrid(ee,ue,{vals:me,layer:V["angular-grid"],path:tt,transFn:E.noop,crisp:!1}),n.drawLabels(ee,ue,{vals:me,layer:V["angular-axis"],repositionOnUpdate:!0,transFn:ze,labelFns:nt})}le(V["angular-line"].select("path"),re.showline,{d:Z.pathSubplot(),transform:t(j,Q)}).attr("stroke-width",re.linewidth).call(r.stroke,re.linecolor)},O.updateFx=function(ce,q){if(!this.gd._context.staticPlot){var Z=!this.isSmith;Z&&(this.updateAngularDrag(ce),this.updateRadialDrag(ce,q,0),this.updateRadialDrag(ce,q,1)),this.updateHoverAndMainDrag(ce)}},O.updateHoverAndMainDrag=function(ce){var q=this,Z=q.isSmith,ee=q.gd,V=q.layers,oe=ce._zoomlayer,ie=v.MINZOOM,j=v.OFFEDGE,Q=q.radius,re=q.innerRadius,ue=q.cx,_e=q.cy,we=q.cxx,Re=q.cyy,ze=q.sectorInRad,Xe=q.vangles,tt=q.radialAxis,it=u.clampTiny,et=u.findXYatLength,nt=u.findEnclosingVertexAngles,Ae=v.cornerHalfWidth,me=v.cornerLen/2,fe,Be,Qe=c.makeDragger(V,"path","maindrag",ce.dragmode===!1?"none":"crosshair");p.select(Qe).attr("d",q.pathSubplot()).attr("transform",t(ue,_e)),Qe.onmousemove=function(ir){d.hover(ee,ir,q.id),ee._fullLayout._lasthover=Qe,ee._fullLayout._hoversubplot=q.id},Qe.onmouseout=function(ir){ee._dragging||m.unhover(ee,ir)};var at={element:Qe,gd:ee,subplot:q.id,plotinfo:{id:q.id,xaxis:q.xaxis,yaxis:q.yaxis},xaxes:[q.xaxis],yaxes:[q.yaxis]},$e,It,Pt,Vt,Wt,Cr,yr,qr,Mr;function Dr(ir,tr){return Math.sqrt(ir*ir+tr*tr)}function xt(ir,tr){return Dr(ir-we,tr-Re)}function Ne(ir,tr){return Math.atan2(Re-tr,ir-we)}function Ye(ir,tr){return[ir*Math.cos(tr),ir*Math.sin(-tr)]}function be(ir,tr){if(ir===0)return q.pathSector(2*Ae);var Ir=me/ir,vi=tr-Ir,Vi=tr+Ir,Ui=Math.max(0,Math.min(ir,Q)),Ki=Ui-Ae,ea=Ui+Ae;return"M"+Ye(Ki,vi)+"A"+[Ki,Ki]+" 0,0,0 "+Ye(Ki,Vi)+"L"+Ye(ea,Vi)+"A"+[ea,ea]+" 0,0,1 "+Ye(ea,vi)+"Z"}function Ie(ir,tr,Ir){if(ir===0)return q.pathSector(2*Ae);var vi=Ye(ir,tr),Vi=Ye(ir,Ir),Ui=it((vi[0]+Vi[0])/2),Ki=it((vi[1]+Vi[1])/2),ea,Bi;if(Ui&&Ki){var _a=Ki/Ui,Ca=-1/_a,Kt=et(Ae,_a,Ui,Ki);ea=et(me,Ca,Kt[0][0],Kt[0][1]),Bi=et(me,Ca,Kt[1][0],Kt[1][1])}else{var zt,Zt;Ki?(zt=me,Zt=Ae):(zt=Ae,Zt=me),ea=[[Ui-zt,Ki-Zt],[Ui+zt,Ki-Zt]],Bi=[[Ui-zt,Ki+Zt],[Ui+zt,Ki+Zt]]}return"M"+ea.join("L")+"L"+Bi.reverse().join("L")+"Z"}function qe(){Pt=null,Vt=null,Wt=q.pathSubplot(),Cr=!1;var ir=ee._fullLayout[q.id];yr=x(ir.bgcolor).getLuminance(),qr=c.makeZoombox(oe,yr,ue,_e,Wt),qr.attr("fill-rule","evenodd"),Mr=c.makeCorners(oe,ue,_e),w(ee)}function ke(ir,tr){return tr=Math.max(Math.min(tr,Q),re),ir<j?ir=0:Q-ir<j?ir=Q:tr<j?tr=0:Q-tr<j&&(tr=Q),Math.abs(tr-ir)>ie?(ir<tr?(Pt=ir,Vt=tr):(Pt=tr,Vt=ir),!0):(Pt=null,Vt=null,!1)}function Me(ir,tr){ir=ir||Wt,tr=tr||"M0,0Z",qr.attr("d",ir),Mr.attr("d",tr),c.transitionZoombox(qr,Mr,Cr,yr),Cr=!0;var Ir={};kt(Ir),ee.emit("plotly_relayouting",Ir)}function Le(ir,tr){ir=ir*fe,tr=tr*Be;var Ir=$e+ir,vi=It+tr,Vi=xt($e,It),Ui=Math.min(xt(Ir,vi),Q),Ki=Ne($e,It),ea,Bi;ke(Vi,Ui)&&(ea=Wt+q.pathSector(Vt),Pt&&(ea+=q.pathSector(Pt)),Bi=be(Pt,Ki)+be(Vt,Ki)),Me(ea,Bi)}function ut(ir,tr,Ir,vi){var Vi=u.findIntersectionXY(Ir,vi,Ir,[ir-we,Re-tr]);return Dr(Vi[0],Vi[1])}function lt(ir,tr){var Ir=$e+ir,vi=It+tr,Vi=Ne($e,It),Ui=Ne(Ir,vi),Ki=nt(Vi,Xe),ea=nt(Ui,Xe),Bi=ut($e,It,Ki[0],Ki[1]),_a=Math.min(ut(Ir,vi,ea[0],ea[1]),Q),Ca,Kt;ke(Bi,_a)&&(Ca=Wt+q.pathSector(Vt),Pt&&(Ca+=q.pathSector(Pt)),Kt=[Ie(Pt,Ki[0],Ki[1]),Ie(Vt,Ki[0],Ki[1])].join(" ")),Me(Ca,Kt)}function gt(){if(c.removeZoombox(ee),!(Pt===null||Vt===null)){var ir={};kt(ir),c.showDoubleClickNotifier(ee),S.call("_guiRelayout",ee,ir)}}function kt(ir){var tr=tt._rl,Ir=(tr[1]-tr[0])/(1-re/Q)/Q,vi=[tr[0]+(Pt-re)*Ir,tr[0]+(Vt-re)*Ir];ir[q.id+".radialaxis.range"]=vi}function nr(ir,tr){var Ir=ee._fullLayout.clickmode;if(c.removeZoombox(ee),ir===2){var vi={};for(var Vi in q.viewInitial)vi[q.id+"."+Vi]=q.viewInitial[Vi];ee.emit("plotly_doubleclick",null),S.call("_guiRelayout",ee,vi)}Ir.indexOf("select")>-1&&ir===1&&_(tr,ee,[q.xaxis],[q.yaxis],q.id,at),Ir.indexOf("event")>-1&&d.click(ee,tr,q.id)}at.prepFn=function(ir,tr,Ir){var vi=ee._fullLayout.dragmode,Vi=Qe.getBoundingClientRect();ee._fullLayout._calcInverseTransform(ee);var Ui=ee._fullLayout._invTransform;fe=ee._fullLayout._invScaleX,Be=ee._fullLayout._invScaleY;var Ki=E.apply3DTransform(Ui)(tr-Vi.left,Ir-Vi.top);if($e=Ki[0],It=Ki[1],Xe){var ea=u.findPolygonOffset(Q,ze[0],ze[1],Xe);$e+=we+ea[0],It+=Re+ea[1]}switch(vi){case"zoom":at.clickFn=nr,Z||(Xe?at.moveFn=lt:at.moveFn=Le,at.doneFn=gt,qe(ir,tr,Ir));break;case"select":case"lasso":l(ir,tr,Ir,at,vi);break}},m.init(at)},O.updateRadialDrag=function(ce,q,Z){var ee=this,V=ee.gd,oe=ee.layers,ie=ee.radius,j=ee.innerRadius,Q=ee.cx,re=ee.cy,ue=ee.radialAxis,_e=v.radialDragBoxSize,we=_e/2;if(!ue.visible)return;var Re=B(ee.radialAxisAngle),ze=ue._rl,Xe=ze[0],tt=ze[1],it=ze[Z],et=.75*(ze[1]-ze[0])/(1-ee.getHole(q))/ie,nt,Ae,me;Z?(nt=Q+(ie+we)*Math.cos(Re),Ae=re-(ie+we)*Math.sin(Re),me="radialdrag"):(nt=Q+(j-we)*Math.cos(Re),Ae=re-(j-we)*Math.sin(Re),me="radialdrag-inner");var fe=c.makeRectDragger(oe,me,"crosshair",-we,-we,_e,_e),Be={element:fe,gd:V};ce.dragmode===!1&&(Be.dragmode=!1),le(p.select(fe),ue.visible&&j<ie,{transform:t(nt,Ae)});var Qe,at,$e;function It(yr,qr){if(Qe)Qe(yr,qr);else{var Mr=[yr,-qr],Dr=[Math.cos(Re),Math.sin(Re)],xt=Math.abs(E.dot(Mr,Dr)/Math.sqrt(E.dot(Mr,Mr)));isNaN(xt)||(Qe=xt<.5?Wt:Cr)}var Ne={};Pt(Ne),V.emit("plotly_relayouting",Ne)}function Pt(yr){at!==null?yr[ee.id+".radialaxis.angle"]=at:$e!==null&&(yr[ee.id+".radialaxis.range["+Z+"]"]=$e)}function Vt(){at!==null?S.call("_guiRelayout",V,ee.id+".radialaxis.angle",at):$e!==null&&S.call("_guiRelayout",V,ee.id+".radialaxis.range["+Z+"]",$e)}function Wt(yr,qr){if(Z!==0){var Mr=nt+yr,Dr=Ae+qr;at=Math.atan2(re-Dr,Mr-Q),ee.vangles&&(at=se(at,ee.vangles)),at=I(at);var xt=t(Q,re)+e(-at);oe["radial-axis"].attr("transform",xt),oe["radial-line"].select("line").attr("transform",xt);var Ne=ee.gd._fullLayout,Ye=Ne[ee.id];ee.updateRadialAxisTitle(Ne,Ye,at)}}function Cr(yr,qr){var Mr=E.dot([yr,-qr],[Math.cos(Re),Math.sin(Re)]);if($e=it-et*Mr,et>0!=(Z?$e>Xe:$e<tt)){$e=null;return}var Dr=V._fullLayout,xt=Dr[ee.id];ue.range[Z]=$e,ue._rl[Z]=$e,ee.updateRadialAxis(Dr,xt),ee.xaxis.setRange(),ee.xaxis.setScale(),ee.yaxis.setRange(),ee.yaxis.setScale();var Ne=!1;for(var Ye in ee.traceHash){var be=ee.traceHash[Ye],Ie=E.filterVisible(be),qe=be[0][0].trace._module;qe.plot(V,ee,Ie,xt),S.traceIs(Ye,"gl")&&Ie.length&&(Ne=!0)}Ne&&(M(V),g(V))}Be.prepFn=function(){Qe=null,at=null,$e=null,Be.moveFn=It,Be.doneFn=Vt,w(V)},Be.clampFn=function(yr,qr){return Math.sqrt(yr*yr+qr*qr)<v.MINDRAG&&(yr=0,qr=0),[yr,qr]},m.init(Be)},O.updateAngularDrag=function(ce){var q=this,Z=q.gd,ee=q.layers,V=q.radius,oe=q.angularAxis,ie=q.cx,j=q.cy,Q=q.cxx,re=q.cyy,ue=v.angularDragBoxSize,_e=c.makeDragger(ee,"path","angulardrag",ce.dragmode===!1?"none":"move"),we={element:_e,gd:Z};ce.dragmode===!1?we.dragmode=!1:p.select(_e).attr("d",q.pathAnnulus(V,V+ue)).attr("transform",t(ie,j)).call(A,"move");function Re($e,It){return Math.atan2(re+ue-It,$e-Q-ue)}var ze=ee.frontplot.select(".scatterlayer").selectAll(".trace"),Xe=ze.selectAll(".point"),tt=ze.selectAll(".textpoint"),it,et,nt,Ae,me,fe;function Be($e,It){var Pt=q.gd._fullLayout,Vt=Pt[q.id],Wt=it+$e*ce._invScaleX,Cr=et+It*ce._invScaleY,yr=Re(Wt,Cr),qr=I(yr-fe);if(Ae=nt+qr,ee.frontplot.attr("transform",t(q.xOffset2,q.yOffset2)+e([-qr,Q,re])),q.vangles){me=q.radialAxisAngle+qr;var Mr=t(ie,j)+e(-qr),Dr=t(ie,j)+e(-me);ee.bg.attr("transform",Mr),ee["radial-grid"].attr("transform",Mr),ee["radial-axis"].attr("transform",Dr),ee["radial-line"].select("line").attr("transform",Dr),q.updateRadialAxisTitle(Pt,Vt,me)}else q.clipPaths.forTraces.select("path").attr("transform",t(Q,re)+e(qr));Xe.each(function(){var ke=p.select(this),Me=o.getTranslate(ke);ke.attr("transform",t(Me.x,Me.y)+e([qr]))}),tt.each(function(){var ke=p.select(this),Me=ke.select("text"),Le=o.getTranslate(ke);ke.attr("transform",e([qr,Me.attr("x"),Me.attr("y")])+t(Le.x,Le.y))}),oe.rotation=E.modHalf(Ae,360),q.updateAngularAxis(Pt,Vt),q._hasClipOnAxisFalse&&!E.isFullCircle(q.sectorInRad)&&ze.call(o.hideOutsideRangePoints,q);var xt=!1;for(var Ne in q.traceHash)if(S.traceIs(Ne,"gl")){var Ye=q.traceHash[Ne],be=E.filterVisible(Ye),Ie=Ye[0][0].trace._module;Ie.plot(Z,q,be,Vt),be.length&&(xt=!0)}xt&&(M(Z),g(Z));var qe={};Qe(qe),Z.emit("plotly_relayouting",qe)}function Qe($e){$e[q.id+".angularaxis.rotation"]=Ae,q.vangles&&($e[q.id+".radialaxis.angle"]=me)}function at(){tt.select("text").attr("transform",null);var $e={};Qe($e),S.call("_guiRelayout",Z,$e)}we.prepFn=function($e,It,Pt){var Vt=ce[q.id];nt=Vt.angularaxis.rotation;var Wt=_e.getBoundingClientRect();it=It-Wt.left,et=Pt-Wt.top,Z._fullLayout._calcInverseTransform(Z);var Cr=E.apply3DTransform(ce._invTransform)(it,et);it=Cr[0],et=Cr[1],fe=Re(it,et),we.moveFn=Be,we.doneFn=at,w(Z)},q.vangles&&!E.isFullCircle(q.sectorInRad)&&(we.prepFn=E.noop,A(p.select(_e),null)),m.init(we)},O.isPtInside=function(ce){if(this.isSmith)return!0;var q=this.sectorInRad,Z=this.vangles,ee=this.angularAxis.c2g(ce.theta),V=this.radialAxis,oe=V.c2l(ce.r),ie=V._rl,j=Z?u.isPtInsidePolygon:E.isPtInsideSector;return j(oe,ee,ie,q,Z)},O.pathArc=function(ce){var q=this.sectorInRad,Z=this.vangles,ee=Z?u.pathPolygon:E.pathArc;return ee(ce,q[0],q[1],Z)},O.pathSector=function(ce){var q=this.sectorInRad,Z=this.vangles,ee=Z?u.pathPolygon:E.pathSector;return ee(ce,q[0],q[1],Z)},O.pathAnnulus=function(ce,q){var Z=this.sectorInRad,ee=this.vangles,V=ee?u.pathPolygonAnnulus:E.pathAnnulus;return V(ce,q,Z[0],Z[1],ee)},O.pathSubplot=function(){var ce=this.innerRadius,q=this.radius;return ce?this.pathAnnulus(ce,q):this.pathSector(q)},O.fillViewInitialKey=function(ce,q){ce in this.viewInitial||(this.viewInitial[ce]=q)};function X(ce){var q=ce.ticks+String(ce.ticklen)+String(ce.showticklabels);return"side"in ce&&(q+=ce.side),q}function J(ce){var q=ce[0],Z=ce[1],ee=Z-q,V=N(q,360),oe=V+ee,ie=Math.cos(B(V)),j=Math.sin(B(V)),Q=Math.cos(B(oe)),re=Math.sin(B(oe)),ue,_e,we,Re;return V<=90&&oe>=90||V>90&&oe>=450?Re=1:j<=0&&re<=0?Re=0:Re=Math.max(j,re),V<=180&&oe>=180||V>180&&oe>=540?ue=-1:ie>=0&&Q>=0?ue=0:ue=Math.min(ie,Q),V<=270&&oe>=270||V>270&&oe>=630?_e=-1:j>=0&&re>=0?_e=0:_e=Math.min(j,re),oe>=360?we=1:ie<=0&&Q<=0?we=0:we=Math.max(ie,Q),[ue,_e,we,Re]}function se(ce,q){var Z=function(V){return E.angleDist(ce,V)},ee=E.findIndexOfMin(q,Z);return q[ee]}function le(ce,q,Z){return q?(ce.attr("display",null),ce.attr(Z)):ce&&ce.attr("display","none"),ce}}}),VA=De({"src/plots/polar/layout_attributes.js"(Y,H){"use strict";var p=Pf(),x=Ih(),S=Ec().attributes,E=ui().extendFlat,e=gc().overrideAll,t=e({color:x.color,showline:E({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:E({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({tickmode:x.minor.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,ticklabelstep:x.ticklabelstep,showticklabels:x.showticklabels,labelalias:x.labelalias,minorloglabels:x.minorloglabels,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,showexponent:x.showexponent,exponentformat:x.exponentformat,minexponent:x.minexponent,separatethousands:x.separatethousands,tickfont:x.tickfont,tickangle:x.tickangle,tickformat:x.tickformat,tickformatstops:x.tickformatstops,layer:x.layer},"plot","from-root"),o={visible:E({},x.visible,{dflt:!0}),type:E({},x.type,{values:["-","linear","log","date","category"]}),autotypenumbers:x.autotypenumbers,autorangeoptions:{minallowed:x.autorangeoptions.minallowed,maxallowed:x.autorangeoptions.maxallowed,clipmin:x.autorangeoptions.clipmin,clipmax:x.autorangeoptions.clipmax,include:x.autorangeoptions.include,editType:"plot"},autorange:E({},x.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:E({},x.minallowed,{editType:"plot"}),maxallowed:E({},x.maxallowed,{editType:"plot"}),range:E({},x.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:x.categoryorder,categoryarray:x.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:x.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:E({},x.title.text,{editType:"plot",dflt:""}),font:E({},x.title.font,{editType:"plot"}),editType:"plot"},hoverformat:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(o,t,r);var i={visible:E({},x.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:x.autotypenumbers,categoryorder:x.categoryorder,categoryarray:x.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:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(i,t,r),H.exports={domain:S({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:p.background},radialaxis:o,angularaxis:i,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),Z4=De({"src/plots/polar/layout_defaults.js"(Y,H){"use strict";var p=ui(),x=vo(),S=Gl(),E=Kp(),e=Lh().getSubplotData,t=U0(),r=Zm(),o=qp(),i=Hp(),n=D_(),a=gy(),s=Ww(),h=$m(),c=VA(),m=NA(),d=Fb(),T=d.axisNames;function l(w,A,M,g){var b=M("bgcolor");g.bgColor=x.combine(b,g.paper_bgcolor);var v=M("sector");M("hole");var u=e(g.fullData,d.name,g.id),y=g.layoutOut,f;function R(_e,we){return M(f+"."+_e,we)}for(var L=0;L<T.length;L++){f=T[L],p.isPlainObject(w[f])||(w[f]={});var z=w[f],F=S.newContainer(A,f);F._id=F._name=f,F._attr=g.id+"."+f,F._traceIndices=u.map(function(_e){return _e.index});var N=d.axisName2dataArray[f],B=_(z,F,R,u,N,g);n(z,F,R,{axData:u,dataAttr:N});var I=R("visible");switch(m(F,A,y),R("uirevision",A.uirevision),F._m=1,f){case"radialaxis":R("minallowed"),R("maxallowed");var U=R("range"),O=F.getAutorangeDflt(U),X=R("autorange",O),J;U&&(U[0]===null&&U[1]===null||(U[0]===null||U[1]===null)&&(X==="reversed"||X===!0)||U[0]!==null&&(X==="min"||X==="max reversed")||U[1]!==null&&(X==="max"||X==="min reversed"))&&(U=void 0,delete F.range,F.autorange=!0,J=!0),J||(O=F.getAutorangeDflt(U),X=R("autorange",O)),z.autorange=X,X&&(s(R,X,U),(B==="linear"||B==="-")&&R("rangemode"),F.isReversed()&&(F._m=-1)),F.cleanRange("range",{dfltRange:[0,1]});break;case"angularaxis":if(B==="date"){p.log("Polar plots do not support date angular axes yet.");for(var se=0;se<u.length;se++)u[se].visible=!1;B=z.type=F.type="linear"}R(B==="linear"?"thetaunit":"period");var le=R("direction");R("rotation",{counterclockwise:0,clockwise:90}[le]);break}if(i(z,F,R,F.type,{tickSuffixDflt:F.thetaunit==="degrees"?"\xB0":void 0}),I){var ce,q,Z,ee,V,oe,ie,j,Q,re,ue=g.font||{};ce=R("color"),q=ce===z.color?ce:ue.color,Z=ue.size,ee=ue.family,V=ue.weight,oe=ue.style,ie=ue.variant,j=ue.textcase,Q=ue.lineposition,re=ue.shadow,t(z,F,R,F.type),o(z,F,R,F.type,{font:{weight:V,style:oe,variant:ie,textcase:j,lineposition:Q,shadow:re,color:q,size:Z,family:ee},noAutotickangles:f==="angularaxis",noTicklabelshift:!0,noTicklabelstandoff:!0}),r(z,F,R,{outerTicks:!0}),a(z,F,R,{dfltColor:ce,bgColor:g.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:c[f]}),R("layer"),f==="radialaxis"&&(R("side"),R("angle",v[0]),R("title.text"),p.coerceFont(R,"title.font",{weight:V,style:oe,variant:ie,textcase:j,lineposition:Q,shadow:re,color:q,size:p.bigFont(Z),family:ee}))}B!=="category"&&R("hoverformat"),F._input=z}A.angularaxis.type==="category"&&M("gridshape")}function _(w,A,M,g,b,v){var u=M("autotypenumbers",v.autotypenumbersDflt),y=M("type");if(y==="-"){for(var f,R=0;R<g.length;R++)if(g[R].visible){f=g[R];break}f&&f[b]&&(A.type=h(f[b],"gregorian",{noMultiCategory:!0,autotypenumbers:u})),A.type==="-"?A.type="linear":w.type=A.type}return A.type}H.exports=function(A,M,g){E(A,M,g,{type:d.name,attributes:c,handleDefaults:l,font:M.font,autotypenumbersDflt:M.autotypenumbers,paper_bgcolor:M.paper_bgcolor,fullData:g,layoutOut:M})}}}),Ob=De({"src/plots/polar/index.js"(Y,H){"use strict";var p=Lh().getSubplotCalcData,x=ui().counterRegex,S=jA(),E=Fb(),e=E.attr,t=E.name,r=x(t),o={};o[e]={valType:"subplotid",dflt:t,editType:"calc"};function i(a){for(var s=a._fullLayout,h=a.calcdata,c=s._subplots[t],m=0;m<c.length;m++){var d=c[m],T=p(h,t,d),l=s[d]._subplot;l||(l=S(a,d),s[d]._subplot=l),l.plot(T,s,a._promises)}}function n(a,s,h,c){for(var m=c._subplots[t]||[],d=c._has&&c._has("gl"),T=s._has&&s._has("gl"),l=d&&!T,_=0;_<m.length;_++){var w=m[_],A=c[w]._subplot;if(!s[w]&&A){A.framework.remove(),A.layers["radial-axis-title"].remove();for(var M in A.clipPaths)A.clipPaths[M].remove()}l&&A._scene&&(A._scene.destroy(),A._scene=null)}}H.exports={attr:e,name:t,idRoot:t,idRegex:r,attrRegex:r,attributes:o,layoutAttributes:VA(),supplyLayoutDefaults:Z4(),plot:i,clean:n,toSVG:Gf().toSVG}}}),f1=De({"src/traces/scatterpolar/attributes.js"(Y,H){"use strict";var{hovertemplateAttrs:p,texttemplateAttrs:x,templatefallbackAttrs:S}=ou(),E=Xo().extendFlat,e=vv(),t=lf(),r=Yl(),o=t.line;H.exports={mode:t.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:t.text,texttemplate:x({editType:"plot"},{keys:["r","theta","text"]}),texttemplatefallback:S({editType:"plot"}),hovertext:t.hovertext,line:{color:o.color,width:o.width,dash:o.dash,backoff:o.backoff,shape:E({},o.shape,{values:["linear","spline"]}),smoothing:o.smoothing,editType:"calc"},connectgaps:t.connectgaps,marker:t.marker,cliponaxis:E({},t.cliponaxis,{dflt:!1}),textposition:t.textposition,textfont:t.textfont,fill:E({},t.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:e(),hoverinfo:E({},r.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:t.hoveron,hovertemplate:p(),hovertemplatefallback:S(),selected:t.selected,unselected:t.unselected}}}),Nb=De({"src/traces/scatterpolar/defaults.js"(Y,H){"use strict";var p=ui(),x=Hu(),S=Od(),E=Wd(),e=eg(),t=Xd(),r=mv(),o=zv().PTS_LINESONLY,i=f1();function n(s,h,c,m){function d(_,w){return p.coerce(s,h,i,_,w)}var T=a(s,h,m,d);if(!T){h.visible=!1;return}d("thetaunit"),d("mode",T<o?"lines+markers":"lines"),d("text"),d("hovertext"),h.hoveron!=="fills"&&(d("hovertemplate"),d("hovertemplatefallback")),x.hasMarkers(h)&&S(s,h,c,m,d,{gradient:!0}),x.hasLines(h)&&(E(s,h,c,m,d,{backoff:!0}),e(s,h,d),d("connectgaps")),x.hasText(h)&&(d("texttemplate"),d("texttemplatefallback"),t(s,h,m,d));var l=[];(x.hasMarkers(h)||x.hasText(h))&&(d("cliponaxis"),d("marker.maxdisplayed"),l.push("points")),d("fill"),h.fill!=="none"&&(r(s,h,c,d),x.hasLines(h)||e(s,h,d)),(h.fill==="tonext"||h.fill==="toself")&&l.push("fills"),d("hoveron",l.join("+")||"points"),p.coerceSelectionMarkerOpacity(h,d)}function a(s,h,c,m){var d=m("r"),T=m("theta");p.isTypedArray(d)&&(h.r=d=Array.from(d)),p.isTypedArray(T)&&(h.theta=T=Array.from(T));var l;if(d)T?l=Math.min(d.length,T.length):(l=d.length,m("theta0"),m("dtheta"));else{if(!T)return 0;l=h.theta.length,m("r0"),m("dr")}return h._length=l,l}H.exports={handleRThetaDefaults:a,supplyDefaults:n}}}),Ub=De({"src/traces/scatterpolar/format_labels.js"(Y,H){"use strict";var p=ui(),x=us();H.exports=function(E,e,t){var r={},o=t[e.subplot]._subplot,i,n;o?(i=o.radialAxis,n=o.angularAxis):(o=t[e.subplot],i=o.radialaxis,n=o.angularaxis);var a=i.c2l(E.r);r.rLabel=x.tickText(i,a,!0).text;var s=n.thetaunit==="degrees"?p.rad2deg(E.theta):E.theta;return r.thetaLabel=x.tickText(n,s,!0).text,r}}}),K4=De({"src/traces/scatterpolar/calc.js"(Y,H){"use strict";var p=vn(),x=zn().BADNUM,S=us(),E=Yd(),e=Fv(),t=Zd(),r=Kd().calcMarkerSize;H.exports=function(i,n){for(var a=i._fullLayout,s=n.subplot,h=a[s].radialaxis,c=a[s].angularaxis,m=h.makeCalcdata(n,"r"),d=c.makeCalcdata(n,"theta"),T=n._length,l=new Array(T),_=0;_<T;_++){var w=m[_],A=d[_],M=l[_]={};p(w)&&p(A)?(M.r=w,M.theta=A):M.r=x}var g=r(n,T);return n._extremes.x=S.findExtremes(h,m,{ppad:g}),E(i,n),e(l,n),t(l,n),l}}}),$4=De({"src/traces/scatterpolar/plot.js"(Y,H){"use strict";var p=tg(),x=zn().BADNUM;H.exports=function(E,e,t){for(var r=e.layers.frontplot.select("g.scatterlayer"),o=e.xaxis,i=e.yaxis,n={xaxis:o,yaxis:i,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},a=e.radialAxis,s=e.angularAxis,h=0;h<t.length;h++)for(var c=t[h],m=0;m<c.length;m++){m===0&&(c[0].trace._xA=o,c[0].trace._yA=i);var d=c[m],T=d.r;if(T===x)d.x=d.y=x;else{var l=a.c2g(T),_=s.c2g(d.theta);d.x=l*Math.cos(_),d.y=l*Math.sin(_)}}p(E,n,t,r)}}}),jb=De({"src/traces/scatterpolar/hover.js"(Y,H){"use strict";var p=ig();function x(E,e,t,r){var o=p(E,e,t,r);if(!(!o||o[0].index===!1)){var i=o[0];if(i.index===void 0)return o;var n=E.subplot,a=i.cd[i.index],s=i.trace;if(n.isPtInside(a))return i.xLabelVal=void 0,i.yLabelVal=void 0,S(a,s,n,i),i.hovertemplate=s.hovertemplate,o}}function S(E,e,t,r){var o=t.radialAxis,i=t.angularAxis;o._hovertitle="r",i._hovertitle="\u03B8";var n={};n[e.subplot]={_subplot:t};var a=e._module.formatLabels(E,e,n);r.rLabel=a.rLabel,r.thetaLabel=a.thetaLabel;var s=E.hi||e.hoverinfo,h=[];function c(d,T){h.push(d._hovertitle+": "+T)}if(!e.hovertemplate){var m=s.split("+");m.indexOf("all")!==-1&&(m=["r","theta","text"]),m.indexOf("r")!==-1&&c(o,r.rLabel),m.indexOf("theta")!==-1&&c(i,r.thetaLabel),m.indexOf("text")!==-1&&r.text&&(h.push(r.text),delete r.text),r.extraText=h.join("<br>")}}H.exports={hoverPoints:x,makeHoverPointText:S}}}),J4=De({"src/traces/scatterpolar/index.js"(Y,H){"use strict";H.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:Ob(),categories:["polar","symbols","showLegend","scatter-like"],attributes:f1(),supplyDefaults:Nb().supplyDefaults,colorbar:qh(),formatLabels:Ub(),calc:K4(),plot:$4(),style:Sd().style,styleOnSelect:Sd().styleOnSelect,hoverPoints:jb().hoverPoints,selectPoints:ag(),meta:{}}}}),Q4=De({"lib/scatterpolar.js"(Y,H){"use strict";H.exports=J4()}}),qA=De({"src/traces/scatterpolargl/attributes.js"(Y,H){"use strict";var p=f1(),{cliponaxis:x,hoveron:S}=p,E=bi(p,["cliponaxis","hoveron"]),{connectgaps:e,line:{color:t,dash:r,width:o},fill:i,fillcolor:n,marker:a,textfont:s,textposition:h}=r1();H.exports=yi(Ri({},E),{connectgaps:e,fill:i,fillcolor:n,line:{color:t,dash:r,editType:"calc",width:o},marker:a,textfont:s,textposition:h})}}),ez=De({"src/traces/scatterpolargl/defaults.js"(Y,H){"use strict";var p=ui(),x=Hu(),S=Nb().handleRThetaDefaults,E=Od(),e=Wd(),t=Xd(),r=mv(),o=zv().PTS_LINESONLY,i=qA();H.exports=function(a,s,h,c){function m(T,l){return p.coerce(a,s,i,T,l)}var d=S(a,s,c,m);if(!d){s.visible=!1;return}m("thetaunit"),m("mode",d<o?"lines+markers":"lines"),m("text"),m("hovertext"),s.hoveron!=="fills"&&(m("hovertemplate"),m("hovertemplatefallback")),x.hasMarkers(s)&&E(a,s,h,c,m,{noAngleRef:!0,noLineDash:!0,noStandOff:!0}),x.hasLines(s)&&(e(a,s,h,c,m),m("connectgaps")),x.hasText(s)&&(m("texttemplate"),m("texttemplatefallback"),t(a,s,c,m,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0})),m("fill"),s.fill!=="none"&&r(a,s,h,m),p.coerceSelectionMarkerOpacity(s,m)}}}),tz=De({"src/traces/scatterpolargl/format_labels.js"(Y,H){"use strict";var p=Ub();H.exports=function(S,E,e){var t=S.i;return"r"in S||(S.r=E._r[t]),"theta"in S||(S.theta=E._theta[t]),p(S,E,e)}}}),rz=De({"src/traces/scatterpolargl/calc.js"(Y,H){"use strict";var p=Yd(),x=Kd().calcMarkerSize,S=um(),E=us(),e=l0().TOO_MANY_POINTS;H.exports=function(r,o){var i=r._fullLayout,n=o.subplot,a=i[n].radialaxis,s=i[n].angularaxis,h=o._r=a.makeCalcdata(o,"r"),c=o._theta=s.makeCalcdata(o,"theta"),m=o._length,d={};m<h.length&&(h=h.slice(0,m)),m<c.length&&(c=c.slice(0,m)),d.r=h,d.theta=c,p(r,o);var T=d.opts=S.style(r,o),l;return m<e?l=x(o,m):T.marker&&(l=2*(T.marker.sizeAvg||Math.max(T.marker.size,3))),o._extremes.x=E.findExtremes(a,h,{ppad:l}),[{x:!1,y:!1,t:d,trace:o}]}}}),iz=De({"src/traces/scatterpolargl/hover.js"(Y,H){"use strict";var p=pb(),x=jb().makeHoverPointText;function S(E,e,t,r){var o=E.cd,i=o[0].t,n=i.r,a=i.theta,s=p.hoverPoints(E,e,t,r);if(!(!s||s[0].index===!1)){var h=s[0];if(h.index===void 0)return s;var c=E.subplot,m=h.cd[h.index],d=h.trace;if(m.r=n[h.index],m.theta=a[h.index],!!c.isPtInside(m))return h.xLabelVal=void 0,h.yLabelVal=void 0,x(m,d,c,h),s}}H.exports={hoverPoints:S}}}),az=De({"src/traces/scatterpolargl/base_index.js"(Y,H){"use strict";H.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:Ob(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:qA(),supplyDefaults:ez(),colorbar:qh(),formatLabels:tz(),calc:rz(),hoverPoints:iz().hoverPoints,selectPoints:A5(),meta:{}}}}),nz=De({"src/traces/scatterpolargl/plot.js"(Y,H){"use strict";var p=gb(),x=vn(),S=Y5(),E=w5(),e=um(),t=ui(),r=l0().TOO_MANY_POINTS,o={};H.exports=function(n,a,s){if(s.length){var h=a.radialAxis,c=a.angularAxis,m=E(n,a);return s.forEach(function(d){if(!(!d||!d[0]||!d[0].trace)){var T=d[0],l=T.trace,_=T.t,w=l._length,A=_.r,M=_.theta,g=_.opts,b,v=A.slice(),u=M.slice();for(b=0;b<A.length;b++)a.isPtInside({r:A[b],theta:M[b]})||(v[b]=NaN,u[b]=NaN);var y=new Array(w*2),f=Array(w),R=Array(w);for(b=0;b<w;b++){var L=v[b],z,F;if(x(L)){var N=h.c2g(L),B=c.c2g(u[b],l.thetaunit);z=N*Math.cos(B),F=N*Math.sin(B)}else z=F=NaN;f[b]=y[b*2]=z,R[b]=y[b*2+1]=F}_.tree=p(y),g.marker&&w>=r&&(g.marker.cluster=_.tree),g.marker&&(g.markerSel.positions=g.markerUnsel.positions=g.marker.positions=y),g.line&&y.length>1&&t.extendFlat(g.line,e.linePositions(n,l,y)),g.text&&(t.extendFlat(g.text,{positions:y},e.textPosition(n,l,g.text,g.marker)),t.extendFlat(g.textSel,{positions:y},e.textPosition(n,l,g.text,g.markerSel)),t.extendFlat(g.textUnsel,{positions:y},e.textPosition(n,l,g.text,g.markerUnsel))),g.fill&&!m.fill2d&&(m.fill2d=!0),g.marker&&!m.scatter2d&&(m.scatter2d=!0),g.line&&!m.line2d&&(m.line2d=!0),g.text&&!m.glText&&(m.glText=!0),m.lineOptions.push(g.line),m.fillOptions.push(g.fill),m.markerOptions.push(g.marker),m.markerSelectedOptions.push(g.markerSel),m.markerUnselectedOptions.push(g.markerUnsel),m.textOptions.push(g.text),m.textSelectedOptions.push(g.textSel),m.textUnselectedOptions.push(g.textUnsel),m.selectBatch.push([]),m.unselectBatch.push([]),_.x=f,_.y=R,_.rawx=f,_.rawy=R,_.r=A,_.theta=M,_.positions=y,_._scene=m,_.index=m.count,m.count++}}),S(n,a,s)}},H.exports.reglPrecompiled=o}}),oz=De({"src/traces/scatterpolargl/index.js"(Y,H){"use strict";var p=az();p.plot=nz(),H.exports=p}}),sz=De({"lib/scatterpolargl.js"(Y,H){"use strict";H.exports=oz()}}),HA=De({"src/traces/barpolar/attributes.js"(Y,H){"use strict";var{hovertemplateAttrs:p,templatefallbackAttrs:x}=ou(),S=Xo().extendFlat,E=f1(),e=Bv();H.exports={r:E.r,theta:E.theta,r0:E.r0,dr:E.dr,theta0:E.theta0,dtheta:E.dtheta,thetaunit:E.thetaunit,base:S({},e.base,{}),offset:S({},e.offset,{}),width:S({},e.width,{}),text:S({},e.text,{}),hovertext:S({},e.hovertext,{}),marker:t(),hoverinfo:E.hoverinfo,hovertemplate:p(),hovertemplatefallback:x(),selected:e.selected,unselected:e.unselected};function t(){var r=S({},e.marker);return delete r.cornerradius,r}}}),GA=De({"src/traces/barpolar/layout_attributes.js"(Y,H){"use strict";H.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),lz=De({"src/traces/barpolar/defaults.js"(Y,H){"use strict";var p=ui(),x=Nb().handleRThetaDefaults,S=q_(),E=HA();H.exports=function(t,r,o,i){function n(s,h){return p.coerce(t,r,E,s,h)}var a=x(t,r,i,n);if(!a){r.visible=!1;return}n("thetaunit"),n("base"),n("offset"),n("width"),n("text"),n("hovertext"),n("hovertemplate"),n("hovertemplatefallback"),S(t,r,n,o,i),p.coerceSelectionMarkerOpacity(r,n)}}}),uz=De({"src/traces/barpolar/layout_defaults.js"(Y,H){"use strict";var p=ui(),x=GA();H.exports=function(S,E,e){var t={},r;function o(a,s){return p.coerce(S[r]||{},E[r],x,a,s)}for(var i=0;i<e.length;i++){var n=e[i];n.type==="barpolar"&&n.visible===!0&&(r=n.subplot,t[r]||(o("barmode"),o("bargap"),t[r]=1))}}}}),WA=De({"src/traces/barpolar/calc.js"(Y,H){"use strict";var p=$h().hasColorscale,x=Jh(),S=ui().isArrayOrTypedArray,E=xy(),e=G0().setGroupPositions,t=Zd(),r=Mo().traceIs,o=ui().extendFlat;function i(a,s){for(var h=a._fullLayout,c=s.subplot,m=h[c].radialaxis,d=h[c].angularaxis,T=m.makeCalcdata(s,"r"),l=d.makeCalcdata(s,"theta"),_=s._length,w=new Array(_),A=T,M=l,g=0;g<_;g++)w[g]={p:M[g],s:A[g]};function b(v){var u=s[v];u!==void 0&&(s["_"+v]=S(u)?d.makeCalcdata(s,v):d.d2c(u,s.thetaunit))}return d.type==="linear"&&(b("width"),b("offset")),p(s,"marker")&&x(a,s,{vals:s.marker.color,containerStr:"marker",cLetter:"c"}),p(s,"marker.line")&&x(a,s,{vals:s.marker.line.color,containerStr:"marker.line",cLetter:"c"}),E(w,s),t(w,s),w}function n(a,s,h){for(var c=a.calcdata,m=[],d=0;d<c.length;d++){var T=c[d],l=T[0].trace;l.visible===!0&&r(l,"bar")&&l.subplot===h&&m.push(T)}var _=o({},s.radialaxis,{_id:"x"}),w=s.angularaxis;e(a,w,_,m,{mode:s.barmode,norm:s.barnorm,gap:s.bargap,groupgap:s.bargroupgap})}H.exports={calc:i,crossTraceCalc:n}}}),cz=De({"src/traces/barpolar/plot.js"(Y,H){"use strict";var p=za(),x=vn(),S=ui(),E=ys(),e=Bb();H.exports=function(o,i,n){var a=o._context.staticPlot,s=i.xaxis,h=i.yaxis,c=i.radialAxis,m=i.angularAxis,d=t(i),T=i.layers.frontplot.select("g.barlayer");S.makeTraceGroups(T,n,"trace bars").each(function(){var l=p.select(this),_=S.ensureSingle(l,"g","points"),w=_.selectAll("g.point").data(S.identity);w.enter().append("g").style("vector-effect",a?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),w.exit().remove(),w.each(function(A){var M=p.select(this),g=A.rp0=c.c2p(A.s0),b=A.rp1=c.c2p(A.s1),v=A.thetag0=m.c2g(A.p0),u=A.thetag1=m.c2g(A.p1),y;if(!x(g)||!x(b)||!x(v)||!x(u)||g===b||v===u)y="M0,0Z";else{var f=c.c2g(A.s1),R=(v+u)/2;A.ct=[s.c2p(f*Math.cos(R)),h.c2p(f*Math.sin(R))],y=d(g,b,v,u)}S.ensureSingle(M,"path").attr("d",y)}),E.setClipUrl(l,i._hasClipOnAxisFalse?i.clipIds.forTraces:null,o)})};function t(r){var o=r.cxx,i=r.cyy;return r.vangles?function(n,a,s,h){var c,m;S.angleDelta(s,h)>0?(c=s,m=h):(c=h,m=s);var d=e.findEnclosingVertexAngles(c,r.vangles)[0],T=e.findEnclosingVertexAngles(m,r.vangles)[1],l=[d,(c+m)/2,T];return e.pathPolygonAnnulus(n,a,c,m,l,o,i)}:function(n,a,s,h){return S.pathAnnulus(n,a,s,h,o,i)}}}}),fz=De({"src/traces/barpolar/hover.js"(Y,H){"use strict";var p=sf(),x=ui(),S=ng().getTraceColor,E=x.fillText,e=jb().makeHoverPointText,t=Bb().isPtInsidePolygon;H.exports=function(o,i,n){var a=o.cd,s=a[0].trace,h=o.subplot,c=h.radialAxis,m=h.angularAxis,d=h.vangles,T=d?t:x.isPtInsideSector,l=o.maxHoverDistance,_=m._period||2*Math.PI,w=Math.abs(c.g2p(Math.sqrt(i*i+n*n))),A=Math.atan2(n,i);c.range[0]>c.range[1]&&(A+=Math.PI);var M=function(u){return T(w,A,[u.rp0,u.rp1],[u.thetag0,u.thetag1],d)?l+Math.min(1,Math.abs(u.thetag1-u.thetag0)/_)-1+(u.rp1-w)/(u.rp1-u.rp0)-1:1/0};if(p.getClosest(a,M,o),o.index!==!1){var g=o.index,b=a[g];o.x0=o.x1=b.ct[0],o.y0=o.y1=b.ct[1];var v=x.extendFlat({},b,{r:b.s,theta:b.p});return E(b,s,o),e(v,s,h,o),o.hovertemplate=s.hovertemplate,o.color=S(s,b),o.xLabelVal=o.yLabelVal=void 0,b.s<0&&(o.idealAlign="left"),[o]}}}}),hz=De({"src/traces/barpolar/index.js"(Y,H){"use strict";H.exports={moduleType:"trace",name:"barpolar",basePlotModule:Ob(),categories:["polar","bar","showLegend"],attributes:HA(),layoutAttributes:GA(),supplyDefaults:lz(),supplyLayoutDefaults:uz(),calc:WA().calc,crossTraceCalc:WA().crossTraceCalc,plot:cz(),colorbar:qh(),formatLabels:Ub(),style:$d().style,styleOnSelect:$d().styleOnSelect,hoverPoints:fz(),selectPoints:og(),meta:{}}}}),dz=De({"lib/barpolar.js"(Y,H){"use strict";H.exports=hz()}}),XA=De({"src/plots/smith/constants.js"(Y,H){"use strict";H.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),YA=De({"src/plots/smith/layout_attributes.js"(Y,H){"use strict";var p=Pf(),x=Ih(),S=Ec().attributes,E=ui().extendFlat,e=gc().overrideAll,t=e({color:x.color,showline:E({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:E({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({ticklen:x.ticklen,tickwidth:E({},x.tickwidth,{dflt:2}),tickcolor:x.tickcolor,showticklabels:x.showticklabels,labelalias:x.labelalias,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,tickfont:x.tickfont,tickformat:x.tickformat,hoverformat:x.hoverformat,layer:x.layer},"plot","from-root"),o=E({visible:E({},x.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:E({},x.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},t,r),i=E({visible:E({},x.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:x.ticks,editType:"calc"},t,r);H.exports={domain:S({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:p.background},realaxis:o,imaginaryaxis:i,editType:"calc"}}}),vz=De({"src/plots/smith/layout_defaults.js"(Y,H){"use strict";var p=ui(),x=vo(),S=Gl(),E=Kp(),e=Lh().getSubplotData,t=Hp(),r=qp(),o=gy(),i=Dv(),n=YA(),a=XA(),s=a.axisNames,h=m(function(d){return p.isTypedArray(d)&&(d=Array.from(d)),d.slice().reverse().map(function(T){return-T}).concat([0]).concat(d)},String);function c(d,T,l,_){var w=l("bgcolor");_.bgColor=x.combine(w,_.paper_bgcolor);var A=e(_.fullData,a.name,_.id),M=_.layoutOut,g;function b(O,X){return l(g+"."+O,X)}for(var v=0;v<s.length;v++){g=s[v],p.isPlainObject(d[g])||(d[g]={});var u=d[g],y=S.newContainer(T,g);y._id=y._name=g,y._attr=_.id+"."+g,y._traceIndices=A.map(function(O){return O.index});var f=b("visible");if(y.type="linear",i(y,M),t(u,y,b,y.type),f){var R=g==="realaxis";if(R&&b("side"),R)b("tickvals");else{var L=h(T.realaxis.tickvals||n.realaxis.tickvals.dflt);b("tickvals",L)}p.isTypedArray(y.tickvals)&&(y.tickvals=Array.from(y.tickvals));var z,F,N,B,I=_.font||{};f&&(z=b("color"),F=z===u.color?z:I.color,N=I.size,B=I.family),r(u,y,b,y.type,{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noAng:!R,noExp:!0,font:{color:F,size:N,family:B}}),p.coerce2(d,T,n,g+".ticklen"),p.coerce2(d,T,n,g+".tickwidth"),p.coerce2(d,T,n,g+".tickcolor",T.color);var U=b("ticks");U||(delete T[g].ticklen,delete T[g].tickwidth,delete T[g].tickcolor),o(u,y,b,{dfltColor:z,bgColor:_.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:n[g]}),b("layer")}b("hoverformat"),delete y.type,y._input=u}}H.exports=function(T,l,_){E(T,l,_,{noUirevision:!0,type:a.name,attributes:n,handleDefaults:c,font:l.font,paper_bgcolor:l.paper_bgcolor,fullData:_,layoutOut:l})};function m(d,T){var l={};return function(_){var w=T?T(_):_;if(w in l)return l[w];var A=d(_);return l[w]=A,A}}}}),pz=De({"src/plots/smith/index.js"(Y,H){"use strict";var p=Lh().getSubplotCalcData,x=ui().counterRegex,S=jA(),E=XA(),e=E.attr,t=E.name,r=x(t),o={};o[e]={valType:"subplotid",dflt:t,editType:"calc"};function i(a){for(var s=a._fullLayout,h=a.calcdata,c=s._subplots[t],m=0;m<c.length;m++){var d=c[m],T=p(h,t,d),l=s[d]._subplot;l||(l=S(a,d,!0),s[d]._subplot=l),l.plot(T,s,a._promises)}}function n(a,s,h,c){for(var m=c._subplots[t]||[],d=0;d<m.length;d++){var T=m[d],l=c[T]._subplot;if(!s[T]&&l){l.framework.remove();for(var _ in l.clipPaths)l.clipPaths[_].remove()}}}H.exports={attr:e,name:t,idRoot:t,idRegex:r,attrRegex:r,attributes:o,layoutAttributes:YA(),supplyLayoutDefaults:vz(),plot:i,clean:n,toSVG:Gf().toSVG}}}),ZA=De({"src/traces/scattersmith/attributes.js"(Y,H){"use strict";var{hovertemplateAttrs:p,texttemplateAttrs:x,templatefallbackAttrs:S}=ou(),E=Xo().extendFlat,e=vv(),t=lf(),r=Yl(),o=t.line;H.exports={mode:t.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:t.text,texttemplate:x({editType:"plot"},{keys:["real","imag","text"]}),texttemplatefallback:S({editType:"plot"}),hovertext:t.hovertext,line:{color:o.color,width:o.width,dash:o.dash,backoff:o.backoff,shape:E({},o.shape,{values:["linear","spline"]}),smoothing:o.smoothing,editType:"calc"},connectgaps:t.connectgaps,marker:t.marker,cliponaxis:E({},t.cliponaxis,{dflt:!1}),textposition:t.textposition,textfont:t.textfont,fill:E({},t.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:e(),hoverinfo:E({},r.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:t.hoveron,hovertemplate:p(),hovertemplatefallback:S(),selected:t.selected,unselected:t.unselected}}}),mz=De({"src/traces/scattersmith/defaults.js"(Y,H){"use strict";var p=ui(),x=Hu(),S=Od(),E=Wd(),e=eg(),t=Xd(),r=mv(),o=zv().PTS_LINESONLY,i=ZA();H.exports=function(s,h,c,m){function d(_,w){return p.coerce(s,h,i,_,w)}var T=n(s,h,m,d);if(!T){h.visible=!1;return}d("mode",T<o?"lines+markers":"lines"),d("text"),d("hovertext"),h.hoveron!=="fills"&&(d("hovertemplate"),d("hovertemplatefallback")),x.hasMarkers(h)&&S(s,h,c,m,d,{gradient:!0}),x.hasLines(h)&&(E(s,h,c,m,d,{backoff:!0}),e(s,h,d),d("connectgaps")),x.hasText(h)&&(d("texttemplate"),d("texttemplatefallback"),t(s,h,m,d));var l=[];(x.hasMarkers(h)||x.hasText(h))&&(d("cliponaxis"),d("marker.maxdisplayed"),l.push("points")),d("fill"),h.fill!=="none"&&(r(s,h,c,d),x.hasLines(h)||e(s,h,d)),(h.fill==="tonext"||h.fill==="toself")&&l.push("fills"),d("hoveron",l.join("+")||"points"),p.coerceSelectionMarkerOpacity(h,d)};function n(a,s,h,c){var m=c("real"),d=c("imag"),T;return m&&d&&(T=Math.min(m.length,d.length)),p.isTypedArray(m)&&(s.real=m=Array.from(m)),p.isTypedArray(d)&&(s.imag=d=Array.from(d)),s._length=T,T}}}),gz=De({"src/traces/scattersmith/format_labels.js"(Y,H){"use strict";var p=us();H.exports=function(S,E,e){var t={},r=e[E.subplot]._subplot;return t.realLabel=p.tickText(r.radialAxis,S.real,!0).text,t.imagLabel=p.tickText(r.angularAxis,S.imag,!0).text,t}}}),yz=De({"src/traces/scattersmith/calc.js"(Y,H){"use strict";var p=vn(),x=zn().BADNUM,S=Yd(),E=Fv(),e=Zd(),t=Kd().calcMarkerSize;H.exports=function(o,i){for(var n=o._fullLayout,a=i.subplot,s=n[a].realaxis,h=n[a].imaginaryaxis,c=s.makeCalcdata(i,"real"),m=h.makeCalcdata(i,"imag"),d=i._length,T=new Array(d),l=0;l<d;l++){var _=c[l],w=m[l],A=T[l]={};p(_)&&p(w)?(A.real=_,A.imag=w):A.real=x}return t(i,d),S(o,i),E(T,i),e(T,i),T}}}),_z=De({"src/traces/scattersmith/plot.js"(Y,H){"use strict";var p=tg(),x=zn().BADNUM,S=UA(),E=S.smith;H.exports=function(t,r,o){for(var i=r.layers.frontplot.select("g.scatterlayer"),n=r.xaxis,a=r.yaxis,s={xaxis:n,yaxis:a,plot:r.framework,layerClipId:r._hasClipOnAxisFalse?r.clipIds.forTraces:null},h=0;h<o.length;h++)for(var c=o[h],m=0;m<c.length;m++){m===0&&(c[0].trace._xA=n,c[0].trace._yA=a);var d=c[m],T=d.real;if(T===x)d.x=d.y=x;else{var l=E([T,d.imag]);d.x=l[0],d.y=l[1]}}p(t,s,o,i)}}}),xz=De({"src/traces/scattersmith/hover.js"(Y,H){"use strict";var p=ig();function x(E,e,t,r){var o=p(E,e,t,r);if(!(!o||o[0].index===!1)){var i=o[0];if(i.index===void 0)return o;var n=E.subplot,a=i.cd[i.index],s=i.trace;if(n.isPtInside(a))return i.xLabelVal=void 0,i.yLabelVal=void 0,S(a,s,n,i),i.hovertemplate=s.hovertemplate,o}}function S(E,e,t,r){var o=t.radialAxis,i=t.angularAxis;o._hovertitle="real",i._hovertitle="imag";var n={};n[e.subplot]={_subplot:t};var a=e._module.formatLabels(E,e,n);r.realLabel=a.realLabel,r.imagLabel=a.imagLabel;var s=E.hi||e.hoverinfo,h=[];function c(d,T){h.push(d._hovertitle+": "+T)}if(!e.hovertemplate){var m=s.split("+");m.indexOf("all")!==-1&&(m=["real","imag","text"]),m.indexOf("real")!==-1&&c(o,r.realLabel),m.indexOf("imag")!==-1&&c(i,r.imagLabel),m.indexOf("text")!==-1&&r.text&&(h.push(r.text),delete r.text),r.extraText=h.join("<br>")}}H.exports={hoverPoints:x,makeHoverPointText:S}}}),bz=De({"src/traces/scattersmith/index.js"(Y,H){"use strict";H.exports={moduleType:"trace",name:"scattersmith",basePlotModule:pz(),categories:["smith","symbols","showLegend","scatter-like"],attributes:ZA(),supplyDefaults:mz(),colorbar:qh(),formatLabels:gz(),calc:yz(),plot:_z(),style:Sd().style,styleOnSelect:Sd().styleOnSelect,hoverPoints:xz().hoverPoints,selectPoints:ag(),meta:{}}}}),wz=De({"lib/scattersmith.js"(Y,H){"use strict";H.exports=bz()}}),td=De({"node_modules/world-calendars/dist/main.js"(Y,H){var p=ih();function x(){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={}}p(x.prototype,{instance:function(o,i){o=(o||"gregorian").toLowerCase(),i=i||"";var n=this._localCals[o+"-"+i];if(!n&&this.calendars[o]&&(n=new this.calendars[o](i),this._localCals[o+"-"+i]=n),!n)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,o);return n},newDate:function(o,i,n,a,s){return a=(o!=null&&o.year?o.calendar():typeof a=="string"?this.instance(a,s):a)||this.instance(),a.newDate(o,i,n)},substituteDigits:function(o){return function(i){return(i+"").replace(/[0-9]/g,function(n){return o[n]})}},substituteChineseDigits:function(o,i){return function(n){for(var a="",s=0;n>0;){var h=n%10;a=(h===0?"":o[h]+i[s])+a,s++,n=Math.floor(n/10)}return a.indexOf(o[1]+i[1])===0&&(a=a.substr(1)),a||o[0]}}});function S(o,i,n,a){if(this._calendar=o,this._year=i,this._month=n,this._day=a,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function E(o,i){return o=""+o,"000000".substring(0,i-o.length)+o}p(S.prototype,{newDate:function(o,i,n){return this._calendar.newDate(o??this,i,n)},year:function(o){return arguments.length===0?this._year:this.set(o,"y")},month:function(o){return arguments.length===0?this._month:this.set(o,"m")},day:function(o){return arguments.length===0?this._day:this.set(o,"d")},date:function(o,i,n){if(!this._calendar.isValid(o,i,n))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=o,this._month=i,this._day=n,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(o,i){return this._calendar.add(this,o,i)},set:function(o,i){return this._calendar.set(this,o,i)},compareTo:function(o){if(this._calendar.name!==o._calendar.name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,o._calendar.local.name);var i=this._year!==o._year?this._year-o._year:this._month!==o._month?this.monthOfYear()-o.monthOfYear():this._day-o._day;return i===0?0:i<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(o){return this._calendar.fromJD(o)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(o){return this._calendar.fromJSDate(o)},toString:function(){return(this.year()<0?"-":"")+E(Math.abs(this.year()),4)+"-"+E(this.month(),2)+"-"+E(this.day(),2)}});function e(){this.shortYearCutoff="+10"}p(e.prototype,{_validateLevel:0,newDate:function(o,i,n){return o==null?this.today():(o.year&&(this._validate(o,i,n,r.local.invalidDate||r.regionalOptions[""].invalidDate),n=o.day(),i=o.month(),o=o.year()),new S(this,o,i,n))},today:function(){return this.fromJSDate(new Date)},epoch:function(o){var i=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return i.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(o){var i=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return(i.year()<0?"-":"")+E(Math.abs(i.year()),4)},monthsInYear:function(o){return this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),12},monthOfYear:function(o,i){var n=this._validate(o,i,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return(n.month()+this.monthsInYear(n)-this.firstMonth)%this.monthsInYear(n)+this.minMonth},fromMonthOfYear:function(o,i){var n=(i+this.firstMonth-2*this.minMonth)%this.monthsInYear(o)+this.minMonth;return this._validate(o,n,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth),n},daysInYear:function(o){var i=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return this.leapYear(i)?366:365},dayOfYear:function(o,i,n){var a=this._validate(o,i,n,r.local.invalidDate||r.regionalOptions[""].invalidDate);return a.toJD()-this.newDate(a.year(),this.fromMonthOfYear(a.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(o,i,n){var a=this._validate(o,i,n,r.local.invalidDate||r.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(a))+2)%this.daysInWeek()},extraInfo:function(o,i,n){return this._validate(o,i,n,r.local.invalidDate||r.regionalOptions[""].invalidDate),{}},add:function(o,i,n){return this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate),this._correctAdd(o,this._add(o,i,n),i,n)},_add:function(o,i,n){if(this._validateLevel++,n==="d"||n==="w"){var a=o.toJD()+i*(n==="w"?this.daysInWeek():1),s=o.calendar().fromJD(a);return this._validateLevel--,[s.year(),s.month(),s.day()]}try{var h=o.year()+(n==="y"?i:0),c=o.monthOfYear()+(n==="m"?i:0),s=o.day(),m=function(l){for(;c<l.minMonth;)h--,c+=l.monthsInYear(h);for(var _=l.monthsInYear(h);c>_-1+l.minMonth;)h++,c-=_,_=l.monthsInYear(h)};n==="y"?(o.month()!==this.fromMonthOfYear(h,c)&&(c=this.newDate(h,o.month(),this.minDay).monthOfYear()),c=Math.min(c,this.monthsInYear(h)),s=Math.min(s,this.daysInMonth(h,this.fromMonthOfYear(h,c)))):n==="m"&&(m(this),s=Math.min(s,this.daysInMonth(h,this.fromMonthOfYear(h,c))));var d=[h,this.fromMonthOfYear(h,c),s];return this._validateLevel--,d}catch(T){throw this._validateLevel--,T}},_correctAdd:function(o,i,n,a){if(!this.hasYearZero&&(a==="y"||a==="m")&&(i[0]===0||o.year()>0!=i[0]>0)){var s={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[a],h=n<0?-1:1;i=this._add(o,n*s[0]+h*s[1],s[2])}return o.date(i[0],i[1],i[2])},set:function(o,i,n){this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate);var a=n==="y"?i:o.year(),s=n==="m"?i:o.month(),h=n==="d"?i:o.day();return(n==="y"||n==="m")&&(h=Math.min(h,this.daysInMonth(a,s))),o.date(a,s,h)},isValid:function(o,i,n){this._validateLevel++;var a=this.hasYearZero||o!==0;if(a){var s=this.newDate(o,i,this.minDay);a=i>=this.minMonth&&i-this.minMonth<this.monthsInYear(s)&&n>=this.minDay&&n-this.minDay<this.daysInMonth(s)}return this._validateLevel--,a},toJSDate:function(o,i,n){var a=this._validate(o,i,n,r.local.invalidDate||r.regionalOptions[""].invalidDate);return r.instance().fromJD(this.toJD(a)).toJSDate()},fromJSDate:function(o){return this.fromJD(r.instance().fromJSDate(o).toJD())},_validate:function(o,i,n,a){if(o.year){if(this._validateLevel===0&&this.name!==o.calendar().name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this.local.name).replace(/\{1\}/,o.calendar().local.name);return o}try{if(this._validateLevel++,this._validateLevel===1&&!this.isValid(o,i,n))throw a.replace(/\{0\}/,this.local.name);var s=this.newDate(o,i,n);return this._validateLevel--,s}catch(h){throw this._validateLevel--,h}}});function t(o){this.local=this.regionalOptions[o]||this.regionalOptions[""]}t.prototype=new e,p(t.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(n){var i=this._validate(n,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),n=i.year()+(i.year()<0?1:0);return n%4===0&&(n%100!==0||n%400===0)},weekOfYear:function(o,i,n){var a=this.newDate(o,i,n);return a.add(4-(a.dayOfWeek()||7),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInMonth:function(o,i){var n=this._validate(o,i,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return this.daysPerMonth[n.month()-1]+(n.month()===2&&this.leapYear(n.year())?1:0)},weekDay:function(o,i,n){return(this.dayOfWeek(o,i,n)||7)<6},toJD:function(o,i,n){var a=this._validate(o,i,n,r.local.invalidDate||r.regionalOptions[""].invalidDate);o=a.year(),i=a.month(),n=a.day(),o<0&&o++,i<3&&(i+=12,o--);var s=Math.floor(o/100),h=2-s+Math.floor(s/4);return Math.floor(365.25*(o+4716))+Math.floor(30.6001*(i+1))+n+h-1524.5},fromJD:function(o){var i=Math.floor(o+.5),n=Math.floor((i-186721625e-2)/36524.25);n=i+1+n-Math.floor(n/4);var a=n+1524,s=Math.floor((a-122.1)/365.25),h=Math.floor(365.25*s),c=Math.floor((a-h)/30.6001),m=a-h-Math.floor(c*30.6001),d=c-(c>13.5?13:1),T=s-(d>2.5?4716:4715);return T<=0&&T--,this.newDate(T,d,m)},toJSDate:function(o,i,n){var a=this._validate(o,i,n,r.local.invalidDate||r.regionalOptions[""].invalidDate),s=new Date(a.year(),a.month()-1,a.day());return s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0),s.setHours(s.getHours()>12?s.getHours()+2:0),s},fromJSDate:function(o){return this.newDate(o.getFullYear(),o.getMonth()+1,o.getDate())}});var r=H.exports=new x;r.cdate=S,r.baseCalendar=e,r.calendars.gregorian=t}}),Tz=De({"node_modules/world-calendars/dist/plus.js"(){var Y=ih(),H=td();Y(H.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"}),H.local=H.regionalOptions[""],Y(H.cdate.prototype,{formatDate:function(p,x){return typeof p!="string"&&(x=p,p=""),this._calendar.formatDate(p||"",this,x)}}),Y(H.baseCalendar.prototype,{UNIX_EPOCH:H.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:24*60*60,TICKS_EPOCH:H.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(p,x,S){if(typeof p!="string"&&(S=x,x=p,p=""),!x)return"";if(x.calendar()!==this)throw H.local.invalidFormat||H.regionalOptions[""].invalidFormat;p=p||this.local.dateFormat,S=S||{};for(var E=S.dayNamesShort||this.local.dayNamesShort,e=S.dayNames||this.local.dayNames,t=S.monthNumbers||this.local.monthNumbers,r=S.monthNamesShort||this.local.monthNamesShort,o=S.monthNames||this.local.monthNames,i=S.calculateWeek||this.local.calculateWeek,n=function(A,M){for(var g=1;w+g<p.length&&p.charAt(w+g)===A;)g++;return w+=g-1,Math.floor(g/(M||1))>1},a=function(A,M,g,b){var v=""+M;if(n(A,b))for(;v.length<g;)v="0"+v;return v},s=function(A,M,g,b){return n(A)?b[M]:g[M]},h=this,c=function(A){return typeof t=="function"?t.call(h,A,n("m")):T(a("m",A.month(),2))},m=function(A,M){return M?typeof o=="function"?o.call(h,A):o[A.month()-h.minMonth]:typeof r=="function"?r.call(h,A):r[A.month()-h.minMonth]},d=this.local.digits,T=function(A){return S.localNumbers&&d?d(A):A},l="",_=!1,w=0;w<p.length;w++)if(_)p.charAt(w)==="'"&&!n("'")?_=!1:l+=p.charAt(w);else switch(p.charAt(w)){case"d":l+=T(a("d",x.day(),2));break;case"D":l+=s("D",x.dayOfWeek(),E,e);break;case"o":l+=a("o",x.dayOfYear(),3);break;case"w":l+=a("w",x.weekOfYear(),2);break;case"m":l+=c(x);break;case"M":l+=m(x,n("M"));break;case"y":l+=n("y",2)?x.year():(x.year()%100<10?"0":"")+x.year()%100;break;case"Y":n("Y",2),l+=x.formatYear();break;case"J":l+=x.toJD();break;case"@":l+=(x.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":l+=(x.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":n("'")?l+="'":_=!0;break;default:l+=p.charAt(w)}return l},parseDate:function(p,x,S){if(x==null)throw H.local.invalidArguments||H.regionalOptions[""].invalidArguments;if(x=typeof x=="object"?x.toString():x+"",x==="")return null;p=p||this.local.dateFormat,S=S||{};var E=S.shortYearCutoff||this.shortYearCutoff;E=typeof E!="string"?E:this.today().year()%100+parseInt(E,10);for(var e=S.dayNamesShort||this.local.dayNamesShort,t=S.dayNames||this.local.dayNames,r=S.parseMonth||this.local.parseMonth,o=S.monthNumbers||this.local.monthNumbers,i=S.monthNamesShort||this.local.monthNamesShort,n=S.monthNames||this.local.monthNames,a=-1,s=-1,h=-1,c=-1,m=-1,d=!1,T=!1,l=function(R,L){for(var z=1;u+z<p.length&&p.charAt(u+z)===R;)z++;return u+=z-1,Math.floor(z/(L||1))>1},_=function(R,L){var z=l(R,L),F=[2,3,z?4:2,z?4:2,10,11,20]["oyYJ@!".indexOf(R)+1],N=new RegExp("^-?\\d{1,"+F+"}"),B=x.substring(v).match(N);if(!B)throw(H.local.missingNumberAt||H.regionalOptions[""].missingNumberAt).replace(/\{0\}/,v);return v+=B[0].length,parseInt(B[0],10)},w=this,A=function(){if(typeof o=="function"){l("m");var R=o.call(w,x.substring(v));return v+=R.length,R}return _("m")},M=function(R,L,z,F){for(var N=l(R,F)?z:L,B=0;B<N.length;B++)if(x.substr(v,N[B].length).toLowerCase()===N[B].toLowerCase())return v+=N[B].length,B+w.minMonth;throw(H.local.unknownNameAt||H.regionalOptions[""].unknownNameAt).replace(/\{0\}/,v)},g=function(){if(typeof n=="function"){var R=l("M")?n.call(w,x.substring(v)):i.call(w,x.substring(v));return v+=R.length,R}return M("M",i,n)},b=function(){if(x.charAt(v)!==p.charAt(u))throw(H.local.unexpectedLiteralAt||H.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,v);v++},v=0,u=0;u<p.length;u++)if(T)p.charAt(u)==="'"&&!l("'")?T=!1:b();else switch(p.charAt(u)){case"d":c=_("d");break;case"D":M("D",e,t);break;case"o":m=_("o");break;case"w":_("w");break;case"m":h=A();break;case"M":h=g();break;case"y":var y=u;d=!l("y",2),u=y,s=_("y",2);break;case"Y":s=_("Y",2);break;case"J":a=_("J")+.5,x.charAt(v)==="."&&(v++,_("J"));break;case"@":a=_("@")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case"!":a=_("!")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case"*":v=x.length;break;case"'":l("'")?b():T=!0;break;default:b()}if(v<x.length)throw H.local.unexpectedText||H.regionalOptions[""].unexpectedText;if(s===-1?s=this.today().year():s<100&&d&&(s+=E===-1?1900:this.today().year()-this.today().year()%100-(s<=E?0:100)),typeof h=="string"&&(h=r.call(this,s,h)),m>-1){h=1,c=m;for(var f=this.daysInMonth(s,h);c>f;f=this.daysInMonth(s,h))h++,c-=f}return a>-1?this.fromJD(a):this.newDate(s,h,c)},determineDate:function(p,x,S,E,e){S&&typeof S!="object"&&(e=E,E=S,S=null),typeof E!="string"&&(e=E,E="");var t=this,r=function(o){try{return t.parseDate(E,o,e)}catch{}o=o.toLowerCase();for(var i=(o.match(/^c/)&&S?S.newDate():null)||t.today(),n=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,a=n.exec(o);a;)i.add(parseInt(a[1],10),a[2]||"d"),a=n.exec(o);return i};return x=x?x.newDate():null,p=p==null?x:typeof p=="string"?r(p):typeof p=="number"?isNaN(p)||p===1/0||p===-1/0?x:t.today().add(p,"d"):t.newDate(p),p}})}}),Az=De({"node_modules/world-calendars/dist/calendars/chinese.js"(){var Y=td(),H=ih(),p=Y.instance();function x(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}x.prototype=new Y.baseCalendar,H(x.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(a,s){if(typeof a=="string"){var h=a.match(E);return h?h[0]:""}var c=this._validateYear(a),m=a.month(),d=""+this.toChineseMonth(c,m);return s&&d.length<2&&(d="0"+d),this.isIntercalaryMonth(c,m)&&(d+="i"),d},monthNames:function(a){if(typeof a=="string"){var s=a.match(e);return s?s[0]:""}var h=this._validateYear(a),c=a.month(),m=this.toChineseMonth(h,c),d=["\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"][m-1];return this.isIntercalaryMonth(h,c)&&(d="\u95F0"+d),d},monthNamesShort:function(a){if(typeof a=="string"){var s=a.match(t);return s?s[0]:""}var h=this._validateYear(a),c=a.month(),m=this.toChineseMonth(h,c),d=["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"][m-1];return this.isIntercalaryMonth(h,c)&&(d="\u95F0"+d),d},parseMonth:function(a,s){a=this._validateYear(a);var h=parseInt(s),c;if(isNaN(h))s[0]==="\u95F0"&&(c=!0,s=s.substring(1)),s[s.length-1]==="\u6708"&&(s=s.substring(0,s.length-1)),h=1+["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"].indexOf(s);else{var m=s[s.length-1];c=m==="i"||m==="I"}var d=this.toMonthIndex(a,h,c);return d},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(a,s){if(a.year&&(a=a.year()),typeof a!="number"||a<1888||a>2111)throw s.replace(/\{0\}/,this.local.name);return a},toMonthIndex:function(a,s,h){var c=this.intercalaryMonth(a),m=h&&s!==c;if(m||s<1||s>12)throw Y.local.invalidMonth.replace(/\{0\}/,this.local.name);var d;return c?!h&&s<=c?d=s-1:d=s:d=s-1,d},toChineseMonth:function(a,s){a.year&&(a=a.year(),s=a.month());var h=this.intercalaryMonth(a),c=h?12:11;if(s<0||s>c)throw Y.local.invalidMonth.replace(/\{0\}/,this.local.name);var m;return h?s<h?m=s+1:m=s:m=s+1,m},intercalaryMonth:function(a){a=this._validateYear(a);var s=r[a-r[0]],h=s>>13;return h},isIntercalaryMonth:function(a,s){a.year&&(a=a.year(),s=a.month());var h=this.intercalaryMonth(a);return!!h&&h===s},leapYear:function(a){return this.intercalaryMonth(a)!==0},weekOfYear:function(a,s,h){var c=this._validateYear(a,Y.local.invalidyear),m=o[c-o[0]],d=m>>9&4095,T=m>>5&15,l=m&31,_;_=p.newDate(d,T,l),_.add(4-(_.dayOfWeek()||7),"d");var w=this.toJD(a,s,h)-_.toJD();return 1+Math.floor(w/7)},monthsInYear:function(a){return this.leapYear(a)?13:12},daysInMonth:function(a,s){a.year&&(s=a.month(),a=a.year()),a=this._validateYear(a);var h=r[a-r[0]],c=h>>13,m=c?12:11;if(s>m)throw Y.local.invalidMonth.replace(/\{0\}/,this.local.name);var d=h&1<<12-s?30:29;return d},weekDay:function(a,s,h){return(this.dayOfWeek(a,s,h)||7)<6},toJD:function(a,s,h){var c=this._validate(a,d,h,Y.local.invalidDate);a=this._validateYear(c.year()),s=c.month(),h=c.day();var m=this.isIntercalaryMonth(a,s),d=this.toChineseMonth(a,s),T=n(a,d,h,m);return p.toJD(T.year,T.month,T.day)},fromJD:function(a){var s=p.fromJD(a),h=i(s.year(),s.month(),s.day()),c=this.toMonthIndex(h.year,h.month,h.isIntercalary);return this.newDate(h.year,c,h.day)},fromString:function(a){var s=a.match(S),h=this._validateYear(+s[1]),c=+s[2],m=!!s[3],d=this.toMonthIndex(h,c,m),T=+s[4];return this.newDate(h,d,T)},add:function(a,s,h){var c=a.year(),m=a.month(),d=this.isIntercalaryMonth(c,m),T=this.toChineseMonth(c,m),l=Object.getPrototypeOf(x.prototype).add.call(this,a,s,h);if(h==="y"){var _=l.year(),w=l.month(),A=this.isIntercalaryMonth(_,T),M=d&&A?this.toMonthIndex(_,T,!0):this.toMonthIndex(_,T,!1);M!==w&&l.month(M)}return l}});var S=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,E=/^\d?\d[iI]?/m,e=/^闰?十?[一二三四五六七八九]?月/m,t=/^闰?十?[一二三四五六七八九]?/m;Y.calendars.chinese=x;var r=[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],o=[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 i(a,s,h,c){var m,d;if(typeof a=="object")m=a,d=s||{};else{var T=typeof a=="number"&&a>=1888&&a<=2111;if(!T)throw new Error("Solar year outside range 1888-2111");var l=typeof s=="number"&&s>=1&&s<=12;if(!l)throw new Error("Solar month outside range 1 - 12");var _=typeof h=="number"&&h>=1&&h<=31;if(!_)throw new Error("Solar day outside range 1 - 31");m={year:a,month:s,day:h},d=c||{}}var w=o[m.year-o[0]],A=m.year<<9|m.month<<5|m.day;d.year=A>=w?m.year:m.year-1,w=o[d.year-o[0]];var M=w>>9&4095,g=w>>5&15,b=w&31,v,u=new Date(M,g-1,b),y=new Date(m.year,m.month-1,m.day);v=Math.round((y-u)/(24*3600*1e3));var f=r[d.year-r[0]],R;for(R=0;R<13;R++){var L=f&1<<12-R?30:29;if(v<L)break;v-=L}var z=f>>13;return!z||R<z?(d.isIntercalary=!1,d.month=1+R):R===z?(d.isIntercalary=!0,d.month=R):(d.isIntercalary=!1,d.month=R),d.day=1+v,d}function n(a,s,h,c,m){var d,T;if(typeof a=="object")T=a,d=s||{};else{var l=typeof a=="number"&&a>=1888&&a<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var _=typeof s=="number"&&s>=1&&s<=12;if(!_)throw new Error("Lunar month outside range 1 - 12");var w=typeof h=="number"&&h>=1&&h<=30;if(!w)throw new Error("Lunar day outside range 1 - 30");var A;typeof c=="object"?(A=!1,d=c):(A=!!c,d=m||{}),T={year:a,month:s,day:h,isIntercalary:A}}var M;M=T.day-1;var g=r[T.year-r[0]],b=g>>13,v;b&&(T.month>b||T.isIntercalary)?v=T.month:v=T.month-1;for(var u=0;u<v;u++){var y=g&1<<12-u?30:29;M+=y}var f=o[T.year-o[0]],R=f>>9&4095,L=f>>5&15,z=f&31,F=new Date(R,L-1,z+M);return d.year=F.getFullYear(),d.month=1+F.getMonth(),d.day=F.getDate(),d}}}),Sz=De({"node_modules/world-calendars/dist/calendars/coptic.js"(){var Y=td(),H=ih();function p(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}p.prototype=new Y.baseCalendar,H(p.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(E){var S=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),E=S.year()+(S.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear||Y.regionalOptions[""].invalidYear),13},weekOfYear:function(x,S,E){var e=this.newDate(x,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,S){var E=this._validate(x,S,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(x,S,E){return(this.dayOfWeek(x,S,E)||7)<6},toJD:function(x,S,E){var e=this._validate(x,S,E,Y.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var S=Math.floor(x)+.5-this.jdEpoch,E=Math.floor((S-Math.floor((S+366)/1461))/365)+1;E<=0&&E--,S=Math.floor(x)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(S/30)+1,t=S-(e-1)*30+1;return this.newDate(E,e,t)}}),Y.calendars.coptic=p}}),Mz=De({"node_modules/world-calendars/dist/calendars/discworld.js"(){var Y=td(),H=ih();function p(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}p.prototype=new Y.baseCalendar,H(p.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(S){return this._validate(S,this.minMonth,this.minDay,Y.local.invalidYear),!1},monthsInYear:function(S){return this._validate(S,this.minMonth,this.minDay,Y.local.invalidYear),13},daysInYear:function(S){return this._validate(S,this.minMonth,this.minDay,Y.local.invalidYear),400},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/8)+1},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(S,E,e){var t=this._validate(S,E,e,Y.local.invalidDate);return(t.day()+1)%8},weekDay:function(S,E,e){var t=this.dayOfWeek(S,E,e);return t>=2&&t<=6},extraInfo:function(S,E,e){var t=this._validate(S,E,e,Y.local.invalidDate);return{century:x[Math.floor((t.year()-1)/100)+1]||""}},toJD:function(S,E,e){var t=this._validate(S,E,e,Y.local.invalidDate);return S=t.year()+(t.year()<0?1:0),E=t.month(),e=t.day(),e+(E>1?16:0)+(E>2?(E-2)*32:0)+(S-1)*400+this.jdEpoch-1},fromJD:function(S){S=Math.floor(S+.5)-Math.floor(this.jdEpoch)-1;var E=Math.floor(S/400)+1;S-=(E-1)*400,S+=S>15?16:0;var e=Math.floor(S/32)+1,t=S-(e-1)*32+1;return this.newDate(E<=0?E-1:E,e,t)}});var x={20:"Fruitbat",21:"Anchovy"};Y.calendars.discworld=p}}),Ez=De({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var Y=td(),H=ih();function p(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}p.prototype=new Y.baseCalendar,H(p.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(E){var S=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),E=S.year()+(S.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear||Y.regionalOptions[""].invalidYear),13},weekOfYear:function(x,S,E){var e=this.newDate(x,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,S){var E=this._validate(x,S,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(x,S,E){return(this.dayOfWeek(x,S,E)||7)<6},toJD:function(x,S,E){var e=this._validate(x,S,E,Y.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var S=Math.floor(x)+.5-this.jdEpoch,E=Math.floor((S-Math.floor((S+366)/1461))/365)+1;E<=0&&E--,S=Math.floor(x)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(S/30)+1,t=S-(e-1)*30+1;return this.newDate(E,e,t)}}),Y.calendars.ethiopian=p}}),kz=De({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var Y=td(),H=ih();function p(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}p.prototype=new Y.baseCalendar,H(p.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(S){var E=this._validate(S,this.minMonth,this.minDay,Y.local.invalidYear);return this._leapYear(E.year())},_leapYear:function(S){return S=S<0?S+1:S,x(S*7+1,19)<7},monthsInYear:function(S){return this._validate(S,this.minMonth,this.minDay,Y.local.invalidYear),this._leapYear(S.year?S.year():S)?13:12},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,Y.local.invalidYear);return S=E.year(),this.toJD(S===-1?1:S+1,7,1)-this.toJD(S,7,1)},daysInMonth:function(S,E){return S.year&&(E=S.month(),S=S.year()),this._validate(S,E,this.minDay,Y.local.invalidMonth),E===12&&this.leapYear(S)||E===8&&x(this.daysInYear(S),10)===5?30:E===9&&x(this.daysInYear(S),10)===3?29:this.daysPerMonth[E-1]},weekDay:function(S,E,e){return this.dayOfWeek(S,E,e)!==6},extraInfo:function(S,E,e){var t=this._validate(S,E,e,Y.local.invalidDate);return{yearType:(this.leapYear(t)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(t)%10-3]}},toJD:function(S,E,e){var t=this._validate(S,E,e,Y.local.invalidDate);S=t.year(),E=t.month(),e=t.day();var r=S<=0?S+1:S,o=this.jdEpoch+this._delay1(r)+this._delay2(r)+e+1;if(E<7){for(var i=7;i<=this.monthsInYear(S);i++)o+=this.daysInMonth(S,i);for(var i=1;i<E;i++)o+=this.daysInMonth(S,i)}else for(var i=7;i<E;i++)o+=this.daysInMonth(S,i);return o},_delay1:function(S){var E=Math.floor((235*S-234)/19),e=12084+13753*E,t=E*29+Math.floor(e/25920);return x(3*(t+1),7)<3&&t++,t},_delay2:function(S){var E=this._delay1(S-1),e=this._delay1(S),t=this._delay1(S+1);return t-e===356?2:e-E===382?1:0},fromJD:function(S){S=Math.floor(S)+.5;for(var E=Math.floor((S-this.jdEpoch)*98496/35975351)-1;S>=this.toJD(E===-1?1:E+1,7,1);)E++;for(var e=S<this.toJD(E,1,1)?7:1;S>this.toJD(E,e,this.daysInMonth(E,e));)e++;var t=S-this.toJD(E,e,1)+1;return this.newDate(E,e,t)}});function x(S,E){return S-E*Math.floor(S/E)}Y.calendars.hebrew=p}}),Cz=De({"node_modules/world-calendars/dist/calendars/islamic.js"(){var Y=td(),H=ih();function p(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}p.prototype=new Y.baseCalendar,H(p.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(x){var S=this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear);return(S.year()*11+14)%30<11},weekOfYear:function(x,S,E){var e=this.newDate(x,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){return this.leapYear(x)?355:354},daysInMonth:function(x,S){var E=this._validate(x,S,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===12&&this.leapYear(E.year())?1:0)},weekDay:function(x,S,E){return this.dayOfWeek(x,S,E)!==5},toJD:function(x,S,E){var e=this._validate(x,S,E,Y.local.invalidDate);return x=e.year(),S=e.month(),E=e.day(),x=x<=0?x+1:x,E+Math.ceil(29.5*(S-1))+(x-1)*354+Math.floor((3+11*x)/30)+this.jdEpoch-1},fromJD:function(x){x=Math.floor(x)+.5;var S=Math.floor((30*(x-this.jdEpoch)+10646)/10631);S=S<=0?S-1:S;var E=Math.min(12,Math.ceil((x-29-this.toJD(S,1,1))/29.5)+1),e=x-this.toJD(S,E,1)+1;return this.newDate(S,E,e)}}),Y.calendars.islamic=p}}),Lz=De({"node_modules/world-calendars/dist/calendars/julian.js"(){var Y=td(),H=ih();function p(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}p.prototype=new Y.baseCalendar,H(p.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(E){var S=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),E=S.year()<0?S.year()+1:S.year();return E%4===0},weekOfYear:function(x,S,E){var e=this.newDate(x,S,E);return e.add(4-(e.dayOfWeek()||7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,S){var E=this._validate(x,S,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===2&&this.leapYear(E.year())?1:0)},weekDay:function(x,S,E){return(this.dayOfWeek(x,S,E)||7)<6},toJD:function(x,S,E){var e=this._validate(x,S,E,Y.local.invalidDate);return x=e.year(),S=e.month(),E=e.day(),x<0&&x++,S<=2&&(x--,S+=12),Math.floor(365.25*(x+4716))+Math.floor(30.6001*(S+1))+E-1524.5},fromJD:function(x){var S=Math.floor(x+.5),E=S+1524,e=Math.floor((E-122.1)/365.25),t=Math.floor(365.25*e),r=Math.floor((E-t)/30.6001),o=r-Math.floor(r<14?1:13),i=e-Math.floor(o>2?4716:4715),n=E-t-Math.floor(30.6001*r);return i<=0&&i--,this.newDate(i,o,n)}}),Y.calendars.julian=p}}),Iz=De({"node_modules/world-calendars/dist/calendars/mayan.js"(){var Y=td(),H=ih();function p(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}p.prototype=new Y.baseCalendar,H(p.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,Y.local.invalidYear),!1},formatYear:function(E){var e=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear);E=e.year();var t=Math.floor(E/400);E=E%400,E+=E<0?400:0;var r=Math.floor(E/20);return t+"."+r+"."+E%20},forYear:function(E){if(E=E.split("."),E.length<3)throw"Invalid Mayan year";for(var e=0,t=0;t<E.length;t++){var r=parseInt(E[t],10);if(Math.abs(r)>19||t>0&&r<0)throw"Invalid Mayan year";e=e*20+r}return e},monthsInYear:function(E){return this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),18},weekOfYear:function(E,e,t){return this._validate(E,e,t,Y.local.invalidDate),0},daysInYear:function(E){return this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),360},daysInMonth:function(E,e){return this._validate(E,e,this.minDay,Y.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(E,e,t){var r=this._validate(E,e,t,Y.local.invalidDate);return r.day()},weekDay:function(E,e,t){return this._validate(E,e,t,Y.local.invalidDate),!0},extraInfo:function(E,e,t){var r=this._validate(E,e,t,Y.local.invalidDate),o=r.toJD(),i=this._toHaab(o),n=this._toTzolkin(o);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[n[0]-1],tzolkinDay:n[0],tzolkinTrecena:n[1]}},_toHaab:function(E){E-=this.jdEpoch;var e=x(E+8+17*20,365);return[Math.floor(e/20)+1,x(e,20)]},_toTzolkin:function(E){return E-=this.jdEpoch,[S(E+20,20),S(E+4,13)]},toJD:function(E,e,t){var r=this._validate(E,e,t,Y.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(E){E=Math.floor(E)+.5-this.jdEpoch;var e=Math.floor(E/360);E=E%360,E+=E<0?360:0;var t=Math.floor(E/20),r=E%20;return this.newDate(e,t,r)}});function x(E,e){return E-e*Math.floor(E/e)}function S(E,e){return x(E-1,e)+1}Y.calendars.mayan=p}}),Pz=De({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var Y=td(),H=ih();function p(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}p.prototype=new Y.baseCalendar;var x=Y.instance("gregorian");H(p.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(S){var E=this._validate(S,this.minMonth,this.minDay,Y.local.invalidYear||Y.regionalOptions[""].invalidYear);return x.leapYear(E.year()+(E.year()<1?1:0)+1469)},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(1-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return(this.dayOfWeek(S,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Y.local.invalidMonth),r=t.year();r<0&&r++;for(var o=t.day(),i=1;i<t.month();i++)o+=this.daysPerMonth[i-1];return o+x.toJD(r+1468,3,13)},fromJD:function(S){S=Math.floor(S+.5);for(var E=Math.floor((S-(this.jdEpoch-1))/366);S>=this.toJD(E+1,1,1);)E++;for(var e=S-Math.floor(this.toJD(E,1,1)+.5)+1,t=1;e>this.daysInMonth(E,t);)e-=this.daysInMonth(E,t),t++;return this.newDate(E,t,e)}}),Y.calendars.nanakshahi=p}}),Rz=De({"node_modules/world-calendars/dist/calendars/nepali.js"(){var Y=td(),H=ih();function p(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}p.prototype=new Y.baseCalendar,H(p.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(x){return this.daysInYear(x)!==this.daysPerYear},weekOfYear:function(x,S,E){var e=this.newDate(x,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){var S=this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear);if(x=S.year(),typeof this.NEPALI_CALENDAR_DATA[x]>"u")return this.daysPerYear;for(var E=0,e=this.minMonth;e<=12;e++)E+=this.NEPALI_CALENDAR_DATA[x][e];return E},daysInMonth:function(x,S){return x.year&&(S=x.month(),x=x.year()),this._validate(x,S,this.minDay,Y.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[x]>"u"?this.daysPerMonth[S-1]:this.NEPALI_CALENDAR_DATA[x][S]},weekDay:function(x,S,E){return this.dayOfWeek(x,S,E)!==6},toJD:function(x,S,E){var e=this._validate(x,S,E,Y.local.invalidDate);x=e.year(),S=e.month(),E=e.day();var t=Y.instance(),r=0,o=S,i=x;this._createMissingCalendarData(x);var n=x-(o>9||o===9&&E>=this.NEPALI_CALENDAR_DATA[i][0]?56:57);for(S!==9&&(r=E,o--);o!==9;)o<=0&&(o=12,i--),r+=this.NEPALI_CALENDAR_DATA[i][o],o--;return S===9?(r+=E-this.NEPALI_CALENDAR_DATA[i][0],r<0&&(r+=t.daysInYear(n))):r+=this.NEPALI_CALENDAR_DATA[i][9]-this.NEPALI_CALENDAR_DATA[i][0],t.newDate(n,1,1).add(r,"d").toJD()},fromJD:function(x){var S=Y.instance(),E=S.fromJD(x),e=E.year(),t=E.dayOfYear(),r=e+56;this._createMissingCalendarData(r);for(var o=9,i=this.NEPALI_CALENDAR_DATA[r][0],n=this.NEPALI_CALENDAR_DATA[r][o]-i+1;t>n;)o++,o>12&&(o=1,r++),n+=this.NEPALI_CALENDAR_DATA[r][o];var a=this.NEPALI_CALENDAR_DATA[r][o]-(n-t);return this.newDate(r,o,a)},_createMissingCalendarData:function(x){var S=this.daysPerMonth.slice(0);S.unshift(17);for(var E=x-1;E<x+2;E++)typeof this.NEPALI_CALENDAR_DATA[E]>"u"&&(this.NEPALI_CALENDAR_DATA[E]=S)},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]}}),Y.calendars.nepali=p}}),Dz=De({"node_modules/world-calendars/dist/calendars/persian.js"(){var Y=td(),H=ih();function p(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}function x(S){var E=S-475;S<0&&E++;var e=.242197,t=e*E,r=e*(E+1),o=t-Math.floor(t),i=r-Math.floor(r);return o>i}p.prototype=new Y.baseCalendar,H(p.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(S){var E=this._validate(S,this.minMonth,this.minDay,Y.local.invalidYear);return x(E.year())},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-((t.dayOfWeek()+1)%7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return this.dayOfWeek(S,E,e)!==5},toJD:function(S,E,e){var t=this._validate(S,E,e,Y.local.invalidDate);S=t.year(),E=t.month(),e=t.day();var r=0;if(S>0)for(var o=1;o<S;o++)x(o)&&r++;else if(S<0)for(var o=S;o<0;o++)x(o)&&r--;return e+(E<=7?(E-1)*31:(E-1)*30+6)+(S>0?S-1:S)*365+r+this.jdEpoch-1},fromJD:function(S){S=Math.floor(S)+.5;var E=475+(S-this.toJD(475,1,1))/365.242197,e=Math.floor(E);e<=0&&e--,S>this.toJD(e,12,x(e)?30:29)&&(e++,e===0&&e++);var t=S-this.toJD(e,1,1)+1,r=t<=186?Math.ceil(t/31):Math.ceil((t-6)/30),o=S-this.toJD(e,r,1)+1;return this.newDate(e,r,o)}}),Y.calendars.persian=p,Y.calendars.jalali=p}}),zz=De({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var Y=td(),H=ih(),p=Y.instance();function x(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}x.prototype=new Y.baseCalendar,H(x.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(e){var E=this._validate(e,this.minMonth,this.minDay,Y.local.invalidYear),e=this._t2gYear(E.year());return p.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,Y.local.invalidYear),r=this._t2gYear(t.year());return p.weekOfYear(r,t.month(),t.day())},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return(this.dayOfWeek(S,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Y.local.invalidDate),r=this._t2gYear(t.year());return p.toJD(r,t.month(),t.day())},fromJD:function(S){var E=p.fromJD(S),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(S){return S+this.yearsOffset+(S>=-this.yearsOffset&&S<=-1?1:0)},_g2tYear:function(S){return S-this.yearsOffset-(S>=1&&S<=this.yearsOffset?1:0)}}),Y.calendars.taiwan=x}}),Fz=De({"node_modules/world-calendars/dist/calendars/thai.js"(){var Y=td(),H=ih(),p=Y.instance();function x(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}x.prototype=new Y.baseCalendar,H(x.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(e){var E=this._validate(e,this.minMonth,this.minDay,Y.local.invalidYear),e=this._t2gYear(E.year());return p.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,Y.local.invalidYear),r=this._t2gYear(t.year());return p.weekOfYear(r,t.month(),t.day())},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return(this.dayOfWeek(S,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Y.local.invalidDate),r=this._t2gYear(t.year());return p.toJD(r,t.month(),t.day())},fromJD:function(S){var E=p.fromJD(S),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(S){return S-this.yearsOffset-(S>=1&&S<=this.yearsOffset?1:0)},_g2tYear:function(S){return S+this.yearsOffset+(S>=-this.yearsOffset&&S<=-1?1:0)}}),Y.calendars.thai=x}}),Bz=De({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var Y=td(),H=ih();function p(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}p.prototype=new Y.baseCalendar,H(p.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(S){var E=this._validate(S,this.minMonth,this.minDay,Y.local.invalidYear);return this.daysInYear(E.year())===355},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(S){for(var E=0,e=1;e<=12;e++)E+=this.daysInMonth(S,e);return E},daysInMonth:function(S,E){for(var e=this._validate(S,E,this.minDay,Y.local.invalidMonth),t=e.toJD()-24e5+.5,r=0,o=0;o<x.length;o++){if(x[o]>t)return x[r]-x[r-1];r++}return 30},weekDay:function(S,E,e){return this.dayOfWeek(S,E,e)!==5},toJD:function(S,E,e){var t=this._validate(S,E,e,Y.local.invalidDate),r=12*(t.year()-1)+t.month()-15292,o=t.day()+x[r-1]-1;return o+24e5-.5},fromJD:function(S){for(var E=S-24e5+.5,e=0,t=0;t<x.length&&!(x[t]>E);t++)e++;var r=e+15292,o=Math.floor((r-1)/12),i=o+1,n=r-12*o,a=E-x[e-1]+1;return this.newDate(i,n,a)},isValid:function(S,E,e){var t=Y.baseCalendar.prototype.isValid.apply(this,arguments);return t&&(S=S.year!=null?S.year:S,t=S>=1276&&S<=1500),t},_validate:function(S,E,e,t){var r=Y.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw t.replace(/\{0\}/,this.local.name);return r}}),Y.calendars.ummalqura=p;var x=[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]}}),Oz=De({"src/components/calendars/calendars.js"(Y,H){"use strict";H.exports=td(),Tz(),Az(),Sz(),Mz(),Ez(),kz(),Cz(),Lz(),Iz(),Pz(),Rz(),Dz(),zz(),Fz(),Bz()}}),Nz=De({"src/components/calendars/index.js"(Y,H){"use strict";var p=Oz(),x=ui(),S=zn(),E=S.EPOCHJD,e=S.ONEDAY,t={valType:"enumerated",values:x.sortObjectKeys(p.calendars),editType:"calc",dflt:"gregorian"},r=function(g,b,v,u){var y={};return y[v]=t,x.coerce(g,b,y,v,u)},o=function(g,b,v,u){for(var y=0;y<v.length;y++)r(g,b,v[y]+"calendar",u.calendar)},i={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"},n={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"},a={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"]},s="##",h={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:s,w:s,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}};function c(g,b,v){for(var u=Math.floor((b+.05)/e)+E,y=d(v).fromJD(u),f=0,R,L,z,F,N;(f=g.indexOf("%",f))!==-1;)R=g.charAt(f+1),R==="0"||R==="-"||R==="_"?(z=3,L=g.charAt(f+2),R==="_"&&(R="-")):(L=R,R="0",z=2),F=h[L],F?(F===s?N=s:N=y.formatDate(F[R]),g=g.slice(0,f)+N+g.slice(f+z),f+=N.length):f+=z;return g}var m={};function d(g){var b=m[g];return b||(b=m[g]=p.instance(g),b)}function T(g){return x.extendFlat({},t,{description:g})}function l(g){return"Sets the calendar system to use with `"+g+"` date data."}var _={xcalendar:T(l("x"))},w=x.extendFlat({},_,{ycalendar:T(l("y"))}),A=x.extendFlat({},w,{zcalendar:T(l("z"))}),M=T(["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(" "));H.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:w,bar:w,box:w,heatmap:w,contour:w,histogram:w,histogram2d:w,histogram2dcontour:w,scatter3d:A,surface:A,mesh3d:A,scattergl:w,ohlc:_,candlestick:_},layout:{calendar:T(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:M},yaxis:{calendar:M},scene:{xaxis:{calendar:M},yaxis:{calendar:M},zaxis:{calendar:M}},polar:{radialaxis:{calendar:M}}}},layoutAttributes:t,handleDefaults:r,handleTraceDefaults:o,CANONICAL_SUNDAY:n,CANONICAL_TICK:i,DFLTRANGE:a,getCal:d,worldCalFmt:c}}}),Uz=De({"lib/calendars.js"(Y,H){"use strict";H.exports=Nz()}}),jz=De({"lib/index.js"(Y,H){var p=yk();p.register([wk(),Sk(),Ck(),Dk(),Ok(),Vk(),Gk(),r6(),f6(),w6(),P6(),JC(),aL(),HL(),QL(),sI(),vI(),II(),zI(),BI(),jI(),WI(),$I(),tP(),mP(),_P(),rR(),gR(),LR(),FR(),WR(),KR(),aD(),gD(),bD(),CD(),HD(),KD(),i4(),M4(),D4(),N4(),H4(),Y4(),Q4(),sz(),dz(),wz(),Uz()]),H.exports=p}});return jz()})();return window.Plotly=jt,jt})});var ko=Qv(P0()),op=Qv(a_());var LS;(function(jt){function Se(Mt){let Lt=document.body,$t=gr=>{gr.preventDefault(),gr.stopPropagation(),gr.clipboardData.setData("text",Mt),Lt.removeEventListener("copy",$t,!0)};Lt.addEventListener("copy",$t,!0),document.execCommand("copy")}jt.copyText=Se})(LS||(LS={}));var Yc;(function(jt){function Se(gr){let pi=window.getComputedStyle(gr),ti=parseFloat(pi.borderTopWidth)||0,ci=parseFloat(pi.borderLeftWidth)||0,Ii=parseFloat(pi.borderRightWidth)||0,si=parseFloat(pi.borderBottomWidth)||0,mi=parseFloat(pi.paddingTop)||0,Ri=parseFloat(pi.paddingLeft)||0,yi=parseFloat(pi.paddingRight)||0,bi=parseFloat(pi.paddingBottom)||0,wi=ci+Ri+yi+Ii,De=ti+mi+bi+si;return{borderTop:ti,borderLeft:ci,borderRight:Ii,borderBottom:si,paddingTop:mi,paddingLeft:Ri,paddingRight:yi,paddingBottom:bi,horizontalSum:wi,verticalSum:De}}jt.boxSizing=Se;function Mt(gr){let pi=window.getComputedStyle(gr),ti=parseFloat(pi.minWidth)||0,ci=parseFloat(pi.minHeight)||0,Ii=parseFloat(pi.maxWidth)||1/0,si=parseFloat(pi.maxHeight)||1/0;return Ii=Math.max(ti,Ii),si=Math.max(ci,si),{minWidth:ti,minHeight:ci,maxWidth:Ii,maxHeight:si}}jt.sizeLimits=Mt;function Lt(gr,pi,ti){let ci=gr.getBoundingClientRect();return pi>=ci.left&&pi<ci.right&&ti>=ci.top&&ti<ci.bottom}jt.hitTest=Lt;function $t(gr,pi){let ti=gr.getBoundingClientRect(),ci=pi.getBoundingClientRect();if(!(ci.top<=ti.top&&ci.bottom>=ti.bottom)){if(ci.top<ti.top&&ci.height<=ti.height){gr.scrollTop-=ti.top-ci.top;return}if(ci.bottom>ti.bottom&&ci.height>=ti.height){gr.scrollTop-=ti.top-ci.top;return}if(ci.top<ti.top&&ci.height>ti.height){gr.scrollTop-=ti.bottom-ci.bottom;return}if(ci.bottom>ti.bottom&&ci.height<ti.height){gr.scrollTop-=ti.bottom-ci.bottom;return}}}jt.scrollIntoViewIfNeeded=$t})(Yc||(Yc={}));var cd;(function(jt){jt.IS_MAC=!!navigator.platform.match(/Mac/i),jt.IS_WIN=!!navigator.platform.match(/Win/i),jt.IS_IE=/Trident/.test(navigator.userAgent),jt.IS_EDGE=/Edge/.test(navigator.userAgent);function Se(Mt){return jt.IS_MAC?Mt.metaKey:Mt.ctrlKey}jt.accelKey=Se})(cd||(cd={}));var lv;(function(jt){function Se($t){if($t in sv.specificityCache)return sv.specificityCache[$t];let gr=sv.calculateSingle($t);return sv.specificityCache[$t]=gr}jt.calculateSpecificity=Se;function Mt($t){if($t in sv.validityCache)return sv.validityCache[$t];let gr=!0;try{sv.testElem.querySelector($t)}catch{gr=!1}return sv.validityCache[$t]=gr}jt.isValid=Mt;function Lt($t,gr){return sv.protoMatchFunc.call($t,gr)}jt.matches=Lt})(lv||(lv={}));var sv;(function(jt){jt.specificityCache=Object.create(null),jt.validityCache=Object.create(null),jt.testElem=document.createElement("div"),jt.protoMatchFunc=(()=>{let si=Element.prototype;return si.matches||si.matchesSelector||si.mozMatchesSelector||si.msMatchesSelector||si.oMatchesSelector||si.webkitMatchesSelector||function(mi){let Ri=this,yi=Ri.ownerDocument?Ri.ownerDocument.querySelectorAll(mi):[];return Array.prototype.indexOf.call(yi,Ri)!==-1}})();function Se(si){si=si.split(",",1)[0];let mi=0,Ri=0,yi=0;function bi(wi){let De=si.match(wi);return De===null?!1:(si=si.slice(De[0].length),!0)}for(si=si.replace(Ii," $1 ");si.length>0;){if(bi(Mt)){mi++;continue}if(bi(Lt)){Ri++;continue}if(bi($t)){Ri++;continue}if(bi(pi)){yi++;continue}if(bi(ti)){Ri++;continue}if(bi(gr)){yi++;continue}if(!bi(ci))return 0}return mi=Math.min(mi,255),Ri=Math.min(Ri,255),yi=Math.min(yi,255),mi<<16|Ri<<8|yi}jt.calculateSingle=Se;let Mt=/^#[^\s\+>~#\.\[:]+/,Lt=/^\.[^\s\+>~#\.\[:]+/,$t=/^\[[^\]]+\]/,gr=/^[^\s\+>~#\.\[:]+/,pi=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,ti=/^:[^\s\+>~#\.\[:]+/,ci=/^[\s\+>~\*]+/,Ii=/:not\(([^\)]+)\)/g})(sv||(sv={}));var tp=Qv(P0());var Nm=class{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return this._size===0}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let Se=this._first;for(;Se;)yield Se.value,Se=Se.next}*retro(){let Se=this._last;for(;Se;)yield Se.value,Se=Se.prev}*nodes(){let Se=this._first;for(;Se;)yield Se,Se=Se.next}*retroNodes(){let Se=this._last;for(;Se;)yield Se,Se=Se.prev}assign(Se){this.clear();for(let Mt of Se)this.addLast(Mt)}push(Se){this.addLast(Se)}pop(){return this.removeLast()}shift(Se){this.addFirst(Se)}unshift(){return this.removeFirst()}addFirst(Se){let Mt=new ep.LinkedListNode(this,Se);return this._first?(Mt.next=this._first,this._first.prev=Mt,this._first=Mt):(this._first=Mt,this._last=Mt),this._size++,Mt}addLast(Se){let Mt=new ep.LinkedListNode(this,Se);return this._last?(Mt.prev=this._last,this._last.next=Mt,this._last=Mt):(this._first=Mt,this._last=Mt),this._size++,Mt}insertBefore(Se,Mt){if(!Mt||Mt===this._first)return this.addFirst(Se);if(!(Mt instanceof ep.LinkedListNode)||Mt.list!==this)throw new Error("Reference node is not owned by the list.");let Lt=new ep.LinkedListNode(this,Se),$t=Mt,gr=$t.prev;return Lt.next=$t,Lt.prev=gr,$t.prev=Lt,gr.next=Lt,this._size++,Lt}insertAfter(Se,Mt){if(!Mt||Mt===this._last)return this.addLast(Se);if(!(Mt instanceof ep.LinkedListNode)||Mt.list!==this)throw new Error("Reference node is not owned by the list.");let Lt=new ep.LinkedListNode(this,Se),$t=Mt,gr=$t.next;return Lt.next=gr,Lt.prev=$t,$t.next=Lt,gr.prev=Lt,this._size++,Lt}removeFirst(){let Se=this._first;if(Se)return Se===this._last?(this._first=null,this._last=null):(this._first=Se.next,this._first.prev=null),Se.list=null,Se.next=null,Se.prev=null,this._size--,Se.value}removeLast(){let Se=this._last;if(Se)return Se===this._first?(this._first=null,this._last=null):(this._last=Se.prev,this._last.next=null),Se.list=null,Se.next=null,Se.prev=null,this._size--,Se.value}removeNode(Se){if(!(Se instanceof ep.LinkedListNode)||Se.list!==this)throw new Error("Node is not owned by the list.");let Mt=Se;Mt===this._first&&Mt===this._last?(this._first=null,this._last=null):Mt===this._first?(this._first=Mt.next,this._first.prev=null):Mt===this._last?(this._last=Mt.prev,this._last.next=null):(Mt.next.prev=Mt.prev,Mt.prev.next=Mt.next),Mt.list=null,Mt.next=null,Mt.prev=null,this._size--}clear(){let Se=this._first;for(;Se;){let Mt=Se.next;Se.list=null,Se.prev=null,Se.next=null,Se=Mt}this._first=null,this._last=null,this._size=0}};(function(jt){function Se(Mt){let Lt=new jt;return Lt.assign(Mt),Lt}jt.from=Se})(Nm||(Nm={}));var ep;(function(jt){class Se{constructor(Lt,$t){this.list=null,this.next=null,this.prev=null,this.list=Lt,this.value=$t}}jt.LinkedListNode=Se})(ep||(ep={}));var _d=class{constructor(Se){this.type=Se}get isConflatable(){return!1}conflate(Se){return!1}},Bp=class extends _d{get isConflatable(){return!0}conflate(Se){return!0}},qo;(function(jt){let Se=null,Mt=(Qn=>Do=>{let Tn=!1;return Qn.then(()=>!Tn&&Do()),()=>{Tn=!0}})(Promise.resolve());function Lt(Qn,Do){let Tn=Ri.get(Qn);if(!Tn||Tn.length===0){tn(Qn,Do);return}(0,tp.every)((0,tp.retro)(Tn),vn=>vn?De(vn,Qn,Do):!0)&&tn(Qn,Do)}jt.sendMessage=Lt;function $t(Qn,Do){if(!Do.isConflatable){Ya(Qn,Do);return}(0,tp.some)(mi,lo=>lo.handler!==Qn||!lo.msg||lo.msg.type!==Do.type||!lo.msg.isConflatable?!1:lo.msg.conflate(Do))||Ya(Qn,Do)}jt.postMessage=$t;function gr(Qn,Do){let Tn=Ri.get(Qn);Tn&&Tn.indexOf(Do)!==-1||(Tn?Tn.push(Do):Ri.set(Qn,[Do]))}jt.installMessageHook=gr;function pi(Qn,Do){let Tn=Ri.get(Qn);if(!Tn)return;let lo=Tn.indexOf(Do);lo!==-1&&(Tn[lo]=null,Ua(Tn))}jt.removeMessageHook=pi;function ti(Qn){let Do=Ri.get(Qn);Do&&Do.length>0&&(tp.ArrayExt.fill(Do,null),Ua(Do));for(let Tn of mi)Tn.handler===Qn&&(Tn.handler=null,Tn.msg=null)}jt.clearData=ti;function ci(){wi||Se===null||(Se(),Se=null,wi=!0,sa(),wi=!1)}jt.flush=ci;function Ii(){return bi}jt.getExceptionHandler=Ii;function si(Qn){let Do=bi;return bi=Qn,Do}jt.setExceptionHandler=si;let mi=new Nm,Ri=new WeakMap,yi=new Set,bi=Qn=>{console.error(Qn)},wi=!1;function De(Qn,Do,Tn){let lo=!0;try{typeof Qn=="function"?lo=Qn(Do,Tn):lo=Qn.messageHook(Do,Tn)}catch(vn){bi(vn)}return lo}function tn(Qn,Do){try{Qn.processMessage(Do)}catch(Tn){bi(Tn)}}function Ya(Qn,Do){mi.addLast({handler:Qn,msg:Do}),Se===null&&(Se=Mt(sa))}function sa(){if(Se=null,mi.isEmpty)return;let Qn={handler:null,msg:null};for(mi.addLast(Qn);;){let Do=mi.removeFirst();if(Do===Qn)return;Do.handler&&Do.msg&&Lt(Do.handler,Do.msg)}}function Ua(Qn){yi.size===0&&Mt(en),yi.add(Qn)}function en(){yi.forEach(Mn),yi.clear()}function Mn(Qn){tp.ArrayExt.removeAllWhere(Qn,za)}function za(Qn){return Qn===null}})(qo||(qo={}));var xd=class{constructor(Se){this._pid=R0.nextPID(),this.name=Se.name,this._create=Se.create,this._coerce=Se.coerce||null,this._compare=Se.compare||null,this._changed=Se.changed||null}get(Se){let Mt,Lt=R0.ensureMap(Se);return this._pid in Lt?Mt=Lt[this._pid]:Mt=Lt[this._pid]=this._createValue(Se),Mt}set(Se,Mt){let Lt,$t=R0.ensureMap(Se);this._pid in $t?Lt=$t[this._pid]:Lt=$t[this._pid]=this._createValue(Se);let gr=this._coerceValue(Se,Mt);this._maybeNotify(Se,Lt,$t[this._pid]=gr)}coerce(Se){let Mt,Lt=R0.ensureMap(Se);this._pid in Lt?Mt=Lt[this._pid]:Mt=Lt[this._pid]=this._createValue(Se);let $t=this._coerceValue(Se,Mt);this._maybeNotify(Se,Mt,Lt[this._pid]=$t)}_createValue(Se){let Mt=this._create;return Mt(Se)}_coerceValue(Se,Mt){let Lt=this._coerce;return Lt?Lt(Se,Mt):Mt}_compareValue(Se,Mt){let Lt=this._compare;return Lt?Lt(Se,Mt):Se===Mt}_maybeNotify(Se,Mt,Lt){let $t=this._changed;$t&&!this._compareValue(Mt,Lt)&&$t(Se,Mt,Lt)}};(function(jt){function Se(Mt){R0.ownerData.delete(Mt)}jt.clearData=Se})(xd||(xd={}));var R0;(function(jt){jt.ownerData=new WeakMap,jt.nextPID=(()=>{let Mt=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${Mt++}`})();function Se(Mt){let Lt=jt.ownerData.get(Mt);return Lt||(Lt=Object.create(null),jt.ownerData.set(Mt,Lt),Lt)}jt.ensureMap=Se})(R0||(R0={}));var n_=Qv(P0()),R7=Qv(a_()),Vc=class{constructor(Se){this.sender=Se}connect(Se,Mt){return zd.connect(this,Se,Mt)}disconnect(Se,Mt){return zd.disconnect(this,Se,Mt)}emit(Se){zd.emit(this,Se)}};(function(jt){function Se(ci,Ii){zd.disconnectBetween(ci,Ii)}jt.disconnectBetween=Se;function Mt(ci){zd.disconnectSender(ci)}jt.disconnectSender=Mt;function Lt(ci){zd.disconnectReceiver(ci)}jt.disconnectReceiver=Lt;function $t(ci){zd.disconnectAll(ci)}jt.disconnectAll=$t;function gr(ci){zd.disconnectAll(ci)}jt.clearData=gr;function pi(){return zd.exceptionHandler}jt.getExceptionHandler=pi;function ti(ci){let Ii=zd.exceptionHandler;return zd.exceptionHandler=ci,Ii}jt.setExceptionHandler=ti})(Vc||(Vc={}));var zd;(function(jt){jt.exceptionHandler=Ya=>{console.error(Ya)};function Se(Ya,sa,Ua){Ua=Ua||void 0;let en=ci.get(Ya.sender);if(en||(en=[],ci.set(Ya.sender,en)),Ri(en,Ya,sa,Ua))return!1;let Mn=Ua||sa,za=Ii.get(Mn);za||(za=[],Ii.set(Mn,za));let Qn={signal:Ya,slot:sa,thisArg:Ua};return en.push(Qn),za.push(Qn),!0}jt.connect=Se;function Mt(Ya,sa,Ua){Ua=Ua||void 0;let en=ci.get(Ya.sender);if(!en||en.length===0)return!1;let Mn=Ri(en,Ya,sa,Ua);if(!Mn)return!1;let za=Ua||sa,Qn=Ii.get(za);return Mn.signal=null,bi(en),bi(Qn),!0}jt.disconnect=Mt;function Lt(Ya,sa){let Ua=ci.get(Ya);if(!Ua||Ua.length===0)return;let en=Ii.get(sa);if(!(!en||en.length===0)){for(let Mn of en)Mn.signal&&Mn.signal.sender===Ya&&(Mn.signal=null);bi(Ua),bi(en)}}jt.disconnectBetween=Lt;function $t(Ya){let sa=ci.get(Ya);if(!(!sa||sa.length===0)){for(let Ua of sa){if(!Ua.signal)continue;let en=Ua.thisArg||Ua.slot;Ua.signal=null,bi(Ii.get(en))}bi(sa)}}jt.disconnectSender=$t;function gr(Ya){let sa=Ii.get(Ya);if(!(!sa||sa.length===0)){for(let Ua of sa){if(!Ua.signal)continue;let en=Ua.signal.sender;Ua.signal=null,bi(ci.get(en))}bi(sa)}}jt.disconnectReceiver=gr;function pi(Ya){$t(Ya),gr(Ya)}jt.disconnectAll=pi;function ti(Ya,sa){let Ua=ci.get(Ya.sender);if(!(!Ua||Ua.length===0))for(let en=0,Mn=Ua.length;en<Mn;++en){let za=Ua[en];za.signal===Ya&&yi(za,sa)}}jt.emit=ti;let ci=new WeakMap,Ii=new WeakMap,si=new Set,mi=typeof requestAnimationFrame=="function"?requestAnimationFrame:setImmediate;function Ri(Ya,sa,Ua,en){return(0,n_.find)(Ya,Mn=>Mn.signal===sa&&Mn.slot===Ua&&Mn.thisArg===en)}function yi(Ya,sa){let{signal:Ua,slot:en,thisArg:Mn}=Ya;try{en.call(Mn,Ua.sender,sa)}catch(za){jt.exceptionHandler(za)}}function bi(Ya){si.size===0&&mi(wi),si.add(Ya)}function wi(){si.forEach(De),si.clear()}function De(Ya){n_.ArrayExt.removeAllWhere(Ya,tn)}function tn(Ya){return Ya.signal===null}})(zd||(zd={}));var Op=class{constructor(Se){this._fn=Se}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let Se=this._fn;this._fn=null,Se()}};var $g=class{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(Se=>{Se.dispose()}),this._items.clear())}contains(Se){return this._items.has(Se)}add(Se){this._items.add(Se)}remove(Se){this._items.delete(Se)}clear(){this._items.clear()}};(function(jt){function Se(Mt){let Lt=new jt;for(let $t of Mt)Lt.add($t);return Lt}jt.from=Se})($g||($g={}));var o_=class extends $g{constructor(){super(...arguments),this._disposed=new Vc(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),Vc.clearData(this))}};(function(jt){function Se(Mt){let Lt=new jt;for(let $t of Mt)Lt.add($t);return Lt}jt.from=Se})(o_||(o_={}));var bd=class jt{constructor(Se){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:Mt,edge:Lt,distance:$t}=this._scrollTarget,gr=fd.SCROLL_EDGE_SIZE-$t,pi=Math.pow(gr/fd.SCROLL_EDGE_SIZE,2),ti=Math.max(1,Math.round(pi*fd.SCROLL_EDGE_SIZE));switch(Lt){case"top":Mt.scrollTop-=ti;break;case"left":Mt.scrollLeft-=ti;break;case"right":Mt.scrollLeft+=ti;break;case"bottom":Mt.scrollTop+=ti;break}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=Se.document||document,this.mimeData=Se.mimeData,this.dragImage=Se.dragImage||null,this.proposedAction=Se.proposedAction||"copy",this.supportedActions=Se.supportedActions||"all",this.source=Se.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let Se=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});fd.dispatchDragLeave(this,this._currentTarget,null,Se)}this._finalize("none")}}get isDisposed(){return this._disposed}start(Se,Mt){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(Se,Mt),this._promise=new Promise($t=>{this._resolve=$t});let Lt=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:Se,clientY:Mt});return document.dispatchEvent(Lt),this._promise}handleEvent(Se){switch(Se.type){case"pointermove":this._evtPointerMove(Se);break;case"pointerup":this._evtPointerUp(Se);break;case"keydown":this._evtKeyDown(Se);break;default:Se.preventDefault(),Se.stopPropagation();break}}moveDragImage(Se,Mt){if(!this.dragImage)return;let Lt=this.dragImage.style;Lt.transform=`translate(${Se}px, ${Mt}px)`}_evtPointerMove(Se){Se.preventDefault(),Se.stopPropagation(),this._updateCurrentTarget(Se),this._updateDragScroll(Se),this.moveDragImage(Se.clientX,Se.clientY)}_evtPointerUp(Se){if(Se.preventDefault(),Se.stopPropagation(),Se.button!==0)return;if(this._updateCurrentTarget(Se),!this._currentTarget){this._finalize("none");return}if(this._dropAction==="none"){fd.dispatchDragLeave(this,this._currentTarget,null,Se),this._finalize("none");return}let Mt=fd.dispatchDrop(this,this._currentTarget,Se);this._finalize(Mt)}_evtKeyDown(Se){Se.preventDefault(),Se.stopPropagation(),Se.keyCode===27&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(Se){let Mt=fd.findScrollTarget(Se);!this._scrollTarget&&!Mt||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=Mt)}_updateCurrentTarget(Se){let Mt=this._currentTarget,Lt=this._currentTarget,$t=this._currentElement,gr=fd.findElementBehindBackdrop(Se,this.document);this._currentElement=gr,gr!==$t&&gr!==Lt&&fd.dispatchDragExit(this,Lt,gr,Se),gr!==$t&&gr!==Lt&&(Lt=fd.dispatchDragEnter(this,gr,Lt,Se)),Lt!==Mt&&(this._currentTarget=Lt,fd.dispatchDragLeave(this,Mt,Lt,Se));let pi=fd.dispatchDragOver(this,Lt,Se);this._setDropAction(pi)}_attachDragImage(Se,Mt){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let Lt=this.dragImage.style;Lt.pointerEvents="none",Lt.position="fixed",Lt.transform=`translate(${Se}px, ${Mt}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let Se=this.dragImage.parentNode;Se&&Se.removeChild(this.dragImage)}_setDropAction(Se){if(Se=fd.validateAction(Se,this.supportedActions),!(this._override&&this._dropAction===Se))switch(Se){case"none":this._dropAction=Se,this._override=jt.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=Se,this._override=jt.overrideCursor("copy",this.document);break;case"link":this._dropAction=Se,this._override=jt.overrideCursor("alias",this.document);break;case"move":this._dropAction=Se,this._override=jt.overrideCursor("move",this.document);break}}_finalize(Se){let Mt=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,Mt&&Mt(Se)}};(function(jt){class Se extends DragEvent{constructor($t,gr){super(gr.type,{bubbles:!0,cancelable:!0,altKey:$t.altKey,button:$t.button,clientX:$t.clientX,clientY:$t.clientY,ctrlKey:$t.ctrlKey,detail:0,metaKey:$t.metaKey,relatedTarget:gr.related,screenX:$t.screenX,screenY:$t.screenY,shiftKey:$t.shiftKey,view:window});let{drag:pi}=gr;this.dropAction="none",this.mimeData=pi.mimeData,this.proposedAction=pi.proposedAction,this.supportedActions=pi.supportedActions,this.source=pi.source}}jt.Event=Se;function Mt(Lt,$t=document){return fd.overrideCursor(Lt,$t)}jt.overrideCursor=Mt})(bd||(bd={}));var fd;(function(jt){jt.SCROLL_EDGE_SIZE=20;function Se(Ua,en){return mi[Ua]&Ri[en]?Ua:"none"}jt.validateAction=Se;function Mt(Ua,en=document){if(Ua){if(Lt&&Ua==Lt.event)return Lt.element;jt.cursorBackdrop.style.zIndex="-1000";let Mn=en.elementFromPoint(Ua.clientX,Ua.clientY);return jt.cursorBackdrop.style.zIndex="",Lt={event:Ua,element:Mn},Mn}else{let Mn=jt.cursorBackdrop.style.transform;if($t&&Mn===$t.transform)return $t.element;let za=jt.cursorBackdrop.getBoundingClientRect();jt.cursorBackdrop.style.zIndex="-1000";let Qn=en.elementFromPoint(za.left+za.width/2,za.top+za.height/2);return jt.cursorBackdrop.style.zIndex="",$t={transform:Mn,element:Qn},Qn}}jt.findElementBehindBackdrop=Mt;let Lt=null,$t=null;function gr(Ua){let en=Ua.clientX,Mn=Ua.clientY,za=Mt(Ua);for(;za;za=za.parentElement){if(!za.hasAttribute("data-lm-dragscroll"))continue;let Qn=0,Do=0;za===document.body&&(Qn=window.pageXOffset,Do=window.pageYOffset);let Tn=za.getBoundingClientRect(),lo=Tn.top+Do,vn=Tn.left+Qn,zn=vn+Tn.width,zl=lo+Tn.height;if(en<vn||en>=zn||Mn<lo||Mn>=zl)continue;let fu=en-vn+1,vl=Mn-lo+1,bu=zn-en,Tf=zl-Mn,Hc=Math.min(fu,vl,bu,Tf);if(Hc>jt.SCROLL_EDGE_SIZE)continue;let Ac;switch(Hc){case Tf:Ac="bottom";break;case vl:Ac="top";break;case bu:Ac="right";break;case fu:Ac="left";break;default:throw"unreachable"}let af=za.scrollWidth-za.clientWidth,gf=za.scrollHeight-za.clientHeight,wu;switch(Ac){case"top":wu=gf>0&&za.scrollTop>0;break;case"left":wu=af>0&&za.scrollLeft>0;break;case"right":wu=af>0&&za.scrollLeft<af;break;case"bottom":wu=gf>0&&za.scrollTop<gf;break;default:throw"unreachable"}if(wu)return{element:za,edge:Ac,distance:Hc}}return null}jt.findScrollTarget=gr;function pi(Ua,en,Mn,za){if(!en)return null;let Qn=new bd.Event(za,{drag:Ua,related:Mn,type:"lm-dragenter"});if(!en.dispatchEvent(Qn))return en;let Tn=Ua.document instanceof Document?Ua.document.body:Ua.document.firstElementChild;return en===Tn?Mn:(Qn=new bd.Event(za,{drag:Ua,related:Mn,type:"lm-dragenter"}),Tn.dispatchEvent(Qn),Tn)}jt.dispatchDragEnter=pi;function ti(Ua,en,Mn,za){if(!en)return;let Qn=new bd.Event(za,{drag:Ua,related:Mn,type:"lm-dragexit"});en.dispatchEvent(Qn)}jt.dispatchDragExit=ti;function ci(Ua,en,Mn,za){if(!en)return;let Qn=new bd.Event(za,{drag:Ua,related:Mn,type:"lm-dragleave"});en.dispatchEvent(Qn)}jt.dispatchDragLeave=ci;function Ii(Ua,en,Mn){if(!en)return"none";let za=new bd.Event(Mn,{drag:Ua,related:null,type:"lm-dragover"});return en.dispatchEvent(za)?"none":za.dropAction}jt.dispatchDragOver=Ii;function si(Ua,en,Mn){if(!en)return"none";let za=new bd.Event(Mn,{drag:Ua,related:null,type:"lm-drop"});return en.dispatchEvent(za)?"none":za.dropAction}jt.dispatchDrop=si;let mi={none:0,copy:1,link:2,move:4},Ri={none:mi.none,copy:mi.copy,link:mi.link,move:mi.move,"copy-link":mi.copy|mi.link,"copy-move":mi.copy|mi.move,"link-move":mi.link|mi.move,all:mi.copy|mi.link|mi.move};function yi(Ua,en=document){let Mn=++sa,za=en instanceof Document?en.body:en.firstElementChild;return jt.cursorBackdrop.isConnected||(jt.cursorBackdrop.style.transform="scale(0)",za.appendChild(jt.cursorBackdrop),De(),document.addEventListener("pointermove",bi,{capture:!0,passive:!0}),jt.cursorBackdrop.addEventListener("scroll",wi,{capture:!0,passive:!0})),jt.cursorBackdrop.style.cursor=Ua,new Op(()=>{Mn===sa&&jt.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",bi,!0),jt.cursorBackdrop.removeEventListener("scroll",wi,!0),za.removeChild(jt.cursorBackdrop))})}jt.overrideCursor=yi;function bi(Ua){jt.cursorBackdrop&&(jt.cursorBackdrop.style.transform=`translate(${Ua.clientX}px, ${Ua.clientY}px)`)}function wi(Ua){if(!jt.cursorBackdrop)return;let en=Mt();if(!en)return;let Mn=en.closest("[data-lm-dragscroll]");Mn&&(Mn.scrollTop+=jt.cursorBackdrop.scrollTop-tn,Mn.scrollLeft+=jt.cursorBackdrop.scrollLeft-tn,De())}function De(){jt.cursorBackdrop.scrollTop=tn,jt.cursorBackdrop.scrollLeft=tn}let tn=500;function Ya(){let Ua=document.createElement("div");return Ua.classList.add("lm-cursor-backdrop"),Ua}let sa=0;jt.cursorBackdrop=Ya()})(fd||(fd={}));var IS=Qv(P0()),Kh=Qv(a_());function Um(){return Sw.keyboardLayout}var Jg=class jt{constructor(Se,Mt,Lt=[]){this.name=Se,this._codes=Mt,this._keys=jt.extractKeys(Mt),this._modifierKeys=jt.convertToKeySet(Lt)}keys(){return Object.keys(this._keys)}isValidKey(Se){return Se in this._keys}isModifierKey(Se){return Se in this._modifierKeys}keyForKeydownEvent(Se){return this._codes[Se.keyCode]||""}};(function(jt){function Se(Lt){let $t=Object.create(null);for(let gr in Lt)$t[Lt[gr]]=!0;return $t}jt.extractKeys=Se;function Mt(Lt){let $t=Object(null);for(let gr=0,pi=Lt.length;gr<pi;++gr)$t[Lt[gr]]=!0;return $t}jt.convertToKeySet=Mt})(Jg||(Jg={}));var D7=new Jg("en-us",{8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",27:"Escape",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Meta",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Meta"},["Shift","Ctrl","Alt","Meta"]),Sw;(function(jt){jt.keyboardLayout=D7})(Sw||(Sw={}));var rp=class jt{constructor(){this._timerID=0,this._timerModifierID=0,this._replaying=!1,this._keystrokes=[],this._keydownEvents=[],this._keyBindings=[],this._exactKeyMatch=null,this._commands=new Map,this._commandChanged=new Vc(this),this._commandExecuted=new Vc(this),this._keyBindingChanged=new Vc(this),this._holdKeyBindingPromises=new Map}get commandChanged(){return this._commandChanged}get commandExecuted(){return this._commandExecuted}get keyBindingChanged(){return this._keyBindingChanged}get keyBindings(){return this._keyBindings}listCommands(){return Array.from(this._commands.keys())}hasCommand(Se){return this._commands.has(Se)}addCommand(Se,Mt){if(this._commands.has(Se))throw new Error(`Command '${Se}' already registered.`);return this._commands.set(Se,uv.createCommand(Mt)),this._commandChanged.emit({id:Se,type:"added"}),new Op(()=>{this._commands.delete(Se),this._commandChanged.emit({id:Se,type:"removed"})})}notifyCommandChanged(Se){if(Se!==void 0&&!this._commands.has(Se))throw new Error(`Command '${Se}' is not registered.`);this._commandChanged.emit({id:Se,type:Se?"changed":"many-changed"})}describedBy(Se,Mt=Kh.JSONExt.emptyObject){var Lt;let $t=this._commands.get(Se);return Promise.resolve((Lt=$t?.describedBy.call(void 0,Mt))!==null&&Lt!==void 0?Lt:{args:null})}label(Se,Mt=Kh.JSONExt.emptyObject){var Lt;let $t=this._commands.get(Se);return(Lt=$t?.label.call(void 0,Mt))!==null&&Lt!==void 0?Lt:""}mnemonic(Se,Mt=Kh.JSONExt.emptyObject){let Lt=this._commands.get(Se);return Lt?Lt.mnemonic.call(void 0,Mt):-1}icon(Se,Mt=Kh.JSONExt.emptyObject){var Lt;return(Lt=this._commands.get(Se))===null||Lt===void 0?void 0:Lt.icon.call(void 0,Mt)}iconClass(Se,Mt=Kh.JSONExt.emptyObject){let Lt=this._commands.get(Se);return Lt?Lt.iconClass.call(void 0,Mt):""}iconLabel(Se,Mt=Kh.JSONExt.emptyObject){let Lt=this._commands.get(Se);return Lt?Lt.iconLabel.call(void 0,Mt):""}caption(Se,Mt=Kh.JSONExt.emptyObject){let Lt=this._commands.get(Se);return Lt?Lt.caption.call(void 0,Mt):""}usage(Se,Mt=Kh.JSONExt.emptyObject){let Lt=this._commands.get(Se);return Lt?Lt.usage.call(void 0,Mt):""}className(Se,Mt=Kh.JSONExt.emptyObject){let Lt=this._commands.get(Se);return Lt?Lt.className.call(void 0,Mt):""}dataset(Se,Mt=Kh.JSONExt.emptyObject){let Lt=this._commands.get(Se);return Lt?Lt.dataset.call(void 0,Mt):{}}isEnabled(Se,Mt=Kh.JSONExt.emptyObject){let Lt=this._commands.get(Se);return Lt?Lt.isEnabled.call(void 0,Mt):!1}isToggled(Se,Mt=Kh.JSONExt.emptyObject){let Lt=this._commands.get(Se);return Lt?Lt.isToggled.call(void 0,Mt):!1}isToggleable(Se,Mt=Kh.JSONExt.emptyObject){let Lt=this._commands.get(Se);return Lt?Lt.isToggleable:!1}isVisible(Se,Mt=Kh.JSONExt.emptyObject){let Lt=this._commands.get(Se);return Lt?Lt.isVisible.call(void 0,Mt):!1}execute(Se,Mt=Kh.JSONExt.emptyObject){let Lt=this._commands.get(Se);if(!Lt)return Promise.reject(new Error(`Command '${Se}' not registered.`));let $t;try{$t=Lt.execute.call(void 0,Mt)}catch(pi){$t=Promise.reject(pi)}let gr=Promise.resolve($t);return this._commandExecuted.emit({id:Se,args:Mt,result:gr}),gr}addKeyBinding(Se){let Mt=uv.createKeyBinding(Se);return this._keyBindings.push(Mt),this._keyBindingChanged.emit({binding:Mt,type:"added"}),new Op(()=>{IS.ArrayExt.removeFirstOf(this._keyBindings,Mt),this._keyBindingChanged.emit({binding:Mt,type:"removed"})})}processKeydownEvent(Se){if(Se.defaultPrevented||this._replaying)return;let Mt=jt.keystrokeForKeydownEvent(Se);if(!Mt){this._replayKeydownEvents(),this._clearPendingState();return}if(jt.isModifierKeyPressed(Se)){let{exact:pi}=uv.matchKeyBinding(this._keyBindings,[Mt],Se);pi?(Se.preventDefault(),Se.stopPropagation(),this._startModifierTimer(pi)):this._clearModifierTimer();return}this._keystrokes.push(Mt);let{exact:Lt,partial:$t}=uv.matchKeyBinding(this._keyBindings,this._keystrokes,Se),gr=$t.length!==0;if(!Lt&&!gr){this._replayKeydownEvents(),this._clearPendingState();return}if((Lt?.preventDefault||$t.some(pi=>pi.preventDefault))&&(Se.preventDefault(),Se.stopPropagation()),this._keydownEvents.push(Se),Lt&&!gr){this._executeKeyBinding(Lt),this._clearPendingState();return}Lt&&(this._exactKeyMatch=Lt),this._startTimer()}holdKeyBindingExecution(Se,Mt){this._holdKeyBindingPromises.set(Se,Mt)}processKeyupEvent(Se){this._clearModifierTimer()}_startModifierTimer(Se){this._clearModifierTimer(),this._timerModifierID=window.setTimeout(()=>{this._executeKeyBinding(Se)},uv.modifierkeyTimeOut)}_clearModifierTimer(){this._timerModifierID!==0&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout(()=>{this._onPendingTimeout()},uv.CHORD_TIMEOUT)}_clearTimer(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(uv.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(Se){if(this._holdKeyBindingPromises.size!==0){let gr=[...this._keydownEvents],pi=(await Promise.race([Promise.all(gr.map(async ti=>{var ci;return(ci=this._holdKeyBindingPromises.get(ti))!==null&&ci!==void 0?ci:Promise.resolve(!0)})),new Promise(ti=>{setTimeout(()=>ti([!1]),uv.KEYBINDING_HOLD_TIMEOUT)})])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!pi)return}let{command:Mt,args:Lt}=Se,$t={_luminoEvent:{type:"keybinding",keys:Se.keys},...Lt};if(!this.hasCommand(Mt)||!this.isEnabled(Mt,$t)){let gr=this.hasCommand(Mt)?"enabled":"registered",ti=`Cannot execute key binding '${Se.keys.join(", ")}':`,ci=`command '${Mt}' is not ${gr}.`;console.warn(`${ti} ${ci}`);return}await this.execute(Mt,$t)}_clearPendingState(){this._clearTimer(),this._clearModifierTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}};(function(jt){function Se(ti){let ci="",Ii=!1,si=!1,mi=!1,Ri=!1;for(let yi of ti.split(/\s+/))yi==="Accel"?cd.IS_MAC?si=!0:mi=!0:yi==="Alt"?Ii=!0:yi==="Cmd"?si=!0:yi==="Ctrl"?mi=!0:yi==="Shift"?Ri=!0:yi.length>0&&(ci=yi);return{cmd:si,ctrl:mi,alt:Ii,shift:Ri,key:ci}}jt.parseKeystroke=Se;function Mt(ti){let ci="",Ii=Se(ti);return Ii.ctrl&&(ci+="Ctrl "),Ii.alt&&(ci+="Alt "),Ii.shift&&(ci+="Shift "),Ii.cmd&&cd.IS_MAC&&(ci+="Cmd "),Ii.key?ci+Ii.key:ci.trim()}jt.normalizeKeystroke=Mt;function Lt(ti){let ci;return cd.IS_WIN?ci=ti.winKeys||ti.keys:cd.IS_MAC?ci=ti.macKeys||ti.keys:ci=ti.linuxKeys||ti.keys,ci.map(Mt)}jt.normalizeKeys=Lt;function $t(ti){return typeof ti=="string"?ci(ti):ti.map(ci).join(", ");function ci(Ii){let si=[],mi=cd.IS_MAC?" ":"+",Ri=Se(Ii);return Ri.ctrl&&si.push("Ctrl"),Ri.alt&&si.push("Alt"),Ri.shift&&si.push("Shift"),cd.IS_MAC&&Ri.cmd&&si.push("Cmd"),si.push(Ri.key),si.map(uv.formatKey).join(mi)}}jt.formatKeystroke=$t;function gr(ti){let ci=Um(),Ii=ci.keyForKeydownEvent(ti);return ci.isModifierKey(Ii)}jt.isModifierKeyPressed=gr;function pi(ti){let ci=Um(),Ii=ci.keyForKeydownEvent(ti),si=[];return ti.ctrlKey&&si.push("Ctrl"),ti.altKey&&si.push("Alt"),ti.shiftKey&&si.push("Shift"),ti.metaKey&&cd.IS_MAC&&si.push("Cmd"),ci.isModifierKey(Ii)||si.push(Ii),si.join(" ")}jt.keystrokeForKeydownEvent=pi})(rp||(rp={}));var uv;(function(jt){jt.CHORD_TIMEOUT=1e3,jt.KEYBINDING_HOLD_TIMEOUT=1e3,jt.modifierkeyTimeOut=500;function Se(sa){return{execute:sa.execute,describedBy:bi(typeof sa.describedBy=="function"?sa.describedBy:{args:null,...sa.describedBy},()=>({args:null})),label:bi(sa.label,ci),mnemonic:bi(sa.mnemonic,Ii),icon:bi(sa.icon,yi),iconClass:bi(sa.iconClass,ci),iconLabel:bi(sa.iconLabel,ci),caption:bi(sa.caption,ci),usage:bi(sa.usage,ci),className:bi(sa.className,ci),dataset:bi(sa.dataset,Ri),isEnabled:sa.isEnabled||si,isToggled:sa.isToggled||mi,isToggleable:sa.isToggleable||!!sa.isToggled,isVisible:sa.isVisible||si}}jt.createCommand=Se;function Mt(sa){var Ua;return{keys:rp.normalizeKeys(sa),selector:wi(sa),command:sa.command,args:sa.args||Kh.JSONExt.emptyObject,preventDefault:(Ua=sa.preventDefault)!==null&&Ua!==void 0?Ua:!0}}jt.createKeyBinding=Mt;function Lt(sa,Ua,en){let Mn=null,za=[],Qn=1/0,Do=0;for(let Tn=0,lo=sa.length;Tn<lo;++Tn){let vn=sa[Tn],zn=De(vn.keys,Ua);if(zn===0)continue;if(zn===2){tn(vn.selector,en)!==-1&&za.push(vn);continue}let zl=tn(vn.selector,en);if(zl===-1||zl>Qn)continue;let fu=lv.calculateSpecificity(vn.selector);(!Mn||zl<Qn||fu>=Do)&&(Mn=vn,Qn=zl,Do=fu)}return{exact:Mn,partial:za}}jt.matchKeyBinding=Lt;function $t(sa){sa.target.dispatchEvent(Ya(sa))}jt.replayKeyEvent=$t;function gr(sa){return cd.IS_MAC?pi.hasOwnProperty(sa)?pi[sa]:sa:ti.hasOwnProperty(sa)?ti[sa]:sa}jt.formatKey=gr;let pi={Backspace:"\u232B",Tab:"\u21E5",Enter:"\u23CE",Shift:"\u21E7",Ctrl:"\u2303",Alt:"\u2325",Escape:"\u238B",PageUp:"\u21DE",PageDown:"\u21DF",End:"\u2198",Home:"\u2196",ArrowLeft:"\u2190",ArrowUp:"\u2191",ArrowRight:"\u2192",ArrowDown:"\u2193",Delete:"\u2326",Cmd:"\u2318"},ti={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},ci=()=>"",Ii=()=>-1,si=()=>!0,mi=()=>!1,Ri=()=>({}),yi=()=>{};function bi(sa,Ua){return sa===void 0?Ua:typeof sa=="function"?sa:()=>sa}function wi(sa){if(sa.selector.indexOf(",")!==-1)throw new Error(`Selector cannot contain commas: ${sa.selector}`);if(!lv.isValid(sa.selector))throw new Error(`Invalid selector: ${sa.selector}`);return sa.selector}function De(sa,Ua){if(sa.length<Ua.length)return 0;for(let en=0,Mn=Ua.length;en<Mn;++en)if(sa[en]!==Ua[en])return 0;return sa.length>Ua.length?2:1}function tn(sa,Ua){let en=Ua.target,Mn=Ua.currentTarget;for(let za=0;en!==null;en=en.parentElement,++za){if(en.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(lv.matches(en,sa))return za;if(en===Mn)return-1}return-1}function Ya(sa){let Ua=document.createEvent("Event"),en=sa.bubbles||!0,Mn=sa.cancelable||!0;return Ua.initEvent(sa.type||"keydown",en,Mn),Ua.key=sa.key||"",Ua.keyCode=sa.keyCode||0,Ua.which=sa.keyCode||0,Ua.ctrlKey=sa.ctrlKey||!1,Ua.altKey=sa.altKey||!1,Ua.shiftKey=sa.shiftKey||!1,Ua.metaKey=sa.metaKey||!1,Ua.view=sa.view||window,Ua}})(uv||(uv={}));var jm=Qv(P0()),Vm=class{constructor(Se){this.type="text",this.content=Se}},Qg=class{constructor(Se,Mt,Lt,$t){this.type="element",this.tag=Se,this.attrs=Mt,this.children=Lt,this.renderer=$t}};function qc(jt){let Se={},Mt,Lt=[];for(let gr=1,pi=arguments.length;gr<pi;++gr){let ti=arguments[gr];typeof ti=="string"?Lt.push(new Vm(ti)):ti instanceof Vm||ti instanceof Qg?Lt.push(ti):ti instanceof Array?$t(Lt,ti):(gr===1||gr===2)&&ti&&typeof ti=="object"&&("render"in ti?Mt=ti:Se=ti)}return new Qg(jt,Se,Lt,Mt);function $t(gr,pi){for(let ti of pi)typeof ti=="string"?gr.push(new Vm(ti)):(ti instanceof Vm||ti instanceof Qg)&&gr.push(ti)}}(function(jt){jt.a=jt.bind(void 0,"a"),jt.abbr=jt.bind(void 0,"abbr"),jt.address=jt.bind(void 0,"address"),jt.area=jt.bind(void 0,"area"),jt.article=jt.bind(void 0,"article"),jt.aside=jt.bind(void 0,"aside"),jt.audio=jt.bind(void 0,"audio"),jt.b=jt.bind(void 0,"b"),jt.bdi=jt.bind(void 0,"bdi"),jt.bdo=jt.bind(void 0,"bdo"),jt.blockquote=jt.bind(void 0,"blockquote"),jt.br=jt.bind(void 0,"br"),jt.button=jt.bind(void 0,"button"),jt.canvas=jt.bind(void 0,"canvas"),jt.caption=jt.bind(void 0,"caption"),jt.cite=jt.bind(void 0,"cite"),jt.code=jt.bind(void 0,"code"),jt.col=jt.bind(void 0,"col"),jt.colgroup=jt.bind(void 0,"colgroup"),jt.data=jt.bind(void 0,"data"),jt.datalist=jt.bind(void 0,"datalist"),jt.dd=jt.bind(void 0,"dd"),jt.del=jt.bind(void 0,"del"),jt.dfn=jt.bind(void 0,"dfn"),jt.div=jt.bind(void 0,"div"),jt.dl=jt.bind(void 0,"dl"),jt.dt=jt.bind(void 0,"dt"),jt.em=jt.bind(void 0,"em"),jt.embed=jt.bind(void 0,"embed"),jt.fieldset=jt.bind(void 0,"fieldset"),jt.figcaption=jt.bind(void 0,"figcaption"),jt.figure=jt.bind(void 0,"figure"),jt.footer=jt.bind(void 0,"footer"),jt.form=jt.bind(void 0,"form"),jt.h1=jt.bind(void 0,"h1"),jt.h2=jt.bind(void 0,"h2"),jt.h3=jt.bind(void 0,"h3"),jt.h4=jt.bind(void 0,"h4"),jt.h5=jt.bind(void 0,"h5"),jt.h6=jt.bind(void 0,"h6"),jt.header=jt.bind(void 0,"header"),jt.hr=jt.bind(void 0,"hr"),jt.i=jt.bind(void 0,"i"),jt.iframe=jt.bind(void 0,"iframe"),jt.img=jt.bind(void 0,"img"),jt.input=jt.bind(void 0,"input"),jt.ins=jt.bind(void 0,"ins"),jt.kbd=jt.bind(void 0,"kbd"),jt.label=jt.bind(void 0,"label"),jt.legend=jt.bind(void 0,"legend"),jt.li=jt.bind(void 0,"li"),jt.main=jt.bind(void 0,"main"),jt.map=jt.bind(void 0,"map"),jt.mark=jt.bind(void 0,"mark"),jt.meter=jt.bind(void 0,"meter"),jt.nav=jt.bind(void 0,"nav"),jt.noscript=jt.bind(void 0,"noscript"),jt.object=jt.bind(void 0,"object"),jt.ol=jt.bind(void 0,"ol"),jt.optgroup=jt.bind(void 0,"optgroup"),jt.option=jt.bind(void 0,"option"),jt.output=jt.bind(void 0,"output"),jt.p=jt.bind(void 0,"p"),jt.param=jt.bind(void 0,"param"),jt.pre=jt.bind(void 0,"pre"),jt.progress=jt.bind(void 0,"progress"),jt.q=jt.bind(void 0,"q"),jt.rp=jt.bind(void 0,"rp"),jt.rt=jt.bind(void 0,"rt"),jt.ruby=jt.bind(void 0,"ruby"),jt.s=jt.bind(void 0,"s"),jt.samp=jt.bind(void 0,"samp"),jt.section=jt.bind(void 0,"section"),jt.select=jt.bind(void 0,"select"),jt.small=jt.bind(void 0,"small"),jt.source=jt.bind(void 0,"source"),jt.span=jt.bind(void 0,"span"),jt.strong=jt.bind(void 0,"strong"),jt.sub=jt.bind(void 0,"sub"),jt.summary=jt.bind(void 0,"summary"),jt.sup=jt.bind(void 0,"sup"),jt.table=jt.bind(void 0,"table"),jt.tbody=jt.bind(void 0,"tbody"),jt.td=jt.bind(void 0,"td"),jt.textarea=jt.bind(void 0,"textarea"),jt.tfoot=jt.bind(void 0,"tfoot"),jt.th=jt.bind(void 0,"th"),jt.thead=jt.bind(void 0,"thead"),jt.time=jt.bind(void 0,"time"),jt.title=jt.bind(void 0,"title"),jt.tr=jt.bind(void 0,"tr"),jt.track=jt.bind(void 0,"track"),jt.u=jt.bind(void 0,"u"),jt.ul=jt.bind(void 0,"ul"),jt.var_=jt.bind(void 0,"var"),jt.video=jt.bind(void 0,"video"),jt.wbr=jt.bind(void 0,"wbr")})(qc||(qc={}));var ip;(function(jt){function Se(Lt){return D0.createDOMNode(Lt)}jt.realize=Se;function Mt(Lt,$t){let gr=D0.hostMap.get($t)||[],pi=D0.asContentArray(Lt);D0.hostMap.set($t,pi),D0.updateContent($t,gr,pi)}jt.render=Mt})(ip||(ip={}));var D0;(function(jt){jt.hostMap=new WeakMap;function Se(yi){return yi?yi instanceof Array?yi:[yi]:[]}jt.asContentArray=Se;function Mt(yi){let bi=arguments[1]||null,wi=arguments[2]||null;if(bi)bi.insertBefore(Mt(yi),wi);else{if(yi.type==="text")return document.createTextNode(yi.content);if(bi=document.createElement(yi.tag),pi(bi,yi.attrs),yi.renderer)return yi.renderer.render(bi,{attrs:yi.attrs,children:yi.children}),bi;for(let De=0,tn=yi.children.length;De<tn;++De)Mt(yi.children[De],bi)}return bi}jt.createDOMNode=Mt;function Lt(yi,bi,wi){if(bi===wi)return;let De=Ri(yi,bi),tn=bi.slice(),Ya=yi.firstChild,sa=wi.length;for(let Ua=0;Ua<sa;++Ua){if(Ua>=tn.length){Mt(wi[Ua],yi);continue}let en=tn[Ua],Mn=wi[Ua];if(en===Mn){Ya=Ya.nextSibling;continue}if(en.type==="text"&&Mn.type==="text"){Ya.textContent!==Mn.content&&(Ya.textContent=Mn.content),Ya=Ya.nextSibling;continue}if(en.type==="text"||Mn.type==="text"){jm.ArrayExt.insert(tn,Ua,Mn),Mt(Mn,yi,Ya);continue}if(!en.renderer!=!Mn.renderer){jm.ArrayExt.insert(tn,Ua,Mn),Mt(Mn,yi,Ya);continue}let za=Mn.attrs.key;if(za&&za in De){let Do=De[za];Do.vNode!==en&&(jm.ArrayExt.move(tn,tn.indexOf(Do.vNode,Ua+1),Ua),yi.insertBefore(Do.element,Ya),en=Do.vNode,Ya=Do.element)}if(en===Mn){Ya=Ya.nextSibling;continue}let Qn=en.attrs.key;if(Qn&&Qn!==za){jm.ArrayExt.insert(tn,Ua,Mn),Mt(Mn,yi,Ya);continue}if(en.tag!==Mn.tag){jm.ArrayExt.insert(tn,Ua,Mn),Mt(Mn,yi,Ya);continue}ti(Ya,en.attrs,Mn.attrs),Mn.renderer?Mn.renderer.render(Ya,{attrs:Mn.attrs,children:Mn.children}):Lt(Ya,en.children,Mn.children),Ya=Ya.nextSibling}$t(yi,tn,sa,!0)}jt.updateContent=Lt;function $t(yi,bi,wi,De){for(let tn=bi.length-1;tn>=wi;--tn){let Ya=bi[tn],sa=De?yi.lastChild:yi.childNodes[tn];Ya.type==="text"||(Ya.renderer&&Ya.renderer.unrender?Ya.renderer.unrender(sa,{attrs:Ya.attrs,children:Ya.children}):$t(sa,Ya.children,0,!1)),De&&yi.removeChild(sa)}}let gr={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function pi(yi,bi){for(let wi in bi)wi in gr||(wi.substr(0,2)==="on"?yi[wi]=bi[wi]:yi.setAttribute(wi,bi[wi]));bi.className!==void 0&&yi.setAttribute("class",bi.className),bi.htmlFor!==void 0&&yi.setAttribute("for",bi.htmlFor),bi.dataset&&ci(yi,bi.dataset),bi.style&&si(yi,bi.style)}function ti(yi,bi,wi){if(bi===wi)return;let De;for(De in bi)De in gr||De in wi||(De.substr(0,2)==="on"?yi[De]=null:yi.removeAttribute(De));for(De in wi)De in gr||bi[De]===wi[De]||(De.substr(0,2)==="on"?yi[De]=wi[De]:yi.setAttribute(De,wi[De]));bi.className!==wi.className&&(wi.className!==void 0?yi.setAttribute("class",wi.className):yi.removeAttribute("class")),bi.htmlFor!==wi.htmlFor&&(wi.htmlFor!==void 0?yi.setAttribute("for",wi.htmlFor):yi.removeAttribute("for")),bi.dataset!==wi.dataset&&Ii(yi,bi.dataset||{},wi.dataset||{}),bi.style!==wi.style&&mi(yi,bi.style||{},wi.style||{})}function ci(yi,bi){for(let wi in bi)yi.setAttribute(`data-${wi}`,bi[wi])}function Ii(yi,bi,wi){for(let De in bi)De in wi||yi.removeAttribute(`data-${De}`);for(let De in wi)bi[De]!==wi[De]&&yi.setAttribute(`data-${De}`,wi[De])}function si(yi,bi){let wi=yi.style,De;for(De in bi)wi[De]=bi[De]}function mi(yi,bi,wi){let De=yi.style,tn;for(tn in bi)tn in wi||(De[tn]="");for(tn in wi)bi[tn]!==wi[tn]&&(De[tn]=wi[tn])}function Ri(yi,bi){let wi=yi.firstChild,De=Object.create(null);for(let tn of bi)tn.type==="element"&&tn.attrs.key&&(De[tn.attrs.key]={vNode:tn,element:wi}),wi=wi.nextSibling;return De}})(D0||(D0={}));var Pv=class{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}},Fd;(function(jt){function Se(gr,pi){let ti=gr.length;if(ti===0)return pi;let ci=0,Ii=0,si=0,mi=0,Ri=0;for(let wi=0;wi<ti;++wi){let De=gr[wi],tn=De.minSize,Ya=De.maxSize,sa=De.sizeHint;De.done=!1,De.size=Math.max(tn,Math.min(sa,Ya)),si+=De.size,ci+=tn,Ii+=Ya,De.stretch>0&&(mi+=De.stretch,Ri++)}if(pi===si)return 0;if(pi<=ci){for(let wi=0;wi<ti;++wi){let De=gr[wi];De.size=De.minSize}return pi-ci}if(pi>=Ii){for(let wi=0;wi<ti;++wi){let De=gr[wi];De.size=De.maxSize}return pi-Ii}let yi=.01,bi=ti;if(pi<si){let wi=si-pi;for(;Ri>0&&wi>yi;){let De=wi,tn=mi;for(let Ya=0;Ya<ti;++Ya){let sa=gr[Ya];if(sa.done||sa.stretch===0)continue;let Ua=sa.stretch*De/tn;sa.size-Ua<=sa.minSize?(wi-=sa.size-sa.minSize,mi-=sa.stretch,sa.size=sa.minSize,sa.done=!0,bi--,Ri--):(wi-=Ua,sa.size-=Ua)}}for(;bi>0&&wi>yi;){let De=wi/bi;for(let tn=0;tn<ti;++tn){let Ya=gr[tn];Ya.done||(Ya.size-De<=Ya.minSize?(wi-=Ya.size-Ya.minSize,Ya.size=Ya.minSize,Ya.done=!0,bi--):(wi-=De,Ya.size-=De))}}}else{let wi=pi-si;for(;Ri>0&&wi>yi;){let De=wi,tn=mi;for(let Ya=0;Ya<ti;++Ya){let sa=gr[Ya];if(sa.done||sa.stretch===0)continue;let Ua=sa.stretch*De/tn;sa.size+Ua>=sa.maxSize?(wi-=sa.maxSize-sa.size,mi-=sa.stretch,sa.size=sa.maxSize,sa.done=!0,bi--,Ri--):(wi-=Ua,sa.size+=Ua)}}for(;bi>0&&wi>yi;){let De=wi/bi;for(let tn=0;tn<ti;++tn){let Ya=gr[tn];Ya.done||(Ya.size+De>=Ya.maxSize?(wi-=Ya.maxSize-Ya.size,Ya.size=Ya.maxSize,Ya.done=!0,bi--):(wi-=De,Ya.size+=De))}}}return 0}jt.calc=Se;function Mt(gr,pi,ti){gr.length===0||ti===0||(ti>0?Lt(gr,pi,ti):$t(gr,pi,-ti))}jt.adjust=Mt;function Lt(gr,pi,ti){let ci=0;for(let Ri=0;Ri<=pi;++Ri){let yi=gr[Ri];ci+=yi.maxSize-yi.size}let Ii=0;for(let Ri=pi+1,yi=gr.length;Ri<yi;++Ri){let bi=gr[Ri];Ii+=bi.size-bi.minSize}ti=Math.min(ti,ci,Ii);let si=ti;for(let Ri=pi;Ri>=0&&si>0;--Ri){let yi=gr[Ri],bi=yi.maxSize-yi.size;bi>=si?(yi.sizeHint=yi.size+si,si=0):(yi.sizeHint=yi.size+bi,si-=bi)}let mi=ti;for(let Ri=pi+1,yi=gr.length;Ri<yi&&mi>0;++Ri){let bi=gr[Ri],wi=bi.size-bi.minSize;wi>=mi?(bi.sizeHint=bi.size-mi,mi=0):(bi.sizeHint=bi.size-wi,mi-=wi)}}function $t(gr,pi,ti){let ci=0;for(let Ri=pi+1,yi=gr.length;Ri<yi;++Ri){let bi=gr[Ri];ci+=bi.maxSize-bi.size}let Ii=0;for(let Ri=0;Ri<=pi;++Ri){let yi=gr[Ri];Ii+=yi.size-yi.minSize}ti=Math.min(ti,ci,Ii);let si=ti;for(let Ri=pi+1,yi=gr.length;Ri<yi&&si>0;++Ri){let bi=gr[Ri],wi=bi.maxSize-bi.size;wi>=si?(bi.sizeHint=bi.size+si,si=0):(bi.sizeHint=bi.size+wi,si-=wi)}let mi=ti;for(let Ri=pi;Ri>=0&&mi>0;--Ri){let yi=gr[Ri],bi=yi.size-yi.minSize;bi>=mi?(yi.sizeHint=yi.size-mi,mi=0):(yi.sizeHint=yi.size-bi,mi-=bi)}}})(Fd||(Fd={}));var ey=class{constructor(Se){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new Vc(this),this._isDisposed=!1,this.owner=Se.owner,Se.label!==void 0&&(this._label=Se.label),Se.mnemonic!==void 0&&(this._mnemonic=Se.mnemonic),Se.icon!==void 0&&(this._icon=Se.icon),Se.iconClass!==void 0&&(this._iconClass=Se.iconClass),Se.iconLabel!==void 0&&(this._iconLabel=Se.iconLabel),Se.caption!==void 0&&(this._caption=Se.caption),Se.className!==void 0&&(this._className=Se.className),Se.closable!==void 0&&(this._closable=Se.closable),this._dataset=Se.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(Se){this._label!==Se&&(this._label=Se,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(Se){this._mnemonic!==Se&&(this._mnemonic=Se,this._changed.emit(void 0))}get icon(){return this._icon}set icon(Se){this._icon!==Se&&(this._icon=Se,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(Se){this._iconClass!==Se&&(this._iconClass=Se,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(Se){this._iconLabel!==Se&&(this._iconLabel=Se,this._changed.emit(void 0))}get caption(){return this._caption}set caption(Se){this._caption!==Se&&(this._caption=Se,this._changed.emit(void 0))}get className(){return this._className}set className(Se){this._className!==Se&&(this._className=Se,this._changed.emit(void 0))}get closable(){return this._closable}set closable(Se){this._closable!==Se&&(this._closable=Se,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(Se){this._dataset!==Se&&(this._dataset=Se,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,Vc.clearData(this))}},rs=class jt{constructor(Se={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new Vc(this),this._hiddenMode=jt.HiddenMode.Display,this.node=s_.createNode(Se),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(jt.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&jt.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),Vc.clearData(this),qo.clearData(this),xd.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(jt.Flag.IsDisposed)}get isAttached(){return this.testFlag(jt.Flag.IsAttached)}get isHidden(){return this.testFlag(jt.Flag.IsHidden)}get isVisible(){return this.testFlag(jt.Flag.IsVisible)}get title(){return s_.titleProperty.get(this)}get id(){return this.node.id}set id(Se){this.node.id=Se}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(Se){this._hiddenMode!==Se&&(this.isHidden&&this._toggleHidden(!1),Se==jt.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=Se,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(Se){if(this._parent!==Se){if(Se&&this.contains(Se))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let Mt=new jt.ChildMessage("child-removed",this);qo.sendMessage(this._parent,Mt)}if(this._parent=Se,this._parent&&!this._parent.isDisposed){let Mt=new jt.ChildMessage("child-added",this);qo.sendMessage(this._parent,Mt)}this.isDisposed||qo.sendMessage(this,jt.Msg.ParentChanged)}}get layout(){return this._layout}set layout(Se){if(this._layout!==Se){if(this.testFlag(jt.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(Se.parent)throw new Error("Cannot change layout parent.");this._layout=Se,Se.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(Se){for(let Mt=Se;Mt;Mt=Mt._parent)if(Mt===this)return!0;return!1}hasClass(Se){return this.node.classList.contains(Se)}addClass(Se){this.node.classList.add(Se)}removeClass(Se){this.node.classList.remove(Se)}toggleClass(Se,Mt){return Mt===!0?(this.node.classList.add(Se),!0):Mt===!1?(this.node.classList.remove(Se),!1):this.node.classList.toggle(Se)}update(){qo.postMessage(this,jt.Msg.UpdateRequest)}fit(){qo.postMessage(this,jt.Msg.FitRequest)}activate(){qo.postMessage(this,jt.Msg.ActivateRequest)}close(){qo.sendMessage(this,jt.Msg.CloseRequest)}show(){if(this.testFlag(jt.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&qo.sendMessage(this,jt.Msg.BeforeShow),this.clearFlag(jt.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&qo.sendMessage(this,jt.Msg.AfterShow),this.parent)){let Se=new jt.ChildMessage("child-shown",this);qo.sendMessage(this.parent,Se)}}hide(){if(!this.testFlag(jt.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&qo.sendMessage(this,jt.Msg.BeforeHide),this.setFlag(jt.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&qo.sendMessage(this,jt.Msg.AfterHide),this.parent)){let Se=new jt.ChildMessage("child-hidden",this);qo.sendMessage(this.parent,Se)}}setHidden(Se){Se?this.hide():this.show()}testFlag(Se){return(this._flags&Se)!==0}setFlag(Se){this._flags|=Se}clearFlag(Se){this._flags&=~Se}processMessage(Se){switch(Se.type){case"resize":this.notifyLayout(Se),this.onResize(Se);break;case"update-request":this.notifyLayout(Se),this.onUpdateRequest(Se);break;case"fit-request":this.notifyLayout(Se),this.onFitRequest(Se);break;case"before-show":this.notifyLayout(Se),this.onBeforeShow(Se);break;case"after-show":this.setFlag(jt.Flag.IsVisible),this.notifyLayout(Se),this.onAfterShow(Se);break;case"before-hide":this.notifyLayout(Se),this.onBeforeHide(Se);break;case"after-hide":this.clearFlag(jt.Flag.IsVisible),this.notifyLayout(Se),this.onAfterHide(Se);break;case"before-attach":this.notifyLayout(Se),this.onBeforeAttach(Se);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(jt.Flag.IsVisible),this.setFlag(jt.Flag.IsAttached),this.notifyLayout(Se),this.onAfterAttach(Se);break;case"before-detach":this.notifyLayout(Se),this.onBeforeDetach(Se);break;case"after-detach":this.clearFlag(jt.Flag.IsVisible),this.clearFlag(jt.Flag.IsAttached),this.notifyLayout(Se),this.onAfterDetach(Se);break;case"activate-request":this.notifyLayout(Se),this.onActivateRequest(Se);break;case"close-request":this.notifyLayout(Se),this.onCloseRequest(Se);break;case"child-added":this.notifyLayout(Se),this.onChildAdded(Se);break;case"child-removed":this.notifyLayout(Se),this.onChildRemoved(Se);break;default:this.notifyLayout(Se);break}}notifyLayout(Se){this._layout&&this._layout.processParentMessage(Se)}onCloseRequest(Se){this.parent?this.parent=null:this.isAttached&&jt.detach(this)}onResize(Se){}onUpdateRequest(Se){}onFitRequest(Se){}onActivateRequest(Se){}onBeforeShow(Se){}onAfterShow(Se){}onBeforeHide(Se){}onAfterHide(Se){}onBeforeAttach(Se){}onAfterAttach(Se){}onBeforeDetach(Se){}onAfterDetach(Se){}onChildAdded(Se){}onChildRemoved(Se){}_toggleHidden(Se){if(Se)switch(this._hiddenMode){case jt.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case jt.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case jt.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1";break}else switch(this._hiddenMode){case jt.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case jt.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case jt.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="";break}}};(function(jt){(function(gr){gr[gr.Display=0]="Display",gr[gr.Scale=1]="Scale",gr[gr.ContentVisibility=2]="ContentVisibility"})(jt.HiddenMode||(jt.HiddenMode={})),function(gr){gr[gr.IsDisposed=1]="IsDisposed",gr[gr.IsAttached=2]="IsAttached",gr[gr.IsHidden=4]="IsHidden",gr[gr.IsVisible=8]="IsVisible",gr[gr.DisallowLayout=16]="DisallowLayout"}(jt.Flag||(jt.Flag={})),function(gr){gr.BeforeShow=new _d("before-show"),gr.AfterShow=new _d("after-show"),gr.BeforeHide=new _d("before-hide"),gr.AfterHide=new _d("after-hide"),gr.BeforeAttach=new _d("before-attach"),gr.AfterAttach=new _d("after-attach"),gr.BeforeDetach=new _d("before-detach"),gr.AfterDetach=new _d("after-detach"),gr.ParentChanged=new _d("parent-changed"),gr.UpdateRequest=new Bp("update-request"),gr.FitRequest=new Bp("fit-request"),gr.ActivateRequest=new Bp("activate-request"),gr.CloseRequest=new Bp("close-request")}(jt.Msg||(jt.Msg={}));class Se extends _d{constructor(pi,ti){super(pi),this.child=ti}}jt.ChildMessage=Se;class Mt extends _d{constructor(pi,ti){super("resize"),this.width=pi,this.height=ti}}jt.ResizeMessage=Mt,function(gr){gr.UnknownSize=new gr(-1,-1)}(Mt=jt.ResizeMessage||(jt.ResizeMessage={}));function Lt(gr,pi,ti=null){if(gr.parent)throw new Error("Cannot attach a child widget.");if(gr.isAttached||gr.node.isConnected)throw new Error("Widget is already attached.");if(!pi.isConnected)throw new Error("Host is not attached.");qo.sendMessage(gr,jt.Msg.BeforeAttach),pi.insertBefore(gr.node,ti),qo.sendMessage(gr,jt.Msg.AfterAttach)}jt.attach=Lt;function $t(gr){if(gr.parent)throw new Error("Cannot detach a child widget.");if(!gr.isAttached||!gr.node.isConnected)throw new Error("Widget is not attached.");qo.sendMessage(gr,jt.Msg.BeforeDetach),gr.node.parentNode.removeChild(gr.node),qo.sendMessage(gr,jt.Msg.AfterDetach)}jt.detach=$t})(rs||(rs={}));var s_;(function(jt){jt.titleProperty=new xd({name:"title",create:Mt=>new ey({owner:Mt})});function Se(Mt){return Mt.node||document.createElement(Mt.tag||"div")}jt.createNode=Se})(s_||(s_={}));var sp=class{constructor(Se={}){this._disposed=!1,this._parent=null,this._fitPolicy=Se.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,Vc.clearData(this),xd.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(Se){if(this._parent!==Se){if(this._parent)throw new Error("Cannot change parent widget.");if(Se.layout!==this)throw new Error("Invalid parent widget.");this._parent=Se,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(Se){if(this._fitPolicy!==Se&&(this._fitPolicy=Se,this._parent)){let Mt=this._parent.node.style;Mt.minWidth="",Mt.minHeight="",Mt.maxWidth="",Mt.maxHeight="",this._parent.fit()}}processParentMessage(Se){switch(Se.type){case"resize":this.onResize(Se);break;case"update-request":this.onUpdateRequest(Se);break;case"fit-request":this.onFitRequest(Se);break;case"before-show":this.onBeforeShow(Se);break;case"after-show":this.onAfterShow(Se);break;case"before-hide":this.onBeforeHide(Se);break;case"after-hide":this.onAfterHide(Se);break;case"before-attach":this.onBeforeAttach(Se);break;case"after-attach":this.onAfterAttach(Se);break;case"before-detach":this.onBeforeDetach(Se);break;case"after-detach":this.onAfterDetach(Se);break;case"child-removed":this.onChildRemoved(Se);break;case"child-shown":this.onChildShown(Se);break;case"child-hidden":this.onChildHidden(Se);break}}init(){for(let Se of this)Se.parent=this.parent}onResize(Se){for(let Mt of this)qo.sendMessage(Mt,rs.ResizeMessage.UnknownSize)}onUpdateRequest(Se){for(let Mt of this)qo.sendMessage(Mt,rs.ResizeMessage.UnknownSize)}onBeforeAttach(Se){for(let Mt of this)qo.sendMessage(Mt,Se)}onAfterAttach(Se){for(let Mt of this)qo.sendMessage(Mt,Se)}onBeforeDetach(Se){for(let Mt of this)qo.sendMessage(Mt,Se)}onAfterDetach(Se){for(let Mt of this)qo.sendMessage(Mt,Se)}onBeforeShow(Se){for(let Mt of this)Mt.isHidden||qo.sendMessage(Mt,Se)}onAfterShow(Se){for(let Mt of this)Mt.isHidden||qo.sendMessage(Mt,Se)}onBeforeHide(Se){for(let Mt of this)Mt.isHidden||qo.sendMessage(Mt,Se)}onAfterHide(Se){for(let Mt of this)Mt.isHidden||qo.sendMessage(Mt,Se)}onChildRemoved(Se){this.removeWidget(Se.child)}onFitRequest(Se){}onChildShown(Se){}onChildHidden(Se){}};(function(jt){function Se(gr){return qm.horizontalAlignmentProperty.get(gr)}jt.getHorizontalAlignment=Se;function Mt(gr,pi){qm.horizontalAlignmentProperty.set(gr,pi)}jt.setHorizontalAlignment=Mt;function Lt(gr){return qm.verticalAlignmentProperty.get(gr)}jt.getVerticalAlignment=Lt;function $t(gr,pi){qm.verticalAlignmentProperty.set(gr,pi)}jt.setVerticalAlignment=$t})(sp||(sp={}));var B0=class{constructor(Se){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=Se,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let Se=this.widget.node.style;Se.position="",Se.top="",Se.left="",Se.width="",Se.height="",Se.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let Se=Yc.sizeLimits(this.widget.node);this._minWidth=Se.minWidth,this._minHeight=Se.minHeight,this._maxWidth=Se.maxWidth,this._maxHeight=Se.maxHeight}update(Se,Mt,Lt,$t){let gr=Math.max(this._minWidth,Math.min(Lt,this._maxWidth)),pi=Math.max(this._minHeight,Math.min($t,this._maxHeight));if(gr<Lt)switch(sp.getHorizontalAlignment(this.widget)){case"left":break;case"center":Se+=(Lt-gr)/2;break;case"right":Se+=Lt-gr;break;default:throw"unreachable"}if(pi<$t)switch(sp.getVerticalAlignment(this.widget)){case"top":break;case"center":Mt+=($t-pi)/2;break;case"bottom":Mt+=$t-pi;break;default:throw"unreachable"}let ti=!1,ci=this.widget.node.style;if(this._top!==Mt&&(this._top=Mt,ci.top=`${Mt}px`),this._left!==Se&&(this._left=Se,ci.left=`${Se}px`),this._width!==gr&&(ti=!0,this._width=gr,ci.width=`${gr}px`),this._height!==pi&&(ti=!0,this._height=pi,ci.height=`${pi}px`),ti){let Ii=new rs.ResizeMessage(gr,pi);qo.sendMessage(this.widget,Ii)}}},qm;(function(jt){jt.horizontalAlignmentProperty=new xd({name:"horizontalAlignment",create:()=>"center",changed:Se}),jt.verticalAlignmentProperty=new xd({name:"verticalAlignment",create:()=>"top",changed:Se});function Se(Mt){Mt.parent&&Mt.parent.layout&&Mt.parent.update()}})(qm||(qm={}));var Hm=class extends sp{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(Se){this.insertWidget(this._widgets.length,Se)}insertWidget(Se,Mt){Mt.parent=this.parent;let Lt=this._widgets.indexOf(Mt),$t=Math.max(0,Math.min(Se,this._widgets.length));if(Lt===-1){ko.ArrayExt.insert(this._widgets,$t,Mt),this.parent&&this.attachWidget($t,Mt);return}$t===this._widgets.length&&$t--,Lt!==$t&&(ko.ArrayExt.move(this._widgets,Lt,$t),this.parent&&this.moveWidget(Lt,$t,Mt))}removeWidget(Se){this.removeWidgetAt(this._widgets.indexOf(Se))}removeWidgetAt(Se){let Mt=ko.ArrayExt.removeAt(this._widgets,Se);Mt&&this.parent&&this.detachWidget(Se,Mt)}init(){super.init();let Se=0;for(let Mt of this)this.attachWidget(Se++,Mt)}attachWidget(Se,Mt){let Lt=this.parent.node.children[Se];this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.BeforeAttach),this.parent.node.insertBefore(Mt.node,Lt),this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.AfterAttach)}moveWidget(Se,Mt,Lt){this.parent.isAttached&&qo.sendMessage(Lt,rs.Msg.BeforeDetach),this.parent.node.removeChild(Lt.node),this.parent.isAttached&&qo.sendMessage(Lt,rs.Msg.AfterDetach);let $t=this.parent.node.children[Mt];this.parent.isAttached&&qo.sendMessage(Lt,rs.Msg.BeforeAttach),this.parent.node.insertBefore(Lt.node,$t),this.parent.isAttached&&qo.sendMessage(Lt,rs.Msg.AfterAttach)}detachWidget(Se,Mt){this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.BeforeDetach),this.parent.node.removeChild(Mt.node),this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.AfterDetach)}},ty;(function(jt){function Se(Mt){return Math.max(0,Math.floor(Mt))}jt.clampDimension=Se})(ty||(ty={}));var ry=ty,lp=class jt extends Hm{constructor(Se){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=Se.renderer,Se.orientation!==void 0&&(this._orientation=Se.orientation),Se.alignment!==void 0&&(this._alignment=Se.alignment),Se.spacing!==void 0&&(this._spacing=ty.clampDimension(Se.spacing))}dispose(){for(let Se of this._items)Se.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(Se){this._orientation!==Se&&(this._orientation=Se,this.parent&&(this.parent.dataset.orientation=Se,this.parent.fit()))}get alignment(){return this._alignment}set alignment(Se){this._alignment!==Se&&(this._alignment=Se,this.parent&&(this.parent.dataset.alignment=Se,this.parent.update()))}get spacing(){return this._spacing}set spacing(Se){Se=ty.clampDimension(Se),this._spacing!==Se&&(this._spacing=Se,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map(Se=>Se.size)}relativeSizes(){return np.normalize(this._sizers.map(Se=>Se.size))}setRelativeSizes(Se,Mt=!0){let Lt=this._sizers.length,$t=Se.slice(0,Lt);for(;$t.length<Lt;)$t.push(0);let gr=np.normalize($t);for(let pi=0;pi<Lt;++pi){let ti=this._sizers[pi];ti.sizeHint=gr[pi],ti.size=gr[pi]}this._hasNormedSizes=!0,Mt&&this.parent&&this.parent.update()}moveHandle(Se,Mt){let Lt=this._handles[Se];if(!Lt||Lt.classList.contains("lm-mod-hidden"))return;let $t;if(this._orientation==="horizontal"?$t=Mt-Lt.offsetLeft:$t=Mt-Lt.offsetTop,$t!==0){for(let gr of this._sizers)gr.size>0&&(gr.sizeHint=gr.size);Fd.adjust(this._sizers,Se,$t),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(Se,Mt){let Lt=new B0(Mt),$t=np.createHandle(this.renderer),gr=np.averageSize(this._sizers),pi=np.createSizer(gr);ko.ArrayExt.insert(this._items,Se,Lt),ko.ArrayExt.insert(this._sizers,Se,pi),ko.ArrayExt.insert(this._handles,Se,$t),this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.BeforeAttach),this.parent.node.appendChild(Mt.node),this.parent.node.appendChild($t),this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.AfterAttach),this.parent.fit()}moveWidget(Se,Mt,Lt){ko.ArrayExt.move(this._items,Se,Mt),ko.ArrayExt.move(this._sizers,Se,Mt),ko.ArrayExt.move(this._handles,Se,Mt),this.parent.fit()}detachWidget(Se,Mt){let Lt=ko.ArrayExt.removeAt(this._items,Se),$t=ko.ArrayExt.removeAt(this._handles,Se);ko.ArrayExt.removeAt(this._sizers,Se),this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.BeforeDetach),this.parent.node.removeChild(Mt.node),this.parent.node.removeChild($t),this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.AfterDetach),Lt.dispose(),this.parent.fit()}onBeforeShow(Se){super.onBeforeShow(Se),this.parent.update()}onBeforeAttach(Se){super.onBeforeAttach(Se),this.parent.fit()}onChildShown(Se){this.parent.fit()}onChildHidden(Se){this.parent.fit()}onResize(Se){this.parent.isVisible&&this._update(Se.width,Se.height)}onUpdateRequest(Se){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(Se){this.parent.isAttached&&this._fit()}updateItemPosition(Se,Mt,Lt,$t,gr,pi,ti){let ci=this._items[Se];if(ci.isHidden)return;let Ii=this._handles[Se].style;Mt?(Lt+=this.widgetOffset,ci.update(Lt,$t,ti,gr),Lt+=ti,Ii.top=`${$t}px`,Ii.left=`${Lt}px`,Ii.width=`${this._spacing}px`,Ii.height=`${gr}px`):($t+=this.widgetOffset,ci.update(Lt,$t,pi,ti),$t+=ti,Ii.top=`${$t}px`,Ii.left=`${Lt}px`,Ii.width=`${pi}px`,Ii.height=`${this._spacing}px`)}_fit(){let Se=0,Mt=-1;for(let ci=0,Ii=this._items.length;ci<Ii;++ci)this._items[ci].isHidden?this._handles[ci].classList.add("lm-mod-hidden"):(this._handles[ci].classList.remove("lm-mod-hidden"),Mt=ci,Se++);Mt!==-1&&this._handles[Mt].classList.add("lm-mod-hidden"),this._fixed=this._spacing*Math.max(0,Se-1)+this.widgetOffset*this._items.length;let Lt=this._orientation==="horizontal",$t=Lt?this._fixed:0,gr=Lt?0:this._fixed;for(let ci=0,Ii=this._items.length;ci<Ii;++ci){let si=this._items[ci],mi=this._sizers[ci];if(mi.size>0&&(mi.sizeHint=mi.size),si.isHidden){mi.minSize=0,mi.maxSize=0;continue}si.fit(),mi.stretch=jt.getStretch(si.widget),Lt?(mi.minSize=si.minWidth,mi.maxSize=si.maxWidth,$t+=si.minWidth,gr=Math.max(gr,si.minHeight)):(mi.minSize=si.minHeight,mi.maxSize=si.maxHeight,gr+=si.minHeight,$t=Math.max($t,si.minWidth))}let pi=this._box=Yc.boxSizing(this.parent.node);$t+=pi.horizontalSum,gr+=pi.verticalSum;let ti=this.parent.node.style;ti.minWidth=`${$t}px`,ti.minHeight=`${gr}px`,this._dirty=!0,this.parent.parent&&qo.sendMessage(this.parent.parent,rs.Msg.FitRequest),this._dirty&&qo.sendMessage(this.parent,rs.Msg.UpdateRequest)}_update(Se,Mt){this._dirty=!1;let Lt=0;for(let mi=0,Ri=this._items.length;mi<Ri;++mi)Lt+=+!this._items[mi].isHidden;if(Lt===0&&this.widgetOffset===0)return;Se<0&&(Se=this.parent.node.offsetWidth),Mt<0&&(Mt=this.parent.node.offsetHeight),this._box||(this._box=Yc.boxSizing(this.parent.node));let $t=this._box.paddingTop,gr=this._box.paddingLeft,pi=Se-this._box.horizontalSum,ti=Mt-this._box.verticalSum,ci=0,Ii=0,si=this._orientation==="horizontal";if(Lt>0){let mi;if(si?mi=Math.max(0,pi-this._fixed):mi=Math.max(0,ti-this._fixed),this._hasNormedSizes){for(let yi of this._sizers)yi.sizeHint*=mi;this._hasNormedSizes=!1}let Ri=Fd.calc(this._sizers,mi);if(Ri>0)switch(this._alignment){case"start":break;case"center":ci=0,Ii=Ri/2;break;case"end":ci=0,Ii=Ri;break;case"justify":ci=Ri/Lt,Ii=0;break;default:throw"unreachable"}}for(let mi=0,Ri=this._items.length;mi<Ri;++mi){let bi=this._items[mi].isHidden?0:this._sizers[mi].size+ci;this.updateItemPosition(mi,si,si?gr+Ii:gr,si?$t:$t+Ii,ti,pi,bi);let wi=this.widgetOffset+(this._handles[mi].classList.contains("lm-mod-hidden")?0:this._spacing);si?gr+=bi+wi:$t+=bi+wi}}};(function(jt){function Se(Lt){return np.stretchProperty.get(Lt)}jt.getStretch=Se;function Mt(Lt,$t){np.stretchProperty.set(Lt,$t)}jt.setStretch=Mt})(lp||(lp={}));var np;(function(jt){jt.stretchProperty=new xd({name:"stretch",create:()=>0,coerce:(pi,ti)=>Math.max(0,Math.floor(ti)),changed:gr});function Se(pi){let ti=new Pv;return ti.sizeHint=Math.floor(pi),ti}jt.createSizer=Se;function Mt(pi){let ti=pi.createHandle();return ti.style.position="absolute",ti.style.contain="style",ti}jt.createHandle=Mt;function Lt(pi){return pi.reduce((ti,ci)=>ti+ci.size,0)/pi.length||0}jt.averageSize=Lt;function $t(pi){let ti=pi.length;if(ti===0)return[];let ci=pi.reduce((Ii,si)=>Ii+Math.abs(si),0);return ci===0?pi.map(Ii=>1/ti):pi.map(Ii=>Ii/ci)}jt.normalize=$t;function gr(pi){pi.parent&&pi.parent.layout instanceof lp&&pi.parent.fit()}})(np||(np={}));var Mw=class extends lp{constructor(Se){super({...Se,orientation:Se.orientation||"vertical"}),this._titles=[],this.titleSpace=Se.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(Se){Se=ry.clampDimension(Se),this.widgetOffset!==Se&&(this.widgetOffset=Se,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(Se,Mt){let Lt=this._titles[Se],$t=Lt.classList.contains("lm-mod-expanded"),gr=l_.createTitle(this.renderer,Mt.title,$t);this._titles[Se]=gr,this.parent.node.replaceChild(gr,Lt)}insertWidget(Se,Mt){Mt.id||(Mt.id=`id-${op.UUID.uuid4()}`),super.insertWidget(Se,Mt)}attachWidget(Se,Mt){let Lt=l_.createTitle(this.renderer,Mt.title);ko.ArrayExt.insert(this._titles,Se,Lt),this.parent.node.appendChild(Lt),Mt.node.setAttribute("role","region"),Mt.node.setAttribute("aria-labelledby",Lt.id),super.attachWidget(Se,Mt)}moveWidget(Se,Mt,Lt){ko.ArrayExt.move(this._titles,Se,Mt),super.moveWidget(Se,Mt,Lt)}detachWidget(Se,Mt){let Lt=ko.ArrayExt.removeAt(this._titles,Se);this.parent.node.removeChild(Lt),super.detachWidget(Se,Mt)}updateItemPosition(Se,Mt,Lt,$t,gr,pi,ti){let ci=this._titles[Se].style;ci.top=`${$t}px`,ci.left=`${Lt}px`,ci.height=`${this.widgetOffset}px`,Mt?ci.width=`${gr}px`:ci.width=`${pi}px`,super.updateItemPosition(Se,Mt,Lt,$t,gr,pi,ti)}},l_;(function(jt){function Se(Mt,Lt,$t=!0){let gr=Mt.createSectionTitle(Lt);return gr.style.position="absolute",gr.style.contain="strict",gr.setAttribute("aria-label",`${Lt.label} Section`),gr.setAttribute("aria-expanded",$t?"true":"false"),gr.setAttribute("aria-controls",Lt.owner.id),$t&&gr.classList.add("lm-mod-expanded"),gr}jt.createTitle=Se})(l_||(l_={}));var u_=class extends rs{constructor(Se={}){super(),this.addClass("lm-Panel"),this.layout=Ew.createLayout(Se)}get widgets(){return this.layout.widgets}addWidget(Se){this.layout.addWidget(Se)}insertWidget(Se,Mt){this.layout.insertWidget(Se,Mt)}},Ew;(function(jt){function Se(Mt){return Mt.layout||new Hm}jt.createLayout=Se})(Ew||(Ew={}));var O0=class extends u_{constructor(Se={}){super({layout:kw.createLayout(Se)}),this._handleMoved=new Vc(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(Se){this.layout.orientation=Se}get alignment(){return this.layout.alignment}set alignment(Se){this.layout.alignment=Se}get spacing(){return this.layout.spacing}set spacing(Se){this.layout.spacing=Se}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(Se,Mt=!0){this.layout.setRelativeSizes(Se,Mt)}handleEvent(Se){switch(Se.type){case"pointerdown":this._evtPointerDown(Se);break;case"pointermove":this._evtPointerMove(Se);break;case"pointerup":this._evtPointerUp(Se);break;case"keydown":this._evtKeyDown(Se);break;case"contextmenu":Se.preventDefault(),Se.stopPropagation();break}}onBeforeAttach(Se){this.node.addEventListener("pointerdown",this)}onAfterDetach(Se){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(Se){Se.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(Se){Se.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(Se){this._pressData&&(Se.preventDefault(),Se.stopPropagation()),Se.keyCode===27&&this._releaseMouse()}_evtPointerDown(Se){if(Se.button!==0)return;let Mt=this.layout,Lt=ko.ArrayExt.findFirstIndex(Mt.handles,Ii=>Ii.contains(Se.target));if(Lt===-1)return;Se.preventDefault(),Se.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let $t,gr=Mt.handles[Lt],pi=gr.getBoundingClientRect();Mt.orientation==="horizontal"?$t=Se.clientX-pi.left:$t=Se.clientY-pi.top;let ti=window.getComputedStyle(gr),ci=bd.overrideCursor(ti.cursor);this._pressData={index:Lt,delta:$t,override:ci}}_evtPointerMove(Se){Se.preventDefault(),Se.stopPropagation();let Mt,Lt=this.layout,$t=this.node.getBoundingClientRect();Lt.orientation==="horizontal"?Mt=Se.clientX-$t.left-this._pressData.delta:Mt=Se.clientY-$t.top-this._pressData.delta,Lt.moveHandle(this._pressData.index,Mt)}_evtPointerUp(Se){Se.button===0&&(Se.preventDefault(),Se.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}};(function(jt){class Se{createHandle(){let gr=document.createElement("div");return gr.className="lm-SplitPanel-handle",gr}}jt.Renderer=Se,jt.defaultRenderer=new Se;function Mt($t){return lp.getStretch($t)}jt.getStretch=Mt;function Lt($t,gr){lp.setStretch($t,gr)}jt.setStretch=Lt})(O0||(O0={}));var kw;(function(jt){function Se(Mt){return Mt.layout||new lp({renderer:Mt.renderer||O0.defaultRenderer,orientation:Mt.orientation,alignment:Mt.alignment,spacing:Mt.spacing})}jt.createLayout=Se})(kw||(kw={}));var iy=class extends O0{constructor(Se={}){super({...Se,layout:Cw.createLayout(Se)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new Vc(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(Se){this.layout.titleSpace=Se}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(Se){super.addWidget(Se),Se.title.changed.connect(this._onTitleChanged,this)}collapse(Se){let Mt=this.layout.widgets[Se];Mt&&!Mt.isHidden&&this._toggleExpansion(Se)}expand(Se){let Mt=this.layout.widgets[Se];Mt&&Mt.isHidden&&this._toggleExpansion(Se)}insertWidget(Se,Mt){super.insertWidget(Se,Mt),Mt.title.changed.connect(this._onTitleChanged,this)}handleEvent(Se){switch(super.handleEvent(Se),Se.type){case"click":this._evtClick(Se);break;case"keydown":this._eventKeyDown(Se);break}}onBeforeAttach(Se){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(Se)}onAfterDetach(Se){super.onAfterDetach(Se),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(Se){let Mt=ko.ArrayExt.findFirstIndex(this.widgets,Lt=>Lt.contains(Se.owner));Mt>=0&&(this.layout.updateTitle(Mt,Se.owner),this.update())}_computeWidgetSize(Se){let Mt=this.layout,Lt=Mt.widgets[Se];if(!Lt)return;let $t=Lt.isHidden,gr=Mt.absoluteSizes(),pi=($t?-1:1)*this.spacing,ti=gr.reduce((Ii,si)=>Ii+si),ci=[...gr];if($t){let Ii=this._widgetSizesCache.get(Lt);if(!Ii)return;ci[Se]+=Ii;let si=ci.map(mi=>mi-Ii>0).lastIndexOf(!0);si===-1?ci.forEach((mi,Ri)=>{Ri!==Se&&(ci[Ri]-=gr[Ri]/ti*(Ii-pi))}):ci[si]-=Ii-pi}else{let Ii=gr[Se];this._widgetSizesCache.set(Lt,Ii),ci[Se]=0;let si=ci.map(mi=>mi>0).lastIndexOf(!0);if(si===-1)return;ci[si]=gr[si]+Ii+pi}return ci.map(Ii=>Ii/(ti+pi))}_evtClick(Se){let Mt=Se.target;if(Mt){let Lt=ko.ArrayExt.findFirstIndex(this.titles,$t=>$t.contains(Mt));Lt>=0&&(Se.preventDefault(),Se.stopPropagation(),this._toggleExpansion(Lt))}}_eventKeyDown(Se){if(Se.defaultPrevented)return;let Mt=Se.target,Lt=!1;if(Mt){let $t=ko.ArrayExt.findFirstIndex(this.titles,gr=>gr.contains(Mt));if($t>=0){let gr=Se.keyCode.toString();if(Se.key.match(/Space|Enter/)||gr.match(/13|32/))Mt.click(),Lt=!0;else if(this.orientation==="horizontal"?Se.key.match(/ArrowLeft|ArrowRight/)||gr.match(/37|39/):Se.key.match(/ArrowUp|ArrowDown/)||gr.match(/38|40/)){let pi=Se.key.match(/ArrowLeft|ArrowUp/)||gr.match(/37|38/)?-1:1,ti=this.titles.length,ci=($t+ti+pi)%ti;this.titles[ci].focus(),Lt=!0}else Se.key==="End"||gr==="35"?(this.titles[this.titles.length-1].focus(),Lt=!0):(Se.key==="Home"||gr==="36")&&(this.titles[0].focus(),Lt=!0)}Lt&&Se.preventDefault()}}_toggleExpansion(Se){let Mt=this.titles[Se],Lt=this.layout.widgets[Se],$t=this._computeWidgetSize(Se);$t&&this.setRelativeSizes($t,!1),Lt.isHidden?(Mt.classList.add("lm-mod-expanded"),Mt.setAttribute("aria-expanded","true"),Lt.show()):(Mt.classList.remove("lm-mod-expanded"),Mt.setAttribute("aria-expanded","false"),Lt.hide()),this._expansionToggled.emit(Se)}};(function(jt){class Se extends O0.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++Se._nInstance}createCollapseIcon(Lt){return document.createElement("span")}createSectionTitle(Lt){let $t=document.createElement("h3");$t.setAttribute("tabindex","0"),$t.id=this.createTitleKey(Lt),$t.className=this.titleClassName;for(let ti in Lt.dataset)$t.dataset[ti]=Lt.dataset[ti];let gr=$t.appendChild(this.createCollapseIcon(Lt));gr.className="lm-AccordionPanel-titleCollapser";let pi=$t.appendChild(document.createElement("span"));return pi.className="lm-AccordionPanel-titleLabel",pi.textContent=Lt.label,pi.title=Lt.caption||Lt.label,$t}createTitleKey(Lt){let $t=this._titleKeys.get(Lt);return $t===void 0&&($t=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(Lt,$t)),$t}}Se._nInstance=0,jt.Renderer=Se,jt.defaultRenderer=new Se})(iy||(iy={}));var Cw;(function(jt){function Se(Mt){return Mt.layout||new Mw({renderer:Mt.renderer||iy.defaultRenderer,orientation:Mt.orientation,alignment:Mt.alignment,spacing:Mt.spacing,titleSpace:Mt.titleSpace})}jt.createLayout=Se})(Cw||(Cw={}));var Iv=class jt extends Hm{constructor(Se={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",Se.direction!==void 0&&(this._direction=Se.direction),Se.alignment!==void 0&&(this._alignment=Se.alignment),Se.spacing!==void 0&&(this._spacing=ry.clampDimension(Se.spacing))}dispose(){for(let Se of this._items)Se.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(Se){this._direction!==Se&&(this._direction=Se,this.parent&&(this.parent.dataset.direction=Se,this.parent.fit()))}get alignment(){return this._alignment}set alignment(Se){this._alignment!==Se&&(this._alignment=Se,this.parent&&(this.parent.dataset.alignment=Se,this.parent.update()))}get spacing(){return this._spacing}set spacing(Se){Se=ry.clampDimension(Se),this._spacing!==Se&&(this._spacing=Se,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(Se,Mt){ko.ArrayExt.insert(this._items,Se,new B0(Mt)),ko.ArrayExt.insert(this._sizers,Se,new Pv),this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.BeforeAttach),this.parent.node.appendChild(Mt.node),this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.AfterAttach),this.parent.fit()}moveWidget(Se,Mt,Lt){ko.ArrayExt.move(this._items,Se,Mt),ko.ArrayExt.move(this._sizers,Se,Mt),this.parent.update()}detachWidget(Se,Mt){let Lt=ko.ArrayExt.removeAt(this._items,Se);ko.ArrayExt.removeAt(this._sizers,Se),this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.BeforeDetach),this.parent.node.removeChild(Mt.node),this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.AfterDetach),Lt.dispose(),this.parent.fit()}onBeforeShow(Se){super.onBeforeShow(Se),this.parent.update()}onBeforeAttach(Se){super.onBeforeAttach(Se),this.parent.fit()}onChildShown(Se){this.parent.fit()}onChildHidden(Se){this.parent.fit()}onResize(Se){this.parent.isVisible&&this._update(Se.width,Se.height)}onUpdateRequest(Se){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(Se){this.parent.isAttached&&this._fit()}_fit(){let Se=0;for(let ti=0,ci=this._items.length;ti<ci;++ti)Se+=+!this._items[ti].isHidden;this._fixed=this._spacing*Math.max(0,Se-1);let Mt=z0.isHorizontal(this._direction),Lt=Mt?this._fixed:0,$t=Mt?0:this._fixed;for(let ti=0,ci=this._items.length;ti<ci;++ti){let Ii=this._items[ti],si=this._sizers[ti];if(Ii.isHidden){si.minSize=0,si.maxSize=0;continue}Ii.fit(),si.sizeHint=jt.getSizeBasis(Ii.widget),si.stretch=jt.getStretch(Ii.widget),Mt?(si.minSize=Ii.minWidth,si.maxSize=Ii.maxWidth,Lt+=Ii.minWidth,$t=Math.max($t,Ii.minHeight)):(si.minSize=Ii.minHeight,si.maxSize=Ii.maxHeight,$t+=Ii.minHeight,Lt=Math.max(Lt,Ii.minWidth))}let gr=this._box=Yc.boxSizing(this.parent.node);Lt+=gr.horizontalSum,$t+=gr.verticalSum;let pi=this.parent.node.style;pi.minWidth=`${Lt}px`,pi.minHeight=`${$t}px`,this._dirty=!0,this.parent.parent&&qo.sendMessage(this.parent.parent,rs.Msg.FitRequest),this._dirty&&qo.sendMessage(this.parent,rs.Msg.UpdateRequest)}_update(Se,Mt){this._dirty=!1;let Lt=0;for(let mi=0,Ri=this._items.length;mi<Ri;++mi)Lt+=+!this._items[mi].isHidden;if(Lt===0)return;Se<0&&(Se=this.parent.node.offsetWidth),Mt<0&&(Mt=this.parent.node.offsetHeight),this._box||(this._box=Yc.boxSizing(this.parent.node));let $t=this._box.paddingTop,gr=this._box.paddingLeft,pi=Se-this._box.horizontalSum,ti=Mt-this._box.verticalSum,ci;switch(this._direction){case"left-to-right":ci=Fd.calc(this._sizers,Math.max(0,pi-this._fixed));break;case"top-to-bottom":ci=Fd.calc(this._sizers,Math.max(0,ti-this._fixed));break;case"right-to-left":ci=Fd.calc(this._sizers,Math.max(0,pi-this._fixed)),gr+=pi;break;case"bottom-to-top":ci=Fd.calc(this._sizers,Math.max(0,ti-this._fixed)),$t+=ti;break;default:throw"unreachable"}let Ii=0,si=0;if(ci>0)switch(this._alignment){case"start":break;case"center":Ii=0,si=ci/2;break;case"end":Ii=0,si=ci;break;case"justify":Ii=ci/Lt,si=0;break;default:throw"unreachable"}for(let mi=0,Ri=this._items.length;mi<Ri;++mi){let yi=this._items[mi];if(yi.isHidden)continue;let bi=this._sizers[mi].size;switch(this._direction){case"left-to-right":yi.update(gr+si,$t,bi+Ii,ti),gr+=bi+Ii+this._spacing;break;case"top-to-bottom":yi.update(gr,$t+si,pi,bi+Ii),$t+=bi+Ii+this._spacing;break;case"right-to-left":yi.update(gr-si-bi-Ii,$t,bi+Ii,ti),gr-=bi+Ii+this._spacing;break;case"bottom-to-top":yi.update(gr,$t-si-bi-Ii,pi,bi+Ii),$t-=bi+Ii+this._spacing;break;default:throw"unreachable"}}}};(function(jt){function Se(gr){return z0.stretchProperty.get(gr)}jt.getStretch=Se;function Mt(gr,pi){z0.stretchProperty.set(gr,pi)}jt.setStretch=Mt;function Lt(gr){return z0.sizeBasisProperty.get(gr)}jt.getSizeBasis=Lt;function $t(gr,pi){z0.sizeBasisProperty.set(gr,pi)}jt.setSizeBasis=$t})(Iv||(Iv={}));var z0;(function(jt){jt.stretchProperty=new xd({name:"stretch",create:()=>0,coerce:($t,gr)=>Math.max(0,Math.floor(gr)),changed:Lt}),jt.sizeBasisProperty=new xd({name:"sizeBasis",create:()=>0,coerce:($t,gr)=>Math.max(0,Math.floor(gr)),changed:Lt});function Se($t){return $t==="left-to-right"||$t==="right-to-left"}jt.isHorizontal=Se;function Mt($t){return Math.max(0,Math.floor($t))}jt.clampSpacing=Mt;function Lt($t){$t.parent&&$t.parent.layout instanceof Iv&&$t.parent.fit()}})(z0||(z0={}));var c_=class extends u_{constructor(Se={}){super({layout:Lw.createLayout(Se)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(Se){this.layout.direction=Se}get alignment(){return this.layout.alignment}set alignment(Se){this.layout.alignment=Se}get spacing(){return this.layout.spacing}set spacing(Se){this.layout.spacing=Se}onChildAdded(Se){Se.child.addClass("lm-BoxPanel-child")}onChildRemoved(Se){Se.child.removeClass("lm-BoxPanel-child")}};(function(jt){function Se(gr){return Iv.getStretch(gr)}jt.getStretch=Se;function Mt(gr,pi){Iv.setStretch(gr,pi)}jt.setStretch=Mt;function Lt(gr){return Iv.getSizeBasis(gr)}jt.getSizeBasis=Lt;function $t(gr,pi){Iv.setSizeBasis(gr,pi)}jt.setSizeBasis=$t})(c_||(c_={}));var Lw;(function(jt){function Se(Mt){return Mt.layout||new Iv(Mt)}jt.createLayout=Se})(Lw||(Lw={}));var f_=class jt extends rs{constructor(Se){super({node:ap.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(rs.Flag.DisallowLayout),this.commands=Se.commands,this.renderer=Se.renderer||jt.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(Se){let Mt=ap.createItem(this.commands,Se);return this._items.push(Mt),this.refresh(),Mt}addItems(Se){let Mt=Se.map(Lt=>ap.createItem(this.commands,Lt));return Mt.forEach(Lt=>this._items.push(Lt)),this.refresh(),Mt}removeItem(Se){this.removeItemAt(this._items.indexOf(Se))}removeItemAt(Se){ko.ArrayExt.removeAt(this._items,Se)&&this.refresh()}clearItems(){this._items.length!==0&&(this._items.length=0,this.refresh())}refresh(){if(this._results=null,this.inputNode.value!==""){let Se=this.node.getElementsByClassName("lm-close-icon")[0];Se.style.display="inherit"}else{let Se=this.node.getElementsByClassName("lm-close-icon")[0];Se.style.display="none"}this.update()}handleEvent(Se){switch(Se.type){case"click":this._evtClick(Se);break;case"keydown":this._evtKeyDown(Se);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused();break}}onBeforeAttach(Se){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(Se){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(Se){this.update(),super.onAfterShow(Se)}onActivateRequest(Se){if(this.isAttached){let Mt=this.inputNode;Mt.focus(),Mt.select()}}onUpdateRequest(Se){if(this.isHidden)return;let Mt=this.inputNode.value,Lt=this.contentNode,$t=this._results;if($t||($t=this._results=ap.search(this._items,Mt),this._activeIndex=Mt?ko.ArrayExt.findFirstIndex($t,ap.canActivate):-1),!Mt&&$t.length===0){ip.render(null,Lt);return}if(Mt&&$t.length===0){let ci=this.renderer.renderEmptyMessage({query:Mt});ip.render(ci,Lt);return}let gr=this.renderer,pi=this._activeIndex,ti=new Array($t.length);for(let ci=0,Ii=$t.length;ci<Ii;++ci){let si=$t[ci];if(si.type==="header"){let mi=si.indices,Ri=si.category;ti[ci]=gr.renderHeader({category:Ri,indices:mi})}else{let mi=si.item,Ri=si.indices,yi=ci===pi;ti[ci]=gr.renderItem({item:mi,indices:Ri,active:yi})}}if(ip.render(ti,Lt),pi<0||pi>=$t.length)Lt.scrollTop=0;else{let ci=Lt.children[pi];Yc.scrollIntoViewIfNeeded(Lt,ci)}}_evtClick(Se){if(Se.button!==0)return;if(Se.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}let Mt=ko.ArrayExt.findFirstIndex(this.contentNode.children,Lt=>Lt.contains(Se.target));Mt!==-1&&(Se.preventDefault(),Se.stopPropagation(),this._execute(Mt))}_evtKeyDown(Se){if(!(Se.altKey||Se.ctrlKey||Se.metaKey||Se.shiftKey))switch(Se.keyCode){case 13:Se.preventDefault(),Se.stopPropagation(),this._execute(this._activeIndex);break;case 38:Se.preventDefault(),Se.stopPropagation(),this._activatePreviousItem();break;case 40:Se.preventDefault(),Se.stopPropagation(),this._activateNextItem();break}}_activateNextItem(){if(!this._results||this._results.length===0)return;let Se=this._activeIndex,Mt=this._results.length,Lt=Se<Mt-1?Se+1:0,$t=Lt===0?Mt-1:Lt-1;this._activeIndex=ko.ArrayExt.findFirstIndex(this._results,ap.canActivate,Lt,$t),this.update()}_activatePreviousItem(){if(!this._results||this._results.length===0)return;let Se=this._activeIndex,Mt=this._results.length,Lt=Se<=0?Mt-1:Se-1,$t=Lt===Mt-1?0:Lt+1;this._activeIndex=ko.ArrayExt.findLastIndex(this._results,ap.canActivate,Lt,$t),this.update()}_execute(Se){if(!this._results)return;let Mt=this._results[Se];if(Mt){if(Mt.type==="header"){let Lt=this.inputNode;Lt.value=`${Mt.category.toLowerCase()} `,Lt.focus(),this.refresh();return}Mt.item.isEnabled&&(this.commands.execute(Mt.item.command,Mt.item.args),this.inputNode.value="",this.refresh())}}_toggleFocused(){let Se=document.activeElement===this.inputNode;this.toggleClass("lm-mod-focused",Se)}_onGenericChange(){this.refresh()}};(function(jt){class Se{renderHeader(Lt){let $t=this.formatHeader(Lt);return qc.li({className:"lm-CommandPalette-header"},$t)}renderItem(Lt){let $t=this.createItemClass(Lt),gr=this.createItemDataset(Lt);return Lt.item.isToggleable?qc.li({className:$t,dataset:gr,role:"menuitemcheckbox","aria-checked":`${Lt.item.isToggled}`},this.renderItemIcon(Lt),this.renderItemContent(Lt),this.renderItemShortcut(Lt)):qc.li({className:$t,dataset:gr,role:"menuitem"},this.renderItemIcon(Lt),this.renderItemContent(Lt),this.renderItemShortcut(Lt))}renderEmptyMessage(Lt){let $t=this.formatEmptyMessage(Lt);return qc.li({className:"lm-CommandPalette-emptyMessage"},$t)}renderItemIcon(Lt){let $t=this.createIconClass(Lt);return qc.div({className:$t},Lt.item.icon,Lt.item.iconLabel)}renderItemContent(Lt){return qc.div({className:"lm-CommandPalette-itemContent"},this.renderItemLabel(Lt),this.renderItemCaption(Lt))}renderItemLabel(Lt){let $t=this.formatItemLabel(Lt);return qc.div({className:"lm-CommandPalette-itemLabel"},$t)}renderItemCaption(Lt){let $t=this.formatItemCaption(Lt);return qc.div({className:"lm-CommandPalette-itemCaption"},$t)}renderItemShortcut(Lt){let $t=this.formatItemShortcut(Lt);return qc.div({className:"lm-CommandPalette-itemShortcut"},$t)}createItemClass(Lt){let $t="lm-CommandPalette-item";Lt.item.isEnabled||($t+=" lm-mod-disabled"),Lt.item.isToggled&&($t+=" lm-mod-toggled"),Lt.active&&($t+=" lm-mod-active");let gr=Lt.item.className;return gr&&($t+=` ${gr}`),$t}createItemDataset(Lt){return{...Lt.item.dataset,command:Lt.item.command}}createIconClass(Lt){let $t="lm-CommandPalette-itemIcon",gr=Lt.item.iconClass;return gr?`${$t} ${gr}`:$t}formatHeader(Lt){return!Lt.indices||Lt.indices.length===0?Lt.category:ko.StringExt.highlight(Lt.category,Lt.indices,qc.mark)}formatEmptyMessage(Lt){return`No commands found that match '${Lt.query}'`}formatItemShortcut(Lt){let $t=Lt.item.keyBinding;return $t?rp.formatKeystroke($t.keys):null}formatItemLabel(Lt){return!Lt.indices||Lt.indices.length===0?Lt.item.label:ko.StringExt.highlight(Lt.item.label,Lt.indices,qc.mark)}formatItemCaption(Lt){return Lt.item.caption}}jt.Renderer=Se,jt.defaultRenderer=new Se})(f_||(f_={}));var ap;(function(jt){function Se(){let Ri=document.createElement("div"),yi=document.createElement("div"),bi=document.createElement("div"),wi=document.createElement("input"),De=document.createElement("ul"),tn=document.createElement("button");return yi.className="lm-CommandPalette-search",bi.className="lm-CommandPalette-wrapper",wi.className="lm-CommandPalette-input",tn.className="lm-close-icon",De.className="lm-CommandPalette-content",De.setAttribute("role","menu"),wi.spellcheck=!1,bi.appendChild(wi),bi.appendChild(tn),yi.appendChild(bi),Ri.appendChild(yi),Ri.appendChild(De),Ri}jt.createNode=Se;function Mt(Ri,yi){return new mi(Ri,yi)}jt.createItem=Mt;function Lt(Ri,yi){let bi=ti(Ri,yi);return bi.sort(Ii),si(bi)}jt.search=Lt;function $t(Ri){return Ri.type==="item"&&Ri.item.isEnabled}jt.canActivate=$t;function gr(Ri){return Ri.trim().replace(/\s+/g," ")}function pi(Ri){return Ri.replace(/\s+/g,"").toLowerCase()}function ti(Ri,yi){yi=pi(yi);let bi=[];for(let wi=0,De=Ri.length;wi<De;++wi){let tn=Ri[wi];if(!tn.isVisible)continue;if(!yi){bi.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:tn});continue}let Ya=ci(tn,yi);Ya&&(tn.isEnabled||(Ya.score+=1e3),bi.push(Ya))}return bi}function ci(Ri,yi){let bi=Ri.category.toLowerCase(),wi=Ri.label.toLowerCase(),De=`${bi} ${wi}`,tn=1/0,Ya=null,sa=/\b\w/g;for(;;){let Qn=sa.exec(De);if(!Qn)break;let Do=ko.StringExt.matchSumOfDeltas(De,yi,Qn.index);if(!Do)break;Do.score<=tn&&(tn=Do.score,Ya=Do.indices)}if(!Ya||tn===1/0)return null;let Ua=bi.length+1,en=ko.ArrayExt.lowerBound(Ya,Ua,(Qn,Do)=>Qn-Do),Mn=Ya.slice(0,en),za=Ya.slice(en);for(let Qn=0,Do=za.length;Qn<Do;++Qn)za[Qn]-=Ua;return Mn.length===0?{matchType:0,categoryIndices:null,labelIndices:za,score:tn,item:Ri}:za.length===0?{matchType:1,categoryIndices:Mn,labelIndices:null,score:tn,item:Ri}:{matchType:2,categoryIndices:Mn,labelIndices:za,score:tn,item:Ri}}function Ii(Ri,yi){let bi=Ri.matchType-yi.matchType;if(bi!==0)return bi;let wi=Ri.score-yi.score;if(wi!==0)return wi;let De=0,tn=0;switch(Ri.matchType){case 0:De=Ri.labelIndices[0],tn=yi.labelIndices[0];break;case 1:case 2:De=Ri.categoryIndices[0],tn=yi.categoryIndices[0];break}if(De!==tn)return De-tn;let Ya=Ri.item.category.localeCompare(yi.item.category);if(Ya!==0)return Ya;let sa=Ri.item.rank,Ua=yi.item.rank;return sa!==Ua?sa<Ua?-1:1:Ri.item.label.localeCompare(yi.item.label)}function si(Ri){let yi=[];for(let bi=0,wi=Ri.length;bi<wi;++bi){let{item:De,categoryIndices:tn,labelIndices:Ya}=Ri[bi],sa=De.category;(bi===0||sa!==Ri[bi-1].item.category)&&yi.push({type:"header",category:sa,indices:tn}),yi.push({type:"item",item:De,indices:Ya})}return yi}class mi{constructor(yi,bi){this._commands=yi,this.category=gr(bi.category),this.command=bi.command,this.args=bi.args||op.JSONExt.emptyObject,this.rank=bi.rank!==void 0?bi.rank:1/0}get label(){return this._commands.label(this.command,this.args)}get icon(){return this._commands.icon(this.command,this.args)}get iconClass(){return this._commands.iconClass(this.command,this.args)}get iconLabel(){return this._commands.iconLabel(this.command,this.args)}get caption(){return this._commands.caption(this.command,this.args)}get className(){return this._commands.className(this.command,this.args)}get dataset(){return this._commands.dataset(this.command,this.args)}get isEnabled(){return this._commands.isEnabled(this.command,this.args)}get isToggled(){return this._commands.isToggled(this.command,this.args)}get isToggleable(){return this._commands.isToggleable(this.command,this.args)}get isVisible(){return this._commands.isVisible(this.command,this.args)}get keyBinding(){let{command:yi,args:bi}=this;return ko.ArrayExt.findLastValue(this._commands.keyBindings,wi=>wi.command===yi&&op.JSONExt.deepEqual(wi.args,bi))||null}}})(ap||(ap={}));var F0=class jt extends rs{constructor(Se){super({node:wd.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new Vc(this),this._menuRequested=new Vc(this),this.addClass("lm-Menu"),this.setFlag(rs.Flag.DisallowLayout),this.commands=Se.commands,this.renderer=Se.renderer||jt.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let Se=this;for(;Se._parentMenu;)Se=Se._parentMenu;return Se}get leafMenu(){let Se=this;for(;Se._childMenu;)Se=Se._childMenu;return Se}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(Se){this.activeIndex=Se?this._items.indexOf(Se):-1}get activeIndex(){return this._activeIndex}set activeIndex(Se){(Se<0||Se>=this._items.length)&&(Se=-1),Se!==-1&&!wd.canActivate(this._items[Se])&&(Se=-1),this._activeIndex!==Se&&(this._activeIndex=Se,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let Se=this._items.length,Mt=this._activeIndex,Lt=Mt<Se-1?Mt+1:0,$t=Lt===0?Se-1:Lt-1;this.activeIndex=ko.ArrayExt.findFirstIndex(this._items,wd.canActivate,Lt,$t)}activatePreviousItem(){let Se=this._items.length,Mt=this._activeIndex,Lt=Mt<=0?Se-1:Mt-1,$t=Lt===Se-1?0:Lt+1;this.activeIndex=ko.ArrayExt.findLastIndex(this._items,wd.canActivate,Lt,$t)}triggerActiveItem(){if(!this.isAttached)return;let Se=this.activeItem;if(!Se)return;if(this._cancelOpenTimer(),this._cancelCloseTimer(),Se.type==="submenu"){this._openChildMenu(!0);return}this.rootMenu.close();let{command:Mt,args:Lt}=Se;this.commands.isEnabled(Mt,Lt)?this.commands.execute(Mt,Lt):console.log(`Command '${Mt}' is disabled.`)}addItem(Se){return this.insertItem(this._items.length,Se)}insertItem(Se,Mt){this.isAttached&&this.close(),this.activeIndex=-1;let Lt=Math.max(0,Math.min(Se,this._items.length)),$t=wd.createItem(this,Mt);return ko.ArrayExt.insert(this._items,Lt,$t),this.update(),$t}removeItem(Se){this.removeItemAt(this._items.indexOf(Se))}removeItemAt(Se){this.isAttached&&this.close(),this.activeIndex=-1,ko.ArrayExt.removeAt(this._items,Se)&&this.update()}clearItems(){this.isAttached&&this.close(),this.activeIndex=-1,this._items.length!==0&&(this._items.length=0,this.update())}open(Se,Mt,Lt={}){var $t,gr;if(this.isAttached)return;let pi=Lt.forceX||!1,ti=Lt.forceY||!1,ci=($t=Lt.host)!==null&&$t!==void 0?$t:null,Ii=(gr=Lt.ref)!==null&&gr!==void 0?gr:null;wd.openRootMenu(this,Se,Mt,pi,ti,ci,Ii),this.activate()}handleEvent(Se){switch(Se.type){case"keydown":this._evtKeyDown(Se);break;case"mouseup":this._evtMouseUp(Se);break;case"mousemove":this._evtMouseMove(Se);break;case"mouseenter":this._evtMouseEnter(Se);break;case"mouseleave":this._evtMouseLeave(Se);break;case"mousedown":this._evtMouseDown(Se);break;case"contextmenu":Se.preventDefault(),Se.stopPropagation();break}}onBeforeAttach(Se){this.node.addEventListener("keydown",this),this.node.addEventListener("mouseup",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseenter",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this),document.addEventListener("mousedown",this,!0)}onAfterDetach(Se){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mouseup",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseenter",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),document.removeEventListener("mousedown",this,!0)}onActivateRequest(Se){this.isAttached&&this.node.focus()}onUpdateRequest(Se){let Mt=this._items,Lt=this.renderer,$t=this._activeIndex,gr=wd.computeCollapsed(Mt),pi=new Array(Mt.length);for(let ti=0,ci=Mt.length;ti<ci;++ti){let Ii=Mt[ti],si=ti===$t,mi=gr[ti];pi[ti]=Lt.renderItem({item:Ii,active:si,collapsed:mi,onfocus:()=>{this.activeIndex=ti}})}ip.render(pi,this.contentNode)}onCloseRequest(Se){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;let Mt=this._childMenu;Mt&&(this._childIndex=-1,this._childMenu=null,Mt._parentMenu=null,Mt.close());let Lt=this._parentMenu;Lt&&(this._parentMenu=null,Lt._childIndex=-1,Lt._childMenu=null,Lt.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(Se)}_evtKeyDown(Se){Se.preventDefault(),Se.stopPropagation();let Mt=Se.keyCode;if(Mt===13){this.triggerActiveItem();return}if(Mt===27){this.close();return}if(Mt===37){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(Mt===38){this.activatePreviousItem();return}if(Mt===39){let pi=this.activeItem;pi&&pi.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(Mt===40){this.activateNextItem();return}let Lt=Um().keyForKeydownEvent(Se);if(!Lt)return;let $t=this._activeIndex+1,gr=wd.findMnemonic(this._items,Lt,$t);gr.index!==-1&&!gr.multiple?(this.activeIndex=gr.index,this.triggerActiveItem()):gr.index!==-1?this.activeIndex=gr.index:gr.auto!==-1&&(this.activeIndex=gr.auto)}_evtMouseUp(Se){Se.button===0&&(Se.preventDefault(),Se.stopPropagation(),this.triggerActiveItem())}_evtMouseMove(Se){let Mt=ko.ArrayExt.findFirstIndex(this.contentNode.children,$t=>Yc.hitTest($t,Se.clientX,Se.clientY));if(Mt===this._activeIndex)return;if(this.activeIndex=Mt,Mt=this.activeIndex,Mt===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}this._childIndex!==-1&&this._startCloseTimer(),this._cancelOpenTimer();let Lt=this.activeItem;!Lt||Lt.type!=="submenu"||!Lt.submenu||this._startOpenTimer()}_evtMouseEnter(Se){for(let Mt=this._parentMenu;Mt;Mt=Mt._parentMenu)Mt._cancelOpenTimer(),Mt._cancelCloseTimer(),Mt.activeIndex=Mt._childIndex}_evtMouseLeave(Se){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}let{clientX:Mt,clientY:Lt}=Se;if(Yc.hitTest(this._childMenu.node,Mt,Lt)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()}_evtMouseDown(Se){this._parentMenu||(wd.hitTestMenus(this,Se.clientX,Se.clientY)?(Se.preventDefault(),Se.stopPropagation()):this.close())}_openChildMenu(Se=!1){let Mt=this.activeItem;if(!Mt||Mt.type!=="submenu"||!Mt.submenu){this._closeChildMenu();return}let Lt=Mt.submenu;if(Lt===this._childMenu)return;jt.saveWindowData(),this._closeChildMenu(),this._childMenu=Lt,this._childIndex=this._activeIndex,Lt._parentMenu=this,qo.sendMessage(this,rs.Msg.UpdateRequest);let $t=this.contentNode.children[this._activeIndex];wd.openSubmenu(Lt,$t),Se&&(Lt.activeIndex=-1,Lt.activateNextItem()),Lt.activate()}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){this._openTimerID===0&&(this._openTimerID=window.setTimeout(()=>{this._openTimerID=0,this._openChildMenu()},wd.TIMER_DELAY))}_startCloseTimer(){this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},wd.TIMER_DELAY))}_cancelOpenTimer(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){wd.saveWindowData()}};(function(jt){class Se{renderItem(Lt){let $t=this.createItemClass(Lt),gr=this.createItemDataset(Lt),pi=this.createItemARIA(Lt);return qc.li({className:$t,dataset:gr,tabindex:"0",onfocus:Lt.onfocus,...pi},this.renderIcon(Lt),this.renderLabel(Lt),this.renderShortcut(Lt),this.renderSubmenu(Lt))}renderIcon(Lt){let $t=this.createIconClass(Lt);return qc.div({className:$t},Lt.item.icon,Lt.item.iconLabel)}renderLabel(Lt){let $t=this.formatLabel(Lt);return qc.div({className:"lm-Menu-itemLabel"},$t)}renderShortcut(Lt){let $t=this.formatShortcut(Lt);return qc.div({className:"lm-Menu-itemShortcut"},$t)}renderSubmenu(Lt){return qc.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(Lt){let $t="lm-Menu-item";Lt.item.isEnabled||($t+=" lm-mod-disabled"),Lt.item.isToggled&&($t+=" lm-mod-toggled"),Lt.item.isVisible||($t+=" lm-mod-hidden"),Lt.active&&($t+=" lm-mod-active"),Lt.collapsed&&($t+=" lm-mod-collapsed");let gr=Lt.item.className;return gr&&($t+=` ${gr}`),$t}createItemDataset(Lt){let $t,{type:gr,command:pi,dataset:ti}=Lt.item;return gr==="command"?$t={...ti,type:gr,command:pi}:$t={...ti,type:gr},$t}createIconClass(Lt){let $t="lm-Menu-itemIcon",gr=Lt.item.iconClass;return gr?`${$t} ${gr}`:$t}createItemARIA(Lt){let $t={};switch(Lt.item.type){case"separator":$t.role="presentation";break;case"submenu":$t["aria-haspopup"]="true",Lt.item.isEnabled||($t["aria-disabled"]="true");break;default:Lt.item.isEnabled||($t["aria-disabled"]="true"),$t.role="menuitem"}return $t}formatLabel(Lt){let{label:$t,mnemonic:gr}=Lt.item;if(gr<0||gr>=$t.length)return $t;let pi=$t.slice(0,gr),ti=$t.slice(gr+1),ci=$t[gr],Ii=qc.span({className:"lm-Menu-itemMnemonic"},ci);return[pi,Ii,ti]}formatShortcut(Lt){let $t=Lt.item.keyBinding;return $t?rp.formatKeystroke($t.keys):null}}jt.Renderer=Se,jt.defaultRenderer=new Se})(F0||(F0={}));var wd;(function(jt){jt.TIMER_DELAY=300,jt.SUBMENU_OVERLAP=3;let Se=null,Mt=0;function Lt(){return Mt>0?(Mt--,Se):si()}function $t(){Se=si(),Mt++}jt.saveWindowData=$t;function gr(){let wi=document.createElement("div"),De=document.createElement("ul");return De.className="lm-Menu-content",wi.appendChild(De),De.setAttribute("role","menu"),wi.tabIndex=0,wi}jt.createNode=gr;function pi(wi){return wi.type!=="separator"&&wi.isEnabled&&wi.isVisible}jt.canActivate=pi;function ti(wi,De){return new bi(wi.commands,De)}jt.createItem=ti;function ci(wi,De,tn){for(let Ya=wi;Ya;Ya=Ya.childMenu)if(Yc.hitTest(Ya.node,De,tn))return!0;return!1}jt.hitTestMenus=ci;function Ii(wi){let De=new Array(wi.length);ko.ArrayExt.fill(De,!1);let tn=0,Ya=wi.length;for(;tn<Ya;++tn){let en=wi[tn];if(en.isVisible){if(en.type!=="separator")break;De[tn]=!0}}let sa=Ya-1;for(;sa>=0;--sa){let en=wi[sa];if(en.isVisible){if(en.type!=="separator")break;De[sa]=!0}}let Ua=!1;for(;++tn<sa;){let en=wi[tn];en.isVisible&&(en.type!=="separator"?Ua=!1:Ua?De[tn]=!0:Ua=!0)}return De}jt.computeCollapsed=Ii;function si(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}function mi(wi,De,tn,Ya,sa,Ua,en){let Mn=Lt(),za=Mn.pageXOffset,Qn=Mn.pageYOffset,Do=Mn.clientWidth,Tn=Mn.clientHeight;qo.sendMessage(wi,rs.Msg.UpdateRequest);let lo=Tn-(sa?tn:0),vn=wi.node,zn=vn.style;zn.opacity="0",zn.maxHeight=`${lo}px`,rs.attach(wi,Ua||document.body,en);let{width:zl,height:fu}=vn.getBoundingClientRect();!Ya&&De+zl>za+Do&&(De=za+Do-zl),!sa&&tn+fu>Qn+Tn&&(tn>Qn+Tn?tn=Qn+Tn-fu:tn=tn-fu),zn.transform=`translate(${Math.max(0,De)}px, ${Math.max(0,tn)}px`,zn.opacity="1"}jt.openRootMenu=mi;function Ri(wi,De){let tn=Lt(),Ya=tn.pageXOffset,sa=tn.pageYOffset,Ua=tn.clientWidth,en=tn.clientHeight;qo.sendMessage(wi,rs.Msg.UpdateRequest);let Mn=en,za=wi.node,Qn=za.style;Qn.opacity="0",Qn.maxHeight=`${Mn}px`,rs.attach(wi,document.body);let{width:Do,height:Tn}=za.getBoundingClientRect(),lo=Yc.boxSizing(wi.node),vn=De.getBoundingClientRect(),zn=vn.right-jt.SUBMENU_OVERLAP;zn+Do>Ya+Ua&&(zn=vn.left+jt.SUBMENU_OVERLAP-Do);let zl=vn.top-lo.borderTop-lo.paddingTop;zl+Tn>sa+en&&(zl=vn.bottom+lo.borderBottom+lo.paddingBottom-Tn),Qn.transform=`translate(${Math.max(0,zn)}px, ${Math.max(0,zl)}px`,Qn.opacity="1"}jt.openSubmenu=Ri;function yi(wi,De,tn){let Ya=-1,sa=-1,Ua=!1,en=De.toUpperCase();for(let Mn=0,za=wi.length;Mn<za;++Mn){let Qn=(Mn+tn)%za,Do=wi[Qn];if(!pi(Do))continue;let Tn=Do.label;if(Tn.length===0)continue;let lo=Do.mnemonic;if(lo>=0&&lo<Tn.length){Tn[lo].toUpperCase()===en&&(Ya===-1?Ya=Qn:Ua=!0);continue}sa===-1&&Tn[0].toUpperCase()===en&&(sa=Qn)}return{index:Ya,multiple:Ua,auto:sa}}jt.findMnemonic=yi;class bi{constructor(De,tn){this._commands=De,this.type=tn.type||"command",this.command=tn.command||"",this.args=tn.args||op.JSONExt.emptyObject,this.submenu=tn.submenu||null}get label(){return this.type==="command"?this._commands.label(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.label:""}get mnemonic(){return this.type==="command"?this._commands.mnemonic(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.mnemonic:-1}get icon(){if(this.type==="command")return this._commands.icon(this.command,this.args);if(this.type==="submenu"&&this.submenu)return this.submenu.title.icon}get iconClass(){return this.type==="command"?this._commands.iconClass(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconClass:""}get iconLabel(){return this.type==="command"?this._commands.iconLabel(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconLabel:""}get caption(){return this.type==="command"?this._commands.caption(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.caption:""}get className(){return this.type==="command"?this._commands.className(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.className:""}get dataset(){return this.type==="command"?this._commands.dataset(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.dataset:{}}get isEnabled(){return this.type==="command"?this._commands.isEnabled(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0}get isToggled(){return this.type==="command"?this._commands.isToggled(this.command,this.args):!1}get isVisible(){return this.type==="command"?this._commands.isVisible(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0}get keyBinding(){if(this.type==="command"){let{command:De,args:tn}=this;return ko.ArrayExt.findLastValue(this._commands.keyBindings,Ya=>Ya.command===De&&op.JSONExt.deepEqual(Ya.args,tn))||null}return null}}})(wd||(wd={}));var PS;(function(jt){function Se(pi,ti){let ci=Lt(pi.selector),Ii=pi.rank!==void 0?pi.rank:1/0;return{...pi,selector:ci,rank:Ii,id:ti}}jt.createItem=Se;function Mt(pi,ti,ci,Ii){let si=ti.target;if(!si)return null;let mi=ti.currentTarget;if(!mi||!mi.contains(si)&&(si=document.elementFromPoint(ti.clientX,ti.clientY),!si||!mi.contains(si)))return null;let Ri=[],yi=pi.slice();for(;si!==null;){let bi=[];for(let wi=0,De=yi.length;wi<De;++wi){let tn=yi[wi];tn&&lv.matches(si,tn.selector)&&(bi.push(tn),yi[wi]=null)}if(bi.length!==0&&(ci&&bi.sort(Ii?gr:$t),Ri.push(...bi)),si===mi)break;si=si.parentElement}return ci||Ri.sort(Ii?gr:$t),Ri}jt.matchItems=Mt;function Lt(pi){if(pi.indexOf(",")!==-1)throw new Error(`Selector cannot contain commas: ${pi}`);if(!lv.isValid(pi))throw new Error(`Invalid selector: ${pi}`);return pi}function $t(pi,ti){let ci=pi.rank,Ii=ti.rank;return ci!==Ii?ci<Ii?-1:1:pi.id-ti.id}function gr(pi,ti){let ci=lv.calculateSpecificity(pi.selector),Ii=lv.calculateSpecificity(ti.selector);return ci!==Ii?Ii-ci:$t(pi,ti)}})(PS||(PS={}));var z7=["ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Home","End"],Gm=class jt extends rs{constructor(Se={}){super({node:Gd.createNode()}),this._currentIndex=-1,this._titles=[],this._titlesEditable=!1,this._previousTitle=null,this._dragData=null,this._addButtonEnabled=!1,this._tabMoved=new Vc(this),this._currentChanged=new Vc(this),this._addRequested=new Vc(this),this._tabCloseRequested=new Vc(this),this._tabDetachRequested=new Vc(this),this._tabActivateRequested=new Vc(this),this.addClass("lm-TabBar"),this.contentNode.setAttribute("role","tablist"),this.setFlag(rs.Flag.DisallowLayout),this._document=Se.document||document,this.tabsMovable=Se.tabsMovable||!1,this.titlesEditable=Se.titlesEditable||!1,this.allowDeselect=Se.allowDeselect||!1,this.addButtonEnabled=Se.addButtonEnabled||!1,this.insertBehavior=Se.insertBehavior||"select-tab-if-needed",this.name=Se.name||"",this.orientation=Se.orientation||"horizontal",this.removeBehavior=Se.removeBehavior||"select-tab-after",this.renderer=Se.renderer||jt.defaultRenderer}dispose(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,super.dispose()}get currentChanged(){return this._currentChanged}get tabMoved(){return this._tabMoved}get tabActivateRequested(){return this._tabActivateRequested}get addRequested(){return this._addRequested}get tabCloseRequested(){return this._tabCloseRequested}get tabDetachRequested(){return this._tabDetachRequested}get document(){return this._document}get titlesEditable(){return this._titlesEditable}set titlesEditable(Se){this._titlesEditable=Se}get currentTitle(){return this._titles[this._currentIndex]||null}set currentTitle(Se){this.currentIndex=Se?this._titles.indexOf(Se):-1}get currentIndex(){return this._currentIndex}set currentIndex(Se){if((Se<0||Se>=this._titles.length)&&(Se=-1),this._currentIndex===Se)return;let Mt=this._currentIndex,Lt=this._titles[Mt]||null,$t=Se,gr=this._titles[$t]||null;this._currentIndex=$t,this._previousTitle=Lt,this.update(),this._currentChanged.emit({previousIndex:Mt,previousTitle:Lt,currentIndex:$t,currentTitle:gr})}get name(){return this._name}set name(Se){this._name=Se,Se?this.contentNode.setAttribute("aria-label",Se):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(Se){this._orientation!==Se&&(this._releaseMouse(),this._orientation=Se,this.dataset.orientation=Se,this.contentNode.setAttribute("aria-orientation",Se))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(Se){this._addButtonEnabled!==Se&&(this._addButtonEnabled=Se,Se?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(Se){return this.insertTab(this._titles.length,Se)}insertTab(Se,Mt){this._releaseMouse();let Lt=Gd.asTitle(Mt),$t=this._titles.indexOf(Lt),gr=Math.max(0,Math.min(Se,this._titles.length));return $t===-1?(ko.ArrayExt.insert(this._titles,gr,Lt),Lt.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(gr,Lt),Lt):(gr===this._titles.length&&gr--,$t===gr||(ko.ArrayExt.move(this._titles,$t,gr),this.update(),this._adjustCurrentForMove($t,gr)),Lt)}removeTab(Se){this.removeTabAt(this._titles.indexOf(Se))}removeTabAt(Se){this._releaseMouse();let Mt=ko.ArrayExt.removeAt(this._titles,Se);Mt&&(Mt.changed.disconnect(this._onTitleChanged,this),Mt===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(Se,Mt))}clearTabs(){if(this._titles.length===0)return;this._releaseMouse();for(let Lt of this._titles)Lt.changed.disconnect(this._onTitleChanged,this);let Se=this.currentIndex,Mt=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),Se!==-1&&this._currentChanged.emit({previousIndex:Se,previousTitle:Mt,currentIndex:-1,currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(Se){switch(Se.type){case"pointerdown":this._evtPointerDown(Se);break;case"pointermove":this._evtPointerMove(Se);break;case"pointerup":this._evtPointerUp(Se);break;case"dblclick":this._evtDblClick(Se);break;case"keydown":Se.eventPhase===Event.CAPTURING_PHASE?this._evtKeyDownCapturing(Se):this._evtKeyDown(Se);break;case"contextmenu":Se.preventDefault(),Se.stopPropagation();break}}onBeforeAttach(Se){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this),this.node.addEventListener("keydown",this)}onAfterDetach(Se){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this.node.removeEventListener("keydown",this),this._releaseMouse()}onUpdateRequest(Se){var Mt;let Lt=this._titles,$t=this.renderer,gr=this.currentTitle,pi=new Array(Lt.length),ti=(Mt=this._getCurrentTabindex())!==null&&Mt!==void 0?Mt:this._currentIndex>-1?this._currentIndex:0;for(let ci=0,Ii=Lt.length;ci<Ii;++ci){let si=Lt[ci],mi=si===gr,Ri=mi?Ii:Ii-ci-1,yi=ti===ci?0:-1;pi[ci]=$t.renderTab({title:si,current:mi,zIndex:Ri,tabIndex:yi})}ip.render(pi,this.contentNode)}_getCurrentTabindex(){let Se=null,Mt=this.contentNode.querySelector('li[tabindex="0"]');return Mt?Se=[...this.contentNode.children].indexOf(Mt):this._addButtonEnabled&&this.addButtonNode.getAttribute("tabindex")==="0"&&(Se=-1),Se}_evtDblClick(Se){if(!this.titlesEditable)return;let Mt=this.contentNode.children,Lt=ko.ArrayExt.findFirstIndex(Mt,pi=>Yc.hitTest(pi,Se.clientX,Se.clientY));if(Lt===-1)return;let $t=this.titles[Lt],gr=Mt[Lt].querySelector(".lm-TabBar-tabLabel");if(gr&&gr.contains(Se.target)){let pi=$t.label||"",ti=gr.innerHTML;gr.innerHTML="";let ci=document.createElement("input");ci.classList.add("lm-TabBar-tabInput"),ci.value=pi,gr.appendChild(ci);let Ii=()=>{ci.removeEventListener("blur",Ii),gr.innerHTML=ti,this.node.addEventListener("keydown",this)};ci.addEventListener("dblclick",si=>si.stopPropagation()),ci.addEventListener("blur",Ii),ci.addEventListener("keydown",si=>{si.key==="Enter"?(ci.value!==""&&($t.label=$t.caption=ci.value),Ii()):si.key==="Escape"&&Ii()}),this.node.removeEventListener("keydown",this),ci.select(),ci.focus(),gr.children.length>0&&gr.children[0].focus()}}_evtKeyDownCapturing(Se){Se.eventPhase===Event.CAPTURING_PHASE&&(Se.preventDefault(),Se.stopPropagation(),Se.key==="Escape"&&this._releaseMouse())}_evtKeyDown(Se){var Mt,Lt,$t;if(!(Se.key==="Tab"||Se.eventPhase===Event.CAPTURING_PHASE)){if(Se.key==="Enter"||Se.key==="Spacebar"||Se.key===" "){let gr=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(gr))Se.preventDefault(),Se.stopPropagation(),this._addRequested.emit();else{let pi=ko.ArrayExt.findFirstIndex(this.contentNode.children,ti=>ti.contains(gr));pi>=0&&(Se.preventDefault(),Se.stopPropagation(),this.currentIndex=pi)}}else if(z7.includes(Se.key)){let gr=[...this.contentNode.children];if(this.addButtonEnabled&&gr.push(this.addButtonNode),gr.length<=1)return;Se.preventDefault(),Se.stopPropagation();let pi=gr.indexOf(document.activeElement);pi===-1&&(pi=this._currentIndex);let ti;Se.key==="ArrowRight"&&this._orientation==="horizontal"||Se.key==="ArrowDown"&&this._orientation==="vertical"?ti=(Mt=gr[pi+1])!==null&&Mt!==void 0?Mt:gr[0]:Se.key==="ArrowLeft"&&this._orientation==="horizontal"||Se.key==="ArrowUp"&&this._orientation==="vertical"?ti=(Lt=gr[pi-1])!==null&&Lt!==void 0?Lt:gr[gr.length-1]:Se.key==="Home"?ti=gr[0]:Se.key==="End"&&(ti=gr[gr.length-1]),ti&&(($t=gr[pi])===null||$t===void 0||$t.setAttribute("tabindex","-1"),ti?.setAttribute("tabindex","0"),ti.focus())}}}_evtPointerDown(Se){if(Se.button!==0&&Se.button!==1||this._dragData||Se.target.classList.contains("lm-TabBar-tabInput"))return;let Mt=this.addButtonEnabled&&this.addButtonNode.contains(Se.target),Lt=this.contentNode.children,$t=ko.ArrayExt.findFirstIndex(Lt,pi=>Yc.hitTest(pi,Se.clientX,Se.clientY));if($t===-1&&!Mt||(Se.preventDefault(),Se.stopPropagation(),this._dragData={tab:Lt[$t],index:$t,pressX:Se.clientX,pressY:Se.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),Se.button===1||Mt))return;let gr=Lt[$t].querySelector(this.renderer.closeIconSelector);gr&&gr.contains(Se.target)||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===$t?this.currentIndex=-1:this.currentIndex=$t,this.currentIndex!==-1&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}_evtPointerMove(Se){let Mt=this._dragData;if(!Mt)return;Se.preventDefault(),Se.stopPropagation();let Lt=this.contentNode.children;if(!(!Mt.dragActive&&!Gd.dragExceeded(Mt,Se))){if(!Mt.dragActive){let $t=Mt.tab.getBoundingClientRect();this._orientation==="horizontal"?(Mt.tabPos=Mt.tab.offsetLeft,Mt.tabSize=$t.width,Mt.tabPressPos=Mt.pressX-$t.left):(Mt.tabPos=Mt.tab.offsetTop,Mt.tabSize=$t.height,Mt.tabPressPos=Mt.pressY-$t.top),Mt.tabPressOffset={x:Mt.pressX-$t.left,y:Mt.pressY-$t.top},Mt.tabLayout=Gd.snapTabLayout(Lt,this._orientation),Mt.contentRect=this.contentNode.getBoundingClientRect(),Mt.override=bd.overrideCursor("default"),Mt.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),Mt.dragActive=!0}if(!Mt.detachRequested&&Gd.detachExceeded(Mt,Se)){Mt.detachRequested=!0;let $t=Mt.index,gr=Se.clientX,pi=Se.clientY,ti=Lt[$t],ci=this._titles[$t];if(this._tabDetachRequested.emit({index:$t,title:ci,tab:ti,clientX:gr,clientY:pi,offset:Mt.tabPressOffset}),Mt.dragAborted)return}Gd.layoutTabs(Lt,Mt,Se,this._orientation)}}_evtPointerUp(Se){if(Se.button!==0&&Se.button!==1)return;let Mt=this._dragData;if(!Mt)return;if(Se.preventDefault(),Se.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!Mt.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(Se.target)){this._addRequested.emit(void 0);return}let gr=this.contentNode.children,pi=ko.ArrayExt.findFirstIndex(gr,Ii=>Yc.hitTest(Ii,Se.clientX,Se.clientY));if(pi!==Mt.index)return;let ti=this._titles[pi];if(!ti.closable)return;if(Se.button===1){this._tabCloseRequested.emit({index:pi,title:ti});return}let ci=gr[pi].querySelector(this.renderer.closeIconSelector);if(ci&&ci.contains(Se.target)){this._tabCloseRequested.emit({index:pi,title:ti});return}return}if(Se.button!==0)return;Gd.finalizeTabPosition(Mt,this._orientation),Mt.tab.classList.remove("lm-mod-dragging");let Lt=Gd.parseTransitionDuration(Mt.tab);setTimeout(()=>{if(Mt.dragAborted)return;this._dragData=null,Gd.resetTabPositions(this.contentNode.children,this._orientation),Mt.override.dispose(),this.removeClass("lm-mod-dragging");let $t=Mt.index,gr=Mt.targetIndex;gr===-1||$t===gr||(ko.ArrayExt.move(this._titles,$t,gr),this._adjustCurrentForMove($t,gr),this._tabMoved.emit({fromIndex:$t,toIndex:gr,title:this._titles[gr]}),qo.sendMessage(this,rs.Msg.UpdateRequest))},Lt)}_releaseMouse(){let Se=this._dragData;Se&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),Se.dragAborted=!0,Se.dragActive&&(Gd.resetTabPositions(this.contentNode.children,this._orientation),Se.override.dispose(),Se.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(Se,Mt){let Lt=this.currentTitle,$t=this._currentIndex,gr=this.insertBehavior;if(gr==="select-tab"||gr==="select-tab-if-needed"&&$t===-1){this._currentIndex=Se,this._previousTitle=Lt,this._currentChanged.emit({previousIndex:$t,previousTitle:Lt,currentIndex:Se,currentTitle:Mt});return}$t>=Se&&this._currentIndex++}_adjustCurrentForMove(Se,Mt){this._currentIndex===Se?this._currentIndex=Mt:this._currentIndex<Se&&this._currentIndex>=Mt?this._currentIndex++:this._currentIndex>Se&&this._currentIndex<=Mt&&this._currentIndex--}_adjustCurrentForRemove(Se,Mt){let Lt=this._currentIndex,$t=this.removeBehavior;if(Lt!==Se){Lt>Se&&this._currentIndex--;return}if(this._titles.length===0){this._currentIndex=-1,this._currentChanged.emit({previousIndex:Se,previousTitle:Mt,currentIndex:-1,currentTitle:null});return}if($t==="select-tab-after"){this._currentIndex=Math.min(Se,this._titles.length-1),this._currentChanged.emit({previousIndex:Se,previousTitle:Mt,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if($t==="select-tab-before"){this._currentIndex=Math.max(0,Se-1),this._currentChanged.emit({previousIndex:Se,previousTitle:Mt,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if($t==="select-previous-tab"){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(Se,this._titles.length-1),this._currentChanged.emit({previousIndex:Se,previousTitle:Mt,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:Se,previousTitle:Mt,currentIndex:-1,currentTitle:null})}_onTitleChanged(Se){this.update()}};(function(jt){class Se{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++Se._nInstance}renderTab(Lt){let $t=Lt.title.caption,gr=this.createTabKey(Lt),pi=gr,ti=this.createTabStyle(Lt),ci=this.createTabClass(Lt),Ii=this.createTabDataset(Lt),si=this.createTabARIA(Lt);return Lt.title.closable?qc.li({id:pi,key:gr,className:ci,title:$t,style:ti,dataset:Ii,...si},this.renderIcon(Lt),this.renderLabel(Lt),this.renderCloseIcon(Lt)):qc.li({id:pi,key:gr,className:ci,title:$t,style:ti,dataset:Ii,...si},this.renderIcon(Lt),this.renderLabel(Lt))}renderIcon(Lt){let{title:$t}=Lt,gr=this.createIconClass(Lt);return qc.div({className:gr},$t.icon,$t.iconLabel)}renderLabel(Lt){return qc.div({className:"lm-TabBar-tabLabel"},Lt.title.label)}renderCloseIcon(Lt){return qc.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(Lt){let $t=this._tabKeys.get(Lt.title);return $t===void 0&&($t=`tab-key-${this._uuid}-${this._tabID++}`,this._tabKeys.set(Lt.title,$t)),$t}createTabStyle(Lt){return{zIndex:`${Lt.zIndex}`}}createTabClass(Lt){let $t="lm-TabBar-tab";return Lt.title.className&&($t+=` ${Lt.title.className}`),Lt.title.closable&&($t+=" lm-mod-closable"),Lt.current&&($t+=" lm-mod-current"),$t}createTabDataset(Lt){return Lt.title.dataset}createTabARIA(Lt){var $t;return{role:"tab","aria-selected":Lt.current.toString(),tabindex:`${($t=Lt.tabIndex)!==null&&$t!==void 0?$t:"-1"}`}}createIconClass(Lt){let $t="lm-TabBar-tabIcon",gr=Lt.title.iconClass;return gr?`${$t} ${gr}`:$t}}Se._nInstance=0,jt.Renderer=Se,jt.defaultRenderer=new Se,jt.addButtonSelector=".lm-TabBar-addButton"})(Gm||(Gm={}));var Gd;(function(jt){jt.DRAG_THRESHOLD=5,jt.DETACH_THRESHOLD=20;function Se(){let si=document.createElement("div"),mi=document.createElement("ul");mi.setAttribute("role","tablist"),mi.className="lm-TabBar-content",si.appendChild(mi);let Ri=document.createElement("div");return Ri.className="lm-TabBar-addButton lm-mod-hidden",Ri.setAttribute("tabindex","-1"),Ri.setAttribute("role","button"),si.appendChild(Ri),si}jt.createNode=Se;function Mt(si){return si instanceof ey?si:new ey(si)}jt.asTitle=Mt;function Lt(si){let mi=window.getComputedStyle(si);return 1e3*(parseFloat(mi.transitionDuration)||0)}jt.parseTransitionDuration=Lt;function $t(si,mi){let Ri=new Array(si.length);for(let yi=0,bi=si.length;yi<bi;++yi){let wi=si[yi],De=window.getComputedStyle(wi);mi==="horizontal"?Ri[yi]={pos:wi.offsetLeft,size:wi.offsetWidth,margin:parseFloat(De.marginLeft)||0}:Ri[yi]={pos:wi.offsetTop,size:wi.offsetHeight,margin:parseFloat(De.marginTop)||0}}return Ri}jt.snapTabLayout=$t;function gr(si,mi){let Ri=Math.abs(mi.clientX-si.pressX),yi=Math.abs(mi.clientY-si.pressY);return Ri>=jt.DRAG_THRESHOLD||yi>=jt.DRAG_THRESHOLD}jt.dragExceeded=gr;function pi(si,mi){let Ri=si.contentRect;return mi.clientX<Ri.left-jt.DETACH_THRESHOLD||mi.clientX>=Ri.right+jt.DETACH_THRESHOLD||mi.clientY<Ri.top-jt.DETACH_THRESHOLD||mi.clientY>=Ri.bottom+jt.DETACH_THRESHOLD}jt.detachExceeded=pi;function ti(si,mi,Ri,yi){let bi,wi,De,tn;yi==="horizontal"?(bi=mi.pressX,wi=Ri.clientX-mi.contentRect.left,De=Ri.clientX,tn=mi.contentRect.width):(bi=mi.pressY,wi=Ri.clientY-mi.contentRect.top,De=Ri.clientY,tn=mi.contentRect.height);let Ya=mi.index,sa=wi-mi.tabPressPos,Ua=sa+mi.tabSize;for(let en=0,Mn=si.length;en<Mn;++en){let za,Qn=mi.tabLayout[en],Do=Qn.pos+(Qn.size>>1);if(en<mi.index&&sa<Do)za=`${mi.tabSize+mi.tabLayout[en+1].margin}px`,Ya=Math.min(Ya,en);else if(en>mi.index&&Ua>Do)za=`${-mi.tabSize-Qn.margin}px`,Ya=Math.max(Ya,en);else if(en===mi.index){let Tn=De-bi,lo=tn-(mi.tabPos+mi.tabSize);za=`${Math.max(-mi.tabPos,Math.min(Tn,lo))}px`}else za="";yi==="horizontal"?si[en].style.left=za:si[en].style.top=za}mi.targetIndex=Ya}jt.layoutTabs=ti;function ci(si,mi){let Ri;mi==="horizontal"?Ri=si.contentRect.width:Ri=si.contentRect.height;let yi;if(si.targetIndex===si.index)yi=0;else if(si.targetIndex>si.index){let De=si.tabLayout[si.targetIndex];yi=De.pos+De.size-si.tabSize-si.tabPos}else yi=si.tabLayout[si.targetIndex].pos-si.tabPos;let bi=Ri-(si.tabPos+si.tabSize),wi=Math.max(-si.tabPos,Math.min(yi,bi));mi==="horizontal"?si.tab.style.left=`${wi}px`:si.tab.style.top=`${wi}px`}jt.finalizeTabPosition=ci;function Ii(si,mi){for(let Ri of si)mi==="horizontal"?Ri.style.left="":Ri.style.top=""}jt.resetTabPositions=Ii})(Gd||(Gd={}));var Iw=class extends sp{constructor(Se){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=Se.renderer,Se.spacing!==void 0&&(this._spacing=ry.clampDimension(Se.spacing)),this._document=Se.document||document,this._hiddenMode=Se.hiddenMode!==void 0?Se.hiddenMode:rs.HiddenMode.Display}dispose(){let Se=this[Symbol.iterator]();this._items.forEach(Mt=>{Mt.dispose()}),this._box=null,this._root=null,this._items.clear();for(let Mt of Se)Mt.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(Se){if(this._hiddenMode!==Se){this._hiddenMode=Se;for(let Mt of this.tabBars())if(Mt.titles.length>1)for(let Lt of Mt.titles)Lt.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(Se){Se=ry.clampDimension(Se),this._spacing!==Se&&(this._spacing=Se,this.parent&&this.parent.fit())}get isEmpty(){return this._root===null}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():(0,ko.empty)()}widgets(){return this._root?this._root.iterUserWidgets():(0,ko.empty)()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():(0,ko.empty)()}tabBars(){return this._root?this._root.iterTabBars():(0,ko.empty)()}handles(){return this._root?this._root.iterHandles():(0,ko.empty)()}moveHandle(Se,Mt,Lt){let $t=Se.classList.contains("lm-mod-hidden");if(!this._root||$t)return;let gr=this._root.findSplitNode(Se);if(!gr)return;let pi;gr.node.orientation==="horizontal"?pi=Mt-Se.offsetLeft:pi=Lt-Se.offsetTop,pi!==0&&(gr.node.holdSizes(),Fd.adjust(gr.node.sizers,gr.index,pi),this.parent&&this.parent.update())}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(Se){let Mt=new Set,Lt;Se.main?Lt=hh.normalizeAreaConfig(Se.main,Mt):Lt=null;let $t=this.widgets(),gr=this.tabBars(),pi=this.handles();this._root=null;for(let ti of $t)Mt.has(ti)||(ti.parent=null);for(let ti of gr)ti.dispose();for(let ti of pi)ti.parentNode&&ti.parentNode.removeChild(ti);for(let ti of Mt)ti.parent=this.parent;Lt?this._root=hh.realizeAreaConfig(Lt,{createTabBar:ti=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):this._root=null,this.parent&&(Mt.forEach(ti=>{this.attachWidget(ti)}),this.parent.fit())}addWidget(Se,Mt={}){let Lt=Mt.ref||null,$t=Mt.mode||"tab-after",gr=null;if(this._root&&Lt&&(gr=this._root.findTabNode(Lt)),Lt&&!gr)throw new Error("Reference widget is not in the layout.");switch(Se.parent=this.parent,$t){case"tab-after":this._insertTab(Se,Lt,gr,!0);break;case"tab-before":this._insertTab(Se,Lt,gr,!1);break;case"split-top":this._insertSplit(Se,Lt,gr,"vertical",!1);break;case"split-left":this._insertSplit(Se,Lt,gr,"horizontal",!1);break;case"split-right":this._insertSplit(Se,Lt,gr,"horizontal",!0);break;case"split-bottom":this._insertSplit(Se,Lt,gr,"vertical",!0);break;case"merge-top":this._insertSplit(Se,Lt,gr,"vertical",!1,!0);break;case"merge-left":this._insertSplit(Se,Lt,gr,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(Se,Lt,gr,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(Se,Lt,gr,"vertical",!0,!0);break}this.parent&&(this.attachWidget(Se),this.parent.fit())}removeWidget(Se){this._removeWidget(Se),this.parent&&(this.detachWidget(Se),this.parent.fit())}hitTestTabAreas(Se,Mt){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=Yc.boxSizing(this.parent.node));let Lt=this.parent.node.getBoundingClientRect(),$t=Se-Lt.left-this._box.borderLeft,gr=Mt-Lt.top-this._box.borderTop,pi=this._root.hitTestTabNodes($t,gr);if(!pi)return null;let{tabBar:ti,top:ci,left:Ii,width:si,height:mi}=pi,Ri=this._box.borderLeft+this._box.borderRight,yi=this._box.borderTop+this._box.borderBottom,bi=Lt.width-Ri-(Ii+si),wi=Lt.height-yi-(ci+mi);return{tabBar:ti,x:$t,y:gr,top:ci,left:Ii,right:bi,bottom:wi,width:si,height:mi}}init(){super.init();for(let Se of this)this.attachWidget(Se);for(let Se of this.handles())this.parent.node.appendChild(Se);this.parent.fit()}attachWidget(Se){this.parent.node!==Se.node.parentNode&&(this._items.set(Se,new B0(Se)),this.parent.isAttached&&qo.sendMessage(Se,rs.Msg.BeforeAttach),this.parent.node.appendChild(Se.node),this.parent.isAttached&&qo.sendMessage(Se,rs.Msg.AfterAttach))}detachWidget(Se){if(this.parent.node!==Se.node.parentNode)return;this.parent.isAttached&&qo.sendMessage(Se,rs.Msg.BeforeDetach),this.parent.node.removeChild(Se.node),this.parent.isAttached&&qo.sendMessage(Se,rs.Msg.AfterDetach);let Mt=this._items.get(Se);Mt&&(this._items.delete(Se),Mt.dispose())}onBeforeShow(Se){super.onBeforeShow(Se),this.parent.update()}onBeforeAttach(Se){super.onBeforeAttach(Se),this.parent.fit()}onChildShown(Se){this.parent.fit()}onChildHidden(Se){this.parent.fit()}onResize(Se){this.parent.isVisible&&this._update(Se.width,Se.height)}onUpdateRequest(Se){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(Se){this.parent.isAttached&&this._fit()}_removeWidget(Se){if(!this._root)return;let Mt=this._root.findTabNode(Se);if(!Mt)return;if(hh.removeAria(Se),Mt.tabBar.titles.length>1){if(Mt.tabBar.removeTab(Se.title),this._hiddenMode===rs.HiddenMode.Scale&&Mt.tabBar.titles.length==1){let Ri=Mt.tabBar.titles[0].owner;Ri.hiddenMode=rs.HiddenMode.Display}return}if(Mt.tabBar.dispose(),this._root===Mt){this._root=null;return}this._root.holdAllSizes();let Lt=Mt.parent;Mt.parent=null;let $t=ko.ArrayExt.removeFirstOf(Lt.children,Mt),gr=ko.ArrayExt.removeAt(Lt.handles,$t);if(ko.ArrayExt.removeAt(Lt.sizers,$t),gr.parentNode&&gr.parentNode.removeChild(gr),Lt.children.length>1){Lt.syncHandles();return}let pi=Lt.parent;Lt.parent=null;let ti=Lt.children[0],ci=Lt.handles[0];if(Lt.children.length=0,Lt.handles.length=0,Lt.sizers.length=0,ci.parentNode&&ci.parentNode.removeChild(ci),this._root===Lt){ti.parent=null,this._root=ti;return}let Ii=pi,si=Ii.children.indexOf(Lt);if(ti instanceof hh.TabLayoutNode){ti.parent=Ii,Ii.children[si]=ti;return}let mi=ko.ArrayExt.removeAt(Ii.handles,si);ko.ArrayExt.removeAt(Ii.children,si),ko.ArrayExt.removeAt(Ii.sizers,si),mi.parentNode&&mi.parentNode.removeChild(mi);for(let Ri=0,yi=ti.children.length;Ri<yi;++Ri){let bi=ti.children[Ri],wi=ti.handles[Ri],De=ti.sizers[Ri];ko.ArrayExt.insert(Ii.children,si+Ri,bi),ko.ArrayExt.insert(Ii.handles,si+Ri,wi),ko.ArrayExt.insert(Ii.sizers,si+Ri,De),bi.parent=Ii}ti.children.length=0,ti.handles.length=0,ti.sizers.length=0,ti.parent=null,Ii.syncHandles()}_createTabNode(Se){let Mt=new hh.TabLayoutNode(this._createTabBar());return Mt.tabBar.addTab(Se.title),hh.addAria(Se,Mt.tabBar),Mt}_insertTab(Se,Mt,Lt,$t){if(Se===Mt)return;if(!this._root){let pi=new hh.TabLayoutNode(this._createTabBar());pi.tabBar.addTab(Se.title),this._root=pi,hh.addAria(Se,pi.tabBar);return}Lt||(Lt=this._root.findFirstTabNode()),Lt.tabBar.titles.indexOf(Se.title)===-1&&(this._removeWidget(Se),Se.hide());let gr;if(Mt?gr=Lt.tabBar.titles.indexOf(Mt.title):gr=Lt.tabBar.currentIndex,this._hiddenMode===rs.HiddenMode.Scale)if(Lt.tabBar.titles.length===0)Se.hiddenMode=rs.HiddenMode.Display;else if(Lt.tabBar.titles.length==1){let pi=Lt.tabBar.titles[0].owner;pi.hiddenMode=rs.HiddenMode.Scale}else Se.hiddenMode=rs.HiddenMode.Scale;else Se.hiddenMode=this._hiddenMode;Lt.tabBar.insertTab(gr+($t?1:0),Se.title),hh.addAria(Se,Lt.tabBar)}_insertSplit(Se,Mt,Lt,$t,gr,pi=!1){if(Se===Mt&&Lt&&Lt.tabBar.titles.length===1)return;if(this._removeWidget(Se),!this._root){this._root=this._createTabNode(Se);return}if(!Lt||!Lt.parent){let Ri=this._splitRoot($t),yi=gr?Ri.children.length:0;Ri.normalizeSizes();let bi=hh.createSizer(Lt?1:hh.GOLDEN_RATIO),wi=this._createTabNode(Se);ko.ArrayExt.insert(Ri.children,yi,wi),ko.ArrayExt.insert(Ri.sizers,yi,bi),ko.ArrayExt.insert(Ri.handles,yi,this._createHandle()),wi.parent=Ri,Ri.normalizeSizes(),Ri.syncHandles();return}let ti=Lt.parent;if(ti.orientation===$t){let Ri=ti.children.indexOf(Lt);if(pi){let De=Ri+(gr?1:-1),tn=ti.children[De];if(tn instanceof hh.TabLayoutNode){this._insertTab(Se,null,tn,!0),++tn.tabBar.currentIndex;return}}ti.normalizeSizes();let yi=ti.sizers[Ri].sizeHint/=2,bi=Ri+(gr?1:0),wi=this._createTabNode(Se);ko.ArrayExt.insert(ti.children,bi,wi),ko.ArrayExt.insert(ti.sizers,bi,hh.createSizer(yi)),ko.ArrayExt.insert(ti.handles,bi,this._createHandle()),wi.parent=ti,ti.syncHandles();return}let ci=ko.ArrayExt.removeFirstOf(ti.children,Lt),Ii=new hh.SplitLayoutNode($t);Ii.normalized=!0,Ii.children.push(Lt),Ii.sizers.push(hh.createSizer(.5)),Ii.handles.push(this._createHandle()),Lt.parent=Ii;let si=gr?1:0,mi=this._createTabNode(Se);ko.ArrayExt.insert(Ii.children,si,mi),ko.ArrayExt.insert(Ii.sizers,si,hh.createSizer(.5)),ko.ArrayExt.insert(Ii.handles,si,this._createHandle()),mi.parent=Ii,Ii.syncHandles(),ko.ArrayExt.insert(ti.children,ci,Ii),Ii.parent=ti}_splitRoot(Se){let Mt=this._root;if(Mt instanceof hh.SplitLayoutNode&&Mt.orientation===Se)return Mt;let Lt=this._root=new hh.SplitLayoutNode(Se);return Mt&&(Lt.children.push(Mt),Lt.sizers.push(hh.createSizer(0)),Lt.handles.push(this._createHandle()),Mt.parent=Lt),Lt}_fit(){let Se=0,Mt=0;if(this._root){let gr=this._root.fit(this._spacing,this._items);Se=gr.minWidth,Mt=gr.minHeight}let Lt=this._box=Yc.boxSizing(this.parent.node);Se+=Lt.horizontalSum,Mt+=Lt.verticalSum;let $t=this.parent.node.style;$t.minWidth=`${Se}px`,$t.minHeight=`${Mt}px`,this._dirty=!0,this.parent.parent&&qo.sendMessage(this.parent.parent,rs.Msg.FitRequest),this._dirty&&qo.sendMessage(this.parent,rs.Msg.UpdateRequest)}_update(Se,Mt){if(this._dirty=!1,!this._root)return;Se<0&&(Se=this.parent.node.offsetWidth),Mt<0&&(Mt=this.parent.node.offsetHeight),this._box||(this._box=Yc.boxSizing(this.parent.node));let Lt=this._box.paddingTop,$t=this._box.paddingLeft,gr=Se-this._box.horizontalSum,pi=Mt-this._box.verticalSum;this._root.update(Lt,$t,gr,pi,this._spacing,this._items)}_createTabBar(){let Se=this.renderer.createTabBar(this._document);return Se.orientation="horizontal",this.parent&&this.attachWidget(Se),Se}_createHandle(){let Se=this.renderer.createHandle(),Mt=Se.style;return Mt.position="absolute",Mt.contain="strict",Mt.top="0",Mt.left="0",Mt.width="0",Mt.height="0",this.parent&&this.parent.node.appendChild(Se),Se}},hh;(function(jt){jt.GOLDEN_RATIO=.618;function Se(Ri){let yi=new Pv;return yi.sizeHint=Ri,yi.size=Ri,yi}jt.createSizer=Se;function Mt(Ri,yi){let bi;return Ri.type==="tab-area"?bi=ci(Ri,yi):bi=Ii(Ri,yi),bi}jt.normalizeAreaConfig=Mt;function Lt(Ri,yi,bi){let wi;return Ri.type==="tab-area"?wi=si(Ri,yi,bi):wi=mi(Ri,yi,bi),wi}jt.realizeAreaConfig=Lt;class $t{constructor(yi){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;let bi=new Pv,wi=new Pv;bi.stretch=0,wi.stretch=1,this.tabBar=yi,this.sizers=[bi,wi]}get top(){return this._top}get left(){return this._left}get width(){return this._width}get height(){return this._height}*iterAllWidgets(){yield this.tabBar,yield*this.iterUserWidgets()}*iterUserWidgets(){for(let yi of this.tabBar.titles)yield yi.owner}*iterSelectedWidgets(){let yi=this.tabBar.currentTitle;yi&&(yield yi.owner)}*iterTabBars(){yield this.tabBar}*iterHandles(){}findTabNode(yi){return this.tabBar.titles.indexOf(yi.title)!==-1?this:null}findSplitNode(yi){return null}findFirstTabNode(){return this}hitTestTabNodes(yi,bi){return yi<this._left||yi>=this._left+this._width||bi<this._top||bi>=this._top+this._height?null:this}createConfig(){let yi=this.tabBar.titles.map(wi=>wi.owner),bi=this.tabBar.currentIndex;return{type:"tab-area",widgets:yi,currentIndex:bi}}holdAllSizes(){}fit(yi,bi){let wi=0,De=0,tn=1/0,Ya=1/0,sa=bi.get(this.tabBar),Ua=this.tabBar.currentTitle,en=Ua?bi.get(Ua.owner):void 0,[Mn,za]=this.sizers;return sa&&sa.fit(),en&&en.fit(),sa&&!sa.isHidden?(wi=Math.max(wi,sa.minWidth),De+=sa.minHeight,Mn.minSize=sa.minHeight,Mn.maxSize=sa.maxHeight):(Mn.minSize=0,Mn.maxSize=0),en&&!en.isHidden?(wi=Math.max(wi,en.minWidth),De+=en.minHeight,za.minSize=en.minHeight,za.maxSize=1/0):(za.minSize=0,za.maxSize=1/0),{minWidth:wi,minHeight:De,maxWidth:tn,maxHeight:Ya}}update(yi,bi,wi,De,tn,Ya){this._top=bi,this._left=yi,this._width=wi,this._height=De;let sa=Ya.get(this.tabBar),Ua=this.tabBar.currentTitle,en=Ua?Ya.get(Ua.owner):void 0;if(Fd.calc(this.sizers,De),sa&&!sa.isHidden){let Mn=this.sizers[0].size;sa.update(yi,bi,wi,Mn),bi+=Mn}if(en&&!en.isHidden){let Mn=this.sizers[1].size;en.update(yi,bi,wi,Mn)}}}jt.TabLayoutNode=$t;class gr{constructor(yi){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=yi}*iterAllWidgets(){for(let yi of this.children)yield*yi.iterAllWidgets()}*iterUserWidgets(){for(let yi of this.children)yield*yi.iterUserWidgets()}*iterSelectedWidgets(){for(let yi of this.children)yield*yi.iterSelectedWidgets()}*iterTabBars(){for(let yi of this.children)yield*yi.iterTabBars()}*iterHandles(){yield*this.handles;for(let yi of this.children)yield*yi.iterHandles()}findTabNode(yi){for(let bi=0,wi=this.children.length;bi<wi;++bi){let De=this.children[bi].findTabNode(yi);if(De)return De}return null}findSplitNode(yi){let bi=this.handles.indexOf(yi);if(bi!==-1)return{index:bi,node:this};for(let wi=0,De=this.children.length;wi<De;++wi){let tn=this.children[wi].findSplitNode(yi);if(tn)return tn}return null}findFirstTabNode(){return this.children.length===0?null:this.children[0].findFirstTabNode()}hitTestTabNodes(yi,bi){for(let wi=0,De=this.children.length;wi<De;++wi){let tn=this.children[wi].hitTestTabNodes(yi,bi);if(tn)return tn}return null}createConfig(){let yi=this.orientation,bi=this.createNormalizedSizes(),wi=this.children.map(De=>De.createConfig());return{type:"split-area",orientation:yi,children:wi,sizes:bi}}syncHandles(){this.handles.forEach((yi,bi)=>{yi.setAttribute("data-orientation",this.orientation),bi===this.handles.length-1?yi.classList.add("lm-mod-hidden"):yi.classList.remove("lm-mod-hidden")})}holdSizes(){for(let yi of this.sizers)yi.sizeHint=yi.size}holdAllSizes(){for(let yi of this.children)yi.holdAllSizes();this.holdSizes()}normalizeSizes(){let yi=this.sizers.length;if(yi===0)return;this.holdSizes();let bi=this.sizers.reduce((wi,De)=>wi+De.sizeHint,0);if(bi===0)for(let wi of this.sizers)wi.size=wi.sizeHint=1/yi;else for(let wi of this.sizers)wi.size=wi.sizeHint/=bi;this.normalized=!0}createNormalizedSizes(){let yi=this.sizers.length;if(yi===0)return[];let bi=this.sizers.map(De=>De.size),wi=bi.reduce((De,tn)=>De+tn,0);if(wi===0)for(let De=bi.length-1;De>-1;De--)bi[De]=1/yi;else for(let De=bi.length-1;De>-1;De--)bi[De]/=wi;return bi}fit(yi,bi){let wi=this.orientation==="horizontal",De=Math.max(0,this.children.length-1)*yi,tn=wi?De:0,Ya=wi?0:De,sa=1/0,Ua=1/0;for(let en=0,Mn=this.children.length;en<Mn;++en){let za=this.children[en].fit(yi,bi);wi?(Ya=Math.max(Ya,za.minHeight),tn+=za.minWidth,this.sizers[en].minSize=za.minWidth):(tn=Math.max(tn,za.minWidth),Ya+=za.minHeight,this.sizers[en].minSize=za.minHeight)}return{minWidth:tn,minHeight:Ya,maxWidth:sa,maxHeight:Ua}}update(yi,bi,wi,De,tn,Ya){let sa=this.orientation==="horizontal",Ua=Math.max(0,this.children.length-1)*tn,en=Math.max(0,(sa?wi:De)-Ua);if(this.normalized){for(let Mn of this.sizers)Mn.sizeHint*=en;this.normalized=!1}Fd.calc(this.sizers,en);for(let Mn=0,za=this.children.length;Mn<za;++Mn){let Qn=this.children[Mn],Do=this.sizers[Mn].size,Tn=this.handles[Mn].style;sa?(Qn.update(yi,bi,Do,De,tn,Ya),yi+=Do,Tn.top=`${bi}px`,Tn.left=`${yi}px`,Tn.width=`${tn}px`,Tn.height=`${De}px`,yi+=tn):(Qn.update(yi,bi,wi,Do,tn,Ya),bi+=Do,Tn.top=`${bi}px`,Tn.left=`${yi}px`,Tn.width=`${wi}px`,Tn.height=`${tn}px`,bi+=tn)}}}jt.SplitLayoutNode=gr;function pi(Ri,yi){Ri.node.setAttribute("role","tabpanel");let bi=yi.renderer;if(bi instanceof Gm.Renderer){let wi=bi.createTabKey({title:Ri.title,current:!1,zIndex:0});Ri.node.setAttribute("aria-labelledby",wi)}}jt.addAria=pi;function ti(Ri){Ri.node.removeAttribute("role"),Ri.node.removeAttribute("aria-labelledby")}jt.removeAria=ti;function ci(Ri,yi){if(Ri.widgets.length===0)return null;let bi=[];for(let De of Ri.widgets)yi.has(De)||(yi.add(De),bi.push(De));if(bi.length===0)return null;let wi=Ri.currentIndex;return wi!==-1&&(wi<0||wi>=bi.length)&&(wi=0),{type:"tab-area",widgets:bi,currentIndex:wi}}function Ii(Ri,yi){let bi=Ri.orientation,wi=[],De=[];for(let tn=0,Ya=Ri.children.length;tn<Ya;++tn){let sa=Mt(Ri.children[tn],yi);sa&&(sa.type==="tab-area"||sa.orientation!==bi?(wi.push(sa),De.push(Math.abs(Ri.sizes[tn]||0))):(wi.push(...sa.children),De.push(...sa.sizes)))}return wi.length===0?null:wi.length===1?wi[0]:{type:"split-area",orientation:bi,children:wi,sizes:De}}function si(Ri,yi,bi){let wi=yi.createTabBar(bi);for(let De of Ri.widgets)De.hide(),wi.addTab(De.title),jt.addAria(De,wi);return wi.currentIndex=Ri.currentIndex,new $t(wi)}function mi(Ri,yi,bi){let wi=new gr(Ri.orientation);return Ri.children.forEach((De,tn)=>{let Ya=Lt(De,yi,bi),sa=Se(Ri.sizes[tn]),Ua=yi.createHandle();wi.children.push(Ya),wi.handles.push(Ua),wi.sizers.push(sa),Ya.parent=wi}),wi.syncHandles(),wi.normalizeSizes(),wi}})(hh||(hh={}));var h_=class jt extends rs{constructor(Se={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new Vc(this),this._addRequested=new Vc(this),this.addClass("lm-DockPanel"),this._document=Se.document||document,this._mode=Se.mode||"multiple-document",this._renderer=Se.renderer||jt.defaultRenderer,this._edges=Se.edges||eh.DEFAULT_EDGES,Se.tabsMovable!==void 0&&(this._tabsMovable=Se.tabsMovable),Se.tabsConstrained!==void 0&&(this._tabsConstrained=Se.tabsConstrained),Se.addButtonEnabled!==void 0&&(this._addButtonEnabled=Se.addButtonEnabled),this.dataset.mode=this._mode;let Mt={createTabBar:()=>this._createTabBar(),createHandle:()=>this._createHandle()};this.layout=new Iw({document:this._document,renderer:Mt,spacing:Se.spacing,hiddenMode:Se.hiddenMode}),this.overlay=Se.overlay||new jt.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(Se){this.layout.hiddenMode=Se}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(Se){this.layout.spacing=Se}get mode(){return this._mode}set mode(Se){if(this._mode===Se)return;this._mode=Se,this.dataset.mode=Se;let Mt=this.layout;switch(Se){case"multiple-document":for(let Lt of Mt.tabBars())Lt.show();break;case"single-document":Mt.restoreLayout(eh.createSingleDocumentConfig(this));break;default:throw"unreachable"}qo.postMessage(this,eh.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(Se){this._tabsMovable=Se;for(let Mt of this.tabBars())Mt.tabsMovable=Se}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(Se){this._tabsConstrained=Se}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(Se){this._addButtonEnabled=Se;for(let Mt of this.tabBars())Mt.addButtonEnabled=Se}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(Se){let Mt=(0,ko.find)(this.tabBars(),Lt=>Lt.titles.indexOf(Se.title)!==-1);if(!Mt)throw new Error("Widget is not contained in the dock panel.");Mt.currentTitle=Se.title}activateWidget(Se){this.selectWidget(Se),Se.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(Se){this._mode="multiple-document",this.layout.restoreLayout(Se),(cd.IS_EDGE||cd.IS_IE)&&qo.flush(),qo.postMessage(this,eh.LayoutModified)}addWidget(Se,Mt={}){this._mode==="single-document"?this.layout.addWidget(Se):this.layout.addWidget(Se,Mt),qo.postMessage(this,eh.LayoutModified)}processMessage(Se){Se.type==="layout-modified"?this._layoutModified.emit(void 0):super.processMessage(Se)}handleEvent(Se){switch(Se.type){case"lm-dragenter":this._evtDragEnter(Se);break;case"lm-dragleave":this._evtDragLeave(Se);break;case"lm-dragover":this._evtDragOver(Se);break;case"lm-drop":this._evtDrop(Se);break;case"pointerdown":this._evtPointerDown(Se);break;case"pointermove":this._evtPointerMove(Se);break;case"pointerup":this._evtPointerUp(Se);break;case"keydown":this._evtKeyDown(Se);break;case"contextmenu":Se.preventDefault(),Se.stopPropagation();break}}onBeforeAttach(Se){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(Se){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(Se){eh.isGeneratedTabBarProperty.get(Se.child)||Se.child.addClass("lm-DockPanel-widget")}onChildRemoved(Se){eh.isGeneratedTabBarProperty.get(Se.child)||(Se.child.removeClass("lm-DockPanel-widget"),qo.postMessage(this,eh.LayoutModified))}_evtDragEnter(Se){Se.mimeData.hasData("application/vnd.lumino.widget-factory")&&(Se.preventDefault(),Se.stopPropagation())}_evtDragLeave(Se){Se.preventDefault(),!(this._tabsConstrained&&Se.source!==this)&&(Se.stopPropagation(),this.overlay.hide(1))}_evtDragOver(Se){Se.preventDefault(),this._tabsConstrained&&Se.source!==this||this._showOverlay(Se.clientX,Se.clientY)==="invalid"?Se.dropAction="none":(Se.stopPropagation(),Se.dropAction=Se.proposedAction)}_evtDrop(Se){if(Se.preventDefault(),this.overlay.hide(0),Se.proposedAction==="none"){Se.dropAction="none";return}let{clientX:Mt,clientY:Lt}=Se,{zone:$t,target:gr}=eh.findDropTarget(this,Mt,Lt,this._edges);if(this._tabsConstrained&&Se.source!==this||$t==="invalid"){Se.dropAction="none";return}let ti=Se.mimeData.getData("application/vnd.lumino.widget-factory");if(typeof ti!="function"){Se.dropAction="none";return}let ci=ti();if(!(ci instanceof rs)){Se.dropAction="none";return}if(ci.contains(this)){Se.dropAction="none";return}let Ii=gr?eh.getDropRef(gr.tabBar):null;switch($t){case"root-all":this.addWidget(ci);break;case"root-top":this.addWidget(ci,{mode:"split-top"});break;case"root-left":this.addWidget(ci,{mode:"split-left"});break;case"root-right":this.addWidget(ci,{mode:"split-right"});break;case"root-bottom":this.addWidget(ci,{mode:"split-bottom"});break;case"widget-all":this.addWidget(ci,{mode:"tab-after",ref:Ii});break;case"widget-top":this.addWidget(ci,{mode:"split-top",ref:Ii});break;case"widget-left":this.addWidget(ci,{mode:"split-left",ref:Ii});break;case"widget-right":this.addWidget(ci,{mode:"split-right",ref:Ii});break;case"widget-bottom":this.addWidget(ci,{mode:"split-bottom",ref:Ii});break;case"widget-tab":this.addWidget(ci,{mode:"tab-after",ref:Ii});break;default:throw"unreachable"}Se.dropAction=Se.proposedAction,Se.stopPropagation(),this.activateWidget(ci)}_evtKeyDown(Se){Se.preventDefault(),Se.stopPropagation(),Se.keyCode===27&&(this._releaseMouse(),qo.postMessage(this,eh.LayoutModified))}_evtPointerDown(Se){if(Se.button!==0)return;let Mt=this.layout,Lt=Se.target,$t=(0,ko.find)(Mt.handles(),si=>si.contains(Lt));if(!$t)return;Se.preventDefault(),Se.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let gr=$t.getBoundingClientRect(),pi=Se.clientX-gr.left,ti=Se.clientY-gr.top,ci=window.getComputedStyle($t),Ii=bd.overrideCursor(ci.cursor,this._document);this._pressData={handle:$t,deltaX:pi,deltaY:ti,override:Ii}}_evtPointerMove(Se){if(!this._pressData)return;Se.preventDefault(),Se.stopPropagation();let Mt=this.node.getBoundingClientRect(),Lt=Se.clientX-Mt.left-this._pressData.deltaX,$t=Se.clientY-Mt.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,Lt,$t)}_evtPointerUp(Se){Se.button===0&&(Se.preventDefault(),Se.stopPropagation(),this._releaseMouse(),qo.postMessage(this,eh.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(Se,Mt){let{zone:Lt,target:$t}=eh.findDropTarget(this,Se,Mt,this._edges);if(Lt==="invalid")return this.overlay.hide(100),Lt;let gr,pi,ti,ci,Ii=Yc.boxSizing(this.node),si=this.node.getBoundingClientRect();switch(Lt){case"root-all":gr=Ii.paddingTop,pi=Ii.paddingLeft,ti=Ii.paddingRight,ci=Ii.paddingBottom;break;case"root-top":gr=Ii.paddingTop,pi=Ii.paddingLeft,ti=Ii.paddingRight,ci=si.height*eh.GOLDEN_RATIO;break;case"root-left":gr=Ii.paddingTop,pi=Ii.paddingLeft,ti=si.width*eh.GOLDEN_RATIO,ci=Ii.paddingBottom;break;case"root-right":gr=Ii.paddingTop,pi=si.width*eh.GOLDEN_RATIO,ti=Ii.paddingRight,ci=Ii.paddingBottom;break;case"root-bottom":gr=si.height*eh.GOLDEN_RATIO,pi=Ii.paddingLeft,ti=Ii.paddingRight,ci=Ii.paddingBottom;break;case"widget-all":gr=$t.top,pi=$t.left,ti=$t.right,ci=$t.bottom;break;case"widget-top":gr=$t.top,pi=$t.left,ti=$t.right,ci=$t.bottom+$t.height/2;break;case"widget-left":gr=$t.top,pi=$t.left,ti=$t.right+$t.width/2,ci=$t.bottom;break;case"widget-right":gr=$t.top,pi=$t.left+$t.width/2,ti=$t.right,ci=$t.bottom;break;case"widget-bottom":gr=$t.top+$t.height/2,pi=$t.left,ti=$t.right,ci=$t.bottom;break;case"widget-tab":{let mi=$t.tabBar.node.getBoundingClientRect().height;gr=$t.top,pi=$t.left,ti=$t.right,ci=$t.bottom+$t.height-mi;break}default:throw"unreachable"}return this.overlay.show({top:gr,left:pi,right:ti,bottom:ci}),Lt}_createTabBar(){let Se=this._renderer.createTabBar(this._document);return eh.isGeneratedTabBarProperty.set(Se,!0),this._mode==="single-document"&&Se.hide(),Se.tabsMovable=this._tabsMovable,Se.allowDeselect=!1,Se.addButtonEnabled=this._addButtonEnabled,Se.removeBehavior="select-previous-tab",Se.insertBehavior="select-tab-if-needed",Se.tabMoved.connect(this._onTabMoved,this),Se.currentChanged.connect(this._onCurrentChanged,this),Se.tabCloseRequested.connect(this._onTabCloseRequested,this),Se.tabDetachRequested.connect(this._onTabDetachRequested,this),Se.tabActivateRequested.connect(this._onTabActivateRequested,this),Se.addRequested.connect(this._onTabAddRequested,this),Se}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){qo.postMessage(this,eh.LayoutModified)}_onCurrentChanged(Se,Mt){let{previousTitle:Lt,currentTitle:$t}=Mt;Lt&&Lt.owner.hide(),$t&&$t.owner.show(),(cd.IS_EDGE||cd.IS_IE)&&qo.flush(),qo.postMessage(this,eh.LayoutModified)}_onTabAddRequested(Se){this._addRequested.emit(Se)}_onTabActivateRequested(Se,Mt){Mt.title.owner.activate()}_onTabCloseRequested(Se,Mt){Mt.title.owner.close()}_onTabDetachRequested(Se,Mt){if(this._drag)return;Se.releaseMouse();let{title:Lt,tab:$t,clientX:gr,clientY:pi,offset:ti}=Mt,ci=new op.MimeData,Ii=()=>Lt.owner;ci.setData("application/vnd.lumino.widget-factory",Ii);let si=$t.cloneNode(!0);ti&&(si.style.top=`-${ti.y}px`,si.style.left=`-${ti.x}px`),this._drag=new bd({document:this._document,mimeData:ci,dragImage:si,proposedAction:"move",supportedActions:"move",source:this}),$t.classList.add("lm-mod-hidden");let mi=()=>{this._drag=null,$t.classList.remove("lm-mod-hidden")};this._drag.start(gr,pi).then(mi)}};(function(jt){class Se{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show($t){let gr=this.node.style;gr.top=`${$t.top}px`,gr.left=`${$t.left}px`,gr.right=`${$t.right}px`,gr.bottom=`${$t.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide($t){if(!this._hidden){if($t<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden");return}this._timer===-1&&(this._timer=window.setTimeout(()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")},$t))}}}jt.Overlay=Se;class Mt{createTabBar($t){let gr=new Gm({document:$t});return gr.addClass("lm-DockPanel-tabBar"),gr}createHandle(){let $t=document.createElement("div");return $t.className="lm-DockPanel-handle",$t}}jt.Renderer=Mt,jt.defaultRenderer=new Mt})(h_||(h_={}));var eh;(function(jt){jt.GOLDEN_RATIO=.618,jt.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},jt.LayoutModified=new Bp("layout-modified"),jt.isGeneratedTabBarProperty=new xd({name:"isGeneratedTabBar",create:()=>!1});function Se($t){if($t.isEmpty)return{main:null};let gr=Array.from($t.widgets()),pi=$t.selectedWidgets().next().value,ti=pi?gr.indexOf(pi):-1;return{main:{type:"tab-area",widgets:gr,currentIndex:ti}}}jt.createSingleDocumentConfig=Se;function Mt($t,gr,pi,ti){if(!Yc.hitTest($t.node,gr,pi))return{zone:"invalid",target:null};let ci=$t.layout;if(ci.isEmpty)return{zone:"root-all",target:null};if($t.mode==="multiple-document"){let sa=$t.node.getBoundingClientRect(),Ua=gr-sa.left+1,en=pi-sa.top+1,Mn=sa.right-gr,za=sa.bottom-pi;switch(Math.min(en,Mn,za,Ua)){case en:if(en<ti.top)return{zone:"root-top",target:null};break;case Mn:if(Mn<ti.right)return{zone:"root-right",target:null};break;case za:if(za<ti.bottom)return{zone:"root-bottom",target:null};break;case Ua:if(Ua<ti.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}let Ii=ci.hitTestTabAreas(gr,pi);if(!Ii)return{zone:"invalid",target:null};if($t.mode==="single-document")return{zone:"widget-all",target:Ii};let si=Ii.x-Ii.left+1,mi=Ii.y-Ii.top+1,Ri=Ii.left+Ii.width-Ii.x,yi=Ii.top+Ii.height-Ii.y,bi=Ii.tabBar.node.getBoundingClientRect().height;if(mi<bi)return{zone:"widget-tab",target:Ii};let wi=Math.round(Ii.width/3),De=Math.round(Ii.height/3);if(si>wi&&Ri>wi&&mi>De&&yi>De)return{zone:"widget-all",target:Ii};si/=wi,mi/=De,Ri/=wi,yi/=De;let tn=Math.min(si,mi,Ri,yi),Ya;switch(tn){case si:Ya="widget-left";break;case mi:Ya="widget-top";break;case Ri:Ya="widget-right";break;case yi:Ya="widget-bottom";break;default:throw"unreachable"}return{zone:Ya,target:Ii}}jt.findDropTarget=Mt;function Lt($t){return $t.titles.length===0?null:$t.currentTitle?$t.currentTitle.owner:$t.titles[$t.titles.length-1].owner}jt.getDropRef=Lt})(eh||(eh={}));var ay=class jt extends sp{constructor(Se={}){super(Se),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new Pv],this._columnSizers=[new Pv],this._box=null,Se.rowCount!==void 0&&kh.reallocSizers(this._rowSizers,Se.rowCount),Se.columnCount!==void 0&&kh.reallocSizers(this._columnSizers,Se.columnCount),Se.rowSpacing!==void 0&&(this._rowSpacing=kh.clampValue(Se.rowSpacing)),Se.columnSpacing!==void 0&&(this._columnSpacing=kh.clampValue(Se.columnSpacing))}dispose(){for(let Se of this._items){let Mt=Se.widget;Se.dispose(),Mt.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(Se){Se!==this.rowCount&&(kh.reallocSizers(this._rowSizers,Se),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(Se){Se!==this.columnCount&&(kh.reallocSizers(this._columnSizers,Se),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(Se){Se=kh.clampValue(Se),this._rowSpacing!==Se&&(this._rowSpacing=Se,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(Se){Se=kh.clampValue(Se),this._columnSpacing!==Se&&(this._columnSpacing=Se,this.parent&&this.parent.fit())}rowStretch(Se){let Mt=this._rowSizers[Se];return Mt?Mt.stretch:-1}setRowStretch(Se,Mt){let Lt=this._rowSizers[Se];Lt&&(Mt=kh.clampValue(Mt),Lt.stretch!==Mt&&(Lt.stretch=Mt,this.parent&&this.parent.update()))}columnStretch(Se){let Mt=this._columnSizers[Se];return Mt?Mt.stretch:-1}setColumnStretch(Se,Mt){let Lt=this._columnSizers[Se];Lt&&(Mt=kh.clampValue(Mt),Lt.stretch!==Mt&&(Lt.stretch=Mt,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(let Se of this._items)yield Se.widget}addWidget(Se){ko.ArrayExt.findFirstIndex(this._items,Lt=>Lt.widget===Se)===-1&&(this._items.push(new B0(Se)),this.parent&&this.attachWidget(Se))}removeWidget(Se){let Mt=ko.ArrayExt.findFirstIndex(this._items,$t=>$t.widget===Se);if(Mt===-1)return;let Lt=ko.ArrayExt.removeAt(this._items,Mt);this.parent&&this.detachWidget(Se),Lt.dispose()}init(){super.init();for(let Se of this)this.attachWidget(Se)}attachWidget(Se){this.parent.isAttached&&qo.sendMessage(Se,rs.Msg.BeforeAttach),this.parent.node.appendChild(Se.node),this.parent.isAttached&&qo.sendMessage(Se,rs.Msg.AfterAttach),this.parent.fit()}detachWidget(Se){this.parent.isAttached&&qo.sendMessage(Se,rs.Msg.BeforeDetach),this.parent.node.removeChild(Se.node),this.parent.isAttached&&qo.sendMessage(Se,rs.Msg.AfterDetach),this.parent.fit()}onBeforeShow(Se){super.onBeforeShow(Se),this.parent.update()}onBeforeAttach(Se){super.onBeforeAttach(Se),this.parent.fit()}onChildShown(Se){this.parent.fit()}onChildHidden(Se){this.parent.fit()}onResize(Se){this.parent.isVisible&&this._update(Se.width,Se.height)}onUpdateRequest(Se){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(Se){this.parent.isAttached&&this._fit()}_fit(){for(let ci=0,Ii=this.rowCount;ci<Ii;++ci)this._rowSizers[ci].minSize=0;for(let ci=0,Ii=this.columnCount;ci<Ii;++ci)this._columnSizers[ci].minSize=0;let Se=this._items.filter(ci=>!ci.isHidden);for(let ci=0,Ii=Se.length;ci<Ii;++ci)Se[ci].fit();let Mt=this.rowCount-1,Lt=this.columnCount-1;Se.sort(kh.rowSpanCmp);for(let ci=0,Ii=Se.length;ci<Ii;++ci){let si=Se[ci],mi=jt.getCellConfig(si.widget),Ri=Math.min(mi.row,Mt),yi=Math.min(mi.row+mi.rowSpan-1,Mt);kh.distributeMin(this._rowSizers,Ri,yi,si.minHeight)}Se.sort(kh.columnSpanCmp);for(let ci=0,Ii=Se.length;ci<Ii;++ci){let si=Se[ci],mi=jt.getCellConfig(si.widget),Ri=Math.min(mi.column,Lt),yi=Math.min(mi.column+mi.columnSpan-1,Lt);kh.distributeMin(this._columnSizers,Ri,yi,si.minWidth)}if(this.fitPolicy==="set-no-constraint"){qo.sendMessage(this.parent,rs.Msg.UpdateRequest);return}let $t=Mt*this._rowSpacing,gr=Lt*this._columnSpacing;for(let ci=0,Ii=this.rowCount;ci<Ii;++ci)$t+=this._rowSizers[ci].minSize;for(let ci=0,Ii=this.columnCount;ci<Ii;++ci)gr+=this._columnSizers[ci].minSize;let pi=this._box=Yc.boxSizing(this.parent.node);gr+=pi.horizontalSum,$t+=pi.verticalSum;let ti=this.parent.node.style;ti.minWidth=`${gr}px`,ti.minHeight=`${$t}px`,this._dirty=!0,this.parent.parent&&qo.sendMessage(this.parent.parent,rs.Msg.FitRequest),this._dirty&&qo.sendMessage(this.parent,rs.Msg.UpdateRequest)}_update(Se,Mt){this._dirty=!1,Se<0&&(Se=this.parent.node.offsetWidth),Mt<0&&(Mt=this.parent.node.offsetHeight),this._box||(this._box=Yc.boxSizing(this.parent.node));let Lt=this._box.paddingTop,$t=this._box.paddingLeft,gr=Se-this._box.horizontalSum,pi=Mt-this._box.verticalSum,ti=this.rowCount-1,ci=this.columnCount-1,Ii=ti*this._rowSpacing,si=ci*this._columnSpacing;Fd.calc(this._rowSizers,Math.max(0,pi-Ii)),Fd.calc(this._columnSizers,Math.max(0,gr-si));for(let mi=0,Ri=Lt,yi=this.rowCount;mi<yi;++mi)this._rowStarts[mi]=Ri,Ri+=this._rowSizers[mi].size+this._rowSpacing;for(let mi=0,Ri=$t,yi=this.columnCount;mi<yi;++mi)this._columnStarts[mi]=Ri,Ri+=this._columnSizers[mi].size+this._columnSpacing;for(let mi=0,Ri=this._items.length;mi<Ri;++mi){let yi=this._items[mi];if(yi.isHidden)continue;let bi=jt.getCellConfig(yi.widget),wi=Math.min(bi.row,ti),De=Math.min(bi.column,ci),tn=Math.min(bi.row+bi.rowSpan-1,ti),Ya=Math.min(bi.column+bi.columnSpan-1,ci),sa=this._columnStarts[De],Ua=this._rowStarts[wi],en=this._columnStarts[Ya]+this._columnSizers[Ya].size-sa,Mn=this._rowStarts[tn]+this._rowSizers[tn].size-Ua;yi.update(sa,Ua,en,Mn)}}};(function(jt){function Se(Lt){return kh.cellConfigProperty.get(Lt)}jt.getCellConfig=Se;function Mt(Lt,$t){kh.cellConfigProperty.set(Lt,kh.normalizeConfig($t))}jt.setCellConfig=Mt})(ay||(ay={}));var kh;(function(jt){jt.cellConfigProperty=new xd({name:"cellConfig",create:()=>({row:0,column:0,rowSpan:1,columnSpan:1}),changed:ti});function Se(ci){let Ii=Math.max(0,Math.floor(ci.row||0)),si=Math.max(0,Math.floor(ci.column||0)),mi=Math.max(1,Math.floor(ci.rowSpan||0)),Ri=Math.max(1,Math.floor(ci.columnSpan||0));return{row:Ii,column:si,rowSpan:mi,columnSpan:Ri}}jt.normalizeConfig=Se;function Mt(ci){return Math.max(0,Math.floor(ci))}jt.clampValue=Mt;function Lt(ci,Ii){let si=jt.cellConfigProperty.get(ci.widget),mi=jt.cellConfigProperty.get(Ii.widget);return si.rowSpan-mi.rowSpan}jt.rowSpanCmp=Lt;function $t(ci,Ii){let si=jt.cellConfigProperty.get(ci.widget),mi=jt.cellConfigProperty.get(Ii.widget);return si.columnSpan-mi.columnSpan}jt.columnSpanCmp=$t;function gr(ci,Ii){for(Ii=Math.max(1,Math.floor(Ii));ci.length<Ii;)ci.push(new Pv);ci.length>Ii&&(ci.length=Ii)}jt.reallocSizers=gr;function pi(ci,Ii,si,mi){if(si<Ii)return;if(Ii===si){let bi=ci[Ii];bi.minSize=Math.max(bi.minSize,mi);return}let Ri=0;for(let bi=Ii;bi<=si;++bi)Ri+=ci[bi].minSize;if(Ri>=mi)return;let yi=(mi-Ri)/(si-Ii+1);for(let bi=Ii;bi<=si;++bi)ci[bi].minSize+=yi}jt.distributeMin=pi;function ti(ci){ci.parent&&ci.parent.layout instanceof ay&&ci.parent.fit()}})(kh||(kh={}));var d_=class jt extends rs{constructor(Se={}){super({node:v_.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(rs.Flag.DisallowLayout),this.renderer=Se.renderer||jt.defaultRenderer,this._forceItemsPosition=Se.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=Se.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(Se){this.activeIndex=Se?this._menus.indexOf(Se):-1}get activeIndex(){return this._activeIndex}set activeIndex(Se){(Se<0||Se>=this._menus.length)&&(Se=-1),Se>-1&&this._menus[Se].items.length===0&&(Se=-1),this._activeIndex!==Se&&(this._activeIndex=Se,this.update())}get menus(){return this._menus}openActiveMenu(){this._activeIndex!==-1&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(Se,Mt=!0){this.insertMenu(this._menus.length,Se,Mt)}insertMenu(Se,Mt,Lt=!0){this._closeChildMenu();let $t=this._menus.indexOf(Mt),gr=Math.max(0,Math.min(Se,this._menus.length));if($t===-1){ko.ArrayExt.insert(this._menus,gr,Mt),Mt.addClass("lm-MenuBar-menu"),Mt.aboutToClose.connect(this._onMenuAboutToClose,this),Mt.menuRequested.connect(this._onMenuMenuRequested,this),Mt.title.changed.connect(this._onTitleChanged,this),Lt&&this.update();return}gr===this._menus.length&&gr--,$t!==gr&&(ko.ArrayExt.move(this._menus,$t,gr),Lt&&this.update())}removeMenu(Se,Mt=!0){this.removeMenuAt(this._menus.indexOf(Se),Mt)}removeMenuAt(Se,Mt=!0){this._closeChildMenu();let Lt=ko.ArrayExt.removeAt(this._menus,Se);Lt&&(Lt.aboutToClose.disconnect(this._onMenuAboutToClose,this),Lt.menuRequested.disconnect(this._onMenuMenuRequested,this),Lt.title.changed.disconnect(this._onTitleChanged,this),Lt.removeClass("lm-MenuBar-menu"),Mt&&this.update())}clearMenus(){if(this._menus.length!==0){this._closeChildMenu();for(let Se of this._menus)Se.aboutToClose.disconnect(this._onMenuAboutToClose,this),Se.menuRequested.disconnect(this._onMenuMenuRequested,this),Se.title.changed.disconnect(this._onTitleChanged,this),Se.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(Se){switch(Se.type){case"keydown":this._evtKeyDown(Se);break;case"mousedown":this._evtMouseDown(Se);break;case"mousemove":this._evtMouseMove(Se);break;case"focusout":this._evtFocusOut(Se);break;case"contextmenu":Se.preventDefault(),Se.stopPropagation();break}}onBeforeAttach(Se){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(Se){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(Se){this.isAttached&&this._focusItemAt(0)}onResize(Se){this.update(),super.onResize(Se)}onUpdateRequest(Se){var Mt;let Lt=this._menus,$t=this.renderer,gr=this._activeIndex,pi=this._tabFocusIndex>=0&&this._tabFocusIndex<Lt.length?this._tabFocusIndex:0,ti=this._overflowIndex>-1?this._overflowIndex:Lt.length,ci=0,Ii=!1;ti=this._overflowMenu!==null?ti-1:ti;let si=new Array(ti);for(let mi=0;mi<ti;++mi)si[mi]=$t.renderItem({title:Lt[mi].title,active:mi===gr,tabbable:mi===pi,disabled:Lt[mi].items.length===0,onfocus:()=>{this._tabFocusIndex=mi,this.activeIndex=mi}}),ci+=this._menuItemSizes[mi],Lt[mi].title.label===this._overflowMenuOptions.title&&(Ii=!0,ti--);if(this._overflowMenuOptions.isVisible){if(this._overflowIndex>-1&&!Ii){if(this._overflowMenu===null){let mi=(Mt=this._overflowMenuOptions.title)!==null&&Mt!==void 0?Mt:"...";this._overflowMenu=new F0({commands:new rp}),this._overflowMenu.title.label=mi,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let mi=Lt.length-2;mi>=ti;mi--){let Ri=this.menus[mi];Ri.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:Ri}),this.removeMenu(Ri,!1)}si[ti]=$t.renderItem({title:this._overflowMenu.title,active:ti===gr&&Lt[ti].items.length!==0,tabbable:ti===pi,disabled:Lt[ti].items.length===0,onfocus:()=>{this._tabFocusIndex=ti,this.activeIndex=ti}}),ti++}else if(this._overflowMenu!==null){let mi=this._overflowMenu.items,Ri=this.node.offsetWidth,yi=this._overflowMenu.items.length;for(let bi=0;bi<yi;++bi){let wi=Lt.length-1-bi;if(Ri-ci>this._menuItemSizes[wi]){let De=mi[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(ti,De,!1),si[ti]=$t.renderItem({title:De.title,active:!1,tabbable:ti===pi,disabled:Lt[ti].items.length===0,onfocus:()=>{this._tabFocusIndex=ti,this.activeIndex=ti}}),ti++}}this._overflowMenu.items.length===0&&(this.removeMenu(this._overflowMenu,!1),si.pop(),this._overflowMenu=null,this._overflowIndex=-1)}}ip.render(si,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;let Se=this.contentNode.childNodes,Mt=this.node.offsetWidth,Lt=0,$t=-1,gr=Se.length;if(this._menuItemSizes.length==0)for(let pi=0;pi<gr;pi++){let ti=Se[pi];Lt+=ti.offsetWidth,this._menuItemSizes.push(ti.offsetWidth),Lt>Mt&&$t===-1&&($t=pi)}else for(let pi=0;pi<this._menuItemSizes.length;pi++)if(Lt+=this._menuItemSizes[pi],Lt>Mt){$t=pi;break}this._overflowIndex=$t}_evtKeyDown(Se){let Mt=Se.keyCode;if(Mt===9){this.activeIndex=-1;return}if(Se.preventDefault(),Se.stopPropagation(),Mt===13||Mt===32||Mt===38||Mt===40){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;this.openActiveMenu();return}if(Mt===27){this._closeChildMenu(),this._focusItemAt(this.activeIndex);return}if(Mt===37||Mt===39){let pi=Mt===37?-1:1,ti=this._tabFocusIndex+pi,ci=this._menus.length;for(let Ii=0;Ii<ci;Ii++){let si=(ci+ti+pi*Ii)%ci;if(this._menus[si].items.length){this._focusItemAt(si);return}}return}let Lt=Um().keyForKeydownEvent(Se);if(!Lt)return;let $t=this._activeIndex+1,gr=v_.findMnemonic(this._menus,Lt,$t);gr.index!==-1&&!gr.multiple?(this.activeIndex=gr.index,this.openActiveMenu()):gr.index!==-1?(this.activeIndex=gr.index,this._focusItemAt(this.activeIndex)):gr.auto!==-1&&(this.activeIndex=gr.auto,this._focusItemAt(this.activeIndex))}_evtMouseDown(Se){if(!Yc.hitTest(this.node,Se.clientX,Se.clientY))return;Se.stopPropagation(),Se.stopImmediatePropagation();let Mt=ko.ArrayExt.findFirstIndex(this.contentNode.children,Lt=>Yc.hitTest(Lt,Se.clientX,Se.clientY));if(Mt===-1){this._closeChildMenu();return}if(Se.button===0)if(this._childMenu)this._closeChildMenu(),this.activeIndex=Mt;else{Se.preventDefault();let Lt=this._positionForMenu(Mt);F0.saveWindowData(),this.activeIndex=Mt,this._openChildMenu(Lt)}}_evtMouseMove(Se){let Mt=ko.ArrayExt.findFirstIndex(this.contentNode.children,$t=>Yc.hitTest($t,Se.clientX,Se.clientY));if(Mt===this._activeIndex||Mt===-1&&this._childMenu)return;let Lt=Mt>=0&&this._childMenu?this._positionForMenu(Mt):null;F0.saveWindowData(),this.activeIndex=Mt,Lt&&this._openChildMenu(Lt)}_positionForMenu(Se){let Mt=this.contentNode.children[Se],{left:Lt,bottom:$t}=Mt.getBoundingClientRect();return{top:$t,left:Lt}}_evtFocusOut(Se){!this._childMenu&&!this.node.contains(Se.relatedTarget)&&(this.activeIndex=-1)}_focusItemAt(Se){let Mt=this.contentNode.childNodes[Se];Mt&&Mt.focus()}_openChildMenu(Se={}){let Mt=this.activeMenu;if(!Mt){this._closeChildMenu();return}let Lt=this._childMenu;if(Lt===Mt)return;this._childMenu=Mt,Lt?Lt.close():document.addEventListener("mousedown",this,!0),this._tabFocusIndex=this.activeIndex,qo.sendMessage(this,rs.Msg.UpdateRequest);let{left:$t,top:gr}=Se;(typeof $t>"u"||typeof gr>"u")&&({left:$t,top:gr}=this._positionForMenu(this._activeIndex)),Lt||this.addClass("lm-mod-active"),Mt.items.length>0&&Mt.open($t,gr,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0);let Se=this._childMenu;this._childMenu=null,Se.close(),this.activeIndex=-1}_onMenuAboutToClose(Se){Se===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(Se,Mt){if(Se!==this._childMenu)return;let Lt=this._activeIndex,$t=this._menus.length;switch(Mt){case"next":this.activeIndex=Lt===$t-1?0:Lt+1;break;case"previous":this.activeIndex=Lt===0?$t-1:Lt-1;break}this.openActiveMenu()}_onTitleChanged(){this.update()}};(function(jt){class Se{renderItem(Lt){let $t=this.createItemClass(Lt),gr=this.createItemDataset(Lt),pi=this.createItemARIA(Lt);return qc.li({className:$t,dataset:gr,...Lt.disabled?{}:{tabindex:Lt.tabbable?"0":"-1"},onfocus:Lt.onfocus,...pi},this.renderIcon(Lt),this.renderLabel(Lt))}renderIcon(Lt){let $t=this.createIconClass(Lt);return qc.div({className:$t},Lt.title.icon,Lt.title.iconLabel)}renderLabel(Lt){let $t=this.formatLabel(Lt);return qc.div({className:"lm-MenuBar-itemLabel"},$t)}createItemClass(Lt){let $t="lm-MenuBar-item";return Lt.title.className&&($t+=` ${Lt.title.className}`),Lt.active&&!Lt.disabled&&($t+=" lm-mod-active"),$t}createItemDataset(Lt){return Lt.title.dataset}createItemARIA(Lt){return{role:"menuitem","aria-haspopup":"true","aria-disabled":Lt.disabled?"true":"false"}}createIconClass(Lt){let $t="lm-MenuBar-itemIcon",gr=Lt.title.iconClass;return gr?`${$t} ${gr}`:$t}formatLabel(Lt){let{label:$t,mnemonic:gr}=Lt.title;if(gr<0||gr>=$t.length)return $t;let pi=$t.slice(0,gr),ti=$t.slice(gr+1),ci=$t[gr],Ii=qc.span({className:"lm-MenuBar-itemMnemonic"},ci);return[pi,Ii,ti]}}jt.Renderer=Se,jt.defaultRenderer=new Se})(d_||(d_={}));var v_;(function(jt){function Se(){let Lt=document.createElement("div"),$t=document.createElement("ul");return $t.className="lm-MenuBar-content",Lt.appendChild($t),$t.setAttribute("role","menubar"),Lt}jt.createNode=Se;function Mt(Lt,$t,gr){let pi=-1,ti=-1,ci=!1,Ii=$t.toUpperCase();for(let si=0,mi=Lt.length;si<mi;++si){let Ri=(si+gr)%mi,yi=Lt[Ri].title;if(yi.label.length===0)continue;let bi=yi.mnemonic;if(bi>=0&&bi<yi.label.length){yi.label[bi].toUpperCase()===Ii&&(pi===-1?pi=Ri:ci=!0);continue}ti===-1&&yi.label[0].toUpperCase()===Ii&&(ti=Ri)}return{index:pi,multiple:ci,auto:ti}}jt.findMnemonic=Mt})(v_||(v_={}));var RS;(function(jt){function Se(){let Lt=document.createElement("div"),$t=document.createElement("div"),gr=document.createElement("div"),pi=document.createElement("div"),ti=document.createElement("div");return $t.className="lm-ScrollBar-button",gr.className="lm-ScrollBar-button",$t.dataset.action="decrement",gr.dataset.action="increment",pi.className="lm-ScrollBar-track",ti.className="lm-ScrollBar-thumb",pi.appendChild(ti),Lt.appendChild($t),Lt.appendChild(pi),Lt.appendChild(gr),Lt}jt.createNode=Se;function Mt(Lt,$t){return Lt.thumbNode.contains($t)?"thumb":Lt.trackNode.contains($t)?"track":Lt.decrementNode.contains($t)?"decrement":Lt.incrementNode.contains($t)?"increment":null}jt.findPart=Mt})(RS||(RS={}));var Pw=class extends Hm{constructor(Se={}){super(Se),this._dirty=!1,this._items=[],this._box=null,this._hiddenMode=Se.hiddenMode!==void 0?Se.hiddenMode:rs.HiddenMode.Display}get hiddenMode(){return this._hiddenMode}set hiddenMode(Se){this._hiddenMode!==Se&&(this._hiddenMode=Se,this.widgets.length>1&&this.widgets.forEach(Mt=>{Mt.hiddenMode=this._hiddenMode}))}dispose(){for(let Se of this._items)Se.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(Se,Mt){this._hiddenMode===rs.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=rs.HiddenMode.Scale),Mt.hiddenMode=rs.HiddenMode.Scale):Mt.hiddenMode=rs.HiddenMode.Display,ko.ArrayExt.insert(this._items,Se,new B0(Mt)),this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.BeforeAttach),this.parent.node.appendChild(Mt.node),this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.AfterAttach),this.parent.fit()}moveWidget(Se,Mt,Lt){ko.ArrayExt.move(this._items,Se,Mt),this.parent.update()}detachWidget(Se,Mt){let Lt=ko.ArrayExt.removeAt(this._items,Se);this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.BeforeDetach),this.parent.node.removeChild(Mt.node),this.parent.isAttached&&qo.sendMessage(Mt,rs.Msg.AfterDetach),Lt.widget.node.style.zIndex="",this._hiddenMode===rs.HiddenMode.Scale&&(Mt.hiddenMode=rs.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=rs.HiddenMode.Display)),Lt.dispose(),this.parent.fit()}onBeforeShow(Se){super.onBeforeShow(Se),this.parent.update()}onBeforeAttach(Se){super.onBeforeAttach(Se),this.parent.fit()}onChildShown(Se){this.parent.fit()}onChildHidden(Se){this.parent.fit()}onResize(Se){this.parent.isVisible&&this._update(Se.width,Se.height)}onUpdateRequest(Se){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(Se){this.parent.isAttached&&this._fit()}_fit(){let Se=0,Mt=0;for(let gr=0,pi=this._items.length;gr<pi;++gr){let ti=this._items[gr];ti.isHidden||(ti.fit(),Se=Math.max(Se,ti.minWidth),Mt=Math.max(Mt,ti.minHeight))}let Lt=this._box=Yc.boxSizing(this.parent.node);Se+=Lt.horizontalSum,Mt+=Lt.verticalSum;let $t=this.parent.node.style;$t.minWidth=`${Se}px`,$t.minHeight=`${Mt}px`,this._dirty=!0,this.parent.parent&&qo.sendMessage(this.parent.parent,rs.Msg.FitRequest),this._dirty&&qo.sendMessage(this.parent,rs.Msg.UpdateRequest)}_update(Se,Mt){this._dirty=!1;let Lt=0;for(let ci=0,Ii=this._items.length;ci<Ii;++ci)Lt+=+!this._items[ci].isHidden;if(Lt===0)return;Se<0&&(Se=this.parent.node.offsetWidth),Mt<0&&(Mt=this.parent.node.offsetHeight),this._box||(this._box=Yc.boxSizing(this.parent.node));let $t=this._box.paddingTop,gr=this._box.paddingLeft,pi=Se-this._box.horizontalSum,ti=Mt-this._box.verticalSum;for(let ci=0,Ii=this._items.length;ci<Ii;++ci){let si=this._items[ci];si.isHidden||(si.widget.node.style.zIndex=`${ci}`,si.update(gr,$t,pi,ti))}}};var DS;(function(jt){function Se(Mt){return Mt.layout||new Pw}jt.createLayout=Se})(DS||(DS={}));var zS;(function(jt){function Se(gr){return Lt[gr]}jt.orientationFromPlacement=Se;function Mt(gr){return $t[gr]}jt.directionFromPlacement=Mt;let Lt={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},$t={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}})(zS||(zS={}));var F7="jp-RenderedPlotly",B7="jp-MaterialIcon jp-PlotlyIcon",NS="application/vnd.plotly.v1+json",Rw=class jt extends rs{constructor(Se){super(),this.addClass(F7),this._mimeType=Se.mimeType,this._img_el=document.createElement("img"),this._img_el.className="plot-img",this.node.appendChild(this._img_el),this._img_el.addEventListener("mouseenter",Mt=>{this.createGraph(this._model)})}renderModel(Se){if(this.hasGraphElement())return Promise.resolve();this._model=Se;let Mt=Se.data["image/png"];return Mt!=null?(this.updateImage(Mt),Promise.resolve()):this.createGraph(Se)}hasGraphElement(){return this.node.querySelector(".plot-container")!==null}updateImage(Se){this.hideGraph(),this._img_el.src="data:image/png;base64,"+Se,this.showImage()}hideGraph(){let Se=this.node.querySelector(".plot-container");Se!=null&&(Se.style.display="none")}showGraph(){let Se=this.node.querySelector(".plot-container");Se!=null&&(Se.style.display="block")}hideImage(){let Se=this.node.querySelector(".plot-img");Se!=null&&(Se.style.display="none")}showImage(){let Se=this.node.querySelector(".plot-img");Se!=null&&(Se.style.display="block")}createGraph(Se){let{data:Mt,layout:Lt,frames:$t,config:gr}=Se.data[this._mimeType];return Lt.height||(Lt.height=360),(async()=>(jt.Plotly===null&&(jt.Plotly=await Promise.resolve().then(()=>Qv(OS())),jt._resolveLoadingPlotly()),jt.loadingPlotly))().then(()=>jt.Plotly.react(this.node,Mt,Lt,gr)).then(ti=>{this.showGraph(),this.hideImage(),this.update(),$t&&jt.Plotly.addFrames(this.node,$t),this.node.offsetWidth>0&&this.node.offsetHeight>0&&jt.Plotly.toImage(ti,{format:"png",width:this.node.offsetWidth,height:this.node.offsetHeight}).then(ci=>{let Ii=ci.split(",")[1];Se.data["image/png"]!==Ii&&Se.setData({data:{...Se.data,"image/png":Ii}})}),this.node.on("plotly_webglcontextlost",()=>{let ci=Se.data["image/png"];if(ci!=null)return this.updateImage(ci),Promise.resolve()})})}onAfterShow(Se){this.update()}onResize(Se){this.update()}onUpdateRequest(Se){jt.Plotly&&this.isVisible&&this.hasGraphElement()&&jt.Plotly.redraw(this.node).then(()=>{jt.Plotly.Plots.resize(this.node)})}static{this.Plotly=null}static{this.loadingPlotly=new Promise(Se=>{jt._resolveLoadingPlotly=Se})}},O7={safe:!0,mimeTypes:[NS],createRenderer:jt=>new Rw(jt)},N7=[{id:"@jupyterlab/plotly-extension:factory",rendererFactory:O7,rank:2,dataType:"json",fileTypes:[{name:"plotly",mimeTypes:[NS],extensions:[".plotly",".plotly.json"],iconClass:B7}],documentWidgetFactoryOptions:{name:"Plotly",primaryFileType:"plotly",fileTypes:["plotly","json"],defaultFor:["plotly"]}}],N9=N7;export{NS as MIME_TYPE,Rw as RenderedPlotly,N9 as default,O7 as rendererFactory};
3790/*! Bundled license information:
3791
3792plotly.js/dist/plotly.js:

Callers 15

commands.pyFile · 0.45
install_js_depsFunction · 0.45
overwrite_schemaFunction · 0.45
overwrite_bundleFunction · 0.45
get_latest_commit_infoFunction · 0.45
from_arrayFunction · 0.45
files.pyFile · 0.45
get_moduleFunction · 0.45
zlFunction · 0.45
fuFunction · 0.45
getPluginDescriptionMethod · 0.45

Calls 1

_createValueMethod · 0.45

Tested by 4

itFunction · 0.36
parse_svg_dimensionsFunction · 0.36
perform_requestFunction · 0.36