@deck.gl/jupyter-widget 9.0.16 → 9.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -550,7 +550,7 @@ ${n}${o}${t.type.toUpperCase()}: ${t.message}
550
550
  <code style="user-select:text;"><pre>
551
551
  ${n}
552
552
  </pre></code>`,s.style.top="10px",s.style.left="10px",s.style.position="absolute",s.style.zIndex="9999",s.style.width="100%",s.style.textAlign="left",document.body.appendChild(s);let l=document.getElementsByClassName("luma-compiler-log-error");l[0]?.scrollIntoView&&l[0].scrollIntoView(),s.onclick=()=>{let u=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(u)}}},Sd=c3;Yr(Sd,"defaultProps",{...fn.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debug:"errors"});function Kie(t){return l3(t.source).name||t.id||oa(`unnamed ${t.stage}-shader`)}var u3=class extends fn{get[Symbol.toStringTag](){return"Sampler"}constructor(e,r){super(e,r,u3.defaultProps)}},Cd=u3;Yr(Cd,"defaultProps",{...fn.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"nearest",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});var f3=class extends fn{get[Symbol.toStringTag](){return"Framebuffer"}width;height;colorAttachments=[];depthStencilAttachment=null;constructor(e,r={}){super(e,r,f3.defaultProps),this.width=this.props.width,this.height=this.props.height}resize(e){let r=!e;if(e){let[i,n]=Array.isArray(e)?e:[e.width,e.height];r=r||n!==this.height||i!==this.width,this.width=i,this.height=n}r&&(Kt.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.props.colorAttachments.length===0&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map(r=>{if(typeof r=="string"){let i=this.createColorTexture(r);return this.attachResource(i),i.view}return r instanceof bo?r.view:r});let e=this.props.depthStencilAttachment;if(e)if(typeof e=="string"){let r=this.createDepthStencilTexture(e);this.attachResource(r),this.depthStencilAttachment=r.view}else e instanceof bo?this.depthStencilAttachment=e.view:this.depthStencilAttachment=e}createColorTexture(e){return this.device.createTexture({id:"color-attachment",usage:bo.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height})}createDepthStencilTexture(e){return this.device.createTexture({id:"depth-stencil-attachment",usage:bo.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height})}resizeAttachments(e,r){for(let i=0;i<this.colorAttachments.length;++i)if(this.colorAttachments[i]){let n=this.device._createTexture({...this.colorAttachments[i].props,width:e,height:r});this.destroyAttachedResource(this.colorAttachments[i]),this.colorAttachments[i]=n.view,this.attachResource(n.view)}if(this.depthStencilAttachment){let i=this.device._createTexture({...this.depthStencilAttachment.props,width:e,height:r});this.destroyAttachedResource(this.depthStencilAttachment),this.depthStencilAttachment=i.view,this.attachResource(i)}}},_h=f3;Yr(_h,"defaultProps",{...fn.defaultProps,width:1,height:1,colorAttachments:[],depthStencilAttachment:null});var h3=class extends fn{get[Symbol.toStringTag](){return"RenderPipeline"}shaderLayout;bufferLayout;linkStatus="pending";hash="";constructor(e,r){super(e,r,h3.defaultProps),this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}setUniformsWebGL(e){throw new Error("Use uniform blocks")}},Af=h3;Yr(Af,"defaultProps",{...fn.defaultProps,vs:null,vertexEntryPoint:"vertexMain",vsConstants:{},fs:null,fragmentEntryPoint:"fragmentMain",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",parameters:{},bindings:{},uniforms:{}});var p3=class extends fn{get[Symbol.toStringTag](){return"RenderPass"}constructor(e,r){super(e,r,p3.defaultProps)}},D0=p3;Yr(D0,"defaultProps",{...fn.defaultProps,framebuffer:null,parameters:void 0,clearColor:[0,0,0,0],clearDepth:1,clearStencil:0,depthReadOnly:!1,stencilReadOnly:!1,discard:!1,occlusionQuerySet:void 0,timestampQuerySet:void 0,beginTimestampIndex:void 0,endTimestampIndex:void 0});var d3=class extends fn{get[Symbol.toStringTag](){return"ComputePipeline"}hash="";constructor(e,r){super(e,r,d3.defaultProps)}},rm=d3;Yr(rm,"defaultProps",{...fn.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});var A3=class extends fn{get[Symbol.toStringTag](){return"CommandEncoder"}constructor(e,r){super(e,r,A3.defaultProps)}},L0=A3;Yr(L0,"defaultProps",{...fn.defaultProps,measureExecutionTime:void 0});var m3=class extends fn{get[Symbol.toStringTag](){return"CommandBuffer"}constructor(e,r){super(e,r,m3.defaultProps)}},F0=m3;Yr(F0,"defaultProps",{...fn.defaultProps});function tz(t){let[e,r]=Jie[t],i=e==="i32"||e==="u32",n=e!=="u32",o=Qie[e]*r,s=Zie(e,r);return{dataType:e,components:r,defaultVertexFormat:s,byteLength:o,integer:i,signed:n}}function Zie(t,e){let r;switch(t){case"f32":r="float32";break;case"i32":r="sint32";break;case"u32":r="uint32";break;case"f16":return e<=2?"float16x2":"float16x4"}return e===1?r:`${r}x${e}`}var Jie={f32:["f32",1],"vec2<f32>":["f32",2],"vec3<f32>":["f32",3],"vec4<f32>":["f32",4],f16:["f16",1],"vec2<f16>":["f16",2],"vec3<f16>":["f16",3],"vec4<f16>":["f16",4],i32:["i32",1],"vec2<i32>":["i32",2],"vec3<i32>":["i32",3],"vec4<i32>":["i32",4],u32:["u32",1],"vec2<u32>":["u32",2],"vec3<u32>":["u32",3],"vec4<u32>":["u32",4]},Qie={f32:4,f16:2,i32:4,u32:4};function g3(t){let e;t.endsWith("-webgl")&&(t.replace("-webgl",""),e=!0);let[r,i]=t.split("x"),n=r,o=i?parseInt(i):1,s=j2(n),l={type:n,components:o,byteLength:s.byteLength*o,integer:s.integer,signed:s.signed,normalized:s.normalized};return e&&(l.webglOnly=!0),l}function W2(t,e){let r={};for(let i of t.attributes)r[i.name]=$ie(t,e,i.name);return r}function rz(t,e,r=16){let i=W2(t,e),n=new Array(r).fill(null);for(let o of Object.values(i))n[o.location]=o;return n}function $ie(t,e,r){let i=ene(t,r),n=tne(e,r);if(!i)return null;let o=tz(i.type),s=n?.vertexFormat||o.defaultVertexFormat,l=g3(s);return{attributeName:n?.attributeName||i.name,bufferName:n?.bufferName||i.name,location:i.location,shaderType:i.type,shaderDataType:o.dataType,shaderComponents:o.components,vertexFormat:s,bufferDataType:l.type,bufferComponents:l.components,normalized:l.normalized,integer:o.integer,stepMode:n?.stepMode||i.stepMode,byteOffset:n?.byteOffset||0,byteStride:n?.byteStride||0}}function ene(t,e){let r=t.attributes.find(i=>i.name===e);return r||Kt.warn(`shader layout attribute "${e}" not present in shader`),r||null}function tne(t,e){rne(t);let r=ine(t,e);return r||(r=nne(t,e),r)?r:(Kt.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function rne(t){for(let e of t)(e.attributes&&e.format||!e.attributes&&!e.format)&&Kt.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function ine(t,e){for(let r of t)if(r.format&&r.name===e)return{attributeName:r.name,bufferName:e,stepMode:r.stepMode,vertexFormat:r.format,byteOffset:0,byteStride:r.byteStride||0};return null}function nne(t,e){for(let r of t){let i=r.byteStride;if(typeof r.byteStride!="number")for(let o of r.attributes||[]){let s=g3(o.format);i+=s.byteLength}let n=r.attributes?.find(o=>o.attribute===e);if(n)return{attributeName:n.attribute,bufferName:r.name,stepMode:r.stepMode,vertexFormat:n.format,byteOffset:n.byteOffset,byteStride:i}}return null}function _3(t,e){let r={...t,attributes:t.attributes.map(i=>({...i}))};for(let i of e?.attributes||[]){let n=r.attributes.find(o=>o.name===i.name);n?(n.type=i.type||n.type,n.stepMode=i.stepMode||n.stepMode):Kt.warn(`shader layout attribute ${i.name} not present in shader`)}return r}var y3=class extends fn{get[Symbol.toStringTag](){return"VertexArray"}maxVertexAttributes;attributeInfos;indexBuffer=null;attributes;constructor(e,r){super(e,r,y3.defaultProps),this.maxVertexAttributes=e.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null),this.attributeInfos=rz(r.renderPipeline.shaderLayout,r.renderPipeline.bufferLayout,this.maxVertexAttributes)}setConstantWebGL(e,r){throw new Error("constant attributes not supported")}},N0=y3;Yr(N0,"defaultProps",{...fn.defaultProps,renderPipeline:null});var v3=class extends fn{get[Symbol.toStringTag](){return"TransformFeedback"}constructor(e,r){super(e,r,v3.defaultProps)}},k0=v3;Yr(k0,"defaultProps",{...fn.defaultProps,layout:void 0,buffers:{}});var x3=class extends fn{get[Symbol.toStringTag](){return"QuerySet"}constructor(e,r){super(e,r,x3.defaultProps)}},U0=x3;Yr(U0,"defaultProps",{...fn.defaultProps,type:void 0,count:void 0});var one={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2<f32>":{type:"f32",components:2},"vec3<f32>":{type:"f32",components:3},"vec4<f32>":{type:"f32",components:4},"vec2<i32>":{type:"i32",components:2},"vec3<i32>":{type:"i32",components:3},"vec4<i32>":{type:"i32",components:4},"vec2<u32>":{type:"u32",components:2},"vec3<u32>":{type:"u32",components:3},"vec4<u32>":{type:"u32",components:4},"mat2x2<f32>":{type:"f32",components:4},"mat2x3<f32>":{type:"f32",components:6},"mat2x4<f32>":{type:"f32",components:8},"mat3x2<f32>":{type:"f32",components:6},"mat3x3<f32>":{type:"f32",components:9},"mat3x4<f32>":{type:"f32",components:12},"mat4x2<f32>":{type:"f32",components:8},"mat4x3<f32>":{type:"f32",components:12},"mat4x4<f32>":{type:"f32",components:16}};function iz(t){let e=one[t];return Yi(t),e}function nz(t,e){switch(e){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}var q2;function X2(t){return(!q2||q2.byteLength<t)&&(q2=new ArrayBuffer(t)),q2}function b3(t,e){let r=X2(t.BYTES_PER_ELEMENT*e);return new t(r,0,e)}function w3(t){let{target:e,source:r,start:i=0,count:n=1}=t,o=r.length,s=n*o,l=0;for(let u=i;l<o;l++)e[u++]=r[l];for(;l<s;)l<s-l?(e.copyWithin(i+l,i,i+l),l*=2):(e.copyWithin(i+l,i,i+s-l),l=s);return t.target}var oz=1024,Y2=class{layout={};byteLength;constructor(e){let r=0;for(let[n,o]of Object.entries(e)){let s=iz(o),{type:l,components:u}=s;r=nz(r,u);let h=r;r+=u,this.layout[n]={type:l,size:u,offset:h}}r+=(4-r%4)%4;let i=r*4;this.byteLength=Math.max(i,oz)}getData(e){let r=Math.max(this.byteLength,oz),i=X2(r),n={i32:new Int32Array(i),u32:new Uint32Array(i),f32:new Float32Array(i),f16:new Uint16Array(i)};for(let[o,s]of Object.entries(e)){let l=this.layout[o];if(!l){Kt.warn(`Supplied uniform value ${o} not present in uniform block layout`)();continue}let{type:u,size:h,offset:v}=l,T=n[u];if(h===1){if(typeof s!="number"&&typeof s!="boolean"){Kt.warn(`Supplied value for single component uniform ${o} is not a number: ${s}`)();continue}T[v]=Number(s)}else{let E=bd(s);if(!E){Kt.warn(`Supplied value for multi component / array uniform ${o} is not a numeric array: ${s}`)();continue}T.set(E,v)}}return new Uint8Array(i)}has(e){return Boolean(this.layout[e])}get(e){return this.layout[e]}};function sz(t,e,r=16){if(t!==e)return!1;let i=bd(t);if(!i)return!1;let n=bd(e);if(n&&i.length===n.length){for(let o=0;o<i.length;++o)if(n[o]!==i[o])return!1}return!0}function az(t){let e=bd(t);return e?e.slice():t}var K2=class{name;uniforms={};modifiedUniforms={};modified=!0;bindingLayout={};needsRedraw="initialized";constructor(e){if(this.name=e?.name,e?.name&&e?.shaderLayout){let r=e?.shaderLayout.bindings?.find(n=>n.type==="uniform"&&n.name===e?.name);if(!r)throw new Error(e?.name);let i=r;for(let n of i.uniforms||[])this.bindingLayout[n.name]=n}}setUniforms(e){for(let[r,i]of Object.entries(e))this._setUniform(r,i),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${r}=${i}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,r){sz(this.uniforms[e],r)||(this.uniforms[e]=az(r),this.modifiedUniforms[e]=!0,this.modified=!0)}};var ax=class{uniformBlocks=new Map;uniformBufferLayouts=new Map;uniformBuffers=new Map;constructor(e){for(let[r,i]of Object.entries(e)){let n=r,o=new Y2(i.uniformTypes||{});this.uniformBufferLayouts.set(n,o);let s=new K2({name:r});s.setUniforms(i.defaultUniforms||{}),this.uniformBlocks.set(n,s)}}destroy(){for(let e of this.uniformBuffers.values())e.destroy()}setUniforms(e){for(let[r,i]of Object.entries(e))this.uniformBlocks.get(r).setUniforms(i);this.updateUniformBuffers()}getUniformBufferByteLength(e){return this.uniformBufferLayouts.get(e).byteLength}getUniformBufferData(e){let r=this.uniformBlocks.get(e).getAllUniforms();return this.uniformBufferLayouts.get(e).getData(r)}createUniformBuffer(e,r,i){i&&this.setUniforms(i);let n=this.getUniformBufferByteLength(r),o=e.createBuffer({usage:Xi.UNIFORM|Xi.COPY_DST,byteLength:n}),s=this.getUniformBufferData(r);return o.write(s),o}getManagedUniformBuffer(e,r){if(!this.uniformBuffers.get(r)){let i=this.getUniformBufferByteLength(r),n=e.createBuffer({usage:Xi.UNIFORM|Xi.COPY_DST,byteLength:i});this.uniformBuffers.set(r,n)}return this.uniformBuffers.get(r)}updateUniformBuffers(){let e=!1;for(let r of this.uniformBlocks.keys()){let i=this.updateUniformBuffer(r);e||=i}return e&&Kt.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){let r=this.uniformBlocks.get(e),i=this.uniformBuffers.get(e),n=!1;if(i&&r.needsRedraw){n||=r.needsRedraw;let o=this.getUniformBufferData(e);this.uniformBuffers.get(e).write(o);let l=this.uniformBlocks.get(e).getAllUniforms();Kt.log(4,`Writing to uniform buffer ${String(e)}`,o,l)()}return n}};function Z2(t){let e=ArrayBuffer.isView(t)?t.constructor:t;switch(e){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(e.constructor.name)}}function lx(t){switch(t){case"float32":return Float32Array;case"uint32":return Uint32Array;case"sint32":return Int32Array;case"uint16":case"unorm16":return Uint16Array;case"sint16":case"snorm16":return Int16Array;case"uint8":case"unorm8":return Uint8Array;case"sint8":case"snorm8":return Int8Array;default:throw new Error(t)}}function T3(t,e,r){if(!e||e>4)throw new Error(`size ${e}`);let i=e,n=Z2(t);if(n==="uint8"||n==="sint8"){if(i===1||i===3)throw new Error(`size: ${e}`);return r&&(n=n.replace("int","norm")),`${n}x${i}`}if(n==="uint16"||n==="sint16"){if(i===1||i===3)throw new Error(`size: ${e}`);return r&&(n=n.replace("int","norm")),`${n}x${i}`}return i===1?n:`${n}x${i}`}function lz(t){return bd(t)!==null||typeof t=="number"||typeof t=="boolean"}function cx(t){let e={bindings:{},uniforms:{}};return Object.keys(t).forEach(r=>{let i=t[r];lz(i)?e.uniforms[r]=i:e.bindings[r]=i}),e}function E3(t,e,r){let{removedProps:i={},deprecatedProps:n={},replacedProps:o={}}=r;for(let l in i)if(l in e){let h=i[l]?`${t}.${i[l]}`:"N/A";Kt.removed(`${t}.${l}`,h)()}for(let l in n)if(l in e){let u=n[l];Kt.deprecated(`${t}.${l}`,`${t}.${u}`)()}let s=null;for(let[l,u]of Object.entries(o))l in e&&(Kt.deprecated(`${t}.${l}`,`${t}.${u}`)(),s=s||Object.assign({},e),s[u]=e[l],delete s[l]);return s||e}var sne="";async function S3(t,e){return await new Promise((r,i)=>{try{let n=new Image;n.onload=()=>r(n),n.onerror=()=>i(new Error(`Could not load image ${t}.`)),n.crossOrigin=e?.crossOrigin||"anonymous",n.src=t.startsWith("http")?t:sne+t}catch(n){i(n)}})}async function ux(t,e){let r=document.getElementsByTagName("head")[0];if(!r)throw new Error("loadScript");let i=document.createElement("script");return i.setAttribute("type","text/javascript"),i.setAttribute("src",t),e&&(i.id=e),new Promise((n,o)=>{i.onload=n,i.onerror=s=>o(new Error(`Unable to load script '${t}': ${s}`)),r.appendChild(i)})}function fx(t,e,r){if(t===e)return!0;if(!r||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!fx(t[i],e[i],r-1))return!1;return!0}if(Array.isArray(e))return!1;if(typeof t=="object"&&typeof e=="object"){let i=Object.keys(t),n=Object.keys(e);if(i.length!==n.length)return!1;for(let o of i)if(!e.hasOwnProperty(o)||!fx(t[o],e[o],r-1))return!1;return!0}return!1}function C3(t){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}function M3(t){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}var yh;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",t[t.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.CULL_FACE=2884]="CULL_FACE",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.BLEND=3042]="BLEND",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.DITHER=3024]="DITHER",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DOUBLE=5130]="DOUBLE",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",t[t.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.READ_BUFFER=3074]="READ_BUFFER",t[t.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",t[t.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",t[t.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",t[t.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",t[t.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",t[t.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",t[t.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",t[t.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",t[t.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",t[t.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",t[t.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",t[t.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",t[t.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",t[t.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",t[t.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",t[t.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",t[t.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",t[t.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",t[t.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",t[t.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",t[t.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",t[t.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",t[t.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",t[t.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",t[t.RED=6403]="RED",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB10_A2=32857]="RGB10_A2",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",t[t.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",t[t.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",t[t.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",t[t.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",t[t.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",t[t.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",t[t.SRGB=35904]="SRGB",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",t[t.RGBA32F=34836]="RGBA32F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.RGB16F=34843]="RGB16F",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R16F=33325]="R16F",t[t.R32F=33326]="R32F",t[t.RG16F=33327]="RG16F",t[t.RG32F=33328]="RG32F",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2UI=36975]="RGB10_A2UI",t[t.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",t[t.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.RG=33319]="RG",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",t[t.CURRENT_QUERY=34917]="CURRENT_QUERY",t[t.QUERY_RESULT=34918]="QUERY_RESULT",t[t.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",t[t.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",t[t.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",t[t.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",t[t.DRAW_BUFFER0=34853]="DRAW_BUFFER0",t[t.DRAW_BUFFER1=34854]="DRAW_BUFFER1",t[t.DRAW_BUFFER2=34855]="DRAW_BUFFER2",t[t.DRAW_BUFFER3=34856]="DRAW_BUFFER3",t[t.DRAW_BUFFER4=34857]="DRAW_BUFFER4",t[t.DRAW_BUFFER5=34858]="DRAW_BUFFER5",t[t.DRAW_BUFFER6=34859]="DRAW_BUFFER6",t[t.DRAW_BUFFER7=34860]="DRAW_BUFFER7",t[t.DRAW_BUFFER8=34861]="DRAW_BUFFER8",t[t.DRAW_BUFFER9=34862]="DRAW_BUFFER9",t[t.DRAW_BUFFER10=34863]="DRAW_BUFFER10",t[t.DRAW_BUFFER11=34864]="DRAW_BUFFER11",t[t.DRAW_BUFFER12=34865]="DRAW_BUFFER12",t[t.DRAW_BUFFER13=34866]="DRAW_BUFFER13",t[t.DRAW_BUFFER14=34867]="DRAW_BUFFER14",t[t.DRAW_BUFFER15=34868]="DRAW_BUFFER15",t[t.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",t[t.MAX_SAMPLES=36183]="MAX_SAMPLES",t[t.SAMPLER_BINDING=35097]="SAMPLER_BINDING",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",t[t.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",t[t.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",t[t.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",t[t.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",t[t.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",t[t.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",t[t.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",t[t.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",t[t.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",t[t.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",t[t.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",t[t.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",t[t.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",t[t.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",t[t.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",t[t.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",t[t.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",t[t.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",t[t.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",t[t.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",t[t.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",t[t.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",t[t.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",t[t.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",t[t.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",t[t.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",t[t.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",t[t.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",t[t.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",t[t.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",t[t.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",t[t.UNIFORM_TYPE=35383]="UNIFORM_TYPE",t[t.UNIFORM_SIZE=35384]="UNIFORM_SIZE",t[t.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",t[t.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",t[t.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",t[t.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",t[t.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",t[t.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",t[t.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",t[t.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",t[t.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS",t[t.SYNC_FENCE=37142]="SYNC_FENCE",t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED",t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED",t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",t[t.COLOR=6144]="COLOR",t[t.DEPTH=6145]="DEPTH",t[t.STENCIL=6146]="STENCIL",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STREAM_COPY=35042]="STREAM_COPY",t[t.STATIC_READ=35045]="STATIC_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",t[t.INVALID_INDEX=4294967295]="INVALID_INDEX",t[t.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",t[t.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",t[t.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",t[t.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",t[t.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",t[t.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",t[t.R16_EXT=33322]="R16_EXT",t[t.RG16_EXT=33324]="RG16_EXT",t[t.RGB16_EXT=32852]="RGB16_EXT",t[t.RGBA16_EXT=32859]="RGBA16_EXT",t[t.R16_SNORM_EXT=36760]="R16_SNORM_EXT",t[t.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",t[t.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",t[t.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",t[t.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",t[t.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",t[t.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",t[t.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",t[t.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",t[t.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",t[t.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",t[t.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",t[t.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",t[t.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",t[t.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",t[t.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",t[t.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",t[t.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR",t[t.DEPTH_CLAMP_EXT=34383]="DEPTH_CLAMP_EXT",t[t.FIRST_VERTEX_CONVENTION_WEBGL=36429]="FIRST_VERTEX_CONVENTION_WEBGL",t[t.LAST_VERTEX_CONVENTION_WEBGL=36430]="LAST_VERTEX_CONVENTION_WEBGL",t[t.PROVOKING_VERTEX_WEBL=36431]="PROVOKING_VERTEX_WEBL",t[t.POLYGON_MODE_WEBGL=2880]="POLYGON_MODE_WEBGL",t[t.POLYGON_OFFSET_LINE_WEBGL=10754]="POLYGON_OFFSET_LINE_WEBGL",t[t.LINE_WEBGL=6913]="LINE_WEBGL",t[t.FILL_WEBGL=6914]="FILL_WEBGL",t[t.MAX_CLIP_DISTANCES_WEBGL=3378]="MAX_CLIP_DISTANCES_WEBGL",t[t.MAX_CULL_DISTANCES_WEBGL=33529]="MAX_CULL_DISTANCES_WEBGL",t[t.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL=33530]="MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL",t[t.CLIP_DISTANCE0_WEBGL=12288]="CLIP_DISTANCE0_WEBGL",t[t.CLIP_DISTANCE1_WEBGL=12289]="CLIP_DISTANCE1_WEBGL",t[t.CLIP_DISTANCE2_WEBGL=12290]="CLIP_DISTANCE2_WEBGL",t[t.CLIP_DISTANCE3_WEBGL=12291]="CLIP_DISTANCE3_WEBGL",t[t.CLIP_DISTANCE4_WEBGL=12292]="CLIP_DISTANCE4_WEBGL",t[t.CLIP_DISTANCE5_WEBGL=12293]="CLIP_DISTANCE5_WEBGL",t[t.CLIP_DISTANCE6_WEBGL=12294]="CLIP_DISTANCE6_WEBGL",t[t.CLIP_DISTANCE7_WEBGL=12295]="CLIP_DISTANCE7_WEBGL",t[t.POLYGON_OFFSET_CLAMP_EXT=36379]="POLYGON_OFFSET_CLAMP_EXT",t[t.LOWER_LEFT_EXT=36001]="LOWER_LEFT_EXT",t[t.UPPER_LEFT_EXT=36002]="UPPER_LEFT_EXT",t[t.NEGATIVE_ONE_TO_ONE_EXT=37726]="NEGATIVE_ONE_TO_ONE_EXT",t[t.ZERO_TO_ONE_EXT=37727]="ZERO_TO_ONE_EXT",t[t.CLIP_ORIGIN_EXT=37724]="CLIP_ORIGIN_EXT",t[t.CLIP_DEPTH_MODE_EXT=37725]="CLIP_DEPTH_MODE_EXT",t[t.SRC1_COLOR_WEBGL=35065]="SRC1_COLOR_WEBGL",t[t.SRC1_ALPHA_WEBGL=34185]="SRC1_ALPHA_WEBGL",t[t.ONE_MINUS_SRC1_COLOR_WEBGL=35066]="ONE_MINUS_SRC1_COLOR_WEBGL",t[t.ONE_MINUS_SRC1_ALPHA_WEBGL=35067]="ONE_MINUS_SRC1_ALPHA_WEBGL",t[t.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL=35068]="MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL",t[t.MIRROR_CLAMP_TO_EDGE_EXT=34627]="MIRROR_CLAMP_TO_EDGE_EXT"})(yh||(yh={}));var px={[3042]:!1,[32773]:new Float32Array([0,0,0,0]),[32777]:32774,[34877]:32774,[32969]:1,[32968]:0,[32971]:1,[32970]:0,[3106]:new Float32Array([0,0,0,0]),[3107]:[!0,!0,!0,!0],[2884]:!1,[2885]:1029,[2929]:!1,[2931]:1,[2932]:513,[2928]:new Float32Array([0,1]),[2930]:!0,[3024]:!0,[35725]:null,[36006]:null,[36007]:null,[34229]:null,[34964]:null,[2886]:2305,[33170]:4352,[2849]:1,[32823]:!1,[32824]:0,[10752]:0,[32926]:!1,[32928]:!1,[32938]:1,[32939]:!1,[3089]:!1,[3088]:new Int32Array([0,0,1024,1024]),[2960]:!1,[2961]:0,[2968]:4294967295,[36005]:4294967295,[2962]:519,[2967]:0,[2963]:4294967295,[34816]:519,[36003]:0,[36004]:4294967295,[2964]:7680,[2965]:7680,[2966]:7680,[34817]:7680,[34818]:7680,[34819]:7680,[2978]:[0,0,1024,1024],[36389]:null,[36662]:null,[36663]:null,[35053]:null,[35055]:null,[35723]:4352,[36010]:null,[35977]:!1,[3333]:4,[3317]:4,[37440]:!1,[37441]:!1,[37443]:37444,[3330]:0,[3332]:0,[3331]:0,[3314]:0,[32878]:0,[3316]:0,[3315]:0,[32877]:0},ya=(t,e,r)=>e?t.enable(r):t.disable(r),cz=(t,e,r)=>t.hint(r,e),Kc=(t,e,r)=>t.pixelStorei(r,e),uz=(t,e,r)=>{let i=r===36006?36009:36008;return t.bindFramebuffer(i,e)},hx=(t,e,r)=>{let n={[34964]:34962,[36662]:36662,[36663]:36663,[35053]:35051,[35055]:35052}[r];t.bindBuffer(n,e)};function I3(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}var fz={[3042]:ya,[32773]:(t,e)=>t.blendColor(...e),[32777]:"blendEquation",[34877]:"blendEquation",[32969]:"blendFunc",[32968]:"blendFunc",[32971]:"blendFunc",[32970]:"blendFunc",[3106]:(t,e)=>t.clearColor(...e),[3107]:(t,e)=>t.colorMask(...e),[2884]:ya,[2885]:(t,e)=>t.cullFace(e),[2929]:ya,[2931]:(t,e)=>t.clearDepth(e),[2932]:(t,e)=>t.depthFunc(e),[2928]:(t,e)=>t.depthRange(...e),[2930]:(t,e)=>t.depthMask(e),[3024]:ya,[35723]:cz,[35725]:(t,e)=>t.useProgram(e),[36007]:(t,e)=>t.bindRenderbuffer(36161,e),[36389]:(t,e)=>t.bindTransformFeedback?.(36386,e),[34229]:(t,e)=>t.bindVertexArray(e),[36006]:uz,[36010]:uz,[34964]:hx,[36662]:hx,[36663]:hx,[35053]:hx,[35055]:hx,[2886]:(t,e)=>t.frontFace(e),[33170]:cz,[2849]:(t,e)=>t.lineWidth(e),[32823]:ya,[32824]:"polygonOffset",[10752]:"polygonOffset",[35977]:ya,[32926]:ya,[32928]:ya,[32938]:"sampleCoverage",[32939]:"sampleCoverage",[3089]:ya,[3088]:(t,e)=>t.scissor(...e),[2960]:ya,[2961]:(t,e)=>t.clearStencil(e),[2968]:(t,e)=>t.stencilMaskSeparate(1028,e),[36005]:(t,e)=>t.stencilMaskSeparate(1029,e),[2962]:"stencilFuncFront",[2967]:"stencilFuncFront",[2963]:"stencilFuncFront",[34816]:"stencilFuncBack",[36003]:"stencilFuncBack",[36004]:"stencilFuncBack",[2964]:"stencilOpFront",[2965]:"stencilOpFront",[2966]:"stencilOpFront",[34817]:"stencilOpBack",[34818]:"stencilOpBack",[34819]:"stencilOpBack",[2978]:(t,e)=>t.viewport(...e),[34383]:ya,[10754]:ya,[12288]:ya,[12289]:ya,[12290]:ya,[12291]:ya,[12292]:ya,[12293]:ya,[12294]:ya,[12295]:ya,[3333]:Kc,[3317]:Kc,[37440]:Kc,[37441]:Kc,[37443]:Kc,[3330]:Kc,[3332]:Kc,[3331]:Kc,[3314]:Kc,[32878]:Kc,[3316]:Kc,[3315]:Kc,[32877]:Kc,framebuffer:(t,e)=>{let r=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,r)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{let r=typeof e=="number"?[e,e]:e;t.blendEquationSeparate(...r)},blendFunc:(t,e)=>{let r=e?.length===2?[...e,...e]:e;t.blendFuncSeparate(...r)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=I3(e)?e:[e,e];let[r,i]=e;t.stencilMaskSeparate(1028,r),t.stencilMaskSeparate(1029,i)},stencilFunc:(t,e)=>{e=I3(e)&&e.length===3?[...e,...e]:e;let[r,i,n,o,s,l]=e;t.stencilFuncSeparate(1028,r,i,n),t.stencilFuncSeparate(1029,o,s,l)},stencilOp:(t,e)=>{e=I3(e)&&e.length===3?[...e,...e]:e;let[r,i,n,o,s,l]=e;t.stencilOpSeparate(1028,r,i,n),t.stencilOpSeparate(1029,o,s,l)},viewport:(t,e)=>t.viewport(...e)};function Ys(t,e,r){return e[t]!==void 0?e[t]:r[t]}var hz={blendEquation:(t,e,r)=>t.blendEquationSeparate(Ys(32777,e,r),Ys(34877,e,r)),blendFunc:(t,e,r)=>t.blendFuncSeparate(Ys(32969,e,r),Ys(32968,e,r),Ys(32971,e,r),Ys(32970,e,r)),polygonOffset:(t,e,r)=>t.polygonOffset(Ys(32824,e,r),Ys(10752,e,r)),sampleCoverage:(t,e,r)=>t.sampleCoverage(Ys(32938,e,r),Ys(32939,e,r)),stencilFuncFront:(t,e,r)=>t.stencilFuncSeparate(1028,Ys(2962,e,r),Ys(2967,e,r),Ys(2963,e,r)),stencilFuncBack:(t,e,r)=>t.stencilFuncSeparate(1029,Ys(34816,e,r),Ys(36003,e,r),Ys(36004,e,r)),stencilOpFront:(t,e,r)=>t.stencilOpSeparate(1028,Ys(2964,e,r),Ys(2965,e,r),Ys(2966,e,r)),stencilOpBack:(t,e,r)=>t.stencilOpSeparate(1029,Ys(34817,e,r),Ys(34818,e,r),Ys(34819,e,r))},P3={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,r)=>t({[e]:r}),hint:(t,e,r)=>t({[e]:r}),useProgram:(t,e)=>t({[35725]:e}),bindRenderbuffer:(t,e,r)=>t({[36007]:r}),bindTransformFeedback:(t,e,r)=>t({[36389]:r}),bindVertexArray:(t,e)=>t({[34229]:e}),bindFramebuffer:(t,e,r)=>{switch(e){case 36160:return t({[36006]:r,[36010]:r});case 36009:return t({[36006]:r});case 36008:return t({[36010]:r});default:return null}},bindBuffer:(t,e,r)=>{let i={[34962]:[34964],[36662]:[36662],[36663]:[36663],[35051]:[35053],[35052]:[35055]}[e];return i?t({[i]:r}):{valueChanged:!0}},blendColor:(t,e,r,i,n)=>t({[32773]:new Float32Array([e,r,i,n])}),blendEquation:(t,e)=>t({[32777]:e,[34877]:e}),blendEquationSeparate:(t,e,r)=>t({[32777]:e,[34877]:r}),blendFunc:(t,e,r)=>t({[32969]:e,[32968]:r,[32971]:e,[32970]:r}),blendFuncSeparate:(t,e,r,i,n)=>t({[32969]:e,[32968]:r,[32971]:i,[32970]:n}),clearColor:(t,e,r,i,n)=>t({[3106]:new Float32Array([e,r,i,n])}),clearDepth:(t,e)=>t({[2931]:e}),clearStencil:(t,e)=>t({[2961]:e}),colorMask:(t,e,r,i,n)=>t({[3107]:[e,r,i,n]}),cullFace:(t,e)=>t({[2885]:e}),depthFunc:(t,e)=>t({[2932]:e}),depthRange:(t,e,r)=>t({[2928]:new Float32Array([e,r])}),depthMask:(t,e)=>t({[2930]:e}),frontFace:(t,e)=>t({[2886]:e}),lineWidth:(t,e)=>t({[2849]:e}),polygonOffset:(t,e,r)=>t({[32824]:e,[10752]:r}),sampleCoverage:(t,e,r)=>t({[32938]:e,[32939]:r}),scissor:(t,e,r,i,n)=>t({[3088]:new Int32Array([e,r,i,n])}),stencilMask:(t,e)=>t({[2968]:e,[36005]:e}),stencilMaskSeparate:(t,e,r)=>t({[e===1028?2968:36005]:r}),stencilFunc:(t,e,r,i)=>t({[2962]:e,[2967]:r,[2963]:i,[34816]:e,[36003]:r,[36004]:i}),stencilFuncSeparate:(t,e,r,i,n)=>t({[e===1028?2962:34816]:r,[e===1028?2967:36003]:i,[e===1028?2963:36004]:n}),stencilOp:(t,e,r,i)=>t({[2964]:e,[2965]:r,[2966]:i,[34817]:e,[34818]:r,[34819]:i}),stencilOpSeparate:(t,e,r,i,n)=>t({[e===1028?2964:34817]:r,[e===1028?2965:34818]:i,[e===1028?2966:34819]:n}),viewport:(t,e,r,i,n)=>t({[2978]:[e,r,i,n]})},vh=(t,e)=>t.isEnabled(e),R3={[3042]:vh,[2884]:vh,[2929]:vh,[3024]:vh,[32823]:vh,[32926]:vh,[32928]:vh,[3089]:vh,[2960]:vh,[35977]:vh},pz=new Set([34016,36388,36387,35983,35368,34965,35739,35738,3074,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34866,34867,34868,35097,32873,35869,32874,34068]);function mf(t,e){if(ane(e))return;let r={};for(let n in e){let o=Number(n),s=fz[n];s&&(typeof s=="string"?r[s]=!0:s(t,e[n],o))}let i=t.state&&t.state.cache;if(i)for(let n in r){let o=hz[n];o(t,e,i)}}function J2(t,e=px){if(typeof e=="number"){let n=e,o=R3[n];return o?o(t,n):t.getParameter(n)}let r=Array.isArray(e)?e:Object.keys(e),i={};for(let n of r){let o=R3[n];i[n]=o?o(t,Number(n)):t.getParameter(Number(n))}return i}function dz(t){mf(t,px)}function ane(t){for(let e in t)return!1;return!0}function Az(t,e){if(t===e)return!0;let r=Array.isArray(t)||ArrayBuffer.isView(t),i=Array.isArray(e)||ArrayBuffer.isView(e);if(r&&i&&t.length===e.length){for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}return!1}var B3=class{gl;program=null;stateStack=[];enable=!0;cache;log;constructor(e,{copyState:r=!1,log:i=()=>{}}={}){this.gl=e,this.cache=r?J2(e):Object.assign({},px),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e={}){this.stateStack.push({})}pop(){Yi(this.stateStack.length>0);let e=this.stateStack[this.stateStack.length-1];mf(this.gl,e),this.stateStack.pop()}_updateCache(e){let r=!1,i,n=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(let o in e){Yi(o!==void 0);let s=e[o],l=this.cache[o];Az(s,l)||(r=!0,i=l,n&&!(o in n)&&(n[o]=l),this.cache[o]=s)}return{valueChanged:r,oldValue:i}}};function im(t){return t.state}function O3(t,e){let{enable:r=!0,copyState:i}=e;if(Yi(i!==void 0),!t.state){t.state=new B3(t,{copyState:i}),cne(t);for(let o in P3){let s=P3[o];lne(t,o,s)}mz(t,"getParameter"),mz(t,"isEnabled")}let n=im(t);return n.enable=r,t}function Md(t){let e=im(t);e||(O3(t,{copyState:!1}),e=im(t)),e.push()}function mp(t){let e=im(t);Yi(e),e.pop()}function mz(t,e){let r=t[e].bind(t);t[e]=function(n){if(n===void 0||pz.has(n))return r(n);let o=im(t);return n in o.cache||(o.cache[n]=r(n)),o.enable?o.cache[n]:r(n)},Object.defineProperty(t[e],"name",{value:`${e}-from-cache`,configurable:!1})}function lne(t,e,r){if(!t[e])return;let i=t[e].bind(t);t[e]=function(...o){let s=im(t),{valueChanged:l,oldValue:u}=r(s._updateCache,...o);return l&&i(...o),u},Object.defineProperty(t[e],"name",{value:`${e}-to-cache`,configurable:!1})}function cne(t){let e=t.useProgram.bind(t);t.useProgram=function(i){let n=im(t);n.program!==i&&(e(i),n.program=i)}}var une={powerPreference:"high-performance",onContextLost:()=>console.error("WebGL context lost"),onContextRestored:()=>console.info("WebGL context restored")};function gz(t,e){e={...une,...e};let r=null,i=o=>r=o.statusMessage||r;t.addEventListener("webglcontextcreationerror",i,!1);let n=null;if(n||=t.getContext("webgl2",e),t.removeEventListener("webglcontextcreationerror",i,!1),!n)throw new Error(`Failed to create WebGL context: ${r||"Unknown error"}`);if(e.onContextLost){let{onContextLost:o}=e;t.addEventListener("webglcontextlost",s=>o(s),!1)}if(e.onContextRestored){let{onContextRestored:o}=e;t.addEventListener("webglcontextrestored",s=>o(s),!1)}return n}function Mu(t,e,r){return r[e]===void 0&&(r[e]=t.getExtension(e)||null),r[e]}function _z(t,e){let r=t.getParameter(7936),i=t.getParameter(7937);Mu(t,"WEBGL_debug_renderer_info",e);let n=e.WEBGL_debug_renderer_info,o=t.getParameter(n?n.UNMASKED_VENDOR_WEBGL:7936),s=t.getParameter(n?n.UNMASKED_RENDERER_WEBGL:7937),l=o||r,u=s||i,h=t.getParameter(7938),v=yz(l,u),T=fne(l,u),E=hne(l,u);return{type:"webgl",gpu:v,gpuType:E,gpuBackend:T,vendor:l,renderer:u,version:h,shadingLanguage:"glsl",shadingLanguageVersion:300}}function yz(t,e){return/NVIDIA/i.exec(t)||/NVIDIA/i.exec(e)?"nvidia":/INTEL/i.exec(t)||/INTEL/i.exec(e)?"intel":/Apple/i.exec(t)||/Apple/i.exec(e)?"apple":/AMD/i.exec(t)||/AMD/i.exec(e)||/ATI/i.exec(t)||/ATI/i.exec(e)?"amd":/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e)?"software":"unknown"}function fne(t,e){return/Metal/i.exec(t)||/Metal/i.exec(e)?"metal":/ANGLE/i.exec(t)||/ANGLE/i.exec(e)?"opengl":"unknown"}function hne(t,e){if(/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e))return"cpu";switch(yz(t,e)){case"intel":return"integrated";case"software":return"cpu";case"unknown":return"unknown";default:return"discrete"}}function Q2(t){switch(t){case"uint8":return 5121;case"sint8":return 5120;case"unorm8":return 5121;case"snorm8":return 5120;case"uint16":return 5123;case"sint16":return 5122;case"unorm16":return 5123;case"snorm16":return 5122;case"uint32":return 5125;case"sint32":return 5124;case"float16":return 5131;case"float32":return 5126}throw new Error(String(t))}var Fl="texture-compression-bc",Ho="texture-compression-astc",xh="texture-compression-etc2",pne="texture-compression-etc1-webgl",$2="texture-compression-pvrtc-webgl",D3="texture-compression-atc-webgl",dx="float32-renderable-webgl",L3="float16-renderable-webgl",dne="rgb9e5ufloat_renderable-webgl",F3="snorm8-renderable-webgl",Ax="norm16-renderable-webgl",N3="snorm16-renderable-webgl",eT="float32-filterable",vz="float16-filterable-webgl",mx="WEBGL_compressed_texture_s3tc",gx="WEBGL_compressed_texture_s3tc_srgb",z0="EXT_texture_compression_rgtc",V0="EXT_texture_compression_bptc",Ane="WEBGL_compressed_texture_etc",mne="WEBGL_compressed_texture_astc",gne="WEBGL_compressed_texture_etc1",_ne="WEBGL_compressed_texture_pvrtc",yne="WEBGL_compressed_texture_atc",xz="EXT_texture_norm16",bz="EXT_render_snorm",vne="EXT_color_buffer_float",tT={"float32-renderable-webgl":["EXT_color_buffer_float"],"float16-renderable-webgl":["EXT_color_buffer_half_float"],"rgb9e5ufloat_renderable-webgl":["WEBGL_render_shared_exponent"],"snorm8-renderable-webgl":[bz],"norm16-renderable-webgl":[xz],"snorm16-renderable-webgl":[xz,bz],"float32-filterable":["OES_texture_float_linear"],"float16-filterable-webgl":["OES_texture_half_float_linear"],"texture-filterable-anisotropic-webgl":["EXT_texture_filter_anisotropic"],"texture-blend-float-webgl":["EXT_float_blend"],"texture-compression-bc":[mx,gx,z0,V0],"texture-compression-bc5-webgl":[z0],"texture-compression-bc7-webgl":[V0],"texture-compression-etc2":[Ane],"texture-compression-astc":[mne],"texture-compression-etc1-webgl":[gne],"texture-compression-pvrtc-webgl":[_ne],"texture-compression-atc-webgl":[yne]};function wz(t){return t in tT}function Tz(t,e,r){return(tT[e]||[]).every(n=>Mu(t,n,r))}var rT={"rgb8unorm-unsized":{gl:6407,b:4,c:2,bpp:4,dataFormat:6407,types:[5121,33635]},"rgba8unorm-unsized":{gl:6408,b:4,c:2,bpp:4,dataFormat:6408,types:[5121,32819,32820]},r8unorm:{gl:33321,b:1,c:1,rb:!0},r8snorm:{gl:36756,b:1,c:1,render:F3},r8uint:{gl:33330,b:1,c:1,rb:!0},r8sint:{gl:33329,b:1,c:1,rb:!0},rg8unorm:{gl:33323,b:2,c:2,rb:!0},rg8snorm:{gl:36757,b:2,c:2,render:F3},rg8uint:{gl:33336,b:2,c:2,rb:!0},rg8sint:{gl:33335,b:2,c:2,rb:!0},r16uint:{gl:33332,b:2,c:1,rb:!0},r16sint:{gl:33331,b:2,c:1,rb:!0},r16float:{gl:33325,b:2,c:1,render:L3,filter:"float16-filterable-webgl",rb:!0},"r16unorm-webgl":{gl:33322,b:2,c:1,f:Ax,rb:!0},"r16snorm-webgl":{gl:36760,b:2,c:1,f:N3},"rgba4unorm-webgl":{gl:32854,b:2,c:4,wgpu:!1,rb:!0},"rgb565unorm-webgl":{gl:36194,b:2,c:4,wgpu:!1,rb:!0},"rgb5a1unorm-webgl":{gl:32855,b:2,c:4,wgpu:!1,rb:!0},"rgb8unorm-webgl":{gl:32849,b:3,c:3,wgpu:!1},"rgb8snorm-webgl":{gl:36758,b:3,c:3,wgpu:!1},rgba8unorm:{gl:32856,b:4,c:2,bpp:4},"rgba8unorm-srgb":{gl:35907,b:4,c:4,bpp:4},rgba8snorm:{gl:36759,b:4,c:4,render:F3},rgba8uint:{gl:36220,b:4,c:4,bpp:4},rgba8sint:{gl:36238,b:4,c:4,bpp:4},bgra8unorm:{b:4,c:4},"bgra8unorm-srgb":{b:4,c:4},rg16uint:{gl:33338,b:4,c:1,bpp:4},rg16sint:{gl:33337,b:4,c:2,bpp:4},rg16float:{gl:33327,bpp:4,b:4,c:2,render:L3,filter:vz,rb:!0},"rg16unorm-webgl":{gl:33324,b:2,c:2,render:Ax},"rg16snorm-webgl":{gl:36761,b:2,c:2,render:N3},r32uint:{gl:33334,b:4,c:1,bpp:4,rb:!0},r32sint:{gl:33333,b:4,c:1,bpp:4,rb:!0},r32float:{gl:33326,bpp:4,b:4,c:1,render:dx,filter:eT},rgb9e5ufloat:{gl:35901,b:4,c:3,p:1,render:dne},rg11b10ufloat:{gl:35898,b:4,c:3,p:1,render:dx,rb:!0},rgb10a2unorm:{gl:32857,b:4,c:4,p:1,rb:!0},"rgb10a2uint-webgl":{b:4,c:4,gl:36975,p:1,wgpu:!1,bpp:4,rb:!0},"rgb16unorm-webgl":{gl:32852,b:2,c:3,f:Ax},"rgb16snorm-webgl":{gl:36762,b:2,c:3,f:Ax},rg32uint:{gl:33340,b:8,c:2,rb:!0},rg32sint:{gl:33339,b:8,c:2,rb:!0},rg32float:{gl:33328,b:8,c:2,render:dx,filter:eT,rb:!0},rgba16uint:{gl:36214,b:8,c:4,rb:!0},rgba16sint:{gl:36232,b:8,c:4,rb:!0},rgba16float:{gl:34842,b:8,c:4,render:L3,filter:vz},"rgba16unorm-webgl":{gl:32859,b:2,c:4,render:Ax,rb:!0},"rgba16snorm-webgl":{gl:36763,b:2,c:4,render:N3},"rgb32float-webgl":{gl:34837,render:dx,filter:eT,gl2ext:vne,dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,b:16,c:4,rb:!0},rgba32sint:{gl:36226,b:16,c:4,rb:!0},rgba32float:{gl:34836,b:16,c:4,render:dx,filter:eT,rb:!0},stencil8:{gl:36168,b:1,c:1,attachment:36128,rb:!0},depth16unorm:{gl:33189,b:2,c:1,attachment:36096,dataFormat:6402,types:[5123],rb:!0},depth24plus:{gl:33190,b:3,c:1,attachment:36096,dataFormat:6402,types:[5125]},depth32float:{gl:36012,b:4,c:1,attachment:36096,dataFormat:6402,types:[5126],rb:!0},"depth24plus-stencil8":{gl:35056,b:4,c:2,p:1,attachment:33306,rb:!0,depthTexture:!0,dataFormat:34041,types:[34042]},"depth24unorm-stencil8":{gl:35056,b:4,c:2,p:1,attachment:33306,dataFormat:34041,types:[34042],rb:!0},"depth32float-stencil8":{gl:36013,b:5,c:2,p:1,attachment:33306,dataFormat:34041,types:[36269],rb:!0},"bc1-rgb-unorm-webgl":{gl:33776,x:mx,f:Fl},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:gx,f:Fl},"bc1-rgba-unorm":{gl:33777,x:mx,f:Fl},"bc1-rgba-unorm-srgb":{gl:35916,x:gx,f:Fl},"bc2-rgba-unorm":{gl:33778,x:mx,f:Fl},"bc2-rgba-unorm-srgb":{gl:35918,x:gx,f:Fl},"bc3-rgba-unorm":{gl:33779,x:mx,f:Fl},"bc3-rgba-unorm-srgb":{gl:35919,x:gx,f:Fl},"bc4-r-unorm":{gl:36283,x:z0,f:Fl},"bc4-r-snorm":{gl:36284,x:z0,f:Fl},"bc5-rg-unorm":{gl:36285,x:z0,f:Fl},"bc5-rg-snorm":{gl:36286,x:z0,f:Fl},"bc6h-rgb-ufloat":{gl:36495,x:V0,f:Fl},"bc6h-rgb-float":{gl:36494,x:V0,f:Fl},"bc7-rgba-unorm":{gl:36492,x:V0,f:Fl},"bc7-rgba-unorm-srgb":{gl:36493,x:V0,f:Fl},"etc2-rgb8unorm":{gl:37492,f:xh},"etc2-rgb8unorm-srgb":{gl:37494,f:xh},"etc2-rgb8a1unorm":{gl:37496,f:xh},"etc2-rgb8a1unorm-srgb":{gl:37497,f:xh},"etc2-rgba8unorm":{gl:37493,f:xh},"etc2-rgba8unorm-srgb":{gl:37495,f:xh},"eac-r11unorm":{gl:37488,f:xh},"eac-r11snorm":{gl:37489,f:xh},"eac-rg11unorm":{gl:37490,f:xh},"eac-rg11snorm":{gl:37491,f:xh},"astc-4x4-unorm":{gl:37808,f:Ho},"astc-4x4-unorm-srgb":{gl:37840,f:Ho},"astc-5x4-unorm":{gl:37809,f:Ho},"astc-5x4-unorm-srgb":{gl:37841,f:Ho},"astc-5x5-unorm":{gl:37810,f:Ho},"astc-5x5-unorm-srgb":{gl:37842,f:Ho},"astc-6x5-unorm":{gl:37811,f:Ho},"astc-6x5-unorm-srgb":{gl:37843,f:Ho},"astc-6x6-unorm":{gl:37812,f:Ho},"astc-6x6-unorm-srgb":{gl:37844,f:Ho},"astc-8x5-unorm":{gl:37813,f:Ho},"astc-8x5-unorm-srgb":{gl:37845,f:Ho},"astc-8x6-unorm":{gl:37814,f:Ho},"astc-8x6-unorm-srgb":{gl:37846,f:Ho},"astc-8x8-unorm":{gl:37815,f:Ho},"astc-8x8-unorm-srgb":{gl:37847,f:Ho},"astc-10x5-unorm":{gl:37819,f:Ho},"astc-10x5-unorm-srgb":{gl:37851,f:Ho},"astc-10x6-unorm":{gl:37817,f:Ho},"astc-10x6-unorm-srgb":{gl:37849,f:Ho},"astc-10x8-unorm":{gl:37818,f:Ho},"astc-10x8-unorm-srgb":{gl:37850,f:Ho},"astc-10x10-unorm":{gl:37819,f:Ho},"astc-10x10-unorm-srgb":{gl:37851,f:Ho},"astc-12x10-unorm":{gl:37820,f:Ho},"astc-12x10-unorm-srgb":{gl:37852,f:Ho},"astc-12x12-unorm":{gl:37821,f:Ho},"astc-12x12-unorm-srgb":{gl:37853,f:Ho},"pvrtc-rgb4unorm-webgl":{gl:35840,f:$2},"pvrtc-rgba4unorm-webgl":{gl:35842,f:$2},"pvrtc-rbg2unorm-webgl":{gl:35841,f:$2},"pvrtc-rgba2unorm-webgl":{gl:35843,f:$2},"etc1-rbg-unorm-webgl":{gl:36196,f:pne},"atc-rgb-unorm-webgl":{gl:35986,f:D3},"atc-rgba-unorm-webgl":{gl:35986,f:D3},"atc-rgbai-unorm-webgl":{gl:34798,f:D3}},xne={[6403]:1,[36244]:1,[33319]:2,[33320]:2,[6407]:3,[36248]:3,[6408]:4,[36249]:4,[6402]:1,[34041]:1,[6406]:1,[6409]:1,[6410]:2},bne={[5126]:4,[5125]:4,[5124]:4,[5123]:2,[5122]:2,[5131]:2,[5120]:1,[5121]:1};function iT(t,e,r){let i=rT[e];if(!i||i.gl===void 0)return!1;let n=i.x||i.gl2ext;return n?Boolean(Mu(t,n,r)):!0}function k3(t){let r=rT[t]?.gl;if(r===void 0)throw new Error(`Unsupported texture format ${t}`);return r}function Ez(t,e,r){if(!iT(t,e,r)||e.startsWith("depth")||e.startsWith("stencil"))return!1;try{if(H2(e).signed)return!1}catch{return!1}return e.endsWith("32float")?Boolean(Mu(t,"OES_texture_float_linear, extensions",r)):e.endsWith("16float")?Boolean(Mu(t,"OES_texture_half_float_linear, extensions",r)):!0}function Sz(t,e,r){return!(!iT(t,e,r)||typeof e=="number")}function j0(t){let e=rT[t],r=k3(t),i=H2(t);return{format:r,dataFormat:e?.dataFormat||wne(i.format,i.integer,i.normalized,r),type:i.dataType?Q2(i.dataType):e?.types?.[0]||5121,compressed:i.compressed}}function Cz(t){let e=rT[t];if(!e?.attachment)throw new Error(`${t} is not a depth stencil format`);return e.attachment}function U3(t){let e=j0(t),r=xne[e.dataFormat]||4,i=bne[e.type]||1;return r*i}function wne(t,e,r,i){if(i===6408||i===6407)return i;switch(t){case"r":return e&&!r?36244:6403;case"rg":return e&&!r?33320:33319;case"rgb":return e&&!r?36248:6407;case"rgba":return e&&!r?36249:6408;default:return 6408}}var Mz={"depth-clip-control":"EXT_depth_clamp","timer-query-webgl":"EXT_disjoint_timer_query_webgl2","compilation-status-async-webgl":"KHR_parallel_shader_compile","polygon-mode-webgl":"WEBGL_polygon_mode","provoking-vertex-webgl":"WEBGL_provoking_vertex","shader-clip-cull-distance-webgl":"WEBGL_clip_cull_distance","shader-noperspective-interpolation-webgl":"NV_shader_noperspective_interpolation","shader-conservative-depth-webgl":"EXT_conservative_depth"},nT=class extends ox{gl;extensions;testedFeatures=new Set;constructor(e,r,i){super([],i),this.gl=e,this.extensions=r,Mu(e,"EXT_color_buffer_float",r)}*[Symbol.iterator](){let e=this.getFeatures();for(let r of e)this.has(r)&&(yield r);return[]}has(e){return this.disabledFeatures[e]?!1:(this.testedFeatures.has(e)||(this.testedFeatures.add(e),wz(e)&&Tz(this.gl,e,this.extensions)&&this.features.add(e),this.getWebGLFeature(e)&&this.features.add(e)),this.features.has(e))}initializeFeatures(){let e=this.getFeatures().filter(r=>r!=="polygon-mode-webgl");for(let r of e)this.has(r)}getFeatures(){return[...Object.keys(Mz),...Object.keys(tT)]}getWebGLFeature(e){let r=Mz[e];return Boolean(typeof r=="string"?Mu(this.gl,r,this.extensions):r)}};var oT=class extends nx{get maxTextureDimension1D(){return 0}get maxTextureDimension2D(){return this.getParameter(3379)}get maxTextureDimension3D(){return this.getParameter(32883)}get maxTextureArrayLayers(){return this.getParameter(35071)}get maxBindGroups(){return 0}get maxDynamicUniformBuffersPerPipelineLayout(){return 0}get maxDynamicStorageBuffersPerPipelineLayout(){return 0}get maxSampledTexturesPerShaderStage(){return this.getParameter(35660)}get maxSamplersPerShaderStage(){return this.getParameter(35661)}get maxStorageBuffersPerShaderStage(){return 0}get maxStorageTexturesPerShaderStage(){return 0}get maxUniformBuffersPerShaderStage(){return this.getParameter(35375)}get maxUniformBufferBindingSize(){return this.getParameter(35376)}get maxStorageBufferBindingSize(){return 0}get minUniformBufferOffsetAlignment(){return this.getParameter(35380)}get minStorageBufferOffsetAlignment(){return 0}get maxVertexBuffers(){return 16}get maxVertexAttributes(){return this.getParameter(34921)}get maxVertexBufferArrayStride(){return 2048}get maxInterStageShaderComponents(){return this.getParameter(35659)}get maxComputeWorkgroupStorageSize(){return 0}get maxComputeInvocationsPerWorkgroup(){return 0}get maxComputeWorkgroupSizeX(){return 0}get maxComputeWorkgroupSizeY(){return 0}get maxComputeWorkgroupSizeZ(){return 0}get maxComputeWorkgroupsPerDimension(){return 0}gl;limits={};constructor(e){super(),this.gl=e}getParameter(e){return this.limits[e]===void 0&&(this.limits[e]=this.gl.getParameter(e)),this.limits[e]}};function Iu(t,e,r){if(Tne(e))return r(t);let{nocatch:i=!0}=e;Md(t),mf(t,e);let n;if(i)n=r(t),mp(t);else try{n=r(t)}finally{mp(t)}return n}function Tne(t){for(let e in t)return!1;return!0}function Pz(t,e,r,i){if(wd(e))return i(t);let n=t;Md(n.gl);try{return Ene(t,e),mf(n.gl,r),i(t)}finally{mp(n.gl)}}function Ene(t,e){let r=t,{gl:i}=r;if(e.cullMode)switch(e.cullMode){case"none":i.disable(2884);break;case"front":i.enable(2884),i.cullFace(1028);break;case"back":i.enable(2884),i.cullFace(1029);break}if(e.frontFace&&i.frontFace(nm("frontFace",e.frontFace,{ccw:2305,cw:2304})),e.unclippedDepth&&t.features.has("depth-clip-control")&&i.enable(34383),e.depthBias!==void 0&&(i.enable(32823),i.polygonOffset(e.depthBias,e.depthBiasSlopeScale||0)),e.provokingVertex&&t.features.has("provoking-vertex-webgl")){let o=r.getExtension("WEBGL_provoking_vertex").WEBGL_provoking_vertex,s=nm("provokingVertex",e.provokingVertex,{first:36429,last:36430});o?.provokingVertexWEBGL(s)}if((e.polygonMode||e.polygonOffsetLine)&&t.features.has("polygon-mode-webgl")){if(e.polygonMode){let o=r.getExtension("WEBGL_polygon_mode").WEBGL_polygon_mode,s=nm("polygonMode",e.polygonMode,{fill:6914,line:6913});o?.polygonModeWEBGL(1028,s),o?.polygonModeWEBGL(1029,s)}e.polygonOffsetLine&&i.enable(10754)}if(t.features.has("shader-clip-cull-distance-webgl")&&(e.clipDistance0&&i.enable(12288),e.clipDistance1&&i.enable(12289),e.clipDistance2&&i.enable(12290),e.clipDistance3&&i.enable(12291),e.clipDistance4&&i.enable(12292),e.clipDistance5&&i.enable(12293),e.clipDistance6&&i.enable(12294),e.clipDistance7&&i.enable(12295)),e.depthWriteEnabled!==void 0&&i.depthMask(Cne("depthWriteEnabled",e.depthWriteEnabled)),e.depthCompare&&(e.depthCompare!=="always"?i.enable(2929):i.disable(2929),i.depthFunc(aT("depthCompare",e.depthCompare))),e.stencilWriteMask){let n=e.stencilWriteMask;i.stencilMaskSeparate(1028,n),i.stencilMaskSeparate(1029,n)}if(e.stencilReadMask&&Kt.warn("stencilReadMask not supported under WebGL"),e.stencilCompare){let n=e.stencilReadMask||4294967295,o=aT("depthCompare",e.stencilCompare);e.stencilCompare!=="always"?i.enable(2960):i.disable(2960),i.stencilFuncSeparate(1028,o,0,n),i.stencilFuncSeparate(1029,o,0,n)}if(e.stencilPassOperation&&e.stencilFailOperation&&e.stencilDepthFailOperation){let n=z3("stencilPassOperation",e.stencilPassOperation),o=z3("stencilFailOperation",e.stencilFailOperation),s=z3("stencilDepthFailOperation",e.stencilDepthFailOperation);i.stencilOpSeparate(1028,o,s,n),i.stencilOpSeparate(1029,o,s,n)}if(e.blendColorOperation||e.blendAlphaOperation){i.enable(3042);let n=Iz("blendColorOperation",e.blendColorOperation||"add"),o=Iz("blendAlphaOperation",e.blendAlphaOperation||"add");i.blendEquationSeparate(n,o);let s=sT("blendColorSrcFactor",e.blendColorSrcFactor||"one"),l=sT("blendColorDstFactor",e.blendColorDstFactor||"zero"),u=sT("blendAlphaSrcFactor",e.blendAlphaSrcFactor||"one"),h=sT("blendAlphaDstFactor",e.blendAlphaDstFactor||"zero");i.blendFuncSeparate(s,l,u,h)}}function aT(t,e){return nm(t,e,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function z3(t,e){return nm(t,e,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function Iz(t,e){return nm(t,e,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function sT(t,e){return nm(t,e,{one:1,zero:0,"src-color":768,"one-minus-src-color":769,"dst-color":774,"one-minus-dst-color":775,"src-alpha":770,"one-minus-src-alpha":771,"dst-alpha":772,"one-minus-dst-alpha":773,"src-alpha-saturated":776,"constant-color":32769,"one-minus-constant-color":32770,"constant-alpha":32771,"one-minus-constant-alpha":32772})}function Sne(t,e){return`Illegal parameter ${e} for ${t}`}function nm(t,e,r){if(!(e in r))throw new Error(Sne(t,e));return r[e]}function Cne(t,e){return e}function lT(t){let e={};return t.addressModeU&&(e[10242]=V3(t.addressModeU)),t.addressModeV&&(e[10243]=V3(t.addressModeV)),t.addressModeW&&(e[32882]=V3(t.addressModeW)),t.magFilter&&(e[10240]=Rz(t.magFilter)),(t.minFilter||t.mipmapFilter)&&(e[10241]=Mne(t.minFilter||"linear",t.mipmapFilter)),t.lodMinClamp!==void 0&&(e[33082]=t.lodMinClamp),t.lodMaxClamp!==void 0&&(e[33083]=t.lodMaxClamp),t.type==="comparison-sampler"&&(e[34892]=34894),t.compare&&(e[34893]=aT("compare",t.compare)),t.maxAnisotropy&&(e[34046]=t.maxAnisotropy),e}function V3(t){switch(t){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function Rz(t){switch(t){case"nearest":return 9728;case"linear":return 9729}}function Mne(t,e){if(!e)return Rz(t);switch(t){case"nearest":return e==="nearest"?9984:9986;case"linear":return e==="nearest"?9985:9987}}var $l=class extends Xi{device;gl;handle;glTarget;glUsage;glIndexType=5123;byteLength;bytesUsed;constructor(e,r={}){super(e,r),this.device=e,this.gl=this.device.gl;let i=typeof r=="object"?r.handle:void 0;this.handle=i||this.gl.createBuffer(),e.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glTarget=Ine(this.props.usage),this.glUsage=Pne(this.props.usage),this.glIndexType=this.props.indexType==="uint32"?5125:5123,r.data?this._initWithData(r.data,r.byteOffset,r.byteLength):this._initWithByteLength(r.byteLength||0)}_initWithData(e,r=0,i=e.byteLength+r){let n=this.glTarget;this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,i,this.glUsage),this.gl.bufferSubData(n,r,e),this.gl.bindBuffer(n,null),this.bytesUsed=i,this.byteLength=i,this._setDebugData(e,r,i),this.trackAllocatedMemory(i)}_initWithByteLength(e){Yi(e>=0);let r=e;e===0&&(r=new Float32Array(0));let i=this.glTarget;return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,r,this.glUsage),this.gl.bindBuffer(i,null),this.bytesUsed=e,this.byteLength=e,this._setDebugData(null,0,e),this.trackAllocatedMemory(e),this}destroy(){!this.destroyed&&this.handle&&(this.removeStats(),this.trackDeallocatedMemory(),this.gl.deleteBuffer(this.handle),this.destroyed=!0,this.handle=null)}write(e,r=0){this.gl.bindBuffer(36663,this.handle),this.gl.bufferSubData(36663,r,e),this.gl.bindBuffer(36663,null),this._setDebugData(e,r,e.byteLength)}async readAsync(e=0,r){return this.readSyncWebGL(e,r)}readSyncWebGL(e=0,r){r=r??this.byteLength-e;let i=new Uint8Array(r),n=0;return this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,e,i,n,r),this.gl.bindBuffer(36662,null),this._setDebugData(i,e,r),i}};function Ine(t){return t&Xi.INDEX?34963:t&Xi.VERTEX?34962:t&Xi.UNIFORM?35345:34962}function Pne(t){return t&Xi.INDEX||t&Xi.VERTEX?35044:t&Xi.UNIFORM?35048:35044}var om=class extends Cd{device;handle;parameters;constructor(e,r){super(e,r),this.device=e,this.parameters=lT(r),this.handle=this.handle||this.device.gl.createSampler(),this._setSamplerParameters(this.parameters)}destroy(){this.handle&&(this.device.gl.deleteSampler(this.handle),this.handle=void 0)}toString(){return`Sampler(${this.id},${JSON.stringify(this.props)})`}_setSamplerParameters(e){for(let[r,i]of Object.entries(e)){let n=Number(r);switch(n){case 33082:case 33083:this.device.gl.samplerParameterf(this.handle,n,i);break;default:this.device.gl.samplerParameteri(this.handle,n,i);break}}}};var gf=class extends Ed{device;gl;handle;texture;constructor(e,r){super(e,{...bo.defaultProps,...r}),this.device=e,this.gl=this.device.gl,this.handle=null,this.texture=r.texture}};var Rne={parameters:{},pixelStore:{},pixels:null,border:0,dataFormat:void 0,textureUnit:void 0,target:void 0},cT=class extends bo{MAX_ATTRIBUTES;device;gl;handle;sampler=void 0;view=void 0;glFormat=void 0;type=void 0;dataFormat=void 0;mipmaps=void 0;target;textureUnit=void 0;loaded=!1;_video;constructor(e,r){super(e,{...Rne,format:"rgba8unorm",...r}),this.device=e,this.gl=this.device.gl,this.handle=this.props.handle||this.gl.createTexture(),this.device.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glFormat=6408,this.target=Bne(this.props),this.loaded=!1,typeof this.props?.data=="string"&&Object.assign(this.props,{data:S3(this.props.data)}),this.initialize(this.props),Object.seal(this)}destroy(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)}toString(){return`Texture(${this.id},${this.width}x${this.height})`}createView(e){return new gf(this.device,{...e,texture:this})}initialize(e={}){if(this.props.dimension==="cube")return this.initializeCube(e);let r=e.data;if(r instanceof Promise)return r.then(z=>this.initialize(Object.assign({},e,{pixels:z,data:z}))),this;let i=typeof HTMLVideoElement<"u"&&r instanceof HTMLVideoElement;if(i&&r.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,r.addEventListener("loadeddata",()=>this.initialize(e)),this;let{parameters:n={}}=e,{pixels:o=null,pixelStore:s={},textureUnit:l=void 0,mipmaps:u=!0}=e;r||(r=o);let{width:h,height:v,dataFormat:T,type:E,compressed:M=!1}=e,{depth:O=0}=e,F=k3(e.format);return{width:h,height:v,compressed:M,dataFormat:T,type:E}=this._deduceParameters({format:e.format,type:E,dataFormat:T,compressed:M,data:r,width:h,height:v}),this.width=h,this.height=v,this.glFormat=F,this.type=E,this.dataFormat=T,this.textureUnit=l,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),this.mipmaps=u,this.setImageData({data:r,width:h,height:v,depth:O,format:F,type:E,dataFormat:T,parameters:s,compressed:M}),this.setSampler(e.sampler),this._setSamplerParameters(n),this.view=this.createView({...this.props,mipLevelCount:1,arrayLayerCount:1}),u&&this.device.isTextureFormatFilterable(e.format)&&this.generateMipmap(),i&&(this._video={video:r,parameters:n,lastTime:r.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?r.currentTime:-1}),this}initializeCube(e){let{mipmaps:r=!0,parameters:i={}}=e;return this.setCubeMapImageData(e).then(()=>{this.loaded=!0,r&&this.generateMipmap(e),this.setSampler(e.sampler),this._setSamplerParameters(i)}),this}setSampler(e={}){let r;e instanceof om?(this.sampler=e,r=e.props):(this.sampler=new om(this.device,e),r=e);let i=lT(r);return this._setSamplerParameters(i),this}resize(e){let{height:r,width:i,mipmaps:n=!1}=e;return i!==this.width||r!==this.height?this.initialize({width:i,height:r,format:this.format,type:this.type,dataFormat:this.dataFormat,mipmaps:n}):this}update(){if(this._video){let{video:e,parameters:r,lastTime:i}=this._video;if(i===e.currentTime||e.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:e,parameters:r}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=e.currentTime}}generateMipmap(e={}){return this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Iu(this.gl,e,()=>{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this}setImageData(e){if(this.props.dimension==="3d"||this.props.dimension==="2d-array")return this.setImageData3D(e);this.trackDeallocatedMemory("Texture");let{target:r=this.target,pixels:i=null,level:n=0,glFormat:o=this.glFormat,offset:s=0,parameters:l={}}=e,{data:u=null,type:h=this.type,width:v=this.width,height:T=this.height,dataFormat:E=this.dataFormat,compressed:M=!1}=e;u||(u=i),{type:h,dataFormat:E,compressed:M,width:v,height:T}=this._deduceParameters({format:this.props.format,type:h,dataFormat:E,compressed:M,data:u,width:v,height:T});let{gl:O}=this;O.bindTexture(this.target,this.handle);let F=null;if({data:u,dataType:F}=this._getDataType({data:u,compressed:M}),Iu(this.gl,l,()=>{switch(F){case"null":O.texImage2D(r,n,o,v,T,0,E,h,u);break;case"typed-array":O.texImage2D(r,n,o,v,T,0,E,h,u,s);break;case"buffer":this.device.gl.bindBuffer(35052,u.handle||u),this.device.gl.texImage2D(r,n,o,v,T,0,E,h,s),this.device.gl.bindBuffer(35052,null);break;case"browser-object":O.texImage2D(r,n,o,v,T,0,E,h,u);break;case"compressed":for(let[z,W]of u.entries())O.compressedTexImage2D(r,z,W.format,W.width,W.height,0,W.data);break;default:Yi(!1,"Unknown image data type")}}),u&&u.byteLength)this.trackAllocatedMemory(u.byteLength,"Texture");else{let z=U3(this.props.format);this.trackAllocatedMemory(this.width*this.height*z,"Texture")}return this.loaded=!0,this}setSubImageData({target:e=this.target,pixels:r=null,data:i=null,x:n=0,y:o=0,width:s=this.width,height:l=this.height,level:u=0,glFormat:h=this.glFormat,type:v=this.type,dataFormat:T=this.dataFormat,compressed:E=!1,offset:M=0,parameters:O={}}){if({type:v,dataFormat:T,compressed:E,width:s,height:l}=this._deduceParameters({format:this.props.format,type:v,dataFormat:T,compressed:E,data:i,width:s,height:l}),Yi(this.depth===1,"texSubImage not supported for 3D textures"),i||(i=r),i&&i.data){let F=i;i=F.data,s=F.shape[0],l=F.shape[1]}i instanceof $l&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),Iu(this.gl,O,()=>{E?this.gl.compressedTexSubImage2D(e,u,n,o,s,l,h,i):i===null?this.gl.texSubImage2D(e,u,n,o,s,l,T,v,null):ArrayBuffer.isView(i)?this.gl.texSubImage2D(e,u,n,o,s,l,T,v,i,M):typeof WebGLBuffer<"u"&&i instanceof WebGLBuffer?(this.device.gl.bindBuffer(35052,i),this.device.gl.texSubImage2D(e,u,n,o,s,l,T,v,M),this.device.gl.bindBuffer(35052,null)):this.device.gl.texSubImage2D(e,u,n,o,s,l,T,v,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e={}){return Kt.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){let{gl:r}=this;return e!==void 0&&(this.textureUnit=e,r.activeTexture(33984+e)),r.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){let{gl:r}=this;return e!==void 0&&(this.textureUnit=e,r.activeTexture(33984+e)),r.bindTexture(this.target,null),e}_getDataType({data:e,compressed:r=!1}){return r?{data:e,dataType:"compressed"}:e===null?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof $l?{data:e.handle,dataType:"buffer"}:typeof WebGLBuffer<"u"&&e instanceof WebGLBuffer?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){let{format:r,data:i}=e,{width:n,height:o,dataFormat:s,type:l,compressed:u}=e,h=j0(r);return s=s||h.dataFormat,l=l||h.type,u=u||h.compressed,{width:n,height:o}=this._deduceImageSize(i,n,o),{dataFormat:s,type:l,compressed:u,width:n,height:o,format:r,data:i}}_deduceImageSize(e,r,i){let n;return typeof ImageData<"u"&&e instanceof ImageData?n={width:e.width,height:e.height}:typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement?n={width:e.naturalWidth,height:e.naturalHeight}:typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement?n={width:e.width,height:e.height}:typeof ImageBitmap<"u"&&e instanceof ImageBitmap?n={width:e.width,height:e.height}:typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement?n={width:e.videoWidth,height:e.videoHeight}:e?n={width:r,height:i}:n={width:r>=0?r:1,height:i>=0?i:1},Yi(n,"Could not deduced texture size"),Yi(r===void 0||n.width===r,"Deduced texture width does not match supplied width"),Yi(i===void 0||n.height===i,"Deduced texture height does not match supplied height"),n}async setCubeMapImageData(e){let{gl:r}=this,{width:i,height:n,pixels:o,data:s,format:l=6408,type:u=5121}=e,h=o||s,v=await Promise.all(cT.FACES.map(T=>{let E=h[T];return Promise.all(Array.isArray(E)?E:[E])}));this.bind(),cT.FACES.forEach((T,E)=>{v[E].length>1&&this.props.mipmaps!==!1&&Kt.warn(`${this.id} has mipmap and multiple LODs.`)(),v[E].forEach((M,O)=>{i&&n?r.texImage2D(T,O,l,i,n,0,l,u,M):r.texImage2D(T,O,l,l,u,M)})}),this.unbind()}setImageDataForFace(e){let{face:r,width:i,height:n,pixels:o,data:s,format:l=6408,type:u=5121}=e,{gl:h}=this,v=o||s;return this.bind(),v instanceof Promise?v.then(T=>this.setImageDataForFace(Object.assign({},e,{face:r,data:T,pixels:T}))):this.width||this.height?h.texImage2D(r,0,l,i,n,0,l,u,v):h.texImage2D(r,0,l,l,u,v),this}setImageData3D(e){let{level:r=0,dataFormat:i,format:n,type:o,width:s,height:l,depth:u=1,offset:h=0,data:v,parameters:T={}}=e;this.trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle);let E=j0(n);if(Iu(this.gl,T,()=>{ArrayBuffer.isView(v)&&this.gl.texImage3D(this.target,r,E.format,s,l,u,0,E.dataFormat,E.type,v),v instanceof $l&&(this.gl.bindBuffer(35052,v.handle),this.gl.texImage3D(this.target,r,i,s,l,u,0,n,o,h))}),v&&v.byteLength)this.trackAllocatedMemory(v.byteLength,"Texture");else{let M=U3(this.props.format);this.trackAllocatedMemory(this.width*this.height*this.depth*M,"Texture")}return this.loaded=!0,this}_setSamplerParameters(e){if(!wd(e)){One(e),this.gl.bindTexture(this.target,this.handle);for(let[r,i]of Object.entries(e)){let n=Number(r),o=i;switch(n){case 33082:case 33083:this.gl.texParameterf(this.target,n,o);break;default:this.gl.texParameteri(this.target,n,o);break}}this.gl.bindTexture(this.target,null)}}},ec=cT;Yr(ec,"FACES",[34069,34070,34071,34072,34073,34074]);function Bne(t){switch(t.dimension){case"2d":return 3553;case"cube":return 34067;case"2d-array":return 35866;case"3d":return 32879;case"1d":case"cube-array":default:throw new Error(t.dimension)}}function One(t){Kt.log(1,"texture sampler parameters",t)()}var bh=class extends _h{device;gl;handle;get texture(){return this.colorAttachments[0]}constructor(e,r){super(e,r);let i=r.handle===null;if(this.device=e,this.gl=e.gl,this.handle=this.props.handle||i?this.props.handle:this.gl.createFramebuffer(),!i){e.setSpectorMetadata(this.handle,{id:this.props.id,props:this.props}),this.autoCreateAttachmentTextures();let n=this.gl.bindFramebuffer(36160,this.handle);for(let o=0;o<this.colorAttachments.length;++o){let s=this.colorAttachments[o],l=36064+o;s&&this._attachOne(l,s)}if(this.depthStencilAttachment&&this._attachOne(Cz(this.depthStencilAttachment.props.format),this.depthStencilAttachment),r.check!==!1){let o=this.gl.checkFramebufferStatus(36160);if(o!==36053)throw new Error(`Framebuffer ${Lne(o)}`)}this.gl.bindFramebuffer(36160,n)}}destroy(){super.destroy(),!this.destroyed&&this.handle!==null&&this.gl.deleteFramebuffer(this.handle)}createDepthStencilTexture(e){return new ec(this.device,{id:`${this.id}-depth-stencil`,format:e,width:this.width,height:this.height,mipmaps:!1})}resizeAttachments(e,r){if(this.handle===null)return this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;e===void 0&&(e=this.gl.drawingBufferWidth),r===void 0&&(r=this.gl.drawingBufferHeight);for(let i of this.colorAttachments)i.texture.resize({width:e,height:r});return this.depthStencilAttachment&&this.depthStencilAttachment.texture.resize({width:e,height:r}),this}_attachOne(e,r){if(Array.isArray(r)){let[i,n=0,o=0]=r;return this._attachTexture(e,i,n,o),i}if(r instanceof ec)return this._attachTexture(e,r,0,0),r;if(r instanceof gf){let i=r;return this._attachTexture(e,i.texture,i.props.baseMipLevel,i.props.baseArrayLayer),r.texture}throw new Error("attach")}_attachTexture(e,r,i,n){let{gl:o}=this.device;switch(o.bindTexture(r.target,r.handle),r.target){case 35866:case 32879:o.framebufferTextureLayer(36160,e,r.target,n,i);break;case 34067:let s=Dne(i);o.framebufferTexture2D(36160,e,s,r.handle,n);break;case 3553:o.framebufferTexture2D(36160,e,3553,r.handle,n);break;default:Yi(!1,"Illegal texture type")}o.bindTexture(r.target,null)}};function Dne(t){return t<34069?t+34069:t}function Lne(t){switch(t){case 36053:return"success";case 36054:return"Mismatched attachments";case 36055:return"No attachments";case 36057:return"Height/width mismatch";case 36061:return"Unsupported or split attachments";case 36182:return"Samples mismatch";default:return`${t}`}}var uT=class extends Td{device;presentationSize;_framebuffer=null;constructor(e,r){super(r),this.device=e,this.presentationSize=[-1,-1],this._setAutoCreatedCanvasId(`${this.device.id}-canvas`),this.update()}getCurrentFramebuffer(){return this.update(),this._framebuffer=this._framebuffer||new bh(this.device,{handle:null}),this._framebuffer}update(){let e=this.getPixelSize();(e[0]!==this.presentationSize[0]||e[1]!==this.presentationSize[1])&&(this.presentationSize=e,this.resize())}resize(e){if(this.device.gl&&this.canvas){let r=this.getDevicePixelRatio(e?.useDevicePixels);this.setDevicePixelRatio(r,e);return}}commit(){}};var Fne={spector:Kt.get("spector")||Kt.get("spectorjs")},Nne="https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",kne=1,wc=null,Bz=!1;async function Oz(t){if(!globalThis.SPECTOR)try{await ux(Nne)}catch(e){Kt.warn(String(e))}}function Dz(t){if(t={...Fne,...t},!t?.spector||(!wc&&globalThis.SPECTOR&&(Kt.probe(kne,"SPECTOR found and initialized")(),wc=new globalThis.SPECTOR.Spector,globalThis.luma&&(globalThis.luma.spector=wc)),!wc))return null;if(Bz||(Bz=!0,wc.spyCanvases(),wc?.onCaptureStarted.add(e=>Kt.info("Spector capture started:",e)()),wc?.onCapture.add(e=>{Kt.info("Spector capture complete:",e)(),wc?.getResultUI(),wc?.resultView.display(),wc?.resultView.addCapture(e)})),t?.canvas){if(typeof t.spector=="string"&&t.spector!==t.canvas.id)return wc;wc?.startCapture(t?.canvas,500),new Promise(e=>setTimeout(e,2e3)).then(e=>{Kt.info("Spector capture stopped after 2 seconds")(),wc?.stopCapture()})}return wc}var Une="https://unpkg.com/webgl-debug@2.0.1/index.js";function Lz(t){return t.luma=t.luma||{},t.luma}async function Fz(){Ol()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await ux(Une))}function Nz(t,e={}){return t?e.debug?Vne(t,e):zne(t):null}function zne(t){let e=Lz(t);return e.realContext?e.realContext:t}function Vne(t,e){if(!globalThis.WebGLDebugUtils)return Kt.warn("webgl-debug not loaded")(),t;let r=Lz(t);if(r.debugContext)return r.debugContext;globalThis.WebGLDebugUtils.init({...yh,...t});let i=globalThis.WebGLDebugUtils.makeDebugContext(t,jne.bind(null,e),Hne.bind(null,e));for(let s in yh)!(s in i)&&typeof yh[s]=="number"&&(i[s]=yh[s]);class n{}Object.setPrototypeOf(i,Object.getPrototypeOf(t)),Object.setPrototypeOf(n,i);let o=Object.create(n);return r.realContext=t,r.debugContext=o,o.debug=!0,o}function j3(t,e){e=Array.from(e).map(i=>i===void 0?"undefined":i);let r=globalThis.WebGLDebugUtils.glFunctionArgsToString(t,e);return r=`${r.slice(0,100)}${r.length>100?"...":""}`,`gl.${t}(${r})`}function jne(t,e,r,i){i=Array.from(i).map(l=>l===void 0?"undefined":l);let n=globalThis.WebGLDebugUtils.glEnumToString(e),o=globalThis.WebGLDebugUtils.glFunctionArgsToString(r,i),s=`${n} in gl.${r}(${o})`;Kt.error(s)();debugger;if(t.throwOnError)throw new Error(s)}function Hne(t,e,r){let i="";if(Kt.level>=1&&(i=j3(e,r),Kt.log(1,i)()),t.break&&t.break.length>0&&(i=i||j3(e,r),t.break.every(o=>i.indexOf(o)!==-1)))debugger;for(let n of r)if(n===void 0){if(i=i||j3(e,r),t.throwOnError)throw new Error(`Undefined argument: ${i}`);Kt.error(`Undefined argument: ${i}`)();debugger}}function Uz(t){let e=t.split(/\r?\n/),r=[];for(let i of e){if(i.length<=1)continue;let n=i.split(":");if(n.length===2){let[T,E]=n;r.push({message:E.trim(),type:kz(T),lineNum:0,linePos:0});continue}let[o,s,l,...u]=n,h=parseInt(l,10);isNaN(h)&&(h=0);let v=parseInt(s,10);isNaN(v)&&(v=0),r.push({message:u.join(":").trim(),type:kz(o),lineNum:h,linePos:v})}return r}function kz(t){let e=["warning","error","info"],r=t.toLowerCase();return e.includes(r)?r:"info"}var fT=class extends Sd{device;handle;constructor(e,r){switch(super(e,r),this.device=e,this.props.stage){case"vertex":this.handle=this.props.handle||this.device.gl.createShader(35633);break;case"fragment":this.handle=this.props.handle||this.device.gl.createShader(35632);break;default:throw new Error(this.props.stage)}this._compile(this.source)}destroy(){this.handle&&(this.removeStats(),this.device.gl.deleteShader(this.handle),this.destroyed=!0)}async getCompilationInfo(){return await this._waitForCompilationComplete(),this.getCompilationInfoSync()}getCompilationInfoSync(){let e=this.device.gl.getShaderInfoLog(this.handle);return Uz(e)}getTranslatedSource(){return this.device.getExtension("WEBGL_debug_shaders").WEBGL_debug_shaders?.getTranslatedShaderSource(this.handle)}async _compile(e){e=(n=>n.startsWith("#version ")?n:`#version 100
553
- ${n}`)(e);let{gl:i}=this.device;if(i.shaderSource(this.handle,e),i.compileShader(this.handle),Kt.level===0){this.compilationStatus="pending";return}if(!this.device.features.has("compilation-status-async-webgl")){if(this._getCompilationStatus(),this.debugShader(),this.compilationStatus==="error")throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`);return}Kt.once(1,"Shader compilation is asynchronous")(),await this._waitForCompilationComplete(),Kt.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader()}async _waitForCompilationComplete(){let e=async n=>await new Promise(o=>setTimeout(o,n));if(!this.device.features.has("compilation-status-async-webgl")){await e(10);return}let{gl:i}=this.device;for(;;){if(i.getShaderParameter(this.handle,37297))return;await e(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?"success":"error"}};var Gne=256,Wne=1024,qne=16384,H3=6144,Xne=[1,2,4,8],hT=class extends D0{device;glParameters;constructor(e,r){super(e,r),this.device=e,Md(this.device.gl),this.setParameters(this.props.parameters),this.clear()}end(){mp(this.device.gl)}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}setParameters(e={}){let r={...this.glParameters};this.props.framebuffer&&(r.framebuffer=this.props.framebuffer),this.props.depthReadOnly&&(r.depthMask=!this.props.depthReadOnly),r.stencilMask=this.props.stencilReadOnly?0:1,r[35977]=this.props.discard,e.viewport&&(e.viewport.length>=6?(r.viewport=e.viewport.slice(0,4),r.depthRange=[e.viewport[4],e.viewport[5]]):r.viewport=e.viewport),e.scissorRect&&(r.scissorTest=!0,r.scissor=e.scissorRect),e.blendConstant&&(r.blendColor=e.blendConstant),e.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),e[2967]=e.stencilReference),e.colorMask&&(r.colorMask=Xne.map(i=>Boolean(i&e.colorMask))),this.glParameters=r,mf(this.device.gl,r)}beginOcclusionQuery(e){this.props.occlusionQuerySet?.beginOcclusionQuery()}endOcclusionQuery(){this.props.occlusionQuerySet?.endOcclusionQuery()}clear(){let e={...this.glParameters},r=0;this.props.clearColor!==!1&&(r|=qne,e.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(r|=Gne,e.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(r|=Wne,e.clearStencil=this.props.clearStencil),r!==0&&Iu(this.device.gl,e,()=>{this.device.gl.clear(r)})}clearColorBuffer(e=0,r=[0,0,0,0]){Iu(this.device.gl,{framebuffer:this.props.framebuffer},()=>{switch(r.constructor){case Int32Array:this.device.gl.clearBufferiv(H3,e,r);break;case Uint32Array:this.device.gl.clearBufferuiv(H3,e,r);break;case Float32Array:default:this.device.gl.clearBufferfv(H3,e,r);break}})}};var Yne="Failed to deduce GL constant from typed array";function zz(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(Yne)}}function _x(t,e){let{clamped:r=!0}=e||{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return r?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}var Kne={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},Zne={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},Id=class{offset;stride;type;size;divisor;normalized;integer;buffer;index;static getBytesPerElement(e){return _x(e.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(e){return Yi(e.size),_x(e.type||5126).BYTES_PER_ELEMENT*e.size}static resolve(...e){return new Id(Kne,...e)}constructor(...e){e.forEach(r=>this._assign(r)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return Id.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return Id.getBytesPerVertex(this)}_assign(e={}){return e=E3("Accessor",e,Zne),e.type!==void 0&&(this.type=e.type,(e.type===5124||e.type===5125)&&(this.integer=!0)),e.size!==void 0&&(this.size=e.size),e.offset!==void 0&&(this.offset=e.offset),e.stride!==void 0&&(this.stride=e.stride),e.normalize!==void 0&&(this.normalized=e.normalize),e.normalized!==void 0&&(this.normalized=e.normalized),e.integer!==void 0&&(this.integer=e.integer),e.divisor!==void 0&&(this.divisor=e.divisor),e.buffer!==void 0&&(this.buffer=e.buffer),e.index!==void 0&&(typeof e.index=="boolean"?this.index=e.index?1:0:this.index=e.index),e.instanced!==void 0&&(this.divisor=e.instanced?1:0),e.isInstanced!==void 0&&(this.divisor=e.isInstanced?1:0),this.offset===void 0&&delete this.offset,this.stride===void 0&&delete this.stride,this.type===void 0&&delete this.type,this.size===void 0&&delete this.size,this.divisor===void 0&&delete this.divisor,this.normalized===void 0&&delete this.normalized,this.integer===void 0&&delete this.integer,this.buffer===void 0&&delete this.buffer,this.index===void 0&&delete this.index,this}};function Vz(t){return Jne.includes(t)}var Jne=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],jz={[5126]:[5126,1,"float","f32","float32"],[35664]:[5126,2,"vec2","vec2<f32>","float32x2"],[35665]:[5126,3,"vec3","vec3<f32>","float32x3"],[35666]:[5126,4,"vec4","vec4<f32>","float32x4"],[5124]:[5124,1,"int","i32","sint32"],[35667]:[5124,2,"ivec2","vec2<i32>","sint32x2"],[35668]:[5124,3,"ivec3","vec3<i32>","sint32x3"],[35669]:[5124,4,"ivec4","vec4<i32>","sint32x4"],[5125]:[5125,1,"uint","u32","uint32"],[36294]:[5125,2,"uvec2","vec2<u32>","uint32x2"],[36295]:[5125,3,"uvec3","vec3<u32>","uint32x3"],[36296]:[5125,4,"uvec4","vec4<u32>","uint32x4"],[35670]:[5126,1,"bool","f32","float32"],[35671]:[5126,2,"bvec2","vec2<f32>","float32x2"],[35672]:[5126,3,"bvec3","vec3<f32>","float32x3"],[35673]:[5126,4,"bvec4","vec4<f32>","float32x4"],[35674]:[5126,8,"mat2","mat2x2<f32>"],[35685]:[5126,8,"mat2x3","mat2x3<f32>"],[35686]:[5126,8,"mat2x4","mat2x4<f32>"],[35687]:[5126,12,"mat3x2","mat3x2<f32>"],[35675]:[5126,12,"mat3","mat3x3<f32>"],[35688]:[5126,12,"mat3x4","mat3x4<f32>"],[35689]:[5126,16,"mat4x2","mat4x2<f32>"],[35690]:[5126,16,"mat4x3","mat4x3<f32>"],[35676]:[5126,16,"mat4","mat4x4<f32>"]};function G3(t){let e=jz[t];if(!e)throw new Error("uniform");let[r,i,,n]=e;return{format:n,components:i,glType:r}}function Hz(t){let e=jz[t];if(!e)throw new Error("attribute");let[,r,,i,n]=e;return{attributeType:i,vertexFormat:n,components:r}}function Gz(t,e){let r={attributes:[],bindings:[]};r.attributes=Qne(t,e);let i=toe(t,e);for(let l of i){let u=l.uniforms.map(h=>({name:h.name,format:h.format,byteOffset:h.byteOffset,byteStride:h.byteStride,arrayLength:h.arrayLength}));r.bindings.push({type:"uniform",name:l.name,location:l.location,visibility:(l.vertex?1:0)&(l.fragment?2:0),minBindingSize:l.byteLength,uniforms:u})}let n=eoe(t,e),o=0;for(let l of n)if(Vz(l.type)){let{viewDimension:u,sampleType:h}=ioe(l.type);r.bindings.push({type:"texture",name:l.name,location:o,viewDimension:u,sampleType:h}),l.textureUnit=o,o+=1}n.length&&(r.uniforms=n);let s=$ne(t,e);return s?.length&&(r.varyings=s),r}function Qne(t,e){let r=[],i=t.getProgramParameter(e,35721);for(let n=0;n<i;n++){let o=t.getActiveAttrib(e,n);if(!o)throw new Error("activeInfo");let{name:s,type:l}=o,u=t.getAttribLocation(e,s);if(u>=0){let{attributeType:h}=Hz(l),v=/instance/i.test(s)?"instance":"vertex";r.push({name:s,location:u,stepMode:v,type:h})}}return r.sort((n,o)=>n.location-o.location),r}function $ne(t,e){let r=[],i=t.getProgramParameter(e,35971);for(let n=0;n<i;n++){let o=t.getTransformFeedbackVarying(e,n);if(!o)throw new Error("activeInfo");let{name:s,type:l,size:u}=o,{glType:h,components:v}=G3(l),T=new Id({type:h,size:u*v}),E={location:n,name:s,accessor:T};r.push(E)}return r.sort((n,o)=>n.location-o.location),r}function eoe(t,e){let r=[],i=t.getProgramParameter(e,35718);for(let n=0;n<i;n++){let o=t.getActiveUniform(e,n);if(!o)throw new Error("activeInfo");let{name:s,size:l,type:u}=o,{name:h,isArray:v}=noe(s),T=t.getUniformLocation(e,h),E={location:T,name:h,size:l,type:u,isArray:v};if(r.push(E),E.size>1)for(let M=0;M<E.size;M++){let O=`${h}[${M}]`;T=t.getUniformLocation(e,O);let F={...E,name:O,location:T};r.push(F)}}return r}function toe(t,e){let r=(o,s)=>t.getActiveUniformBlockParameter(e,o,s),i=[],n=t.getProgramParameter(e,35382);for(let o=0;o<n;o++){let s={name:t.getActiveUniformBlockName(e,o)||"",location:r(o,35391),byteLength:r(o,35392),vertex:r(o,35396),fragment:r(o,35398),uniformCount:r(o,35394),uniforms:[]},l=r(o,35395)||[],u=t.getActiveUniforms(e,l,35383),h=t.getActiveUniforms(e,l,35384),v=t.getActiveUniforms(e,l,35387),T=t.getActiveUniforms(e,l,35388);for(let E=0;E<s.uniformCount;++E){let M=t.getActiveUniform(e,l[E]);if(!M)throw new Error("activeInfo");s.uniforms.push({name:M.name,format:G3(u[E]).format,type:u[E],arrayLength:h[E],byteOffset:v[E],byteStride:T[E]})}i.push(s)}return i.sort((o,s)=>o.location-s.location),i}var roe={[35678]:["2d","float"],[35680]:["cube","float"],[35679]:["3d","float"],[35682]:["3d","depth"],[36289]:["2d-array","float"],[36292]:["2d-array","depth"],[36293]:["cube","float"],[36298]:["2d","sint"],[36299]:["3d","sint"],[36300]:["cube","sint"],[36303]:["2d-array","uint"],[36306]:["2d","uint"],[36307]:["3d","uint"],[36308]:["cube","uint"],[36311]:["2d-array","uint"]};function ioe(t){let e=roe[t];if(!e)throw new Error("sampler");let[r,i]=e;return{viewDimension:r,sampleType:i}}function noe(t){if(t[t.length-1]!=="]")return{name:t,length:1,isArray:!1};let r=/([^[]*)(\[[0-9]+\])?/.exec(t);if(!r||r.length<2)throw new Error(`Failed to parse GLSL uniform name ${t}`);return{name:r[1],length:r[2]?1:0,isArray:Boolean(r[2])}}function Wz(t,e,r,i){let n=t,o=i;o===!0&&(o=1),o===!1&&(o=0);let s=typeof o=="number"?[o]:o;switch(r){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof i!="number")throw new Error("samplers must be set to integers");return t.uniform1i(e,i);case 5126:return t.uniform1fv(e,s);case 35664:return t.uniform2fv(e,s);case 35665:return t.uniform3fv(e,s);case 35666:return t.uniform4fv(e,s);case 5124:return t.uniform1iv(e,s);case 35667:return t.uniform2iv(e,s);case 35668:return t.uniform3iv(e,s);case 35669:return t.uniform4iv(e,s);case 35670:return t.uniform1iv(e,s);case 35671:return t.uniform2iv(e,s);case 35672:return t.uniform3iv(e,s);case 35673:return t.uniform4iv(e,s);case 5125:return n.uniform1uiv(e,s,1);case 36294:return n.uniform2uiv(e,s,2);case 36295:return n.uniform3uiv(e,s,3);case 36296:return n.uniform4uiv(e,s,4);case 35674:return t.uniformMatrix2fv(e,!1,s);case 35675:return t.uniformMatrix3fv(e,!1,s);case 35676:return t.uniformMatrix4fv(e,!1,s);case 35685:return n.uniformMatrix2x3fv(e,!1,s);case 35686:return n.uniformMatrix2x4fv(e,!1,s);case 35687:return n.uniformMatrix3x2fv(e,!1,s);case 35688:return n.uniformMatrix3x4fv(e,!1,s);case 35689:return n.uniformMatrix4x2fv(e,!1,s);case 35690:return n.uniformMatrix4x3fv(e,!1,s)}throw new Error("Illegal uniform")}function qz(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"line-loop-webgl":return 2;case"triangle-list":return 4;case"triangle-strip":return 5;case"triangle-fan-webgl":return 6;default:throw new Error(t)}}function Xz(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"line-loop-webgl":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;case"triangle-fan-webgl":return 4;default:throw new Error(t)}}var Yz=4,pT=class extends Af{device;handle;vs;fs;introspectedLayout;uniforms={};bindings={};varyings=null;_uniformCount=0;_uniformSetters={};constructor(e,r){super(e,r),this.device=e,this.handle=this.props.handle||this.device.gl.createProgram(),this.device.setSpectorMetadata(this.handle,{id:this.props.id}),this.vs=r.vs,this.fs=r.fs;let{varyings:i,bufferMode:n=35981}=r;switch(i&&i.length>0&&(this.varyings=i,this.device.gl.transformFeedbackVaryings(this.handle,i,n)),this._linkShaders(),Kt.time(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=Gz(this.device.gl,this.handle),Kt.timeEnd(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=_3(this.introspectedLayout,r.shaderLayout),this.props.topology){case"triangle-fan-webgl":case"line-loop-webgl":Kt.warn(`Primitive topology ${this.props.topology} is deprecated and will be removed in v9.1`);break;default:}}destroy(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)}setBindings(e,r){for(let[i,n]of Object.entries(e)){let o=this.shaderLayout.bindings.find(s=>s.name===i)||this.shaderLayout.bindings.find(s=>s.name===`${i}Uniforms`);if(!o){let s=this.shaderLayout.bindings.map(l=>`"${l.name}"`).join(", ");r?.disableWarnings||Kt.warn(`Unknown binding "${i}" in render pipeline "${this.id}", expected one of ${s}`)();continue}switch(n||Kt.warn(`Unsetting binding "${i}" in render pipeline "${this.id}"`)(),o.type){case"uniform":if(!(n instanceof $l)&&!(n.buffer instanceof $l))throw new Error("buffer value");break;case"texture":if(!(n instanceof gf||n instanceof ec||n instanceof bh))throw new Error("texture value");break;case"sampler":Kt.warn(`Ignoring sampler ${i}`)();break;default:throw new Error(o.type)}this.bindings[i]=n}}draw(e){let{renderPass:r,parameters:i=this.props.parameters,topology:n=this.props.topology,vertexArray:o,vertexCount:s,instanceCount:l,isInstanced:u=!1,firstVertex:h=0,transformFeedback:v}=e,T=qz(n),E=Boolean(o.indexBuffer),M=o.indexBuffer?.glIndexType;if(this.linkStatus!=="success")return Kt.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable()||s===0)return Kt.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;if(s===0)return Kt.info(2,`RenderPipeline:${this.id}.draw() aborted - no vertices to draw`)(),!0;this.device.gl.useProgram(this.handle),o.bindBeforeRender(r),v&&v.begin(this.props.topology),this._applyBindings(),this._applyUniforms();let O=r;return Pz(this.device,i,O.glParameters,()=>{E&&u?this.device.gl.drawElementsInstanced(T,s||0,M,h,l||0):E?this.device.gl.drawElements(T,s||0,M,h):u?this.device.gl.drawArraysInstanced(T,h,s||0,l||0):this.device.gl.drawArrays(T,h,s||0),v&&v.end()}),o.unbindAfterRender(r),!0}setUniformsWebGL(e){let{bindings:r}=cx(e);Object.keys(r).forEach(i=>{Kt.warn(`Unsupported value "${JSON.stringify(r[i])}" used in setUniforms() for key ${i}. Use setBindings() instead?`)()}),Object.assign(this.uniforms,e)}async _linkShaders(){let{gl:e}=this.device;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),Kt.time(Yz,`linkProgram for ${this.id}`)(),e.linkProgram(this.handle),Kt.timeEnd(Yz,`linkProgram for ${this.id}`)(),Kt.level,!this.device.features.has("compilation-status-async-webgl")){let i=this._getLinkStatus();this._reportLinkStatus(i);return}Kt.once(1,"RenderPipeline linking is asynchronous")(),await this._waitForLinkComplete(),Kt.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();let r=this._getLinkStatus();this._reportLinkStatus(r)}_reportLinkStatus(e){switch(e){case"success":return;default:throw this.vs.compilationStatus==="error"?(this.vs.debugShader(),new Error(`Error during compilation of shader ${this.vs.id}`)):this.fs?.compilationStatus==="error"?(this.fs.debugShader(),new Error(`Error during compilation of shader ${this.fs.id}`)):new Error(`Error during ${e}: ${this.device.gl.getProgramInfoLog(this.handle)}`)}}_getLinkStatus(){let{gl:e}=this.device;return e.getProgramParameter(this.handle,35714)?(e.validateProgram(this.handle),e.getProgramParameter(this.handle,35715)?(this.linkStatus="success","success"):(this.linkStatus="error","validation")):(this.linkStatus="error","linking")}async _waitForLinkComplete(){let e=async n=>await new Promise(o=>setTimeout(o,n));if(!this.device.features.has("compilation-status-async-webgl")){await e(10);return}let{gl:i}=this.device;for(;;){if(i.getProgramParameter(this.handle,37297))return;await e(10)}}_areTexturesRenderable(){let e=!0;for(let[,r]of Object.entries(this.bindings))r instanceof ec&&(r.update(),e=e&&r.loaded);return e}_applyBindings(){if(this.linkStatus!=="success")return;let{gl:e}=this.device;e.useProgram(this.handle);let r=0,i=0;for(let n of this.shaderLayout.bindings){let o=this.bindings[n.name]||this.bindings[n.name.replace(/Uniforms$/,"")];if(!o)throw new Error(`No value for binding ${n.name} in ${this.id}`);switch(n.type){case"uniform":let{name:s}=n,l=e.getUniformBlockIndex(this.handle,s);if(l===4294967295)throw new Error(`Invalid uniform block name ${s}`);e.uniformBlockBinding(this.handle,i,l),o instanceof $l?e.bindBufferBase(35345,i,o.handle):e.bindBufferRange(35345,i,o.buffer.handle,o.offset||0,o.size||o.buffer.byteLength-o.offset),i+=1;break;case"texture":if(!(o instanceof gf||o instanceof ec||o instanceof bh))throw new Error("texture");let u;if(o instanceof gf)u=o.texture;else if(o instanceof ec)u=o;else if(o instanceof bh&&o.colorAttachments[0]instanceof gf)Kt.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),u=o.colorAttachments[0].texture;else throw new Error("No texture");e.activeTexture(33984+r),e.bindTexture(u.target,u.handle),r+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${n.type}' not supported in WebGL`)}}}_applyUniforms(){for(let e of this.shaderLayout.uniforms||[]){let{name:r,location:i,type:n,textureUnit:o}=e,s=this.uniforms[r]??o;s!==void 0&&Wz(this.device.gl,i,n,s)}}};var dT=class extends F0{device;commands=[];constructor(e){super(e,{}),this.device=e}submitCommands(e=this.commands){for(let r of e)switch(r.name){case"copy-buffer-to-buffer":ooe(this.device,r.options);break;case"copy-buffer-to-texture":soe(this.device,r.options);break;case"copy-texture-to-buffer":aoe(this.device,r.options);break;case"copy-texture-to-texture":loe(this.device,r.options);break}}};function ooe(t,e){let r=e.source,i=e.destination;t.gl.bindBuffer(36662,r.handle),t.gl.bindBuffer(36663,i.handle),t.gl.copyBufferSubData(36662,36663,e.sourceOffset??0,e.destinationOffset??0,e.size),t.gl.bindBuffer(36662,null),t.gl.bindBuffer(36663,null)}function soe(t,e){throw new Error("Not implemented")}function aoe(t,e){let{source:r,mipLevel:i=0,aspect:n="all",width:o=e.source.width,height:s=e.source.height,depthOrArrayLayers:l=0,origin:u=[0,0],destination:h,byteOffset:v=0,bytesPerRow:T,rowsPerImage:E}=e;if(n!=="all")throw new Error("not supported");if(i!==0||l!==0||T||E)throw new Error("not implemented");let{framebuffer:M,destroyFramebuffer:O}=Kz(r),F;try{let z=h,W=o||M.width,J=s||M.height,K=j0(M.texture.props.format),ne=K.dataFormat,ge=K.type;t.gl.bindBuffer(35051,z.handle),F=t.gl.bindFramebuffer(36160,M.handle),t.gl.readPixels(u[0],u[1],W,J,ne,ge,v)}finally{t.gl.bindBuffer(35051,null),F!==void 0&&t.gl.bindFramebuffer(36160,F),O&&M.destroy()}}function loe(t,e){let{source:r,destinationMipLevel:i=0,origin:n=[0,0],destinationOrigin:o=[0,0],destination:s}=e,{width:l=e.destination.width,height:u=e.destination.height}=e,{framebuffer:h,destroyFramebuffer:v}=Kz(r),[T,E]=n,[M,O,F]=o,z=t.gl.bindFramebuffer(36160,h.handle),W=null,J;if(s instanceof ec)W=s,l=Number.isFinite(l)?l:W.width,u=Number.isFinite(u)?u:W.height,W.bind(0),J=W.target;else throw new Error("invalid destination");switch(J){case 3553:case 34067:t.gl.copyTexSubImage2D(J,i,M,O,T,E,l,u);break;case 35866:case 32879:t.gl.copyTexSubImage3D(J,i,M,O,F,T,E,l,u);break;default:}W&&W.unbind(),t.gl.bindFramebuffer(36160,z),v&&h.destroy()}function Kz(t){if(t instanceof bo){let{width:e,height:r,id:i}=t;return{framebuffer:t.device.createFramebuffer({id:`framebuffer-for-${i}`,width:e,height:r,colorAttachments:[t]}),destroyFramebuffer:!0}}return{framebuffer:t,destroyFramebuffer:!1}}var AT=class extends L0{device;commandBuffer;constructor(e,r){super(e,r),this.device=e,this.commandBuffer=new dT(e)}destroy(){}finish(){this.commandBuffer.submitCommands()}copyBufferToBuffer(e){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:e})}copyBufferToTexture(e){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:e})}copyTextureToBuffer(e){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:e})}copyTextureToTexture(e){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:e})}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}resolveQuerySet(e,r,i){}};var H0=class extends N0{get[Symbol.toStringTag](){return"VertexArray"}device;handle;buffer=null;bufferValue=null;static isConstantAttributeZeroSupported(e){return SP()==="Chrome"}constructor(e,r){super(e,r),this.device=e,this.handle=this.device.gl.createVertexArray()}destroy(){super.destroy(),this.buffer&&this.buffer?.destroy(),this.handle&&(this.device.gl.deleteVertexArray(this.handle),this.handle=void 0)}setIndexBuffer(e){let r=e;if(r&&r.glTarget!==34963)throw new Error("Use .setBuffer()");this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34963,r?r.handle:null),this.indexBuffer=r,this.device.gl.bindVertexArray(null)}setBuffer(e,r){let i=r;if(i.glTarget===34963)throw new Error("Use .setIndexBuffer()");let{size:n,type:o,stride:s,offset:l,normalized:u,integer:h,divisor:v}=this._getAccessor(e);this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,i.handle),h?this.device.gl.vertexAttribIPointer(e,n,o,s,l):this.device.gl.vertexAttribPointer(e,n,o,u,s,l),this.device.gl.bindBuffer(34962,null),this.device.gl.enableVertexAttribArray(e),this.device.gl.vertexAttribDivisor(e,v||0),this.attributes[e]=i,this.device.gl.bindVertexArray(null)}setConstantWebGL(e,r){this._enable(e,!1),this.attributes[e]=r}bindBeforeRender(){this.device.gl.bindVertexArray(this.handle),this._applyConstantAttributes()}unbindAfterRender(){this.device.gl.bindVertexArray(null)}_applyConstantAttributes(){for(let e=0;e<this.maxVertexAttributes;++e){let r=this.attributes[e];ArrayBuffer.isView(r)&&this.device.setConstantAttributeWebGL(e,r)}}_getAccessor(e){let r=this.attributeInfos[e];if(!r)throw new Error(`Unknown attribute location ${e}`);let i=Q2(r.bufferDataType);return{size:r.bufferComponents,type:i,stride:r.byteStride,offset:r.byteOffset,normalized:r.normalized,integer:r.integer,divisor:r.stepMode==="instance"?1:0}}_enable(e,r=!0){let n=H0.isConstantAttributeZeroSupported(this.device)||e!==0;(r||n)&&(e=Number(e),this.device.gl.bindVertexArray(this.handle),r?this.device.gl.enableVertexAttribArray(e):this.device.gl.disableVertexAttribArray(e),this.device.gl.bindVertexArray(null))}getConstantBuffer(e,r){let i=coe(r),n=i.byteLength*e,o=i.length*e;if(this.buffer&&n!==this.buffer.byteLength)throw new Error(`Buffer size is immutable, byte length ${n} !== ${this.buffer.byteLength}.`);let s=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:n}),s=s||!uoe(i,this.bufferValue),s){let l=b3(r.constructor,o);w3({target:l,source:i,start:0,count:o}),this.buffer.write(l),this.bufferValue=r}return this.buffer}};function coe(t){return Array.isArray(t)?new Float32Array(t):t}function uoe(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}var mT=class extends k0{device;gl;handle;layout;buffers={};unusedBuffers={};bindOnUse=!0;_bound=!1;constructor(e,r){super(e,r),this.device=e,this.gl=e.gl,this.handle=this.props.handle||this.gl.createTransformFeedback(),this.layout=this.props.layout,r.buffers&&this.setBuffers(r.buffers),Object.seal(this)}destroy(){this.gl.deleteTransformFeedback(this.handle),super.destroy()}begin(e="point-list"){this.gl.bindTransformFeedback(36386,this.handle),this.bindOnUse&&this._bindBuffers(),this.gl.beginTransformFeedback(Xz(e))}end(){this.gl.endTransformFeedback(),this.bindOnUse&&this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null)}setBuffers(e){this.buffers={},this.unusedBuffers={},this.bind(()=>{for(let r in e)this.setBuffer(r,e[r])})}setBuffer(e,r){let i=this._getVaryingIndex(e),{buffer:n,byteLength:o,byteOffset:s}=this._getBufferRange(r);if(i<0){this.unusedBuffers[e]=n,Kt.warn(`${this.id} unusedBuffers varying buffer ${e}`)();return}this.buffers[i]={buffer:n,byteLength:o,byteOffset:s},this.bindOnUse||this._bindBuffer(i,n,s,o)}getBuffer(e){if(Zz(e))return this.buffers[e]||null;let r=this._getVaryingIndex(e);return r>=0?this.buffers[r]:null}bind(e=this.handle){if(typeof e!="function")return this.gl.bindTransformFeedback(36386,e),this;let r;return this._bound?r=e():(this.gl.bindTransformFeedback(36386,this.handle),this._bound=!0,r=e(),this._bound=!1,this.gl.bindTransformFeedback(36386,null)),r}unbind(){this.bind(null)}_getBufferRange(e){if(e instanceof $l)return{buffer:e,byteOffset:0,byteLength:e.byteLength};let{buffer:r,byteOffset:i=0,byteLength:n=e.buffer.byteLength}=e;return{buffer:r,byteOffset:i,byteLength:n}}_getVaryingIndex(e){if(Zz(e))return Number(e);for(let r of this.layout.varyings)if(e===r.name)return r.location;return-1}_bindBuffers(){for(let e in this.buffers){let{buffer:r,byteLength:i,byteOffset:n}=this._getBufferRange(this.buffers[e]);this._bindBuffer(Number(e),r,n,i)}}_unbindBuffers(){for(let e in this.buffers)this.gl.bindBufferBase(35982,Number(e),null)}_bindBuffer(e,r,i=0,n){let o=r&&r.handle;!o||n===void 0?this.gl.bindBufferBase(35982,e,o):this.gl.bindBufferRange(35982,e,o,i,n)}};function Zz(t){return typeof t=="number"?Number.isInteger(t):/^\d+$/.test(t)}var gT=class extends U0{device;handle;target=null;_queryPending=!1;_pollingPromise=null;get[Symbol.toStringTag](){return"Query"}constructor(e,r){if(super(e,r),this.device=e,r.count>1)throw new Error("WebGL QuerySet can only have one value");this.handle=this.device.gl.createQuery(),Object.seal(this)}destroy(){this.device.gl.deleteQuery(this.handle)}beginTimestampQuery(){return this._begin(35007)}endTimestampQuery(){this._end()}beginOcclusionQuery(e){return this._begin(e?.conservative?36202:35887)}endOcclusionQuery(){this._end()}beginTransformFeedbackQuery(){return this._begin(35976)}endTransformFeedbackQuery(){this._end()}async resolveQuery(){return[await this.pollQuery()]}_begin(e){this._queryPending||(this.target=e,this.device.gl.beginQuery(this.target,this.handle))}_end(){this._queryPending||this.target&&(this.device.gl.endQuery(this.target),this.target=null,this._queryPending=!0)}isResultAvailable(){if(!this._queryPending)return!1;let e=this.device.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.device.gl.getParameter(36795)}getResult(){return this.device.gl.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}pollQuery(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let r=0;return this._pollingPromise=new Promise((i,n)=>{let o=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):r++>e?(n("Timed out"),this._pollingPromise=null):requestAnimationFrame(o)};requestAnimationFrame(o)}),this._pollingPromise}};function W3(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Yi(!1),0}}function Jz(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Yi(!1),0}}function Qz(t,e){let{sourceX:r=0,sourceY:i=0,sourceFormat:n=6408,sourceAttachment:o=36064}=e||{},{target:s=null,sourceWidth:l,sourceHeight:u,sourceType:h}=e||{},{framebuffer:v,deleteFramebuffer:T}=e5(t);Yi(v);let{gl:E,handle:M}=v;l=l||v.width,u=u||v.height;let O=o-36064;h=h||v.colorAttachments[O]?.texture?.type||5121,s=hoe(s,h,n,l,u),h=h||zz(s);let F=E.bindFramebuffer(36160,M);return E.readPixels(r,i,l,u,n,h,s),E.bindFramebuffer(36160,F||null),T&&v.destroy(),s}function $z(t,e){let{target:r,sourceX:i=0,sourceY:n=0,sourceFormat:o=6408,targetByteOffset:s=0}=e||{},{sourceWidth:l,sourceHeight:u,sourceType:h}=e||{},{framebuffer:v,deleteFramebuffer:T}=e5(t);Yi(v),l=l||v.width,u=u||v.height;let E=v;h=h||5121;let M=r;if(!M){let F=W3(o),z=Jz(h),W=s+l*u*F*z;M=E.device.createBuffer({byteLength:W})}let O=t.device.createCommandEncoder();return O.copyTextureToBuffer({source:t,width:l,height:u,origin:[i,n],destination:M,byteOffset:s}),O.destroy(),T&&v.destroy(),M}function e5(t){return t instanceof _h?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:foe(t),deleteFramebuffer:!0}}function foe(t,e){let{device:r,width:i,height:n,id:o}=t;return r.createFramebuffer({...e,id:`framebuffer-for-${o}`,width:i,height:n,colorAttachments:[t]})}function hoe(t,e,r,i,n){if(t)return t;e=e||5121;let o=_x(e,{clamped:!1}),s=W3(r);return new o(i*n*s)}var poe=256,doe=1024,Aoe=16384;var moe="clear: bad arguments";function t5(t,e){let{framebuffer:r=null,color:i=null,depth:n=null,stencil:o=null}=e||{},s={};r&&(s.framebuffer=r);let l=0;i&&(l|=Aoe,i!==!0&&(s.clearColor=i)),n&&(l|=poe,n!==!0&&(s.clearDepth=n)),o&&(l|=doe,n!==!0&&(s.clearStencil=n)),Yi(l!==0,moe);let u=t.gl;Iu(u,s,()=>{u.clear(l)})}var yx=1,G0=class extends Yc{type="webgl";handle;features;limits;info;canvasContext;lost;_resolveContextLost;static isSupported(){return typeof WebGL2RenderingContext<"u"}static attach(e){if(e instanceof G0)return e;if(e?.device instanceof Yc)return e.device;if(!goe(e))throw new Error("Invalid WebGL2RenderingContext");return new G0({gl:e})}static async create(e={}){Kt.groupCollapsed(yx,"WebGLDevice created")();let r=[];e.debug&&r.push(Fz()),e.spector&&r.push(Oz()),typeof e.canvas=="string"&&r.push(Td.pageLoaded);let i=await Promise.allSettled(r);for(let s of i)s.status==="rejected"&&Kt.error(`Failed to initialize debug libraries ${s.reason}`)();if(Kt.probe(yx+1,"DOM is loaded")(),e.gl?.device)return Kt.warn("reattaching existing device")(),G0.attach(e.gl);let n=new G0(e),o=`Created ${n.type}${n.debug?" debug":""} context: ${n.info.vendor}, ${n.info.renderer} for canvas: ${n.canvasContext.id}`;return Kt.probe(yx,o)(),Kt.table(yx,n.info)(),Kt.groupEnd(yx)(),n}constructor(e){super({...e,id:e.id||oa("webgl-device")});let r=e.gl?.device;if(r)throw new Error(`WebGL context already attached to device ${r.id}`);let i=e.gl?.canvas||e.canvas;this.canvasContext=new uT(this,{...e,canvas:i}),this.lost=new Promise(l=>{this._resolveContextLost=l});let n=e.gl||null;if(n||=gz(this.canvasContext.canvas,{...e,onContextLost:l=>this._resolveContextLost?.({reason:"destroyed",message:"Entered sleep mode, or too many apps or browser tabs are using the GPU."})}),!n)throw new Error("WebGL context creation failed");this.handle=n,this.gl=n,this.gl.device=this,this.gl._version=2,e.spector&&(this.spectorJS=Dz({...this.props,canvas:this.handle.canvas})),this.info=_z(this.gl,this._extensions),this.limits=new oT(this.gl),this.features=new nT(this.gl,this._extensions,this.props.disabledFeatures),this.props.initalizeFeatures&&this.features.initializeFeatures(),this.canvasContext.resize();let{enable:o=!0,copyState:s=!1}=e;O3(this.gl,{enable:o,copyState:s,log:(...l)=>Kt.log(1,...l)()}),e.debug&&(this.gl=Nz(this.gl,{...e,throwOnError:!0}),this.debug=!0,Kt.level=Math.max(Kt.level,1),Kt.warn("WebGL debug mode activated. Performance reduced.")())}destroy(){}get isLost(){return this.gl.isContextLost()}getSize(){return[this.gl.drawingBufferWidth,this.gl.drawingBufferHeight]}isTextureFormatSupported(e){return iT(this.gl,e,this._extensions)}isTextureFormatFilterable(e){return Ez(this.gl,e,this._extensions)}isTextureFormatRenderable(e){return Sz(this.gl,e,this._extensions)}createCanvasContext(e){throw new Error("WebGL only supports a single canvas")}createBuffer(e){let r=this._getBufferProps(e);return new $l(this,r)}_createTexture(e){return new ec(this,e)}createExternalTexture(e){throw new Error("createExternalTexture() not implemented")}createSampler(e){return new om(this,e)}createShader(e){return new fT(this,e)}createFramebuffer(e){return new bh(this,e)}createVertexArray(e){return new H0(this,e)}createTransformFeedback(e){return new mT(this,e)}createQuerySet(e){return new gT(this,e)}createRenderPipeline(e){return new pT(this,e)}beginRenderPass(e){return new hT(this,e)}createComputePipeline(e){throw new Error("ComputePipeline not supported in WebGL")}beginComputePass(e){throw new Error("ComputePass not supported in WebGL")}renderPass=null;createCommandEncoder(e){return new AT(this,e)}submit(){this.renderPass?.end(),this.renderPass=null}readPixelsToArrayWebGL(e,r){return Qz(e,r)}readPixelsToBufferWebGL(e,r){return $z(e,r)}setParametersWebGL(e){mf(this.gl,e)}getParametersWebGL(e){return J2(this.gl,e)}withParametersWebGL(e,r){return Iu(this.gl,e,r)}clearWebGL(e){t5(this,e)}resetWebGL(){Kt.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")(),dz(this.gl)}gl;debug=!1;_canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1};_extensions={};_polyfilled=!1;spectorJS;loseDevice(){let e=!1,i=this.getExtension("WEBGL_lose_context").WEBGL_lose_context;return i&&(e=!0,i.loseContext()),this._resolveContextLost?.({reason:"destroyed",message:"Application triggered context loss"}),e}pushState(){Md(this.gl)}popState(){mp(this.gl)}setSpectorMetadata(e,r){e.__SPECTOR_Metadata=r}getGLKey(e,r){r=r||this.gl2||this.gl;let i=Number(e);for(let n in r)if(r[n]===i)return`GL.${n}`;return String(e)}_constants;setConstantAttributeWebGL(e,r){let i=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(i).fill(null);let n=this._constants[e];switch(n&&xoe(n,r)&&Kt.info(1,`setConstantAttributeWebGL(${e}) could have been skipped, value unchanged`)(),this._constants[e]=r,r.constructor){case Float32Array:_oe(this,e,r);break;case Int32Array:yoe(this,e,r);break;case Uint32Array:voe(this,e,r);break;default:Yi(!1)}}getExtension(e){return Mu(this.gl,e,this._extensions),this._extensions}},wh=G0;Yr(wh,"type","webgl");function goe(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&Number.isFinite(t._version))}function _oe(t,e,r){switch(r.length){case 1:t.gl.vertexAttrib1fv(e,r);break;case 2:t.gl.vertexAttrib2fv(e,r);break;case 3:t.gl.vertexAttrib3fv(e,r);break;case 4:t.gl.vertexAttrib4fv(e,r);break;default:Yi(!1)}}function yoe(t,e,r){t.gl.vertexAttribI4iv(e,r)}function voe(t,e,r){t.gl.vertexAttribI4uiv(e,r)}function xoe(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}var r5,i5,o5={fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif',display:"flex",flex:"wrap",maxWidth:"500px",flexDirection:"column",zIndex:2};function _T(){return document.createElement("div")}function boe(t){if(!t.picked)return null;if(t.object===r5)return i5;let e={html:Toe(t.object),style:o5};return i5=e,r5=t.object,e}var woe=new Set(["position","index"]);function Toe(t){let e=_T();for(let r in t){if(woe.has(r))continue;let i=_T();i.className="header",i.textContent=r;let n=_T();n.className="value",n.textContent=Soe(t[r]);let o=_T();Eoe(o,i,n),o.appendChild(i),o.appendChild(n),e.appendChild(o)}return e.innerHTML}function Eoe(t,e,r){Object.assign(e.style,{fontWeight:700,marginRight:"10px",flex:"1 1 0%"}),Object.assign(r.style,{flex:"none",maxWidth:"250px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),Object.assign(t.style,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"stretch"})}function Soe(t){let e;if(Array.isArray(t)&&t.length>4)e=`Array<${t.length}>`;else if(typeof t=="string")e=t;else if(typeof t=="number")e=String(t);else try{e=JSON.stringify(t)}catch{e="<Non-Serializable Object>"}let r=50;return e.length>r&&(e=e.slice(0,r)),e}function n5(t,e){let r,i=t,n="properties",o=/{[^}]*}/g,s=u=>u.replace(/[{}]/g,""),l=[...new Set(t.match(o).map(s))];for(let u of l){if(u.includes(".")){r=e;let h=u.split(".");for(let v of h)if(r.hasOwnProperty(v))r=r[v];else{r=void 0;break}}else e.hasOwnProperty(u)?r=e[u]:e[n]&&e[n].hasOwnProperty(u)?r=e[n][u]:r=void 0;i=i.replaceAll(`{${u}}`,r)}return i}function q3(t){return t?t.html||t.text?e=>{if(!e.picked)return null;let r={style:t.style||o5};return t.html?r.html=n5(t.html,e.object):r.text=n5(t.text,e.object),r}:boe:null}function s5(t){let e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,document.getElementsByTagName("head")[0].appendChild(e)}function a5(t,e){let r=document.createElement("div");return r.style.width=Number.isFinite(t)?`${t}px`:t,r.style.height=`${e}px`,r.style.position="relative",r}var c5=ga(l5()),Coe="https://api.tiles.mapbox.com/mapbox-gl-js/v1.13.2/mapbox-gl.css",K3=c5.default;function u5(t=Coe){s5(t)}function f5(){let t=["mapboxgl-missing-css"];for(let e of t){let r=document.getElementsByClassName(e)[0];r&&r.style&&(r.style.display="none")}}var Z3={};function h5(t){if(!Z3[t]){let e=document.createElement("script");e.type="text/javascript",e.src=t,document.querySelector("head").appendChild(e),Z3[t]=new Promise(i=>{e.onload=i})}return Z3[t]}var p5="4.2.0-beta.2";var Moe=globalThis.loaders?.parseImageNode,J3=typeof Image<"u",Q3=typeof ImageBitmap<"u",Ioe=Boolean(Moe),$3=Ap?!0:Ioe;function d5(t){switch(t){case"auto":return Q3||J3||$3;case"imagebitmap":return Q3;case"image":return J3;case"data":return $3;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function A5(){if(Q3)return"imagebitmap";if(J3)return"image";if($3)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function m5(t){let e=Poe(t);if(!e)throw new Error("Not an image");return e}function vx(t){switch(m5(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function Poe(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var Roe=/^data:image\/svg\+xml/,Boe=/\.svg((\?|#).*)?$/;function yT(t){return t&&(Roe.test(t)||Boe.test(t))}function g5(t,e){if(yT(e)){let i=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return eR(t,e)}function eR(t,e){if(yT(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function vT(t,e,r){let i=g5(t,r),n=self.URL||self.webkitURL,o=typeof i!="string"&&n.createObjectURL(i);try{return await Ooe(o||i,e)}finally{o&&n.revokeObjectURL(o)}}async function Ooe(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((i,n)=>{try{r.onload=()=>i(r),r.onerror=o=>{let s=o instanceof Error?o.message:"error";n(new Error(s))}}catch(o){n(o)}})}var Doe={},_5=!0;async function y5(t,e,r){let i;yT(r)?i=await vT(t,e,r):i=eR(t,r);let n=e&&e.imagebitmap;return await Loe(i,n)}async function Loe(t,e=null){if((Foe(e)||!_5)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),_5=!1}return await createImageBitmap(t)}function Foe(t){for(let e in t||Doe)return!1;return!0}function v5(t){return!zoe(t,"ftyp",4)||!(t[8]&96)?null:Noe(t)}function Noe(t){switch(koe(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function koe(t,e,r){return String.fromCharCode(...t.slice(e,r))}function Uoe(t){return[...t].map(e=>e.charCodeAt(0))}function zoe(t,e,r=0){let i=Uoe(e);for(let n=0;n<i.length;++n)if(i[n]!==t[n+r])return!1;return!0}var Th=!1,xx=!0;function sm(t){let e=bx(t);return joe(e)||Woe(e)||Hoe(e)||Goe(e)||Voe(e)}function Voe(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=v5(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function joe(t){let e=bx(t);return e.byteLength>=24&&e.getUint32(0,Th)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Th),height:e.getUint32(20,Th)}:null}function Hoe(t){let e=bx(t);return e.byteLength>=10&&e.getUint32(0,Th)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,xx),height:e.getUint16(8,xx)}:null}function Goe(t){let e=bx(t);return e.byteLength>=14&&e.getUint16(0,Th)===16973&&e.getUint32(2,xx)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,xx),height:e.getUint32(22,xx)}:null}function Woe(t){let e=bx(t);if(!(e.byteLength>=3&&e.getUint16(0,Th)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:n}=qoe(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,Th);if(n.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,Th),width:e.getUint16(o+7,Th)};if(!i.has(s))return null;o+=2,o+=e.getUint16(o,Th)}return null}function qoe(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function bx(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function x5(t,e){let{mimeType:r}=sm(t)||{},i=globalThis.loaders?.parseImageNode;return On(i),await i(t,r)}async function b5(t,e,r){e=e||{};let n=(e.image||{}).type||"auto",{url:o}=r||{},s=Xoe(n),l;switch(s){case"imagebitmap":l=await y5(t,e,o);break;case"image":l=await vT(t,e,o);break;case"data":l=await x5(t,e);break;default:On(!1)}return n==="data"&&(l=vx(l)),l}function Xoe(t){switch(t){case"auto":case"data":return A5();default:return d5(t),t}}var Yoe=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Koe=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Zoe={image:{type:"auto",decode:!0}},Eh={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:p5,mimeTypes:Koe,extensions:Yoe,parse:b5,tests:[t=>Boolean(sm(new DataView(t)))],options:Zoe};var tR={};function rR(t){if(tR[t]===void 0){let e=Ap?Qoe(t):Joe(t);tR[t]=e}return tR[t]}function Joe(t){let e=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||e,i=globalThis.loaders?.parseImageNode;return Boolean(i)&&r.includes(t)}function Qoe(t){switch(t){case"image/avif":case"image/webp":return $oe(t);default:return!0}}function $oe(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}var ese=new bc({id:"deck"}),ur=ese;var iR={};function w5(t){iR=t}function Ks(t,e,r,i){ur.level>0&&iR[t]&&iR[t].call(null,e,r,i)}function tse(t){let e=t[0],r=t[t.length-1];return e==="{"&&r==="}"||e==="["&&r==="]"}var T5={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:tse,parseTextSync:JSON.parse};function rse(){let t="9.0.16",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${t}`);return e||(ur.log(1,`deck.gl ${t}`)(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:ur,_registerLoggers:w5},tm([T5,[Eh,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}var xT=rse();function Sh(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}var nR={number:{type:"number",validate(t,e){return Number.isFinite(t)&&typeof e=="object"&&(e.max===void 0||t<=e.max)&&(e.min===void 0||t>=e.min)}},array:{type:"array",validate(t,e){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function S5(t){let e={};for(let[r,i]of Object.entries(t))e[r]=ise(i);return e}function C5(t,e,r){let i={};for(let[n,o]of Object.entries(e))t&&n in t&&!o.private?(o.validate&&Sh(o.validate(t[n],o),`${r}: invalid ${n}`),i[n]=t[n]):i[n]=o.value;return i}function ise(t){let e=E5(t);if(e!=="object")return{value:t,...nR[e],type:e};if(typeof t=="object")return t?t.type!==void 0?{...t,...nR[t.type],type:t.type}:t.value===void 0?{type:"object",value:t}:(e=E5(t.value),{...t,...nR[e],type:e}):{type:"object",value:null};throw new Error("props")}function E5(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}var M5=`#ifdef MODULE_LOGDEPTH
553
+ ${n}`)(e);let{gl:i}=this.device;if(i.shaderSource(this.handle,e),i.compileShader(this.handle),Kt.level===0){this.compilationStatus="pending";return}if(!this.device.features.has("compilation-status-async-webgl")){if(this._getCompilationStatus(),this.debugShader(),this.compilationStatus==="error")throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`);return}Kt.once(1,"Shader compilation is asynchronous")(),await this._waitForCompilationComplete(),Kt.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader()}async _waitForCompilationComplete(){let e=async n=>await new Promise(o=>setTimeout(o,n));if(!this.device.features.has("compilation-status-async-webgl")){await e(10);return}let{gl:i}=this.device;for(;;){if(i.getShaderParameter(this.handle,37297))return;await e(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?"success":"error"}};var Gne=256,Wne=1024,qne=16384,H3=6144,Xne=[1,2,4,8],hT=class extends D0{device;glParameters;constructor(e,r){super(e,r),this.device=e,Md(this.device.gl),this.setParameters(this.props.parameters),this.clear()}end(){mp(this.device.gl)}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}setParameters(e={}){let r={...this.glParameters};this.props.framebuffer&&(r.framebuffer=this.props.framebuffer),this.props.depthReadOnly&&(r.depthMask=!this.props.depthReadOnly),r.stencilMask=this.props.stencilReadOnly?0:1,r[35977]=this.props.discard,e.viewport&&(e.viewport.length>=6?(r.viewport=e.viewport.slice(0,4),r.depthRange=[e.viewport[4],e.viewport[5]]):r.viewport=e.viewport),e.scissorRect&&(r.scissorTest=!0,r.scissor=e.scissorRect),e.blendConstant&&(r.blendColor=e.blendConstant),e.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),e[2967]=e.stencilReference),e.colorMask&&(r.colorMask=Xne.map(i=>Boolean(i&e.colorMask))),this.glParameters=r,mf(this.device.gl,r)}beginOcclusionQuery(e){this.props.occlusionQuerySet?.beginOcclusionQuery()}endOcclusionQuery(){this.props.occlusionQuerySet?.endOcclusionQuery()}clear(){let e={...this.glParameters},r=0;this.props.clearColor!==!1&&(r|=qne,e.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(r|=Gne,e.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(r|=Wne,e.clearStencil=this.props.clearStencil),r!==0&&Iu(this.device.gl,e,()=>{this.device.gl.clear(r)})}clearColorBuffer(e=0,r=[0,0,0,0]){Iu(this.device.gl,{framebuffer:this.props.framebuffer},()=>{switch(r.constructor){case Int32Array:this.device.gl.clearBufferiv(H3,e,r);break;case Uint32Array:this.device.gl.clearBufferuiv(H3,e,r);break;case Float32Array:default:this.device.gl.clearBufferfv(H3,e,r);break}})}};var Yne="Failed to deduce GL constant from typed array";function zz(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(Yne)}}function _x(t,e){let{clamped:r=!0}=e||{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return r?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}var Kne={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},Zne={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},Id=class{offset;stride;type;size;divisor;normalized;integer;buffer;index;static getBytesPerElement(e){return _x(e.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(e){return Yi(e.size),_x(e.type||5126).BYTES_PER_ELEMENT*e.size}static resolve(...e){return new Id(Kne,...e)}constructor(...e){e.forEach(r=>this._assign(r)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return Id.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return Id.getBytesPerVertex(this)}_assign(e={}){return e=E3("Accessor",e,Zne),e.type!==void 0&&(this.type=e.type,(e.type===5124||e.type===5125)&&(this.integer=!0)),e.size!==void 0&&(this.size=e.size),e.offset!==void 0&&(this.offset=e.offset),e.stride!==void 0&&(this.stride=e.stride),e.normalize!==void 0&&(this.normalized=e.normalize),e.normalized!==void 0&&(this.normalized=e.normalized),e.integer!==void 0&&(this.integer=e.integer),e.divisor!==void 0&&(this.divisor=e.divisor),e.buffer!==void 0&&(this.buffer=e.buffer),e.index!==void 0&&(typeof e.index=="boolean"?this.index=e.index?1:0:this.index=e.index),e.instanced!==void 0&&(this.divisor=e.instanced?1:0),e.isInstanced!==void 0&&(this.divisor=e.isInstanced?1:0),this.offset===void 0&&delete this.offset,this.stride===void 0&&delete this.stride,this.type===void 0&&delete this.type,this.size===void 0&&delete this.size,this.divisor===void 0&&delete this.divisor,this.normalized===void 0&&delete this.normalized,this.integer===void 0&&delete this.integer,this.buffer===void 0&&delete this.buffer,this.index===void 0&&delete this.index,this}};function Vz(t){return Jne.includes(t)}var Jne=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],jz={[5126]:[5126,1,"float","f32","float32"],[35664]:[5126,2,"vec2","vec2<f32>","float32x2"],[35665]:[5126,3,"vec3","vec3<f32>","float32x3"],[35666]:[5126,4,"vec4","vec4<f32>","float32x4"],[5124]:[5124,1,"int","i32","sint32"],[35667]:[5124,2,"ivec2","vec2<i32>","sint32x2"],[35668]:[5124,3,"ivec3","vec3<i32>","sint32x3"],[35669]:[5124,4,"ivec4","vec4<i32>","sint32x4"],[5125]:[5125,1,"uint","u32","uint32"],[36294]:[5125,2,"uvec2","vec2<u32>","uint32x2"],[36295]:[5125,3,"uvec3","vec3<u32>","uint32x3"],[36296]:[5125,4,"uvec4","vec4<u32>","uint32x4"],[35670]:[5126,1,"bool","f32","float32"],[35671]:[5126,2,"bvec2","vec2<f32>","float32x2"],[35672]:[5126,3,"bvec3","vec3<f32>","float32x3"],[35673]:[5126,4,"bvec4","vec4<f32>","float32x4"],[35674]:[5126,8,"mat2","mat2x2<f32>"],[35685]:[5126,8,"mat2x3","mat2x3<f32>"],[35686]:[5126,8,"mat2x4","mat2x4<f32>"],[35687]:[5126,12,"mat3x2","mat3x2<f32>"],[35675]:[5126,12,"mat3","mat3x3<f32>"],[35688]:[5126,12,"mat3x4","mat3x4<f32>"],[35689]:[5126,16,"mat4x2","mat4x2<f32>"],[35690]:[5126,16,"mat4x3","mat4x3<f32>"],[35676]:[5126,16,"mat4","mat4x4<f32>"]};function G3(t){let e=jz[t];if(!e)throw new Error("uniform");let[r,i,,n]=e;return{format:n,components:i,glType:r}}function Hz(t){let e=jz[t];if(!e)throw new Error("attribute");let[,r,,i,n]=e;return{attributeType:i,vertexFormat:n,components:r}}function Gz(t,e){let r={attributes:[],bindings:[]};r.attributes=Qne(t,e);let i=toe(t,e);for(let l of i){let u=l.uniforms.map(h=>({name:h.name,format:h.format,byteOffset:h.byteOffset,byteStride:h.byteStride,arrayLength:h.arrayLength}));r.bindings.push({type:"uniform",name:l.name,location:l.location,visibility:(l.vertex?1:0)&(l.fragment?2:0),minBindingSize:l.byteLength,uniforms:u})}let n=eoe(t,e),o=0;for(let l of n)if(Vz(l.type)){let{viewDimension:u,sampleType:h}=ioe(l.type);r.bindings.push({type:"texture",name:l.name,location:o,viewDimension:u,sampleType:h}),l.textureUnit=o,o+=1}n.length&&(r.uniforms=n);let s=$ne(t,e);return s?.length&&(r.varyings=s),r}function Qne(t,e){let r=[],i=t.getProgramParameter(e,35721);for(let n=0;n<i;n++){let o=t.getActiveAttrib(e,n);if(!o)throw new Error("activeInfo");let{name:s,type:l}=o,u=t.getAttribLocation(e,s);if(u>=0){let{attributeType:h}=Hz(l),v=/instance/i.test(s)?"instance":"vertex";r.push({name:s,location:u,stepMode:v,type:h})}}return r.sort((n,o)=>n.location-o.location),r}function $ne(t,e){let r=[],i=t.getProgramParameter(e,35971);for(let n=0;n<i;n++){let o=t.getTransformFeedbackVarying(e,n);if(!o)throw new Error("activeInfo");let{name:s,type:l,size:u}=o,{glType:h,components:v}=G3(l),T=new Id({type:h,size:u*v}),E={location:n,name:s,accessor:T};r.push(E)}return r.sort((n,o)=>n.location-o.location),r}function eoe(t,e){let r=[],i=t.getProgramParameter(e,35718);for(let n=0;n<i;n++){let o=t.getActiveUniform(e,n);if(!o)throw new Error("activeInfo");let{name:s,size:l,type:u}=o,{name:h,isArray:v}=noe(s),T=t.getUniformLocation(e,h),E={location:T,name:h,size:l,type:u,isArray:v};if(r.push(E),E.size>1)for(let M=0;M<E.size;M++){let O=`${h}[${M}]`;T=t.getUniformLocation(e,O);let F={...E,name:O,location:T};r.push(F)}}return r}function toe(t,e){let r=(o,s)=>t.getActiveUniformBlockParameter(e,o,s),i=[],n=t.getProgramParameter(e,35382);for(let o=0;o<n;o++){let s={name:t.getActiveUniformBlockName(e,o)||"",location:r(o,35391),byteLength:r(o,35392),vertex:r(o,35396),fragment:r(o,35398),uniformCount:r(o,35394),uniforms:[]},l=r(o,35395)||[],u=t.getActiveUniforms(e,l,35383),h=t.getActiveUniforms(e,l,35384),v=t.getActiveUniforms(e,l,35387),T=t.getActiveUniforms(e,l,35388);for(let E=0;E<s.uniformCount;++E){let M=t.getActiveUniform(e,l[E]);if(!M)throw new Error("activeInfo");s.uniforms.push({name:M.name,format:G3(u[E]).format,type:u[E],arrayLength:h[E],byteOffset:v[E],byteStride:T[E]})}i.push(s)}return i.sort((o,s)=>o.location-s.location),i}var roe={[35678]:["2d","float"],[35680]:["cube","float"],[35679]:["3d","float"],[35682]:["3d","depth"],[36289]:["2d-array","float"],[36292]:["2d-array","depth"],[36293]:["cube","float"],[36298]:["2d","sint"],[36299]:["3d","sint"],[36300]:["cube","sint"],[36303]:["2d-array","uint"],[36306]:["2d","uint"],[36307]:["3d","uint"],[36308]:["cube","uint"],[36311]:["2d-array","uint"]};function ioe(t){let e=roe[t];if(!e)throw new Error("sampler");let[r,i]=e;return{viewDimension:r,sampleType:i}}function noe(t){if(t[t.length-1]!=="]")return{name:t,length:1,isArray:!1};let r=/([^[]*)(\[[0-9]+\])?/.exec(t);if(!r||r.length<2)throw new Error(`Failed to parse GLSL uniform name ${t}`);return{name:r[1],length:r[2]?1:0,isArray:Boolean(r[2])}}function Wz(t,e,r,i){let n=t,o=i;o===!0&&(o=1),o===!1&&(o=0);let s=typeof o=="number"?[o]:o;switch(r){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof i!="number")throw new Error("samplers must be set to integers");return t.uniform1i(e,i);case 5126:return t.uniform1fv(e,s);case 35664:return t.uniform2fv(e,s);case 35665:return t.uniform3fv(e,s);case 35666:return t.uniform4fv(e,s);case 5124:return t.uniform1iv(e,s);case 35667:return t.uniform2iv(e,s);case 35668:return t.uniform3iv(e,s);case 35669:return t.uniform4iv(e,s);case 35670:return t.uniform1iv(e,s);case 35671:return t.uniform2iv(e,s);case 35672:return t.uniform3iv(e,s);case 35673:return t.uniform4iv(e,s);case 5125:return n.uniform1uiv(e,s,1);case 36294:return n.uniform2uiv(e,s,2);case 36295:return n.uniform3uiv(e,s,3);case 36296:return n.uniform4uiv(e,s,4);case 35674:return t.uniformMatrix2fv(e,!1,s);case 35675:return t.uniformMatrix3fv(e,!1,s);case 35676:return t.uniformMatrix4fv(e,!1,s);case 35685:return n.uniformMatrix2x3fv(e,!1,s);case 35686:return n.uniformMatrix2x4fv(e,!1,s);case 35687:return n.uniformMatrix3x2fv(e,!1,s);case 35688:return n.uniformMatrix3x4fv(e,!1,s);case 35689:return n.uniformMatrix4x2fv(e,!1,s);case 35690:return n.uniformMatrix4x3fv(e,!1,s)}throw new Error("Illegal uniform")}function qz(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"line-loop-webgl":return 2;case"triangle-list":return 4;case"triangle-strip":return 5;case"triangle-fan-webgl":return 6;default:throw new Error(t)}}function Xz(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"line-loop-webgl":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;case"triangle-fan-webgl":return 4;default:throw new Error(t)}}var Yz=4,pT=class extends Af{device;handle;vs;fs;introspectedLayout;uniforms={};bindings={};varyings=null;_uniformCount=0;_uniformSetters={};constructor(e,r){super(e,r),this.device=e,this.handle=this.props.handle||this.device.gl.createProgram(),this.device.setSpectorMetadata(this.handle,{id:this.props.id}),this.vs=r.vs,this.fs=r.fs;let{varyings:i,bufferMode:n=35981}=r;switch(i&&i.length>0&&(this.varyings=i,this.device.gl.transformFeedbackVaryings(this.handle,i,n)),this._linkShaders(),Kt.time(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=Gz(this.device.gl,this.handle),Kt.timeEnd(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=_3(this.introspectedLayout,r.shaderLayout),this.props.topology){case"triangle-fan-webgl":case"line-loop-webgl":Kt.warn(`Primitive topology ${this.props.topology} is deprecated and will be removed in v9.1`);break;default:}}destroy(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)}setBindings(e,r){for(let[i,n]of Object.entries(e)){let o=this.shaderLayout.bindings.find(s=>s.name===i)||this.shaderLayout.bindings.find(s=>s.name===`${i}Uniforms`);if(!o){let s=this.shaderLayout.bindings.map(l=>`"${l.name}"`).join(", ");r?.disableWarnings||Kt.warn(`Unknown binding "${i}" in render pipeline "${this.id}", expected one of ${s}`)();continue}switch(n||Kt.warn(`Unsetting binding "${i}" in render pipeline "${this.id}"`)(),o.type){case"uniform":if(!(n instanceof $l)&&!(n.buffer instanceof $l))throw new Error("buffer value");break;case"texture":if(!(n instanceof gf||n instanceof ec||n instanceof bh))throw new Error("texture value");break;case"sampler":Kt.warn(`Ignoring sampler ${i}`)();break;default:throw new Error(o.type)}this.bindings[i]=n}}draw(e){let{renderPass:r,parameters:i=this.props.parameters,topology:n=this.props.topology,vertexArray:o,vertexCount:s,instanceCount:l,isInstanced:u=!1,firstVertex:h=0,transformFeedback:v}=e,T=qz(n),E=Boolean(o.indexBuffer),M=o.indexBuffer?.glIndexType;if(this.linkStatus!=="success")return Kt.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable()||s===0)return Kt.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;if(s===0)return Kt.info(2,`RenderPipeline:${this.id}.draw() aborted - no vertices to draw`)(),!0;this.device.gl.useProgram(this.handle),o.bindBeforeRender(r),v&&v.begin(this.props.topology),this._applyBindings(),this._applyUniforms();let O=r;return Pz(this.device,i,O.glParameters,()=>{E&&u?this.device.gl.drawElementsInstanced(T,s||0,M,h,l||0):E?this.device.gl.drawElements(T,s||0,M,h):u?this.device.gl.drawArraysInstanced(T,h,s||0,l||0):this.device.gl.drawArrays(T,h,s||0),v&&v.end()}),o.unbindAfterRender(r),!0}setUniformsWebGL(e){let{bindings:r}=cx(e);Object.keys(r).forEach(i=>{Kt.warn(`Unsupported value "${JSON.stringify(r[i])}" used in setUniforms() for key ${i}. Use setBindings() instead?`)()}),Object.assign(this.uniforms,e)}async _linkShaders(){let{gl:e}=this.device;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),Kt.time(Yz,`linkProgram for ${this.id}`)(),e.linkProgram(this.handle),Kt.timeEnd(Yz,`linkProgram for ${this.id}`)(),Kt.level,!this.device.features.has("compilation-status-async-webgl")){let i=this._getLinkStatus();this._reportLinkStatus(i);return}Kt.once(1,"RenderPipeline linking is asynchronous")(),await this._waitForLinkComplete(),Kt.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();let r=this._getLinkStatus();this._reportLinkStatus(r)}_reportLinkStatus(e){switch(e){case"success":return;default:throw this.vs.compilationStatus==="error"?(this.vs.debugShader(),new Error(`Error during compilation of shader ${this.vs.id}`)):this.fs?.compilationStatus==="error"?(this.fs.debugShader(),new Error(`Error during compilation of shader ${this.fs.id}`)):new Error(`Error during ${e}: ${this.device.gl.getProgramInfoLog(this.handle)}`)}}_getLinkStatus(){let{gl:e}=this.device;return e.getProgramParameter(this.handle,35714)?(e.validateProgram(this.handle),e.getProgramParameter(this.handle,35715)?(this.linkStatus="success","success"):(this.linkStatus="error","validation")):(this.linkStatus="error","linking")}async _waitForLinkComplete(){let e=async n=>await new Promise(o=>setTimeout(o,n));if(!this.device.features.has("compilation-status-async-webgl")){await e(10);return}let{gl:i}=this.device;for(;;){if(i.getProgramParameter(this.handle,37297))return;await e(10)}}_areTexturesRenderable(){let e=!0;for(let[,r]of Object.entries(this.bindings))r instanceof ec&&(r.update(),e=e&&r.loaded);return e}_applyBindings(){if(this.linkStatus!=="success")return;let{gl:e}=this.device;e.useProgram(this.handle);let r=0,i=0;for(let n of this.shaderLayout.bindings){let o=this.bindings[n.name]||this.bindings[n.name.replace(/Uniforms$/,"")];if(!o)throw new Error(`No value for binding ${n.name} in ${this.id}`);switch(n.type){case"uniform":let{name:s}=n,l=e.getUniformBlockIndex(this.handle,s);if(l===4294967295)throw new Error(`Invalid uniform block name ${s}`);e.uniformBlockBinding(this.handle,i,l),o instanceof $l?e.bindBufferBase(35345,i,o.handle):e.bindBufferRange(35345,i,o.buffer.handle,o.offset||0,o.size||o.buffer.byteLength-o.offset),i+=1;break;case"texture":if(!(o instanceof gf||o instanceof ec||o instanceof bh))throw new Error("texture");let u;if(o instanceof gf)u=o.texture;else if(o instanceof ec)u=o;else if(o instanceof bh&&o.colorAttachments[0]instanceof gf)Kt.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),u=o.colorAttachments[0].texture;else throw new Error("No texture");e.activeTexture(33984+r),e.bindTexture(u.target,u.handle),r+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${n.type}' not supported in WebGL`)}}}_applyUniforms(){for(let e of this.shaderLayout.uniforms||[]){let{name:r,location:i,type:n,textureUnit:o}=e,s=this.uniforms[r]??o;s!==void 0&&Wz(this.device.gl,i,n,s)}}};var dT=class extends F0{device;commands=[];constructor(e){super(e,{}),this.device=e}submitCommands(e=this.commands){for(let r of e)switch(r.name){case"copy-buffer-to-buffer":ooe(this.device,r.options);break;case"copy-buffer-to-texture":soe(this.device,r.options);break;case"copy-texture-to-buffer":aoe(this.device,r.options);break;case"copy-texture-to-texture":loe(this.device,r.options);break}}};function ooe(t,e){let r=e.source,i=e.destination;t.gl.bindBuffer(36662,r.handle),t.gl.bindBuffer(36663,i.handle),t.gl.copyBufferSubData(36662,36663,e.sourceOffset??0,e.destinationOffset??0,e.size),t.gl.bindBuffer(36662,null),t.gl.bindBuffer(36663,null)}function soe(t,e){throw new Error("Not implemented")}function aoe(t,e){let{source:r,mipLevel:i=0,aspect:n="all",width:o=e.source.width,height:s=e.source.height,depthOrArrayLayers:l=0,origin:u=[0,0],destination:h,byteOffset:v=0,bytesPerRow:T,rowsPerImage:E}=e;if(n!=="all")throw new Error("not supported");if(i!==0||l!==0||T||E)throw new Error("not implemented");let{framebuffer:M,destroyFramebuffer:O}=Kz(r),F;try{let z=h,W=o||M.width,J=s||M.height,K=j0(M.texture.props.format),ne=K.dataFormat,ge=K.type;t.gl.bindBuffer(35051,z.handle),F=t.gl.bindFramebuffer(36160,M.handle),t.gl.readPixels(u[0],u[1],W,J,ne,ge,v)}finally{t.gl.bindBuffer(35051,null),F!==void 0&&t.gl.bindFramebuffer(36160,F),O&&M.destroy()}}function loe(t,e){let{source:r,destinationMipLevel:i=0,origin:n=[0,0],destinationOrigin:o=[0,0],destination:s}=e,{width:l=e.destination.width,height:u=e.destination.height}=e,{framebuffer:h,destroyFramebuffer:v}=Kz(r),[T,E]=n,[M,O,F]=o,z=t.gl.bindFramebuffer(36160,h.handle),W=null,J;if(s instanceof ec)W=s,l=Number.isFinite(l)?l:W.width,u=Number.isFinite(u)?u:W.height,W.bind(0),J=W.target;else throw new Error("invalid destination");switch(J){case 3553:case 34067:t.gl.copyTexSubImage2D(J,i,M,O,T,E,l,u);break;case 35866:case 32879:t.gl.copyTexSubImage3D(J,i,M,O,F,T,E,l,u);break;default:}W&&W.unbind(),t.gl.bindFramebuffer(36160,z),v&&h.destroy()}function Kz(t){if(t instanceof bo){let{width:e,height:r,id:i}=t;return{framebuffer:t.device.createFramebuffer({id:`framebuffer-for-${i}`,width:e,height:r,colorAttachments:[t]}),destroyFramebuffer:!0}}return{framebuffer:t,destroyFramebuffer:!1}}var AT=class extends L0{device;commandBuffer;constructor(e,r){super(e,r),this.device=e,this.commandBuffer=new dT(e)}destroy(){}finish(){this.commandBuffer.submitCommands()}copyBufferToBuffer(e){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:e})}copyBufferToTexture(e){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:e})}copyTextureToBuffer(e){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:e})}copyTextureToTexture(e){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:e})}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}resolveQuerySet(e,r,i){}};var H0=class extends N0{get[Symbol.toStringTag](){return"VertexArray"}device;handle;buffer=null;bufferValue=null;static isConstantAttributeZeroSupported(e){return SP()==="Chrome"}constructor(e,r){super(e,r),this.device=e,this.handle=this.device.gl.createVertexArray()}destroy(){super.destroy(),this.buffer&&this.buffer?.destroy(),this.handle&&(this.device.gl.deleteVertexArray(this.handle),this.handle=void 0)}setIndexBuffer(e){let r=e;if(r&&r.glTarget!==34963)throw new Error("Use .setBuffer()");this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34963,r?r.handle:null),this.indexBuffer=r,this.device.gl.bindVertexArray(null)}setBuffer(e,r){let i=r;if(i.glTarget===34963)throw new Error("Use .setIndexBuffer()");let{size:n,type:o,stride:s,offset:l,normalized:u,integer:h,divisor:v}=this._getAccessor(e);this.device.gl.bindVertexArray(this.handle),this.device.gl.bindBuffer(34962,i.handle),h?this.device.gl.vertexAttribIPointer(e,n,o,s,l):this.device.gl.vertexAttribPointer(e,n,o,u,s,l),this.device.gl.bindBuffer(34962,null),this.device.gl.enableVertexAttribArray(e),this.device.gl.vertexAttribDivisor(e,v||0),this.attributes[e]=i,this.device.gl.bindVertexArray(null)}setConstantWebGL(e,r){this._enable(e,!1),this.attributes[e]=r}bindBeforeRender(){this.device.gl.bindVertexArray(this.handle),this._applyConstantAttributes()}unbindAfterRender(){this.device.gl.bindVertexArray(null)}_applyConstantAttributes(){for(let e=0;e<this.maxVertexAttributes;++e){let r=this.attributes[e];ArrayBuffer.isView(r)&&this.device.setConstantAttributeWebGL(e,r)}}_getAccessor(e){let r=this.attributeInfos[e];if(!r)throw new Error(`Unknown attribute location ${e}`);let i=Q2(r.bufferDataType);return{size:r.bufferComponents,type:i,stride:r.byteStride,offset:r.byteOffset,normalized:r.normalized,integer:r.integer,divisor:r.stepMode==="instance"?1:0}}_enable(e,r=!0){let n=H0.isConstantAttributeZeroSupported(this.device)||e!==0;(r||n)&&(e=Number(e),this.device.gl.bindVertexArray(this.handle),r?this.device.gl.enableVertexAttribArray(e):this.device.gl.disableVertexAttribArray(e),this.device.gl.bindVertexArray(null))}getConstantBuffer(e,r){let i=coe(r),n=i.byteLength*e,o=i.length*e;if(this.buffer&&n!==this.buffer.byteLength)throw new Error(`Buffer size is immutable, byte length ${n} !== ${this.buffer.byteLength}.`);let s=!this.buffer;if(this.buffer=this.buffer||this.device.createBuffer({byteLength:n}),s=s||!uoe(i,this.bufferValue),s){let l=b3(r.constructor,o);w3({target:l,source:i,start:0,count:o}),this.buffer.write(l),this.bufferValue=r}return this.buffer}};function coe(t){return Array.isArray(t)?new Float32Array(t):t}function uoe(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}var mT=class extends k0{device;gl;handle;layout;buffers={};unusedBuffers={};bindOnUse=!0;_bound=!1;constructor(e,r){super(e,r),this.device=e,this.gl=e.gl,this.handle=this.props.handle||this.gl.createTransformFeedback(),this.layout=this.props.layout,r.buffers&&this.setBuffers(r.buffers),Object.seal(this)}destroy(){this.gl.deleteTransformFeedback(this.handle),super.destroy()}begin(e="point-list"){this.gl.bindTransformFeedback(36386,this.handle),this.bindOnUse&&this._bindBuffers(),this.gl.beginTransformFeedback(Xz(e))}end(){this.gl.endTransformFeedback(),this.bindOnUse&&this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null)}setBuffers(e){this.buffers={},this.unusedBuffers={},this.bind(()=>{for(let r in e)this.setBuffer(r,e[r])})}setBuffer(e,r){let i=this._getVaryingIndex(e),{buffer:n,byteLength:o,byteOffset:s}=this._getBufferRange(r);if(i<0){this.unusedBuffers[e]=n,Kt.warn(`${this.id} unusedBuffers varying buffer ${e}`)();return}this.buffers[i]={buffer:n,byteLength:o,byteOffset:s},this.bindOnUse||this._bindBuffer(i,n,s,o)}getBuffer(e){if(Zz(e))return this.buffers[e]||null;let r=this._getVaryingIndex(e);return r>=0?this.buffers[r]:null}bind(e=this.handle){if(typeof e!="function")return this.gl.bindTransformFeedback(36386,e),this;let r;return this._bound?r=e():(this.gl.bindTransformFeedback(36386,this.handle),this._bound=!0,r=e(),this._bound=!1,this.gl.bindTransformFeedback(36386,null)),r}unbind(){this.bind(null)}_getBufferRange(e){if(e instanceof $l)return{buffer:e,byteOffset:0,byteLength:e.byteLength};let{buffer:r,byteOffset:i=0,byteLength:n=e.buffer.byteLength}=e;return{buffer:r,byteOffset:i,byteLength:n}}_getVaryingIndex(e){if(Zz(e))return Number(e);for(let r of this.layout.varyings)if(e===r.name)return r.location;return-1}_bindBuffers(){for(let e in this.buffers){let{buffer:r,byteLength:i,byteOffset:n}=this._getBufferRange(this.buffers[e]);this._bindBuffer(Number(e),r,n,i)}}_unbindBuffers(){for(let e in this.buffers)this.gl.bindBufferBase(35982,Number(e),null)}_bindBuffer(e,r,i=0,n){let o=r&&r.handle;!o||n===void 0?this.gl.bindBufferBase(35982,e,o):this.gl.bindBufferRange(35982,e,o,i,n)}};function Zz(t){return typeof t=="number"?Number.isInteger(t):/^\d+$/.test(t)}var gT=class extends U0{device;handle;target=null;_queryPending=!1;_pollingPromise=null;get[Symbol.toStringTag](){return"Query"}constructor(e,r){if(super(e,r),this.device=e,r.count>1)throw new Error("WebGL QuerySet can only have one value");this.handle=this.device.gl.createQuery(),Object.seal(this)}destroy(){this.device.gl.deleteQuery(this.handle)}beginTimestampQuery(){return this._begin(35007)}endTimestampQuery(){this._end()}beginOcclusionQuery(e){return this._begin(e?.conservative?36202:35887)}endOcclusionQuery(){this._end()}beginTransformFeedbackQuery(){return this._begin(35976)}endTransformFeedbackQuery(){this._end()}async resolveQuery(){return[await this.pollQuery()]}_begin(e){this._queryPending||(this.target=e,this.device.gl.beginQuery(this.target,this.handle))}_end(){this._queryPending||this.target&&(this.device.gl.endQuery(this.target),this.target=null,this._queryPending=!0)}isResultAvailable(){if(!this._queryPending)return!1;let e=this.device.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.device.gl.getParameter(36795)}getResult(){return this.device.gl.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}pollQuery(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let r=0;return this._pollingPromise=new Promise((i,n)=>{let o=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):r++>e?(n("Timed out"),this._pollingPromise=null):requestAnimationFrame(o)};requestAnimationFrame(o)}),this._pollingPromise}};function W3(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Yi(!1),0}}function Jz(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Yi(!1),0}}function Qz(t,e){let{sourceX:r=0,sourceY:i=0,sourceFormat:n=6408,sourceAttachment:o=36064}=e||{},{target:s=null,sourceWidth:l,sourceHeight:u,sourceType:h}=e||{},{framebuffer:v,deleteFramebuffer:T}=e5(t);Yi(v);let{gl:E,handle:M}=v;l=l||v.width,u=u||v.height;let O=o-36064;h=h||v.colorAttachments[O]?.texture?.type||5121,s=hoe(s,h,n,l,u),h=h||zz(s);let F=E.bindFramebuffer(36160,M);return E.readPixels(r,i,l,u,n,h,s),E.bindFramebuffer(36160,F||null),T&&v.destroy(),s}function $z(t,e){let{target:r,sourceX:i=0,sourceY:n=0,sourceFormat:o=6408,targetByteOffset:s=0}=e||{},{sourceWidth:l,sourceHeight:u,sourceType:h}=e||{},{framebuffer:v,deleteFramebuffer:T}=e5(t);Yi(v),l=l||v.width,u=u||v.height;let E=v;h=h||5121;let M=r;if(!M){let F=W3(o),z=Jz(h),W=s+l*u*F*z;M=E.device.createBuffer({byteLength:W})}let O=t.device.createCommandEncoder();return O.copyTextureToBuffer({source:t,width:l,height:u,origin:[i,n],destination:M,byteOffset:s}),O.destroy(),T&&v.destroy(),M}function e5(t){return t instanceof _h?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:foe(t),deleteFramebuffer:!0}}function foe(t,e){let{device:r,width:i,height:n,id:o}=t;return r.createFramebuffer({...e,id:`framebuffer-for-${o}`,width:i,height:n,colorAttachments:[t]})}function hoe(t,e,r,i,n){if(t)return t;e=e||5121;let o=_x(e,{clamped:!1}),s=W3(r);return new o(i*n*s)}var poe=256,doe=1024,Aoe=16384;var moe="clear: bad arguments";function t5(t,e){let{framebuffer:r=null,color:i=null,depth:n=null,stencil:o=null}=e||{},s={};r&&(s.framebuffer=r);let l=0;i&&(l|=Aoe,i!==!0&&(s.clearColor=i)),n&&(l|=poe,n!==!0&&(s.clearDepth=n)),o&&(l|=doe,n!==!0&&(s.clearStencil=n)),Yi(l!==0,moe);let u=t.gl;Iu(u,s,()=>{u.clear(l)})}var yx=1,G0=class extends Yc{type="webgl";handle;features;limits;info;canvasContext;lost;_resolveContextLost;static isSupported(){return typeof WebGL2RenderingContext<"u"}static attach(e){if(e instanceof G0)return e;if(e?.device instanceof Yc)return e.device;if(!goe(e))throw new Error("Invalid WebGL2RenderingContext");return new G0({gl:e})}static async create(e={}){Kt.groupCollapsed(yx,"WebGLDevice created")();let r=[];e.debug&&r.push(Fz()),e.spector&&r.push(Oz()),typeof e.canvas=="string"&&r.push(Td.pageLoaded);let i=await Promise.allSettled(r);for(let s of i)s.status==="rejected"&&Kt.error(`Failed to initialize debug libraries ${s.reason}`)();if(Kt.probe(yx+1,"DOM is loaded")(),e.gl?.device)return Kt.warn("reattaching existing device")(),G0.attach(e.gl);let n=new G0(e),o=`Created ${n.type}${n.debug?" debug":""} context: ${n.info.vendor}, ${n.info.renderer} for canvas: ${n.canvasContext.id}`;return Kt.probe(yx,o)(),Kt.table(yx,n.info)(),Kt.groupEnd(yx)(),n}constructor(e){super({...e,id:e.id||oa("webgl-device")});let r=e.gl?.device;if(r)throw new Error(`WebGL context already attached to device ${r.id}`);let i=e.gl?.canvas||e.canvas;this.canvasContext=new uT(this,{...e,canvas:i}),this.lost=new Promise(l=>{this._resolveContextLost=l});let n=e.gl||null;if(n||=gz(this.canvasContext.canvas,{...e,onContextLost:l=>this._resolveContextLost?.({reason:"destroyed",message:"Entered sleep mode, or too many apps or browser tabs are using the GPU."})}),!n)throw new Error("WebGL context creation failed");this.handle=n,this.gl=n,this.gl.device=this,this.gl._version=2,e.spector&&(this.spectorJS=Dz({...this.props,canvas:this.handle.canvas})),this.info=_z(this.gl,this._extensions),this.limits=new oT(this.gl),this.features=new nT(this.gl,this._extensions,this.props.disabledFeatures),this.props.initalizeFeatures&&this.features.initializeFeatures(),this.canvasContext.resize();let{enable:o=!0,copyState:s=!1}=e;O3(this.gl,{enable:o,copyState:s,log:(...l)=>Kt.log(1,...l)()}),e.debug&&(this.gl=Nz(this.gl,{...e,throwOnError:!0}),this.debug=!0,Kt.level=Math.max(Kt.level,1),Kt.warn("WebGL debug mode activated. Performance reduced.")())}destroy(){}get isLost(){return this.gl.isContextLost()}getSize(){return[this.gl.drawingBufferWidth,this.gl.drawingBufferHeight]}isTextureFormatSupported(e){return iT(this.gl,e,this._extensions)}isTextureFormatFilterable(e){return Ez(this.gl,e,this._extensions)}isTextureFormatRenderable(e){return Sz(this.gl,e,this._extensions)}createCanvasContext(e){throw new Error("WebGL only supports a single canvas")}createBuffer(e){let r=this._getBufferProps(e);return new $l(this,r)}_createTexture(e){return new ec(this,e)}createExternalTexture(e){throw new Error("createExternalTexture() not implemented")}createSampler(e){return new om(this,e)}createShader(e){return new fT(this,e)}createFramebuffer(e){return new bh(this,e)}createVertexArray(e){return new H0(this,e)}createTransformFeedback(e){return new mT(this,e)}createQuerySet(e){return new gT(this,e)}createRenderPipeline(e){return new pT(this,e)}beginRenderPass(e){return new hT(this,e)}createComputePipeline(e){throw new Error("ComputePipeline not supported in WebGL")}beginComputePass(e){throw new Error("ComputePass not supported in WebGL")}renderPass=null;createCommandEncoder(e){return new AT(this,e)}submit(){this.renderPass?.end(),this.renderPass=null}readPixelsToArrayWebGL(e,r){return Qz(e,r)}readPixelsToBufferWebGL(e,r){return $z(e,r)}setParametersWebGL(e){mf(this.gl,e)}getParametersWebGL(e){return J2(this.gl,e)}withParametersWebGL(e,r){return Iu(this.gl,e,r)}clearWebGL(e){t5(this,e)}resetWebGL(){Kt.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")(),dz(this.gl)}gl;debug=!1;_canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1};_extensions={};_polyfilled=!1;spectorJS;loseDevice(){let e=!1,i=this.getExtension("WEBGL_lose_context").WEBGL_lose_context;return i&&(e=!0,i.loseContext()),this._resolveContextLost?.({reason:"destroyed",message:"Application triggered context loss"}),e}pushState(){Md(this.gl)}popState(){mp(this.gl)}setSpectorMetadata(e,r){e.__SPECTOR_Metadata=r}getGLKey(e,r){r=r||this.gl2||this.gl;let i=Number(e);for(let n in r)if(r[n]===i)return`GL.${n}`;return String(e)}_constants;setConstantAttributeWebGL(e,r){let i=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(i).fill(null);let n=this._constants[e];switch(n&&xoe(n,r)&&Kt.info(1,`setConstantAttributeWebGL(${e}) could have been skipped, value unchanged`)(),this._constants[e]=r,r.constructor){case Float32Array:_oe(this,e,r);break;case Int32Array:yoe(this,e,r);break;case Uint32Array:voe(this,e,r);break;default:Yi(!1)}}getExtension(e){return Mu(this.gl,e,this._extensions),this._extensions}},wh=G0;Yr(wh,"type","webgl");function goe(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&Number.isFinite(t._version))}function _oe(t,e,r){switch(r.length){case 1:t.gl.vertexAttrib1fv(e,r);break;case 2:t.gl.vertexAttrib2fv(e,r);break;case 3:t.gl.vertexAttrib3fv(e,r);break;case 4:t.gl.vertexAttrib4fv(e,r);break;default:Yi(!1)}}function yoe(t,e,r){t.gl.vertexAttribI4iv(e,r)}function voe(t,e,r){t.gl.vertexAttribI4uiv(e,r)}function xoe(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}var r5,i5,o5={fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif',display:"flex",flex:"wrap",maxWidth:"500px",flexDirection:"column",zIndex:2};function _T(){return document.createElement("div")}function boe(t){if(!t.picked)return null;if(t.object===r5)return i5;let e={html:Toe(t.object),style:o5};return i5=e,r5=t.object,e}var woe=new Set(["position","index"]);function Toe(t){let e=_T();for(let r in t){if(woe.has(r))continue;let i=_T();i.className="header",i.textContent=r;let n=_T();n.className="value",n.textContent=Soe(t[r]);let o=_T();Eoe(o,i,n),o.appendChild(i),o.appendChild(n),e.appendChild(o)}return e.innerHTML}function Eoe(t,e,r){Object.assign(e.style,{fontWeight:700,marginRight:"10px",flex:"1 1 0%"}),Object.assign(r.style,{flex:"none",maxWidth:"250px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),Object.assign(t.style,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"stretch"})}function Soe(t){let e;if(Array.isArray(t)&&t.length>4)e=`Array<${t.length}>`;else if(typeof t=="string")e=t;else if(typeof t=="number")e=String(t);else try{e=JSON.stringify(t)}catch{e="<Non-Serializable Object>"}let r=50;return e.length>r&&(e=e.slice(0,r)),e}function n5(t,e){let r,i=t,n="properties",o=/{[^}]*}/g,s=u=>u.replace(/[{}]/g,""),l=[...new Set(t.match(o).map(s))];for(let u of l){if(u.includes(".")){r=e;let h=u.split(".");for(let v of h)if(r.hasOwnProperty(v))r=r[v];else{r=void 0;break}}else e.hasOwnProperty(u)?r=e[u]:e[n]&&e[n].hasOwnProperty(u)?r=e[n][u]:r=void 0;i=i.replaceAll(`{${u}}`,r)}return i}function q3(t){return t?t.html||t.text?e=>{if(!e.picked)return null;let r={style:t.style||o5};return t.html?r.html=n5(t.html,e.object):r.text=n5(t.text,e.object),r}:boe:null}function s5(t){let e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,document.getElementsByTagName("head")[0].appendChild(e)}function a5(t,e){let r=document.createElement("div");return r.style.width=Number.isFinite(t)?`${t}px`:t,r.style.height=`${e}px`,r.style.position="relative",r}var c5=ga(l5()),Coe="https://api.tiles.mapbox.com/mapbox-gl-js/v1.13.2/mapbox-gl.css",K3=c5.default;function u5(t=Coe){s5(t)}function f5(){let t=["mapboxgl-missing-css"];for(let e of t){let r=document.getElementsByClassName(e)[0];r&&r.style&&(r.style.display="none")}}var Z3={};function h5(t){if(!Z3[t]){let e=document.createElement("script");e.type="text/javascript",e.src=t,document.querySelector("head").appendChild(e),Z3[t]=new Promise(i=>{e.onload=i})}return Z3[t]}var p5="4.2.0-beta.2";var Moe=globalThis.loaders?.parseImageNode,J3=typeof Image<"u",Q3=typeof ImageBitmap<"u",Ioe=Boolean(Moe),$3=Ap?!0:Ioe;function d5(t){switch(t){case"auto":return Q3||J3||$3;case"imagebitmap":return Q3;case"image":return J3;case"data":return $3;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function A5(){if(Q3)return"imagebitmap";if(J3)return"image";if($3)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function m5(t){let e=Poe(t);if(!e)throw new Error("Not an image");return e}function vx(t){switch(m5(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function Poe(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var Roe=/^data:image\/svg\+xml/,Boe=/\.svg((\?|#).*)?$/;function yT(t){return t&&(Roe.test(t)||Boe.test(t))}function g5(t,e){if(yT(e)){let i=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return eR(t,e)}function eR(t,e){if(yT(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function vT(t,e,r){let i=g5(t,r),n=self.URL||self.webkitURL,o=typeof i!="string"&&n.createObjectURL(i);try{return await Ooe(o||i,e)}finally{o&&n.revokeObjectURL(o)}}async function Ooe(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((i,n)=>{try{r.onload=()=>i(r),r.onerror=o=>{let s=o instanceof Error?o.message:"error";n(new Error(s))}}catch(o){n(o)}})}var Doe={},_5=!0;async function y5(t,e,r){let i;yT(r)?i=await vT(t,e,r):i=eR(t,r);let n=e&&e.imagebitmap;return await Loe(i,n)}async function Loe(t,e=null){if((Foe(e)||!_5)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),_5=!1}return await createImageBitmap(t)}function Foe(t){for(let e in t||Doe)return!1;return!0}function v5(t){return!zoe(t,"ftyp",4)||!(t[8]&96)?null:Noe(t)}function Noe(t){switch(koe(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function koe(t,e,r){return String.fromCharCode(...t.slice(e,r))}function Uoe(t){return[...t].map(e=>e.charCodeAt(0))}function zoe(t,e,r=0){let i=Uoe(e);for(let n=0;n<i.length;++n)if(i[n]!==t[n+r])return!1;return!0}var Th=!1,xx=!0;function sm(t){let e=bx(t);return joe(e)||Woe(e)||Hoe(e)||Goe(e)||Voe(e)}function Voe(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=v5(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function joe(t){let e=bx(t);return e.byteLength>=24&&e.getUint32(0,Th)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Th),height:e.getUint32(20,Th)}:null}function Hoe(t){let e=bx(t);return e.byteLength>=10&&e.getUint32(0,Th)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,xx),height:e.getUint16(8,xx)}:null}function Goe(t){let e=bx(t);return e.byteLength>=14&&e.getUint16(0,Th)===16973&&e.getUint32(2,xx)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,xx),height:e.getUint32(22,xx)}:null}function Woe(t){let e=bx(t);if(!(e.byteLength>=3&&e.getUint16(0,Th)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:n}=qoe(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,Th);if(n.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,Th),width:e.getUint16(o+7,Th)};if(!i.has(s))return null;o+=2,o+=e.getUint16(o,Th)}return null}function qoe(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function bx(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function x5(t,e){let{mimeType:r}=sm(t)||{},i=globalThis.loaders?.parseImageNode;return On(i),await i(t,r)}async function b5(t,e,r){e=e||{};let n=(e.image||{}).type||"auto",{url:o}=r||{},s=Xoe(n),l;switch(s){case"imagebitmap":l=await y5(t,e,o);break;case"image":l=await vT(t,e,o);break;case"data":l=await x5(t,e);break;default:On(!1)}return n==="data"&&(l=vx(l)),l}function Xoe(t){switch(t){case"auto":case"data":return A5();default:return d5(t),t}}var Yoe=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Koe=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Zoe={image:{type:"auto",decode:!0}},Eh={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:p5,mimeTypes:Koe,extensions:Yoe,parse:b5,tests:[t=>Boolean(sm(new DataView(t)))],options:Zoe};var tR={};function rR(t){if(tR[t]===void 0){let e=Ap?Qoe(t):Joe(t);tR[t]=e}return tR[t]}function Joe(t){let e=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||e,i=globalThis.loaders?.parseImageNode;return Boolean(i)&&r.includes(t)}function Qoe(t){switch(t){case"image/avif":case"image/webp":return $oe(t);default:return!0}}function $oe(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}var ese=new bc({id:"deck"}),ur=ese;var iR={};function w5(t){iR=t}function Ks(t,e,r,i){ur.level>0&&iR[t]&&iR[t].call(null,e,r,i)}function tse(t){let e=t[0],r=t[t.length-1];return e==="{"&&r==="}"||e==="["&&r==="]"}var T5={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:tse,parseTextSync:JSON.parse};function rse(){let t="9.0.18",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${t}`);return e||(ur.log(1,`deck.gl ${t}`)(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:ur,_registerLoggers:w5},tm([T5,[Eh,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}var xT=rse();function Sh(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}var nR={number:{type:"number",validate(t,e){return Number.isFinite(t)&&typeof e=="object"&&(e.max===void 0||t<=e.max)&&(e.min===void 0||t>=e.min)}},array:{type:"array",validate(t,e){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function S5(t){let e={};for(let[r,i]of Object.entries(t))e[r]=ise(i);return e}function C5(t,e,r){let i={};for(let[n,o]of Object.entries(e))t&&n in t&&!o.private?(o.validate&&Sh(o.validate(t[n],o),`${r}: invalid ${n}`),i[n]=t[n]):i[n]=o.value;return i}function ise(t){let e=E5(t);if(e!=="object")return{value:t,...nR[e],type:e};if(typeof t=="object")return t?t.type!==void 0?{...t,...nR[t.type],type:t.type}:t.value===void 0?{type:"object",value:t}:(e=E5(t.value),{...t,...nR[e],type:e}):{type:"object",value:null};throw new Error("props")}function E5(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}var M5=`#ifdef MODULE_LOGDEPTH
554
554
  logdepth_adjustPosition(gl_Position);
555
555
  #endif
556
556
  `,I5=`#ifdef MODULE_MATERIAL
@@ -3690,7 +3690,7 @@ clip_commonPosition = geometry.position.xy;
3690
3690
  in vec2 clip_commonPosition;
3691
3691
  `,"fs:DECKGL_FILTER_COLOR":`
3692
3692
  if (!clip_isInBounds(clip_commonPosition)) discard;
3693
- `},sM=class extends Nm{getShaders(){let e="instancePositions"in this.getAttributeManager().attributes;return this.props.clipByInstance!==void 0&&(e=Boolean(this.props.clipByInstance)),this.state.clipByInstance=e,e?{modules:[j1e],inject:H1e}:{modules:[G1e],inject:W1e}}draw({uniforms:e}){let{clipBounds:r}=this.props;if(this.state.clipByInstance)e.clip_bounds=r;else{let i=this.projectPosition([r[0],r[1],0]),n=this.projectPosition([r[2],r[3],0]);e.clip_bounds=[Math.min(i[0],n[0]),Math.min(i[1],n[1]),Math.max(i[0],n[0]),Math.max(i[1],n[1])]}}},ay=sM;(()=>{sM.defaultProps=V1e})(),(()=>{sM.extensionName="ClipExtension"})();function uF(t,e,r){let i=q1e(t),n=Object.keys(i).filter(o=>i[o]!==Array);return X1e(t,{propArrayTypes:i,...e},{numericPropKeys:r&&r.numericPropKeys||n,PositionDataType:r?r.PositionDataType:Float32Array,triangulate:r?r.triangulate:!0})}function q1e(t){let e={};for(let r of t)if(r.properties)for(let i in r.properties){let n=r.properties[i];e[i]=$1e(n,e[i])}return e}function X1e(t,e,r){let{pointPositionsCount:i,pointFeaturesCount:n,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:l,polygonPositionsCount:u,polygonObjectsCount:h,polygonRingsCount:v,polygonFeaturesCount:T,propArrayTypes:E,coordLength:M}=e,{numericPropKeys:O=[],PositionDataType:F=Float32Array,triangulate:z=!0}=r,W=t[0]&&"id"in t[0],J=t.length>65535?Uint32Array:Uint16Array,K={type:"Point",positions:new F(i*M),globalFeatureIds:new J(i),featureIds:n>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:[],fields:[]},ne={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new F(o*M),globalFeatureIds:new J(o),featureIds:l>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},ge={type:"Polygon",polygonIndices:u>65535?new Uint32Array(h+1):new Uint16Array(h+1),primitivePolygonIndices:u>65535?new Uint32Array(v+1):new Uint16Array(v+1),positions:new F(u*M),globalFeatureIds:new J(u),featureIds:T>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]};z&&(ge.triangles=[]);for(let me of[K,ne,ge])for(let fe of O){let $=E[fe];me.numericProps[fe]=new $(me.positions.length/M)}ne.pathIndices[s]=o,ge.polygonIndices[h]=u,ge.primitivePolygonIndices[v]=u;let H={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let me of t){let fe=me.geometry,$=me.properties||{};switch(fe.type){case"Point":Y1e(fe,K,H,M,$),K.properties.push(cF($,O)),W&&K.fields.push({id:me.id}),H.pointFeature++;break;case"LineString":K1e(fe,ne,H,M,$),ne.properties.push(cF($,O)),W&&ne.fields.push({id:me.id}),H.lineFeature++;break;case"Polygon":Z1e(fe,ge,H,M,$),ge.properties.push(cF($,O)),W&&ge.fields.push({id:me.id}),H.polygonFeature++;break;default:throw new Error("Invalid geometry type")}H.feature++}return Q1e(K,ne,ge,M)}function Y1e(t,e,r,i,n){e.positions.set(t.data,r.pointPosition*i);let o=t.data.length/i;fF(e,n,r.pointPosition,o),e.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+o),e.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+o),r.pointPosition+=o}function K1e(t,e,r,i,n){e.positions.set(t.data,r.linePosition*i);let o=t.data.length/i;fF(e,n,r.linePosition,o),e.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+o),e.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+o);for(let s=0,l=t.indices.length;s<l;++s){let u=t.indices[s],h=s===l-1?t.data.length:t.indices[s+1];e.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(h-u)/i}}function Z1e(t,e,r,i,n){e.positions.set(t.data,r.polygonPosition*i);let o=t.data.length/i;fF(e,n,r.polygonPosition,o),e.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+o),e.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+o);for(let s=0,l=t.indices.length;s<l;++s){let u=r.polygonPosition;e.polygonIndices[r.polygonObject++]=u;let h=t.areas[s],v=t.indices[s],T=t.indices[s+1];for(let M=0,O=v.length;M<O;++M){let F=v[M],z=M===O-1?T===void 0?t.data.length:T[0]:v[M+1];e.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(z-F)/i}let E=r.polygonPosition;J1e(e,h,v,{startPosition:u,endPosition:E,coordLength:i})}}function J1e(t,e,r,{startPosition:i,endPosition:n,coordLength:o}){if(!t.triangles)return;let s=i*o,l=n*o,u=t.positions.subarray(s,l),h=r[0],v=r.slice(1).map(E=>(E-h)/o),T=OO(u,v,o,e);for(let E=0,M=T.length;E<M;++E)t.triangles.push(i+T[E])}function lF(t,e){let r={};for(let i in t)r[i]={value:t[i],size:e};return r}function Q1e(t,e,r,i){let n={shape:"binary-feature-collection",points:{...t,positions:{value:t.positions,size:i},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:lF(t.numericProps,1)},lines:{...e,positions:{value:e.positions,size:i},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:lF(e.numericProps,1)},polygons:{...r,positions:{value:r.positions,size:i},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:lF(r.numericProps,1)}};return n.polygons&&r.triangles&&(n.polygons.triangles={value:new Uint32Array(r.triangles),size:1}),n}function fF(t,e,r,i){for(let n in t.numericProps)if(n in e){let o=e[n];t.numericProps[n].fill(o,r,r+i)}}function cF(t,e){let r={};for(let i in t)e.includes(i)||(r[i]=t[i]);return r}function $1e(t,e){return e===Array||!Number.isFinite(t)?Array:e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array}function cM(t,e){let r=e?.globalFeatureId;return r!==void 0?ebe(t,r):tbe(t,e?.type)}function ebe(t,e){let r=aY(t);for(let i of r){let n=0,o=i.featureIds.value[0];for(let s=0;s<i.featureIds.value.length;s++){let l=i.featureIds.value[s];if(l!==o){if(e===i.globalFeatureIds.value[n])return aM(i,n,s);n=s,o=l}}if(e===i.globalFeatureIds.value[n])return aM(i,n,i.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}function tbe(t,e){let r=aY(t,e);return rbe(r)}function sY(t,e,r){switch(t.type){case"Point":return sbe(t,e,r);case"LineString":return obe(t,e,r);case"Polygon":return lY(t,e,r);default:let i=t;throw new Error(`Unsupported geometry type: ${i?.type}`)}}function aY(t,e){let r=[];return t.points&&(t.points.type="Point",r.push(t.points)),t.lines&&(t.lines.type="LineString",r.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",r.push(t.polygons)),r}function rbe(t){let e=[];for(let r of t){if(r.featureIds.value.length===0)continue;let i=0,n=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let s=r.featureIds.value[o];s!==n&&(e.push(aM(r,i,o)),i=o,n=s)}e.push(aM(r,i,r.featureIds.value.length))}return e}function aM(t,e,r){let i=sY(t,e,r),n=nbe(t,e,r),o=ibe(t,e,r);return{type:"Feature",geometry:i,properties:n,...o}}function ibe(t,e=0,r){return t.fields&&t.fields[t.featureIds.value[e]]}function nbe(t,e=0,r){let i=Object.assign({},t.properties[t.featureIds.value[e]]);for(let n in t.numericProps)i[n]=t.numericProps[n].value[e];return i}function lY(t,e=-1/0,r=1/0){let{positions:i}=t,n=t.polygonIndices.value.filter(u=>u>=e&&u<=r),o=t.primitivePolygonIndices.value.filter(u=>u>=e&&u<=r);if(!(n.length>2)){let u=[];for(let h=0;h<o.length-1;h++){let v=o[h],T=o[h+1],E=lM(i,v,T);u.push(E)}return{type:"Polygon",coordinates:u}}let l=[];for(let u=0;u<n.length-1;u++){let h=n[u],v=n[u+1],T=lY(t,h,v).coordinates;l.push(T)}return{type:"MultiPolygon",coordinates:l}}function obe(t,e=-1/0,r=1/0){let{positions:i}=t,n=t.pathIndices.value.filter(l=>l>=e&&l<=r);if(!(n.length>2))return{type:"LineString",coordinates:lM(i,n[0],n[1])};let s=[];for(let l=0;l<n.length-1;l++){let u=lM(i,n[l],n[l+1]);s.push(u)}return{type:"MultiLineString",coordinates:s}}function sbe(t,e,r){let{positions:i}=t,n=lM(i,e,r);return n.length>1?{type:"MultiPoint",coordinates:n}:{type:"Point",coordinates:n[0]}}function lM(t,e,r){e=e||0,r=r||t.value.length/t.size;let i=[];for(let n=e;n<r;n++){let o=Array();for(let s=n*t.size;s<(n+1)*t.size;s++)o.push(Number(t.value[s]));i.push(o)}return i}var _F=ga(AY(),1);function mY(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let o=0;o<e;o++){let s=Tbe(t[o]);s!==0&&(n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[o]]):i&&i.push(t[o]))}return i&&r.push(i),r}function Tbe(t){let e=0;for(let r=0,i=t.length-1,n,o;r<t.length;i=r++)n=t[r],o=t[i],e+=(o[0]-n[0])*(n[1]+o[1]);return e}function gY(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?Ebe(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function Ebe(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}var uy=class{properties;extent;type;id;_pbf;_geometry;_keys;_values;static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(e,r,i,n,o){this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=n,this._values=o,e.readFields(gY,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,i=1,n=0,o=0,s=0,l=[],u;for(;e.pos<r;){if(n<=0){let h=e.readVarint();i=h&7,n=h>>3}if(n--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),i===1&&(u&&l.push(u),u=[]),u&&u.push([o,s]);else if(i===7)u&&u.push(u[0].slice());else throw new Error(`unknown command ${i}`)}return u&&l.push(u),l}bbox(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,i=1,n=0,o=0,s=0,l=1/0,u=-1/0,h=1/0,v=-1/0;for(;e.pos<r;){if(n<=0){let T=e.readVarint();i=T&7,n=T>>3}if(n--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),o<l&&(l=o),o>u&&(u=o),s<h&&(h=s),s>v&&(v=s);else if(i!==7)throw new Error(`unknown command ${i}`)}return[l,h,u,v]}_toGeoJSON(e){let r=this.loadGeometry(),i=uy.types[this.type],n,o;switch(this.type){case 1:let l=[];for(n=0;n<r.length;n++)l[n]=r[n][0];r=l,e(r,this);break;case 2:for(n=0;n<r.length;n++)e(r[n],this);break;case 3:for(r=mY(r),n=0;n<r.length;n++)for(o=0;o<r[n].length;o++)e(r[n][o],this);break}r.length===1?r=r[0]:i=`Multi${i}`;let s={type:"Feature",geometry:{type:i,coordinates:r},properties:this.properties};return this.id!==null&&(s.id=this.id),s}toGeoJSON(e){if(typeof e=="function")return this._toGeoJSON(e);let{x:r,y:i,z:n}=e,o=this.extent*Math.pow(2,n),s=this.extent*r,l=this.extent*i;function u(h){for(let v=0;v<h.length;v++){let T=h[v];T[0]=(T[0]+s)*360/o-180;let E=180-(T[1]+l)*360/o;T[1]=360/Math.PI*Math.atan(Math.exp(E*Math.PI/180))-90}}return this._toGeoJSON(u)}};var hM=class{version;name;extent;length;_pbf;_keys;_values;_features;constructor(e,r){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Sbe,this,r),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let r=this._pbf.readVarint()+this._pbf.pos;return new uy(this._pbf,r,this.extent,this._keys,this._values)}};function Sbe(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(Cbe(r)))}function Cbe(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint()>>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}return e}var pM=class{layers;constructor(e,r){this.layers=e.readFields(Mbe,{},r)}};function Mbe(t,e,r){if(t===3&&r){let i=new hM(r,r.readVarint()+r.pos);i.length&&e&&(e[i.name]=i)}}function _Y(t){let e=t.indices.length,r="Polygon";if(e<=1)return{type:r,data:t.data,areas:[[Xd(t.data)]],indices:[t.indices]};let i=[],n=[],o=[],s=[],l,u=0;for(let h,v=0,T;v<e;v++){T=t.indices[v]-u,h=t.indices[v+1]-u||t.data.length;let E=t.data.slice(T,h),M=Xd(E);if(M===0){let O=t.data.slice(0,T),F=t.data.slice(h);t.data=O.concat(F),u+=h-T;continue}l===void 0&&(l=M<0),l===M<0?(s.length&&(i.push(o),n.push(s)),s=[T],o=[M]):(o.push(M),s.push(T))}return o&&i.push(o),s.length&&n.push(s),{type:r,areas:i,indices:n,data:t.data}}function yY(t,e,r,i){for(let n=0,o=t.length;n<o;n+=2){t[n]=(t[n]+e)*360/i-180;let s=180-(t[n+1]+r)*360/i;t[n+1]=360/Math.PI*Math.atan(Math.exp(s*Math.PI/180))-90}}function vY(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?Ibe(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function Ibe(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}var xY,yg,dF,dM,AF,mF,Gb;var AM=class{properties;extent;type;id;_pbf;_geometry;_keys;_values;_geometryInfo;constructor(e,r,i,n,o,s){this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=n,this._values=o,this._geometryInfo=s,e.readFields(vY,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry,xY=e.readVarint()+e.pos,yg=1,dM=0,AF=0,mF=0,Gb=0;let r=[],i=[];for(;e.pos<xY;)if(dM<=0&&(dF=e.readVarint(),yg=dF&7,dM=dF>>3),dM--,yg===1||yg===2)AF+=e.readSVarint(),mF+=e.readSVarint(),yg===1&&r.push(Gb),i.push(AF,mF),Gb+=2;else if(yg===7){if(Gb>0){let n=r[r.length-1];i.push(i[n],i[n+1]),Gb+=2}}else throw new Error(`unknown command ${yg}`);return{data:i,indices:r}}_toBinaryCoordinates(e){let r=this.loadGeometry(),i;e(r.data,this);let n=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,i={type:"Point",...r};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/n,i={type:"LineString",...r};break;case 3:i=_Y(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=i.indices.length;for(let s of i.indices)this._geometryInfo.polygonRingsCount+=s.length;this._geometryInfo.polygonPositionsCount+=i.data.length/n;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}let o={type:"Feature",geometry:i,properties:this.properties};return this.id!==null&&(o.id=this.id),o}toBinaryCoordinates(e){if(typeof e=="function")return this._toBinaryCoordinates(e);let{x:r,y:i,z:n}=e,o=this.extent*Math.pow(2,n),s=this.extent*r,l=this.extent*i;return this._toBinaryCoordinates(u=>yY(u,s,l,o))}};var mM=class{version;name;extent;length;_pbf;_keys;_values;_features;constructor(e,r){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Pbe,this,r),this.length=this._features.length}feature(e,r){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let i=this._pbf.readVarint()+this._pbf.pos;return new AM(this._pbf,i,this.extent,this._keys,this._values,r)}};function Pbe(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(Rbe(r)))}function Rbe(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint()>>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}return e}var gM=class{layers;constructor(e,r){this.layers=e.readFields(Bbe,{},r)}};function Bbe(t,e,r){if(t===3&&r){let i=new mM(r,r.readVarint()+r.pos);i.length&&e&&(e[i.name]=i)}}function yF(t,e){let r=Dbe(e),i=e?.gis?.format||e?.mvt?.shape||e?.shape;switch(i){case"columnar-table":return{shape:"columnar-table",data:gF(t,r)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:bY(t,r)};case"geojson":return bY(t,r);case"binary-geometry":return gF(t,r);case"binary":return gF(t,r);default:throw new Error(i||"undefined shape")}}function gF(t,e){let[r,i]=Obe(t,e),n=uF(r,i);return n.byteLength=t.byteLength,n}function Obe(t,e){let r=[],i={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(t.byteLength<=0)return[r,i];let n=new gM(new _F.default(t));return(e&&Array.isArray(e.layers)?e.layers:Object.keys(n.layers)).forEach(s=>{let l=n.layers[s];if(l)for(let u=0;u<l.length;u++){let h=l.feature(u,i),v=Fbe(h,e,s);r.push(v)}}),[r,i]}function bY(t,e){if(t.byteLength<=0)return[];let r=[],i=new pM(new _F.default(t));return(Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach(o=>{let s=i.layers[o];if(s)for(let l=0;l<s.length;l++){let u=s.feature(l),h=Lbe(u,e,o);r.push(h)}}),r}function Dbe(t){if(!t?.mvt)throw new Error("mvt options required");let e=t.mvt?.coordinates==="wgs84",{tileIndex:r}=t.mvt,i=r&&Number.isFinite(r.x)&&Number.isFinite(r.y)&&Number.isFinite(r.z);if(e&&!i)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}function Lbe(t,e,r){let i=t.toGeoJSON(e.coordinates==="wgs84"?e.tileIndex:Nbe);return e.layerProperty&&(i.properties[e.layerProperty]=r),i}function Fbe(t,e,r){let i=t.toBinaryCoordinates(e.coordinates==="wgs84"?e.tileIndex:kbe);return e.layerProperty&&i.properties&&(i.properties[e.layerProperty]=r),i}function Nbe(t,e){let{extent:r}=e;for(let i=0;i<t.length;i++){let n=t[i];n[0]/=r,n[1]/=r}}function kbe(t,e){let{extent:r}=e;for(let i=0,n=t.length;i<n;++i)t[i]/=r}var Ube="4.2.0-beta.2",_M={dataType:null,batchType:null,name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:Ube,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}},zbe={..._M,parse:async(t,e)=>yF(t,e),parseSync:yF,binary:!0};var Vbe={Point:wY,MultiPoint:jbe,LineString:TY,MultiLineString:Hbe,Polygon:EY,MultiPolygon:Gbe};function wY([t,e],[r,i],n){let o=Oa(r[0],i[0],t),s=Oa(r[1],i[1],e);return n.unprojectFlat([o,s])}function vF(t,e,r){return t.map(i=>wY(i,e,r))}function jbe(t,e,r){return vF(t,e,r)}function TY(t,e,r){return vF(t,e,r)}function Hbe(t,e,r){return t.map(i=>TY(i,e,r))}function EY(t,e,r){return t.map(i=>vF(i,e,r))}function Gbe(t,e,r){return t.map(i=>EY(i,e,r))}function SY(t,e,r){let i=r.projectFlat([e.west,e.north]),n=r.projectFlat([e.east,e.south]),o=[i,n];return{...t,coordinates:Vbe[t.type](t.coordinates,o,r)}}var Wbe=["points","lines","polygons"];function xF(t,e,r,i){for(let n of Wbe){let o=t[n]&&qbe(t[n],e,r,i);if(o>=0)return o}return-1}function qbe(t,e,r,i){let n=t.featureIds.value;if(!n.length)return-1;let o=0,s=n[n.length-1]+1;if(i){let u=Xbe(t,i);if(u)o=u[0],s=u[1]+1;else return-1}let l=-1;if(e in t.numericProps){let u=t.numericProps[e].value.findIndex((h,v)=>h===r&&n[v]>=o&&n[v]<s);return u>=0?t.globalFeatureIds.value[u]:-1}else e?l=CY(t.properties,u=>u[e]===r,o,s):t.fields&&(l=CY(t.fields,u=>u.id===r,o,s));return l>=0?Ybe(t,l):-1}function Xbe(t,e){if(!t.__layers){let r={},{properties:i}=t;for(let n=0;n<i.length;n++){let{layerName:o}=i[n];o&&(r[o]?r[o][1]=n:r[o]=[n,n])}t.__layers=r}return t.__layers[e]}function Ybe(t,e){if(!t.__ids){let r=[],i=t.featureIds.value,n=t.globalFeatureIds.value;for(let o=0;o<i.length;o++)r[i[o]]=n[o];t.__ids=r}return t.__ids[e]}function CY(t,e,r,i){for(let n=r;n<i;n++)if(e(t[n],n))return n;return-1}var bF=512,Kbe={...Oh.defaultProps,data:nA,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[_M],binary:!0},yM=class extends Fh{initializeState(){super.initializeState();let e=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:e,data:null,tileJSON:null,hoveredFeatureId:null,hoveredFeatureLayerName:null})}get isLoaded(){return Boolean(this.state?.data&&super.isLoaded)}updateState({props:e,oldProps:r,context:i,changeFlags:n}){n.dataChanged&&this._updateTileData(),this.state?.data&&(super.updateState({props:e,oldProps:r,context:i,changeFlags:n}),this._setWGS84PropertyForTiles());let{highlightColor:o}=e;o!==r.highlightColor&&Array.isArray(o)&&this.setState({highlightColor:o})}async _updateTileData(){let e=this.props.data,r=null;if(typeof e=="string"&&!OD(e)){let{onDataLoad:i,fetch:n}=this.props;this.setState({data:null,tileJSON:null});try{r=await n(e,{propName:"data",layer:this,loaders:[]})}catch(o){this.raiseError(o,"loading TileJSON"),e=null}i&&i(r,{propName:"data",layer:this})}else e&&typeof e=="object"&&"tilejson"in e&&(r=e);r&&(e=r.tiles),this.setState({data:e,tileJSON:r})}_getTilesetOptions(){let e=super._getTilesetOptions(),r=this.state.tileJSON,{minZoom:i,maxZoom:n}=this.props;return r&&(Number.isFinite(r.minzoom)&&r.minzoom>i&&(e.minZoom=r.minzoom),Number.isFinite(r.maxzoom)&&(!Number.isFinite(n)||r.maxzoom<n)&&(e.maxZoom=r.maxzoom)),e}renderLayers(){return this.state?.data?super.renderLayers():null}getTileData(e){let{data:r,binary:i}=this.state,{index:n,signal:o}=e,s=Lh(r,e);if(!s)return Promise.reject("Invalid URL");let l=this.getLoadOptions(),{fetch:u}=this.props;return l={...l,mimeType:"application/x-protobuf",mvt:{...l?.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:n},gis:i?{format:"binary"}:{}},u(s,{propName:"data",layer:this,loadOptions:l,signal:o})}renderSubLayers(e){let{x:r,y:i,z:n}=e.tile.index,o=Math.pow(2,n),s=bF/o,l=-s,u=bF*r/o,h=bF*(1-i/o),v=new Kr().scale([s,l,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=v,e.coordinateOrigin=[u,h,0],e.coordinateSystem=Zr.CARTESIAN,e.extensions=[...e.extensions||[],new ay]);let T=super.renderSubLayers(e);return this.state.binary&&!(T instanceof Oh)&&ur.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),T}_updateAutoHighlight(e){let{uniqueIdProperty:r}=this.props,{hoveredFeatureId:i,hoveredFeatureLayerName:n}=this.state,o=e.object,s=null,l=null;o&&(s=wF(o,r),l=MY(o));let{highlightColor:u}=this.props;typeof u=="function"&&(u=u(e)),(i!==s||n!==l)&&this.setState({highlightColor:u,hoveredFeatureId:s,hoveredFeatureLayerName:l})}getPickingInfo(e){let r=super.getPickingInfo(e),i=Boolean(this.context.viewport.resolution);if(this.state.binary&&r.index!==-1){let{data:n}=e.sourceLayer.props;r.object=cM(n,{globalFeatureId:r.index})}return r.object&&!i&&(r.object=PY(r.object,r.tile.bbox,this.context.viewport)),r}getSubLayerPropsByTile(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(e){let{hoveredFeatureId:r,hoveredFeatureLayerName:i,binary:n}=this.state,{uniqueIdProperty:o,highlightedFeatureId:s}=this.props,l=e.content,u=IY(s);if(!(IY(r)||u))return-1;let v=u?s:r;return Array.isArray(l)?l.findIndex(T=>{let E=wF(T,o)===v,M=u||MY(T)===i;return E&&M}):l&&n?xF(l,o,v,u?"":i):-1}_pickObjects(e){let{deck:r,viewport:i}=this.context,n=i.width,o=i.height,s=i.x,l=i.y,u=[this.id];return r.pickObjects({x:s,y:l,width:n,height:o,layerIds:u,maxObjects:e})}getRenderedFeatures(e=null){let r=this._pickObjects(e),i=new Set,n=[];for(let o of r){let s=wF(o.object,this.props.uniqueIdProperty);s===void 0?n.push(o.object):i.has(s)||(i.add(s),n.push(o.object))}return n}_setWGS84PropertyForTiles(){let e="dataInWGS84";this.state.tileset.selectedTiles.forEach(i=>{i.hasOwnProperty(e)||Object.defineProperty(i,e,{get:()=>{if(!i.content)return null;if(this.state.binary&&Array.isArray(i.content)&&!i.content.length)return[];let{bbox:n}=i;if(i._contentWGS84===void 0&&DD(n)){let o=this.state.binary?cM(i.content):i.content;i._contentWGS84=o.map(s=>PY(s,n,this.context.viewport))}return i._contentWGS84}})})}},Wb=yM;(()=>{yM.layerName="MVTLayer"})(),(()=>{yM.defaultProps=Kbe})();function wF(t,e){if(t.properties&&e)return t.properties[e];if("id"in t)return t.id}function MY(t){return t.properties?.layerName||null}function IY(t){return t!=null&&t!==""}function PY(t,e,r){let i={...t,geometry:{type:t.geometry.type}};return Object.defineProperty(i.geometry,"coordinates",{get:()=>SY(t.geometry,e,r).coordinates}),i}var RY="0123456789bcdefghjkmnpqrstuvwxyz",BY={};for(let t=0;t<RY.length;t++)BY[RY.charAt(t)]=t;var Zbe=-90,Jbe=90,Qbe=-180,$be=180;function ewe(t){let e=!0,r=Jbe,i=Zbe,n=$be,o=Qbe,s,l=0;for(let u=0,h=t.length;u<h;u++){let v=t[u].toLowerCase();l=BY[v];for(let T=4;T>=0;T--){let E=l>>T&1;e?(s=(n+o)/2,E===1?o=s:n=s):(s=(r+i)/2,E===1?i=s:r=s),e=!e}}return[i,o,r,n]}function OY(t){let[e,r,i,n]=ewe(t);return[n,i,n,e,r,e,r,i,n,i]}var twe={getGeohash:{type:"accessor",value:t=>t.geohash}},vM=class extends eu{indexToBounds(){let{data:e,getGeohash:r}=this.props;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(i,n)=>OY(r(i,n))}}},qb=vM;(()=>{vM.layerName="GeohashLayer"})(),(()=>{vM.defaultProps=twe})();function fy(t,e=""){if(!t)throw new Error(`JSON conversion error ${e}`)}function LY(t,e){let r=iwe(e),i=t;for(let n of r)i=rwe(i)?i[n]:void 0;return i}function rwe(t){return t!==null&&typeof t=="object"}var DY={};function iwe(t){if(typeof t=="string"){let e=DY[t];return e||(e=t.split("."),DY[t]=e),e}return Array.isArray(t)?t:[t]}var EF={};As(EF,{addBinaryOp:()=>lwe,addUnaryOp:()=>awe,compile:()=>owe,compileAsync:()=>swe,eval:()=>tl,evalAsync:()=>Yb,parse:()=>zY.default});var hy=ga(TF()),zY=ga(TF()),Yb=function t(e,r){try{var i,n=e;switch(n.type){case"ArrayExpression":return Promise.resolve(NY(n.elements,r));case"BinaryExpression":return Promise.resolve(Promise.all([t(n.left,r),t(n.right,r)])).then(function(M){return py[n.operator](M[0],M[1])});case"CallExpression":var o,s,l,u=function(){if(typeof s=="function"){var M=s,O=M.apply,F=o;return Promise.resolve(NY(n.arguments,r)).then(function(z){return Promise.resolve(O.call(M,F,z))})}},h=n.callee.type==="MemberExpression"?Promise.resolve(FY(n.callee,r)).then(function(M){o=(l=M)[0],s=l[1]}):Promise.resolve(t(n.callee,r)).then(function(M){s=M});return Promise.resolve(h&&h.then?h.then(u):u());case"ConditionalExpression":return Promise.resolve(t(n.test,r)).then(function(M){return Promise.resolve(t(M?n.consequent:n.alternate,r))});case"Identifier":return Promise.resolve(r[n.name]);case"Literal":return Promise.resolve(n.value);case"LogicalExpression":var v=function(M){return i?M:Promise.resolve(Promise.all([t(n.left,r),t(n.right,r)])).then(function(O){return py[n.operator](O[0],O[1])})},T=n.operator==="||"?(i=1,Promise.resolve(t(n.left,r)).then(function(M){return M||Promise.resolve(t(n.right,r))})):function(){if(n.operator==="&&")return i=1,Promise.resolve(t(n.left,r)).then(function(M){return M&&Promise.resolve(t(n.right,r))})}();return Promise.resolve(T&&T.then?T.then(v):v(T));case"MemberExpression":return Promise.resolve(FY(n,r)).then(function(M){return M[1]});case"ThisExpression":return Promise.resolve(r);case"UnaryExpression":var E=bM[n.operator];return Promise.resolve(t(n.argument,r)).then(function(M){return E.call(bM,M)});default:return Promise.resolve(void 0)}}catch(M){return Promise.reject(M)}},FY=function(t,e){try{return Promise.resolve(Yb(t.object,e)).then(function(r){function i(){if(/^__proto__|prototype|constructor$/.test(n))throw Error('Access to member "'+n+'" disallowed.');return[r,r[n]]}var n,o=function(){if(t.computed)return Promise.resolve(Yb(t.property,e)).then(function(s){n=s});n=t.property.name}();return o&&o.then?o.then(i):i()})}catch(r){return Promise.reject(r)}},NY=function(t,e){try{return Promise.resolve(Promise.all(t.map(function(r){return Yb(r,e)})))}catch(r){return Promise.reject(r)}},nwe={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},py={"||":function(t,e){return t||e},"&&":function(t,e){return t&&e},"|":function(t,e){return t|e},"^":function(t,e){return t^e},"&":function(t,e){return t&e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"<<":function(t,e){return t<<e},">>":function(t,e){return t>>e},">>>":function(t,e){return t>>>e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e}},bM={"-":function(t){return-t},"+":function(t){return+t},"~":function(t){return~t},"!":function(t){return!t}};function kY(t,e){return t.map(function(r){return tl(r,e)})}function UY(t,e){var r,i=tl(t.object,e);if(r=t.computed?tl(t.property,e):t.property.name,/^__proto__|prototype|constructor$/.test(r))throw Error('Access to member "'+r+'" disallowed.');return[i,i[r]]}function tl(t,e){var r=t;switch(r.type){case"ArrayExpression":return kY(r.elements,e);case"BinaryExpression":return py[r.operator](tl(r.left,e),tl(r.right,e));case"CallExpression":var i,n,o;return r.callee.type==="MemberExpression"?(i=(o=UY(r.callee,e))[0],n=o[1]):n=tl(r.callee,e),typeof n!="function"?void 0:n.apply(i,kY(r.arguments,e));case"ConditionalExpression":return tl(r.test,e)?tl(r.consequent,e):tl(r.alternate,e);case"Identifier":return e[r.name];case"Literal":return r.value;case"LogicalExpression":return r.operator==="||"?tl(r.left,e)||tl(r.right,e):r.operator==="&&"?tl(r.left,e)&&tl(r.right,e):py[r.operator](tl(r.left,e),tl(r.right,e));case"MemberExpression":return UY(r,e)[1];case"ThisExpression":return e;case"UnaryExpression":return bM[r.operator](tl(r.argument,e));default:return}}function owe(t){return tl.bind(null,(0,hy.default)(t))}function swe(t){return Yb.bind(null,(0,hy.default)(t))}function awe(t,e){hy.default.addUnaryOp(t),bM[t]=e}function lwe(t,e,r){r?(hy.default.addBinaryOp(t,e),py[t]=r):(hy.default.addBinaryOp(t,nwe[t]||1),py[t]=e)}var{parse:cwe,eval:uwe}=EF,SF={"-":t=>t};function vg(t,e){if(t in SF)return SF[t];let r,i=cwe(t);return i.type==="Identifier"?r=n=>LY(n,t):(CF(i,n=>{if(n.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),r=n=>uwe(i,n)),SF[t]=r,r}function CF(t,e){if(Array.isArray(t))t.forEach(r=>CF(r,e));else if(t&&typeof t=="object"){t.type&&e(t);for(let r in t)CF(t[r],e)}}var dy="@@=",MF="@@#",VY="@@type",wM="@@function";var jY=t=>t&&typeof t=="object",Xp=class{constructor(...e){this.typeKey=VY,this.functionKey=wM,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=vg,this.preProcessClassProps=(r,i)=>i,this.postProcessConvertedJson=r=>r;for(let r of e)this.merge(r)}merge(e){for(let r in e)switch(r){case"layers":case"views":Object.assign(this.classes,e[r]);break;default:if(r in this){let i=e[r];this[r]=jY(this[r])?Object.assign(this[r],i):i}}}validate(e){return fy(!this.typeKey||typeof this.typeKey=="string"),fy(jY(this.classes)),!0}};function fwe(t){return typeof t=="string"&&t.startsWith(dy)}function hwe(t){return t.replace(dy,"")}function Ay(t,e){let r={};for(let i in t){let n=t[i];fwe(n)&&(n=hwe(n),n=vg(n,e)),r[i]=n}return r}function HY(t,e,r){let i=r.classes[t],n=r.reactComponents[t];if(!i&&!n){let{log:o}=r;if(o){let s=JSON.stringify(e,null,0).slice(0,40);o.warn(`JSON converter: No registered class of type ${t}(${s}...) `)}return null}return i?pwe(i,e,r):dwe(n,e,r)}function pwe(t,e,r){return r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=Ay(e,r),new t(e)}function dwe(t,e,r){let{React:i}=r,{children:n=[]}=e;return delete e.children,r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=Ay(e,r),i.createElement(t,e,n)}function GY(t,e,r){let i=r.functions[t];if(!i){let{log:n}=r;if(n){let o=JSON.stringify(e,null,0).slice(0,40);n.warn(`JSON converter: No registered function ${t}(${o}...) `)}return null}return i(e)}function IF(t){return typeof t=="string"?JSON.parse(t):t}var PF=t=>t&&typeof t=="object",xg=class{constructor(e){this.log=console,this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(e)}finalize(){}setProps(e){"configuration"in e&&(this.configuration=e.configuration instanceof Xp?e.configuration:new Xp(e.configuration)),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}mergeConfiguration(e){this.configuration.merge(e)}convert(e){if(!e||e===this.json)return this.convertedJson;this.json=e;let r=IF(e),i=Awe(r,this.configuration);return i=this.configuration.postProcessConvertedJson(i),this.convertedJson=i,i}convertJson(e){return this.convert(e)}};function Awe(t,e){return e=new Xp(e),RF(t,"",e)}function RF(t,e,r){return Array.isArray(t)?t.map((i,n)=>RF(i,String(n),r)):mwe(t,r)?gwe(t,r):PF(t)?wM in t?_we(t,r):BF(t,r):typeof t=="string"?ywe(t,e,r):t}function mwe(t,e){let{typeKey:r}=e;return PF(t)&&Boolean(t[r])}function gwe(t,e){let{typeKey:r}=e,i=t[r],n={...t};return delete n[r],n=BF(n,e),HY(i,n,e)}function _we(t,e){let{functionKey:r}=e,i=t[r],n={...t};return delete n[r],n=BF(n,e),GY(i,n,e)}function BF(t,e){fy(PF(t));let r={};for(let i in t){let n=t[i];r[i]=RF(n,i,e)}return r}function ywe(t,e,r){if(t.startsWith(dy)&&r.convertFunction)return t=t.replace(dy,""),r.convertFunction(t,r);if(t.startsWith(MF)){if(t=t.replace(MF,""),r.constants[t])return r.constants[t];let[i,n]=t.split(".");return r.enumerations[i][n]}return t}var my={onInitialize:t=>t,onFinalize:t=>t,onMessage:t=>t},zh=class{static setCallbacks({onInitialize:e,onFinalize:r,onMessage:i}){e&&(my.onInitialize=e),r&&(my.onFinalize=r),i&&(my.onMessage=i)}constructor(e="Transport"){this._messageQueue=[],this.userData={},this._destroyed=!1,this.name=e}getRootDOMElement(){return typeof document<"u"?document.body:null}sendJSONMessage(){console.error("Back-channel not implemented for this transport")}sendBinaryMessage(){console.error("Back-channel not implemented for this transport")}_initialize(e={}){let r={transport:this,...e};my.onInitialize(r)}_finalize(e={}){let r={transport:this,...e};my.onFinalize(r),this._destroyed=!0}_messageReceived(e={}){e={transport:this,...e},console.debug("Delivering transport message",e),my.onMessage(e)}static _stringifyJSONSafe(e){let r=new Set;return JSON.stringify(e,(i,n)=>{if(typeof n=="object"&&n!==null){if(r.has(n))try{return JSON.parse(JSON.stringify(n))}catch{return}r.add(n)}return n})}};function WY(t,e){if(t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(!(r in e)||t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}var TM=class{constructor(e){this.map=null,this.width=0,this.height=0,this.props={...e},this._initialize(this.props)}finalize(){this.map?.remove(),this.map=null}setProps(e){let r=this.props,i={...this.props,...e};if(this.props=i,!this.map)return;this._update(r,i)&&this.redraw()}redraw(){let e=this.map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this.map}_initialize(e){let{mapLib:r,container:i}=e;r.accessToken=e.mapboxApiAccessToken||"",this.map=new e.mapLib.Map({container:i,maxZoom:24,...e.mapOptions,...qY(e.viewState),style:e.mapStyle,interactive:!1,trackResize:!1}),Object.defineProperty(i,"offsetWidth",{get:()=>this.width}),Object.defineProperty(i,"clientWidth",{get:()=>this.width}),Object.defineProperty(i,"offsetHeight",{get:()=>this.height}),Object.defineProperty(i,"clientHeight",{get:()=>this.height}),this.map.resize()}_update(e,r){e.mapStyle!==r.mapStyle&&this.map.setStyle(r.mapStyle);let n=e.width!==r.width||e.height!==r.height;n&&(this.width=r.width,this.height=r.height,this.map.resize());let o=e.viewState,s=r.viewState,l=s.latitude!==o.latitude||s.longitude!==o.longitude||s.zoom!==o.zoom||s.pitch!==o.pitch||s.bearing!==o.bearing;return l&&this.map.jumpTo(qY(s)),n||l}};function qY(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing??0,pitch:t.pitch??0}}var XY={position:"absolute",left:0,top:0,width:"100%",height:"100%"};function vwe(t){let{container:e=document.body}=t;if(typeof e=="string"&&(e=document.getElementById(e)),!e)throw Error("Deck: container not found");window.getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=document.createElement("div");e.appendChild(i),Object.assign(i.style,XY);let n=document.createElement("canvas");return e.appendChild(n),Object.assign(n.style,XY),{container:e,mapCanvas:i,deckCanvas:n}}var bg=class extends Ip{constructor(e){if(typeof document>"u")throw Error("Deck can only be used in the browser");let{mapCanvas:r,deckCanvas:i}=vwe(e),n=e.viewState||e.initialViewState,o=Number.isFinite(n&&n.latitude),{map:s=globalThis.mapboxgl||globalThis.maplibregl}=e;super({canvas:i,...e}),s&&s.Map?this._map=o&&new TM({...e,width:0,height:0,viewState:n,container:r,mapLib:s}):this._map=s}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"mapStyle"in e&&this._map&&this._map.setProps({mapStyle:e.mapStyle}),super.setProps(e)}_drawLayers(e,r){if(this._map){let i=this.getViewports()[0];i&&this._map.setProps({width:i.width,height:i.height,viewState:i})}super._drawLayers(e,r)}};Ll.registerDevices([wh]);var YY=t=>t.charAt(0)===t.charAt(0).toUpperCase(),xwe=t=>t.charAt(0)===t.charAt(0).toLowerCase()&&t.charAt(0)!=="_";function OF(t={},e){let r={},i=Object.keys(t).filter(e);for(let n of i)r[n]=t[n];return r}var bwe={classes:OF(Kb,YY),enumerations:{COORDINATE_SYSTEM:Zr,GL:yh}};tm([Hv]);var cA=new xg({configuration:bwe});function wwe(t,e){let r={classes:OF(t,YY),functions:OF(t,xwe)};e.mergeConfiguration(r)}function Twe(t,e){if(!t)return;let r={};function i(){Object.values(r).every(o=>o)&&typeof e=="function"&&e()}function n(o,s){wwe(s,cA),r[o]=s,i()}t.forEach(({libraryName:o,resourceUri:s})=>{if(r[o]=!1,o in window){n(o,window[o]);return}Object.defineProperty(window,o,{set:l=>n(o,l),get:()=>r[o]}),h5(s)})}function KY(t,e){let r=cA.convert(t);e.setProps(r)}function Ewe(t,e){return t.filter(r=>r&&r.id&&!e.find(i=>i.id===r.id))}function Swe({mapProvider:t,props:e,mapboxApiKey:r,googleMapsKey:i,handleEvent:n,getTooltip:o,container:s}){let u={...n?{onClick:h=>n("deck-click-event",h),onHover:h=>n("deck-hover-event",h),onResize:h=>n("deck-resize-event",h),onViewStateChange:({viewState:h,interactionState:v,oldViewState:T})=>{let E=new Tc(h);h.nw=E.unproject([0,0]),h.se=E.unproject([E.width,E.height]),n("deck-view-state-change-event",h)},onDragStart:h=>n("deck-drag-start-event",h),onDrag:h=>n("deck-drag-event",h),onDragEnd:h=>n("deck-drag-end-event",h)}:null,getTooltip:o,container:s};switch(t){case"mapbox":return ur.info("Using Mapbox base maps")(),new bg({...u,...e,map:K3,mapboxApiAccessToken:r,onLoad:f5});case"carto":return ur.info("Using Carto base maps")(),new bg({map:K3,...u,...e});case"google_maps":return ur.info("Using Google Maps base maps")(),z9({...u,...e,googleMapsKey:i});default:return ur.info("No recognized map provider specified")(),new bg({...u,...e,map:null,mapboxApiAccessToken:null})}}function EM({mapboxApiKey:t,googleMapsKey:e,container:r,jsonInput:i,tooltip:n,handleEvent:o,customLibraries:s,configuration:l}){let u;try{l&&cA.mergeConfiguration(l);let h=i.layers||[],v=cA.convert(i);PO(r,v);let T=(v.layers||[]).filter(z=>z),E=Ewe(h,T),M=q3(n),{mapProvider:O}=v;u=Swe({mapProvider:O,props:v,mapboxApiKey:t,googleMapsKey:e,handleEvent:o,getTooltip:M,container:r}),Twe(s,()=>{if(E.length){let W=(cA.convert({layers:i.layers}).layers||[]).filter(J=>J);W.length>T.length&&u.setProps({layers:W})}})}catch(h){console.error(h)}return u}function SM(){zh.setCallbacks({onInitialize({transport:t}){let{width:e,height:r,customLibraries:i,mapboxApiKey:n,jsonInput:o,tooltip:s}=Pwe(t);u5();let l=t.getRootDOMElement(),u=a5(e,r);l.appendChild(u);let h=JSON.parse(o),v=EM({mapboxApiKey:n,container:u,jsonInput:h,tooltip:s,handleEvent:(T,E)=>Iwe(t,T,E),customLibraries:i});t.userData.deck=v},onFinalize({transport:t}){let{deck:e}=t.userData;e.finalize()},onMessage({transport:t,type:e,json:r,binary:i}){let{deck:n}=t.userData,o;switch(e){case"json":o=cA.convert(r),n.setProps(o);break;case"json-with-binary":o=cA.convert(r);let s=t.jupyterModel.get("data_buffer"),l=Cwe({binary:s,convertedJson:o});n.setProps(l);break;default:}}})}function Cwe({binary:t,convertedJson:e}){for(let r=0;r<e.layers.length;r++){let i=e.layers[r].id,n=e.layers[r];e.layers[r]=n.clone({data:t[i]})}return e}function Mwe(t,e){return e instanceof Dn?e.id:e}function Iwe(t,e,r){if(e==="hover"&&!r.picked&&r.index===-1)return;let i=JSON.parse(JSON.stringify(r,Mwe));t.sendJSONMessage(e,i)}function Pwe(t){let{jupyterModel:e}=t;if(!e)throw new Error("deck.gl playground currently only works with the Jupyter Widget Transport");return{width:e.get("width"),height:e.get("height"),customLibraries:e.get("custom_libraries"),mapboxApiKey:e.get("mapbox_key"),jsonInput:e.get("json_input"),tooltip:e.get("tooltip")}}var wg=class extends zh{constructor(){super("Jupyter Transport (JavaScript <=> Jupyter Kernel)"),this.jupyterModel=null,this.jupyterView=null}getRootDOMElement(){return this.jupyterView.el}sendJSONMessage(e,r){let i=zh._stringifyJSONSafe({type:e,data:r});this.jupyterModel.send(i)}};var qw={};As(qw,{CONTROL_COMM_PROTOCOL_VERSION:()=>NQ,CONTROL_COMM_TARGET:()=>FQ,CONTROL_COMM_TIMEOUT:()=>kQ,DOMWidgetModel:()=>fk,DOMWidgetView:()=>hk,IJupyterWidgetRegistry:()=>aIe,JUPYTER_WIDGETS_VERSION:()=>NM,JupyterPhosphorPanelWidget:()=>$Me,JupyterPhosphorWidget:()=>Hee,LayoutModel:()=>eIe,LayoutView:()=>tIe,ManagerBase:()=>vMe,PROTOCOL_VERSION:()=>kM,StyleModel:()=>rIe,StyleView:()=>iIe,ViewList:()=>sIe,WidgetModel:()=>PA,WidgetView:()=>fv,WrappedError:()=>gMe,assign:()=>Yp,base64ToBuffer:()=>iN,bufferToBase64:()=>rN,bufferToHex:()=>yMe,difference:()=>FM,hexToBuffer:()=>tN,isEqual:()=>Cy,pack_models:()=>uk,put_buffers:()=>uA,reject:()=>Hh,remove_buffers:()=>ow,resolvePromisesDict:()=>My,serialize_state:()=>UQ,shims:()=>pk,unpack_models:()=>Ww,uuid:()=>nw});var LM=ga(QY()),RQ=ga(gy()),BQ=ga(EQ()),OQ=ga(PQ()),mMe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),DM=function(){return DM=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},DM.apply(this,arguments)};function FM(t,e){return t.filter(function(r){return e.indexOf(r)===-1})}function Cy(t,e){return(0,BQ.default)(t,e)}var Yp=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t};function nw(){return RQ.UUID.uuid4()}var gMe=function(t){mMe(e,t);function e(r,i){var n=t.call(this,r)||this;return console.warn("WrappedError has been deprecated!"),i instanceof e?n.error_stack=i.error_stack:n.error_stack=[i],n.error_stack.push(n),n}return e}(Error);function My(t){var e=Object.keys(t),r=[];return e.forEach(function(i){r.push(t[i])}),Promise.all(r).then(function(i){for(var n={},o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function Hh(t,e){return function(i){throw e&&console.error(new Error(t)),i}}function uA(t,e,r){for(var i=0;i<e.length;i++){for(var n=e[i],o=t,s=0;s<n.length-1;s++)o=o[n[s]];o[n[n.length-1]]=r[i]}}function ow(t){var e=[],r=[];function i(o,s){if(o.toJSON&&(o=o.toJSON()),Array.isArray(o))for(var l=!1,u=0;u<o.length;u++){var h=o[u];if(h)if(h instanceof ArrayBuffer||ArrayBuffer.isView(h))l||(o=o.slice(),l=!0),e.push(ArrayBuffer.isView(h)?h.buffer:h),r.push(s.concat([u])),o[u]=null;else{var v=i(h,s.concat([u]));v!==h&&(l||(o=o.slice(),l=!0),o[u]=v)}}else if((0,OQ.default)(o))for(var T in o){var l=!1;if(o.hasOwnProperty(T)){var h=o[T];if(h)if(h instanceof ArrayBuffer||ArrayBuffer.isView(h))l||(o=DM({},o),l=!0),e.push(ArrayBuffer.isView(h)?h.buffer:h),r.push(s.concat([T])),delete o[T];else{var v=i(h,s.concat([T]));v!==h&&(l||(o=DM({},o),l=!0),o[T]=v)}}}return o}var n=i(t,[]);return{state:n,buffers:e,buffer_paths:r}}var _Me=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"];function yMe(t){for(var e=new Uint8Array(t),r=[],i=0;i<e.length;i++)r.push(_Me[e[i]]);return r.join("")}function tN(t){for(var e=new Uint8Array(t.length/2),r=0;r<t.length;r+=2)e[r/2]=parseInt(t.slice(r,r+2),16);return e.buffer}function rN(t){return(0,LM.fromByteArray)(new Uint8Array(t))}function iN(t){return(0,LM.toByteArray)(t).buffer}var LQ=ga(gy());var NM="1.2.0",kM="2.1.0";var sw=function(){return sw=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},sw.apply(this,arguments)},fA=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function l(v){try{h(i.next(v))}catch(T){s(T)}}function u(v){try{h(i.throw(v))}catch(T){s(T)}}function h(v){v.done?o(v.value):n(v.value).then(l,u)}h((i=i.apply(t,e||[])).next())})},hA=function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(h){return function(v){return u([h,v])}}function u(h){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(o=h[0]&2?n.return:h[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,h[1])).done)return o;switch(n=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,n=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){r.label=h[1];break}if(h[0]===6&&r.label<o[1]){r.label=o[1],o=h;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(h);break}o[2]&&r.ops.pop(),r.trys.pop();continue}h=e.call(t,r)}catch(v){h=[6,v],n=0}finally{i=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},DQ=kM.split(".",1)[0],FQ="jupyter.widget.control",NQ="1.0.0",kQ=4e3,vMe=function(){function t(){this.comm_target_name="jupyter.widget",this._models=Object.create(null)}return t.prototype.display_model=function(e,r,i){var n=this;return i===void 0&&(i={}),this.create_view(r,i).then(function(o){return n.display_view(e,o,i)}).catch(Hh("Could not create view",!0))},t.prototype.setViewOptions=function(e){return e===void 0&&(e={}),e},t.prototype.create_view=function(e,r){var i=this;r===void 0&&(r={});var n=e.state_change=e.state_change.then(function(){return i.loadClass(e.get("_view_name"),e.get("_view_module"),e.get("_view_module_version")).then(function(s){var l=new s({model:e,options:i.setViewOptions(r)});return l.listenTo(e,"destroy",l.remove),Promise.resolve(l.render()).then(function(){return l})}).catch(Hh("Could not create a view for model id "+e.model_id,!0))}),o=nw();return e.views[o]=n,n.then(function(s){s.once("remove",function(){delete s.model.views[o]},i)}),e.state_change},t.prototype.callbacks=function(e){return{}},t.prototype.get_model=function(e){return this._models[e]},t.prototype.has_model=function(e){return this._models[e]!==void 0},t.prototype.handle_comm_open=function(e,r){var i=(r.metadata||{}).version||"";if(i.split(".",1)[0]!==DQ){var n="Wrong widget protocol version: received protocol version '"+i+"', but was expecting major version '"+DQ+"'";return console.error(n),Promise.reject(n)}var o=r.content.data,s=o.buffer_paths||[],l=(r.buffers||[]).map(function(u){return u instanceof DataView?u:new DataView(u instanceof ArrayBuffer?u:u.buffer)});return uA(o.state,s,l),this.new_model({model_name:o.state._model_name,model_module:o.state._model_module,model_module_version:o.state._model_module_version,comm:e},o.state).catch(Hh("Could not create a model.",!0))},t.prototype.new_widget=function(e,r){var i=this;r===void 0&&(r={});var n;if(e.view_name===void 0||e.view_module===void 0||e.view_module_version===void 0)return Promise.reject("new_widget(...) must be given view information in the options.");e.comm?n=Promise.resolve(e.comm):n=this._create_comm(this.comm_target_name,e.model_id,{state:{_model_module:e.model_module,_model_module_version:e.model_module_version,_model_name:e.model_name,_view_module:e.view_module,_view_module_version:e.view_module_version,_view_name:e.view_name}},{version:kM});var o=sw({},e);return n.then(function(s){o.comm=s;var l=i.new_model(o,r);return l.then(function(u){return u.sync("create",u),u})},function(){return o.model_id||(o.model_id=nw()),i.new_model(o,r)})},t.prototype.register_model=function(e,r){var i=this;this._models[e]=r,r.then(function(n){n.once("comm:close",function(){delete i._models[e]})})},t.prototype.new_model=function(e,r){return r===void 0&&(r={}),fA(this,void 0,void 0,function(){var i,n;return hA(this,function(o){switch(o.label){case 0:if(e.model_id)i=e.model_id;else if(e.comm)i=e.model_id=e.comm.comm_id;else throw new Error("Neither comm nor model_id provided in options object. At least one must exist.");return n=this._make_model(e,r),this.register_model(i,n),[4,n];case 1:return[2,o.sent()]}})})},t.prototype._make_model=function(e,r){return r===void 0&&(r={}),fA(this,void 0,void 0,function(){var i,n,o,s,l,u,h;return hA(this,function(v){switch(v.label){case 0:i=e.model_id,n=this.loadClass(e.model_name,e.model_module,e.model_module_version),v.label=1;case 1:return v.trys.push([1,3,,4]),[4,n];case 2:return o=v.sent(),[3,4];case 3:throw s=v.sent(),console.error("Could not instantiate widget"),s;case 4:if(!o)throw new Error("Cannot find model module "+e.model_module+"@"+e.model_module_version+", "+e.model_name);return[4,o._deserialize_state(r,this)];case 5:return l=v.sent(),u={widget_manager:this,model_id:i,comm:e.comm},h=new o(l,u),h.name=e.model_name,h.module=e.model_module,[2,h]}})})},t.prototype._loadFromKernel=function(){return fA(this,void 0,void 0,function(){var e,r,i,n,o,s,l,u,h,v,T,E,M,O=this;return hA(this,function(F){switch(F.label){case 0:return F.trys.push([0,3,,4]),[4,this._create_comm(FQ,nw(),{},{version:NQ})];case 1:return i=F.sent(),[4,new Promise(function(z,W){i.on_msg(function(J){if(e=J.content.data,e.method!=="update_states"){console.warn(`
3693
+ `},sM=class extends Nm{getShaders(){let e="instancePositions"in this.getAttributeManager().attributes;return this.props.clipByInstance!==void 0&&(e=Boolean(this.props.clipByInstance)),this.state.clipByInstance=e,e?{modules:[j1e],inject:H1e}:{modules:[G1e],inject:W1e}}draw({uniforms:e}){let{clipBounds:r}=this.props;if(this.state.clipByInstance)e.clip_bounds=r;else{let i=this.projectPosition([r[0],r[1],0]),n=this.projectPosition([r[2],r[3],0]);e.clip_bounds=[Math.min(i[0],n[0]),Math.min(i[1],n[1]),Math.max(i[0],n[0]),Math.max(i[1],n[1])]}}},ay=sM;(()=>{sM.defaultProps=V1e})(),(()=>{sM.extensionName="ClipExtension"})();function uF(t,e,r){let i=q1e(t),n=Object.keys(i).filter(o=>i[o]!==Array);return X1e(t,{propArrayTypes:i,...e},{numericPropKeys:r&&r.numericPropKeys||n,PositionDataType:r?r.PositionDataType:Float32Array,triangulate:r?r.triangulate:!0})}function q1e(t){let e={};for(let r of t)if(r.properties)for(let i in r.properties){let n=r.properties[i];e[i]=$1e(n,e[i])}return e}function X1e(t,e,r){let{pointPositionsCount:i,pointFeaturesCount:n,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:l,polygonPositionsCount:u,polygonObjectsCount:h,polygonRingsCount:v,polygonFeaturesCount:T,propArrayTypes:E,coordLength:M}=e,{numericPropKeys:O=[],PositionDataType:F=Float32Array,triangulate:z=!0}=r,W=t[0]&&"id"in t[0],J=t.length>65535?Uint32Array:Uint16Array,K={type:"Point",positions:new F(i*M),globalFeatureIds:new J(i),featureIds:n>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:[],fields:[]},ne={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new F(o*M),globalFeatureIds:new J(o),featureIds:l>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},ge={type:"Polygon",polygonIndices:u>65535?new Uint32Array(h+1):new Uint16Array(h+1),primitivePolygonIndices:u>65535?new Uint32Array(v+1):new Uint16Array(v+1),positions:new F(u*M),globalFeatureIds:new J(u),featureIds:T>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]};z&&(ge.triangles=[]);for(let me of[K,ne,ge])for(let fe of O){let $=E[fe];me.numericProps[fe]=new $(me.positions.length/M)}ne.pathIndices[s]=o,ge.polygonIndices[h]=u,ge.primitivePolygonIndices[v]=u;let H={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let me of t){let fe=me.geometry,$=me.properties||{};switch(fe.type){case"Point":Y1e(fe,K,H,M,$),K.properties.push(cF($,O)),W&&K.fields.push({id:me.id}),H.pointFeature++;break;case"LineString":K1e(fe,ne,H,M,$),ne.properties.push(cF($,O)),W&&ne.fields.push({id:me.id}),H.lineFeature++;break;case"Polygon":Z1e(fe,ge,H,M,$),ge.properties.push(cF($,O)),W&&ge.fields.push({id:me.id}),H.polygonFeature++;break;default:throw new Error("Invalid geometry type")}H.feature++}return Q1e(K,ne,ge,M)}function Y1e(t,e,r,i,n){e.positions.set(t.data,r.pointPosition*i);let o=t.data.length/i;fF(e,n,r.pointPosition,o),e.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+o),e.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+o),r.pointPosition+=o}function K1e(t,e,r,i,n){e.positions.set(t.data,r.linePosition*i);let o=t.data.length/i;fF(e,n,r.linePosition,o),e.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+o),e.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+o);for(let s=0,l=t.indices.length;s<l;++s){let u=t.indices[s],h=s===l-1?t.data.length:t.indices[s+1];e.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(h-u)/i}}function Z1e(t,e,r,i,n){e.positions.set(t.data,r.polygonPosition*i);let o=t.data.length/i;fF(e,n,r.polygonPosition,o),e.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+o),e.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+o);for(let s=0,l=t.indices.length;s<l;++s){let u=r.polygonPosition;e.polygonIndices[r.polygonObject++]=u;let h=t.areas[s],v=t.indices[s],T=t.indices[s+1];for(let M=0,O=v.length;M<O;++M){let F=v[M],z=M===O-1?T===void 0?t.data.length:T[0]:v[M+1];e.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(z-F)/i}let E=r.polygonPosition;J1e(e,h,v,{startPosition:u,endPosition:E,coordLength:i})}}function J1e(t,e,r,{startPosition:i,endPosition:n,coordLength:o}){if(!t.triangles)return;let s=i*o,l=n*o,u=t.positions.subarray(s,l),h=r[0],v=r.slice(1).map(E=>(E-h)/o),T=OO(u,v,o,e);for(let E=0,M=T.length;E<M;++E)t.triangles.push(i+T[E])}function lF(t,e){let r={};for(let i in t)r[i]={value:t[i],size:e};return r}function Q1e(t,e,r,i){let n={shape:"binary-feature-collection",points:{...t,positions:{value:t.positions,size:i},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:lF(t.numericProps,1)},lines:{...e,positions:{value:e.positions,size:i},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:lF(e.numericProps,1)},polygons:{...r,positions:{value:r.positions,size:i},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:lF(r.numericProps,1)}};return n.polygons&&r.triangles&&(n.polygons.triangles={value:new Uint32Array(r.triangles),size:1}),n}function fF(t,e,r,i){for(let n in t.numericProps)if(n in e){let o=e[n];t.numericProps[n].fill(o,r,r+i)}}function cF(t,e){let r={};for(let i in t)e.includes(i)||(r[i]=t[i]);return r}function $1e(t,e){return e===Array||!Number.isFinite(t)?Array:e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array}function cM(t,e){let r=e?.globalFeatureId;return r!==void 0?ebe(t,r):tbe(t,e?.type)}function ebe(t,e){let r=aY(t);for(let i of r){let n=0,o=i.featureIds.value[0];for(let s=0;s<i.featureIds.value.length;s++){let l=i.featureIds.value[s];if(l!==o){if(e===i.globalFeatureIds.value[n])return aM(i,n,s);n=s,o=l}}if(e===i.globalFeatureIds.value[n])return aM(i,n,i.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}function tbe(t,e){let r=aY(t,e);return rbe(r)}function sY(t,e,r){switch(t.type){case"Point":return sbe(t,e,r);case"LineString":return obe(t,e,r);case"Polygon":return lY(t,e,r);default:let i=t;throw new Error(`Unsupported geometry type: ${i?.type}`)}}function aY(t,e){let r=[];return t.points&&(t.points.type="Point",r.push(t.points)),t.lines&&(t.lines.type="LineString",r.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",r.push(t.polygons)),r}function rbe(t){let e=[];for(let r of t){if(r.featureIds.value.length===0)continue;let i=0,n=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let s=r.featureIds.value[o];s!==n&&(e.push(aM(r,i,o)),i=o,n=s)}e.push(aM(r,i,r.featureIds.value.length))}return e}function aM(t,e,r){let i=sY(t,e,r),n=nbe(t,e,r),o=ibe(t,e,r);return{type:"Feature",geometry:i,properties:n,...o}}function ibe(t,e=0,r){return t.fields&&t.fields[t.featureIds.value[e]]}function nbe(t,e=0,r){let i=Object.assign({},t.properties[t.featureIds.value[e]]);for(let n in t.numericProps)i[n]=t.numericProps[n].value[e];return i}function lY(t,e=-1/0,r=1/0){let{positions:i}=t,n=t.polygonIndices.value.filter(u=>u>=e&&u<=r),o=t.primitivePolygonIndices.value.filter(u=>u>=e&&u<=r);if(!(n.length>2)){let u=[];for(let h=0;h<o.length-1;h++){let v=o[h],T=o[h+1],E=lM(i,v,T);u.push(E)}return{type:"Polygon",coordinates:u}}let l=[];for(let u=0;u<n.length-1;u++){let h=n[u],v=n[u+1],T=lY(t,h,v).coordinates;l.push(T)}return{type:"MultiPolygon",coordinates:l}}function obe(t,e=-1/0,r=1/0){let{positions:i}=t,n=t.pathIndices.value.filter(l=>l>=e&&l<=r);if(!(n.length>2))return{type:"LineString",coordinates:lM(i,n[0],n[1])};let s=[];for(let l=0;l<n.length-1;l++){let u=lM(i,n[l],n[l+1]);s.push(u)}return{type:"MultiLineString",coordinates:s}}function sbe(t,e,r){let{positions:i}=t,n=lM(i,e,r);return n.length>1?{type:"MultiPoint",coordinates:n}:{type:"Point",coordinates:n[0]}}function lM(t,e,r){e=e||0,r=r||t.value.length/t.size;let i=[];for(let n=e;n<r;n++){let o=Array();for(let s=n*t.size;s<(n+1)*t.size;s++)o.push(Number(t.value[s]));i.push(o)}return i}var _F=ga(AY(),1);function mY(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let o=0;o<e;o++){let s=Tbe(t[o]);s!==0&&(n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[o]]):i&&i.push(t[o]))}return i&&r.push(i),r}function Tbe(t){let e=0;for(let r=0,i=t.length-1,n,o;r<t.length;i=r++)n=t[r],o=t[i],e+=(o[0]-n[0])*(n[1]+o[1]);return e}function gY(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?Ebe(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function Ebe(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}var uy=class{properties;extent;type;id;_pbf;_geometry;_keys;_values;static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(e,r,i,n,o){this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=n,this._values=o,e.readFields(gY,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,i=1,n=0,o=0,s=0,l=[],u;for(;e.pos<r;){if(n<=0){let h=e.readVarint();i=h&7,n=h>>3}if(n--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),i===1&&(u&&l.push(u),u=[]),u&&u.push([o,s]);else if(i===7)u&&u.push(u[0].slice());else throw new Error(`unknown command ${i}`)}return u&&l.push(u),l}bbox(){let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,i=1,n=0,o=0,s=0,l=1/0,u=-1/0,h=1/0,v=-1/0;for(;e.pos<r;){if(n<=0){let T=e.readVarint();i=T&7,n=T>>3}if(n--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),o<l&&(l=o),o>u&&(u=o),s<h&&(h=s),s>v&&(v=s);else if(i!==7)throw new Error(`unknown command ${i}`)}return[l,h,u,v]}_toGeoJSON(e){let r=this.loadGeometry(),i=uy.types[this.type],n,o;switch(this.type){case 1:let l=[];for(n=0;n<r.length;n++)l[n]=r[n][0];r=l,e(r,this);break;case 2:for(n=0;n<r.length;n++)e(r[n],this);break;case 3:for(r=mY(r),n=0;n<r.length;n++)for(o=0;o<r[n].length;o++)e(r[n][o],this);break}r.length===1?r=r[0]:i=`Multi${i}`;let s={type:"Feature",geometry:{type:i,coordinates:r},properties:this.properties};return this.id!==null&&(s.id=this.id),s}toGeoJSON(e){if(typeof e=="function")return this._toGeoJSON(e);let{x:r,y:i,z:n}=e,o=this.extent*Math.pow(2,n),s=this.extent*r,l=this.extent*i;function u(h){for(let v=0;v<h.length;v++){let T=h[v];T[0]=(T[0]+s)*360/o-180;let E=180-(T[1]+l)*360/o;T[1]=360/Math.PI*Math.atan(Math.exp(E*Math.PI/180))-90}}return this._toGeoJSON(u)}};var hM=class{version;name;extent;length;_pbf;_keys;_values;_features;constructor(e,r){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Sbe,this,r),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let r=this._pbf.readVarint()+this._pbf.pos;return new uy(this._pbf,r,this.extent,this._keys,this._values)}};function Sbe(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(Cbe(r)))}function Cbe(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint()>>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}return e}var pM=class{layers;constructor(e,r){this.layers=e.readFields(Mbe,{},r)}};function Mbe(t,e,r){if(t===3&&r){let i=new hM(r,r.readVarint()+r.pos);i.length&&e&&(e[i.name]=i)}}function _Y(t){let e=t.indices.length,r="Polygon";if(e<=1)return{type:r,data:t.data,areas:[[Xd(t.data)]],indices:[t.indices]};let i=[],n=[],o=[],s=[],l,u=0;for(let h,v=0,T;v<e;v++){T=t.indices[v]-u,h=t.indices[v+1]-u||t.data.length;let E=t.data.slice(T,h),M=Xd(E);if(M===0){let O=t.data.slice(0,T),F=t.data.slice(h);t.data=O.concat(F),u+=h-T;continue}l===void 0&&(l=M<0),l===M<0?(s.length&&(i.push(o),n.push(s)),s=[T],o=[M]):(o.push(M),s.push(T))}return o&&i.push(o),s.length&&n.push(s),{type:r,areas:i,indices:n,data:t.data}}function yY(t,e,r,i){for(let n=0,o=t.length;n<o;n+=2){t[n]=(t[n]+e)*360/i-180;let s=180-(t[n+1]+r)*360/i;t[n+1]=360/Math.PI*Math.atan(Math.exp(s*Math.PI/180))-90}}function vY(t,e,r){e&&r&&(t===1?e.id=r.readVarint():t===2?Ibe(r,e):t===3?e.type=r.readVarint():t===4&&(e._geometry=r.pos))}function Ibe(t,e){let r=t.readVarint()+t.pos;for(;t.pos<r;){let i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}var xY,yg,dF,dM,AF,mF,Gb;var AM=class{properties;extent;type;id;_pbf;_geometry;_keys;_values;_geometryInfo;constructor(e,r,i,n,o,s){this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=n,this._values=o,this._geometryInfo=s,e.readFields(vY,this,r)}loadGeometry(){let e=this._pbf;e.pos=this._geometry,xY=e.readVarint()+e.pos,yg=1,dM=0,AF=0,mF=0,Gb=0;let r=[],i=[];for(;e.pos<xY;)if(dM<=0&&(dF=e.readVarint(),yg=dF&7,dM=dF>>3),dM--,yg===1||yg===2)AF+=e.readSVarint(),mF+=e.readSVarint(),yg===1&&r.push(Gb),i.push(AF,mF),Gb+=2;else if(yg===7){if(Gb>0){let n=r[r.length-1];i.push(i[n],i[n+1]),Gb+=2}}else throw new Error(`unknown command ${yg}`);return{data:i,indices:r}}_toBinaryCoordinates(e){let r=this.loadGeometry(),i;e(r.data,this);let n=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=r.indices.length,i={type:"Point",...r};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=r.indices.length,this._geometryInfo.linePositionsCount+=r.data.length/n,i={type:"LineString",...r};break;case 3:i=_Y(r),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=i.indices.length;for(let s of i.indices)this._geometryInfo.polygonRingsCount+=s.length;this._geometryInfo.polygonPositionsCount+=i.data.length/n;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}let o={type:"Feature",geometry:i,properties:this.properties};return this.id!==null&&(o.id=this.id),o}toBinaryCoordinates(e){if(typeof e=="function")return this._toBinaryCoordinates(e);let{x:r,y:i,z:n}=e,o=this.extent*Math.pow(2,n),s=this.extent*r,l=this.extent*i;return this._toBinaryCoordinates(u=>yY(u,s,l,o))}};var mM=class{version;name;extent;length;_pbf;_keys;_values;_features;constructor(e,r){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Pbe,this,r),this.length=this._features.length}feature(e,r){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let i=this._pbf.readVarint()+this._pbf.pos;return new AM(this._pbf,i,this.extent,this._keys,this._values,r)}};function Pbe(t,e,r){e&&r&&(t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(Rbe(r)))}function Rbe(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){let i=t.readVarint()>>3;e=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}return e}var gM=class{layers;constructor(e,r){this.layers=e.readFields(Bbe,{},r)}};function Bbe(t,e,r){if(t===3&&r){let i=new mM(r,r.readVarint()+r.pos);i.length&&e&&(e[i.name]=i)}}function yF(t,e){let r=Dbe(e),i=e?.gis?.format||e?.mvt?.shape||e?.shape;switch(i){case"columnar-table":return{shape:"columnar-table",data:gF(t,r)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:bY(t,r)};case"geojson":return bY(t,r);case"binary-geometry":return gF(t,r);case"binary":return gF(t,r);default:throw new Error(i||"undefined shape")}}function gF(t,e){let[r,i]=Obe(t,e),n=uF(r,i);return n.byteLength=t.byteLength,n}function Obe(t,e){let r=[],i={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(t.byteLength<=0)return[r,i];let n=new gM(new _F.default(t));return(e&&Array.isArray(e.layers)?e.layers:Object.keys(n.layers)).forEach(s=>{let l=n.layers[s];if(l)for(let u=0;u<l.length;u++){let h=l.feature(u,i),v=Fbe(h,e,s);r.push(v)}}),[r,i]}function bY(t,e){if(t.byteLength<=0)return[];let r=[],i=new pM(new _F.default(t));return(Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach(o=>{let s=i.layers[o];if(s)for(let l=0;l<s.length;l++){let u=s.feature(l),h=Lbe(u,e,o);r.push(h)}}),r}function Dbe(t){if(!t?.mvt)throw new Error("mvt options required");let e=t.mvt?.coordinates==="wgs84",{tileIndex:r}=t.mvt,i=r&&Number.isFinite(r.x)&&Number.isFinite(r.y)&&Number.isFinite(r.z);if(e&&!i)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}function Lbe(t,e,r){let i=t.toGeoJSON(e.coordinates==="wgs84"?e.tileIndex:Nbe);return e.layerProperty&&(i.properties[e.layerProperty]=r),i}function Fbe(t,e,r){let i=t.toBinaryCoordinates(e.coordinates==="wgs84"?e.tileIndex:kbe);return e.layerProperty&&i.properties&&(i.properties[e.layerProperty]=r),i}function Nbe(t,e){let{extent:r}=e;for(let i=0;i<t.length;i++){let n=t[i];n[0]/=r,n[1]/=r}}function kbe(t,e){let{extent:r}=e;for(let i=0,n=t.length;i<n;++i)t[i]/=r}var Ube="4.2.0-beta.2",_M={dataType:null,batchType:null,name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:Ube,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}},zbe={..._M,parse:async(t,e)=>yF(t,e),parseSync:yF,binary:!0};var Vbe={Point:wY,MultiPoint:jbe,LineString:TY,MultiLineString:Hbe,Polygon:EY,MultiPolygon:Gbe};function wY([t,e],[r,i],n){let o=Oa(r[0],i[0],t),s=Oa(r[1],i[1],e);return n.unprojectFlat([o,s])}function vF(t,e,r){return t.map(i=>wY(i,e,r))}function jbe(t,e,r){return vF(t,e,r)}function TY(t,e,r){return vF(t,e,r)}function Hbe(t,e,r){return t.map(i=>TY(i,e,r))}function EY(t,e,r){return t.map(i=>vF(i,e,r))}function Gbe(t,e,r){return t.map(i=>EY(i,e,r))}function SY(t,e,r){let i=r.projectFlat([e.west,e.north]),n=r.projectFlat([e.east,e.south]),o=[i,n];return{...t,coordinates:Vbe[t.type](t.coordinates,o,r)}}var Wbe=["points","lines","polygons"];function xF(t,e,r,i){for(let n of Wbe){let o=t[n]&&qbe(t[n],e,r,i);if(o>=0)return o}return-1}function qbe(t,e,r,i){let n=t.featureIds.value;if(!n.length)return-1;let o=0,s=n[n.length-1]+1;if(i){let u=Xbe(t,i);if(u)o=u[0],s=u[1]+1;else return-1}let l=-1;if(e in t.numericProps){let u=t.numericProps[e].value.findIndex((h,v)=>h===r&&n[v]>=o&&n[v]<s);return u>=0?t.globalFeatureIds.value[u]:-1}else e?l=CY(t.properties,u=>u[e]===r,o,s):t.fields&&(l=CY(t.fields,u=>u.id===r,o,s));return l>=0?Ybe(t,l):-1}function Xbe(t,e){if(!t.__layers){let r={},{properties:i}=t;for(let n=0;n<i.length;n++){let{layerName:o}=i[n];o&&(r[o]?r[o][1]=n:r[o]=[n,n])}t.__layers=r}return t.__layers[e]}function Ybe(t,e){if(!t.__ids){let r=[],i=t.featureIds.value,n=t.globalFeatureIds.value;for(let o=0;o<i.length;o++)r[i[o]]=n[o];t.__ids=r}return t.__ids[e]}function CY(t,e,r,i){for(let n=r;n<i;n++)if(e(t[n],n))return n;return-1}var bF=512,Kbe={...Oh.defaultProps,data:nA,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[_M],binary:!0},yM=class extends Fh{initializeState(){super.initializeState();let e=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:e,data:null,tileJSON:null,hoveredFeatureId:null,hoveredFeatureLayerName:null})}get isLoaded(){return Boolean(this.state?.data&&super.isLoaded)}updateState({props:e,oldProps:r,context:i,changeFlags:n}){n.dataChanged&&this._updateTileData(),this.state?.data&&(super.updateState({props:e,oldProps:r,context:i,changeFlags:n}),this._setWGS84PropertyForTiles());let{highlightColor:o}=e;o!==r.highlightColor&&Array.isArray(o)&&this.setState({highlightColor:o})}async _updateTileData(){let e=this.props.data,r=null;if(typeof e=="string"&&!OD(e)){let{onDataLoad:i,fetch:n}=this.props;this.setState({data:null,tileJSON:null});try{r=await n(e,{propName:"data",layer:this,loaders:[]})}catch(o){this.raiseError(o,"loading TileJSON"),e=null}i&&i(r,{propName:"data",layer:this})}else e&&typeof e=="object"&&"tilejson"in e&&(r=e);r&&(e=r.tiles),this.setState({data:e,tileJSON:r})}_getTilesetOptions(){let e=super._getTilesetOptions(),r=this.state.tileJSON,{minZoom:i,maxZoom:n}=this.props;return r&&(Number.isFinite(r.minzoom)&&r.minzoom>i&&(e.minZoom=r.minzoom),Number.isFinite(r.maxzoom)&&(!Number.isFinite(n)||r.maxzoom<n)&&(e.maxZoom=r.maxzoom)),e}renderLayers(){return this.state?.data?super.renderLayers():null}getTileData(e){let{data:r,binary:i}=this.state,{index:n,signal:o}=e,s=Lh(r,e);if(!s)return Promise.reject("Invalid URL");let l=this.getLoadOptions(),{fetch:u}=this.props;return l={...l,mimeType:"application/x-protobuf",mvt:{...l?.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:n},gis:i?{format:"binary"}:{}},u(s,{propName:"data",layer:this,loadOptions:l,signal:o})}renderSubLayers(e){let{x:r,y:i,z:n}=e.tile.index,o=Math.pow(2,n),s=bF/o,l=-s,u=bF*r/o,h=bF*(1-i/o),v=new Kr().scale([s,l,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=v,e.coordinateOrigin=[u,h,0],e.coordinateSystem=Zr.CARTESIAN,e.extensions=[...e.extensions||[],new ay]);let T=super.renderSubLayers(e);return this.state.binary&&!(T instanceof Oh)&&ur.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),T}_updateAutoHighlight(e){let{uniqueIdProperty:r}=this.props,{hoveredFeatureId:i,hoveredFeatureLayerName:n}=this.state,o=e.object,s=null,l=null;o&&(s=wF(o,r),l=MY(o));let{highlightColor:u}=this.props;typeof u=="function"&&(u=u(e)),(i!==s||n!==l)&&this.setState({highlightColor:u,hoveredFeatureId:s,hoveredFeatureLayerName:l})}_isWGS84(){return Boolean(this.context.viewport.resolution)}getPickingInfo(e){let r=super.getPickingInfo(e);if(this.state.binary&&r.index!==-1){let{data:i}=e.sourceLayer.props;r.object=cM(i,{globalFeatureId:r.index})}return r.object&&!this._isWGS84()&&(r.object=PY(r.object,r.tile.bbox,this.context.viewport)),r}getSubLayerPropsByTile(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(e){let{hoveredFeatureId:r,hoveredFeatureLayerName:i,binary:n}=this.state,{uniqueIdProperty:o,highlightedFeatureId:s}=this.props,l=e.content,u=IY(s);if(!(IY(r)||u))return-1;let v=u?s:r;return Array.isArray(l)?l.findIndex(T=>{let E=wF(T,o)===v,M=u||MY(T)===i;return E&&M}):l&&n?xF(l,o,v,u?"":i):-1}_pickObjects(e){let{deck:r,viewport:i}=this.context,n=i.width,o=i.height,s=i.x,l=i.y,u=[this.id];return r.pickObjects({x:s,y:l,width:n,height:o,layerIds:u,maxObjects:e})}getRenderedFeatures(e=null){let r=this._pickObjects(e),i=new Set,n=[];for(let o of r){let s=wF(o.object,this.props.uniqueIdProperty);s===void 0?n.push(o.object):i.has(s)||(i.add(s),n.push(o.object))}return n}_setWGS84PropertyForTiles(){let e="dataInWGS84";this.state.tileset.selectedTiles.forEach(i=>{i.hasOwnProperty(e)||Object.defineProperty(i,e,{get:()=>{if(!i.content)return null;if(this.state.binary&&Array.isArray(i.content)&&!i.content.length)return[];let{bbox:n}=i;if(i._contentWGS84===void 0&&DD(n)){let o=this.state.binary?cM(i.content):i.content;i._contentWGS84=o.map(s=>PY(s,n,this.context.viewport))}return i._contentWGS84}})})}},Wb=yM;(()=>{yM.layerName="MVTLayer"})(),(()=>{yM.defaultProps=Kbe})();function wF(t,e){if(t.properties&&e)return t.properties[e];if("id"in t)return t.id}function MY(t){return t.properties?.layerName||null}function IY(t){return t!=null&&t!==""}function PY(t,e,r){let i={...t,geometry:{type:t.geometry.type}};return Object.defineProperty(i.geometry,"coordinates",{get:()=>SY(t.geometry,e,r).coordinates}),i}var RY="0123456789bcdefghjkmnpqrstuvwxyz",BY={};for(let t=0;t<RY.length;t++)BY[RY.charAt(t)]=t;var Zbe=-90,Jbe=90,Qbe=-180,$be=180;function ewe(t){let e=!0,r=Jbe,i=Zbe,n=$be,o=Qbe,s,l=0;for(let u=0,h=t.length;u<h;u++){let v=t[u].toLowerCase();l=BY[v];for(let T=4;T>=0;T--){let E=l>>T&1;e?(s=(n+o)/2,E===1?o=s:n=s):(s=(r+i)/2,E===1?i=s:r=s),e=!e}}return[i,o,r,n]}function OY(t){let[e,r,i,n]=ewe(t);return[n,i,n,e,r,e,r,i,n,i]}var twe={getGeohash:{type:"accessor",value:t=>t.geohash}},vM=class extends eu{indexToBounds(){let{data:e,getGeohash:r}=this.props;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(i,n)=>OY(r(i,n))}}},qb=vM;(()=>{vM.layerName="GeohashLayer"})(),(()=>{vM.defaultProps=twe})();function fy(t,e=""){if(!t)throw new Error(`JSON conversion error ${e}`)}function LY(t,e){let r=iwe(e),i=t;for(let n of r)i=rwe(i)?i[n]:void 0;return i}function rwe(t){return t!==null&&typeof t=="object"}var DY={};function iwe(t){if(typeof t=="string"){let e=DY[t];return e||(e=t.split("."),DY[t]=e),e}return Array.isArray(t)?t:[t]}var EF={};As(EF,{addBinaryOp:()=>lwe,addUnaryOp:()=>awe,compile:()=>owe,compileAsync:()=>swe,eval:()=>tl,evalAsync:()=>Yb,parse:()=>zY.default});var hy=ga(TF()),zY=ga(TF()),Yb=function t(e,r){try{var i,n=e;switch(n.type){case"ArrayExpression":return Promise.resolve(NY(n.elements,r));case"BinaryExpression":return Promise.resolve(Promise.all([t(n.left,r),t(n.right,r)])).then(function(M){return py[n.operator](M[0],M[1])});case"CallExpression":var o,s,l,u=function(){if(typeof s=="function"){var M=s,O=M.apply,F=o;return Promise.resolve(NY(n.arguments,r)).then(function(z){return Promise.resolve(O.call(M,F,z))})}},h=n.callee.type==="MemberExpression"?Promise.resolve(FY(n.callee,r)).then(function(M){o=(l=M)[0],s=l[1]}):Promise.resolve(t(n.callee,r)).then(function(M){s=M});return Promise.resolve(h&&h.then?h.then(u):u());case"ConditionalExpression":return Promise.resolve(t(n.test,r)).then(function(M){return Promise.resolve(t(M?n.consequent:n.alternate,r))});case"Identifier":return Promise.resolve(r[n.name]);case"Literal":return Promise.resolve(n.value);case"LogicalExpression":var v=function(M){return i?M:Promise.resolve(Promise.all([t(n.left,r),t(n.right,r)])).then(function(O){return py[n.operator](O[0],O[1])})},T=n.operator==="||"?(i=1,Promise.resolve(t(n.left,r)).then(function(M){return M||Promise.resolve(t(n.right,r))})):function(){if(n.operator==="&&")return i=1,Promise.resolve(t(n.left,r)).then(function(M){return M&&Promise.resolve(t(n.right,r))})}();return Promise.resolve(T&&T.then?T.then(v):v(T));case"MemberExpression":return Promise.resolve(FY(n,r)).then(function(M){return M[1]});case"ThisExpression":return Promise.resolve(r);case"UnaryExpression":var E=bM[n.operator];return Promise.resolve(t(n.argument,r)).then(function(M){return E.call(bM,M)});default:return Promise.resolve(void 0)}}catch(M){return Promise.reject(M)}},FY=function(t,e){try{return Promise.resolve(Yb(t.object,e)).then(function(r){function i(){if(/^__proto__|prototype|constructor$/.test(n))throw Error('Access to member "'+n+'" disallowed.');return[r,r[n]]}var n,o=function(){if(t.computed)return Promise.resolve(Yb(t.property,e)).then(function(s){n=s});n=t.property.name}();return o&&o.then?o.then(i):i()})}catch(r){return Promise.reject(r)}},NY=function(t,e){try{return Promise.resolve(Promise.all(t.map(function(r){return Yb(r,e)})))}catch(r){return Promise.reject(r)}},nwe={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},py={"||":function(t,e){return t||e},"&&":function(t,e){return t&&e},"|":function(t,e){return t|e},"^":function(t,e){return t^e},"&":function(t,e){return t&e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"<<":function(t,e){return t<<e},">>":function(t,e){return t>>e},">>>":function(t,e){return t>>>e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e}},bM={"-":function(t){return-t},"+":function(t){return+t},"~":function(t){return~t},"!":function(t){return!t}};function kY(t,e){return t.map(function(r){return tl(r,e)})}function UY(t,e){var r,i=tl(t.object,e);if(r=t.computed?tl(t.property,e):t.property.name,/^__proto__|prototype|constructor$/.test(r))throw Error('Access to member "'+r+'" disallowed.');return[i,i[r]]}function tl(t,e){var r=t;switch(r.type){case"ArrayExpression":return kY(r.elements,e);case"BinaryExpression":return py[r.operator](tl(r.left,e),tl(r.right,e));case"CallExpression":var i,n,o;return r.callee.type==="MemberExpression"?(i=(o=UY(r.callee,e))[0],n=o[1]):n=tl(r.callee,e),typeof n!="function"?void 0:n.apply(i,kY(r.arguments,e));case"ConditionalExpression":return tl(r.test,e)?tl(r.consequent,e):tl(r.alternate,e);case"Identifier":return e[r.name];case"Literal":return r.value;case"LogicalExpression":return r.operator==="||"?tl(r.left,e)||tl(r.right,e):r.operator==="&&"?tl(r.left,e)&&tl(r.right,e):py[r.operator](tl(r.left,e),tl(r.right,e));case"MemberExpression":return UY(r,e)[1];case"ThisExpression":return e;case"UnaryExpression":return bM[r.operator](tl(r.argument,e));default:return}}function owe(t){return tl.bind(null,(0,hy.default)(t))}function swe(t){return Yb.bind(null,(0,hy.default)(t))}function awe(t,e){hy.default.addUnaryOp(t),bM[t]=e}function lwe(t,e,r){r?(hy.default.addBinaryOp(t,e),py[t]=r):(hy.default.addBinaryOp(t,nwe[t]||1),py[t]=e)}var{parse:cwe,eval:uwe}=EF,SF={"-":t=>t};function vg(t,e){if(t in SF)return SF[t];let r,i=cwe(t);return i.type==="Identifier"?r=n=>LY(n,t):(CF(i,n=>{if(n.type==="CallExpression")throw new Error("Function calls not allowed in JSON expressions")}),r=n=>uwe(i,n)),SF[t]=r,r}function CF(t,e){if(Array.isArray(t))t.forEach(r=>CF(r,e));else if(t&&typeof t=="object"){t.type&&e(t);for(let r in t)CF(t[r],e)}}var dy="@@=",MF="@@#",VY="@@type",wM="@@function";var jY=t=>t&&typeof t=="object",Xp=class{constructor(...e){this.typeKey=VY,this.functionKey=wM,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.React=null,this.convertFunction=vg,this.preProcessClassProps=(r,i)=>i,this.postProcessConvertedJson=r=>r;for(let r of e)this.merge(r)}merge(e){for(let r in e)switch(r){case"layers":case"views":Object.assign(this.classes,e[r]);break;default:if(r in this){let i=e[r];this[r]=jY(this[r])?Object.assign(this[r],i):i}}}validate(e){return fy(!this.typeKey||typeof this.typeKey=="string"),fy(jY(this.classes)),!0}};function fwe(t){return typeof t=="string"&&t.startsWith(dy)}function hwe(t){return t.replace(dy,"")}function Ay(t,e){let r={};for(let i in t){let n=t[i];fwe(n)&&(n=hwe(n),n=vg(n,e)),r[i]=n}return r}function HY(t,e,r){let i=r.classes[t],n=r.reactComponents[t];if(!i&&!n){let{log:o}=r;if(o){let s=JSON.stringify(e,null,0).slice(0,40);o.warn(`JSON converter: No registered class of type ${t}(${s}...) `)}return null}return i?pwe(i,e,r):dwe(n,e,r)}function pwe(t,e,r){return r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=Ay(e,r),new t(e)}function dwe(t,e,r){let{React:i}=r,{children:n=[]}=e;return delete e.children,r.preProcessClassProps&&(e=r.preProcessClassProps(t,e,r)),e=Ay(e,r),i.createElement(t,e,n)}function GY(t,e,r){let i=r.functions[t];if(!i){let{log:n}=r;if(n){let o=JSON.stringify(e,null,0).slice(0,40);n.warn(`JSON converter: No registered function ${t}(${o}...) `)}return null}return i(e)}function IF(t){return typeof t=="string"?JSON.parse(t):t}var PF=t=>t&&typeof t=="object",xg=class{constructor(e){this.log=console,this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(e)}finalize(){}setProps(e){"configuration"in e&&(this.configuration=e.configuration instanceof Xp?e.configuration:new Xp(e.configuration)),"onJSONChange"in e&&(this.onJSONChange=e.onJSONChange)}mergeConfiguration(e){this.configuration.merge(e)}convert(e){if(!e||e===this.json)return this.convertedJson;this.json=e;let r=IF(e),i=Awe(r,this.configuration);return i=this.configuration.postProcessConvertedJson(i),this.convertedJson=i,i}convertJson(e){return this.convert(e)}};function Awe(t,e){return e=new Xp(e),RF(t,"",e)}function RF(t,e,r){return Array.isArray(t)?t.map((i,n)=>RF(i,String(n),r)):mwe(t,r)?gwe(t,r):PF(t)?wM in t?_we(t,r):BF(t,r):typeof t=="string"?ywe(t,e,r):t}function mwe(t,e){let{typeKey:r}=e;return PF(t)&&Boolean(t[r])}function gwe(t,e){let{typeKey:r}=e,i=t[r],n={...t};return delete n[r],n=BF(n,e),HY(i,n,e)}function _we(t,e){let{functionKey:r}=e,i=t[r],n={...t};return delete n[r],n=BF(n,e),GY(i,n,e)}function BF(t,e){fy(PF(t));let r={};for(let i in t){let n=t[i];r[i]=RF(n,i,e)}return r}function ywe(t,e,r){if(t.startsWith(dy)&&r.convertFunction)return t=t.replace(dy,""),r.convertFunction(t,r);if(t.startsWith(MF)){if(t=t.replace(MF,""),r.constants[t])return r.constants[t];let[i,n]=t.split(".");return r.enumerations[i][n]}return t}var my={onInitialize:t=>t,onFinalize:t=>t,onMessage:t=>t},zh=class{static setCallbacks({onInitialize:e,onFinalize:r,onMessage:i}){e&&(my.onInitialize=e),r&&(my.onFinalize=r),i&&(my.onMessage=i)}constructor(e="Transport"){this._messageQueue=[],this.userData={},this._destroyed=!1,this.name=e}getRootDOMElement(){return typeof document<"u"?document.body:null}sendJSONMessage(){console.error("Back-channel not implemented for this transport")}sendBinaryMessage(){console.error("Back-channel not implemented for this transport")}_initialize(e={}){let r={transport:this,...e};my.onInitialize(r)}_finalize(e={}){let r={transport:this,...e};my.onFinalize(r),this._destroyed=!0}_messageReceived(e={}){e={transport:this,...e},console.debug("Delivering transport message",e),my.onMessage(e)}static _stringifyJSONSafe(e){let r=new Set;return JSON.stringify(e,(i,n)=>{if(typeof n=="object"&&n!==null){if(r.has(n))try{return JSON.parse(JSON.stringify(n))}catch{return}r.add(n)}return n})}};function WY(t,e){if(t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(!(r in e)||t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}var TM=class{constructor(e){this.map=null,this.width=0,this.height=0,this.props={...e},this._initialize(this.props)}finalize(){this.map?.remove(),this.map=null}setProps(e){let r=this.props,i={...this.props,...e};if(this.props=i,!this.map)return;this._update(r,i)&&this.redraw()}redraw(){let e=this.map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}getMap(){return this.map}_initialize(e){let{mapLib:r,container:i}=e;r.accessToken=e.mapboxApiAccessToken||"",this.map=new e.mapLib.Map({container:i,maxZoom:24,...e.mapOptions,...qY(e.viewState),style:e.mapStyle,interactive:!1,trackResize:!1}),Object.defineProperty(i,"offsetWidth",{get:()=>this.width}),Object.defineProperty(i,"clientWidth",{get:()=>this.width}),Object.defineProperty(i,"offsetHeight",{get:()=>this.height}),Object.defineProperty(i,"clientHeight",{get:()=>this.height}),this.map.resize()}_update(e,r){e.mapStyle!==r.mapStyle&&this.map.setStyle(r.mapStyle);let n=e.width!==r.width||e.height!==r.height;n&&(this.width=r.width,this.height=r.height,this.map.resize());let o=e.viewState,s=r.viewState,l=s.latitude!==o.latitude||s.longitude!==o.longitude||s.zoom!==o.zoom||s.pitch!==o.pitch||s.bearing!==o.bearing;return l&&this.map.jumpTo(qY(s)),n||l}};function qY(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing??0,pitch:t.pitch??0}}var XY={position:"absolute",left:0,top:0,width:"100%",height:"100%"};function vwe(t){let{container:e=document.body}=t;if(typeof e=="string"&&(e=document.getElementById(e)),!e)throw Error("Deck: container not found");window.getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=document.createElement("div");e.appendChild(i),Object.assign(i.style,XY);let n=document.createElement("canvas");return e.appendChild(n),Object.assign(n.style,XY),{container:e,mapCanvas:i,deckCanvas:n}}var bg=class extends Ip{constructor(e){if(typeof document>"u")throw Error("Deck can only be used in the browser");let{mapCanvas:r,deckCanvas:i}=vwe(e),n=e.viewState||e.initialViewState,o=Number.isFinite(n&&n.latitude),{map:s=globalThis.mapboxgl||globalThis.maplibregl}=e;super({canvas:i,...e}),s&&s.Map?this._map=o&&new TM({...e,width:0,height:0,viewState:n,container:r,mapLib:s}):this._map=s}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(e){"mapStyle"in e&&this._map&&this._map.setProps({mapStyle:e.mapStyle}),super.setProps(e)}_drawLayers(e,r){if(this._map){let i=this.getViewports()[0];i&&this._map.setProps({width:i.width,height:i.height,viewState:i})}super._drawLayers(e,r)}};Ll.registerDevices([wh]);var YY=t=>t.charAt(0)===t.charAt(0).toUpperCase(),xwe=t=>t.charAt(0)===t.charAt(0).toLowerCase()&&t.charAt(0)!=="_";function OF(t={},e){let r={},i=Object.keys(t).filter(e);for(let n of i)r[n]=t[n];return r}var bwe={classes:OF(Kb,YY),enumerations:{COORDINATE_SYSTEM:Zr,GL:yh}};tm([Hv]);var cA=new xg({configuration:bwe});function wwe(t,e){let r={classes:OF(t,YY),functions:OF(t,xwe)};e.mergeConfiguration(r)}function Twe(t,e){if(!t)return;let r={};function i(){Object.values(r).every(o=>o)&&typeof e=="function"&&e()}function n(o,s){wwe(s,cA),r[o]=s,i()}t.forEach(({libraryName:o,resourceUri:s})=>{if(r[o]=!1,o in window){n(o,window[o]);return}Object.defineProperty(window,o,{set:l=>n(o,l),get:()=>r[o]}),h5(s)})}function KY(t,e){let r=cA.convert(t);e.setProps(r)}function Ewe(t,e){return t.filter(r=>r&&r.id&&!e.find(i=>i.id===r.id))}function Swe({mapProvider:t,props:e,mapboxApiKey:r,googleMapsKey:i,handleEvent:n,getTooltip:o,container:s}){let u={...n?{onClick:h=>n("deck-click-event",h),onHover:h=>n("deck-hover-event",h),onResize:h=>n("deck-resize-event",h),onViewStateChange:({viewState:h,interactionState:v,oldViewState:T})=>{let E=new Tc(h);h.nw=E.unproject([0,0]),h.se=E.unproject([E.width,E.height]),n("deck-view-state-change-event",h)},onDragStart:h=>n("deck-drag-start-event",h),onDrag:h=>n("deck-drag-event",h),onDragEnd:h=>n("deck-drag-end-event",h)}:null,getTooltip:o,container:s};switch(t){case"mapbox":return ur.info("Using Mapbox base maps")(),new bg({...u,...e,map:K3,mapboxApiAccessToken:r,onLoad:f5});case"carto":return ur.info("Using Carto base maps")(),new bg({map:K3,...u,...e});case"google_maps":return ur.info("Using Google Maps base maps")(),z9({...u,...e,googleMapsKey:i});default:return ur.info("No recognized map provider specified")(),new bg({...u,...e,map:null,mapboxApiAccessToken:null})}}function EM({mapboxApiKey:t,googleMapsKey:e,container:r,jsonInput:i,tooltip:n,handleEvent:o,customLibraries:s,configuration:l}){let u;try{l&&cA.mergeConfiguration(l);let h=i.layers||[],v=cA.convert(i);PO(r,v);let T=(v.layers||[]).filter(z=>z),E=Ewe(h,T),M=q3(n),{mapProvider:O}=v;u=Swe({mapProvider:O,props:v,mapboxApiKey:t,googleMapsKey:e,handleEvent:o,getTooltip:M,container:r}),Twe(s,()=>{if(E.length){let W=(cA.convert({layers:i.layers}).layers||[]).filter(J=>J);W.length>T.length&&u.setProps({layers:W})}})}catch(h){console.error(h)}return u}function SM(){zh.setCallbacks({onInitialize({transport:t}){let{width:e,height:r,customLibraries:i,mapboxApiKey:n,jsonInput:o,tooltip:s}=Pwe(t);u5();let l=t.getRootDOMElement(),u=a5(e,r);l.appendChild(u);let h=JSON.parse(o),v=EM({mapboxApiKey:n,container:u,jsonInput:h,tooltip:s,handleEvent:(T,E)=>Iwe(t,T,E),customLibraries:i});t.userData.deck=v},onFinalize({transport:t}){let{deck:e}=t.userData;e.finalize()},onMessage({transport:t,type:e,json:r,binary:i}){let{deck:n}=t.userData,o;switch(e){case"json":o=cA.convert(r),n.setProps(o);break;case"json-with-binary":o=cA.convert(r);let s=t.jupyterModel.get("data_buffer"),l=Cwe({binary:s,convertedJson:o});n.setProps(l);break;default:}}})}function Cwe({binary:t,convertedJson:e}){for(let r=0;r<e.layers.length;r++){let i=e.layers[r].id,n=e.layers[r];e.layers[r]=n.clone({data:t[i]})}return e}function Mwe(t,e){return e instanceof Dn?e.id:e}function Iwe(t,e,r){if(e==="hover"&&!r.picked&&r.index===-1)return;let i=JSON.parse(JSON.stringify(r,Mwe));t.sendJSONMessage(e,i)}function Pwe(t){let{jupyterModel:e}=t;if(!e)throw new Error("deck.gl playground currently only works with the Jupyter Widget Transport");return{width:e.get("width"),height:e.get("height"),customLibraries:e.get("custom_libraries"),mapboxApiKey:e.get("mapbox_key"),jsonInput:e.get("json_input"),tooltip:e.get("tooltip")}}var wg=class extends zh{constructor(){super("Jupyter Transport (JavaScript <=> Jupyter Kernel)"),this.jupyterModel=null,this.jupyterView=null}getRootDOMElement(){return this.jupyterView.el}sendJSONMessage(e,r){let i=zh._stringifyJSONSafe({type:e,data:r});this.jupyterModel.send(i)}};var qw={};As(qw,{CONTROL_COMM_PROTOCOL_VERSION:()=>NQ,CONTROL_COMM_TARGET:()=>FQ,CONTROL_COMM_TIMEOUT:()=>kQ,DOMWidgetModel:()=>fk,DOMWidgetView:()=>hk,IJupyterWidgetRegistry:()=>aIe,JUPYTER_WIDGETS_VERSION:()=>NM,JupyterPhosphorPanelWidget:()=>$Me,JupyterPhosphorWidget:()=>Hee,LayoutModel:()=>eIe,LayoutView:()=>tIe,ManagerBase:()=>vMe,PROTOCOL_VERSION:()=>kM,StyleModel:()=>rIe,StyleView:()=>iIe,ViewList:()=>sIe,WidgetModel:()=>PA,WidgetView:()=>fv,WrappedError:()=>gMe,assign:()=>Yp,base64ToBuffer:()=>iN,bufferToBase64:()=>rN,bufferToHex:()=>yMe,difference:()=>FM,hexToBuffer:()=>tN,isEqual:()=>Cy,pack_models:()=>uk,put_buffers:()=>uA,reject:()=>Hh,remove_buffers:()=>ow,resolvePromisesDict:()=>My,serialize_state:()=>UQ,shims:()=>pk,unpack_models:()=>Ww,uuid:()=>nw});var LM=ga(QY()),RQ=ga(gy()),BQ=ga(EQ()),OQ=ga(PQ()),mMe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),DM=function(){return DM=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},DM.apply(this,arguments)};function FM(t,e){return t.filter(function(r){return e.indexOf(r)===-1})}function Cy(t,e){return(0,BQ.default)(t,e)}var Yp=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t};function nw(){return RQ.UUID.uuid4()}var gMe=function(t){mMe(e,t);function e(r,i){var n=t.call(this,r)||this;return console.warn("WrappedError has been deprecated!"),i instanceof e?n.error_stack=i.error_stack:n.error_stack=[i],n.error_stack.push(n),n}return e}(Error);function My(t){var e=Object.keys(t),r=[];return e.forEach(function(i){r.push(t[i])}),Promise.all(r).then(function(i){for(var n={},o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function Hh(t,e){return function(i){throw e&&console.error(new Error(t)),i}}function uA(t,e,r){for(var i=0;i<e.length;i++){for(var n=e[i],o=t,s=0;s<n.length-1;s++)o=o[n[s]];o[n[n.length-1]]=r[i]}}function ow(t){var e=[],r=[];function i(o,s){if(o.toJSON&&(o=o.toJSON()),Array.isArray(o))for(var l=!1,u=0;u<o.length;u++){var h=o[u];if(h)if(h instanceof ArrayBuffer||ArrayBuffer.isView(h))l||(o=o.slice(),l=!0),e.push(ArrayBuffer.isView(h)?h.buffer:h),r.push(s.concat([u])),o[u]=null;else{var v=i(h,s.concat([u]));v!==h&&(l||(o=o.slice(),l=!0),o[u]=v)}}else if((0,OQ.default)(o))for(var T in o){var l=!1;if(o.hasOwnProperty(T)){var h=o[T];if(h)if(h instanceof ArrayBuffer||ArrayBuffer.isView(h))l||(o=DM({},o),l=!0),e.push(ArrayBuffer.isView(h)?h.buffer:h),r.push(s.concat([T])),delete o[T];else{var v=i(h,s.concat([T]));v!==h&&(l||(o=DM({},o),l=!0),o[T]=v)}}}return o}var n=i(t,[]);return{state:n,buffers:e,buffer_paths:r}}var _Me=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"];function yMe(t){for(var e=new Uint8Array(t),r=[],i=0;i<e.length;i++)r.push(_Me[e[i]]);return r.join("")}function tN(t){for(var e=new Uint8Array(t.length/2),r=0;r<t.length;r+=2)e[r/2]=parseInt(t.slice(r,r+2),16);return e.buffer}function rN(t){return(0,LM.fromByteArray)(new Uint8Array(t))}function iN(t){return(0,LM.toByteArray)(t).buffer}var LQ=ga(gy());var NM="1.2.0",kM="2.1.0";var sw=function(){return sw=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},sw.apply(this,arguments)},fA=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function l(v){try{h(i.next(v))}catch(T){s(T)}}function u(v){try{h(i.throw(v))}catch(T){s(T)}}function h(v){v.done?o(v.value):n(v.value).then(l,u)}h((i=i.apply(t,e||[])).next())})},hA=function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(h){return function(v){return u([h,v])}}function u(h){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(o=h[0]&2?n.return:h[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,h[1])).done)return o;switch(n=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,n=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){r.label=h[1];break}if(h[0]===6&&r.label<o[1]){r.label=o[1],o=h;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(h);break}o[2]&&r.ops.pop(),r.trys.pop();continue}h=e.call(t,r)}catch(v){h=[6,v],n=0}finally{i=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},DQ=kM.split(".",1)[0],FQ="jupyter.widget.control",NQ="1.0.0",kQ=4e3,vMe=function(){function t(){this.comm_target_name="jupyter.widget",this._models=Object.create(null)}return t.prototype.display_model=function(e,r,i){var n=this;return i===void 0&&(i={}),this.create_view(r,i).then(function(o){return n.display_view(e,o,i)}).catch(Hh("Could not create view",!0))},t.prototype.setViewOptions=function(e){return e===void 0&&(e={}),e},t.prototype.create_view=function(e,r){var i=this;r===void 0&&(r={});var n=e.state_change=e.state_change.then(function(){return i.loadClass(e.get("_view_name"),e.get("_view_module"),e.get("_view_module_version")).then(function(s){var l=new s({model:e,options:i.setViewOptions(r)});return l.listenTo(e,"destroy",l.remove),Promise.resolve(l.render()).then(function(){return l})}).catch(Hh("Could not create a view for model id "+e.model_id,!0))}),o=nw();return e.views[o]=n,n.then(function(s){s.once("remove",function(){delete s.model.views[o]},i)}),e.state_change},t.prototype.callbacks=function(e){return{}},t.prototype.get_model=function(e){return this._models[e]},t.prototype.has_model=function(e){return this._models[e]!==void 0},t.prototype.handle_comm_open=function(e,r){var i=(r.metadata||{}).version||"";if(i.split(".",1)[0]!==DQ){var n="Wrong widget protocol version: received protocol version '"+i+"', but was expecting major version '"+DQ+"'";return console.error(n),Promise.reject(n)}var o=r.content.data,s=o.buffer_paths||[],l=(r.buffers||[]).map(function(u){return u instanceof DataView?u:new DataView(u instanceof ArrayBuffer?u:u.buffer)});return uA(o.state,s,l),this.new_model({model_name:o.state._model_name,model_module:o.state._model_module,model_module_version:o.state._model_module_version,comm:e},o.state).catch(Hh("Could not create a model.",!0))},t.prototype.new_widget=function(e,r){var i=this;r===void 0&&(r={});var n;if(e.view_name===void 0||e.view_module===void 0||e.view_module_version===void 0)return Promise.reject("new_widget(...) must be given view information in the options.");e.comm?n=Promise.resolve(e.comm):n=this._create_comm(this.comm_target_name,e.model_id,{state:{_model_module:e.model_module,_model_module_version:e.model_module_version,_model_name:e.model_name,_view_module:e.view_module,_view_module_version:e.view_module_version,_view_name:e.view_name}},{version:kM});var o=sw({},e);return n.then(function(s){o.comm=s;var l=i.new_model(o,r);return l.then(function(u){return u.sync("create",u),u})},function(){return o.model_id||(o.model_id=nw()),i.new_model(o,r)})},t.prototype.register_model=function(e,r){var i=this;this._models[e]=r,r.then(function(n){n.once("comm:close",function(){delete i._models[e]})})},t.prototype.new_model=function(e,r){return r===void 0&&(r={}),fA(this,void 0,void 0,function(){var i,n;return hA(this,function(o){switch(o.label){case 0:if(e.model_id)i=e.model_id;else if(e.comm)i=e.model_id=e.comm.comm_id;else throw new Error("Neither comm nor model_id provided in options object. At least one must exist.");return n=this._make_model(e,r),this.register_model(i,n),[4,n];case 1:return[2,o.sent()]}})})},t.prototype._make_model=function(e,r){return r===void 0&&(r={}),fA(this,void 0,void 0,function(){var i,n,o,s,l,u,h;return hA(this,function(v){switch(v.label){case 0:i=e.model_id,n=this.loadClass(e.model_name,e.model_module,e.model_module_version),v.label=1;case 1:return v.trys.push([1,3,,4]),[4,n];case 2:return o=v.sent(),[3,4];case 3:throw s=v.sent(),console.error("Could not instantiate widget"),s;case 4:if(!o)throw new Error("Cannot find model module "+e.model_module+"@"+e.model_module_version+", "+e.model_name);return[4,o._deserialize_state(r,this)];case 5:return l=v.sent(),u={widget_manager:this,model_id:i,comm:e.comm},h=new o(l,u),h.name=e.model_name,h.module=e.model_module,[2,h]}})})},t.prototype._loadFromKernel=function(){return fA(this,void 0,void 0,function(){var e,r,i,n,o,s,l,u,h,v,T,E,M,O=this;return hA(this,function(F){switch(F.label){case 0:return F.trys.push([0,3,,4]),[4,this._create_comm(FQ,nw(),{},{version:NQ})];case 1:return i=F.sent(),[4,new Promise(function(z,W){i.on_msg(function(J){if(e=J.content.data,e.method!=="update_states"){console.warn(`
3694
3694
  Unknown `+e.method+` message on the Control channel
3695
3695
  `);return}r=(J.buffers||[]).map(function(K){return K instanceof DataView?K:new DataView(K instanceof ArrayBuffer?K:K.buffer)}),z(null)}),i.on_close(function(){return W("Control comm was closed too early")}),i.send({method:"request_states"},{}),setTimeout(function(){return W("Control comm did not respond in time")},kQ)})];case 2:return F.sent(),i.close(),[3,4];case 3:return n=F.sent(),console.warn('Failed to fetch ipywidgets through the "jupyter.widget.control" comm channel, fallback to fetching individual model state. Reason:',n),[2,this._loadFromKernelModels()];case 4:for(o=e.states,s={},l={},u=0;u<e.buffer_paths.length;u++)h=e.buffer_paths[u],v=h[0],T=h.slice(1),E=r[u],s[v]||(s[v]=[],l[v]=[]),s[v].push(T),l[v].push(E);return[4,Promise.all(Object.keys(o).map(function(z){return fA(O,void 0,void 0,function(){var W,J;return hA(this,function(K){switch(K.label){case 0:return this.has_model(z)?(J=void 0,[3,3]):[3,1];case 1:return[4,this._create_comm("jupyter.widget",z)];case 2:J=K.sent(),K.label=3;case 3:return W=J,[2,{widget_id:z,comm:W}]}})})}))];case 5:return M=F.sent(),[4,Promise.all(M.map(function(z){var W=z.widget_id,J=z.comm;return fA(O,void 0,void 0,function(){var K,ne,ge,H;return hA(this,function(me){switch(me.label){case 0:K=o[W],W in s&&uA(K,s[W],l[W]),me.label=1;case 1:return me.trys.push([1,7,,8]),J?[4,this.new_model({model_name:K.model_name,model_module:K.model_module,model_module_version:K.model_module_version,model_id:W,comm:J},K.state)]:[3,3];case 2:return me.sent(),[3,6];case 3:return[4,this.get_model(W)];case 4:return ne=me.sent(),[4,ne.constructor._deserialize_state(K.state,this)];case 5:ge=me.sent(),ne.set_state(ge),me.label=6;case 6:return[3,8];case 7:return H=me.sent(),console.error(H),[3,8];case 8:return[2]}})})}))];case 6:return F.sent(),[2]}})})},t.prototype._loadFromKernelModels=function(){return fA(this,void 0,void 0,function(){var e,r,i=this;return hA(this,function(n){switch(n.label){case 0:return[4,this._get_comm_info()];case 1:return e=n.sent(),[4,Promise.all(Object.keys(e).map(function(o){return fA(i,void 0,void 0,function(){var s,l,u;return hA(this,function(h){switch(h.label){case 0:return this.has_model(o)?[2]:[4,this._create_comm(this.comm_target_name,o)];case 1:return s=h.sent(),l="",u=new LQ.PromiseDelegate,s.on_msg(function(v){if(v.parent_header.msg_id===l&&v.header.msg_type==="comm_msg"&&v.content.data.method==="update"){var T=v.content.data,E=T.buffer_paths||[],M=v.buffers||[];uA(T.state,E,M),u.resolve({comm:s,msg:v})}}),l=s.send({method:"request_state"},this.callbacks(void 0)),[2,u.promise]}})})}))];case 2:return r=n.sent(),[4,Promise.all(r.map(function(o){return fA(i,void 0,void 0,function(){var s;return hA(this,function(l){switch(l.label){case 0:return o?(s=o.msg.content,[4,this.new_model({model_name:s.data.state._model_name,model_module:s.data.state._model_module,model_module_version:s.data.state._model_module_version,comm:o.comm},s.data.state)]):[2];case 1:return l.sent(),[2]}})})}))];case 3:return n.sent(),[2]}})})},t.prototype.clear_state=function(){var e=this;return My(this._models).then(function(r){Object.keys(r).forEach(function(i){return r[i].close()}),e._models=Object.create(null)})},t.prototype.get_state=function(e){var r=this;e===void 0&&(e={});var i=Object.keys(this._models).map(function(n){return r._models[n]});return Promise.all(i).then(function(n){return UQ(n,e)})},t.prototype.set_state=function(e){var r=this;if(!(e.version_major&&e.version_major<=2))throw"Unsupported widget state format";var i=e.state,n=this._get_comm_info().then(function(o){return Promise.all(Object.keys(i).map(function(s){var l={base64:iN,hex:tN},u=i[s],h=u.state;if(u.buffers){var v=u.buffers.map(function(M){return M.path}),T=u.buffers.map(function(M){return new DataView(l[M.encoding](M.data))});uA(u.state,v,T)}if(r.has_model(s))return r.get_model(s).then(function(M){return M.constructor._deserialize_state(h||{},r).then(function(O){return M.set_state(O),M})});var E={model_id:s,model_name:u.model_name,model_module:u.model_module,model_module_version:u.model_module_version};return o.hasOwnProperty(s)?r._create_comm(r.comm_target_name,s).then(function(M){return E.comm=M,r.new_model(E)}):r.new_model(E,h)}))});return n},t.prototype.disconnect=function(){var e=this;Object.keys(this._models).forEach(function(r){e._models[r].then(function(i){i.comm_live=!1})})},t.prototype.resolveUrl=function(e){return Promise.resolve(e)},t.prototype.filterExistingModelState=function(e){var r=this,i=e.state;return i=Object.keys(i).filter(function(n){return!r.has_model(n)}).reduce(function(n,o){return n[o]=i[o],n},{}),sw(sw({},e),{state:i})},t}();function UQ(t,e){e===void 0&&(e={});var r={};return t.forEach(function(i){var n=i.model_id,o=ow(i.serialize(i.get_state(e.drop_defaults))),s=o.buffers.map(function(l,u){return{data:rN(l),path:o.buffer_paths[u],encoding:"base64"}});r[n]={model_name:i.name,model_module:i.module,model_module_version:i.get("_model_module_version"),state:o.state},s.length>0&&(r[n].buffers=s)}),{version_major:2,version_minor:0,state:r}}var oN=function(){return oN=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},oN.apply(this,arguments)};function zQ(t,e,r){if(t==null)return this;var i;if(typeof t=="object"?(i=t,r=e):(i={})[t]=e,r||(r={}),!this._validate(i,r))return!1;var n=r.unset,o=r.silent,s=[],l=this._changing;this._changing=!0;try{l||(this._previousAttributes=oN({},this.attributes),this.changed={});var u=this.attributes,h=this.changed,v=this._previousAttributes;for(var T in i)e=i[T],Cy(u[T],e)||s.push(T),Cy(v[T],e)?delete h[T]:h[T]=e,n?delete u[T]:u[T]=e;if(this.id=this.get(this.idAttribute),!o){s.length&&(this._pending=r);for(var E=0;E<s.length;E++)this.trigger("change:"+s[E],this,u[s[E]],r)}if(l)return this;if(!o)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r)}finally{this._pending=!1,this._changing=!1}return this}var jee=ga(H4()),ck=ga(V4());var See=ga(H4()),LMe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),kw=Element.prototype,FMe=kw.matches||kw.webkitMatchesSelector||kw.mozMatchesSelector||kw.msMatchesSelector||kw.oMatchesSelector||function(e){for(var r=(this.document||this.ownerDocument).querySelectorAll(e),i=r.length;--i>=0&&r.item(i)!==this;);return i>-1},Cee=function(t){LMe(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._removeElement=function(){this.undelegateEvents(),this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype._setElement=function(r){this.el=r},e.prototype._setAttributes=function(r){for(var i in r)i in this.el?this.el[i]=r[i]:this.el.setAttribute(i,r[i])},e.prototype.delegate=function(r,i,n){typeof i!="string"&&(n=i,i=null),this._domEvents===void 0&&(this._domEvents=[]);var o=this.el,s=i?function(l){for(var u=l.target||l.srcElement;u&&u!==o;u=u.parentNode)if(FMe.call(u,i))return l.delegateTarget=u,n.handleEvent?n.handleEvent(l):n(l)}:n;return this.el.addEventListener(r,s,!1),this._domEvents.push({eventName:r,handler:s,listener:n,selector:i}),s},e.prototype.undelegate=function(r,i,n){if(typeof i=="function"&&(n=i,i=null),this.el&&this._domEvents)for(var o=this._domEvents.slice(),s=o.length;s--;){var l=o[s],u=l.eventName===r&&(n?l.listener===n:!0)&&(i?l.selector===i:!0);u&&(this.el.removeEventListener(l.eventName,l.handler,!1),this._domEvents.splice(s,1))}return this},e.prototype.undelegateEvents=function(){if(this.el&&this._domEvents){for(var r=this._domEvents.length,i=0;i<r;i++){var n=this._domEvents[i];this.el.removeEventListener(n.eventName,n.handler,!1)}this._domEvents.length=0}return this},e}(See.View);var rr;(function(t){function e(me,fe,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=me.length;if(we===0)return-1;$<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1);var Oe;Z<$?Oe=Z+1+(we-$):Oe=Z-$+1;for(var he=0;he<Oe;++he){var Le=($+he)%we;if(me[Le]===fe)return Le}return-1}t.firstIndexOf=e;function r(me,fe,$,Z){$===void 0&&($=-1),Z===void 0&&(Z=0);var we=me.length;if(we===0)return-1;$<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1);var Oe;$<Z?Oe=$+1+(we-Z):Oe=$-Z+1;for(var he=0;he<Oe;++he){var Le=($-he+we)%we;if(me[Le]===fe)return Le}return-1}t.lastIndexOf=r;function i(me,fe,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=me.length;if(we===0)return-1;$<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1);var Oe;Z<$?Oe=Z+1+(we-$):Oe=Z-$+1;for(var he=0;he<Oe;++he){var Le=($+he)%we;if(fe(me[Le],Le))return Le}return-1}t.findFirstIndex=i;function n(me,fe,$,Z){$===void 0&&($=-1),Z===void 0&&(Z=0);var we=me.length;if(we===0)return-1;$<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1);var Oe;$<Z?Oe=$+1+(we-Z):Oe=$-Z+1;for(var he=0;he<Oe;++he){var Le=($-he+we)%we;if(fe(me[Le],Le))return Le}return-1}t.findLastIndex=n;function o(me,fe,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=i(me,fe,$,Z);return we!==-1?me[we]:void 0}t.findFirstValue=o;function s(me,fe,$,Z){$===void 0&&($=-1),Z===void 0&&(Z=0);var we=n(me,fe,$,Z);return we!==-1?me[we]:void 0}t.findLastValue=s;function l(me,fe,$,Z,we){Z===void 0&&(Z=0),we===void 0&&(we=-1);var Oe=me.length;if(Oe===0)return 0;Z<0?Z=Math.max(0,Z+Oe):Z=Math.min(Z,Oe-1),we<0?we=Math.max(0,we+Oe):we=Math.min(we,Oe-1);for(var he=Z,Le=we-Z+1;Le>0;){var ft=Le>>1,Vt=he+ft;$(me[Vt],fe)<0?(he=Vt+1,Le-=ft+1):Le=ft}return he}t.lowerBound=l;function u(me,fe,$,Z,we){Z===void 0&&(Z=0),we===void 0&&(we=-1);var Oe=me.length;if(Oe===0)return 0;Z<0?Z=Math.max(0,Z+Oe):Z=Math.min(Z,Oe-1),we<0?we=Math.max(0,we+Oe):we=Math.min(we,Oe-1);for(var he=Z,Le=we-Z+1;Le>0;){var ft=Le>>1,Vt=he+ft;$(me[Vt],fe)>0?Le=ft:(he=Vt+1,Le-=ft+1)}return he}t.upperBound=u;function h(me,fe,$){if(me===fe)return!0;if(me.length!==fe.length)return!1;for(var Z=0,we=me.length;Z<we;++Z)if($?!$(me[Z],fe[Z]):me[Z]!==fe[Z])return!1;return!0}t.shallowEqual=h;function v(me,fe){fe===void 0&&(fe={});var $=fe.start,Z=fe.stop,we=fe.step;if(we===void 0&&(we=1),we===0)throw new Error("Slice `step` cannot be zero.");var Oe=me.length;$===void 0?$=we<0?Oe-1:0:$<0?$=Math.max($+Oe,we<0?-1:0):$>=Oe&&($=we<0?Oe-1:Oe),Z===void 0?Z=we<0?-1:Oe:Z<0?Z=Math.max(Z+Oe,we<0?-1:0):Z>=Oe&&(Z=we<0?Oe-1:Oe);var he;we<0&&Z>=$||we>0&&$>=Z?he=0:we<0?he=Math.floor((Z-$+1)/we+1):he=Math.floor((Z-$-1)/we+1);for(var Le=[],ft=0;ft<he;++ft)Le[ft]=me[$+ft*we];return Le}t.slice=v;function T(me,fe,$){var Z=me.length;if(!(Z<=1)&&(fe<0?fe=Math.max(0,fe+Z):fe=Math.min(fe,Z-1),$<0?$=Math.max(0,$+Z):$=Math.min($,Z-1),fe!==$)){for(var we=me[fe],Oe=fe<$?1:-1,he=fe;he!==$;he+=Oe)me[he]=me[he+Oe];me[$]=we}}t.move=T;function E(me,fe,$){fe===void 0&&(fe=0),$===void 0&&($=-1);var Z=me.length;if(!(Z<=1))for(fe<0?fe=Math.max(0,fe+Z):fe=Math.min(fe,Z-1),$<0?$=Math.max(0,$+Z):$=Math.min($,Z-1);fe<$;){var we=me[fe],Oe=me[$];me[fe++]=Oe,me[$--]=we}}t.reverse=E;function M(me,fe,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=me.length;if(!(we<=1)&&($<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1),!($>=Z))){var Oe=Z-$+1;if(fe>0?fe=fe%Oe:fe<0&&(fe=(fe%Oe+Oe)%Oe),fe!==0){var he=$+fe;E(me,$,he-1),E(me,he,Z),E(me,$,Z)}}}t.rotate=M;function O(me,fe,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=me.length;if(we!==0){$<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1);var Oe;Z<$?Oe=Z+1+(we-$):Oe=Z-$+1;for(var he=0;he<Oe;++he)me[($+he)%we]=fe}}t.fill=O;function F(me,fe,$){var Z=me.length;fe<0?fe=Math.max(0,fe+Z):fe=Math.min(fe,Z);for(var we=Z;we>fe;--we)me[we]=me[we-1];me[fe]=$}t.insert=F;function z(me,fe){var $=me.length;if(fe<0&&(fe+=$),!(fe<0||fe>=$)){for(var Z=me[fe],we=fe+1;we<$;++we)me[we-1]=me[we];return me.length=$-1,Z}}t.removeAt=z;function W(me,fe,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=e(me,fe,$,Z);return we!==-1&&z(me,we),we}t.removeFirstOf=W;function J(me,fe,$,Z){$===void 0&&($=-1),Z===void 0&&(Z=0);var we=r(me,fe,$,Z);return we!==-1&&z(me,we),we}t.removeLastOf=J;function K(me,fe,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=me.length;if(we===0)return 0;$<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1);for(var Oe=0,he=0;he<we;++he)$<=Z&&he>=$&&he<=Z&&me[he]===fe||Z<$&&(he<=Z||he>=$)&&me[he]===fe?Oe++:Oe>0&&(me[he-Oe]=me[he]);return Oe>0&&(me.length=we-Oe),Oe}t.removeAllOf=K;function ne(me,fe,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we,Oe=i(me,fe,$,Z);return Oe!==-1&&(we=z(me,Oe)),{index:Oe,value:we}}t.removeFirstWhere=ne;function ge(me,fe,$,Z){$===void 0&&($=-1),Z===void 0&&(Z=0);var we,Oe=n(me,fe,$,Z);return Oe!==-1&&(we=z(me,Oe)),{index:Oe,value:we}}t.removeLastWhere=ge;function H(me,fe,$,Z){$===void 0&&($=0),Z===void 0&&(Z=-1);var we=me.length;if(we===0)return 0;$<0?$=Math.max(0,$+we):$=Math.min($,we-1),Z<0?Z=Math.max(0,Z+we):Z=Math.min(Z,we-1);for(var Oe=0,he=0;he<we;++he)$<=Z&&he>=$&&he<=Z&&fe(me[he],he)||Z<$&&(he<=Z||he>=$)&&fe(me[he],he)?Oe++:Oe>0&&(me[he-Oe]=me[he]);return Oe>0&&(me.length=we-Oe),Oe}t.removeAllWhere=H})(rr||(rr={}));function ou(t){var e;return typeof t.iter=="function"?e=t.iter():e=new NMe(t),e}function Ei(t,e){for(var r=0,i=ou(t),n;(n=i.next())!==void 0;)if(e(n,r++)===!1)return}function Mee(t,e){for(var r=0,i=ou(t),n;(n=i.next())!==void 0;)if(!e(n,r++))return!1;return!0}function Iee(t,e){for(var r=0,i=ou(t),n;(n=i.next())!==void 0;)if(e(n,r++))return!0;return!1}function Pee(t){for(var e=0,r=[],i=ou(t),n;(n=i.next())!==void 0;)r[e++]=n;return r}var NMe=function(){function t(e){this._index=0,this._source=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},t}(),J2t=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?e:this.next()}},t}(),Q2t=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?this._source[e]:this.next()}},t}(),$2t=function(){function t(e,r){r===void 0&&(r=Object.keys(e)),this._index=0,this._source=e,this._keys=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source,this._keys);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._keys.length)){var e=this._keys[this._index++];return e in this._source?[e,this._source[e]]:this.next()}},t}(),eTt=function(){function t(e){this._fn=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){throw new Error("An `FnIterator` cannot be cloned.")},t.prototype.next=function(){return this._fn.call(void 0)},t}();function W4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new jg(ou(t.map(ou)))}var jg=function(){function t(e){this._cloned=!1,this._source=e,this._active=void 0}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone());return e._active=this._active&&this._active.clone(),e._cloned=!0,this._cloned=!0,e},t.prototype.next=function(){if(this._active===void 0){var e=this._source.next();if(e===void 0)return;this._active=this._cloned?e.clone():e}var r=this._active.next();return r!==void 0?r:(this._active=void 0,this.next())},t}();function su(){return new kMe}var kMe=function(){function t(){}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t},t.prototype.next=function(){},t}();var tTt=function(){function t(e,r){this._source=e,this._index=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._index)},t.prototype.next=function(){var e=this._source.next();if(e!==void 0)return[this._index++,e]},t}();function Ree(t,e){return new UMe(ou(t),e)}var UMe=function(){function t(e,r){this._index=0,this._source=e,this._fn=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){for(var e=this._fn,r=this._source,i;(i=r.next())!==void 0;)if(e(i,this._index++))return i},t}();function rv(t,e){for(var r=0,i=ou(t),n;(n=i.next())!==void 0;)if(e(n,r++))return n}function Bee(t,e){var r=ou(t),i=r.next();if(i!==void 0){for(var n=i;(i=r.next())!==void 0;)e(i,n)>0&&(n=i);return n}}function wA(t,e){return new zMe(ou(t),e)}var zMe=function(){function t(e,r){this._index=0,this._source=e,this._fn=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source.clone(),this._fn);return e._index=this._index,e},t.prototype.next=function(){var e=this._source.next();if(e!==void 0)return this._fn.call(void 0,e,this._index++)},t}();var rTt=function(){function t(e,r,i){this._index=0,this._start=e,this._stop=r,this._step=i,this._length=G4.rangeLength(e,r,i)}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._start,this._stop,this._step);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index>=this._length))return this._start+this._step*this._index++},t}(),G4;(function(t){function e(r,i,n){return n===0?1/0:r>i&&n>0||r<i&&n<0?0:Math.ceil((i-r)/n)}t.rangeLength=e})(G4||(G4={}));function q4(t,e,r){var i=0,n=ou(t),o=n.next();if(o===void 0&&r===void 0)throw new TypeError("Reduce of empty iterable with no initial value.");if(o===void 0)return r;var s=n.next();if(s===void 0&&r===void 0)return o;if(s===void 0)return e(r,o,i++);var l;r===void 0?l=e(o,s,i++):l=e(e(r,o,i++),s,i++);for(var u;(u=n.next())!==void 0;)l=e(l,u,i++);return l}function Uw(t){return new VMe(t,1)}var VMe=function(){function t(e,r){this._value=e,this._count=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._value,this._count)},t.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},t}();function Oee(t){var e;return typeof t.retro=="function"?e=t.retro():e=new jMe(t),e}var jMe=function(){function t(e){this._source=e,this._index=e.length-1}return t.prototype.iter=function(){return this},t.prototype.clone=function(){var e=new t(this._source);return e._index=this._index,e},t.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},t}();var iTt=function(){function t(e,r){this._source=e,this._step=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._step)},t.prototype.next=function(){for(var e=this._source.next(),r=this._step-1;r>0;--r)this._source.next();return e},t}(),tv;(function(t){function e(s,l,u){u===void 0&&(u=0);for(var h=new Array(l.length),v=0,T=u,E=l.length;v<E;++v,++T){if(T=s.indexOf(l[v],T),T===-1)return null;h[v]=T}return h}t.findIndices=e;function r(s,l,u){u===void 0&&(u=0);var h=e(s,l,u);if(!h)return null;for(var v=0,T=0,E=h.length;T<E;++T){var M=h[T]-u;v+=M*M}return{score:v,indices:h}}t.matchSumOfSquares=r;function i(s,l,u){u===void 0&&(u=0);var h=e(s,l,u);if(!h)return null;for(var v=0,T=u-1,E=0,M=h.length;E<M;++E){var O=h[E];v+=O-T-1,T=O}return{score:v,indices:h}}t.matchSumOfDeltas=i;function n(s,l,u){for(var h=[],v=0,T=0,E=l.length;v<E;){for(var M=l[v],O=l[v];++v<E&&l[v]===O+1;)O++;T<M&&h.push(s.slice(T,M)),M<O+1&&h.push(u(s.slice(M,O+1))),T=O+1}return T<s.length&&h.push(s.slice(T)),h}t.highlight=n;function o(s,l){return s<l?-1:s>l?1:0}t.cmp=o})(tv||(tv={}));var nTt=function(){function t(e,r){this._source=e,this._count=r}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.clone(),this._count)},t.prototype.next=function(){if(!(this._count<=0)){var e=this._source.next();if(e!==void 0)return this._count--,e}},t}();var oTt=function(){function t(e){this._source=e}return t.prototype.iter=function(){return this},t.prototype.clone=function(){return new t(this._source.map(function(e){return e.clone()}))},t.prototype.next=function(){for(var e=new Array(this._source.length),r=0,i=this._source.length;r<i;++r){var n=this._source[r].next();if(n===void 0)return;e[r]=n}return e},t}();var Dee;(function(t){function e(r){var i=document.body,n=function(o){o.preventDefault(),o.stopPropagation(),o.clipboardData.setData("text",r),i.removeEventListener("copy",n,!0)};i.addEventListener("copy",n,!0),document.execCommand("copy")}t.copyText=e})(Dee||(Dee={}));var ho;(function(t){function e(o){var s=window.getComputedStyle(o),l=parseFloat(s.borderTopWidth)||0,u=parseFloat(s.borderLeftWidth)||0,h=parseFloat(s.borderRightWidth)||0,v=parseFloat(s.borderBottomWidth)||0,T=parseFloat(s.paddingTop)||0,E=parseFloat(s.paddingLeft)||0,M=parseFloat(s.paddingRight)||0,O=parseFloat(s.paddingBottom)||0,F=u+E+M+h,z=l+T+O+v;return{borderTop:l,borderLeft:u,borderRight:h,borderBottom:v,paddingTop:T,paddingLeft:E,paddingRight:M,paddingBottom:O,horizontalSum:F,verticalSum:z}}t.boxSizing=e;function r(o){var s=window.getComputedStyle(o),l=parseFloat(s.minWidth)||0,u=parseFloat(s.minHeight)||0,h=parseFloat(s.maxWidth)||1/0,v=parseFloat(s.maxHeight)||1/0;return h=Math.max(l,h),v=Math.max(u,v),{minWidth:l,minHeight:u,maxWidth:h,maxHeight:v}}t.sizeLimits=r;function i(o,s,l){var u=o.getBoundingClientRect();return s>=u.left&&s<u.right&&l>=u.top&&l<u.bottom}t.hitTest=i;function n(o,s){var l=o.getBoundingClientRect(),u=s.getBoundingClientRect();if(!(u.top<=l.top&&u.bottom>=l.bottom)){if(u.top<l.top&&u.height<=l.height){o.scrollTop-=l.top-u.top;return}if(u.bottom>l.bottom&&u.height>=l.height){o.scrollTop-=l.top-u.top;return}if(u.top<l.top&&u.height>l.height){o.scrollTop-=l.bottom-u.bottom;return}if(u.bottom>l.bottom&&u.height<l.height){o.scrollTop-=l.bottom-u.bottom;return}}}t.scrollIntoViewIfNeeded=n})(ho||(ho={}));var nl;(function(t){t.IS_MAC=!!navigator.platform.match(/Mac/i),t.IS_WIN=!!navigator.platform.match(/Win/i),t.IS_IE=/Trident/.test(navigator.userAgent),t.IS_EDGE=/Edge/.test(navigator.userAgent);function e(r){return t.IS_MAC?r.metaKey:r.ctrlKey}t.accelKey=e})(nl||(nl={}));var Hf;(function(t){function e(n){if(n in jf.specificityCache)return jf.specificityCache[n];var o=jf.calculateSingle(n);return jf.specificityCache[n]=o}t.calculateSpecificity=e;function r(n){if(n in jf.validityCache)return jf.validityCache[n];var o=!0;try{jf.testElem.querySelector(n)}catch{o=!1}return jf.validityCache[n]=o}t.isValid=r;function i(n,o){return jf.protoMatchFunc.call(n,o)}t.matches=i})(Hf||(Hf={}));var jf;(function(t){t.specificityCache=Object.create(null),t.validityCache=Object.create(null),t.testElem=document.createElement("div"),t.protoMatchFunc=function(){var v=Element.prototype;return v.matches||v.matchesSelector||v.mozMatchesSelector||v.msMatchesSelector||v.oMatchesSelector||v.webkitMatchesSelector||function(T){var E=this,M=E.ownerDocument?E.ownerDocument.querySelectorAll(T):[];return Array.prototype.indexOf.call(M,E)!==-1}}();function e(v){v=v.split(",",1)[0];var T=0,E=0,M=0;function O(F){var z=v.match(F);return z===null?!1:(v=v.slice(z[0].length),!0)}for(v=v.replace(h," $1 ");v.length>0;){if(O(r)){T++;continue}if(O(i)){E++;continue}if(O(n)){E++;continue}if(O(s)){M++;continue}if(O(l)){E++;continue}if(O(o)){M++;continue}if(!O(u))return 0}return T=Math.min(T,255),E=Math.min(E,255),M=Math.min(M,255),T<<16|E<<8|M}t.calculateSingle=e;var r=/^#[^\s\+>~#\.\[:]+/,i=/^\.[^\s\+>~#\.\[:]+/,n=/^\[[^\]]+\]/,o=/^[^\s\+>~#\.\[:]+/,s=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,l=/^:[^\s\+>~#\.\[:]+/,u=/^[\s\+>~\*]+/,h=/:not\(([^\)]+)\)/g})(jf||(jf={}));var Lee=function(){function t(e){this._root=new la.LeafNode,this.cmp=e}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this._root.size===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._root.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){var e=la.firstLeaf(this._root);return e.size>0?e.items[0]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){var e=la.lastLeaf(this._root);return e.size>0?e.items[e.size-1]:void 0},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return la.iterItems(this._root)},t.prototype.retro=function(){return la.retroItems(this._root)},t.prototype.slice=function(e,r){return la.sliceItems(this._root,e,r)},t.prototype.retroSlice=function(e,r){return la.retroSliceItems(this._root,e,r)},t.prototype.at=function(e){return la.itemAt(this._root,e)},t.prototype.has=function(e,r){return la.hasItem(this._root,e,r)},t.prototype.indexOf=function(e,r){return la.indexOf(this._root,e,r)},t.prototype.get=function(e,r){return la.getItem(this._root,e,r)},t.prototype.assign=function(e){this.clear(),this.update(e)},t.prototype.insert=function(e){var r=la.insertItem(this._root,e,this.cmp);return this._root=la.maybeSplitRoot(this._root),r},t.prototype.update=function(e){var r=this;Ei(e,function(i){r.insert(i)})},t.prototype.delete=function(e,r){var i=la.deleteItem(this._root,e,r);return this._root=la.maybeExtractRoot(this._root),i},t.prototype.remove=function(e){var r=la.removeItem(this._root,e);return this._root=la.maybeExtractRoot(this._root),r},t.prototype.clear=function(){la.clear(this._root),this._root=new la.LeafNode},t}();(function(t){function e(r,i){var n=new t(i);return n.assign(r),n}t.from=e})(Lee||(Lee={}));var la;(function(t){var e=function(){function he(){this.items=[],this.sizes=[],this.children=[]}return Object.defineProperty(he.prototype,"type",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(he.prototype,"size",{get:function(){return this.sizes[this.sizes.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty(he.prototype,"width",{get:function(){return this.children.length},enumerable:!0,configurable:!0}),he}();t.BranchNode=e;var r=function(){function he(){this.next=null,this.prev=null,this.items=[]}return Object.defineProperty(he.prototype,"type",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(he.prototype,"size",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),Object.defineProperty(he.prototype,"width",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),he}();t.LeafNode=r;function i(he){for(;he.type===0;)he=he.children[0];return he}t.firstLeaf=i;function n(he){for(;he.type===0;)he=he.children[he.children.length-1];return he}t.lastLeaf=n;function o(he){var Le=i(he);return new ge(Le,0,-1)}t.iterItems=o;function s(he){var Le=n(he);return new H(Le,Le.size-1,-1)}t.retroItems=s;function l(he,Le,ft){Le===void 0?Le=0:Le<0?Le=Math.max(0,Le+he.size):Le=Math.min(Le,he.size),ft===void 0?ft=he.size:ft<0?ft=Math.max(0,ft+he.size):ft=Math.min(ft,he.size);var Vt=Math.max(0,ft-Le);if(Vt===0)return su();for(;he.type===0;){var Yt=me(he.sizes,Le);Yt>0&&(Le-=he.sizes[Yt-1]),he=he.children[Yt]}return new ge(he,Le,Vt)}t.sliceItems=l;function u(he,Le,ft){Le===void 0?Le=he.size-1:Le<0?Le=Math.max(-1,Le+he.size):Le=Math.min(Le,he.size-1),ft===void 0?ft=-1:ft<0?ft=Math.max(-1,ft+he.size):ft=Math.min(ft,he.size-1);var Vt=Math.max(0,Le-ft);if(Vt===0)return su();for(;he.type===0;){var Yt=me(he.sizes,Le);Yt>0&&(Le-=he.sizes[Yt-1]),he=he.children[Yt]}return new H(he,Le,Vt)}t.retroSliceItems=u;function h(he,Le){if(Le<0&&(Le+=he.size),!(Le<0||Le>=he.size)){for(;he.type===0;){var ft=me(he.sizes,Le);ft>0&&(Le-=he.sizes[ft-1]),he=he.children[ft]}return he.items[Le]}}t.itemAt=h;function v(he,Le,ft){for(;he.type===0;){var Vt=fe(he.items,Le,ft);he=he.children[Vt]}var Yt=$(he.items,Le,ft);return Yt>=0}t.hasItem=v;function T(he,Le,ft){for(var Vt=0;he.type===0;){var Yt=fe(he.items,Le,ft);Yt>0&&(Vt+=he.sizes[Yt-1]),he=he.children[Yt]}var mr=$(he.items,Le,ft);return mr>=0?Vt+mr:-Vt+mr}t.indexOf=T;function E(he,Le,ft){for(;he.type===0;){var Vt=fe(he.items,Le,ft);he=he.children[Vt]}var Yt=$(he.items,Le,ft);return Yt>=0?he.items[Yt]:void 0}t.getItem=E;function M(he,Le,ft){if(he.type===1){var Vt=$(he.items,Le,ft),Yt;return Vt>=0?(Yt=he.items[Vt],he.items[Vt]=Le):(Yt=void 0,rr.insert(he.items,-Vt-1,Le)),Yt}var mr=fe(he.items,Le,ft),Er=he.children[mr],Jr=Er.size,or=M(Er,Le,ft),ai=Er.size;if(he.items[mr]=Er.items[0],Jr===ai)return or;if(Er.width>K){var Jt=we(Er);rr.insert(he.children,mr+1,Jt),rr.insert(he.items,mr+1,Jt.items[0])}return Z(he,mr),or}t.insertItem=M;function O(he,Le,ft){if(he.type===1){var Vt=$(he.items,Le,ft);return Vt<0?void 0:rr.removeAt(he.items,Vt)}var Yt=fe(he.items,Le,ft),mr=he.children[Yt],Er=mr.size,Jr=O(mr,Le,ft),or=mr.size;return Er===or||(he.items[Yt]=mr.items[0],mr.width<ne&&(Yt=Oe(he,Yt)),Z(he,Yt)),Jr}t.deleteItem=O;function F(he,Le){if(Le<0&&(Le+=he.size),!(Le<0||Le>=he.size)){if(he.type===1)return rr.removeAt(he.items,Le);var ft=me(he.sizes,Le);ft>0&&(Le-=he.sizes[ft]);var Vt=he.children[ft],Yt=F(Vt,Le);return he.items[ft]=Vt.items[0],Vt.width<ne&&(ft=Oe(he,ft)),Z(he,ft),Yt}}t.removeItem=F;function z(he){he.type===0?(Ei(he.children,z),he.children.length=0,he.sizes.length=0,he.items.length=0):(he.items.length=0,he.next=null,he.prev=null)}t.clear=z;function W(he){if(he.width<=K)return he;var Le=new e,ft=we(he);return Le.sizes[0]=he.size,Le.sizes[1]=he.size+ft.size,Le.children[0]=he,Le.children[1]=ft,Le.items[0]=he.items[0],Le.items[1]=ft.items[0],Le}t.maybeSplitRoot=W;function J(he){if(he.type===1||he.children.length>1)return he;var Le=he.children.pop();return z(he),Le}t.maybeExtractRoot=J;var K=32,ne=K>>1,ge=function(){function he(Le,ft,Vt){this._node=Le,this._index=ft,this._count=Vt}return he.prototype.iter=function(){return this},he.prototype.clone=function(){return new he(this._node,this._index,this._count)},he.prototype.next=function(){if(!(this._node===null||this._count===0))return this._index>=this._node.size?(this._node=this._node.next,this._index=0,this.next()):(this._count>0&&this._count--,this._node.items[this._index++])},he}(),H=function(){function he(Le,ft,Vt){this._node=Le,this._index=ft,this._count=Vt}return he.prototype.iter=function(){return this},he.prototype.clone=function(){return new he(this._node,this._index,this._count)},he.prototype.next=function(){if(!(this._node===null||this._count===0))return this._index>=this._node.size&&(this._index=this._node.size-1),this._index<0?(this._node=this._node.prev,this._index=this._node?this._node.size-1:-1,this.next()):(this._count>0&&this._count--,this._node.items[this._index--])},he}();function me(he,Le){for(var ft=he.length,Vt=0;Vt<ft;++Vt)if(he[Vt]>Le)return Vt;return ft-1}function fe(he,Le,ft){for(var Vt=he.length,Yt=1;Yt<Vt;++Yt)if(ft(he[Yt],Le)>0)return Yt-1;return Vt-1}function $(he,Le,ft){for(var Vt=he.length,Yt=0;Yt<Vt;++Yt){var mr=ft(he[Yt],Le);if(mr===0)return Yt;if(mr>0)return-Yt-1}return-Vt-1}function Z(he,Le){for(var ft=he.sizes,Vt=he.children,Yt=Le>0?ft[Le-1]:0,mr=Vt.length;Le<mr;++Le)Yt=ft[Le]=Yt+Vt[Le].size;ft.length=Vt.length}function we(he){if(he.type===1){for(var Le=new r,ft=he.items,Vt=Le.items,Yt=ne,mr=ft.length;Yt<mr;++Yt)Vt.push(ft[Yt]);return ft.length=ne,he.next&&(he.next.prev=Le),Le.next=he.next,Le.prev=he,he.next=Le,Le}for(var Er=new e,Jr=he.children,or=Er.children,Yt=ne,mr=Jr.length;Yt<mr;++Yt)or.push(Jr[Yt]);Jr.length=ne;for(var ai=he.items,Jt=Er.items,Yt=ne,mr=ai.length;Yt<mr;++Yt)Jt.push(ai[Yt]);return ai.length=ne,Z(he,ne),Z(Er,0),Er}function Oe(he,Le){var ft,Vt,Yt,mr,Er,Jr,or=he.children[Le],ai=Le===0?he.children[Le+1]:he.children[Le-1],Jt=Le===0,qt=or.type===1,wi=ai.width>ne;if(qt&&wi&&Jt){var ae=or,be=ai;return ae.items.push(be.items.shift()),he.items[Le+1]=be.items[0],Le}if(qt&&wi&&!Jt){var ae=or,be=ai;return ae.items.unshift(be.items.pop()),he.items[Le]=ae.items[0],Le-1}if(qt&&!wi&&Jt){var ae=or,be=ai;return(ft=be.items).unshift.apply(ft,ae.items),rr.removeAt(he.children,Le),rr.removeAt(he.items,Le+1),ae.prev&&(ae.prev.next=be),be.prev=ae.prev,z(ae),Le}if(qt&&!wi&&!Jt){var ae=or,be=ai;return(Vt=be.items).push.apply(Vt,ae.items),rr.removeAt(he.children,Le),rr.removeAt(he.items,Le),ae.next&&(ae.next.prev=be),be.next=ae.next,z(ae),Le-1}if(!qt&&wi&&Jt){var ae=or,be=ai;return ae.children.push(be.children.shift()),ae.items.push(be.items.shift()),he.items[Le+1]=be.items[0],Z(ae,ae.width-1),Z(be,0),Le}if(!qt&&wi&&!Jt){var ae=or,be=ai;return ae.children.unshift(be.children.pop()),ae.items.unshift(be.items.pop()),he.items[Le]=ae.items[0],Z(ae,0),Z(be,be.width-1),Le-1}if(!qt&&!wi&&Jt){var ae=or,be=ai;return(Yt=be.children).unshift.apply(Yt,ae.children),(mr=be.items).unshift.apply(mr,ae.items),rr.removeAt(he.children,Le),rr.removeAt(he.items,Le+1),Z(be,0),ae.children.length=0,z(ae),Le}if(!qt&&!wi&&!Jt){var ae=or,be=ai;return(Er=be.children).push.apply(Er,ae.children),(Jr=be.items).push.apply(Jr,ae.items),rr.removeAt(he.children,Le),rr.removeAt(he.items,Le),Z(be,0),ae.children.length=0,z(ae),Le-1}throw"unreachable"}})(la||(la={}));var GI=function(){function t(){this._first=null,this._last=null,this._size=0}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this._size===0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){return this._first?this._first.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){return this._last?this._last.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstNode",{get:function(){return this._first},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastNode",{get:function(){return this._last},enumerable:!0,configurable:!0}),t.prototype.iter=function(){return new t.ForwardValueIterator(this._first)},t.prototype.retro=function(){return new t.RetroValueIterator(this._last)},t.prototype.nodes=function(){return new t.ForwardNodeIterator(this._first)},t.prototype.retroNodes=function(){return new t.RetroNodeIterator(this._last)},t.prototype.assign=function(e){var r=this;this.clear(),Ei(e,function(i){r.addLast(i)})},t.prototype.push=function(e){this.addLast(e)},t.prototype.pop=function(){return this.removeLast()},t.prototype.shift=function(e){this.addFirst(e)},t.prototype.unshift=function(){return this.removeFirst()},t.prototype.addFirst=function(e){var r=new ed.LinkedListNode(this,e);return this._first?(r.next=this._first,this._first.prev=r,this._first=r):(this._first=r,this._last=r),this._size++,r},t.prototype.addLast=function(e){var r=new ed.LinkedListNode(this,e);return this._last?(r.prev=this._last,this._last.next=r,this._last=r):(this._first=r,this._last=r),this._size++,r},t.prototype.insertBefore=function(e,r){if(!r||r===this._first)return this.addFirst(e);if(!(r instanceof ed.LinkedListNode)||r.list!==this)throw new Error("Reference node is not owned by the list.");var i=new ed.LinkedListNode(this,e),n=r,o=n.prev;return i.next=n,i.prev=o,n.prev=i,o.next=i,this._size++,i},t.prototype.insertAfter=function(e,r){if(!r||r===this._last)return this.addLast(e);if(!(r instanceof ed.LinkedListNode)||r.list!==this)throw new Error("Reference node is not owned by the list.");var i=new ed.LinkedListNode(this,e),n=r,o=n.next;return i.next=o,i.prev=n,n.next=i,o.prev=i,this._size++,i},t.prototype.removeFirst=function(){var e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value},t.prototype.removeLast=function(){var e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value},t.prototype.removeNode=function(e){if(!(e instanceof ed.LinkedListNode)||e.list!==this)throw new Error("Node is not owned by the list.");var r=e;r===this._first&&r===this._last?(this._first=null,this._last=null):r===this._first?(this._first=r.next,this._first.prev=null):r===this._last?(this._last=r.prev,this._last.next=null):(r.next.prev=r.prev,r.prev.next=r.next),r.list=null,r.next=null,r.prev=null,this._size--},t.prototype.clear=function(){for(var e=this._first;e;){var r=e.next;e.list=null,e.prev=null,e.next=null,e=r}this._first=null,this._last=null,this._size=0},t}();(function(t){function e(s){var l=new t;return l.assign(s),l}t.from=e;var r=function(){function s(l){this._node=l}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var l=this._node;return this._node=l.next,l.value}},s}();t.ForwardValueIterator=r;var i=function(){function s(l){this._node=l}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var l=this._node;return this._node=l.prev,l.value}},s}();t.RetroValueIterator=i;var n=function(){function s(l){this._node=l}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var l=this._node;return this._node=l.next,l}},s}();t.ForwardNodeIterator=n;var o=function(){function s(l){this._node=l}return s.prototype.iter=function(){return this},s.prototype.clone=function(){return new s(this._node)},s.prototype.next=function(){if(this._node){var l=this._node;return this._node=l.prev,l}},s}();t.RetroNodeIterator=o})(GI||(GI={}));var ed;(function(t){var e=function(){function r(i,n){this.list=null,this.next=null,this.prev=null,this.list=i,this.value=n}return r}();t.LinkedListNode=e})(ed||(ed={}));var X4=function(t,e){return X4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},X4(t,e)};function HMe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");X4(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var au=function(){function t(e){this.type=e}return Object.defineProperty(t.prototype,"isConflatable",{get:function(){return!1},enumerable:!0,configurable:!0}),t.prototype.conflate=function(e){return!1},t}(),iv=function(t){HMe(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"isConflatable",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.conflate=function(r){return!0},e}(au),xr;(function(t){function e($,Z){var we=v.get($);if(!we||we.length===0){J($,Z);return}var Oe=Mee(Oee(we),function(he){return he?W(he,$,Z):!0});Oe&&J($,Z)}t.sendMessage=e;function r($,Z){if(!Z.isConflatable){K($,Z);return}var we=Iee(h,function(Oe){return Oe.handler!==$||!Oe.msg||Oe.msg.type!==Z.type||!Oe.msg.isConflatable?!1:Oe.msg.conflate(Z)});we||K($,Z)}t.postMessage=r;function i($,Z){var we=v.get($);we&&we.indexOf(Z)!==-1||(we?we.push(Z):v.set($,[Z]))}t.installMessageHook=i;function n($,Z){var we=v.get($);if(we){var Oe=we.indexOf(Z);Oe!==-1&&(we[Oe]=null,ge(we))}}t.removeMessageHook=n;function o($){var Z=v.get($);Z&&Z.length>0&&(rr.fill(Z,null),ge(Z)),Ei(h,function(we){we.handler===$&&(we.handler=null,we.msg=null)})}t.clearData=o;function s(){O||M===0||(z(M),O=!0,ne(),O=!1)}t.flush=s;function l(){return E}t.getExceptionHandler=l;function u($){var Z=E;return E=$,Z}t.setExceptionHandler=u;var h=new GI,v=new WeakMap,T=new Set,E=function($){console.error($)},M=0,O=!1,F=function(){var $=typeof requestAnimationFrame=="function";return $?requestAnimationFrame:setImmediate}(),z=function(){var $=typeof cancelAnimationFrame=="function";return $?cancelAnimationFrame:clearImmediate}();function W($,Z,we){var Oe=!0;try{typeof $=="function"?Oe=$(Z,we):Oe=$.messageHook(Z,we)}catch(he){E(he)}return Oe}function J($,Z){try{$.processMessage(Z)}catch(we){E(we)}}function K($,Z){h.addLast({handler:$,msg:Z}),M===0&&(M=F(ne))}function ne(){if(M=0,!h.isEmpty){var $={handler:null,msg:null};for(h.addLast($);;){var Z=h.removeFirst();if(Z===$)return;Z.handler&&Z.msg&&e(Z.handler,Z.msg)}}}function ge($){T.size===0&&F(H),T.add($)}function H(){T.forEach(me),T.clear()}function me($){rr.removeAllWhere($,fe)}function fe($){return $===null}})(xr||(xr={}));var lc=function(){function t(e){this._pid=Hg.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}return t.prototype.get=function(e){var r,i=Hg.ensureMap(e);return this._pid in i?r=i[this._pid]:r=i[this._pid]=this._createValue(e),r},t.prototype.set=function(e,r){var i,n=Hg.ensureMap(e);this._pid in n?i=n[this._pid]:i=n[this._pid]=this._createValue(e);var o=this._coerceValue(e,r);this._maybeNotify(e,i,n[this._pid]=o)},t.prototype.coerce=function(e){var r,i=Hg.ensureMap(e);this._pid in i?r=i[this._pid]:r=i[this._pid]=this._createValue(e);var n=this._coerceValue(e,r);this._maybeNotify(e,r,i[this._pid]=n)},t.prototype._createValue=function(e){var r=this._create;return r(e)},t.prototype._coerceValue=function(e,r){var i=this._coerce;return i?i(e,r):r},t.prototype._compareValue=function(e,r){var i=this._compare;return i?i(e,r):e===r},t.prototype._maybeNotify=function(e,r,i){var n=this._changed;n&&!this._compareValue(r,i)&&n(e,r,i)},t}();(function(t){function e(r){Hg.ownerData.delete(r)}t.clearData=e})(lc||(lc={}));var Hg;(function(t){t.ownerData=new WeakMap,t.nextPID=function(){var r=0;return function(){var i=Math.random(),n=(""+i).slice(2);return"pid-"+n+"-"+r++}}();function e(r){var i=t.ownerData.get(r);return i||(i=Object.create(null),t.ownerData.set(r,i),i)}t.ensureMap=e})(Hg||(Hg={}));var Wn=function(){function t(e){this._blockedCount=0,this.sender=e}return t.prototype.block=function(e){this._blockedCount++;try{e()}finally{this._blockedCount--}},t.prototype.connect=function(e,r){return Lc.connect(this,e,r)},t.prototype.disconnect=function(e,r){return Lc.disconnect(this,e,r)},t.prototype.emit=function(e){this._blockedCount||Lc.emit(this,e)},t}();(function(t){function e(h,v){var T=Lc.blockedProperty;T.set(h,T.get(h)+1);try{v()}finally{T.set(h,T.get(h)-1)}}t.blockAll=e;function r(h,v){Lc.disconnectBetween(h,v)}t.disconnectBetween=r;function i(h){Lc.disconnectSender(h)}t.disconnectSender=i;function n(h){Lc.disconnectReceiver(h)}t.disconnectReceiver=n;function o(h){Lc.disconnectAll(h)}t.disconnectAll=o;function s(h){Lc.disconnectAll(h)}t.clearData=s;function l(){return Lc.exceptionHandler}t.getExceptionHandler=l;function u(h){var v=Lc.exceptionHandler;return Lc.exceptionHandler=h,v}t.setExceptionHandler=u})(Wn||(Wn={}));var Lc;(function(t){t.exceptionHandler=function(J){console.error(J)};function e(J,K,ne){ne=ne||void 0;var ge=u.get(J.sender);if(ge||(ge=[],u.set(J.sender,ge)),E(ge,J,K,ne))return!1;var H=ne||K,me=h.get(H);me||(me=[],h.set(H,me));var fe={signal:J,slot:K,thisArg:ne};return ge.push(fe),me.push(fe),!0}t.connect=e;function r(J,K,ne){ne=ne||void 0;var ge=u.get(J.sender);if(!ge||ge.length===0)return!1;var H=E(ge,J,K,ne);if(!H)return!1;var me=ne||K,fe=h.get(me);return H.signal=null,O(ge),O(fe),!0}t.disconnect=r;function i(J,K){var ne=u.get(J);if(!(!ne||ne.length===0)){var ge=h.get(K);!ge||ge.length===0||(Ei(ge,function(H){H.signal&&H.signal.sender===J&&(H.signal=null)}),O(ne),O(ge))}}t.disconnectBetween=i;function n(J){var K=u.get(J);!K||K.length===0||(Ei(K,function(ne){if(ne.signal){var ge=ne.thisArg||ne.slot;ne.signal=null,O(h.get(ge))}}),O(K))}t.disconnectSender=n;function o(J){var K=h.get(J);!K||K.length===0||(Ei(K,function(ne){if(ne.signal){var ge=ne.signal.sender;ne.signal=null,O(u.get(ge))}}),O(K))}t.disconnectReceiver=o;function s(J){n(J),o(J)}t.disconnectAll=s;function l(J,K){if(!(t.blockedProperty.get(J.sender)>0)){var ne=u.get(J.sender);if(!(!ne||ne.length===0))for(var ge=0,H=ne.length;ge<H;++ge){var me=ne[ge];me.signal===J&&M(me,K)}}}t.emit=l;var u=new WeakMap,h=new WeakMap,v=new Set,T=function(){var J=typeof requestAnimationFrame=="function";return J?requestAnimationFrame:setImmediate}();function E(J,K,ne,ge){return rv(J,function(H){return H.signal===K&&H.slot===ne&&H.thisArg===ge})}function M(J,K){var ne=J.signal,ge=J.slot,H=J.thisArg;try{ge.call(H,ne.sender,K)}catch(me){t.exceptionHandler(me)}}function O(J){v.size===0&&T(F),v.add(J)}function F(){v.forEach(z),v.clear()}function z(J){rr.removeAllWhere(J,W)}function W(J){return J.signal===null}t.blockedProperty=new lc({name:"blocked",create:function(){return 0}})})(Lc||(Lc={}));var Y4=function(t,e){return Y4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},Y4(t,e)};function Nee(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Y4(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var TA=function(){function t(e){this._fn=e}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return!this._fn},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){if(this._fn){var e=this._fn;this._fn=null,e()}},t}(),yTt=function(t){Nee(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._disposed=new Wn(r),r}return Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._disposed.emit(void 0),Wn.clearData(this))},e}(TA),K4=function(){function t(){this._isDisposed=!1,this._items=new Set}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(function(e){e.dispose()}),this._items.clear())},t.prototype.contains=function(e){return this._items.has(e)},t.prototype.add=function(e){this._items.add(e)},t.prototype.remove=function(e){this._items.delete(e)},t.prototype.clear=function(){this._items.clear()},t}();(function(t){function e(r){var i=new t;return Ei(r,function(n){i.add(n)}),i}t.from=e})(K4||(K4={}));var Fee=function(t){Nee(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._disposed=new Wn(r),r}return Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._disposed.emit(void 0),Wn.clearData(this))},e}(K4);(function(t){function e(r){var i=new t;return Ei(r,function(n){i.add(n)}),i}t.from=e})(Fee||(Fee={}));var EA=function(){function t(e){var r=this;this._onScrollFrame=function(){if(r._scrollTarget){var i=r._scrollTarget,n=i.element,o=i.edge,s=i.distance,l=Wl.SCROLL_EDGE_SIZE-s,u=Math.pow(l/Wl.SCROLL_EDGE_SIZE,2),h=Math.max(1,Math.round(u*Wl.SCROLL_EDGE_SIZE));switch(o){case"top":n.scrollTop-=h;break;case"left":n.scrollLeft-=h;break;case"right":n.scrollLeft+=h;break;case"bottom":n.scrollTop+=h;break}requestAnimationFrame(r._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=e.document||document,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}return t.prototype.dispose=function(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){var e=Wl.createMouseEvent("pointerup",-1,-1);Wl.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),t.prototype.start=function(e,r){var i=this;if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,r),this._promise=new Promise(function(o,s){i._resolve=o});var n=Wl.createMouseEvent("pointermove",e,r);return document.dispatchEvent(n),this._promise},t.prototype.handleEvent=function(e){switch(e.type){case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e);break;case"pointermove":this._evtMouseMove(e);break;case"pointerup":this._evtMouseUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation();break}},t.prototype.moveDragImage=function(e,r){if(this.dragImage){var i=this.dragImage.style;i.top=r+"px",i.left=e+"px"}},t.prototype._evtMouseMove=function(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)},t.prototype._evtMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),e.button===0){if(this._updateCurrentTarget(e),!this._currentTarget){this._finalize("none");return}if(this._dropAction==="none"){Wl.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}var r=Wl.dispatchDrop(this,this._currentTarget,e);this._finalize(r)}},t.prototype._evtKeyDown=function(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&this.dispose()},t.prototype._addListeners=function(){document.addEventListener("mousedown",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("mouseenter",this,!0),document.addEventListener("mouseleave",this,!0),document.addEventListener("mouseover",this,!0),document.addEventListener("mouseout",this,!0),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)},t.prototype._removeListeners=function(){document.removeEventListener("mousedown",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mouseenter",this,!0),document.removeEventListener("mouseleave",this,!0),document.removeEventListener("mouseover",this,!0),document.removeEventListener("mouseout",this,!0),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)},t.prototype._updateDragScroll=function(e){var r=Wl.findScrollTarget(e);!this._scrollTarget&&!r||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=r)},t.prototype._updateCurrentTarget=function(e){var r=this._currentTarget,i=this._currentTarget,n=this._currentElement,o=this.document.elementFromPoint(e.clientX,e.clientY);this._currentElement=o,o!==n&&o!==i&&Wl.dispatchDragExit(this,i,o,e),o!==n&&o!==i&&(i=Wl.dispatchDragEnter(this,o,i,e)),i!==r&&(this._currentTarget=i,Wl.dispatchDragLeave(this,r,i,e));var s=Wl.dispatchDragOver(this,i,e);this._setDropAction(s)},t.prototype._attachDragImage=function(e,r){if(this.dragImage){this.dragImage.classList.add("lm-mod-drag-image"),this.dragImage.classList.add("p-mod-drag-image");var i=this.dragImage.style;i.pointerEvents="none",i.position="fixed",i.top=r+"px",i.left=e+"px";var n=this.document instanceof Document?this.document.body:this.document.firstElementChild;n.appendChild(this.dragImage)}},t.prototype._detachDragImage=function(){if(this.dragImage){var e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}},t.prototype._setDropAction=function(e){if(e=Wl.validateAction(e,this.supportedActions),!(this._override&&this._dropAction===e))switch(e){case"none":this._dropAction=e,this._override=t.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=t.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=t.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=t.overrideCursor("move",this.document);break}},t.prototype._finalize=function(e){var r=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,r&&r(e)},t}();(function(t){function e(i,n){n===void 0&&(n=document);var o=++r,s=n instanceof Document?n.body:n.firstElementChild;return s.style.cursor=i,s.classList.add("lm-mod-override-cursor"),s.classList.add("p-mod-override-cursor"),new TA(function(){o===r&&(s.style.cursor="",s.classList.remove("lm-mod-override-cursor"),s.classList.remove("p-mod-override-cursor"))})}t.overrideCursor=e;var r=0})(EA||(EA={}));var Wl;(function(t){t.SCROLL_EDGE_SIZE=20;function e(E,M){return h[E]&v[M]?E:"none"}t.validateAction=e;function r(E,M,O){var F=document.createEvent("MouseEvent");return F.initMouseEvent(E,!0,!0,window,0,0,0,M,O,!1,!1,!1,!1,0,null),F}t.createMouseEvent=r;function i(E){for(var M=E.clientX,O=E.clientY,F=document.elementFromPoint(M,O);F;F=F.parentElement){var z=F.hasAttribute("data-lm-dragscroll");if(z=z||F.hasAttribute("data-p-dragscroll"),!!z){var W=0,J=0;F===document.body&&(W=window.pageXOffset,J=window.pageYOffset);var K=F.getBoundingClientRect(),ne=K.top+J,ge=K.left+W,H=ge+K.width,me=ne+K.height;if(!(M<ge||M>=H||O<ne||O>=me)){var fe=M-ge+1,$=O-ne+1,Z=H-M,we=me-O,Oe=Math.min(fe,$,Z,we);if(!(Oe>t.SCROLL_EDGE_SIZE)){var he=void 0;switch(Oe){case we:he="bottom";break;case $:he="top";break;case Z:he="right";break;case fe:he="left";break;default:throw"unreachable"}var Le=F.scrollWidth-F.clientWidth,ft=F.scrollHeight-F.clientHeight,Vt=void 0;switch(he){case"top":Vt=ft>0&&F.scrollTop>0;break;case"left":Vt=Le>0&&F.scrollLeft>0;break;case"right":Vt=Le>0&&F.scrollLeft<Le;break;case"bottom":Vt=ft>0&&F.scrollTop<ft;break;default:throw"unreachable"}if(Vt)return{element:F,edge:he,distance:Oe}}}}}return null}t.findScrollTarget=i;function n(E,M,O,F){if(!M)return null;var z=T("lm-dragenter",E,F,O),W=!M.dispatchEvent(z);if(W||(z=T("p-dragenter",E,F,O),W=!M.dispatchEvent(z),W))return M;var J=E.document instanceof Document?E.document.body:E.document.firstElementChild;return M===J?O:(z=T("lm-dragenter",E,F,O),J.dispatchEvent(z),z=T("p-dragenter",E,F,O),J.dispatchEvent(z),J)}t.dispatchDragEnter=n;function o(E,M,O,F){if(M){var z=T("lm-dragexit",E,F,O);M.dispatchEvent(z),z=T("p-dragexit",E,F,O),M.dispatchEvent(z)}}t.dispatchDragExit=o;function s(E,M,O,F){if(M){var z=T("lm-dragleave",E,F,O);M.dispatchEvent(z),z=T("p-dragleave",E,F,O),M.dispatchEvent(z)}}t.dispatchDragLeave=s;function l(E,M,O){if(!M)return"none";var F=T("lm-dragover",E,O,null),z=!M.dispatchEvent(F);return z||(F=T("p-dragover",E,O,null),z=!M.dispatchEvent(F),z)?F.dropAction:"none"}t.dispatchDragOver=l;function u(E,M,O){if(!M)return"none";var F=T("lm-drop",E,O,null),z=!M.dispatchEvent(F);return z||(F=T("p-drop",E,O,null),z=!M.dispatchEvent(F),z)?F.dropAction:"none"}t.dispatchDrop=u;var h={none:0,copy:1,link:2,move:4},v={none:h.none,copy:h.copy,link:h.link,move:h.move,"copy-link":h.copy|h.link,"copy-move":h.copy|h.move,"link-move":h.link|h.move,all:h.copy|h.link|h.move};function T(E,M,O,F){var z=document.createEvent("MouseEvent");return z.initMouseEvent(E,!0,!0,window,0,O.screenX,O.screenY,O.clientX,O.clientY,O.ctrlKey,O.altKey,O.shiftKey,O.metaKey,O.button,F),z.dropAction="none",z.mimeData=M.mimeData,z.proposedAction=M.proposedAction,z.supportedActions=M.supportedActions,z.source=M.source,z}})(Wl||(Wl={}));var qg=ga(gy());var cc=ga(gy());function nv(){return J4.keyboardLayout}var Z4=function(){function t(e,r,i){i===void 0&&(i=[]),this.name=e,this._codes=r,this._keys=t.extractKeys(r),this._modifierKeys=t.convertToKeySet(i)}return t.prototype.keys=function(){return Object.keys(this._keys)},t.prototype.isValidKey=function(e){return e in this._keys},t.prototype.isModifierKey=function(e){return e in this._modifierKeys},t.prototype.keyForKeydownEvent=function(e){return this._codes[e.keyCode]||""},t}();(function(t){function e(i){var n=Object.create(null);for(var o in i)n[i[o]]=!0;return n}t.extractKeys=e;function r(i){for(var n=Object(null),o=0,s=i.length;o<s;++o)n[i[o]]=!0;return n}t.convertToKeySet=r})(Z4||(Z4={}));var GMe=new Z4("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"]),J4;(function(t){t.keyboardLayout=GMe})(J4||(J4={}));var Q4=function(){return Q4=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Q4.apply(this,arguments)},ov=function(){function t(){this._timerID=0,this._replaying=!1,this._keystrokes=[],this._keydownEvents=[],this._keyBindings=[],this._exactKeyMatch=null,this._commands=Object.create(null),this._commandChanged=new Wn(this),this._commandExecuted=new Wn(this),this._keyBindingChanged=new Wn(this)}return Object.defineProperty(t.prototype,"commandChanged",{get:function(){return this._commandChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"commandExecuted",{get:function(){return this._commandExecuted},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBindingChanged",{get:function(){return this._keyBindingChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyBindings",{get:function(){return this._keyBindings},enumerable:!0,configurable:!0}),t.prototype.listCommands=function(){return Object.keys(this._commands)},t.prototype.hasCommand=function(e){return e in this._commands},t.prototype.addCommand=function(e,r){var i=this;if(e in this._commands)throw new Error("Command '"+e+"' already registered.");return this._commands[e]=SA.createCommand(r),this._commandChanged.emit({id:e,type:"added"}),new TA(function(){delete i._commands[e],i._commandChanged.emit({id:e,type:"removed"})})},t.prototype.notifyCommandChanged=function(e){if(e!==void 0&&!(e in this._commands))throw new Error("Command '"+e+"' is not registered.");this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})},t.prototype.describedBy=function(e){var r=this._commands[e];return r?r.describedBy||{args:null}:{args:null}},t.prototype.label=function(e,r){r===void 0&&(r=cc.JSONExt.emptyObject);var i=this._commands[e];return i?i.label.call(void 0,r):""},t.prototype.mnemonic=function(e,r){r===void 0&&(r=cc.JSONExt.emptyObject);var i=this._commands[e];return i?i.mnemonic.call(void 0,r):-1},t.prototype.icon=function(e,r){r===void 0&&(r=cc.JSONExt.emptyObject);var i=this._commands[e];return i?i.icon.call(void 0,r):""},t.prototype.iconClass=function(e,r){r===void 0&&(r=cc.JSONExt.emptyObject);var i=this._commands[e];return i?i.iconClass.call(void 0,r):""},t.prototype.iconLabel=function(e,r){r===void 0&&(r=cc.JSONExt.emptyObject);var i=this._commands[e];return i?i.iconLabel.call(void 0,r):""},t.prototype.caption=function(e,r){r===void 0&&(r=cc.JSONExt.emptyObject);var i=this._commands[e];return i?i.caption.call(void 0,r):""},t.prototype.usage=function(e,r){r===void 0&&(r=cc.JSONExt.emptyObject);var i=this._commands[e];return i?i.usage.call(void 0,r):""},t.prototype.className=function(e,r){r===void 0&&(r=cc.JSONExt.emptyObject);var i=this._commands[e];return i?i.className.call(void 0,r):""},t.prototype.dataset=function(e,r){r===void 0&&(r=cc.JSONExt.emptyObject);var i=this._commands[e];return i?i.dataset.call(void 0,r):{}},t.prototype.isEnabled=function(e,r){r===void 0&&(r=cc.JSONExt.emptyObject);var i=this._commands[e];return i?i.isEnabled.call(void 0,r):!1},t.prototype.isToggled=function(e,r){r===void 0&&(r=cc.JSONExt.emptyObject);var i=this._commands[e];return i?i.isToggled.call(void 0,r):!1},t.prototype.isToggleable=function(e,r){var i=this._commands[e];return i?i.isToggleable:!1},t.prototype.isVisible=function(e,r){r===void 0&&(r=cc.JSONExt.emptyObject);var i=this._commands[e];return i?i.isVisible.call(void 0,r):!1},t.prototype.execute=function(e,r){r===void 0&&(r=cc.JSONExt.emptyObject);var i=this._commands[e];if(!i)return Promise.reject(new Error("Command '"+e+"' not registered."));var n;try{n=i.execute.call(void 0,r)}catch(s){n=Promise.reject(s)}var o=Promise.resolve(n);return this._commandExecuted.emit({id:e,args:r,result:o}),o},t.prototype.addKeyBinding=function(e){var r=this,i=SA.createKeyBinding(e);return this._keyBindings.push(i),this._keyBindingChanged.emit({binding:i,type:"added"}),new TA(function(){rr.removeFirstOf(r._keyBindings,i),r._keyBindingChanged.emit({binding:i,type:"removed"})})},t.prototype.processKeydownEvent=function(e){if(!(this._replaying||t.isModifierKeyPressed(e))){var r=t.keystrokeForKeydownEvent(e);if(!r){this._replayKeydownEvents(),this._clearPendingState();return}this._keystrokes.push(r);var i=SA.matchKeyBinding(this._keyBindings,this._keystrokes,e),n=i.exact,o=i.partial;if(!n&&!o){this._replayKeydownEvents(),this._clearPendingState();return}if(e.preventDefault(),e.stopPropagation(),n&&!o){this._executeKeyBinding(n),this._clearPendingState();return}n&&(this._exactKeyMatch=n),this._keydownEvents.push(e),this._startTimer()}},t.prototype._startTimer=function(){var e=this;this._clearTimer(),this._timerID=window.setTimeout(function(){e._onPendingTimeout()},SA.CHORD_TIMEOUT)},t.prototype._clearTimer=function(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)},t.prototype._replayKeydownEvents=function(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(SA.replayKeyEvent),this._replaying=!1)},t.prototype._executeKeyBinding=function(e){var r=e.command,i=e.args;if(!this.hasCommand(r)||!this.isEnabled(r,i)){var n=this.hasCommand(r)?"enabled":"registered",o=e.keys.join(", "),s="Cannot execute key binding '"+o+"':",l="command '"+r+"' is not "+n+".";console.warn(s+" "+l);return}this.execute(r,i)},t.prototype._clearPendingState=function(){this._clearTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0},t.prototype._onPendingTimeout=function(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()},t}();(function(t){function e(l){for(var u="",h=!1,v=!1,T=!1,E=!1,M=0,O=l.split(/\s+/);M<O.length;M++){var F=O[M];F==="Accel"?nl.IS_MAC?v=!0:T=!0:F==="Alt"?h=!0:F==="Cmd"?v=!0:F==="Ctrl"?T=!0:F==="Shift"?E=!0:F.length>0&&(u=F)}return{cmd:v,ctrl:T,alt:h,shift:E,key:u}}t.parseKeystroke=e;function r(l){var u="",h=e(l);return h.ctrl&&(u+="Ctrl "),h.alt&&(u+="Alt "),h.shift&&(u+="Shift "),h.cmd&&nl.IS_MAC&&(u+="Cmd "),u+h.key}t.normalizeKeystroke=r;function i(l){var u;return nl.IS_WIN?u=l.winKeys||l.keys:nl.IS_MAC?u=l.macKeys||l.keys:u=l.linuxKeys||l.keys,u.map(r)}t.normalizeKeys=i;function n(l){return typeof l=="string"?u(l):l.map(u).join(", ");function u(h){var v=[],T=nl.IS_MAC?" ":"+",E=e(h);return E.ctrl&&v.push("Ctrl"),E.alt&&v.push("Alt"),E.shift&&v.push("Shift"),nl.IS_MAC&&E.cmd&&v.push("Cmd"),v.push(E.key),v.map(SA.formatKey).join(T)}}t.formatKeystroke=n;function o(l){var u=nv(),h=u.keyForKeydownEvent(l);return u.isModifierKey(h)}t.isModifierKeyPressed=o;function s(l){var u=nv(),h=u.keyForKeydownEvent(l);if(!h||u.isModifierKey(h))return"";var v=[];return l.ctrlKey&&v.push("Ctrl"),l.altKey&&v.push("Alt"),l.shiftKey&&v.push("Shift"),l.metaKey&&nl.IS_MAC&&v.push("Cmd"),v.push(h),v.join(" ")}t.keystrokeForKeydownEvent=s})(ov||(ov={}));var SA;(function(t){t.CHORD_TIMEOUT=1e3;function e(K){var ne,ge;return!K.icon||typeof K.icon=="string"?(ge=O(K.iconClass||K.icon,u),ne=ge):(ge=O(K.iconClass,u),ne=O(K.icon,M)),{execute:K.execute,describedBy:Q4({args:null},K.describedBy),label:O(K.label,u),mnemonic:O(K.mnemonic,h),icon:ne,iconClass:ge,iconLabel:O(K.iconLabel,u),caption:O(K.caption,u),usage:O(K.usage,u),className:O(K.className,u),dataset:O(K.dataset,E),isEnabled:K.isEnabled||v,isToggled:K.isToggled||T,isToggleable:K.isToggleable||!!K.isToggled,isVisible:K.isVisible||v}}t.createCommand=e;function r(K){return{keys:ov.normalizeKeys(K),selector:F(K),command:K.command,args:K.args||cc.JSONExt.emptyObject}}t.createKeyBinding=r;function i(K,ne,ge){for(var H=null,me=!1,fe=1/0,$=0,Z=0,we=K.length;Z<we;++Z){var Oe=K[Z],he=z(Oe.keys,ne);if(he!==0){if(he===2){!me&&W(Oe.selector,ge)!==-1&&(me=!0);continue}var Le=W(Oe.selector,ge);if(!(Le===-1||Le>fe)){var ft=Hf.calculateSpecificity(Oe.selector);(!H||Le<fe||ft>=$)&&(H=Oe,fe=Le,$=ft)}}}return{exact:H,partial:me}}t.matchKeyBinding=i;function n(K){K.target.dispatchEvent(J(K))}t.replayKeyEvent=n;function o(K){return nl.IS_MAC?s.hasOwnProperty(K)?s[K]:K:l.hasOwnProperty(K)?l[K]:K}t.formatKey=o;var s={Backspace:"\u232B",Tab:"\u21E5",Enter:"\u21A9",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"},l={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},u=function(){return""},h=function(){return-1},v=function(){return!0},T=function(){return!1},E=function(){return{}},M=function(){};function O(K,ne){return K===void 0?ne:typeof K=="function"?K:function(){return K}}function F(K){if(K.selector.indexOf(",")!==-1)throw new Error("Selector cannot contain commas: "+K.selector);if(!Hf.isValid(K.selector))throw new Error("Invalid selector: "+K.selector);return K.selector}function z(K,ne){if(K.length<ne.length)return 0;for(var ge=0,H=ne.length;ge<H;++ge)if(K[ge]!==ne[ge])return 0;return K.length>ne.length?2:1}function W(K,ne){for(var ge=ne.target,H=ne.currentTarget,me=0;ge!==null;ge=ge.parentElement,++me){if(ge.hasAttribute("data-lm-suppress-shortcuts")||ge.hasAttribute("data-p-suppress-shortcuts"))return-1;if(Hf.matches(ge,K))return me;if(ge===H)return-1}return-1}function J(K){var ne=document.createEvent("Event"),ge=K.bubbles||!0,H=K.cancelable||!0;return ne.initEvent(K.type||"keydown",ge,H),ne.key=K.key||"",ne.keyCode=K.keyCode||0,ne.which=K.keyCode||0,ne.ctrlKey=K.ctrlKey||!1,ne.altKey=K.altKey||!1,ne.shiftKey=K.shiftKey||!1,ne.metaKey=K.metaKey||!1,ne.view=K.view||window,ne}})(SA||(SA={}));var $4=function(t,e){return $4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},$4(t,e)};function WMe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");$4(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var WI=function(){function t(e){this.type="text",this.content=e}return t}(),qI=function(){function t(e,r,i,n){this.type="element",this.tag=e,this.attrs=r,this.children=i,this.renderer=n}return t}(),RTt=function(t){WMe(e,t);function e(r,i,n){return t.call(this,r,i,[],n||void 0)||this}return e}(qI);function so(t){for(var e={},r,i=[],n=1,o=arguments.length;n<o;++n){var s=arguments[n];typeof s=="string"?i.push(new WI(s)):s instanceof WI||s instanceof qI?i.push(s):s instanceof Array?l(i,s):(n===1||n===2)&&s&&typeof s=="object"&&("render"in s?r=s:e=s)}return new qI(t,e,i,r);function l(u,h){for(var v=0,T=h;v<T.length;v++){var E=T[v];typeof E=="string"?u.push(new WI(E)):(E instanceof WI||E instanceof qI)&&u.push(E)}}}(function(t){t.a=t.bind(void 0,"a"),t.abbr=t.bind(void 0,"abbr"),t.address=t.bind(void 0,"address"),t.area=t.bind(void 0,"area"),t.article=t.bind(void 0,"article"),t.aside=t.bind(void 0,"aside"),t.audio=t.bind(void 0,"audio"),t.b=t.bind(void 0,"b"),t.bdi=t.bind(void 0,"bdi"),t.bdo=t.bind(void 0,"bdo"),t.blockquote=t.bind(void 0,"blockquote"),t.br=t.bind(void 0,"br"),t.button=t.bind(void 0,"button"),t.canvas=t.bind(void 0,"canvas"),t.caption=t.bind(void 0,"caption"),t.cite=t.bind(void 0,"cite"),t.code=t.bind(void 0,"code"),t.col=t.bind(void 0,"col"),t.colgroup=t.bind(void 0,"colgroup"),t.data=t.bind(void 0,"data"),t.datalist=t.bind(void 0,"datalist"),t.dd=t.bind(void 0,"dd"),t.del=t.bind(void 0,"del"),t.dfn=t.bind(void 0,"dfn"),t.div=t.bind(void 0,"div"),t.dl=t.bind(void 0,"dl"),t.dt=t.bind(void 0,"dt"),t.em=t.bind(void 0,"em"),t.embed=t.bind(void 0,"embed"),t.fieldset=t.bind(void 0,"fieldset"),t.figcaption=t.bind(void 0,"figcaption"),t.figure=t.bind(void 0,"figure"),t.footer=t.bind(void 0,"footer"),t.form=t.bind(void 0,"form"),t.h1=t.bind(void 0,"h1"),t.h2=t.bind(void 0,"h2"),t.h3=t.bind(void 0,"h3"),t.h4=t.bind(void 0,"h4"),t.h5=t.bind(void 0,"h5"),t.h6=t.bind(void 0,"h6"),t.header=t.bind(void 0,"header"),t.hr=t.bind(void 0,"hr"),t.i=t.bind(void 0,"i"),t.iframe=t.bind(void 0,"iframe"),t.img=t.bind(void 0,"img"),t.input=t.bind(void 0,"input"),t.ins=t.bind(void 0,"ins"),t.kbd=t.bind(void 0,"kbd"),t.label=t.bind(void 0,"label"),t.legend=t.bind(void 0,"legend"),t.li=t.bind(void 0,"li"),t.main=t.bind(void 0,"main"),t.map=t.bind(void 0,"map"),t.mark=t.bind(void 0,"mark"),t.meter=t.bind(void 0,"meter"),t.nav=t.bind(void 0,"nav"),t.noscript=t.bind(void 0,"noscript"),t.object=t.bind(void 0,"object"),t.ol=t.bind(void 0,"ol"),t.optgroup=t.bind(void 0,"optgroup"),t.option=t.bind(void 0,"option"),t.output=t.bind(void 0,"output"),t.p=t.bind(void 0,"p"),t.param=t.bind(void 0,"param"),t.pre=t.bind(void 0,"pre"),t.progress=t.bind(void 0,"progress"),t.q=t.bind(void 0,"q"),t.rp=t.bind(void 0,"rp"),t.rt=t.bind(void 0,"rt"),t.ruby=t.bind(void 0,"ruby"),t.s=t.bind(void 0,"s"),t.samp=t.bind(void 0,"samp"),t.section=t.bind(void 0,"section"),t.select=t.bind(void 0,"select"),t.small=t.bind(void 0,"small"),t.source=t.bind(void 0,"source"),t.span=t.bind(void 0,"span"),t.strong=t.bind(void 0,"strong"),t.sub=t.bind(void 0,"sub"),t.summary=t.bind(void 0,"summary"),t.sup=t.bind(void 0,"sup"),t.table=t.bind(void 0,"table"),t.tbody=t.bind(void 0,"tbody"),t.td=t.bind(void 0,"td"),t.textarea=t.bind(void 0,"textarea"),t.tfoot=t.bind(void 0,"tfoot"),t.th=t.bind(void 0,"th"),t.thead=t.bind(void 0,"thead"),t.time=t.bind(void 0,"time"),t.title=t.bind(void 0,"title"),t.tr=t.bind(void 0,"tr"),t.track=t.bind(void 0,"track"),t.u=t.bind(void 0,"u"),t.ul=t.bind(void 0,"ul"),t.var_=t.bind(void 0,"var"),t.video=t.bind(void 0,"video"),t.wbr=t.bind(void 0,"wbr")})(so||(so={}));var td;(function(t){function e(i){return Gg.createDOMNode(i)}t.realize=e;function r(i,n){var o=Gg.hostMap.get(n)||[],s=Gg.asContentArray(i);Gg.hostMap.set(n,s),Gg.updateContent(n,o,s)}t.render=r})(td||(td={}));var Gg;(function(t){t.hostMap=new WeakMap;function e(M){return M?M instanceof Array?M:[M]:[]}t.asContentArray=e;function r(M){var O=arguments[1]||null,F=arguments[2]||null;if(O)O.insertBefore(r(M),F);else{if(M.type==="text")return document.createTextNode(M.content);if(O=document.createElement(M.tag),s(O,M.attrs),M.renderer)return M.renderer.render(O,{attrs:M.attrs,children:M.children}),O;for(var z=0,W=M.children.length;z<W;++z)r(M.children[z],O)}return O}t.createDOMNode=r;function i(M,O,F){if(O!==F){for(var z=E(M,O),W=O.slice(),J=M.firstChild,K=F.length,ne=0;ne<K;++ne){if(ne>=W.length){r(F[ne],M);continue}var ge=W[ne],H=F[ne];if(ge===H){J=J.nextSibling;continue}if(ge.type==="text"&&H.type==="text"){J.textContent!==H.content&&(J.textContent=H.content),J=J.nextSibling;continue}if(ge.type==="text"||H.type==="text"){rr.insert(W,ne,H),r(H,M,J);continue}if(!ge.renderer!=!H.renderer){rr.insert(W,ne,H),r(H,M,J);continue}var me=H.attrs.key;if(me&&me in z){var fe=z[me];fe.vNode!==ge&&(rr.move(W,W.indexOf(fe.vNode,ne+1),ne),M.insertBefore(fe.element,J),ge=fe.vNode,J=fe.element)}if(ge===H){J=J.nextSibling;continue}var $=ge.attrs.key;if($&&$!==me){rr.insert(W,ne,H),r(H,M,J);continue}if(ge.tag!==H.tag){rr.insert(W,ne,H),r(H,M,J);continue}l(J,ge.attrs,H.attrs),H.renderer?H.renderer.render(J,{attrs:H.attrs,children:H.children}):i(J,ge.children,H.children),J=J.nextSibling}n(M,W,K,!0)}}t.updateContent=i;function n(M,O,F,z){for(var W=O.length-1;W>=F;--W){var J=O[W],K=z?M.lastChild:M.childNodes[W];J.type==="text"||(J.renderer&&J.renderer.unrender?J.renderer.unrender(K,{attrs:J.attrs,children:J.children}):n(K,J.children,0,!1)),z&&M.removeChild(K)}}var o={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function s(M,O){for(var F in O)F in o||(F.substr(0,2)==="on"?M[F]=O[F]:M.setAttribute(F,O[F]));O.className!==void 0&&M.setAttribute("class",O.className),O.htmlFor!==void 0&&M.setAttribute("for",O.htmlFor),O.dataset&&u(M,O.dataset),O.style&&v(M,O.style)}function l(M,O,F){if(O!==F){var z;for(z in O)z in o||z in F||(z.substr(0,2)==="on"?M[z]=null:M.removeAttribute(z));for(z in F)z in o||O[z]===F[z]||(z.substr(0,2)==="on"?M[z]=F[z]:M.setAttribute(z,F[z]));O.className!==F.className&&(F.className!==void 0?M.setAttribute("class",F.className):M.removeAttribute("class")),O.htmlFor!==F.htmlFor&&(F.htmlFor!==void 0?M.setAttribute("for",F.htmlFor):M.removeAttribute("for")),O.dataset!==F.dataset&&h(M,O.dataset||{},F.dataset||{}),O.style!==F.style&&T(M,O.style||{},F.style||{})}}function u(M,O){for(var F in O)M.setAttribute("data-"+F,O[F])}function h(M,O,F){for(var z in O)z in F||M.removeAttribute("data-"+z);for(var W in F)O[W]!==F[W]&&M.setAttribute("data-"+W,F[W])}function v(M,O){var F=M.style,z;for(z in O)F[z]=O[z]}function T(M,O,F){var z=M.style,W;for(W in O)W in F||(z[W]="");for(W in F)O[W]!==F[W]&&(z[W]=F[W])}function E(M,O){for(var F=M.firstChild,z=Object.create(null),W=0,J=O;W<J.length;W++){var K=J[W];K.type==="element"&&K.attrs.key&&(z[K.attrs.key]={vNode:K,element:F}),F=F.nextSibling}return z}})(Gg||(Gg={}));var ek=function(t,e){return ek=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},ek(t,e)};function ks(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ek(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ol=function(){return ol=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},ol.apply(this,arguments)};function qMe(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function XMe(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var o=arguments[e],s=0,l=o.length;s<l;s++,n++)i[n]=o[s];return i}var CA=function(){function t(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}return t}(),lu;(function(t){function e(o,s){var l=o.length;if(l===0)return s;for(var u=0,h=0,v=0,T=0,E=0,M=0;M<l;++M){var O=o[M],F=O.minSize,z=O.maxSize,W=O.sizeHint;O.done=!1,O.size=Math.max(F,Math.min(W,z)),v+=O.size,u+=F,h+=z,O.stretch>0&&(T+=O.stretch,E++)}if(s===v)return 0;if(s<=u){for(var M=0;M<l;++M){var O=o[M];O.size=O.minSize}return s-u}if(s>=h){for(var M=0;M<l;++M){var O=o[M];O.size=O.maxSize}return s-h}var J=.01,K=l;if(s<v){for(var ne=v-s;E>0&&ne>J;)for(var ge=ne,H=T,M=0;M<l;++M){var O=o[M];if(!(O.done||O.stretch===0)){var me=O.stretch*ge/H;O.size-me<=O.minSize?(ne-=O.size-O.minSize,T-=O.stretch,O.size=O.minSize,O.done=!0,K--,E--):(ne-=me,O.size-=me)}}for(;K>0&&ne>J;)for(var me=ne/K,M=0;M<l;++M){var O=o[M];O.done||(O.size-me<=O.minSize?(ne-=O.size-O.minSize,O.size=O.minSize,O.done=!0,K--):(ne-=me,O.size-=me))}}else{for(var ne=s-v;E>0&&ne>J;)for(var ge=ne,H=T,M=0;M<l;++M){var O=o[M];if(!(O.done||O.stretch===0)){var me=O.stretch*ge/H;O.size+me>=O.maxSize?(ne-=O.maxSize-O.size,T-=O.stretch,O.size=O.maxSize,O.done=!0,K--,E--):(ne-=me,O.size+=me)}}for(;K>0&&ne>J;)for(var me=ne/K,M=0;M<l;++M){var O=o[M];O.done||(O.size+me>=O.maxSize?(ne-=O.maxSize-O.size,O.size=O.maxSize,O.done=!0,K--):(ne-=me,O.size+=me))}}return 0}t.calc=e;function r(o,s,l){o.length===0||l===0||(l>0?i(o,s,l):n(o,s,-l))}t.adjust=r;function i(o,s,l){for(var u=0,h=0;h<=s;++h){var v=o[h];u+=v.maxSize-v.size}for(var T=0,h=s+1,E=o.length;h<E;++h){var v=o[h];T+=v.size-v.minSize}l=Math.min(l,u,T);for(var M=l,h=s;h>=0&&M>0;--h){var v=o[h],O=v.maxSize-v.size;O>=M?(v.sizeHint=v.size+M,M=0):(v.sizeHint=v.size+O,M-=O)}for(var F=l,h=s+1,E=o.length;h<E&&F>0;++h){var v=o[h],O=v.size-v.minSize;O>=F?(v.sizeHint=v.size-F,F=0):(v.sizeHint=v.size-O,F-=O)}}function n(o,s,l){for(var u=0,h=s+1,v=o.length;h<v;++h){var T=o[h];u+=T.maxSize-T.size}for(var E=0,h=0;h<=s;++h){var T=o[h];E+=T.size-T.minSize}l=Math.min(l,u,E);for(var M=l,h=s+1,v=o.length;h<v&&M>0;++h){var T=o[h],O=T.maxSize-T.size;O>=M?(T.sizeHint=T.size+M,M=0):(T.sizeHint=T.size+O,M-=O)}for(var F=l,h=s;h>=0&&F>0;--h){var T=o[h],O=T.size-T.minSize;O>=F?(T.sizeHint=T.size-F,F=0):(T.sizeHint=T.size-O,F-=O)}}})(lu||(lu={}));var tk=function(){function t(e){this._label="",this._caption="",this._mnemonic=-1,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new Wn(this),this._isDisposed=!1,this.owner=e.owner,e.label!==void 0&&(this._label=e.label),e.mnemonic!==void 0&&(this._mnemonic=e.mnemonic),e.icon!==void 0?typeof e.icon=="string"?(this._icon=null,this._iconClass=e.icon):this._icon=e.icon:this._icon=null,e.iconClass!==void 0&&(this._iconClass=e.iconClass),e.iconLabel!==void 0&&(this._iconLabel=e.iconLabel),e.iconRenderer!==void 0&&(this._icon=e.iconRenderer),e.caption!==void 0&&(this._caption=e.caption),e.className!==void 0&&(this._className=e.className),e.closable!==void 0&&(this._closable=e.closable),this._dataset=e.dataset||{}}return Object.defineProperty(t.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){return this._label},set:function(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mnemonic",{get:function(){return this._mnemonic},set:function(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return this._icon===null?this.iconClass:this._icon},set:function(e){if(typeof e=="string")this._icon=null,this.iconClass=e;else{if(this._icon===e)return;this._icon=e,this._changed.emit(void 0)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{get:function(){return this._iconClass},set:function(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconLabel",{get:function(){return this._iconLabel},set:function(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconRenderer",{get:function(){return this._icon||void 0},set:function(e){this.icon=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this._caption},set:function(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this._className},set:function(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"closable",{get:function(){return this._closable},set:function(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this._dataset},set:function(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this._isDisposed=!0,Wn.clearData(this))},t}(),Br=function(){function t(e){e===void 0&&(e={}),this._flags=0,this._layout=null,this._parent=null,this._disposed=new Wn(this),this._hiddenMode=t.HiddenMode.Display,this.node=XI.createNode(e),this.addClass("lm-Widget"),this.addClass("p-Widget")}return t.prototype.dispose=function(){this.isDisposed||(this.setFlag(t.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&t.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),Wn.clearData(this),xr.clearData(this),lc.clearData(this))},Object.defineProperty(t.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this.testFlag(t.Flag.IsDisposed)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.testFlag(t.Flag.IsAttached)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.testFlag(t.Flag.IsHidden)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.testFlag(t.Flag.IsVisible)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return XI.titleProperty.get(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.node.id},set:function(e){this.node.id=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataset",{get:function(){return this.node.dataset},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(e){this._hiddenMode!==e&&(this.isHidden&&this._toggleHidden(!1),e==t.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=e,this.isHidden&&this._toggleHidden(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},set:function(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var r=new t.ChildMessage("child-removed",this);xr.sendMessage(this._parent,r)}if(this._parent=e,this._parent&&!this._parent.isDisposed){var r=new t.ChildMessage("child-added",this);xr.sendMessage(this._parent,r)}this.isDisposed||xr.sendMessage(this,t.Msg.ParentChanged)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(e){if(this._layout!==e){if(this.testFlag(t.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}},enumerable:!0,configurable:!0}),t.prototype.children=function(){return this._layout?this._layout.iter():su()},t.prototype.contains=function(e){for(var r=e;r;r=r._parent)if(r===this)return!0;return!1},t.prototype.hasClass=function(e){return this.node.classList.contains(e)},t.prototype.addClass=function(e){this.node.classList.add(e)},t.prototype.removeClass=function(e){this.node.classList.remove(e)},t.prototype.toggleClass=function(e,r){return r===!0?(this.node.classList.add(e),!0):r===!1?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)},t.prototype.update=function(){xr.postMessage(this,t.Msg.UpdateRequest)},t.prototype.fit=function(){xr.postMessage(this,t.Msg.FitRequest)},t.prototype.activate=function(){xr.postMessage(this,t.Msg.ActivateRequest)},t.prototype.close=function(){xr.sendMessage(this,t.Msg.CloseRequest)},t.prototype.show=function(){if(this.testFlag(t.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&xr.sendMessage(this,t.Msg.BeforeShow),this.clearFlag(t.Flag.IsHidden),this.node.removeAttribute("aria-hidden"),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&xr.sendMessage(this,t.Msg.AfterShow),this.parent)){var e=new t.ChildMessage("child-shown",this);xr.sendMessage(this.parent,e)}},t.prototype.hide=function(){if(!this.testFlag(t.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&xr.sendMessage(this,t.Msg.BeforeHide),this.setFlag(t.Flag.IsHidden),this.node.setAttribute("aria-hidden","true"),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&xr.sendMessage(this,t.Msg.AfterHide),this.parent)){var e=new t.ChildMessage("child-hidden",this);xr.sendMessage(this.parent,e)}},t.prototype.setHidden=function(e){e?this.hide():this.show()},t.prototype.testFlag=function(e){return(this._flags&e)!==0},t.prototype.setFlag=function(e){this._flags|=e},t.prototype.clearFlag=function(e){this._flags&=~e},t.prototype.processMessage=function(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(t.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(t.Flag.IsVisible),this.setFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(t.Flag.IsVisible),this.clearFlag(t.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e);break}},t.prototype.notifyLayout=function(e){this._layout&&this._layout.processParentMessage(e)},t.prototype.onCloseRequest=function(e){this.parent?this.parent=null:this.isAttached&&t.detach(this)},t.prototype.onResize=function(e){},t.prototype.onUpdateRequest=function(e){},t.prototype.onFitRequest=function(e){},t.prototype.onActivateRequest=function(e){},t.prototype.onBeforeShow=function(e){},t.prototype.onAfterShow=function(e){},t.prototype.onBeforeHide=function(e){},t.prototype.onAfterHide=function(e){},t.prototype.onBeforeAttach=function(e){},t.prototype.onAfterAttach=function(e){},t.prototype.onBeforeDetach=function(e){},t.prototype.onAfterDetach=function(e){},t.prototype.onChildAdded=function(e){},t.prototype.onChildRemoved=function(e){},t.prototype._toggleHidden=function(e){if(e)switch(this._hiddenMode){case t.HiddenMode.Display:this.addClass("lm-mod-hidden"),this.addClass("p-mod-hidden");break;case t.HiddenMode.Scale:this.node.style.transform="scale(0)";break;case t.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1";break}else switch(this._hiddenMode){case t.HiddenMode.Display:this.removeClass("lm-mod-hidden"),this.removeClass("p-mod-hidden");break;case t.HiddenMode.Scale:this.node.style.transform="";break;case t.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="";break}},t}();(function(t){(function(o){o[o.Display=0]="Display",o[o.Scale=1]="Scale",o[o.ContentVisibility=2]="ContentVisibility"})(t.HiddenMode||(t.HiddenMode={})),function(o){o[o.IsDisposed=1]="IsDisposed",o[o.IsAttached=2]="IsAttached",o[o.IsHidden=4]="IsHidden",o[o.IsVisible=8]="IsVisible",o[o.DisallowLayout=16]="DisallowLayout"}(t.Flag||(t.Flag={})),function(o){o.BeforeShow=new au("before-show"),o.AfterShow=new au("after-show"),o.BeforeHide=new au("before-hide"),o.AfterHide=new au("after-hide"),o.BeforeAttach=new au("before-attach"),o.AfterAttach=new au("after-attach"),o.BeforeDetach=new au("before-detach"),o.AfterDetach=new au("after-detach"),o.ParentChanged=new au("parent-changed"),o.UpdateRequest=new iv("update-request"),o.FitRequest=new iv("fit-request"),o.ActivateRequest=new iv("activate-request"),o.CloseRequest=new iv("close-request")}(t.Msg||(t.Msg={}));var e=function(o){ks(s,o);function s(l,u){var h=o.call(this,l)||this;return h.child=u,h}return s}(au);t.ChildMessage=e;var r=function(o){ks(s,o);function s(l,u){var h=o.call(this,"resize")||this;return h.width=l,h.height=u,h}return s}(au);t.ResizeMessage=r,function(o){o.UnknownSize=new o(-1,-1)}(r=t.ResizeMessage||(t.ResizeMessage={}));function i(o,s,l){if(l===void 0&&(l=null),o.parent)throw new Error("Cannot attach a child widget.");if(o.isAttached||o.node.isConnected)throw new Error("Widget is already attached.");if(!s.isConnected)throw new Error("Host is not attached.");xr.sendMessage(o,t.Msg.BeforeAttach),s.insertBefore(o.node,l),xr.sendMessage(o,t.Msg.AfterAttach)}t.attach=i;function n(o){if(o.parent)throw new Error("Cannot detach a child widget.");if(!o.isAttached||!o.node.isConnected)throw new Error("Widget is not attached.");xr.sendMessage(o,t.Msg.BeforeDetach),o.node.parentNode.removeChild(o.node),xr.sendMessage(o,t.Msg.AfterDetach)}t.detach=n})(Br||(Br={}));var XI;(function(t){t.titleProperty=new lc({name:"title",create:function(r){return new tk({owner:r})}});function e(r){return r.node||document.createElement(r.tag||"div")}t.createNode=e})(XI||(XI={}));var MA=function(){function t(e){e===void 0&&(e={}),this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}return t.prototype.dispose=function(){this._parent=null,this._disposed=!0,Wn.clearData(this),lc.clearData(this)},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},set:function(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fitPolicy",{get:function(){return this._fitPolicy},set:function(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){var r=this._parent.node.style;r.minWidth="",r.minHeight="",r.maxWidth="",r.maxHeight="",this._parent.fit()}},enumerable:!0,configurable:!0}),t.prototype.processParentMessage=function(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e);break}},t.prototype.init=function(){var e=this;Ei(this,function(r){r.parent=e.parent})},t.prototype.onResize=function(e){Ei(this,function(r){xr.sendMessage(r,Br.ResizeMessage.UnknownSize)})},t.prototype.onUpdateRequest=function(e){Ei(this,function(r){xr.sendMessage(r,Br.ResizeMessage.UnknownSize)})},t.prototype.onBeforeAttach=function(e){Ei(this,function(r){xr.sendMessage(r,e)})},t.prototype.onAfterAttach=function(e){Ei(this,function(r){xr.sendMessage(r,e)})},t.prototype.onBeforeDetach=function(e){Ei(this,function(r){xr.sendMessage(r,e)})},t.prototype.onAfterDetach=function(e){Ei(this,function(r){xr.sendMessage(r,e)})},t.prototype.onBeforeShow=function(e){Ei(this,function(r){r.isHidden||xr.sendMessage(r,e)})},t.prototype.onAfterShow=function(e){Ei(this,function(r){r.isHidden||xr.sendMessage(r,e)})},t.prototype.onBeforeHide=function(e){Ei(this,function(r){r.isHidden||xr.sendMessage(r,e)})},t.prototype.onAfterHide=function(e){Ei(this,function(r){r.isHidden||xr.sendMessage(r,e)})},t.prototype.onChildRemoved=function(e){this.removeWidget(e.child)},t.prototype.onFitRequest=function(e){},t.prototype.onChildShown=function(e){},t.prototype.onChildHidden=function(e){},t}();(function(t){function e(o){return sv.horizontalAlignmentProperty.get(o)}t.getHorizontalAlignment=e;function r(o,s){sv.horizontalAlignmentProperty.set(o,s)}t.setHorizontalAlignment=r;function i(o){return sv.verticalAlignmentProperty.get(o)}t.getVerticalAlignment=i;function n(o,s){sv.verticalAlignmentProperty.set(o,s)}t.setVerticalAlignment=n})(MA||(MA={}));var Hw=function(){function t(e){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=e,this.widget.node.style.position="absolute"}return t.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height=""}},Object.defineProperty(t.prototype,"minWidth",{get:function(){return this._minWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minHeight",{get:function(){return this._minHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){return this._maxWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxHeight",{get:function(){return this._maxHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.widget.isHidden},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.widget.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.widget.isAttached},enumerable:!0,configurable:!0}),t.prototype.fit=function(){var e=ho.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight},t.prototype.update=function(e,r,i,n){var o=Math.max(this._minWidth,Math.min(i,this._maxWidth)),s=Math.max(this._minHeight,Math.min(n,this._maxHeight));if(o<i)switch(MA.getHorizontalAlignment(this.widget)){case"left":break;case"center":e+=(i-o)/2;break;case"right":e+=i-o;break;default:throw"unreachable"}if(s<n)switch(MA.getVerticalAlignment(this.widget)){case"top":break;case"center":r+=(n-s)/2;break;case"bottom":r+=n-s;break;default:throw"unreachable"}var l=!1,u=this.widget.node.style;if(this._top!==r&&(this._top=r,u.top=r+"px"),this._left!==e&&(this._left=e,u.left=e+"px"),this._width!==o&&(l=!0,this._width=o,u.width=o+"px"),this._height!==s&&(l=!0,this._height=s,u.height=s+"px"),l){var h=new Br.ResizeMessage(o,s);xr.sendMessage(this.widget,h)}},t}(),sv;(function(t){t.horizontalAlignmentProperty=new lc({name:"horizontalAlignment",create:function(){return"center"},changed:e}),t.verticalAlignmentProperty=new lc({name:"verticalAlignment",create:function(){return"top"},changed:e});function e(r){r.parent&&r.parent.layout&&r.parent.update()}})(sv||(sv={}));var QI=function(t){ks(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._widgets=[],r}return e.prototype.dispose=function(){for(;this._widgets.length>0;)this._widgets.pop().dispose();t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return ou(this._widgets)},e.prototype.addWidget=function(r){this.insertWidget(this._widgets.length,r)},e.prototype.insertWidget=function(r,i){i.parent=this.parent;var n=this._widgets.indexOf(i),o=Math.max(0,Math.min(r,this._widgets.length));if(n===-1){rr.insert(this._widgets,o,i),this.parent&&this.attachWidget(o,i);return}o===this._widgets.length&&o--,n!==o&&(rr.move(this._widgets,n,o),this.parent&&this.moveWidget(n,o,i))},e.prototype.removeWidget=function(r){this.removeWidgetAt(this._widgets.indexOf(r))},e.prototype.removeWidgetAt=function(r){var i=rr.removeAt(this._widgets,r);i&&this.parent&&this.detachWidget(r,i)},e.prototype.init=function(){var r=this;t.prototype.init.call(this),Ei(this,function(i,n){r.attachWidget(n,i)})},e.prototype.attachWidget=function(r,i){var n=this.parent.node.children[r];this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,n),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterAttach)},e.prototype.moveWidget=function(r,i,n){this.parent.isAttached&&xr.sendMessage(n,Br.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&xr.sendMessage(n,Br.Msg.AfterDetach);var o=this.parent.node.children[i];this.parent.isAttached&&xr.sendMessage(n,Br.Msg.BeforeAttach),this.parent.node.insertBefore(n.node,o),this.parent.isAttached&&xr.sendMessage(n,Br.Msg.AfterAttach)},e.prototype.detachWidget=function(r,i){this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterDetach)},e}(MA),zw;(function(t){function e(r){return Math.max(0,Math.floor(r))}t.clampDimension=e})(zw||(zw={}));var Vw=zw,Xg=function(t){ks(e,t);function e(r){var i=t.call(this)||this;return i.widgetOffset=0,i._fixed=0,i._spacing=4,i._dirty=!1,i._hasNormedSizes=!1,i._sizers=[],i._items=[],i._handles=[],i._box=null,i._alignment="start",i._orientation="horizontal",i.renderer=r.renderer,r.orientation!==void 0&&(i._orientation=r.orientation),r.alignment!==void 0&&(i._alignment=r.alignment),r.spacing!==void 0&&(i._spacing=zw.clampDimension(r.spacing)),i}return e.prototype.dispose=function(){Ei(this._items,function(r){r.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(r){this._orientation!==r&&(this._orientation=r,this.parent&&(this.parent.dataset.orientation=r,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(r){this._alignment!==r&&(this._alignment=r,this.parent&&(this.parent.dataset.alignment=r,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(r){r=zw.clampDimension(r),this._spacing!==r&&(this._spacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this._handles},enumerable:!0,configurable:!0}),e.prototype.absoluteSizes=function(){return this._sizers.map(function(r){return r.size})},e.prototype.relativeSizes=function(){return id.normalize(this._sizers.map(function(r){return r.size}))},e.prototype.setRelativeSizes=function(r,i){i===void 0&&(i=!0);for(var n=this._sizers.length,o=r.slice(0,n);o.length<n;)o.push(0);for(var s=id.normalize(o),l=0;l<n;++l){var u=this._sizers[l];u.sizeHint=s[l],u.size=s[l]}this._hasNormedSizes=!0,i&&this.parent&&this.parent.update()},e.prototype.moveHandle=function(r,i){var n=this._handles[r];if(!(!n||n.classList.contains("lm-mod-hidden"))){var o;if(this._orientation==="horizontal"?o=i-n.offsetLeft:o=i-n.offsetTop,o!==0){for(var s=0,l=this._sizers;s<l.length;s++){var u=l[s];u.size>0&&(u.sizeHint=u.size)}lu.adjust(this._sizers,r,o),this.parent&&this.parent.update()}}},e.prototype.init=function(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(r,i){var n=new Hw(i),o=id.createHandle(this.renderer),s=id.averageSize(this._sizers),l=id.createSizer(s);rr.insert(this._items,r,n),rr.insert(this._sizers,r,l),rr.insert(this._handles,r,o),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeAttach),this.parent.node.appendChild(i.node),this.parent.node.appendChild(o),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(r,i,n){rr.move(this._items,r,i),rr.move(this._sizers,r,i),rr.move(this._handles,r,i),this.parent.fit()},e.prototype.detachWidget=function(r,i){var n=rr.removeAt(this._items,r),o=rr.removeAt(this._handles,r);rr.removeAt(this._sizers,r),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.node.removeChild(o),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(r){t.prototype.onBeforeShow.call(this,r),this.parent.update()},e.prototype.onBeforeAttach=function(r){t.prototype.onBeforeAttach.call(this,r),this.parent.fit()},e.prototype.onChildShown=function(r){this.parent.fit()},e.prototype.onChildHidden=function(r){this.parent.fit()},e.prototype.onResize=function(r){this.parent.isVisible&&this._update(r.width,r.height)},e.prototype.onUpdateRequest=function(r){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(r){this.parent.isAttached&&this._fit()},e.prototype.updateItemPosition=function(r,i,n,o,s,l,u){var h=this._items[r];if(!h.isHidden){var v=this._handles[r].style;i?(n+=this.widgetOffset,h.update(n,o,u,s),n+=u,v.top=o+"px",v.left=n+"px",v.width=this._spacing+"px",v.height=s+"px"):(o+=this.widgetOffset,h.update(n,o,l,u),o+=u,v.top=o+"px",v.left=n+"px",v.width=l+"px",v.height=this._spacing+"px")}},e.prototype._fit=function(){for(var r=0,i=-1,n=0,o=this._items.length;n<o;++n)this._items[n].isHidden?(this._handles[n].classList.add("lm-mod-hidden"),this._handles[n].classList.add("p-mod-hidden")):(this._handles[n].classList.remove("lm-mod-hidden"),this._handles[n].classList.remove("p-mod-hidden"),i=n,r++);i!==-1&&(this._handles[i].classList.add("lm-mod-hidden"),this._handles[i].classList.add("p-mod-hidden")),this._fixed=this._spacing*Math.max(0,r-1)+this.widgetOffset*this._items.length;for(var s=this._orientation==="horizontal",l=s?this._fixed:0,u=s?0:this._fixed,n=0,o=this._items.length;n<o;++n){var h=this._items[n],v=this._sizers[n];if(v.size>0&&(v.sizeHint=v.size),h.isHidden){v.minSize=0,v.maxSize=0;continue}h.fit(),v.stretch=e.getStretch(h.widget),s?(v.minSize=h.minWidth,v.maxSize=h.maxWidth,l+=h.minWidth,u=Math.max(u,h.minHeight)):(v.minSize=h.minHeight,v.maxSize=h.maxHeight,u+=h.minHeight,l=Math.max(l,h.minWidth))}var T=this._box=ho.boxSizing(this.parent.node);l+=T.horizontalSum,u+=T.verticalSum;var E=this.parent.node.style;E.minWidth=l+"px",E.minHeight=u+"px",this._dirty=!0,this.parent.parent&&xr.sendMessage(this.parent.parent,Br.Msg.FitRequest),this._dirty&&xr.sendMessage(this.parent,Br.Msg.UpdateRequest)},e.prototype._update=function(r,i){this._dirty=!1;for(var n=0,o=0,s=this._items.length;o<s;++o)n+=+!this._items[o].isHidden;if(!(n===0&&this.widgetOffset===0)){r<0&&(r=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=ho.boxSizing(this.parent.node));var l=this._box.paddingTop,u=this._box.paddingLeft,h=r-this._box.horizontalSum,v=i-this._box.verticalSum,T=0,E=0,M=this._orientation==="horizontal";if(n>0){var O=void 0;if(M?O=Math.max(0,h-this._fixed):O=Math.max(0,v-this._fixed),this._hasNormedSizes){for(var F=0,z=this._sizers;F<z.length;F++){var W=z[F];W.sizeHint*=O}this._hasNormedSizes=!1}var J=lu.calc(this._sizers,O);if(J>0)switch(this._alignment){case"start":break;case"center":T=0,E=J/2;break;case"end":T=0,E=J;break;case"justify":T=J/n,E=0;break;default:throw"unreachable"}}for(var o=0,s=this._items.length;o<s;++o){var K=this._items[o],ne=K.isHidden?0:this._sizers[o].size+T;this.updateItemPosition(o,M,M?u+E:u,M?l:l+E,v,h,ne);var ge=this.widgetOffset+(this._handles[o].classList.contains("lm-mod-hidden")?0:this._spacing);M?u+=ne+ge:l+=ne+ge}}},e}(QI);(function(t){function e(i){return id.stretchProperty.get(i)}t.getStretch=e;function r(i,n){id.stretchProperty.set(i,n)}t.setStretch=r})(Xg||(Xg={}));var id;(function(t){t.stretchProperty=new lc({name:"stretch",create:function(){return 0},coerce:function(s,l){return Math.max(0,Math.floor(l))},changed:o});function e(s){var l=new CA;return l.sizeHint=Math.floor(s),l}t.createSizer=e;function r(s){var l=s.createHandle();return l.style.position="absolute",l}t.createHandle=r;function i(s){return s.reduce(function(l,u){return l+u.size},0)/s.length||0}t.averageSize=i;function n(s){var l=s.length;if(l===0)return[];var u=s.reduce(function(h,v){return h+Math.abs(v)},0);return u===0?s.map(function(h){return 1/l}):s.map(function(h){return h/u})}t.normalize=n;function o(s){s.parent&&s.parent.layout instanceof Xg&&s.parent.fit()}})(id||(id={}));var YMe=function(t){ks(e,t);function e(r){var i=t.call(this,ol(ol({},r),{orientation:r.orientation||"vertical"}))||this;return i._titles=[],i.titleSpace=r.titleSpace||22,i}return Object.defineProperty(e.prototype,"titleSpace",{get:function(){return this.widgetOffset},set:function(r){r=Vw.clampDimension(r),this.widgetOffset!==r&&(this.widgetOffset=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.isDisposed||(this._titles.length=0,t.prototype.dispose.call(this))},e.prototype.updateTitle=function(r,i){var n=this._titles[r],o=n.classList.contains("lm-mod-expanded"),s=YI.createTitle(this.renderer,i.title,o);this._titles[r]=s,this.parent.node.replaceChild(s,n)},e.prototype.attachWidget=function(r,i){var n=YI.createTitle(this.renderer,i.title);rr.insert(this._titles,r,n),this.parent.node.appendChild(n),i.node.setAttribute("role","region"),i.node.setAttribute("aria-labelledby",n.id),t.prototype.attachWidget.call(this,r,i)},e.prototype.moveWidget=function(r,i,n){rr.move(this._titles,r,i),t.prototype.moveWidget.call(this,r,i,n)},e.prototype.detachWidget=function(r,i){var n=rr.removeAt(this._titles,r);this.parent.node.removeChild(n),t.prototype.detachWidget.call(this,r,i)},e.prototype.updateItemPosition=function(r,i,n,o,s,l,u){var h=this._titles[r].style;h.top=o+"px",h.left=n+"px",h.height=this.widgetOffset+"px",i?h.width=s+"px":h.width=l+"px",t.prototype.updateItemPosition.call(this,r,i,n,o,s,l,u)},e}(Xg),YI;(function(t){function e(r,i,n){n===void 0&&(n=!0);var o=r.createSectionTitle(i);return o.style.position="absolute",o.setAttribute("aria-label",i.label+" Section"),o.setAttribute("aria-expanded",n?"true":"false"),o.setAttribute("aria-controls",i.owner.id),n&&o.classList.add("lm-mod-expanded"),o}t.createTitle=e})(YI||(YI={}));var Gw=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this)||this;return i.addClass("lm-Panel"),i.addClass("p-Panel"),i.layout=rk.createLayout(r),i}return Object.defineProperty(e.prototype,"widgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(r){this.layout.addWidget(r)},e.prototype.insertWidget=function(r,i){this.layout.insertWidget(r,i)},e}(Br),rk;(function(t){function e(r){return r.layout||new QI}t.createLayout=e})(rk||(rk={}));var jw=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{layout:ik.createLayout(r)})||this;return i._handleMoved=new Wn(i),i._pressData=null,i.addClass("lm-SplitPanel"),i.addClass("p-SplitPanel"),i}return e.prototype.dispose=function(){this._releaseMouse(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"orientation",{get:function(){return this.layout.orientation},set:function(r){this.layout.orientation=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(r){this.layout.alignment=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(r){this.layout.spacing=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handleMoved",{get:function(){return this._handleMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handles",{get:function(){return this.layout.handles},enumerable:!0,configurable:!0}),e.prototype.relativeSizes=function(){return this.layout.relativeSizes()},e.prototype.setRelativeSizes=function(r,i){i===void 0&&(i=!0),this.layout.setRelativeSizes(r,i)},e.prototype.handleEvent=function(r){switch(r.type){case"mousedown":this._evtMouseDown(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseup":this._evtMouseUp(r);break;case"pointerdown":this._evtMouseDown(r);break;case"pointermove":this._evtMouseMove(r);break;case"pointerup":this._evtMouseUp(r);break;case"keydown":this._evtKeyDown(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this)},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()},e.prototype.onChildAdded=function(r){r.child.addClass("lm-SplitPanel-child"),r.child.addClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype.onChildRemoved=function(r){r.child.removeClass("lm-SplitPanel-child"),r.child.removeClass("p-SplitPanel-child"),this._releaseMouse()},e.prototype._evtKeyDown=function(r){this._pressData&&(r.preventDefault(),r.stopPropagation()),r.keyCode===27&&this._releaseMouse()},e.prototype._evtMouseDown=function(r){if(r.button===0){var i=this.layout,n=rr.findFirstIndex(i.handles,function(v){return v.contains(r.target)});if(n!==-1){r.preventDefault(),r.stopPropagation(),document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);var o,s=i.handles[n],l=s.getBoundingClientRect();i.orientation==="horizontal"?o=r.clientX-l.left:o=r.clientY-l.top;var u=window.getComputedStyle(s),h=EA.overrideCursor(u.cursor);this._pressData={index:n,delta:o,override:h}}}},e.prototype._evtMouseMove=function(r){r.preventDefault(),r.stopPropagation();var i,n=this.layout,o=this.node.getBoundingClientRect();n.orientation==="horizontal"?i=r.clientX-o.left-this._pressData.delta:i=r.clientY-o.top-this._pressData.delta,n.moveHandle(this._pressData.index,i)},e.prototype._evtMouseUp=function(r){r.button===0&&(r.preventDefault(),r.stopPropagation(),this._releaseMouse())},e.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))},e}(Gw);(function(t){var e=function(){function n(){}return n.prototype.createHandle=function(){var o=document.createElement("div");return o.className="lm-SplitPanel-handle",o.classList.add("p-SplitPanel-handle"),o},n}();t.Renderer=e,t.defaultRenderer=new e;function r(n){return Xg.getStretch(n)}t.getStretch=r;function i(n,o){Xg.setStretch(n,o)}t.setStretch=i})(jw||(jw={}));var ik;(function(t){function e(r){return r.layout||new Xg({renderer:r.renderer||jw.defaultRenderer,orientation:r.orientation,alignment:r.alignment,spacing:r.spacing})}t.createLayout=e})(ik||(ik={}));var nk=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,ol(ol({},r),{layout:ok.createLayout(r)}))||this;return i._widgetSizesCache=new WeakMap,i.addClass("lm-AccordionPanel"),i}return Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titleSpace",{get:function(){return this.layout.titleSpace},set:function(r){this.layout.titleSpace=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this.layout.titles},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(r){t.prototype.addWidget.call(this,r),r.title.changed.connect(this._onTitleChanged,this)},e.prototype.collapse=function(r){var i=this.layout.widgets[r];i&&!i.isHidden&&this._toggleExpansion(r)},e.prototype.expand=function(r){var i=this.layout.widgets[r];i&&i.isHidden&&this._toggleExpansion(r)},e.prototype.insertWidget=function(r,i){t.prototype.insertWidget.call(this,r,i),i.title.changed.connect(this._onTitleChanged,this)},e.prototype.handleEvent=function(r){switch(t.prototype.handleEvent.call(this,r),r.type){case"click":this._evtClick(r);break;case"keydown":this._eventKeyDown(r);break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),t.prototype.onBeforeAttach.call(this,r)},e.prototype.onAfterDetach=function(r){t.prototype.onAfterDetach.call(this,r),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)},e.prototype._onTitleChanged=function(r){var i=rr.findFirstIndex(this.widgets,function(n){return n.contains(r.owner)});i>=0&&(this.layout.updateTitle(i,r.owner),this.update())},e.prototype._computeWidgetSize=function(r){var i=this.layout,n=i.widgets[r];if(n){var o=n.isHidden,s=i.absoluteSizes(),l=(o?-1:1)*this.spacing,u=s.reduce(function(M,O){return M+O}),h=XMe(s);if(o){var E=this._widgetSizesCache.get(n);if(!E)return;h[r]+=E;var T=h.map(function(O){return O-E>0}).lastIndexOf(!0);T===-1?h.forEach(function(O,F){F!==r&&(h[F]-=s[F]/u*(E-l))}):h[T]-=E-l}else{var v=s[r];this._widgetSizesCache.set(n,v),h[r]=0;var T=h.map(function(M){return M>0}).lastIndexOf(!0);if(T===-1)return;h[T]=s[T]+v+l}return h.map(function(M){return M/(u+l)})}},e.prototype._evtClick=function(r){var i=r.target;if(i){var n=rr.findFirstIndex(this.titles,function(o){return o.contains(i)});n>=0&&(r.preventDefault(),r.stopPropagation(),this._toggleExpansion(n))}},e.prototype._eventKeyDown=function(r){if(!r.defaultPrevented){var i=r.target,n=!1;if(i){var o=rr.findFirstIndex(this.titles,function(v){return v.contains(i)});if(o>=0){var s=r.keyCode.toString();if(r.key.match(/Space|Enter/)||s.match(/13|32/))i.click(),n=!0;else if(this.orientation==="horizontal"?r.key.match(/ArrowLeft|ArrowRight/)||s.match(/37|39/):r.key.match(/ArrowUp|ArrowDown/)||s.match(/38|40/)){var l=r.key.match(/ArrowLeft|ArrowUp/)||s.match(/37|38/)?-1:1,u=this.titles.length,h=(o+u+l)%u;this.titles[h].focus(),n=!0}else r.key==="End"||s==="35"?(this.titles[this.titles.length-1].focus(),n=!0):(r.key==="Home"||s==="36")&&(this.titles[0].focus(),n=!0)}n&&r.preventDefault()}}},e.prototype._toggleExpansion=function(r){var i=this.titles[r],n=this.layout.widgets[r],o=this._computeWidgetSize(r);o&&this.setRelativeSizes(o,!1),n.isHidden?(i.classList.add("lm-mod-expanded"),i.setAttribute("aria-expanded","true"),n.show()):(i.classList.remove("lm-mod-expanded"),i.setAttribute("aria-expanded","false"),n.hide())},e}(jw);(function(t){var e=function(r){ks(i,r);function i(){var n=r.call(this)||this;return n.titleClassName="lm-AccordionPanel-title",n._titleID=0,n._titleKeys=new WeakMap,n._uuid=++i._nInstance,n}return i.prototype.createCollapseIcon=function(n){return document.createElement("span")},i.prototype.createSectionTitle=function(n){var o=document.createElement("h3");o.setAttribute("role","button"),o.setAttribute("tabindex","0"),o.id=this.createTitleKey(n),o.className=this.titleClassName;for(var s in n.dataset)o.dataset[s]=n.dataset[s];var l=o.appendChild(this.createCollapseIcon(n));l.className="lm-AccordionPanel-titleCollapser";var u=o.appendChild(document.createElement("span"));return u.className="lm-AccordionPanel-titleLabel",u.textContent=n.label,u.title=n.caption||n.label,o},i.prototype.createTitleKey=function(n){var o=this._titleKeys.get(n);return o===void 0&&(o="title-key-"+this._uuid+"-"+this._titleID++,this._titleKeys.set(n,o)),o},i._nInstance=0,i}(jw.Renderer);t.Renderer=e,t.defaultRenderer=new e})(nk||(nk={}));var ok;(function(t){function e(r){return r.layout||new YMe({renderer:r.renderer||nk.defaultRenderer,orientation:r.orientation,alignment:r.alignment,spacing:r.spacing,titleSpace:r.titleSpace})}t.createLayout=e})(ok||(ok={}));var Gf=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this)||this;return i._fixed=0,i._spacing=4,i._dirty=!1,i._sizers=[],i._items=[],i._box=null,i._alignment="start",i._direction="top-to-bottom",r.direction!==void 0&&(i._direction=r.direction),r.alignment!==void 0&&(i._alignment=r.alignment),r.spacing!==void 0&&(i._spacing=Vw.clampDimension(r.spacing)),i}return e.prototype.dispose=function(){Ei(this._items,function(r){r.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"direction",{get:function(){return this._direction},set:function(r){this._direction!==r&&(this._direction=r,this.parent&&(this.parent.dataset.direction=r,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(r){this._alignment!==r&&(this._alignment=r,this.parent&&(this.parent.dataset.alignment=r,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(r){r=Vw.clampDimension(r),this._spacing!==r&&(this._spacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,t.prototype.init.call(this)},e.prototype.attachWidget=function(r,i){rr.insert(this._items,r,new Hw(i)),rr.insert(this._sizers,r,new CA),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeAttach),this.parent.node.appendChild(i.node),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(r,i,n){rr.move(this._items,r,i),rr.move(this._sizers,r,i),this.parent.update()},e.prototype.detachWidget=function(r,i){var n=rr.removeAt(this._items,r);rr.removeAt(this._sizers,r),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterDetach),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(r){t.prototype.onBeforeShow.call(this,r),this.parent.update()},e.prototype.onBeforeAttach=function(r){t.prototype.onBeforeAttach.call(this,r),this.parent.fit()},e.prototype.onChildShown=function(r){this.parent.fit()},e.prototype.onChildHidden=function(r){this.parent.fit()},e.prototype.onResize=function(r){this.parent.isVisible&&this._update(r.width,r.height)},e.prototype.onUpdateRequest=function(r){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(r){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var r=0,i=0,n=this._items.length;i<n;++i)r+=+!this._items[i].isHidden;this._fixed=this._spacing*Math.max(0,r-1);for(var o=Wg.isHorizontal(this._direction),s=o?this._fixed:0,l=o?0:this._fixed,i=0,n=this._items.length;i<n;++i){var u=this._items[i],h=this._sizers[i];if(u.isHidden){h.minSize=0,h.maxSize=0;continue}u.fit(),h.sizeHint=e.getSizeBasis(u.widget),h.stretch=e.getStretch(u.widget),o?(h.minSize=u.minWidth,h.maxSize=u.maxWidth,s+=u.minWidth,l=Math.max(l,u.minHeight)):(h.minSize=u.minHeight,h.maxSize=u.maxHeight,l+=u.minHeight,s=Math.max(s,u.minWidth))}var v=this._box=ho.boxSizing(this.parent.node);s+=v.horizontalSum,l+=v.verticalSum;var T=this.parent.node.style;T.minWidth=s+"px",T.minHeight=l+"px",this._dirty=!0,this.parent.parent&&xr.sendMessage(this.parent.parent,Br.Msg.FitRequest),this._dirty&&xr.sendMessage(this.parent,Br.Msg.UpdateRequest)},e.prototype._update=function(r,i){this._dirty=!1;for(var n=0,o=0,s=this._items.length;o<s;++o)n+=+!this._items[o].isHidden;if(n!==0){r<0&&(r=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=ho.boxSizing(this.parent.node));var l=this._box.paddingTop,u=this._box.paddingLeft,h=r-this._box.horizontalSum,v=i-this._box.verticalSum,T;switch(this._direction){case"left-to-right":T=lu.calc(this._sizers,Math.max(0,h-this._fixed));break;case"top-to-bottom":T=lu.calc(this._sizers,Math.max(0,v-this._fixed));break;case"right-to-left":T=lu.calc(this._sizers,Math.max(0,h-this._fixed)),u+=h;break;case"bottom-to-top":T=lu.calc(this._sizers,Math.max(0,v-this._fixed)),l+=v;break;default:throw"unreachable"}var E=0,M=0;if(T>0)switch(this._alignment){case"start":break;case"center":E=0,M=T/2;break;case"end":E=0,M=T;break;case"justify":E=T/n,M=0;break;default:throw"unreachable"}for(var o=0,s=this._items.length;o<s;++o){var O=this._items[o];if(!O.isHidden){var F=this._sizers[o].size;switch(this._direction){case"left-to-right":O.update(u+M,l,F+E,v),u+=F+E+this._spacing;break;case"top-to-bottom":O.update(u,l+M,h,F+E),l+=F+E+this._spacing;break;case"right-to-left":O.update(u-M-F-E,l,F+E,v),u-=F+E+this._spacing;break;case"bottom-to-top":O.update(u,l-M-F-E,h,F+E),l-=F+E+this._spacing;break;default:throw"unreachable"}}}}},e}(QI);(function(t){function e(o){return Wg.stretchProperty.get(o)}t.getStretch=e;function r(o,s){Wg.stretchProperty.set(o,s)}t.setStretch=r;function i(o){return Wg.sizeBasisProperty.get(o)}t.getSizeBasis=i;function n(o,s){Wg.sizeBasisProperty.set(o,s)}t.setSizeBasis=n})(Gf||(Gf={}));var Wg;(function(t){t.stretchProperty=new lc({name:"stretch",create:function(){return 0},coerce:function(n,o){return Math.max(0,Math.floor(o))},changed:i}),t.sizeBasisProperty=new lc({name:"sizeBasis",create:function(){return 0},coerce:function(n,o){return Math.max(0,Math.floor(o))},changed:i});function e(n){return n==="left-to-right"||n==="right-to-left"}t.isHorizontal=e;function r(n){return Math.max(0,Math.floor(n))}t.clampSpacing=r;function i(n){n.parent&&n.parent.layout instanceof Gf&&n.parent.fit()}})(Wg||(Wg={}));var kee=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{layout:sk.createLayout(r)})||this;return i.addClass("lm-BoxPanel"),i.addClass("p-BoxPanel"),i}return Object.defineProperty(e.prototype,"direction",{get:function(){return this.layout.direction},set:function(r){this.layout.direction=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(r){this.layout.alignment=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(r){this.layout.spacing=r},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(r){r.child.addClass("lm-BoxPanel-child"),r.child.addClass("p-BoxPanel-child")},e.prototype.onChildRemoved=function(r){r.child.removeClass("lm-BoxPanel-child"),r.child.removeClass("p-BoxPanel-child")},e}(Gw);(function(t){function e(o){return Gf.getStretch(o)}t.getStretch=e;function r(o,s){Gf.setStretch(o,s)}t.setStretch=r;function i(o){return Gf.getSizeBasis(o)}t.getSizeBasis=i;function n(o,s){Gf.setSizeBasis(o,s)}t.setSizeBasis=n})(kee||(kee={}));var sk;(function(t){function e(r){return r.layout||new Gf(r)}t.createLayout=e})(sk||(sk={}));var Uee=function(t){ks(e,t);function e(r){var i=t.call(this,{node:rd.createNode()})||this;return i._activeIndex=-1,i._items=[],i._results=null,i.addClass("lm-CommandPalette"),i.addClass("p-CommandPalette"),i.setFlag(Br.Flag.DisallowLayout),i.commands=r.commands,i.renderer=r.renderer||e.defaultRenderer,i.commands.commandChanged.connect(i._onGenericChange,i),i.commands.keyBindingChanged.connect(i._onGenericChange,i),i}return e.prototype.dispose=function(){this._items.length=0,this._results=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"searchNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.addItem=function(r){var i=rd.createItem(this.commands,r);return this._items.push(i),this.refresh(),i},e.prototype.addItems=function(r){var i=this,n=r.map(function(o){return rd.createItem(i.commands,o)});return n.forEach(function(o){return i._items.push(o)}),this.refresh(),n},e.prototype.removeItem=function(r){this.removeItemAt(this._items.indexOf(r))},e.prototype.removeItemAt=function(r){var i=rr.removeAt(this._items,r);i&&this.refresh()},e.prototype.clearItems=function(){this._items.length!==0&&(this._items.length=0,this.refresh())},e.prototype.refresh=function(){if(this._results=null,this.inputNode.value!==""){var r=this.node.getElementsByClassName("lm-close-icon")[0];r.style.display="inherit"}else{var r=this.node.getElementsByClassName("lm-close-icon")[0];r.style.display="none"}this.update()},e.prototype.handleEvent=function(r){switch(r.type){case"click":this._evtClick(r);break;case"keydown":this._evtKeyDown(r);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused();break}},e.prototype.onBeforeAttach=function(r){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)},e.prototype.onAfterDetach=function(r){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)},e.prototype.onActivateRequest=function(r){if(this.isAttached){var i=this.inputNode;i.focus(),i.select()}},e.prototype.onUpdateRequest=function(r){var i=this.inputNode.value,n=this.contentNode,o=this._results;if(o||(o=this._results=rd.search(this._items,i),this._activeIndex=i?rr.findFirstIndex(o,rd.canActivate):-1),!i&&o.length===0){td.render(null,n);return}if(i&&o.length===0){var s=this.renderer.renderEmptyMessage({query:i});td.render(s,n);return}for(var l=this.renderer,u=this._activeIndex,h=new Array(o.length),v=0,T=o.length;v<T;++v){var E=o[v];if(E.type==="header"){var M=E.indices,O=E.category;h[v]=l.renderHeader({category:O,indices:M})}else{var F=E.item,M=E.indices,z=v===u;h[v]=l.renderItem({item:F,indices:M,active:z})}}if(td.render(h,n),u<0||u>=o.length)n.scrollTop=0;else{var W=n.children[u];ho.scrollIntoViewIfNeeded(n,W)}},e.prototype._evtClick=function(r){if(r.button===0){if(r.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}var i=rr.findFirstIndex(this.contentNode.children,function(n){return n.contains(r.target)});i!==-1&&(r.preventDefault(),r.stopPropagation(),this._execute(i))}},e.prototype._evtKeyDown=function(r){if(!(r.altKey||r.ctrlKey||r.metaKey||r.shiftKey))switch(r.keyCode){case 13:r.preventDefault(),r.stopPropagation(),this._execute(this._activeIndex);break;case 38:r.preventDefault(),r.stopPropagation(),this._activatePreviousItem();break;case 40:r.preventDefault(),r.stopPropagation(),this._activateNextItem();break}},e.prototype._activateNextItem=function(){if(!(!this._results||this._results.length===0)){var r=this._activeIndex,i=this._results.length,n=r<i-1?r+1:0,o=n===0?i-1:n-1;this._activeIndex=rr.findFirstIndex(this._results,rd.canActivate,n,o),this.update()}},e.prototype._activatePreviousItem=function(){if(!(!this._results||this._results.length===0)){var r=this._activeIndex,i=this._results.length,n=r<=0?i-1:r-1,o=n===i-1?0:n+1;this._activeIndex=rr.findLastIndex(this._results,rd.canActivate,n,o),this.update()}},e.prototype._execute=function(r){if(this._results){var i=this._results[r];if(i){if(i.type==="header"){var n=this.inputNode;n.value=i.category.toLowerCase()+" ",n.focus(),this.refresh();return}i.item.isEnabled&&(this.commands.execute(i.item.command,i.item.args),this.inputNode.value="",this.refresh())}}},e.prototype._toggleFocused=function(){var r=document.activeElement===this.inputNode;this.toggleClass("lm-mod-focused",r),this.toggleClass("p-mod-focused",r)},e.prototype._onGenericChange=function(){this.refresh()},e}(Br);(function(t){var e=function(){function r(){}return r.prototype.renderHeader=function(i){var n=this.formatHeader(i);return so.li({className:"lm-CommandPalette-header p-CommandPalette-header"},n)},r.prototype.renderItem=function(i){var n=this.createItemClass(i),o=this.createItemDataset(i);return i.item.isToggleable?so.li({className:n,dataset:o,role:"checkbox","aria-checked":""+i.item.isToggled},this.renderItemIcon(i),this.renderItemContent(i),this.renderItemShortcut(i)):so.li({className:n,dataset:o},this.renderItemIcon(i),this.renderItemContent(i),this.renderItemShortcut(i))},r.prototype.renderEmptyMessage=function(i){var n=this.formatEmptyMessage(i);return so.li({className:"lm-CommandPalette-emptyMessage p-CommandPalette-emptyMessage"},n)},r.prototype.renderItemIcon=function(i){var n=this.createIconClass(i);return typeof i.item.icon=="string"?so.div({className:n},i.item.iconLabel):so.div({className:n},i.item.icon,i.item.iconLabel)},r.prototype.renderItemContent=function(i){return so.div({className:"lm-CommandPalette-itemContent p-CommandPalette-itemContent"},this.renderItemLabel(i),this.renderItemCaption(i))},r.prototype.renderItemLabel=function(i){var n=this.formatItemLabel(i);return so.div({className:"lm-CommandPalette-itemLabel p-CommandPalette-itemLabel"},n)},r.prototype.renderItemCaption=function(i){var n=this.formatItemCaption(i);return so.div({className:"lm-CommandPalette-itemCaption p-CommandPalette-itemCaption"},n)},r.prototype.renderItemShortcut=function(i){var n=this.formatItemShortcut(i);return so.div({className:"lm-CommandPalette-itemShortcut p-CommandPalette-itemShortcut"},n)},r.prototype.createItemClass=function(i){var n="lm-CommandPalette-item";n+=" p-CommandPalette-item",i.item.isEnabled||(n+=" lm-mod-disabled",n+=" p-mod-disabled"),i.item.isToggled&&(n+=" lm-mod-toggled",n+=" p-mod-toggled"),i.active&&(n+=" lm-mod-active",n+=" p-mod-active");var o=i.item.className;return o&&(n+=" "+o),n},r.prototype.createItemDataset=function(i){return ol(ol({},i.item.dataset),{command:i.item.command})},r.prototype.createIconClass=function(i){var n="lm-CommandPalette-itemIcon";n+=" p-CommandPalette-itemIcon";var o=i.item.iconClass;return o?n+" "+o:n},r.prototype.formatHeader=function(i){return!i.indices||i.indices.length===0?i.category:tv.highlight(i.category,i.indices,so.mark)},r.prototype.formatEmptyMessage=function(i){return"No commands found that match '"+i.query+"'"},r.prototype.formatItemShortcut=function(i){var n=i.item.keyBinding;return n?ov.formatKeystroke(n.keys):null},r.prototype.formatItemLabel=function(i){return!i.indices||i.indices.length===0?i.item.label:tv.highlight(i.item.label,i.indices,so.mark)},r.prototype.formatItemCaption=function(i){return i.item.caption},r}();t.Renderer=e,t.defaultRenderer=new e})(Uee||(Uee={}));var rd;(function(t){function e(){var E=document.createElement("div"),M=document.createElement("div"),O=document.createElement("div"),F=document.createElement("input"),z=document.createElement("ul"),W=document.createElement("button");return M.className="lm-CommandPalette-search",O.className="lm-CommandPalette-wrapper",F.className="lm-CommandPalette-input",W.className="lm-close-icon",z.className="lm-CommandPalette-content",M.classList.add("p-CommandPalette-search"),O.classList.add("p-CommandPalette-wrapper"),F.classList.add("p-CommandPalette-input"),z.classList.add("p-CommandPalette-content"),F.spellcheck=!1,O.appendChild(F),O.appendChild(W),M.appendChild(O),E.appendChild(M),E.appendChild(z),E}t.createNode=e;function r(E,M){return new T(E,M)}t.createItem=r;function i(E,M){var O=l(E,M);return O.sort(h),v(O)}t.search=i;function n(E){return E.type==="item"&&E.item.isEnabled}t.canActivate=n;function o(E){return E.trim().replace(/\s+/g," ")}function s(E){return E.replace(/\s+/g,"").toLowerCase()}function l(E,M){M=s(M);for(var O=[],F=0,z=E.length;F<z;++F){var W=E[F];if(W.isVisible){if(!M){O.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:W});continue}var J=u(W,M);J&&(W.isEnabled||(J.score+=1e3),O.push(J))}}return O}function u(E,M){for(var O=E.category.toLowerCase(),F=E.label.toLowerCase(),z=O+" "+F,W=1/0,J=null,K=/\b\w/g;;){var ne=K.exec(z);if(!ne)break;var ge=tv.matchSumOfDeltas(z,M,ne.index);if(!ge)break;ge&&ge.score<=W&&(W=ge.score,J=ge.indices)}if(!J||W===1/0)return null;for(var H=O.length+1,me=rr.lowerBound(J,H,function(Oe,he){return Oe-he}),fe=J.slice(0,me),$=J.slice(me),Z=0,we=$.length;Z<we;++Z)$[Z]-=H;return fe.length===0?{matchType:0,categoryIndices:null,labelIndices:$,score:W,item:E}:$.length===0?{matchType:1,categoryIndices:fe,labelIndices:null,score:W,item:E}:{matchType:2,categoryIndices:fe,labelIndices:$,score:W,item:E}}function h(E,M){var O=E.matchType-M.matchType;if(O!==0)return O;var F=E.score-M.score;if(F!==0)return F;var z=0,W=0;switch(E.matchType){case 0:z=E.labelIndices[0],W=M.labelIndices[0];break;case 1:case 2:z=E.categoryIndices[0],W=M.categoryIndices[0];break}if(z!==W)return z-W;var J=E.item.category.localeCompare(M.item.category);if(J!==0)return J;var K=E.item.rank,ne=M.item.rank;return K!==ne?K<ne?-1:1:E.item.label.localeCompare(M.item.label)}function v(E){var M=new Array(E.length);rr.fill(M,!1);for(var O=[],F=0,z=E.length;F<z;++F)if(!M[F]){var W=E[F],J=W.item,K=W.categoryIndices,ne=J.category;O.push({type:"header",category:ne,indices:K});for(var ge=F;ge<z;++ge)if(!M[ge]){var H=E[ge],me=H.item,fe=H.labelIndices;me.category===ne&&(O.push({type:"item",item:me,indices:fe}),M[ge]=!0)}}return O}var T=function(){function E(M,O){this._commands=M,this.category=o(O.category),this.command=O.command,this.args=O.args||qg.JSONExt.emptyObject,this.rank=O.rank!==void 0?O.rank:1/0}return Object.defineProperty(E.prototype,"label",{get:function(){return this._commands.label(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"icon",{get:function(){return this._commands.icon(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"iconClass",{get:function(){return this._commands.iconClass(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"iconLabel",{get:function(){return this._commands.iconLabel(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"caption",{get:function(){return this._commands.caption(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"className",{get:function(){return this._commands.className(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"dataset",{get:function(){return this._commands.dataset(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"isEnabled",{get:function(){return this._commands.isEnabled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"isToggled",{get:function(){return this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"isToggleable",{get:function(){return this._commands.isToggleable(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"isVisible",{get:function(){return this._commands.isVisible(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"keyBinding",{get:function(){var M=this,O=M.command,F=M.args;return rr.findLastValue(this._commands.keyBindings,function(z){return z.command===O&&qg.JSONExt.deepEqual(z.args,F)})||null},enumerable:!0,configurable:!0}),E}()})(rd||(rd={}));var lv=function(t){ks(e,t);function e(r){var i=t.call(this,{node:uc.createNode()})||this;return i._childIndex=-1,i._activeIndex=-1,i._openTimerID=0,i._closeTimerID=0,i._items=[],i._childMenu=null,i._parentMenu=null,i._aboutToClose=new Wn(i),i._menuRequested=new Wn(i),i.addClass("lm-Menu"),i.addClass("p-Menu"),i.setFlag(Br.Flag.DisallowLayout),i.commands=r.commands,i.renderer=r.renderer||e.defaultRenderer,i}return e.prototype.dispose=function(){this.close(),this._items.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"aboutToClose",{get:function(){return this._aboutToClose},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menuRequested",{get:function(){return this._menuRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentMenu",{get:function(){return this._parentMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rootMenu",{get:function(){for(var r=this;r._parentMenu;)r=r._parentMenu;return r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leafMenu",{get:function(){for(var r=this;r._childMenu;)r=r._childMenu;return r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-Menu-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeItem",{get:function(){return this._items[this._activeIndex]||null},set:function(r){this.activeIndex=r?this._items.indexOf(r):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(r){(r<0||r>=this._items.length)&&(r=-1),r!==-1&&!uc.canActivate(this._items[r])&&(r=-1),this._activeIndex!==r&&(this._activeIndex=r,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),e.prototype.activateNextItem=function(){var r=this._items.length,i=this._activeIndex,n=i<r-1?i+1:0,o=n===0?r-1:n-1;this.activeIndex=rr.findFirstIndex(this._items,uc.canActivate,n,o)},e.prototype.activatePreviousItem=function(){var r=this._items.length,i=this._activeIndex,n=i<=0?r-1:i-1,o=n===r-1?0:n+1;this.activeIndex=rr.findLastIndex(this._items,uc.canActivate,n,o)},e.prototype.triggerActiveItem=function(){if(this.isAttached){var r=this.activeItem;if(r){if(this._cancelOpenTimer(),this._cancelCloseTimer(),r.type==="submenu"){this._openChildMenu(!0);return}this.rootMenu.close();var i=r.command,n=r.args;this.commands.isEnabled(i,n)?this.commands.execute(i,n):console.log("Command '"+i+"' is disabled.")}}},e.prototype.addItem=function(r){return this.insertItem(this._items.length,r)},e.prototype.insertItem=function(r,i){this.isAttached&&this.close(),this.activeIndex=-1;var n=Math.max(0,Math.min(r,this._items.length)),o=uc.createItem(this,i);return rr.insert(this._items,n,o),this.update(),o},e.prototype.removeItem=function(r){this.removeItemAt(this._items.indexOf(r))},e.prototype.removeItemAt=function(r){this.isAttached&&this.close(),this.activeIndex=-1;var i=rr.removeAt(this._items,r);i&&this.update()},e.prototype.clearItems=function(){this.isAttached&&this.close(),this.activeIndex=-1,this._items.length!==0&&(this._items.length=0,this.update())},e.prototype.open=function(r,i,n){if(n===void 0&&(n={}),!this.isAttached){var o=n.forceX||!1,s=n.forceY||!1;uc.openRootMenu(this,r,i,o,s),this.activate()}},e.prototype.handleEvent=function(r){switch(r.type){case"keydown":this._evtKeyDown(r);break;case"mouseup":this._evtMouseUp(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseenter":this._evtMouseEnter(r);break;case"mouseleave":this._evtMouseLeave(r);break;case"mousedown":this._evtMouseDown(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){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)},e.prototype.onAfterDetach=function(r){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)},e.prototype.onActivateRequest=function(r){this.isAttached&&this.node.focus()},e.prototype.onUpdateRequest=function(r){for(var i=this,n=this._items,o=this.renderer,s=this._activeIndex,l=uc.computeCollapsed(n),u=new Array(n.length),h=function(E,M){var O=n[E],F=E===s,z=l[E];u[E]=o.renderItem({item:O,active:F,collapsed:z,onfocus:function(){i.activeIndex=E}})},v=0,T=n.length;v<T;++v)h(v);td.render(u,this.contentNode)},e.prototype.onCloseRequest=function(r){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;var i=this._childMenu;i&&(this._childIndex=-1,this._childMenu=null,i._parentMenu=null,i.close());var n=this._parentMenu;n&&(this._parentMenu=null,n._childIndex=-1,n._childMenu=null,n.activate()),this.isAttached&&this._aboutToClose.emit(void 0),t.prototype.onCloseRequest.call(this,r)},e.prototype._evtKeyDown=function(r){r.preventDefault(),r.stopPropagation();var i=r.keyCode;if(i===13){this.triggerActiveItem();return}if(i===27){this.close();return}if(i===37){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(i===38){this.activatePreviousItem();return}if(i===39){var n=this.activeItem;n&&n.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(i===40){this.activateNextItem();return}var o=nv().keyForKeydownEvent(r);if(o){var s=this._activeIndex+1,l=uc.findMnemonic(this._items,o,s);l.index!==-1&&!l.multiple?(this.activeIndex=l.index,this.triggerActiveItem()):l.index!==-1?this.activeIndex=l.index:l.auto!==-1&&(this.activeIndex=l.auto)}},e.prototype._evtMouseUp=function(r){r.button===0&&(r.preventDefault(),r.stopPropagation(),this.triggerActiveItem())},e.prototype._evtMouseMove=function(r){var i=rr.findFirstIndex(this.contentNode.children,function(o){return ho.hitTest(o,r.clientX,r.clientY)});if(i!==this._activeIndex){if(this.activeIndex=i,i=this.activeIndex,i===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}this._childIndex!==-1&&this._startCloseTimer(),this._cancelOpenTimer();var n=this.activeItem;!n||n.type!=="submenu"||!n.submenu||this._startOpenTimer()}},e.prototype._evtMouseEnter=function(r){for(var i=this._parentMenu;i;i=i._parentMenu)i._cancelOpenTimer(),i._cancelCloseTimer(),i.activeIndex=i._childIndex},e.prototype._evtMouseLeave=function(r){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}var i=r.clientX,n=r.clientY;if(ho.hitTest(this._childMenu.node,i,n)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()},e.prototype._evtMouseDown=function(r){this._parentMenu||(uc.hitTestMenus(this,r.clientX,r.clientY)?(r.preventDefault(),r.stopPropagation()):this.close())},e.prototype._openChildMenu=function(r){r===void 0&&(r=!1);var i=this.activeItem;if(!i||i.type!=="submenu"||!i.submenu){this._closeChildMenu();return}var n=i.submenu;if(n!==this._childMenu){e.saveWindowData(),this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,xr.sendMessage(this,Br.Msg.UpdateRequest);var o=this.contentNode.children[this._activeIndex];uc.openSubmenu(n,o),r&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}},e.prototype._closeChildMenu=function(){this._childMenu&&this._childMenu.close()},e.prototype._startOpenTimer=function(){var r=this;this._openTimerID===0&&(this._openTimerID=window.setTimeout(function(){r._openTimerID=0,r._openChildMenu()},uc.TIMER_DELAY))},e.prototype._startCloseTimer=function(){var r=this;this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(function(){r._closeTimerID=0,r._closeChildMenu()},uc.TIMER_DELAY))},e.prototype._cancelOpenTimer=function(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)},e.prototype._cancelCloseTimer=function(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)},e.saveWindowData=function(){uc.saveWindowData()},e}(Br);(function(t){var e=function(){function r(){}return r.prototype.renderItem=function(i){var n=this.createItemClass(i),o=this.createItemDataset(i),s=this.createItemARIA(i);return so.li(ol({className:n,dataset:o,tabindex:"0",onfocus:i.onfocus},s),this.renderIcon(i),this.renderLabel(i),this.renderShortcut(i),this.renderSubmenu(i))},r.prototype.renderIcon=function(i){var n=this.createIconClass(i);return typeof i.item.icon=="string"?so.div({className:n},i.item.iconLabel):so.div({className:n},i.item.icon,i.item.iconLabel)},r.prototype.renderLabel=function(i){var n=this.formatLabel(i);return so.div({className:"lm-Menu-itemLabel p-Menu-itemLabel"},n)},r.prototype.renderShortcut=function(i){var n=this.formatShortcut(i);return so.div({className:"lm-Menu-itemShortcut p-Menu-itemShortcut"},n)},r.prototype.renderSubmenu=function(i){return so.div({className:"lm-Menu-itemSubmenuIcon p-Menu-itemSubmenuIcon"})},r.prototype.createItemClass=function(i){var n="lm-Menu-item";n+=" p-Menu-item",i.item.isEnabled||(n+=" lm-mod-disabled",n+=" p-mod-disabled"),i.item.isToggled&&(n+=" lm-mod-toggled",n+=" p-mod-toggled"),i.item.isVisible||(n+=" lm-mod-hidden",n+=" p-mod-hidden"),i.active&&(n+=" lm-mod-active",n+=" p-mod-active"),i.collapsed&&(n+=" lm-mod-collapsed",n+=" p-mod-collapsed");var o=i.item.className;return o&&(n+=" "+o),n},r.prototype.createItemDataset=function(i){var n,o=i.item,s=o.type,l=o.command,u=o.dataset;return s==="command"?n=ol(ol({},u),{type:s,command:l}):n=ol(ol({},u),{type:s}),n},r.prototype.createIconClass=function(i){var n="lm-Menu-itemIcon";n+=" p-Menu-itemIcon";var o=i.item.iconClass;return o?n+" "+o:n},r.prototype.createItemARIA=function(i){var n={};switch(i.item.type){case"separator":n.role="presentation";break;case"submenu":n["aria-haspopup"]="true",i.item.isEnabled||(n["aria-disabled"]="true");break;default:i.item.isEnabled||(n["aria-disabled"]="true"),n.role="menuitem"}return n},r.prototype.formatLabel=function(i){var n=i.item,o=n.label,s=n.mnemonic;if(s<0||s>=o.length)return o;var l=o.slice(0,s),u=o.slice(s+1),h=o[s],v=so.span({className:"lm-Menu-itemMnemonic p-Menu-itemMnemonic"},h);return[l,v,u]},r.prototype.formatShortcut=function(i){var n=i.item.keyBinding;return n?ov.formatKeystroke(n.keys):null},r}();t.Renderer=e,t.defaultRenderer=new e})(lv||(lv={}));var uc;(function(t){t.TIMER_DELAY=300,t.SUBMENU_OVERLAP=3;var e=null,r=0;function i(){return r>0?(r--,e):v()}function n(){e=v(),r++}t.saveWindowData=n;function o(){var F=document.createElement("div"),z=document.createElement("ul");return z.className="lm-Menu-content",z.classList.add("p-Menu-content"),F.appendChild(z),z.setAttribute("role","menu"),F.tabIndex=0,F}t.createNode=o;function s(F){return F.type!=="separator"&&F.isEnabled&&F.isVisible}t.canActivate=s;function l(F,z){return new O(F.commands,z)}t.createItem=l;function u(F,z,W){for(var J=F;J;J=J.childMenu)if(ho.hitTest(J.node,z,W))return!0;return!1}t.hitTestMenus=u;function h(F){var z=new Array(F.length);rr.fill(z,!1);for(var W=0,J=F.length;W<J;++W){var K=F[W];if(K.isVisible){if(K.type!=="separator")break;z[W]=!0}}for(var ne=J-1;ne>=0;--ne){var K=F[ne];if(K.isVisible){if(K.type!=="separator")break;z[ne]=!0}}for(var ge=!1;++W<ne;){var K=F[W];K.isVisible&&(K.type!=="separator"?ge=!1:ge?z[W]=!0:ge=!0)}return z}t.computeCollapsed=h;function v(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}function T(F,z,W,J,K){var ne=i(),ge=ne.pageXOffset,H=ne.pageYOffset,me=ne.clientWidth,fe=ne.clientHeight;xr.sendMessage(F,Br.Msg.UpdateRequest);var $=fe-(K?W:0),Z=F.node,we=Z.style;we.opacity="0",we.maxHeight=$+"px",Br.attach(F,document.body);var Oe=Z.getBoundingClientRect(),he=Oe.width,Le=Oe.height;!J&&z+he>ge+me&&(z=ge+me-he),!K&&W+Le>H+fe&&(W>H+fe?W=H+fe-Le:W=W-Le),we.transform="translate("+Math.max(0,z)+"px, "+Math.max(0,W)+"px",we.opacity="1"}t.openRootMenu=T;function E(F,z){var W=i(),J=W.pageXOffset,K=W.pageYOffset,ne=W.clientWidth,ge=W.clientHeight;xr.sendMessage(F,Br.Msg.UpdateRequest);var H=ge,me=F.node,fe=me.style;fe.opacity="0",fe.maxHeight=H+"px",Br.attach(F,document.body);var $=me.getBoundingClientRect(),Z=$.width,we=$.height,Oe=ho.boxSizing(F.node),he=z.getBoundingClientRect(),Le=he.right-t.SUBMENU_OVERLAP;Le+Z>J+ne&&(Le=he.left+t.SUBMENU_OVERLAP-Z);var ft=he.top-Oe.borderTop-Oe.paddingTop;ft+we>K+ge&&(ft=he.bottom+Oe.borderBottom+Oe.paddingBottom-we),fe.transform="translate("+Math.max(0,Le)+"px, "+Math.max(0,ft)+"px",fe.opacity="1"}t.openSubmenu=E;function M(F,z,W){for(var J=-1,K=-1,ne=!1,ge=z.toUpperCase(),H=0,me=F.length;H<me;++H){var fe=(H+W)%me,$=F[fe];if(s($)){var Z=$.label;if(Z.length!==0){var we=$.mnemonic;if(we>=0&&we<Z.length){Z[we].toUpperCase()===ge&&(J===-1?J=fe:ne=!0);continue}K===-1&&Z[0].toUpperCase()===ge&&(K=fe)}}}return{index:J,multiple:ne,auto:K}}t.findMnemonic=M;var O=function(){function F(z,W){this._commands=z,this.type=W.type||"command",this.command=W.command||"",this.args=W.args||qg.JSONExt.emptyObject,this.submenu=W.submenu||null}return Object.defineProperty(F.prototype,"label",{get:function(){return this.type==="command"?this._commands.label(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.label:""},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"mnemonic",{get:function(){return this.type==="command"?this._commands.mnemonic(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.mnemonic:-1},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"icon",{get:function(){return this.type==="command"?this._commands.icon(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.icon:this.iconClass},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"iconClass",{get:function(){return this.type==="command"?this._commands.iconClass(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconClass:""},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"iconLabel",{get:function(){return this.type==="command"?this._commands.iconLabel(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconLabel:""},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"caption",{get:function(){return this.type==="command"?this._commands.caption(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.caption:""},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"className",{get:function(){return this.type==="command"?this._commands.className(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.className:""},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"dataset",{get:function(){return this.type==="command"?this._commands.dataset(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.dataset:{}},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"isEnabled",{get:function(){return this.type==="command"?this._commands.isEnabled(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"isToggled",{get:function(){return this.type==="command"?this._commands.isToggled(this.command,this.args):!1},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"isVisible",{get:function(){return this.type==="command"?this._commands.isVisible(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0},enumerable:!0,configurable:!0}),Object.defineProperty(F.prototype,"keyBinding",{get:function(){if(this.type==="command"){var z=this,W=z.command,J=z.args;return rr.findLastValue(this._commands.keyBindings,function(K){return K.command===W&&qg.JSONExt.deepEqual(K.args,J)})||null}return null},enumerable:!0,configurable:!0}),F}()})(uc||(uc={}));var HTt=function(){function t(e){this._groupByTarget=!0,this._idTick=0,this._items=[],this._sortBySelector=!0;var r=e.groupByTarget,i=e.sortBySelector,n=qMe(e,["groupByTarget","sortBySelector"]);this.menu=new lv(n),this._groupByTarget=r!==!1,this._sortBySelector=i!==!1}return t.prototype.addItem=function(e){var r=this,i=KI.createItem(e,this._idTick++);return this._items.push(i),new TA(function(){rr.removeFirstOf(r._items,i)})},t.prototype.open=function(e){var r=this;if(lv.saveWindowData(),this.menu.clearItems(),this._items.length===0)return!1;var i=KI.matchItems(this._items,e,this._groupByTarget,this._sortBySelector);return!i||i.length===0?!1:(Ei(i,function(n){r.menu.addItem(n)}),this.menu.open(e.clientX,e.clientY),!0)},t}(),KI;(function(t){function e(s,l){var u=i(s.selector),h=s.rank!==void 0?s.rank:1/0;return ol(ol({},s),{selector:u,rank:h,id:l})}t.createItem=e;function r(s,l,u,h){var v=l.target;if(!v)return null;var T=l.currentTarget;if(!T||!T.contains(v)&&(v=document.elementFromPoint(l.clientX,l.clientY),!v||!T.contains(v)))return null;for(var E=[],M=s.slice();v!==null;){for(var O=[],F=0,z=M.length;F<z;++F){var W=M[F];W&&Hf.matches(v,W.selector)&&(O.push(W),M[F]=null)}if(O.length!==0&&(u&&O.sort(h?o:n),E.push.apply(E,O)),v===T)break;v=v.parentElement}return u||E.sort(h?o:n),E}t.matchItems=r;function i(s){if(s.indexOf(",")!==-1)throw new Error("Selector cannot contain commas: "+s);if(!Hf.isValid(s))throw new Error("Invalid selector: "+s);return s}function n(s,l){var u=s.rank,h=l.rank;return u!==h?u<h?-1:1:s.id-l.id}function o(s,l){var u=Hf.calculateSpecificity(s.selector),h=Hf.calculateSpecificity(l.selector);return u!==h?h-u:n(s,l)}})(KI||(KI={}));var cv=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{node:Ju.createNode()})||this;return i._currentIndex=-1,i._titles=[],i._titlesEditable=!1,i._previousTitle=null,i._dragData=null,i._addButtonEnabled=!1,i._tabMoved=new Wn(i),i._currentChanged=new Wn(i),i._addRequested=new Wn(i),i._tabCloseRequested=new Wn(i),i._tabDetachRequested=new Wn(i),i._tabActivateRequested=new Wn(i),i.addClass("lm-TabBar"),i.addClass("p-TabBar"),i.contentNode.setAttribute("role","tablist"),i.setFlag(Br.Flag.DisallowLayout),i._document=r.document||document,i.tabsMovable=r.tabsMovable||!1,i.titlesEditable=r.titlesEditable||!1,i.allowDeselect=r.allowDeselect||!1,i.addButtonEnabled=r.addButtonEnabled||!1,i.insertBehavior=r.insertBehavior||"select-tab-if-needed",i.name=r.name||"",i.orientation=r.orientation||"horizontal",i.removeBehavior=r.removeBehavior||"select-tab-after",i.renderer=r.renderer||e.defaultRenderer,i}return e.prototype.dispose=function(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabMoved",{get:function(){return this._tabMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabActivateRequested",{get:function(){return this._tabActivateRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabCloseRequested",{get:function(){return this._tabCloseRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabDetachRequested",{get:function(){return this._tabDetachRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"document",{get:function(){return this._document},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titlesEditable",{get:function(){return this._titlesEditable},set:function(r){this._titlesEditable=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTitle",{get:function(){return this._titles[this._currentIndex]||null},set:function(r){this.currentIndex=r?this._titles.indexOf(r):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this._currentIndex},set:function(r){if((r<0||r>=this._titles.length)&&(r=-1),this._currentIndex!==r){var i=this._currentIndex,n=this._titles[i]||null,o=r,s=this._titles[o]||null;this._currentIndex=o,this._previousTitle=n,this.update(),this._currentChanged.emit({previousIndex:i,previousTitle:n,currentIndex:o,currentTitle:s})}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(r){this._name=r,r?this.contentNode.setAttribute("aria-label",r):this.contentNode.removeAttribute("aria-label")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(r){this._orientation!==r&&(this._releaseMouse(),this._orientation=r,this.dataset.orientation=r,this.contentNode.setAttribute("aria-orientation",r))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(r){this._addButtonEnabled!==r&&(this._addButtonEnabled=r,r?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]},enumerable:!0,configurable:!0}),e.prototype.addTab=function(r){return this.insertTab(this._titles.length,r)},e.prototype.insertTab=function(r,i){this._releaseMouse();var n=Ju.asTitle(i),o=this._titles.indexOf(n),s=Math.max(0,Math.min(r,this._titles.length));return o===-1?(rr.insert(this._titles,s,n),n.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(s,n),n):(s===this._titles.length&&s--,o===s||(rr.move(this._titles,o,s),this.update(),this._adjustCurrentForMove(o,s)),n)},e.prototype.removeTab=function(r){this.removeTabAt(this._titles.indexOf(r))},e.prototype.removeTabAt=function(r){this._releaseMouse();var i=rr.removeAt(this._titles,r);i&&(i.changed.disconnect(this._onTitleChanged,this),i===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(r,i))},e.prototype.clearTabs=function(){if(this._titles.length!==0){this._releaseMouse();for(var r=0,i=this._titles;r<i.length;r++){var n=i[r];n.changed.disconnect(this._onTitleChanged,this)}var o=this.currentIndex,s=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),o!==-1&&this._currentChanged.emit({previousIndex:o,previousTitle:s,currentIndex:-1,currentTitle:null})}},e.prototype.releaseMouse=function(){this._releaseMouse()},e.prototype.handleEvent=function(r){switch(r.type){case"mousedown":this._evtMouseDown(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseup":this._evtMouseUp(r);break;case"pointerdown":this._evtMouseDown(r);break;case"pointermove":this._evtMouseMove(r);break;case"pointerup":this._evtMouseUp(r);break;case"dblclick":this._evtDblClick(r);break;case"keydown":this._evtKeyDown(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this)},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(r){for(var i=this._titles,n=this.renderer,o=this.currentTitle,s=new Array(i.length),l=0,u=i.length;l<u;++l){var h=i[l],v=h===o,T=v?u:u-l-1;s[l]=n.renderTab({title:h,current:v,zIndex:T})}td.render(s,this.contentNode)},e.prototype._evtDblClick=function(r){if(this.titlesEditable){var i=this.contentNode.children,n=rr.findFirstIndex(i,function(T){return ho.hitTest(T,r.clientX,r.clientY)});if(n!==-1){var o=this.titles[n],s=i[n].querySelector(".lm-TabBar-tabLabel");if(s&&s.contains(r.target)){var l=o.label||"",u=s.innerHTML;s.innerHTML="";var h=document.createElement("input");h.classList.add("lm-TabBar-tabInput"),h.value=l,s.appendChild(h);var v=function(){h.removeEventListener("blur",v),s.innerHTML=u};h.addEventListener("dblclick",function(T){return T.stopPropagation()}),h.addEventListener("blur",v),h.addEventListener("keydown",function(T){T.key==="Enter"?(h.value!==""&&(o.label=o.caption=h.value),v()):T.key==="Escape"&&v()}),h.select(),h.focus(),s.children.length>0&&s.children[0].focus()}}}},e.prototype._evtKeyDown=function(r){r.preventDefault(),r.stopPropagation(),r.keyCode===27&&this._releaseMouse()},e.prototype._evtMouseDown=function(r){if(!(r.button!==0&&r.button!==1)&&!this._dragData){var i=this.addButtonEnabled&&this.addButtonNode.contains(r.target),n=this.contentNode.children,o=rr.findFirstIndex(n,function(l){return ho.hitTest(l,r.clientX,r.clientY)});if(!(o===-1&&!i)&&(r.preventDefault(),r.stopPropagation(),this._dragData={tab:n[o],index:o,pressX:r.clientX,pressY:r.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("mouseup",this,!0),this.document.addEventListener("pointerup",this,!0),!(r.button===1||i))){var s=n[o].querySelector(this.renderer.closeIconSelector);s&&s.contains(r.target)||(this.tabsMovable&&(this.document.addEventListener("mousemove",this,!0),this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===o?this.currentIndex=-1:this.currentIndex=o,this.currentIndex!==-1&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}}},e.prototype._evtMouseMove=function(r){var i=this._dragData;if(i){r.preventDefault(),r.stopPropagation();var n=this.contentNode.children;if(!(!i.dragActive&&!Ju.dragExceeded(i,r))){if(!i.dragActive){var o=i.tab.getBoundingClientRect();this._orientation==="horizontal"?(i.tabPos=i.tab.offsetLeft,i.tabSize=o.width,i.tabPressPos=i.pressX-o.left):(i.tabPos=i.tab.offsetTop,i.tabSize=o.height,i.tabPressPos=i.pressY-o.top),i.tabLayout=Ju.snapTabLayout(n,this._orientation),i.contentRect=this.contentNode.getBoundingClientRect(),i.override=EA.overrideCursor("default"),i.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),i.tab.classList.add("p-mod-dragging"),this.addClass("p-mod-dragging"),i.dragActive=!0}if(!i.detachRequested&&Ju.detachExceeded(i,r)){i.detachRequested=!0;var s=i.index,l=r.clientX,u=r.clientY,h=n[s],v=this._titles[s];if(this._tabDetachRequested.emit({index:s,title:v,tab:h,clientX:l,clientY:u}),i.dragAborted)return}Ju.layoutTabs(n,i,r,this._orientation)}}},e.prototype._evtMouseUp=function(r){var i=this;if(!(r.button!==0&&r.button!==1)){var n=this._dragData;if(n){if(r.preventDefault(),r.stopPropagation(),this.document.removeEventListener("mousemove",this,!0),this.document.removeEventListener("mouseup",this,!0),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!n.dragActive){this._dragData=null;var o=this.addButtonEnabled&&this.addButtonNode.contains(r.target);if(o){this._addRequested.emit(void 0);return}var s=this.contentNode.children,l=rr.findFirstIndex(s,function(T){return ho.hitTest(T,r.clientX,r.clientY)});if(l!==n.index)return;var u=this._titles[l];if(!u.closable)return;if(r.button===1){this._tabCloseRequested.emit({index:l,title:u});return}var h=s[l].querySelector(this.renderer.closeIconSelector);if(h&&h.contains(r.target)){this._tabCloseRequested.emit({index:l,title:u});return}return}if(r.button===0){Ju.finalizeTabPosition(n,this._orientation),n.tab.classList.remove("lm-mod-dragging"),n.tab.classList.remove("p-mod-dragging");var v=Ju.parseTransitionDuration(n.tab);setTimeout(function(){if(!n.dragAborted){i._dragData=null,Ju.resetTabPositions(i.contentNode.children,i._orientation),n.override.dispose(),i.removeClass("lm-mod-dragging"),i.removeClass("p-mod-dragging");var T=n.index,E=n.targetIndex;E===-1||T===E||(rr.move(i._titles,T,E),i._adjustCurrentForMove(T,E),i._tabMoved.emit({fromIndex:T,toIndex:E,title:i._titles[E]}),xr.sendMessage(i,Br.Msg.UpdateRequest))}},v)}}}},e.prototype._releaseMouse=function(){var r=this._dragData;r&&(this._dragData=null,this.document.removeEventListener("mousemove",this,!0),this.document.removeEventListener("mouseup",this,!0),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),r.dragAborted=!0,r.dragActive&&(Ju.resetTabPositions(this.contentNode.children,this._orientation),r.override.dispose(),r.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging"),r.tab.classList.remove("p-mod-dragging"),this.removeClass("p-mod-dragging")))},e.prototype._adjustCurrentForInsert=function(r,i){var n=this.currentTitle,o=this._currentIndex,s=this.insertBehavior;if(s==="select-tab"||s==="select-tab-if-needed"&&o===-1){this._currentIndex=r,this._previousTitle=n,this._currentChanged.emit({previousIndex:o,previousTitle:n,currentIndex:r,currentTitle:i});return}o>=r&&this._currentIndex++},e.prototype._adjustCurrentForMove=function(r,i){this._currentIndex===r?this._currentIndex=i:this._currentIndex<r&&this._currentIndex>=i?this._currentIndex++:this._currentIndex>r&&this._currentIndex<=i&&this._currentIndex--},e.prototype._adjustCurrentForRemove=function(r,i){var n=this._currentIndex,o=this.removeBehavior;if(n!==r){n>r&&this._currentIndex--;return}if(this._titles.length===0){this._currentIndex=-1,this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:-1,currentTitle:null});return}if(o==="select-tab-after"){this._currentIndex=Math.min(r,this._titles.length-1),this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(o==="select-tab-before"){this._currentIndex=Math.max(0,r-1),this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(o==="select-previous-tab"){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(r,this._titles.length-1),this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:-1,currentTitle:null})},e.prototype._onTitleChanged=function(r){this.update()},e}(Br);(function(t){var e=function(){function r(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++r._nInstance}return r.prototype.renderTab=function(i){var n=i.title.caption,o=this.createTabKey(i),s=o,l=this.createTabStyle(i),u=this.createTabClass(i),h=this.createTabDataset(i),v=this.createTabARIA(i);return i.title.closable?so.li(ol({id:s,key:o,className:u,title:n,style:l,dataset:h},v),this.renderIcon(i),this.renderLabel(i),this.renderCloseIcon(i)):so.li(ol({id:s,key:o,className:u,title:n,style:l,dataset:h},v),this.renderIcon(i),this.renderLabel(i))},r.prototype.renderIcon=function(i){var n=i.title,o=this.createIconClass(i);return typeof n.icon=="string"?so.div({className:o},n.iconLabel):so.div({className:o},n.icon,n.iconLabel)},r.prototype.renderLabel=function(i){return so.div({className:"lm-TabBar-tabLabel p-TabBar-tabLabel"},i.title.label)},r.prototype.renderCloseIcon=function(i){return so.div({className:"lm-TabBar-tabCloseIcon p-TabBar-tabCloseIcon"})},r.prototype.createTabKey=function(i){var n=this._tabKeys.get(i.title);return n===void 0&&(n="tab-key-"+this._uuid+"-"+this._tabID++,this._tabKeys.set(i.title,n)),n},r.prototype.createTabStyle=function(i){return{zIndex:""+i.zIndex}},r.prototype.createTabClass=function(i){var n="lm-TabBar-tab";return n+=" p-TabBar-tab",i.title.className&&(n+=" "+i.title.className),i.title.closable&&(n+=" lm-mod-closable",n+=" p-mod-closable"),i.current&&(n+=" lm-mod-current",n+=" p-mod-current"),n},r.prototype.createTabDataset=function(i){return i.title.dataset},r.prototype.createTabARIA=function(i){return{role:"tab","aria-selected":i.current.toString()}},r.prototype.createIconClass=function(i){var n="lm-TabBar-tabIcon";n+=" p-TabBar-tabIcon";var o=i.title.iconClass;return o?n+" "+o:n},r._nInstance=0,r}();t.Renderer=e,t.defaultRenderer=new e,t.addButtonSelector=".lm-TabBar-addButton"})(cv||(cv={}));var Ju;(function(t){t.DRAG_THRESHOLD=5,t.DETACH_THRESHOLD=20;function e(){var v=document.createElement("div"),T=document.createElement("ul");T.setAttribute("role","tablist"),T.className="lm-TabBar-content",T.classList.add("p-TabBar-content"),v.appendChild(T);var E=document.createElement("div");return E.className="lm-TabBar-addButton lm-mod-hidden",v.appendChild(E),v}t.createNode=e;function r(v){return v instanceof tk?v:new tk(v)}t.asTitle=r;function i(v){var T=window.getComputedStyle(v);return 1e3*(parseFloat(T.transitionDuration)||0)}t.parseTransitionDuration=i;function n(v,T){for(var E=new Array(v.length),M=0,O=v.length;M<O;++M){var F=v[M],z=window.getComputedStyle(F);T==="horizontal"?E[M]={pos:F.offsetLeft,size:F.offsetWidth,margin:parseFloat(z.marginLeft)||0}:E[M]={pos:F.offsetTop,size:F.offsetHeight,margin:parseFloat(z.marginTop)||0}}return E}t.snapTabLayout=n;function o(v,T){var E=Math.abs(T.clientX-v.pressX),M=Math.abs(T.clientY-v.pressY);return E>=t.DRAG_THRESHOLD||M>=t.DRAG_THRESHOLD}t.dragExceeded=o;function s(v,T){var E=v.contentRect;return T.clientX<E.left-t.DETACH_THRESHOLD||T.clientX>=E.right+t.DETACH_THRESHOLD||T.clientY<E.top-t.DETACH_THRESHOLD||T.clientY>=E.bottom+t.DETACH_THRESHOLD}t.detachExceeded=s;function l(v,T,E,M){var O,F,z,W;M==="horizontal"?(O=T.pressX,F=E.clientX-T.contentRect.left,z=E.clientX,W=T.contentRect.width):(O=T.pressY,F=E.clientY-T.contentRect.top,z=E.clientY,W=T.contentRect.height);for(var J=T.index,K=F-T.tabPressPos,ne=K+T.tabSize,ge=0,H=v.length;ge<H;++ge){var me=void 0,fe=T.tabLayout[ge],$=fe.pos+(fe.size>>1);if(ge<T.index&&K<$)me=T.tabSize+T.tabLayout[ge+1].margin+"px",J=Math.min(J,ge);else if(ge>T.index&&ne>$)me=-T.tabSize-fe.margin+"px",J=Math.max(J,ge);else if(ge===T.index){var Z=z-O,we=W-(T.tabPos+T.tabSize);me=Math.max(-T.tabPos,Math.min(Z,we))+"px"}else me="";M==="horizontal"?v[ge].style.left=me:v[ge].style.top=me}T.targetIndex=J}t.layoutTabs=l;function u(v,T){var E;T==="horizontal"?E=v.contentRect.width:E=v.contentRect.height;var M;if(v.targetIndex===v.index)M=0;else if(v.targetIndex>v.index){var O=v.tabLayout[v.targetIndex];M=O.pos+O.size-v.tabSize-v.tabPos}else{var O=v.tabLayout[v.targetIndex];M=O.pos-v.tabPos}var F=E-(v.tabPos+v.tabSize),z=Math.max(-v.tabPos,Math.min(M,F));T==="horizontal"?v.tab.style.left=z+"px":v.tab.style.top=z+"px"}t.finalizeTabPosition=u;function h(v,T){Ei(v,function(E){T==="horizontal"?E.style.left="":E.style.top=""})}t.resetTabPositions=h})(Ju||(Ju={}));var KMe=function(t){ks(e,t);function e(r){var i=t.call(this)||this;return i._spacing=4,i._dirty=!1,i._root=null,i._box=null,i._items=new Map,i.renderer=r.renderer,r.spacing!==void 0&&(i._spacing=Vw.clampDimension(r.spacing)),i._document=r.document||document,i._hiddenMode=r.hiddenMode!==void 0?r.hiddenMode:Br.HiddenMode.Display,i}return e.prototype.dispose=function(){var r=this.iter();this._items.forEach(function(i){i.dispose()}),this._box=null,this._root=null,this._items.clear(),Ei(r,function(i){i.dispose()}),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(r){var i=this;this._hiddenMode!==r&&(this._hiddenMode=r,Ei(this.tabBars(),function(n){n.titles.length>1&&n.titles.forEach(function(o){o.owner.hiddenMode=i._hiddenMode})}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this._spacing},set:function(r){r=Vw.clampDimension(r),this._spacing!==r&&(this._spacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this._root===null},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._root?this._root.iterAllWidgets():su()},e.prototype.widgets=function(){return this._root?this._root.iterUserWidgets():su()},e.prototype.selectedWidgets=function(){return this._root?this._root.iterSelectedWidgets():su()},e.prototype.tabBars=function(){return this._root?this._root.iterTabBars():su()},e.prototype.handles=function(){return this._root?this._root.iterHandles():su()},e.prototype.moveHandle=function(r,i,n){var o=r.classList.contains("lm-mod-hidden");if(o=o||r.classList.contains("p-mod-hidden"),!(!this._root||o)){var s=this._root.findSplitNode(r);if(s){var l;s.node.orientation==="horizontal"?l=i-r.offsetLeft:l=n-r.offsetTop,l!==0&&(s.node.holdSizes(),lu.adjust(s.node.sizers,s.index,l),this.parent&&this.parent.update())}}},e.prototype.saveLayout=function(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}},e.prototype.restoreLayout=function(r){var i=this,n=new Set,o;r.main?o=Ea.normalizeAreaConfig(r.main,n):o=null;var s=this.widgets(),l=this.tabBars(),u=this.handles();this._root=null,Ei(s,function(h){n.has(h)||(h.parent=null)}),Ei(l,function(h){h.dispose()}),Ei(u,function(h){h.parentNode&&h.parentNode.removeChild(h)}),n.forEach(function(h){h.parent=i.parent}),o?this._root=Ea.realizeAreaConfig(o,{createTabBar:function(h){return i._createTabBar()},createHandle:function(){return i._createHandle()}},this._document):this._root=null,this.parent&&(n.forEach(function(h){i.attachWidget(h)}),this.parent.fit())},e.prototype.addWidget=function(r,i){i===void 0&&(i={});var n=i.ref||null,o=i.mode||"tab-after",s=null;if(this._root&&n&&(s=this._root.findTabNode(n)),n&&!s)throw new Error("Reference widget is not in the layout.");switch(r.parent=this.parent,o){case"tab-after":this._insertTab(r,n,s,!0);break;case"tab-before":this._insertTab(r,n,s,!1);break;case"split-top":this._insertSplit(r,n,s,"vertical",!1);break;case"split-left":this._insertSplit(r,n,s,"horizontal",!1);break;case"split-right":this._insertSplit(r,n,s,"horizontal",!0);break;case"split-bottom":this._insertSplit(r,n,s,"vertical",!0);break}this.parent&&(this.attachWidget(r),this.parent.fit())},e.prototype.removeWidget=function(r){this._removeWidget(r),this.parent&&(this.detachWidget(r),this.parent.fit())},e.prototype.hitTestTabAreas=function(r,i){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=ho.boxSizing(this.parent.node));var n=this.parent.node.getBoundingClientRect(),o=r-n.left-this._box.borderLeft,s=i-n.top-this._box.borderTop,l=this._root.hitTestTabNodes(o,s);if(!l)return null;var u=l.tabBar,h=l.top,v=l.left,T=l.width,E=l.height,M=this._box.borderLeft+this._box.borderRight,O=this._box.borderTop+this._box.borderBottom,F=n.width-M-(v+T),z=n.height-O-(h+E);return{tabBar:u,x:o,y:s,top:h,left:v,right:F,bottom:z,width:T,height:E}},e.prototype.init=function(){var r=this;t.prototype.init.call(this),Ei(this,function(i){r.attachWidget(i)}),Ei(this.handles(),function(i){r.parent.node.appendChild(i)}),this.parent.fit()},e.prototype.attachWidget=function(r){this.parent.node!==r.node.parentNode&&(this._items.set(r,new Hw(r)),this.parent.isAttached&&xr.sendMessage(r,Br.Msg.BeforeAttach),this.parent.node.appendChild(r.node),this.parent.isAttached&&xr.sendMessage(r,Br.Msg.AfterAttach))},e.prototype.detachWidget=function(r){if(this.parent.node===r.node.parentNode){this.parent.isAttached&&xr.sendMessage(r,Br.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&xr.sendMessage(r,Br.Msg.AfterDetach);var i=this._items.get(r);i&&(this._items.delete(r),i.dispose())}},e.prototype.onBeforeShow=function(r){t.prototype.onBeforeShow.call(this,r),this.parent.update()},e.prototype.onBeforeAttach=function(r){t.prototype.onBeforeAttach.call(this,r),this.parent.fit()},e.prototype.onChildShown=function(r){this.parent.fit()},e.prototype.onChildHidden=function(r){this.parent.fit()},e.prototype.onResize=function(r){this.parent.isVisible&&this._update(r.width,r.height)},e.prototype.onUpdateRequest=function(r){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(r){this.parent.isAttached&&this._fit()},e.prototype._removeWidget=function(r){if(this._root){var i=this._root.findTabNode(r);if(i){if(Ea.removeAria(r),i.tabBar.titles.length>1){if(i.tabBar.removeTab(r.title),this._hiddenMode===Br.HiddenMode.Scale&&i.tabBar.titles.length==1){var n=i.tabBar.titles[0].owner;n.hiddenMode=Br.HiddenMode.Display}return}if(i.tabBar.dispose(),this._root===i){this._root=null;return}this._root.holdAllSizes();var o=i.parent;i.parent=null;var s=rr.removeFirstOf(o.children,i),l=rr.removeAt(o.handles,s);if(rr.removeAt(o.sizers,s),l.parentNode&&l.parentNode.removeChild(l),o.children.length>1){o.syncHandles();return}var u=o.parent;o.parent=null;var h=o.children[0],v=o.handles[0];if(o.children.length=0,o.handles.length=0,o.sizers.length=0,v.parentNode&&v.parentNode.removeChild(v),this._root===o){h.parent=null,this._root=h;return}var T=u,E=T.children.indexOf(o);if(h instanceof Ea.TabLayoutNode){h.parent=T,T.children[E]=h;return}var M=rr.removeAt(T.handles,E);rr.removeAt(T.children,E),rr.removeAt(T.sizers,E),M.parentNode&&M.parentNode.removeChild(M);for(var O=0,F=h.children.length;O<F;++O){var z=h.children[O],W=h.handles[O],J=h.sizers[O];rr.insert(T.children,E+O,z),rr.insert(T.handles,E+O,W),rr.insert(T.sizers,E+O,J),z.parent=T}h.children.length=0,h.handles.length=0,h.sizers.length=0,h.parent=null,T.syncHandles()}}},e.prototype._insertTab=function(r,i,n,o){if(r!==i){if(!this._root){var s=new Ea.TabLayoutNode(this._createTabBar());s.tabBar.addTab(r.title),this._root=s,Ea.addAria(r,s.tabBar);return}n||(n=this._root.findFirstTabNode()),n.tabBar.titles.indexOf(r.title)===-1&&(this._removeWidget(r),r.hide());var l;if(i?l=n.tabBar.titles.indexOf(i.title):l=n.tabBar.currentIndex,this._hiddenMode===Br.HiddenMode.Scale)if(n.tabBar.titles.length===0)r.hiddenMode=Br.HiddenMode.Display;else if(n.tabBar.titles.length==1){var u=n.tabBar.titles[0].owner;u.hiddenMode=Br.HiddenMode.Scale}else r.hiddenMode=Br.HiddenMode.Scale;else r.hiddenMode=this._hiddenMode;n.tabBar.insertTab(l+(o?1:0),r.title),Ea.addAria(r,n.tabBar)}},e.prototype._insertSplit=function(r,i,n,o,s){if(!(r===i&&n&&n.tabBar.titles.length===1)){this._removeWidget(r);var l=new Ea.TabLayoutNode(this._createTabBar());if(l.tabBar.addTab(r.title),Ea.addAria(r,l.tabBar),!this._root){this._root=l;return}if(!n||!n.parent){var u=this._splitRoot(o),h=s?u.children.length:0;u.normalizeSizes();var v=Ea.createSizer(n?1:Ea.GOLDEN_RATIO);rr.insert(u.children,h,l),rr.insert(u.sizers,h,v),rr.insert(u.handles,h,this._createHandle()),l.parent=u,u.normalizeSizes(),u.syncHandles();return}var T=n.parent;if(T.orientation===o){var E=T.children.indexOf(n);T.normalizeSizes();var M=T.sizers[E].sizeHint/=2,O=E+(s?1:0);rr.insert(T.children,O,l),rr.insert(T.sizers,O,Ea.createSizer(M)),rr.insert(T.handles,O,this._createHandle()),l.parent=T,T.syncHandles();return}var F=rr.removeFirstOf(T.children,n),z=new Ea.SplitLayoutNode(o);z.normalized=!0,z.children.push(n),z.sizers.push(Ea.createSizer(.5)),z.handles.push(this._createHandle()),n.parent=z;var W=s?1:0;rr.insert(z.children,W,l),rr.insert(z.sizers,W,Ea.createSizer(.5)),rr.insert(z.handles,W,this._createHandle()),l.parent=z,z.syncHandles(),rr.insert(T.children,F,z),z.parent=T}},e.prototype._splitRoot=function(r){var i=this._root;if(i instanceof Ea.SplitLayoutNode&&i.orientation===r)return i;var n=this._root=new Ea.SplitLayoutNode(r);return i&&(n.children.push(i),n.sizers.push(Ea.createSizer(0)),n.handles.push(this._createHandle()),i.parent=n),n},e.prototype._fit=function(){var r=0,i=0;if(this._root){var n=this._root.fit(this._spacing,this._items);r=n.minWidth,i=n.minHeight}var o=this._box=ho.boxSizing(this.parent.node);r+=o.horizontalSum,i+=o.verticalSum;var s=this.parent.node.style;s.minWidth=r+"px",s.minHeight=i+"px",this._dirty=!0,this.parent.parent&&xr.sendMessage(this.parent.parent,Br.Msg.FitRequest),this._dirty&&xr.sendMessage(this.parent,Br.Msg.UpdateRequest)},e.prototype._update=function(r,i){if(this._dirty=!1,!!this._root){r<0&&(r=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=ho.boxSizing(this.parent.node));var n=this._box.paddingTop,o=this._box.paddingLeft,s=r-this._box.horizontalSum,l=i-this._box.verticalSum;this._root.update(n,o,s,l,this._spacing,this._items)}},e.prototype._createTabBar=function(){var r=this.renderer.createTabBar(this._document);return r.orientation="horizontal",this.parent&&(r.parent=this.parent,this.attachWidget(r)),r},e.prototype._createHandle=function(){var r=this.renderer.createHandle(),i=r.style;return i.position="absolute",i.top="0",i.left="0",i.width="0",i.height="0",this.parent&&this.parent.node.appendChild(r),r},e}(MA),Ea;(function(t){t.GOLDEN_RATIO=.618;function e(E){var M=new CA;return M.sizeHint=E,M.size=E,M}t.createSizer=e;function r(E,M){var O;return E.type==="tab-area"?O=u(E,M):O=h(E,M),O}t.normalizeAreaConfig=r;function i(E,M,O){var F;return E.type==="tab-area"?F=v(E,M,O):F=T(E,M,O),F}t.realizeAreaConfig=i;var n=function(){function E(M){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;var O=new CA,F=new CA;O.stretch=0,F.stretch=1,this.tabBar=M,this.sizers=[O,F]}return Object.defineProperty(E.prototype,"top",{get:function(){return this._top},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"left",{get:function(){return this._left},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),E.prototype.iterAllWidgets=function(){return W4(Uw(this.tabBar),this.iterUserWidgets())},E.prototype.iterUserWidgets=function(){return wA(this.tabBar.titles,function(M){return M.owner})},E.prototype.iterSelectedWidgets=function(){var M=this.tabBar.currentTitle;return M?Uw(M.owner):su()},E.prototype.iterTabBars=function(){return Uw(this.tabBar)},E.prototype.iterHandles=function(){return su()},E.prototype.findTabNode=function(M){return this.tabBar.titles.indexOf(M.title)!==-1?this:null},E.prototype.findSplitNode=function(M){return null},E.prototype.findFirstTabNode=function(){return this},E.prototype.hitTestTabNodes=function(M,O){return M<this._left||M>=this._left+this._width||O<this._top||O>=this._top+this._height?null:this},E.prototype.createConfig=function(){var M=this.tabBar.titles.map(function(F){return F.owner}),O=this.tabBar.currentIndex;return{type:"tab-area",widgets:M,currentIndex:O}},E.prototype.holdAllSizes=function(){},E.prototype.fit=function(M,O){var F=0,z=0,W=1/0,J=1/0,K=O.get(this.tabBar),ne=this.tabBar.currentTitle,ge=ne?O.get(ne.owner):void 0,H=this.sizers,me=H[0],fe=H[1];return K&&K.fit(),ge&&ge.fit(),K&&!K.isHidden?(F=Math.max(F,K.minWidth),z+=K.minHeight,me.minSize=K.minHeight,me.maxSize=K.maxHeight):(me.minSize=0,me.maxSize=0),ge&&!ge.isHidden?(F=Math.max(F,ge.minWidth),z+=ge.minHeight,fe.minSize=ge.minHeight,fe.maxSize=1/0):(fe.minSize=0,fe.maxSize=1/0),{minWidth:F,minHeight:z,maxWidth:W,maxHeight:J}},E.prototype.update=function(M,O,F,z,W,J){this._top=O,this._left=M,this._width=F,this._height=z;var K=J.get(this.tabBar),ne=this.tabBar.currentTitle,ge=ne?J.get(ne.owner):void 0;if(lu.calc(this.sizers,z),K&&!K.isHidden){var H=this.sizers[0].size;K.update(M,O,F,H),O+=H}if(ge&&!ge.isHidden){var H=this.sizers[1].size;ge.update(M,O,F,H)}},E}();t.TabLayoutNode=n;var o=function(){function E(M){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=M}return E.prototype.iterAllWidgets=function(){var M=wA(this.children,function(O){return O.iterAllWidgets()});return new jg(M)},E.prototype.iterUserWidgets=function(){var M=wA(this.children,function(O){return O.iterUserWidgets()});return new jg(M)},E.prototype.iterSelectedWidgets=function(){var M=wA(this.children,function(O){return O.iterSelectedWidgets()});return new jg(M)},E.prototype.iterTabBars=function(){var M=wA(this.children,function(O){return O.iterTabBars()});return new jg(M)},E.prototype.iterHandles=function(){var M=wA(this.children,function(O){return O.iterHandles()});return W4(this.handles,new jg(M))},E.prototype.findTabNode=function(M){for(var O=0,F=this.children.length;O<F;++O){var z=this.children[O].findTabNode(M);if(z)return z}return null},E.prototype.findSplitNode=function(M){var O=this.handles.indexOf(M);if(O!==-1)return{index:O,node:this};for(var F=0,z=this.children.length;F<z;++F){var W=this.children[F].findSplitNode(M);if(W)return W}return null},E.prototype.findFirstTabNode=function(){return this.children.length===0?null:this.children[0].findFirstTabNode()},E.prototype.hitTestTabNodes=function(M,O){for(var F=0,z=this.children.length;F<z;++F){var W=this.children[F].hitTestTabNodes(M,O);if(W)return W}return null},E.prototype.createConfig=function(){var M=this.orientation,O=this.createNormalizedSizes(),F=this.children.map(function(z){return z.createConfig()});return{type:"split-area",orientation:M,children:F,sizes:O}},E.prototype.syncHandles=function(){var M=this;Ei(this.handles,function(O,F){O.setAttribute("data-orientation",M.orientation),F===M.handles.length-1?(O.classList.add("lm-mod-hidden"),O.classList.add("p-mod-hidden")):(O.classList.remove("lm-mod-hidden"),O.classList.remove("p-mod-hidden"))})},E.prototype.holdSizes=function(){Ei(this.sizers,function(M){M.sizeHint=M.size})},E.prototype.holdAllSizes=function(){Ei(this.children,function(M){return M.holdAllSizes()}),this.holdSizes()},E.prototype.normalizeSizes=function(){var M=this.sizers.length;if(M!==0){this.holdSizes();var O=q4(this.sizers,function(F,z){return F+z.sizeHint},0);O===0?Ei(this.sizers,function(F){F.size=F.sizeHint=1/M}):Ei(this.sizers,function(F){F.size=F.sizeHint/=O}),this.normalized=!0}},E.prototype.createNormalizedSizes=function(){var M=this.sizers.length;if(M===0)return[];var O=this.sizers.map(function(z){return z.size}),F=q4(O,function(z,W){return z+W},0);return F===0?Ei(O,function(z,W){O[W]=1/M}):Ei(O,function(z,W){O[W]=z/F}),O},E.prototype.fit=function(M,O){for(var F=this.orientation==="horizontal",z=Math.max(0,this.children.length-1)*M,W=F?z:0,J=F?0:z,K=1/0,ne=1/0,ge=0,H=this.children.length;ge<H;++ge){var me=this.children[ge].fit(M,O);F?(J=Math.max(J,me.minHeight),W+=me.minWidth,this.sizers[ge].minSize=me.minWidth):(W=Math.max(W,me.minWidth),J+=me.minHeight,this.sizers[ge].minSize=me.minHeight)}return{minWidth:W,minHeight:J,maxWidth:K,maxHeight:ne}},E.prototype.update=function(M,O,F,z,W,J){var K=this.orientation==="horizontal",ne=Math.max(0,this.children.length-1)*W,ge=Math.max(0,(K?F:z)-ne);this.normalized&&(Ei(this.sizers,function(we){we.sizeHint*=ge}),this.normalized=!1),lu.calc(this.sizers,ge);for(var H=0,me=this.children.length;H<me;++H){var fe=this.children[H],$=this.sizers[H].size,Z=this.handles[H].style;K?(fe.update(M,O,$,z,W,J),M+=$,Z.top=O+"px",Z.left=M+"px",Z.width=W+"px",Z.height=z+"px",M+=W):(fe.update(M,O,F,$,W,J),O+=$,Z.top=O+"px",Z.left=M+"px",Z.width=F+"px",Z.height=W+"px",O+=W)}},E}();t.SplitLayoutNode=o;function s(E,M){E.node.setAttribute("role","tabpanel");var O=M.renderer;if(O instanceof cv.Renderer){var F=O.createTabKey({title:E.title,current:!1,zIndex:0});E.node.setAttribute("aria-labelledby",F)}}t.addAria=s;function l(E){E.node.removeAttribute("role"),E.node.removeAttribute("aria-labelledby")}t.removeAria=l;function u(E,M){if(E.widgets.length===0)return null;var O=[];if(Ei(E.widgets,function(z){M.has(z)||(M.add(z),O.push(z))}),O.length===0)return null;var F=E.currentIndex;return F!==-1&&(F<0||F>=O.length)&&(F=0),{type:"tab-area",widgets:O,currentIndex:F}}function h(E,M){for(var O=E.orientation,F=[],z=[],W=0,J=E.children.length;W<J;++W){var K=r(E.children[W],M);K&&(K.type==="tab-area"||K.orientation!==O?(F.push(K),z.push(Math.abs(E.sizes[W]||0))):(F.push.apply(F,K.children),z.push.apply(z,K.sizes)))}return F.length===0?null:F.length===1?F[0]:{type:"split-area",orientation:O,children:F,sizes:z}}function v(E,M,O){var F=M.createTabBar(O);return Ei(E.widgets,function(z){z.hide(),F.addTab(z.title),t.addAria(z,F)}),F.currentIndex=E.currentIndex,new n(F)}function T(E,M,O){var F=new o(E.orientation);return Ei(E.children,function(z,W){var J=i(z,M,O),K=e(E.sizes[W]),ne=M.createHandle();F.children.push(J),F.handles.push(ne),F.sizers.push(K),J.parent=F}),F.syncHandles(),F.normalizeSizes(),F}})(Ea||(Ea={}));var zee=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this)||this;i._drag=null,i._tabsMovable=!0,i._tabsConstrained=!1,i._addButtonEnabled=!1,i._pressData=null,i._layoutModified=new Wn(i),i._addRequested=new Wn(i),i.addClass("lm-DockPanel"),i.addClass("p-DockPanel"),i._document=r.document||document,i._mode=r.mode||"multiple-document",i._renderer=r.renderer||e.defaultRenderer,i._edges=r.edges||Qs.DEFAULT_EDGES,r.tabsMovable!==void 0&&(i._tabsMovable=r.tabsMovable),r.tabsConstrained!==void 0&&(i._tabsConstrained=r.tabsConstrained),r.addButtonEnabled!==void 0&&(i._addButtonEnabled=r.addButtonEnabled),i.dataset.mode=i._mode;var n={createTabBar:function(){return i._createTabBar()},createHandle:function(){return i._createHandle()}};return i.layout=new KMe({document:i._document,renderer:n,spacing:r.spacing,hiddenMode:r.hiddenMode}),i.overlay=r.overlay||new e.Overlay,i.node.appendChild(i.overlay.node),i}return e.prototype.dispose=function(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(r){this.layout.hiddenMode=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layoutModified",{get:function(){return this._layoutModified},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(r){this.layout.spacing=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return this._mode},set:function(r){if(this._mode!==r){this._mode=r,this.dataset.mode=r;var i=this.layout;switch(r){case"multiple-document":Ei(i.tabBars(),function(n){n.show()});break;case"single-document":i.restoreLayout(Qs.createSingleDocumentConfig(this));break;default:throw"unreachable"}xr.postMessage(this,Qs.LayoutModified)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this._tabsMovable},set:function(r){this._tabsMovable=r,Ei(this.tabBars(),function(i){i.tabsMovable=r})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsConstrained",{get:function(){return this._tabsConstrained},set:function(r){this._tabsConstrained=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(r){this._addButtonEnabled=r,Ei(this.tabBars(),function(i){i.addButtonEnabled=r})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.layout.isEmpty},enumerable:!0,configurable:!0}),e.prototype.widgets=function(){return this.layout.widgets()},e.prototype.selectedWidgets=function(){return this.layout.selectedWidgets()},e.prototype.tabBars=function(){return this.layout.tabBars()},e.prototype.handles=function(){return this.layout.handles()},e.prototype.selectWidget=function(r){var i=rv(this.tabBars(),function(n){return n.titles.indexOf(r.title)!==-1});if(!i)throw new Error("Widget is not contained in the dock panel.");i.currentTitle=r.title},e.prototype.activateWidget=function(r){this.selectWidget(r),r.activate()},e.prototype.saveLayout=function(){return this.layout.saveLayout()},e.prototype.restoreLayout=function(r){this._mode="multiple-document",this.layout.restoreLayout(r),(nl.IS_EDGE||nl.IS_IE)&&xr.flush(),xr.postMessage(this,Qs.LayoutModified)},e.prototype.addWidget=function(r,i){i===void 0&&(i={}),this._mode==="single-document"?this.layout.addWidget(r):this.layout.addWidget(r,i),xr.postMessage(this,Qs.LayoutModified)},e.prototype.processMessage=function(r){r.type==="layout-modified"?this._layoutModified.emit(void 0):t.prototype.processMessage.call(this,r)},e.prototype.handleEvent=function(r){switch(r.type){case"lm-dragenter":this._evtDragEnter(r);break;case"lm-dragleave":this._evtDragLeave(r);break;case"lm-dragover":this._evtDragOver(r);break;case"lm-drop":this._evtDrop(r);break;case"mousedown":this._evtMouseDown(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseup":this._evtMouseUp(r);break;case"pointerdown":this._evtMouseDown(r);break;case"pointermove":this._evtMouseMove(r);break;case"pointerup":this._evtMouseUp(r);break;case"keydown":this._evtKeyDown(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){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("mousedown",this),this.node.addEventListener("pointerdown",this)},e.prototype.onAfterDetach=function(r){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("mousedown",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()},e.prototype.onChildAdded=function(r){Qs.isGeneratedTabBarProperty.get(r.child)||(r.child.addClass("lm-DockPanel-widget"),r.child.addClass("p-DockPanel-widget"))},e.prototype.onChildRemoved=function(r){Qs.isGeneratedTabBarProperty.get(r.child)||(r.child.removeClass("lm-DockPanel-widget"),r.child.removeClass("p-DockPanel-widget"),xr.postMessage(this,Qs.LayoutModified))},e.prototype._evtDragEnter=function(r){r.mimeData.hasData("application/vnd.lumino.widget-factory")&&(r.preventDefault(),r.stopPropagation())},e.prototype._evtDragLeave=function(r){r.preventDefault(),!(this._tabsConstrained&&r.source!==this)&&(r.stopPropagation(),this.overlay.hide(1))},e.prototype._evtDragOver=function(r){r.preventDefault(),this._tabsConstrained&&r.source!==this||this._showOverlay(r.clientX,r.clientY)==="invalid"?r.dropAction="none":(r.stopPropagation(),r.dropAction=r.proposedAction)},e.prototype._evtDrop=function(r){if(r.preventDefault(),this.overlay.hide(0),r.proposedAction==="none"){r.dropAction="none";return}var i=r.clientX,n=r.clientY,o=Qs.findDropTarget(this,i,n,this._edges),s=o.zone,l=o.target;if(this._tabsConstrained&&r.source!==this||s==="invalid"){r.dropAction="none";return}var u=r.mimeData,h=u.getData("application/vnd.lumino.widget-factory");if(typeof h!="function"){r.dropAction="none";return}var v=h();if(!(v instanceof Br)){r.dropAction="none";return}if(v.contains(this)){r.dropAction="none";return}var T=l?Qs.getDropRef(l.tabBar):null;switch(s){case"root-all":this.addWidget(v);break;case"root-top":this.addWidget(v,{mode:"split-top"});break;case"root-left":this.addWidget(v,{mode:"split-left"});break;case"root-right":this.addWidget(v,{mode:"split-right"});break;case"root-bottom":this.addWidget(v,{mode:"split-bottom"});break;case"widget-all":this.addWidget(v,{mode:"tab-after",ref:T});break;case"widget-top":this.addWidget(v,{mode:"split-top",ref:T});break;case"widget-left":this.addWidget(v,{mode:"split-left",ref:T});break;case"widget-right":this.addWidget(v,{mode:"split-right",ref:T});break;case"widget-bottom":this.addWidget(v,{mode:"split-bottom",ref:T});break;case"widget-tab":this.addWidget(v,{mode:"tab-after",ref:T});break;default:throw"unreachable"}r.dropAction=r.proposedAction,r.stopPropagation(),this.activateWidget(v)},e.prototype._evtKeyDown=function(r){r.preventDefault(),r.stopPropagation(),r.keyCode===27&&(this._releaseMouse(),xr.postMessage(this,Qs.LayoutModified))},e.prototype._evtMouseDown=function(r){if(r.button===0){var i=this.layout,n=r.target,o=rv(i.handles(),function(T){return T.contains(n)});if(o){r.preventDefault(),r.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("mouseup",this,!0),this._document.addEventListener("mousemove",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);var s=o.getBoundingClientRect(),l=r.clientX-s.left,u=r.clientY-s.top,h=window.getComputedStyle(o),v=EA.overrideCursor(h.cursor,this._document);this._pressData={handle:o,deltaX:l,deltaY:u,override:v}}}},e.prototype._evtMouseMove=function(r){if(this._pressData){r.preventDefault(),r.stopPropagation();var i=this.node.getBoundingClientRect(),n=r.clientX-i.left-this._pressData.deltaX,o=r.clientY-i.top-this._pressData.deltaY,s=this.layout;s.moveHandle(this._pressData.handle,n,o)}},e.prototype._evtMouseUp=function(r){r.button===0&&(r.preventDefault(),r.stopPropagation(),this._releaseMouse(),xr.postMessage(this,Qs.LayoutModified))},e.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("mouseup",this,!0),this._document.removeEventListener("mousemove",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))},e.prototype._showOverlay=function(r,i){var n=Qs.findDropTarget(this,r,i,this._edges),o=n.zone,s=n.target;if(o==="invalid")return this.overlay.hide(100),o;var l,u,h,v,T=ho.boxSizing(this.node),E=this.node.getBoundingClientRect();switch(o){case"root-all":l=T.paddingTop,u=T.paddingLeft,h=T.paddingRight,v=T.paddingBottom;break;case"root-top":l=T.paddingTop,u=T.paddingLeft,h=T.paddingRight,v=E.height*Qs.GOLDEN_RATIO;break;case"root-left":l=T.paddingTop,u=T.paddingLeft,h=E.width*Qs.GOLDEN_RATIO,v=T.paddingBottom;break;case"root-right":l=T.paddingTop,u=E.width*Qs.GOLDEN_RATIO,h=T.paddingRight,v=T.paddingBottom;break;case"root-bottom":l=E.height*Qs.GOLDEN_RATIO,u=T.paddingLeft,h=T.paddingRight,v=T.paddingBottom;break;case"widget-all":l=s.top,u=s.left,h=s.right,v=s.bottom;break;case"widget-top":l=s.top,u=s.left,h=s.right,v=s.bottom+s.height/2;break;case"widget-left":l=s.top,u=s.left,h=s.right+s.width/2,v=s.bottom;break;case"widget-right":l=s.top,u=s.left+s.width/2,h=s.right,v=s.bottom;break;case"widget-bottom":l=s.top+s.height/2,u=s.left,h=s.right,v=s.bottom;break;case"widget-tab":var M=s.tabBar.node.getBoundingClientRect().height;l=s.top,u=s.left,h=s.right,v=s.bottom+s.height-M;break;default:throw"unreachable"}return this.overlay.show({top:l,left:u,right:h,bottom:v}),o},e.prototype._createTabBar=function(){var r=this._renderer.createTabBar(this._document);return Qs.isGeneratedTabBarProperty.set(r,!0),this._mode==="single-document"&&r.hide(),r.tabsMovable=this._tabsMovable,r.allowDeselect=!1,r.addButtonEnabled=this._addButtonEnabled,r.removeBehavior="select-previous-tab",r.insertBehavior="select-tab-if-needed",r.tabMoved.connect(this._onTabMoved,this),r.currentChanged.connect(this._onCurrentChanged,this),r.tabCloseRequested.connect(this._onTabCloseRequested,this),r.tabDetachRequested.connect(this._onTabDetachRequested,this),r.tabActivateRequested.connect(this._onTabActivateRequested,this),r.addRequested.connect(this._onTabAddRequested,this),r},e.prototype._createHandle=function(){return this._renderer.createHandle()},e.prototype._onTabMoved=function(){xr.postMessage(this,Qs.LayoutModified)},e.prototype._onCurrentChanged=function(r,i){var n=i.previousTitle,o=i.currentTitle;n&&n.owner.hide(),o&&o.owner.show(),(nl.IS_EDGE||nl.IS_IE)&&xr.flush(),xr.postMessage(this,Qs.LayoutModified)},e.prototype._onTabAddRequested=function(r){this._addRequested.emit(r)},e.prototype._onTabActivateRequested=function(r,i){i.title.owner.activate()},e.prototype._onTabCloseRequested=function(r,i){i.title.owner.close()},e.prototype._onTabDetachRequested=function(r,i){var n=this;if(!this._drag){r.releaseMouse();var o=i.title,s=i.tab,l=i.clientX,u=i.clientY,h=new qg.MimeData,v=function(){return o.owner};h.setData("application/vnd.lumino.widget-factory",v);var T=s.cloneNode(!0);this._drag=new EA({document:this._document,mimeData:h,dragImage:T,proposedAction:"move",supportedActions:"move",source:this}),s.classList.add("lm-mod-hidden"),s.classList.add("p-mod-hidden");var E=function(){n._drag=null,s.classList.remove("lm-mod-hidden"),s.classList.remove("p-mod-hidden")};this._drag.start(l,u).then(E)}},e}(Br);(function(t){var e=function(){function i(){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.classList.add("p-DockPanel-overlay"),this.node.classList.add("p-mod-hidden"),this.node.style.position="absolute"}return i.prototype.show=function(n){var o=this.node.style;o.top=n.top+"px",o.left=n.left+"px",o.right=n.right+"px",o.bottom=n.bottom+"px",clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"),this.node.classList.remove("p-mod-hidden"))},i.prototype.hide=function(n){var o=this;if(!this._hidden){if(n<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden"),this.node.classList.add("p-mod-hidden");return}this._timer===-1&&(this._timer=window.setTimeout(function(){o._timer=-1,o._hidden=!0,o.node.classList.add("lm-mod-hidden"),o.node.classList.add("p-mod-hidden")},n))}},i}();t.Overlay=e;var r=function(){function i(){}return i.prototype.createTabBar=function(n){var o=new cv({document:n});return o.addClass("lm-DockPanel-tabBar"),o.addClass("p-DockPanel-tabBar"),o},i.prototype.createHandle=function(){var n=document.createElement("div");return n.className="lm-DockPanel-handle",n.classList.add("p-DockPanel-handle"),n},i}();t.Renderer=r,t.defaultRenderer=new r})(zee||(zee={}));var Qs;(function(t){t.GOLDEN_RATIO=.618,t.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},t.LayoutModified=new iv("layout-modified"),t.isGeneratedTabBarProperty=new lc({name:"isGeneratedTabBar",create:function(){return!1}});function e(n){if(n.isEmpty)return{main:null};var o=Pee(n.widgets()),s=n.selectedWidgets().next(),l=s?o.indexOf(s):-1;return{main:{type:"tab-area",widgets:o,currentIndex:l}}}t.createSingleDocumentConfig=e;function r(n,o,s,l){if(!ho.hitTest(n.node,o,s))return{zone:"invalid",target:null};var u=n.layout;if(u.isEmpty)return{zone:"root-all",target:null};if(n.mode==="multiple-document"){var h=n.node.getBoundingClientRect(),v=o-h.left+1,T=s-h.top+1,E=h.right-o,M=h.bottom-s,O=Math.min(T,E,M,v);switch(O){case T:if(T<l.top)return{zone:"root-top",target:null};break;case E:if(E<l.right)return{zone:"root-right",target:null};break;case M:if(M<l.bottom)return{zone:"root-bottom",target:null};break;case v:if(v<l.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}var F=u.hitTestTabAreas(o,s);if(!F)return{zone:"invalid",target:null};if(n.mode==="single-document")return{zone:"widget-all",target:F};var z=F.x-F.left+1,W=F.y-F.top+1,J=F.left+F.width-F.x,K=F.top+F.height-F.y,ne=F.tabBar.node.getBoundingClientRect().height;if(W<ne)return{zone:"widget-tab",target:F};var ge=Math.round(F.width/3),H=Math.round(F.height/3);if(z>ge&&J>ge&&W>H&&K>H)return{zone:"widget-all",target:F};z/=ge,W/=H,J/=ge,K/=H;var me=Math.min(z,W,J,K),fe;switch(me){case z:fe="widget-left";break;case W:fe="widget-top";break;case J:fe="widget-right";break;case K:fe="widget-bottom";break;default:throw"unreachable"}return{zone:fe,target:F}}t.findDropTarget=r;function i(n){return n.titles.length===0?null:n.currentTitle?n.currentTitle.owner:n.titles[n.titles.length-1].owner}t.getDropRef=i})(Qs||(Qs={}));var GTt=function(){function t(){this._counter=0,this._widgets=[],this._activeWidget=null,this._currentWidget=null,this._numbers=new Map,this._nodes=new Map,this._activeChanged=new Wn(this),this._currentChanged=new Wn(this)}return t.prototype.dispose=function(){var e=this;this._counter<0||(this._counter=-1,Wn.clearData(this),Ei(this._widgets,function(r){r.node.removeEventListener("focus",e,!0),r.node.removeEventListener("blur",e,!0)}),this._activeWidget=null,this._currentWidget=null,this._nodes.clear(),this._numbers.clear(),this._widgets.length=0)},Object.defineProperty(t.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeChanged",{get:function(){return this._activeChanged},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._counter<0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentWidget",{get:function(){return this._currentWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"activeWidget",{get:function(){return this._activeWidget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),t.prototype.focusNumber=function(e){var r=this._numbers.get(e);return r===void 0?-1:r},t.prototype.has=function(e){return this._numbers.has(e)},t.prototype.add=function(e){if(!this._numbers.has(e)){var r=e.node.contains(document.activeElement),i=r?this._counter++:-1;this._widgets.push(e),this._numbers.set(e,i),this._nodes.set(e.node,e),e.node.addEventListener("focus",this,!0),e.node.addEventListener("blur",this,!0),e.disposed.connect(this._onWidgetDisposed,this),r&&this._setWidgets(e,e)}},t.prototype.remove=function(e){var r=this;if(this._numbers.has(e)&&(e.disposed.disconnect(this._onWidgetDisposed,this),e.node.removeEventListener("focus",this,!0),e.node.removeEventListener("blur",this,!0),rr.removeFirstOf(this._widgets,e),this._nodes.delete(e.node),this._numbers.delete(e),this._currentWidget===e)){var i=Ree(this._widgets,function(o){return r._numbers.get(o)!==-1}),n=Bee(i,function(o,s){var l=r._numbers.get(o),u=r._numbers.get(s);return l-u})||null;this._setWidgets(n,null)}},t.prototype.handleEvent=function(e){switch(e.type){case"focus":this._evtFocus(e);break;case"blur":this._evtBlur(e);break}},t.prototype._setWidgets=function(e,r){var i=this._currentWidget;this._currentWidget=e;var n=this._activeWidget;this._activeWidget=r,i!==e&&this._currentChanged.emit({oldValue:i,newValue:e}),n!==r&&this._activeChanged.emit({oldValue:n,newValue:r})},t.prototype._evtFocus=function(e){var r=this._nodes.get(e.currentTarget);r!==this._currentWidget&&this._numbers.set(r,this._counter++),this._setWidgets(r,r)},t.prototype._evtBlur=function(e){var r=this._nodes.get(e.currentTarget),i=e.relatedTarget;if(!i){this._setWidgets(this._currentWidget,null);return}if(!r.node.contains(i)&&!rv(this._widgets,function(n){return n.node.contains(i)})){this._setWidgets(this._currentWidget,null);return}},t.prototype._onWidgetDisposed=function(e){this.remove(e)},t}(),ak=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,r)||this;return i._dirty=!1,i._rowSpacing=4,i._columnSpacing=4,i._items=[],i._rowStarts=[],i._columnStarts=[],i._rowSizers=[new CA],i._columnSizers=[new CA],i._box=null,r.rowCount!==void 0&&ka.reallocSizers(i._rowSizers,r.rowCount),r.columnCount!==void 0&&ka.reallocSizers(i._columnSizers,r.columnCount),r.rowSpacing!==void 0&&(i._rowSpacing=ka.clampValue(r.rowSpacing)),r.columnSpacing!==void 0&&(i._columnSpacing=ka.clampValue(r.columnSpacing)),i}return e.prototype.dispose=function(){Ei(this._items,function(r){var i=r.widget;r.dispose(),i.dispose()}),this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"rowCount",{get:function(){return this._rowSizers.length},set:function(r){r!==this.rowCount&&(ka.reallocSizers(this._rowSizers,r),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnCount",{get:function(){return this._columnSizers.length},set:function(r){r!==this.columnCount&&(ka.reallocSizers(this._columnSizers,r),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSpacing",{get:function(){return this._rowSpacing},set:function(r){r=ka.clampValue(r),this._rowSpacing!==r&&(this._rowSpacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnSpacing",{get:function(){return this._columnSpacing},set:function(r){r=ka.clampValue(r),this._columnSpacing!==r&&(this._columnSpacing=r,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),e.prototype.rowStretch=function(r){var i=this._rowSizers[r];return i?i.stretch:-1},e.prototype.setRowStretch=function(r,i){var n=this._rowSizers[r];n&&(i=ka.clampValue(i),n.stretch!==i&&(n.stretch=i,this.parent&&this.parent.update()))},e.prototype.columnStretch=function(r){var i=this._columnSizers[r];return i?i.stretch:-1},e.prototype.setColumnStretch=function(r,i){var n=this._columnSizers[r];n&&(i=ka.clampValue(i),n.stretch!==i&&(n.stretch=i,this.parent&&this.parent.update()))},e.prototype.iter=function(){return wA(this._items,function(r){return r.widget})},e.prototype.addWidget=function(r){var i=rr.findFirstIndex(this._items,function(n){return n.widget===r});i===-1&&(this._items.push(new Hw(r)),this.parent&&this.attachWidget(r))},e.prototype.removeWidget=function(r){var i=rr.findFirstIndex(this._items,function(o){return o.widget===r});if(i!==-1){var n=rr.removeAt(this._items,i);this.parent&&this.detachWidget(r),n.dispose()}},e.prototype.init=function(){var r=this;t.prototype.init.call(this),Ei(this,function(i){r.attachWidget(i)})},e.prototype.attachWidget=function(r){this.parent.isAttached&&xr.sendMessage(r,Br.Msg.BeforeAttach),this.parent.node.appendChild(r.node),this.parent.isAttached&&xr.sendMessage(r,Br.Msg.AfterAttach),this.parent.fit()},e.prototype.detachWidget=function(r){this.parent.isAttached&&xr.sendMessage(r,Br.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&xr.sendMessage(r,Br.Msg.AfterDetach),this.parent.fit()},e.prototype.onBeforeShow=function(r){t.prototype.onBeforeShow.call(this,r),this.parent.update()},e.prototype.onBeforeAttach=function(r){t.prototype.onBeforeAttach.call(this,r),this.parent.fit()},e.prototype.onChildShown=function(r){this.parent.fit()},e.prototype.onChildHidden=function(r){this.parent.fit()},e.prototype.onResize=function(r){this.parent.isVisible&&this._update(r.width,r.height)},e.prototype.onUpdateRequest=function(r){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(r){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var r=0,i=this.rowCount;r<i;++r)this._rowSizers[r].minSize=0;for(var r=0,i=this.columnCount;r<i;++r)this._columnSizers[r].minSize=0;for(var n=this._items.filter(function(W){return!W.isHidden}),r=0,i=n.length;r<i;++r)n[r].fit();var o=this.rowCount-1,s=this.columnCount-1;n.sort(ka.rowSpanCmp);for(var r=0,i=n.length;r<i;++r){var l=n[r],u=e.getCellConfig(l.widget),h=Math.min(u.row,o),v=Math.min(u.row+u.rowSpan-1,o);ka.distributeMin(this._rowSizers,h,v,l.minHeight)}n.sort(ka.columnSpanCmp);for(var r=0,i=n.length;r<i;++r){var l=n[r],u=e.getCellConfig(l.widget),T=Math.min(u.column,s),E=Math.min(u.column+u.columnSpan-1,s);ka.distributeMin(this._columnSizers,T,E,l.minWidth)}if(this.fitPolicy==="set-no-constraint"){xr.sendMessage(this.parent,Br.Msg.UpdateRequest);return}for(var M=o*this._rowSpacing,O=s*this._columnSpacing,r=0,i=this.rowCount;r<i;++r)M+=this._rowSizers[r].minSize;for(var r=0,i=this.columnCount;r<i;++r)O+=this._columnSizers[r].minSize;var F=this._box=ho.boxSizing(this.parent.node);O+=F.horizontalSum,M+=F.verticalSum;var z=this.parent.node.style;z.minWidth=O+"px",z.minHeight=M+"px",this._dirty=!0,this.parent.parent&&xr.sendMessage(this.parent.parent,Br.Msg.FitRequest),this._dirty&&xr.sendMessage(this.parent,Br.Msg.UpdateRequest)},e.prototype._update=function(r,i){this._dirty=!1,r<0&&(r=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=ho.boxSizing(this.parent.node));var n=this._box.paddingTop,o=this._box.paddingLeft,s=r-this._box.horizontalSum,l=i-this._box.verticalSum,u=this.rowCount-1,h=this.columnCount-1,v=u*this._rowSpacing,T=h*this._columnSpacing;lu.calc(this._rowSizers,Math.max(0,l-v)),lu.calc(this._columnSizers,Math.max(0,s-T));for(var E=0,M=n,O=this.rowCount;E<O;++E)this._rowStarts[E]=M,M+=this._rowSizers[E].size+this._rowSpacing;for(var E=0,M=o,O=this.columnCount;E<O;++E)this._columnStarts[E]=M,M+=this._columnSizers[E].size+this._columnSpacing;for(var E=0,O=this._items.length;E<O;++E){var F=this._items[E];if(!F.isHidden){var z=e.getCellConfig(F.widget),W=Math.min(z.row,u),J=Math.min(z.column,h),K=Math.min(z.row+z.rowSpan-1,u),ne=Math.min(z.column+z.columnSpan-1,h),ge=this._columnStarts[J],H=this._rowStarts[W],me=this._columnStarts[ne]+this._columnSizers[ne].size-ge,fe=this._rowStarts[K]+this._rowSizers[K].size-H;F.update(ge,H,me,fe)}}},e}(MA);(function(t){function e(i){return ka.cellConfigProperty.get(i)}t.getCellConfig=e;function r(i,n){ka.cellConfigProperty.set(i,ka.normalizeConfig(n))}t.setCellConfig=r})(ak||(ak={}));var ka;(function(t){t.cellConfigProperty=new lc({name:"cellConfig",create:function(){return{row:0,column:0,rowSpan:1,columnSpan:1}},changed:l});function e(u){var h=Math.max(0,Math.floor(u.row||0)),v=Math.max(0,Math.floor(u.column||0)),T=Math.max(1,Math.floor(u.rowSpan||0)),E=Math.max(1,Math.floor(u.columnSpan||0));return{row:h,column:v,rowSpan:T,columnSpan:E}}t.normalizeConfig=e;function r(u){return Math.max(0,Math.floor(u))}t.clampValue=r;function i(u,h){var v=t.cellConfigProperty.get(u.widget),T=t.cellConfigProperty.get(h.widget);return v.rowSpan-T.rowSpan}t.rowSpanCmp=i;function n(u,h){var v=t.cellConfigProperty.get(u.widget),T=t.cellConfigProperty.get(h.widget);return v.columnSpan-T.columnSpan}t.columnSpanCmp=n;function o(u,h){for(h=Math.max(1,Math.floor(h));u.length<h;)u.push(new CA);u.length>h&&(u.length=h)}t.reallocSizers=o;function s(u,h,v,T){if(!(v<h)){if(h===v){var E=u[h];E.minSize=Math.max(E.minSize,T);return}for(var M=0,O=h;O<=v;++O)M+=u[O].minSize;if(!(M>=T))for(var F=(T-M)/(v-h+1),O=h;O<=v;++O)u[O].minSize+=F}}t.distributeMin=s;function l(u){u.parent&&u.parent.layout instanceof ak&&u.parent.fit()}})(ka||(ka={}));var Vee=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{node:ZI.createNode()})||this;return i._activeIndex=-1,i._tabFocusIndex=0,i._menus=[],i._childMenu=null,i.addClass("lm-MenuBar"),i.addClass("p-MenuBar"),i.setFlag(Br.Flag.DisallowLayout),i.renderer=r.renderer||e.defaultRenderer,i._forceItemsPosition=r.forceItemsPosition||{forceX:!0,forceY:!0},i}return e.prototype.dispose=function(){this._closeChildMenu(),this._menus.length=0,t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeMenu",{get:function(){return this._menus[this._activeIndex]||null},set:function(r){this.activeIndex=r?this._menus.indexOf(r):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(r){(r<0||r>=this._menus.length)&&(r=-1),this._activeIndex!==r&&(this._activeIndex=r,r!==-1&&(this._tabFocusIndex=r),this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"menus",{get:function(){return this._menus},enumerable:!0,configurable:!0}),e.prototype.openActiveMenu=function(){this._activeIndex!==-1&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))},e.prototype.addMenu=function(r){this.insertMenu(this._menus.length,r)},e.prototype.insertMenu=function(r,i){this._closeChildMenu();var n=this._menus.indexOf(i),o=Math.max(0,Math.min(r,this._menus.length));if(n===-1){rr.insert(this._menus,o,i),i.addClass("lm-MenuBar-menu"),i.addClass("p-MenuBar-menu"),i.aboutToClose.connect(this._onMenuAboutToClose,this),i.menuRequested.connect(this._onMenuMenuRequested,this),i.title.changed.connect(this._onTitleChanged,this),this.update();return}o===this._menus.length&&o--,n!==o&&(rr.move(this._menus,n,o),this.update())},e.prototype.removeMenu=function(r){this.removeMenuAt(this._menus.indexOf(r))},e.prototype.removeMenuAt=function(r){this._closeChildMenu();var i=rr.removeAt(this._menus,r);i&&(i.aboutToClose.disconnect(this._onMenuAboutToClose,this),i.menuRequested.disconnect(this._onMenuMenuRequested,this),i.title.changed.disconnect(this._onTitleChanged,this),i.removeClass("lm-MenuBar-menu"),i.removeClass("p-MenuBar-menu"),this.update())},e.prototype.clearMenus=function(){if(this._menus.length!==0){this._closeChildMenu();for(var r=0,i=this._menus;r<i.length;r++){var n=i[r];n.aboutToClose.disconnect(this._onMenuAboutToClose,this),n.menuRequested.disconnect(this._onMenuMenuRequested,this),n.title.changed.disconnect(this._onTitleChanged,this),n.removeClass("lm-MenuBar-menu"),n.removeClass("p-MenuBar-menu")}this._menus.length=0,this.update()}},e.prototype.handleEvent=function(r){switch(r.type){case"keydown":this._evtKeyDown(r);break;case"mousedown":this._evtMouseDown(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseleave":this._evtMouseLeave(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this)},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()},e.prototype.onActivateRequest=function(r){this.isAttached&&(this.activeIndex=0)},e.prototype.onUpdateRequest=function(r){for(var i=this,n=this._menus,o=this.renderer,s=this._activeIndex,l=this._tabFocusIndex>=0&&this._tabFocusIndex<n.length?this._tabFocusIndex:0,u=new Array(n.length),h=function(E,M){var O=n[E].title,F=E===s;F&&n[E].items.length==0&&(F=!1),u[E]=o.renderItem({title:O,active:F,tabbable:E===l,onfocus:function(){i.activeIndex=E}})},v=0,T=n.length;v<T;++v)h(v);td.render(u,this.contentNode)},e.prototype._evtKeyDown=function(r){var i=r.keyCode;if(i===9){this.activeIndex=-1;return}if(r.preventDefault(),r.stopPropagation(),i===13||i===32||i===38||i===40){this.openActiveMenu();return}if(i===27){this._closeChildMenu(),this.activeIndex=-1,this.node.blur();return}if(i===37){var n=this._activeIndex,o=this._menus.length;this.activeIndex=n===0?o-1:n-1;return}if(i===39){var n=this._activeIndex,o=this._menus.length;this.activeIndex=n===o-1?0:n+1;return}var s=nv().keyForKeydownEvent(r);if(s){var l=this._activeIndex+1,u=ZI.findMnemonic(this._menus,s,l);u.index!==-1&&!u.multiple?(this.activeIndex=u.index,this.openActiveMenu()):u.index!==-1?this.activeIndex=u.index:u.auto!==-1&&(this.activeIndex=u.auto)}},e.prototype._evtMouseDown=function(r){if(ho.hitTest(this.node,r.clientX,r.clientY)){r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation();var i=rr.findFirstIndex(this.contentNode.children,function(o){return ho.hitTest(o,r.clientX,r.clientY)});if(i===-1){this._closeChildMenu();return}if(r.button===0)if(this._childMenu)this._closeChildMenu(),this.activeIndex=i;else{var n=this._positionForMenu(i);lv.saveWindowData(),this.activeIndex=i,this._openChildMenu(n)}}},e.prototype._evtMouseMove=function(r){var i=rr.findFirstIndex(this.contentNode.children,function(o){return ho.hitTest(o,r.clientX,r.clientY)});if(i!==this._activeIndex&&!(i===-1&&this._childMenu)){var n=this._positionForMenu(i);lv.saveWindowData(),this.activeIndex=i,this._childMenu&&this._openChildMenu(n)}},e.prototype._positionForMenu=function(r){var i=this.contentNode.children[r],n=i.getBoundingClientRect(),o=n.left,s=n.bottom;return{top:s,left:o}},e.prototype._evtMouseLeave=function(r){this._childMenu||(this.activeIndex=-1)},e.prototype._openChildMenu=function(r){var i;r===void 0&&(r={});var n=this.activeMenu;if(!n){this._closeChildMenu();return}var o=this._childMenu;if(o!==n){this._childMenu=n,o?o.close():document.addEventListener("mousedown",this,!0),xr.sendMessage(this,Br.Msg.UpdateRequest);var s=r.left,l=r.top;(typeof s>"u"||typeof l>"u")&&(i=this._positionForMenu(this._activeIndex),s=i.left,l=i.top),o||(this.addClass("lm-mod-active"),this.addClass("p-mod-active")),n.items.length>0&&n.open(s,l,this._forceItemsPosition)}},e.prototype._closeChildMenu=function(){if(this._childMenu){this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0);var r=this._childMenu;this._childMenu=null,r.close(),this.activeIndex=-1}},e.prototype._onMenuAboutToClose=function(r){r===this._childMenu&&(this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)},e.prototype._onMenuMenuRequested=function(r,i){if(r===this._childMenu){var n=this._activeIndex,o=this._menus.length;switch(i){case"next":this.activeIndex=n===o-1?0:n+1;break;case"previous":this.activeIndex=n===0?o-1:n-1;break}this.openActiveMenu()}},e.prototype._onTitleChanged=function(){this.update()},e}(Br);(function(t){var e=function(){function r(){}return r.prototype.renderItem=function(i){var n=this.createItemClass(i),o=this.createItemDataset(i),s=this.createItemARIA(i);return so.li(ol({className:n,dataset:o,tabindex:i.tabbable?"0":"-1",onfocus:i.onfocus},s),this.renderIcon(i),this.renderLabel(i))},r.prototype.renderIcon=function(i){var n=this.createIconClass(i);return typeof i.title.icon=="string"?so.div({className:n},i.title.iconLabel):so.div({className:n},i.title.icon,i.title.iconLabel)},r.prototype.renderLabel=function(i){var n=this.formatLabel(i);return so.div({className:"lm-MenuBar-itemLabel p-MenuBar-itemLabel"},n)},r.prototype.createItemClass=function(i){var n="lm-MenuBar-item";return n+=" p-MenuBar-item",i.title.className&&(n+=" "+i.title.className),i.active&&(n+=" lm-mod-active",n+=" p-mod-active"),n},r.prototype.createItemDataset=function(i){return i.title.dataset},r.prototype.createItemARIA=function(i){return{role:"menuitem","aria-haspopup":"true"}},r.prototype.createIconClass=function(i){var n="lm-MenuBar-itemIcon";n+=" p-MenuBar-itemIcon";var o=i.title.iconClass;return o?n+" "+o:n},r.prototype.formatLabel=function(i){var n=i.title,o=n.label,s=n.mnemonic;if(s<0||s>=o.length)return o;var l=o.slice(0,s),u=o.slice(s+1),h=o[s],v=so.span({className:"lm-MenuBar-itemMnemonic p-MenuBar-itemMnemonic"},h);return[l,v,u]},r}();t.Renderer=e,t.defaultRenderer=new e})(Vee||(Vee={}));var ZI;(function(t){function e(){var i=document.createElement("div"),n=document.createElement("ul");return n.className="lm-MenuBar-content",n.classList.add("p-MenuBar-content"),i.appendChild(n),n.setAttribute("role","menubar"),i}t.createNode=e;function r(i,n,o){for(var s=-1,l=-1,u=!1,h=n.toUpperCase(),v=0,T=i.length;v<T;++v){var E=(v+o)%T,M=i[E].title;if(M.label.length!==0){var O=M.mnemonic;if(O>=0&&O<M.label.length){M.label[O].toUpperCase()===h&&(s===-1?s=E:u=!0);continue}l===-1&&M.label[0].toUpperCase()===h&&(l=E)}}return{index:s,multiple:u,auto:l}}t.findMnemonic=r})(ZI||(ZI={}));var WTt=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{node:JI.createNode()})||this;return i._onRepeat=function(){if(i._repeatTimer=-1,!!i._pressData){var n=i._pressData.part;if(n!=="thumb"){i._repeatTimer=window.setTimeout(i._onRepeat,20);var o=i._pressData.mouseX,s=i._pressData.mouseY;if(n==="decrement"){if(!ho.hitTest(i.decrementNode,o,s))return;i._stepRequested.emit("decrement");return}if(n==="increment"){if(!ho.hitTest(i.incrementNode,o,s))return;i._stepRequested.emit("increment");return}if(n==="track"){if(!ho.hitTest(i.trackNode,o,s))return;var l=i.thumbNode;if(ho.hitTest(l,o,s))return;var u=l.getBoundingClientRect(),h=void 0;i._orientation==="horizontal"?h=o<u.left?"decrement":"increment":h=s<u.top?"decrement":"increment",i._pageRequested.emit(h);return}}}},i._value=0,i._page=10,i._maximum=100,i._repeatTimer=-1,i._pressData=null,i._thumbMoved=new Wn(i),i._stepRequested=new Wn(i),i._pageRequested=new Wn(i),i.addClass("lm-ScrollBar"),i.addClass("p-ScrollBar"),i.setFlag(Br.Flag.DisallowLayout),i._orientation=r.orientation||"vertical",i.dataset.orientation=i._orientation,r.maximum!==void 0&&(i._maximum=Math.max(0,r.maximum)),r.page!==void 0&&(i._page=Math.max(0,r.page)),r.value!==void 0&&(i._value=Math.max(0,Math.min(r.value,i._maximum))),i}return Object.defineProperty(e.prototype,"thumbMoved",{get:function(){return this._thumbMoved},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepRequested",{get:function(){return this._stepRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageRequested",{get:function(){return this._pageRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(r){this._orientation!==r&&(this._releaseMouse(),this._orientation=r,this.dataset.orientation=r,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(r){r=Math.max(0,Math.min(r,this._maximum)),this._value!==r&&(this._value=r,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this._page},set:function(r){r=Math.max(0,r),this._page!==r&&(this._page=r,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(r){r=Math.max(0,r),this._maximum!==r&&(this._maximum=r,this._value=Math.min(this._value,r),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"incrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trackNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-track")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"thumbNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-thumb")[0]},enumerable:!0,configurable:!0}),e.prototype.handleEvent=function(r){switch(r.type){case"mousedown":this._evtMouseDown(r);break;case"mousemove":this._evtMouseMove(r);break;case"mouseup":this._evtMouseUp(r);break;case"keydown":this._evtKeyDown(r);break;case"contextmenu":r.preventDefault(),r.stopPropagation();break}},e.prototype.onBeforeAttach=function(r){this.node.addEventListener("mousedown",this),this.update()},e.prototype.onAfterDetach=function(r){this.node.removeEventListener("mousedown",this),this._releaseMouse()},e.prototype.onUpdateRequest=function(r){var i=this._value*100/this._maximum,n=this._page*100/(this._page+this._maximum);i=Math.max(0,Math.min(i,100)),n=Math.max(0,Math.min(n,100));var o=this.thumbNode.style;this._orientation==="horizontal"?(o.top="",o.height="",o.left=i+"%",o.width=n+"%",o.transform="translate("+-i+"%, 0%)"):(o.left="",o.width="",o.top=i+"%",o.height=n+"%",o.transform="translate(0%, "+-i+"%)")},e.prototype._evtKeyDown=function(r){if(r.preventDefault(),r.stopPropagation(),r.keyCode===27){var i=this._pressData?this._pressData.value:-1;this._releaseMouse(),i!==-1&&this._moveThumb(i)}},e.prototype._evtMouseDown=function(r){if(r.button===0&&(this.activate(),!this._pressData)){var i=JI.findPart(this,r.target);if(i){r.preventDefault(),r.stopPropagation();var n=EA.overrideCursor("default");if(this._pressData={part:i,override:n,delta:-1,value:-1,mouseX:r.clientX,mouseY:r.clientY},document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0),i==="thumb"){var o=this.thumbNode,s=o.getBoundingClientRect();this._orientation==="horizontal"?this._pressData.delta=r.clientX-s.left:this._pressData.delta=r.clientY-s.top,o.classList.add("lm-mod-active"),o.classList.add("p-mod-active"),this._pressData.value=this._value;return}if(i==="track"){var s=this.thumbNode.getBoundingClientRect(),l=void 0;this._orientation==="horizontal"?l=r.clientX<s.left?"decrement":"increment":l=r.clientY<s.top?"decrement":"increment",this._repeatTimer=window.setTimeout(this._onRepeat,350),this._pageRequested.emit(l);return}if(i==="decrement"){this.decrementNode.classList.add("lm-mod-active"),this.decrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),this._stepRequested.emit("decrement");return}if(i==="increment"){this.incrementNode.classList.add("lm-mod-active"),this.incrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),this._stepRequested.emit("increment");return}}}},e.prototype._evtMouseMove=function(r){if(this._pressData&&(r.preventDefault(),r.stopPropagation(),this._pressData.mouseX=r.clientX,this._pressData.mouseY=r.clientY,this._pressData.part==="thumb")){var i=this.thumbNode.getBoundingClientRect(),n=this.trackNode.getBoundingClientRect(),o,s;this._orientation==="horizontal"?(o=r.clientX-n.left-this._pressData.delta,s=n.width-i.width):(o=r.clientY-n.top-this._pressData.delta,s=n.height-i.height);var l=s===0?0:o*this._maximum/s;this._moveThumb(l)}},e.prototype._evtMouseUp=function(r){r.button===0&&(r.preventDefault(),r.stopPropagation(),this._releaseMouse())},e.prototype._releaseMouse=function(){this._pressData&&(clearTimeout(this._repeatTimer),this._repeatTimer=-1,this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),this.thumbNode.classList.remove("lm-mod-active"),this.decrementNode.classList.remove("lm-mod-active"),this.incrementNode.classList.remove("lm-mod-active"),this.thumbNode.classList.remove("p-mod-active"),this.decrementNode.classList.remove("p-mod-active"),this.incrementNode.classList.remove("p-mod-active"))},e.prototype._moveThumb=function(r){r=Math.max(0,Math.min(r,this._maximum)),this._value!==r&&(this._value=r,this.update(),this._thumbMoved.emit(r))},e}(Br),JI;(function(t){function e(){var i=document.createElement("div"),n=document.createElement("div"),o=document.createElement("div"),s=document.createElement("div"),l=document.createElement("div");return n.className="lm-ScrollBar-button",o.className="lm-ScrollBar-button",n.dataset.action="decrement",o.dataset.action="increment",s.className="lm-ScrollBar-track",l.className="lm-ScrollBar-thumb",n.classList.add("p-ScrollBar-button"),o.classList.add("p-ScrollBar-button"),s.classList.add("p-ScrollBar-track"),l.classList.add("p-ScrollBar-thumb"),s.appendChild(l),i.appendChild(n),i.appendChild(s),i.appendChild(o),i}t.createNode=e;function r(i,n){return i.thumbNode.contains(n)?"thumb":i.trackNode.contains(n)?"track":i.decrementNode.contains(n)?"decrement":i.incrementNode.contains(n)?"increment":null}t.findPart=r})(JI||(JI={}));var qTt=function(t){ks(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._widget=null,r}return e.prototype.dispose=function(){if(this._widget){var r=this._widget;this._widget=null,r.dispose()}t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"widget",{get:function(){return this._widget},set:function(r){r&&(r.parent=this.parent),this._widget!==r&&(this._widget&&this._widget.dispose(),this._widget=r,this.parent&&r&&this.attachWidget(r))},enumerable:!0,configurable:!0}),e.prototype.iter=function(){return this._widget?Uw(this._widget):su()},e.prototype.removeWidget=function(r){this._widget===r&&(this._widget=null,this.parent&&this.detachWidget(r))},e.prototype.init=function(){var r=this;t.prototype.init.call(this),Ei(this,function(i){r.attachWidget(i)})},e.prototype.attachWidget=function(r){this.parent.isAttached&&xr.sendMessage(r,Br.Msg.BeforeAttach),this.parent.node.appendChild(r.node),this.parent.isAttached&&xr.sendMessage(r,Br.Msg.AfterAttach)},e.prototype.detachWidget=function(r){this.parent.isAttached&&xr.sendMessage(r,Br.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&xr.sendMessage(r,Br.Msg.AfterDetach)},e}(MA),ZMe=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,r)||this;return i._dirty=!1,i._items=[],i._box=null,i._hiddenMode=r.hiddenMode!==void 0?r.hiddenMode:Br.HiddenMode.Display,i}return Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(r){var i=this;this._hiddenMode!==r&&(this._hiddenMode=r,this.widgets.length>1&&this.widgets.forEach(function(n){n.hiddenMode=i._hiddenMode}))},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){Ei(this._items,function(r){r.dispose()}),this._box=null,this._items.length=0,t.prototype.dispose.call(this)},e.prototype.attachWidget=function(r,i){this._hiddenMode===Br.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=Br.HiddenMode.Scale),i.hiddenMode=Br.HiddenMode.Scale):i.hiddenMode=Br.HiddenMode.Display,rr.insert(this._items,r,new Hw(i)),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeAttach),this.parent.node.appendChild(i.node),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterAttach),this.parent.fit()},e.prototype.moveWidget=function(r,i,n){rr.move(this._items,r,i),this.parent.update()},e.prototype.detachWidget=function(r,i){var n=rr.removeAt(this._items,r);this.parent.isAttached&&xr.sendMessage(i,Br.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&xr.sendMessage(i,Br.Msg.AfterDetach),n.widget.node.style.zIndex="",this._hiddenMode===Br.HiddenMode.Scale&&(i.hiddenMode=Br.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=Br.HiddenMode.Display)),n.dispose(),this.parent.fit()},e.prototype.onBeforeShow=function(r){t.prototype.onBeforeShow.call(this,r),this.parent.update()},e.prototype.onBeforeAttach=function(r){t.prototype.onBeforeAttach.call(this,r),this.parent.fit()},e.prototype.onChildShown=function(r){this.parent.fit()},e.prototype.onChildHidden=function(r){this.parent.fit()},e.prototype.onResize=function(r){this.parent.isVisible&&this._update(r.width,r.height)},e.prototype.onUpdateRequest=function(r){this.parent.isVisible&&this._update(-1,-1)},e.prototype.onFitRequest=function(r){this.parent.isAttached&&this._fit()},e.prototype._fit=function(){for(var r=0,i=0,n=0,o=this._items.length;n<o;++n){var s=this._items[n];s.isHidden||(s.fit(),r=Math.max(r,s.minWidth),i=Math.max(i,s.minHeight))}var l=this._box=ho.boxSizing(this.parent.node);r+=l.horizontalSum,i+=l.verticalSum;var u=this.parent.node.style;u.minWidth=r+"px",u.minHeight=i+"px",this._dirty=!0,this.parent.parent&&xr.sendMessage(this.parent.parent,Br.Msg.FitRequest),this._dirty&&xr.sendMessage(this.parent,Br.Msg.UpdateRequest)},e.prototype._update=function(r,i){this._dirty=!1;for(var n=0,o=0,s=this._items.length;o<s;++o)n+=+!this._items[o].isHidden;if(n!==0){r<0&&(r=this.parent.node.offsetWidth),i<0&&(i=this.parent.node.offsetHeight),this._box||(this._box=ho.boxSizing(this.parent.node));for(var l=this._box.paddingTop,u=this._box.paddingLeft,h=r-this._box.horizontalSum,v=i-this._box.verticalSum,o=0,s=this._items.length;o<s;++o){var T=this._items[o];T.isHidden||(T.widget.node.style.zIndex=""+o,T.update(u,l,h,v))}}},e}(QI),JMe=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this,{layout:lk.createLayout(r)})||this;return i._widgetRemoved=new Wn(i),i.addClass("lm-StackedPanel"),i.addClass("p-StackedPanel"),i}return Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(r){this.layout.hiddenMode=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgetRemoved",{get:function(){return this._widgetRemoved},enumerable:!0,configurable:!0}),e.prototype.onChildAdded=function(r){r.child.addClass("lm-StackedPanel-child"),r.child.addClass("p-StackedPanel-child")},e.prototype.onChildRemoved=function(r){r.child.removeClass("lm-StackedPanel-child"),r.child.removeClass("p-StackedPanel-child"),this._widgetRemoved.emit(r.child)},e}(Gw),lk;(function(t){function e(r){return r.layout||new ZMe}t.createLayout=e})(lk||(lk={}));var XTt=function(t){ks(e,t);function e(r){r===void 0&&(r={});var i=t.call(this)||this;i._currentChanged=new Wn(i),i._addRequested=new Wn(i),i.addClass("lm-TabPanel"),i.addClass("p-TabPanel"),i.tabBar=new cv(r),i.tabBar.addClass("lm-TabPanel-tabBar"),i.stackedPanel=new JMe,i.stackedPanel.addClass("lm-TabPanel-stackedPanel"),i.tabBar.addClass("p-TabPanel-tabBar"),i.stackedPanel.addClass("p-TabPanel-stackedPanel"),i.tabBar.tabMoved.connect(i._onTabMoved,i),i.tabBar.currentChanged.connect(i._onCurrentChanged,i),i.tabBar.tabCloseRequested.connect(i._onTabCloseRequested,i),i.tabBar.tabActivateRequested.connect(i._onTabActivateRequested,i),i.tabBar.addRequested.connect(i._onTabAddRequested,i),i.stackedPanel.widgetRemoved.connect(i._onWidgetRemoved,i),i._tabPlacement=r.tabPlacement||"top";var n=av.directionFromPlacement(i._tabPlacement),o=av.orientationFromPlacement(i._tabPlacement);i.tabBar.orientation=o,i.tabBar.dataset.placement=i._tabPlacement;var s=new Gf({direction:n,spacing:0});return Gf.setStretch(i.tabBar,0),Gf.setStretch(i.stackedPanel,1),s.addWidget(i.tabBar),s.addWidget(i.stackedPanel),i.layout=s,i}return Object.defineProperty(e.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this.tabBar.currentIndex},set:function(r){this.tabBar.currentIndex=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentWidget",{get:function(){var r=this.tabBar.currentTitle;return r?r.owner:null},set:function(r){this.tabBar.currentTitle=r?r.title:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabsMovable",{get:function(){return this.tabBar.tabsMovable},set:function(r){this.tabBar.tabsMovable=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addButtonEnabled",{get:function(){return this.tabBar.addButtonEnabled},set:function(r){this.tabBar.addButtonEnabled=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabPlacement",{get:function(){return this._tabPlacement},set:function(r){if(this._tabPlacement!==r){this._tabPlacement=r;var i=av.directionFromPlacement(r),n=av.orientationFromPlacement(r);this.tabBar.orientation=n,this.tabBar.dataset.placement=r,this.layout.direction=i}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgets",{get:function(){return this.stackedPanel.widgets},enumerable:!0,configurable:!0}),e.prototype.addWidget=function(r){this.insertWidget(this.widgets.length,r)},e.prototype.insertWidget=function(r,i){i!==this.currentWidget&&i.hide(),this.stackedPanel.insertWidget(r,i),this.tabBar.insertTab(r,i.title),i.node.setAttribute("role","tabpanel");var n=this.tabBar.renderer;if(n instanceof cv.Renderer){var o=n.createTabKey({title:i.title,current:!1,zIndex:0});i.node.setAttribute("aria-labelledby",o)}},e.prototype._onCurrentChanged=function(r,i){var n=i.previousIndex,o=i.previousTitle,s=i.currentIndex,l=i.currentTitle,u=o?o.owner:null,h=l?l.owner:null;u&&u.hide(),h&&h.show(),this._currentChanged.emit({previousIndex:n,previousWidget:u,currentIndex:s,currentWidget:h}),(nl.IS_EDGE||nl.IS_IE)&&xr.flush()},e.prototype._onTabAddRequested=function(r,i){this._addRequested.emit(r)},e.prototype._onTabActivateRequested=function(r,i){i.title.owner.activate()},e.prototype._onTabCloseRequested=function(r,i){i.title.owner.close()},e.prototype._onTabMoved=function(r,i){this.stackedPanel.insertWidget(i.toIndex,i.title.owner)},e.prototype._onWidgetRemoved=function(r,i){i.node.removeAttribute("role"),i.node.removeAttribute("aria-labelledby"),this.tabBar.removeTab(i.title)},e}(Br),av;(function(t){function e(o){return i[o]}t.orientationFromPlacement=e;function r(o){return n[o]}t.directionFromPlacement=r;var i={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},n={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}})(av||(av={}));var uv=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),IA=function(){return IA=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},IA.apply(this,arguments)},QMe="IPY_MODEL_";function Ww(t,e){if(Array.isArray(t)){var r=[];return t.forEach(function(n,o){r.push(Ww(n,e))}),Promise.all(r)}else if(t instanceof Object){var i={};return Object.keys(t).forEach(function(n){i[n]=Ww(t[n],e)}),My(i)}else return typeof t=="string"&&t.slice(0,10)==="IPY_MODEL_"?e.get_model(t.slice(10,t.length)):Promise.resolve(t)}function uk(t,e){if(Array.isArray(t)){for(var r=[],i=0,n=t;i<n.length;i++){var o=n[i];r.push(uk(o,e))}return r}else{if(t instanceof PA)return""+QMe+t.model_id;if(t instanceof Object&&typeof t!="string"){var s={};Object.keys(t).forEach(function(l){s[l]=uk(t[l],e)})}else return t}}var PA=function(t){uv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.defaults=function(){return{_model_module:"@jupyter-widgets/base",_model_name:"WidgetModel",_model_module_version:NM,_view_module:"@jupyter-widgets/base",_view_name:null,_view_module_version:NM,_view_count:null}},e.prototype.isNew=function(){return!1},e.prototype.initialize=function(r,i){this._expectedEchoMsgIds={},this._attrsToUpdate={},t.prototype.initialize.call(this,r,i),this.widget_manager=i.widget_manager,this.model_id=i.model_id;var n=i.comm;this.views=Object.create(null),this.state_change=Promise.resolve(),this._closed=!1,this._state_lock=null,this._msg_buffer=null,this._msg_buffer_callbacks=null,this._pending_msgs=0,this._buffered_state_diff={},n?(this.comm=n,n.on_close(this._handle_comm_closed.bind(this)),n.on_msg(this._handle_comm_msg.bind(this)),this.comm_live=!0):this.comm_live=!1},Object.defineProperty(e.prototype,"comm_live",{get:function(){return this._comm_live},set:function(r){this._comm_live=r,this.trigger("comm_live_update")},enumerable:!0,configurable:!0}),e.prototype.send=function(r,i,n){if(this.comm!==void 0){var o={method:"custom",content:r};this.comm.send(o,i,{},n)}},e.prototype.close=function(r){var i=this;if(r===void 0&&(r=!1),!this._closed){this._closed=!0,this.comm&&!r&&this.comm.close(),this.stopListening(),this.trigger("destroy",this),this.comm&&delete this.comm;var n=Object.keys(this.views).map(function(o){return i.views[o].then(function(s){return s.remove()})});return delete this.views,Promise.all(n).then(function(){})}},e.prototype._handle_comm_closed=function(r){this.trigger("comm:close"),this.close(!0)},e.prototype._handle_comm_msg=function(r){var i=this,n=r.content.data,o=n.method;switch(o){case"update":case"echo_update":return this.state_change=this.state_change.then(function(){var s,l,u,h=n.state,v=(s=n.buffer_paths,s??[]),T=(u=(l=r.buffers)===null||l===void 0?void 0:l.slice(0,v.length),u??[]).map(function(O){return O instanceof DataView?O:new DataView(O instanceof ArrayBuffer?O:O.buffer)});if(uA(h,v,T),r.parent_header&&o==="echo_update"){var E=r.parent_header.msg_id,M=Object.keys(h).filter(function(O){return i._expectedEchoMsgIds.hasOwnProperty(O)});M.forEach(function(O){var F=i._expectedEchoMsgIds[O]!==E;F?delete h[O]:(delete i._expectedEchoMsgIds[O],i._msg_buffer!==null&&Object.prototype.hasOwnProperty.call(i._msg_buffer,O)&&delete h[O])})}return i.constructor._deserialize_state(h,i.widget_manager)}).then(function(s){i.set_state(s)}).catch(Hh("Could not process update msg for model id: "+this.model_id,!0)),this.state_change;case"custom":return this.trigger("msg:custom",n.content,r.buffers),Promise.resolve()}},e.prototype.set_state=function(r){this._state_lock=r;try{this.set(r)}catch(i){console.error("Error setting state: "+i.message)}finally{this._state_lock=null}},e.prototype.get_state=function(r){var i=this.attributes;if(r){var n=this.defaults,o=typeof n=="function"?n.call(this):n,s={};return Object.keys(i).forEach(function(l){Cy(i[l],o[l])||(s[l]=i[l])}),s}else return IA({},i)},e.prototype._handle_status=function(r){if(this.comm!==void 0&&r.content.execution_state==="idle"&&(this._pending_msgs--,this._pending_msgs<0&&(console.error("Jupyter Widgets message throttle: Pending messages < 0 (="+this._pending_msgs+"), which is unexpected. Resetting to 0 to continue."),this._pending_msgs=0),this._msg_buffer!==null&&this._pending_msgs<1)){var i=this.send_sync_message(this._msg_buffer,this._msg_buffer_callbacks);this.rememberLastUpdateFor(i),this._msg_buffer=null,this._msg_buffer_callbacks=null}},e.prototype.callbacks=function(r){return this.widget_manager.callbacks(r)},e.prototype.set=function(r,i,n){var o=zQ.call(this,r,i,n);if(this._buffered_state_diff!==void 0){var s=this.changedAttributes()||{};if(this._state_lock)for(var l=0,u=Object.keys(this._state_lock);l<u.length;l++){var h=u[l];s[h]===this._state_lock[h]&&delete s[h]}this._buffered_state_diff=Yp(this._buffered_state_diff,s)}return o},e.prototype.sync=function(r,i,n){var o=this;if(n===void 0&&(n={}),this.comm===void 0)throw"Syncing error: no comm channel defined";var s=r==="patch"?n.attrs:i.get_state(n.drop_defaults);if(this._state_lock)for(var l=0,u=Object.keys(this._state_lock);l<u.length;l++){var h=u[l];s[h]===this._state_lock[h]&&delete s[h]}Object.keys(s).forEach(function(M){o._attrsToUpdate[M]=!0});var v=this.serialize(s);if(Object.keys(v).length>0){var T=n.callbacks||this.callbacks();if(this._pending_msgs>=1){switch(r){case"patch":this._msg_buffer=Yp(this._msg_buffer||{},v);break;case"update":case"create":this._msg_buffer=v;break;default:throw"unrecognized syncing method"}this._msg_buffer_callbacks=T}else{var E=this.send_sync_message(s,T);this.rememberLastUpdateFor(E)}}},e.prototype.rememberLastUpdateFor=function(r){var i=this;Object.keys(this._attrsToUpdate).forEach(function(n){i._expectedEchoMsgIds[n]=r}),this._attrsToUpdate={}},e.prototype.serialize=function(r){for(var i=this.constructor.serializers||{},n=0,o=Object.keys(r);n<o.length;n++){var s=o[n];try{i[s]&&i[s].serialize?r[s]=i[s].serialize(r[s],this):r[s]=JSON.parse(JSON.stringify(r[s])),r[s]&&r[s].toJSON&&(r[s]=r[s].toJSON())}catch(l){throw console.error("Error serializing widget state attribute: ",s),l}}return r},e.prototype.send_sync_message=function(r,i){var n=this;if(i===void 0&&(i={}),!this.comm)return"";try{i={shell:IA({},i.shell),iopub:IA({},i.iopub),input:i.input};var o=i.iopub.status;i.iopub.status=function(u){n._handle_status(u),o&&o(u)};var s=ow(r),l=this.comm.send({method:"update",state:s.state,buffer_paths:s.buffer_paths},i,{},s.buffers);return this._pending_msgs++,l}catch(u){console.error("Could not send widget sync message",u)}return""},e.prototype.save_changes=function(r){if(this.comm_live){var i={patch:!0};r&&(i.callbacks=r),this.save(this._buffered_state_diff,i),this._buffered_state_diff={}}},e.prototype.on_some_change=function(r,i,n){var o=this;this.on("change",function(){r.some(o.hasChanged,o)&&i.apply(n,arguments)},this)},e.prototype.toJSON=function(r){return"IPY_MODEL_"+this.model_id},e._deserialize_state=function(r,i){var n=this.serializers,o;if(n){o={};for(var s in r)n[s]&&n[s].deserialize?o[s]=n[s].deserialize(r[s],i):o[s]=r[s]}else o=r;return My(o)},e}(jee.Model);var fk=function(t){uv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.defaults=function(){return Yp(t.prototype.defaults.call(this),{_dom_classes:[]})},e.serializers=IA(IA({},PA.serializers),{layout:{deserialize:Ww},style:{deserialize:Ww}}),e}(PA);var fv=function(t){uv(e,t);function e(r){return t.call(this,r)||this}return e.prototype.initialize=function(r){var i=this;this.listenTo(this.model,"change",function(){var n=Object.keys(i.model.changedAttributes()||{});n[0]==="_view_count"&&n.length===1||i.update()}),this.options=r.options,this.once("remove",function(){typeof i.model.get("_view_count")=="number"&&(i.model.set("_view_count",i.model.get("_view_count")-1),i.model.save_changes())}),this.once("displayed",function(){typeof i.model.get("_view_count")=="number"&&(i.model.set("_view_count",i.model.get("_view_count")+1),i.model.save_changes())}),this.displayed=new Promise(function(n,o){i.once("displayed",n)})},e.prototype.update=function(r){},e.prototype.render=function(){},e.prototype.create_child_view=function(r,i){return i===void 0&&(i={}),i=IA({parent:this},i),this.model.widget_manager.create_view(r,i).catch(Hh("Could not create child view",!0))},e.prototype.callbacks=function(){return this.model.callbacks(this)},e.prototype.send=function(r,i){this.model.send(r,this.callbacks(),i)},e.prototype.touch=function(){this.model.save_changes(this.callbacks())},e.prototype.remove=function(){return t.prototype.remove.call(this),this.trigger("remove"),this},e}(Cee);var Hee=function(t){uv(e,t);function e(r){var i=this,n=r.view;return delete r.view,i=t.call(this,r)||this,i._view=n,i}return e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._view&&this._view.remove(),this._view=null)},e.prototype.processMessage=function(r){t.prototype.processMessage.call(this,r),this._view.processPhosphorMessage(r)},e}(Br);var $Me=function(t){uv(e,t);function e(r){var i=this,n=r.view;return delete r.view,i=t.call(this,r)||this,i._view=n,i}return e.prototype.processMessage=function(r){t.prototype.processMessage.call(this,r),this._view.processPhosphorMessage(r)},e.prototype.dispose=function(){this.isDisposed||(t.prototype.dispose.call(this),this._view&&this._view.remove(),this._view=null)},e}(Gw);var hk=function(t){uv(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.initialize=function(r){var i=this;t.prototype.initialize.call(this,r),this.listenTo(this.model,"change:_dom_classes",function(n,o){var s=n.previous("_dom_classes");i.update_classes(s,o)}),this.layoutPromise=Promise.resolve(),this.listenTo(this.model,"change:layout",function(n,o){i.setLayout(o,n.previous("layout"))}),this.stylePromise=Promise.resolve(),this.listenTo(this.model,"change:style",function(n,o){i.setStyle(o,n.previous("style"))}),this.displayed.then(function(){i.update_classes([],i.model.get("_dom_classes")),i.setLayout(i.model.get("layout")),i.setStyle(i.model.get("style"))}),this._comm_live_update(),this.listenTo(this.model,"comm_live_update",function(){i._comm_live_update()})},e.prototype.setLayout=function(r,i){var n=this;r&&(this.layoutPromise=this.layoutPromise.then(function(o){return o&&(o.unlayout(),n.stopListening(o.model),o.remove()),n.create_child_view(r).then(function(s){return n.displayed.then(function(){return s.trigger("displayed"),n.listenTo(s.model,"change",function(){xr.postMessage(n.pWidget,Br.ResizeMessage.UnknownSize)}),xr.postMessage(n.pWidget,Br.ResizeMessage.UnknownSize),s})}).catch(Hh("Could not add LayoutView to DOMWidgetView",!0))}))},e.prototype.setStyle=function(r,i){var n=this;r&&(this.stylePromise=this.stylePromise.then(function(o){return o&&(o.unstyle(),n.stopListening(o.model),o.remove()),n.create_child_view(r).then(function(s){return n.displayed.then(function(){return s.trigger("displayed"),s})}).catch(Hh("Could not add styleView to DOMWidgetView",!0))}))},e.prototype.update_classes=function(r,i,n){n===void 0&&(n=this.el),FM(r,i).map(function(o){n.classList?n.classList.remove(o):n.setAttribute("class",n.getAttribute("class").replace(o,""))}),FM(i,r).map(function(o){n.classList?n.classList.add(o):n.setAttribute("class",n.getAttribute("class").concat(" ",o))})},e.prototype.update_mapped_classes=function(r,i,n){var o=this.model.previous(i),s=r[o]?r[o]:[];o=this.model.get(i);var l=r[o]?r[o]:[];this.update_classes(s,l,n||this.el)},e.prototype.set_mapped_classes=function(r,i,n){var o=this.model.get(i),s=r[o]?r[o]:[];this.update_classes([],s,n||this.el)},e.prototype._setElement=function(r){this.pWidget&&this.pWidget.dispose(),this.$el=r instanceof ck.default?r:(0,ck.default)(r),this.el=this.$el[0],this.pWidget=new Hee({node:r,view:this})},e.prototype.remove=function(){return this.pWidget&&this.pWidget.dispose(),t.prototype.remove.call(this)},e.prototype.processPhosphorMessage=function(r){switch(r.type){case"after-attach":this.trigger("displayed");break}},e.prototype._comm_live_update=function(){this.model.comm_live?this.pWidget.removeClass("jupyter-widgets-disconnected"):this.pWidget.addClass("jupyter-widgets-disconnected")},e}(fv);var Gee=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),Wee={align_content:null,align_items:null,align_self:null,border:null,bottom:null,display:null,flex:null,flex_flow:null,height:null,justify_content:null,justify_items:null,left:null,margin:null,max_height:null,max_width:null,min_height:null,min_width:null,overflow:null,overflow_x:null,overflow_y:null,order:null,padding:null,right:null,top:null,visibility:null,width:null,object_fit:null,object_position:null,grid_auto_columns:null,grid_auto_flow:null,grid_auto_rows:null,grid_gap:null,grid_template_rows:null,grid_template_columns:null,grid_template_areas:null,grid_row:null,grid_column:null,grid_area:null},eIe=function(t){Gee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.defaults=function(){return Yp(t.prototype.defaults.call(this),{_model_name:"LayoutModel",_view_name:"LayoutView"},Wee)},e}(PA);var tIe=function(t){Gee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.initialize=function(r){this._traitNames=[],t.prototype.initialize.call(this,r);for(var i=0,n=Object.keys(Wee);i<n.length;i++){var o=n[i];this.registerTrait(o)}},e.prototype.registerTrait=function(r){var i=this;if(this._traitNames.push(r),r==="overflow_x"||r==="overflow_y"){this.listenTo(this.model,"change:"+r,function(n,o){i.handleOverflowChange(r,o)}),this.handleOverflowChange(r,this.model.get(r));return}this.listenTo(this.model,"change:"+r,function(n,o){i.handleChange(r,o)}),this.handleChange(r,this.model.get(r))},e.prototype.css_name=function(r){return r.replace(/_/g,"-")},e.prototype.handleChange=function(r,i){var n=this.options.parent;n?i===null?n.el.style.removeProperty(this.css_name(r)):n.el.style[this.css_name(r)]=i:console.warn("Style not applied because a parent view does not exist")},e.prototype.handleOverflowChange=function(r,i){var n=this.options.parent;n?i===null?this.model.get("overflow")===null&&n.el.style.removeProperty(this.css_name(r)):n.el.style[this.css_name(r)]=i:console.warn("Style not applied because a parent view does not exist")},e.prototype.unlayout=function(){var r=this,i=this.options.parent;this._traitNames.forEach(function(n){i?i.el.style.removeProperty(r.css_name(n)):console.warn("Style not removed because a parent view does not exist")},this)},e}(fv);var qee=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},t(e,r)};return function(e,r){t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}}(),rIe=function(t){qee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.defaults=function(){var r=this.constructor;return Yp(t.prototype.defaults.call(this),{_model_name:"StyleModel",_view_name:"StyleView"},Object.keys(r.styleProperties).reduce(function(i,n){return i[n]=r.styleProperties[n].default,i},{}))},e.styleProperties={},e}(PA);var iIe=function(t){qee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.initialize=function(r){this._traitNames=[],t.prototype.initialize.call(this,r);for(var i=this.model.constructor,n=0,o=Object.keys(i.styleProperties);n<o.length;n++){var s=o[n];this.registerTrait(s)}this.style()},e.prototype.registerTrait=function(r){var i=this;this._traitNames.push(r),this.listenTo(this.model,"change:"+r,function(n,o){i.handleChange(r,o)})},e.prototype.handleChange=function(r,i){var n=this.options.parent;if(n){var o=this.model.constructor,s=o.styleProperties,l=s[r].attribute,u=s[r].selector,h=u?n.el.querySelectorAll(u):[n.el];if(i===null)for(var v=0;v!==h.length;++v)h[v].style.removeProperty(l);else for(var v=0;v!==h.length;++v)h[v].style[l]=i}else console.warn("Style not applied because a parent view does not exist")},e.prototype.style=function(){for(var r=0,i=this._traitNames;r<i.length;r++){var n=i[r];this.handleChange(n,this.model.get(n))}},e.prototype.unstyle=function(){var r=this.options.parent,i=this.model.constructor,n=i.styleProperties;this._traitNames.forEach(function(o){if(r)for(var s=n[o].attribute,l=n[o].selector,u=l?r.el.querySelectorAll(l):[r.el],h=0;h!==u.length;++h)u[h].style.removeProperty(s);else console.warn("Style not removed because a parent view does not exist")},this)},e}(fv);var nIe=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function l(v){try{h(i.next(v))}catch(T){s(T)}}function u(v){try{h(i.throw(v))}catch(T){s(T)}}function h(v){v.done?o(v.value):n(v.value).then(l,u)}h((i=i.apply(t,e||[])).next())})},oIe=function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,n,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(h){return function(v){return u([h,v])}}function u(h){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(o=h[0]&2?n.return:h[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,h[1])).done)return o;switch(n=0,o&&(h=[h[0]&2,o.value]),h[0]){case 0:case 1:o=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,n=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!o||h[1]>o[0]&&h[1]<o[3])){r.label=h[1];break}if(h[0]===6&&r.label<o[1]){r.label=o[1],o=h;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(h);break}o[2]&&r.ops.pop(),r.trys.pop();continue}h=e.call(t,r)}catch(v){h=[6,v],n=0}finally{i=o=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},pk;(function(t){var e;(function(r){var i=function(){function o(s){this.targets=Object.create(null),this.comms=Object.create(null),this.kernel=null,this.jsServicesKernel=null,this.init_kernel(s)}return o.prototype.init_kernel=function(s){this.kernel=s,this.jsServicesKernel=s},o.prototype.new_comm=function(s,l,u,h,v,T){return nIe(this,void 0,void 0,function(){var E,M;return oIe(this,function(O){return E=this.jsServicesKernel.createComm(s,v),M=new n(E),this.register_comm(M),M.open(l,u,h,T),[2,M]})})},o.prototype.register_target=function(s,l){var u=this,h=this.jsServicesKernel.registerCommTarget(s,function(v,T){var E=new n(v);u.register_comm(E);try{return l(E,T)}catch(M){E.close(),console.error(M),console.error(new Error("Exception opening new comm"))}});this.targets[s]=h},o.prototype.unregister_target=function(s,l){var u=this.targets[s];u.dispose(),delete this.targets[s]},o.prototype.register_comm=function(s){return this.comms[s.comm_id]=Promise.resolve(s),s.kernel=this.kernel,s.comm_id},o}();r.CommManager=i;var n=function(){function o(s){this.jsServicesComm=null,this.kernel=null,this.jsServicesComm=s}return Object.defineProperty(o.prototype,"comm_id",{get:function(){return this.jsServicesComm.commId},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"target_name",{get:function(){return this.jsServicesComm.targetName},enumerable:!0,configurable:!0}),o.prototype.open=function(s,l,u,h){var v=this.jsServicesComm.open(s,u,h);return this._hookupCallbacks(v,l),v.msg.header.msg_id},o.prototype.send=function(s,l,u,h){var v=this.jsServicesComm.send(s,u,h);return this._hookupCallbacks(v,l),v.msg.header.msg_id},o.prototype.close=function(s,l,u,h){var v=this.jsServicesComm.close(s,u,h);return this._hookupCallbacks(v,l),v.msg.header.msg_id},o.prototype.on_msg=function(s){this.jsServicesComm.onMsg=s.bind(this)},o.prototype.on_close=function(s){this.jsServicesComm.onClose=s.bind(this)},o.prototype._hookupCallbacks=function(s,l){l&&(s.onReply=function(u){l.shell&&l.shell.reply&&l.shell.reply(u)},s.onStdin=function(u){l.input&&l.input(u)},s.onIOPub=function(u){if(l.iopub){if(l.iopub.status&&u.header.msg_type==="status")l.iopub.status(u);else if(l.iopub.clear_output&&u.header.msg_type==="clear_output")l.iopub.clear_output(u);else if(l.iopub.output)switch(u.header.msg_type){case"display_data":case"execute_result":case"stream":case"error":l.iopub.output(u);break;default:break}}})},o}();r.Comm=n})(e=t.services||(t.services={}))})(pk||(pk={}));var sIe=function(){function t(e,r,i){this.initialize(e,r,i)}return t.prototype.initialize=function(e,r,i){this._handler_context=i||this,this._models=[],this.views=[],this._create_view=e,this._remove_view=r||function(n){n.remove()}},t.prototype.update=function(e,r,i,n){var o=i||this._remove_view,s=r||this._create_view;n=n||this._handler_context;for(var l=0;l<e.length&&!(l>=this._models.length||e[l]!==this._models[l]);l++);for(var u=l,h=this.views.splice(u,this.views.length-u),v=0;v<h.length;v++)h[v].then(function(T){o.call(n,T)});for(;l<e.length;l++)this.views.push(Promise.resolve(s.call(n,e[l],l)));return this._models=e.slice(),Promise.all(this.views)},t.prototype.remove=function(){var e=this;return Promise.all(this.views).then(function(r){r.forEach(function(i){return e._remove_view.call(e._handler_context,i)}),e.views=[],e._models=[]})},t.prototype.dispose=function(){this.views=null,this._models=null},t}();var Xee=ga(gy()),aIe=new Xee.Token("jupyter.extensions.jupyterWidgetRegistry");function lIe(t){switch(t){case"int8":return Int8Array;case"uint8":return Uint8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"float32":return Float32Array;case"float64":return Float64Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`Unrecognized dtype ${t}`)}}function Yee(t,e){if(!t)return null;for(let r in t){let i=t[r].attributes;for(let n in i){let{dtype:o,value:s}=i[n],l=lIe(o);i[n].value=new l(s.buffer)}}return t}var RA=null,dk=qw&&fk;if(dk){class t extends dk{defaults(){return{...super.defaults(),_model_name:RA.model_name,_model_module:RA.model_module,_model_module_version:RA.model_module_version,_view_name:RA.view_name,_view_module:RA.view_module,_view_module_version:RA.view_module_version,custom_libraries:[],json_input:null,mapbox_key:null,selected_data:[],data_buffer:null,tooltip:null,width:"100%",height:500,js_warning:!1}}static get serializers(){return{...dk.serializers,data_buffer:{deserialize:Yee}}}static get model_name(){return"JupyterTransportModel"}static get model_module(){return Uv}static get model_module_version(){return kv}static get view_name(){return"JupyterTransportView"}static get view_module(){return Uv}static get view_module_version(){return kv}}RA=t}var Kee=RA;var Jee=null,Zee=qw&&hk;if(Zee){class t extends Zee{initialize(){this.listenTo(this.model,"destroy",this.remove),this.transport=new wg,this.transport.jupyterModel=this.model,this.transport.jupyterView=this,this.transport._initialize(),super.initialize.apply(this,arguments)}remove(){this.transport&&(this.transport._finalize(),this.transport.jupyterModel=null,this.transport.jupyterView=null,this.transport=null)}render(){super.render(),this.model.on("change:json_input",this.onJsonChanged.bind(this)),this.model.on("change:data_buffer",this.onDataBufferChanged.bind(this)),this.onDataBufferChanged()}onJsonChanged(){let r=JSON.parse(this.model.get("json_input"));this.transport._messageReceived({type:"json",json:r})}onDataBufferChanged(){let r=this.model.get("json_input"),i=this.model.get("data_buffer");r&&i?this.transport._messageReceived({type:"json-with-binary",json:r,binary:i}):this.transport._messageReceived({type:"json",json:r})}}Jee=t}var Qee=Jee;var Ak={};As(Ak,{Buffer:()=>Xi,BufferTransform:()=>zu,CubeGeometry:()=>xp,Device:()=>Yc,Framebuffer:()=>_h,Geometry:()=>Mn,GroupNode:()=>Qc,Model:()=>Ni,ModelNode:()=>Ih,ScenegraphNode:()=>Vu,SphereGeometry:()=>Qx,Texture:()=>bo,TextureTransform:()=>Mh,attachDevice:()=>dIe,createDevice:()=>AIe,enforceWebGL2:()=>mIe,getAvailableDevices:()=>fIe,getSupportedDevices:()=>hIe,registerDevices:()=>uIe,setDefaultDeviceProps:()=>pIe,stats:()=>cIe});var{stats:cIe,registerDevices:uIe,getAvailableDevices:fIe,getSupportedDevices:hIe,setDefaultDeviceProps:pIe,attachDevice:dIe,createDevice:AIe,enforceWebGL2:mIe}=Ll;var mk={};As(mk,{fetchFile:()=>B0,load:()=>_a,parse:()=>xd,registerLoaders:()=>tm});var $ee=document.body&&document.body.getAttribute("data-base-url");$ee&&(window.__webpack_public_path__=`${$ee}nbextensions/pydeck/nb_extension`);SM();globalThis.deck=globalThis.deck||{};Object.assign(globalThis.deck,Kb);globalThis.luma=globalThis.luma||{};Object.assign(globalThis.luma,Ak);globalThis.loaders=globalThis.loaders||{};Object.assign(globalThis.loaders,mk);return R6(gIe);})();
3696
3696
  return __exports__;